ams: basic support for compiling with gcc 16

This commit is contained in:
hexkyz 2026-06-16 21:10:23 +01:00
parent fcd46b4419
commit 3a3a2ca99b
7 changed files with 39 additions and 13 deletions

View File

@ -1356,6 +1356,9 @@ namespace ams::nxboot {
emc_zcal_wait_cnt_old &= ~0x7ff; emc_zcal_wait_cnt_old &= ~0x7ff;
emc_zcal_wait_cnt_new &= ~0x7ff; emc_zcal_wait_cnt_new &= ~0x7ff;
/* TODO: Unused variable. */
AMS_UNUSED(emc_zcal_wait_cnt_old);
if (dram_type == DRAM_TYPE_LPDDR4) { if (dram_type == DRAM_TYPE_LPDDR4) {
zq_wait_long = std::max<u32>(1, util::DivideUp(1000000, destination_clock_period)); zq_wait_long = std::max<u32>(1, util::DivideUp(1000000, destination_clock_period));
} else if (dram_type == DRAM_TYPE_LPDDR2 || is_lpddr3) { } else if (dram_type == DRAM_TYPE_LPDDR2 || is_lpddr3) {

View File

@ -105,6 +105,9 @@ namespace ams::se {
value |= ((flags & KeySlotLockFlags_KeyRead) == 0) ? (1u << 1) : 0; value |= ((flags & KeySlotLockFlags_KeyRead) == 0) ? (1u << 1) : 0;
value |= ((flags & KeySlotLockFlags_KeyRead) == 0) ? (1u << 2) : 0; value |= ((flags & KeySlotLockFlags_KeyRead) == 0) ? (1u << 2) : 0;
/* TODO: Unused variable. */
AMS_UNUSED(value);
reg::Write(SE->SE_RSA_KEYTABLE_ACCESS[slot], SE_REG_BITS_ENUM_SEL(RSA_KEYTABLE_ACCESS_KEYREAD, (flags & KeySlotLockFlags_KeyRead) != 0, DISABLE, ENABLE), reg::Write(SE->SE_RSA_KEYTABLE_ACCESS[slot], SE_REG_BITS_ENUM_SEL(RSA_KEYTABLE_ACCESS_KEYREAD, (flags & KeySlotLockFlags_KeyRead) != 0, DISABLE, ENABLE),
SE_REG_BITS_ENUM_SEL(RSA_KEYTABLE_ACCESS_KEYUPDATE, (flags & KeySlotLockFlags_KeyWrite) != 0, DISABLE, ENABLE), SE_REG_BITS_ENUM_SEL(RSA_KEYTABLE_ACCESS_KEYUPDATE, (flags & KeySlotLockFlags_KeyWrite) != 0, DISABLE, ENABLE),
SE_REG_BITS_ENUM_SEL(RSA_KEYTABLE_ACCESS_KEYUSE, (flags & KeySlotLockFlags_KeyUse) != 0, DISABLE, ENABLE)); SE_REG_BITS_ENUM_SEL(RSA_KEYTABLE_ACCESS_KEYUSE, (flags & KeySlotLockFlags_KeyUse) != 0, DISABLE, ENABLE));

View File

@ -730,6 +730,9 @@ namespace ams::kern::arch::arm64 {
} }
MESOSPHERE_ASSERT(mapped_pages == num_pages); MESOSPHERE_ASSERT(mapped_pages == num_pages);
/* TODO: Unused variable. */
AMS_UNUSED(mapped_pages);
/* Perform what coalescing we can. */ /* Perform what coalescing we can. */
this->MergePages(orig_virt_addr, num_pages, page_list); this->MergePages(orig_virt_addr, num_pages, page_list);

View File

@ -757,10 +757,12 @@ namespace ams::kern {
{ {
MESOSPHERE_ASSERT(num_params >= 3); MESOSPHERE_ASSERT(num_params >= 3);
info->info.exception.exception_address = params[1]; /* Keep the compiler happy, even though the assert has us covered. */
if (num_params >= 3) {
info->info.exception.exception_data_count = 1; info->info.exception.exception_address = params[1];
info->info.exception.exception_data[0] = params[2]; info->info.exception.exception_data_count = 1;
info->info.exception.exception_data[0] = params[2];
}
} }
break; break;
case ams::svc::DebugException_DebuggerAttached: case ams::svc::DebugException_DebuggerAttached:
@ -774,7 +776,10 @@ namespace ams::kern {
{ {
MESOSPHERE_ASSERT(num_params >= 2); MESOSPHERE_ASSERT(num_params >= 2);
info->info.exception.exception_address = params[1]; /* Keep the compiler happy, even though the assert has us covered. */
if (num_params >= 2) {
info->info.exception.exception_address = params[1];
}
info->info.exception.exception_data_count = 0; info->info.exception.exception_data_count = 0;
for (size_t i = 2; i < num_params; ++i) { for (size_t i = 2; i < num_params; ++i) {
@ -806,7 +811,10 @@ namespace ams::kern {
{ {
MESOSPHERE_ASSERT(num_params >= 2); MESOSPHERE_ASSERT(num_params >= 2);
info->info.exception.exception_address = params[1]; /* Keep the compiler happy, even though the assert has us covered. */
if (num_params >= 2) {
info->info.exception.exception_address = params[1];
}
} }
break; break;
} }

View File

@ -47,7 +47,7 @@ namespace ams::hos {
#endif #endif
exosphere::ApiInfo GetExosphereApiInfo(bool allow_approximate) { exosphere::ApiInfo GetExosphereApiInfo(bool allow_approximate) {
exosphere::ApiInfo info; exosphere::ApiInfo info = exosphere::ApiInfo{ util::BitPack64{0} };
#if defined(ATMOSPHERE_OS_HORIZON) #if defined(ATMOSPHERE_OS_HORIZON)
while (true) { while (true) {
if (R_SUCCEEDED(GetExosphereApiInfo(std::addressof(info)))) { if (R_SUCCEEDED(GetExosphereApiInfo(std::addressof(info)))) {

View File

@ -221,6 +221,9 @@ namespace ams::ncm {
/* Assert that we copied the right number of infos. */ /* Assert that we copied the right number of infos. */
AMS_ASSERT(count == fragment_count); AMS_ASSERT(count == fragment_count);
/* TODO: Unused variable. */
AMS_UNUSED(count);
R_SUCCEED(); R_SUCCEED();
} }
@ -433,6 +436,9 @@ namespace ams::ncm {
/* Assert that we copied the right number of infos. */ /* Assert that we copied the right number of infos. */
AMS_ASSERT(count == fragment_count); AMS_ASSERT(count == fragment_count);
/* TODO: Unused variable. */
AMS_UNUSED(count);
R_SUCCEED(); R_SUCCEED();
} }

View File

@ -186,6 +186,9 @@ namespace ams::svc::codegen::impl {
size_t i = 0; size_t i = 0;
(layout.ProcessArgument<AbiType, ArgumentTypes>(i++, NGRN, NSAA), ...); (layout.ProcessArgument<AbiType, ArgumentTypes>(i++, NGRN, NSAA), ...);
/* TODO: Unused variable. */
AMS_UNUSED(i);
return layout; return layout;
} }