aboutsummaryrefslogtreecommitdiff
path: root/boot/userland-boot.c
diff options
context:
space:
mode:
authorSergey Bugaev <bugaevc@gmail.com>2023-05-09 00:31:22 +0300
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-05-10 02:41:45 +0200
commit75f76d10aad328a1af5961cb365a2b4325b98d8e (patch)
tree9072fb9c33576788ebe2f52afbeae7d0b2ecba31 /boot/userland-boot.c
parent202585da4315df1c68e6619d8097b06aaac98bbc (diff)
downloadhurd-75f76d10aad328a1af5961cb365a2b4325b98d8e.tar.gz
hurd-75f76d10aad328a1af5961cb365a2b4325b98d8e.tar.bz2
hurd-75f76d10aad328a1af5961cb365a2b4325b98d8e.zip
boot: Port to x64_64
Message-Id: <20230508213136.608575-28-bugaevc@gmail.com>
Diffstat (limited to 'boot/userland-boot.c')
-rw-r--r--boot/userland-boot.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/boot/userland-boot.c b/boot/userland-boot.c
index 2f9bd8cd..f407f0a6 100644
--- a/boot/userland-boot.c
+++ b/boot/userland-boot.c
@@ -257,7 +257,7 @@ boot_script_exec_cmd (void *hook,
{
char *args, *p;
int arg_len, i;
- size_t reg_size;
+ mach_msg_type_number_t reg_size;
void *arg_pos;
vm_offset_t stack_start, stack_end;
vm_address_t startpc, str_start;
@@ -313,8 +313,13 @@ boot_script_exec_cmd (void *hook,
reg_size = i386_THREAD_STATE_COUNT;
thread_get_state (thread, i386_THREAD_STATE,
(thread_state_t) &regs, &reg_size);
- regs.eip = (int) startpc;
- regs.uesp = (int) arg_pos;
+#ifdef __x86_64__
+ regs.rip = (uintptr_t) startpc;
+ regs.ursp = (uintptr_t) arg_pos;
+#else
+ regs.eip = (uintptr_t) startpc;
+ regs.uesp = (uintptr_t) arg_pos;
+#endif
thread_set_state (thread, i386_THREAD_STATE,
(thread_state_t) &regs, reg_size);
}