/branches/dynload/uspace/lib/libc/include/libc.h |
---|
48,7 → 48,7 |
#define __SYSCALL6(id, p1, p2, p3, p4, p5, p6) \ |
__syscall(p1, p2, p3, p4, p5, p6,id) |
extern void __main(void); |
extern void __main(void *pcb_ptr); |
extern void __exit(void); |
#endif |
/branches/dynload/uspace/lib/libc/generic/libc.c |
---|
48,6 → 48,7 |
#include <ipc/ipc.h> |
#include <async.h> |
#include <as.h> |
#include <loader/pcb.h> |
extern char _heap; |
56,7 → 57,7 |
thread_exit(status); |
} |
void __main(void) |
void __main(void *pcb_ptr) |
{ |
fibril_t *f; |
/branches/dynload/uspace/lib/libc/arch/sparc64/src/entry.s |
---|
34,12 → 34,18 |
## User-space task entry point |
# |
# %o0 contains uarg |
# %o1 contains pcb_ptr |
# |
__entry: |
# Pass pcb_ptr as the first argument to __main() |
mov %o1, %o0 |
sethi %hi(_gp), %l7 |
call __main |
or %l7, %lo(_gp), %l7 |
call main |
nop |
call __exit |
nop |
/branches/dynload/uspace/lib/libc/arch/ia64/src/entry.s |
---|
34,10 → 34,14 |
## User-space task entry point |
# |
# r2 contains the PCB pointer |
# |
__entry: |
alloc loc0 = ar.pfs, 0, 1, 2, 0 |
mov r1 = _gp |
mov r1 = _gp |
# Pass PCB pointer as the first argument to __main |
mov out0 = r2 |
br.call.sptk.many b0 = __main |
0: |
br.call.sptk.many b0 = main |
/branches/dynload/uspace/lib/libc/arch/arm32/src/entry.s |
---|
34,8 → 34,12 |
## User-space task entry point |
# |
# r1 contains the PCB pointer |
# |
__entry: |
# Pass pcb_ptr to __main as the first argument (in r0) |
mov r0, r1 |
bl __main |
bl main |
bl __exit |
/branches/dynload/uspace/lib/libc/arch/ppc32/src/entry.s |
---|
34,8 → 34,12 |
## User-space task entry point |
# |
# r3 contains the PCB pointer |
# |
__entry: |
# Pass the PCB pointer to __main() as the first argument. |
# Since the first argument is passed in r3, no operation is needed. |
bl __main |
bl main |
bl __exit |
/branches/dynload/uspace/lib/libc/arch/amd64/src/entry.s |
---|
34,8 → 34,12 |
## User-space task entry point |
# |
# %rdi contains the PCB pointer |
# |
__entry: |
# %rdi was deliberately chosen as the first argument is also in %rdi |
# Pass PCB pointer to __main (no operation) |
call __main |
call main |
call __exit |
/branches/dynload/uspace/lib/libc/arch/mips32/src/entry.s |
---|
35,13 → 35,13 |
## User-space task entry point |
# |
# $a0 ($4) contains the PCB pointer |
# |
.ent __entry |
__entry: |
.frame $sp, 32, $31 |
.cpload $25 |
# Mips o32 may store its arguments on stack, make space (16 bytes), |
# so that it could work with -O0 |
# Make space additional 16 bytes for the stack frame |
48,7 → 48,11 |
addiu $sp, -32 |
.cprestore 16 # Allow PIC code |
# Pass pcb_ptr to __main() as the first argument. pcb_ptr is already |
# in $a0. As the first argument is passed in $a0, no operation |
# is needed. |
jal __main |
nop |
/branches/dynload/uspace/lib/libc/arch/ia32/src/entry.s |
---|
34,6 → 34,7 |
## User-space task entry point |
# |
# %ebx contains the PCB pointer |
# |
__entry: |
mov %ss, %ax |
41,7 → 42,10 |
mov %ax, %es |
mov %ax, %fs |
# Do not set %gs, it contains descriptor that can see TLS |
# Pass the PCB pointer to __main as the first argument |
pushl %ebx |
call __main |
call main |
call __exit |