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
......@@ -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))))
......
......@@ -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 @@ void enable_mmu_direct_el3(unsigned int flags);
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 */
......@@ -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 @@ void mmap_add_region(unsigned long long base_pa, uintptr_t base_va,
size_t size, unsigned int attr);
void mmap_add(const mmap_region_t *mm);
#endif /*__ASSEMBLY__*/
#endif /*__ASSEMBLER__*/
#endif /* XLAT_TABLES_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 @@ int xlat_get_mem_attributes_ctx(const xlat_ctx_t *ctx, uintptr_t base_va,
uint32_t *attr);
int xlat_get_mem_attributes(uintptr_t base_va, uint32_t *attr);
#endif /*__ASSEMBLY__*/
#endif /*__ASSEMBLER__*/
#endif /* XLAT_TABLES_V2_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 @@ struct xlat_ctx {
.initialized = false, \
}
#endif /*__ASSEMBLY__*/
#endif /*__ASSEMBLER__*/
#endif /* XLAT_TABLES_V2_HELPERS_H */
......@@ -29,7 +29,7 @@
#define BOARD_CSS_PLAT_TYPE_EMULATOR 0x02
#define BOARD_CSS_PLAT_TYPE_FVP 0x03
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
#include <lib/mmio.h>
......@@ -37,7 +37,7 @@
((mmio_read_32(addr) & BOARD_CSS_PLAT_ID_REG_ID_MASK) \
>> BOARD_CSS_PLAT_ID_REG_ID_SHIFT)
#endif /* __ASSEMBLY__ */
#endif /* __ASSEMBLER__ */
#define MAX_IO_DEVICES 3
......
......@@ -136,7 +136,7 @@
#define SPIDEN_INT_CLR_SHIFT 6
#define SPIDEN_SEL_SET_SHIFT 7
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
/* SSC_VERSION related accessors */
......@@ -150,7 +150,7 @@
(((val) >> SSC_VERSION_CONFIG_SHIFT) & \
SSC_VERSION_CONFIG_MASK)
#endif /* __ASSEMBLY__ */
#endif /* __ASSEMBLER__ */
/*************************************************************************
* Required platform porting definitions common to all
......
......@@ -63,7 +63,7 @@
#endif /* SPM_MM */
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
#include <stdint.h>
......@@ -85,6 +85,6 @@ uint64_t spm_sp_call(uint32_t smc_fid, uint64_t x1, uint64_t x2, uint64_t x3);
#endif /* SPM_MM */
#endif /* __ASSEMBLY__ */
#endif /* __ASSEMBLER__ */
#endif /* SPM_SVC_H */
......@@ -15,7 +15,7 @@ LIB_DIR = ../../$(BUILD_PLAT)/lib
WRAPPER_DIR = ../../$(BUILD_PLAT)/libwrapper
LIBS = -lmbedtls -lfdt -lc
INC = $(INCLUDES:-I%=-I../../%)
PPFLAGS = $(INC) $(DEFINES) -P -D__ASSEMBLY__ -D__LINKER__ -MD -MP -MT $(BUILD_DIR)/romlib.ld
PPFLAGS = $(INC) $(DEFINES) -P -x assembler-with-cpp -D__LINKER__ -MD -MP -MT $(BUILD_DIR)/romlib.ld
OBJS = $(BUILD_DIR)/jmptbl.o $(BUILD_DIR)/init.o
MAPFILE = ../../$(BUILD_PLAT)/romlib/romlib.map
......
......@@ -273,7 +273,7 @@ $(eval IMAGE := IMAGE_BL$(call uppercase,$(3)))
$(1): $(2) $(filter-out %.d,$(MAKEFILE_LIST)) | bl$(3)_dirs
$$(ECHO) " PP $$<"
$$(Q)$$(CPP) $$(CPPFLAGS) -P -D__ASSEMBLY__ -D__LINKER__ $(MAKE_DEP) -D$(IMAGE) -o $$@ $$<
$$(Q)$$(CPP) $$(CPPFLAGS) -P -x assembler-with-cpp -D__LINKER__ $(MAKE_DEP) -D$(IMAGE) -o $$@ $$<
-include $(DEP)
......
......@@ -187,7 +187,7 @@
/* Platform ID address */
#define SSC_VERSION (SSC_REG_BASE + SSC_VERSION_OFFSET)
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
/* SSC_VERSION related accessors */
/* Returns the part number of the platform */
#define GET_SGI_PART_NUM \
......@@ -195,7 +195,7 @@
/* Returns the configuration number of the platform */
#define GET_SGI_CONFIG_NUM \
GET_SSC_VERSION_CONFIG(mmio_read_32(SSC_VERSION))
#endif /* __ASSEMBLY__ */
#endif /* __ASSEMBLER__ */
/*******************************************************************************
* Memprotect definitions
......
......@@ -51,7 +51,7 @@
/* Platform ID address */
#define SSC_VERSION (SSC_REG_BASE + SSC_VERSION_OFFSET)
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
/* SSC_VERSION related accessors */
/* Returns the part number of the platform */
#define GET_PLAT_PART_NUM \
......@@ -59,7 +59,7 @@
/* Returns the configuration number of the platform */
#define GET_PLAT_CONFIG_NUM \
GET_SSC_VERSION_CONFIG(mmio_read_32(SSC_VERSION))
#endif /* __ASSEMBLY__ */
#endif /* __ASSEMBLER__ */
/*************************************************************************
......
......@@ -7,7 +7,7 @@
#ifndef HISI_PWRC_H
#define HISI_PWRC_H
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
void hisi_pwrc_set_cluster_wfi(unsigned int id);
void hisi_pwrc_set_core_bx_addr(unsigned int core,
......@@ -17,6 +17,6 @@ void hisi_pwrc_enable_debug(unsigned int core,
unsigned int cluster);
int hisi_pwrc_setup(void);
#endif /*__ASSEMBLY__*/
#endif /*__ASSEMBLER__*/
#endif /* HISI_PWRC_H */
......@@ -50,7 +50,7 @@
#define LPUART_BAUD_BOTHEDGE_MASK (0x20000U)
#define LPUART_BAUD_M10_MASK (0x20000000U)
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
#include <stdint.h>
......@@ -61,6 +61,6 @@ typedef struct {
int console_lpuart_register(uintptr_t baseaddr, uint32_t clock, uint32_t baud,
console_lpuart_t *console);
#endif /*__ASSEMBLY__*/
#endif /*__ASSEMBLER__*/
#endif /* IMX8_LPUART_H */
......@@ -9,7 +9,7 @@
#include <drivers/console.h>
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
typedef struct {
console_t console;
......@@ -18,6 +18,6 @@ typedef struct {
int console_imx_uart_register(uintptr_t baseaddr, uint32_t clock, uint32_t baud,
console_uart_t *console);
#endif /*__ASSEMBLY__*/
#endif /*__ASSEMBLER__*/
#endif /* IMX_UART_H */
......@@ -63,7 +63,7 @@
#define CONSOLE_T_16550_BASE CONSOLE_T_DRVDATA
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
#include <stdint.h>
......@@ -81,6 +81,6 @@ typedef struct {
int console_ls_16550_register(uintptr_t baseaddr, uint32_t clock, uint32_t baud,
console_ls_16550_t *console);
#endif /*__ASSEMBLY__*/
#endif /*__ASSEMBLER__*/
#endif /* LS_16550_H */
......@@ -8,9 +8,9 @@
#ifndef PLATFORM_DEF_H
#define PLATFORM_DEF_H
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
#include <stdio.h>
#endif /* __ASSEMBLY__ */
#endif /* __ASSEMBLER__ */
#include <board_marvell_def.h>
#include <mvebu_def.h>
......
......@@ -8,9 +8,9 @@
#ifndef PLATFORM_DEF_H
#define PLATFORM_DEF_H
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
#include <stdio.h>
#endif /* __ASSEMBLY__ */
#endif /* __ASSEMBLER__ */
#include <common/interrupt_props.h>
#include <drivers/arm/gic_common.h>
......
......@@ -85,7 +85,7 @@
#define CCI_CLK_CTRL (MCUCFG_BASE + 0x660)
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
#include <plat/common/common_def.h>
#include <stdint.h>
......@@ -112,5 +112,5 @@ void cci_secure_switch(unsigned int ns);
void cci_init_sf(void);
unsigned long cci_reg_access(unsigned int op, unsigned long offset, unsigned long val);
#endif /* __ASSEMBLY__ */
#endif /* __ASSEMBLER__ */
#endif /* MCSI_H */
......@@ -9,7 +9,7 @@
#include <tegra_def.h>
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
#include <lib/mmio.h>
#include <stdint.h>
......@@ -173,6 +173,6 @@ tegra_mc_settings_t *tegra_get_mc_settings(void);
******************************************************************************/
void plat_memctrl_tzdram_setup(uint64_t phys_base, uint64_t size_in_bytes);
#endif /* __ASSEMBLY__ */
#endif /* __ASSEMBLER__ */
#endif /* MEMCTRL_V2_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