Loading...
Searching...
No Matches
architecture.h File Reference

Platform-independent access to architecture details. More...

Detailed Description

Platform-independent access to architecture details.

Author
Marian Buschsieweke maria.nosp@m.n.bu.nosp@m.schsi.nosp@m.ewek.nosp@m.e@ovg.nosp@m.u.de

Definition in file architecture.h.

#include <stdint.h>
#include <inttypes.h>
#include <limits.h>
#include "architecture_arch.h"
+ Include dependency graph for architecture.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ARCHITECTURE_BREAKPOINT(value)   do {} while (1)
 Set a breakpoint.
 
#define ARCHITECTURE_WORD_BITS   <NUM>
 Size of a word in bits.
 
#define ARCHITECTURE_WORD_BYTES   <ARCHITECTURE_WORD_BITS / 8>
 Size of a word in bytes.
 
#define SWORD_MAX   <2^(ARCHITECTURE_WORD_BITS - 1) - 1>
 Highest number an sword_t can hold.
 
#define SWORD_MIN   <-2^(ARCHITECTURE_WORD_BITS - 1)>
 Smallest number an sword_t can hold.
 
#define UWORD_MAX   <2^ARCHITECTURE_WORD_BITS - 1>
 Highest number an uword_t can hold.
 
#define UWORD_MIN   (0U)
 Smallest number an uword_t can hold.
 
#define PRIxTXTPTR   PRIxPTR
 Format string macro for text section pointer.
 
#define PRI_SIZE_T_MODIFIER   /* implementation defined */
 Architecture specific modifier used for printing sizes.
 
#define PRIdSIZE   PRI_SIZE_T_MODIFIER "d"
 Macro holding the format specifier to print an ssize_t variable in decimal representation.
 
#define PRIiSIZE   PRI_SIZE_T_MODIFIER "i"
 Macro holding the format specifier to print an ssize_t variable.
 
#define PRIoSIZE   PRI_SIZE_T_MODIFIER "o"
 Macro holding the format specifier to print an ssize_t variable in octal representation.
 
#define PRIuSIZE   PRI_SIZE_T_MODIFIER "u"
 Macro holding the format specifier to print an size_t variable in decimal representation.
 
#define PRIxSIZE   PRI_SIZE_T_MODIFIER "x"
 Macro holding the format specifier to print an size_t variable in hexadecimal representation.
 
#define PRIXSIZE   PRI_SIZE_T_MODIFIER "X"
 Macro holding the format specifier to print an size_t variable in hexadecimal representation.
 
#define WORD_ALIGNED   __attribute__((aligned(ARCHITECTURE_WORD_BYTES)))
 Type qualifier to use to align data on word boundaries.
 
#define HAS_ALIGNMENT_OF(addr, alignment)   (((uintptr_t)(addr) & ((alignment) - 1)) == 0)
 Check if addr is alignment to alignment.
 
#define IS_WORD_ALIGNED(addr)   HAS_ALIGNMENT_OF(addr, ARCHITECTURE_WORD_BYTES)
 Check if addr is word-aligned.
 

Typedefs

typedef uint< NUM > _t uword_t
 Word sized unsigned integer.
 
typedef int< NUM > _t sword_t
 Word sized signed integer.
 
typedef uintptr_t uinttxtptr_t
 Pointer type to point anywhere in the .text section.