[3/3] RTEMS: Change register_t definition

Message ID 20190213131912.20445-3-sebastian.huber@embedded-brains.de
State New
Headers show
Series
  • [1/3] Move RTEMS and XMK specific type definitions
Related show

Commit Message

Sebastian Huber Feb. 13, 2019, 1:19 p.m.
On 64-bit targets, the register_t type must be a 64-bit integer.

Add u_register_t definition for FreeBSD comptatibility.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>

---
 newlib/libc/sys/rtems/include/machine/types.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

-- 
2.16.4

Comments

Joel Sherrill Feb. 13, 2019, 1:33 p.m. | #1
Is RTEMS the only case in newlib that provides register_t?

On Wed, Feb 13, 2019, 7:19 AM Sebastian Huber <
sebastian.huber@embedded-brains.de wrote:

> On 64-bit targets, the register_t type must be a 64-bit integer.

>

> Add u_register_t definition for FreeBSD comptatibility.

>

> Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>

> ---

>  newlib/libc/sys/rtems/include/machine/types.h | 4 +++-

>  1 file changed, 3 insertions(+), 1 deletion(-)

>

> diff --git a/newlib/libc/sys/rtems/include/machine/types.h

> b/newlib/libc/sys/rtems/include/machine/types.h

> index 54c643016..0c654f355 100644

> --- a/newlib/libc/sys/rtems/include/machine/types.h

> +++ b/newlib/libc/sys/rtems/include/machine/types.h

> @@ -68,7 +68,7 @@ typedef       __int64_t       quad_t;

>  typedef        quad_t *        qaddr_t;

>  #endif

>

> -typedef        int     register_t;

> +typedef        __intptr_t      register_t;

>

>  #ifndef _RLIM_T_DECLARED

>  typedef        __rlim_t        rlim_t;         /* resource limit */

> @@ -79,6 +79,8 @@ typedef       __uintptr_t     segsz_t;        /* segment

> size (in pages) */

>

>  typedef        __uintptr_t     uintfptr_t;

>

> +typedef        __uintptr_t     u_register_t;

> +

>  typedef        __uintptr_t     kvaddr_t;

>  typedef        size_t          ksize_t;

>

> --

> 2.16.4

>

>
Sebastian Huber Feb. 13, 2019, 1:34 p.m. | #2
On 13/02/2019 14:33, Joel Sherrill wrote:
> Is RTEMS the only case in newlib that provides register_t? 


No, this is why I moved the definition to <machine/types.h>.

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber@embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Corinna Vinschen Feb. 13, 2019, 5:02 p.m. | #3
On Feb 13 14:19, Sebastian Huber wrote:
> On 64-bit targets, the register_t type must be a 64-bit integer.

> 

> Add u_register_t definition for FreeBSD comptatibility.


Can you fix this for Cygwin as well in the same patch?


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat

Patch

diff --git a/newlib/libc/sys/rtems/include/machine/types.h b/newlib/libc/sys/rtems/include/machine/types.h
index 54c643016..0c654f355 100644
--- a/newlib/libc/sys/rtems/include/machine/types.h
+++ b/newlib/libc/sys/rtems/include/machine/types.h
@@ -68,7 +68,7 @@  typedef	__int64_t	quad_t;
 typedef	quad_t *	qaddr_t;
 #endif
 
-typedef	int	register_t;
+typedef	__intptr_t	register_t;
 
 #ifndef _RLIM_T_DECLARED
 typedef	__rlim_t	rlim_t;		/* resource limit */
@@ -79,6 +79,8 @@  typedef	__uintptr_t	segsz_t;	/* segment size (in pages) */
 
 typedef	__uintptr_t	uintfptr_t;
 
+typedef	__uintptr_t	u_register_t;
+
 typedef	__uintptr_t	kvaddr_t;
 typedef	size_t		ksize_t;