| 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 | typedef unsigned long uacpi_interrupt_state; |
| 15 | |
| 16 | typedef void *uacpi_thread_id; |
| 17 | |
| 18 | /* |
| 19 | * Replace as needed depending on your platform's way to represent thread ids. |
| 20 | * uACPI offers a few more helpers like uacpi_atomic_{load,store}{8,16,32,64,ptr} |
| 21 | * (or you could provide your own helpers) |
| 22 | */ |
| 23 | #ifndef UACPI_ATOMIC_LOAD_THREAD_ID |
| 24 | #define UACPI_ATOMIC_LOAD_THREAD_ID(ptr) ((uacpi_thread_id)uacpi_atomic_load_ptr(ptr)) |
| 25 | #endif |
| 26 | |
| 27 | #ifndef UACPI_ATOMIC_STORE_THREAD_ID |
| 28 | #define UACPI_ATOMIC_STORE_THREAD_ID(ptr, value) uacpi_atomic_store_ptr(ptr, value) |
| 29 | #endif |
| 30 | |
| 31 | /* |
| 32 | * A sentinel value that the kernel promises to NEVER return from |
| 33 | * uacpi_kernel_get_current_thread_id or this will break |
| 34 | */ |
| 35 | #ifndef UACPI_THREAD_ID_NONE |
| 36 | #define UACPI_THREAD_ID_NONE ((uacpi_thread_id)-1) |
| 37 | #endif |
| 38 | |
| 39 | #endif |
| 40 | |