Skip to content

Commit 5baf3dd

Browse files
author
Shigeki Ohtsu
committed
deps, uv, linux: support armv8 (aarch64)
Numbers are taken from include/uapi/asm-generic/unistd.h.
1 parent 8d1c87e commit 5baf3dd

File tree

2 files changed

+45
-6
lines changed

2 files changed

+45
-6
lines changed

deps/uv/src/unix/linux-core.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
210210
if (pthread_sigmask(SIG_BLOCK, &sigset, NULL))
211211
abort();
212212

213-
if (sigmask != 0 && no_epoll_pwait == 0) {
213+
if (no_epoll_pwait == 0) {
214214
nfds = uv__epoll_pwait(loop->backend_fd,
215215
events,
216216
ARRAY_SIZE(events),
@@ -579,6 +579,7 @@ static int read_models(unsigned int numcpus, uv_cpu_info_t* ci) {
579579
speed_idx = 0;
580580

581581
#if defined(__arm__) || \
582+
defined(__aarch64__) || \
582583
defined(__i386__) || \
583584
defined(__mips__) || \
584585
defined(__x86_64__)
@@ -599,9 +600,9 @@ static int read_models(unsigned int numcpus, uv_cpu_info_t* ci) {
599600
continue;
600601
}
601602
}
602-
#if defined(__arm__) || defined(__mips__)
603+
#if defined(__arm__) || defined(__mips__) || defined(__aarch64__)
603604
if (model_idx < numcpus) {
604-
#if defined(__arm__)
605+
#if defined(__arm__) || defined(__aarch64)
605606
/* Fallback for pre-3.8 kernels. */
606607
static const char model_marker[] = "Processor\t: ";
607608
#else /* defined(__mips__) */
@@ -618,18 +619,18 @@ static int read_models(unsigned int numcpus, uv_cpu_info_t* ci) {
618619
continue;
619620
}
620621
}
621-
#else /* !__arm__ && !__mips__ */
622+
#else /* !__arm__ && !__mips__ && !__aarch64__ */
622623
if (speed_idx < numcpus) {
623624
if (strncmp(buf, speed_marker, sizeof(speed_marker) - 1) == 0) {
624625
ci[speed_idx++].speed = atoi(buf + sizeof(speed_marker) - 1);
625626
continue;
626627
}
627628
}
628-
#endif /* __arm__ || __mips__ */
629+
#endif /* __arm__ || __mips__ || __aarch64__ */
629630
}
630631

631632
fclose(fp);
632-
#endif /* __arm__ || __i386__ || __mips__ || __x86_64__ */
633+
#endif /* __arm__ || __aarch64__ || __i386__ || __mips__ || __x86_64__ */
633634

634635
/* Now we want to make sure that all the models contain *something* because
635636
* it's not safe to leave them as null. Copy the last entry unless there

deps/uv/src/unix/linux-syscalls.c

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545
# define __NR_accept4 288
4646
# elif defined(__i386__)
4747
/* Nothing. Handled through socketcall(). */
48+
# elif defined(__aarch64__)
49+
# define __NR_accept4 242
4850
# elif defined(__arm__)
4951
# define __NR_accept4 (UV_SYSCALL_BASE + 366)
5052
# endif
@@ -55,6 +57,8 @@
5557
# define __NR_eventfd 284
5658
# elif defined(__i386__)
5759
# define __NR_eventfd 323
60+
# elif defined(__aarch64__)
61+
# define __NR_eventfd 1044
5862
# elif defined(__arm__)
5963
# define __NR_eventfd (UV_SYSCALL_BASE + 351)
6064
# endif
@@ -65,6 +69,8 @@
6569
# define __NR_eventfd2 290
6670
# elif defined(__i386__)
6771
# define __NR_eventfd2 328
72+
# elif defined(__aarch64__)
73+
# define __NR_eventfd2 19
6874
# elif defined(__arm__)
6975
# define __NR_eventfd2 (UV_SYSCALL_BASE + 356)
7076
# endif
@@ -75,6 +81,8 @@
7581
# define __NR_epoll_create 213
7682
# elif defined(__i386__)
7783
# define __NR_epoll_create 254
84+
# elif defined(__aarch64__)
85+
/* not defined without __ARCH_WANT_SYSCALL_NO_FLAGS */
7886
# elif defined(__arm__)
7987
# define __NR_epoll_create (UV_SYSCALL_BASE + 250)
8088
# endif
@@ -85,6 +93,8 @@
8593
# define __NR_epoll_create1 291
8694
# elif defined(__i386__)
8795
# define __NR_epoll_create1 329
96+
# elif defined(__aarch64__)
97+
# define __NR_epoll_create1 20
8898
# elif defined(__arm__)
8999
# define __NR_epoll_create1 (UV_SYSCALL_BASE + 357)
90100
# endif
@@ -95,6 +105,8 @@
95105
# define __NR_epoll_ctl 233 /* used to be 214 */
96106
# elif defined(__i386__)
97107
# define __NR_epoll_ctl 255
108+
# elif defined(__aarch64__)
109+
# define __NR_epoll_ctl 21
98110
# elif defined(__arm__)
99111
# define __NR_epoll_ctl (UV_SYSCALL_BASE + 251)
100112
# endif
@@ -103,6 +115,8 @@
103115
#ifndef __NR_epoll_wait
104116
# if defined(__x86_64__)
105117
# define __NR_epoll_wait 232 /* used to be 215 */
118+
# elif defined(__aarch64__)
119+
/* deprecated */
106120
# elif defined(__i386__)
107121
# define __NR_epoll_wait 256
108122
# elif defined(__arm__)
@@ -115,6 +129,8 @@
115129
# define __NR_epoll_pwait 281
116130
# elif defined(__i386__)
117131
# define __NR_epoll_pwait 319
132+
# elif defined(__aarch64__)
133+
# define __NR_epoll_pwait 22
118134
# elif defined(__arm__)
119135
# define __NR_epoll_pwait (UV_SYSCALL_BASE + 346)
120136
# endif
@@ -125,6 +141,8 @@
125141
# define __NR_inotify_init 253
126142
# elif defined(__i386__)
127143
# define __NR_inotify_init 291
144+
# elif defined(__aarch64__)
145+
/* not defined without __ARCH_WANT_SYSCALL_NO_FLAGS */
128146
# elif defined(__arm__)
129147
# define __NR_inotify_init (UV_SYSCALL_BASE + 316)
130148
# endif
@@ -135,6 +153,8 @@
135153
# define __NR_inotify_init1 294
136154
# elif defined(__i386__)
137155
# define __NR_inotify_init1 332
156+
# elif defined(__aarch64__)
157+
# define __NR_inotify_init1 26
138158
# elif defined(__arm__)
139159
# define __NR_inotify_init1 (UV_SYSCALL_BASE + 360)
140160
# endif
@@ -145,6 +165,8 @@
145165
# define __NR_inotify_add_watch 254
146166
# elif defined(__i386__)
147167
# define __NR_inotify_add_watch 292
168+
# elif defined(__aarch64__)
169+
# define __NR_inotify_add_watch 27
148170
# elif defined(__arm__)
149171
# define __NR_inotify_add_watch (UV_SYSCALL_BASE + 317)
150172
# endif
@@ -155,6 +177,8 @@
155177
# define __NR_inotify_rm_watch 255
156178
# elif defined(__i386__)
157179
# define __NR_inotify_rm_watch 293
180+
# elif defined(__aarch64__)
181+
# define __NR_inotify_rm_watch 28
158182
# elif defined(__arm__)
159183
# define __NR_inotify_rm_watch (UV_SYSCALL_BASE + 318)
160184
# endif
@@ -165,6 +189,8 @@
165189
# define __NR_pipe2 293
166190
# elif defined(__i386__)
167191
# define __NR_pipe2 331
192+
# elif defined(__aarch64__)
193+
# define __NR_pipe2 59
168194
# elif defined(__arm__)
169195
# define __NR_pipe2 (UV_SYSCALL_BASE + 359)
170196
# endif
@@ -175,6 +201,8 @@
175201
# define __NR_recvmmsg 299
176202
# elif defined(__i386__)
177203
# define __NR_recvmmsg 337
204+
# elif defined(__aarch64__)
205+
# define __NR_recvmmsg 212
178206
# elif defined(__arm__)
179207
# define __NR_recvmmsg (UV_SYSCALL_BASE + 365)
180208
# endif
@@ -185,6 +213,8 @@
185213
# define __NR_sendmmsg 307
186214
# elif defined(__i386__)
187215
# define __NR_sendmmsg 345
216+
# elif defined(__aarch64__)
217+
# define __NR_sendmmsg 211
188218
# elif defined(__arm__)
189219
# define __NR_sendmmsg (UV_SYSCALL_BASE + 374)
190220
# endif
@@ -195,6 +225,8 @@
195225
# define __NR_utimensat 280
196226
# elif defined(__i386__)
197227
# define __NR_utimensat 320
228+
# elif defined(__aarch64__)
229+
# define __NR_utimensat 88
198230
# elif defined(__arm__)
199231
# define __NR_utimensat (UV_SYSCALL_BASE + 348)
200232
# endif
@@ -205,6 +237,8 @@
205237
# define __NR_preadv 295
206238
# elif defined(__i386__)
207239
# define __NR_preadv 333
240+
# elif defined(__aarch64__)
241+
# define __NR_preadv 69
208242
# elif defined(__arm__)
209243
# define __NR_preadv (UV_SYSCALL_BASE + 361)
210244
# endif
@@ -215,6 +249,8 @@
215249
# define __NR_pwritev 296
216250
# elif defined(__i386__)
217251
# define __NR_pwritev 334
252+
# elif defined(__aarch64__)
253+
# define __NR_pwritev 70
218254
# elif defined(__arm__)
219255
# define __NR_pwritev (UV_SYSCALL_BASE + 362)
220256
# endif
@@ -225,6 +261,8 @@
225261
# define __NR_dup3 292
226262
# elif defined(__i386__)
227263
# define __NR_dup3 330
264+
# elif defined(__aarch64__)
265+
# define __NR_dup3 24
228266
# elif defined(__arm__)
229267
# define __NR_dup3 (UV_SYSCALL_BASE + 358)
230268
# endif

0 commit comments

Comments
 (0)