Compare commits
24 Commits
22_support
...
1.11.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
931e3c37fd | ||
|
|
4b4db91341 | ||
|
|
e3fc339fe5 | ||
|
|
a051c3c723 | ||
|
|
9a1ea02c8c | ||
|
|
bae1ad22ec | ||
|
|
cd1503a9ca | ||
|
|
72e3b0dd34 | ||
|
|
ac120cf84b | ||
|
|
97ffad2ab6 | ||
|
|
c8d68a3a8a | ||
|
|
8987d642d1 | ||
|
|
7ffb1da2ac | ||
|
|
5c426bf90d | ||
|
|
31ca20f3b7 | ||
|
|
174da786e4 | ||
|
|
4a8f7628c2 | ||
|
|
9d16ee6a74 | ||
|
|
3b9ee08c69 | ||
|
|
2694f31eb3 | ||
|
|
f3f1fa46ed | ||
|
|
5dd9816e3c | ||
|
|
5a5d9b206b | ||
|
|
f8a5a6c015 |
@@ -15,6 +15,13 @@
|
||||
# Desc: Controls whether userland has access to the PMU registers.
|
||||
# NOTE: It is unknown what effects this has on official code.
|
||||
|
||||
# Key: enable_mem_mode, default: 0.
|
||||
# Desc: Controls whether boot config memory mode is taken into account
|
||||
# for retail units. This does not affect development units.
|
||||
# NOTE: On retail units max ram size is capped to 4GB.
|
||||
# Enabling this will use the boot config memory mode parameter,
|
||||
# which by default is auto and size gets set based on physical size.
|
||||
|
||||
# Key: blank_prodinfo_sysmmc, default: 0.
|
||||
# Desc: Controls whether PRODINFO should be blanked in sysmmc.
|
||||
# This will cause the system to see dummied out keys and
|
||||
@@ -51,6 +58,7 @@ debugmode=1
|
||||
debugmode_user=0
|
||||
disable_user_exception_handlers=0
|
||||
enable_user_pmu_access=0
|
||||
enable_mem_mode=0
|
||||
blank_prodinfo_sysmmc=0
|
||||
blank_prodinfo_emummc=0
|
||||
allow_writing_to_cal_sysmmc=0
|
||||
|
||||
@@ -1,4 +1,22 @@
|
||||
# Changelog
|
||||
## 1.11.0
|
||||
+ Support was added for 22.0.0.
|
||||
+ Special thanks to @alula for handling a large chunk of the necessary kernel, loader and erpt changes.
|
||||
+ The console should boot and atmosphère should be fully functional.
|
||||
+ **Please note**: A change in how applications/applets' lifespan is managed broke the homebrew ecosystem.
|
||||
+ All applications and applets are expected to perform a clean exit by calling the relevant IPC commands.
|
||||
+ Homebrew compiled with libnx and hbmenu itself explicitly avoid exiting so it can keep using the same process.
|
||||
+ Properly fixing this would require a re-design of how homebrew is launched and terminated.
|
||||
+ As a temporary solution, patches to the `am` sysmodule are now included which allow restoring the previous behavior and regain homebrew compatibility without any further changes.
|
||||
+ Nonetheless, please report any issues you may face when testing homebrew to ensure no edge cases have been missed.
|
||||
+ `exosphère` was updated to reflect the latest official secure monitor behavior.
|
||||
+ `mesosphère` was updated to reflect the latest official kernel behavior.
|
||||
+ `loader` was updated to reflect the latest official behavior.
|
||||
+ `erpt` was updated to reflect the latest official behavior.
|
||||
+ `pgl` was updated to fix a few issues.
|
||||
+ Support was added for memory modes above 4GB (thanks @CTCaer).
|
||||
+ A build time option to configure Joy-Con rails as UART for debugging was added (thanks @alula).
|
||||
+ General system stability improvements to enhance the user's experience.
|
||||
## 1.10.2
|
||||
+ Basic support was added for 21.2.0.
|
||||
+ General system stability improvements to enhance the user's experience.
|
||||
|
||||
2
emummc/source/FS/offsets/2200.h
vendored
2
emummc/source/FS/offsets/2200.h
vendored
@@ -31,7 +31,7 @@
|
||||
#define FS_OFFSET_2200_CLKRST_SET_MIN_V_CLK_RATE 0x1CF260
|
||||
|
||||
// Misc funcs
|
||||
#define FS_OFFSET_2200_LOCK_MUTEX 0x1CF260
|
||||
#define FS_OFFSET_2200_LOCK_MUTEX 0x1A4EF0
|
||||
#define FS_OFFSET_2200_UNLOCK_MUTEX 0x1A4F40
|
||||
|
||||
#define FS_OFFSET_2200_SDMMC_WRAPPER_CONTROLLER_OPEN 0x1AC0B0
|
||||
|
||||
2
emummc/source/FS/offsets/2200_exfat.h
vendored
2
emummc/source/FS/offsets/2200_exfat.h
vendored
@@ -31,7 +31,7 @@
|
||||
#define FS_OFFSET_2200_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x1DA450
|
||||
|
||||
// Misc funcs
|
||||
#define FS_OFFSET_2200_EXFAT_LOCK_MUTEX 0x1DA450
|
||||
#define FS_OFFSET_2200_EXFAT_LOCK_MUTEX 0x1B00E0
|
||||
#define FS_OFFSET_2200_EXFAT_UNLOCK_MUTEX 0x1B0130
|
||||
|
||||
#define FS_OFFSET_2200_EXFAT_SDMMC_WRAPPER_CONTROLLER_OPEN 0x1B72A0
|
||||
|
||||
@@ -132,10 +132,13 @@ namespace ams::secmon::smc {
|
||||
}
|
||||
|
||||
u32 GetMemoryMode() {
|
||||
/* Unless development function is enabled, we're 4 GB. */
|
||||
/* Unless development function or forced boot config memory size is enabled, we're 4 GB. */
|
||||
u32 memory_mode = pkg1::MemoryMode_4GB;
|
||||
|
||||
if (const auto &bcd = GetBootConfig().data; bcd.IsDevelopmentFunctionEnabled()) {
|
||||
const auto &bcd = GetBootConfig().data;
|
||||
const auto &sc = GetSecmonConfiguration(); /* Exosphere extensions */
|
||||
|
||||
if (bcd.IsDevelopmentFunctionEnabled() || sc.IsBootConfigMemoryModeEnabled()) {
|
||||
memory_mode = GetMemoryMode(bcd.GetMemoryMode());
|
||||
}
|
||||
|
||||
@@ -146,17 +149,19 @@ namespace ams::secmon::smc {
|
||||
pkg1::MemorySize memory_size = pkg1::MemorySize_4GB;
|
||||
util::BitPack32 value = {};
|
||||
|
||||
if (const auto &bcd = GetBootConfig().data; bcd.IsDevelopmentFunctionEnabled()) {
|
||||
memory_size = GetMemorySize(GetMemoryMode(bcd.GetMemoryMode()));
|
||||
const auto &bcd = GetBootConfig().data;
|
||||
const auto &sc = GetSecmonConfiguration(); /* Exosphere extensions */
|
||||
|
||||
if (bcd.IsDevelopmentFunctionEnabled()) {
|
||||
value.Set<KernelConfiguration::Flags1>(bcd.GetKernelFlags1());
|
||||
value.Set<KernelConfiguration::Flags0>(bcd.GetKernelFlags0());
|
||||
}
|
||||
|
||||
value.Set<KernelConfiguration::PhysicalMemorySize>(memory_size);
|
||||
if (bcd.IsDevelopmentFunctionEnabled() || sc.IsBootConfigMemoryModeEnabled()) {
|
||||
memory_size = GetMemorySize(GetMemoryMode(bcd.GetMemoryMode()));
|
||||
}
|
||||
|
||||
/* Exosphere extensions. */
|
||||
const auto &sc = GetSecmonConfiguration();
|
||||
value.Set<KernelConfiguration::PhysicalMemorySize>(memory_size);
|
||||
|
||||
if (!sc.DisableUserModeExceptionHandlers()) {
|
||||
value.Set<KernelConfiguration::EnableUserExceptionHandlers>(true);
|
||||
@@ -169,6 +174,27 @@ namespace ams::secmon::smc {
|
||||
return value.value;
|
||||
}
|
||||
|
||||
fuse::DramId GetDramIdAdjusted() {
|
||||
const auto dram_id = fuse::GetDramId();
|
||||
AMS_ABORT_UNLESS(dram_id < fuse::DramId_Count);
|
||||
|
||||
const auto fuse_mem_size = DramIdToMemorySize[dram_id];
|
||||
const auto phys_mem_size = GetPhysicalMemorySize();
|
||||
|
||||
AMS_ABORT_UNLESS(fuse_mem_size <= phys_mem_size);
|
||||
|
||||
if (fuse_mem_size == phys_mem_size) {
|
||||
return dram_id;
|
||||
}
|
||||
|
||||
/* Adjust Dram ID to match density/ranks. */
|
||||
if (GetSocType() == fuse::SocType_Erista) {
|
||||
return fuse::DramId_IcosaSamsung6GB;
|
||||
} else { /* fuse::SocType_Mariko */
|
||||
return fuse::DramId_IowaSamsung1y8GBX;
|
||||
}
|
||||
}
|
||||
|
||||
constinit u64 g_payload_address = 0;
|
||||
constinit bool g_set_true_target_firmware = false;
|
||||
|
||||
@@ -178,7 +204,7 @@ namespace ams::secmon::smc {
|
||||
args.r[1] = GetBootConfig().signed_data.IsProgramVerificationDisabled();
|
||||
break;
|
||||
case ConfigItem::DramId:
|
||||
args.r[1] = fuse::GetDramId();
|
||||
args.r[1] = GetDramIdAdjusted(); /* Nintendo: fuse::GetDramId() */
|
||||
break;
|
||||
case ConfigItem::SecurityEngineInterruptNumber:
|
||||
args.r[1] = SecurityEngineUserInterruptId;
|
||||
@@ -471,9 +497,18 @@ namespace ams::secmon::smc {
|
||||
|
||||
/* For exosphere's usage. */
|
||||
pkg1::MemorySize GetPhysicalMemorySize() {
|
||||
const auto dram_id = fuse::GetDramId();
|
||||
AMS_ABORT_UNLESS(dram_id < fuse::DramId_Count);
|
||||
return DramIdToMemorySize[dram_id];
|
||||
const uintptr_t MC = secmon::MemoryRegionVirtualDeviceMemoryController.GetAddress();
|
||||
const u32 mem_size = reg::Read(MC + MC_EMEM_CFG) & 0x3FFF;
|
||||
|
||||
switch (mem_size >> 10) {
|
||||
case 4:
|
||||
default:
|
||||
return pkg1::MemorySize_4GB;
|
||||
case 6:
|
||||
return pkg1::MemorySize_6GB;
|
||||
case 8:
|
||||
return pkg1::MemorySize_8GB;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -545,6 +545,12 @@ namespace ams::nxboot {
|
||||
} else {
|
||||
storage_ctx.flags[0] &= ~secmon::SecureMonitorConfigurationFlag_EnableUserModePerformanceCounterAccess;
|
||||
}
|
||||
} else if (std::strcmp(entry.key, "enable_mem_mode") == 0) {
|
||||
if (entry.value[0] == '1') {
|
||||
storage_ctx.flags[0] |= secmon::SecureMonitorConfigurationFlag_BootConfigMemoryModeEnabled;
|
||||
} else {
|
||||
storage_ctx.flags[0] &= ~secmon::SecureMonitorConfigurationFlag_BootConfigMemoryModeEnabled;
|
||||
}
|
||||
} else if (std::strcmp(entry.key, "blank_prodinfo_sysmmc") == 0) {
|
||||
if (!emummc_enabled) {
|
||||
if (entry.value[0] == '1') {
|
||||
|
||||
@@ -30,6 +30,7 @@ namespace ams::secmon {
|
||||
SecureMonitorConfigurationFlag_ShouldUseBlankCalibrationBinary = (1u << 5),
|
||||
SecureMonitorConfigurationFlag_AllowWritingToCalibrationBinarySysmmc = (1u << 6),
|
||||
SecureMonitorConfigurationFlag_ForceEnableUsb30 = (1u << 7),
|
||||
SecureMonitorConfigurationFlag_BootConfigMemoryModeEnabled = (1u << 8),
|
||||
|
||||
SecureMonitorConfigurationFlag_Default = SecureMonitorConfigurationFlag_IsDevelopmentFunctionEnabledForKernel,
|
||||
};
|
||||
@@ -103,6 +104,7 @@ namespace ams::secmon {
|
||||
constexpr bool ShouldUseBlankCalibrationBinary() const { return (this->flags[0] & SecureMonitorConfigurationFlag_ShouldUseBlankCalibrationBinary) != 0; }
|
||||
constexpr bool AllowWritingToCalibrationBinarySysmmc() const { return (this->flags[0] & SecureMonitorConfigurationFlag_AllowWritingToCalibrationBinarySysmmc) != 0; }
|
||||
constexpr bool IsUsb30ForceEnabled() const { return (this->flags[0] & SecureMonitorConfigurationFlag_ForceEnableUsb30) != 0; }
|
||||
constexpr bool IsBootConfigMemoryModeEnabled() const { return (this->flags[0] & SecureMonitorConfigurationFlag_BootConfigMemoryModeEnabled) != 0; }
|
||||
|
||||
constexpr bool IsDevelopmentFunctionEnabled(bool for_kern) const { return for_kern ? this->IsDevelopmentFunctionEnabledForKernel() : this->IsDevelopmentFunctionEnabledForUser(); }
|
||||
};
|
||||
|
||||
@@ -111,6 +111,7 @@ namespace ams::erpt {
|
||||
|
||||
struct CreateReportOptionFlag {
|
||||
using SubmitFsInfo = util::BitFlagSet<BITSIZEOF(u32), CreateReportOptionFlag>::Flag<0>;
|
||||
using Unknown0x20000 = util::BitFlagSet<BITSIZEOF(u32), CreateReportOptionFlag>::Flag<17>; /* TODO: What is this, it's checked in Reporter::CreateReport or below */
|
||||
};
|
||||
|
||||
using CreateReportOptionFlagSet = util::BitFlagSet<BITSIZEOF(u32), CreateReportOptionFlag>;
|
||||
|
||||
@@ -52,7 +52,8 @@ namespace ams::fs {
|
||||
|
||||
struct GameCardErrorReportInfo {
|
||||
u16 game_card_crc_error_num;
|
||||
u16 reserved1;
|
||||
u8 last_deactivate_reason;
|
||||
u8 reserved1;
|
||||
u16 asic_crc_error_num;
|
||||
u16 reserved2;
|
||||
u16 refresh_num;
|
||||
@@ -73,7 +74,8 @@ namespace ams::fs {
|
||||
u32 awaken_count;
|
||||
u32 read_count_from_insert;
|
||||
u32 read_count_from_awaken;
|
||||
u8 reserved5[8];
|
||||
u32 last_deactivate_reason_result;
|
||||
u32 reserved5;
|
||||
};
|
||||
static_assert(util::is_pod<GameCardErrorReportInfo>::value);
|
||||
static_assert(sizeof(GameCardErrorReportInfo) == 0x40);
|
||||
|
||||
@@ -19,5 +19,6 @@
|
||||
namespace ams::erpt::srv {
|
||||
|
||||
Result SubmitFsInfo();
|
||||
void ClearFsInfo();
|
||||
|
||||
}
|
||||
|
||||
@@ -363,6 +363,8 @@ namespace ams::erpt::srv {
|
||||
R_ABORT_UNLESS(record->Add(FieldId_GameCardReadCountFromAwaken, ei.read_count_from_awaken));
|
||||
R_ABORT_UNLESS(record->Add(FieldId_GameCardLastReadErrorPageAddress, ei.last_read_error_page_address));
|
||||
R_ABORT_UNLESS(record->Add(FieldId_GameCardLastReadErrorPageCount, ei.last_read_error_page_count));
|
||||
R_ABORT_UNLESS(record->Add(FieldId_GameCardLastDeactivateReasonResult, ei.last_deactivate_reason_result));
|
||||
R_ABORT_UNLESS(record->Add(FieldId_GameCardLastDeactivateReason, ei.last_deactivate_reason));
|
||||
|
||||
/* Submit the record. */
|
||||
R_ABORT_UNLESS(Context::SubmitContextRecord(std::move(record)));
|
||||
@@ -496,4 +498,27 @@ namespace ams::erpt::srv {
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
void ClearFsInfo() {
|
||||
Context::ClearContext(CategoryId_NANDTypeInfo);
|
||||
Context::ClearContext(CategoryId_NANDSpeedModeInfo);
|
||||
Context::ClearContext(CategoryId_NANDExtendedCsd);
|
||||
Context::ClearContext(CategoryId_NANDPatrolInfo);
|
||||
Context::ClearContext(CategoryId_NANDErrorInfo);
|
||||
Context::ClearContext(CategoryId_NANDDriverLog);
|
||||
Context::ClearContext(CategoryId_MicroSDTypeInfo);
|
||||
Context::ClearContext(CategoryId_MicroSDSpeedModeInfo);
|
||||
Context::ClearContext(CategoryId_SdCardSizeSpec);
|
||||
Context::ClearContext(CategoryId_SdCardActivationInfo);
|
||||
Context::ClearContext(CategoryId_SdCardErrorInfo);
|
||||
Context::ClearContext(CategoryId_SdCardDriverLog);
|
||||
Context::ClearContext(CategoryId_GameCardCIDInfo);
|
||||
Context::ClearContext(CategoryId_GameCardErrorInfo);
|
||||
Context::ClearContext(CategoryId_GameCardDetailedErrorInfo);
|
||||
Context::ClearContext(CategoryId_GameCardLogInfo);
|
||||
Context::ClearContext(CategoryId_FsProxyErrorInfo);
|
||||
Context::ClearContext(CategoryId_FsProxyErrorInfo2);
|
||||
Context::ClearContext(CategoryId_FsProxyErrorInfo3);
|
||||
Context::ClearContext(CategoryId_FsMemoryInfo);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -423,7 +423,11 @@ namespace ams::erpt::srv {
|
||||
|
||||
auto report = std::make_unique<Report>(record.get(), redirect_new_reports);
|
||||
R_UNLESS(report != nullptr, erpt::ResultOutOfMemory());
|
||||
auto report_guard = SCOPE_GUARD { const auto delete_res = report->Delete(); R_ASSERT(delete_res); AMS_UNUSED(delete_res); };
|
||||
auto report_guard = SCOPE_GUARD {
|
||||
const auto delete_res = report->Delete();
|
||||
R_ASSERT(delete_res);
|
||||
AMS_UNUSED(delete_res);
|
||||
};
|
||||
|
||||
R_TRY(Context::WriteContextsToReport(report.get()));
|
||||
R_TRY(report->GetSize(std::addressof(record->m_info.report_size)));
|
||||
@@ -434,7 +438,7 @@ namespace ams::erpt::srv {
|
||||
} else {
|
||||
/* If we are redirecting new reports, we don't want to store the report in the journal. */
|
||||
/* We should take this opportunity to delete any attachments associated with the report. */
|
||||
R_ABORT_UNLESS(JournalForAttachments::DeleteAttachments(report_id));
|
||||
R_TRY(JournalForAttachments::DeleteAttachments(report_id));
|
||||
}
|
||||
|
||||
R_TRY(Journal::Commit());
|
||||
@@ -489,6 +493,20 @@ namespace ams::erpt::srv {
|
||||
static_cast<void>(Context::ClearContext(CategoryId_ErrorInfo));
|
||||
static_cast<void>(Context::ClearContext(CategoryId_ErrorInfoAuto));
|
||||
static_cast<void>(Context::ClearContext(CategoryId_ErrorInfoDefaults));
|
||||
|
||||
#if defined(ATMOSPHERE_OS_HORIZON)
|
||||
/* TODO: What else is missing? */
|
||||
if (hos::GetVersion() >= hos::Version_17_0_0 && flags.Test<CreateReportOptionFlag::SubmitFsInfo>()) {
|
||||
ClearFsInfo();
|
||||
}
|
||||
|
||||
/* if (erpt::ResultInvalidPowerState::Includes(...)) {
|
||||
* Nintendo ignores this and sends "power_state_violation" play report if this error happens.
|
||||
* } else {
|
||||
* Nintendo sends "write_failure" play report if any other error happens.
|
||||
* }
|
||||
*/
|
||||
#endif
|
||||
};
|
||||
|
||||
/* Get the context entry pointer. */
|
||||
|
||||
@@ -75,15 +75,15 @@ namespace ams::pgl::srv {
|
||||
NON_COPYABLE(HostPackageReader);
|
||||
NON_MOVEABLE(HostPackageReader);
|
||||
private:
|
||||
char m_content_path[fs::EntryNameLengthMax] = {};
|
||||
ExtensionType m_extension_type = ExtensionType::None;
|
||||
char m_mount_name[fs::MountNameLengthMax] = {};
|
||||
bool m_is_mounted = false;
|
||||
char m_content_path[fs::EntryNameLengthMax] = {};
|
||||
ExtensionType m_extension_type = ExtensionType::None;
|
||||
char m_mount_name[fs::MountNameLengthMax + 1] = {};
|
||||
bool m_is_mounted = false;
|
||||
ncm::AutoBuffer m_content_meta_buffer;
|
||||
ncm::ProgramId m_program_id = ncm::InvalidProgramId;
|
||||
u32 m_program_version = 0;
|
||||
ncm::ContentMetaType m_content_meta_type = static_cast<ncm::ContentMetaType>(0);
|
||||
u8 m_program_index = 0;
|
||||
ncm::ProgramId m_program_id = ncm::InvalidProgramId;
|
||||
u32 m_program_version = 0;
|
||||
ncm::ContentMetaType m_content_meta_type = static_cast<ncm::ContentMetaType>(0);
|
||||
u8 m_program_index = 0;
|
||||
public:
|
||||
HostPackageReader() : m_content_meta_buffer() { /* ... */ }
|
||||
~HostPackageReader() {
|
||||
|
||||
@@ -452,6 +452,9 @@ namespace ams::result::impl {
|
||||
} \
|
||||
}
|
||||
|
||||
/// Explicitly discards the result returned by an expression.
|
||||
#define R_DISCARD(res_expr) (static_cast<void>(res_expr))
|
||||
|
||||
#if defined(ATMOSPHERE_BOARD_NINTENDO_NX) && defined(ATMOSPHERE_IS_STRATOSPHERE) && !defined(AMS_ENABLE_DETAILED_ASSERTIONS) && !defined(AMS_BUILD_FOR_DEBUGGING) && !defined(AMS_BUILD_FOR_AUDITING)
|
||||
#define AMS_CALL_ON_RESULT_ASSERTION_IMPL(cond, val) do { ::ams::diag::impl::FatalErrorByResultForNx(val); AMS_INFINITE_LOOP(); AMS_ASSUME(false); } while (false)
|
||||
#define AMS_CALL_ON_RESULT_ABORT_IMPL(cond, val) do { ::ams::diag::impl::FatalErrorByResultForNx(val); AMS_INFINITE_LOOP(); AMS_ASSUME(false); } while (false)
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Atmosphère-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#define AMS_ZSTD_IMPLEMENTATION
|
||||
#include <stratosphere/util/util_zbic_for_loader.hpp>
|
||||
@@ -15,7 +15,7 @@
|
||||
"filesystem_access": {
|
||||
"permissions": "0xFFFFFFFFFFFFFFFF"
|
||||
},
|
||||
"service_access": ["erpt:c", "fatal:u", "fsp-srv", "ldr:shel", "lm", "lr", "pm:shell", "set", "set:sys"],
|
||||
"service_access": ["fatal:u", "fsp-srv", "ldr:shel", "lr", "pm:shell", "set:sys"],
|
||||
"service_host": ["pgl"],
|
||||
"kernel_capabilities": [{
|
||||
"type": "kernel_flags",
|
||||
@@ -87,4 +87,4 @@
|
||||
"type": "handle_table_size",
|
||||
"value": 256
|
||||
}]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,13 +30,14 @@ namespace ams {
|
||||
fs::InitializeForSystem();
|
||||
fs::SetAllocator(pgl::srv::Allocate, pgl::srv::Deallocate);
|
||||
fs::SetEnabledAutoAbort(false);
|
||||
|
||||
/* Initialize lr. */
|
||||
lr::Initialize();
|
||||
|
||||
/* Initialize other services we need. */
|
||||
R_ABORT_UNLESS(setInitialize());
|
||||
R_ABORT_UNLESS(setsysInitialize());
|
||||
R_ABORT_UNLESS(pmshellInitialize());
|
||||
R_ABORT_UNLESS(ldrShellInitialize());
|
||||
R_ABORT_UNLESS(lrInitialize());
|
||||
|
||||
/* Verify that we can sanely execute. */
|
||||
ams::CheckApiVersion();
|
||||
@@ -58,3 +59,36 @@ namespace ams {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* Override operator new. */
|
||||
void *operator new(size_t size) {
|
||||
return ams::pgl::srv::Allocate(size);
|
||||
}
|
||||
|
||||
void *operator new(size_t size, const std::nothrow_t &) {
|
||||
return ams::pgl::srv::Allocate(size);
|
||||
}
|
||||
|
||||
void operator delete(void *p) {
|
||||
return ams::pgl::srv::Deallocate(p, 0);
|
||||
}
|
||||
|
||||
void operator delete(void *p, size_t size) {
|
||||
return ams::pgl::srv::Deallocate(p, size);
|
||||
}
|
||||
|
||||
void *operator new[](size_t size) {
|
||||
return ams::pgl::srv::Allocate(size);
|
||||
}
|
||||
|
||||
void *operator new[](size_t size, const std::nothrow_t &) {
|
||||
return ams::pgl::srv::Allocate(size);
|
||||
}
|
||||
|
||||
void operator delete[](void *p) {
|
||||
return ams::pgl::srv::Deallocate(p, 0);
|
||||
}
|
||||
|
||||
void operator delete[](void *p, size_t size) {
|
||||
return ams::pgl::srv::Deallocate(p, size);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user