Skip to content

Commit d0a7017

Browse files
committed
autogenerate syscall table
1 parent 9d8fd89 commit d0a7017

File tree

13 files changed

+947
-274
lines changed

13 files changed

+947
-274
lines changed

so3/Kbuild

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,31 @@
22
# Kbuild for top-level directory of the kernel
33
# This file takes care of the following:
44

5-
# Generate asm-offsets.h
5+
# Generate syscall_table.h.in and syscall_number.h
6+
7+
syscall-files = include/generated/syscall_table.h.in
8+
syscall-files += include/generated/syscall_number.h
9+
syscall-script = scripts/syscall_gen.sh
10+
syscall-src = syscall.tbl arch/$(SRCARCH)/syscall.h.in
11+
12+
quiet_cmd_syscall_gen = GEN $@
13+
cmd_syscall_gen = $(syscall-script) $(syscall-src) $(syscall-files)
14+
15+
$(syscall-files) &: $(syscall-script) $(syscall-src) Kbuild FORCE
16+
$(call if_changed,syscall_gen)
17+
18+
always := $(syscall-files)
19+
targets := $(syscall-files)
20+
21+
# Generate asm-offsets.h
622
#
723

824
offsets-file := include/generated/asm-offsets.h
925

10-
always := $(offsets-file)
11-
targets := $(offsets-file)
26+
always += $(offsets-file)
27+
targets += $(offsets-file)
1228
targets += arch/$(SRCARCH)/asm-offsets.s
13-
29+
1430
# Default sed regexp - multiline due to syntax constraints
1531
define sed-y
1632
"/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"
@@ -34,10 +50,9 @@ define cmd_offsets
3450
endef
3551

3652
# We use internal kbuild rules to avoid the "is up to date" message from make
37-
arch/$(SRCARCH)/asm-offsets.s: $(srctree)/arch/$(SRCARCH)/asm-offsets.c FORCE
53+
arch/$(SRCARCH)/asm-offsets.s: $(srctree)/arch/$(SRCARCH)/asm-offsets.c include/generated/syscall_number.h FORCE
3854
$(Q)mkdir -p $(dir $@)
3955
$(call if_changed_dep,cc_s_c)
4056

4157
$(offsets-file): arch/$(SRCARCH)/asm-offsets.s Kbuild
4258
$(call cmd,offsets)
43-

so3/arch/arm32/context.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ ENTRY(__root_proc)
272272
mov r0, #STDOUT
273273
adr r1, .LC_welcome
274274
mov r2, #welcome_len
275-
mov r7, #SYSCALL_WRITE
275+
mov r7, #SYSCALL_write
276276
@ Invoke the syscall - kernel side
277277
svc 0
278278

@@ -282,6 +282,6 @@ ENTRY(__root_proc)
282282
mov r1, #0
283283
mov r2, #0
284284

285-
mov r7, #SYSCALL_EXECVE
285+
mov r7, #SYSCALL_execve
286286

287287
svc 0

so3/arch/arm32/exception.S

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ syscall_interrupt:
199199
add lr, sp, #OFFSET_SP_USR
200200
stmia lr, {sp, lr}^
201201

202-
cmp r7, #SYSCALL_SIGRETURN
202+
cmp r7, #SYSCALL_sigreturn
203203
beq __after_push_sp_usr
204204
205205
ldr r0, [sp, #OFFSET_SP_USR]
@@ -228,7 +228,7 @@ __after_push_sp_usr:
228228

229229
@ Check if sigreturn has been called. In this case, we
230230
@ clean the stack frame which has been used to manage the user handler.
231-
cmp r7, #SYSCALL_SIGRETURN
231+
cmp r7, #SYSCALL_sigreturn
232232
bne __no_sigreturn
233233

234234
@ Reset the stack frame by removing the one issued from sigreturn
@@ -246,7 +246,7 @@ __no_sigreturn:
246246
__ret_from_fork:
247247

248248
@ Store the return value on the stack frame
249-
cmp r7, #SYSCALL_SIGRETURN
249+
cmp r7, #SYSCALL_sigreturn
250250
strne r0, [sp, #OFFSET_R0]
251251

252252
#ifdef CONFIG_IPC_SIGNAL

so3/arch/arm32/include/asm/syscall_number.h

Lines changed: 0 additions & 105 deletions
This file was deleted.

0 commit comments

Comments
 (0)