mirror of
https://github.com/RGBCube/serenity
synced 2025-05-22 18:55:07 +00:00
Kernel: Give PTY's *actually* unique major ID's
Okay, one "dunce hat" point for me. The new PTY majors conflicted with PATAChannel. Now they are 200 for master and 201 for slave, not used by anything else.. I hope!
This commit is contained in:
parent
be459acaea
commit
e9dda8d592
4 changed files with 7 additions and 3 deletions
|
@ -30,6 +30,10 @@ Device::Device(unsigned major, unsigned minor)
|
||||||
, m_minor(minor)
|
, m_minor(minor)
|
||||||
{
|
{
|
||||||
u32 device_id = encoded_device(major, minor);
|
u32 device_id = encoded_device(major, minor);
|
||||||
|
auto it = all_devices().find(device_id);
|
||||||
|
if (it != all_devices().end()) {
|
||||||
|
dbg() << "Already registered " << major << "," << minor << ": " << it->value->class_name();
|
||||||
|
}
|
||||||
ASSERT(!all_devices().contains(device_id));
|
ASSERT(!all_devices().contains(device_id));
|
||||||
all_devices().set(device_id, this);
|
all_devices().set(device_id, this);
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,7 +69,7 @@ RefPtr<Inode> DevPtsFS::get_inode(InodeIdentifier inode_id) const
|
||||||
return m_root_inode;
|
return m_root_inode;
|
||||||
|
|
||||||
unsigned pty_index = inode_index_to_pty_index(inode_id.index());
|
unsigned pty_index = inode_index_to_pty_index(inode_id.index());
|
||||||
auto* device = Device::get_device(11, pty_index);
|
auto* device = Device::get_device(201, pty_index);
|
||||||
ASSERT(device);
|
ASSERT(device);
|
||||||
|
|
||||||
auto inode = adopt(*new DevPtsFSInode(const_cast<DevPtsFS&>(*this), inode_id.index()));
|
auto inode = adopt(*new DevPtsFSInode(const_cast<DevPtsFS&>(*this), inode_id.index()));
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
//#define MASTERPTY_DEBUG
|
//#define MASTERPTY_DEBUG
|
||||||
|
|
||||||
MasterPTY::MasterPTY(unsigned index)
|
MasterPTY::MasterPTY(unsigned index)
|
||||||
: CharacterDevice(100, index)
|
: CharacterDevice(200, index)
|
||||||
, m_slave(adopt(*new SlavePTY(*this, index)))
|
, m_slave(adopt(*new SlavePTY(*this, index)))
|
||||||
, m_index(index)
|
, m_index(index)
|
||||||
{
|
{
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
//#define SLAVEPTY_DEBUG
|
//#define SLAVEPTY_DEBUG
|
||||||
|
|
||||||
SlavePTY::SlavePTY(MasterPTY& master, unsigned index)
|
SlavePTY::SlavePTY(MasterPTY& master, unsigned index)
|
||||||
: TTY(101, index)
|
: TTY(201, index)
|
||||||
, m_master(master)
|
, m_master(master)
|
||||||
, m_index(index)
|
, m_index(index)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue