From 148549fab36e04a28e20524c2b4c68ae646ab172 Mon Sep 17 00:00:00 2001 From: law Date: Fri, 5 Sep 1997 17:43:51 +0000 Subject: * v850: New directory for v850 port. * v850/lib1funcs.asm: New file. * t-v850, v850.c, v850.h, v850.md, xm-v850.h: New files. * ginclude/va-v850.h: New file. * varargs.h, stdarg.h: Include va-mn10200.h. * configure.in (mn10200-*-*): New target. * Makefile.in (USER_H): Add va-mn10200.h. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@15104 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ginclude/stdarg.h | 4 ++++ gcc/ginclude/va-v850.h | 37 +++++++++++++++++++++++++++++++++++++ gcc/ginclude/varargs.h | 4 ++++ 3 files changed, 45 insertions(+) create mode 100644 gcc/ginclude/va-v850.h (limited to 'gcc/ginclude') diff --git a/gcc/ginclude/stdarg.h b/gcc/ginclude/stdarg.h index 694865a69b8..c497199d735 100644 --- a/gcc/ginclude/stdarg.h +++ b/gcc/ginclude/stdarg.h @@ -53,6 +53,9 @@ #ifdef __mn10200__ #include "va-mn10200.h" #else +#ifdef __v850__ +#include "va-v850.h" +#else /* Define __gnuc_va_list. */ @@ -109,6 +112,7 @@ void va_end (__gnuc_va_list); /* Defined in libgcc.a */ #endif /* _STDARG_H */ +#endif /* not v850 */ #endif /* not mn10200 */ #endif /* not mn10300 */ #endif /* not sh */ diff --git a/gcc/ginclude/va-v850.h b/gcc/ginclude/va-v850.h new file mode 100644 index 00000000000..3fd812ab228 --- /dev/null +++ b/gcc/ginclude/va-v850.h @@ -0,0 +1,37 @@ +/* CYGNUS LOCAL v850/law (entire file ) */ + +/* Define __gnuc_va_list. */ + +#ifndef __GNUC_VA_LIST +#define __GNUC_VA_LIST +typedef void *__gnuc_va_list; +#endif /* not __GNUC_VA_LIST */ + +/* If this is for internal libc use, don't define anything but + __gnuc_va_list. */ +#if defined (_STDARG_H) || defined (_VARARGS_H) + +#ifdef _STDARG_H +#define va_start(AP, LASTARG) \ + (AP = ((__gnuc_va_list) __builtin_next_arg (LASTARG))) +#else +#define __va_ellipsis ... +#define va_alist __builtin_va_alist +#define va_dcl int __builtin_va_alist; __va_ellipsis +#define va_start(AP) AP=(char *) &__builtin_va_alist +#endif + +/* Now stuff common to both varargs & stdarg implementations. */ +#define __va_rounded_size(TYPE) \ + (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int)) +#undef va_end +void va_end (__gnuc_va_list); +#define va_end(AP) ((void)0) +#define va_arg(AP, TYPE) \ + (sizeof (TYPE) > 8 \ + ? (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (char *)),\ + **((TYPE **) (void *) ((char *) (AP) - __va_rounded_size (char *))))\ + : (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)), \ + *((TYPE *) (void *) ((char *) (AP) - __va_rounded_size (TYPE))))) +#endif +/* END CYGNUS LOCAL */ diff --git a/gcc/ginclude/varargs.h b/gcc/ginclude/varargs.h index e0db8cc187b..dbe97354aba 100644 --- a/gcc/ginclude/varargs.h +++ b/gcc/ginclude/varargs.h @@ -51,6 +51,9 @@ #ifdef __mn10200__ #include "va-mn10200.h" #else +#ifdef __v850__ +#include "va-v850.h" +#else #ifdef __NeXT__ @@ -126,6 +129,7 @@ typedef void *__gnuc_va_list; /* Copy __gnuc_va_list into another variable of this type. */ #define __va_copy(dest, src) (dest) = (src) +#endif /* not v850 */ #endif /* not mn10200 */ #endif /* not mn10300 */ #endif /* not sh */ -- cgit v1.2.1