require '_h2ph_pre.ph';

unless(defined(&_LINUX_MODULE_H)) {
    eval 'sub _LINUX_MODULE_H () {1;}' unless defined(&_LINUX_MODULE_H);
    require 'linux/config.ph';
    require 'linux/list.ph';
    if(defined(&__GENKSYMS__)) {
	eval 'sub _set_ver {
	    local($sym) = @_;
    	    eval q($sym);
	}' unless defined(&_set_ver);
	undef(&MODVERSIONS) if defined(&MODVERSIONS);
	eval 'sub MODVERSIONS () {1;}' unless defined(&MODVERSIONS);
    } else {
	if(!defined( &MODVERSIONS)  && defined( &EXPORT_SYMTAB)) {
	    eval 'sub _set_ver {
	        local($sym) = @_;
    		eval q($sym);
	    }' unless defined(&_set_ver);
	    require 'linux/modversions.ph';
	}
    }
    if(defined(&__alpha__)) {
    }
    eval 'sub MOD_UNINITIALIZED () {0;}' unless defined(&MOD_UNINITIALIZED);
    eval 'sub MOD_RUNNING () {1;}' unless defined(&MOD_RUNNING);
    eval 'sub MOD_DELETED () {2;}' unless defined(&MOD_DELETED);
    eval 'sub MOD_AUTOCLEAN () {4;}' unless defined(&MOD_AUTOCLEAN);
    eval 'sub MOD_VISITED () {8;}' unless defined(&MOD_VISITED);
    eval 'sub MOD_USED_ONCE () {16;}' unless defined(&MOD_USED_ONCE);
    eval 'sub MOD_JUST_FREED () {32;}' unless defined(&MOD_JUST_FREED);
    eval 'sub MOD_INITIALIZING () {64;}' unless defined(&MOD_INITIALIZING);
    eval 'sub QM_MODULES () {1;}' unless defined(&QM_MODULES);
    eval 'sub QM_DEPS () {2;}' unless defined(&QM_DEPS);
    eval 'sub QM_REFS () {3;}' unless defined(&QM_REFS);
    eval 'sub QM_SYMBOLS () {4;}' unless defined(&QM_SYMBOLS);
    eval 'sub QM_INFO () {5;}' unless defined(&QM_INFO);
    eval 'sub MOD_CAN_QUERY {
        local($mod) = @_;
	    eval q(((($mod)-> &flags & ( &MOD_RUNNING |  &MOD_INITIALIZING))  && !(($mod)-> &flags &  &MOD_DELETED)));
    }' unless defined(&MOD_CAN_QUERY);
    eval 'sub mod_member_present {
        local($mod,$member) = @_;
	    eval q((((0)->$member + 1) <= ($mod)-> &size_of_struct));
    }' unless defined(&mod_member_present);
    eval 'sub mod_archdata_member_present {
        local($mod, $type, $member) = @_;
	    eval q((((&->$member) + $sizeof{(0)->$member}) <= (($mod)-> &archdata_end - ($mod)-> &archdata_start)));
    }' unless defined(&mod_archdata_member_present);
    eval 'sub mod_bound {
        local($p, $n, $m) = @_;
	    eval q(( >= ( + (-> &size_of_struct))  && (+) <= ($m) + ($m)-> &size));
    }' unless defined(&mod_bound);
    eval 'sub GET_USE_COUNT {
        local($module) = @_;
	    eval q(( &atomic_read(($module)-> ($uc->{usecount}))));
    }' unless defined(&GET_USE_COUNT);
    eval 'sub __MOD_INC_USE_COUNT {
        local($mod) = @_;
	    eval q(( &atomic_inc(($mod)-> ($uc->{usecount})), ($mod)-> &flags |=  &MOD_VISITED| &MOD_USED_ONCE));
    }' unless defined(&__MOD_INC_USE_COUNT);
    eval 'sub __MOD_DEC_USE_COUNT {
        local($mod) = @_;
	    eval q(( &atomic_dec(($mod)-> ($uc->{usecount})), ($mod)-> &flags |=  &MOD_VISITED));
    }' unless defined(&__MOD_DEC_USE_COUNT);
    eval 'sub __MOD_IN_USE {
        local($mod) = @_;
	    eval q(( &mod_member_present(($mod),  &can_unload)  && ($mod)-> &can_unload ? ($mod)-> &can_unload() :  &atomic_read(($mod)-> ($uc->{usecount}))));
    }' unless defined(&__MOD_IN_USE);
    eval 'sub __MODULE_STRING_1 {
        local($x) = @_;
	    eval q($x);
    }' unless defined(&__MODULE_STRING_1);
    eval 'sub __MODULE_STRING {
        local($x) = @_;
	    eval q( &__MODULE_STRING_1($x));
    }' unless defined(&__MODULE_STRING);
    if(defined( &MODULE)  && !defined( &__GENKSYMS__)) {
	eval 'sub MODULE_AUTHOR {
	    local($name) = @_;
    	    eval q( &const \'char\'  $__module_author[]  &__attribute__(( &section(\\".modinfo\\"))) = \\"author=\\" $name);
	}' unless defined(&MODULE_AUTHOR);
	eval 'sub MODULE_DESCRIPTION {
	    local($desc) = @_;
    	    eval q( &const \'char\'  $__module_description[]  &__attribute__(( &section(\\".modinfo\\"))) = \\"description=\\" $desc);
	}' unless defined(&MODULE_DESCRIPTION);
	eval 'sub MODULE_SUPPORTED_DEVICE {
	    local($dev) = @_;
    	    eval q( &const \'char\'  $__module_device[]  &__attribute__(( &section(\\".modinfo\\"))) = \\"device=\\" $dev);
	}' unless defined(&MODULE_SUPPORTED_DEVICE);
	eval 'sub MODULE_PARM {
	    local($var,$type) = @_;
    	    eval q( &const \'char\'  &__module_parm_$var->[]  &__attribute__(( &section(\\".modinfo\\"))) = \\"parm_\\"  &__MODULE_STRING($var) \\"=\\" $type);
	}' unless defined(&MODULE_PARM);
	eval 'sub MODULE_PARM_DESC {
	    local($var,$desc) = @_;
    	    eval q( &const \'char\'  &__module_parm_desc_$var->[]  &__attribute__(( &section(\\".modinfo\\"))) = \\"parm_desc_\\"  &__MODULE_STRING($var) \\"=\\" $desc);
	}' unless defined(&MODULE_PARM_DESC);
	eval 'sub MODULE_GENERIC_TABLE {
	    local($gtype,$name) = @_;
    	    eval q( &static  &const \'unsigned long __module_\'$gtype &_size  &__attribute__ (( &unused)) = $sizeof{\'struct gtype\' &_id};  &static  &const \'struct gtype\' &_id *  &__module_$gtype &_table  &__attribute__ (( &unused)) = $name);
	}' unless defined(&MODULE_GENERIC_TABLE);
	eval 'sub MODULE_DEVICE_TABLE {
	    local($type,$name) = @_;
    	    eval q( &MODULE_GENERIC_TABLE($type &_device,$name));
	}' unless defined(&MODULE_DEVICE_TABLE);
	eval 'sub MODULE_LICENSE {
	    local($license) = @_;
    	    eval q( &static  &const \'char\'  $__module_license[]  &__attribute__(( &section(\\".modinfo\\"))) = \\"license=\\" $license);
	}' unless defined(&MODULE_LICENSE);
	eval 'sub THIS_MODULE () {(& &__this_module);}' unless defined(&THIS_MODULE);
	eval 'sub MOD_INC_USE_COUNT () { &__MOD_INC_USE_COUNT( &THIS_MODULE);}' unless defined(&MOD_INC_USE_COUNT);
	eval 'sub MOD_DEC_USE_COUNT () { &__MOD_DEC_USE_COUNT( &THIS_MODULE);}' unless defined(&MOD_DEC_USE_COUNT);
	eval 'sub MOD_IN_USE () { &__MOD_IN_USE( &THIS_MODULE);}' unless defined(&MOD_IN_USE);
	require 'linux/version.ph';
	if(defined(&MODVERSIONS)) {
	}
    } else {
	eval 'sub MODULE_AUTHOR {
	    local($name) = @_;
    	    eval q();
	}' unless defined(&MODULE_AUTHOR);
	eval 'sub MODULE_LICENSE {
	    local($license) = @_;
    	    eval q();
	}' unless defined(&MODULE_LICENSE);
	eval 'sub MODULE_DESCRIPTION {
	    local($desc) = @_;
    	    eval q();
	}' unless defined(&MODULE_DESCRIPTION);
	eval 'sub MODULE_SUPPORTED_DEVICE {
	    local($name) = @_;
    	    eval q();
	}' unless defined(&MODULE_SUPPORTED_DEVICE);
	eval 'sub MODULE_PARM {
	    local($var,$type) = @_;
    	    eval q();
	}' unless defined(&MODULE_PARM);
	eval 'sub MODULE_PARM_DESC {
	    local($var,$desc) = @_;
    	    eval q();
	}' unless defined(&MODULE_PARM_DESC);
	eval 'sub MODULE_GENERIC_TABLE {
	    local($gtype,$name) = @_;
    	    eval q();
	}' unless defined(&MODULE_GENERIC_TABLE);
	eval 'sub MODULE_DEVICE_TABLE {
	    local($type,$name) = @_;
    	    eval q();
	}' unless defined(&MODULE_DEVICE_TABLE);
	unless(defined(&__GENKSYMS__)) {
	    eval 'sub THIS_MODULE () { &NULL;}' unless defined(&THIS_MODULE);
	    eval 'sub MOD_INC_USE_COUNT () { &do { }  &while (0);}' unless defined(&MOD_INC_USE_COUNT);
	    eval 'sub MOD_DEC_USE_COUNT () { &do { }  &while (0);}' unless defined(&MOD_DEC_USE_COUNT);
	    eval 'sub MOD_IN_USE () {1;}' unless defined(&MOD_IN_USE);
	}
    }
    if(defined( &__GENKSYMS__)) {
    }
 elsif(!defined( &AUTOCONF_INCLUDED)) {
	eval 'sub __EXPORT_SYMBOL {
	    local($sym,$str) = @_;
    	    eval q( &error  &config_must_be_included_before_module);
	}' unless defined(&__EXPORT_SYMBOL);
	eval 'sub EXPORT_SYMBOL {
	    local($var) = @_;
    	    eval q( &error  &config_must_be_included_before_module);
	}' unless defined(&EXPORT_SYMBOL);
	eval 'sub EXPORT_SYMBOL_NOVERS {
	    local($var) = @_;
    	    eval q( &error  &config_must_be_included_before_module);
	}' unless defined(&EXPORT_SYMBOL_NOVERS);
	eval 'sub EXPORT_SYMBOL_GPL {
	    local($var) = @_;
    	    eval q( &error  &config_must_be_included_before_module);
	}' unless defined(&EXPORT_SYMBOL_GPL);
    }
 elsif(!defined( &CONFIG_MODULES)) {
	eval 'sub __EXPORT_SYMBOL {
	    local($sym,$str) = @_;
    	    eval q();
	}' unless defined(&__EXPORT_SYMBOL);
	eval 'sub EXPORT_SYMBOL {
	    local($var) = @_;
    	    eval q();
	}' unless defined(&EXPORT_SYMBOL);
	eval 'sub EXPORT_SYMBOL_NOVERS {
	    local($var) = @_;
    	    eval q();
	}' unless defined(&EXPORT_SYMBOL_NOVERS);
	eval 'sub EXPORT_SYMBOL_GPL {
	    local($var) = @_;
    	    eval q();
	}' unless defined(&EXPORT_SYMBOL_GPL);
    } else {
	eval 'sub __EXPORT_SYMBOL {
	    local($sym, $str) = @_;
    	    eval q( &const \'char\'  &__kstrtab_$sym->[]  &__attribute__(( &section(\\".kstrtab\\"))) = $str;  &const \'struct module_symbol\'  &__ksymtab_$sym  &__attribute__(( &section(\\"__ksymtab\\"))) = { $sym,  &__kstrtab_$sym });
	}' unless defined(&__EXPORT_SYMBOL);
	eval 'sub __EXPORT_SYMBOL_GPL {
	    local($sym, $str) = @_;
    	    eval q( &const \'char\'  &__kstrtab_$sym->[]  &__attribute__(( &section(\\".kstrtab\\"))) = \\"GPLONLY_\\" $str;  &const \'struct module_symbol\'  &__ksymtab_$sym  &__attribute__(( &section(\\"__ksymtab\\"))) = { $sym,  &__kstrtab_$sym });
	}' unless defined(&__EXPORT_SYMBOL_GPL);
	if(defined( &MODVERSIONS) || !defined( &CONFIG_MODVERSIONS)) {
	    eval 'sub EXPORT_SYMBOL {
	        local($var) = @_;
    		eval q( &__EXPORT_SYMBOL($var,  &__MODULE_STRING($var)));
	    }' unless defined(&EXPORT_SYMBOL);
	    eval 'sub EXPORT_SYMBOL_GPL {
	        local($var) = @_;
    		eval q( &__EXPORT_SYMBOL_GPL($var,  &__MODULE_STRING($var)));
	    }' unless defined(&EXPORT_SYMBOL_GPL);
	} else {
	    eval 'sub EXPORT_SYMBOL {
	        local($var) = @_;
    		eval q( &__EXPORT_SYMBOL($var,  &__MODULE_STRING( &__VERSIONED_SYMBOL($var))));
	    }' unless defined(&EXPORT_SYMBOL);
	    eval 'sub EXPORT_SYMBOL_GPL {
	        local($var) = @_;
    		eval q( &__EXPORT_SYMBOL_GPL($var,  &__MODULE_STRING( &__VERSIONED_SYMBOL($var))));
	    }' unless defined(&EXPORT_SYMBOL_GPL);
	}
	eval 'sub EXPORT_SYMBOL_NOVERS {
	    local($var) = @_;
    	    eval q( &__EXPORT_SYMBOL($var,  &__MODULE_STRING($var)));
	}' unless defined(&EXPORT_SYMBOL_NOVERS);
    }
    if(defined(&MODULE)) {
	eval 'sub EXPORT_NO_SYMBOLS () { &__asm__(".section __ksymtab\\n.previous");}' unless defined(&EXPORT_NO_SYMBOLS);
    } else {
	eval 'sub EXPORT_NO_SYMBOLS () {1;}' unless defined(&EXPORT_NO_SYMBOLS);
    }
    if(defined(&CONFIG_MODULES)) {
	eval 'sub SET_MODULE_OWNER {
	    local($some_struct) = @_;
    	    eval q( &do { ($some_struct)-> &owner =  &THIS_MODULE; }  &while (0));
	}' unless defined(&SET_MODULE_OWNER);
    } else {
	eval 'sub SET_MODULE_OWNER {
	    local($some_struct) = @_;
    	    eval q( &do { }  &while (0));
	}' unless defined(&SET_MODULE_OWNER);
    }
}
1;
