BeRTOS
types.h File Reference

CPU-specific type definitions. More...

#include "detect.h"
#include "attr.h"
#include <limits.h>
#include <cfg/compiler.h>

Go to the source code of this file.

Defines

Default type sizes.

These defaults are reasonable for most 16/32bit machines.

Some of these macros may be overridden by CPU-specific code above.

ANSI C requires that the following equations be true:

   sizeof(char) <= sizeof(short) <= sizeof(int) <= sizeof(long)
   sizeof(float) <= sizeof(double)
   CPU_BITS_PER_CHAR  >= 8
   CPU_BITS_PER_SHORT >= 8
   CPU_BITS_PER_INT   >= 16
   CPU_BITS_PER_LONG  >= 32
#define SIZEOF_CHAR   1
#define SIZEOF_SHORT   2
#define SIZEOF_INT   2
#define SIZEOF_LONG   4
#define SIZEOF_PTR   2
#define SIZEOF_SIZE_T   2
#define CPU_BITS_PER_CHAR   (SIZEOF_CHAR * 8)
#define CPU_BITS_PER_SHORT   (SIZEOF_SHORT * CPU_BITS_PER_CHAR)
#define CPU_BITS_PER_INT   (SIZEOF_INT * CPU_BITS_PER_CHAR)
#define CPU_BITS_PER_LONG   (SIZEOF_LONG * CPU_BITS_PER_CHAR)
#define CPU_BITS_PER_PTR   (SIZEOF_PTR * CPU_BITS_PER_CHAR)
#define HWREG(x)   (*((reg32_t *)(x)))
 Macros for hardware access, both direct and via the bit-band region.
#define HWREGH(x)   (*((reg16_t *)(x)))
 Macros for hardware access, both direct and via the bit-band region.
#define HWREGB(x)   (*((reg8_t *)(x)))
 Macros for hardware access, both direct and via the bit-band region.

Detailed Description

CPU-specific type definitions.

Author:
Giovanni Bajo <rasky@develer.com>
Bernie Innocenti <bernie@codewiz.org>
Stefano Fedrigo <aleph@develer.com>
Francesco Sacchi <batt@develer.com>

Definition in file types.h.