forked from ShuriZma/suyu
1
0
Fork 0

Compare commits

...

3 Commits

Author SHA1 Message Date
Belal Ashraf fed0ec70e0 fix line wrapping in the functions list 2024-04-10 21:21:09 +02:00
Belal Ashraf 097e340d40 fix wrong function name 2024-04-10 17:45:33 +02:00
Belal Ashraf aebf13752e fix qlaunch on firmware 18
yea
2024-04-10 17:27:32 +02:00
8 changed files with 45 additions and 5 deletions

View File

@ -172,6 +172,7 @@ Result KPageTableBase::InitializeForKernel(bool is_64_bit, KVirtualAddress start
m_mapped_unsafe_physical_memory = 0; m_mapped_unsafe_physical_memory = 0;
m_mapped_insecure_memory = 0; m_mapped_insecure_memory = 0;
m_mapped_ipc_server_memory = 0; m_mapped_ipc_server_memory = 0;
m_alias_region_extra_size = 0;
m_memory_block_slab_manager = m_memory_block_slab_manager =
m_kernel.GetSystemSystemResource().GetMemoryBlockSlabManagerPointer(); m_kernel.GetSystemSystemResource().GetMemoryBlockSlabManagerPointer();
@ -269,6 +270,12 @@ Result KPageTableBase::InitializeForProcess(Svc::CreateProcessFlag as_type, bool
process_code_end = m_code_region_end; process_code_end = m_code_region_end;
} }
m_alias_region_extra_size = 0;
if (as_type == Svc::CreateProcessFlag::EnableReservedRegionExtraSize) {
m_alias_region_extra_size = GetAddressSpaceSize() / 8;
alias_region_size += m_alias_region_extra_size;
}
// Set other basic fields. // Set other basic fields.
m_enable_aslr = enable_aslr; m_enable_aslr = enable_aslr;
m_enable_device_address_space_merge = enable_das_merge; m_enable_device_address_space_merge = enable_das_merge;

View File

@ -208,6 +208,7 @@ private:
size_t m_mapped_unsafe_physical_memory{}; size_t m_mapped_unsafe_physical_memory{};
size_t m_mapped_insecure_memory{}; size_t m_mapped_insecure_memory{};
size_t m_mapped_ipc_server_memory{}; size_t m_mapped_ipc_server_memory{};
size_t m_alias_region_extra_size{};
mutable KLightLock m_general_lock; mutable KLightLock m_general_lock;
mutable KLightLock m_map_physical_memory_lock; mutable KLightLock m_map_physical_memory_lock;
KLightLock m_device_map_lock; KLightLock m_device_map_lock;
@ -682,6 +683,9 @@ public:
size_t GetAliasRegionSize() const { size_t GetAliasRegionSize() const {
return m_alias_region_end - m_alias_region_start; return m_alias_region_end - m_alias_region_start;
} }
size_t GetReservedRegionExtraSize() const {
return m_alias_region_extra_size;
}
size_t GetStackRegionSize() const { size_t GetStackRegionSize() const {
return m_stack_region_end - m_stack_region_start; return m_stack_region_end - m_stack_region_start;
} }

View File

@ -410,6 +410,9 @@ public:
size_t GetAliasRegionSize() const { size_t GetAliasRegionSize() const {
return m_page_table.GetAliasRegionSize(); return m_page_table.GetAliasRegionSize();
} }
size_t GetReservedRegionExtraSize() const {
return m_page_table.GetReservedRegionExtraSize();
}
size_t GetStackRegionSize() const { size_t GetStackRegionSize() const {
return m_page_table.GetStackRegionSize(); return m_page_table.GetStackRegionSize();
} }

View File

