strace: mapping type handler for _kern_map_file()

Change-Id: I1f315c285668221fb9ff15165c81dfcd753d7df8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8977
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
Jérôme Duval
2025-02-14 12:59:38 +00:00
committed by waddlesplash
parent 083e763302
commit 12b22e8e48
+13
View File
@@ -49,8 +49,16 @@ static const enum_info kAddressSpecs[] = {
};
static const enum_info kAreaMappings[] = {
ENUM_INFO_ENTRY(REGION_NO_PRIVATE_MAP),
ENUM_INFO_ENTRY(REGION_PRIVATE_MAP),
{ 0, NULL }
};
static FlagsTypeHandler::FlagsList kAreaProtectionFlags;
static EnumTypeHandler::EnumMap kAddressSpecsMap;
static EnumTypeHandler::EnumMap kAreaMappingMap;
void
@@ -62,6 +70,9 @@ patch_area()
for (int i = 0; kAddressSpecs[i].name != NULL; i++) {
kAddressSpecsMap[kAddressSpecs[i].index] = kAddressSpecs[i].name;
}
for (int i = 0; kAreaMappings[i].name != NULL; i++) {
kAreaMappingMap[kAreaMappings[i].index] = kAreaMappings[i].name;
}
Syscall *create = get_syscall("_kern_create_area");
create->GetParameter("address")->SetInOut(true);
@@ -97,6 +108,8 @@ patch_area()
new EnumTypeHandler(kAddressSpecsMap));
map_file->GetParameter("protection")->SetHandler(
new FlagsTypeHandler(kAreaProtectionFlags));
map_file->GetParameter("mapping")->SetHandler(
new EnumTypeHandler(kAreaMappingMap));
Syscall *set_memory_protection = get_syscall("_kern_set_memory_protection");
set_memory_protection->GetParameter("protection")->SetHandler(