10 #include "../lib/types.h"
41 extern unsigned long arch_flags;
43 #define ARCH_CPU_CLOCK_WRAPS
46 #define atomic_add(p, v) \
47 std::atomic_fetch_add(p, (v))
48 #define atomic_sub(p, v) \
49 std::atomic_fetch_sub(p, (v))
50 #define atomic_load_relaxed(p) \
51 std::atomic_load_explicit(p, \
52 std::memory_order_relaxed)
53 #define atomic_load_acquire(p) \
54 std::atomic_load_explicit(p, \
55 std::memory_order_acquire)
56 #define atomic_store_release(p, v) \
57 std::atomic_store_explicit(p, (v), \
58 std::memory_order_release)
60 #define atomic_add(p, v) \
61 atomic_fetch_add((_Atomic typeof(*(p)) *)(p), v)
62 #define atomic_sub(p, v) \
63 atomic_fetch_sub((_Atomic typeof(*(p)) *)(p), v)
64 #define atomic_load_relaxed(p) \
65 atomic_load_explicit((_Atomic typeof(*(p)) *)(p), \
67 #define atomic_load_acquire(p) \
68 atomic_load_explicit((_Atomic typeof(*(p)) *)(p), \
70 #define atomic_store_release(p, v) \
71 atomic_store_explicit((_Atomic typeof(*(p)) *)(p), (v), \
75 /* IWYU pragma: begin_exports */
78 #elif defined(__x86_64__)
79 #include "arch-x86_64.h"
80 #elif defined(__powerpc__) || defined(__powerpc64__) || defined(__ppc__)
82 #elif defined(__ia64__)
83 #include "arch-ia64.h"
84 #elif defined(__alpha__)
85 #include "arch-alpha.h"
86 #elif defined(__s390x__) || defined(__s390__)
87 #include "arch-s390.h"
88 #elif defined(__sparc__)
89 #include "arch-sparc.h"
90 #elif defined(__sparc64__)
91 #include "arch-sparc64.h"
92 #elif defined(__arm__)
94 #elif defined(__mips__) || defined(__mips64__)
95 #include "arch-mips.h"
98 #elif defined(__hppa__)
99 #include "arch-hppa.h"
100 #elif defined(__aarch64__)
101 #include "arch-aarch64.h"
102 #elif defined(__loongarch64)
103 #include "arch-loongarch64.h"
104 #elif defined(__riscv) && __riscv_xlen == 64
105 #include "arch-riscv64.h"
107 #warning "Unknown architecture, attempting to use generic model."
108 #include "arch-generic.h"
111 #include "../lib/ffz.h"
112 /* IWYU pragma: end_exports */
114 #ifndef ARCH_HAVE_INIT
115 static inline int arch_init(char *envp[])
123 * alpha is the only exception, all other architectures
124 * have common numbers for new system calls.
126 # ifndef __NR_io_uring_setup
127 # define __NR_io_uring_setup 535
129 # ifndef __NR_io_uring_enter
130 # define __NR_io_uring_enter 536
132 # ifndef __NR_io_uring_register
133 # define __NR_io_uring_register 537
135 #else /* !__alpha__ */
136 # ifndef __NR_io_uring_setup
137 # define __NR_io_uring_setup 425
139 # ifndef __NR_io_uring_enter
140 # define __NR_io_uring_enter 426
142 # ifndef __NR_io_uring_register
143 # define __NR_io_uring_register 427
147 #define ARCH_HAVE_IOURING