mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:48:11 +00:00
Kernel/Devices: Remove required_mode and device_name methods
These methods are no longer needed because SystemServer is able to populate the DevFS on its own. Device absolute_path no longer assume a path to the /dev location, because it really should not assume any path to a Device node. Because StorageManagement still needs to know the storage name, we declare a virtual method only for StorageDevices to override, but this technique should really be removed later on.
This commit is contained in:
parent
4f04cb98c1
commit
21b6d84ff0
38 changed files with 18 additions and 141 deletions
|
@ -158,11 +158,6 @@ KResultOr<size_t> ConsolePort::write(OpenFileDescription& desc, u64, const UserO
|
||||||
return total_bytes_copied;
|
return total_bytes_copied;
|
||||||
}
|
}
|
||||||
|
|
||||||
String ConsolePort::device_name() const
|
|
||||||
{
|
|
||||||
return String::formatted("hvc{}p{}", m_console.device_id(), m_port);
|
|
||||||
}
|
|
||||||
|
|
||||||
KResultOr<NonnullRefPtr<OpenFileDescription>> ConsolePort::open(int options)
|
KResultOr<NonnullRefPtr<OpenFileDescription>> ConsolePort::open(int options)
|
||||||
{
|
{
|
||||||
if (!m_open)
|
if (!m_open)
|
||||||
|
|
|
@ -40,10 +40,6 @@ private:
|
||||||
virtual KResultOr<size_t> write(OpenFileDescription&, u64, const UserOrKernelBuffer&, size_t) override;
|
virtual KResultOr<size_t> write(OpenFileDescription&, u64, const UserOrKernelBuffer&, size_t) override;
|
||||||
virtual KResultOr<NonnullRefPtr<OpenFileDescription>> open(int options) override;
|
virtual KResultOr<NonnullRefPtr<OpenFileDescription>> open(int options) override;
|
||||||
|
|
||||||
mode_t required_mode() const override { return 0666; }
|
|
||||||
|
|
||||||
String device_name() const override;
|
|
||||||
|
|
||||||
void init_receive_buffer();
|
void init_receive_buffer();
|
||||||
|
|
||||||
static unsigned next_device_id;
|
static unsigned next_device_id;
|
||||||
|
|
|
@ -33,10 +33,6 @@ public:
|
||||||
|
|
||||||
const CircularQueue<char, 16384>& logbuffer() const { return m_logbuffer; }
|
const CircularQueue<char, 16384>& logbuffer() const { return m_logbuffer; }
|
||||||
|
|
||||||
// ^Device
|
|
||||||
virtual mode_t required_mode() const override { return 0666; }
|
|
||||||
virtual String device_name() const override { return "console"; }
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CircularQueue<char, 16384> m_logbuffer;
|
CircularQueue<char, 16384> m_logbuffer;
|
||||||
};
|
};
|
||||||
|
|
|
@ -51,8 +51,11 @@ Device::~Device()
|
||||||
|
|
||||||
String Device::absolute_path() const
|
String Device::absolute_path() const
|
||||||
{
|
{
|
||||||
// FIXME: Don't assume mount point for DevFs
|
// FIXME: I assume we can't really provide a well known path in the kernel
|
||||||
return String::formatted("/dev/{}", device_name());
|
// because this is a violation of abstraction layers between userland and the
|
||||||
|
// kernel, but maybe the whole name of "absolute_path" is just wrong as this
|
||||||
|
// is really not an "absolute_path".
|
||||||
|
return String::formatted("device:{},{}", major(), minor());
|
||||||
}
|
}
|
||||||
|
|
||||||
String Device::absolute_path(const OpenFileDescription&) const
|
String Device::absolute_path(const OpenFileDescription&) const
|
||||||
|
|
|
@ -37,9 +37,6 @@ public:
|
||||||
UserID uid() const { return m_uid; }
|
UserID uid() const { return m_uid; }
|
||||||
GroupID gid() const { return m_gid; }
|
GroupID gid() const { return m_gid; }
|
||||||
|
|
||||||
virtual mode_t required_mode() const = 0;
|
|
||||||
virtual String device_name() const = 0;
|
|
||||||
|
|
||||||
virtual bool is_device() const override { return true; }
|
virtual bool is_device() const override { return true; }
|
||||||
|
|
||||||
static void for_each(Function<void(Device&)>);
|
static void for_each(Function<void(Device&)>);
|
||||||
|
|
|
@ -16,10 +16,6 @@ public:
|
||||||
static NonnullRefPtr<FullDevice> must_create();
|
static NonnullRefPtr<FullDevice> must_create();
|
||||||
virtual ~FullDevice() override;
|
virtual ~FullDevice() override;
|
||||||
|
|
||||||
// ^Device
|
|
||||||
virtual mode_t required_mode() const override { return 0666; }
|
|
||||||
virtual String device_name() const override { return "full"; }
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
FullDevice();
|
FullDevice();
|
||||||
|
|
||||||
|
|
|
@ -33,14 +33,9 @@ public:
|
||||||
// ^HIDDevice
|
// ^HIDDevice
|
||||||
virtual Type instrument_type() const override { return Type::Keyboard; }
|
virtual Type instrument_type() const override { return Type::Keyboard; }
|
||||||
|
|
||||||
// ^Device
|
|
||||||
virtual mode_t required_mode() const override { return 0440; }
|
|
||||||
|
|
||||||
// ^File
|
// ^File
|
||||||
virtual KResult ioctl(OpenFileDescription&, unsigned request, Userspace<void*> arg) override;
|
virtual KResult ioctl(OpenFileDescription&, unsigned request, Userspace<void*> arg) override;
|
||||||
|
|
||||||
virtual String device_name() const override { return String::formatted("keyboard{}", minor()); }
|
|
||||||
|
|
||||||
void update_modifier(u8 modifier, bool state)
|
void update_modifier(u8 modifier, bool state)
|
||||||
{
|
{
|
||||||
if (state)
|
if (state)
|
||||||
|
|
|
@ -31,11 +31,6 @@ public:
|
||||||
// ^HIDDevice
|
// ^HIDDevice
|
||||||
virtual Type instrument_type() const override { return Type::Mouse; }
|
virtual Type instrument_type() const override { return Type::Mouse; }
|
||||||
|
|
||||||
// ^Device
|
|
||||||
virtual mode_t required_mode() const override { return 0440; }
|
|
||||||
|
|
||||||
virtual String device_name() const override { return String::formatted("mouse{}", minor()); }
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
MouseDevice();
|
MouseDevice();
|
||||||
// ^CharacterDevice
|
// ^CharacterDevice
|
||||||
|
|
|
@ -141,9 +141,4 @@ KResultOr<Memory::Region*> KCOVDevice::mmap(Process& process, OpenFileDescriptio
|
||||||
range, *kcov_instance->vmobject(), offset, {}, prot, shared);
|
range, *kcov_instance->vmobject(), offset, {}, prot, shared);
|
||||||
}
|
}
|
||||||
|
|
||||||
String KCOVDevice::device_name() const
|
|
||||||
{
|
|
||||||
return "kcov"sv;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,10 +25,6 @@ public:
|
||||||
KResultOr<Memory::Region*> mmap(Process&, OpenFileDescription&, Memory::VirtualRange const&, u64 offset, int prot, bool shared) override;
|
KResultOr<Memory::Region*> mmap(Process&, OpenFileDescription&, Memory::VirtualRange const&, u64 offset, int prot, bool shared) override;
|
||||||
KResultOr<NonnullRefPtr<OpenFileDescription>> open(int options) override;
|
KResultOr<NonnullRefPtr<OpenFileDescription>> open(int options) override;
|
||||||
|
|
||||||
// ^Device
|
|
||||||
virtual mode_t required_mode() const override { return 0660; }
|
|
||||||
virtual String device_name() const override;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual StringView class_name() const override { return "KCOVDevice"; }
|
virtual StringView class_name() const override { return "KCOVDevice"; }
|
||||||
|
|
||||||
|
|
|
@ -21,10 +21,6 @@ public:
|
||||||
|
|
||||||
virtual KResultOr<Memory::Region*> mmap(Process&, OpenFileDescription&, Memory::VirtualRange const&, u64 offset, int prot, bool shared) override;
|
virtual KResultOr<Memory::Region*> mmap(Process&, OpenFileDescription&, Memory::VirtualRange const&, u64 offset, int prot, bool shared) override;
|
||||||
|
|
||||||
// ^Device
|
|
||||||
virtual mode_t required_mode() const override { return 0660; }
|
|
||||||
virtual String device_name() const override { return "mem"; };
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
MemoryDevice();
|
MemoryDevice();
|
||||||
virtual StringView class_name() const override { return "MemoryDevice"; }
|
virtual StringView class_name() const override { return "MemoryDevice"; }
|
||||||
|
|
|
@ -19,10 +19,6 @@ public:
|
||||||
static void initialize();
|
static void initialize();
|
||||||
static NullDevice& the();
|
static NullDevice& the();
|
||||||
|
|
||||||
// ^Device
|
|
||||||
virtual mode_t required_mode() const override { return 0666; }
|
|
||||||
virtual String device_name() const override { return "null"; }
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// ^CharacterDevice
|
// ^CharacterDevice
|
||||||
virtual KResultOr<size_t> read(OpenFileDescription&, u64, UserOrKernelBuffer&, size_t) override;
|
virtual KResultOr<size_t> read(OpenFileDescription&, u64, UserOrKernelBuffer&, size_t) override;
|
||||||
|
|
|
@ -16,10 +16,6 @@ public:
|
||||||
static NonnullRefPtr<RandomDevice> must_create();
|
static NonnullRefPtr<RandomDevice> must_create();
|
||||||
virtual ~RandomDevice() override;
|
virtual ~RandomDevice() override;
|
||||||
|
|
||||||
// ^Device
|
|
||||||
virtual mode_t required_mode() const override { return 0666; }
|
|
||||||
virtual String device_name() const override { return "random"; }
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
RandomDevice();
|
RandomDevice();
|
||||||
|
|
||||||
|
|
|
@ -34,10 +34,6 @@ public:
|
||||||
|
|
||||||
virtual StringView purpose() const override { return class_name(); }
|
virtual StringView purpose() const override { return class_name(); }
|
||||||
|
|
||||||
// ^Device
|
|
||||||
virtual mode_t required_mode() const override { return 0220; }
|
|
||||||
virtual String device_name() const override { return "audio"; }
|
|
||||||
|
|
||||||
virtual KResult ioctl(OpenFileDescription&, unsigned, Userspace<void*>) override;
|
virtual KResult ioctl(OpenFileDescription&, unsigned, Userspace<void*>) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -104,11 +104,6 @@ void SerialDevice::put_char(char ch)
|
||||||
m_last_put_char_was_carriage_return = (ch == '\r');
|
m_last_put_char_was_carriage_return = (ch == '\r');
|
||||||
}
|
}
|
||||||
|
|
||||||
String SerialDevice::device_name() const
|
|
||||||
{
|
|
||||||
return String::formatted("ttyS{}", minor() - 64);
|
|
||||||
}
|
|
||||||
|
|
||||||
UNMAP_AFTER_INIT void SerialDevice::initialize()
|
UNMAP_AFTER_INIT void SerialDevice::initialize()
|
||||||
{
|
{
|
||||||
set_interrupts(false);
|
set_interrupts(false);
|
||||||
|
|
|
@ -102,10 +102,6 @@ public:
|
||||||
DataReady = 0x01 << 0
|
DataReady = 0x01 << 0
|
||||||
};
|
};
|
||||||
|
|
||||||
// ^Device
|
|
||||||
virtual mode_t required_mode() const override { return 0620; }
|
|
||||||
virtual String device_name() const override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class PCISerialDevice;
|
friend class PCISerialDevice;
|
||||||
|
|
||||||
|
|
|
@ -16,10 +16,6 @@ public:
|
||||||
static NonnullRefPtr<ZeroDevice> must_create();
|
static NonnullRefPtr<ZeroDevice> must_create();
|
||||||
virtual ~ZeroDevice() override;
|
virtual ~ZeroDevice() override;
|
||||||
|
|
||||||
// ^Device
|
|
||||||
virtual mode_t required_mode() const override { return 0666; }
|
|
||||||
virtual String device_name() const override { return "zero"; }
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ZeroDevice();
|
ZeroDevice();
|
||||||
// ^CharacterDevice
|
// ^CharacterDevice
|
||||||
|
|
|
@ -84,11 +84,6 @@ void FramebufferDevice::activate_writes()
|
||||||
m_graphical_writes_enabled = true;
|
m_graphical_writes_enabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
String FramebufferDevice::device_name() const
|
|
||||||
{
|
|
||||||
return String::formatted("fb{}", minor());
|
|
||||||
}
|
|
||||||
|
|
||||||
UNMAP_AFTER_INIT KResult FramebufferDevice::initialize()
|
UNMAP_AFTER_INIT KResult FramebufferDevice::initialize()
|
||||||
{
|
{
|
||||||
// FIXME: Would be nice to be able to unify this with mmap above, but this
|
// FIXME: Would be nice to be able to unify this with mmap above, but this
|
||||||
|
|
|
@ -25,10 +25,6 @@ public:
|
||||||
virtual KResult ioctl(OpenFileDescription&, unsigned request, Userspace<void*> arg) override;
|
virtual KResult ioctl(OpenFileDescription&, unsigned request, Userspace<void*> arg) override;
|
||||||
virtual KResultOr<Memory::Region*> mmap(Process&, OpenFileDescription&, Memory::VirtualRange const&, u64 offset, int prot, bool shared) override;
|
virtual KResultOr<Memory::Region*> mmap(Process&, OpenFileDescription&, Memory::VirtualRange const&, u64 offset, int prot, bool shared) override;
|
||||||
|
|
||||||
// ^Device
|
|
||||||
virtual mode_t required_mode() const override { return 0660; }
|
|
||||||
virtual String device_name() const override;
|
|
||||||
|
|
||||||
virtual void deactivate_writes();
|
virtual void deactivate_writes();
|
||||||
virtual void activate_writes();
|
virtual void activate_writes();
|
||||||
size_t framebuffer_size_in_bytes() const;
|
size_t framebuffer_size_in_bytes() const;
|
||||||
|
|
|
@ -68,9 +68,6 @@ private:
|
||||||
virtual KResultOr<size_t> write(OpenFileDescription&, u64, const UserOrKernelBuffer&, size_t) override { return EINVAL; };
|
virtual KResultOr<size_t> write(OpenFileDescription&, u64, const UserOrKernelBuffer&, size_t) override { return EINVAL; };
|
||||||
virtual void start_request(AsyncBlockDeviceRequest& request) override { request.complete(AsyncDeviceRequest::Failure); }
|
virtual void start_request(AsyncBlockDeviceRequest& request) override { request.complete(AsyncDeviceRequest::Failure); }
|
||||||
|
|
||||||
virtual mode_t required_mode() const override { return 0666; }
|
|
||||||
virtual String device_name() const override { return String::formatted("fb{}", minor()); }
|
|
||||||
|
|
||||||
static bool is_valid_buffer_index(int buffer_index)
|
static bool is_valid_buffer_index(int buffer_index)
|
||||||
{
|
{
|
||||||
return buffer_index == 0 || buffer_index == 1;
|
return buffer_index == 0 || buffer_index == 1;
|
||||||
|
|
|
@ -41,7 +41,7 @@ void PATADiskDevice::start_request(AsyncBlockDeviceRequest& request)
|
||||||
m_channel->start_request(request, is_slave(), m_capabilities);
|
m_channel->start_request(request, is_slave(), m_capabilities);
|
||||||
}
|
}
|
||||||
|
|
||||||
String PATADiskDevice::device_name() const
|
String PATADiskDevice::storage_name() const
|
||||||
{
|
{
|
||||||
return String::formatted("hd{:c}", 'a' + minor());
|
return String::formatted("hd{:c}", 'a' + minor());
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@ public:
|
||||||
|
|
||||||
// ^BlockDevice
|
// ^BlockDevice
|
||||||
virtual void start_request(AsyncBlockDeviceRequest&) override;
|
virtual void start_request(AsyncBlockDeviceRequest&) override;
|
||||||
virtual String device_name() const override;
|
virtual String storage_name() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
PATADiskDevice(const IDEController&, IDEChannel&, DriveType, InterfaceType, u16, u64);
|
PATADiskDevice(const IDEController&, IDEChannel&, DriveType, InterfaceType, u16, u64);
|
||||||
|
|
|
@ -68,13 +68,6 @@ bool DiskPartition::can_write(const OpenFileDescription& fd, size_t offset) cons
|
||||||
return m_device->can_write(fd, offset + adjust);
|
return m_device->can_write(fd, offset + adjust);
|
||||||
}
|
}
|
||||||
|
|
||||||
String DiskPartition::device_name() const
|
|
||||||
{
|
|
||||||
// FIXME: Try to not hardcode a maximum of 16 partitions per drive!
|
|
||||||
size_t partition_index = minor() % 16;
|
|
||||||
return String::formatted("{}{}", m_device->device_name(), partition_index + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
StringView DiskPartition::class_name() const
|
StringView DiskPartition::class_name() const
|
||||||
{
|
{
|
||||||
return "DiskPartition";
|
return "DiskPartition";
|
||||||
|
|
|
@ -25,10 +25,6 @@ public:
|
||||||
virtual KResultOr<size_t> write(OpenFileDescription&, u64, const UserOrKernelBuffer&, size_t) override;
|
virtual KResultOr<size_t> write(OpenFileDescription&, u64, const UserOrKernelBuffer&, size_t) override;
|
||||||
virtual bool can_write(const OpenFileDescription&, size_t) const override;
|
virtual bool can_write(const OpenFileDescription&, size_t) const override;
|
||||||
|
|
||||||
// ^Device
|
|
||||||
virtual mode_t required_mode() const override { return 0600; }
|
|
||||||
virtual String device_name() const override;
|
|
||||||
|
|
||||||
const DiskPartitionMetadata& metadata() const;
|
const DiskPartitionMetadata& metadata() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -55,7 +55,7 @@ void RamdiskDevice::start_request(AsyncBlockDeviceRequest& request)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String RamdiskDevice::device_name() const
|
String RamdiskDevice::storage_name() const
|
||||||
{
|
{
|
||||||
// FIXME: Try to not hardcode a maximum of 16 partitions per drive!
|
// FIXME: Try to not hardcode a maximum of 16 partitions per drive!
|
||||||
size_t drive_index = minor() / 16;
|
size_t drive_index = minor() / 16;
|
||||||
|
|
|
@ -26,7 +26,7 @@ public:
|
||||||
|
|
||||||
// ^DiskDevice
|
// ^DiskDevice
|
||||||
virtual StringView class_name() const override;
|
virtual StringView class_name() const override;
|
||||||
virtual String device_name() const override;
|
virtual String storage_name() const override;
|
||||||
|
|
||||||
bool is_slave() const;
|
bool is_slave() const;
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ void SATADiskDevice::start_request(AsyncBlockDeviceRequest& request)
|
||||||
m_port->start_request(request);
|
m_port->start_request(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
String SATADiskDevice::device_name() const
|
String SATADiskDevice::storage_name() const
|
||||||
{
|
{
|
||||||
return String::formatted("hd{:c}", 'a' + minor());
|
return String::formatted("hd{:c}", 'a' + minor());
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@ public:
|
||||||
// ^StorageDevice
|
// ^StorageDevice
|
||||||
// ^BlockDevice
|
// ^BlockDevice
|
||||||
virtual void start_request(AsyncBlockDeviceRequest&) override;
|
virtual void start_request(AsyncBlockDeviceRequest&) override;
|
||||||
virtual String device_name() const override;
|
virtual String storage_name() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SATADiskDevice(const AHCIController&, const AHCIPort&, size_t sector_size, u64 max_addressable_block);
|
SATADiskDevice(const AHCIController&, const AHCIPort&, size_t sector_size, u64 max_addressable_block);
|
||||||
|
|
|
@ -29,8 +29,8 @@ public:
|
||||||
virtual KResultOr<size_t> write(OpenFileDescription&, u64, const UserOrKernelBuffer&, size_t) override;
|
virtual KResultOr<size_t> write(OpenFileDescription&, u64, const UserOrKernelBuffer&, size_t) override;
|
||||||
virtual bool can_write(const OpenFileDescription&, size_t) const override;
|
virtual bool can_write(const OpenFileDescription&, size_t) const override;
|
||||||
|
|
||||||
// ^Device
|
// FIXME: This is being used only during early boot, find a better way to find devices...
|
||||||
virtual mode_t required_mode() const override { return 0600; }
|
virtual String storage_name() const = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
StorageDevice(const StorageController&, size_t, u64);
|
StorageDevice(const StorageController&, size_t, u64);
|
||||||
|
|
|
@ -126,15 +126,12 @@ UNMAP_AFTER_INIT void StorageManagement::determine_boot_device()
|
||||||
{
|
{
|
||||||
VERIFY(!m_controllers.is_empty());
|
VERIFY(!m_controllers.is_empty());
|
||||||
if (m_boot_argument.starts_with("/dev/")) {
|
if (m_boot_argument.starts_with("/dev/")) {
|
||||||
StringView device_name = m_boot_argument.substring_view(5);
|
StringView storage_name = m_boot_argument.substring_view(5);
|
||||||
Device::for_each([&](Device& device) {
|
for (auto& storage_device : m_storage_devices) {
|
||||||
if (device.is_block_device()) {
|
if (storage_device.storage_name() == storage_name) {
|
||||||
auto& block_device = static_cast<BlockDevice&>(device);
|
m_boot_block_device = storage_device;
|
||||||
if (device.device_name() == device_name) {
|
|
||||||
m_boot_block_device = block_device;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_boot_block_device.is_null()) {
|
if (m_boot_block_device.is_null()) {
|
||||||
|
|
|
@ -130,9 +130,4 @@ String MasterPTY::absolute_path(const OpenFileDescription&) const
|
||||||
return String::formatted("ptm:{}", m_pts_name);
|
return String::formatted("ptm:{}", m_pts_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
String MasterPTY::device_name() const
|
|
||||||
{
|
|
||||||
return String::formatted("{}", minor());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,10 +28,6 @@ public:
|
||||||
|
|
||||||
virtual String absolute_path(const OpenFileDescription&) const override;
|
virtual String absolute_path(const OpenFileDescription&) const override;
|
||||||
|
|
||||||
// ^Device
|
|
||||||
virtual mode_t required_mode() const override { return 0640; }
|
|
||||||
virtual String device_name() const override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
explicit MasterPTY(unsigned index, NonnullOwnPtr<DoubleBuffer> buffer);
|
explicit MasterPTY(unsigned index, NonnullOwnPtr<DoubleBuffer> buffer);
|
||||||
// ^CharacterDevice
|
// ^CharacterDevice
|
||||||
|
|
|
@ -35,10 +35,6 @@ public:
|
||||||
|
|
||||||
void notify_master_destroyed(Badge<MasterPTY>, unsigned index);
|
void notify_master_destroyed(Badge<MasterPTY>, unsigned index);
|
||||||
|
|
||||||
// ^Device
|
|
||||||
virtual mode_t required_mode() const override { return 0666; }
|
|
||||||
virtual String device_name() const override { return "ptmx"; }
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// ^CharacterDevice
|
// ^CharacterDevice
|
||||||
virtual StringView class_name() const override { return "PTYMultiplexer"; }
|
virtual StringView class_name() const override { return "PTYMultiplexer"; }
|
||||||
|
|
|
@ -107,11 +107,6 @@ KResult SlavePTY::close()
|
||||||
return KSuccess;
|
return KSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
String SlavePTY::device_name() const
|
|
||||||
{
|
|
||||||
return String::formatted("{}", minor());
|
|
||||||
}
|
|
||||||
|
|
||||||
FileBlockerSet& SlavePTY::blocker_set()
|
FileBlockerSet& SlavePTY::blocker_set()
|
||||||
{
|
{
|
||||||
return m_master->blocker_set();
|
return m_master->blocker_set();
|
||||||
|
|
|
@ -38,9 +38,6 @@ private:
|
||||||
virtual StringView class_name() const override { return "SlavePTY"; }
|
virtual StringView class_name() const override { return "SlavePTY"; }
|
||||||
virtual KResult close() override;
|
virtual KResult close() override;
|
||||||
|
|
||||||
// ^Device
|
|
||||||
virtual String device_name() const override;
|
|
||||||
|
|
||||||
friend class MasterPTY;
|
friend class MasterPTY;
|
||||||
SlavePTY(MasterPTY&, unsigned index);
|
SlavePTY(MasterPTY&, unsigned index);
|
||||||
|
|
||||||
|
|
|
@ -49,9 +49,6 @@ public:
|
||||||
void set_default_termios();
|
void set_default_termios();
|
||||||
void hang_up();
|
void hang_up();
|
||||||
|
|
||||||
// ^Device
|
|
||||||
virtual mode_t required_mode() const override { return 0620; }
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual KResultOr<size_t> on_tty_write(const UserOrKernelBuffer&, size_t) = 0;
|
virtual KResultOr<size_t> on_tty_write(const UserOrKernelBuffer&, size_t) = 0;
|
||||||
void set_size(unsigned short columns, unsigned short rows);
|
void set_size(unsigned short columns, unsigned short rows);
|
||||||
|
|
|
@ -359,11 +359,6 @@ void VirtualConsole::set_cursor_style(VT::CursorStyle)
|
||||||
// Do nothing
|
// Do nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
String VirtualConsole::device_name() const
|
|
||||||
{
|
|
||||||
return String::formatted("tty{}", minor());
|
|
||||||
}
|
|
||||||
|
|
||||||
void VirtualConsole::echo(u8 ch)
|
void VirtualConsole::echo(u8 ch)
|
||||||
{
|
{
|
||||||
m_console_impl.on_input(ch);
|
m_console_impl.on_input(ch);
|
||||||
|
|
|
@ -107,9 +107,6 @@ private:
|
||||||
// ^CharacterDevice
|
// ^CharacterDevice
|
||||||
virtual StringView class_name() const override { return "VirtualConsole"; }
|
virtual StringView class_name() const override { return "VirtualConsole"; }
|
||||||
|
|
||||||
// ^Device
|
|
||||||
virtual String device_name() const override;
|
|
||||||
|
|
||||||
void set_active(bool);
|
void set_active(bool);
|
||||||
void flush_dirty_lines();
|
void flush_dirty_lines();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue