mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:28:11 +00:00
Kernel+SystemServer: Defer creation of device nodes to userspace
Don't create these device nodes in the Kernel, so we essentially enforce userspace (SystemServer) to take control of this operation and to decide how to create these device nodes. This makes the DevFS to resemble linux devtmpfs, and allows us to remove a bunch of unneeded overriding implementations of device name creation in the Kernel.
This commit is contained in:
parent
fcc046047f
commit
e0d712c6f7
7 changed files with 144 additions and 45 deletions
|
@ -19,6 +19,8 @@ constexpr u32 encoded_device(unsigned major, unsigned minor)
|
|||
{
|
||||
return (minor & 0xff) | (major << 8) | ((minor & ~0xff) << 12);
|
||||
}
|
||||
static inline unsigned int major_from_encoded_device(dev_t dev) { return (dev & 0xfff00u) >> 8u; }
|
||||
static inline unsigned int minor_from_encoded_device(dev_t dev) { return (dev & 0xffu) | ((dev >> 12u) & 0xfff00u); }
|
||||
|
||||
inline bool is_directory(mode_t mode) { return (mode & S_IFMT) == S_IFDIR; }
|
||||
inline bool is_character_device(mode_t mode) { return (mode & S_IFMT) == S_IFCHR; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue