require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_MACHINE_OLDMON_H)) {
    eval 'sub _MACHINE_OLDMON_H () {1;}' unless defined(&_MACHINE_OLDMON_H);
    eval 'sub PROM_BASE () {0xffe81000;}' unless defined(&PROM_BASE);
    eval("sub MAP_MAINMEM () { 0; }") unless defined(&MAP_MAINMEM);
    eval("sub MAP_OBIO () { 1; }") unless defined(&MAP_OBIO);
    eval("sub MAP_MBMEM () { 2; }") unless defined(&MAP_MBMEM);
    eval("sub MAP_MBIO () { 3; }") unless defined(&MAP_MBIO);
    eval("sub MAP_VME16A16D () { 4; }") unless defined(&MAP_VME16A16D);
    eval("sub MAP_VME16A32D () { 5; }") unless defined(&MAP_VME16A32D);
    eval("sub MAP_VME24A16D () { 6; }") unless defined(&MAP_VME24A16D);
    eval("sub MAP_VME24A32D () { 7; }") unless defined(&MAP_VME24A32D);
    eval("sub MAP_VME32A16D () { 8; }") unless defined(&MAP_VME32A16D);
    eval("sub MAP_VME32A32D () { 9; }") unless defined(&MAP_VME32A32D);
    eval 'sub SAIO_F_READ () {0x1;}' unless defined(&SAIO_F_READ);
    eval 'sub SAIO_F_WRITE () {0x2;}' unless defined(&SAIO_F_WRITE);
    eval 'sub SAIO_F_ALLOC () {0x4;}' unless defined(&SAIO_F_ALLOC);
    eval 'sub SAIO_F_FILE () {0x8;}' unless defined(&SAIO_F_FILE);
    eval 'sub SAIO_F_EOF () {0x10;}' unless defined(&SAIO_F_EOF);
    eval 'sub SAIO_F_AJAR () {0x20;}' unless defined(&SAIO_F_AJAR);
    eval 'sub PROMDEV_KBD () {0;}' unless defined(&PROMDEV_KBD);
    eval 'sub PROMDEV_SCREEN () {0;}' unless defined(&PROMDEV_SCREEN);
    eval 'sub PROMDEV_TTYA () {1;}' unless defined(&PROMDEV_TTYA);
    eval 'sub PROMDEV_TTYB () {2;}' unless defined(&PROMDEV_TTYB);
    eval 'sub romVectorPtr () {( &PROM_BASE);}' unless defined(&romVectorPtr);
    eval 'sub mon_printf () {( ($romVectorPtr->{printf}));}' unless defined(&mon_printf);
    eval 'sub mon_putchar () {( ($romVectorPtr->{putChar}));}' unless defined(&mon_putchar);
    eval 'sub mon_may_getchar () {( ($romVectorPtr->{mayGet}));}' unless defined(&mon_may_getchar);
    eval 'sub mon_exit_to_mon () {( ($romVectorPtr->{exitToMon}));}' unless defined(&mon_exit_to_mon);
    eval 'sub mon_reboot () {( ($romVectorPtr->{exitToMon}));}' unless defined(&mon_reboot);
    eval 'sub mon_panic {
        my($x) = @_;
	    eval q({  &mon_printf($x);  &mon_exit_to_mon();});
    }' unless defined(&mon_panic);
    eval 'sub mon_setcxsegmap {
        my($context, $va, $sme) = @_;
	    eval q( ($romVectorPtr->{setcxsegmap})($context, $va, $sme));
    }' unless defined(&mon_setcxsegmap);
    eval 'sub romp () {( &romVectorPtr);}' unless defined(&romp);
    eval 'sub OLDMON_STARTVADDR () {0xffd00000;}' unless defined(&OLDMON_STARTVADDR);
    eval 'sub OLDMON_ENDVADDR () {0xfff00000;}' unless defined(&OLDMON_ENDVADDR);
    eval 'sub MONSHORTPAGE () {0xfffe000;}' unless defined(&MONSHORTPAGE);
    eval 'sub MONSHORTSEG () {0xffe0000;}' unless defined(&MONSHORTSEG);
    if(defined(&SUN4)) {
    }
}
1;
