require '_h2ph_pre.ph';

unless(defined(&_POWERPC_TRAP_H_)) {
    eval 'sub _POWERPC_TRAP_H_ () {1;}' unless defined(&_POWERPC_TRAP_H_);
    eval 'sub EXC_RSVD () {0x;}' unless defined(&EXC_RSVD);
    eval 'sub EXC_RST () {0x100;}' unless defined(&EXC_RST);
    eval 'sub EXC_MCHK () {0x200;}' unless defined(&EXC_MCHK);
    eval 'sub EXC_DSI () {0x300;}' unless defined(&EXC_DSI);
    eval 'sub EXC_ISI () {0x400;}' unless defined(&EXC_ISI);
    eval 'sub EXC_EXI () {0x500;}' unless defined(&EXC_EXI);
    eval 'sub EXC_ALI () {0x600;}' unless defined(&EXC_ALI);
    eval 'sub EXC_PGM () {0x700;}' unless defined(&EXC_PGM);
    eval 'sub EXC_FPU () {0x800;}' unless defined(&EXC_FPU);
    eval 'sub EXC_DECR () {0x900;}' unless defined(&EXC_DECR);
    eval 'sub EXC_SC () {0xc00;}' unless defined(&EXC_SC);
    eval 'sub EXC_TRC () {0xd00;}' unless defined(&EXC_TRC);
    eval 'sub EXC_FPA () {0xe00;}' unless defined(&EXC_FPA);
    eval 'sub EXC_PERF () {0xf00;}' unless defined(&EXC_PERF);
    eval 'sub EXC_VEC () {0xf20;}' unless defined(&EXC_VEC);
    eval 'sub EXC_BPT () {0x1300;}' unless defined(&EXC_BPT);
    eval 'sub EXC_SMI () {0x1400;}' unless defined(&EXC_SMI);
    eval 'sub EXC_IMISS () {0x1000;}' unless defined(&EXC_IMISS);
    eval 'sub EXC_DLMISS () {0x1100;}' unless defined(&EXC_DLMISS);
    eval 'sub EXC_DSMISS () {0x1200;}' unless defined(&EXC_DSMISS);
    eval 'sub EXC_LAST () {0x2f00;}' unless defined(&EXC_LAST);
    eval 'sub EXC_AST () {0x3000;}' unless defined(&EXC_AST);
    eval 'sub EXC_USER () {0x10000;}' unless defined(&EXC_USER);
    eval 'sub EXC_ALI_OPCODE_INDICATOR {
        local($dsisr) = @_;
	    eval q((($dsisr >> 10) & 0x7f));
    }' unless defined(&EXC_ALI_OPCODE_INDICATOR);
    eval 'sub EXC_ALI_LFD () {0x9;}' unless defined(&EXC_ALI_LFD);
    eval 'sub EXC_ALI_STFD () {0xb;}' unless defined(&EXC_ALI_STFD);
    eval 'sub EXC_ALI_DCBZ () {0x5f;}' unless defined(&EXC_ALI_DCBZ);
    eval 'sub EXC_ALI_RST {
        local($dsisr) = @_;
	    eval q((($dsisr >> 5) & 0x1f));
    }' unless defined(&EXC_ALI_RST);
    eval 'sub EXC_ALI_RA {
        local($dsisr) = @_;
	    eval q(($dsisr & 0x1f));
    }' unless defined(&EXC_ALI_RA);
}
1;
