mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 23:17:45 +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:
parent
5d7855adea
commit
b13417ddb4
3 changed files with 35 additions and 16 deletions
|
@ -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; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue