kern: implement SvcCreateInterruptEvent

This commit is contained in:
Michael Scire 2020-07-14 03:26:02 -07:00 committed by SciresM
parent b35380a942
commit 04f325cf5a
8 changed files with 239 additions and 8 deletions

View file

@ -230,7 +230,7 @@ namespace ams::kern {
}
}
bool SetInterruptAllowed(u32 id) {
bool SetInterruptPermitted(u32 id) {
constexpr size_t BitsPerWord = BITSIZEOF(this->irq_access_flags[0]);
if (id < BITSIZEOF(this->irq_access_flags)) {
this->irq_access_flags[id / BitsPerWord] = (1ul << (id % BitsPerWord));
@ -274,6 +274,15 @@ namespace ams::kern {
}
}
constexpr bool IsPermittedInterrupt(u32 id) const {
constexpr size_t BitsPerWord = BITSIZEOF(this->irq_access_flags[0]);
if (id < BITSIZEOF(this->irq_access_flags)) {
return (this->irq_access_flags[id / BitsPerWord] & (1ul << (id % BitsPerWord))) != 0;
} else {
return false;
}
}
/* TODO: Member functions. */
};