1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:37:36 +00:00

Kernel: Move all code into the Kernel namespace

This commit is contained in:
Andreas Kling 2020-02-16 01:27:42 +01:00
parent d42f0f4661
commit a356e48150
201 changed files with 907 additions and 111 deletions

View file

@ -34,6 +34,8 @@
//#define MASTERPTY_DEBUG
namespace Kernel {
MasterPTY::MasterPTY(unsigned index)
: CharacterDevice(200, index)
, m_slave(adopt(*new SlavePTY(*this, index)))
@ -136,3 +138,5 @@ String MasterPTY::absolute_path(const FileDescription&) const
{
return String::format("ptm:%s", m_pts_name.characters());
}
}

View file

@ -30,6 +30,8 @@
#include <Kernel/Devices/CharacterDevice.h>
#include <Kernel/DoubleBuffer.h>
namespace Kernel {
class SlavePTY;
class MasterPTY final : public CharacterDevice {
@ -63,3 +65,5 @@ private:
DoubleBuffer m_buffer;
String m_pts_name;
};
}

View file

@ -32,6 +32,8 @@
//#define PTMX_DEBUG
namespace Kernel {
static const unsigned s_max_pty_pairs = 8;
static PTYMultiplexer* s_the;
@ -78,3 +80,5 @@ void PTYMultiplexer::notify_master_destroyed(Badge<MasterPTY>, unsigned index)
dbgprintf("PTYMultiplexer: %u added to freelist\n", index);
#endif
}
}

View file

@ -30,6 +30,8 @@
#include <Kernel/Devices/CharacterDevice.h>
#include <Kernel/Lock.h>
namespace Kernel {
class MasterPTY;
class PTYMultiplexer final : public CharacterDevice {
@ -56,3 +58,5 @@ private:
Lock m_lock { "PTYMultiplexer" };
Vector<unsigned> m_freelist;
};
}

View file

@ -31,6 +31,8 @@
//#define SLAVEPTY_DEBUG
namespace Kernel {
SlavePTY::SlavePTY(MasterPTY& master, unsigned index)
: TTY(201, index)
, m_master(master)
@ -97,3 +99,5 @@ void SlavePTY::close()
{
m_master->notify_slave_closed({});
}
}

View file

@ -29,6 +29,8 @@
#include <Kernel/FileSystem/InodeIdentifier.h>
#include <Kernel/TTY/TTY.h>
namespace Kernel {
class MasterPTY;
class SlavePTY final : public TTY {
@ -58,3 +60,5 @@ private:
unsigned m_index;
char m_tty_name[32];
};
}

View file

@ -32,6 +32,8 @@
//#define TTY_DEBUG
namespace Kernel {
TTY::TTY(unsigned major, unsigned minor)
: CharacterDevice(major, minor)
{
@ -345,3 +347,5 @@ void TTY::hang_up()
{
generate_signal(SIGHUP);
}
}

View file

@ -31,6 +31,8 @@
#include <Kernel/DoubleBuffer.h>
#include <Kernel/UnixTypes.h>
namespace Kernel {
class Process;
class TTY : public CharacterDevice {
@ -95,3 +97,5 @@ private:
unsigned short m_rows { 0 };
unsigned short m_columns { 0 };
};
}

View file

@ -32,6 +32,8 @@
#include <LibBareMetal/IO.h>
#include <LibBareMetal/StdLib.h>
namespace Kernel {
static u8* s_vga_buffer;
static VirtualConsole* s_consoles[6];
static int s_active_console;
@ -588,3 +590,5 @@ void VirtualConsole::set_vga_start_row(u16 row)
IO::out8(0x3d4, 0x0d);
IO::out8(0x3d5, LSB(m_current_vga_start_address));
}
}

View file

@ -30,6 +30,8 @@
#include <Kernel/TTY/TTY.h>
#include <LibBareMetal/Output/Console.h>
namespace Kernel {
class VirtualConsole final : public TTY
, public KeyboardClient
, public ConsoleImplementation {
@ -116,3 +118,5 @@ private:
u8* m_horizontal_tabs { nullptr };
char m_tty_name[32];
};
}