]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[build] Allow __asmcall to be used as a type attribute
authorMichael Brown <mcb30@ipxe.org>
Tue, 2 Mar 2021 10:15:23 +0000 (10:15 +0000)
committerMichael Brown <mcb30@ipxe.org>
Tue, 2 Mar 2021 10:15:23 +0000 (10:15 +0000)
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>
src/arch/i386/include/bits/compiler.h
src/arch/x86/interface/pcbios/bios_console.c
src/arch/x86/interface/pcbios/int13.c
src/arch/x86/interface/syslinux/comboot_call.c
src/arch/x86/transitions/librm_test.c
src/arch/x86_64/include/bits/compiler.h

index 7c4a09396beb91dc71324e8be98a94f256c3137c..87201135f78cfe10a21ec91aa73c05df7a7e87b5 100644 (file)
@@ -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
index 52a02fba50ca54d28e91becb14056a66341e1c72..80ebf330ef9057e440285e6581f6e2617ef0c80d 100644 (file)
@@ -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;
index ca789a0d154e1fe3c2508a3aefeade3c607bdf96..30530e197b53251b7c2568ab9a6d3ec29121ae00 100644 (file)
@@ -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;
index e70f200e3324e51fd5377b417b4d2a6eb16c7963..dc308dafe20e4a8adbc06bc9c8590815de96fc31 100644 (file)
@@ -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 ) {
index 77cf8022c48ac2ba4e10a2efb673ec7252960fd9..347d86a151e33afc8d66f6461a68d566a64c6009 100644 (file)
@@ -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 */
 }
 
index 46985da3ee4cb014e52582f73f66cf0d0c8e4dd7..5129f90d0f9561acd417a56f2116f04470e948c6 100644 (file)
@@ -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