@ -37,7 +37,8 @@ Result GetInfo(Core::System& system, u64* result, InfoType info_id_type, Handle
case InfoType::TotalNonSystemMemorySize: case InfoType::TotalNonSystemMemorySize:
case InfoType::UsedNonSystemMemorySize: case InfoType::UsedNonSystemMemorySize:
case InfoType::IsApplication: case InfoType::IsApplication:
case InfoType::FreeThreadCount: { case InfoType::FreeThreadCount:
case InfoType::ReservedRegionExtraSize: {
R_UNLESS(info_sub_id == 0, ResultInvalidEnumValue); R_UNLESS(info_sub_id == 0, ResultInvalidEnumValue);
const auto& handle_table = GetCurrentProcess(system.Kernel()).GetHandleTable(); const auto& handle_table = GetCurrentProcess(system.Kernel()).GetHandleTable();
@ -134,6 +135,10 @@ Result GetInfo(Core::System& system, u64* result, InfoType info_id_type, Handle
} }
R_SUCCEED(); R_SUCCEED();
case InfoType::ReservedRegionExtraSize:
*result = process->GetPageTable().GetReservedRegionExtraSize();
R_SUCCEED();
default: default:
break; break;
} }

View File

@ -153,6 +153,7 @@ enum class InfoType : u32 {
ThreadTickCount = 25, ThreadTickCount = 25,
IsSvcPermitted = 26, IsSvcPermitted = 26,
IoRegionHint = 27, IoRegionHint = 27,
ReservedRegionExtraSize = 28,
MesosphereMeta = 65000, MesosphereMeta = 65000,
MesosphereCurrentProcess = 65001, MesosphereCurrentProcess = 65001,
@ -642,9 +643,12 @@ enum class CreateProcessFlag : u32 {
// 11.x+ DisableDeviceAddressSpaceMerge. // 11.x+ DisableDeviceAddressSpaceMerge.
DisableDeviceAddressSpaceMerge = (1 << 12), DisableDeviceAddressSpaceMerge = (1 << 12),
EnableReservedRegionExtraSize = (1 << 13),
// Mask of all flags. // Mask of all flags.
All = Is64Bit | AddressSpaceMask | EnableDebug | EnableAslr | IsApplication | All = Is64Bit | AddressSpaceMask | EnableDebug | EnableAslr | IsApplication |
PoolPartitionMask | OptimizeMemoryAllocation | DisableDeviceAddressSpaceMerge, PoolPartitionMask | OptimizeMemoryAllocation | DisableDeviceAddressSpaceMerge |
EnableReservedRegionExtraSize,
}; };
DECLARE_ENUM_FLAG_OPERATORS(CreateProcessFlag); DECLARE_ENUM_FLAG_OPERATORS(CreateProcessFlag);

View File

