/branches/dynload/uspace/lib/rtld/arch/ppc32/src/runtime.c |
---|
42,7 → 42,7 |
{ |
asm volatile ( |
"mr %%r3, %0\n" |
"li %%r9, 30\n" |
"li %%r9, 31\n" |
"sc\n" |
: |
: "r" (i) |
/branches/dynload/uspace/lib/rtld/arch/ppc32/src/bootstrap.c |
---|
49,7 → 49,7 |
{ |
asm volatile ( |
"mr %%r3, %0\n" |
"li %%r9, 30\n" |
"li %%r9, 31\n" |
"sc\n" |
: |
: "r" (i) |
/branches/dynload/uspace/lib/rtld/arch/ia32/src/runtime.c |
---|
42,7 → 42,7 |
{ |
unsigned dummy; |
asm volatile ( |
"movl $30, %%eax;" |
"movl $31, %%eax;" |
"int $0x30" |
: "=d" (dummy) /* output - %edx clobbered */ |
: "d" (i) /* input */ |
/branches/dynload/uspace/lib/rtld/arch/ia32/src/bootstrap.c |
---|
46,7 → 46,7 |
{ |
unsigned dummy; |
asm volatile ( |
"movl $30, %%eax;" |
"movl $31, %%eax;" |
"int $0x30" |
: "=d" (dummy) /* output - %edx clobbered */ |
: "d" (i) /* input */ |
/branches/dynload/uspace/lib/libc/include/task.h |
---|
40,6 → 40,7 |
typedef uint64_t task_id_t; |
extern task_id_t task_get_id(void); |
task_id_t task_spawn(const char *path, const char *argv[]); |
#endif |
/branches/dynload/uspace/lib/libc/generic/task.c |
---|
33,7 → 33,9 |
*/ |
#include <task.h> |
#include <libc.h> |
#include <ipc/ipc.h> |
#include <async.h> |
#include <errno.h> |
task_id_t task_get_id(void) |
{ |
44,5 → 46,50 |
return task_id; |
} |
static int task_spawn_loader(void) |
{ |
int phone_id, rc; |
rc = __SYSCALL1(SYS_TASK_SPAWN, (sysarg_t) &phone_id); |
if (rc != 0) |
return rc; |
return phone_id; |
} |
#include <stdio.h> |
#include <unistd.h> |
task_id_t task_spawn(const char *path, const char *argv[]) |
{ |
int phone_id; |
ipc_call_t answer; |
aid_t req; |
int rc; |
phone_id = task_spawn_loader(); |
if (phone_id < 0) return 0; |
printf("phone_id:%d\n", phone_id); |
// getchar(); |
// req = async_send_0(phone_id, 1024, &answer); |
rc = ipc_data_write_start(phone_id, (void *)path, strlen(path)); |
printf("->%d\n", rc); |
if (rc != EOK) { |
// async_wait_for(req, NULL); |
return 1; |
} |
// async_wait_for(req, &rc); |
if (rc != EOK) return 0; |
// rc = async_req_0_0(phone_id, 1025); |
// printf("->%d\n", rc); |
// if (rc != EOK) return 0; |
// ipc_hangup(phone_id); |
return 1; |
} |
/** @} |
*/ |