mirror of
https://github.com/switchbrew/switch-tools.git
synced 2025-06-21 21:42:39 +02:00
use actual lowest/highest priorities, ignoring field names
This commit is contained in:
parent
70d270d001
commit
becb4df6f6
@ -341,13 +341,17 @@ int ParseKipConfiguration(const char *json, KipHeader *kip_hdr) {
|
||||
status = 0;
|
||||
goto PARSE_CAPS_END;
|
||||
}
|
||||
|
||||
u8 real_highest_prio = (lowest_prio < highest_prio) ? lowest_prio : highest_prio;
|
||||
u8 real_lowest_prio = (lowest_prio > highest_prio) ? lowest_prio : highest_prio;
|
||||
|
||||
desc = highest_cpu;
|
||||
desc <<= 8;
|
||||
desc |= lowest_cpu;
|
||||
desc <<= 6;
|
||||
desc |= (lowest_prio & 0x3F);
|
||||
desc |= (real_highest_prio & 0x3F);
|
||||
desc <<= 6;
|
||||
desc |= (highest_prio & 0x3F);
|
||||
desc |= (real_lowest_prio & 0x3F);
|
||||
kip_hdr->Capabilities[cur_cap++] = (u32)((desc << 4) | (0x0007));
|
||||
} else if (!strcmp(type_str, "syscalls")) {
|
||||
if (!cJSON_IsObject(value)) {
|
||||
|
@ -646,13 +646,17 @@ int CreateNpdm(const char *json, void **dst, u32 *dst_size) {
|
||||
status = 0;
|
||||
goto NPDM_BUILD_END;
|
||||
}
|
||||
|
||||
u8 real_highest_prio = (lowest_prio < highest_prio) ? lowest_prio : highest_prio;
|
||||
u8 real_lowest_prio = (lowest_prio > highest_prio) ? lowest_prio : highest_prio;
|
||||
|
||||
desc = highest_cpu;
|
||||
desc <<= 8;
|
||||
desc |= lowest_cpu;
|
||||
desc <<= 6;
|
||||
desc |= (lowest_prio & 0x3F);
|
||||
desc |= (real_highest_prio & 0x3F);
|
||||
desc <<= 6;
|
||||
desc |= (highest_prio & 0x3F);
|
||||
desc |= (real_lowest_prio & 0x3F);
|
||||
caps[cur_cap++] = (u32)((desc << 4) | (0x0007));
|
||||
} else if (!strcmp(type_str, "syscalls")) {
|
||||
if (!cJSON_IsObject(value)) {
|
||||
|
Loading…
Reference in New Issue
Block a user