summaryrefslogtreecommitdiff
path: root/include/common
diff options
context:
space:
mode:
authorJeenu Viswambharan <jeenu.viswambharan@arm.com>2017-01-19 14:23:36 +0000
committerJeenu Viswambharan <jeenu.viswambharan@arm.com>2017-01-30 14:53:17 +0000
commitb38bc68b9edf385f2576a6cbf304187721f562c1 (patch)
tree6dbf8b264b50310372e289e99ee98c923d1c42de /include/common
parentd7aa7b44d6c73f84a8913b010e850e0322063d91 (diff)
Allow spin locks to be defined from assembly
At present, spin locks can only defined from C files. Add some macros such that they can be defined from assembly files too. Change-Id: I64f0c214062f5c15b3c8b412c7f25c908e87d970 Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
Diffstat (limited to 'include/common')
-rw-r--r--include/common/aarch32/asm_macros.S12
-rw-r--r--include/common/aarch64/asm_macros.S12
2 files changed, 22 insertions, 2 deletions
diff --git a/include/common/aarch32/asm_macros.S b/include/common/aarch32/asm_macros.S
index 23122f34..45023a0b 100644
--- a/include/common/aarch32/asm_macros.S
+++ b/include/common/aarch32/asm_macros.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2016-2017, ARM Limited and Contributors. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -32,6 +32,7 @@
#include <arch.h>
#include <asm_macros_common.S>
+#include <spinlock.h>
#define WORD_SIZE 4
@@ -124,4 +125,13 @@
#endif
.endm
+ /*
+ * Reserve space for a spin lock in assembly file.
+ */
+ .macro define_asm_spinlock _name:req
+ .align SPINLOCK_ASM_ALIGN
+ \_name:
+ .space SPINLOCK_ASM_SIZE
+ .endm
+
#endif /* __ASM_MACROS_S__ */
diff --git a/include/common/aarch64/asm_macros.S b/include/common/aarch64/asm_macros.S
index 88e8d9c6..b0f3a0db 100644
--- a/include/common/aarch64/asm_macros.S
+++ b/include/common/aarch64/asm_macros.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013-2016, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2013-2017, ARM Limited and Contributors. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -32,6 +32,7 @@
#include <arch.h>
#include <asm_macros_common.S>
+#include <spinlock.h>
.macro func_prologue
@@ -200,4 +201,13 @@
#endif
.endm
+ /*
+ * Reserve space for a spin lock in assembly file.
+ */
+ .macro define_asm_spinlock _name:req
+ .align SPINLOCK_ASM_ALIGN
+ \_name:
+ .space SPINLOCK_ASM_SIZE
+ .endm
+
#endif /* __ASM_MACROS_S__ */