Externals/ACPICA - Cleaning up a little (and fixing compilation errors)
authorJohn Hodge (sonata) <[email protected]>
Sat, 1 Dec 2012 08:45:57 +0000 (16:45 +0800)
committerJohn Hodge (sonata) <[email protected]>
Sat, 1 Dec 2012 08:45:57 +0000 (16:45 +0800)
Externals/ACPICA/Makefile
Externals/ACPICA/Makefile.kinc [new file with mode: 0644]
Externals/ACPICA/acacess.h

index 761b5ec..97d3414 100644 (file)
@@ -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 (file)
index 0000000..6410f51
--- /dev/null
@@ -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
+
+
index bcbdc9d..154b202 100644 (file)
@@ -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__
 
 #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; \

UCC git Repository :: git.ucc.asn.au