mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-10-23 17:53:01 -04:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 76592ec6d5 |
@@ -1,3 +1,6 @@
|
||||
# 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 */
|
||||
|
||||
@@ -5,9 +8,22 @@
|
||||
|
||||
#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
|
||||
|
||||
@@ -72,10 +72,9 @@ void ServiceFrameworkBase::ReportUnimplementedFunction(HLERequestContext& ctx, c
|
||||
}
|
||||
|
||||
[[nodiscard]] static bool VersionGateCheck(Core::System& system, u32 vg) {
|
||||
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 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;
|
||||
u32 const cg = (c_pat << 0) | (c_min << 4) | (c_maj << 8);
|
||||
u32 const sg = (vg >> 16) & 0xffff;
|
||||
u32 const ug = vg & 0xffff;
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
#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"
|
||||
@@ -97,28 +95,13 @@ 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);
|
||||
{
|
||||
std::scoped_lock lock{cache_mutex};
|
||||
cache = {&system, {firmware_data, result}};
|
||||
return cache.second;
|
||||
}
|
||||
|
||||
return {firmware_data, result};
|
||||
}
|
||||
|
||||
// TODO(crueter): GET AS STRING
|
||||
|
||||
Reference in New Issue
Block a user