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:
Bahadir Balban
2009-10-17 18:48:30 +03:00
parent d19c5c26fd
commit 7ba7a2e796
33 changed files with 109 additions and 187 deletions

View File

@@ -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));

View File

@@ -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;
}