Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
osv
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Verlässliche Systemsoftware
projects
osv
Commits
e415242a
Commit
e415242a
authored
12 years ago
by
Avi Kivity
Browse files
Options
Downloads
Patches
Plain Diff
apic clockevents: per-cpu setup
The apic needs to be programmed on each cpu that is brought up.
parent
3d8b87be
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
arch/x64/apic-clock.cc
+8
-3
8 additions, 3 deletions
arch/x64/apic-clock.cc
core/sched.cc
+1
-0
1 addition, 0 deletions
core/sched.cc
drivers/clockevent.hh
+1
-0
1 addition, 0 deletions
drivers/clockevent.hh
with
10 additions
and
3 deletions
arch/x64/apic-clock.cc
+
8
−
3
View file @
e415242a
...
...
@@ -9,6 +9,7 @@ class apic_clock_events : public clock_event_driver {
public:
explicit
apic_clock_events
();
~
apic_clock_events
();
virtual
void
setup_on_cpu
();
virtual
void
set
(
u64
time
);
private:
unsigned
_vector
;
...
...
@@ -17,15 +18,19 @@ private:
apic_clock_events
::
apic_clock_events
()
:
_vector
(
idt
.
register_handler
([
this
]
{
_callback
->
fired
();
}))
{
processor
::
apic
->
write
(
apicreg
::
TMDCR
,
0xb
);
// divide by 1
processor
::
apic
->
write
(
apicreg
::
TMICT
,
0
);
processor
::
apic
->
write
(
apicreg
::
LVTT
,
_vector
);
// one-shot
}
apic_clock_events
::~
apic_clock_events
()
{
}
void
apic_clock_events
::
setup_on_cpu
()
{
processor
::
apic
->
write
(
apicreg
::
TMDCR
,
0xb
);
// divide by 1
processor
::
apic
->
write
(
apicreg
::
TMICT
,
0
);
processor
::
apic
->
write
(
apicreg
::
LVTT
,
_vector
);
// one-shot
}
void
apic_clock_events
::
set
(
u64
time
)
{
u64
now
=
clock
::
get
()
->
time
();
...
...
This diff is collapsed.
Click to expand it.
core/sched.cc
+
1
−
0
View file @
e415242a
...
...
@@ -64,6 +64,7 @@ void cpu::handle_incoming_wakeups()
void
cpu
::
init_on_cpu
()
{
arch
.
init_on_cpu
();
clock_event
->
setup_on_cpu
();
}
void
schedule
(
bool
yield
)
...
...
This diff is collapsed.
Click to expand it.
drivers/clockevent.hh
+
1
−
0
View file @
e415242a
...
...
@@ -13,6 +13,7 @@ public:
class
clock_event_driver
{
public:
virtual
~
clock_event_driver
();
virtual
void
setup_on_cpu
()
=
0
;
// set() is cpu-local: each processor has its own timer
virtual
void
set
(
u64
time
)
=
0
;
void
set_callback
(
clock_event_callback
*
callback
);
...
...
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