Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 21 additions & 6 deletions so3/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,31 @@
# Kbuild for top-level directory of the kernel
# This file takes care of the following:

# Generate asm-offsets.h
# Generate syscall_table.h.in and syscall_number.h

syscall-files = include/generated/syscall_table.h.in
syscall-files += include/generated/syscall_number.h
syscall-script = scripts/syscall_gen.sh
syscall-src = syscall.tbl arch/$(SRCARCH)/syscall.h.in

quiet_cmd_syscall_gen = GEN $@
cmd_syscall_gen = $(syscall-script) $(syscall-src) $(syscall-files)

$(syscall-files) &: $(syscall-script) $(syscall-src) Kbuild FORCE
$(call if_changed,syscall_gen)

always := $(syscall-files)
targets := $(syscall-files)

# Generate asm-offsets.h
#

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

always := $(offsets-file)
targets := $(offsets-file)
always += $(offsets-file)
targets += $(offsets-file)
targets += arch/$(SRCARCH)/asm-offsets.s

# Default sed regexp - multiline due to syntax constraints
define sed-y
"/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"
Expand All @@ -34,10 +50,9 @@ define cmd_offsets
endef

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

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

4 changes: 2 additions & 2 deletions so3/arch/arm32/context.S
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ ENTRY(__root_proc)
mov r0, #STDOUT
adr r1, .LC_welcome
mov r2, #welcome_len
mov r7, #SYSCALL_WRITE
mov r7, #SYSCALL_write
@ Invoke the syscall - kernel side
svc 0

Expand All @@ -282,6 +282,6 @@ ENTRY(__root_proc)
mov r1, #0
mov r2, #0

mov r7, #SYSCALL_EXECVE
mov r7, #SYSCALL_execve

svc 0
6 changes: 3 additions & 3 deletions so3/arch/arm32/exception.S
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ syscall_interrupt:
add lr, sp, #OFFSET_SP_USR
stmia lr, {sp, lr}^

cmp r7, #SYSCALL_SIGRETURN
cmp r7, #SYSCALL_sigreturn
beq __after_push_sp_usr

ldr r0, [sp, #OFFSET_SP_USR]
Expand Down Expand Up @@ -228,7 +228,7 @@ __after_push_sp_usr:

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

@ Reset the stack frame by removing the one issued from sigreturn
Expand All @@ -246,7 +246,7 @@ __no_sigreturn:
__ret_from_fork:

@ Store the return value on the stack frame
cmp r7, #SYSCALL_SIGRETURN
cmp r7, #SYSCALL_sigreturn
strne r0, [sp, #OFFSET_R0]

#ifdef CONFIG_IPC_SIGNAL
Expand Down
105 changes: 0 additions & 105 deletions so3/arch/arm32/include/asm/syscall_number.h

This file was deleted.

Loading