1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:08:12 +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:
Andreas Kling 2019-12-26 22:31:26 +01:00
parent 154d10e4e9
commit 95034fdfbd
2 changed files with 6 additions and 14 deletions

View file

@ -8,6 +8,7 @@
#include <Kernel/Console.h>
#include <Kernel/Devices/KeyboardDevice.h>
#include <Kernel/Devices/NullDevice.h>
#include <Kernel/Devices/PCSpeaker.h>
#include <Kernel/Devices/RandomDevice.h>
#include <Kernel/FileSystem/Custody.h>
#include <Kernel/FileSystem/DevPtsFS.h>
@ -3623,7 +3624,11 @@ int Process::sys$yield()
int Process::sys$beep()
{
Scheduler::beep();
PCSpeaker::tone_on(440);
u64 wakeup_time = current->sleep(100);
PCSpeaker::tone_off();
if (wakeup_time > g_uptime)
return -EINTR;
return 0;
}