Skip to content

Commit

Permalink
deps, uv, linux: support armv8 (aarch64)
Browse files Browse the repository at this point in the history
Numbers are taken from include/uapi/asm-generic/unistd.h.
  • Loading branch information
Shigeki Ohtsu committed Mar 30, 2015
1 parent 8d1c87e commit 5baf3dd
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 6 deletions.
13 changes: 7 additions & 6 deletions deps/uv/src/unix/linux-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
if (pthread_sigmask(SIG_BLOCK, &sigset, NULL))
abort();

if (sigmask != 0 && no_epoll_pwait == 0) {
if (no_epoll_pwait == 0) {
nfds = uv__epoll_pwait(loop->backend_fd,
events,
ARRAY_SIZE(events),
Expand Down Expand Up @@ -579,6 +579,7 @@ static int read_models(unsigned int numcpus, uv_cpu_info_t* ci) {
speed_idx = 0;

#if defined(__arm__) || \
defined(__aarch64__) || \
defined(__i386__) || \
defined(__mips__) || \
defined(__x86_64__)
Expand All @@ -599,9 +600,9 @@ static int read_models(unsigned int numcpus, uv_cpu_info_t* ci) {
continue;
}
}
#if defined(__arm__) || defined(__mips__)
#if defined(__arm__) || defined(__mips__) || defined(__aarch64__)
if (model_idx < numcpus) {
#if defined(__arm__)
#if defined(__arm__) || defined(__aarch64)
/* Fallback for pre-3.8 kernels. */
static const char model_marker[] = "Processor\t: ";
#else /* defined(__mips__) */
Expand All @@ -618,18 +619,18 @@ static int read_models(unsigned int numcpus, uv_cpu_info_t* ci) {
continue;
}
}
#else /* !__arm__ && !__mips__ */
#else /* !__arm__ && !__mips__ && !__aarch64__ */
if (speed_idx < numcpus) {
if (strncmp(buf, speed_marker, sizeof(speed_marker) - 1) == 0) {
ci[speed_idx++].speed = atoi(buf + sizeof(speed_marker) - 1);
continue;
}
}
#endif /* __arm__ || __mips__ */
#endif /* __arm__ || __mips__ || __aarch64__ */
}

fclose(fp);
#endif /* __arm__ || __i386__ || __mips__ || __x86_64__ */
#endif /* __arm__ || __aarch64__ || __i386__ || __mips__ || __x86_64__ */

/* Now we want to make sure that all the models contain *something* because
* it's not safe to leave them as null. Copy the last entry unless there
Expand Down
38 changes: 38 additions & 0 deletions deps/uv/src/unix/linux-syscalls.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
# define __NR_accept4 288
# elif defined(__i386__)
/* Nothing. Handled through socketcall(). */
# elif defined(__aarch64__)
# define __NR_accept4 242
# elif defined(__arm__)
# define __NR_accept4 (UV_SYSCALL_BASE + 366)
# endif
Expand All @@ -55,6 +57,8 @@
# define __NR_eventfd 284
# elif defined(__i386__)
# define __NR_eventfd 323
# elif defined(__aarch64__)
# define __NR_eventfd 1044
# elif defined(__arm__)
# define __NR_eventfd (UV_SYSCALL_BASE + 351)
# endif
Expand All @@ -65,6 +69,8 @@
# define __NR_eventfd2 290
# elif defined(__i386__)
# define __NR_eventfd2 328
# elif defined(__aarch64__)
# define __NR_eventfd2 19
# elif defined(__arm__)
# define __NR_eventfd2 (UV_SYSCALL_BASE + 356)
# endif
Expand All @@ -75,6 +81,8 @@
# define __NR_epoll_create 213
# elif defined(__i386__)
# define __NR_epoll_create 254
# elif defined(__aarch64__)
/* not defined without __ARCH_WANT_SYSCALL_NO_FLAGS */
# elif defined(__arm__)
# define __NR_epoll_create (UV_SYSCALL_BASE + 250)
# endif
Expand All @@ -85,6 +93,8 @@
# define __NR_epoll_create1 291
# elif defined(__i386__)
# define __NR_epoll_create1 329
# elif defined(__aarch64__)
# define __NR_epoll_create1 20
# elif defined(__arm__)
# define __NR_epoll_create1 (UV_SYSCALL_BASE + 357)
# endif
Expand All @@ -95,6 +105,8 @@
# define __NR_epoll_ctl 233 /* used to be 214 */
# elif defined(__i386__)
# define __NR_epoll_ctl 255
# elif defined(__aarch64__)
# define __NR_epoll_ctl 21
# elif defined(__arm__)
# define __NR_epoll_ctl (UV_SYSCALL_BASE + 251)
# endif
Expand All @@ -103,6 +115,8 @@
#ifndef __NR_epoll_wait
# if defined(__x86_64__)
# define __NR_epoll_wait 232 /* used to be 215 */
# elif defined(__aarch64__)
/* deprecated */
# elif defined(__i386__)
# define __NR_epoll_wait 256
# elif defined(__arm__)
Expand All @@ -115,6 +129,8 @@
# define __NR_epoll_pwait 281
# elif defined(__i386__)
# define __NR_epoll_pwait 319
# elif defined(__aarch64__)
# define __NR_epoll_pwait 22
# elif defined(__arm__)
# define __NR_epoll_pwait (UV_SYSCALL_BASE + 346)
# endif
Expand All @@ -125,6 +141,8 @@
# define __NR_inotify_init 253
# elif defined(__i386__)
# define __NR_inotify_init 291
# elif defined(__aarch64__)
/* not defined without __ARCH_WANT_SYSCALL_NO_FLAGS */
# elif defined(__arm__)
# define __NR_inotify_init (UV_SYSCALL_BASE + 316)
# endif
Expand All @@ -135,6 +153,8 @@
# define __NR_inotify_init1 294
# elif defined(__i386__)
# define __NR_inotify_init1 332
# elif defined(__aarch64__)
# define __NR_inotify_init1 26
# elif defined(__arm__)
# define __NR_inotify_init1 (UV_SYSCALL_BASE + 360)
# endif
Expand All @@ -145,6 +165,8 @@
# define __NR_inotify_add_watch 254
# elif defined(__i386__)
# define __NR_inotify_add_watch 292
# elif defined(__aarch64__)
# define __NR_inotify_add_watch 27
# elif defined(__arm__)
# define __NR_inotify_add_watch (UV_SYSCALL_BASE + 317)
# endif
Expand All @@ -155,6 +177,8 @@
# define __NR_inotify_rm_watch 255
# elif defined(__i386__)
# define __NR_inotify_rm_watch 293
# elif defined(__aarch64__)
# define __NR_inotify_rm_watch 28
# elif defined(__arm__)
# define __NR_inotify_rm_watch (UV_SYSCALL_BASE + 318)
# endif
Expand All @@ -165,6 +189,8 @@
# define __NR_pipe2 293
# elif defined(__i386__)
# define __NR_pipe2 331
# elif defined(__aarch64__)
# define __NR_pipe2 59
# elif defined(__arm__)
# define __NR_pipe2 (UV_SYSCALL_BASE + 359)
# endif
Expand All @@ -175,6 +201,8 @@
# define __NR_recvmmsg 299
# elif defined(__i386__)
# define __NR_recvmmsg 337
# elif defined(__aarch64__)
# define __NR_recvmmsg 212
# elif defined(__arm__)
# define __NR_recvmmsg (UV_SYSCALL_BASE + 365)
# endif
Expand All @@ -185,6 +213,8 @@
# define __NR_sendmmsg 307
# elif defined(__i386__)
# define __NR_sendmmsg 345
# elif defined(__aarch64__)
# define __NR_sendmmsg 211
# elif defined(__arm__)
# define __NR_sendmmsg (UV_SYSCALL_BASE + 374)
# endif
Expand All @@ -195,6 +225,8 @@
# define __NR_utimensat 280
# elif defined(__i386__)
# define __NR_utimensat 320
# elif defined(__aarch64__)
# define __NR_utimensat 88
# elif defined(__arm__)
# define __NR_utimensat (UV_SYSCALL_BASE + 348)
# endif
Expand All @@ -205,6 +237,8 @@
# define __NR_preadv 295
# elif defined(__i386__)
# define __NR_preadv 333
# elif defined(__aarch64__)
# define __NR_preadv 69
# elif defined(__arm__)
# define __NR_preadv (UV_SYSCALL_BASE + 361)
# endif
Expand All @@ -215,6 +249,8 @@
# define __NR_pwritev 296
# elif defined(__i386__)
# define __NR_pwritev 334
# elif defined(__aarch64__)
# define __NR_pwritev 70
# elif defined(__arm__)
# define __NR_pwritev (UV_SYSCALL_BASE + 362)
# endif
Expand All @@ -225,6 +261,8 @@
# define __NR_dup3 292
# elif defined(__i386__)
# define __NR_dup3 330
# elif defined(__aarch64__)
# define __NR_dup3 24
# elif defined(__arm__)
# define __NR_dup3 (UV_SYSCALL_BASE + 358)
# endif
Expand Down

0 comments on commit 5baf3dd

Please sign in to comment.