mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-29 14:05:17 -04:00
kern: implement SvcSetUnsafeLimit
This commit is contained in:
parent
970b85bf9a
commit
71d266f867
2 changed files with 31 additions and 2 deletions
|
@ -35,6 +35,9 @@ namespace ams::kern {
|
|||
|
||||
Pool_Shift = 4,
|
||||
Pool_Mask = (0xF << Pool_Shift),
|
||||
|
||||
/* Aliases. */
|
||||
Pool_Unsafe = Pool_Application,
|
||||
};
|
||||
|
||||
enum Direction {
|
||||
|
@ -184,6 +187,23 @@ namespace ams::kern {
|
|||
address += cur_pages * PageSize;
|
||||
}
|
||||
}
|
||||
|
||||
size_t GetSize() {
|
||||
size_t total = 0;
|
||||
for (size_t i = 0; i < this->num_managers; i++) {
|
||||
total += this->managers[i].GetSize();
|
||||
}
|
||||
return total;
|
||||
}
|
||||
|
||||
size_t GetSize(Pool pool) {
|
||||
constexpr Direction GetSizeDirection = Direction_FromFront;
|
||||
size_t total = 0;
|
||||
for (auto *manager = this->GetFirstManager(pool, GetSizeDirection); manager != nullptr; manager = this->GetNextManager(manager, GetSizeDirection)) {
|
||||
total += manager->GetSize();
|
||||
}
|
||||
return total;
|
||||
}
|
||||
public:
|
||||
static size_t CalculateMetadataOverheadSize(size_t region_size) {
|
||||
return Impl::CalculateMetadataOverheadSize(region_size);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue