mirror of
https://github.com/drasko/codezero.git
synced 2026-08-04 21:40:07 +02:00
Added a simplified ascii_to_int() implementation.
Removed dependency on hard-coded pager id. Pager id is now passed as an environment string `pagerid' to tasks. Alternatively, this could take space in the utcb of each task.
This commit is contained in:
@@ -42,7 +42,7 @@ int init_execve(char *filepath)
|
||||
struct exec_file_desc efd;
|
||||
struct tcb *new_task, *self;
|
||||
struct args_struct args, env;
|
||||
char *env_string = "pagerid=0";
|
||||
char env_string[30];
|
||||
int err;
|
||||
int fd;
|
||||
|
||||
@@ -52,6 +52,8 @@ int init_execve(char *filepath)
|
||||
.tgid = TASK_ID_INVALID,
|
||||
};
|
||||
|
||||
sprintf(env_string, "pagerid=%d", self_tid());
|
||||
|
||||
/* Set up args_struct */
|
||||
args.argc = 1;
|
||||
args.argv = alloca(sizeof(args.argv));
|
||||
|
||||
@@ -434,8 +434,6 @@ struct tcb *task_create(struct tcb *parent, struct task_ids *ids,
|
||||
*
|
||||
* (low) |->argc|argv[0]|argv[1]|...|argv[argc] = 0|envp[0]|envp[1]|...|NULL| (high)
|
||||
*
|
||||
* IOW:
|
||||
*
|
||||
* argc
|
||||
* argv pointers
|
||||
* null
|
||||
@@ -447,8 +445,10 @@ struct tcb *task_create(struct tcb *parent, struct task_ids *ids,
|
||||
* space, heap seems to get used in uClibc.
|
||||
*
|
||||
*/
|
||||
int task_copy_args_to_user(char *user_stack, unsigned long user_ptr,
|
||||
struct args_struct *args, struct args_struct *env)
|
||||
int task_copy_args_to_user(char *user_stack,
|
||||
unsigned long user_ptr,
|
||||
struct args_struct *args,
|
||||
struct args_struct *env)
|
||||
{
|
||||
char **argv_start, **envp_start;
|
||||
|
||||
@@ -503,6 +503,7 @@ int task_copy_args_to_user(char *user_stack, unsigned long user_ptr,
|
||||
| ((unsigned long)user_stack &
|
||||
PAGE_MASK));
|
||||
|
||||
/* Update location */
|
||||
user_stack += strlen(env->argv[i]) + 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user