1 | #pragma once |
2 | |
3 | #ifdef UACPI_OVERRIDE_ARCH_HELPERS |
4 | #include "uacpi_arch_helpers.h" |
5 | #else |
6 | |
7 | #include <uacpi/platform/atomic.h> |
8 | |
9 | #ifndef UACPI_ARCH_FLUSH_CPU_CACHE |
10 | #define UACPI_ARCH_FLUSH_CPU_CACHE() do {} while (0) |
11 | #endif |
12 | |
13 | typedef unsigned long uacpi_cpu_flags; |
14 | |
15 | typedef void *uacpi_thread_id; |
16 | |
17 | /* |
18 | * Replace as needed depending on your platform's way to represent thread ids. |
19 | * uACPI offers a few more helpers like uacpi_atomic_{load,store}{8,16,32,64,ptr} |
20 | * (or you could provide your own helpers) |
21 | */ |
22 | #ifndef UACPI_ATOMIC_LOAD_THREAD_ID |
23 | #define UACPI_ATOMIC_LOAD_THREAD_ID(ptr) ((uacpi_thread_id)uacpi_atomic_load_ptr(ptr)) |
24 | #endif |
25 | |
26 | #ifndef UACPI_ATOMIC_STORE_THREAD_ID |
27 | #define UACPI_ATOMIC_STORE_THREAD_ID(ptr, value) uacpi_atomic_store_ptr(ptr, value) |
28 | #endif |
29 | |
30 | /* |
31 | * A sentinel value that the kernel promises to NEVER return from |
32 | * uacpi_kernel_get_current_thread_id or this will break |
33 | */ |
34 | #ifndef UACPI_THREAD_ID_NONE |
35 | #define UACPI_THREAD_ID_NONE ((uacpi_thread_id)-1) |
36 | #endif |
37 | |
38 | #endif |
39 | |