From: John Hodge (sonata) Date: Sat, 1 Dec 2012 08:45:57 +0000 (+0800) Subject: Externals/ACPICA - Cleaning up a little (and fixing compilation errors) X-Git-Tag: rel0.15~622 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=fb2379add2a38e3725401e1860d50df5d1b1430e;p=tpg%2Facess2.git Externals/ACPICA - Cleaning up a little (and fixing compilation errors) --- diff --git a/Externals/ACPICA/Makefile b/Externals/ACPICA/Makefile index 761b5ec4..97d3414b 100644 --- a/Externals/ACPICA/Makefile +++ b/Externals/ACPICA/Makefile @@ -2,7 +2,6 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../Makefile.cfg -COMPONENTS = utilities tables BIN := ../bin-$(ARCH)/libacpica.a _VERS := $(patsubst acpica-unix-%.tar.gz,%,$(wildcard acpica-unix-*.tar.gz)) @@ -33,7 +32,7 @@ CPPFLAGS += -D ARCH=$(ARCH) -D ARCHDIR=$(ARCHDIR) -D PLATFORM=\"$(PLATFORM)\" -D CPPFLAGS += -D KERNEL_VERSION=$(KERNEL_VERSION) -ffreestanding CFLAGS += -Wall -fno-stack-protector -Wstrict-prototypes -std=gnu99 -g -SRCS := $(foreach comp,$(COMPONENTS),$(wildcard $(COMPDIR)$(comp)/*.c)) +SRCS := $(wildcard $(COMPDIR)*/*.c) OBJS := $(SRCS:$(COMPDIR)%.c=obj-$(ARCH)/%.o) ACENV_H := $(ACPICAROOT)source/include/platform/acenv.h @@ -46,10 +45,11 @@ extract: $(ACPICAROOT) @echo Re-run make to compile endif -all: $(BIN) +all: $(BIN) include clean: - $(RM) -r obj-$(ARCH)/ + $(RM) -r obj-$(ARCH)/ include + purge: clean $(RM) -r $(ACPICAROOT) @@ -58,6 +58,9 @@ $(BIN): $(OBJS) @echo [AR] $@ @ar rcu $@ $(OBJS) +include: + ln -s $(ACPICAROOT)source/include + $(ACPICAROOT): $(ACPICA_ARCHIVE) tar -xf $(ACPICA_ARCHIVE) diff --git a/Externals/ACPICA/Makefile.kinc b/Externals/ACPICA/Makefile.kinc new file mode 100644 index 00000000..6410f51b --- /dev/null +++ b/Externals/ACPICA/Makefile.kinc @@ -0,0 +1,8 @@ +CPPFLAGS += -I $(ACESSDIR)/Externals/ACPICA/include -D_ACESS -D__KERNEL__ +EXTERN_OBJS += $(ACESSDIR)/Externals/bin-$(ARCH)/libacpica.a + +$(ACESSDIR)/Externals/bin-$(ARCH)/libacpica.a: + @make -C $(ACESSDIR)/Externals/ACPICA + @make -C $(ACESSDIR)/Externals/ACPICA + + diff --git a/Externals/ACPICA/acacess.h b/Externals/ACPICA/acacess.h index bcbdc9df..154b202c 100644 --- a/Externals/ACPICA/acacess.h +++ b/Externals/ACPICA/acacess.h @@ -9,7 +9,7 @@ #define ACPI_USE_SYSTEM_CLIBRARY #define ACPI_USE_DO_WHILE_0 -#define ACPI_MUTEX_TYPE ACPI_BINARY_SEMAPHORE +#define ACPI_MUTEX_TYPE ACPI_OSL_MUTEX #ifdef __KERNEL__ @@ -20,14 +20,20 @@ #define ACPI_MACHINE_WIDTH BITS -#define ACPI_SPINLOCK tShortSpinlock +#define ACPI_SPINLOCK tShortSpinlock* #define ACPI_CPU_FLAGS unsigned long #define COMPILER_DEPENDENT_UINT64 Uint64 #define COMPILER_DEPENDENT_INT64 Sint64 #define ACPI_DIV_64_BY_32(n_hi, n_lo, d32, q32, r32) do { \ - q32 = DivMod64( ((Sint64)n_hi<<32)|n_lo, d32, &r32 ); \ + Uint64 rem; \ + Sint64 num = ((Sint64)n_hi<<32)|n_lo; \ + int sgn = 1; \ + if(num < 0) {num = -num; sgn = -sgn; } \ + if(d32 < 0) {d32 = -d32; sgn = -sgn; } \ + q32 = sgn * DivMod64U( num, d32, &rem ); \ + r32 = rem; \ }while(0) #define ACPI_SHIFT_RIGHT_64(n_hi, n_lo) do { \ n_lo >>= 1; \