1 #ifndef __LUNAIX_BSTAGE_H
2 #define __LUNAIX_BSTAGE_H
3 #include <lunaix/types.h>
5 #define boot_text __attribute__((section(".boot.text")))
6 #define boot_data __attribute__((section(".boot.data")))
7 #define boot_bss __attribute__((section(".boot.bss")))
10 Bridge the far symbol to the vicinity.
12 Which is a workaround for relocation
13 issue where symbol define in kernel
14 code is too far away from the boot code.
16 #ifdef CONFIG_ARCH_X86_64
17 #define bridge_farsym(far_sym) \
19 ".section .boot.bss\n" \
21 ".globl __lc_" #far_sym "\n" \
22 "__lc_" #far_sym ":\n" \
23 ".8byte " #far_sym "\n" \
26 extern unsigned long __lc_##far_sym[];
27 #define __far(far_sym) (__lc_##far_sym[0])
30 #define bridge_farsym(far_sym) extern u8_t far_sym[];
31 #define __far(far_sym) ((ptr_t)far_sym)
37 #endif /* __LUNAIX_BSTAGE_H */