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
647672e21f
commit
48734c99d3
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=304742
@ -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…
Reference in New Issue
Block a user