@ -323,7 +323,7 @@ public:
{11, &IProfileCommon::LoadImage, "LoadImage"}, {11, &IProfileCommon::LoadImage, "LoadImage"},
{20, &IProfileCommon::GetImageSize, "GetLargeImageSize"}, // 18.0.0+ {20, &IProfileCommon::GetImageSize, "GetLargeImageSize"}, // 18.0.0+
{21, &IProfileCommon::LoadImage, "LoadLargeImage"}, // 18.0.0+ {21, &IProfileCommon::LoadImage, "LoadLargeImage"}, // 18.0.0+
{30, nullptr, "GetImageId"}, // 18.0.0+ {30, &IProfileCommon::Unknown, "GetImageId"}, // 18.0.0+
}; };
RegisterHandlers(functions); RegisterHandlers(functions);
@ -494,6 +494,13 @@ protected:
rb.Push(ResultSuccess); rb.Push(ResultSuccess);
} }
void Unknown(HLERequestContext& ctx) {
LOG_WARNING(Service_ACC, "(STUBBED) called");
IPC::ResponseBuilder rb{ctx, 3};
rb.Push(ResultSuccess);
rb.Push(0);
}
ProfileManager& profile_manager; ProfileManager& profile_manager;
Common::UUID user_id{}; ///< The user id this profile refers to. Common::UUID user_id{}; ///< The user id this profile refers to.
}; };
@ -509,7 +516,15 @@ class IProfileEditor final : public IProfileCommon {
public: public:
explicit IProfileEditor(Core::System& system_, Common::UUID user_id_, explicit IProfileEditor(Core::System& system_, Common::UUID user_id_,
ProfileManager& profile_manager_) ProfileManager& profile_manager_)
: IProfileCommon{system_, "IProfileEditor", true, user_id_, profile_manager_} {} : IProfileCommon{system_, "IProfileEditor", true, user_id_, profile_manager_} {
// clang-format off
static const FunctionInfo functions[] = {
{30, &IProfileEditor::Unknown, "Unknown"},
};
// clang-format on
RegisterHandlers(functions);
}
}; };
class ISessionObject final : public ServiceFramework<ISessionObject> { class ISessionObject final : public ServiceFramework<ISessionObject> {

View File

@ -14,6 +14,7 @@ IAudioDevice::IAudioDevice(Core::System& system_, u64 applet_resource_user_id, u
: ServiceFramework{system_, "IAudioDevice"}, service_context{system_, "IAudioDevice"}, : ServiceFramework{system_, "IAudioDevice"}, service_context{system_, "IAudioDevice"},
impl{std::make_unique<AudioDevice>(system_, applet_resource_user_id, revision)}, impl{std::make_unique<AudioDevice>(system_, applet_resource_user_id, revision)},
event{service_context.CreateEvent(fmt::format("IAudioDeviceEvent-{}", device_num))} { event{service_context.CreateEvent(fmt::format("IAudioDeviceEvent-{}", device_num))} {
// clang-format off
static const FunctionInfo functions[] = { static const FunctionInfo functions[] = {
{0, D<&IAudioDevice::ListAudioDeviceName>, "ListAudioDeviceName"}, {0, D<&IAudioDevice::ListAudioDeviceName>, "ListAudioDeviceName"},
{1, D<&IAudioDevice::SetAudioDeviceOutputVolume>, "SetAudioDeviceOutputVolume"}, {1, D<&IAudioDevice::SetAudioDeviceOutputVolume>, "SetAudioDeviceOutputVolume"},
@ -37,6 +38,7 @@ IAudioDevice::IAudioDevice(Core::System& system_, u64 applet_resource_user_id, u
{19, nullptr, "SetAudioDeviceOutputVolumeAutoTuneEnabled"}, // 18.0.0+ {19, nullptr, "SetAudioDeviceOutputVolumeAutoTuneEnabled"}, // 18.0.0+
{20, nullptr, "IsAudioDeviceOutputVolumeAutoTuneEnabled"} // 18.0.0+ {20, nullptr, "IsAudioDeviceOutputVolumeAutoTuneEnabled"} // 18.0.0+
}; };
// clang-format on
RegisterHandlers(functions); RegisterHandlers(functions);
event->Signal(); event->Signal();

View File

@ -105,7 +105,7 @@ IParentalControlService::IParentalControlService(Core::System& system_, Capabili
{1954, nullptr, "IsBedtimeAlarmEnabled"}, // 18.0.0+ {1954, nullptr, "IsBedtimeAlarmEnabled"}, // 18.0.0+
{1955, nullptr, "GetBedtimeAlarmTime"}, // 18.0.0+ {1955, nullptr, "GetBedtimeAlarmTime"}, // 18.0.0+
{1956, nullptr, "GetBedtimeAlarmTimeHour"}, // 18.0.0+ {1956, nullptr, "GetBedtimeAlarmTimeHour"}, // 18.0.0+
{1967, nullptr, "GetBedtimeAlarmMinute"}, // 18.0.0+ {1967, nullptr, "GetBedtimeAlarmTimeMinute"}, // 18.0.0+
{2001, nullptr, "RequestPairingAsync"}, {2001, nullptr, "RequestPairingAsync"},
{2002, nullptr, "FinishRequestPairing"}, {2002, nullptr, "FinishRequestPairing"},
{2003, nullptr, "AuthorizePairingAsync"}, {2003, nullptr, "AuthorizePairingAsync"},