revert between 56095 -> 55830 in arch
[AROS.git] / arch / all-pc / acpica / acpica-unix-20190108-aros.diff
blob25518e46d388c0bf03f5b650832a8371c8f035ab
1 diff -ruN acpica-unix-20190108/source/include/platform/acaros.h acpica-unix-20190108.aros/source/include/platform/acaros.h
2 --- acpica-unix-20190108/source/include/platform/acaros.h 1970-01-01 01:00:00.000000000 +0100
3 +++ acpica-unix-20190108.aros/source/include/platform/acaros.h 2018-09-21 15:22:45.699532372 +0100
4 @@ -0,0 +1,86 @@
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 (__WORDSIZE==64)
66 +#define ACPI_MACHINE_WIDTH 64
67 +#else
68 +#define ACPI_MACHINE_WIDTH 32
69 +#define ACPI_32BIT_PHYSICAL_ADDRESS
70 +#endif
72 +#ifndef __cdecl
73 +#define __cdecl
74 +#endif
76 +#define ACPI_FLUSH_CPU_CACHE() CacheClearU()
77 +#define ACPI_ACQUIRE_GLOBAL_LOCK(facs,acq) \
78 + { ACPI_TABLE_FACS *_facs = facs; \
79 + BOOLEAN ok = FALSE; \
80 + Disable(); if (_facs->GlobalLock == 0) { _facs->GlobalLock=1; ok = TRUE; } Enable(); \
81 + acq = ok; }
82 +#define ACPI_RELEASE_GLOBAL_LOCK(facs,pend) \
83 + { ACPI_TABLE_FACS *_facs = facs; \
84 + BOOLEAN ok = FALSE; \
85 + Disable(); if (_facs->GlobalLock == 1) { _facs->GlobalLock=0; ok = TRUE; } Enable(); \
86 + pend = ok; }
88 +#include <libraries/acpica.h>
90 +#endif /* __ACAROS_H__ */
91 diff -ruN acpica-unix-20190108/source/include/platform/acenv.h acpica-unix-20190108.aros/source/include/platform/acenv.h
92 --- acpica-unix-20190108/source/include/platform/acenv.h 2018-08-10 16:49:24.000000000 +0100
93 +++ acpica-unix-20190108.aros/source/include/platform/acenv.h 2018-09-21 14:56:06.593884036 +0100
94 @@ -335,6 +335,9 @@
95 #elif defined(__QNX__)
96 #include "acqnx.h"
98 +#elif defined(__AROS__)
99 +#include "acaros.h"
102 * EFI applications can be built with -nostdlib, in this case, it must be
103 * included after including all other host environmental definitions, in