Add exceptionHandler static method for generation IDT DescriptorSpecs

This commit is contained in:
Eryn Wells 2016-03-13 12:52:05 -04:00
parent 6e2de52aa9
commit d57bf8cf8c
2 changed files with 10 additions and 0 deletions

View file

@ -154,6 +154,14 @@ IDT::systemIDT()
return sIDT;
}
IDT::DescriptorSpec
IDT::DescriptorSpec::exceptionHandler(uint16_t segment,
void (*handler)())
{
return {segment, uint32_t(handler), true, DPL::Ring0, true, Type::Interrupt};
}
/*
* Public
*/

View file

@ -124,6 +124,8 @@ struct IDT
struct DescriptorSpec
{
static DescriptorSpec exceptionHandler(uint16_t segment, void (*handler)());
uint16_t segment;
uint32_t offset;
bool isPresent;