mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-29 06:02:07 +03: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
Notes:
sideshowbarker
2024-07-17 17:38:29 +09:00
Author: https://github.com/supercomputer7 Commit: https://github.com/SerenityOS/serenity/commit/fdef8d0d37 Pull-request: https://github.com/SerenityOS/serenity/pull/15173 Reviewed-by: https://github.com/linusg
@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
#include <Kernel/Arch/x86/IO.h>
|
||||
#include <Kernel/Devices/PCSpeaker.h>
|
||||
#include <Kernel/Arch/x86/common/PCSpeaker.h>
|
||||
#include <Kernel/Time/PIT.h>
|
||||
|
||||
void PCSpeaker::tone_on(int frequency)
|
@ -59,7 +59,6 @@ set(KERNEL_SOURCES
|
||||
Devices/MemoryDevice.cpp
|
||||
Devices/NullDevice.cpp
|
||||
Devices/PCISerialDevice.cpp
|
||||
Devices/PCSpeaker.cpp
|
||||
Devices/RandomDevice.cpp
|
||||
Devices/SelfTTYDevice.cpp
|
||||
Devices/SerialDevice.cpp
|
||||
@ -335,6 +334,7 @@ if ("${SERENITY_ARCH}" STREQUAL "i686" OR "${SERENITY_ARCH}" STREQUAL "x86_64")
|
||||
Arch/x86/common/DebugOutput.cpp
|
||||
Arch/x86/common/Delay.cpp
|
||||
Arch/x86/common/I8042Reboot.cpp
|
||||
Arch/x86/common/PCSpeaker.cpp
|
||||
Arch/x86/common/RTC.cpp
|
||||
Arch/x86/common/ScopedCritical.cpp
|
||||
Arch/x86/common/SmapDisabler.cpp
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -8,11 +8,13 @@
|
||||
|
||||
#include <AK/StdLibExtras.h>
|
||||
#include <Kernel/Arch/Delay.h>
|
||||
#if ARCH(I386) || ARCH(X86_64)
|
||||
# include <Kernel/Arch/x86/common/PCSpeaker.h>
|
||||
#endif
|
||||
#include <Kernel/CommandLine.h>
|
||||
#include <Kernel/Debug.h>
|
||||
#include <Kernel/Devices/DeviceManagement.h>
|
||||
#include <Kernel/Devices/HID/HIDManagement.h>
|
||||
#include <Kernel/Devices/PCSpeaker.h>
|
||||
#include <Kernel/Graphics/GraphicsManagement.h>
|
||||
#include <Kernel/Heap/kmalloc.h>
|
||||
#include <Kernel/Sections.h>
|
||||
@ -327,9 +329,11 @@ void VirtualConsole::beep()
|
||||
{
|
||||
if (!kernel_command_line().is_pc_speaker_enabled())
|
||||
return;
|
||||
#if ARCH(I386) || ARCH(X86_64)
|
||||
PCSpeaker::tone_on(440);
|
||||
microseconds_delay(10000);
|
||||
PCSpeaker::tone_off();
|
||||
#endif
|
||||
}
|
||||
|
||||
void VirtualConsole::set_window_title(StringView)
|
||||
|
Loading…
Reference in New Issue
Block a user