mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:18:11 +00:00
Kernel: Move PCSpeaker code to the x86-specific architecture directory
The PCSpeaker code is specific to x86 platforms, thus it makes sense to put in the Arch/x86 subdirectory.
This commit is contained in:
parent
1596ee241f
commit
fdef8d0d37
5 changed files with 14 additions and 4 deletions
|
@ -5,7 +5,9 @@
|
|||
*/
|
||||
|
||||
#include <Kernel/CommandLine.h>
|
||||
#include <Kernel/Devices/PCSpeaker.h>
|
||||
#if ARCH(I386) || ARCH(X86_64)
|
||||
# include <Kernel/Arch/x86/common/PCSpeaker.h>
|
||||
#endif
|
||||
#include <Kernel/Process.h>
|
||||
|
||||
namespace Kernel {
|
||||
|
@ -15,12 +17,16 @@ ErrorOr<FlatPtr> Process::sys$beep()
|
|||
VERIFY_NO_PROCESS_BIG_LOCK(this);
|
||||
if (!kernel_command_line().is_pc_speaker_enabled())
|
||||
return ENODEV;
|
||||
#if ARCH(I386) || ARCH(X86_64)
|
||||
PCSpeaker::tone_on(440);
|
||||
auto result = Thread::current()->sleep(Time::from_nanoseconds(200'000'000));
|
||||
PCSpeaker::tone_off();
|
||||
if (result.was_interrupted())
|
||||
return EINTR;
|
||||
return 0;
|
||||
#else
|
||||
return ENOTIMPL;
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue