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: Julius Werner <jwerner@chromium.org>
diff --git a/include/lib/bakery_lock.h b/include/lib/bakery_lock.h
index a2f540c..1fece01 100644
--- a/include/lib/bakery_lock.h
+++ b/include/lib/bakery_lock.h
@@ -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 @@
 #define DECLARE_BAKERY_LOCK(_name) extern bakery_lock_t _name
 
 
-#endif /* __ASSEMBLY__ */
+#endif /* __ASSEMBLER__ */
 #endif /* BAKERY_LOCK_H */
diff --git a/include/lib/cpus/aarch32/cortex_a9.h b/include/lib/cpus/aarch32/cortex_a9.h
index 1fb0a92..a8c978a 100644
--- a/include/lib/cpus/aarch32/cortex_a9.h
+++ b/include/lib/cpus/aarch32/cortex_a9.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
diff --git a/include/lib/cpus/aarch64/cortex_a75.h b/include/lib/cpus/aarch64/cortex_a75.h
index 204bfdd..e5ca1ba 100644
--- a/include/lib/cpus/aarch64/cortex_a75.h
+++ b/include/lib/cpus/aarch64/cortex_a75.h
@@ -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_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 */
diff --git a/include/lib/cpus/aarch64/cpuamu.h b/include/lib/cpus/aarch64/cpuamu.h
index 921abdb..463f890 100644
--- a/include/lib/cpus/aarch64/cpuamu.h
+++ b/include/lib/cpus/aarch64/cpuamu.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 @@
 void cpuamu_context_save(unsigned int nr_counters);
 void cpuamu_context_restore(unsigned int nr_counters);
 
-#endif /* __ASSEMBLY__ */
+#endif /* __ASSEMBLER__ */
 
 #endif /* CPUAMU_H */
diff --git a/include/lib/cpus/aarch64/denver.h b/include/lib/cpus/aarch64/denver.h
index 81c076a..02657a0 100644
--- a/include/lib/cpus/aarch64/denver.h
+++ b/include/lib/cpus/aarch64/denver.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 */
diff --git a/include/lib/cpus/errata_report.h b/include/lib/cpus/errata_report.h
index 17b2c30..7cac77e 100644
--- a/include/lib/cpus/errata_report.h
+++ b/include/lib/cpus/errata_report.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 @@
 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
diff --git a/include/lib/el3_runtime/aarch32/context.h b/include/lib/el3_runtime/aarch32/context.h
index 86ff53a..c5567c9 100644
--- a/include/lib/el3_runtime/aarch32/context.h
+++ b/include/lib/el3_runtime/aarch32/context.h
@@ -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 @@
 CASSERT(CTX_REGS_OFFSET == __builtin_offsetof(cpu_context_t, regs_ctx), \
 	assert_core_context_regs_offset_mismatch);
 
-#endif /* __ASSEMBLY__ */
+#endif /* __ASSEMBLER__ */
 
 #endif /* CONTEXT_H */
diff --git a/include/lib/el3_runtime/aarch64/context.h b/include/lib/el3_runtime/aarch64/context.h
index 5bd0de4..a76a59b 100644
--- a/include/lib/el3_runtime/aarch64/context.h
+++ b/include/lib/el3_runtime/aarch64/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_restore(fp_regs_t *regs);
 #endif
 
-#endif /* __ASSEMBLY__ */
+#endif /* __ASSEMBLER__ */
 
 #endif /* CONTEXT_H */
diff --git a/include/lib/el3_runtime/cpu_data.h b/include/lib/el3_runtime/cpu_data.h
index 9e1d7f1..66c47ab 100644
--- a/include/lib/el3_runtime/cpu_data.h
+++ b/include/lib/el3_runtime/cpu_data.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 @@
 						sizeof(((cpu_data_t *)0)->_m))
 
 
-#endif /* __ASSEMBLY__ */
+#endif /* __ASSEMBLER__ */
 #endif /* CPU_DATA_H */
diff --git a/include/lib/extensions/ras.h b/include/lib/extensions/ras.h
index 98daab6..4fc8f04 100644
--- a/include/lib/extensions/ras.h
+++ b/include/lib/extensions/ras.h
@@ -68,7 +68,7 @@
 		.num_intrs = ARRAY_SIZE(_array), \
 	}
 
-#ifndef __ASSEMBLY__
+#ifndef __ASSEMBLER__
 
 #include <assert.h>
 
@@ -196,6 +196,6 @@
 		void *handle, uint64_t flags);
 void ras_init(void);
 
-#endif /* __ASSEMBLY__ */
+#endif /* __ASSEMBLER__ */
 
 #endif /* RAS_H */
diff --git a/include/lib/extensions/ras_arch.h b/include/lib/extensions/ras_arch.h
index e9375a3..0c98c4a 100644
--- a/include/lib/extensions/ras_arch.h
+++ b/include/lib/extensions/ras_arch.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 @@
 /* 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 */
diff --git a/include/lib/libc/aarch64/setjmp_.h b/include/lib/libc/aarch64/setjmp_.h
index 174b3eb..f880a17 100644
--- a/include/lib/libc/aarch64/setjmp_.h
+++ b/include/lib/libc/aarch64/setjmp_.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 */
diff --git a/include/lib/libc/setjmp.h b/include/lib/libc/setjmp.h
index 5661201..be8e2c0 100644
--- a/include/lib/libc/setjmp.h
+++ b/include/lib/libc/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 */
diff --git a/include/lib/libfdt/fdt.h b/include/lib/libfdt/fdt.h
index 74961f9..ef7c86b 100644
--- a/include/lib/libfdt/fdt.h
+++ b/include/lib/libfdt/fdt.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 @@
 	char data[0];
 };
 
-#endif /* !__ASSEMBLY */
+#endif /* !__ASSEMBLER__ */
 
 #define FDT_MAGIC	0xd00dfeed	/* 4: version, 4: total size */
 #define FDT_TAGSIZE	sizeof(fdt32_t)
diff --git a/include/lib/psci/psci.h b/include/lib/psci/psci.h
index fe279d4..04e5e3d 100644
--- a/include/lib/psci/psci.h
+++ b/include/lib/psci/psci.h
@@ -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 @@
 void __dead2 psci_power_down_wfi(void);
 void psci_arch_setup(void);
 
-#endif /*__ASSEMBLY__*/
+#endif /*__ASSEMBLER__*/
 
 #endif /* PSCI_H */
diff --git a/include/lib/psci/psci_lib.h b/include/lib/psci/psci_lib.h
index 53d7711..76c1a8d 100644
--- a/include/lib/psci/psci_lib.h
+++ b/include/lib/psci/psci_lib.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_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 */
diff --git a/include/lib/runtime_instr.h b/include/lib/runtime_instr.h
index f5a3f13..303f27e 100644
--- a/include/lib/runtime_instr.h
+++ b/include/lib/runtime_instr.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 */
diff --git a/include/lib/smccc.h b/include/lib/smccc.h
index 94c39d2..76e6023 100644
--- a/include/lib/smccc.h
+++ b/include/lib/smccc.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 @@
 		smc_uuid_word((_uuid).node[2], (_uuid).node[3],			\
 			      (_uuid).node[4], (_uuid).node[5]))
 
-#endif /*__ASSEMBLY__*/
+#endif /*__ASSEMBLER__*/
 #endif /* SMCCC_H */
diff --git a/include/lib/spinlock.h b/include/lib/spinlock.h
index fcd36e8..0bf3ee0 100644
--- a/include/lib/spinlock.h
+++ b/include/lib/spinlock.h
@@ -7,7 +7,7 @@
 #ifndef SPINLOCK_H
 #define SPINLOCK_H
 
-#ifndef __ASSEMBLY__
+#ifndef __ASSEMBLER__
 
 #include <stdint.h>
 
diff --git a/include/lib/utils.h b/include/lib/utils.h
index 6748454..cdb125c 100644
--- a/include/lib/utils.h
+++ b/include/lib/utils.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 @@
 /* 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 */
diff --git a/include/lib/utils_def.h b/include/lib/utils_def.h
index 41f71e8..7098bac 100644
--- a/include/lib/utils_def.h
+++ b/include/lib/utils_def.h
@@ -32,7 +32,7 @@
  * position @h. For example
  * GENMASK_64(39, 21) gives us the 64bit vector 0x000000ffffe00000.
  */
