Indentation fix, cleanup.
[AROS.git] / arch / all-pc / acpica / source / include / platform / acaros.h
blobb4e52f58de67c7223939b0446a50584172f83318
1 /******************************************************************************
3 * Name: aclinux.h - OS specific defines, etc. for AROS
5 *****************************************************************************/
7 #ifndef __ACAROS_H__
8 #define __ACAROS_H__
10 #if defined(__i386__) || defined(__x86_64__)
11 #define ACPI_DIV_64_BY_32(n_hi, n_lo, d32, q32, r32) \
12 asm volatile ( \
13 "mov %2, %%edx\n" \
14 "mov %3, %%eax\n" \
15 "div %4\n" \
16 "mov %%eax, %0\n" \
17 "mov %%edx, %1\n" \
18 : "=r" (q32), "=r" (r32) \
19 : "r" (n_hi), "r" (n_lo), "r" (d32) \
20 : "%eax", "%edx" );
22 #define ACPI_SHIFT_RIGHT_64(n_hi, n_lo) \
23 asm volatile ( \
24 "shr $1, %0\n" \
25 "rcr $1, %1\n" \
26 : "=r" (n_hi), "=r" (n_lo) \
27 : "0" (n_hi), "1" (n_lo) \
29 #endif
31 /* Common (in-kernel/user-space) ACPICA configuration */
33 #define ACPI_USE_SYSTEM_CLIBRARY
34 #define ACPI_USE_STANDARD_HEADERS
35 #define ACPI_MUTEX_TYPE ACPI_BINARY_SEMAPHORE
36 #define ACPI_USE_LOCAL_CACHE
39 * Calling conventions:
41 * ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads)
42 * ACPI_EXTERNAL_XFACE - External ACPI interfaces
43 * ACPI_INTERNAL_XFACE - Internal ACPI interfaces
44 * ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces
46 #define ACPI_SYSTEM_XFACE
47 #define ACPI_EXTERNAL_XFACE
48 #define ACPI_INTERNAL_XFACE
49 #define ACPI_INTERNAL_VAR_XFACE
51 #include <stdint.h>
52 #include <proto/exec.h>
54 /* Host-dependent types and defines for AROS ACPICA */
56 #if defined(__x86_64__)
57 #define ACPI_MACHINE_WIDTH 64
58 #elif defined(__i386__)
59 #define ACPI_MACHINE_WIDTH 32
60 #else
61 #error Unsupported hardware architecture!
62 #endif
64 #ifndef __cdecl
65 #define __cdecl
66 #endif
68 #define ACPI_FLUSH_CPU_CACHE() CacheClearU()
69 #define ACPI_ACQUIRE_GLOBAL_LOCK(facs,acq) \
70 { ACPI_TABLE_FACS *_facs = facs; \
71 BOOLEAN ok = FALSE; \
72 Disable(); if (_facs->GlobalLock == 0) { _facs->GlobalLock=1; ok = TRUE; } Enable(); \
73 acq = ok; }
74 #define ACPI_RELEASE_GLOBAL_LOCK(facs,pend) \
75 { ACPI_TABLE_FACS *_facs = facs; \
76 BOOLEAN ok = FALSE; \
77 Disable(); if (_facs->GlobalLock == 1) { _facs->GlobalLock=0; ok = TRUE; } Enable(); \
78 pend = ok; }
80 /* AROS uses GCC */
82 #include "acgcc.h"
84 #include <libraries/acpica.h>
86 #endif /* __ACAROS_H__ */