require '_h2ph_pre.ph';

unless(defined(&PSL_C)) {
    eval 'sub PSL_C () {0x0001;}' unless defined(&PSL_C);
    eval 'sub PSL_V () {0x0002;}' unless defined(&PSL_V);
    eval 'sub PSL_Z () {0x0004;}' unless defined(&PSL_Z);
    eval 'sub PSL_N () {0x0008;}' unless defined(&PSL_N);
    eval 'sub PSL_X () {0x0010;}' unless defined(&PSL_X);
    eval 'sub PSL_ALLCC () {0x001f;}' unless defined(&PSL_ALLCC);
    eval 'sub PSL_IPL0 () {0x0000;}' unless defined(&PSL_IPL0);
    eval 'sub PSL_IPL1 () {0x0100;}' unless defined(&PSL_IPL1);
    eval 'sub PSL_IPL2 () {0x0200;}' unless defined(&PSL_IPL2);
    eval 'sub PSL_IPL3 () {0x0300;}' unless defined(&PSL_IPL3);
    eval 'sub PSL_IPL4 () {0x0400;}' unless defined(&PSL_IPL4);
    eval 'sub PSL_IPL5 () {0x0500;}' unless defined(&PSL_IPL5);
    eval 'sub PSL_IPL6 () {0x0600;}' unless defined(&PSL_IPL6);
    eval 'sub PSL_IPL7 () {0x0700;}' unless defined(&PSL_IPL7);
    eval 'sub PSL_M () {0x1000;}' unless defined(&PSL_M);
    eval 'sub PSL_S () {0x2000;}' unless defined(&PSL_S);
    eval 'sub PSL_T () {0x8000;}' unless defined(&PSL_T);
    eval 'sub PSL_LOWIPL () {( &PSL_S);}' unless defined(&PSL_LOWIPL);
    eval 'sub PSL_HIGHIPL () {( &PSL_S |  &PSL_IPL7);}' unless defined(&PSL_HIGHIPL);
    eval 'sub PSL_IPL () {( &PSL_IPL7);}' unless defined(&PSL_IPL);
    eval 'sub PSL_USER () {(0);}' unless defined(&PSL_USER);
    eval 'sub PSL_MBZ () {0xffff58e0;}' unless defined(&PSL_MBZ);
    eval 'sub PSL_USERSET () {(0);}' unless defined(&PSL_USERSET);
    eval 'sub PSL_USERCLR () {( &PSL_S |  &PSL_IPL7 |  &PSL_MBZ);}' unless defined(&PSL_USERCLR);
    eval 'sub USERMODE {
        local($ps) = @_;
	    eval q(((($ps) &  &PSL_S) == 0));
    }' unless defined(&USERMODE);
}
1;
