mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:48:11 +00:00
Kernel: Move PC speaker beep timing logic from scheduler to the syscall
I don't know why I put this in the scheduler to begin with.. the caller can just block until the beeping is finished.
This commit is contained in:
parent
154d10e4e9
commit
95034fdfbd
2 changed files with 6 additions and 14 deletions
|
@ -1,6 +1,5 @@
|
|||
#include <AK/TemporaryChange.h>
|
||||
#include <Kernel/Arch/i386/PIT.h>
|
||||
#include <Kernel/Devices/PCSpeaker.h>
|
||||
#include <Kernel/FileSystem/FileDescription.h>
|
||||
#include <Kernel/Process.h>
|
||||
#include <Kernel/Profiling.h>
|
||||
|
@ -51,7 +50,6 @@ Thread* g_colonel;
|
|||
WaitQueue* g_finalizer_wait_queue;
|
||||
static Process* s_colonel_process;
|
||||
u64 g_uptime;
|
||||
static u64 s_beep_timeout;
|
||||
|
||||
struct TaskRedirectionData {
|
||||
u16 selector;
|
||||
|
@ -65,12 +63,6 @@ bool Scheduler::is_active()
|
|||
return s_active;
|
||||
}
|
||||
|
||||
void Scheduler::beep()
|
||||
{
|
||||
PCSpeaker::tone_on(440);
|
||||
s_beep_timeout = g_uptime + 100;
|
||||
}
|
||||
|
||||
Thread::JoinBlocker::JoinBlocker(Thread& joinee, void*& joinee_exit_value)
|
||||
: m_joinee(joinee)
|
||||
, m_joinee_exit_value(joinee_exit_value)
|
||||
|
@ -554,11 +546,6 @@ void Scheduler::timer_tick(RegisterDump& regs)
|
|||
tv.tv_usec = PIT::ticks_this_second() * 1000;
|
||||
Process::update_info_page_timestamp(tv);
|
||||
|
||||
if (s_beep_timeout && g_uptime > s_beep_timeout) {
|
||||
PCSpeaker::tone_off();
|
||||
s_beep_timeout = 0;
|
||||
}
|
||||
|
||||
if (current->process().is_profiling()) {
|
||||
auto backtrace = current->raw_backtrace(regs.ebp);
|
||||
auto& sample = Profiling::next_sample_slot();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue