Skip to content

Commit f3240c1

Browse files
committed
avr32: wire up missing syscalls
This patch adds a bunch of missing syscalls to AVR32: __NR_pread64 __NR_pwrite64 __NR_timerfd_create __NR_fallocate __NR_timerfd_settime __NR_timerfd_gettime __NR_signalfd4 __NR_eventfd2 __NR_epoll_create1 __NR_dup3 __NR_pipe2 __NR_inotify_init1 __NR_preadv __NR_pwritev __NR_rt_tgsigqueueinfo __NR_perf_event_open __NR_recvmmsg __NR_fanotify_init __NR_fanotify_mark __NR_prlimit64 __NR_name_to_handle_at __NR_open_by_handle_at __NR_clock_adjtime __NR_syncfs __NR_sendmmsg __NR_process_vm_readv __NR_process_vm_writev __NR_kcmp __NR_finit_module __NR_sched_setattr __NR_sched_getattr __NR_renameat2 __NR_seccomp __NR_getrandom __NR_memfd_create __NR_bpf __NR_execveat On AVR32, all parameters beyond the 5th are passed on the stack. System calls don't use the stack -- they borrow a callee-saved register instead. This means that syscalls that take 6 parameters must be called through a stub that pushes the last parameter on the stack. This relates to syscall fallocate, fanotify_mark, process_vm_readv, and process_vm_writev. Signed-off-by: Hans-Christian Egtvedt <[email protected]>
1 parent bfa76d4 commit f3240c1

File tree

4 files changed

+111
-5
lines changed

4 files changed

+111
-5
lines changed

arch/avr32/include/asm/unistd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
#include <uapi/asm/unistd.h>
1212

13-
#define NR_syscalls 284
13+
#define NR_syscalls 321
1414

1515
/* Old stuff */
1616
#define __IGNORE_uselib

arch/avr32/include/uapi/asm/unistd.h

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,6 @@
222222
#define __NR_epoll_wait 207
223223
#define __NR_remap_file_pages 208
224224
#define __NR_set_tid_address 209
225-
226225
#define __NR_timer_create 210
227226
#define __NR_timer_settime 211
228227
#define __NR_timer_gettime 212
@@ -238,7 +237,6 @@
238237
/* 222 reserved for tux */
239238
#define __NR_utimes 223
240239
#define __NR_fadvise64_64 224
241-
242240
#define __NR_cacheflush 225
243241

244242
#define __NR_vserver 226
@@ -281,7 +279,6 @@
281279
#define __NR_tee 263
282280
#define __NR_vmsplice 264
283281
#define __NR_epoll_pwait 265
284-
285282
#define __NR_msgget 266
286283
#define __NR_msgsnd 267
287284
#define __NR_msgrcv 268
@@ -294,11 +291,47 @@
294291
#define __NR_shmget 275
295292
#define __NR_shmdt 276
296293
#define __NR_shmctl 277
297-
298294
#define __NR_utimensat 278
299295
#define __NR_signalfd 279
300296
/* 280 was __NR_timerfd */
301297
#define __NR_eventfd 281
302298
#define __NR_setns 283
299+
#define __NR_pread64 284
300+
#define __NR_pwrite64 285
301+
#define __NR_timerfd_create 286
302+
#define __NR_fallocate 287
303+
#define __NR_timerfd_settime 288
304+
#define __NR_timerfd_gettime 289
305+
#define __NR_signalfd4 290
306+
#define __NR_eventfd2 291
307+
#define __NR_epoll_create1 292
308+
#define __NR_dup3 293
309+
#define __NR_pipe2 294
310+
#define __NR_inotify_init1 295
311+
#define __NR_preadv 296
312+
#define __NR_pwritev 297
313+
#define __NR_rt_tgsigqueueinfo 298
314+
#define __NR_perf_event_open 299
315+
#define __NR_recvmmsg 300
316+
#define __NR_fanotify_init 301
317+
#define __NR_fanotify_mark 302
318+
#define __NR_prlimit64 303
319+
#define __NR_name_to_handle_at 304
320+
#define __NR_open_by_handle_at 305
321+
#define __NR_clock_adjtime 306
322+
#define __NR_syncfs 307
323+
#define __NR_sendmmsg 308
324+
#define __NR_process_vm_readv 309
325+
#define __NR_process_vm_writev 310
326+
#define __NR_kcmp 311
327+
#define __NR_finit_module 312
328+
#define __NR_sched_setattr 313
329+
#define __NR_sched_getattr 314
330+
#define __NR_renameat2 315
331+
#define __NR_seccomp 316
332+
#define __NR_getrandom 317
333+
#define __NR_memfd_create 318
334+
#define __NR_bpf 319
335+
#define __NR_execveat 320
303336

304337
#endif /* _UAPI__ASM_AVR32_UNISTD_H */

arch/avr32/kernel/syscall-stubs.S

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,39 @@ __sys_sync_file_range:
8888
call sys_sync_file_range
8989
sub sp, -4
9090
popm pc
91+
92+
.global __sys_fallocate
93+
.type __sys_fallocate,@function
94+
__sys_fallocate:
95+
pushm lr
96+
st.w --sp, ARG6
97+
call sys_fallocate
98+
sub sp, -4
99+
popm pc
100+
101+
.global __sys_fanotify_mark
102+
.type __sys_fanotify_mark,@function
103+
__sys_fanotify_mark:
104+
pushm lr
105+
st.w --sp, ARG6
106+
call sys_fanotify_mark
107+
sub sp, -4
108+
popm pc
109+
110+
.global __sys_process_vm_readv
111+
.type __sys_process_vm_readv,@function
112+
__sys_process_vm_readv:
113+
pushm lr
114+
st.w --sp, ARG6
115+
call sys_process_vm_readv
116+
sub sp, -4
117+
popm pc
118+
119+
.global __sys_process_vm_writev
120+
.type __sys_process_vm_writev,@function
121+
__sys_process_vm_writev:
122+
pushm lr
123+
st.w --sp, ARG6
124+
call sys_process_vm_writev
125+
sub sp, -4
126+
popm pc

arch/avr32/kernel/syscall_table.S

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,4 +297,41 @@ sys_call_table:
297297
.long sys_eventfd
298298
.long sys_recvmmsg
299299
.long sys_setns
300+
.long sys_pread64
301+
.long sys_pwrite64 /* 285 */
302+
.long sys_timerfd_create
303+
.long __sys_fallocate
304+
.long sys_timerfd_settime
305+
.long sys_timerfd_gettime
306+
.long sys_signalfd4 /* 290 */
307+
.long sys_eventfd2
308+
.long sys_epoll_create1
309+
.long sys_dup3
310+
.long sys_pipe2
311+
.long sys_inotify_init1 /* 295 */
312+
.long sys_preadv
313+
.long sys_pwritev
314+
.long sys_rt_tgsigqueueinfo
315+
.long sys_perf_event_open
316+
.long sys_recvmmsg /* 300 */
317+
.long sys_fanotify_init
318+
.long __sys_fanotify_mark
319+
.long sys_prlimit64
320+
.long sys_name_to_handle_at
321+
.long sys_open_by_handle_at /* 305 */
322+
.long sys_clock_adjtime
323+
.long sys_syncfs
324+
.long sys_sendmmsg
325+
.long __sys_process_vm_readv
326+
.long __sys_process_vm_writev /* 310 */
327+
.long sys_kcmp
328+
.long sys_finit_module
329+
.long sys_sched_setattr
330+
.long sys_sched_getattr
331+
.long sys_renameat2 /* 315 */
332+
.long sys_seccomp
333+
.long sys_getrandom
334+
.long sys_memfd_create
335+
.long sys_bpf
336+
.long sys_execveat /* 320 */
300337
.long sys_ni_syscall /* r8 is saturated at nr_syscalls */

0 commit comments

Comments
 (0)