require '_h2ph_pre.ph';

unless(defined(&_LINUX_DEVFS_FS_KERNEL_H)) {
    eval 'sub _LINUX_DEVFS_FS_KERNEL_H () {1;}' unless defined(&_LINUX_DEVFS_FS_KERNEL_H);
    require 'linux/fs.ph';
    require 'linux/config.ph';
    require 'linux/locks.ph';
    require 'linux/kdev_t.ph';
    require 'linux/types.ph';
    require 'asm/semaphore.ph';
    eval 'sub DEVFS_SUPER_MAGIC () {0x1373;}' unless defined(&DEVFS_SUPER_MAGIC);
    eval 'sub IS_DEVFS_INODE {
        local($inode) = @_;
	    eval q(( &DEVFS_SUPER_MAGIC == ($inode)-> ($i_sb->{s_magic})));
    }' unless defined(&IS_DEVFS_INODE);
    eval 'sub DEVFS_MINOR {
        local($inode) = @_;
	    eval q(({\'unsigned int m\'; (($inode)-> &i_sb  && (($inode)-> ($i_sb->{s_magic})== &DEVFS_SUPER_MAGIC)  && ( &devfs_get_maj_min( &devfs_get_handle_from_inode(($inode)), &NULL, &m)==0) ) ?  &m :  &MINOR(($inode)-> &r_dev); }));
    }' unless defined(&DEVFS_MINOR);
    eval 'sub DEVFS_FL_NONE () {0x;}' unless defined(&DEVFS_FL_NONE);
    eval 'sub DEVFS_FL_AUTO_OWNER () {0x1;}' unless defined(&DEVFS_FL_AUTO_OWNER);
    eval 'sub DEVFS_FL_SHOW_UNREG () {0x2;}' unless defined(&DEVFS_FL_SHOW_UNREG);
    eval 'sub DEVFS_FL_HIDE () {0x4;}' unless defined(&DEVFS_FL_HIDE);
    eval 'sub DEVFS_FL_AUTO_DEVNUM () {0x8;}' unless defined(&DEVFS_FL_AUTO_DEVNUM);
    eval 'sub DEVFS_FL_AOPEN_NOTIFY () {0x10;}' unless defined(&DEVFS_FL_AOPEN_NOTIFY);
    eval 'sub DEVFS_FL_REMOVABLE () {0x20;}' unless defined(&DEVFS_FL_REMOVABLE);
    eval 'sub DEVFS_FL_WAIT () {0x40;}' unless defined(&DEVFS_FL_WAIT);
    eval 'sub DEVFS_FL_NO_PERSISTENCE () {0x80;}' unless defined(&DEVFS_FL_NO_PERSISTENCE);
    eval 'sub DEVFS_FL_CURRENT_OWNER () {0x100;}' unless defined(&DEVFS_FL_CURRENT_OWNER);
    eval 'sub DEVFS_FL_DEFAULT () { &DEVFS_FL_NONE;}' unless defined(&DEVFS_FL_DEFAULT);
    eval 'sub DEVFS_SPECIAL_CHR () {0;}' unless defined(&DEVFS_SPECIAL_CHR);
    eval 'sub DEVFS_SPECIAL_BLK () {1;}' unless defined(&DEVFS_SPECIAL_BLK);
    if(defined(&CONFIG_BLK_DEV_INITRD)) {
	eval 'sub ROOT_DEVICE_NAME () {(( &real_root_dev == &ROOT_DEV) ?  &root_device_name: &NULL);}' unless defined(&ROOT_DEVICE_NAME);
    } else {
	eval 'sub ROOT_DEVICE_NAME () { &root_device_name;}' unless defined(&ROOT_DEVICE_NAME);
    }
    if(defined(&CONFIG_DEVFS_FS)) {
	eval 'sub UNIQUE_NUMBERSPACE_INITIALISER () {{ &SPIN_LOCK_UNLOCKED, 0, 0, 0,  &NULL};}' unless defined(&UNIQUE_NUMBERSPACE_INITIALISER);
    } else {
	eval 'sub UNIQUE_NUMBERSPACE_INITIALISER () {{0};}' unless defined(&UNIQUE_NUMBERSPACE_INITIALISER);
    }
}
1;
