Skip to content

Commit 70d270d

Browse files
SciresMWinterMute
authored andcommitted
Add support for optional OptimizeMemoryAllocation npdm flag
1 parent 6fd5ae6 commit 70d270d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/npdmtool.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,11 @@ int CreateNpdm(const char *json, void **dst, u32 *dst_size) {
363363
}
364364
header.MmuFlags |= is_64_bit;
365365

366+
int optimize_memory_allocation; // optional
367+
if (cJSON_GetBoolean(npdm_json, "optimize_memory_allocation", &optimize_memory_allocation)) {
368+
header.MmuFlags |= ((optimize_memory_allocation & 1) << 4);
369+
}
370+
366371
int disable_device_address_space_merge; // optional
367372
if (cJSON_GetBoolean(npdm_json, "disable_device_address_space_merge", &disable_device_address_space_merge)) {
368373
header.MmuFlags |= ((disable_device_address_space_merge & 1) << 5);

0 commit comments

Comments
 (0)