Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Nov 2017 14:45:56 +0000 (UTC)
From:      Ed Schouten <ed@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r326228 - in head/sys: amd64/cloudabi32 amd64/cloudabi64 arm/cloudabi32 arm64/cloudabi64 i386/cloudabi32
Message-ID:  <201711261445.vAQEjuan081539@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ed
Date: Sun Nov 26 14:45:56 2017
New Revision: 326228
URL: https://svnweb.freebsd.org/changeset/base/326228

Log:
  Use TO_PTR() to convert integers to pointers.
  
  For FreeBSD/arm64's cloudabi32 support, I'm going to need a TO_PTR() in
  this place. Also use it for all of the other source files, so that the
  difference remains as minimal as possible.
  
  MFC after:	2 weeks

Modified:
  head/sys/amd64/cloudabi32/cloudabi32_sysvec.c
  head/sys/amd64/cloudabi64/cloudabi64_sysvec.c
  head/sys/arm/cloudabi32/cloudabi32_sysvec.c
  head/sys/arm64/cloudabi64/cloudabi64_sysvec.c
  head/sys/i386/cloudabi32/cloudabi32_sysvec.c

Modified: head/sys/amd64/cloudabi32/cloudabi32_sysvec.c
==============================================================================
--- head/sys/amd64/cloudabi32/cloudabi32_sysvec.c	Sun Nov 26 14:28:27 2017	(r326227)
+++ head/sys/amd64/cloudabi32/cloudabi32_sysvec.c	Sun Nov 26 14:45:56 2017	(r326228)
@@ -86,7 +86,7 @@ cloudabi32_proc_setregs(struct thread *td, struct imag
 {
 
 	ia32_setregs(td, imgp, stack);
-	(void)cpu_set_user_tls(td, (void *)stack);
+	(void)cpu_set_user_tls(td, TO_PTR(stack));
 }
 
 static int

Modified: head/sys/amd64/cloudabi64/cloudabi64_sysvec.c
==============================================================================
--- head/sys/amd64/cloudabi64/cloudabi64_sysvec.c	Sun Nov 26 14:28:27 2017	(r326227)
+++ head/sys/amd64/cloudabi64/cloudabi64_sysvec.c	Sun Nov 26 14:45:56 2017	(r326228)
@@ -83,7 +83,7 @@ cloudabi64_proc_setregs(struct thread *td, struct imag
 	regs = td->td_frame;
 	regs->tf_rdi = stack + sizeof(register_t) +
 	    roundup(sizeof(cloudabi64_tcb_t), sizeof(register_t));
-	(void)cpu_set_user_tls(td, (void *)stack);
+	(void)cpu_set_user_tls(td, TO_PTR(stack));
 }
 
 static int
@@ -188,7 +188,7 @@ cloudabi64_thread_setregs(struct thread *td,
 	frame->tf_rdi = td->td_tid;
 	frame->tf_rsi = attr->argument;
 
-	return (cpu_set_user_tls(td, (void *)tcbptr));
+	return (cpu_set_user_tls(td, TO_PTR(tcbptr)));
 }
 
 static struct sysentvec cloudabi64_elf_sysvec = {

Modified: head/sys/arm/cloudabi32/cloudabi32_sysvec.c
==============================================================================
--- head/sys/arm/cloudabi32/cloudabi32_sysvec.c	Sun Nov 26 14:28:27 2017	(r326227)
+++ head/sys/arm/cloudabi32/cloudabi32_sysvec.c	Sun Nov 26 14:45:56 2017	(r326228)
@@ -63,7 +63,7 @@ cloudabi32_proc_setregs(struct thread *td, struct imag
 	regs = td->td_frame;
 	regs->tf_r0 =
 	    stack + roundup(sizeof(cloudabi32_tcb_t), sizeof(register_t));
-	(void)cpu_set_user_tls(td, (void *)stack);
+	(void)cpu_set_user_tls(td, TO_PTR(stack));
 }
 
 static int

Modified: head/sys/arm64/cloudabi64/cloudabi64_sysvec.c
==============================================================================
--- head/sys/arm64/cloudabi64/cloudabi64_sysvec.c	Sun Nov 26 14:28:27 2017	(r326227)
+++ head/sys/arm64/cloudabi64/cloudabi64_sysvec.c	Sun Nov 26 14:45:56 2017	(r326228)
@@ -63,7 +63,7 @@ cloudabi64_proc_setregs(struct thread *td, struct imag
 	regs = td->td_frame;
 	regs->tf_x[0] =
 	    stack + roundup(sizeof(cloudabi64_tcb_t), sizeof(register_t));
-	(void)cpu_set_user_tls(td, (void *)stack);
+	(void)cpu_set_user_tls(td, TO_PTR(stack));
 }
 
 static int

Modified: head/sys/i386/cloudabi32/cloudabi32_sysvec.c
==============================================================================
--- head/sys/i386/cloudabi32/cloudabi32_sysvec.c	Sun Nov 26 14:28:27 2017	(r326227)
+++ head/sys/i386/cloudabi32/cloudabi32_sysvec.c	Sun Nov 26 14:45:56 2017	(r326228)
@@ -81,7 +81,7 @@ cloudabi32_proc_setregs(struct thread *td, struct imag
 {
 
 	exec_setregs(td, imgp, stack);
-	(void)cpu_set_user_tls(td, (void *)stack);
+	(void)cpu_set_user_tls(td, TO_PTR(stack));
 }
 
 static int



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201711261445.vAQEjuan081539>