diff options
author | Michael Brown <mcb30@etherboot.org> | 2007-07-29 00:17:25 +0100 |
---|---|---|
committer | Michael Brown <mcb30@etherboot.org> | 2007-07-29 00:17:25 +0100 |
commit | a6a1052096c72660a24fead2e1e7d580ea4f8bc2 (patch) | |
tree | 8de861af803d0775320f6124e51d09f6397aecc7 /src/arch | |
parent | e3484e26eba1ba36481d814b35f8561a0f4cb8a6 (diff) | |
download | ipxe-a6a1052096c72660a24fead2e1e7d580ea4f8bc2.tar.gz |
Applied a modified version of holger's regparm patches.
Diffstat (limited to 'src/arch')
-rw-r--r-- | src/arch/i386/Config | 12 | ||||
-rw-r--r-- | src/arch/i386/core/relocate.c | 2 | ||||
-rw-r--r-- | src/arch/i386/interface/pcbios/int13.c | 2 | ||||
-rw-r--r-- | src/arch/i386/interface/pxe/pxe_call.c | 4 |
4 files changed, 16 insertions, 4 deletions
diff --git a/src/arch/i386/Config b/src/arch/i386/Config index 87791321..16de411b 100644 --- a/src/arch/i386/Config +++ b/src/arch/i386/Config @@ -130,6 +130,18 @@ endif # this is almost always a win. the kernel uses it, too. CFLAGS+= -mpreferred-stack-boundary=2 +# use regparm for all functions - C functions called from assembly (or +# vice versa) need __cdecl now +CFLAGS+= -mregparm=3 + +# use -mrtd (same __cdecl requirements as above) +CFLAGS+= -mrtd + +# this is the logical complement to -mregparm=3. +# it doesn't currently buy us anything, but if anything ever tries +# to return small structures, let's be prepared +CFLAGS+= -freg-struct-return + LDFLAGS+= -N --no-check-sections ifeq "$(shell uname -s)" "FreeBSD" diff --git a/src/arch/i386/core/relocate.c b/src/arch/i386/core/relocate.c index d3b42d0d..39d00b09 100644 --- a/src/arch/i386/core/relocate.c +++ b/src/arch/i386/core/relocate.c @@ -39,7 +39,7 @@ extern char _end[]; * address space, and returns the physical address of the new location * to the prefix in %edi. */ -void relocate ( struct i386_all_regs *ix86 ) { +__cdecl void relocate ( struct i386_all_regs *ix86 ) { struct memory_map memmap; unsigned long start, end, size, padded_size; unsigned long new_start, new_end; diff --git a/src/arch/i386/interface/pcbios/int13.c b/src/arch/i386/interface/pcbios/int13.c index f7cb6795..53817c7a 100644 --- a/src/arch/i386/interface/pcbios/int13.c +++ b/src/arch/i386/interface/pcbios/int13.c @@ -321,7 +321,7 @@ static int int13_get_extended_parameters ( struct int13_drive *drive, * INT 13 handler * */ -static void int13 ( struct i386_all_regs *ix86 ) { +static __cdecl void int13 ( struct i386_all_regs *ix86 ) { int command = ix86->regs.ah; unsigned int bios_drive = ix86->regs.dl; unsigned int original_bios_drive = bios_drive; diff --git a/src/arch/i386/interface/pxe/pxe_call.c b/src/arch/i386/interface/pxe/pxe_call.c index 834ca738..1c1b5066 100644 --- a/src/arch/i386/interface/pxe/pxe_call.c +++ b/src/arch/i386/interface/pxe/pxe_call.c @@ -112,7 +112,7 @@ static PXENV_EXIT_t pxenv_unknown ( struct s_PXENV_UNKNOWN *pxenv_unknown ) { * @v es:di Address of PXE parameter block * @ret ax PXE exit code */ -void pxe_api_call ( struct i386_all_regs *ix86 ) { +__cdecl void pxe_api_call ( struct i386_all_regs *ix86 ) { int opcode = ix86->regs.bx; userptr_t parameters = real_to_user ( ix86->segs.es, ix86->regs.di ); size_t param_len; @@ -304,7 +304,7 @@ void pxe_api_call ( struct i386_all_regs *ix86 ) { * @v es:di Address of PXE parameter block * @ret ax PXE exit code */ -void pxe_loader_call ( struct i386_all_regs *ix86 ) { +__cdecl void pxe_loader_call ( struct i386_all_regs *ix86 ) { userptr_t uparams = real_to_user ( ix86->segs.es, ix86->regs.di ); struct s_UNDI_LOADER params; PXENV_EXIT_t ret; |