* devices.h (lives_in_dev): New field.

(dev_on_fs): Set bit size.
(is_dev_resident): Define new method.
* devices.in: Use different method for labelling requested name for dev
storage: prefix it with a ='.  Use an actual ':' to denote an internal device.
(exists_console): Avoid repeated test.
(exists_ntdev_silent): Rename from the less-descriptive exists_ntdevs.
(dev_dev_storage): Delete unneeded define.
* gendevices: Add a flag to each line denoting whether the device lives in /dev
space.
(generate): Handle special ":" case here for internal devices.  Parse
=something_dev as requiring a storage location.  Tack the rest of the line back
onto the reformulated "$rest".
* devices.cc: Regenerate.
This commit is contained in:
Christopher Faylor
2012-04-02 20:41:46 +00:00
parent eb7729eb36
commit 17a61045ff
5 changed files with 3574 additions and 3496 deletions

View File

@ -275,7 +275,8 @@ struct device
const char *native;
int (*exists_func) (const device&);
_mode_t mode;
bool dev_on_fs;
bool lives_in_dev:4;
bool dev_on_fs:4;
static const device *lookup (const char *, unsigned int = UINT32_MAX);
void parse (const char *);
void parse (_major_t major, _minor_t minor);
@ -318,6 +319,7 @@ struct device
inline void setfs (bool x) {dev_on_fs = x;}
inline bool isfs () const {return dev_on_fs || d.devn == FH_FS;}
inline bool is_fs_special () const {return dev_on_fs && d.devn != FH_FS;}
inline bool is_dev_resident () const {return lives_in_dev;}
inline int exists () const {return exists_func (*this);}
unsigned char type () const
{