Xen Test Framework
Macros
symbolic-const.h File Reference

Macros for creating constants using mnemonics. More...

#include <xtf/macro_magic.h>
#include <arch/desc.h>
#include <arch/processor.h>
+ Include dependency graph for symbolic-const.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define TOK_OR(t, ...)   VAR_MACRO_C1(TOK_OR, t, ##__VA_ARGS__)
 Tokenise and OR together. More...
 
#define INIT_GDTE_SYM(base, limit, ...)    INIT_GDTE(base, limit, TOK_OR(SEG_ATTR_, ##__VA_ARGS__))
 Initialiser for an LDT/GDT entry using SEG_ATTR_ mnemonics. More...
 
#define GDTE_SYM(base, limit, ...)    ((user_desc)INIT_GDTE_SYM(base, limit, __VA_ARGS__))
 As INIT_GDTE_SYM(), but creates a user_desc object. More...
 
#define SEL_EC_SYM(sel, ...)   (sel | TOK_OR(X86_EC_, ##__VA_ARGS__))
 Create a selector based error code using X86_EC_ mnemonics. More...
 
#define EXC_EC_SYM(exc, ...)    SEL_EC_SYM(((X86_EXC_ ## exc) << 3), IDT, ##__VA_ARGS__)
 Create an exception selector based error code using mnemonics, with implicit X86_EC_IDT. More...
 
#define PF_SYM(...)   TOK_OR(_PAGE_, ##__VA_ARGS__)
 Create pagetable entry flags based on mnemonics. More...
 
#define PFEC_SYM(...)   TOK_OR(X86_PFEC_, ##__VA_ARGS__)
 Create pagetable error code based on mnemonics. More...
 

Detailed Description

Macros for creating constants using mnemonics.

Definition in file symbolic-const.h.

Macro Definition Documentation

◆ TOK_OR

#define TOK_OR (   t,
  ... 
)    VAR_MACRO_C1(TOK_OR, t, ##__VA_ARGS__)

Tokenise and OR together.

For each varadic parameter, tokenise with 't' and OR together.

Parameters
tCommon stem partial token.
...Partial tokens.

Example:

  TOK_OR(t, x, y)    => (t ## x | t ## y)
  TOK_OR(t, x, y, z) => (t ## x | t ## y | t ## z)

Definition at line 42 of file symbolic-const.h.

◆ INIT_GDTE_SYM

#define INIT_GDTE_SYM (   base,
  limit,
  ... 
)     INIT_GDTE(base, limit, TOK_OR(SEG_ATTR_, ##__VA_ARGS__))

Initialiser for an LDT/GDT entry using SEG_ATTR_ mnemonics.

Parameters
baseSegment base.
limitSegment limit.
...Partial SEG_ATTR_ tokens for attributes.

Example usage:

Definition at line 58 of file symbolic-const.h.

◆ GDTE_SYM

#define GDTE_SYM (   base,
  limit,
  ... 
)     ((user_desc)INIT_GDTE_SYM(base, limit, __VA_ARGS__))

As INIT_GDTE_SYM(), but creates a user_desc object.

Definition at line 64 of file symbolic-const.h.

◆ SEL_EC_SYM

#define SEL_EC_SYM (   sel,
  ... 
)    (sel | TOK_OR(X86_EC_, ##__VA_ARGS__))

Create a selector based error code using X86_EC_ mnemonics.

Parameters
selSelector value.
...Partial X86_EC_ tokens.

Example usage:

Definition at line 80 of file symbolic-const.h.

◆ EXC_EC_SYM

#define EXC_EC_SYM (   exc,
  ... 
)     SEL_EC_SYM(((X86_EXC_ ## exc) << 3), IDT, ##__VA_ARGS__)

Create an exception selector based error code using mnemonics, with implicit X86_EC_IDT.

Parameters
excPartial X86_EXC_ token for selector.
...Partial X86_EC_ tokens.

Example usage:

Definition at line 96 of file symbolic-const.h.

◆ PF_SYM

#define PF_SYM (   ...)    TOK_OR(_PAGE_, ##__VA_ARGS__)

Create pagetable entry flags based on mnemonics.

Parameters
...Partial PAGE tokens.

Example usage:

Definition at line 108 of file symbolic-const.h.

◆ PFEC_SYM

#define PFEC_SYM (   ...)    TOK_OR(X86_PFEC_, ##__VA_ARGS__)

Create pagetable error code based on mnemonics.

Parameters
...Partial X86_PFEC_ tokens.

Eample usage:

Definition at line 119 of file symbolic-const.h.