diff options
author | Michael Brown <mcb30@ipxe.org> | 2021-03-02 10:15:23 +0000 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2021-03-02 10:15:23 +0000 |
commit | 916ebef1984e9caa05646463734b51202b405774 (patch) | |
tree | 5aadea92562bac70a98e3837c7577de76eac1405 | |
parent | c09b627973d9362caba39de09f7d2c6990eb9701 (diff) | |
download | ipxe-916ebef1984e9caa05646463734b51202b405774.tar.gz |
[build] Allow __asmcall to be used as a type attribute
The "used" attribute can be applied only to functions or variables,
which prevents the use of __asmcall as a type attribute.
Fix by removing "used" from the definition of __asmcall for i386 and
x86_64 architectures, and adding explicit __used annotations where
necessary.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
-rw-r--r-- | src/arch/i386/include/bits/compiler.h | 2 | ||||
-rw-r--r-- | src/arch/x86/interface/pcbios/bios_console.c | 2 | ||||
-rw-r--r-- | src/arch/x86/interface/pcbios/int13.c | 2 | ||||
-rw-r--r-- | src/arch/x86/interface/syslinux/comboot_call.c | 6 | ||||
-rw-r--r-- | src/arch/x86/transitions/librm_test.c | 3 | ||||
-rw-r--r-- | src/arch/x86_64/include/bits/compiler.h | 2 |
6 files changed, 9 insertions, 8 deletions
diff --git a/src/arch/i386/include/bits/compiler.h b/src/arch/i386/include/bits/compiler.h index 7c4a09396..87201135f 100644 --- a/src/arch/i386/include/bits/compiler.h +++ b/src/arch/i386/include/bits/compiler.h @@ -9,7 +9,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); #ifndef ASSEMBLY /** Declare a function with standard calling conventions */ -#define __asmcall __attribute__ (( used, cdecl, regparm(0) )) +#define __asmcall __attribute__ (( cdecl, regparm(0) )) /** * Declare a function with libgcc implicit linkage diff --git a/src/arch/x86/interface/pcbios/bios_console.c b/src/arch/x86/interface/pcbios/bios_console.c index 52a02fba5..80ebf330e 100644 --- a/src/arch/x86/interface/pcbios/bios_console.c +++ b/src/arch/x86/interface/pcbios/bios_console.c @@ -443,7 +443,7 @@ struct console_driver bios_console __console_driver = { * * @v ix86 Registers as passed to INT 16 */ -static __asmcall void bios_inject ( struct i386_all_regs *ix86 ) { +static __asmcall __used void bios_inject ( struct i386_all_regs *ix86 ) { unsigned int discard_a; unsigned int scancode; unsigned int i; diff --git a/src/arch/x86/interface/pcbios/int13.c b/src/arch/x86/interface/pcbios/int13.c index ca789a0d1..30530e197 100644 --- a/src/arch/x86/interface/pcbios/int13.c +++ b/src/arch/x86/interface/pcbios/int13.c @@ -1064,7 +1064,7 @@ static int int13_cdrom_read_boot_catalog ( struct san_device *sandev, * INT 13 handler * */ -static __asmcall void int13 ( struct i386_all_regs *ix86 ) { +static __asmcall __used void int13 ( struct i386_all_regs *ix86 ) { int command = ix86->regs.ah; unsigned int bios_drive = ix86->regs.dl; struct san_device *sandev; diff --git a/src/arch/x86/interface/syslinux/comboot_call.c b/src/arch/x86/interface/syslinux/comboot_call.c index e70f200e3..dc308dafe 100644 --- a/src/arch/x86/interface/syslinux/comboot_call.c +++ b/src/arch/x86/interface/syslinux/comboot_call.c @@ -220,7 +220,7 @@ static int comboot_fetch_kernel ( char *kernel_file, char *cmdline ) { /** * Terminate program interrupt handler */ -static __asmcall void int20 ( struct i386_all_regs *ix86 __unused ) { +static __asmcall __used void int20 ( struct i386_all_regs *ix86 __unused ) { rmlongjmp ( comboot_return, COMBOOT_EXIT ); } @@ -228,7 +228,7 @@ static __asmcall void int20 ( struct i386_all_regs *ix86 __unused ) { /** * DOS-compatible API */ -static __asmcall void int21 ( struct i386_all_regs *ix86 ) { +static __asmcall __used void int21 ( struct i386_all_regs *ix86 ) { ix86->flags |= CF; switch ( ix86->regs.ah ) { @@ -311,7 +311,7 @@ __weak int pxe_api_call_weak ( struct i386_all_regs *ix86 __unused ) { /** * SYSLINUX API */ -static __asmcall void int22 ( struct i386_all_regs *ix86 ) { +static __asmcall __used void int22 ( struct i386_all_regs *ix86 ) { ix86->flags |= CF; switch ( ix86->regs.ax ) { diff --git a/src/arch/x86/transitions/librm_test.c b/src/arch/x86/transitions/librm_test.c index 77cf8022c..347d86a15 100644 --- a/src/arch/x86/transitions/librm_test.c +++ b/src/arch/x86/transitions/librm_test.c @@ -58,7 +58,8 @@ static struct profiler virt_call_profiler __profiler = { .name = "virt_call" }; /** * Dummy function for profiling tests */ -static __asmcall void librm_test_call ( struct i386_all_regs *ix86 __unused ) { +static __asmcall __used void +librm_test_call ( struct i386_all_regs *ix86 __unused ) { /* Do nothing */ } diff --git a/src/arch/x86_64/include/bits/compiler.h b/src/arch/x86_64/include/bits/compiler.h index 46985da3e..5129f90d0 100644 --- a/src/arch/x86_64/include/bits/compiler.h +++ b/src/arch/x86_64/include/bits/compiler.h @@ -9,7 +9,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); #ifndef ASSEMBLY /** Declare a function with standard calling conventions */ -#define __asmcall __attribute__ (( used, regparm(0) )) +#define __asmcall __attribute__ (( regparm(0) )) /** Declare a function with libgcc implicit linkage */ #define __libgcc |