Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Suyu
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
many-archive
Suyu
Commits
a4e84018
There was an error fetching the commit references. Please try again later.
Commit
a4e84018
authored
5 years ago
by
bunnei
Browse files
Options
Downloads
Patches
Plain Diff
service: time: Implement GetClockSnapshotFromSystemClockContext.
parent
fab2607c
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/core/hle/service/time/interface.cpp
+1
-1
1 addition, 1 deletion
src/core/hle/service/time/interface.cpp
src/core/hle/service/time/time.cpp
+25
-2
25 additions, 2 deletions
src/core/hle/service/time/time.cpp
src/core/hle/service/time/time.h
+1
-0
1 addition, 0 deletions
src/core/hle/service/time/time.h
with
27 additions
and
3 deletions
src/core/hle/service/time/interface.cpp
+
1
−
1
View file @
a4e84018
...
...
@@ -28,7 +28,7 @@ Time::Time(std::shared_ptr<Module> module, Core::System& system, const char* nam
{
201
,
nullptr
,
"GetStandardUserSystemClockAutomaticCorrectionUpdatedTime"
},
{
300
,
&
Time
::
CalculateMonotonicSystemClockBaseTimePoint
,
"CalculateMonotonicSystemClockBaseTimePoint"
},
{
400
,
&
Time
::
GetClockSnapshot
,
"GetClockSnapshot"
},
{
401
,
nullptr
,
"GetClockSnapshotFromSystemClockContext"
},
{
401
,
&
Time
::
GetClockSnapshotFromSystemClockContext
,
"GetClockSnapshotFromSystemClockContext"
},
{
500
,
nullptr
,
"CalculateStandardUserSystemClockDifferenceByUser"
},
{
501
,
nullptr
,
"CalculateSpanBetween"
},
};
...
...
This diff is collapsed.
Click to expand it.
src/core/hle/service/time/time.cpp
+
25
−
2
View file @
a4e84018
...
...
@@ -242,7 +242,7 @@ void Module::Interface::CalculateMonotonicSystemClockBaseTimePoint(Kernel::HLERe
void
Module
::
Interface
::
GetClockSnapshot
(
Kernel
::
HLERequestContext
&
ctx
)
{
LOG_DEBUG
(
Service_Time
,
"called"
);
IPC
::
RequestParser
rp
{
ctx
};
const
auto
type
=
rp
.
PopRaw
<
u8
>
();
const
auto
type
{
rp
.
PopRaw
<
u8
>
()
}
;
Clock
::
SystemClockContext
user_context
{};
if
(
const
ResultCode
result
{
...
...
@@ -277,6 +277,29 @@ void Module::Interface::GetClockSnapshot(Kernel::HLERequestContext& ctx) {
ctx
.
WriteBuffer
(
&
clock_snapshot
,
sizeof
(
Clock
::
ClockSnapshot
));
}
void
Module
::
Interface
::
GetClockSnapshotFromSystemClockContext
(
Kernel
::
HLERequestContext
&
ctx
)
{
LOG_DEBUG
(
Service_Time
,
"called"
);
IPC
::
RequestParser
rp
{
ctx
};
const
auto
type
{
rp
.
PopRaw
<
u8
>
()};
rp
.
AlignWithPadding
();
const
Clock
::
SystemClockContext
user_context
{
rp
.
PopRaw
<
Clock
::
SystemClockContext
>
()};
const
Clock
::
SystemClockContext
network_context
{
rp
.
PopRaw
<
Clock
::
SystemClockContext
>
()};
Clock
::
ClockSnapshot
clock_snapshot
{};
if
(
const
ResultCode
result
{
GetClockSnapshotFromSystemClockContextInternal
(
&
ctx
.
GetThread
(),
user_context
,
network_context
,
type
,
clock_snapshot
)};
result
!=
RESULT_SUCCESS
)
{
IPC
::
ResponseBuilder
rb
{
ctx
,
2
};
rb
.
Push
(
result
);
return
;
}
IPC
::
ResponseBuilder
rb
{
ctx
,
2
};
rb
.
Push
(
RESULT_SUCCESS
);
ctx
.
WriteBuffer
(
&
clock_snapshot
,
sizeof
(
Clock
::
ClockSnapshot
));
}
void
Module
::
Interface
::
GetSharedMemoryNativeHandle
(
Kernel
::
HLERequestContext
&
ctx
)
{
LOG_DEBUG
(
Service_Time
,
"called"
);
IPC
::
ResponseBuilder
rb
{
ctx
,
2
,
1
};
...
...
@@ -290,7 +313,7 @@ Module::Interface::Interface(std::shared_ptr<Module> module, Core::System& syste
Module
::
Interface
::~
Interface
()
=
default
;
void
InstallInterfaces
(
Core
::
System
&
system
)
{
auto
module
=
std
::
make_shared
<
Module
>
(
system
);
auto
module
{
std
::
make_shared
<
Module
>
(
system
)
}
;
std
::
make_shared
<
Time
>
(
module
,
system
,
"time:a"
)
->
InstallAsService
(
system
.
ServiceManager
());
std
::
make_shared
<
Time
>
(
module
,
system
,
"time:s"
)
->
InstallAsService
(
system
.
ServiceManager
());
std
::
make_shared
<
Time
>
(
module
,
system
,
"time:u"
)
->
InstallAsService
(
system
.
ServiceManager
());
...
...
This diff is collapsed.
Click to expand it.
src/core/hle/service/time/time.h
+
1
−
0
View file @
a4e84018
...
...
@@ -30,6 +30,7 @@ public:
void
IsStandardNetworkSystemClockAccuracySufficient
(
Kernel
::
HLERequestContext
&
ctx
);
void
CalculateMonotonicSystemClockBaseTimePoint
(
Kernel
::
HLERequestContext
&
ctx
);
void
GetClockSnapshot
(
Kernel
::
HLERequestContext
&
ctx
);
void
GetClockSnapshotFromSystemClockContext
(
Kernel
::
HLERequestContext
&
ctx
);
void
GetSharedMemoryNativeHandle
(
Kernel
::
HLERequestContext
&
ctx
);
private:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment