svn commit: r304742 - in head/sys: amd64/cloudabi64 arm64/cloudabi64 i386/cloudabi32
Ed Schouten
ed at FreeBSD.org
Wed Aug 24 10:13:20 UTC 2016
Author: ed
Date: Wed Aug 24 10:13:18 2016
New Revision: 304742
URL: https://svnweb.freebsd.org/changeset/base/304742
Log:
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.
Modified:
head/sys/amd64/cloudabi64/cloudabi64_sysvec.c
head/sys/arm64/cloudabi64/cloudabi64_sysvec.c
head/sys/i386/cloudabi32/cloudabi32_sysvec.c
Modified: head/sys/amd64/cloudabi64/cloudabi64_sysvec.c
==============================================================================
--- head/sys/amd64/cloudabi64/cloudabi64_sysvec.c Wed Aug 24 10:10:26 2016 (r304741)
+++ head/sys/amd64/cloudabi64/cloudabi64_sysvec.c Wed Aug 24 10:13:18 2016 (r304742)
@@ -171,9 +171,9 @@ cloudabi64_thread_setregs(struct thread
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
Modified: head/sys/arm64/cloudabi64/cloudabi64_sysvec.c
==============================================================================
--- head/sys/arm64/cloudabi64/cloudabi64_sysvec.c Wed Aug 24 10:10:26 2016 (r304741)
+++ head/sys/arm64/cloudabi64/cloudabi64_sysvec.c Wed Aug 24 10:13:18 2016 (r304742)
@@ -139,9 +139,9 @@ cloudabi64_thread_setregs(struct thread
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
Modified: head/sys/i386/cloudabi32/cloudabi32_sysvec.c
==============================================================================
--- head/sys/i386/cloudabi32/cloudabi32_sysvec.c Wed Aug 24 10:10:26 2016 (r304741)
+++ head/sys/i386/cloudabi32/cloudabi32_sysvec.c Wed Aug 24 10:13:18 2016 (r304742)
@@ -155,9 +155,9 @@ cloudabi32_thread_setregs(struct thread
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
More information about the svn-src-head
mailing list