From 6ece91c7632798474a2110ca0379985f183907eb Mon Sep 17 00:00:00 2001 From: Stephen Miller <56742918+StevenMiller123@users.noreply.github.com> Date: Sat, 10 May 2025 22:02:00 -0500 Subject: [PATCH] sceKernelVirtualQuery Fixes VI (#2904) * Reduce bitfield size Linux compilers automatically convert this, Windows not so much. * Static assert for VirtualQueryInfo struct size Since compilers can be weird, having a static assert for this will be helpful. Granted, this probably wont need changing after this PR. --- src/core/libraries/kernel/memory.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/core/libraries/kernel/memory.h b/src/core/libraries/kernel/memory.h index 6acb559d1..2ca7f2931 100644 --- a/src/core/libraries/kernel/memory.h +++ b/src/core/libraries/kernel/memory.h @@ -61,13 +61,15 @@ struct OrbisVirtualQueryInfo { size_t offset; s32 protection; s32 memory_type; - u32 is_flexible : 1; - u32 is_direct : 1; - u32 is_stack : 1; - u32 is_pooled : 1; - u32 is_committed : 1; + u8 is_flexible : 1; + u8 is_direct : 1; + u8 is_stack : 1; + u8 is_pooled : 1; + u8 is_committed : 1; char name[ORBIS_KERNEL_MAXIMUM_NAME_LENGTH]; }; +static_assert(sizeof(OrbisVirtualQueryInfo) == 72, + "OrbisVirtualQueryInfo struct size is incorrect"); struct OrbisKernelBatchMapEntry { void* start;