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
......@@ -273,8 +273,7 @@ endif
CPPFLAGS = ${DEFINES} ${INCLUDES} ${MBEDTLS_INC} -nostdinc \
-Wmissing-include-dirs $(ERRORS) $(WARNINGS)
ASFLAGS += $(CPPFLAGS) $(ASFLAGS_$(ARCH)) \
-D__ASSEMBLY__ -ffreestanding \
-Wa,--fatal-warnings
-ffreestanding -Wa,--fatal-warnings
TF_CFLAGS += $(CPPFLAGS) $(TF_CFLAGS_$(ARCH)) \
-ffreestanding -fno-builtin -Wall -std=gnu99 \
-Os -ffunction-sections -fdata-sections
......@@ -763,14 +762,16 @@ all: msg_start
msg_start:
@echo "Building ${PLAT}"
# Check if deprecated declarations and cpp warnings should be treated as error or not.
ifeq (${ERROR_DEPRECATED},0)
# Check if deprecated declarations and cpp warnings should be treated as error or not.
ifneq ($(findstring clang,$(notdir $(CC))),)
CPPFLAGS += -Wno-error=deprecated-declarations
else
CPPFLAGS += -Wno-error=deprecated-declarations -Wno-error=cpp
endif
endif
# __ASSEMBLY__ is deprecated in favor of the compiler-builtin __ASSEMBLER__.
ASFLAGS += -D__ASSEMBLY__
endif # !ERROR_DEPRECATED
$(eval $(call MAKE_LIB_DIRS))
$(eval $(call MAKE_LIB,c))
......
......@@ -20,7 +20,7 @@
#define TSP_ARGS_END 0x40
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
#include <stdint.h>
......@@ -148,6 +148,6 @@ tsp_args_t *tsp_system_off_main(uint64_t arg0,
uint64_t arg7);
uint64_t tsp_main(void);
#endif /* __ASSEMBLY__ */
#endif /* __ASSEMBLER__ */
#endif /* TSP_PRIVATE_H */
......@@ -58,7 +58,7 @@
#define SDS_REGION_REGIONSIZE_OFFSET 0x4
#define SDS_REGION_DESC_SIZE 0x8
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
#include <stddef.h>
#include <stdint.h>
......@@ -95,6 +95,6 @@ typedef struct region_descriptor {
& SDS_REGION_SCH_VERSION_MASK)
#define GET_SDS_REGION_SIZE(region) ((((region_desc_t *)(region))->reg[1]))
#endif /* __ASSEMBLY__ */
#endif /* __ASSEMBLER__ */
#endif /* SDS_PRIVATE_H */
......@@ -152,7 +152,7 @@
#define IMX_UART_TS_RXFULL BIT(3)
#define IMX_UART_TS_SOFTRST BIT(0)
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
typedef struct {
console_t console;
......@@ -163,6 +163,6 @@ int console_imx_uart_register(uintptr_t baseaddr,
uint32_t clock,
uint32_t baud,
console_imx_uart_t *console);
#endif /*__ASSEMBLY__*/
#endif /*__ASSEMBLER__*/
#endif /* IMX_UART_H */
......@@ -7,7 +7,7 @@
#ifndef MICRO_DELAY_H
#define MICRO_DELAY_H
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
#include <stdint.h>
void rcar_micro_delay(uint64_t micro_sec);
#endif
......
......@@ -148,7 +148,7 @@ RCAR_INSTANTIATE_LOCK
#define IS_CA57(c) ((c) == RCAR_CLUSTER_CA57)
#define IS_CA53(c) ((c) == RCAR_CLUSTER_CA53)
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
IMPORT_SYM(unsigned long, __system_ram_start__, SYSTEM_RAM_START);
IMPORT_SYM(unsigned long, __system_ram_end__, SYSTEM_RAM_END);
IMPORT_SYM(unsigned long, __SRAM_COPY_START__, SRAM_COPY_START);
......
......@@ -38,7 +38,7 @@
#define RCAR_CLUSTER_CA53 (1U)
#define RCAR_CLUSTER_CA57 (2U)
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
void rcar_pwrc_disable_interrupt_wakeup(uint64_t mpidr);
void rcar_pwrc_enable_interrupt_wakeup(uint64_t mpidr);
void rcar_pwrc_clusteroff(uint64_t mpidr);
......
......@@ -24,7 +24,7 @@
#define SMC_CTX_PMCR U(0x88)
#define SMC_CTX_SIZE U(0x90)
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
#include <stdint.h>
......@@ -156,6 +156,6 @@ void smc_set_next_ctx(unsigned int security_state);
/* Get the pointer to next `smc_ctx_t` already set by `smc_set_next_ctx()`. */
void *smc_get_next_ctx(void);
#endif /*__ASSEMBLY__*/
#endif /*__ASSEMBLER__*/
#endif /* SMCCC_HELPERS_H */
......@@ -9,7 +9,7 @@
#include <lib/smccc.h>
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
#include <stdbool.h>
......@@ -82,6 +82,6 @@
_x4 = read_ctx_reg(regs, CTX_GPREG_X4); \
} while (false)
#endif /*__ASSEMBLY__*/
#endif /*__ASSEMBLER__*/
#endif /* SMCCC_HELPERS_H */
......@@ -61,7 +61,7 @@
#define is_fwu_fid(_fid) \
((_fid >= FWU_SMC_FID_START) && (_fid <= FWU_SMC_FID_END))
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
#include <lib/cassert.h>
......@@ -98,5 +98,5 @@ CASSERT(FWU_NUM_SMC_CALLS == \
void bl1_calc_bl2_mem_layout(const meminfo_t *bl1_mem_layout,
meminfo_t *bl2_mem_layout);
#endif /* __ASSEMBLY__ */
#endif /* __ASSEMBLER__ */
#endif /* BL1_H */
......@@ -7,7 +7,7 @@
#ifndef EHF_H
#define EHF_H
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
#include <cdefs.h>
#include <stdint.h>
......@@ -87,6 +87,6 @@ void ehf_register_priority_handler(unsigned int pri, ehf_handler_t handler);
void ehf_allow_ns_preemption(uint64_t preempt_ret_code);
unsigned int ehf_is_ns_preemption_allowed(void);
#endif /* __ASSEMBLY__ */
#endif /* __ASSEMBLER__ */
#endif /* EHF_H */
......@@ -79,7 +79,7 @@
#define get_interrupt_src_ss(flag) (((flag) >> INTR_SRC_SS_FLAG_SHIFT) & \
INTR_SRC_SS_FLAG_MASK)
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
#include <errno.h>
#include <stdint.h>
......@@ -143,5 +143,5 @@ interrupt_type_handler_t get_interrupt_type_handler(uint32_t type);
int disable_intr_rm_local(uint32_t type, uint32_t security_state);
int enable_intr_rm_local(uint32_t type, uint32_t security_state);
#endif /*__ASSEMBLY__*/
#endif /*__ASSEMBLER__*/
#endif /* INTERRUPT_MGMT_H */
......@@ -84,7 +84,7 @@
#define TOS_CALL_VERSION 0xbf00ff03 /* Trusted OS Call Version */
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
#include <stdint.h>
......@@ -106,6 +106,6 @@ typedef struct tsp_vectors {
void tsp_setup(void);
#endif /* __ASSEMBLY__ */
#endif /* __ASSEMBLER__ */
#endif /* TSP_H */
......@@ -11,11 +11,11 @@
#include <common/param_header.h>
#include <lib/utils_def.h>
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
#include <stddef.h>
#include <stdint.h>
#include <lib/cassert.h>
#endif /* __ASSEMBLY__ */
#endif /* __ASSEMBLER__ */
#include <export/common/bl_common_exp.h>
......@@ -91,7 +91,7 @@
#define __TEXT_END__ Load$$__TEXT_EPILOGUE__$$Base
#endif /* USE_ARM_LINK */
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
/*
* Declarations of linker defined symbols to help determine memory layout of
......@@ -178,6 +178,6 @@ void setup_page_tables(const struct mmap_region *bl_regions,
void bl_handle_pauth(void);
#endif /*__ASSEMBLY__*/
#endif /*__ASSEMBLER__*/
#endif /* BL_COMMON_H */
......@@ -27,7 +27,7 @@
#define LOG_LEVEL_INFO U(40)
#define LOG_LEVEL_VERBOSE U(50)
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
#include <cdefs.h>
#include <stdarg.h>
......@@ -110,5 +110,5 @@ void __dead2 __stack_chk_fail(void);
void tf_log(const char *fmt, ...) __printflike(1, 2);
void tf_log_set_max_level(unsigned int log_level);
#endif /* __ASSEMBLY__ */
#endif /* __ASSEMBLER__ */
#endif /* DEBUG_H */
......@@ -9,10 +9,10 @@
#include <common/param_header.h>
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
#include <stdint.h>
#include <lib/cassert.h>
#endif /* __ASSEMBLY__ */
#endif /* __ASSEMBLER__ */
#include <export/common/ep_info_exp.h>
......@@ -30,7 +30,7 @@
#define SET_SECURITY_STATE(x, security) \
((x) = ((x) & ~EP_SECURITY_MASK) | (security))
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
/*
* Compile time assertions related to the 'entry_point_info' structure to
......@@ -56,6 +56,6 @@ CASSERT(sizeof(uintptr_t) ==
__builtin_offsetof(entry_point_info_t, pc), \
assert_entrypoint_and_spsr_should_be_adjacent);
#endif /*__ASSEMBLY__*/
#endif /*__ASSEMBLER__*/
#endif /* EP_INFO_H */
......@@ -7,7 +7,7 @@
#ifndef INTERRUPT_PROPS_H
#define INTERRUPT_PROPS_H
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
/* Create an interrupt property descriptor from various interrupt properties */
#define INTR_PROP_DESC(num, pri, grp, cfg) \
......@@ -25,5 +25,5 @@ typedef struct interrupt_prop {
unsigned int intr_cfg:2;
} interrupt_prop_t;
#endif /* __ASSEMBLY__ */
#endif /* __ASSEMBLER__ */
#endif /* INTERRUPT_PROPS_H */
......@@ -9,9 +9,9 @@
#include <stdbool.h>
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
#include <stdint.h>
#endif /*__ASSEMBLY__*/
#endif /*__ASSEMBLER__*/
#include <export/common/param_header_exp.h>
......
......@@ -39,7 +39,7 @@
*/
#define MAX_RT_SVCS U(128)
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
/* Prototype for runtime service initializing function */
typedef int32_t (*rt_svc_init_t)(void);
......@@ -134,5 +134,5 @@ void init_crash_reporting(void);
extern uint8_t rt_svc_descs_indices[MAX_RT_SVCS];
#endif /*__ASSEMBLY__*/
#endif /*__ASSEMBLER__*/
#endif /* RUNTIME_SVC_H */
......@@ -100,7 +100,7 @@
#define SLAVE_IF_UNUSED -1
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
#include <stdint.h>
......@@ -121,5 +121,5 @@ void cci_init(uintptr_t base, const int *map, unsigned int num_cci_masters);
void cci_enable_snoop_dvm_reqs(unsigned int master_id);
void cci_disable_snoop_dvm_reqs(unsigned int master_id);
#endif /* __ASSEMBLY__ */
#endif /* __ASSEMBLER__ */
#endif /* CCI_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