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
575db041
There was an error fetching the commit references. Please try again later.
Commit
575db041
authored
1 year ago
by
Liam
Browse files
Options
Downloads
Patches
Plain Diff
core_timing: use static typing for no-wait unschedule
parent
f34d3d7e
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/core_timing.cpp
+3
-2
3 additions, 2 deletions
src/core/core_timing.cpp
src/core/core_timing.h
+7
-5
7 additions, 5 deletions
src/core/core_timing.h
src/core/hle/kernel/k_hardware_timer.cpp
+2
-1
2 additions, 1 deletion
src/core/hle/kernel/k_hardware_timer.cpp
with
12 additions
and
8 deletions
src/core/core_timing.cpp
+
3
−
2
View file @
575db041
...
@@ -143,7 +143,8 @@ void CoreTiming::ScheduleLoopingEvent(std::chrono::nanoseconds start_time,
...
@@ -143,7 +143,8 @@ void CoreTiming::ScheduleLoopingEvent(std::chrono::nanoseconds start_time,
event
.
Set
();
event
.
Set
();
}
}
void
CoreTiming
::
UnscheduleEvent
(
const
std
::
shared_ptr
<
EventType
>&
event_type
,
bool
wait
)
{
void
CoreTiming
::
UnscheduleEvent
(
const
std
::
shared_ptr
<
EventType
>&
event_type
,
UnscheduleEventType
type
)
{
{
{
std
::
scoped_lock
lk
{
basic_lock
};
std
::
scoped_lock
lk
{
basic_lock
};
...
@@ -161,7 +162,7 @@ void CoreTiming::UnscheduleEvent(const std::shared_ptr<EventType>& event_type, b
...
@@ -161,7 +162,7 @@ void CoreTiming::UnscheduleEvent(const std::shared_ptr<EventType>& event_type, b
}
}
// Force any in-progress events to finish
// Force any in-progress events to finish
if
(
w
ait
)
{
if
(
type
==
UnscheduleEventType
::
W
ait
)
{
std
::
scoped_lock
lk
{
advance_lock
};
std
::
scoped_lock
lk
{
advance_lock
};
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
src/core/core_timing.h
+
7
−
5
View file @
575db041
...
@@ -35,6 +35,11 @@ struct EventType {
...
@@ -35,6 +35,11 @@ struct EventType {
const
std
::
string
name
;
const
std
::
string
name
;
};
};
enum
class
UnscheduleEventType
{
Wait
,
NoWait
,
};
/**
/**
* This is a system to schedule events into the emulated machine's future. Time is measured
* This is a system to schedule events into the emulated machine's future. Time is measured
* in main CPU clock cycles.
* in main CPU clock cycles.
...
@@ -98,11 +103,8 @@ public:
...
@@ -98,11 +103,8 @@ public:
const
std
::
shared_ptr
<
EventType
>&
event_type
,
const
std
::
shared_ptr
<
EventType
>&
event_type
,
bool
absolute_time
=
false
);
bool
absolute_time
=
false
);
void
UnscheduleEvent
(
const
std
::
shared_ptr
<
EventType
>&
event_type
,
bool
wait
=
true
);
void
UnscheduleEvent
(
const
std
::
shared_ptr
<
EventType
>&
event_type
,
UnscheduleEventType
type
=
UnscheduleEventType
::
Wait
);
void
UnscheduleEventWithoutWait
(
const
std
::
shared_ptr
<
EventType
>&
event_type
)
{
UnscheduleEvent
(
event_type
,
false
);
}
void
AddTicks
(
u64
ticks_to_add
);
void
AddTicks
(
u64
ticks_to_add
);
...
...
This diff is collapsed.
Click to expand it.
src/core/hle/kernel/k_hardware_timer.cpp
+
2
−
1
View file @
575db041
...
@@ -61,7 +61,8 @@ void KHardwareTimer::EnableInterrupt(s64 wakeup_time) {
...
@@ -61,7 +61,8 @@ void KHardwareTimer::EnableInterrupt(s64 wakeup_time) {
}
}
void
KHardwareTimer
::
DisableInterrupt
()
{
void
KHardwareTimer
::
DisableInterrupt
()
{
m_kernel
.
System
().
CoreTiming
().
UnscheduleEventWithoutWait
(
m_event_type
);
m_kernel
.
System
().
CoreTiming
().
UnscheduleEvent
(
m_event_type
,
Core
::
Timing
::
UnscheduleEventType
::
NoWait
);
m_wakeup_time
=
std
::
numeric_limits
<
s64
>::
max
();
m_wakeup_time
=
std
::
numeric_limits
<
s64
>::
max
();
}
}
...
...
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