mirror of
https://github.com/switchbrew/switch-tools.git
synced 2025-06-21 21:42:39 +02:00
ndpmtool/elftool: support force_debug_prod
This commit is contained in:
parent
22471a1f5a
commit
786ccde466
@ -554,6 +554,7 @@ int ParseKipConfiguration(const char *json, KipHeader *kip_hdr) {
|
||||
}
|
||||
int allow_debug = 0;
|
||||
int force_debug = 0;
|
||||
int force_debug_prod = 0;
|
||||
if (!cJSON_GetBoolean(value, "allow_debug", &allow_debug)) {
|
||||
status = 0;
|
||||
goto PARSE_CAPS_END;
|
||||
@ -562,7 +563,11 @@ int ParseKipConfiguration(const char *json, KipHeader *kip_hdr) {
|
||||
status = 0;
|
||||
goto PARSE_CAPS_END;
|
||||
}
|
||||
desc = (allow_debug & 1) | ((force_debug & 1) << 1);
|
||||
if (!cJSON_GetBoolean(value, "force_debug_prod", &force_debug_prod)) {
|
||||
status = 0;
|
||||
goto PARSE_CAPS_END;
|
||||
}
|
||||
desc = (allow_debug & 1) | ((force_debug_prod & 1) << 1) | ((force_debug & 1) << 2);
|
||||
kip_hdr->Capabilities[cur_cap++] = (u32)((desc << 17) | (0xFFFF));
|
||||
} else {
|
||||
fprintf(stderr, "Error: unknown capability %s\n", type_str);
|
||||
|
@ -819,6 +819,7 @@ int CreateNpdm(const char *json, void **dst, u32 *dst_size) {
|
||||
}
|
||||
int allow_debug = 0;
|
||||
int force_debug = 0;
|
||||
int force_debug_prod = 0;
|
||||
if (!cJSON_GetBoolean(value, "allow_debug", &allow_debug)) {
|
||||
status = 0;
|
||||
goto NPDM_BUILD_END;
|
||||
@ -827,7 +828,11 @@ int CreateNpdm(const char *json, void **dst, u32 *dst_size) {
|
||||
status = 0;
|
||||
goto NPDM_BUILD_END;
|
||||
}
|
||||
desc = (allow_debug & 1) | ((force_debug & 1) << 1);
|
||||
if (!cJSON_GetBoolean(value, "force_debug_prod", &force_debug_prod)) {
|
||||
status = 0;
|
||||
goto NPDM_BUILD_END;
|
||||
}
|
||||
desc = (allow_debug & 1) | ((force_debug_prod & 1) << 1) | ((force_debug & 1) << 2);
|
||||
caps[cur_cap++] = (u32)((desc << 17) | (0xFFFF));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user