require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_SYS_DEVICE_H_)) {
    eval 'sub _SYS_DEVICE_H_ () {1;}' unless defined(&_SYS_DEVICE_H_);
    require 'sys/queue.ph';
    eval("sub DV_DULL () { 0; }") unless defined(&DV_DULL);
    eval("sub DV_CPU () { 1; }") unless defined(&DV_CPU);
    eval("sub DV_DISK () { 2; }") unless defined(&DV_DISK);
    eval("sub DV_IFNET () { 3; }") unless defined(&DV_IFNET);
    eval("sub DV_TAPE () { 4; }") unless defined(&DV_TAPE);
    eval("sub DV_TTY () { 5; }") unless defined(&DV_TTY);
    eval("sub DVACT_ACTIVATE () { 0; }") unless defined(&DVACT_ACTIVATE);
    eval("sub DVACT_DEACTIVATE () { 1; }") unless defined(&DVACT_DEACTIVATE);
    require 'sys/lock.ph';
    eval 'sub DVF_ACTIVE () {0x1;}' unless defined(&DVF_ACTIVE);
    eval 'sub FSTATE_NOTFOUND () {0;}' unless defined(&FSTATE_NOTFOUND);
    eval 'sub FSTATE_FOUND () {1;}' unless defined(&FSTATE_FOUND);
    eval 'sub FSTATE_STAR () {2;}' unless defined(&FSTATE_STAR);
    eval 'sub FSTATE_DNOTFOUND () {3;}' unless defined(&FSTATE_DNOTFOUND);
    eval 'sub FSTATE_DSTAR () {4;}' unless defined(&FSTATE_DSTAR);
    eval 'sub DETACH_FORCE () {0x1;}' unless defined(&DETACH_FORCE);
    eval 'sub DETACH_QUIET () {0x2;}' unless defined(&DETACH_QUIET);
    eval 'sub QUIET () {0;}' unless defined(&QUIET);
    eval 'sub UNCONF () {1;}' unless defined(&UNCONF);
    eval 'sub UNSUPP () {2;}' unless defined(&UNSUPP);
    if(defined(&_KERNEL)) {
	if(defined(&__HAVE_DEVICE_REGISTER)) {
	}
	eval 'sub FIRMWARE_MAX () {5*1024*1024;}' unless defined(&FIRMWARE_MAX);
	eval 'sub config_found {
	    my($d, $a, $p) = @_;
    	    eval q( &config_found_sm(($d), ($a), ($p),  &NULL));
	}' unless defined(&config_found);
    }
}
1;
