Commit d5dfdeb6 authored by Julius Werner's avatar Julius Werner
Browse files

Replace __ASSEMBLY__ with compiler-builtin __ASSEMBLER__



NOTE: __ASSEMBLY__ macro is now deprecated in favor of __ASSEMBLER__.

All common C compilers predefine a macro called __ASSEMBLER__ when
preprocessing a .S file. There is no reason for TF-A to define it's own
__ASSEMBLY__ macro for this purpose instead. To unify code with the
export headers (which use __ASSEMBLER__ to avoid one extra dependency),
let's deprecate __ASSEMBLY__ and switch the code base over to the
predefined standard.

Change-Id: Id7d0ec8cf330195da80499c68562b65cb5ab7417
Signed-off-by: default avatarJulius Werner <jwerner@chromium.org>
parent f61469e5
......@@ -11,7 +11,7 @@
#define BAKERY_LOCK_MAX_CPUS PLATFORM_CORE_COUNT
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
#include <cdefs.h>
#include <stdbool.h>
#include <stdint.h>
......@@ -101,5 +101,5 @@ void bakery_lock_release(bakery_lock_t *bakery);
#define DECLARE_BAKERY_LOCK(_name) extern bakery_lock_t _name
#endif /* __ASSEMBLY__ */
#endif /* __ASSEMBLER__ */
#endif /* BAKERY_LOCK_H */
......@@ -25,7 +25,7 @@
******************************************************************************/
#define PCR p15, 0, c15, c0, 0
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
#include <arch_helpers.h>
DEFINE_COPROCR_RW_FUNCS(pcr, PCR)
#endif
......
......@@ -41,7 +41,7 @@
#define CORTEX_A75_AMU_GROUP0_MASK U(0x7)
#define CORTEX_A75_AMU_GROUP1_MASK (U(0) << 3)
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
#include <stdint.h>
uint64_t cortex_a75_amu_cnt_read(int idx);
......@@ -50,6 +50,6 @@ unsigned int cortex_a75_amu_read_cpuamcntenset_el0(void);
unsigned int cortex_a75_amu_read_cpuamcntenclr_el0(void);
void cortex_a75_amu_write_cpuamcntenset_el0(unsigned int mask);
void cortex_a75_amu_write_cpuamcntenclr_el0(unsigned int mask);
#endif /* __ASSEMBLY__ */
#endif /* __ASSEMBLER__ */
#endif /* CORTEX_A75_H */
......@@ -29,7 +29,7 @@
#define CPUAMEVTYPER3_EL0 S3_3_C15_C10_3
#define CPUAMEVTYPER4_EL0 S3_3_C15_C10_4
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
#include <stdint.h>
uint64_t cpuamu_cnt_read(unsigned int idx);
......@@ -43,6 +43,6 @@ int midr_match(unsigned int cpu_midr);
void cpuamu_context_save(unsigned int nr_counters);
void cpuamu_context_restore(unsigned int nr_counters);
#endif /* __ASSEMBLY__ */
#endif /* __ASSEMBLER__ */
#endif /* CPUAMU_H */
......@@ -34,11 +34,11 @@
#define DENVER_CPU_PMSTATE_C7 U(0x7)
#define DENVER_CPU_PMSTATE_MASK U(0xF)
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
/* Disable Dynamic Code Optimisation */
void denver_disable_dco(void);
#endif /* __ASSEMBLY__ */
#endif /* __ASSEMBLER__ */
#endif /* DENVER_H */
......@@ -7,7 +7,7 @@
#ifndef ERRATA_REPORT_H
#define ERRATA_REPORT_H
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
#include <arch.h>
#include <arch_helpers.h>
......@@ -23,7 +23,7 @@ static inline void print_errata_status(void) {}
void errata_print_msg(unsigned int status, const char *cpu, const char *id);
int errata_needs_reporting(spinlock_t *lock, uint32_t *reported);
#endif /* __ASSEMBLY__ */
#endif /* __ASSEMBLER__ */
/* Errata status */
#define ERRATA_NOT_APPLIES 0
......
......@@ -24,7 +24,7 @@
#define CTX_NS_SCTLR U(0x1C)
#define CTX_REGS_END U(0x20)
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
#include <stdint.h>
......@@ -65,6 +65,6 @@ typedef struct cpu_context {
CASSERT(CTX_REGS_OFFSET == __builtin_offsetof(cpu_context_t, regs_ctx), \
assert_core_context_regs_offset_mismatch);
#endif /* __ASSEMBLY__ */
#endif /* __ASSEMBLER__ */
#endif /* CONTEXT_H */
......@@ -207,7 +207,7 @@
#define CTX_PAUTH_REGS_END U(0)
#endif /* CTX_INCLUDE_PAUTH_REGS */
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
#include <stdint.h>
......@@ -384,6 +384,6 @@ void fpregs_context_save(fp_regs_t *regs);
void fpregs_context_restore(fp_regs_t *regs);
#endif
#endif /* __ASSEMBLY__ */
#endif /* __ASSEMBLER__ */
#endif /* CONTEXT_H */
......@@ -49,7 +49,7 @@
#define CPU_DATA_PMF_TS0_IDX 0
#endif
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
#include <arch_helpers.h>
#include <lib/cassert.h>
......@@ -161,5 +161,5 @@ void init_cpu_ops(void);
sizeof(((cpu_data_t *)0)->_m))
#endif /* __ASSEMBLY__ */
#endif /* __ASSEMBLER__ */
#endif /* CPU_DATA_H */
......@@ -68,7 +68,7 @@
.num_intrs = ARRAY_SIZE(_array), \
}
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
#include <assert.h>
......@@ -196,6 +196,6 @@ int ras_ea_handler(unsigned int ea_reason, uint64_t syndrome, void *cookie,
void *handle, uint64_t flags);
void ras_init(void);
#endif /* __ASSEMBLY__ */
#endif /* __ASSEMBLER__ */
#endif /* RAS_H */
......@@ -178,7 +178,7 @@
/* I/DFSC code for synchronous external abort */
#define SYNC_EA_FSC 0x10
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
#include <arch.h>
#include <arch_helpers.h>
......@@ -256,6 +256,6 @@ static inline void ser_sys_select_record(unsigned int idx)
/* Library functions to probe Standard Error Record */
int ser_probe_memmap(uintptr_t base, unsigned int size_num_k, int *probe_data);
int ser_probe_sysreg(unsigned int idx_start, unsigned int num_idx, int *probe_data);
#endif /* __ASSEMBLY__ */
#endif /* __ASSEMBLER__ */
#endif /* RAS_ARCH_H */
......@@ -18,13 +18,13 @@
#define JMP_SIZE (JMP_CTX_END >> 3)
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
#include <cdefs.h>
/* Jump buffer hosting x18 - x30 and sp_el0 registers */
typedef uint64_t jmp_buf[JMP_SIZE] __aligned(16);
#endif /* __ASSEMBLY__ */
#endif /* __ASSEMBLER__ */
#endif /* SETJMP__H */
......@@ -9,12 +9,12 @@
#include <setjmp_.h>
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
#include <cdefs.h>
int setjmp(jmp_buf env);
__dead2 void longjmp(jmp_buf env, int val);
#endif /* __ASSEMBLY__ */
#endif /* __ASSEMBLER__ */
#endif /* SETJMP_H */
......@@ -52,7 +52,7 @@
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
struct fdt_header {
fdt32_t magic; /* magic word FDT_MAGIC */
......@@ -90,7 +90,7 @@ struct fdt_property {
char data[0];
};
#endif /* !__ASSEMBLY */
#endif /* !__ASSEMBLER__ */
#define FDT_MAGIC 0xd00dfeed /* 4: version, 4: total size */
#define FDT_TAGSIZE sizeof(fdt32_t)
......
......@@ -166,7 +166,7 @@
#define PSCI_RESET2_TYPE_ARCH (U(0) << PSCI_RESET2_TYPE_VENDOR_SHIFT)
#define PSCI_RESET2_SYSTEM_WARM_RESET (PSCI_RESET2_TYPE_ARCH | U(0))
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
#include <stdint.h>
......@@ -348,6 +348,6 @@ int psci_features(unsigned int psci_fid);
void __dead2 psci_power_down_wfi(void);
void psci_arch_setup(void);
#endif /*__ASSEMBLY__*/
#endif /*__ASSEMBLER__*/
#endif /* PSCI_H */
......@@ -9,7 +9,7 @@
#include <common/ep_info.h>
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
#include <cdefs.h>
#include <stdint.h>
......@@ -89,6 +89,6 @@ void psci_warmboot_entrypoint(void);
void psci_register_spd_pm_hook(const spd_pm_ops_t *pm);
void psci_prepare_next_non_secure_ctx(
entry_point_info_t *next_image_info);
#endif /* __ASSEMBLY__ */
#endif /* __ASSEMBLER__ */
#endif /* PSCI_LIB_H */
......@@ -17,9 +17,9 @@
#define RT_INSTR_EXIT_CFLUSH U(5)
#define RT_INSTR_TOTAL_IDS U(6)
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
PMF_DECLARE_CAPTURE_TIMESTAMP(rt_instr_svc)
PMF_DECLARE_GET_TIMESTAMP(rt_instr_svc)
#endif /* __ASSEMBLY__ */
#endif /* __ASSEMBLER__ */
#endif /* RUNTIME_INSTR_H */
......@@ -87,7 +87,7 @@
#define SMC_FROM_SECURE (U(0) << 0)
#define SMC_FROM_NON_SECURE (U(1) << 0)
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
#include <stdint.h>
......@@ -155,5 +155,5 @@ static inline uint32_t smc_uuid_word(uint8_t b0, uint8_t b1, uint8_t b2, uint8_t
smc_uuid_word((_uuid).node[2], (_uuid).node[3], \
(_uuid).node[4], (_uuid).node[5]))
#endif /*__ASSEMBLY__*/
#endif /*__ASSEMBLER__*/
#endif /* SMCCC_H */
......@@ -7,7 +7,7 @@
#ifndef SPINLOCK_H
#define SPINLOCK_H
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
#include <stdint.h>
......
......@@ -11,7 +11,7 @@
* C code should be put in this part of the header to avoid breaking ASM files
* or linker scripts including it.
*/
#if !(defined(__LINKER__) || defined(__ASSEMBLY__))
#if !(defined(__LINKER__) || defined(__ASSEMBLER__))
#include <stddef.h>
#include <stdint.h>
......@@ -91,6 +91,6 @@ static inline u_register_t load_addr_## _name(void) \
/* Helper to invoke the function defined by DEFINE_LOAD_SYM_ADDR() */
#define LOAD_ADDR_OF(_name) (typeof(_name) *) load_addr_## _name()
#endif /* !(defined(__LINKER__) || defined(__ASSEMBLY__)) */
#endif /* !(defined(__LINKER__) || defined(__ASSEMBLER__)) */
#endif /* UTILS_H */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment