Home : Platform Support Library | Common Types and Macros

Source Files

xsystem_types.h Types and macros common to other libraries

Source Listings

xsystem_types.h

#ifndef XPLATFORM_TYPES__INCLUDED
#define XPLATFORM_TYPES__INCLUDED

#ifndef FALSE
#define FALSE 0
#endif
#ifndef TRUE
#define TRUE (!FALSE)
#endif

#ifndef NULL
#define NULL ((void*)0)
#endif

#define XSIZE(x) (sizeof(x)/sizeof(x[0]))

//#define XMIN(x,y) ((x < y) ? (x) : (y))
//#define XMAX(x,y) ((x > y) ? (x) : (y))

typedef unsigned int   xbool;
typedef unsigned char  xbyte;
typedef unsigned int   xuint;
typedef   signed int   xsint;

typedef   signed char  xsint08;
typedef unsigned char  xuint08;
typedef   signed short xsint16;
typedef unsigned short xuint16;
typedef   signed int   xsint32;
typedef unsigned int   xuint32;

#define ARRAY_PTR( address, array_name )   asm("mov %0, %1":"=r"(address):"r"(array_name));
#define ARRAY_GET( address, index, value ) asm("ldw %0, %1[%2]":"=r"(value):"r"(address),"r"(index));
#define ARRAY_SET( address, index, value ) asm("stw %0, %1[%2]"::"r"(value),"r"(address),"r"(index));

#endif