Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
kernel
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
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
ACS
Public
HermitOS
kernel
Commits
48080256
Commit
48080256
authored
3 years ago
by
Martin Kröning
Browse files
Options
Downloads
Patches
Plain Diff
Remove unused WakeupReason
parent
e8bd768c
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/scheduler/mod.rs
+0
-10
0 additions, 10 deletions
src/scheduler/mod.rs
src/scheduler/task.rs
+3
-16
3 additions, 16 deletions
src/scheduler/task.rs
src/synch/semaphore.rs
+1
-3
1 addition, 3 deletions
src/synch/semaphore.rs
with
4 additions
and
29 deletions
src/scheduler/mod.rs
+
0
−
10
View file @
48080256
...
...
@@ -297,16 +297,6 @@ impl PerCoreScheduler {
irqsave
(||
self
.current_task
.borrow
()
.prio
)
}
#[inline]
pub
fn
get_current_task_wakeup_reason
(
&
self
)
->
WakeupReason
{
irqsave
(||
self
.current_task
.borrow_mut
()
.last_wakeup_reason
)
}
#[inline]
pub
fn
set_current_task_wakeup_reason
(
&
mut
self
,
reason
:
WakeupReason
)
{
irqsave
(||
self
.current_task
.borrow_mut
()
.last_wakeup_reason
=
reason
);
}
#[cfg(target_arch
=
"x86_64"
)]
#[inline]
pub
fn
get_current_kernel_stack
(
&
self
)
->
VirtAddr
{
...
...
This diff is collapsed.
Click to expand it.
src/scheduler/task.rs
+
3
−
16
View file @
48080256
...
...
@@ -35,13 +35,6 @@ pub enum TaskStatus {
Idle
,
}
/// Reason why wakeup() has been called on a task.
#[derive(Clone,
Copy,
PartialEq)]
pub
enum
WakeupReason
{
Custom
,
Timer
,
}
/// Unique identifier for a task (i.e. `pid`).
#[derive(PartialEq,
Eq,
PartialOrd,
Ord,
Debug,
Clone,
Copy)]
pub
struct
TaskId
(
u32
);
...
...
@@ -365,8 +358,6 @@ pub struct Task {
pub
prev
:
Option
<
Rc
<
RefCell
<
Task
>>>
,
/// Task Thread-Local-Storage (TLS)
pub
tls
:
Option
<
TaskTLS
>
,
/// Reason why wakeup() has been called the last time
pub
last_wakeup_reason
:
WakeupReason
,
/// lwIP error code for this task
#[cfg(feature
=
"newlib"
)]
pub
lwip_errno
:
i32
,
...
...
@@ -399,7 +390,6 @@ impl Task {
next
:
None
,
prev
:
None
,
tls
:
None
,
last_wakeup_reason
:
WakeupReason
::
Custom
,
#[cfg(feature
=
"newlib"
)]
lwip_errno
:
0
,
}
...
...
@@ -420,7 +410,6 @@ impl Task {
next
:
None
,
prev
:
None
,
tls
:
None
,
last_wakeup_reason
:
WakeupReason
::
Custom
,
#[cfg(feature
=
"newlib"
)]
lwip_errno
:
0
,
}
...
...
@@ -445,7 +434,6 @@ impl Task {
next
:
None
,
prev
:
None
,
tls
:
None
,
last_wakeup_reason
:
task
.last_wakeup_reason
,
#[cfg(feature
=
"newlib"
)]
lwip_errno
:
0
,
}
...
...
@@ -480,7 +468,7 @@ impl BlockedTaskQueue {
}
}
fn
wakeup_task
(
task
:
Rc
<
RefCell
<
Task
>>
,
reason
:
WakeupReason
)
{
fn
wakeup_task
(
task
:
Rc
<
RefCell
<
Task
>>
)
{
{
let
mut
borrowed
=
task
.borrow_mut
();
debug!
(
...
...
@@ -502,7 +490,6 @@ impl BlockedTaskQueue {
borrowed
.id
);
borrowed
.status
=
TaskStatus
::
Ready
;
borrowed
.last_wakeup_reason
=
reason
;
}
// Add the task to the ready queue.
...
...
@@ -563,7 +550,7 @@ impl BlockedTaskQueue {
while
let
Some
(
node
)
=
cursor
.current
()
{
if
node
.task
.borrow
()
.id
==
task
.get_id
()
{
// Remove it from the list of blocked tasks and wake it up.
Self
::
wakeup_task
(
node
.task
.clone
()
,
WakeupReason
::
Custom
);
Self
::
wakeup_task
(
node
.task
.clone
());
cursor
.remove_current
();
// If this is the first task, adjust the One-Shot Timer to fire at the
...
...
@@ -607,7 +594,7 @@ impl BlockedTaskQueue {
}
// Otherwise, this task has elapsed, so remove it from the list and wake it up.
Self
::
wakeup_task
(
node
.task
.clone
()
,
WakeupReason
::
Timer
);
Self
::
wakeup_task
(
node
.task
.clone
());
cursor
.remove_current
();
}
}
...
...
This diff is collapsed.
Click to expand it.
src/synch/semaphore.rs
+
1
−
3
View file @
48080256
use
crate
::
arch
::
percore
::
*
;
use
crate
::
scheduler
::
task
::
{
TaskHandlePriorityQueue
,
WakeupReason
}
;
use
crate
::
scheduler
::
task
::
TaskHandlePriorityQueue
;
use
crate
::
synch
::
spinlock
::
SpinlockIrqSave
;
use
crossbeam_utils
::
Backoff
;
...
...
@@ -68,9 +68,7 @@ impl Semaphore {
/// least 1.
pub
fn
acquire
(
&
self
,
time
:
Option
<
u64
>
)
->
bool
{
let
backoff
=
Backoff
::
new
();
// Reset last_wakeup_reason.
let
core_scheduler
=
core_scheduler
();
core_scheduler
.set_current_task_wakeup_reason
(
WakeupReason
::
Custom
);
let
wakeup_time
=
time
.map
(|
ms
|
crate
::
arch
::
processor
::
get_timer_ticks
()
+
ms
*
1000
);
...
...
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