62,13 → 62,11 |
*/ |
void *program_loader = NULL; |
|
/** Create new task with 1 thread and run it |
/** Create a program using an existing address space. |
* |
* @param as Address space containing a binary program image. |
* @param entry_addr Program entry-point address in program address space. |
* @param name Program name. |
* |
* @return Task of the running program or NULL on error. |
* @param as Address space containing a binary program image. |
* @param entry_addr Program entry-point address in program address space. |
* @param p Buffer for storing program information. |
*/ |
void program_create(as_t *as, uintptr_t entry_addr, program_t *p) |
{ |
100,15 → 98,16 |
ASSERT(p->main_thread); |
} |
|
/** Parse an executable image in the physical memory. |
/** Parse an executable image in the kernel memory. |
* |
* If the image belongs to a program loader, it is registered as such, |
* (and *task is set to NULL). Otherwise a task is created from the |
* executable image. The task is returned in *task. |
* |
* @param program_addr Address of program executable image. |
* @param name Program name. |
* @param task Where to store the pointer to the newly created task. |
* @param image_addr Address of an executable program image. |
* @param p Buffer for storing program info. If image_addr |
* points to a loader image, p->task will be set to |
* NULL and EOK will be returned. |
* |
* @return EOK on success or negative error code. |
*/ |
141,10 → 140,8 |
|
/** Create a task from the program loader image. |
* |
* @param name Program name. |
* @param t Buffer for storing pointer to the newly created task. |
* |
* @return Task of the running program or NULL on error. |
* @param p Buffer for storing program info. |
* @return EOK on success or negative error code. |
*/ |
int program_create_loader(program_t *p) |
{ |
169,11 → 166,11 |
return EOK; |
} |
|
/** Make task ready. |
/** Make program ready. |
* |
* Switch task's thread to the ready state. |
* Switch program's main thread to the ready state. |
* |
* @param ta Task to make ready. |
* @param p Program to make ready. |
*/ |
void program_ready(program_t *p) |
{ |
180,7 → 177,7 |
thread_ready(p->main_thread); |
} |
|
/** Syscall for creating a new task from userspace. |
/** Syscall for creating a new loader instance from userspace. |
* |
* Creates a new task from the program loader image, connects a phone |
* to it and stores the phone id into the provided buffer. |