Compare commits

..

1 Commits

Author SHA1 Message Date
PavelBARABANOV 56535ffd16 John patch 2026-10-22 04:29:47 +03:00
3 changed files with 23 additions and 21 deletions
@@ -1,6 +1,3 @@
# SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later
/* SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project */
/* SPDX-License-Identifier: GPL-2.0-or-later */
@@ -8,22 +5,9 @@
#define __ASSEMBLY__
// Newer Linux UAPI headers check __ASSEMBLER__ instead of __ASSEMBLY__ to hide C declarations.
// Without it, asm-generic/signal.h redeclares sigset_t and clashes with glibc's. Only define it
// around these includes, since glibc headers also look at __ASSEMBLER__.
#ifndef __ASSEMBLER__
#define __ASSEMBLER__
#define EDEN_NCE_UNDEF_ASSEMBLER
#endif
#include <asm-generic/signal.h>
#include <asm-generic/unistd.h>
#ifdef EDEN_NCE_UNDEF_ASSEMBLER
#undef __ASSEMBLER__
#undef EDEN_NCE_UNDEF_ASSEMBLER
#endif
#define ReturnToRunCodeByExceptionLevelChangeSignal SIGUSR2
#define BreakFromRunCodeSignal SIGURG
#define GuestAccessFaultSignal SIGSEGV
+4 -3
View File
@@ -72,9 +72,10 @@ void ServiceFrameworkBase::ReportUnimplementedFunction(HLERequestContext& ctx, c
}
[[nodiscard]] static bool VersionGateCheck(Core::System& system, u32 vg) {
u32 const c_maj = FirmwareManager::GetFirmwareVersion(system).first.major;
u32 const c_min = FirmwareManager::GetFirmwareVersion(system).first.minor;
u32 const c_pat = FirmwareManager::GetFirmwareVersion(system).first.micro;
const auto fw = FirmwareManager::GetFirmwareVersion(system).first;
u32 const c_maj = fw.major;
u32 const c_min = fw.minor;
u32 const c_pat = fw.micro;
u32 const cg = (c_pat << 0) | (c_min << 4) | (c_maj << 8);
u32 const sg = (vg >> 16) & 0xffff;
u32 const ug = vg & 0xffff;
+19 -2
View File
@@ -4,6 +4,8 @@
#pragma once
#include "common/common_types.h"
#include <mutex>
#include "core/core.h"
#include "core/file_sys/nca_metadata.h"
#include "core/file_sys/content_archive.h"
@@ -95,13 +97,28 @@ FirmwareCheckResult VerifyFirmware(Core::System &system);
*/
inline std::pair<Service::Set::FirmwareVersionFormat, Result> GetFirmwareVersion(Core::System &system)
{
// The version cannot change while a session runs, and this is on the IPC dispatch path:
// looking it up per call costs a firmware data read with firmware installed, and a
// synthesized SystemVersion archive without one. Remember it.
static std::mutex cache_mutex;
static std::pair<Core::System*, std::pair<Service::Set::FirmwareVersionFormat, Result>> cache{};
{
std::scoped_lock lock{cache_mutex};
if (cache.first == &system) {
return cache.second;
}
}
Service::Set::FirmwareVersionFormat firmware_data{};
const auto result
= Service::Set::GetFirmwareVersionImpl(firmware_data,
system,
Service::Set::GetFirmwareVersionType::Version2);
return {firmware_data, result};
{
std::scoped_lock lock{cache_mutex};
cache = {&system, {firmware_data, result}};
return cache.second;
}
}
// TODO(crueter): GET AS STRING