Use mips/varargs.h.
This commit is contained in:
parent
d5df3fdbce
commit
e717f0bc2b
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: Makefile,v 1.5 1999/02/12 18:13:12 tsubai Exp $
|
||||
# $NetBSD: Makefile,v 1.6 1999/02/17 14:13:42 tsubai Exp $
|
||||
|
||||
KDIR= /sys/arch/newsmips/include
|
||||
INCSDIR= /usr/include/newsmips
|
||||
|
@ -9,6 +9,6 @@ INCS= adrsmap.h ansi.h aout_machdep.h autoconf.h bswap.h bsd-aout.h \
|
|||
kdbparam.h keyboard.h limits.h locore.h machConst.h mips_opcode.h \
|
||||
mouse.h param.h pcb.h pmap.h proc.h profile.h psl.h pte.h ptrace.h \
|
||||
reg.h regdef.h regnum.h reloc.h setjmp.h signal.h stdarg.h trap.h \
|
||||
types.h va-mips.h varargs.h vmparam.h z8530var.h
|
||||
types.h varargs.h vmparam.h z8530var.h
|
||||
|
||||
.include <bsd.kinc.mk>
|
||||
|
|
|
@ -1,96 +0,0 @@
|
|||
/* $NetBSD: va-mips.h,v 1.2 1999/02/15 04:36:35 hubertf Exp $ */
|
||||
/* ---------------------------------------- */
|
||||
/* VARARGS for MIPS/GNU CC */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* ---------------------------------------- */
|
||||
|
||||
|
||||
/* These macros implement varargs for GNU C--either traditional or ANSI. */
|
||||
|
||||
/* Define __gnuc_va_list. */
|
||||
|
||||
#ifndef __GNUC_VA_LIST
|
||||
#define __GNUC_VA_LIST
|
||||
typedef char * __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)
|
||||
|
||||
/* In GCC version 2, we want an ellipsis at the end of the declaration
|
||||
of the argument list. GCC version 1 can't parse it. */
|
||||
|
||||
#if __GNUC__ > 1
|
||||
#define __va_ellipsis ...
|
||||
#else
|
||||
#define __va_ellipsis
|
||||
#endif
|
||||
|
||||
#ifdef __mips64
|
||||
#define __va_rounded_size(__TYPE) \
|
||||
(((sizeof (__TYPE) + 8 - 1) / 8) * 8)
|
||||
#else
|
||||
#define __va_rounded_size(__TYPE) \
|
||||
(((sizeof (__TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
|
||||
#endif
|
||||
|
||||
/* Get definitions for _MIPS_SIM_ABI64 etc. */
|
||||
#ifdef _MIPS_SIM
|
||||
#include <sgidefs.h>
|
||||
#endif
|
||||
|
||||
#ifdef _STDARG_H
|
||||
#define va_start(__AP, __LASTARG) \
|
||||
(__AP = (__gnuc_va_list) __builtin_next_arg (__LASTARG))
|
||||
|
||||
#else
|
||||
#define va_alist __builtin_va_alist
|
||||
#ifdef __mips64
|
||||
/* This assumes that `long long int' is always a 64 bit type. */
|
||||
#define va_dcl long long int __builtin_va_alist; __va_ellipsis
|
||||
#else
|
||||
#define va_dcl int __builtin_va_alist; __va_ellipsis
|
||||
#endif
|
||||
/* Need alternate code for _MIPS_SIM_ABI64. */
|
||||
#if defined(_MIPS_SIM) && (_MIPS_SIM == _MIPS_SIM_ABI64)
|
||||
#define va_start(__AP) \
|
||||
(__AP = (__gnuc_va_list) __builtin_next_arg () \
|
||||
+ (__builtin_args_info (2) >= 8 ? -8 : 0))
|
||||
#else
|
||||
#define va_start(__AP) __AP = (char *) &__builtin_va_alist
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef va_end
|
||||
void va_end (__gnuc_va_list); /* Defined in libgcc.a */
|
||||
#endif
|
||||
#define va_end(__AP) ((void)0)
|
||||
|
||||
/* We cast to void * and then to TYPE * because this avoids
|
||||
a warning about increasing the alignment requirement. */
|
||||
/* The __mips64 cases are reversed from the 32 bit cases, because the standard
|
||||
32 bit calling convention left-aligns all parameters smaller than a word,
|
||||
whereas the __mips64 calling convention does not (and hence they are
|
||||
right aligned). */
|
||||
#ifdef __mips64
|
||||
|
||||
#else /* not __mips64 */
|
||||
|
||||
#ifdef __MIPSEB__
|
||||
/* For big-endian machines. */
|
||||
#define va_arg(__AP, __type) \
|
||||
((__AP = (char *) ((__alignof__ (__type) > 4 \
|
||||
? ((int)__AP + 8 - 1) & -8 \
|
||||
: ((int)__AP + 4 - 1) & -4) \
|
||||
+ __va_rounded_size (__type))), \
|
||||
*(__type *) (void *) (__AP - __va_rounded_size (__type)))
|
||||
#else
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* defined (_STDARG_H) || defined (_VARARGS_H) */
|
|
@ -1,73 +1,3 @@
|
|||
/* $NetBSD: varargs.h,v 1.2 1999/02/15 04:36:35 hubertf Exp $ */
|
||||
/* Record that this is varargs.h; this turns off stdarg.h. */
|
||||
/* $NetBSD: varargs.h,v 1.3 1999/02/17 14:13:42 tsubai Exp $ */
|
||||
|
||||
#ifndef _VARARGS_H
|
||||
#define _VARARGS_H
|
||||
|
||||
#include <machine/va-mips.h>
|
||||
|
||||
#endif /* not _VARARGS_H */
|
||||
|
||||
/* Define va_list from __gnuc_va_list. */
|
||||
|
||||
#ifdef _HIDDEN_VA_LIST /* On OSF1, this means varargs.h is "half-loaded". */
|
||||
#undef _VA_LIST
|
||||
#endif
|
||||
|
||||
#ifdef __svr4__
|
||||
/* SVR4.2 uses _VA_LIST for an internal alias for va_list,
|
||||
so we must avoid testing it and setting it here.
|
||||
SVR4 uses _VA_LIST as a flag in stdarg.h, but we should
|
||||
have no conflict with that. */
|
||||
#ifndef _VA_LIST_
|
||||
#define _VA_LIST_
|
||||
#ifdef __i860__
|
||||
#ifndef _VA_LIST
|
||||
#define _VA_LIST va_list
|
||||
#endif
|
||||
#endif /* __i860__ */
|
||||
typedef __gnuc_va_list va_list;
|
||||
#endif /* _VA_LIST_ */
|
||||
|
||||
#else /* not __svr4__ */
|
||||
|
||||
/* The macro _VA_LIST_ is the same thing used by this file in Ultrix.
|
||||
But on BSD NET2 we must not test or define or undef it.
|
||||
(Note that the comments in NET 2's ansi.h
|
||||
are incorrect for _VA_LIST_--see stdio.h!) */
|
||||
/* Michael Eriksson <mer@sics.se> at Thu Sep 30 11:00:57 1993:
|
||||
Sequent defines _VA_LIST_ in <machine/machtypes.h> to be the type to
|
||||
use for va_list (``typedef _VA_LIST_ va_list'') */
|
||||
#if !defined (_VA_LIST_) || defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__) || defined(WINNT)
|
||||
/* The macro _VA_LIST_DEFINED is used in Windows NT 3.5 */
|
||||
#ifndef _VA_LIST_DEFINED
|
||||
/* The macro _VA_LIST is used in SCO Unix 3.2. */
|
||||
#ifndef _VA_LIST
|
||||
/* The macro _VA_LIST_T_H is used in the Bull dpx2 */
|
||||
#ifndef _VA_LIST_T_H
|
||||
typedef __gnuc_va_list va_list;
|
||||
#endif /* not _VA_LIST_T_H */
|
||||
#endif /* not _VA_LIST */
|
||||
#endif /* not _VA_LIST_DEFINED */
|
||||
#if !(defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__))
|
||||
#define _VA_LIST_
|
||||
#endif
|
||||
#ifndef _VA_LIST
|
||||
#define _VA_LIST
|
||||
#endif
|
||||
#ifndef _VA_LIST_DEFINED
|
||||
#define _VA_LIST_DEFINED
|
||||
#endif
|
||||
#ifndef _VA_LIST_T_H
|
||||
#define _VA_LIST_T_H
|
||||
#endif
|
||||
|
||||
#endif /* not _VA_LIST_, except on certain systems */
|
||||
|
||||
#endif /* not __svr4__ */
|
||||
|
||||
/* The next BSD release (if there is one) wants this symbol to be
|
||||
undefined instead of _VA_LIST_. */
|
||||
#ifdef _BSD_VA_LIST
|
||||
#undef _BSD_VA_LIST
|
||||
#endif
|
||||
#include <mips/varargs.h>
|
||||
|
|
Loading…
Reference in New Issue