1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 10:07:44 +00:00

ACPI: Examine bit width in Generic address structure before asserting

Also, the switch-case flow is simplified for IO access within a Generic
address strucuture's handling.
This commit is contained in:
Liav A 2020-03-11 14:28:17 +02:00 committed by Andreas Kling
parent 5d7855adea
commit b13417ddb4
3 changed files with 35 additions and 16 deletions

View file

@ -147,6 +147,23 @@ public:
ASSERT_NOT_REACHED();
}
inline void out(u32 value, u8 bit_width)
{
if (bit_width == 32) {
IO::out32(get(), value);
return;
}
if (bit_width == 16) {
IO::out16(get(), value);
return;
}
if (bit_width == 8) {
IO::out8(get(), value);
return;
}
ASSERT_NOT_REACHED();
}
bool is_null() const { return m_address == 0; }
bool operator==(const IOAddress& other) const { return m_address == other.m_address; }