require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_I386_SEGMENTS_H_)) {
    eval 'sub _I386_SEGMENTS_H_ () {1;}' unless defined(&_I386_SEGMENTS_H_);
    eval 'sub ISPL {
        local($s) = @_;
	    eval q((($s) &  &SEL_RPL));
    }' unless defined(&ISPL);
    eval 'sub SEL_KPL () {0;}' unless defined(&SEL_KPL);
    eval 'sub SEL_UPL () {3;}' unless defined(&SEL_UPL);
    eval 'sub SEL_RPL () {3;}' unless defined(&SEL_RPL);
    eval 'sub ISLDT {
        local($s) = @_;
	    eval q((($s) &  &SEL_LDT));
    }' unless defined(&ISLDT);
    eval 'sub SEL_LDT () {4;}' unless defined(&SEL_LDT);
    eval 'sub IDXSEL {
        local($s) = @_;
	    eval q(((($s) >> 3) & 0x1fff));
    }' unless defined(&IDXSEL);
    eval 'sub GSEL {
        local($s,$r) = @_;
	    eval q(((($s) << 3) | $r));
    }' unless defined(&GSEL);
    eval 'sub LSEL {
        local($s,$r) = @_;
	    eval q(((($s) << 3) | $r |  &SEL_LDT));
    }' unless defined(&LSEL);
    if(defined(&VM86)) {
	eval 'sub USERMODE {
	    local($c, $f) = @_;
    	    eval q(( &ISPL($c) ==  &SEL_UPL || (($f) &  &PSL_VM) != 0));
	}' unless defined(&USERMODE);
	eval 'sub KERNELMODE {
	    local($c, $f) = @_;
    	    eval q(( &ISPL($c) ==  &SEL_KPL  && (($f) &  &PSL_VM) == 0));
	}' unless defined(&KERNELMODE);
    } else {
	eval 'sub USERMODE {
	    local($c, $f) = @_;
    	    eval q(( &ISPL($c) ==  &SEL_UPL));
	}' unless defined(&USERMODE);
	eval 'sub KERNELMODE {
	    local($c, $f) = @_;
    	    eval q(( &ISPL($c) ==  &SEL_KPL));
	}' unless defined(&KERNELMODE);
    }
    unless(defined(&_LOCORE)) {
	if((defined(&__GNUC__) ? &__GNUC__ : 0) == 2 && (defined(&__GNUC_MINOR__) ? &__GNUC_MINOR__ : 0) < 7) {
	}
	if((defined(&__GNUC__) ? &__GNUC__ : 0) == 2 && (defined(&__GNUC_MINOR__) ? &__GNUC_MINOR__ : 0) < 7) {
	}
	if(defined(&_KERNEL)) {
	}
    }
    eval 'sub SDT_SYSNULL () {0;}' unless defined(&SDT_SYSNULL);
    eval 'sub SDT_SYS286TSS () {1;}' unless defined(&SDT_SYS286TSS);
    eval 'sub SDT_SYSLDT () {2;}' unless defined(&SDT_SYSLDT);
    eval 'sub SDT_SYS286BSY () {3;}' unless defined(&SDT_SYS286BSY);
    eval 'sub SDT_SYS286CGT () {4;}' unless defined(&SDT_SYS286CGT);
    eval 'sub SDT_SYSTASKGT () {5;}' unless defined(&SDT_SYSTASKGT);
    eval 'sub SDT_SYS286IGT () {6;}' unless defined(&SDT_SYS286IGT);
    eval 'sub SDT_SYS286TGT () {7;}' unless defined(&SDT_SYS286TGT);
    eval 'sub SDT_SYSNULL2 () {8;}' unless defined(&SDT_SYSNULL2);
    eval 'sub SDT_SYS386TSS () {9;}' unless defined(&SDT_SYS386TSS);
    eval 'sub SDT_SYSNULL3 () {10;}' unless defined(&SDT_SYSNULL3);
    eval 'sub SDT_SYS386BSY () {11;}' unless defined(&SDT_SYS386BSY);
    eval 'sub SDT_SYS386CGT () {12;}' unless defined(&SDT_SYS386CGT);
    eval 'sub SDT_SYSNULL4 () {13;}' unless defined(&SDT_SYSNULL4);
    eval 'sub SDT_SYS386IGT () {14;}' unless defined(&SDT_SYS386IGT);
    eval 'sub SDT_SYS386TGT () {15;}' unless defined(&SDT_SYS386TGT);
    eval 'sub SDT_MEMRO () {16;}' unless defined(&SDT_MEMRO);
    eval 'sub SDT_MEMROA () {17;}' unless defined(&SDT_MEMROA);
    eval 'sub SDT_MEMRW () {18;}' unless defined(&SDT_MEMRW);
    eval 'sub SDT_MEMRWA () {19;}' unless defined(&SDT_MEMRWA);
    eval 'sub SDT_MEMROD () {20;}' unless defined(&SDT_MEMROD);
    eval 'sub SDT_MEMRODA () {21;}' unless defined(&SDT_MEMRODA);
    eval 'sub SDT_MEMRWD () {22;}' unless defined(&SDT_MEMRWD);
    eval 'sub SDT_MEMRWDA () {23;}' unless defined(&SDT_MEMRWDA);
    eval 'sub SDT_MEME () {24;}' unless defined(&SDT_MEME);
    eval 'sub SDT_MEMEA () {25;}' unless defined(&SDT_MEMEA);
    eval 'sub SDT_MEMER () {26;}' unless defined(&SDT_MEMER);
    eval 'sub SDT_MEMERA () {27;}' unless defined(&SDT_MEMERA);
    eval 'sub SDT_MEMEC () {28;}' unless defined(&SDT_MEMEC);
    eval 'sub SDT_MEMEAC () {29;}' unless defined(&SDT_MEMEAC);
    eval 'sub SDT_MEMERC () {30;}' unless defined(&SDT_MEMERC);
    eval 'sub SDT_MEMERAC () {31;}' unless defined(&SDT_MEMERAC);
    eval 'sub ISMEMSDP {
        local($s) = @_;
	    eval q((( ($s->{d_type})) >=  &SDT_MEMRO  && ( ($s->{d_type})) <=  &SDT_MEMERAC));
    }' unless defined(&ISMEMSDP);
    eval 'sub IS286GDP {
        local($s) = @_;
	    eval q((( ($s->{d_type})) >=  &SDT_SYS286CGT  && ( ($s->{d_type})) <  &SDT_SYS286TGT));
    }' unless defined(&IS286GDP);
    eval 'sub IS386GDP {
        local($s) = @_;
	    eval q((( ($s->{d_type})) >=  &SDT_SYS386CGT  && ( ($s->{d_type})) <  &SDT_SYS386TGT));
    }' unless defined(&IS386GDP);
    eval 'sub ISGDP {
        local($s) = @_;
	    eval q(( &IS286GDP($s) ||  &IS386GDP($s)));
    }' unless defined(&ISGDP);
    eval 'sub ISSDP {
        local($s) = @_;
	    eval q(( &ISMEMSDP($s) || ! &ISGDP($s)));
    }' unless defined(&ISSDP);
    eval 'sub ISSYSSDP {
        local($s) = @_;
	    eval q((! &ISMEMSDP($s)  && ! &ISGDP($s)));
    }' unless defined(&ISSYSSDP);
    eval 'sub SEGEX_EXT () {0x1;}' unless defined(&SEGEX_EXT);
    eval 'sub SEGEX_IDT () {0x2;}' unless defined(&SEGEX_IDT);
    eval 'sub SEGEX_TI () {0x4;}' unless defined(&SEGEX_TI);
    eval 'sub NIDT () {256;}' unless defined(&NIDT);
    eval 'sub NRSVIDT () {32;}' unless defined(&NRSVIDT);
    eval 'sub GNULL_SEL () {0;}' unless defined(&GNULL_SEL);
    eval 'sub GCODE_SEL () {1;}' unless defined(&GCODE_SEL);
    eval 'sub GDATA_SEL () {2;}' unless defined(&GDATA_SEL);
    eval 'sub GLDT_SEL () {3;}' unless defined(&GLDT_SEL);
    eval 'sub GUCODE1_SEL () {4;}' unless defined(&GUCODE1_SEL);
    eval 'sub GUCODE_SEL () {5;}' unless defined(&GUCODE_SEL);
    eval 'sub GUDATA_SEL () {6;}' unless defined(&GUDATA_SEL);
    eval 'sub GAPM32CODE_SEL () {7;}' unless defined(&GAPM32CODE_SEL);
    eval 'sub GAPM16CODE_SEL () {8;}' unless defined(&GAPM16CODE_SEL);
    eval 'sub GAPMDATA_SEL () {9;}' unless defined(&GAPMDATA_SEL);
    eval 'sub GICODE_SEL () {10;}' unless defined(&GICODE_SEL);
    eval 'sub GCPU_SEL () {11;}' unless defined(&GCPU_SEL);
    eval 'sub NGDT () {12;}' unless defined(&NGDT);
    eval 'sub LSYS5CALLS_SEL () {0;}' unless defined(&LSYS5CALLS_SEL);
    eval 'sub LSYS5SIGR_SEL () {1;}' unless defined(&LSYS5SIGR_SEL);
    eval 'sub LUCODE1_SEL () {2;}' unless defined(&LUCODE1_SEL);
    eval 'sub LUCODE_SEL () {3;}' unless defined(&LUCODE_SEL);
    eval 'sub LUDATA_SEL () {4;}' unless defined(&LUDATA_SEL);
    eval 'sub LBSDICALLS_SEL () {16;}' unless defined(&LBSDICALLS_SEL);
    eval 'sub NLDT () {17;}' unless defined(&NLDT);
}
1;
