20 lines
267 B
C
20 lines
267 B
C
#ifndef _VISOR_IDT_H_
|
|
#define _VISOR_IDT_H_
|
|
|
|
#include <stdint.h>
|
|
|
|
__attribute__ ((packed))
|
|
struct IDTR {
|
|
uint16_t limit;
|
|
uint64_t base;
|
|
};
|
|
|
|
static inline struct IDTR
|
|
storeidt(void)
|
|
{
|
|
struct IDTR idtr;
|
|
__asm__ ("sidt %0\n\t" : "=m"(idtr));
|
|
return idtr;
|
|
}
|
|
|
|
#endif
|