mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-24 11:46:58 -04:00
kern: add InfoType_IoRegionHint
This commit is contained in:
parent
48f4c526f3
commit
25383db524
3 changed files with 27 additions and 0 deletions
|
@ -75,6 +75,19 @@ namespace ams::kern {
|
|||
|
||||
constexpr ALWAYS_INLINE KPhysicalAddress GetAddress() const { return m_physical_address; }
|
||||
constexpr ALWAYS_INLINE size_t GetSize() const { return m_size; }
|
||||
|
||||
constexpr uintptr_t GetHint() const {
|
||||
/* TODO: Is this architecture specific? */
|
||||
if (m_size >= 2_MB) {
|
||||
return GetInteger(m_physical_address) & (2_MB - 1);
|
||||
} else if (m_size >= 64_KB) {
|
||||
return GetInteger(m_physical_address) & (64_KB - 1);
|
||||
} else if (m_size >= 4_KB) {
|
||||
return GetInteger(m_physical_address) & (4_KB - 1);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue