diff options
author | Luca Dariz <luca@orpolo.org> | 2022-06-28 12:10:42 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2022-08-28 02:43:17 +0200 |
commit | 5013a77a1ec2008d033297716ad4e27c9f1d48b8 (patch) | |
tree | 859af4943ad3906e8e7295fcd449c1e6d2f675d6 /kern | |
parent | c6fb30a04df6455ae225f6ccf437f5eb907f1a2b (diff) | |
download | gnumach-5013a77a1ec2008d033297716ad4e27c9f1d48b8.tar.gz gnumach-5013a77a1ec2008d033297716ad4e27c9f1d48b8.tar.bz2 gnumach-5013a77a1ec2008d033297716ad4e27c9f1d48b8.zip |
fix argument passing to bootstrap modules
* kern/bootstrap.c: use rpc_ vm types to put the bootstrap module
arguments on the stack, make it consistent with user-space types.
Signed-off-by: Luca Dariz <luca@orpolo.org>
Message-Id: <20220628101054.446126-4-luca@orpolo.org>
Diffstat (limited to 'kern')
-rw-r--r-- | kern/bootstrap.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/kern/bootstrap.c b/kern/bootstrap.c index 60648c9d..259821ae 100644 --- a/kern/bootstrap.c +++ b/kern/bootstrap.c @@ -612,7 +612,7 @@ build_args_and_stack(struct exec_info *boot_exec_info, * and align to integer boundary */ arg_len += (sizeof(integer_t) - + (arg_count + 1 + envc + 1) * sizeof(char *)); + + (arg_count + 1 + envc + 1) * sizeof(rpc_vm_offset_t)); arg_len = (arg_len + sizeof(integer_t) - 1) & ~(sizeof(integer_t)-1); /* @@ -633,7 +633,7 @@ build_args_and_stack(struct exec_info *boot_exec_info, */ string_pos = (arg_pos + sizeof(integer_t) - + (arg_count + 1 + envc + 1) * sizeof(char *)); + + (arg_count + 1 + envc + 1) * sizeof(rpc_vm_offset_t)); /* * first the argument count @@ -651,10 +651,8 @@ build_args_and_stack(struct exec_info *boot_exec_info, arg_item_len = strlen(arg_ptr) + 1; /* include trailing 0 */ /* set string pointer */ - (void) copyout(&string_pos, - arg_pos, - sizeof (char *)); - arg_pos += sizeof(char *); + (void) copyout(&string_pos, arg_pos, sizeof (rpc_vm_offset_t)); + arg_pos += sizeof(rpc_vm_offset_t); /* copy string */ (void) copyout(arg_ptr, string_pos, arg_item_len); @@ -664,8 +662,8 @@ build_args_and_stack(struct exec_info *boot_exec_info, /* * Null terminator for argv. */ - (void) copyout(&zero, arg_pos, sizeof(char *)); - arg_pos += sizeof(char *); + (void) copyout(&zero, arg_pos, sizeof(rpc_vm_offset_t)); + arg_pos += sizeof(rpc_vm_offset_t); /* * Then the strings and string pointers for each environment variable @@ -675,10 +673,8 @@ build_args_and_stack(struct exec_info *boot_exec_info, arg_item_len = strlen(arg_ptr) + 1; /* include trailing 0 */ /* set string pointer */ - (void) copyout(&string_pos, - arg_pos, - sizeof (char *)); - arg_pos += sizeof(char *); + (void) copyout(&string_pos, arg_pos, sizeof (rpc_vm_offset_t)); + arg_pos += sizeof(rpc_vm_offset_t); /* copy string */ (void) copyout(arg_ptr, string_pos, arg_item_len); @@ -688,7 +684,7 @@ build_args_and_stack(struct exec_info *boot_exec_info, /* * Null terminator for envp. */ - (void) copyout(&zero, arg_pos, sizeof(char *)); + (void) copyout(&zero, arg_pos, sizeof(rpc_vm_offset_t)); } |