10 #include "../lib/types.h"
39 extern unsigned long arch_flags;
41 #define ARCH_CPU_CLOCK_WRAPS
44 #define atomic_add(p, v) \
45 std::atomic_fetch_add(p, (v))
46 #define atomic_sub(p, v) \
47 std::atomic_fetch_sub(p, (v))
48 #define atomic_load_relaxed(p) \
49 std::atomic_load_explicit(p, \
50 std::memory_order_relaxed)
51 #define atomic_load_acquire(p) \
52 std::atomic_load_explicit(p, \
53 std::memory_order_acquire)
54 #define atomic_store_release(p, v) \
55 std::atomic_store_explicit(p, (v), \
56 std::memory_order_release)
58 #define atomic_add(p, v) \
59 atomic_fetch_add((_Atomic typeof(*(p)) *)(p), v)
60 #define atomic_sub(p, v) \
61 atomic_fetch_sub((_Atomic typeof(*(p)) *)(p), v)
62 #define atomic_load_relaxed(p) \
63 atomic_load_explicit((_Atomic typeof(*(p)) *)(p), \
65 #define atomic_load_acquire(p) \
66 atomic_load_explicit((_Atomic typeof(*(p)) *)(p), \
68 #define atomic_store_release(p, v) \
69 atomic_store_explicit((_Atomic typeof(*(p)) *)(p), (v), \
73 /* IWYU pragma: begin_exports */
76 #elif defined(__x86_64__)
77 #include "arch-x86_64.h"
78 #elif defined(__powerpc__) || defined(__powerpc64__) || defined(__ppc__)
80 #elif defined(__ia64__)
81 #include "arch-ia64.h"
82 #elif defined(__alpha__)
83 #include "arch-alpha.h"
84 #elif defined(__s390x__) || defined(__s390__)
85 #include "arch-s390.h"
86 #elif defined(__sparc__)
87 #include "arch-sparc.h"
88 #elif defined(__sparc64__)
89 #include "arch-sparc64.h"
90 #elif defined(__arm__)
92 #elif defined(__mips__) || defined(__mips64__)
93 #include "arch-mips.h"
96 #elif defined(__hppa__)
97 #include "arch-hppa.h"
98 #elif defined(__aarch64__)
99 #include "arch-aarch64.h"
101 #warning "Unknown architecture, attempting to use generic model."
102 #include "arch-generic.h"
105 #include "../lib/ffz.h"
106 /* IWYU pragma: end_exports */
108 #ifndef ARCH_HAVE_INIT
109 static inline int arch_init(char *envp[])
117 * alpha is the only exception, all other architectures
118 * have common numbers for new system calls.
120 # ifndef __NR_io_uring_setup
121 # define __NR_io_uring_setup 535
123 # ifndef __NR_io_uring_enter
124 # define __NR_io_uring_enter 536
126 # ifndef __NR_io_uring_register
127 # define __NR_io_uring_register 537
129 #else /* !__alpha__ */
130 # ifndef __NR_io_uring_setup
131 # define __NR_io_uring_setup 425
133 # ifndef __NR_io_uring_enter
134 # define __NR_io_uring_enter 426
136 # ifndef __NR_io_uring_register
137 # define __NR_io_uring_register 427
141 #define ARCH_HAVE_IOURING