acpica update. (NicJA)
[AROS.git] / arch / all-pc / acpica / acpica-unix-20180810-aros.diff
blob2401ea96ef30e49a30f22520bb430f1ae7261b0b
1 diff -ruN acpica-unix-20180810/source/include/platform/acaros.h acpica-unix-20180810.aros/source/include/platform/acaros.h
2 --- acpica-unix-20180810/source/include/platform/acaros.h 1970-01-01 01:00:00.000000000 +0100
3 +++ acpica-unix-20180810.aros/source/include/platform/acaros.h 2018-09-19 00:27:31.596804800 +0100
4 @@ -0,0 +1,87 @@
5 +/******************************************************************************
6 + *
7 + * Name: acaros.h - OS specific defines, etc. for AROS
8 + *
9 + *****************************************************************************/
11 +#ifndef __ACAROS_H__
12 +#define __ACAROS_H__
14 +#if defined(__i386__) || defined(__x86_64__)
15 +#define ACPI_DIV_64_BY_32(n_hi, n_lo, d32, q32, r32) \
16 + asm volatile ( \
17 + "mov %2, %%edx\n" \
18 + "mov %3, %%eax\n" \
19 + "div %4\n" \
20 + "mov %%eax, %0\n" \
21 + "mov %%edx, %1\n" \
22 + : "=r" (q32), "=r" (r32) \
23 + : "r" (n_hi), "r" (n_lo), "r" (d32) \
24 + : "%eax", "%edx" );
26 +#define ACPI_SHIFT_RIGHT_64(n_hi, n_lo) \
27 + asm volatile ( \
28 + "shr $1, %0\n" \
29 + "rcr $1, %1\n" \
30 + : "=r" (n_hi), "=r" (n_lo) \
31 + : "0" (n_hi), "1" (n_lo) \
32 + );
33 +#endif
35 +/* Common (in-kernel/user-space) ACPICA configuration */
37 +#ifndef ACPI_USE_SYSTEM_CLIBRARY
38 +#define ACPI_USE_SYSTEM_CLIBRARY
39 +#endif
40 +#define ACPI_USE_STANDARD_HEADERS
41 +#define ACPI_MUTEX_TYPE ACPI_BINARY_SEMAPHORE
42 +#define ACPI_USE_LOCAL_CACHE
44 +/* Use native AROS version of AcpiOsAllocateZeroed */
45 +#define USE_NATIVE_ALLOCATE_ZEROED
47 +/*
48 + * Calling conventions:
49 + *
50 + * ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads)
51 + * ACPI_EXTERNAL_XFACE - External ACPI interfaces
52 + * ACPI_INTERNAL_XFACE - Internal ACPI interfaces
53 + * ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces
54 + */
55 +#define ACPI_SYSTEM_XFACE
56 +#define ACPI_EXTERNAL_XFACE
57 +#define ACPI_INTERNAL_XFACE
58 +#define ACPI_INTERNAL_VAR_XFACE
60 +#include <stdint.h>
61 +#include <proto/exec.h>
63 +/* Host-dependent types and defines for AROS ACPICA */
65 +#if defined(__x86_64__)
66 +#define ACPI_MACHINE_WIDTH 64
67 +#elif defined(__i386__)
68 +#define ACPI_MACHINE_WIDTH 32
69 +#else
70 +#error Unsupported hardware architecture!
71 +#endif
73 +#ifndef __cdecl
74 +#define __cdecl
75 +#endif
77 +#define ACPI_FLUSH_CPU_CACHE() CacheClearU()
78 +#define ACPI_ACQUIRE_GLOBAL_LOCK(facs,acq) \
79 + { ACPI_TABLE_FACS *_facs = facs; \
80 + BOOLEAN ok = FALSE; \
81 + Disable(); if (_facs->GlobalLock == 0) { _facs->GlobalLock=1; ok = TRUE; } Enable(); \
82 + acq = ok; }
83 +#define ACPI_RELEASE_GLOBAL_LOCK(facs,pend) \
84 + { ACPI_TABLE_FACS *_facs = facs; \
85 + BOOLEAN ok = FALSE; \
86 + Disable(); if (_facs->GlobalLock == 1) { _facs->GlobalLock=0; ok = TRUE; } Enable(); \
87 + pend = ok; }
89 +#include <libraries/acpica.h>
91 +#endif /* __ACAROS_H__ */
92 diff -ruN acpica-unix-20180810/source/include/platform/acenv.h acpica-unix-20180810.aros/source/include/platform/acenv.h
93 --- acpica-unix-20180810/source/include/platform/acenv.h 2018-08-10 16:49:24.000000000 +0100
94 +++ acpica-unix-20180810.aros/source/include/platform/acenv.h 2018-09-18 22:37:03.805227836 +0100
95 @@ -335,6 +335,9 @@
96 #elif defined(__QNX__)
97 #include "acqnx.h"
99 +#elif defined(__AROS__)
100 +#include "acaros.h"
103 * EFI applications can be built with -nostdlib, in this case, it must be
104 * included after including all other host environmental definitions, in