Convert pointers obtained from the threadattr_t structure with TO_PTR().
In all of these source files, the userspace pointer size corresponds with the kernelspace pointer size, meaning that casting directly works. As I'm planning on making 32-bit execution on 64-bit systems work as well, use TO_PTR() here as well, so that the changes between source files remain minimal.
This commit is contained in:
parent
cc5e5ee8a1
commit
c0aa6fd209
@ -171,9 +171,9 @@ cloudabi64_thread_setregs(struct thread *td,
|
||||
return (error);
|
||||
|
||||
/* Perform standard register initialization. */
|
||||
stack.ss_sp = (void *)attr->stack;
|
||||
stack.ss_sp = TO_PTR(attr->stack);
|
||||
stack.ss_size = tcbptr - attr->stack;
|
||||
cpu_set_upcall(td, (void *)attr->entry_point, NULL, &stack);
|
||||
cpu_set_upcall(td, TO_PTR(attr->entry_point), NULL, &stack);
|
||||
|
||||
/*
|
||||
* Pass in the thread ID of the new thread and the argument
|
||||
|
@ -139,9 +139,9 @@ cloudabi64_thread_setregs(struct thread *td,
|
||||
stack_t stack;
|
||||
|
||||
/* Perform standard register initialization. */
|
||||
stack.ss_sp = (void *)attr->stack;
|
||||
stack.ss_sp = TO_PTR(attr->stack);
|
||||
stack.ss_size = attr->stack_size;
|
||||
cpu_set_upcall(td, (void *)attr->entry_point, NULL, &stack);
|
||||
cpu_set_upcall(td, TO_PTR(attr->entry_point), NULL, &stack);
|
||||
|
||||
/*
|
||||
* Pass in the thread ID of the new thread and the argument
|
||||
|
@ -155,9 +155,9 @@ cloudabi32_thread_setregs(struct thread *td,
|
||||
int error;
|
||||
|
||||
/* Perform standard register initialization. */
|
||||
stack.ss_sp = (void *)attr->stack;
|
||||
stack.ss_sp = TO_PTR(attr->stack);
|
||||
stack.ss_size = attr->stack_size - sizeof(args);
|
||||
cpu_set_upcall(td, (void *)attr->entry_point, NULL, &stack);
|
||||
cpu_set_upcall(td, TO_PTR(attr->entry_point), NULL, &stack);
|
||||
|
||||
/*
|
||||
* Copy the arguments for the thread entry point onto the stack
|
||||
|
Loading…
x
Reference in New Issue
Block a user