/branches/dynload/uspace/srv/loader/main.c |
139,7 → 139,7 |
// printf("entry point: 0x%llx\n", prog_info.entry); |
ipc_answer_0(rid, EOK); |
close_console(); |
elf_run(&prog_info); |
elf_run(&prog_info, __pcb_get()); |
return 0; |
} |
|
163,7 → 163,7 |
close_console(); |
|
ipc_answer_0(rid, EOK); |
elf_run(&interp_info); |
elf_run(&interp_info, __pcb_get()); |
|
/* Not reached(?) */ |
return 0; |
/branches/dynload/uspace/srv/loader/elf_load.c |
118,9 → 118,9 |
* |
* @param info Info structure filled earlier by elf_load_file() |
*/ |
void elf_run(elf_info_t *info) |
void elf_run(elf_info_t *info, void *pcb) |
{ |
program_run(info->entry); |
program_run(info->entry, pcb); |
|
/* not reached */ |
} |
/branches/dynload/uspace/srv/loader/arch/ia64/ia64.s |
28,9 → 28,14 |
|
.globl program_run |
|
## void program_run(uintptr_t entry_point); |
## void program_run(void *entry_point, void *pcb); |
# |
# in0 contains entry_point |
# in1 contains pcb |
# |
# Jump to a program entry point |
program_run: |
mov b1 = r32 ;; |
# Pass pcb to the entry point in r2 |
mov r2 = in1 |
mov b1 = in0 ;; |
br b1 ;; |
/branches/dynload/uspace/srv/loader/arch/arm32/arm32.s |
28,8 → 28,12 |
|
.globl program_run |
|
## void program_run(uintptr_t entry_point); |
## void program_run(void *entry_point, void *pcb); |
# |
# r0 contains entry_point |
# r1 contains pcb |
# |
# Jump to a program entry point |
program_run: |
# pcb is passed to the entry point in r1 (where it already is) |
mov r15, r0 |
/branches/dynload/uspace/srv/loader/arch/ppc32/ppc32.s |
28,9 → 28,13 |
|
.globl program_run |
|
## void program_run(uintptr_t entry_point); |
## void program_run(void *entry_point, void *pcb); |
# |
# %r3 contains entry_point |
# %r4 contains pcb |
# |
# Jump to a program entry point |
program_run: |
mtctr %r3 |
mr %r3, %r4 # Pass pcb to the entry point in %r3 |
bctr |
/branches/dynload/uspace/srv/loader/arch/amd64/amd64.s |
28,8 → 28,16 |
|
.globl program_run |
|
## void program_run(uintptr_t entry_point); |
## void program_run(void *entry_point, void *pcb); |
# |
# %rdi contains entry_point |
# %rsi contains pcb |
# |
# Jump to a program entry point |
program_run: |
jmp %rdi |
# pcb must be passed in %rdi, use %rdx as a scratch register |
mov %rdi, %rdx |
mov %rsi, %rdi |
|
# jump to entry point |
jmp %rdx |
/branches/dynload/uspace/srv/loader/arch/mips32/mips32.s |
31,12 → 31,19 |
.global program_run |
.set noreorder |
|
## void program_run(uintptr_t entry_point); |
## void program_run(void *entry_point, void *pcb); |
# |
# $a0 (=$4) contains entry_point |
# $a1 (=$5) contains pcb |
# |
# Jump to a program entry point |
.ent program_run |
program_run: |
move $25, $4 |
# tmp := entry_point |
move $25, $a0 |
|
# Pass pcb to the entry point in $a0 |
move $a0, $a1 |
jr $25 |
nop |
.end |
/branches/dynload/uspace/srv/loader/arch/ia32/ia32.s |
28,13 → 28,22 |
|
.globl program_run |
|
## void program_run(uintptr_t entry_point); |
## void program_run(void *entry_point, void *pcb); |
# |
# Jump to a program entry point |
program_run: |
# Use standard ia32 prologue not to confuse anybody |
push %ebp |
movl %esp, %ebp |
|
# %eax := entry_point |
movl 0x8(%ebp), %eax |
|
# %ebx := pcb |
# pcb is passed to the entry point int %ebx |
mov 0xc(%ebp), %ebx |
|
# Save a tiny bit of stack space |
pop %ebp |
|
jmp %eax |