m32c support contribution
Jeff Johnston
jjohnstn@redhat.com
Wed Aug 10 20:53:00 GMT 2005
Thanks DJ. The patch has been applied.
Regarding chip maintainers, feel free to add a new section to the
MAINTAINERS file with yourself as the maintainer for m32c. You may make
m32-specific changes without permission. Any changes that affect shared
files are write-after-approval.
-- Jeff J.
DJ Delorie wrote:
> On behalf of Red Hat Inc, I would like to contribute support for the
> Renesas M32C family of CPUs to libgloss and newlib.
>
> I offer to be the maintainer, yet I don't see chip maintainers listed
> in newlib's MAINTAINERS file.
>
> Patch (changes) and tarball (new files) attached. The copyright is
> the default Red Hat BSD-like (no ad) license.
>
> [libgloss]
>
> * configure.in: Add m32c support.
> * configure: Regenerated
> * m32c: New directory, Renesas R8C/M16C/M32C support.
>
> [newlib]
>
> * configure.host: Add m32c support.
> * libc/include/machine/ieeefp.h: Likewise.
> * libc/include/machine/setjmp.h: Likewise.
> * libc/include/sys/config.h: Likewise.
> * libc/machine/m32c: New directory, Renesas R8C/M16C/M32C support.
>
> Index: libgloss/configure
> ===================================================================
> RCS file: /cvs/src/src/libgloss/configure,v
> retrieving revision 1.12
> diff -p -U3 -r1.12 libgloss/configure
> --- libgloss/configure 6 Jul 2005 12:58:09 -0000 1.12
> +++ libgloss/configure 28 Jul 2005 19:02:07 -0000
> @@ -797,6 +797,9 @@ case "${target}" in
> xstormy16-*-*)
> configdirs="${configdirs} xstormy16 testsuite"
> ;;
> + m32c-*-*)
> + configdirs="${configdirs} m32c testsuite"
> + ;;
> strongarm-*-elf | strongarm-*-coff)
> configdirs="${configdirs} arm testsuite";
> ;;
> Index: libgloss/configure.in
> ===================================================================
> RCS file: /cvs/src/src/libgloss/configure.in,v
> retrieving revision 1.12
> diff -p -U3 -r1.12 libgloss/configure.in
> --- libgloss/configure.in 6 Jul 2005 12:58:09 -0000 1.12
> +++ libgloss/configure.in 28 Jul 2005 19:02:07 -0000
> @@ -108,6 +108,9 @@ case "${target}" in
> xstormy16-*-*)
> configdirs="${configdirs} xstormy16 testsuite"
> ;;
> + m32c-*-*)
> + configdirs="${configdirs} m32c testsuite"
> + ;;
> strongarm-*-elf | strongarm-*-coff)
> configdirs="${configdirs} arm testsuite";
> ;;
> Index: newlib/configure.host
> ===================================================================
> RCS file: /cvs/src/src/newlib/configure.host,v
> retrieving revision 1.74
> diff -p -U3 -r1.74 newlib/configure.host
> --- newlib/configure.host 6 Jul 2005 13:14:09 -0000 1.74
> +++ newlib/configure.host 28 Jul 2005 19:02:08 -0000
> @@ -67,7 +67,7 @@ case "${target_optspace}:${host}" in
> yes:*)
> newlib_cflags="${newlib_cflags} -Os"
> ;;
> - :m32r-* | :d10v-* | :d30v-* | :avr-*)
> + :m32r-* | :d10v-* | :d30v-* | :avr-* | :m32c-* )
> newlib_cflags="${newlib_cflags} -Os"
> ;;
> no:* | :*)
> @@ -145,6 +145,11 @@ case "${host_cpu}" in
> iq2000)
> machine_dir=iq2000
> ;;
> + m32c)
> + machine_dir=m32c
> + newlib_cflags="${newlib_cflags} -DPREFER_SIZE_OVER_SPEED -DABORT_PROVIDED -DSMALL_MEMORY"
> + ;;
> +
> m32r*)
> machine_dir=m32r
> ;;
> Index: newlib/libc/include/machine/ieeefp.h
> ===================================================================
> RCS file: /cvs/src/src/newlib/libc/include/machine/ieeefp.h,v
> retrieving revision 1.26
> diff -p -U3 -r1.26 newlib/libc/include/machine/ieeefp.h
> --- newlib/libc/include/machine/ieeefp.h 6 Jul 2005 13:14:10 -0000 1.26
> +++ newlib/libc/include/machine/ieeefp.h 28 Jul 2005 19:02:08 -0000
> @@ -269,6 +269,11 @@
> #endif /* __ARMEL__ */
> #endif /* __MAVERICK__ */
>
> +#ifdef __m32c__
> +#define __IEEE_LITTLE_ENDIAN
> +#define __SMALL_BITFIELDS
> +#endif
> +
> #ifdef __CRIS__
> #define __IEEE_LITTLE_ENDIAN
> #endif
> Index: newlib/libc/include/machine/setjmp.h
> ===================================================================
> RCS file: /cvs/src/src/newlib/libc/include/machine/setjmp.h,v
> retrieving revision 1.25
> diff -p -U3 -r1.25 newlib/libc/include/machine/setjmp.h
> --- newlib/libc/include/machine/setjmp.h 6 Jul 2005 13:14:10 -0000 1.25
> +++ newlib/libc/include/machine/setjmp.h 28 Jul 2005 19:02:08 -0000
> @@ -213,6 +213,15 @@ _BEGIN_STD_C
> #define _JBLEN 18
> #endif
>
> +#ifdef __m32c__
> +#if defined(__r8c_cpu__) || defined(__m16c_cpu__)
> +#define _JBLEN (22/2)
> +#else
> +#define _JBLEN (34/2)
> +#endif
> +#define _JBTYPE unsigned short
> +#endif /* __m32c__ */
> +
> #ifdef _JBLEN
> #ifdef _JBTYPE
> typedef _JBTYPE jmp_buf[_JBLEN];
> Index: newlib/libc/include/sys/config.h
> ===================================================================
> RCS file: /cvs/src/src/newlib/libc/include/sys/config.h,v
> retrieving revision 1.40
> diff -p -U3 -r1.40 newlib/libc/include/sys/config.h
> --- newlib/libc/include/sys/config.h 22 Jun 2004 21:54:51 -0000 1.40
> +++ newlib/libc/include/sys/config.h 28 Jul 2005 19:02:08 -0000
> @@ -105,6 +105,22 @@
> #define __BUFSIZ__ 16
> #define _REENT_SMALL
> #endif
> +#ifdef __m32c__
> +#define __SMALL_BITFIELDS
> +#undef INT_MAX
> +#undef UINT_MAX
> +#define INT_MAX __INT_MAX__
> +#define UINT_MAX (__INT_MAX__ * 2U + 1)
> +#define MALLOC_ALIGNMENT 8
> +#if defined(__r8c_cpu__) || defined(__m16c_cpu__)
> +#define _POINTER_INT short
> +#else
> +#define _POINTER_INT long
> +#endif
> +#define __BUFSIZ__ 16
> +#define _REENT_SMALL
> +#endif /* __m32c__ */
> +
>
> /* This block should be kept in sync with GCC's limits.h. The point
> of having these definitions here is to not include limits.h, which
>
More information about the Newlib
mailing list