/* 
 * @COPYRIGHT@
 * 
 * x-kernel v3.3
 * 
 * Copyright (c) 1993,1991,1990,1996  Arizona Board of Regents
 * 
 * @COPYRIGHT@
 *
 * $RCSfile: platform.h,v $
 *
 * HISTORY
 * $Log: platform.h,v $
 * Revision 1.4  1996/06/03  22:45:24  slm
 * Changed msg_s.h to msg_p.h.
 *
 * Revision 1.3  1996/02/01  15:18:54  slm
 * Updated copyright and version.
 *
 * Revision 1.2  1995/08/28  16:12:49  acb
 * Initial revision for x3.3
 *
 * Revision 1.2  1994/11/22  21:16:42  hkaram
 * Added FORCE_LASTCALL; xReAlloc decl.; and included alloca.h
 *
 * Revision 1.1  1994/10/26  20:17:36  hkaram
 * Initial revision
 */
#ifndef platform_h
#define platform_h

/*
 * Macro to assist in declaring the format attribute of printf/sscanf
 * like functions so that GCC can do type checking on the args:
 */
#if __GNUC__ > 1
#  define XFMT(a,s,f)	__attribute__ ((format (a, s, f)))
#  define XNORETURN	__attribute__ ((noreturn))
#else
#  define XFMT(a,s,f)
#  define XNORETURN
#endif /* __GNUC__ > 1 */

#if defined(__GNUC__) && !defined(XK_DEBUG)
# define XK_USE_INLINE
#endif

#ifdef __STDC__

extern  char *  xMalloc( unsigned );
extern  void    xFree( char * );
extern  void    xMallocInit( void );
extern	char *	xRealloc( char *, unsigned );

#else
 
extern  char *  xMalloc( );
extern  void    xFree();
extern  void    xMallocInit();
extern	char *	xRealloc( );

#endif


#define XK_ALIGNED(a,t)	(((unsigned long)(a) & (sizeof(t) - 1)) == 0)
#define XK_ROUNDUP(v,t)	(((v) + sizeof(t) - 1) & ~(sizeof(t) - 1))

/*#include "xk_config.h"*/
#include "xk_arch.h"
#include "xk_debug.h"
#include "xtype.h"
#include "xendian.h"
#include <netinet/in.h>
#include <malloc.h>
#include <alloca.h>
#include <limits.h>
#include "process.h"
#include "x_stdio.h"
#include "x_libc.h"
#include "msg_p.h"	/* this is a platform independent file! */

#ifndef NULL
# define NULL	0
#endif

#ifndef TRUE
# define	TRUE	1
# define	FALSE	0
#endif /* TRUE */

#ifdef __PREDICTIONS__
# define PREDICT_FALSE  @0
# define PREDICT_TRUE   @1
#else
# define PREDICT_FALSE
# define PREDICT_TRUE
#endif

#ifdef __LASTCALL__
# define FORCE_LASTCALL	!
#else
# define FORCE_LASTCALL
#endif

#define ROM_MAX_LINES 	100 	/* Up to 100 table entries */
#define ROM_MAX_FIELDS 	20

extern	char *rom[ROM_MAX_LINES + 1][ROM_MAX_FIELDS + 1];  

#endif /* platform_h */
