Add exceptionHandler static method for generation IDT DescriptorSpecs
This commit is contained in:
parent
6e2de52aa9
commit
d57bf8cf8c
2 changed files with 10 additions and 0 deletions
|
|
@ -154,6 +154,14 @@ IDT::systemIDT()
|
||||||
return sIDT;
|
return sIDT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
IDT::DescriptorSpec
|
||||||
|
IDT::DescriptorSpec::exceptionHandler(uint16_t segment,
|
||||||
|
void (*handler)())
|
||||||
|
{
|
||||||
|
return {segment, uint32_t(handler), true, DPL::Ring0, true, Type::Interrupt};
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Public
|
* Public
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -124,6 +124,8 @@ struct IDT
|
||||||
|
|
||||||
struct DescriptorSpec
|
struct DescriptorSpec
|
||||||
{
|
{
|
||||||
|
static DescriptorSpec exceptionHandler(uint16_t segment, void (*handler)());
|
||||||
|
|
||||||
uint16_t segment;
|
uint16_t segment;
|
||||||
uint32_t offset;
|
uint32_t offset;
|
||||||
bool isPresent;
|
bool isPresent;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue