-
Notifications
You must be signed in to change notification settings - Fork 20
Feat power button #351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: mainline
Are you sure you want to change the base?
Feat power button #351
Conversation
2aa4248 to
e98fd0c
Compare
155fb4d to
114c5ad
Compare
Driver for ACPI fixed power buttons. It allows overwriting the default handler so the button can be used for custom purposes. One such purpose might be to trigger an experiment to run. Signed-off-by: Sandro Rüegge <rueegges@ethz.ch>
114c5ad to
405cb93
Compare
|
I have removed the spinlock changes. I have added another commit that adds a |
Adding a self reference to the percpu allows checking what CPU some code is currently running on. We use this in pb_set_handler to ensure it runs on the bsp.
Signed-off-by: Sandro Rüegge <rueegges@ethz.ch>
405cb93 to
9b2fae1
Compare
|
|
||
| static void default_handler(void *); | ||
|
|
||
| spinlock_t pb_handler_lock = SPINLOCK_INIT; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pb_handler_lock isn't used any more, can remove its definition as well.
minipli-oss
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise LGTM!
| unsigned long usermode_private; | ||
| volatile unsigned long apic_ticks; | ||
| bool apic_timer_enabled; | ||
| struct cpu *cpu; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess, using the proper typedef'd type cpu_t would cause a cyclic header include dependency?
Add support for ACPI fixed power buttons. This is based on #350
I wanted to add the functionality to change the power button handler because it would be useful for triggering experiments for me. This opened up a race condition between the interrupt and the function changing the handler. The interrupt may not wait for a spinlock so I added a try_lock function but I am not very convinced by this approach.