Structure that describes a GDT Pointer (aka GDT Descriptor)
More...
#include <gdt.h>
|
template<typename T , size_t LEN> |
constexpr | Pointer (const T(&desc)[LEN]) |
| Constructor (automatic length)
|
|
constexpr | Pointer (void *desc, size_t len) |
| Constructor.
|
|
void | set (void *desc, size_t len) |
| Set an address.
|
|
|
uint16_t | limit |
| GDT size in bytes (minus 1 byte)
|
|
void * | base |
| GDT base address.
|
|
Structure that describes a GDT Pointer (aka GDT Descriptor)
It contains both the length (in bytes) of the GDT (minus 1 byte) and the pointer to the GDT. The pointer to the GDT can be loaded using the instruction lgdt
.
- Note
- As Intel uses little endian for representing multi-byte values, the GDT::Pointer structure can be used for 16, 32, and 64 bit descriptor tables:
* | 16 bit | 16 bit | 16 bit | 16 bit | 16 bit |
* +--------+---------------------------------------+
* Pointer | limit | base (up to 64 bit) |
* +--------+---------+---------+---------+---------+
* | used for 16 bit | ignored... |
* | used for 32 bit | ignored... |
* | used for 64 bit |
*
- See also
- ISDMv3, Figure 2-6; Memory Management Registers
◆ Pointer() [1/2]
template<typename T , size_t LEN>
constexpr GDT::Pointer::Pointer |
( |
const T(&) |
desc[LEN] | ) |
|
|
inlineexplicitconstexpr |
Constructor (automatic length)
- Parameters
-
desc | Array of GDT segment descriptors – must be defined in the same module! |
◆ Pointer() [2/2]
constexpr GDT::Pointer::Pointer |
( |
void * |
desc, |
|
|
size_t |
len |
|
) |
| |
|
inlineconstexpr |
Constructor.
- Parameters
-
desc | Address of the GDT segment descriptors |
len | Number of entries |
◆ set()
void GDT::Pointer::set |
( |
void * |
desc, |
|
|
size_t |
len |
|
) |
| |
|
inline |
Set an address.
- Note
- On change,
lgdt
must be executed again
- Parameters
-
desc | Address of the GDT segment descriptors |
len | Number of entries |
The documentation for this struct was generated from the following file: