summaryrefslogtreecommitdiff
path: root/src/core/hle/service/glue
diff options
context:
space:
mode:
authorGravatar Fernando S2024-02-02 15:10:46 +0100
committerGravatar GitHub2024-02-02 15:10:46 +0100
commit6baf965777145fd9c76bd06a3c140afa46a50e87 (patch)
tree52a9b8ea293bb9b378e7e662b92e9c56d1f87d4c /src/core/hle/service/glue
parentMerge pull request #12845 from liamwhite/notif (diff)
parentservice: use const references for input raw data (diff)
downloadyuzu-6baf965777145fd9c76bd06a3c140afa46a50e87.tar.gz
yuzu-6baf965777145fd9c76bd06a3c140afa46a50e87.tar.xz
yuzu-6baf965777145fd9c76bd06a3c140afa46a50e87.zip
Merge pull request #12857 from liamwhite/const
service: use const references for input raw data
Diffstat (limited to 'src/core/hle/service/glue')
-rw-r--r--src/core/hle/service/glue/time/static.cpp6
-rw-r--r--src/core/hle/service/glue/time/static.h6
-rw-r--r--src/core/hle/service/glue/time/time_zone.cpp9
-rw-r--r--src/core/hle/service/glue/time/time_zone.h10
-rw-r--r--src/core/hle/service/glue/time/time_zone_binary.cpp6
-rw-r--r--src/core/hle/service/glue/time/time_zone_binary.h6
6 files changed, 24 insertions, 19 deletions
diff --git a/src/core/hle/service/glue/time/static.cpp b/src/core/hle/service/glue/time/static.cpp
index f56db76e1..f8c1218f3 100644
--- a/src/core/hle/service/glue/time/static.cpp
+++ b/src/core/hle/service/glue/time/static.cpp
@@ -200,7 +200,7 @@ Result StaticService::GetStandardUserSystemClockAutomaticCorrectionUpdatedTime(
200} 200}
201 201
202Result StaticService::CalculateMonotonicSystemClockBaseTimePoint( 202Result StaticService::CalculateMonotonicSystemClockBaseTimePoint(
203 Out<s64> out_time, Service::PSC::Time::SystemClockContext& context) { 203 Out<s64> out_time, const Service::PSC::Time::SystemClockContext& context) {
204 SCOPE_EXIT({ LOG_DEBUG(Service_Time, "called. context={} out_time={}", context, *out_time); }); 204 SCOPE_EXIT({ LOG_DEBUG(Service_Time, "called. context={} out_time={}", context, *out_time); });
205 205
206 R_RETURN(m_wrapped_service->CalculateMonotonicSystemClockBaseTimePoint(out_time, context)); 206 R_RETURN(m_wrapped_service->CalculateMonotonicSystemClockBaseTimePoint(out_time, context));
@@ -216,8 +216,8 @@ Result StaticService::GetClockSnapshot(OutClockSnapshot out_snapshot,
216 216
217Result StaticService::GetClockSnapshotFromSystemClockContext( 217Result StaticService::GetClockSnapshotFromSystemClockContext(
218 Service::PSC::Time::TimeType type, OutClockSnapshot out_snapshot, 218 Service::PSC::Time::TimeType type, OutClockSnapshot out_snapshot,
219 Service::PSC::Time::SystemClockContext& user_context, 219 const Service::PSC::Time::SystemClockContext& user_context,
220 Service::PSC::Time::SystemClockContext& network_context) { 220 const Service::PSC::Time::SystemClockContext& network_context) {
221 SCOPE_EXIT({ 221 SCOPE_EXIT({
222 LOG_DEBUG(Service_Time, 222 LOG_DEBUG(Service_Time,
223 "called. type={} out_snapshot={} user_context={} network_context={}", type, 223 "called. type={} out_snapshot={} user_context={} network_context={}", type,
diff --git a/src/core/hle/service/glue/time/static.h b/src/core/hle/service/glue/time/static.h
index d3cc0fdd6..5d3623182 100644
--- a/src/core/hle/service/glue/time/static.h
+++ b/src/core/hle/service/glue/time/static.h
@@ -58,12 +58,12 @@ public:
58 Result GetStandardUserSystemClockAutomaticCorrectionUpdatedTime( 58 Result GetStandardUserSystemClockAutomaticCorrectionUpdatedTime(
59 Out<Service::PSC::Time::SteadyClockTimePoint> out_time_point); 59 Out<Service::PSC::Time::SteadyClockTimePoint> out_time_point);
60 Result CalculateMonotonicSystemClockBaseTimePoint( 60 Result CalculateMonotonicSystemClockBaseTimePoint(
61 Out<s64> out_time, Service::PSC::Time::SystemClockContext& context); 61 Out<s64> out_time, const Service::PSC::Time::SystemClockContext& context);
62 Result GetClockSnapshot(OutClockSnapshot out_snapshot, Service::PSC::Time::TimeType type); 62 Result GetClockSnapshot(OutClockSnapshot out_snapshot, Service::PSC::Time::TimeType type);
63 Result GetClockSnapshotFromSystemClockContext( 63 Result GetClockSnapshotFromSystemClockContext(
64 Service::PSC::Time::TimeType type, OutClockSnapshot out_snapshot, 64 Service::PSC::Time::TimeType type, OutClockSnapshot out_snapshot,
65 Service::PSC::Time::SystemClockContext& user_context, 65 const Service::PSC::Time::SystemClockContext& user_context,
66 Service::PSC::Time::SystemClockContext& network_context); 66 const Service::PSC::Time::SystemClockContext& network_context);
67 Result CalculateStandardUserSystemClockDifferenceByUser(Out<s64> out_difference, 67 Result CalculateStandardUserSystemClockDifferenceByUser(Out<s64> out_difference,
68 InClockSnapshot a, InClockSnapshot b); 68 InClockSnapshot a, InClockSnapshot b);
69 Result CalculateSpanBetween(Out<s64> out_time, InClockSnapshot a, InClockSnapshot b); 69 Result CalculateSpanBetween(Out<s64> out_time, InClockSnapshot a, InClockSnapshot b);
diff --git a/src/core/hle/service/glue/time/time_zone.cpp b/src/core/hle/service/glue/time/time_zone.cpp
index 98d928697..36f163419 100644
--- a/src/core/hle/service/glue/time/time_zone.cpp
+++ b/src/core/hle/service/glue/time/time_zone.cpp
@@ -62,7 +62,8 @@ Result TimeZoneService::GetDeviceLocationName(
62 R_RETURN(m_wrapped_service->GetDeviceLocationName(out_location_name)); 62 R_RETURN(m_wrapped_service->GetDeviceLocationName(out_location_name));
63} 63}
64 64
65Result TimeZoneService::SetDeviceLocationName(Service::PSC::Time::LocationName& location_name) { 65Result TimeZoneService::SetDeviceLocationName(
66 const Service::PSC::Time::LocationName& location_name) {
66 LOG_DEBUG(Service_Time, "called. location_name={}", location_name); 67 LOG_DEBUG(Service_Time, "called. location_name={}", location_name);
67 68
68 R_UNLESS(m_can_write_timezone_device_location, Service::PSC::Time::ResultPermissionDenied); 69 R_UNLESS(m_can_write_timezone_device_location, Service::PSC::Time::ResultPermissionDenied);
@@ -110,7 +111,8 @@ Result TimeZoneService::LoadLocationNameList(
110 R_RETURN(GetTimeZoneLocationList(*out_count, out_names, out_names.size(), index)); 111 R_RETURN(GetTimeZoneLocationList(*out_count, out_names, out_names.size(), index));
111} 112}
112 113
113Result TimeZoneService::LoadTimeZoneRule(OutRule out_rule, Service::PSC::Time::LocationName& name) { 114Result TimeZoneService::LoadTimeZoneRule(OutRule out_rule,
115 const Service::PSC::Time::LocationName& name) {
114 LOG_DEBUG(Service_Time, "called. name={}", name); 116 LOG_DEBUG(Service_Time, "called. name={}", name);
115 117
116 std::scoped_lock l{m_mutex}; 118 std::scoped_lock l{m_mutex};
@@ -139,7 +141,8 @@ Result TimeZoneService::GetDeviceLocationNameAndUpdatedTime(
139} 141}
140 142
141Result TimeZoneService::SetDeviceLocationNameWithTimeZoneRule( 143Result TimeZoneService::SetDeviceLocationNameWithTimeZoneRule(
142 Service::PSC::Time::LocationName& location_name, InBuffer<BufferAttr_HipcAutoSelect> binary) { 144 const Service::PSC::Time::LocationName& location_name,
145 InBuffer<BufferAttr_HipcAutoSelect> binary) {
143 LOG_DEBUG(Service_Time, "called. location_name={}", location_name); 146 LOG_DEBUG(Service_Time, "called. location_name={}", location_name);
144 147
145 R_UNLESS(m_can_write_timezone_device_location, Service::PSC::Time::ResultPermissionDenied); 148 R_UNLESS(m_can_write_timezone_device_location, Service::PSC::Time::ResultPermissionDenied);
diff --git a/src/core/hle/service/glue/time/time_zone.h b/src/core/hle/service/glue/time/time_zone.h
index 9c1530966..beb54ddde 100644
--- a/src/core/hle/service/glue/time/time_zone.h
+++ b/src/core/hle/service/glue/time/time_zone.h
@@ -46,18 +46,20 @@ public:
46 ~TimeZoneService() override; 46 ~TimeZoneService() override;
47 47
48 Result GetDeviceLocationName(Out<Service::PSC::Time::LocationName> out_location_name); 48 Result GetDeviceLocationName(Out<Service::PSC::Time::LocationName> out_location_name);
49 Result SetDeviceLocationName(Service::PSC::Time::LocationName& location_name); 49 Result SetDeviceLocationName(const Service::PSC::Time::LocationName& location_name);
50 Result GetTotalLocationNameCount(Out<u32> out_count); 50 Result GetTotalLocationNameCount(Out<u32> out_count);
51 Result LoadLocationNameList( 51 Result LoadLocationNameList(
52 Out<u32> out_count, 52 Out<u32> out_count,
53 OutArray<Service::PSC::Time::LocationName, BufferAttr_HipcMapAlias> out_names, u32 index); 53 OutArray<Service::PSC::Time::LocationName, BufferAttr_HipcMapAlias> out_names, u32 index);
54 Result LoadTimeZoneRule(OutRule out_rule, Service::PSC::Time::LocationName& location_name); 54 Result LoadTimeZoneRule(OutRule out_rule,
55 const Service::PSC::Time::LocationName& location_name);
55 Result GetTimeZoneRuleVersion(Out<Service::PSC::Time::RuleVersion> out_rule_version); 56 Result GetTimeZoneRuleVersion(Out<Service::PSC::Time::RuleVersion> out_rule_version);
56 Result GetDeviceLocationNameAndUpdatedTime( 57 Result GetDeviceLocationNameAndUpdatedTime(
57 Out<Service::PSC::Time::LocationName> location_name, 58 Out<Service::PSC::Time::LocationName> location_name,
58 Out<Service::PSC::Time::SteadyClockTimePoint> out_time_point); 59 Out<Service::PSC::Time::SteadyClockTimePoint> out_time_point);
59 Result SetDeviceLocationNameWithTimeZoneRule(Service::PSC::Time::LocationName& location_name, 60 Result SetDeviceLocationNameWithTimeZoneRule(
60 InBuffer<BufferAttr_HipcAutoSelect> binary); 61 const Service::PSC::Time::LocationName& location_name,
62 InBuffer<BufferAttr_HipcAutoSelect> binary);
61 Result ParseTimeZoneBinary(OutRule out_rule, InBuffer<BufferAttr_HipcAutoSelect> binary); 63 Result ParseTimeZoneBinary(OutRule out_rule, InBuffer<BufferAttr_HipcAutoSelect> binary);
62 Result GetDeviceLocationNameOperationEventReadableHandle( 64 Result GetDeviceLocationNameOperationEventReadableHandle(
63 OutCopyHandle<Kernel::KReadableEvent> out_event); 65 OutCopyHandle<Kernel::KReadableEvent> out_event);
diff --git a/src/core/hle/service/glue/time/time_zone_binary.cpp b/src/core/hle/service/glue/time/time_zone_binary.cpp
index cc50b6b7b..d5f7ca3d2 100644
--- a/src/core/hle/service/glue/time/time_zone_binary.cpp
+++ b/src/core/hle/service/glue/time/time_zone_binary.cpp
@@ -98,7 +98,7 @@ void GetTimeZoneBinaryVersionPath(std::string& out_path) {
98 out_path = "/version.txt"; 98 out_path = "/version.txt";
99} 99}
100 100
101void GetTimeZoneZonePath(std::string& out_path, Service::PSC::Time::LocationName& name) { 101void GetTimeZoneZonePath(std::string& out_path, const Service::PSC::Time::LocationName& name) {
102 if (g_time_zone_binary_mount_result != ResultSuccess) { 102 if (g_time_zone_binary_mount_result != ResultSuccess) {
103 return; 103 return;
104 } 104 }
@@ -106,7 +106,7 @@ void GetTimeZoneZonePath(std::string& out_path, Service::PSC::Time::LocationName
106 out_path = fmt::format("/zoneinfo/{}", name.data()); 106 out_path = fmt::format("/zoneinfo/{}", name.data());
107} 107}
108 108
109bool IsTimeZoneBinaryValid(Service::PSC::Time::LocationName& name) { 109bool IsTimeZoneBinaryValid(const Service::PSC::Time::LocationName& name) {
110 std::string path{}; 110 std::string path{};
111 GetTimeZoneZonePath(path, name); 111 GetTimeZoneZonePath(path, name);
112 112
@@ -155,7 +155,7 @@ Result GetTimeZoneVersion(Service::PSC::Time::RuleVersion& out_rule_version) {
155} 155}
156 156
157Result GetTimeZoneRule(std::span<const u8>& out_rule, size_t& out_rule_size, 157Result GetTimeZoneRule(std::span<const u8>& out_rule, size_t& out_rule_size,
158 Service::PSC::Time::LocationName& name) { 158 const Service::PSC::Time::LocationName& name) {
159 std::string path{}; 159 std::string path{};
160 GetTimeZoneZonePath(path, name); 160 GetTimeZoneZonePath(path, name);
161 161
diff --git a/src/core/hle/service/glue/time/time_zone_binary.h b/src/core/hle/service/glue/time/time_zone_binary.h
index 461f4577e..9d0a8dfe9 100644
--- a/src/core/hle/service/glue/time/time_zone_binary.h
+++ b/src/core/hle/service/glue/time/time_zone_binary.h
@@ -19,12 +19,12 @@ void ResetTimeZoneBinary();
19Result MountTimeZoneBinary(Core::System& system); 19Result MountTimeZoneBinary(Core::System& system);
20void GetTimeZoneBinaryListPath(std::string& out_path); 20void GetTimeZoneBinaryListPath(std::string& out_path);
21void GetTimeZoneBinaryVersionPath(std::string& out_path); 21void GetTimeZoneBinaryVersionPath(std::string& out_path);
22void GetTimeZoneZonePath(std::string& out_path, Service::PSC::Time::LocationName& name); 22void GetTimeZoneZonePath(std::string& out_path, const Service::PSC::Time::LocationName& name);
23bool IsTimeZoneBinaryValid(Service::PSC::Time::LocationName& name); 23bool IsTimeZoneBinaryValid(const Service::PSC::Time::LocationName& name);
24u32 GetTimeZoneCount(); 24u32 GetTimeZoneCount();
25Result GetTimeZoneVersion(Service::PSC::Time::RuleVersion& out_rule_version); 25Result GetTimeZoneVersion(Service::PSC::Time::RuleVersion& out_rule_version);
26Result GetTimeZoneRule(std::span<const u8>& out_rule, size_t& out_rule_size, 26Result GetTimeZoneRule(std::span<const u8>& out_rule, size_t& out_rule_size,
27 Service::PSC::Time::LocationName& name); 27 const Service::PSC::Time::LocationName& name);
28Result GetTimeZoneLocationList(u32& out_count, 28Result GetTimeZoneLocationList(u32& out_count,
29 std::span<Service::PSC::Time::LocationName> out_names, 29 std::span<Service::PSC::Time::LocationName> out_names,
30 size_t max_names, u32 index); 30 size_t max_names, u32 index);