NOVA User-Level Environment  Version testbox/changed-memory-timing-317-g320d8b5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
util.h File Reference
#include "asm.h"

Macros

#define assert(X)   {if (!(X)) { out_string("\nAssertion failed: '" #X "'\n\n"); __exit(0xbadbbbad);}}
#define memcpy(x, y, z)   __builtin_memcpy(x,y,z)
 we want inlined stringops
#define memset(x, y, z)   __builtin_memset(x,y,z)
#define strlen(x)   __builtin_strlen(x)
#define ERROR(result, value, msg)
 A fatal error happens if value is true.
#define CHECK3(result, value, msg)
 Returns result and prints the msg, if value is true.
#define CHECK4(result, value, msg, hex)
 Returns result and prints the msg and hex, if value is true.

Functions

int out_char (unsigned value)
 lowlevel output functions
void out_unsigned (unsigned int value, int len, unsigned base, char flag)
void out_string (const char *value)
 Output a string.
void out_hex (unsigned int value, unsigned int bitlen)
void out_description (const char *prefix, unsigned int value)
 Output a string followed by a single hex value, prefixed with a message label.
void out_info (const char *msg)
 Output a string, prefixed with a message label.
char * get_arg (char **, char)
int strcmp (char const *, char const *)
unsigned long strtoul (char const *, char const **, int)
void wait (int ms)
 Helper functions.
void __exit (unsigned status) __attribute__((noreturn))
 Print the exit status and reboot the machine.
int check_cpuid (void)
int enable_svm (void)
void serial_init (void)

Variables

const char const * message_label
 every message with out_description is prefixed with message_label

Macro Definition Documentation

#define assert (   X)    {if (!(X)) { out_string("\nAssertion failed: '" #X "'\n\n"); __exit(0xbadbbbad);}}
#define CHECK3 (   result,
  value,
  msg 
)
Value:
{ \
if (value) \
{ \
out_info(msg); \
return result; \
} \
}

Returns result and prints the msg, if value is true.

#define CHECK4 (   result,
  value,
  msg,
  hex 
)
Value:
{ \
if (value) \
{ \
out_description(msg, hex); \
return result; \
} \
}

Returns result and prints the msg and hex, if value is true.

#define ERROR (   result,
  value,
  msg 
)
Value:
{ \
if (value) \
{ \
out_string(msg); \
__exit(result); \
} \
}

A fatal error happens if value is true.

#define memcpy (   x,
  y,
 
)    __builtin_memcpy(x,y,z)

we want inlined stringops

#define memset (   x,
  y,
 
)    __builtin_memset(x,y,z)
#define strlen (   x)    __builtin_strlen(x)

Function Documentation

void __exit ( unsigned  status)

Print the exit status and reboot the machine.

int check_cpuid ( void  )
int enable_svm ( void  )
char* get_arg ( char **  ,
char   
)
int out_char ( unsigned  value)

lowlevel output functions

lowlevel output functions

Note: We allow only to put a char on the last line.

void out_description ( const char *  prefix,
unsigned int  value 
)

Output a string followed by a single hex value, prefixed with a message label.

void out_hex ( unsigned int  value,
unsigned int  bitlen 
)
void out_info ( const char *  msg)

Output a string, prefixed with a message label.

void out_string ( const char *  value)

Output a string.

void out_unsigned ( unsigned int  value,
int  len,
unsigned  base,
char  flag 
)
void serial_init ( void  )
int strcmp ( char const *  ,
char const *   
)
unsigned long strtoul ( char const *  ,
char const **  ,
int   
)
void wait ( int  ms)

Helper functions.

Helper functions.

We use the PIT for this.

Variable Documentation

const char const* message_label

every message with out_description is prefixed with message_label