svc: refactor/rename MemoryInfo fields
This commit is contained in:
@@ -24,7 +24,7 @@ namespace ams::kern {
|
||||
m_physical_address = phys_addr;
|
||||
m_size = size;
|
||||
m_mapping = mapping;
|
||||
m_perm = perm;
|
||||
m_permission = perm;
|
||||
m_pool = pool;
|
||||
m_is_mapped = false;
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace ams::kern {
|
||||
MESOSPHERE_ASSERT_THIS();
|
||||
|
||||
/* Check that the desired perm is allowable. */
|
||||
R_UNLESS((m_perm | map_perm) == m_perm, svc::ResultInvalidNewMemoryPermission());
|
||||
R_UNLESS((m_permission | map_perm) == m_permission, svc::ResultInvalidNewMemoryPermission());
|
||||
|
||||
/* Check that the size is correct. */
|
||||
R_UNLESS(size == m_size, svc::ResultInvalidSize());
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace ams::kern {
|
||||
if (info.m_state == KMemoryState_Free) {
|
||||
return " ";
|
||||
} else {
|
||||
switch (info.m_perm) {
|
||||
switch (info.m_permission) {
|
||||
case KMemoryPermission_UserReadExecute:
|
||||
return "r-x";
|
||||
case KMemoryPermission_UserRead:
|
||||
|
||||
@@ -468,9 +468,9 @@ namespace ams::kern {
|
||||
|
||||
Result KPageTableBase::CheckMemoryState(const KMemoryInfo &info, u32 state_mask, u32 state, u32 perm_mask, u32 perm, u32 attr_mask, u32 attr) const {
|
||||
/* Validate the states match expectation. */
|
||||
R_UNLESS((info.m_state & state_mask) == state, svc::ResultInvalidCurrentMemory());
|
||||
R_UNLESS((info.m_perm & perm_mask) == perm, svc::ResultInvalidCurrentMemory());
|
||||
R_UNLESS((info.m_attribute & attr_mask) == attr, svc::ResultInvalidCurrentMemory());
|
||||
R_UNLESS((info.m_state & state_mask) == state, svc::ResultInvalidCurrentMemory());
|
||||
R_UNLESS((info.m_permission & perm_mask) == perm, svc::ResultInvalidCurrentMemory());
|
||||
R_UNLESS((info.m_attribute & attr_mask) == attr, svc::ResultInvalidCurrentMemory());
|
||||
|
||||
return ResultSuccess();
|
||||
}
|
||||
@@ -524,12 +524,12 @@ namespace ams::kern {
|
||||
|
||||
/* Validate all blocks in the range have correct state. */
|
||||
const KMemoryState first_state = info.m_state;
|
||||
const KMemoryPermission first_perm = info.m_perm;
|
||||
const KMemoryPermission first_perm = info.m_permission;
|
||||
const KMemoryAttribute first_attr = info.m_attribute;
|
||||
while (true) {
|
||||
/* Validate the current block. */
|
||||
R_UNLESS(info.m_state == first_state, svc::ResultInvalidCurrentMemory());
|
||||
R_UNLESS(info.m_perm == first_perm, svc::ResultInvalidCurrentMemory());
|
||||
R_UNLESS(info.m_permission == first_perm, svc::ResultInvalidCurrentMemory());
|
||||
R_UNLESS((info.m_attribute | ignore_attr) == (first_attr | ignore_attr), svc::ResultInvalidCurrentMemory());
|
||||
|
||||
/* Validate against the provided masks. */
|
||||
@@ -1720,9 +1720,9 @@ namespace ams::kern {
|
||||
.m_ipc_lock_count = 0,
|
||||
.m_device_use_count = 0,
|
||||
.m_ipc_disable_merge_count = 0,
|
||||
.m_perm = KMemoryPermission_None,
|
||||
.m_permission = KMemoryPermission_None,
|
||||
.m_attribute = KMemoryAttribute_None,
|
||||
.m_original_perm = KMemoryPermission_None,
|
||||
.m_original_permission = KMemoryPermission_None,
|
||||
.m_disable_merge_attribute = KMemoryBlockDisableMergeAttribute_None,
|
||||
};
|
||||
out_page_info->flags = 0;
|
||||
|
||||
@@ -242,16 +242,16 @@ namespace ams::kern::svc {
|
||||
} else {
|
||||
/* Convert the info. */
|
||||
T converted_info = {};
|
||||
static_assert(std::same_as<decltype(T{}.addr), decltype(ams::svc::MemoryInfo{}.addr)>);
|
||||
static_assert(std::same_as<decltype(T{}.base_address), decltype(ams::svc::MemoryInfo{}.base_address)>);
|
||||
static_assert(std::same_as<decltype(T{}.size), decltype(ams::svc::MemoryInfo{}.size)>);
|
||||
|
||||
converted_info.addr = info.addr;
|
||||
converted_info.size = info.size;
|
||||
converted_info.state = info.state;
|
||||
converted_info.attr = info.attr;
|
||||
converted_info.perm = info.perm;
|
||||
converted_info.ipc_refcount = info.ipc_refcount;
|
||||
converted_info.device_refcount = info.device_refcount;
|
||||
converted_info.base_address = info.base_address;
|
||||
converted_info.size = info.size;
|
||||
converted_info.state = info.state;
|
||||
converted_info.attribute = info.attribute;
|
||||
converted_info.permission = info.permission;
|
||||
converted_info.ipc_count = info.ipc_count;
|
||||
converted_info.device_count = info.device_count;
|
||||
|
||||
/* Copy it. */
|
||||
R_TRY(out_memory_info.CopyFrom(std::addressof(converted_info)));
|
||||
|
||||
@@ -47,16 +47,16 @@ namespace ams::kern::svc {
|
||||
} else {
|
||||
/* Convert the info. */
|
||||
T converted_info = {};
|
||||
static_assert(std::same_as<decltype(T{}.addr), decltype(ams::svc::MemoryInfo{}.addr)>);
|
||||
static_assert(std::same_as<decltype(T{}.base_address), decltype(ams::svc::MemoryInfo{}.base_address)>);
|
||||
static_assert(std::same_as<decltype(T{}.size), decltype(ams::svc::MemoryInfo{}.size)>);
|
||||
|
||||
converted_info.addr = info.addr;
|
||||
converted_info.size = info.size;
|
||||
converted_info.state = info.state;
|
||||
converted_info.attr = info.attr;
|
||||
converted_info.perm = info.perm;
|
||||
converted_info.ipc_refcount = info.ipc_refcount;
|
||||
converted_info.device_refcount = info.device_refcount;
|
||||
converted_info.base_address = info.base_address;
|
||||
converted_info.size = info.size;
|
||||
converted_info.state = info.state;
|
||||
converted_info.attribute = info.attribute;
|
||||
converted_info.permission = info.permission;
|
||||
converted_info.ipc_count = info.ipc_count;
|
||||
converted_info.device_count = info.device_count;
|
||||
|
||||
/* Copy it. */
|
||||
R_TRY(out_memory_info.CopyFrom(std::addressof(converted_info)));
|
||||
|
||||
Reference in New Issue
Block a user