mirror of
https://github.com/ipxe/ipxe
synced 2025-12-27 10:02:42 +03:00
[build] Enable building with the Intel C compiler (icc)
This commit is contained in:
@@ -4,22 +4,33 @@ CFLAGS += -march=i386
|
||||
|
||||
# Code size reduction.
|
||||
#
|
||||
CFLAGS += -fstrength-reduce -fomit-frame-pointer
|
||||
CFLAGS += -fomit-frame-pointer
|
||||
|
||||
# Code size reduction.
|
||||
#
|
||||
ifeq ($(CCTYPE),gcc)
|
||||
CFLAGS += -fstrength-reduce
|
||||
endif
|
||||
|
||||
# Code size reduction. gcc3 needs a different syntax to gcc2 if you
|
||||
# want to avoid spurious warnings.
|
||||
#
|
||||
ifeq ($(CCTYPE),gcc)
|
||||
GCC_VERSION := $(subst ., ,$(shell $(CC) -dumpversion))
|
||||
GCC_MAJOR := $(firstword $(GCC_VERSION))
|
||||
ifeq ($(GCC_MAJOR),2)
|
||||
CFLAGS += -malign-jumps=1 -malign-loops=1 -malign-functions=1
|
||||
else
|
||||
CFLAGS += -falign-jumps=1 -falign-loops=1 -falign-functions=1
|
||||
endif
|
||||
endif # gcc2
|
||||
endif # gcc
|
||||
|
||||
# Code size reduction. This is almost always a win. The kernel uses it, too.
|
||||
# Code size reduction. This is almost always a win. The kernel uses
|
||||
# it, too.
|
||||
#
|
||||
ifeq ($(CCTYPE),gcc)
|
||||
CFLAGS += -mpreferred-stack-boundary=2
|
||||
endif
|
||||
|
||||
# Code size reduction. Use regparm for all functions - C functions
|
||||
# called from assembly (or vice versa) need __asmcall now
|
||||
@@ -27,7 +38,9 @@ CFLAGS += -mpreferred-stack-boundary=2
|
||||
CFLAGS += -mregparm=3
|
||||
|
||||
# Code size reduction. Use -mrtd (same __asmcall requirements as above)
|
||||
ifeq ($(CCTYPE),gcc)
|
||||
CFLAGS += -mrtd
|
||||
endif
|
||||
|
||||
# Code size reduction. This is the logical complement to -mregparm=3.
|
||||
# It doesn't currently buy us anything, but if anything ever tries to
|
||||
|
||||
@@ -90,11 +90,10 @@ int undi_load ( struct undi_device *undi, struct undi_rom *undirom ) {
|
||||
undi_loader_entry = undirom->loader_entry;
|
||||
__asm__ __volatile__ ( REAL_CODE ( "pushw %%ds\n\t"
|
||||
"pushw %%ax\n\t"
|
||||
"lcall *%c2\n\t"
|
||||
"lcall *undi_loader_entry\n\t"
|
||||
"addw $4, %%sp\n\t" )
|
||||
: "=a" ( exit )
|
||||
: "a" ( __from_data16 ( &undi_loader ) ),
|
||||
"p" ( __from_data16 ( &undi_loader_entry ) )
|
||||
: "a" ( __from_data16 ( &undi_loader ) )
|
||||
: "ebx", "ecx", "edx", "esi", "edi", "ebp" );
|
||||
|
||||
/* UNDI API calls may rudely change the status of A20 and not
|
||||
|
||||
@@ -173,12 +173,11 @@ static int undinet_call ( struct undi_nic *undinic, unsigned int function,
|
||||
__asm__ __volatile__ ( REAL_CODE ( "pushw %%es\n\t"
|
||||
"pushw %%di\n\t"
|
||||
"pushw %%bx\n\t"
|
||||
"lcall *%c3\n\t"
|
||||
"lcall *undinet_entry_point\n\t"
|
||||
"addw $6, %%sp\n\t" )
|
||||
: "=a" ( exit ), "=b" ( discard_b ),
|
||||
"=D" ( discard_D )
|
||||
: "p" ( __from_data16 ( &undinet_entry_point )),
|
||||
"b" ( function ),
|
||||
: "b" ( function ),
|
||||
"D" ( __from_data16 ( &undinet_params ) )
|
||||
: "ecx", "edx", "esi", "ebp" );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user