-#if defined(__LINKER__) || defined(__ASSEMBLY__)
+#if defined(__LINKER__) || defined(__ASSEMBLER__)
 #define GENMASK_32(h, l) \
 	(((0xFFFFFFFF) << (l)) & (0xFFFFFFFF >> (32 - 1 - (h))))
 
diff --git a/include/lib/xlat_tables/xlat_mmu_helpers.h b/include/lib/xlat_tables/xlat_mmu_helpers.h
index 85effca..efe0dd5 100644
--- a/include/lib/xlat_tables/xlat_mmu_helpers.h
+++ b/include/lib/xlat_tables/xlat_mmu_helpers.h
@@ -50,7 +50,7 @@
 #define MMU_CFG_TTBR0		2
 #define MMU_CFG_PARAM_MAX	3
 
-#ifndef __ASSEMBLY__
+#ifndef __ASSEMBLER__
 
 #include <stdbool.h>
 #include <stdint.h>
@@ -86,6 +86,6 @@
 bool xlat_arch_is_granule_size_supported(size_t size);
 size_t xlat_arch_get_max_supported_granule_size(void);
 
-#endif /* __ASSEMBLY__ */
+#endif /* __ASSEMBLER__ */
 
 #endif /* XLAT_MMU_HELPERS_H */
diff --git a/include/lib/xlat_tables/xlat_tables.h b/include/lib/xlat_tables/xlat_tables.h
index 9e2543f..082bb5e 100644
--- a/include/lib/xlat_tables/xlat_tables.h
+++ b/include/lib/xlat_tables/xlat_tables.h
@@ -9,7 +9,7 @@
 
 #include <lib/xlat_tables/xlat_tables_defs.h>
 
-#ifndef __ASSEMBLY__
+#ifndef __ASSEMBLER__
 #include <stddef.h>
 #include <stdint.h>
 
@@ -88,5 +88,5 @@
 		     size_t size, unsigned int attr);
 void mmap_add(const mmap_region_t *mm);
 
-#endif /*__ASSEMBLY__*/
+#endif /*__ASSEMBLER__*/
 #endif /* XLAT_TABLES_H */
diff --git a/include/lib/xlat_tables/xlat_tables_v2.h b/include/lib/xlat_tables/xlat_tables_v2.h
index 5551426..0e09998 100644
--- a/include/lib/xlat_tables/xlat_tables_v2.h
+++ b/include/lib/xlat_tables/xlat_tables_v2.h
@@ -10,7 +10,7 @@
 #include <lib/xlat_tables/xlat_tables_defs.h>
 #include <lib/xlat_tables/xlat_tables_v2_helpers.h>
 
-#ifndef __ASSEMBLY__
+#ifndef __ASSEMBLER__
 #include <stddef.h>
 #include <stdint.h>
 
@@ -364,5 +364,5 @@
 				uint32_t *attr);
 int xlat_get_mem_attributes(uintptr_t base_va, uint32_t *attr);
 
-#endif /*__ASSEMBLY__*/
+#endif /*__ASSEMBLER__*/
 #endif /* XLAT_TABLES_V2_H */
diff --git a/include/lib/xlat_tables/xlat_tables_v2_helpers.h b/include/lib/xlat_tables/xlat_tables_v2_helpers.h
index 6a1be32..b17b71a 100644
--- a/include/lib/xlat_tables/xlat_tables_v2_helpers.h
+++ b/include/lib/xlat_tables/xlat_tables_v2_helpers.h
@@ -16,7 +16,7 @@
 #error "Do not include this header file directly. Include xlat_tables_v2.h instead."
 #endif
 
-#ifndef __ASSEMBLY__
+#ifndef __ASSEMBLER__
 
 #include <stdbool.h>
 #include <stddef.h>
@@ -160,6 +160,6 @@
 		.initialized = false,					\
 	}
 
-#endif /*__ASSEMBLY__*/
+#endif /*__ASSEMBLER__*/
 
 #endif /* XLAT_TABLES_V2_HELPERS_H */