]> git.sur5r.net Git - u-boot/commitdiff
Merge git://www.denx.de/git/u-boot
authorMichal Simek <monstr@monstr.eu>
Tue, 7 Aug 2007 20:12:05 +0000 (22:12 +0200)
committerMichal Simek <monstr@monstr.eu>
Tue, 7 Aug 2007 20:12:05 +0000 (22:12 +0200)
1296 files changed:
CHANGELOG
MAKEALL
Makefile
README
board/MAI/AmigaOneG3SE/AmigaOneG3SE.c
board/MAI/AmigaOneG3SE/cmd_boota.c
board/MAI/AmigaOneG3SE/video.c
board/MAI/bios_emulator/bios.c [deleted file]
board/MAI/bios_emulator/glue.c [deleted file]
board/MAI/bios_emulator/glue.h [deleted file]
board/MAI/bios_emulator/scitech/bin/bc31-d16.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/bc45-c32.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/bc45-d16.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/bc45-d32.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/bc45-snp.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/bc45-tnt.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/bc45-vxd.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/bc45-w16.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/bc45-w32.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/bc50-c32.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/bc50-d16.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/bc50-d32.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/bc50-smx.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/bc50-snp.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/bc50-tnt.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/bc50-vxd.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/bc50-w16.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/bc50-w32.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/bc50-x11.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/bcb5-c32.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/bcb5-d16.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/bcb5-d32.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/bcb5-smx.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/bcb5-snp.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/bcb5-tnt.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/bcb5-vxd.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/bcb5-w16.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/bcb5-w32.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/bcb5-x11.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/build [deleted file]
board/MAI/bios_emulator/scitech/bin/build.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/build_db.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/build_it.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/cddrv.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/cdit [deleted file]
board/MAI/bios_emulator/scitech/bin/cdit.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/djgpp.env [deleted file]
board/MAI/bios_emulator/scitech/bin/djgpp_db.env [deleted file]
board/MAI/bios_emulator/scitech/bin/findint3.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/gcc-beos.sh [deleted file]
board/MAI/bios_emulator/scitech/bin/gcc-freebsd.sh [deleted file]
board/MAI/bios_emulator/scitech/bin/gcc-linux.sh [deleted file]
board/MAI/bios_emulator/scitech/bin/gcc2-c32.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/gcc2-dos.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/gcc2-linux.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/gcc2-w32.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/makelib.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/meltobjs.sh [deleted file]
board/MAI/bios_emulator/scitech/bin/ntddk.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/qnx4.sh [deleted file]
board/MAI/bios_emulator/scitech/bin/qnxnto.sh [deleted file]
board/MAI/bios_emulator/scitech/bin/set-vars-beos.sh [deleted file]
board/MAI/bios_emulator/scitech/bin/set-vars-freebsd.sh [deleted file]
board/MAI/bios_emulator/scitech/bin/set-vars-linux.sh [deleted file]
board/MAI/bios_emulator/scitech/bin/set-vars-qnx.sh [deleted file]
board/MAI/bios_emulator/scitech/bin/set-vars.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/vc40-c32.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/vc40-d16.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/vc40-drv9x.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/vc40-drvnt.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/vc40-snp.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/vc40-tnt.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/vc40-w16.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/vc40-w32.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/vc40-x11.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/vc50-c32.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/vc50-d16.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/vc50-drv9x.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/vc50-drvnt.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/vc50-rtt.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/vc50-snp.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/vc50-tnt.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/vc50-w16.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/vc50-w32.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/vc50-x11.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/vc60-c32.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/vc60-d16.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/vc60-drv9x.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/vc60-drvnt.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/vc60-drvw2k.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/vc60-snp.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/vc60-tnt.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/vc60-w16.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/vc60-w32.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/vc60-x11.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/w2kddk.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/wc10-c32.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/wc10-d16.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/wc10-d32.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/wc10-o16.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/wc10-o32.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/wc10-p32.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/wc10-qnx.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/wc10-snp.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/wc10-tnt.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/wc10-w16.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/wc10-w32.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/wc10-x11.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/wc10ac32.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/wc10ad16.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/wc10ad32.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/wc10ao16.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/wc10ao32.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/wc10ap32.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/wc10asnp.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/wc10atnt.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/wc10aw16.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/wc10aw32.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/wc11-c32.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/wc11-d16.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/wc11-d32.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/wc11-o16.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/wc11-o32.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/wc11-p32.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/wc11-qnx.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/wc11-snp.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/wc11-tnt.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/wc11-w16.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/wc11-w32.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/wc11-x11.bat [deleted file]
board/MAI/bios_emulator/scitech/bin/win32sdk.bat [deleted file]
board/MAI/bios_emulator/scitech/include/biosemu.h [deleted file]
board/MAI/bios_emulator/scitech/include/event.h [deleted file]
board/MAI/bios_emulator/scitech/include/mtrr.h [deleted file]
board/MAI/bios_emulator/scitech/include/pcilib.h [deleted file]
board/MAI/bios_emulator/scitech/include/pm_help.h [deleted file]
board/MAI/bios_emulator/scitech/include/pm_wctl.h [deleted file]
board/MAI/bios_emulator/scitech/include/pmapi.h [deleted file]
board/MAI/bios_emulator/scitech/include/pmimp.h [deleted file]
board/MAI/bios_emulator/scitech/include/pmint.h [deleted file]
board/MAI/bios_emulator/scitech/include/scitech.h [deleted file]
board/MAI/bios_emulator/scitech/include/scitech.mac [deleted file]
board/MAI/bios_emulator/scitech/include/x86emu.h [deleted file]
board/MAI/bios_emulator/scitech/include/x86emu/fpu_regs.h [deleted file]
board/MAI/bios_emulator/scitech/include/x86emu/regs.h [deleted file]
board/MAI/bios_emulator/scitech/include/x86emu/types.h [deleted file]
board/MAI/bios_emulator/scitech/lib/debug/linux/gcc/glibc.so/readme.txt [deleted file]
board/MAI/bios_emulator/scitech/lib/debug/linux/gcc/glibc/readme.txt [deleted file]
board/MAI/bios_emulator/scitech/lib/debug/linux/gcc/libc.so/readme.txt [deleted file]
board/MAI/bios_emulator/scitech/lib/debug/linux/gcc/libc/readme.txt [deleted file]
board/MAI/bios_emulator/scitech/lib/release/linux/gcc/glibc.so/readme.txt [deleted file]
board/MAI/bios_emulator/scitech/lib/release/linux/gcc/glibc/readme.txt [deleted file]
board/MAI/bios_emulator/scitech/lib/release/linux/gcc/libc.so/readme.txt [deleted file]
board/MAI/bios_emulator/scitech/lib/release/linux/gcc/libc/readme.txt [deleted file]
board/MAI/bios_emulator/scitech/makedefs/bc16.mk [deleted file]
board/MAI/bios_emulator/scitech/makedefs/bc3.mk [deleted file]
board/MAI/bios_emulator/scitech/makedefs/bc32.mk [deleted file]
board/MAI/bios_emulator/scitech/makedefs/bcos2.mk [deleted file]
board/MAI/bios_emulator/scitech/makedefs/cl16.mk [deleted file]
board/MAI/bios_emulator/scitech/makedefs/cl386.mk [deleted file]
board/MAI/bios_emulator/scitech/makedefs/common.mk [deleted file]
board/MAI/bios_emulator/scitech/makedefs/emx.mk [deleted file]
board/MAI/bios_emulator/scitech/makedefs/gcc_beos.mk [deleted file]
board/MAI/bios_emulator/scitech/makedefs/gcc_dos.mk [deleted file]
board/MAI/bios_emulator/scitech/makedefs/gcc_freebsd.mk [deleted file]
board/MAI/bios_emulator/scitech/makedefs/gcc_linux.mk [deleted file]
board/MAI/bios_emulator/scitech/makedefs/gcc_win32.mk [deleted file]
board/MAI/bios_emulator/scitech/makedefs/hc32.mk [deleted file]
board/MAI/bios_emulator/scitech/makedefs/qnx4.mk [deleted file]
board/MAI/bios_emulator/scitech/makedefs/qnxnto.mk [deleted file]
board/MAI/bios_emulator/scitech/makedefs/rules/bc16.mk [deleted file]
board/MAI/bios_emulator/scitech/makedefs/rules/bc3.mk [deleted file]
board/MAI/bios_emulator/scitech/makedefs/rules/bc32.mk [deleted file]
board/MAI/bios_emulator/scitech/makedefs/rules/bcos2.mk [deleted file]
board/MAI/bios_emulator/scitech/makedefs/rules/cl16.mk [deleted file]
board/MAI/bios_emulator/scitech/makedefs/rules/cl386.mk [deleted file]
board/MAI/bios_emulator/scitech/makedefs/rules/dj32.mk [deleted file]
board/MAI/bios_emulator/scitech/makedefs/rules/emx.mk [deleted file]
board/MAI/bios_emulator/scitech/makedefs/rules/gcc_beos.mk [deleted file]
board/MAI/bios_emulator/scitech/makedefs/rules/gcc_freebsd.mk [deleted file]
board/MAI/bios_emulator/scitech/makedefs/rules/gcc_linux.mk [deleted file]
board/MAI/bios_emulator/scitech/makedefs/rules/gcc_win32.mk [deleted file]
board/MAI/bios_emulator/scitech/makedefs/rules/hc32.mk [deleted file]
board/MAI/bios_emulator/scitech/makedefs/rules/qnx4.mk [deleted file]
board/MAI/bios_emulator/scitech/makedefs/rules/qnxnto.mk [deleted file]
board/MAI/bios_emulator/scitech/makedefs/rules/sc16.mk [deleted file]
board/MAI/bios_emulator/scitech/makedefs/rules/sc32.mk [deleted file]
board/MAI/bios_emulator/scitech/makedefs/rules/va32.mk [deleted file]
board/MAI/bios_emulator/scitech/makedefs/rules/va365.mk [deleted file]
board/MAI/bios_emulator/scitech/makedefs/rules/vc16.mk [deleted file]
board/MAI/bios_emulator/scitech/makedefs/rules/vc32.mk [deleted file]
board/MAI/bios_emulator/scitech/makedefs/rules/wc16.mk [deleted file]
board/MAI/bios_emulator/scitech/makedefs/rules/wc32.mk [deleted file]
board/MAI/bios_emulator/scitech/makedefs/sc16.mk [deleted file]
board/MAI/bios_emulator/scitech/makedefs/sc32.mk [deleted file]
board/MAI/bios_emulator/scitech/makedefs/startup.mk [deleted file]
board/MAI/bios_emulator/scitech/makedefs/va32.mk [deleted file]
board/MAI/bios_emulator/scitech/makedefs/va365.mk [deleted file]
board/MAI/bios_emulator/scitech/makedefs/vc16.mk [deleted file]
board/MAI/bios_emulator/scitech/makedefs/vc32.mk [deleted file]
board/MAI/bios_emulator/scitech/makedefs/wc16.mk [deleted file]
board/MAI/bios_emulator/scitech/makedefs/wc32.mk [deleted file]
board/MAI/bios_emulator/scitech/src/biosemu/besys.c [deleted file]
board/MAI/bios_emulator/scitech/src/biosemu/bios.c [deleted file]
board/MAI/bios_emulator/scitech/src/biosemu/biosemu.c [deleted file]
board/MAI/bios_emulator/scitech/src/biosemu/biosemui.h [deleted file]
board/MAI/bios_emulator/scitech/src/biosemu/makefile [deleted file]
board/MAI/bios_emulator/scitech/src/biosemu/makefile.cross [deleted file]
board/MAI/bios_emulator/scitech/src/biosemu/warmboot.c [deleted file]
board/MAI/bios_emulator/scitech/src/common/_aa_imp.asm [deleted file]
board/MAI/bios_emulator/scitech/src/common/_ga_imp.asm [deleted file]
board/MAI/bios_emulator/scitech/src/common/_gatimer.asm [deleted file]
board/MAI/bios_emulator/scitech/src/common/_pm_imp.asm [deleted file]
board/MAI/bios_emulator/scitech/src/common/aabeos.c [deleted file]
board/MAI/bios_emulator/scitech/src/common/aados.c [deleted file]
board/MAI/bios_emulator/scitech/src/common/aalib.c [deleted file]
board/MAI/bios_emulator/scitech/src/common/aalinux.c [deleted file]
board/MAI/bios_emulator/scitech/src/common/aaos2.c [deleted file]
board/MAI/bios_emulator/scitech/src/common/aaqnx.c [deleted file]
board/MAI/bios_emulator/scitech/src/common/aartt.c [deleted file]
board/MAI/bios_emulator/scitech/src/common/aasmx.c [deleted file]
board/MAI/bios_emulator/scitech/src/common/aavxd.c [deleted file]
board/MAI/bios_emulator/scitech/src/common/aawin32.c [deleted file]
board/MAI/bios_emulator/scitech/src/common/agplib.c [deleted file]
board/MAI/bios_emulator/scitech/src/common/center.c [deleted file]
board/MAI/bios_emulator/scitech/src/common/cmdline.c [deleted file]
board/MAI/bios_emulator/scitech/src/common/gabeos.c [deleted file]
board/MAI/bios_emulator/scitech/src/common/gados.c [deleted file]
board/MAI/bios_emulator/scitech/src/common/galib.c [deleted file]
board/MAI/bios_emulator/scitech/src/common/galinux.c [deleted file]
board/MAI/bios_emulator/scitech/src/common/gantdrv.c [deleted file]
board/MAI/bios_emulator/scitech/src/common/gaos2.c [deleted file]
board/MAI/bios_emulator/scitech/src/common/gaqnx.c [deleted file]
board/MAI/bios_emulator/scitech/src/common/gartt.c [deleted file]
board/MAI/bios_emulator/scitech/src/common/gasmx.c [deleted file]
board/MAI/bios_emulator/scitech/src/common/gavxd.c [deleted file]
board/MAI/bios_emulator/scitech/src/common/gawin32.c [deleted file]
board/MAI/bios_emulator/scitech/src/common/gtfcalc.c [deleted file]
board/MAI/bios_emulator/scitech/src/common/libcimp.c [deleted file]
board/MAI/bios_emulator/scitech/src/common/makefile [deleted file]
board/MAI/bios_emulator/scitech/src/common/peloader.c [deleted file]
board/MAI/bios_emulator/scitech/src/common/vesavbe.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/beos/cpuinfo.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/beos/event.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/beos/oshdr.h [deleted file]
board/MAI/bios_emulator/scitech/src/pm/beos/pm.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/beos/vflat.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/beos/ztimer.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/codepage/us_eng.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/common.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/common/_cpuinfo.asm [deleted file]
board/MAI/bios_emulator/scitech/src/pm/common/_dma.asm [deleted file]
board/MAI/bios_emulator/scitech/src/pm/common/_int64.asm [deleted file]
board/MAI/bios_emulator/scitech/src/pm/common/_joy.asm [deleted file]
board/MAI/bios_emulator/scitech/src/pm/common/_mtrr.asm [deleted file]
board/MAI/bios_emulator/scitech/src/pm/common/_pcihelp.asm [deleted file]
board/MAI/bios_emulator/scitech/src/pm/common/agp.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/common/keyboard.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/common/malloc.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/common/mtrr.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/common/pcilib.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/common/unixio.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/common/vgastate.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/cpuinfo.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/debug.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/dos/_event.asm [deleted file]
board/MAI/bios_emulator/scitech/src/pm/dos/_lztimer.asm [deleted file]
board/MAI/bios_emulator/scitech/src/pm/dos/_pm.asm [deleted file]
board/MAI/bios_emulator/scitech/src/pm/dos/_pmdos.asm [deleted file]
board/MAI/bios_emulator/scitech/src/pm/dos/_vflat.asm [deleted file]
board/MAI/bios_emulator/scitech/src/pm/dos/cpuinfo.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/dos/event.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/dos/oshdr.h [deleted file]
board/MAI/bios_emulator/scitech/src/pm/dos/pm.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/dos/pmdos.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/dos/vflat.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/dos/ztimer.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/event.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/linux/cpuinfo.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/linux/event.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/linux/event.svga [deleted file]
board/MAI/bios_emulator/scitech/src/pm/linux/oshdr.h [deleted file]
board/MAI/bios_emulator/scitech/src/pm/linux/pm.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/linux/vflat.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/linux/ztimer.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/makefile [deleted file]
board/MAI/bios_emulator/scitech/src/pm/ntdrv/_irq.asm [deleted file]
board/MAI/bios_emulator/scitech/src/pm/ntdrv/_pm.asm [deleted file]
board/MAI/bios_emulator/scitech/src/pm/ntdrv/cpuinfo.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/ntdrv/int86.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/ntdrv/irq.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/ntdrv/mem.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/ntdrv/oshdr.h [deleted file]
board/MAI/bios_emulator/scitech/src/pm/ntdrv/pm.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/ntdrv/stdio.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/ntdrv/stdlib.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/ntdrv/vflat.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/ntdrv/ztimer.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/os2/_pmos2.asm [deleted file]
board/MAI/bios_emulator/scitech/src/pm/os2/cpuinfo.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/os2/event.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/os2/mon.h [deleted file]
board/MAI/bios_emulator/scitech/src/pm/os2/oshdr.h [deleted file]
board/MAI/bios_emulator/scitech/src/pm/os2/pm.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/os2/vflat.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/os2/ztimer.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/os2pm/event.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/os2pm/oshdr.h [deleted file]
board/MAI/bios_emulator/scitech/src/pm/oshdr.h [deleted file]
board/MAI/bios_emulator/scitech/src/pm/photon/event.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/photon/oshdr.h [deleted file]
board/MAI/bios_emulator/scitech/src/pm/pm.vpw [deleted file]
board/MAI/bios_emulator/scitech/src/pm/pmcommon.vpj [deleted file]
board/MAI/bios_emulator/scitech/src/pm/pmdos.vpj [deleted file]
board/MAI/bios_emulator/scitech/src/pm/pmlinux.vpj [deleted file]
board/MAI/bios_emulator/scitech/src/pm/pmntdrv.vpj [deleted file]
board/MAI/bios_emulator/scitech/src/pm/pmqnx.vpj [deleted file]
board/MAI/bios_emulator/scitech/src/pm/pmvxd.vpj [deleted file]
board/MAI/bios_emulator/scitech/src/pm/pmwin32.vpj [deleted file]
board/MAI/bios_emulator/scitech/src/pm/qnx/_mtrrqnx.asm [deleted file]
board/MAI/bios_emulator/scitech/src/pm/qnx/cpuinfo.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/qnx/event.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/qnx/mtrrqnx.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/qnx/oshdr.h [deleted file]
board/MAI/bios_emulator/scitech/src/pm/qnx/pm.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/qnx/vflat.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/qnx/ztimer.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/rttarget/cpuinfo.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/rttarget/event.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/rttarget/oshdr.h [deleted file]
board/MAI/bios_emulator/scitech/src/pm/rttarget/pm.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/rttarget/vflat.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/rttarget/ztimer.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/smx/_event.asm [deleted file]
board/MAI/bios_emulator/scitech/src/pm/smx/_lztimer.asm [deleted file]
board/MAI/bios_emulator/scitech/src/pm/smx/_pm.asm [deleted file]
board/MAI/bios_emulator/scitech/src/pm/smx/_pmsmx.asm [deleted file]
board/MAI/bios_emulator/scitech/src/pm/smx/_vflat.asm [deleted file]
board/MAI/bios_emulator/scitech/src/pm/smx/cpuinfo.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/smx/event.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/smx/oshdr.h [deleted file]
board/MAI/bios_emulator/scitech/src/pm/smx/pm.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/smx/pmsmx.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/smx/vflat.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/smx/ztimer.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/stub/cpuinfo.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/stub/event.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/stub/oshdr.h [deleted file]
board/MAI/bios_emulator/scitech/src/pm/stub/pm.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/stub/vflat.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/stub/ztimer.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/tests/altbrk.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/tests/altcrit.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/tests/biosptr.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/tests/block.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/tests/brk.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/tests/callreal.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/tests/checks.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/tests/cpu.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/tests/critical.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/tests/getch.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/tests/isvesa.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/tests/key.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/tests/key15.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/tests/memtest.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/tests/mouse.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/tests/restore.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/tests/rtc.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/tests/save.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/tests/showpci.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/tests/tick.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/tests/timerc.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/tests/timercpp.cpp [deleted file]
board/MAI/bios_emulator/scitech/src/pm/tests/uswc.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/tests/vftest.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/tests/video.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/vdd/cpuinfo.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/vdd/fileio.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/vdd/oshdr.h [deleted file]
board/MAI/bios_emulator/scitech/src/pm/vdd/pm.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/vdd/vflat.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/vdd/ztimer.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/vxd/_pm.asm [deleted file]
board/MAI/bios_emulator/scitech/src/pm/vxd/cpuinfo.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/vxd/fileio.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/vxd/oshdr.h [deleted file]
board/MAI/bios_emulator/scitech/src/pm/vxd/pm.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/vxd/vflat.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/vxd/ztimer.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/win32/_pmwin32.asm [deleted file]
board/MAI/bios_emulator/scitech/src/pm/win32/cpuinfo.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/win32/ddraw.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/win32/event.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/win32/ntservc.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/win32/oshdr.h [deleted file]
board/MAI/bios_emulator/scitech/src/pm/win32/pm.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/win32/vflat.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/win32/ztimer.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/x11/event.c [deleted file]
board/MAI/bios_emulator/scitech/src/pm/x11/oshdr.h [deleted file]
board/MAI/bios_emulator/scitech/src/pm/z_samples.vpj [deleted file]
board/MAI/bios_emulator/scitech/src/pm/ztimer.c [deleted file]
board/MAI/bios_emulator/scitech/src/v86bios/AsmMacros.h [deleted file]
board/MAI/bios_emulator/scitech/src/v86bios/README [deleted file]
board/MAI/bios_emulator/scitech/src/v86bios/awk.scr [deleted file]
board/MAI/bios_emulator/scitech/src/v86bios/cbios.c [deleted file]
board/MAI/bios_emulator/scitech/src/v86bios/command.c [deleted file]
board/MAI/bios_emulator/scitech/src/v86bios/console.c [deleted file]
board/MAI/bios_emulator/scitech/src/v86bios/debug.h [deleted file]
board/MAI/bios_emulator/scitech/src/v86bios/happy_cards [deleted file]
board/MAI/bios_emulator/scitech/src/v86bios/hexdump [deleted file]
board/MAI/bios_emulator/scitech/src/v86bios/int.c [deleted file]
board/MAI/bios_emulator/scitech/src/v86bios/io.c [deleted file]
board/MAI/bios_emulator/scitech/src/v86bios/lex.l [deleted file]
board/MAI/bios_emulator/scitech/src/v86bios/main.c [deleted file]
board/MAI/bios_emulator/scitech/src/v86bios/makefile.linux [deleted file]
board/MAI/bios_emulator/scitech/src/v86bios/mem.c [deleted file]
board/MAI/bios_emulator/scitech/src/v86bios/parser.y [deleted file]
board/MAI/bios_emulator/scitech/src/v86bios/pci.c [deleted file]
board/MAI/bios_emulator/scitech/src/v86bios/pci.h [deleted file]
board/MAI/bios_emulator/scitech/src/v86bios/v86.c [deleted file]
board/MAI/bios_emulator/scitech/src/v86bios/v86bios.c [deleted file]
board/MAI/bios_emulator/scitech/src/v86bios/v86bios.h [deleted file]
board/MAI/bios_emulator/scitech/src/v86bios/working_cards [deleted file]
board/MAI/bios_emulator/scitech/src/v86bios/x86emu.c [deleted file]
board/MAI/bios_emulator/scitech/src/x86emu/LICENSE [deleted file]
board/MAI/bios_emulator/scitech/src/x86emu/debug.c [deleted file]
board/MAI/bios_emulator/scitech/src/x86emu/decode.c [deleted file]
board/MAI/bios_emulator/scitech/src/x86emu/fpu.c [deleted file]
board/MAI/bios_emulator/scitech/src/x86emu/makefile [deleted file]
board/MAI/bios_emulator/scitech/src/x86emu/makefile.cross [deleted file]
board/MAI/bios_emulator/scitech/src/x86emu/makefile.linux [deleted file]
board/MAI/bios_emulator/scitech/src/x86emu/makefile.uboot [deleted file]
board/MAI/bios_emulator/scitech/src/x86emu/ops.c [deleted file]
board/MAI/bios_emulator/scitech/src/x86emu/ops2.c [deleted file]
board/MAI/bios_emulator/scitech/src/x86emu/prim_ops.c [deleted file]
board/MAI/bios_emulator/scitech/src/x86emu/sys.c [deleted file]
board/MAI/bios_emulator/scitech/src/x86emu/validate.c [deleted file]
board/MAI/bios_emulator/scitech/src/x86emu/x86emu/debug.h [deleted file]
board/MAI/bios_emulator/scitech/src/x86emu/x86emu/decode.h [deleted file]
board/MAI/bios_emulator/scitech/src/x86emu/x86emu/fpu.h [deleted file]
board/MAI/bios_emulator/scitech/src/x86emu/x86emu/ops.h [deleted file]
board/MAI/bios_emulator/scitech/src/x86emu/x86emu/prim_asm.h [deleted file]
board/MAI/bios_emulator/scitech/src/x86emu/x86emu/prim_ops.h [deleted file]
board/MAI/bios_emulator/scitech/src/x86emu/x86emu/x86emui.h [deleted file]
board/MAI/bios_emulator/x86interface.c [deleted file]
board/MAI/menu/cmd_menu.c
board/Marvell/common/serial.c
board/a3000/u-boot.lds [deleted file]
board/alaska/alaska.c
board/alaska/u-boot.lds [deleted file]
board/altera/dk1c20/dk1c20.c
board/amirix/ap1000/serial.c
board/at91rm9200dk/at91rm9200dk.c
board/atc/atc.c
board/atc/ti113x.c
board/atc/u-boot.lds [deleted file]
board/atmel/atstk1000/eth.c
board/barco/u-boot.lds [deleted file]
board/bc3450/bc3450.c
board/bc3450/cmd_bc3450.c
board/bc3450/u-boot.lds [deleted file]
board/bf537-stamp/bf537-stamp.c
board/bf537-stamp/ether_bf537.c
board/bf537-stamp/nand.c
board/bmw/u-boot.lds [deleted file]
board/c2mon/pcmcia.c
board/canmb/u-boot.lds [deleted file]
board/cm1_qp1/Makefile [deleted file]
board/cm1_qp1/cm1_qp1.c [deleted file]
board/cm1_qp1/cmd_cm1_qp1.c [deleted file]
board/cm1_qp1/config.mk [deleted file]
board/cm1_qp1/fwupdate.c [deleted file]
board/cm1_qp1/fwupdate.h [deleted file]
board/cm1_qp1/u-boot.lds [deleted file]
board/cm5200/Makefile [new file with mode: 0644]
board/cm5200/cm5200.c [new file with mode: 0644]
board/cm5200/cm5200.h [new file with mode: 0644]
board/cm5200/cmd_cm5200.c [new file with mode: 0644]
board/cm5200/config.mk [new file with mode: 0644]
board/cm5200/fwupdate.c [new file with mode: 0644]
board/cm5200/fwupdate.h [new file with mode: 0644]
board/cm5200/u-boot.lds [new file with mode: 0644]
board/cmc_pu2/cmc_pu2.c
board/cmi/u-boot.lds [deleted file]
board/cogent/config.mk
board/cogent/serial.c
board/cogent/u-boot.lds
board/cpc45/cpc45.c
board/cpc45/pd67290.c
board/cpc45/u-boot.lds [deleted file]
board/cpu86/cpu86.c
board/cpu86/u-boot.lds [deleted file]
board/cpu87/cpu87.c
board/cpu87/u-boot.lds [deleted file]
board/csb637/csb637.c
board/cu824/u-boot.lds [deleted file]
board/dave/PPChameleonEVB/nand.c
board/delta/nand.c
board/eXalion/u-boot.lds [deleted file]
board/emk/top5200/top5200.c
board/emk/top5200/u-boot.lds [deleted file]
board/ep8248/u-boot.lds [deleted file]
board/ep8260/u-boot.lds [deleted file]
board/ep82xxm/u-boot.lds [deleted file]
board/esd/ash405/ash405.c
board/esd/cms700/cms700.c
board/esd/common/auto_update.c
board/esd/common/cmd_loadpci.c
board/esd/cpci5200/cpci5200.c
board/esd/cpci5200/u-boot.lds [deleted file]
board/esd/cpci750/ide.c
board/esd/cpci750/sdram_init.c
board/esd/cpci750/serial.c
board/esd/hh405/hh405.c
board/esd/hub405/hub405.c
board/esd/mecp5200/mecp5200.c
board/esd/mecp5200/u-boot.lds [deleted file]
board/esd/ocrtc/cmd_ocrtc.c
board/esd/pci405/cmd_pci405.c
board/esd/pf5200/pf5200.c
board/esd/pf5200/u-boot.lds [deleted file]
board/esd/plu405/plu405.c
board/esd/voh405/voh405.c
board/esd/wuh405/wuh405.c
board/etin/debris/phantom.c
board/etin/debris/u-boot.lds [deleted file]
board/etin/kvme080/u-boot.lds [deleted file]
board/evb64260/eth.c
board/evb64260/serial.c
board/evb64260/zuma_pbb.c
board/fads/fads.c
board/fads/fads.h
board/fads/pcmcia.c
board/freescale/common/pixis.c
board/freescale/mpc8544ds/Makefile
board/funkwerk/vovpn-gw/m88e6060.c
board/funkwerk/vovpn-gw/u-boot.lds [deleted file]
board/funkwerk/vovpn-gw/vovpn-gw.c
board/g2000/g2000.c
board/gen860t/gen860t.c
board/genietv/genietv.c
board/gth/pcmcia.c
board/gw8260/u-boot.lds [deleted file]
board/hidden_dragon/u-boot.lds [deleted file]
board/hmi1001/config.mk
board/hmi1001/u-boot.lds [deleted file]
board/hymod/bsp.c
board/hymod/config.mk
board/hymod/u-boot.lds
board/icecube/icecube.c
board/icecube/u-boot.lds [deleted file]
board/icu862/pcmcia.c
board/ids8247/ids8247.c
board/ids8247/u-boot.lds [deleted file]
board/inka4x0/config.mk
board/inka4x0/inka4x0.c
board/inka4x0/u-boot.lds [deleted file]
board/iphase4539/u-boot.lds [deleted file]
board/ispan/u-boot.lds [deleted file]
board/ixdp425/ixdp425.c
board/jupiter/jupiter.c
board/jupiter/u-boot.lds [deleted file]
board/kb9202/kb9202.c
board/kup/common/pcmcia.c
board/lwmon/lwmon.c
board/lwmon/pcmcia.c
board/mbx8xx/pcmcia.c
board/mcc200/auto_update.c
board/mcc200/mcc200.c
board/mcc200/u-boot.lds [deleted file]
board/ml2/serial.c
board/motionpro/u-boot.lds [deleted file]
board/mousse/config.mk
board/mousse/u-boot.lds
board/mp2usb/mp2usb.c
board/mpc8260ads/u-boot.lds [deleted file]
board/mpc8266ads/u-boot.lds [deleted file]
board/mpc8313erdb/u-boot.lds [deleted file]
board/mpc832xemds/u-boot.lds [deleted file]
board/mpc8349emds/u-boot.lds [deleted file]
board/mpc8349itx/u-boot.lds [deleted file]
board/mpc8360emds/u-boot.lds [deleted file]
board/mpc8560ads/mpc8560ads.c
board/mpc8641hpcn/mpc8641hpcn.c
board/mpc8641hpcn/sys_eeprom.c
board/mpc8641hpcn/u-boot.lds
board/mpl/common/common_util.c
board/mpl/common/common_util.h
board/mpl/pati/u-boot.lds [deleted file]
board/mpl/vcma9/vcma9.c
board/mpl/vcma9/vcma9.h
board/musenki/u-boot.lds [deleted file]
board/mvblue/u-boot.lds [deleted file]
board/nc650/nand.c
board/netphone/netphone.c
board/netstar/nand.c
board/netta/netta.c
board/netta/pcmcia.c
board/netta2/netta2.c
board/netvia/netvia.c
board/o2dnt/u-boot.lds [deleted file]
board/omap2420h4/omap2420h4.c
board/oxc/u-boot.lds [deleted file]
board/pcippc2/pcippc2.c
board/pm520/pm520.c
board/pm520/u-boot.lds [deleted file]
board/pm826/pm826.c
board/pm826/u-boot.lds [deleted file]
board/pm828/pm828.c
board/pm828/u-boot.lds [deleted file]
board/pn62/cmd_pn62.c
board/pn62/u-boot.lds [deleted file]
board/ppmc8260/u-boot.lds [deleted file]
board/prodrive/alpr/nand.c
board/prodrive/p3mx/serial.c
board/prodrive/pdnb3/nand.c
board/prodrive/pdnb3/pdnb3.c
board/r360mpi/pcmcia.c
board/rattler/u-boot.lds [deleted file]
board/rpxsuper/u-boot.lds [deleted file]
board/rsdproto/config.mk
board/rsdproto/u-boot.lds
board/sacsng/sacsng.c
board/sacsng/u-boot.lds [deleted file]
board/sandpoint/u-boot.lds [deleted file]
board/sbc2410x/sbc2410x.c
board/sbc8240/u-boot.lds [deleted file]
board/sbc8260/u-boot.lds [deleted file]
board/sbc8349/u-boot.lds [deleted file]
board/sc3/sc3nand.c
board/siemens/SCM/u-boot.lds [deleted file]
board/siemens/SMN42/flash.c [changed mode: 0755->0644]
board/siemens/common/fpga.c
board/siemens/pcu_e/pcu_e.c
board/sixnet/sixnet.c
board/sl8245/u-boot.lds [deleted file]
board/sorcery/u-boot.lds [deleted file]
board/spc1920/hpi.c
board/ssv/adnpesc1/adnpesc1.c
board/ssv/common/cmd_sled.c
board/ssv/common/wd_pio.c
board/stxxtc/stxxtc.c
board/svm_sc8xx/svm_sc8xx.c
board/total5200/total5200.c
board/total5200/u-boot.lds [deleted file]
board/tqm5200/cmd_stk52xx.c [changed mode: 0755->0644]
board/tqm5200/cmd_tb5200.c
board/tqm5200/tqm5200.c
board/tqm5200/u-boot.lds [deleted file]
board/tqm8260/u-boot.lds [deleted file]
board/tqm8272/tqm8272.c
board/tqm8272/u-boot.lds [deleted file]
board/tqm834x/u-boot.lds [deleted file]
board/trab/Makefile
board/trab/auto_update.c
board/trab/cmd_trab.c
board/trab/trab_fkt.c
board/uc100/pcmcia.c
board/uc101/config.mk
board/uc101/u-boot.lds [deleted file]
board/utx8245/u-boot.lds [deleted file]
board/v38b/u-boot.lds [deleted file]
board/v38b/v38b.c
board/w7o/cmd_vpd.c
board/xilinx/ml300/serial.c
board/zpc1900/u-boot.lds [deleted file]
board/zylonite/nand.c
common/bedbug.c
common/cmd_autoscript.c
common/cmd_bdinfo.c
common/cmd_bedbug.c
common/cmd_bmp.c
common/cmd_bootm.c
common/cmd_cache.c
common/cmd_console.c
common/cmd_date.c
common/cmd_dcr.c
common/cmd_diag.c
common/cmd_display.c
common/cmd_doc.c
common/cmd_dtt.c
common/cmd_eeprom.c
common/cmd_elf.c
common/cmd_ext2.c
common/cmd_fat.c
common/cmd_fdc.c
common/cmd_fdos.c
common/cmd_flash.c
common/cmd_fpga.c
common/cmd_i2c.c
common/cmd_ide.c
common/cmd_immap.c
common/cmd_itest.c
common/cmd_jffs2.c
common/cmd_load.c
common/cmd_mem.c
common/cmd_mfsl.c
common/cmd_mii.c
common/cmd_misc.c
common/cmd_mmc.c
common/cmd_nand.c
common/cmd_net.c
common/cmd_nvedit.c
common/cmd_pci.c
common/cmd_pcmcia.c
common/cmd_portio.c
common/cmd_reginfo.c
common/cmd_reiser.c
common/cmd_scsi.c
common/cmd_spi.c
common/cmd_universe.c
common/cmd_usb.c
common/cmd_vfd.c
common/cmd_ximg.c
common/command.c
common/docecc.c
common/env_flash.c
common/env_nand.c
common/exports.c
common/hush.c
common/kgdb.c
common/lcd.c
common/main.c
common/miiphyutil.c
common/usb.c
common/usb_storage.c
cpu/74xx_7xx/kgdb.S
cpu/74xx_7xx/traps.c
cpu/arm920t/at91rm9200/bcm5221.c
cpu/arm920t/at91rm9200/dm9161.c
cpu/arm920t/at91rm9200/ether.c
cpu/arm920t/at91rm9200/lxt972.c
cpu/i386/serial.c
cpu/ixp/cpu.c
cpu/ixp/npe/npe.c
cpu/mcf52x2/fec.c
cpu/microblaze/cache.c
cpu/microblaze/interrupts.c
cpu/mips/au1x00_eth.c
cpu/mpc5xx/config.mk
cpu/mpc5xx/interrupts.c
cpu/mpc5xx/traps.c
cpu/mpc5xx/u-boot.lds [new file with mode: 0644]
cpu/mpc5xxx/config.mk
cpu/mpc5xxx/cpu_init.c
cpu/mpc5xxx/fec.c
cpu/mpc5xxx/ide.c
cpu/mpc5xxx/interrupts.c
cpu/mpc5xxx/traps.c
cpu/mpc5xxx/u-boot-customlayout.lds [new file with mode: 0644]
cpu/mpc5xxx/u-boot.lds [new file with mode: 0644]
cpu/mpc8220/config.mk
cpu/mpc8220/cpu_init.c
cpu/mpc8220/fec.c
cpu/mpc8220/traps.c
cpu/mpc8220/u-boot.lds [new file with mode: 0644]
cpu/mpc824x/config.mk
cpu/mpc824x/traps.c
cpu/mpc824x/u-boot.lds [new file with mode: 0644]
cpu/mpc8260/bedbug_603e.c
cpu/mpc8260/config.mk
cpu/mpc8260/cpu_init.c
cpu/mpc8260/ether_fcc.c
cpu/mpc8260/ether_scc.c
cpu/mpc8260/interrupts.c
cpu/mpc8260/kgdb.S
cpu/mpc8260/traps.c
cpu/mpc8260/u-boot.lds [new file with mode: 0644]
cpu/mpc83xx/config.mk
cpu/mpc83xx/interrupts.c
cpu/mpc83xx/traps.c
cpu/mpc83xx/u-boot.lds [new file with mode: 0644]
cpu/mpc85xx/ether_fcc.c
cpu/mpc85xx/interrupts.c
cpu/mpc85xx/traps.c
cpu/mpc86xx/Makefile
cpu/mpc86xx/interrupts.c
cpu/mpc86xx/pci.c [deleted file]
cpu/mpc86xx/pcie_indirect.c [deleted file]
cpu/mpc86xx/traps.c
cpu/mpc8xx/bedbug_860.c
cpu/mpc8xx/fec.c
cpu/mpc8xx/kgdb.S
cpu/mpc8xx/scc.c
cpu/mpc8xx/serial.c
cpu/mpc8xx/traps.c
cpu/nios/interrupts.c
cpu/nios2/interrupts.c
cpu/ppc4xx/4xx_enet.c
cpu/ppc4xx/bedbug_405.c
cpu/ppc4xx/dcr.S
cpu/ppc4xx/interrupts.c
cpu/ppc4xx/kgdb.S
cpu/ppc4xx/ndfc.c
cpu/ppc4xx/serial.c
cpu/ppc4xx/traps.c [changed mode: 0755->0644]
cpu/ppc4xx/usbdev.c
disk/part.c [changed mode: 0755->0644]
disk/part_amiga.c
disk/part_dos.c
disk/part_iso.c
disk/part_mac.c
doc/README.JFFS2
doc/README.PIP405
doc/README.SNTP
doc/README.bedbug
doc/README.nand
doc/README.usb
drivers/Makefile
drivers/ahci.c
drivers/ati_ids.h [new file with mode: 0644]
drivers/ati_radeon_fb.c [new file with mode: 0644]
drivers/ati_radeon_fb.h [new file with mode: 0644]
drivers/bcm570x.c
drivers/bios_emulator/Makefile [new file with mode: 0644]
drivers/bios_emulator/atibios.c [new file with mode: 0644]
drivers/bios_emulator/besys.c [new file with mode: 0644]
drivers/bios_emulator/bios.c [new file with mode: 0644]
drivers/bios_emulator/biosemu.c [new file with mode: 0644]
drivers/bios_emulator/biosemui.h [new file with mode: 0644]
drivers/bios_emulator/include/biosemu.h [new file with mode: 0644]
drivers/bios_emulator/include/x86emu.h [new file with mode: 0644]
drivers/bios_emulator/include/x86emu/debug.h [new file with mode: 0644]
drivers/bios_emulator/include/x86emu/decode.h [new file with mode: 0644]
drivers/bios_emulator/include/x86emu/ops.h [new file with mode: 0644]
drivers/bios_emulator/include/x86emu/prim_asm.h [new file with mode: 0644]
drivers/bios_emulator/include/x86emu/prim_ops.h [new file with mode: 0644]
drivers/bios_emulator/include/x86emu/regs.h [new file with mode: 0644]
drivers/bios_emulator/include/x86emu/x86emui.h [new file with mode: 0644]
drivers/bios_emulator/x86emu/debug.c [new file with mode: 0644]
drivers/bios_emulator/x86emu/decode.c [new file with mode: 0644]
drivers/bios_emulator/x86emu/ops.c [new file with mode: 0644]
drivers/bios_emulator/x86emu/ops2.c [new file with mode: 0644]
drivers/bios_emulator/x86emu/prim_ops.c [new file with mode: 0644]
drivers/bios_emulator/x86emu/sys.c [new file with mode: 0644]
drivers/cfb_console.c
drivers/cs8900.c
drivers/dc2114x.c
drivers/e1000.c
drivers/eepro100.c
drivers/enc28j60.c [changed mode: 0755->0644]
drivers/fsl_pci_init.c [new file with mode: 0644]
drivers/inca-ip_sw.c
drivers/lan91c96.c
drivers/macb.c
drivers/mpc8xx_pcmcia.c
drivers/nand/nand.c
drivers/nand/nand_base.c
drivers/nand/nand_bbt.c
drivers/nand/nand_ecc.c
drivers/nand/nand_ids.c
drivers/nand/nand_util.c
drivers/nand_legacy/nand_legacy.c
drivers/natsemi.c
drivers/netarm_eth.c
drivers/ns8382x.c
drivers/pci.c
drivers/pci_auto.c
drivers/pci_indirect.c
drivers/pcnet.c
drivers/plb2800_eth.c
drivers/pxa_pcmcia.c
drivers/rpx_pcmcia.c
drivers/rtl8019.c
drivers/rtl8139.c
drivers/rtl8169.c
drivers/sk98lin/uboot_drv.c
drivers/sym53c8xx.c
drivers/ti_pci1410a.c
drivers/tigon3.c
drivers/tqm8xx_pcmcia.c
drivers/tsec.c
drivers/tsi108_eth.c
drivers/tsi108_i2c.c
fs/cramfs/cramfs.c
fs/cramfs/uncompress.c
fs/ext2/dev.c
fs/ext2/ext2fs.c
fs/fat/fat.c [changed mode: 0755->0644]
fs/fat/file.c
fs/fdos/dev.c
fs/fdos/fat.c
fs/fdos/fdos.c
fs/fdos/fs.c
fs/fdos/subdir.c
fs/fdos/vfat.c
fs/jffs2/compr_lzari.c
fs/jffs2/compr_lzo.c
fs/jffs2/compr_rtime.c
fs/jffs2/compr_rubin.c
fs/jffs2/compr_zlib.c
fs/jffs2/jffs2_1pass.c
fs/jffs2/jffs2_nand_1pass.c
fs/jffs2/mini_inflate.c
fs/reiserfs/dev.c
fs/reiserfs/mode_string.c
fs/reiserfs/reiserfs.c
include/_exports.h
include/asm-ppc/immap_85xx.h
include/asm-ppc/immap_fsl_pci.h [new file with mode: 0644]
include/cmd_confdefs.h [deleted file]
include/command.h
include/common.h
include/config_cmd_all.h [new file with mode: 0644]
include/config_cmd_default.h [new file with mode: 0644]
include/configs/A3000.h
include/configs/ADCIOP.h
include/configs/ADNPESC1.h
include/configs/ADS860.h
include/configs/AMX860.h
include/configs/AP1000.h
include/configs/APC405.h
include/configs/AR405.h
include/configs/ASH405.h
include/configs/Adder.h
include/configs/Alaska8220.h
include/configs/AmigaOneG3SE.h
include/configs/B2.h
include/configs/BAB7xx.h
include/configs/BC3450.h
include/configs/BMW.h
include/configs/CANBT.h
include/configs/CATcenter.h
include/configs/CCM.h
include/configs/CMS700.h
include/configs/CPC45.h
include/configs/CPCI2DP.h
include/configs/CPCI405.h
include/configs/CPCI4052.h
include/configs/CPCI405AB.h
include/configs/CPCI405DT.h
include/configs/CPCI440.h
include/configs/CPCI750.h
include/configs/CPCIISER4.h
include/configs/CPU86.h
include/configs/CPU87.h
include/configs/CRAYL1.h
include/configs/CU824.h
include/configs/DASA_SIM.h
include/configs/DB64360.h
include/configs/DB64460.h
include/configs/DK1C20.h
include/configs/DK1S10.h
include/configs/DP405.h
include/configs/DU405.h
include/configs/EB+MCF-EV123.h
include/configs/ELPPC.h
include/configs/ELPT860.h
include/configs/EP1C20.h
include/configs/EP1S10.h
include/configs/EP1S40.h
include/configs/EP88x.h
include/configs/ERIC.h
include/configs/ESTEEM192E.h
include/configs/ETX094.h
include/configs/EVB64260.h
include/configs/EXBITGEN.h
include/configs/FADS823.h
include/configs/FADS850SAR.h
include/configs/FLAGADM.h
include/configs/FPS850L.h
include/configs/FPS860L.h
include/configs/G2000.h
include/configs/GEN860T.h
include/configs/GENIETV.h
include/configs/GTH.h
include/configs/HH405.h
include/configs/HIDDEN_DRAGON.h
include/configs/HMI10.h
include/configs/HUB405.h
include/configs/IAD210.h
include/configs/ICU862.h
include/configs/IDS8247.h
include/configs/IP860.h
include/configs/IPHASE4539.h
include/configs/ISPAN.h
include/configs/IVML24.h
include/configs/IVMS8.h
include/configs/IceCube.h
include/configs/JSE.h
include/configs/KAREF.h
include/configs/KUP4K.h
include/configs/KUP4X.h
include/configs/LANTEC.h
include/configs/M5271EVB.h
include/configs/M5272C3.h
include/configs/M5282EVB.h
include/configs/MBX.h
include/configs/MBX860T.h
include/configs/METROBOX.h
include/configs/MHPC.h
include/configs/MIP405.h
include/configs/ML2.h
include/configs/MOUSSE.h
include/configs/MPC8260ADS.h
include/configs/MPC8266ADS.h
include/configs/MPC8313ERDB.h
include/configs/MPC832XEMDS.h
include/configs/MPC8349EMDS.h
include/configs/MPC8349ITX.h
include/configs/MPC8360EMDS.h
include/configs/MPC8540ADS.h
include/configs/MPC8540EVAL.h
include/configs/MPC8541CDS.h
include/configs/MPC8544DS.h
include/configs/MPC8548CDS.h
include/configs/MPC8555CDS.h
include/configs/MPC8560ADS.h
include/configs/MPC8568MDS.h
include/configs/MPC8641HPCN.h
include/configs/MUSENKI.h
include/configs/MVBLUE.h
include/configs/MVS1.h
include/configs/NC650.h
include/configs/NETPHONE.h
include/configs/NETTA.h
include/configs/NETTA2.h
include/configs/NETVIA.h
include/configs/NSCU.h
include/configs/NX823.h
include/configs/OCRTC.h
include/configs/ORSG.h
include/configs/OXC.h
include/configs/P3G4.h
include/configs/PATI.h
include/configs/PCI405.h
include/configs/PCI5441.h
include/configs/PCIPPC2.h
include/configs/PCIPPC6.h
include/configs/PIP405.h
include/configs/PK1C20.h
include/configs/PLU405.h
include/configs/PM520.h
include/configs/PM826.h
include/configs/PM828.h
include/configs/PM854.h
include/configs/PM856.h
include/configs/PMC405.h
include/configs/PN62.h
include/configs/PPChameleonEVB.h
include/configs/QS823.h
include/configs/QS850.h
include/configs/QS860T.h
include/configs/R360MPI.h
include/configs/RBC823.h
include/configs/RPXClassic.h
include/configs/RPXlite.h
include/configs/RPXlite_DW.h
include/configs/RPXsuper.h
include/configs/RRvision.h
include/configs/Rattler.h
include/configs/SBC8540.h
include/configs/SCM.h
include/configs/SL8245.h
include/configs/SM850.h
include/configs/SMN42.h [changed mode: 0755->0644]
include/configs/SPD823TS.h
include/configs/SX1.h
include/configs/SXNI855T.h
include/configs/Sandpoint8240.h
include/configs/Sandpoint8245.h
include/configs/TASREG.h
include/configs/TB5200.h
include/configs/TOP5200.h
include/configs/TOP860.h
include/configs/TQM5200.h
include/configs/TQM823L.h
include/configs/TQM823M.h
include/configs/TQM8260.h
include/configs/TQM8272.h
include/configs/TQM834x.h
include/configs/TQM850L.h
include/configs/TQM850M.h
include/configs/TQM855L.h
include/configs/TQM855M.h
include/configs/TQM85xx.h
include/configs/TQM860L.h
include/configs/TQM860M.h
include/configs/TQM862L.h
include/configs/TQM862M.h
include/configs/TQM866M.h
include/configs/TQM885D.h
include/configs/Total5200.h
include/configs/VCMA9.h
include/configs/VOH405.h
include/configs/VOM405.h
include/configs/VoVPN-GW.h
include/configs/W7OLMC.h
include/configs/W7OLMG.h
include/configs/WUH405.h
include/configs/XPEDITE1K.h
include/configs/Yukon8220.h
include/configs/ZPC1900.h
include/configs/ZUMA.h
include/configs/acadia.h
include/configs/adsvix.h
include/configs/aev.h
include/configs/alpr.h
include/configs/armadillo.h
include/configs/assabet.h
include/configs/at91rm9200dk.h
include/configs/atc.h
include/configs/atstk1002.h
include/configs/bamboo.h
include/configs/barco.h
include/configs/bf533-ezkit.h
include/configs/bf533-stamp.h
include/configs/bf537-stamp.h
include/configs/bf561-ezkit.h
include/configs/bubinga.h
include/configs/c2mon.h
include/configs/canmb.h
include/configs/cerf250.h
include/configs/cm1_qp1.h [deleted file]
include/configs/cm4008.h
include/configs/cm41xx.h
include/configs/cm5200.h [new file with mode: 0644]
include/configs/cmc_pu2.h
include/configs/cmi_mpc5xx.h
include/configs/cobra5272.h
include/configs/cogent_mpc8260.h
include/configs/cogent_mpc8xx.h
include/configs/cpci5200.h
include/configs/cradle.h
include/configs/csb226.h
include/configs/csb272.h
include/configs/csb472.h
include/configs/csb637.h
include/configs/dbau1x00.h
include/configs/debris.h
include/configs/delta.h
include/configs/dnp1110.h
include/configs/eXalion.h
include/configs/ebony.h
include/configs/ep7312.h
include/configs/ep8248.h
include/configs/ep8260.h
include/configs/ep82xxm.h
include/configs/evb4510.h
include/configs/gcplus.h
include/configs/gth2.h
include/configs/gw8260.h
include/configs/hermes.h
include/configs/hmi1001.h
include/configs/hymod.h
include/configs/idmr.h
include/configs/impa7.h
include/configs/incaip.h
include/configs/inka4x0.h
include/configs/innokom.h
include/configs/integratorap.h
include/configs/integratorcp.h
include/configs/ixdp425.h
include/configs/ixdpg425.h
include/configs/jupiter.h
include/configs/katmai.h
include/configs/kb9202.h
include/configs/kvme080.h
include/configs/lart.h
include/configs/logodl.h
include/configs/lpc2292sodimm.h [changed mode: 0755->0644]
include/configs/lpd7a400.h
include/configs/lpd7a404.h
include/configs/luan.h
include/configs/lubbock.h
include/configs/lwmon.h
include/configs/lwmon5.h
include/configs/mcc200.h
include/configs/mecp5200.h
include/configs/ml300.h
include/configs/ml401.h
include/configs/modnet50.h
include/configs/motionpro.h
include/configs/mp2usb.h
include/configs/mpc7448hpc2.h
include/configs/mx1ads.h
include/configs/mx1fs2.h
include/configs/netstar.h
include/configs/ns9750dev.h
include/configs/o2dnt.h
include/configs/ocotea.h
include/configs/omap1510inn.h
include/configs/omap1610h2.h
include/configs/omap1610inn.h
include/configs/omap2420h4.h
include/configs/omap5912osk.h
include/configs/omap730p2.h
include/configs/p3mx.h
include/configs/p3p440.h
include/configs/pb1x00.h
include/configs/pcs440ep.h
include/configs/pcu_e.h
include/configs/pdnb3.h
include/configs/pf5200.h
include/configs/pleb2.h
include/configs/ppmc7xx.h
include/configs/ppmc8260.h
include/configs/purple.h
include/configs/pxa255_idp.h
include/configs/quantum.h
include/configs/r5200.h
include/configs/rmu.h
include/configs/rsdproto.h
include/configs/sacsng.h
include/configs/sbc2410x.h
include/configs/sbc405.h
include/configs/sbc8240.h
include/configs/sbc8260.h
include/configs/sbc8349.h
include/configs/sbc8560.h
include/configs/sc3.h
include/configs/sc520_cdp.h
include/configs/sc520_spunk.h
include/configs/scb9328.h
include/configs/sequoia.h
include/configs/shannon.h
include/configs/smdk2400.h
include/configs/smdk2410.h
include/configs/smmaco4.h
include/configs/sorcery.h
include/configs/spc1920.h
include/configs/spieval.h
include/configs/stxgp3.h
include/configs/stxssa.h
include/configs/stxxtc.h
include/configs/suzaku.h
include/configs/svm_sc8xx.h
include/configs/taishan.h
include/configs/tb0229.h
include/configs/trab.h
include/configs/uc100.h
include/configs/uc101.h
include/configs/utx8245.h
include/configs/v37.h
include/configs/v38b.h
include/configs/versatile.h
include/configs/virtlab2.h
include/configs/voiceblue.h
include/configs/walnut.h
include/configs/wepep250.h
include/configs/xaeniax.h
include/configs/xm250.h
include/configs/xsengine.h
include/configs/xupv2p.h
include/configs/yosemite.h
include/configs/yucca.h
include/configs/zylonite.h
include/exports.h
include/lcd.h
include/mk48t59.h
include/net.h
include/pci.h
include/pcmcia.h
include/radeon.h [new file with mode: 0644]
lib_arm/board.c
lib_avr32/board.c
lib_blackfin/board.c
lib_generic/crc32.c
lib_i386/board.c
lib_m68k/board.c
lib_microblaze/board.c
lib_mips/board.c
lib_ppc/board.c
lib_ppc/kgdb.c
net/bootp.c
net/bootp.h
net/eth.c
net/net.c
net/nfs.c
net/rarp.c
net/sntp.c
net/tftp.c
rtc/bf5xx_rtc.c
rtc/date.c
rtc/ds12887.c
rtc/ds1302.c
rtc/ds1306.c
rtc/ds1307.c
rtc/ds1337.c
rtc/ds1374.c
rtc/ds1556.c
rtc/ds164x.c
rtc/ds174x.c
rtc/ds3231.c
rtc/m41t11.c
rtc/m48t35ax.c
rtc/max6900.c
rtc/mc146818.c
rtc/mk48t59.c
rtc/mpc5xxx.c
rtc/mpc8xx.c
rtc/pcf8563.c
rtc/rs5c372.c
rtc/s3c24x0_rtc.c
tools/updater/cmd_flash.c

index f8a04e6207eb921ba7e228ae76c74320ae518c90..996aedd81216cafb41e5ae0c9596c23e9c21d08c 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,75 @@
+commit 5728be389e65fd47f34b33c2596271eb4db751ae
+Author: Wolfgang Denk <wd@denx.de>
+Date:  Mon Aug 6 01:01:49 2007 +0200
+
+    Coding style cleanup. Update CHANGELOG.
+
+    Signed-off-by: Wolfgang Denk <wd@denx.de>
+
+commit 8092fef4c29b395958bb649647da7e3775731517
+Author: Martin Krause <Martin.Krause@tqs.de>
+Date:  Tue Dec 12 14:26:01 2006 +0100
+
+    Add functions to list of exported functions
+
+    Additionally export the following fuctions (to make trab_config build again):
+    - simple_strtol()
+    - strcmp()
+
+    Also bump the ABI version to reflect this change
+
+    Signed-off-by: Martin Krause <martin.krause@tqs.de>
+
+commit 63cec5814fab5d2b1c86982327433807a5ac0249
+Author: Ed Swarthout <Ed.Swarthout@freescale.com>
+Date:  Thu Aug 2 14:09:49 2007 -0500
+
+    Make MPC8641's PCI/PCI-E driver a common driver for many FSL parts.
+
+    All of the PCI/PCI-Express driver and initialization code that
+    was in the MPC8641HPCN port has now been moved into the common
+    drivers/fsl_pci_init.c.  In a subsequent patch, this will be
+    utilized by the 85xx ports as well.
+
+    Common PCI-E IMMAP register blocks for FSL 85xx/86xx are added.
+
+    Also enable the second PCI-Express controller on 8641
+    by getting its BATS and CFG_ setup right.
+
+    Fixed a u16 vendor compiler warning in AHCI driver too.
+
+    Signed-off-by: Ed Swarthout <Ed.Swarthout@freescale.com>
+    Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit c7e717ebc2b044d7a71062552c9dc0f54ea9b779
+Author: Andy Fleming <afleming@freescale.com>
+Date:  Fri Aug 3 04:05:25 2007 -0500
+
+    Add Marvell 1149 PHY support to the TSEC
+
+commit b1b54e352028ed370c3aa95d6fdeb9d64c5d2f86
+Author: Wolfgang Denk <wd@denx.de>
+Date:  Thu Aug 2 21:27:46 2007 +0200
+
+    Coding style cleanup, update CHANGELOG
+
+    Signed-off-by: Wolfgang Denk <wd@denx.de>
+
+commit 63e22764d2f8653f68888c667eb65b3996b52680
+Author: Wolfgang Denk <wd@denx.de>
+Date:  Thu Aug 2 10:11:18 2007 +0200
+
+    Minor cleanup of <board>_nand build rules.
+
+commit cdd917a43da6fa7fc8f54a3cc9f420ce5ecf3197
+Author: Wolfgang Denk <wd@denx.de>
+Date:  Thu Aug 2 00:48:45 2007 +0200
+
+    Fix build errors and warnings / code cleanup.
+
+    Signed-off-by: Wolfgang Denk <wd@denx.de>
+
 commit 8993e54b6f397973794f3d6f47d3b3c0c98dd4f6
 Author: Rafal Jaworowski <raj@semihalf.com>
 Date:  Fri Jul 27 14:43:59 2007 +0200
@@ -75,6 +147,154 @@ Date:      Thu Jul 12 01:45:34 2007 +0200
 
     Signed-off-by: Wolfgang Denk <wd@denx.de>
 
+commit 5a56af3b522ba47fb33a3fee84d23bf1e5429654
+Author: Andy Fleming <afleming@freescale.com>
+Date:  Fri Jun 8 16:41:18 2007 -0500
+
+    Remove erroneous errata code from Marvel 88E1111S driver
+
+    The Marvel 88E1111S driver for the TSEC was copied from the
+    88E1101 driver, and included a fix for an erratum which does not
+    exist on that part.  Now it is removed
+
+    Signed-off-by: Andy Fleming <afleming@freescale.com>
+
+commit 982efcf23fd03647e01e2fbe28a7a36239156cc0
+Author: Andy Fleming <afleming@freescale.com>
+Date:  Tue Jun 5 16:38:44 2007 -0500
+
+    From: eran liberty <eran.liberty@gmail.com>
+
+    adds the reset register to 85xx immap
+
+    Signed-off-by: Eran Liberty <eran.liberty@gmail.com>
+    Signed-off-by: Andy Fleming <afleming@freescale.com>
+
+commit d3ec0d943a045bdb99e159e7bbc77430e09f11d7
+Author: Andy Fleming <afleming@freescale.com>
+Date:  Thu May 10 17:50:01 2007 -0500
+
+    Polished the 85xx ADS config files
+
+    Made the boot commands use device trees by default.
+    Also moved the ramdisk to 1000000 (I think the previous address
+    was getting overridden during boot).
+
+    Signed-off-by: Andy Fleming <afleming@freescale.com>
+
+commit bfb37b32d1b0b03f18077dba49cc66a6e76fa038
+Author: Ed Swarthout <Ed.Swarthout@freescale.com>
+Date:  Wed May 9 11:03:32 2007 -0500
+
+    8544ds: Fix Makefile after moving pixis to board/freescale.
+
+    The OBJTREE != SRCTREE build scenario was broken.
+    This fixes it.
+
+    Signed-off-by: Ed Swarthout <Ed.Swarthout@freescale.com>
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 2a3cee43c3b71fa5b8d91db19f05067865290f3e
+Author: Andy Fleming <afleming@freescale.com>
+Date:  Wed May 9 00:54:20 2007 -0500
+
+    tsec: Fix PHY code to match first driver
+
+    Jarrold Wen noticed that the generic PHY code always matches
+    under the current implementation.  Change it so the first match
+    wins, and *only* unknown PHYs trigger the generic driver
+
+    Signed-off-by: Andy Fleming <afleming@freescale.com>
+
+commit ccc091aac61a38cd998d575d92f7232e256d6312
+Author: Andy Fleming <afleming@freescale.com>
+Date:  Tue May 8 17:27:43 2007 -0500
+
+    Add support for CPM device tree configuration to 8560 ADS
+
+    * Adds code to modify CPM frequencies
+    * Cleans up the config file to #define TSEC and (for now) #undef FCC
+    * Adds the MII command for all 8560 ADS configurations
+    * Updates config file to provide convenience commands for booting
+      with a device tree
+
+    Signed-off-by: Vitaly Bordug <vbordug@ru.mvista.com>
+    Signed-off-by: Andy Fleming <afleming@freescale.com>
+
+commit 7507d56ccaf7aae1c474342a9a5540165cd7e9d9
+Author: Andy Fleming <afleming@freescale.com>
+Date:  Tue May 8 17:23:02 2007 -0500
+
+    Fix Marvell 88e1145 PHY init code
+
+    Fix a bug in the Marvell 88e1145 PHY init code in the TSEC driver
+    where the reset was being done after the errata code instead of
+    before.
+
+    Signed-off-by: Haiying Wang <haiying.wang@freescale.com>
+    Signed-off-by: Andy Fleming <afleming@freescale.com>
+
+commit 5dc210dec5bace98a50b6ba905347890091a9bb0
+Author: Ed Swarthout <Ed.Swarthout@freescale.com>
+Date:  Wed Jul 11 14:52:16 2007 -0500
+
+    Add simple agent/end-point configuration in PCI AutoConfig for PCI_CLASS_PROCESSOR_POWERPC.
+
+    Signed-off-by: Ed Swarthout <Ed.Swarthout@freescale.com>
+
+commit e8b85f3ba4cd8930e0a2fea2100c815d64201765
+Author: Ed Swarthout <Ed.Swarthout@freescale.com>
+Date:  Wed Jul 11 14:52:08 2007 -0500
+
+    pciauto setup bridge
+
+    The P2P bridge bus numbers programmed into the device are relative to
+    hose->first_busno.
+
+    Signed-off-by: Ed Swarthout <Ed.Swarthout@freescale.com>
+
+commit 571f49fa717004ca4268b4e24057efc7bf9f987b
+Author: Ed Swarthout <Ed.Swarthout@freescale.com>
+Date:  Wed Jul 11 14:52:01 2007 -0500
+
+    Support PCIe extended config registers
+
+    FSL PCIe block has extended cfg registers in the 100 and 400 range.
+    For example, to read the LTSSM register: pci display <busn>.0 404 1
+
+    Signed-off-by: Ed Swarthout <Ed.Swarthout@freescale.com>
+
+commit ba5feb12581bb2912ce301e4866b71f846e9fc07
+Author: Ed Swarthout <Ed.Swarthout@freescale.com>
+Date:  Wed Jul 11 14:51:48 2007 -0500
+
+    Minor improvements to drivers/pci_auto.c
+
+    - Make pciauto_{pre,post}scan_setup_bridge non-static
+    - Added physical address display in debug messages.
+
+    Signed-off-by: Ed Swarthout <Ed.Swarthout@freescale.com>
+
+commit 40e81addab7bb74d20ddf681ce9babc880a828ee
+Author: Ed Swarthout <Ed.Swarthout@freescale.com>
+Date:  Wed Jul 11 14:51:35 2007 -0500
+
+    Start pci hose scan from hose->current_busno.
+
+    Ensure hose->current_busno is not less than first_busno.  This fixes
+    broken board code which leaves current_busno=0 when first_busno is
+    greater than 0 for the cases with multiple controllers.
+
+    Signed-off-by: Ed Swarthout <Ed.Swarthout@freescale.com>
+
+commit 3865b1fb7843a08ad49a6319a36415752276ff48
+Author: Stefan Roese <sr@denx.de>
+Date:  Wed Jul 11 12:13:53 2007 +0200
+
+    Fix some compile problems introduced by the latest CFG_CMD_xxx cleanup
+
+    Signed-off-by: Stefan Roese <sr@denx.de>
+
 commit fa1df308926a6f70e3504c57514ef27ac31fd13a
 Author: Bartlomiej Sieka <tur@semihalf.com>
 Date:  Wed Jul 11 20:11:07 2007 +0200
@@ -95,51 +315,1434 @@ Date:    Wed Jul 11 18:39:11 2007 +0200
 
     Signed-off-by: Heiko Schocher <hs@denx.de>
 
-commit 4ef218f6fdf8d747f4589da5252b004e7d2c2876
-Author: Wolfgang Denk <wd@denx.de>
-Date:  Tue Jul 10 00:01:28 2007 +0200
+commit e9514751cfa5cce61ea699fa0d3eb37898a5eeb5
+Author: Stefan Roese <sr@denx.de>
+Date:  Sun Jul 8 13:44:27 2007 +0200
 
-    Coding style cleanup; update CHANGELOG.
+    Fix malloc problem introduced with the relocation fixup for the PPC platform
 
-    Signed-off-by: Wolfgang Denk <wd@denx.de>
+    The relocation fixup didn't handle the malloc pointer initialization
+    correctly. This patch fixes this problem. Tested successfully on 4xx.
+    The relocation fixup patches for 4xx will follow soon.
 
-commit f1152f8c28db4a22087c21c618a3f7baa48e9a4f
-Author: Wolfgang Denk <wd@denx.de>
-Date:  Fri Jul 6 02:50:19 2007 +0200
+    Signed-off-by: Stefan Roese <sr@denx.de>
 
-    Code cleanup and default config update for STC GP3 SSA board.
+commit b3aff0cb9ecf236d7e8c93761dd1dadf6837a582
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Tue Jul 10 11:19:50 2007 -0500
 
-    Signed-off-by: Wolfgang Denk <wd@denx.de>
+    disk/ doc/ lib_*/ and tools/: Remove lingering references to CFG_CMD_* symbols.
 
-commit b44896215a09c60fa40cae906f7ed207bbc2c492
-Author: Sergei Poselenov <sposelenov@emcraft.com>
-Date:  Thu Jul 5 08:17:37 2007 +0200
+    Fixed some broken instances of "#ifdef CMD_CFG_IDE" too.
+    Those always evaluated TRUE, and thus were always compiled
+    even when IDE really wasn't defined/wanted.
 
-    Merged POST framework with the current TOT.
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
 
-    Signed-off-by: Sergei Poselenov <sposelenov@emcraft.com>
+commit ddb5d86f0215bcb6c293510c50eb050e92883b7a
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Tue Jul 10 11:13:21 2007 -0500
 
-commit f780b83316d9af1f61d71cc88b1917b387b9b995
-Author: Niklaus Giger <niklausgiger@gmx.ch>
-Date:  Wed Jun 27 18:11:38 2007 +0200
+    drivers/: Remove lingering references to CFG_CMD_* symbols.
 
-    resubmit: ppc4xx: Remove sequoia/sequioa.h. Cleanup ppc440.h for PPC440EPX
+    Fixed some broken instances of "#ifdef CMD_CFG_IDE" too.
+    Those always evaluated TRUE, and thus were always compiled
+    even when IDE really wasn't defined/wanted.
 
-    Signed-off-by: Niklaus Giger <niklaus.giger@nestal.com>
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
 
-commit 04e6c38b766eaa2f3287561563c9e215e0c3a0d4
-Author: Stefan Roese <sr@denx.de>
-Date:  Wed Jul 4 10:06:30 2007 +0200
+commit f40a7f3e3888b42a43674b099e5470022c8c544c
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Tue Jul 10 11:07:56 2007 -0500
 
-    ppc4xx: Update lwmon5 board
+    fs/: Remove lingering references to CFG_CMD_* symbols.
 
-    - Add optional ECC generation routine to preserve existing
-      RAM values. This is needed for the Linux log-buffer support
-    - Add optional DDR2 setup with CL=4
-    - GPIO50 not used anymore
-    - Lime register setup added
+    Fixed some broken instances of "#ifdef CMD_CFG_IDE" too.
+    Those always evaluated TRUE, and thus were always compiled
+    even when IDE really wasn't defined/wanted.
 
-    Signed-off-by: Stefan Roese <sr@denx.de>
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 610f2e9c28a9c101e09fa1b78143cf5f00ed1593
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Tue Jul 10 11:05:02 2007 -0500
+
+    net/: Remove lingering references to CFG_CMD_* symbols.
+
+    Fixed some broken instances of "#ifdef CMD_CFG_IDE" too.
+    Those always evaluated TRUE, and thus were always compiled
+    even when IDE really wasn't defined/wanted.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 902531788376046da212afd1661cffb62f3daa1c
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Tue Jul 10 11:02:44 2007 -0500
+
+    common/: Remove lingering references to CFG_CMD_* symbols.
+
+    Fixed some broken instances of "#ifdef CMD_CFG_IDE" too.
+    Those always evaluated TRUE, and thus were always compiled
+    even when IDE really wasn't defined/wanted.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit d39b57415838c73fb0a37eca84de3c68ba990586
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Tue Jul 10 10:48:22 2007 -0500
+
+    board/[j-z]*: Remove lingering references to CFG_CMD_* symbols.
+
+    Fixed some broken instances of "#ifdef CMD_CFG_IDE" too.
+    Those always evaluated TRUE, and thus were always compiled
+    even when IDE really wasn't defined/wanted.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 77a318545d57aefa844752465b94c7e09a3f26d0
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Tue Jul 10 10:39:10 2007 -0500
+
+    board/[A-Za-i]*: Remove lingering references to CFG_CMD_* symbols.
+
+    Fixed some broken instances of "#ifdef CMD_CFG_IDE" too.
+    Those always evaluated TRUE, and thus were always compiled
+    even when IDE really wasn't defined/wanted.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 068b60a0eb7e73b243ca55399f2a7df76e2c3f3d
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Tue Jul 10 10:27:39 2007 -0500
+
+    cpu/ rtc/ include/: Remove lingering references to CFG_CMD_* symbols.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 079a136c3588814784561d6e4856970ee82d6e2a
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Tue Jul 10 10:12:10 2007 -0500
+
+    include/configs/[p-z]* + misc: Cleanup BOOTP and lingering CFG_CMD_*.
+
+    Explicitly add in default CONFIG_BOOTP_* options where cmd_confdefs.h
+    used to be included but CONFIG_BOOTP_MASK was not defined.
+
+    Remove lingering references to CFG_CMD_* symbols.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 7f5c01577400c74cc5bac74f41dd0d3c79df623c
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Tue Jul 10 09:38:02 2007 -0500
+
+    include/configs/[g-o]*: Cleanup BOOTP and lingering CFG_CMD_*.
+
+    Explicitly add in default CONFIG_BOOTP_* options where cmd_confdefs.h
+    used to be included but CONFIG_BOOTP_MASK was not defined.
+
+    Remove lingering references to CFG_CMD_* symbols.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 80ff4f99b84b64edca3fd10da365ec1493be1c95
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Tue Jul 10 09:29:01 2007 -0500
+
+    include/configs/[a-e]*: Cleanup BOOTP and lingering CFG_CMD_*.
+
+    Explicitly add in default CONFIG_BOOTP_* options where cmd_confdefs.h
+    used to be included but CONFIG_BOOTP_MASK was not defined.
+
+    Remove lingering references to CFG_CMD_* symbols.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit a1aa0bb502e25fd598b5e0ccdfb2c174921d714a
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Tue Jul 10 09:22:23 2007 -0500
+
+    include/configs/[P-Z]*: Cleanup BOOTP and lingering CFG_CMD_*.
+
+    Explicitly add in default CONFIG_BOOTP_* options where cmd_confdefs.h
+    used to be included but CONFIG_BOOTP_MASK was not defined.
+
+    Remove lingering references to CFG_CMD_* symbols.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 659e2f6736232a08acca8785c206e2b4d9cd07d7
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Tue Jul 10 09:10:49 2007 -0500
+
+    include/configs/[J-O]*: Cleanup BOOTP and lingering CFG_CMD_*.
+
+    Explicitly add in default CONFIG_BOOTP_* options where cmd_confdefs.h
+    used to be included but CONFIG_BOOTP_MASK was not defined.
+
+    Remove lingering references to CFG_CMD_* symbols.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 11799434c5ff15a612577bb1ad1f4ea1a0595e4b
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Tue Jul 10 09:02:57 2007 -0500
+
+    include/configs/[A-I]*: Cleanup BOOTP and lingering CFG_CMD_*.
+
+    Explicitly add in default CONFIG_BOOTP_* options where cmd_confdefs.h
+    used to be included but CONFIG_BOOTP_MASK was not defined.
+
+    Remove lingering references to CFG_CMD_* symbols.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 1fe80d79c5c4e52d3410a7ab4b8515da095cdab3
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Mon Jul 9 22:08:34 2007 -0500
+
+    Finally retire cmd_confdefs.h and CONFIG_BOOTP_MASK!
+
+    All of the choices for CONFIG_BOOTP_ are now documented in
+    the README file.  You must now individually select exactly
+    the set that you want using a series of
+       #define CONFIG_BOOTP_<x>
+    statements in the board port config files now.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit d3b8c1a743dcd31625c99e6a44590f207eb00028
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Mon Jul 9 21:57:31 2007 -0500
+
+    include/configs/[m-z]*: Directly use CONFIG_BOOTP_* symbols rather than CONFIG_BOOTP_MASK.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 2fd90ce575b02d189cbf443c85309bcd001aa393
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Mon Jul 9 21:48:26 2007 -0500
+
+    include/configs/[a-m]*: Directly use CONFIG_BOOTP_* symbols rather than CONFIG_BOOTP_MASK.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 37d4bb70586659dedef1658ce1bed071be098aec
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Mon Jul 9 21:38:02 2007 -0500
+
+    include/configs/[T-Z]*: Directly use CONFIG_BOOTP_* symbols rather than CONFIG_BOOTP_MASK.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 18225e8dd1950bd6dbf35011e436db7f474c187d
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Mon Jul 9 21:31:24 2007 -0500
+
+    include/configs/[P-S]*: Directly use CONFIG_BOOTP_* symbols rather than CONFIG_BOOTP_MASK.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 7be044e4ea644b0ef1c486dadc1a4c2665b4374d
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Mon Jul 9 21:24:19 2007 -0500
+
+    include/configs/[H-N]*: Directly use CONFIG_BOOTP_* symbols rather than CONFIG_BOOTP_MASK.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 5d2ebe1b3ef0055c661bb1a0d252bf252380069f
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Mon Jul 9 21:16:53 2007 -0500
+
+    include/configs/[A-G]*: Directly use CONFIG_BOOTP_* symbols rather than CONFIG_BOOTP_MASK.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit f55f7f8d83f36021ab1f0e3d738f5d8c8083a7e3
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Mon Jul 9 19:12:30 2007 -0500
+
+    Retire CONFIG_COMMANDS finally.
+    Strip old CFG_CMD_* symbols out.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit b5501f7d720fed99ab0b42c83f5dea52868ce007
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Mon Jul 9 19:10:03 2007 -0500
+
+    Update README.* to reference new CONFIG_CMD_* names now.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 4431283c7e6d54ae180d466e51bf2d97471a0ad9
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Mon Jul 9 19:06:00 2007 -0500
+
+    cpu/m*: Remove obsolete references to CONFIG_COMMANDS
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 3a1ed1e1f922c419bb71f7df4949d783ade369fa
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Mon Jul 9 18:57:22 2007 -0500
+
+    cpu/[7a-ln-z]*: Remove obsolete references to CONFIG_COMMANDS
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit ab3abcbabd840928fb1eb5122118ca466b5e5013
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Mon Jul 9 18:45:16 2007 -0500
+
+    board/[q-z]*: Remove obsolete references to CONFIG_COMMANDS
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 3fe00109a5f12de55b6e25b1f98dfc24bc9090c9
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Mon Jul 9 18:38:39 2007 -0500
+
+    board/[m-p]*: Remove obsolete references to CONFIG_COMMANDS
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit c508a4cefd8a953fc64957650506a035e6e3d9d1
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Mon Jul 9 18:31:28 2007 -0500
+
+    board/[f-l]*: Remove obsolete references to CONFIG_COMMANDS
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit b9307262f8a9f3b5c9e15a6067eadc17407146f6
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Mon Jul 9 18:24:55 2007 -0500
+
+    board/[d-e]*: Remove obsolete references to CONFIG_COMMANDS
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit fcec2eb93e126400009729328e797f12bc94f1fd
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Mon Jul 9 18:19:09 2007 -0500
+
+    board/[A-Za-c]*: Remove obsolete references to CONFIG_COMMANDS
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit a593814f2be0c9cdc3133cd550b167b8a988328f
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Mon Jul 9 18:10:50 2007 -0500
+
+    rtc/: Remove obsolete references to CONFIG_COMMANDS
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 67350568f9d46e66c21829f3513b3db0caeb948b
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Mon Jul 9 18:05:38 2007 -0500
+
+    lib_{arm,avr32,blackfin,generic,i386}/: Remove obsolete references to CONFIG_COMMANDS
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 7def6b34f910f08d7ef0a14646da067719237ca2
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Mon Jul 9 18:02:11 2007 -0500
+
+    lib_{m68k,microblaze,mips,ppc}/: Remove obsolete references to CONFIG_COMMANDS
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit dd60d1223b99a88a7216f3e041fe40634ad4c2bb
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Mon Jul 9 17:56:50 2007 -0500
+
+    fs/: Remove obsolete references to CONFIG_COMMANDS
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit c91898bbc505aff3e12a807af88e76da18efb7ee
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Mon Jul 9 17:46:09 2007 -0500
+
+    tools/: Remove obsolete references to CONFIG_COMMANDS
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 643d1ab23960950b52e0a2803c2d3ea4c558fa01
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Mon Jul 9 17:45:14 2007 -0500
+
+    net/: Remove obsolete references to CONFIG_COMMANDS
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit cb51c0bf88f95a1bca68324b0126f8eed8b43273
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Mon Jul 9 17:39:42 2007 -0500
+
+    drivers/[n-z]*: Remove obsolete references to CONFIG_COMMANDS
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 07d38a17e964aec4c7827f0ee9a583bc8cc1ad6b
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Mon Jul 9 17:30:01 2007 -0500
+
+    drivers/[a-m]*: Remove obsolete references to CONFIG_COMMANDS
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit cde5c64d17cf4834aa7b5c373f288bc7dad27b29
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Mon Jul 9 17:22:37 2007 -0500
+
+    disk/: Remove obsolete references to CONFIG_COMMANDS
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 639221c76c88215bd55af83ad174fc30d1940f8f
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Mon Jul 9 17:15:49 2007 -0500
+
+    include/: Remove obsolete references to CONFIG_COMMANDS
+    Mostly removed from comments here.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 4ef218f6fdf8d747f4589da5252b004e7d2c2876
+Author: Wolfgang Denk <wd@denx.de>
+Date:  Tue Jul 10 00:01:28 2007 +0200
+
+    Coding style cleanup; update CHANGELOG.
+
+    Signed-off-by: Wolfgang Denk <wd@denx.de>
+
+commit c3517f919d0f61650cf3027fd4faf0f631142f6c
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Sun Jul 8 18:10:08 2007 -0500
+
+    common/* non-cmd*: Remove obsolete references to CONFIG_COMMANDS
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit fd9bcaa35be64fe41a4223fdb6ecdbad52470b39
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Sun Jul 8 18:05:39 2007 -0500
+
+    common/cmd_[p-x]*: Remove obsolete references to CONFIG_COMMANDS.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit c76fe47425afc7d5d670ff0539823c85d65d9c42
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Sun Jul 8 18:02:23 2007 -0500
+
+    common/cmd_[i-n]*: Remove obsolete references to CONFIG_COMMANDS.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit baa26db4113679b80970ff447d91cc10217742a6
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Sun Jul 8 17:51:39 2007 -0500
+
+    common/cmd_[af]*: Remove obsolete references to CONFIG_COMMANDS.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit af075ee96e52dda7b6bca6c937588aeaaec5f2cd
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Sun Jul 8 17:02:01 2007 -0500
+
+    Clear up confusion over the CMD_POST and POST_DIAG mess.
+
+    For some reason, CONFIG_POST permeated as CONFIG_CMD_POST_DIAG
+    when it really means just CONFIG_CMD_DIAG. There is no CMD_POST.
+    Clear this mess up some.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit b3631487105a57ab7cbadfc26efbaf9676275018
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Sun Jul 8 15:45:08 2007 -0500
+
+    Remove references to the old cmd_confdefs.h include file.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit a22d4da95e20049b4daa1c2a022f61e8a72f2fb6
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Sun Jul 8 15:42:59 2007 -0500
+
+    include/configs: Catch some CONFIG_CMD_* conversion stragglers.
+
+    Use new CONFIG_CMD_* in lwmon5.h board config file.
+    Fix CONFIG_CMD_* typo braindamage in omap1510inn.h
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit a5562901661bd428f7e5feb333f796372cb81019
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Sun Jul 8 15:31:57 2007 -0500
+
+    include/configs: Use new CONFIG_CMD_* in various [TUVWZYZ]* named board config files.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit fe7f782d5b8c64a0195c68c31a0a11d4f641355e
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Sun Jul 8 15:02:44 2007 -0500
+
+    include/configs: Use new CONFIG_CMD_* in various S* named board config files.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit e9a0f8f15c11f337967aa0600ad6e8af33037f50
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Sun Jul 8 15:12:40 2007 -0500
+
+    include/configs: Use new CONFIG_CMD_* in various R* named board config files.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 12aa9fd23d724bd6ab88e1baa0db35133a27303f
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Sun Jul 8 14:55:07 2007 -0500
+
+    include/configs: Use new CONFIG_CMD_* in various Q* named board config files.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit acf0269779422f3e147d2ddfb499c9f6ff10ad5e
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Sun Jul 8 14:49:44 2007 -0500
+
+    include/configs: Use new CONFIG_CMD_* in various P* named board config files.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit e18a1061a8630cb67995fdf99afd3fb50d1b187d
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Sun Jul 8 14:21:43 2007 -0500
+
+    include/configs: Use new CONFIG_CMD_* in various [NO]* named board config files.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 8353e139bfad9059c54f5b2421f1a3090e15a2e2
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Sun Jul 8 14:14:17 2007 -0500
+
+    include/configs: Use new CONFIG_CMD_* in various M* named board config files.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 348f258f24253433e4a2302a0bbceb6740a67246
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Sun Jul 8 13:46:18 2007 -0500
+
+    include/configs: Use new CONFIG_CMD_* in various [IJKL]* named board config files.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 6c4f4da9bfc9f9403f54fce678ed0364b7c86a6a
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Sun Jul 8 10:09:35 2007 -0500
+
+    include/configs: Use new CONFIG_CMD_* in various H* named board config files.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 60a0876b5106b34220e459c208bbf648073306c0
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Sat Jul 7 21:04:26 2007 -0500
+
+    include/configs: Use new CONFIG_CMD_* in various F* and G* named board config files.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit dcaa71562826a2466e894c868d132509dcda8444
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Sat Jul 7 20:56:05 2007 -0500
+
+    include/configs: Use new CONFIG_CMD_* in various E* named board config files.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 3c3227f3c737502311b25b72084573901cbbf17d
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Sat Jul 7 20:40:43 2007 -0500
+
+    include/configs: Use new CONFIG_CMD_* in various D* named board config files.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 49cf7e8ee7ef943fdfe866ce28410b0bfbf6a26c
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Thu Jul 5 19:52:35 2007 -0500
+
+    include/configs: Use new CONFIG_CMD_* in various C* named board config files.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit de8b2a6e33298dcdb10bdda48db25e53c3089eba
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Thu Jul 5 19:32:07 2007 -0500
+
+    include/configs: Use new CONFIG_CMD_* in various B* named board config files.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 498ff9a228485bd4b9f23d066bada268f9add1dd
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Thu Jul 5 19:13:52 2007 -0500
+
+    include/configs: Use new CONFIG_CMD_* in various A* named board config files.
+
+    Since ADS860.h includes "board/fads/fads.h" with ramifications
+    on the CONFIG_COMMAND treatment, it too has to be adjusted to
+    exclude already configured commands in this same commit.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 6b0a174a1e6f55e1f5a1fbb223cdad7645a4646e
+Author: Stefan Roese <sr@denx.de>
+Date:  Fri Jul 6 09:45:47 2007 +0200
+
+    Fix problem with get/setdcr commands introduced by cfg patches
+
+    Signed-off-by: Stefan Roese <sr@denx.de>
+
+commit f1152f8c28db4a22087c21c618a3f7baa48e9a4f
+Author: Wolfgang Denk <wd@denx.de>
+Date:  Fri Jul 6 02:50:19 2007 +0200
+
+    Code cleanup and default config update for STC GP3 SSA board.
+
+    Signed-off-by: Wolfgang Denk <wd@denx.de>
+
+commit e4dbe1b215f5c6c462e76909d240bd96472b84de
+Author: Wolfgang Denk <wd@denx.de>
+Date:  Thu Jul 5 17:56:27 2007 +0200
+
+    Fixing some typos etc. introduced mainly by cfg patches.
+
+    Signed-off-by: Wolfgang Denk <wd@denx.de>
+
+commit b6b4684546809f89c8bac72863ca49b5fd8ac0cd
+Author: Wolfgang Denk <wd@denx.de>
+Date:  Thu Jul 5 11:12:16 2007 +0200
+
+    Minor coding style cleanup. Update CHANGELOG.
+
+commit dca3b3d6d6396b67e5e84af53452164923c73443
+Author: Jon Loeliger <jdl@jdl.com>
+Date:  Wed Jul 4 22:33:46 2007 -0500
+
+    include/configs: Use new CONFIG_CMD_* in various [v-z]* named board config files.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 6c18eb9804b525f3e4f3bb3d014dd69a200d9fa7
+Author: Jon Loeliger <jdl@jdl.com>
+Date:  Wed Jul 4 22:33:38 2007 -0500
+
+    include/configs: Use new CONFIG_CMD_* in various t* and u* named board config files.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 46da1e96b7db14f4fcd2c92544e7c0862024bc76
+Author: Jon Loeliger <jdl@jdl.com>
+Date:  Wed Jul 4 22:33:30 2007 -0500
+
+    include/configs: Use new CONFIG_CMD_* in various s* named board config files.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 90cc3eb6d2be856d9ddd81436de9cf343bc6b5c8
+Author: Jon Loeliger <jdl@jdl.com>
+Date:  Wed Jul 4 22:33:23 2007 -0500
+
+    include/configs: Use new CONFIG_CMD_* in various q* and r* named board config files.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 26a34560d56a9df5bc2ae23525d9229736134757
+Author: Jon Loeliger <jdl@jdl.com>
+Date:  Wed Jul 4 22:33:17 2007 -0500
+
+    include/configs: Use new CONFIG_CMD_* in various p* named board config files.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit a5cb23092a7d31490a33d4ec871468b63babfa3c
+Author: Jon Loeliger <jdl@jdl.com>
+Date:  Wed Jul 4 22:33:13 2007 -0500
+
+    include/configs: Use new CONFIG_CMD_* in various o* named board config files.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 929a2bfd142737003a8fc32e1b86e1f2c1850257
+Author: Jon Loeliger <jdl@jdl.com>
+Date:  Wed Jul 4 22:33:07 2007 -0500
+
+    include/configs: Use new CONFIG_CMD_* in various n* named board config files.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 5dc11a511960d490f7f01ffd746edfe6277f99b0
+Author: Jon Loeliger <jdl@jdl.com>
+Date:  Wed Jul 4 22:33:01 2007 -0500
+
+    include/configs: Use new CONFIG_CMD_* in various m* named board config files.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 9bbb1c0820c1fbd3811ab6ee4ba0f6c6f76b27e4
+Author: Jon Loeliger <jdl@jdl.com>
+Date:  Wed Jul 4 22:32:57 2007 -0500
+
+    include/configs: Use new CONFIG_CMD_* in various l* named board config files.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit bc234c129fa04fb9fa33530930e5cbc6084cd47a
+Author: Jon Loeliger <jdl@jdl.com>
+Date:  Wed Jul 4 22:32:51 2007 -0500
+
+    include/configs: Use new CONFIG_CMD_* in various j* and k* named board config files.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 1d2c6bc491969f8d8fb34c8e30e8bea7a2af9c31
+Author: Jon Loeliger <jdl@jdl.com>
+Date:  Wed Jul 4 22:32:32 2007 -0500
+
+    include/configs: Use new CONFIG_CMD_* in various i* named board config files.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 48d5d102a2f2e619c92050b9aedbb69689185bc0
+Author: Jon Loeliger <jdl@jdl.com>
+Date:  Wed Jul 4 22:32:25 2007 -0500
+
+    include/configs: Use new CONFIG_CMD_* in various h* named board config files.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 72eb0efaed7048afcc61fc6f0085c49394b5dc36
+Author: Jon Loeliger <jdl@jdl.com>
+Date:  Wed Jul 4 22:32:19 2007 -0500
+
+    include/configs: Use new CONFIG_CMD_* in various g* named board config files.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 1bec3d3002d3bbbae6f2468a0f7376db1120d33e
+Author: Jon Loeliger <jdl@jdl.com>
+Date:  Wed Jul 4 22:32:10 2007 -0500
+
+    include/configs: Use new CONFIG_CMD_* in various e* named board config files.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit ab999ba1b31ebe78dd16374394a55d7c6e5aa6e4
+Author: Jon Loeliger <jdl@jdl.com>
+Date:  Wed Jul 4 22:32:03 2007 -0500
+
+    include/configs: Use new CONFIG_CMD_* in various d* named board config files.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 37e4f24b87fa255ae456d193b7cd23c18dd1d56b
+Author: Jon Loeliger <jdl@jdl.com>
+Date:  Wed Jul 4 22:31:56 2007 -0500
+
+    include/configs: Use new CONFIG_CMD_* in various c* named board config files.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit ba2351f9d1e841bd00ea6dad1e3c16d0259ad264
+Author: Jon Loeliger <jdl@jdl.com>
+Date:  Wed Jul 4 22:31:49 2007 -0500
+
+    include/configs: Use new CONFIG_CMD_* in various b* named board config files.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 0b361c916617aff79e647b40f0e43361e0bbaccf
+Author: Jon Loeliger <jdl@jdl.com>
+Date:  Wed Jul 4 22:31:42 2007 -0500
+
+    include/configs: Use new CONFIG_CMD_* in various a* named board config files.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit b730cda82e362df6a22f4c59c0a9b97e885b1014
+Author: Jon Loeliger <jdl@jdl.com>
+Date:  Wed Jul 4 22:31:35 2007 -0500
+
+    include/configs: Use new CONFIG_CMD_* in mpc5xx board config files.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit d794cfefead5fc177cf4f41164e80382e9c9484a
+Author: Jon Loeliger <jdl@jdl.com>
+Date:  Wed Jul 4 22:31:15 2007 -0500
+
+    include/configs: Use new CONFIG_CMD_* in various 5200 board config files.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit ef0df52ab49eea4a30c15087fd27d54c1d946f2c
+Author: Jon Loeliger <jdl@jdl.com>
+Date:  Wed Jul 4 22:31:07 2007 -0500
+
+    include/configs: Use new CONFIG_CMD_* in STx board config files.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 866e3089bfc826bb4dc74637f8aad87a3bab79fc
+Author: Jon Loeliger <jdl@jdl.com>
+Date:  Wed Jul 4 22:30:58 2007 -0500
+
+    include/configs: Use new CONFIG_CMD_* in sbc* board config files.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 2694690e285acaa34922f55f4b5ae030da60c55a
+Author: Jon Loeliger <jdl@jdl.com>
+Date:  Wed Jul 4 22:30:50 2007 -0500
+
+    include/configs: Use new CONFIG_CMD_* in TQM board config files.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 1cc4c458329765b58e584a19821e796b3c10e976
+Author: Jon Loeliger <jdl@jdl.com>
+Date:  Wed Jul 4 22:30:28 2007 -0500
+
+    include/configs: Use new CONFIG_CMD_* in 82xx board config files.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 8ea5499afdaba0acf60923dd99001c399d4a7c8e
+Author: Jon Loeliger <jdl@jdl.com>
+Date:  Wed Jul 4 22:30:06 2007 -0500
+
+    include/configs: Use new CONFIG_CMD_* in 83xx board config files.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit b44896215a09c60fa40cae906f7ed207bbc2c492
+Author: Sergei Poselenov <sposelenov@emcraft.com>
+Date:  Thu Jul 5 08:17:37 2007 +0200
+
+    Merged POST framework with the current TOT.
+
+    Signed-off-by: Sergei Poselenov <sposelenov@emcraft.com>
+
+commit b24629fa377214d63bb40d1360e354b6d3e4af56
+Author: Jon Loeliger <jdl@jdl.com>
+Date:  Wed Jun 13 13:23:15 2007 -0500
+
+    mpc86xx: Remove old CFG_CMD_* references.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 46175d9764da129bb4fd341cd2554dc7d55f5b2a
+Author: Jon Loeliger <jdl@jdl.com>
+Date:  Wed Jun 13 13:22:54 2007 -0500
+
+    Add MPC8568MDS to MAKEALL 85xx target.
+
+    It was missing from the original port submission.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 2835e518c969e5124ba1174eef3e8375e12fa7d5
+Author: Jon Loeliger <jdl@jdl.com>
+Date:  Wed Jun 13 13:22:08 2007 -0500
+
+    include/configs: Use new CONFIG_CMD_* in 85xx board config files.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 56b304ac2091689506088a9ae67f63fd6300cf16
+Author: Jon Loeliger <jdl@jdl.com>
+Date:  Wed Jun 13 13:21:37 2007 -0500
+
+    Fix #if typo in CONFIG_CMD_* changes.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit f780b83316d9af1f61d71cc88b1917b387b9b995
+Author: Niklaus Giger <niklausgiger@gmx.ch>
+Date:  Wed Jun 27 18:11:38 2007 +0200
+
+    resubmit: ppc4xx: Remove sequoia/sequioa.h. Cleanup ppc440.h for PPC440EPX
+
+    Signed-off-by: Niklaus Giger <niklaus.giger@nestal.com>
+
+commit 04e6c38b766eaa2f3287561563c9e215e0c3a0d4
+Author: Stefan Roese <sr@denx.de>
+Date:  Wed Jul 4 10:06:30 2007 +0200
+
+    ppc4xx: Update lwmon5 board
+
+    - Add optional ECC generation routine to preserve existing
+      RAM values. This is needed for the Linux log-buffer support
+    - Add optional DDR2 setup with CL=4
+    - GPIO50 not used anymore
+    - Lime register setup added
+
+    Signed-off-by: Stefan Roese <sr@denx.de>
+
+commit 6810a34677dbc446334f5e451f1682426dd33b49
+Author: Grant Likely <grant.likely@secretlab.ca>
+Date:  Tue Jul 3 00:17:28 2007 -0600
+
+    Fix Makefile to use $(MKCONFIG) macro for all board ports
+
+    Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
+
+commit 90b1b2d69b9396ff2f01165ebc16c9a594eb5926
+Author: Grant Likely <grant.likely@secretlab.ca>
+Date:  Tue Jul 3 00:17:28 2007 -0600
+
+    Fix Makefile to use $(MKCONFIG) macro for all board ports
+
+    Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
+
+commit 057004f4a4863554d56cc56268bfa7c7d9738e27
+Author: Grant Likely <grant.likely@secretlab.ca>
+Date:  Tue Jul 3 00:34:49 2007 -0600
+
+    Correct fixup relocation for mpc83xx
+
+    Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
+
+commit 5af61b2f4b838a05f79be274f3e5a66edd2d9c96
+Author: Grant Likely <grant.likely@secretlab.ca>
+Date:  Tue Jul 3 00:34:44 2007 -0600
+
+    Correct fixup relocation for mpc8260
+
+    Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
+
+commit f3a52fe05923935db86985daf9438e2f70ac39aa
+Author: Grant Likely <grant.likely@secretlab.ca>
+Date:  Tue Jul 3 00:34:39 2007 -0600
+
+    Correct fixup relocation for mpc824x
+
+    Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
+
+commit a85dd254c0577fca13627c46e93fc2ad4c4f1f00
+Author: Grant Likely <grant.likely@secretlab.ca>
+Date:  Tue Jul 3 00:34:34 2007 -0600
+
+    Correct fixup relocation for mpc8220
+
+    Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
+
+commit 6f7576b20ecf0d040c3ac3b032b5cbc860e38a90
+Author: Grant Likely <grant.likely@secretlab.ca>
+Date:  Tue Jul 3 00:34:29 2007 -0600
+
+    Correct fixup relocation for MPC5xxx
+
+    Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
+
+commit 3649cd99ba815b6601868735765602f00ef3692b
+Author: Grant Likely <grant.likely@secretlab.ca>
+Date:  Tue Jul 3 00:34:24 2007 -0600
+
+    Correct relocation fixup for mpc5xx
+
+    Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
+
+commit f82b3b6304b620ef7e28bfaa1ea887a2ad2fa325
+Author: Grant Likely <grant.likely@secretlab.ca>
+Date:  Tue Jul 3 00:34:19 2007 -0600
+
+    Don't set gd->reloc_off if relocation of .fixup works correctly
+
+    Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
+
+commit e1a6144c32dc7de73bcdd33995de0148cbd0bd28
+Author: Grant Likely <grant.likely@secretlab.ca>
+Date:  Tue Jul 3 00:34:14 2007 -0600
+
+    Remove obsolete mpc83xx linker scripts
+
+    Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
+
+commit 17e32fc3908bf7089d3f16fc82a1c3ae674dd65b
+Author: Grant Likely <grant.likely@secretlab.ca>
+Date:  Tue Jul 3 00:34:09 2007 -0600
+
+    Consolidate mpc8260 linker scripts
+
+    Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
+
+commit af7d38b393690d7eeaf418ac85a1e831a50d5fd0
+Author: Grant Likely <grant.likely@secretlab.ca>
+Date:  Tue Jul 3 00:34:04 2007 -0600
+
+    Remove obsolete mpc824x linker scripts
+
+    Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
+
+commit f94a3aecebc40ca0939c7d66d010009cf51be9e2
+Author: Grant Likely <grant.likely@secretlab.ca>
+Date:  Tue Jul 3 00:33:59 2007 -0600
+
+    Remove obsolete mpc824x linker scripts (3 of 4)
+
+    Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
+
+commit a71c084f3ac7fedf144537db2b2da47323068833
+Author: Grant Likely <grant.likely@secretlab.ca>
+Date:  Tue Jul 3 00:33:53 2007 -0600
+
+    Remove obsolete mpc824x linker scripts (2 of 4)
+
+    Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
+
+commit f670a15468d1365241d40022b9408e1004181f5e
+Author: Grant Likely <grant.likely@secretlab.ca>
+Date:  Tue Jul 3 00:33:48 2007 -0600
+
+    Remove obsolete mpc824x linker scripts (1 of 4)
+
+    Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
+
+commit 09555bd45a04c0e54f172528d21bc18896550d28
+Author: Grant Likely <grant.likely@secretlab.ca>
+Date:  Tue Jul 3 00:33:43 2007 -0600
+
+    Remove obsolete mpc8220 linker scripts
+
+    Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
+
+commit 5efb992f046e51225c93d52f80fecbe433abd789
+Author: Grant Likely <grant.likely@secretlab.ca>
+Date:  Tue Jul 3 00:33:38 2007 -0600
+
+    Remove obsolete mpc5xxx linker scripts (3 of 3)
+
+    Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
+
+commit 07c13dfef65b31647e69d8b61daa1eec598add1a
+Author: Grant Likely <grant.likely@secretlab.ca>
+Date:  Tue Jul 3 00:33:33 2007 -0600
+
+    Remove obsolete mpc5xxx linker scripts (2 of 3)
+
+    Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
+
+commit b4f67513a624ce85866c66c575bd2d9d7977d7f0
+Author: Grant Likely <grant.likely@secretlab.ca>
+Date:  Tue Jul 3 00:33:28 2007 -0600
+
+    Remove obsolete mpc5xxx linker scripts (1 of 3)
+
+    Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
+
+commit b7d8e05f8675249b5f208aa73babeed384a4519d
+Author: Grant Likely <grant.likely@secretlab.ca>
+Date:  Tue Jul 3 00:33:23 2007 -0600
+
+    Remove obsolete mpc5xx linker scripts
+
+    Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
+
+commit 416a0b6d40f6eba3a2fc547253c16bda28d922f7
+Author: Grant Likely <grant.likely@secretlab.ca>
+Date:  Tue Jul 3 00:33:18 2007 -0600
+
+    Consolidate mpc83xx linker scripts
+
+    Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
+
+commit 5fc59175b92883ed5d2666a04e6bc49e70a4a365
+Author: Grant Likely <grant.likely@secretlab.ca>
+Date:  Tue Jul 3 00:33:13 2007 -0600
+
+    Consolidate mpc8260 linker scripts
+
+    Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
+
+commit 737f9eb02d7335df2b3e4d7a4d3348784d1da207
+Author: Grant Likely <grant.likely@secretlab.ca>
+Date:  Tue Jul 3 00:33:08 2007 -0600
+
+    Consolidate mpc824x linker scripts
+
+    Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
+
+commit 9c757b789a59a855db57b448dd825329c4e9c4a0
+Author: Grant Likely <grant.likely@secretlab.ca>
+Date:  Tue Jul 3 00:33:03 2007 -0600
+
+    Consolidate mpc8220 linker scripts
+
+    Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
+
+commit d181c9a15cd41863fe24840d17848429f27d3c8c
+Author: Grant Likely <grant.likely@secretlab.ca>
+Date:  Tue Jul 3 00:32:58 2007 -0600
+
+    Consolidate mpc5xxx linker scripts
+
+    Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
+
+commit 287ac924adb7291bebe5086652a362a30ab28b13
+Author: Grant Likely <grant.likely@secretlab.ca>
+Date:  Tue Jul 3 00:32:53 2007 -0600
+
+    Consolidate mpc5xx linker scripts
+
+    Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
+
+commit 52b8704d0245e589f86d462e9ec25aeb7ecbbbdd
+Author: Wolfgang Denk <wd@denx.de>
+Date:  Wed Jul 4 00:43:53 2007 +0200
+
+    Fix a few file permission problems.
+
+    Signed-off-by: Wolfgang Denk <wd@denx.de>
+
+commit 78e0cf2de7be7f1eaeeb622eb61fd50e4d5e205c
+Author: Wolfgang Denk <wd@denx.de>
+Date:  Wed Jul 4 00:38:38 2007 +0200
+
+    Minor coding style cleanup. Rebuild CHANGELOG file.
+
+commit 2f9c19e496acb6bb50d9299e1aab377625d48c38
+Author: Jon Loeliger <jdl@jdl.com>
+Date:  Mon Jun 11 19:03:44 2007 -0500
+
+    configs/ mpc86xx: Rewrite command line options using new CONFIG_CMD-* style.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 602ad3b33d9ceef83dbab46be68646d645d637ee
+Author: Jon Loeliger <jdl@jdl.com>
+Date:  Mon Jun 11 19:03:39 2007 -0500
+
+    README: Rewrite command line config to use CONFIG_CMD_* names.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 72a074cec68e5bad60d63206c050974e08afd804
+Author: Jon Loeliger <jdl@jdl.com>
+Date:  Mon Jun 11 19:03:34 2007 -0500
+
+    include/ non-config: Augment CONFIG_COMMANDS tests with defined(CONFIG_CMD_*).
+
+    This is a compatibility step that allows both the older form
+    and the new form to co-exist for a while until the older can
+    be removed entirely.
+
+    All transformations are of the form:
+    Before:
+       #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT)
+    After:
+       #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) || defined(CONFIG_CMD_AUTOSCRIPT)
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 5fcf543e0b6628c76ff48705b1b0566bfd11507b
+Author: Jon Loeliger <jdl@jdl.com>
+Date:  Mon Jun 11 19:03:28 2007 -0500
+
+    tools/ : Augment CONFIG_COMMANDS tests with defined(CONFIG_CMD_*).
+
+    This is a compatibility step that allows both the older form
+    and the new form to co-exist for a while until the older can
+    be removed entirely.
+
+    All transformations are of the form:
+    Before:
+       #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT)
+    After:
+       #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) || defined(CONFIG_CMD_AUTOSCRIPT)
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 9107ebe0d352420895ab69b715697bdebc8caf50
+Author: Jon Loeliger <jdl@jdl.com>
+Date:  Mon Jun 11 19:03:23 2007 -0500
+
+    board/[k-z]*: Augment CONFIG_COMMANDS tests with defined(CONFIG_CMD_*).
+
+    This is a compatibility step that allows both the older form
+    and the new form to co-exist for a while until the older can
+    be removed entirely.
+
+    All transformations are of the form:
+    Before:
+       #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT)
+    After:
+       #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) || defined(CONFIG_CMD_AUTOSCRIPT)
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 5e378003d592ea828ec69d6defcd4de79096dd5c
+Author: Jon Loeliger <jdl@jdl.com>
+Date:  Mon Jun 11 19:03:19 2007 -0500
+
+    board/[Ma-i]*: Augment CONFIG_COMMANDS tests with defined(CONFIG_CMD_*).
+
+    This is a compatibility step that allows both the older form
+    and the new form to co-exist for a while until the older can
+    be removed entirely.
+
+    All transformations are of the form:
+    Before:
+       #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT)
+    After:
+       #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) || defined(CONFIG_CMD_AUTOSCRIPT)
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 737184114ec9c9e0ab94d6713536126073bd2472
+Author: Jon Loeliger <jdl@jdl.com>
+Date:  Mon Jun 11 19:03:15 2007 -0500
+
+    cpu/ non-mpc*: Augment CONFIG_COMMANDS tests with defined(CONFIG_CMD_*).
+
+    This is a compatibility step that allows both the older form
+    and the new form to co-exist for a while until the older can
+    be removed entirely.
+
+    All transformations are of the form:
+    Before:
+       #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT)
+    After:
+       #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) || defined(CONFIG_CMD_AUTOSCRIPT)
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit f48070fe5fe440dfb5ee5268c920de70e48ea327
+Author: Jon Loeliger <jdl@jdl.com>
+Date:  Mon Jun 11 19:03:08 2007 -0500
+
+    cpu/mpc*/ : Augment CONFIG_COMMANDS tests with defined(CONFIG_CMD_*).
+
+    This is a compatibility step that allows both the older form
+    and the new form to co-exist for a while until the older can
+    be removed entirely.
+
+    All transformations are of the form:
+    Before:
+       #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT)
+    After:
+       #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) || defined(CONFIG_CMD_AUTOSCRIPT)
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 0c505db0a0dc1f670b13ce3b4d3fbf1ec5b3cbd2
+Author: Jon Loeliger <jdl@jdl.com>
+Date:  Mon Jun 11 19:03:03 2007 -0500
+
+    lib_*/: Augment CONFIG_COMMANDS tests with defined(CONFIG_CMD_*).
+
+    This is a compatibility step that allows both the older form
+    and the new form to co-exist for a while until the older can
+    be removed entirely.
+
+    All transformations are of the form:
+    Before:
+       #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT)
+    After:
+       #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) || defined(CONFIG_CMD_AUTOSCRIPT)
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 73f032021ec5f13cda8faa4e34b6de80960eb86f
+Author: Jon Loeliger <jdl@jdl.com>
+Date:  Mon Jun 11 19:02:58 2007 -0500
+
+    lib_ppc/: Augment CONFIG_COMMANDS tests with defined(CONFIG_CMD_*).
+
+    This is a compatibility step that allows both the older form
+    and the new form to co-exist for a while until the older can
+    be removed entirely.
+
+    All transformations are of the form:
+    Before:
+       #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT)
+    After:
+       #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) || defined(CONFIG_CMD_AUTOSCRIPT)
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 98b79003c21c2578206003256de4e781d6b36ca8
+Author: Jon Loeliger <jdl@jdl.com>
+Date:  Mon Jun 11 19:02:53 2007 -0500
+
+    rtc/: Augment CONFIG_COMMANDS tests with defined(CONFIG_CMD_*).
+
+    This is a compatibility step that allows both the older form
+    and the new form to co-exist for a while until the older can
+    be removed entirely.
+
+    All transformations are of the form:
+    Before:
+       #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT)
+    After:
+       #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) || defined(CONFIG_CMD_AUTOSCRIPT)
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 6e2115acb6a892d53a6881bf253ae41d3df39156
+Author: Jon Loeliger <jdl@jdl.com>
+Date:  Mon Jun 11 19:02:49 2007 -0500
+
+    net/: Augment CONFIG_COMMANDS tests with defined(CONFIG_CMD_*).
+
+    This is a compatibility step that allows both the older form
+    and the new form to co-exist for a while until the older can
+    be removed entirely.
+
+    All transformations are of the form:
+    Before:
+       #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT)
+    After:
+       #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) || defined(CONFIG_CMD_AUTOSCRIPT)
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 45cdb9b72c94655c7308b464a2666057c0b286e0
+Author: Jon Loeliger <jdl@jdl.com>
+Date:  Mon Jun 11 19:02:34 2007 -0500
+
+    disk/: Augment CONFIG_COMMANDS tests with defined(CONFIG_CMD_*).
+
+    This is a compatibility step that allows both the older form
+    and the new form to co-exist for a while until the older can
+    be removed entirely.
+
+    All transformations are of the form:
+    Before:
+       #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT)
+    After:
+       #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) || defined(CONFIG_CMD_AUTOSCRIPT)
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 4e109ae98294a5ca7ff848b7652c7bfd4023a94a
+Author: Jon Loeliger <jdl@jdl.com>
+Date:  Mon Jun 11 19:02:20 2007 -0500
+
+    fs/: Augment CONFIG_COMMANDS tests with defined(CONFIG_CMD_*).
+
+    This is a compatibility step that allows both the older form
+    and the new form to co-exist for a while until the older can
+    be removed entirely.
+
+    All transformations are of the form:
+    Before:
+       #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT)
+    After:
+       #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) || defined(CONFIG_CMD_AUTOSCRIPT)
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit d5be43de93ff905c465e509d45a3164ef48d26e7
+Author: Jon Loeliger <jdl@jdl.com>
+Date:  Mon Jun 11 19:02:10 2007 -0500
+
+    drivers/: Augment CONFIG_COMMANDS tests with defined(CONFIG_CMD_*).
+
+    This is a compatibility step that allows both the older form
+    and the new form to co-exist for a while until the older can
+    be removed entirely.
+
+    All transformations are of the form:
+    Before:
+       #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT)
+    After:
+       #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) || defined(CONFIG_CMD_AUTOSCRIPT)
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit b453960d4fdb87b3970d96119b90df2ed024fc4a
+Author: Jon Loeliger <jdl@jdl.com>
+Date:  Mon Jun 11 19:02:05 2007 -0500
+
+    common/ non-cmd: Augment CONFIG_COMMANDS tests with defined(CONFIG_CMD_*).
+
+    This is a compatibility step that allows both the older form
+    and the new form to co-exist for a while until the older can
+    be removed entirely.
+
+    All transformations are of the form:
+    Before:
+       #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT)
+    After:
+       #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) || defined(CONFIG_CMD_AUTOSCRIPT)
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 65c450b47a62659d522cfa8f4fa1e4e5c60dccd0
+Author: Jon Loeliger <jdl@jdl.com>
+Date:  Mon Jun 11 19:01:54 2007 -0500
+
+    common/cmd_[i-z]* : Augment CONFIG_COMMANDS tests with defined(CONFIG_CMD_*).
+
+    This is a compatibility step that allows both the older form
+    and the new form to co-exist for a while until the older can
+    be removed entirely.
+
+    All transformations are of the form:
+    Before:
+       #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT)
+    After:
+       #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) || defined(CONFIG_CMD_AUTOSCRIPT)
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit a76adc8142c1d956385a109e0b70f9319ede4d66
+Author: Jon Loeliger <jdl@jdl.com>
+Date:  Mon Jun 11 19:01:43 2007 -0500
+
+    common/cmd_[a-f]* : Augment CONFIG_COMMANDS tests with defined(CONFIG_CMD_*).
+
+    This is a compatibility step that allows both the older form
+    and the new form to co-exist for a while until the older can
+    be removed entirely.
+
+    All transformations are of the form:
+    Before:
+       #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT)
+    After:
+       #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) || defined(CONFIG_CMD_AUTOSCRIPT)
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit ec63b10b61fd68238d4c15c1cd04c0b38228e2c1
+Author: Jon Loeliger <jdl@jdl.com>
+Date:  Mon Jun 11 19:01:34 2007 -0500
+
+    Introduce initial versions of new Command Config files.
+
+    Derive three new files from cmd_confdefs.h:
+       config_bootp.h - Has BOOTP related config options, not commands
+       config_cmd_all.h - Has a CONFIG_CMD_* definition for every command
+       config_cmd_default.h - Has a CONFIG_CMD_* definition for default cmds.
+
+    For now, include "config_bootp.h" for compatability until all
+    users of it directly include it properly.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
 
 commit 1f2a05898658900dc5717761e27abf2052e67e13
 Author: Mushtaq Khan <mushtaqk_921@yahoo.co.in>
diff --git a/MAKEALL b/MAKEALL
index 2a03b68708366abb1d773f1af2ce2dff65b25668..3e186ccd5a3d0388c0f2eeed389f73f94bf99bdf 100755 (executable)
--- a/MAKEALL
+++ b/MAKEALL
@@ -35,7 +35,7 @@ LIST_5xx="    \
 #########################################################################
 
 LIST_5xxx="    \
-       BC3450          cm1_qp1         cpci5200        EVAL5200        \
+       BC3450          cm5200          cpci5200        EVAL5200        \
        fo300           icecube_5100    icecube_5200    lite5200b       \
        mcc200          mecp5200        motionpro       o2dnt           \
        pf5200          PM520           TB5200          Total5100       \
@@ -141,8 +141,9 @@ LIST_8260=" \
 #########################################################################
 
 LIST_83xx="    \
-       MPC8313ERDB     MPC832XEMDS     MPC8349EMDS     MPC8349ITX      \
-       MPC8349ITXGP    MPC8360EMDS     sbc8349         TQM834x         \
+       MPC8313ERDB_33  MPC8313ERDB_66  MPC832XEMDS     MPC8349EMDS     \
+       MPC8349ITX      MPC8349ITXGP    MPC8360EMDS     sbc8349         \
+       TQM834x                                                         \
 "
 
 
@@ -152,10 +153,10 @@ LIST_83xx="       \
 
 LIST_85xx="    \
        MPC8540ADS      MPC8540EVAL     MPC8541CDS      MPC8544DS       \
-       MPC8548CDS      MPC8555CDS      MPC8560ADS      PM854           \
-       PM856           sbc8540         sbc8560         stxgp3          \
-       stxssa          TQM8540         TQM8541         TQM8555         \
-       TQM8560                                                         \
+       MPC8548CDS      MPC8555CDS      MPC8560ADS      MPC8568MDS      \
+       PM854           PM856           sbc8540         sbc8560         \
+       stxgp3          stxssa          TQM8540         TQM8541         \
+       TQM8555         TQM8560                                         \
 "
 
 #########################################################################
index 4a0e9f59d29c36cb43a8c4d2b96ff1eba5c7a92f..980aac2b6a5d4dd7b1498ce61e7f0bf9d489d56d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -206,6 +206,7 @@ LIBS += disk/libdisk.a
 LIBS += rtc/librtc.a
 LIBS += dtt/libdtt.a
 LIBS += drivers/libdrivers.a
+LIBS += drivers/bios_emulator/libatibiosemu.a
 LIBS += drivers/nand/libnand.a
 LIBS += drivers/nand_legacy/libnand_legacy.a
 LIBS += drivers/net/libnetdrv.a
@@ -431,7 +432,7 @@ jupiter_config:         unconfig
        @$(MKCONFIG) jupiter ppc mpc5xxx jupiter
 
 v38b_config: unconfig
-       @./mkconfig -a v38b ppc mpc5xxx v38b
+       @$(MKCONFIG) -a v38b ppc mpc5xxx v38b
 
 inka4x0_config:        unconfig
        @$(MKCONFIG) inka4x0 ppc mpc5xxx inka4x0
@@ -534,13 +535,8 @@ PM520_ROMBOOT_DDR_config:  unconfig
 smmaco4_config: unconfig
        @$(MKCONFIG) -a smmaco4 ppc mpc5xxx tqm5200
 
-cm1_qp1_config:        unconfig
-       @ >include/config.h
-       @[ -z "$(findstring cm1_qp1,$@)" ] || \
-               {  echo "... with 64 MByte SDRAM" ; \
-                 echo "... with 32 MByte Flash" ; \
-               }
-       @./mkconfig -a cm1_qp1 ppc mpc5xxx cm1_qp1
+cm5200_config: unconfig
+       @./mkconfig -a cm5200 ppc mpc5xxx cm5200
 
 spieval_config:        unconfig
        @$(MKCONFIG) -a spieval ppc mpc5xxx tqm5200
@@ -1037,9 +1033,8 @@ acadia_config:    unconfig
        @$(MKCONFIG) $(@:_config=) ppc ppc4xx acadia amcc
 
 acadia_nand_config:    unconfig
-       @mkdir -p $(obj)include
-       @mkdir -p $(obj)nand_spl
-       @mkdir -p $(obj)board/amcc/acadia
+       @mkdir -p $(obj)include $(obj)board/amcc/acadia
+       @mkdir -p $(obj)nand_spl/board/amcc/acadia
        @echo "#define CONFIG_NAND_U_BOOT" > $(obj)include/config.h
        @$(MKCONFIG) -n $@ -a acadia ppc ppc4xx acadia amcc
        @echo "TEXT_BASE = 0x01000000" > $(obj)board/amcc/acadia/config.tmp
@@ -1049,7 +1044,7 @@ ADCIOP_config:    unconfig
        @$(MKCONFIG) $(@:_config=) ppc ppc4xx adciop esd
 
 alpr_config:   unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx alpr prodrive
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx alpr prodrive
 
 AP1000_config:unconfig
        @$(MKCONFIG) $(@:_config=) ppc ppc4xx ap1000 amirix
@@ -1067,9 +1062,8 @@ bamboo_config:    unconfig
        @$(MKCONFIG) $(@:_config=) ppc ppc4xx bamboo amcc
 
 bamboo_nand_config:    unconfig
-       @mkdir -p $(obj)include
-       @mkdir -p $(obj)nand_spl
-       @mkdir -p $(obj)board/amcc/bamboo
+       @mkdir -p $(obj)include $(obj)board/amcc/bamboo
+       @mkdir -p $(obj)nand_spl/board/amcc/bamboo
        @echo "#define CONFIG_NAND_U_BOOT" > $(obj)include/config.h
        @$(MKCONFIG) -n $@ -a bamboo ppc ppc4xx bamboo amcc
        @echo "TEXT_BASE = 0x01000000" > $(obj)board/amcc/bamboo/config.tmp
@@ -1250,9 +1244,8 @@ rainier_config: unconfig
 
 sequoia_nand_config \
 rainier_nand_config: unconfig
-       @mkdir -p $(obj)include
-       @mkdir -p $(obj)nand_spl
-       @mkdir -p $(obj)board/amcc/sequoia
+       @mkdir -p $(obj)include $(obj)board/amcc/sequoia
+       @mkdir -p $(obj)nand_spl/board/amcc/sequoia
        @echo "#define CONFIG_NAND_U_BOOT" > $(obj)include/config.h
        @echo "#define CONFIG_$$(echo $(subst ,,$(@:_config=)) | \
                tr '[:lower:]' '[:upper:]')" >> $(obj)include/config.h
@@ -1261,7 +1254,7 @@ rainier_nand_config: unconfig
        @echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk
 
 sc3_config:unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx sc3
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx sc3
 
 taishan_config:        unconfig
        @$(MKCONFIG) $(@:_config=) ppc ppc4xx taishan amcc
@@ -1427,7 +1420,7 @@ ep8260_config:    unconfig
        @$(MKCONFIG) $(@:_config=) ppc mpc8260 ep8260
 
 ep82xxm_config:        unconfig
-       @./mkconfig $(@:_config=) ppc mpc8260 ep82xxm
+       @$(MKCONFIG) $(@:_config=) ppc mpc8260 ep82xxm
 
 gw8260_config: unconfig
        @$(MKCONFIG) $(@:_config=) ppc mpc8260 gw8260
@@ -1668,14 +1661,15 @@ r5200_config :          unconfig
 
 MPC8313ERDB_33_config \
 MPC8313ERDB_66_config: unconfig
-       @echo "" >include/config.h ; \
+       @mkdir -p $(obj)include
+       @echo "" >$(obj)include/config.h ; \
        if [ "$(findstring _33_,$@)" ] ; then \
-               echo -n "...33M ..." ; \
-               echo "#define CFG_33MHZ" >>include/config.h ; \
+               echo "...33M ..." ; \
+               echo "#define CFG_33MHZ" >>$(obj)include/config.h ; \
        fi ; \
        if [ "$(findstring _66_,$@)" ] ; then \
-               echo -n "...66M..." ; \
-               echo "#define CFG_66MHZ" >>include/config.h ; \
+               echo "...66M..." ; \
+               echo "#define CFG_66MHZ" >>$(obj)include/config.h ; \
        fi ;
        @$(MKCONFIG) -a MPC8313ERDB ppc mpc83xx mpc8313erdb
 
@@ -1683,23 +1677,24 @@ MPC832XEMDS_config \
 MPC832XEMDS_HOST_33_config \
 MPC832XEMDS_HOST_66_config \
 MPC832XEMDS_SLAVE_config:      unconfig
-       @echo "" >include/config.h ; \
+       @mkdir -p $(obj)include
+       @echo "" >$(obj)include/config.h ; \
        if [ "$(findstring _HOST_,$@)" ] ; then \
-               echo -n "... PCI HOST " ; \
-               echo "#define CONFIG_PCI" >>include/config.h ; \
+               echo "... PCI HOST " ; \
+               echo "#define CONFIG_PCI" >>$(obj)include/config.h ; \
        fi ; \
        if [ "$(findstring _SLAVE_,$@)" ] ; then \
                echo "...PCI SLAVE 66M"  ; \
-               echo "#define CONFIG_PCI" >>include/config.h ; \
-               echo "#define CONFIG_PCISLAVE" >>include/config.h ; \
+               echo "#define CONFIG_PCI" >>$(obj)include/config.h ; \
+               echo "#define CONFIG_PCISLAVE" >>$(obj)include/config.h ; \
        fi ; \
        if [ "$(findstring _33_,$@)" ] ; then \
-               echo -n "...33M ..." ; \
-               echo "#define PCI_33M" >>include/config.h ; \
+               echo "...33M ..." ; \
+               echo "#define PCI_33M" >>$(obj)include/config.h ; \
        fi ; \
        if [ "$(findstring _66_,$@)" ] ; then \
-               echo -n "...66M..." ; \
-               echo "#define PCI_66M" >>include/config.h ; \
+               echo "...66M..." ; \
+               echo "#define PCI_66M" >>$(obj)include/config.h ; \
        fi ;
        @$(MKCONFIG) -a MPC832XEMDS ppc mpc83xx mpc832xemds
 
@@ -1724,23 +1719,24 @@ MPC8360EMDS_config \
 MPC8360EMDS_HOST_33_config \
 MPC8360EMDS_HOST_66_config \
 MPC8360EMDS_SLAVE_config:      unconfig
-       @echo "" >include/config.h ; \
+       @mkdir -p $(obj)include
+       @echo "" >$(obj)include/config.h ; \
        if [ "$(findstring _HOST_,$@)" ] ; then \
-               echo -n "... PCI HOST " ; \
-               echo "#define CONFIG_PCI" >>include/config.h ; \
+               echo "... PCI HOST " ; \
+               echo "#define CONFIG_PCI" >>$(obj)include/config.h ; \
        fi ; \
        if [ "$(findstring _SLAVE_,$@)" ] ; then \
                echo "...PCI SLAVE 66M"  ; \
-               echo "#define CONFIG_PCI" >>include/config.h ; \
-               echo "#define CONFIG_PCISLAVE" >>include/config.h ; \
+               echo "#define CONFIG_PCI" >>$(obj)include/config.h ; \
+               echo "#define CONFIG_PCISLAVE" >>$(obj)include/config.h ; \
        fi ; \
        if [ "$(findstring _33_,$@)" ] ; then \
-               echo -n "...33M ..." ; \
-               echo "#define PCI_33M" >>include/config.h ; \
+               echo "...33M ..." ; \
+               echo "#define PCI_33M" >>$(obj)include/config.h ; \
        fi ; \
        if [ "$(findstring _66_,$@)" ] ; then \
-               echo -n "...66M..." ; \
-               echo "#define PCI_66M" >>include/config.h ; \
+               echo "...66M..." ; \
+               echo "#define PCI_66M" >>$(obj)include/config.h ; \
        fi ;
        @$(MKCONFIG) -a MPC8360EMDS ppc mpc83xx mpc8360emds
 
@@ -1766,10 +1762,10 @@ MPC8540EVAL_66_slave_config:      unconfig
        @mkdir -p $(obj)include
        @echo "" >$(obj)include/config.h ; \
        if [ "$(findstring _33_,$@)" ] ; then \
-               echo -n "... 33 MHz PCI" ; \
+               echo "... 33 MHz PCI" ; \
        else \
                echo "#define CONFIG_SYSCLK_66M" >>$(obj)include/config.h ; \
-               echo -n "... 66 MHz PCI" ; \
+               echo "... 66 MHz PCI" ; \
        fi ; \
        if [ "$(findstring _slave_,$@)" ] ; then \
                echo "#define CONFIG_PCI_SLAVE" >>$(obj)include/config.h ; \
@@ -1863,7 +1859,7 @@ TQM8560_config:           unconfig
 #########################################################################
 
 MPC8641HPCN_config:    unconfig
-       @./mkconfig $(@:_config=) ppc mpc86xx mpc8641hpcn
+       @$(MKCONFIG) $(@:_config=) ppc mpc86xx mpc8641hpcn
 
 
 #########################################################################
@@ -2030,13 +2026,13 @@ omap1610h2_cs3boot_config \
 omap1610h2_cs_autoboot_config: unconfig
        @mkdir -p $(obj)include
        @if [ "$(findstring _cs0boot_, $@)" ] ; then \
-               echo "#define CONFIG_CS0_BOOT" >> .$(obj)/include/config.h ; \
+               echo "#define CONFIG_CS0_BOOT" >> .$(obj)include/config.h ; \
                echo "... configured for CS0 boot"; \
        elif [ "$(findstring _cs_autoboot_, $@)" ] ; then \
-               echo "#define CONFIG_CS_AUTOBOOT" >> $(obj)./include/config.h ; \
+               echo "#define CONFIG_CS_AUTOBOOT" >> $(obj)include/config.h ; \
                echo "... configured for CS_AUTO boot"; \
        else \
-               echo "#define CONFIG_CS3_BOOT" >> $(obj)./include/config.h ; \
+               echo "#define CONFIG_CS3_BOOT" >> $(obj)include/config.h ; \
                echo "... configured for CS3 boot"; \
        fi;
        @$(MKCONFIG) -a $(call xtract_omap1610xxx,$@) arm arm926ejs omap1610inn NULL omap
@@ -2205,11 +2201,12 @@ logodl_config   :       unconfig
 
 pdnb3_config \
 scpu_config:    unconfig
+       @mkdir -p $(obj)include
        @if [ "$(findstring scpu_,$@)" ] ; then \
-               echo "#define CONFIG_SCPU"      >>include/config.h ; \
+               echo "#define CONFIG_SCPU"      >>$(obj)include/config.h ; \
                echo "... on SCPU board variant" ; \
        else \
-               >include/config.h ; \
+               >$(obj)include/config.h ; \
        fi
        @$(MKCONFIG) -a pdnb3 arm ixp pdnb3 prodrive
 
@@ -2431,14 +2428,16 @@ suzaku_config:  unconfig
        @$(MKCONFIG) -a $(@:_config=) microblaze microblaze suzaku AtmarkTechno
 
 ml401_config:  unconfig
-       @ >include/config.h
-       @echo "#define CONFIG_ML401 1" >> include/config.h
-       @./mkconfig -a $(@:_config=) microblaze microblaze ml401 xilinx
+       @mkdir -p $(obj)include
+       @ >$(obj)include/config.h
+       @echo "#define CONFIG_ML401 1" >> $(obj)include/config.h
+       @$(MKCONFIG) -a $(@:_config=) microblaze microblaze ml401 xilinx
 
 xupv2p_config: unconfig
-       @ >include/config.h
-       @echo "#define CONFIG_XUPV2P 1" >> include/config.h
-       @./mkconfig -a $(@:_config=) microblaze microblaze xupv2p xilinx
+       @mkdir -p $(obj)include
+       @ >$(obj)include/config.h
+       @echo "#define CONFIG_XUPV2P 1" >> $(obj)include/config.h
+       @$(MKCONFIG) -a $(@:_config=) microblaze microblaze xupv2p xilinx
 
 #########################################################################
 ## Blackfin
@@ -2463,7 +2462,7 @@ bf561-ezkit_config:       unconfig
 #########################################################################
 
 atstk1002_config       :       unconfig
-       @./mkconfig $(@:_config=) avr32 at32ap atstk1000 atmel at32ap7000
+       @$(MKCONFIG) $(@:_config=) avr32 at32ap atstk1000 atmel at32ap7000
 
 #########################################################################
 #########################################################################
diff --git a/README b/README
index b64bfb2477cd07f0a58208ee08697d281fc4d829..852ad72acdc09c80c45f3debf49b7908aed7bd35 100644 (file)
--- a/README
+++ b/README
@@ -541,7 +541,7 @@ The following options need to be configured:
                        CFG_CONSOLE_BLINK_COUNT blink interval (cf. i8042.c)
                        CONFIG_CONSOLE_TIME     display time/date info in
                                                upper right corner
-                                               (requires CFG_CMD_DATE)
+                                               (requires CONFIG_CMD_DATE)
                        CONFIG_VIDEO_LOGO       display Linux logo in
                                                upper left corner
                        CONFIG_VIDEO_BMP_LOGO   use bmp_logo.h instead of
@@ -645,103 +645,96 @@ The following options need to be configured:
                time on others. This setting #define's the initial
                value of the "loads_echo" environment variable.
 
-- Kgdb Serial Baudrate: (if CFG_CMD_KGDB is defined)
+- Kgdb Serial Baudrate: (if CONFIG_CMD_KGDB is defined)
                CONFIG_KGDB_BAUDRATE
                Select one of the baudrates listed in
                CFG_BAUDRATE_TABLE, see below.
 
 - Monitor Functions:
-               CONFIG_COMMANDS
-               Most monitor functions can be selected (or
-               de-selected) by adjusting the definition of
-               CONFIG_COMMANDS; to select individual functions,
-               #define CONFIG_COMMANDS by "OR"ing any of the
-               following values:
-
-               #define enables commands:
-               -------------------------
-               CFG_CMD_ASKENV  * ask for env variable
-               CFG_CMD_AUTOSCRIPT Autoscript Support
-               CFG_CMD_BDI       bdinfo
-               CFG_CMD_BEDBUG  * Include BedBug Debugger
-               CFG_CMD_BMP     * BMP support
-               CFG_CMD_BSP     * Board specific commands
-               CFG_CMD_BOOTD     bootd
-               CFG_CMD_CACHE   * icache, dcache
-               CFG_CMD_CONSOLE   coninfo
-               CFG_CMD_DATE    * support for RTC, date/time...
-               CFG_CMD_DHCP    * DHCP support
-               CFG_CMD_DIAG    * Diagnostics
-               CFG_CMD_DOC     * Disk-On-Chip Support
-               CFG_CMD_DTT     * Digital Therm and Thermostat
-               CFG_CMD_ECHO      echo arguments
-               CFG_CMD_EEPROM  * EEPROM read/write support
-               CFG_CMD_ELF     * bootelf, bootvx
-               CFG_CMD_ENV       saveenv
-               CFG_CMD_FDC     * Floppy Disk Support
-               CFG_CMD_FAT     * FAT partition support
-               CFG_CMD_FDOS    * Dos diskette Support
-               CFG_CMD_FLASH     flinfo, erase, protect
-               CFG_CMD_FPGA      FPGA device initialization support
-               CFG_CMD_HWFLOW  * RTS/CTS hw flow control
-               CFG_CMD_I2C     * I2C serial bus support
-               CFG_CMD_IDE     * IDE harddisk support
-               CFG_CMD_IMI       iminfo
-               CFG_CMD_IMLS      List all found images
-               CFG_CMD_IMMAP   * IMMR dump support
-               CFG_CMD_IRQ     * irqinfo
-               CFG_CMD_ITEST     Integer/string test of 2 values
-               CFG_CMD_JFFS2   * JFFS2 Support
-               CFG_CMD_KGDB    * kgdb
-               CFG_CMD_LOADB     loadb
-               CFG_CMD_LOADS     loads
-               CFG_CMD_MEMORY    md, mm, nm, mw, cp, cmp, crc, base,
-                                 loop, loopw, mtest
-               CFG_CMD_MISC      Misc functions like sleep etc
-               CFG_CMD_MMC     * MMC memory mapped support
-               CFG_CMD_MII     * MII utility commands
-               CFG_CMD_NAND    * NAND support
-               CFG_CMD_NET       bootp, tftpboot, rarpboot
-               CFG_CMD_PCI     * pciinfo
-               CFG_CMD_PCMCIA  * PCMCIA support
-               CFG_CMD_PING    * send ICMP ECHO_REQUEST to network host
-               CFG_CMD_PORTIO  * Port I/O
-               CFG_CMD_REGINFO * Register dump
-               CFG_CMD_RUN       run command in env variable
-               CFG_CMD_SAVES   * save S record dump
-               CFG_CMD_SCSI    * SCSI Support
-               CFG_CMD_SDRAM   * print SDRAM configuration information
-                                 (requires CFG_CMD_I2C)
-               CFG_CMD_SETGETDCR Support for DCR Register access (4xx only)
-               CFG_CMD_SPI     * SPI serial bus support
-               CFG_CMD_USB     * USB support
-               CFG_CMD_VFD     * VFD support (TRAB)
-               CFG_CMD_BSP     * Board SPecific functions
-               CFG_CMD_CDP     * Cisco Discover Protocol support
-               CFG_CMD_FSL     * Microblaze FSL support
-               -----------------------------------------------
-               CFG_CMD_ALL     all
-
-               CONFIG_CMD_DFL  Default configuration; at the moment
-                               this is includes all commands, except
-                               the ones marked with "*" in the list
-                               above.
-
-               If you don't define CONFIG_COMMANDS it defaults to
-               CONFIG_CMD_DFL in include/cmd_confdefs.h. A board can
-               override the default settings in the respective
-               include file.
+               Monitor commands can be included or excluded
+               from the build by using the #include files
+               "config_cmd_all.h" and #undef'ing unwanted
+               commands, or using "config_cmd_default.h"
+               and augmenting with additional #define's
+               for wanted commands.
+
+               The default command configuration includes all commands
+               except those marked below with a "*".
+
+               CONFIG_CMD_ASKENV       * ask for env variable
+               CONFIG_CMD_AUTOSCRIPT     Autoscript Support
+               CONFIG_CMD_BDI            bdinfo
+               CONFIG_CMD_BEDBUG       * Include BedBug Debugger
+               CONFIG_CMD_BMP          * BMP support
+               CONFIG_CMD_BSP          * Board specific commands
+               CONFIG_CMD_BOOTD          bootd
+               CONFIG_CMD_CACHE        * icache, dcache
+               CONFIG_CMD_CONSOLE        coninfo
+               CONFIG_CMD_DATE         * support for RTC, date/time...
+               CONFIG_CMD_DHCP         * DHCP support
+               CONFIG_CMD_DIAG         * Diagnostics
+               CONFIG_CMD_DOC          * Disk-On-Chip Support
+               CONFIG_CMD_DTT          * Digital Therm and Thermostat
+               CONFIG_CMD_ECHO           echo arguments
+               CONFIG_CMD_EEPROM       * EEPROM read/write support
+               CONFIG_CMD_ELF          * bootelf, bootvx
+               CONFIG_CMD_ENV            saveenv
+               CONFIG_CMD_FDC          * Floppy Disk Support
+               CONFIG_CMD_FAT          * FAT partition support
+               CONFIG_CMD_FDOS         * Dos diskette Support
+               CONFIG_CMD_FLASH          flinfo, erase, protect
+               CONFIG_CMD_FPGA           FPGA device initialization support
+               CONFIG_CMD_HWFLOW       * RTS/CTS hw flow control
+               CONFIG_CMD_I2C          * I2C serial bus support
+               CONFIG_CMD_IDE          * IDE harddisk support
+               CONFIG_CMD_IMI            iminfo
+               CONFIG_CMD_IMLS           List all found images
+               CONFIG_CMD_IMMAP        * IMMR dump support
+               CONFIG_CMD_IRQ          * irqinfo
+               CONFIG_CMD_ITEST          Integer/string test of 2 values
+               CONFIG_CMD_JFFS2        * JFFS2 Support
+               CONFIG_CMD_KGDB         * kgdb
+               CONFIG_CMD_LOADB          loadb
+               CONFIG_CMD_LOADS          loads
+               CONFIG_CMD_MEMORY         md, mm, nm, mw, cp, cmp, crc, base,
+                                         loop, loopw, mtest
+               CONFIG_CMD_MISC           Misc functions like sleep etc
+               CONFIG_CMD_MMC          * MMC memory mapped support
+               CONFIG_CMD_MII          * MII utility commands
+               CONFIG_CMD_NAND         * NAND support
+               CONFIG_CMD_NET            bootp, tftpboot, rarpboot
+               CONFIG_CMD_PCI          * pciinfo
+               CONFIG_CMD_PCMCIA               * PCMCIA support
+               CONFIG_CMD_PING         * send ICMP ECHO_REQUEST to network
+                                         host
+               CONFIG_CMD_PORTIO       * Port I/O
+               CONFIG_CMD_REGINFO      * Register dump
+               CONFIG_CMD_RUN            run command in env variable
+               CONFIG_CMD_SAVES        * save S record dump
+               CONFIG_CMD_SCSI         * SCSI Support
+               CONFIG_CMD_SDRAM        * print SDRAM configuration information
+                                         (requires CONFIG_CMD_I2C)
+               CONFIG_CMD_SETGETDCR      Support for DCR Register access
+                                         (4xx only)
+               CONFIG_CMD_SPI          * SPI serial bus support
+               CONFIG_CMD_USB          * USB support
+               CONFIG_CMD_VFD          * VFD support (TRAB)
+               CONFIG_CMD_BSP          * Board SPecific functions
+               CONFIG_CMD_CDP          * Cisco Discover Protocol support
+               CONFIG_CMD_FSL          * Microblaze FSL support
+
 
                EXAMPLE: If you want all functions except of network
                support you can write:
 
-               #define CONFIG_COMMANDS (CFG_CMD_ALL & ~CFG_CMD_NET)
+               #include "config_cmd_all.h"
+               #undef CONFIG_CMD_NET
 
        Other Commands:
                fdt (flattened device tree) command: CONFIG_OF_LIBFDT
 
        Note:   Don't enable the "icache" and "dcache" commands
-               (configuration option CFG_CMD_CACHE) unless you know
+               (configuration option CONFIG_CMD_CACHE) unless you know
                what you (and your U-Boot users) are doing. Data
                cache cannot be enabled on systems like the 8xx or
                8260 (where accesses to the IMMR region must be
@@ -769,7 +762,7 @@ The following options need to be configured:
 
 - Real-Time Clock:
 
-               When CFG_CMD_DATE is selected, the type of the RTC
+               When CONFIG_CMD_DATE is selected, the type of the RTC
                has to be selected, too. Define exactly one of the
                following options:
 
@@ -790,14 +783,14 @@ The following options need to be configured:
                When CONFIG_TIMESTAMP is selected, the timestamp
                (date and time) of an image is printed by image
                commands like bootm or iminfo. This option is
-               automatically enabled when you select CFG_CMD_DATE .
+               automatically enabled when you select CONFIG_CMD_DATE .
 
 - Partition Support:
                CONFIG_MAC_PARTITION and/or CONFIG_DOS_PARTITION
                and/or CONFIG_ISO_PARTITION
 
-               If IDE or SCSI support  is  enabled  (CFG_CMD_IDE  or
-               CFG_CMD_SCSI) you must configure support for at least
+               If IDE or SCSI support  is  enabled  (CONFIG_CMD_IDE or
+               CONFIG_CMD_SCSI) you must configure support for at least
                one partition type as well.
 
 - IDE Reset method:
@@ -907,8 +900,8 @@ The following options need to be configured:
                enable this define CONFIG_MMC. The MMC can be
                accessed from the boot prompt by mapping the device
                to physical memory similar to flash. Command line is
-               enabled with CFG_CMD_MMC. The MMC driver also works with
-               the FAT fs. This is enabled with CFG_CMD_FAT.
+               enabled with CONFIG_CMD_MMC. The MMC driver also works with
+               the FAT fs. This is enabled with CONFIG_CMD_FAT.
 
 - Journaling Flash filesystem support:
                CONFIG_JFFS2_NAND, CONFIG_JFFS2_NAND_OFF, CONFIG_JFFS2_NAND_SIZE,
@@ -1123,7 +1116,7 @@ The following options need to be configured:
                boot, thus flooding the BOOTP server. Defining
                CONFIG_BOOTP_RANDOM_DELAY causes a random delay to be
                inserted before sending out BOOTP requests. The
-               following delays are insterted then:
+               following delays are inserted then:
 
                1st BOOTP request:      delay 0 ... 1 sec
                2nd BOOTP request:      delay 0 ... 2 sec
@@ -1132,10 +1125,21 @@ The following options need to be configured:
                BOOTP requests:         delay 0 ... 8 sec
 
 - DHCP Advanced Options:
-               CONFIG_BOOTP_MASK
-
-               You can fine tune the DHCP functionality by adding
-               these flags to the CONFIG_BOOTP_MASK define:
+               You can fine tune the DHCP functionality by defining
+               CONFIG_BOOTP_* symbols:
+
+               CONFIG_BOOTP_SUBNETMASK
+               CONFIG_BOOTP_GATEWAY
+               CONFIG_BOOTP_HOSTNAME
+               CONFIG_BOOTP_NISDOMAIN
+               CONFIG_BOOTP_BOOTPATH
+               CONFIG_BOOTP_BOOTFILESIZE
+               CONFIG_BOOTP_DNS
+               CONFIG_BOOTP_DNS2
+               CONFIG_BOOTP_SEND_HOSTNAME
+               CONFIG_BOOTP_NTPSERVER
+               CONFIG_BOOTP_TIMEOFFSET
+               CONFIG_BOOTP_VENDOREX
 
                CONFIG_BOOTP_DNS2 - If a DHCP client requests the DNS
                serverip from a DHCP server, it is possible that more
@@ -1144,15 +1148,14 @@ The following options need to be configured:
                serverip will be stored in the additional environment
                variable "dnsip2". The first DNS serverip is always
                stored in the variable "dnsip", when CONFIG_BOOTP_DNS
-               is added to the CONFIG_BOOTP_MASK.
+               is defined.
 
                CONFIG_BOOTP_SEND_HOSTNAME - Some DHCP servers are capable
                to do a dynamic update of a DNS server. To do this, they
                need the hostname of the DHCP requester.
-               If CONFIG_BOOP_SEND_HOSTNAME is added to the
-               CONFIG_BOOTP_MASK, the content of the "hostname"
-               environment variable is passed as option 12 to
-               the DHCP server.
+               If CONFIG_BOOP_SEND_HOSTNAME is defined, the content
+               of the "hostname" environment variable is passed as
+               option 12 to the DHCP server.
 
  - CDP Options:
                CONFIG_CDP_DEVICE_ID
@@ -1220,7 +1223,7 @@ The following options need to be configured:
                include the appropriate I2C driver for the selected cpu.
 
                This will allow you to use i2c commands at the u-boot
-               command line (as long as you set CFG_CMD_I2C in
+               command line (as long as you set CONFIG_CMD_I2C in
                CONFIG_COMMANDS) and communicate with i2c based realtime
                clock chips. See common/cmd_i2c.c for a description of the
                command line interface.
@@ -2369,7 +2372,7 @@ Low Level (hardware related) configuration options:
 
 - CONFIG_LOOPW
                Add the "loopw" memory command. This only takes effect if
-               the memory commands are activated globally (CFG_CMD_MEM).
+               the memory commands are activated globally (CONFIG_CMD_MEM).
 
 - CONFIG_MX_CYCLIC
                Add the "mdc" and "mwc" memory commands. These are cyclic
@@ -2383,7 +2386,7 @@ Low Level (hardware related) configuration options:
                This command will write 12345678 to address 100 all 10 ms.
 
                This only takes effect if the memory commands are activated
-               globally (CFG_CMD_MEM).
+               globally (CONFIG_CMD_MEM).
 
 - CONFIG_SKIP_LOWLEVEL_INIT
 - CONFIG_SKIP_RELOCATE_UBOOT
index 40f41c78185dbf6de24cc6fe3822af5650029fcb..b472176635bf66f55fd5d3bb9a7566cf773fe507 100644 (file)
 #include "memio.h"
 #include "via686.h"
 
-__asm(" .globl send_kb                                      \n
-       send_kb:                                            \n
-               lis     r9, 0xfe00                          \n
-                                                           \n
-               li      r4, 0x10        # retries           \n
-               mtctr   r4                                  \n
-                                                           \n
-       idle:                                               \n
-               lbz     r4, 0x64(r9)                        \n
-               andi.   r4, r4, 0x02                        \n
-               bne     idle                                \n
-                                                           \n
-       ready:                                              \n
-               stb     r3, 0x60(r9)                        \n
-                                                           \n
-       check:                                              \n
-               lbz     r4, 0x64(r9)                        \n
-               andi.   r4, r4, 0x01                        \n
-               beq     check                               \n
-                                                           \n
-               lbz     r4, 0x60(r9)                        \n
-               cmpwi   r4, 0xfa                            \n
-               beq     done                                \n
-                                                           \n
-               bdnz    idle                                \n
-                                                           \n
-               li      r3, 0                               \n
-               blr                                         \n
-                                                           \n
-       done:                                               \n
-               li      r3, 1                               \n
-               blr                                         \n
-                                                           \n
-       .globl test_kb                                      \n
-       test_kb:                                            \n
-               mflr    r10                                 \n
-               li      r3, 0xed                            \n
-               bl      send_kb                             \n
-               li      r3, 0x01                            \n
-               bl      send_kb                             \n
-               mtlr    r10                                 \n
-               blr                                         \n
-");
+__asm__(" .globl send_kb                                   \n "
+       "send_kb:                                           \n "
+       "       lis     r9, 0xfe00                          \n "
+       "                                                   \n "
+       "       li      r4, 0x10        # retries           \n "
+       "       mtctr   r4                                  \n "
+       "                                                   \n "
+       "idle:                                              \n "
+       "       lbz     r4, 0x64(r9)                        \n "
+       "       andi.   r4, r4, 0x02                        \n "
+       "       bne     idle                                \n "
+
+       "ready:                                             \n "
+       "       stb     r3, 0x60(r9)                        \n "
+       "                                                   \n "
+       "check:                                             \n "
+       "       lbz     r4, 0x64(r9)                        \n "
+       "       andi.   r4, r4, 0x01                        \n "
+       "       beq     check                               \n "
+       "                                                   \n "
+       "       lbz     r4, 0x60(r9)                        \n "
+       "       cmpwi   r4, 0xfa                            \n "
+       "       beq     done                                \n "
+
+       "       bdnz    idle                                \n "
+
+       "       li      r3, 0                               \n "
+       "       blr                                         \n "
+
+       "done:                                              \n "
+       "       li      r3, 1                               \n "
+       "       blr                                         \n "
+
+       ".globl test_kb                                     \n "
+       "test_kb:                                           \n "
+       "       mflr    r10                                 \n "
+       "       li      r3, 0xed                            \n "
+       "       bl      send_kb                             \n "
+       "       li      r3, 0x01                            \n "
+       "       bl      send_kb                             \n "
+       "       mtlr    r10                                 \n "
+       "       blr                                         "
+);
 
 
 int checkboard (void)
index 143bba2f154099f17837ee4b9875ef1eea4b491e..40c951d068c69b216c4308677c4828452e0627fb 100644 (file)
@@ -119,7 +119,7 @@ int do_boota (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 
        return 0;
 }
-#if defined(CONFIG_AMIGAONEG3SE) && (CONFIG_COMMANDS & CFG_CMD_BSP)
+#if defined(CONFIG_AMIGAONEG3SE) && defined(CONFIG_CMD_BSP)
 U_BOOT_CMD(
        boota,   3,      1,      do_boota,
        "boota   - boot an Amiga kernel\n",
index f6327f72038c83862c9483b7fd9cd28b54a95aaf..fc27c685835fe0ed570275cb2a897010fbb56126 100644 (file)
@@ -56,6 +56,7 @@ int  video_rows(void);
 int  video_cols(void);
 
 char *prompt_string = "=>";
+unsigned char video_get_attr(void);
 
 void video_set_color(unsigned char attr)
 {
diff --git a/board/MAI/bios_emulator/bios.c b/board/MAI/bios_emulator/bios.c
deleted file mode 100644 (file)
index d51eb64..0000000
+++ /dev/null
@@ -1,335 +0,0 @@
-/*
- * Mostly done after the Scitech Bios emulation
- * Written by Hans-Jörg Frieden
- * Hyperion Entertainment
- */
-#include "x86emu.h"
-#include "glue.h"
-
-#undef DEBUG
-#ifdef DEBUG
-#define PRINTF(fmt, args...) printf(fmt, ## args)
-#else
-#define PRINTF(fmt, args...)
-#endif
-
-#define BIOS_SEG 0xFFF0
-#define PCIBIOS_SUCCESSFUL 0
-#define PCIBIOS_DEVICE_NOT_FOUND 0x86
-
-typedef unsigned char UBYTE;
-typedef unsigned short UWORD;
-typedef unsigned long ULONG;
-
-typedef char BYTE;
-typedef short WORT;
-typedef long LONG;
-
-static inline UBYTE read_byte(volatile UBYTE* from)
-{
-    int x;
-    asm volatile ("lbz %0,%1\n eieio" : "=r" (x) : "m" (*from));
-    return (UBYTE)x;
-}
-
-static inline void write_byte(volatile UBYTE *to, int x)
-{
-    asm volatile ("stb %1,%0\n eieio" : "=m" (*to) : "r" (x));
-}
-
-static inline UWORD read_word_little(volatile UWORD *from)
-{
-    int x;
-    asm volatile ("lhbrx %0,0,%1\n eieio" : "=r" (x) : "r" (from), "m" (*from));
-    return (UWORD)x;
-}
-
-static inline UWORD read_word_big(volatile UWORD *from)
-{
-    int x;
-    asm volatile ("lhz %0,%1\n eieio" : "=r" (x) : "m" (*from));
-    return (UWORD)x;
-}
-
-static inline void write_word_little(volatile UWORD *to, int x)
-{
-    asm volatile ("sthbrx %1,0,%2\n eieio" : "=m" (*to) : "r" (x), "r" (to));
-}
-
-static inline void write_word_big(volatile UWORD *to, int x)
-{
-    asm volatile ("sth %1,%0\n eieio" : "=m" (*to) : "r" (x));
-}
-
-static inline ULONG read_long_little(volatile ULONG *from)
-{
-    unsigned long x;
-    asm volatile ("lwbrx %0,0,%1\n eieio" : "=r" (x) : "r" (from), "m"(*from));
-    return (ULONG)x;
-}
-
-static inline ULONG read_long_big(volatile ULONG *from)
-{
-    unsigned long x;
-    asm volatile ("lwz %0,%1\n eieio" : "=r" (x) : "m" (*from));
-    return (ULONG)x;
-}
-
-static inline void write_long_little(volatile ULONG *to, ULONG x)
-{
-    asm volatile ("stwbrx %1,0,%2\n eieio" : "=m" (*to) : "r" (x), "r" (to));
-}
-
-static inline void write_long_big(volatile ULONG *to, ULONG x)
-{
-    asm volatile ("stw %1,%0\n eieio" : "=m" (*to) : "r" (x));
-}
-
-#define port_to_mem(from) (0xFE000000|(from))
-#define in_byte(from) read_byte( (UBYTE *)port_to_mem(from))
-#define in_word(from) read_word_little((UWORD *)port_to_mem(from))
-#define in_long(from) read_long_little((ULONG *)port_to_mem(from))
-#define out_byte(to, val) write_byte((UBYTE *)port_to_mem(to), val)
-#define out_word(to, val) write_word_little((UWORD *)port_to_mem(to), val)
-#define out_long(to, val) write_long_little((ULONG *)port_to_mem(to), val)
-
-static void X86API undefined_intr(int intno)
-{
-    extern u16 A1_rdw(u32 addr);
-    if (A1_rdw(intno * 4 + 2) == BIOS_SEG)
-    {
-       PRINTF("Undefined interrupt %xh called AX = %xh, BX = %xh, CX = %xh, DX = %xh\n",
-          intno, M.x86.R_AX, M.x86.R_BX, M.x86.R_CX, M.x86.R_DX);
-       X86EMU_halt_sys();
-    }
-    else
-    {
-       PRINTF("Calling interrupt %xh, AL=%xh, AH=%xh\n", intno, M.x86.R_AL, M.x86.R_AH);
-       X86EMU_prepareForInt(intno);
-    }
-}
-
-static void X86API int42(int intno);
-static void X86API int15(int intno);
-
-static void X86API int10(int intno)
-{
-    if (A1_rdw(intno*4+2) == BIOS_SEG)
-       int42(intno);
-    else
-    {
-       PRINTF("int10: branching to %04X:%04X, AL=%xh, AH=%xh\n", A1_rdw(intno*4+2), A1_rdw(intno*4),
-              M.x86.R_AL, M.x86.R_AH);
-       X86EMU_prepareForInt(intno);
-    }
-}
-
-static void X86API int1A(int intno)
-{
-    int device;
-
-    switch(M.x86.R_AX)
-    {
-    case 0xB101: /* PCI Bios Present? */
-       M.x86.R_AL  = 0x00;
-       M.x86.R_EDX = 0x20494350;
-       M.x86.R_BX  = 0x0210;
-       M.x86.R_CL  = 3;
-       CLEAR_FLAG(F_CF);
-       break;
-    case 0xB102: /* Find device */
-       device = mypci_find_device(M.x86.R_DX, M.x86.R_CX, M.x86.R_SI);
-       if (device != -1)
-       {
-           M.x86.R_AH = PCIBIOS_SUCCESSFUL;
-           M.x86.R_BH = mypci_bus(device);
-           M.x86.R_BL = mypci_devfn(device);
-       }
-       else
-       {
-           M.x86.R_AH = PCIBIOS_DEVICE_NOT_FOUND;
-       }
-       CONDITIONAL_SET_FLAG((M.x86.R_AH != PCIBIOS_SUCCESSFUL), F_CF);
-       break;
-    case 0xB103: /* Find PCI class code */
-       M.x86.R_AH = PCIBIOS_DEVICE_NOT_FOUND;
-       /*printf("Find by class not yet implmented"); */
-       CONDITIONAL_SET_FLAG((M.x86.R_AH != PCIBIOS_SUCCESSFUL), F_CF);
-       break;
-    case 0xB108: /* read config byte */
-       M.x86.R_CL = mypci_read_cfg_byte(M.x86.R_BH, M.x86.R_BL, M.x86.R_DI);
-       M.x86.R_AH = PCIBIOS_SUCCESSFUL;
-       CONDITIONAL_SET_FLAG((M.x86.R_AH != PCIBIOS_SUCCESSFUL), F_CF);
-       /*printf("read_config_byte %x,%x,%x -> %x\n", M.x86.R_BH, M.x86.R_BL, M.x86.R_DI, */
-       /*          M.x86.R_CL); */
-       break;
-    case 0xB109: /* read config word */
-       M.x86.R_CX = mypci_read_cfg_word(M.x86.R_BH, M.x86.R_BL, M.x86.R_DI);
-       M.x86.R_AH = PCIBIOS_SUCCESSFUL;
-       CONDITIONAL_SET_FLAG((M.x86.R_AH != PCIBIOS_SUCCESSFUL), F_CF);
-       /*printf("read_config_word %x,%x,%x -> %x\n", M.x86.R_BH, M.x86.R_BL, M.x86.R_DI, */
-       /*          M.x86.R_CX); */
-       break;
-    case 0xB10A: /* read config dword */
-       M.x86.R_ECX = mypci_read_cfg_long(M.x86.R_BH, M.x86.R_BL, M.x86.R_DI);
-       M.x86.R_AH = PCIBIOS_SUCCESSFUL;
-       CONDITIONAL_SET_FLAG((M.x86.R_AH != PCIBIOS_SUCCESSFUL), F_CF);
-       /*printf("read_config_long %x,%x,%x -> %x\n", M.x86.R_BH, M.x86.R_BL, M.x86.R_DI, */
-       /*    M.x86.R_ECX); */
-       break;
-    case 0xB10B: /* write config byte */
-       mypci_write_cfg_byte(M.x86.R_BH, M.x86.R_BL, M.x86.R_DI, M.x86.R_CL);
-       M.x86.R_AH = PCIBIOS_SUCCESSFUL;
-       CONDITIONAL_SET_FLAG((M.x86.R_AH != PCIBIOS_SUCCESSFUL), F_CF);
-       /*printf("write_config_byte %x,%x,%x <- %x\n", M.x86.R_BH, M.x86.R_BL, M.x86.R_DI, */
-       /*    M.x86.R_CL); */
-       break;
-    case 0xB10C: /* write config word */
-       mypci_write_cfg_word(M.x86.R_BH, M.x86.R_BL, M.x86.R_DI, M.x86.R_CX);
-       M.x86.R_AH = PCIBIOS_SUCCESSFUL;
-       CONDITIONAL_SET_FLAG((M.x86.R_AH != PCIBIOS_SUCCESSFUL), F_CF);
-       /*printf("write_config_word %x,%x,%x <- %x\n", M.x86.R_BH, M.x86.R_BL, M.x86.R_DI, */
-       /*          M.x86.R_CX); */
-       break;
-    case 0xB10D: /* write config dword */
-       mypci_write_cfg_long(M.x86.R_BH, M.x86.R_BL, M.x86.R_DI, M.x86.R_ECX);
-       M.x86.R_AH = PCIBIOS_SUCCESSFUL;
-       CONDITIONAL_SET_FLAG((M.x86.R_AH != PCIBIOS_SUCCESSFUL), F_CF);
-       /*printf("write_config_long %x,%x,%x <- %x\n", M.x86.R_BH, M.x86.R_BL, M.x86.R_DI, */
-       /*          M.x86.R_ECX); */
-       break;
-    default:
-       PRINTF("BIOS int %xh: Unknown function AX=%04xh\n", intno, M.x86.R_AX);
-
-    }
-}
-
-void bios_init(void)
-{
-    int i;
-    X86EMU_intrFuncs bios_intr_tab[256];
-
-    for (i=0; i<256; i++)
-    {
-       write_long_little(M.mem_base+i*4, BIOS_SEG<<16);
-       bios_intr_tab[i] = undefined_intr;
-    }
-
-    bios_intr_tab[0x10] = int10;
-    bios_intr_tab[0x1A] = int1A;
-    bios_intr_tab[0x42] = int42;
-    bios_intr_tab[0x15] = int15;
-
-    bios_intr_tab[0x6D] = int42;
-
-    X86EMU_setupIntrFuncs(bios_intr_tab);
-    video_init();
-}
-
-unsigned char setup_40x25[] =
-{
-    0x38, 0x28, 0x2d, 0x0a, 0x1f, 6, 0x19,
-    0x1c, 2, 7, 6, 7, 0, 0, 0, 0
-};
-
-unsigned char setup_80x25[] =
-{
-    0x71, 0x50, 0x5a, 0x0a, 0x1f, 6, 0x19,
-    0x1c, 2, 7, 6, 7, 0, 0, 0, 0
-};
-
-unsigned char setup_graphics[] =
-{
-    0x38, 0x28, 0x20, 0x0a, 0x7f, 6, 0x64,
-    0x70, 2, 1, 6, 7, 0, 0, 0, 0
-};
-
-unsigned char setup_bw[] =
-{
-    0x61, 0x50, 0x52, 0x0f, 0x19, 6, 0x19,
-    0x19, 2, 0x0d, 0x0b, 0x0c, 0, 0, 0, 0
-};
-
-unsigned char * setup_modes[] =
-{
-    setup_40x25,     /* mode 0: 40x25 bw text */
-    setup_40x25,     /* mode 1: 40x25 col text */
-    setup_80x25,     /* mode 2: 80x25 bw text */
-    setup_80x25,     /* mode 3: 80x25 col text */
-    setup_graphics,  /* mode 4: 320x200 col graphics */
-    setup_graphics,  /* mode 5: 320x200 bw graphics */
-    setup_graphics,  /* mode 6: 640x200 bw graphics */
-    setup_bw         /* mode 7: 80x25 mono text */
-};
-
-unsigned int setup_cols[] =
-{
-    40, 40, 80, 80, 40, 40, 80, 80
-};
-
-unsigned char setup_modesets[] =
-{
-     0x2C, 0x28, 0x2D, 0x29, 0x2A, 0x2E, 0x1E, 0x29
-};
-
-unsigned int setup_bufsize[] =
-{
-    2048, 2048, 4096, 2096, 16384, 16384, 16384, 4096
-};
-
-void bios_set_mode(int mode)
-{
-    int i;
-    unsigned char mode_set = setup_modesets[mode]; /* Control register value */
-    unsigned char *setup_regs = setup_modes[mode]; /* Register 3D4 Array */
-
-    /* Switch video off */
-    out_byte(0x3D8, mode_set & 0x37);
-
-    /* Set up parameters at 3D4h */
-    for (i=0; i<16; i++)
-    {
-       out_byte(0x3D4, (unsigned char)i);
-       out_byte(0x3D5, *setup_regs);
-       setup_regs++;
-    }
-
-    /* Enable video */
-    out_byte(0x3D8, mode_set);
-
-    /* Set overscan */
-    if (mode == 6) out_byte(0x3D9, 0x3F);
-    else           out_byte(0x3D9, 0x30);
-}
-
-static void bios_print_string(void)
-{
-    extern void video_bios_print_string(char *string, int x, int y, int attr, int count);
-    char *s = (char *)(M.x86.R_ES<<4) + M.x86.R_BP;
-    int attr;
-    if (M.x86.R_AL & 0x02) attr = - 1;
-    else                   attr = M.x86.R_BL;
-    video_bios_print_string(s, M.x86.R_DH, M.x86.R_DL, attr, M.x86.R_CX);
-}
-
-static void X86API int42(int intno)
-{
-    switch (M.x86.R_AH)
-    {
-    case 0x00:
-       bios_set_mode(M.x86.R_AL);
-       break;
-    case 0x13:
-       bios_print_string();
-       break;
-    default:
-       PRINTF("Warning: VIDEO BIOS interrupt %xh unimplemented function %xh, AL = %xh\n",
-              intno, M.x86.R_AH, M.x86.R_AL);
-    }
-}
-
-static void X86API int15(int intno)
-{
-    PRINTF("Called interrupt 15h: AX = %xh, BX = %xh, CX = %xh, DX = %xh\n",
-          M.x86.R_AX, M.x86.R_BX, M.x86.R_CX, M.x86.R_DX);
-}
diff --git a/board/MAI/bios_emulator/glue.c b/board/MAI/bios_emulator/glue.c
deleted file mode 100644 (file)
index b380f0d..0000000
+++ /dev/null
@@ -1,515 +0,0 @@
-#include <common.h>
-#include <pci.h>
-#include <74xx_7xx.h>
-
-
-#ifdef DEBUG
-#undef DEBUG
-#endif
-
-#ifdef DEBUG
-#define PRINTF(format, args...) _printf(format , ## args)
-#else
-#define PRINTF(format, argc...)
-#endif
-
-static pci_dev_t to_pci(int bus, int devfn)
-{
-    return PCI_BDF(bus, (devfn>>3), devfn&3);
-}
-
-int mypci_find_device(int vendor, int product, int index)
-{
-    return pci_find_device(vendor, product, index);
-}
-
-int mypci_bus(int device)
-{
-    return PCI_BUS(device);
-}
-
-int mypci_devfn(int device)
-{
-    return (PCI_DEV(device)<<3) | PCI_FUNC(device);
-}
-
-
-#define mypci_read_func(type, size)                            \
-type mypci_read_cfg_##size##(int bus, int devfn, int offset)   \
-{                                                              \
-    type c;                                                    \
-    pci_read_config_##size##(to_pci(bus, devfn), offset, &c);  \
-    return c;                                                  \
-}
-
-#define mypci_write_func(type, size)                           \
-void mypci_write_cfg_##size##(int bus, int devfn, int offset, int value)       \
-{                                                              \
-    pci_write_config_##size##(to_pci(bus, devfn), offset, value);      \
-}
-
-mypci_read_func(u8,byte);
-mypci_read_func(u16,word);
-
-mypci_write_func(u8,byte);
-mypci_write_func(u16,word);
-
-u32 mypci_read_cfg_long(int bus, int devfn, int offset)
-{
-    u32 c;
-    pci_read_config_dword(to_pci(bus, devfn), offset, &c);
-    return c;
-}
-
-void mypci_write_cfg_long(int bus, int devfn, int offset, int value)
-{
-    pci_write_config_dword(to_pci(bus, devfn), offset, value);
-}
-
-void _printf(const char *fmt, ...)
-{
-    va_list args;
-    char buf[CFG_PBSIZE];
-
-    va_start(args, fmt);
-    (void)vsprintf(buf, fmt, args);
-    va_end(args);
-
-    printf(buf);
-}
-
-char *_getenv(char *name)
-{
-    return getenv(name);
-}
-
-unsigned long get_bar_size(pci_dev_t dev, int offset)
-{
-    u32 bar_back, bar_value;
-
-    /*  Save old BAR value */
-    pci_read_config_dword(dev, offset, &bar_back);
-
-    /*  Write all 1's. */
-    pci_write_config_dword(dev, offset, ~0);
-
-    /*  Now read back the relevant bits */
-    pci_read_config_dword(dev, offset, &bar_value);
-
-    /*  Restore original value */
-    pci_write_config_dword(dev, offset, bar_back);
-
-    if (bar_value == 0) return 0xFFFFFFFF; /*  This BAR is disabled */
-
-    if ((bar_value & PCI_BASE_ADDRESS_SPACE) == PCI_BASE_ADDRESS_SPACE_MEMORY)
-    {
-       /*  This is a memory space BAR. Mask it out so we get the size of it */
-       return ~(bar_value & PCI_BASE_ADDRESS_MEM_MASK) + 1;
-    }
-
-    /*  Not suitable */
-    return 0xFFFFFFFF;
-}
-
-void enable_compatibility_hole(void)
-{
-    u8 cfg;
-    pci_dev_t art = PCI_BDF(0,0,0);
-
-    pci_read_config_byte(art, 0x54, &cfg);
-    /* cfg |= 0x08; */
-    cfg |= 0x20;
-    pci_write_config_byte(art, 0x54, cfg);
-}
-
-void disable_compatibility_hole(void)
-{
-    u8 cfg;
-    pci_dev_t art = PCI_BDF(0,0,0);
-
-    pci_read_config_byte(art, 0x54, &cfg);
-    /* cfg &= ~0x08; */
-    cfg &= ~0x20;
-    pci_write_config_byte(art, 0x54, cfg);
-}
-
-void map_rom(pci_dev_t dev, u32 address)
-{
-    pci_write_config_dword(dev, PCI_ROM_ADDRESS, address|PCI_ROM_ADDRESS_ENABLE);
-}
-
-void unmap_rom(pci_dev_t dev)
-{
-    pci_write_config_dword(dev, PCI_ROM_ADDRESS, 0);
-}
-
-void bat_map(u8 batnum, u32 address, u32 length)
-{
-    u32 temp = address;
-    address &= 0xFFFE0000;
-    temp    &= 0x0001FFFF;
-    length = (length - 1 ) >> 17;
-    length <<= 2;
-
-    switch (batnum)
-    {
-    case 0:
-       __asm volatile ("mtdbatu 0, %0" : : "r" (address | length | 3));
-       __asm volatile ("mtdbatl 0, %0" : : "r" (address | 0x22));
-       break;
-    case 1:
-       __asm volatile ("mtdbatu 1, %0" : : "r" (address | length | 3));
-       __asm volatile ("mtdbatl 1, %0" : : "r" (address | 0x22));
-       break;
-    case 2:
-       __asm volatile ("mtdbatu 2, %0" : : "r" (address | length | 3));
-       __asm volatile ("mtdbatl 2, %0" : : "r" (address | 0x22));
-       break;
-    case 3:
-       __asm volatile ("mtdbatu 3, %0" : : "r" (address | length | 3));
-       __asm volatile ("mtdbatl 3, %0" : : "r" (address | 0x22));
-       break;
-    }
-}
-
-int find_image(u32 rom_address, u32 rom_size, void **image, u32 *image_size);
-
-int attempt_map_rom(pci_dev_t dev, void *copy_address)
-{
-    u32 rom_size      = 0;
-    u32 rom_address   = 0;
-    u32 bar_size      = 0;
-    u32 bar_backup    = 0;
-    int i,j;
-    void *image       = 0;
-    u32 image_size    = 0;
-    int did_correct   = 0;
-    u32 prefetch_addr = 0;
-    u32 prefetch_size = 0;
-    u32 prefetch_idx  = 0;
-
-    /*  Get the size of the expansion rom */
-    pci_write_config_dword(dev, PCI_ROM_ADDRESS, 0xFFFFFFFF);
-    pci_read_config_dword(dev, PCI_ROM_ADDRESS, &rom_size);
-    if ((rom_size & 0x01) == 0)
-    {
-       PRINTF("No ROM\n");
-       return 0;
-    }
-
-    rom_size &= 0xFFFFF800;
-    rom_size = (~rom_size)+1;
-
-    PRINTF("ROM Size is %dK\n", rom_size/1024);
-
-    /*
-     * Try to find a place for the ROM. We always attempt to use
-     * one of the card's bases for this, as this will be in any
-     * bridge's resource range as well as being free of conflicts
-     * with other cards. In a graphics card it is very unlikely
-     * that there won't be any base address that is large enough to
-     * hold the rom.
-     *
-     * FIXME: To work around this, theoretically the largest base
-     * could be used if none is found in the loop below.
-     */
-
-    for (i = PCI_BASE_ADDRESS_0; i <= PCI_BASE_ADDRESS_5; i += 4)
-    {
-       bar_size = get_bar_size(dev, i);
-       PRINTF("PCI_BASE_ADDRESS_%d is %dK large\n",
-              (i - PCI_BASE_ADDRESS_0)/4,
-              bar_size/1024);
-       if (bar_size != 0xFFFFFFFF && bar_size >= rom_size)
-       {
-           PRINTF("Found a match for rom size\n");
-           pci_read_config_dword(dev, i, &rom_address);
-           rom_address &= 0xFFFFFFF0;
-           if (rom_address != 0 && rom_address != 0xFFFFFFF0) break;
-       }
-    }
-
-    if (rom_address == 0 || rom_address == 0xFFFFFFF0)
-    {
-       PRINTF("No suitable rom address found\n");
-       return 0;
-    }
-
-    /*  Disable the BAR */
-    pci_read_config_dword(dev, i, &bar_backup);
-    pci_write_config_dword(dev, i, 0);
-
-    /*  Map ROM */
-    pci_write_config_dword(dev, PCI_ROM_ADDRESS, rom_address | PCI_ROM_ADDRESS_ENABLE);
-
-    /*  Copy the rom to a place in the emulator space */
-    PRINTF("Claiming BAT 2\n");
-    bat_map(2, rom_address, rom_size);
-    /* show_bat_mapping(); */
-
-    if (0 == find_image(rom_address, rom_size, &image, &image_size))
-    {
-       PRINTF("No x86 BIOS image found\n");
-       return 0;
-    }
-
-    PRINTF("Copying %ld bytes from 0x%lx to 0x%lx\n", (long)image_size, (long)image, (long)copy_address);
-
-    /* memcpy(copy_address, rom_address, rom_size); */
-    {
-       unsigned char *from = (unsigned char *)image; /* rom_address; */
-       unsigned char *to = (unsigned char *)copy_address;
-       for (j=0; j<image_size /*rom_size*/; j++)
-       {
-           *to++ = *from++;
-       }
-    }
-
-    PRINTF("Copy is done\n");
-
-    /*  Unmap the ROM and restore the BAR */
-    pci_write_config_dword(dev, PCI_ROM_ADDRESS, 0);
-    pci_write_config_dword(dev, i, bar_backup);
-
-    /*  FIXME: Shouldn't be needed anymore*/
-    /* bat_map(2, 0x80000000, 256*1024*1024);
-       show_bat_mapping(); */
-
-    /*
-     * Since most cards can probably only do 16 bit IO addressing, we
-     * correct their IO base into an appropriate value.
-     * This should do for most.
-     */
-    for (i = PCI_BASE_ADDRESS_0; i <= PCI_BASE_ADDRESS_5; i += 4)
-    {
-       unsigned long value;
-       pci_read_config_dword(dev, i, &value);
-       if (value & 0x01) /*  IO */
-       {
-           did_correct = 1;
-           pci_write_config_dword(dev, i, 0x1001);
-           break;
-       }
-
-       if (value & PCI_BASE_ADDRESS_MEM_PREFETCH)
-       {
-           prefetch_idx = i;
-           prefetch_addr = value & PCI_BASE_ADDRESS_MEM_MASK;
-           prefetch_size = get_bar_size(dev, i);
-       }
-    }
-
-    if (1) /* did_correct) */
-    {
-       extern pci_dev_t pci_find_bridge_for_bus(struct pci_controller *hose, int busnr);
-       int busnr = PCI_BUS(dev);
-       if (busnr)
-       {
-           pci_dev_t bridge;
-           PRINTF("Need to correct bridge device for IO range change\n");
-           bridge = pci_find_bridge_for_bus(NULL, busnr);
-           if (bridge == PCI_ANY_ID)
-           {
-               PRINTF("Didn't find bridge. Hope that's OK\n");
-           }
-           else
-           {
-               /*
-                * Set upper I/O base/limit to 0
-                */
-               pci_write_config_byte(bridge, 0x30, 0x00);
-               pci_write_config_byte(bridge, 0x31, 0x00);
-               pci_write_config_byte(bridge, 0x32, 0x00);
-               pci_write_config_byte(bridge, 0x33, 0x00);
-               if (did_correct)
-               {
-                   /*
-                    * set lower I/O base to 1000
-                    * That is, bits 0:3 are set to 0001 by default.
-                    * bits 7:4 contain I/O address bits 15:12
-                    * all others are assumed 0.
-                    */
-                   pci_write_config_byte(bridge, 0x1C, 0x11);
-                   /*
-                    * Set lower I/O limit to 1FFF
-                    * That is, bits 0:3 are reserved and always 0000
-                    * Bits 7:4 contain I/O address bits 15:12
-                    * All others are assumed F.
-                    */
-                   pci_write_config_byte(bridge, 0x1D, 0x10);
-                   pci_write_config_byte(bridge, 0x0D, 0x20);
-                   PRINTF("Corrected bridge resource range of bridge at %02x:%02x:%02x\n",
-                          PCI_BUS(bridge), PCI_DEV(bridge), PCI_FUNC(bridge));
-
-               }
-               else
-               {
-                   /*
-                    * This card doesn't have I/O, we disable I/O forwarding
-                    */
-                   pci_write_config_byte(bridge, 0x1C, 0x11);
-                   pci_write_config_byte(bridge, 0x1D, 0x00);
-                   pci_write_config_byte(bridge, PCI_INTERRUPT_LINE, 0);
-                   pci_write_config_byte(bridge, PCI_INTERRUPT_PIN, 0);
-                   pci_write_config_dword(bridge, PCI_COMMAND, PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER | PCI_COMMAND_IO);
-                   PRINTF("Disabled bridge resource range of bridge at %02x:%02x:%02x\n",
-                          PCI_BUS(bridge), PCI_DEV(bridge), PCI_FUNC(bridge));
-
-               }
-           }
-           /*
-            * Correct the prefetchable memory base, which is not set correctly by
-            * the U-Boot autoconfig stuff
-            */
-           if (prefetch_idx)
-           {
-/*             PRINTF("Setting prefetchable range to %x, %x (%x and %x)\n", */
-/*                    prefetch_addr, prefetch_addr+prefetch_size, */
-/*                    prefetch_addr>>16, (prefetch_addr+prefetch_size)>>16); */
-/*             pci_write_config_word(bridge, PCI_PREF_MEMORY_BASE, (prefetch_addr>>16)); */
-/*             pci_write_config_word(bridge, PCI_PREF_MEMORY_LIMIT, (prefetch_addr+prefetch_size)>>16); */
-           }
-
-           pci_write_config_word(bridge, PCI_PREF_MEMORY_BASE, 0x1000);
-           pci_write_config_word(bridge, PCI_PREF_MEMORY_LIMIT, 0x0000);
-
-           pci_write_config_byte(bridge, 0xD0, 0x0A);
-           pci_write_config_byte(bridge, 0xD3, 0x04);
-
-           /*
-            * Set the interrupt pin to 0
-            */
-#if 0
-           pci_write_config_byte(dev, PCI_INTERRUPT_LINE, 0);
-           pci_write_config_byte(dev, PCI_INTERRUPT_PIN, 0);
-#endif
-           pci_write_config_byte(bridge, PCI_INTERRUPT_LINE, 0);
-           pci_write_config_byte(bridge, PCI_INTERRUPT_PIN, 0);
-
-       }
-    }
-
-    /* Finally, enable the card's IO and memory response */
-    pci_write_config_dword(dev, PCI_COMMAND, PCI_COMMAND_MEMORY | PCI_COMMAND_IO);
-    pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, 0);
-    pci_write_config_byte(dev, PCI_LATENCY_TIMER, 0);
-
-    return 1;
-}
-
-int find_image(u32 rom_address, u32 rom_size, void **image, u32 *image_size)
-{
-    int i = 0;
-    unsigned char *rom = (unsigned char *)rom_address;
-    /* if (*rom != 0x55 || *(rom+1) != 0xAA) return 0; /* No bios rom this is, yes. */ */
-
-    for (;;)
-    {
-       unsigned short pci_data_offset = *(rom+0x18) + 256 * *(rom+0x19);
-       unsigned short pci_image_length = (*(rom+pci_data_offset+0x10) + 256 * *(rom+pci_data_offset+0x11)) * 512;
-       unsigned char pci_image_type = *(rom+pci_data_offset+0x14);
-       if (*rom != 0x55 || *(rom+1) != 0xAA)
-       {
-           PRINTF("Invalid header this is\n");
-           return 0;
-       }
-       PRINTF("Image %i: Type %d (%s)\n", i++, pci_image_type,
-              pci_image_type==0 ? "x86" :
-              pci_image_type==1 ? "OpenFirmware" :
-              "Unknown");
-       if (pci_image_type == 0)
-       {
-           *image = rom;
-           *image_size = pci_image_length;
-           return 1;
-       }
-
-       if (*(rom+pci_data_offset+0x15) & 0x80)
-       {
-           PRINTF("LAST image encountered, no image found\n");
-           return 0;
-       }
-
-       rom += pci_image_length;
-    }
-}
-
-void show_bat_mapping(void)
-{
-    u32 dbat0u, dbat0l, ibat0u, ibat0l;
-    u32 dbat1u, dbat1l, ibat1u, ibat1l;
-    u32 dbat2u, dbat2l, ibat2u, ibat2l;
-    u32 dbat3u, dbat3l, ibat3u, ibat3l;
-    u32 msr, hid0, l2cr_reg;
-
-    __asm volatile ("mfdbatu %0,0" : "=r" (dbat0u));
-    __asm volatile ("mfdbatl %0,0" : "=r" (dbat0l));
-    __asm volatile ("mfibatu %0,0" : "=r" (ibat0u));
-    __asm volatile ("mfibatl %0,0" : "=r" (ibat0l));
-
-    __asm volatile ("mfdbatu %0,1" : "=r" (dbat1u));
-    __asm volatile ("mfdbatl %0,1" : "=r" (dbat1l));
-    __asm volatile ("mfibatu %0,1" : "=r" (ibat1u));
-    __asm volatile ("mfibatl %0,1" : "=r" (ibat1l));
-
-    __asm volatile ("mfdbatu %0,2" : "=r" (dbat2u));
-    __asm volatile ("mfdbatl %0,2" : "=r" (dbat2l));
-    __asm volatile ("mfibatu %0,2" : "=r" (ibat2u));
-    __asm volatile ("mfibatl %0,2" : "=r" (ibat2l));
-
-    __asm volatile ("mfdbatu %0,3" : "=r" (dbat3u));
-    __asm volatile ("mfdbatl %0,3" : "=r" (dbat3l));
-    __asm volatile ("mfibatu %0,3" : "=r" (ibat3u));
-    __asm volatile ("mfibatl %0,3" : "=r" (ibat3l));
-
-    __asm volatile ("mfmsr %0"     : "=r" (msr));
-    __asm volatile ("mfspr %0,1008": "=r" (hid0));
-    __asm volatile ("mfspr %0,1017": "=r" (l2cr_reg));
-
-    printf("dbat0u: %08x dbat0l: %08x ibat0u: %08x ibat0l: %08x\n",
-          dbat0u, dbat0l, ibat0u, ibat0l);
-    printf("dbat1u: %08x dbat1l: %08x ibat1u: %08x ibat1l: %08x\n",
-          dbat1u, dbat1l, ibat1u, ibat1l);
-    printf("dbat2u: %08x dbat2l: %08x ibat2u: %08x ibat2l: %08x\n",
-          dbat2u, dbat2l, ibat2u, ibat2l);
-    printf("dbat3u: %08x dbat3l: %08x ibat3u: %08x ibat3l: %08x\n",
-          dbat3u, dbat3l, ibat3u, ibat3l);
-
-    printf("\nMSR: %08x   HID0: %08x   L2CR: %08x \n", msr,hid0, l2cr_reg);
-}
-
-
-void remove_init_data(void)
-{
-    char *s;
-
-    /*  Invalidate and disable data cache */
-    invalidate_l1_data_cache();
-    dcache_disable();
-
-    s = getenv("x86_cache");
-
-    if (!s)
-    {
-       icache_enable();
-       dcache_enable();
-    }
-    else if (s)
-    {
-       if (strcmp(s, "dcache")==0)
-       {
-           dcache_enable();
-       }
-       else if (strcmp(s, "icache") == 0)
-       {
-           icache_enable();
-       }
-       else if (strcmp(s, "on")== 0 || strcmp(s, "both") == 0)
-       {
-           dcache_enable();
-           icache_enable();
-       }
-    }
-
-    /*   show_bat_mapping();*/
-}
diff --git a/board/MAI/bios_emulator/glue.h b/board/MAI/bios_emulator/glue.h
deleted file mode 100644 (file)
index 585efe1..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-#ifndef GLUE_H
-#define GLUE_H
-
-typedef unsigned int pci_dev_t;
-
-int mypci_find_device(int vendor, int product, int index);
-int mypci_bus(int device);
-int mypci_devfn(int device);
-unsigned long get_bar_size(pci_dev_t dev, int offset);
-
-u8   mypci_read_cfg_byte(int bus, int devfn, int offset);
-u16  mypci_read_cfg_word(int bus, int devfn, int offset);
-u32  mypci_read_cfg_long(int bus, int devfn, int offset);
-
-void mypci_write_cfg_byte(int bus, int devfn, int offset, u8 value);
-void mypci_write_cfg_word(int bus, int devfn, int offset, u16 value);
-void mypci_write_cfg_long(int bus, int devfn, int offset, u32 value);
-
-void _printf(const char *fmt, ...);
-char *_getenv(char *name);
-
-void *malloc(size_t size);
-void memset(void *addr, int value, size_t size);
-void memcpy(void *to, void *from, size_t numbytes);
-int  strcmp(char *, char *);
-
-void enable_compatibility_hole(void);
-void disable_compatibility_hole(void);
-
-void map_rom(pci_dev_t dev, unsigned long address);
-void unmap_rom(pci_dev_t dev);
-int  attempt_map_rom(pci_dev_t dev, void *copy_address);
-
-#define  PCI_BASE_ADDRESS_SPACE 0x01    /* 0 = memory, 1 = I/O */
-#define  PCI_BASE_ADDRESS_SPACE_IO 0x01
-#define  PCI_BASE_ADDRESS_SPACE_MEMORY 0x00
-#define  PCI_BASE_ADDRESS_MEM_MASK      (~0x0fUL)
-
-#define PCI_BASE_ADDRESS_0      0x10    /* 32 bits */
-#define PCI_BASE_ADDRESS_1      0x14    /* 32 bits [htype 0,1 only] */
-#define PCI_BASE_ADDRESS_2      0x18    /* 32 bits [htype 0 only] */
-#define PCI_BASE_ADDRESS_3      0x1c    /* 32 bits */
-#define PCI_BASE_ADDRESS_4      0x20    /* 32 bits */
-#define PCI_BASE_ADDRESS_5      0x24    /* 32 bits */
-#define PCI_BUS(d)      (((d) >> 16) & 0xff)
-#define PCI_DEV(d)      (((d) >> 11) & 0x1f)
-#define PCI_FUNC(d)     (((d) >> 8) & 0x7)
-#define PCI_BDF(b,d,f)  ((b) << 16 | (d) << 11 | (f) << 8)
-
-#define PCI_ANY_ID (~0)
-#define PCI_ROM_ADDRESS         0x30    /* Bits 31..11 are address, 10..1 reserved */
-#define PCI_ROM_ADDRESS_ENABLE 0x01
-
-#define OFF(addr) ((addr) & 0xFFFF)
-#define SEG(addr) (((addr)>>4) &0xF000)
-
-#endif
diff --git a/board/MAI/bios_emulator/scitech/bin/bc31-d16.bat b/board/MAI/bios_emulator/scitech/bin/bc31-d16.bat
deleted file mode 100755 (executable)
index 776d138..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-@echo off
-REM Setup for compiling with Borland C++ 3.1.
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\DOS16\BC3;%BC3_PATH%\LIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\DOS16\BC3;%BC3_PATH%\LIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%BC3_PATH%\INCLUDE;
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\BC3.MK
-SET USE_DPMI16=
-SET USE_WIN16=
-SET USE_WIN32=
-SET USE_SNAP=
-PATH %SCITECH_BIN%;%BC3_PATH%\BIN;%DEFPATH%
-
-REM: Create Borland compile/link configuration scripts
-echo -I%INCLUDE% > %BC3_PATH%\BIN\turboc.cfg
-echo -L%LIB% >> %BC3_PATH%\BIN\turboc.cfg
-echo -L%LIB% > %BC3_PATH%\BIN\tlink.cfg
-
-echo Borland C++ 3.1 DOS compilation configuration set up.
diff --git a/board/MAI/bios_emulator/scitech/bin/bc45-c32.bat b/board/MAI/bios_emulator/scitech/bin/bc45-c32.bat
deleted file mode 100755 (executable)
index d2939f4..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-@echo off
-REM Setup for compiling with Borland C++ 4.5 in 32 bit Windows mode.
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\WIN32\BC4;%BC4_PATH%\LIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\WIN32\BC4;%BC4_PATH%\LIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%BC4_PATH%\INCLUDE;
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\BC32.MK
-SET USE_WIN16=
-SET USE_WIN32=1
-SET USE_VXD=
-SET USE_TNT=
-SET USE_BC5=
-SET WIN32_GUI=
-SET USE_SNAP=
-SET BC_LIBBASE=BC4
-PATH %SCITECH_BIN%;%BC4_PATH%\BIN;%DEFPATH%%BC_CD_PATH%
-
-REM: Enable Win32 SDK if desired (sdk on command line)
-if NOT .%1%==.sdk goto createfiles
-call win32sdk.bat borland
-
-:createfiles
-REM: Create Borland compile/link configuration scripts
-echo -I%INCLUDE% > %BC4_PATH%\BIN\bcc32.cfg
-echo -L%LIB% >> %BC4_PATH%\BIN\bcc32.cfg
-echo -L%LIB% > %BC4_PATH%\BIN\tlink32.cfg
-
-echo Borland C++ 4.5 32 bit Windows compilation configuration set up.
diff --git a/board/MAI/bios_emulator/scitech/bin/bc45-d16.bat b/board/MAI/bios_emulator/scitech/bin/bc45-d16.bat
deleted file mode 100755 (executable)
index 246517d..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-@echo off
-REM Setup for compiling with Borland C++ 4.5 in 16 bit mode.
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\DOS16\BC4;%BC4_PATH%\LIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\DOS16\BC4;%BC4_PATH%\LIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%BC4_PATH%\INCLUDE
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\BC16.MK
-SET USE_DPMI16=
-SET USE_WIN16=
-SET USE_WIN32=
-SET USE_VXD=
-SET USE_BC5=
-SET WIN32_GUI=
-SET USE_SNAP=
-SET BC_LIBBASE=BC4
-PATH %SCITECH_BIN%;%BC4_PATH%\BIN;%DEFPATH%%BC_CD_PATH%
-
-REM: Create Borland compile/link configuration scripts
-echo -I%INCLUDE% > %BC4_PATH%\BIN\turboc.cfg
-echo -L%LIB% >> %BC4_PATH%\BIN\turboc.cfg
-echo -L%LIB% > %BC4_PATH%\BIN\tlink.cfg
-
-echo Borland C++ 4.5 16 bit DOS compilation configuration set up.
diff --git a/board/MAI/bios_emulator/scitech/bin/bc45-d32.bat b/board/MAI/bios_emulator/scitech/bin/bc45-d32.bat
deleted file mode 100755 (executable)
index cbb2c79..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-@echo off
-REM Setup for compiling with Borland C++ 4.5 in 32 bit mode.
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\DOS32\BC4;%BC4_PATH%\LIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\DOS32\BC4;%BC4_PATH%\LIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%BC4_PATH%\INCLUDE;
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\BC32.MK
-SET USE_DPMI16=
-SET USE_WIN16=
-SET USE_WIN32=
-SET USE_VXD=
-SET USE_TNT=
-SET USE_BC5=
-SET WIN32_GUI=
-SET USE_SNAP=
-SET BC_LIBBASE=BC4
-PATH %SCITECH_BIN%;%BC4_PATH%\BIN;%DEFPATH%%BC_CD_PATH%
-
-REM: Create Borland compile/link configuration scripts
-echo -I%INCLUDE% > %BC4_PATH%\BIN\bcc32.cfg
-echo -L%LIB% >> %BC4_PATH%\BIN\bcc32.cfg
-echo -L%LIB% > %BC4_PATH%\BIN\tlink32.cfg
-
-echo Borland C++ 4.5 32 bit DOS compilation configuration set up (DPMI32).
diff --git a/board/MAI/bios_emulator/scitech/bin/bc45-snp.bat b/board/MAI/bios_emulator/scitech/bin/bc45-snp.bat
deleted file mode 100755 (executable)
index 14d7c05..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-@echo off
-REM Setup for compiling with Borland C++ 4.5 in 32 bit Windows mode.
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\SNAP\BC4;%BC4_PATH%\LIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\SNAP\BC4;%BC4_PATH%\LIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\BC32.MK
-SET USE_WIN16=
-SET USE_WIN32=
-SET USE_VXD=
-SET USE_TNT=
-SET USE_BC5=
-SET WIN32_GUI=
-SET USE_SNAP=1
-SET BC_LIBBASE=BC4
-PATH %SCITECH_BIN%;%BC4_PATH%\BIN;%DEFPATH%%BC_CD_PATH%
-
-REM: Create Borland compile/link configuration scripts
-echo -I%INCLUDE% > %BC4_PATH%\BIN\bcc32.cfg
-echo -L%LIB% >> %BC4_PATH%\BIN\bcc32.cfg
-echo -L%LIB% > %BC4_PATH%\BIN\tlink32.cfg
-
-echo Borland C++ 4.5 Snap compilation configuration set up.
diff --git a/board/MAI/bios_emulator/scitech/bin/bc45-tnt.bat b/board/MAI/bios_emulator/scitech/bin/bc45-tnt.bat
deleted file mode 100755 (executable)
index 50bd3cb..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-@echo off
-REM Setup for compiling with Borland C++ 4.5 in 32 bit mode with Phar Lap TNT
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\DOS32\BC4;%BC4_PATH%\LIB;%TNT_PATH%\LIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\DOS32\BC4;%BC4_PATH%\LIB;%TNT_PATH%\LIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%BC4_PATH%\INCLUDE;%TNT_PATH%\INCLUDE;
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\BC32.MK
-SET USE_DPMI16=
-SET USE_WIN16=
-SET USE_WIN32=
-SET USE_VXD=
-SET USE_TNT=1
-SET USE_BC5=
-SET WIN32_GUI=
-SET USE_SNAP=
-SET BC_LIBBASE=BC4
-PATH %SCITECH_BIN%;%BC4_PATH%\BIN;%TNT_PATH%\BIN;%DEFPATH%%BC_CD_PATH%
-
-REM If you set the following to a 1, a TNT DosStyle app will be created.
-REM Otherwise a TNT NtStyle app will be created. NtStyle apps will *only*
-REM run under real DOS when using our libraries, since we require access
-REM to functions that the Win32 API does not support (such as direct access
-REM to video memory, calling Int 10h BIOS functions etc). DosStyle apps
-REM will however run fine in both DOS and a Win95 DOS box (NT DOS boxes don't
-REM work too well).
-REM
-REM If you are using the RealTime DOS extender, your apps *must* be NtStyle,
-REM and hence will never be able to run under Win95 or WinNT, only DOS.
-
-SET DOSSTYLE=
-
-REM: Create Borland compile/link configuration scripts
-echo -I%INCLUDE% > %BC4_PATH%\BIN\bcc32.cfg
-echo -L%LIB% >> %BC4_PATH%\BIN\bcc32.cfg
-echo -L%LIB% > %BC4_PATH%\BIN\tlink32.cfg
-
-echo Borland C++ 4.5 32 bit DOS compilation configuration set up (TNT).
diff --git a/board/MAI/bios_emulator/scitech/bin/bc45-vxd.bat b/board/MAI/bios_emulator/scitech/bin/bc45-vxd.bat
deleted file mode 100755 (executable)
index 4b59fa4..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-@echo off
-REM Setup for compiling with Borland C++ 4.5 in 32 bit Windows VxD mode.
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\VXD\BC4;%BC4_PATH%\LIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\VXD\BC4;%BC4_PATH%\LIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%BC4_PATH%\INCLUDE;
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\BC32.MK
-SET USE_WIN16=
-SET USE_WIN32=
-SET USE_VXD=1
-SET USE_TNT=
-SET USE_BC5=
-SET WIN32_GUI=
-SET USE_SNAP=
-SET BC_LIBBASE=BC4
-PATH %SCITECH_BIN%;%BC4_PATH%\BIN;%DEFPATH%%BC_CD_PATH%
-
-REM: Create Borland compile/link configuration scripts
-echo -I%INCLUDE% > %BC4_PATH%\BIN\bcc32.cfg
-echo -L%LIB% >> %BC4_PATH%\BIN\bcc32.cfg
-echo -L%LIB% > %BC4_PATH%\BIN\tlink32.cfg
-
-echo Borland C++ 4.5 32-bit VxD compilation configuration set up.
diff --git a/board/MAI/bios_emulator/scitech/bin/bc45-w16.bat b/board/MAI/bios_emulator/scitech/bin/bc45-w16.bat
deleted file mode 100755 (executable)
index 4d799b4..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-@echo off
-REM Setup for compiling with Borland C++ 4.5 in 16 bit Windows mode.
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\WIN16\BC4;%BC4_PATH%\LIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\WIN16\BC4;%BC4_PATH%\LIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%BC4_PATH%\INCLUDE;
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\BC16.MK
-SET USE_DPMI16=
-SET USE_WIN16=1
-SET USE_WIN32=
-SET USE_VXD=
-SET USE_BC5=
-SET WIN32_GUI=
-SET USE_SNAP=
-SET BC_LIBBASE=BC4
-PATH %SCITECH_BIN%;%BC4_PATH%\BIN;%DEFPATH%%BC_CD_PATH%
-
-REM: Create Borland compile/link configuration scripts
-echo -I%INCLUDE% > %BC4_PATH%\BIN\turboc.cfg
-echo -L%LIB% >> %BC4_PATH%\BIN\turboc.cfg
-echo -L%LIB% > %BC4_PATH%\BIN\tlink.cfg
-
-echo Borland C++ 4.5 16 bit Windows compilation configuration set up.
diff --git a/board/MAI/bios_emulator/scitech/bin/bc45-w32.bat b/board/MAI/bios_emulator/scitech/bin/bc45-w32.bat
deleted file mode 100755 (executable)
index a6c199f..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-@echo off
-REM Setup for compiling with Borland C++ 4.5 in 32 bit Windows mode.
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\WIN32\BC4;%BC4_PATH%\LIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\WIN32\BC4;%BC4_PATH%\LIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%BC4_PATH%\INCLUDE;
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\BC32.MK
-SET USE_WIN16=
-SET USE_WIN32=1
-SET USE_VXD=
-SET USE_TNT=
-SET USE_BC5=
-SET WIN32_GUI=1
-SET USE_SNAP=
-SET BC_LIBBASE=BC4
-PATH %SCITECH_BIN%;%BC4_PATH%\BIN;%DEFPATH%%BC_CD_PATH%
-
-REM: Enable Win32 SDK if desired (sdk on command line)
-if NOT .%1%==.sdk goto createfiles
-call win32sdk.bat borland
-
-:createfiles
-REM: Create Borland compile/link configuration scripts
-echo -I%INCLUDE% > %BC4_PATH%\BIN\bcc32.cfg
-echo -L%LIB% >> %BC4_PATH%\BIN\bcc32.cfg
-echo -L%LIB% > %BC4_PATH%\BIN\tlink32.cfg
-
-echo Borland C++ 4.5 32 bit Windows compilation configuration set up.
diff --git a/board/MAI/bios_emulator/scitech/bin/bc50-c32.bat b/board/MAI/bios_emulator/scitech/bin/bc50-c32.bat
deleted file mode 100755 (executable)
index 6a0fde2..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-@echo off
-REM Setup for compiling with Borland C++ 5.0 in 32 bit Windows mode.
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\WIN32\BC5;%BC5_PATH%\LIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\WIN32\BC5;%BC5_PATH%\LIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET C_INCLUDE=%BC5_PATH%\INCLUDE
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%C_INCLUDE%
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\BC32.MK
-SET USE_WIN16=
-SET USE_WIN32=1
-SET USE_VXD=
-SET USE_TNT=
-SET USE_SMX32=
-SET USE_SMX16=
-SET USE_BC5=1
-SET WIN32_GUI=
-SET USE_SNAP=
-SET BC_LIBBASE=BC5
-PATH %SCITECH_BIN%;%BC5_PATH%\BIN;%DEFPATH%%BC5_CD_PATH%
-
-REM: Enable Win32 SDK if desired (sdk on command line)
-if NOT .%1%==.sdk goto createfiles
-call win32sdk.bat borland
-
-:createfiles
-REM: Create Borland compile/link configuration scripts
-echo -I%INCLUDE% > %BC5_PATH%\BIN\bcc32.cfg
-echo -L%LIB% >> %BC5_PATH%\BIN\bcc32.cfg
-echo -L%LIB% > %BC5_PATH%\BIN\tlink32.cfg
-
-echo Borland C++ 5.0 32 bit Windows compilation configuration set up.
diff --git a/board/MAI/bios_emulator/scitech/bin/bc50-d16.bat b/board/MAI/bios_emulator/scitech/bin/bc50-d16.bat
deleted file mode 100755 (executable)
index 23b5038..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-@echo off
-REM Setup for compiling with Borland C++ 5.0 in 16 bit mode.
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\DOS16\BC5;%BC5_PATH%\LIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\DOS16\BC5;%BC5_PATH%\LIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%BC5_PATH%\INCLUDE;
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\BC16.MK
-SET USE_DPMI16=
-SET USE_WIN16=
-SET USE_WIN32=
-SET USE_VXD=
-SET USE_SMX32=
-SET USE_SMX16=
-SET USE_BC5=1
-SET WIN32_GUI=
-SET USE_SNAP=
-SET BC_LIBBASE=BC5
-PATH %SCITECH_BIN%;%BC5_PATH%\BIN;%DEFPATH%%BC5_CD_PATH%
-
-REM: Create Borland compile/link configuration scripts
-echo -I%INCLUDE% > %BC5_PATH%\BIN\turboc.cfg
-echo -L%LIB% >> %BC5_PATH%\BIN\turboc.cfg
-echo -L%LIB% > %BC5_PATH%\BIN\tlink.cfg
-
-echo Borland C++ 5.0 16 bit DOS compilation configuration set up.
diff --git a/board/MAI/bios_emulator/scitech/bin/bc50-d32.bat b/board/MAI/bios_emulator/scitech/bin/bc50-d32.bat
deleted file mode 100755 (executable)
index 0521f93..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-@echo off
-REM Setup for compiling with Borland C++ 5.0 in 32 bit mode.
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\DOS32\BC5;%BC5_PATH%\LIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\DOS32\BC5;%BC5_PATH%\LIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%BC5_PATH%\INCLUDE;
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\BC32.MK
-SET USE_DPMI16=
-SET USE_WIN16=
-SET USE_WIN32=
-SET USE_VXD=
-SET USE_TNT=
-SET USE_SMX32=
-SET USE_SMX16=
-SET USE_BC5=1
-SET WIN32_GUI=
-SET USE_SNAP=
-SET BC_LIBBASE=BC5
-PATH %SCITECH_BIN%;%BC5_PATH%\BIN;%DEFPATH%%BC5_CD_PATH%
-
-REM: Create Borland compile/link configuration scripts
-echo -I%INCLUDE% > %BC5_PATH%\BIN\bcc32.cfg
-echo -L%LIB% >> %BC5_PATH%\BIN\bcc32.cfg
-echo -L%LIB% > %BC5_PATH%\BIN\tlink32.cfg
-
-echo Borland C++ 5.0 32 bit DOS compilation configuration set up (DPMI32).
diff --git a/board/MAI/bios_emulator/scitech/bin/bc50-smx.bat b/board/MAI/bios_emulator/scitech/bin/bc50-smx.bat
deleted file mode 100755 (executable)
index e3241ff..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-@echo off
-REM Setup for compiling with Borland C++ 5.0 in 32 bit mode.
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\SMX32\BC5;%BC5_PATH%\LIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\SMX32\BC5;%BC5_PATH%\LIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%BC5_PATH%\INCLUDE;
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\BC32.MK
-SET USE_DPMI16=
-SET USE_WIN16=
-SET USE_WIN32=
-SET USE_VXD=
-SET USE_TNT=
-SET USE_SMX32=1
-SET USE_SMX16=
-SET USE_BC5=1
-SET WIN32_GUI=
-SET USE_SNAP=
-SET BC_LIBBASE=BC5
-PATH %SCITECH_BIN%;%BC5_PATH%\BIN;%DEFPATH%%BC5_CD_PATH%
-
-REM: Create Borland compile/link configuration scripts
-echo -I%INCLUDE% > %BC5_PATH%\BIN\bcc32.cfg
-echo -L%LIB% >> %BC5_PATH%\BIN\bcc32.cfg
-echo -L%LIB% > %BC5_PATH%\BIN\tlink32.cfg
-
-echo Borland C++ 5.0 32 bit SMX compilation configuration set up (SMX32).
diff --git a/board/MAI/bios_emulator/scitech/bin/bc50-snp.bat b/board/MAI/bios_emulator/scitech/bin/bc50-snp.bat
deleted file mode 100755 (executable)
index ab3acd2..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-@echo off
-REM Setup for compiling with Borland C++ 5.0 in 32 bit Windows mode.
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\SNAP\BC5;%BC5_PATH%\LIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\SNAP\BC5;%BC5_PATH%\LIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\BC32.MK
-SET USE_WIN16=
-SET USE_WIN32=
-SET USE_VXD=
-SET USE_TNT=
-SET USE_SMX32=
-SET USE_SMX16=
-SET USE_BC5=1
-SET WIN32_GUI=
-SET USE_SNAP=1
-SET BC_LIBBASE=BC5
-PATH %SCITECH_BIN%;%BC5_PATH%\BIN;%DEFPATH%%BC5_CD_PATH%
-
-REM: Create Borland compile/link configuration scripts
-echo -I%INCLUDE% > %BC5_PATH%\BIN\bcc32.cfg
-echo -L%LIB% >> %BC5_PATH%\BIN\bcc32.cfg
-echo -L%LIB% > %BC5_PATH%\BIN\tlink32.cfg
-
-echo Borland C++ 5.0 Snap compilation configuration set up.
diff --git a/board/MAI/bios_emulator/scitech/bin/bc50-tnt.bat b/board/MAI/bios_emulator/scitech/bin/bc50-tnt.bat
deleted file mode 100755 (executable)
index 4dcc372..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-@echo off
-REM Setup for compiling with Borland C++ 5.0 in 32 bit mode with Phar Lap TNT
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\DOS32\BC5;%BC5_PATH%\LIB;%TNT_PATH%\LIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\DOS32\BC5;%BC5_PATH%\LIB;%TNT_PATH%\LIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%BC5_PATH%\INCLUDE;%TNT_PATH%\INCLUDE;
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\BC32.MK
-SET USE_DPMI16=
-SET USE_WIN16=
-SET USE_WIN32=
-SET USE_VXD=
-SET USE_TNT=1
-SET USE_SMX32=
-SET USE_SMX16=
-SET USE_BC5=1
-SET WIN32_GUI=
-SET USE_SNAP=
-SET BC_LIBBASE=BC5
-PATH %SCITECH_BIN%;%BC5_PATH%\BIN;%TNT_PATH%\BIN;%DEFPATH%%BC_CD_PATH%
-
-REM If you set the following to a 1, a TNT DosStyle app will be created.
-REM Otherwise a TNT NtStyle app will be created. NtStyle apps will *only*
-REM run under real DOS when using our libraries, since we require access
-REM to functions that the Win32 API does not support (such as direct access
-REM to video memory, calling Int 10h BIOS functions etc). DosStyle apps
-REM will however run fine in both DOS and a Win95 DOS box (NT DOS boxes don't
-REM work too well).
-REM
-REM If you are using the RealTime DOS extender, your apps *must* be NtStyle,
-REM and hence will never be able to run under Win95 or WinNT, only DOS.
-
-SET DOSSTYLE=
-
-REM: Create Borland compile/link configuration scripts
-echo -I%INCLUDE% > %BC5_PATH%\BIN\bcc32.cfg
-echo -L%LIB% >> %BC5_PATH%\BIN\bcc32.cfg
-echo -L%LIB% > %BC5_PATH%\BIN\tlink32.cfg
-
-echo Borland C++ 5.0 32 bit DOS compilation configuration set up (TNT).
diff --git a/board/MAI/bios_emulator/scitech/bin/bc50-vxd.bat b/board/MAI/bios_emulator/scitech/bin/bc50-vxd.bat
deleted file mode 100755 (executable)
index 2356911..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-@echo off
-REM Setup for compiling with Borland C++ 5.0 in 32 bit Windows mode.
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\VXD\BC5;%BC5_PATH%\LIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\VXD\BC5;%BC5_PATH%\LIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%BC5_PATH%\INCLUDE;
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\BC32.MK
-SET USE_WIN16=
-SET USE_WIN32=
-SET USE_VXD=1
-SET USE_TNT=
-SET USE_SMX32=
-SET USE_SMX16=
-SET USE_BC5=1
-SET WIN32_GUI=
-SET USE_SNAP=
-SET BC_LIBBASE=BC5
-PATH %SCITECH_BIN%;%BC5_PATH%\BIN;%DEFPATH%%BC5_CD_PATH%
-
-REM: Create Borland compile/link configuration scripts
-echo -I%INCLUDE% > %BC5_PATH%\BIN\bcc32.cfg
-echo -L%LIB% >> %BC5_PATH%\BIN\bcc32.cfg
-echo -L%LIB% > %BC5_PATH%\BIN\tlink32.cfg
-
-echo Borland C++ 5.0 32 bit Windows (VxD) compilation configuration set up.
diff --git a/board/MAI/bios_emulator/scitech/bin/bc50-w16.bat b/board/MAI/bios_emulator/scitech/bin/bc50-w16.bat
deleted file mode 100755 (executable)
index cd79d86..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- @echo off
-REM Setup for compiling with Borland C++ 5.0 in 16 bit Windows mode.
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\WIN16\BC5;%BC5_PATH%\LIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\WIN16\BC5;%BC5_PATH%\LIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%BC5_PATH%\INCLUDE;
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\BC16.MK
-SET USE_DPMI16=
-SET USE_WIN16=1
-SET USE_WIN32=
-SET USE_VXD=
-SET USE_BC5=1
-SET USE_SMX32=
-SET USE_SMX16=
-SET WIN32_GUI=
-SET USE_SNAP=
-SET BC_LIBBASE=BC5
-PATH %SCITECH_BIN%;%BC5_PATH%\BIN;%DEFPATH%%BC5_CD_PATH%
-
-REM: Create Borland compile/link configuration scripts
-echo -I%INCLUDE% > %BC5_PATH%\BIN\turboc.cfg
-echo -L%LIB% >> %BC5_PATH%\BIN\turboc.cfg
-echo -L%LIB% > %BC5_PATH%\BIN\tlink.cfg
-
-echo Borland C++ 5.0 16 bit Windows compilation configuration set up.
diff --git a/board/MAI/bios_emulator/scitech/bin/bc50-w32.bat b/board/MAI/bios_emulator/scitech/bin/bc50-w32.bat
deleted file mode 100755 (executable)
index 8b8cec9..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-@echo off
-REM Setup for compiling with Borland C++ 5.0 in 32 bit Windows mode.
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\WIN32\BC5;%BC5_PATH%\LIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\WIN32\BC5;%BC5_PATH%\LIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET C_INCLUDE=%BC5_PATH%\INCLUDE
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%C_INCLUDE%
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\BC32.MK
-SET USE_WIN16=
-SET USE_WIN32=1
-SET USE_VXD=
-SET USE_TNT=
-SET USE_SMX32=
-SET USE_SMX16=
-SET USE_BC5=1
-SET WIN32_GUI=1
-SET USE_SNAP=
-SET BC_LIBBASE=BC5
-PATH %SCITECH_BIN%;%BC5_PATH%\BIN;%DEFPATH%%BC5_CD_PATH%
-
-REM: Enable Win32 SDK if desired (sdk on command line)
-if NOT .%1%==.sdk goto createfiles
-call win32sdk.bat borland
-
-:createfiles
-REM: Create Borland compile/link configuration scripts
-echo -I%INCLUDE% > %BC5_PATH%\BIN\bcc32.cfg
-echo -L%LIB% >> %BC5_PATH%\BIN\bcc32.cfg
-echo -L%LIB% > %BC5_PATH%\BIN\tlink32.cfg
-
-echo Borland C++ 5.0 32 bit Windows compilation configuration set up.
diff --git a/board/MAI/bios_emulator/scitech/bin/bc50-x11.bat b/board/MAI/bios_emulator/scitech/bin/bc50-x11.bat
deleted file mode 100755 (executable)
index ebfeb2e..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-@echo off
-REM Setup for compiling with Borland C++ 5.0 in 32 bit Windows mode.
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\WIN32\BC5;%BC5_PATH%\LIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\WIN32\BC5;%BC5_PATH%\LIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%BC5_PATH%\INCLUDE;
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\BC32.MK
-SET USE_WIN16=
-SET USE_WIN32=1
-SET USE_VXD=
-SET USE_TNT=
-SET USE_SMX32=
-SET USE_SMX16=
-SET USE_BC5=1
-SET WIN32_GUI=1
-SET USE_SNAP=
-SET BC_LIBBASE=BC5
-PATH %SCITECH_BIN%;%BC5_PATH%\BIN;%DEFPATH%%BC5_CD_PATH%
-
-REM: Create Borland compile/link configuration scripts
-echo -I%INCLUDE% > %BC5_PATH%\BIN\bcc32.cfg
-echo -L%LIB% >> %BC5_PATH%\BIN\bcc32.cfg
-echo -L%LIB% > %BC5_PATH%\BIN\tlink32.cfg
-
-echo Borland C++ 5.0 32 bit Windows compilation configuration set up.
diff --git a/board/MAI/bios_emulator/scitech/bin/bcb5-c32.bat b/board/MAI/bios_emulator/scitech/bin/bcb5-c32.bat
deleted file mode 100755 (executable)
index 6e09428..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-@echo off
-REM Setup for compiling with Borland C++ Builder 5.0 in 32 bit Windows mode.
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\WIN32\BCB5;%BCB5_PATH%\LIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\WIN32\BCB5;%BCB5_PATH%\LIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET C_INCLUDE=%BCB5_PATH%\INCLUDE
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%C_INCLUDE%
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\BC32.MK
-SET USE_WIN16=
-SET USE_WIN32=1
-SET USE_VXD=
-SET USE_TNT=
-SET USE_SMX32=
-SET USE_SMX16=
-SET USE_BC5=1
-SET WIN32_GUI=
-SET USE_SNAP=
-SET BC_LIBBASE=BC5
-PATH %SCITECH_BIN%;%BCB5_PATH%\BIN;%DEFPATH%%BC5_CD_PATH%
-
-REM: Enable Win32 SDK if desired (sdk on command line)
-if NOT .%1%==.sdk goto createfiles
-call win32sdk.bat borland
-
-:createfiles
-REM: Create Borland compile/link configuration scripts
-echo -I%INCLUDE% > %BCB5_PATH%\BIN\bcc32.cfg
-echo -L%LIB% >> %BCB5_PATH%\BIN\bcc32.cfg
-echo -L%LIB% > %BCB5_PATH%\BIN\tlink32.cfg
-
-echo Borland C++ Builder 5.0 32 bit Windows compilation configuration set up.
diff --git a/board/MAI/bios_emulator/scitech/bin/bcb5-d16.bat b/board/MAI/bios_emulator/scitech/bin/bcb5-d16.bat
deleted file mode 100755 (executable)
index aa13e7d..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-@echo off
-REM Setup for compiling with Borland C++ Builder 5.0 in 16 bit mode.
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\DOS16\BCB5;%BCB5_PATH%\LIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\DOS16\BCB5;%BCB5_PATH%\LIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%BCB5_PATH%\INCLUDE;
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\BC16.MK
-SET USE_DPMI16=
-SET USE_WIN16=
-SET USE_WIN32=
-SET USE_VXD=
-SET USE_SMX32=
-SET USE_SMX16=
-SET USE_BC5=1
-SET WIN32_GUI=
-SET USE_SNAP=
-SET BC_LIBBASE=BC5
-PATH %SCITECH_BIN%;%BCB5_PATH%\BIN;%DEFPATH%%BC5_CD_PATH%
-
-REM: Create Borland compile/link configuration scripts
-echo -I%INCLUDE% > %BCB5_PATH%\BIN\turboc.cfg
-echo -L%LIB% >> %BCB5_PATH%\BIN\turboc.cfg
-echo -L%LIB% > %BCB5_PATH%\BIN\tlink.cfg
-
-echo Borland C++ Builder 5.0 16 bit DOS compilation configuration set up.
diff --git a/board/MAI/bios_emulator/scitech/bin/bcb5-d32.bat b/board/MAI/bios_emulator/scitech/bin/bcb5-d32.bat
deleted file mode 100755 (executable)
index d0017d4..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-@echo off
-REM Setup for compiling with Borland C++ Builder 5.0 in 32 bit mode.
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\DOS32\BCB5;%BCB5_PATH%\LIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\DOS32\BCB5;%BCB5_PATH%\LIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%BCB5_PATH%\INCLUDE;
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\BC32.MK
-SET USE_DPMI16=
-SET USE_WIN16=
-SET USE_WIN32=
-SET USE_VXD=
-SET USE_TNT=
-SET USE_SMX32=
-SET USE_SMX16=
-SET USE_BC5=1
-SET WIN32_GUI=
-SET USE_SNAP=
-SET BC_LIBBASE=BC5
-PATH %SCITECH_BIN%;%BCB5_PATH%\BIN;%DEFPATH%%BC5_CD_PATH%
-
-REM: Create Borland compile/link configuration scripts
-echo -I%INCLUDE% > %BCB5_PATH%\BIN\bcc32.cfg
-echo -L%LIB% >> %BCB5_PATH%\BIN\bcc32.cfg
-echo -L%LIB% > %BCB5_PATH%\BIN\tlink32.cfg
-
-echo Borland C++ Builder 5.0 32 bit DOS compilation configuration set up (DPMI32).
diff --git a/board/MAI/bios_emulator/scitech/bin/bcb5-smx.bat b/board/MAI/bios_emulator/scitech/bin/bcb5-smx.bat
deleted file mode 100755 (executable)
index 2b969a9..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-@echo off
-REM Setup for compiling with Borland C++ Builder 5.0 in 32 bit mode.
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\SMX32\BCB5;%BCB5_PATH%\LIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\SMX32\BCB5;%BCB5_PATH%\LIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%BCB5_PATH%\INCLUDE;
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\BC32.MK
-SET USE_DPMI16=
-SET USE_WIN16=
-SET USE_WIN32=
-SET USE_VXD=
-SET USE_TNT=
-SET USE_SMX32=1
-SET USE_SMX16=
-SET USE_BC5=1
-SET WIN32_GUI=
-SET USE_SNAP=
-SET BC_LIBBASE=BC5
-PATH %SCITECH_BIN%;%BCB5_PATH%\BIN;%DEFPATH%%BC5_CD_PATH%
-
-REM: Create Borland compile/link configuration scripts
-echo -I%INCLUDE% > %BCB5_PATH%\BIN\bcc32.cfg
-echo -L%LIB% >> %BCB5_PATH%\BIN\bcc32.cfg
-echo -L%LIB% > %BCB5_PATH%\BIN\tlink32.cfg
-
-echo Borland C++ Builder 5.0 32 bit SMX compilation configuration set up (SMX32).
diff --git a/board/MAI/bios_emulator/scitech/bin/bcb5-snp.bat b/board/MAI/bios_emulator/scitech/bin/bcb5-snp.bat
deleted file mode 100755 (executable)
index d7b8ff2..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-@echo off
-REM Setup for compiling with Borland C++ Builder 5.0 in 32 bit Windows mode.
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\SNAP\BCB5;%BCB5_PATH%\LIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\SNAP\BCB5;%BCB5_PATH%\LIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\BC32.MK
-SET USE_WIN16=
-SET USE_WIN32=
-SET USE_VXD=
-SET USE_TNT=
-SET USE_SMX32=
-SET USE_SMX16=
-SET USE_BC5=1
-SET WIN32_GUI=
-SET USE_SNAP=1
-SET BC_LIBBASE=BC5
-PATH %SCITECH_BIN%;%BCB5_PATH%\BIN;%DEFPATH%%BC5_CD_PATH%
-
-REM: Create Borland compile/link configuration scripts
-echo -I%INCLUDE% > %BCB5_PATH%\BIN\bcc32.cfg
-echo -L%LIB% >> %BCB5_PATH%\BIN\bcc32.cfg
-echo -L%LIB% > %BCB5_PATH%\BIN\tlink32.cfg
-
-echo Borland C++ Builder 5.0 Snap compilation configuration set up.
diff --git a/board/MAI/bios_emulator/scitech/bin/bcb5-tnt.bat b/board/MAI/bios_emulator/scitech/bin/bcb5-tnt.bat
deleted file mode 100755 (executable)
index 1de3601..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-@echo off
-REM Setup for compiling with Borland C++ Builder 5.0 in 32 bit mode with Phar Lap TNT
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\DOS32\BCB5;%BCB5_PATH%\LIB;%TNT_PATH%\LIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\DOS32\BCB5;%BCB5_PATH%\LIB;%TNT_PATH%\LIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%BCB5_PATH%\INCLUDE;%TNT_PATH%\INCLUDE;
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\BC32.MK
-SET USE_DPMI16=
-SET USE_WIN16=
-SET USE_WIN32=
-SET USE_VXD=
-SET USE_TNT=1
-SET USE_SMX32=
-SET USE_SMX16=
-SET USE_BC5=1
-SET WIN32_GUI=
-SET USE_SNAP=
-SET BC_LIBBASE=BC5
-PATH %SCITECH_BIN%;%BCB5_PATH%\BIN;%TNT_PATH%\BIN;%DEFPATH%%BC_CD_PATH%
-
-REM If you set the following to a 1, a TNT DosStyle app will be created.
-REM Otherwise a TNT NtStyle app will be created. NtStyle apps will *only*
-REM run under real DOS when using our libraries, since we require access
-REM to functions that the Win32 API does not support (such as direct access
-REM to video memory, calling Int 10h BIOS functions etc). DosStyle apps
-REM will however run fine in both DOS and a Win95 DOS box (NT DOS boxes don't
-REM work too well).
-REM
-REM If you are using the RealTime DOS extender, your apps *must* be NtStyle,
-REM and hence will never be able to run under Win95 or WinNT, only DOS.
-
-SET DOSSTYLE=
-
-REM: Create Borland compile/link configuration scripts
-echo -I%INCLUDE% > %BCB5_PATH%\BIN\bcc32.cfg
-echo -L%LIB% >> %BCB5_PATH%\BIN\bcc32.cfg
-echo -L%LIB% > %BCB5_PATH%\BIN\tlink32.cfg
-
-echo Borland C++ Builder 5.0 32 bit DOS compilation configuration set up (TNT).
diff --git a/board/MAI/bios_emulator/scitech/bin/bcb5-vxd.bat b/board/MAI/bios_emulator/scitech/bin/bcb5-vxd.bat
deleted file mode 100755 (executable)
index 28de58c..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-@echo off
-REM Setup for compiling with Borland C++ Builder 5.0 in 32 bit Windows mode.
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\VXD\BCB5;%BCB5_PATH%\LIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\VXD\BCB5;%BCB5_PATH%\LIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%BCB5_PATH%\INCLUDE;
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\BC32.MK
-SET USE_WIN16=
-SET USE_WIN32=
-SET USE_VXD=1
-SET USE_TNT=
-SET USE_SMX32=
-SET USE_SMX16=
-SET USE_BC5=1
-SET WIN32_GUI=
-SET USE_SNAP=
-SET BC_LIBBASE=BC5
-PATH %SCITECH_BIN%;%BCB5_PATH%\BIN;%DEFPATH%%BC5_CD_PATH%
-
-REM: Create Borland compile/link configuration scripts
-echo -I%INCLUDE% > %BCB5_PATH%\BIN\bcc32.cfg
-echo -L%LIB% >> %BCB5_PATH%\BIN\bcc32.cfg
-echo -L%LIB% > %BCB5_PATH%\BIN\tlink32.cfg
-
-echo Borland C++ Builder 5.0 32 bit Windows (VxD) compilation configuration set up.
diff --git a/board/MAI/bios_emulator/scitech/bin/bcb5-w16.bat b/board/MAI/bios_emulator/scitech/bin/bcb5-w16.bat
deleted file mode 100755 (executable)
index c30d004..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
- @echo off
-REM Setup for compiling with Borland C++ Builder 5.0 in 16 bit Windows mode.
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\WIN16\BCB5;%BCB5_PATH%\LIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\WIN16\BCB5;%BCB5_PATH%\LIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%BCB5_PATH%\INCLUDE;
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\BC16.MK
-SET USE_DPMI16=
-SET USE_WIN16=1
-SET USE_WIN32=
-SET USE_VXD=
-SET USE_BC5=1
-SET USE_SMX32=
-SET USE_SMX16=
-SET WIN32_GUI=
-SET USE_SNAP=
-SET BC_LIBBASE=BC5
-PATH %SCITECH_BIN%;%BCB5_PATH%\BIN;%DEFPATH%%BC5_CD_PATH%
-
-REM: Create Borland compile/link configuration scripts
-echo -I%INCLUDE% > %BCB5_PATH%\BIN\turboc.cfg
-echo -L%LIB% >> %BCB5_PATH%\BIN\turboc.cfg
-echo -L%LIB% > %BCB5_PATH%\BIN\tlink.cfg
-
-echo Borland C++ Builder 5.0 16 bit Windows compilation configuration set up.
diff --git a/board/MAI/bios_emulator/scitech/bin/bcb5-w32.bat b/board/MAI/bios_emulator/scitech/bin/bcb5-w32.bat
deleted file mode 100755 (executable)
index 18760e1..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-@echo off
-REM Setup for compiling with Borland C++ Builder 5.0 in 32 bit Windows mode.
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\WIN32\BCB5;%BCB5_PATH%\LIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\WIN32\BCB5;%BCB5_PATH%\LIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET C_INCLUDE=%BCB5_PATH%\INCLUDE
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%C_INCLUDE%
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\BC32.MK
-SET USE_WIN16=
-SET USE_WIN32=1
-SET USE_VXD=
-SET USE_TNT=
-SET USE_SMX32=
-SET USE_SMX16=
-SET USE_BC5=1
-SET WIN32_GUI=1
-SET USE_SNAP=
-SET BC_LIBBASE=BC5
-PATH %SCITECH_BIN%;%BCB5_PATH%\BIN;%DEFPATH%%BC5_CD_PATH%
-
-REM: Enable Win32 SDK if desired (sdk on command line)
-if NOT .%1%==.sdk goto createfiles
-call win32sdk.bat borland
-
-:createfiles
-REM: Create Borland compile/link configuration scripts
-echo -I%INCLUDE% > %BCB5_PATH%\BIN\bcc32.cfg
-echo -L%LIB% >> %BCB5_PATH%\BIN\bcc32.cfg
-echo -L%LIB% > %BCB5_PATH%\BIN\tlink32.cfg
-
-echo Borland C++ Builder 5.0 32 bit Windows compilation configuration set up.
diff --git a/board/MAI/bios_emulator/scitech/bin/bcb5-x11.bat b/board/MAI/bios_emulator/scitech/bin/bcb5-x11.bat
deleted file mode 100755 (executable)
index 198c1a2..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-@echo off
-REM Setup for compiling with Borland C++ Builder 5.0 in 32 bit Windows mode.
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\WIN32\BCB5;%BCB5_PATH%\LIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\WIN32\BCB5;%BCB5_PATH%\LIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%BCB5_PATH%\INCLUDE;
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\BC32.MK
-SET USE_WIN16=
-SET USE_WIN32=1
-SET USE_VXD=
-SET USE_TNT=
-SET USE_SMX32=
-SET USE_SMX16=
-SET USE_BC5=1
-SET WIN32_GUI=1
-SET USE_SNAP=
-SET BC_LIBBASE=BC5
-PATH %SCITECH_BIN%;%BCB5_PATH%\BIN;%DEFPATH%%BC5_CD_PATH%
-
-REM: Create Borland compile/link configuration scripts
-echo -I%INCLUDE% > %BCB5_PATH%\BIN\bcc32.cfg
-echo -L%LIB% >> %BCB5_PATH%\BIN\bcc32.cfg
-echo -L%LIB% > %BCB5_PATH%\BIN\tlink32.cfg
-
-echo Borland C++ Builder 5.0 32 bit Windows compilation configuration set up.
diff --git a/board/MAI/bios_emulator/scitech/bin/build b/board/MAI/bios_emulator/scitech/bin/build
deleted file mode 100755 (executable)
index ff1973d..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#! /bin/sh
-
-if [ $# -lt 1 ] || ( [ "$1" != gcc-linux ] && [ "$1" != qnx4 ] ) ; then
-       echo Usage: $0 compiler_name [DMAKE commands]
-       echo
-       echo Current compilers:
-       echo "  gcc-linux  - GNU C/C++ 2.7 or higher, 32 bit"
-       echo "  qnx4  - Watcom C/C++ 10.6 or higher, 32 bit"
-       exit 1
-fi
-
-unset DBG OPT OPT_SIZE BUILD_DLL IMPORT_DLL FPU CHECKS BETA
-. ${1}.sh
-
-shift
-dmake $* && exit 0
-
-echo *************************************************
-echo * An error occurred while building the library. *
-echo *************************************************
-exit 1
-
diff --git a/board/MAI/bios_emulator/scitech/bin/build.bat b/board/MAI/bios_emulator/scitech/bin/build.bat
deleted file mode 100755 (executable)
index ee29093..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-@echo off
-rem Disable checked build and build release code
-set CHECKED=
-call build_it.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
diff --git a/board/MAI/bios_emulator/scitech/bin/build_db.bat b/board/MAI/bios_emulator/scitech/bin/build_db.bat
deleted file mode 100755 (executable)
index 2b32529..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-@echo off
-rem Enable checked build and build debug code
-set CHECKED=1
-call build_it.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
diff --git a/board/MAI/bios_emulator/scitech/bin/build_it.bat b/board/MAI/bios_emulator/scitech/bin/build_it.bat
deleted file mode 100755 (executable)
index 5a619b4..0000000
+++ /dev/null
@@ -1,432 +0,0 @@
-@echo off
-rem Generic batch file to build a version of the library. This batch file
-rem assumes that the correct batch files exist to setup the appropriate
-rem compilation environments, and that the DMAKE.EXE program is available
-rem somewhere on the path.
-rem
-rem Builds as release or debug depending on the value of the CHECKED
-rem environment variable.
-
-rem Unset all environment variables that change the compile process
-set DBG=
-set OPT=
-set OPT_SIZE=
-set BUILD_DLL=
-set IMPORT_DLL=
-set FPU=
-set CHECKS=
-set BETA=
-
-if %1==bc31-d16 goto bc31-d16
-if %1==bc45-d16 goto bc45-d16
-if %1==bc45-d32 goto bc45-d32
-if %1==bc45-tnt goto bc45-tnt
-if %1==bc45-w16 goto bc45-w16
-if %1==bc45-w32 goto bc45-w32
-if %1==bc45-c32 goto bc45-c32
-if %1==bc45-vxd goto bc45-vxd
-if %1==bc45-snp goto bc45-snp
-if %1==bc50-d16 goto bc50-d16
-if %1==bc50-d32 goto bc50-d32
-if %1==bc50-tnt goto bc50-tnt
-if %1==bc50-w16 goto bc50-w16
-if %1==bc50-w32 goto bc50-w32
-if %1==bc50-c32 goto bc50-c32
-if %1==bc50-vxd goto bc50-vxd
-if %1==bc50-snp goto bc50-snp
-if %1==gcc2-d32 goto gcc2-d32
-if %1==gcc2-w32 goto gcc2-w32
-if %1==gcc2-c32 goto gcc2-c32
-if %1==gcc2-linux goto gcc2-linux
-if %1==vc40-d16 goto vc40-d16
-if %1==vc40-tnt goto vc40-tnt
-if %1==vc40-w16 goto vc40-w16
-if %1==vc40-w32 goto vc40-w32
-if %1==vc40-c32 goto vc40-c32
-if %1==vc40-drv9x goto vc40-drv9x
-if %1==vc40-drvnt goto vc40-drvnt
-if %1==vc40-rtt goto vc40-rtt
-if %1==vc40-snp goto vc40-snp
-if %1==vc50-d16 goto vc50-d16
-if %1==vc50-tnt goto vc50-tnt
-if %1==vc50-w16 goto vc50-w16
-if %1==vc50-w32 goto vc50-w32
-if %1==vc50-c32 goto vc50-c32
-if %1==vc50-drv9x goto vc50-drv9x
-if %1==vc50-drvnt goto vc50-drvnt
-if %1==vc50-rtt goto vc50-rtt
-if %1==vc50-snp goto vc50-snp
-if %1==vc60-d16 goto vc60-d16
-if %1==vc60-tnt goto vc60-tnt
-if %1==vc60-w16 goto vc60-w16
-if %1==vc60-w32 goto vc60-w32
-if %1==vc60-c32 goto vc60-c32
-if %1==vc60-drv9x goto vc60-drv9x
-if %1==vc60-drvnt goto vc60-drvnt
-if %1==vc60-drvw2k goto vc60-drvw2k
-if %1==vc60-rtt goto vc60-rtt
-if %1==vc60-snp goto vc60-snp
-if %1==wc10ad16 goto wc10ad16
-if %1==wc10ad32 goto wc10ad32
-if %1==wc10atnt goto wc10atnt
-if %1==wc10aw16 goto wc10aw16
-if %1==wc10aw32 goto wc10aw32
-if %1==wc10ac32 goto wc10ac32
-if %1==wc10ao32 goto wc10ao32
-if %1==wc10ap32 goto wc10ap32
-if %1==wc10asnp goto wc10asnp
-if %1==wc10-d16 goto wc10-d16
-if %1==wc10-d32 goto wc10-d32
-if %1==wc10-tnt goto wc10-tnt
-if %1==wc10-w16 goto wc10-w16
-if %1==wc10-w32 goto wc10-w32
-if %1==wc10-c32 goto wc10-c32
-if %1==wc10-o32 goto wc10-o32
-if %1==wc10-p32 goto wc10-p32
-if %1==wc10-snp goto wc10-snp
-if %1==wc11-d16 goto wc11-d16
-if %1==wc11-d32 goto wc11-d32
-if %1==wc11-tnt goto wc11-tnt
-if %1==wc11-w16 goto wc11-w16
-if %1==wc11-w32 goto wc11-w32
-if %1==wc11-c32 goto wc11-c32
-if %1==wc11-o32 goto wc11-o32
-if %1==wc11-p32 goto wc11-p32
-if %1==wc11-snp goto wc11-snp
-
-echo Usage: BUILD 'compiler_name' [DMAKE commands]
-echo.
-echo Where 'compiler_name' is of the form comp-os, where
-echo 'comp' defines the compiler and 'os' defines the OS environment.
-echo For instance 'bc50-w32' is for Borland C++ 5.0 for Win32.
-echo The value of 'comp' can be any of the following:
-echo.
-echo    bc45 - Borland C++ 4.5x
-echo    bc50 - Borland C++ 5.x
-echo    vc40 - Visual C++ 4.x
-echo    vc50 - Visual C++ 5.x
-echo    vc60 - Visual C++ 6.x
-echo    wc10 - Watcom C++ 10.6
-echo    wc11 - Watcom C++ 11.0
-echo    gcc2 - GNU C/C++ 2.9x
-echo.
-echo The value of 'os' can be one of the following:
-echo.
-echo    d16   - 16-bit DOS
-echo    d32   - 32-bit DOS
-echo    w16   - 16-bit Windows GUI mode
-echo    c32   - 32-bit Windows console mode
-echo    w32   - 32-bit Windows GUI mode
-echo    o16   - 16-bit OS/2 console mode
-echo    o32   - 32-bit OS/2 console mode
-echo    p32   - 32-bit OS/2 Presentation Manager
-echo    snp   - 32-bit SciTech Snap application
-echo    linux - 32-bit Linux application
-goto end
-
-rem -------------------------------------------------------------------------
-rem Setup for the specified compiler
-
-:bc31-d16
-call bc31-d16.bat
-goto compileit
-
-:bc45-d16
-call bc45-d16.bat
-goto compileit
-
-:bc45-d32
-call bc45-d32.bat
-goto compileit
-
-:bc45-tnt
-call bc45-tnt.bat
-goto compileit
-
-:bc45-w16
-call bc45-w16.bat
-goto compileit
-
-:bc45-w32
-call bc45-w32.bat
-goto compileit
-
-:bc45-c32
-call bc45-c32.bat
-goto compileit
-
-:bc45-vxd
-call bc45-vxd.bat
-goto compileit
-
-:bc50-d16
-call bc50-d16.bat
-goto compileit
-
-:bc50-d32
-call bc50-d32.bat
-goto compileit
-
-:bc50-tnt
-call bc50-tnt.bat
-goto compileit
-
-:bc50-w16
-call bc50-w16.bat
-goto compileit
-
-:bc50-w32
-call bc50-w32.bat
-goto compileit
-
-:bc50-c32
-call bc50-c32.bat
-goto compileit
-
-:bc50-vxd
-call bc50-vxd.bat
-goto compileit
-
-:gcc2-d32
-call gcc2-d32.bat
-goto compileit
-
-:gcc2-w32
-call gcc2-w32.bat
-goto compileit
-
-:gcc2-c32
-call gcc2-c32.bat
-goto compileit
-
-:gcc2-linux
-call gcc2-linux.bat
-goto compileit
-
-:sc70-d16
-call sc70-d16.bat
-goto compileit
-
-:sc70-w16
-call sc70-w16.bat
-goto compileit
-
-:sc70-tnt
-call sc70-tnt.bat
-goto compileit
-
-:sc70-w32
-call sc70-w32.bat
-goto compileit
-
-:sc70-c32
-call sc70-c32.bat
-goto compileit
-
-:vc40-d16
-call vc40-d16.bat
-goto compileit
-
-:vc40-tnt
-call vc40-tnt.bat
-goto compileit
-
-:vc40-w16
-call vc40-w16.bat
-goto compileit
-
-:vc40-w32
-call vc40-w32.bat
-goto compileit
-
-:vc40-c32
-call vc40-c32.bat
-goto compileit
-
-:vc40-drv9x
-call vc40-drv9x.bat
-goto compileit
-
-:vc40-drvnt
-call vc40-drvnt.bat
-goto compileit
-
-:vc40-rtt
-call vc40-rtt.bat
-goto compileit
-
-:vc50-d16
-call vc50-d16.bat
-goto compileit
-
-:vc50-tnt
-call vc50-tnt.bat
-goto compileit
-
-:vc50-w16
-call vc50-w16.bat
-goto compileit
-
-:vc50-w32
-call vc50-w32.bat
-goto compileit
-
-:vc50-c32
-call vc50-c32.bat
-goto compileit
-
-:vc50-drv9x
-call vc50-drv9x.bat
-goto compileit
-
-:vc50-drvnt
-call vc50-drvnt.bat
-goto compileit
-
-:vc50-rtt
-call vc50-rtt.bat
-goto compileit
-
-:vc60-d16
-call vc60-d16.bat
-goto compileit
-
-:vc60-tnt
-call vc60-tnt.bat
-goto compileit
-
-:vc60-w16
-call vc60-w16.bat
-goto compileit
-
-:vc60-w32
-call vc60-w32.bat
-goto compileit
-
-:vc60-c32
-call vc60-c32.bat
-goto compileit
-
-:vc60-drv9x
-call vc60-drv9x.bat
-goto compileit
-
-:vc60-drvnt
-call vc60-drvnt.bat
-goto compileit
-
-:vc60-drvw2k
-call vc60-drvw2k.bat
-goto compileit
-
-:vc60-rtt
-call vc60-rtt.bat
-goto compileit
-
-:wc10ad16
-call wc10ad16.bat
-goto compileit
-
-:wc10ad32
-call wc10ad32.bat
-goto compileit
-
-:wc10atnt
-call wc10atnt.bat
-goto compileit
-
-:wc10aw16
-call wc10aw16.bat
-goto compileit
-
-:wc10aw32
-call wc10aw32.bat
-goto compileit
-
-:wc10ac32
-call wc10ac32.bat
-goto compileit
-
-:wc10ao32
-call wc10ao32.bat
-goto compileit
-
-:wc10ap32
-call wc10ap32.bat
-goto compileit
-
-:wc10-d16
-call wc10-d16.bat
-goto compileit
-
-:wc10-d32
-call wc10-d32.bat
-goto compileit
-
-:wc10-tnt
-call wc10-tnt.bat
-goto compileit
-
-:wc10-w16
-call wc10-w16.bat
-goto compileit
-
-:wc10-w32
-call wc10-w32.bat
-goto compileit
-
-:wc10-c32
-call wc10-c32.bat
-goto compileit
-
-:wc10-o32
-call wc10-o32.bat
-goto compileit
-
-:wc10-p32
-call wc10-p32.bat
-goto compileit
-
-:wc11-d16
-call wc11-d16.bat
-goto compileit
-
-:wc11-d32
-call wc11-d32.bat
-goto compileit
-
-:wc11-tnt
-call wc11-tnt.bat
-goto compileit
-
-:wc11-w16
-call wc11-w16.bat
-goto compileit
-
-:wc11-w32
-call wc11-w32.bat
-goto compileit
-
-:wc11-c32
-call wc11-c32.bat
-goto compileit
-
-:wc11-o32
-call wc11-o32.bat
-goto compileit
-
-:wc11-p32
-call wc11-p32.bat
-goto compileit
-
-:compileit
-k_rm -f *.lib *.a
-dmake %2 %3 %4 %5 %6 %7 %8 %9
-if errorlevel 1 goto errorend
-goto end
-
-:errorend
-echo *************************************************
-echo * An error occurred while building the library. *
-echo *************************************************
-:end
diff --git a/board/MAI/bios_emulator/scitech/bin/cddrv.bat b/board/MAI/bios_emulator/scitech/bin/cddrv.bat
deleted file mode 100755 (executable)
index b64f4d7..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-@echo off
-%1
-cd %3
-%4 %5 %6 %7 %8 %9
-%2
-
diff --git a/board/MAI/bios_emulator/scitech/bin/cdit b/board/MAI/bios_emulator/scitech/bin/cdit
deleted file mode 100755 (executable)
index b22023d..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#! /bin/sh
-
-cd $1
-PROG=$2
-shift 2
-rm -f *.lib *.a
-$PROG $*
-RET=$?
-cd ..
-exit $RET
diff --git a/board/MAI/bios_emulator/scitech/bin/cdit.bat b/board/MAI/bios_emulator/scitech/bin/cdit.bat
deleted file mode 100755 (executable)
index 950b648..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-@echo off
-cd %1
-k_rm -f *.lib *.a
-shift 1
-%1 %2 %3 %4 %5 %6 %7 %8 %9
diff --git a/board/MAI/bios_emulator/scitech/bin/djgpp.env b/board/MAI/bios_emulator/scitech/bin/djgpp.env
deleted file mode 100644 (file)
index 5a2c3d8..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-#= Don't edit this line unless you move djgpp.env outside
-#= of the djgpp installation directory.  If you do move
-#= it, set DJDIR to the directory you installed DJGPP in.
-#=
-DJDIR=%:/>DJGPP%
-
-+USER=dosuser
-+TMPDIR=%DJDIR%/tmp
-+EMU387=%DJDIR%/bin/emu387.dxe
-+LFN=y
-
-[bison]
-BISON_HAIRY=%DJDIR%/lib/bison.hai
-BISON_SIMPLE=%DJDIR%/lib/bison.sim
-
-[cpp]
-CPLUS_INCLUDE_PATH=%/>;CPLUS_INCLUDE_PATH%include;%SCITECH%/include;%PRIVATE%/include;.;%DJDIR%/lang/cxx;%DJDIR%/include;%DJDIR%/contrib/grx20/include
-C_INCLUDE_PATH=%/>;C_INCLUDE_PATH%include;%SCITECH%/include;%PRIVATE%/include;.;%DJDIR%/include;%DJDIR%/contrib/grx20/include
-OBJCPLUS_INCLUDE_PATH=%/>;OBJCPLUS_INCLUDE_PATH%%DJDIR%/include;%DJDIR%/lang/objc
-OBJC_INCLUDE_PATH=%/>;OBJC_INCLUDE_PATH%%DJDIR%/include;%DJDIR%/lang/objc
-
-[gcc]
-COMPILER_PATH=%/>;COMPILER_PATH%%DJDIR%/bin
-LIBRARY_PATH=%/>;LIBRARY_PATH%%DJDIR%/lib;%DJDIR%/contrib/grx20/lib;%SCITECH%/lib/release/dos32/dj2
-
-[info]
-INFOPATH=%/>;INFOPATH%%DJDIR%/info;%DJDIR%/gnu/emacs/info
-INFO_COLORS=0x1f.0x31
-
-[emacs]
-INFOPATH=%/>;INFOPATH%%DJDIR%/info;%DJDIR%/gnu/emacs/info
-
-[less]
-LESSBINFMT=*k<%X>
-LESSCHARDEF=8bcccbcc12bc5b95.b127.b
-LESS=%LESS% -h5$y5$Dd2.0$Du14.0$Ds4.7$Dk9.0$
-
-[locate]
-+LOCATE_PATH=%DJDIR%/lib/locatedb.dat
-
-[ls]
-+LS_COLORS=no=00:fi=00:di=36:lb=37;07:cd=40;33;01:ex=32:*.cmd=32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.deb=01;31:*.jpg=01;34:*.gif=01;34:*.bmp=01;34:*.ppm=01;34:*.tga=01;34:*.xbm=01;34:*.xpm=01;34:*.tif=01;34:*.mpg=01;37:*.avi=01;37:*.gl=01;37:*.dl=01;37:*~=08:*.bak=08:
-[dir]
-+LS_COLORS=no=00:fi=00:di=36:lb=37;07:cd=40;33;01:ex=32:*.cmd=32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.deb=01;31:*.jpg=01;34:*.gif=01;34:*.bmp=01;34:*.ppm=01;34:*.tga=01;34:*.xbm=01;34:*.xpm=01;34:*.tif=01;34:*.mpg=01;37:*.avi=01;37:*.gl=01;37:*.dl=01;37:*~=08:*.bak=08:
-[vdir]
-+LS_COLORS=no=00:fi=00:di=36:lb=37;07:cd=40;33;01:ex=32:*.cmd=32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.deb=01;31:*.jpg=01;34:*.gif=01;34:*.bmp=01;34:*.ppm=01;34:*.tga=01;34:*.xbm=01;34:*.xpm=01;34:*.tif=01;34:*.mpg=01;37:*.avi=01;37:*.gl=01;37:*.dl=01;37:*~=08:*.bak=08:
diff --git a/board/MAI/bios_emulator/scitech/bin/djgpp_db.env b/board/MAI/bios_emulator/scitech/bin/djgpp_db.env
deleted file mode 100644 (file)
index 9b792c9..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-#= Don't edit this line unless you move djgpp.env outside
-#= of the djgpp installation directory.  If you do move
-#= it, set DJDIR to the directory you installed DJGPP in.
-#=
-DJDIR=%:/>DJGPP%
-
-+USER=dosuser
-+TMPDIR=%DJDIR%/tmp
-+EMU387=%DJDIR%/bin/emu387.dxe
-+LFN=y
-
-[bison]
-BISON_HAIRY=%DJDIR%/lib/bison.hai
-BISON_SIMPLE=%DJDIR%/lib/bison.sim
-
-[cpp]
-CPLUS_INCLUDE_PATH=%/>;CPLUS_INCLUDE_PATH%include;%SCITECH%/include;%PRIVATE%/include;.;%DJDIR%/lang/cxx;%DJDIR%/include;%DJDIR%/contrib/grx20/include
-C_INCLUDE_PATH=%/>;C_INCLUDE_PATH%include;%SCITECH%/include;%PRIVATE%/include;.;%DJDIR%/include;%DJDIR%/contrib/grx20/include
-OBJCPLUS_INCLUDE_PATH=%/>;OBJCPLUS_INCLUDE_PATH%%DJDIR%/include;%DJDIR%/lang/objc
-OBJC_INCLUDE_PATH=%/>;OBJC_INCLUDE_PATH%%DJDIR%/include;%DJDIR%/lang/objc
-
-[gcc]
-COMPILER_PATH=%/>;COMPILER_PATH%%DJDIR%/bin
-LIBRARY_PATH=%/>;LIBRARY_PATH%%DJDIR%/lib;%DJDIR%/contrib/grx20/lib;%SCITECH%/lib/debug/dos32/dj2
-
-[info]
-INFOPATH=%/>;INFOPATH%%DJDIR%/info;%DJDIR%/gnu/emacs/info
-INFO_COLORS=0x1f.0x31
-
-[emacs]
-INFOPATH=%/>;INFOPATH%%DJDIR%/info;%DJDIR%/gnu/emacs/info
-
-[less]
-LESSBINFMT=*k<%X>
-LESSCHARDEF=8bcccbcc12bc5b95.b127.b
-LESS=%LESS% -h5$y5$Dd2.0$Du14.0$Ds4.7$Dk9.0$
-
-[locate]
-+LOCATE_PATH=%DJDIR%/lib/locatedb.dat
-
-[ls]
-+LS_COLORS=no=00:fi=00:di=36:lb=37;07:cd=40;33;01:ex=32:*.cmd=32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.deb=01;31:*.jpg=01;34:*.gif=01;34:*.bmp=01;34:*.ppm=01;34:*.tga=01;34:*.xbm=01;34:*.xpm=01;34:*.tif=01;34:*.mpg=01;37:*.avi=01;37:*.gl=01;37:*.dl=01;37:*~=08:*.bak=08:
-[dir]
-+LS_COLORS=no=00:fi=00:di=36:lb=37;07:cd=40;33;01:ex=32:*.cmd=32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.deb=01;31:*.jpg=01;34:*.gif=01;34:*.bmp=01;34:*.ppm=01;34:*.tga=01;34:*.xbm=01;34:*.xpm=01;34:*.tif=01;34:*.mpg=01;37:*.avi=01;37:*.gl=01;37:*.dl=01;37:*~=08:*.bak=08:
-[vdir]
-+LS_COLORS=no=00:fi=00:di=36:lb=37;07:cd=40;33;01:ex=32:*.cmd=32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.deb=01;31:*.jpg=01;34:*.gif=01;34:*.bmp=01;34:*.ppm=01;34:*.tga=01;34:*.xbm=01;34:*.xpm=01;34:*.tif=01;34:*.mpg=01;37:*.avi=01;37:*.gl=01;37:*.dl=01;37:*~=08:*.bak=08:
diff --git a/board/MAI/bios_emulator/scitech/bin/findint3.bat b/board/MAI/bios_emulator/scitech/bin/findint3.bat
deleted file mode 100755 (executable)
index 2e1506c..0000000
+++ /dev/null
@@ -1 +0,0 @@
-perl c:\scitech\src\perl\findint3.per
diff --git a/board/MAI/bios_emulator/scitech/bin/gcc-beos.sh b/board/MAI/bios_emulator/scitech/bin/gcc-beos.sh
deleted file mode 100755 (executable)
index 61ffd93..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#! /bin/sh
-
-# Setup for compiling with GCC/G++ for BeOS
-
-if [ "$CHECKED" = "1" ]; then
-    echo Checked debug build enabled.
-else
-    echo Release build enabled.
-fi
-
-export MAKESTARTUP=$SCITECH/makedefs/gcc_beos.mk
-export INCLUDE="-Iinclude -I$SCITECH/include -I$PRIVATE/include"
-export USE_X11=0
-export USE_BEOS=1
-
-echo GCC BeOS console compilation environment set up
diff --git a/board/MAI/bios_emulator/scitech/bin/gcc-freebsd.sh b/board/MAI/bios_emulator/scitech/bin/gcc-freebsd.sh
deleted file mode 100755 (executable)
index 3816a5d..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#! /bin/sh
-
-# Setup for compiling with GCC/G++ for FreeBSD
-
-if [ "$CHECKED" = "1" ]; then
-    echo Checked debug build enabled.
-else
-    echo Release build enabled.
-fi
-
-export MAKESTARTUP=$SCITECH/makedefs/gcc_freebsd.mk
-export INCLUDE="-Iinclude -I$SCITECH/include -I$PRIVATE/include"
-export USE_X11=1
-export USE_FREEBSD=1
-
-echo GCC FreeBSD console compilation environment set up
diff --git a/board/MAI/bios_emulator/scitech/bin/gcc-linux.sh b/board/MAI/bios_emulator/scitech/bin/gcc-linux.sh
deleted file mode 100755 (executable)
index 27a4c49..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#! /bin/sh
-
-# Setup for compiling with GCC/G++ for Linux
-
-if [ "$CHECKED" = "1" ]; then
-    echo Checked debug build enabled.
-else
-    echo Release build enabled.
-fi
-
-export MAKESTARTUP=$SCITECH/makedefs/gcc_linux.mk
-export INCLUDE="include;$SCITECH/include;$PRIVATE/include"
-export USE_LINUX=1
-
-if [ "x$LIBC" = x ]; then
-       echo "GCC Linux console compilation environment set up (glib)"
-else
-       echo "GCC Linux console compilation environment set up (libc5)"
-fi
diff --git a/board/MAI/bios_emulator/scitech/bin/gcc2-c32.bat b/board/MAI/bios_emulator/scitech/bin/gcc2-c32.bat
deleted file mode 100755 (executable)
index 13c4783..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-@echo off
-REM Setup for compiling with GNU C compiler
-
-if .%CHECKED%==.1 goto checked_build
-set LIB=%SCITECH_LIB%\LIB\release\win32\gcc2
-echo Release build enabled.
-goto setvars
-
-:checked_build
-set LIB=%SCITECH_LIB%\LIB\debug\win32\gcc2
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-set INCLUDE=include;%SCITECH%\include;%PRIVATE%\include
-set MAKESTARTUP=%SCITECH%\makedefs\gcc_win32.mk
-set MAKE_MODE=
-set USE_WIN16=
-set USE_WIN32=1
-set WIN32_GUI=
-set USE_SNAP=
-set GCC_LIBBASE=gcc2
-PATH %SCITECH_BIN%;%GCC2_PATH%\NATIVE\BIN;%DEFPATH%
-
-echo GCC 2.9.x 32-bit Win32 console compilation environment set up
-
diff --git a/board/MAI/bios_emulator/scitech/bin/gcc2-dos.bat b/board/MAI/bios_emulator/scitech/bin/gcc2-dos.bat
deleted file mode 100755 (executable)
index 97cb8bd..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-@echo off
-REM Setup for compiling with DJGPP 2.02
-
-if .%CHECKED%==.1 goto checked_build
-set LIB=%SCITECH_LIB%\LIB\release\dos32\dj2
-%SCITECH%\bin-dos\k_cp %SCITECH%\BIN\DJGPP.ENV %DJ_PATH%\DJGPP.ENV
-echo Release build enabled.
-goto setvars
-
-:checked_build
-set LIB=%SCITECH_LIB%\LIB\debug\dos32\dj2
-%SCITECH%\bin-dos\k_cp %SCITECH%\BIN\DJGPP_DB.ENV %DJ_PATH%\DJGPP.ENV
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-set DJGPP=%DJ_PATH%\DJGPP.ENV
-set INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%DJ_PATH%\INCLUDE;
-set MAKESTARTUP=%SCITECH%\MAKEDEFS\DJ32.MK
-set USE_WIN16=
-set USE_WIN32=
-set WIN32_GUI=
-set USE_SNAP=
-set DJ_LIBBASE=dj2
-PATH %SCITECH_BIN%;%DJ_PATH%\BIN;%DEFPATH%
-
-echo DJGPP 2.02 32-bit DOS compilation environment set up (DPMI).
-
diff --git a/board/MAI/bios_emulator/scitech/bin/gcc2-linux.bat b/board/MAI/bios_emulator/scitech/bin/gcc2-linux.bat
deleted file mode 100755 (executable)
index ceb2ab8..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-@echo off
-REM Setup for compiling with GNU C cross-compiler
-
-if .%CHECKED%==.1 goto checked_build
-set LIB=%SCITECH_LIB%\LIB\release\win32\gcc2
-echo Release build enabled.
-goto setvars
-
-:checked_build
-set LIB=%SCITECH_LIB%\LIB\debug\win32\gcc2
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-set INCLUDE=include;%SCITECH%\include;%PRIVATE%\include
-set MAKESTARTUP=%SCITECH%\MAKEDEFS\gcc_linux.mk
-set MAKE_MODE=UNIX
-set USE_WIN16=
-set USE_WIN32=
-set WIN32_GUI=
-set USE_SNAP=
-set GCC_LIBBASE=gcc2
-PATH %SCITECH_BIN%;%GCC2_PATH%\cross-linux\i386-redhat-linux\BIN;%DEFPATH%
-
-echo GCC 2.9.x 32-bit Linux console cross compilation environment set up
-
diff --git a/board/MAI/bios_emulator/scitech/bin/gcc2-w32.bat b/board/MAI/bios_emulator/scitech/bin/gcc2-w32.bat
deleted file mode 100755 (executable)
index bdb31aa..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-@echo off
-REM Setup for compiling with GNU C compiler
-
-if .%CHECKED%==.1 goto checked_build
-set LIB=%SCITECH_LIB%\LIB\release\win32\gcc2
-echo Release build enabled.
-goto setvars
-
-:checked_build
-set LIB=%SCITECH_LIB%\LIB\debug\win32\gcc2
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-set INCLUDE=include;%SCITECH%\include;%PRIVATE%\include
-set MAKESTARTUP=%SCITECH%\makedefs\gcc_win32.mk
-set MAKE_MODE=
-set USE_WIN16=
-set USE_WIN32=1
-set WIN32_GUI=1
-set USE_SNAP=
-set GCC_LIBBASE=gcc2
-PATH %SCITECH_BIN%;%GCC2_PATH%\NATIVE\BIN;%DEFPATH%
-
-echo GCC 2.9.x 32-bit Win32 GUI compilation environment set up
-
diff --git a/board/MAI/bios_emulator/scitech/bin/makelib.bat b/board/MAI/bios_emulator/scitech/bin/makelib.bat
deleted file mode 100755 (executable)
index 6316734..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-call wc11-d32.bat
-
-cd c:\private\src\license
-dmake clean
-dmake depend
-dmake -u install
-cd c:\scitech\src\pm
-dmake clean
-dmake depend
-dmake -u install
-cd c:\scitech\src\console
-dmake clean
-dmake depend
-dmake -u install
-cd c:\scitech\src\nucleus
-dmake clean
-dmake depend
-dmake -u install
-cd c:\scitech\src\zlib
-dmake clean
-dmake depend
-dmake -u install
-
-cd c:\private\src\graphics\ref2d
-dmake clean
-dmake depend
-dmake -u install
-cd c:\private\src\drvlib
-dmake clean
-dmake depend
-dmake -u install
-
-call wc11-w32.bat
-
-cd c:\private\src\license
-dmake clean
-dmake depend
-dmake -u install
-cd c:\scitech\src\pm
-dmake clean
-dmake depend
-dmake -u install
-cd c:\scitech\src\console
-dmake clean
-dmake depend
-dmake -u install
-cd c:\scitech\src\nucleus
-dmake clean
-dmake depend
-dmake -u install
-cd c:\scitech\src\zlib
-dmake clean
-dmake depend
-dmake -u install
-
-cd c:\private\src\graphics\ref2d
-dmake clean
-dmake depend
-dmake -u install
-cd c:\private\src\drvlib
-dmake clean
-dmake depend
-dmake -u install
-
-call wc10-d32.bat
-
-cd c:\private\src\license
-dmake clean
-dmake depend
-dmake -u install
-cd c:\scitech\src\pm
-dmake clean
-dmake depend
-dmake -u install
-cd c:\scitech\src\console
-dmake clean
-dmake depend
-dmake -u install
-cd c:\scitech\src\nucleus
-dmake clean
-dmake depend
-dmake -u install
-cd c:\scitech\src\zlib
-dmake clean
-dmake depend
-dmake -u install
-
-cd c:\private\src\graphics\ref2d
-dmake clean
-dmake depend
-dmake -u install
-cd c:\private\src\drvlib
-dmake clean
-dmake depend
-dmake -u install
-
-cd \private\src\graphics\drivers
diff --git a/board/MAI/bios_emulator/scitech/bin/meltobjs.sh b/board/MAI/bios_emulator/scitech/bin/meltobjs.sh
deleted file mode 100755 (executable)
index fd1804b..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-#! /bin/sh
-#
-# This script generates a single object file from a set of libraries (*.a files)
-# Usage: meltobjs.sh target.o library1.a library2.a ...
-#
-# (C) SciTech Software, Inc. 1998
-#
-
-TMPDIR=/tmp/melt$$
-TARGET=$1
-TARGETDIR=$PWD
-shift
-mkdir $TMPDIR
-
-cd $TMPDIR
-
-for a in $*
-do
-    ar x $a
-done
-ld -r -o $TARGETDIR/$TARGET *.o
-
-rm -fr $TMPDIR
\ No newline at end of file
diff --git a/board/MAI/bios_emulator/scitech/bin/ntddk.bat b/board/MAI/bios_emulator/scitech/bin/ntddk.bat
deleted file mode 100755 (executable)
index 07c0d78..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-@echo off
-REM: Set up environment variables for Microsoft Windows NT DDK development.
-REM: Note that we have hard coded this for Windows NT i386 development.
-
-SET USE_NTDRV=1
-SET USE_W2KDRV=
-SET BASEDIR=%NT_DDKROOT%
-SET PATH=%BASEDIR%\bin;%PATH%
-SET NTMAKEENV=%BASEDIR%\inc
-SET BUILD_MAKE_PROGRAM=nmake.exe
-SET BUILD_DEFAULT=-ei -nmake -i
-SET BUILD_DEFAULT_TARGETS=-386
-SET _OBJ_DIR=obj
-SET NEW_CRTS=1
-SET _NTROOT=%BASEDIR%
-SET INCLUDE=%BASEDIR%\inc;%INCLUDE%
-
-if .%CHECKED%==.1 goto checked
-
-REM: set up an NT free build environment
-SET DDKBUILDENV=free
-SET C_DEFINES=-D_IDWBUILD
-SET NTDBGFILES=1
-SET NTDEBUG=
-SET NTDEBUGTYPE=
-SET MSC_OPTIMIZATION=
-set LIB=%BASEDIR%\lib\i386\free;%SCITECH_LIB%\LIB\RELEASE\NTDRV\VC6;%MSVCDir%\LIB;.
-
-goto done
-
-:checked
-
-REM: set up an NT checked build environment
-SET DDKBUILDENV=checked
-SET C_DEFINES=-D_IDWBUILD -DRDRDBG -DSRVDBG
-SET NTDBGFILES=
-SET NTDEBUG=ntsd
-SET NTDEBUGTYPE=both
-SET MSC_OPTIMIZATION=/Od /Oi
-set LIB=%BASEDIR%\lib\i386\free;%SCITECH_LIB%\LIB\DEBUG\NTDRV\VC6;%MSVCDir%\LIB;.
-
-:done
diff --git a/board/MAI/bios_emulator/scitech/bin/qnx4.sh b/board/MAI/bios_emulator/scitech/bin/qnx4.sh
deleted file mode 100755 (executable)
index 843c4d9..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-#! /bin/sh
-
-# Setup for compiling with Watcom C/C++ for QNX4
-
-if [ "$CHECKED" = "1" ]; then
-    echo Checked debug build enabled.
-else
-    echo Release build enabled.
-fi
-
-export MAKESTARTUP=$SCITECH/makedefs/qnx4.mk
-export INCLUDE="-I$SCITECH/include -I$PRIVATE/include -I/usr/include"
-export USE_QNX=1
-export USE_QNX4=1
-export WC_LIBBASE=wc10
-
-echo Qnx 4 console compilation environment set up
-
diff --git a/board/MAI/bios_emulator/scitech/bin/qnxnto.sh b/board/MAI/bios_emulator/scitech/bin/qnxnto.sh
deleted file mode 100755 (executable)
index c114f9e..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-#! /bin/sh
-
-# Setup for compiling with Watcom C/C++ for QNX Neutrino
-
-if [ "$CHECKED" = "1" ]; then
-    echo Checked debug build enabled.
-else
-    echo Release build enabled.
-fi
-
-if [ X$GCC_PATH = "X" ]; then
-       export GCC_PATH=/usr/gcc/bin
-fi
-
-export MAKESTARTUP=$SCITECH/makedefs/qnxnto.mk
-export INCLUDE="-I$SCITECH/include -I$PRIVATE/include -I/usr/nto/include"
-export USE_BIOS=1      # VBIOS lib is tiny under Neutrino, always include it
-export USE_QNX=1
-export USE_QNXNTO=1
-
-echo Qnx Neutrino console compilation environment set up
diff --git a/board/MAI/bios_emulator/scitech/bin/set-vars-beos.sh b/board/MAI/bios_emulator/scitech/bin/set-vars-beos.sh
deleted file mode 100755 (executable)
index 0a272d6..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#! /bin/sh
-
-# BeOS VERSION
-# Set the place where SciTech Software is installed, and where each
-# of the supported compilers is installed. These environment variables
-# are used by the batch files in the SCITECH\BIN directory.
-#
-# Modify the as appropriate for your compiler configuration (you should
-# only need to change things in this batch file).
-#
-# This version is for a normal BeOS installation.
-
-# The SCITECH variable points to where batch files, makefile startups,
-# include files and source files will be found when compiling.
-
-export SCITECH=$MGL_ROOT 
-
-# The SCITECH_LIB variable points to where the SciTech libraries live
-# for installation and linking. This allows you to have the source and
-# include files on local machines for compiling and have the libraries
-# located on a common network machine (for network builds).
-
-export SCITECH_LIB=$SCITECH
-
-# The PRIVATE variable points to where private source files reside that
-# do not live in the public source tree
-
-export PRIVATE=$HOME/private
-
-# The following define the locations of all the compilers that you may
-# be using. Change them to reflect where you have installed your
-# compilers.
-
-export GCC_PATH=/boot/develop/tools/gnupro/bin
-
-# Add the Scitech bin path to the current PATH
-export PATH=$SCITECH/bin:$SCITECH/bin-beos:$PATH
-#if [ "x$LIBC" = x ]; then
-#      export PATH=$PATH:$SCITECH/bin-beos/glibc
-#else
-#      export PATH=$PATH:$SCITECH/bin-beos/libc
-#fi
diff --git a/board/MAI/bios_emulator/scitech/bin/set-vars-freebsd.sh b/board/MAI/bios_emulator/scitech/bin/set-vars-freebsd.sh
deleted file mode 100755 (executable)
index c920748..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-#! /bin/sh
-
-# LINUX VERSION
-# Set the place where SciTech Software is installed, and where each
-# of the supported compilers is installed. These environment variables
-# are used by the batch files in the SCITECH\BIN directory.
-#
-# Modify the as appropriate for your compiler configuration (you should
-# only need to change things in this batch file).
-#
-# This version is for a normal Linux installation.
-
-# The SCITECH variable points to where batch files, makefile startups,
-# include files and source files will be found when compiling.
-
-export SCITECH=$MGL_ROOT 
-
-# The SCITECH_LIB variable points to where the SciTech libraries live
-# for installation and linking. This allows you to have the source and
-# include files on local machines for compiling and have the libraries
-# located on a common network machine (for network builds).
-
-export SCITECH_LIB=$SCITECH
-
-# The PRIVATE variable points to where private source files reside that
-# do not live in the public source tree
-
-export PRIVATE=$HOME/private
-
-# The following define the locations of all the compilers that you may
-# be using. Change them to reflect where you have installed your
-# compilers.
-
-export GCC_PATH=/usr/bin
-
-# Add the Scitech bin path to the current PATH
-export PATH=$SCITECH/bin:$SCITECH/bin-freebsd:$PATH
diff --git a/board/MAI/bios_emulator/scitech/bin/set-vars-linux.sh b/board/MAI/bios_emulator/scitech/bin/set-vars-linux.sh
deleted file mode 100755 (executable)
index 35cbf1d..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-#! /bin/sh
-
-# LINUX VERSION
-# Set the place where SciTech Software is installed, and where each
-# of the supported compilers is installed. These environment variables
-# are used by the batch files in the SCITECH\BIN directory.
-#
-# Modify the as appropriate for your compiler configuration (you should
-# only need to change things in this batch file).
-#
-# This version is for a normal Linux installation.
-
-# The SCITECH variable points to where batch files, makefile startups,
-# include files and source files will be found when compiling.
-
-export SCITECH=$MGL_ROOT 
-
-# The SCITECH_LIB variable points to where the SciTech libraries live
-# for installation and linking. This allows you to have the source and
-# include files on local machines for compiling and have the libraries
-# located on a common network machine (for network builds).
-
-export SCITECH_LIB=$SCITECH
-
-# The PRIVATE variable points to where private source files reside that
-# do not live in the public source tree
-
-export PRIVATE=$HOME/private
-
-# The following define the locations of all the compilers that you may
-# be using. Change them to reflect where you have installed your
-# compilers.
-
-export GCC_PATH=/usr/bin
-export TEMP=/tmp TMP=/tmp
-
-# Add the Scitech bin path to the current PATH
-export PATH=$SCITECH/bin:$SCITECH/bin-linux:$PATH
-if [ "x$LIBC" = x ]; then
-       export PATH=$SCITECH/bin-linux/glibc:$PATH
-else
-       export PATH=$SCITECH/bin-linux/libc:$PATH
-fi
diff --git a/board/MAI/bios_emulator/scitech/bin/set-vars-qnx.sh b/board/MAI/bios_emulator/scitech/bin/set-vars-qnx.sh
deleted file mode 100755 (executable)
index 1d73109..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-#! /bin/sh
-
-# QNX 4 VERSION
-# Set the place where SciTech Software is installed, and where each
-# of the supported compilers is installed. These environment variables
-# are used by the batch files in the SCITECH\BIN directory.
-#
-# Modify the as appropriate for your compiler configuration (you should
-# only need to change things in this batch file).
-#
-# This version is for a normal Linux installation.
-
-# The SCITECH variable points to where batch files, makefile startups,
-# include files and source files will be found when compiling.
-
-export SCITECH=$MGL_ROOT 
-
-# The SCITECH_LIB variable points to where the SciTech libraries live
-# for installation and linking. This allows you to have the source and
-# include files on local machines for compiling and have the libraries
-# located on a common network machine (for network builds).
-
-export SCITECH_LIB=$SCITECH
-
-# The PRIVATE variable points to where private source files reside that
-# do not live in the public source tree
-
-export PRIVATE=$HOME/private
-
-# The following define the locations of all the compilers that you may
-# be using. Change them to reflect where you have installed your
-# compilers.
-
-export WC10_PATH=/usr/watcom/10.6/usr
-
-# Add the Scitech bin path to the current PATH
-export PATH=$SCITECH/bin:$SCITECH/bin-qnx:$PATH
diff --git a/board/MAI/bios_emulator/scitech/bin/set-vars.bat b/board/MAI/bios_emulator/scitech/bin/set-vars.bat
deleted file mode 100755 (executable)
index 2a2101d..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-@echo off
-REM:=========================================================================
-REM: Master batch file to set up all necessary environment variables for
-REM: the SciTech makefile utilities. This batch file should be executed
-REM: *first* before any other batch files when you start a command shell.
-REM: You should not need to modify any batch files except this one to
-REM: configure the makefile utilities.
-REM:=========================================================================
-
-REM: Set the place where SciTech Software is installed, and where each
-REM: of the supported compilers is installed. These environment variables
-REM: are used by the batch files in the SCITECH\BIN directory.
-REM:
-REM: Modify the as appropriate for your compiler configuration (you should
-REM: only need to change things in this batch file).
-REM:
-REM: This version is for a normal MSDOS installation.
-
-REM: The SCITECH variable points to where batch files, makefile startups,
-REM: include files and source files will be found when compiling.
-
-SET SCITECH=c:\scitech
-
-REM: The SCITECH_LIB variable points to where the SciTech libraries live
-REM: for installation and linking. This allows you to have the source and
-REM: include files on local machines for compiling and have the libraries
-REM: located on a common network machine (for network builds).
-
-SET SCITECH_LIB=%SCITECH%
-
-REM: The PRIVATE variable points to where private source files reside that
-REM: do not live in the public source tree
-
-SET PRIVATE=c:\private
-
-REM: The following sets up the path to the SciTech command line utilities
-REM: for the development operating system. We select either DOS hosted
-REM: tools or Win32 hosted tools depending on whether you are running
-REM: on NT or not. Windows 9x users can use the Win32 hosted tools but
-REM: they run slower, but you will have long filenames if you do this.
-
-IF .%OS%==.Windows_NT goto Win32_path
-IF NOT .%WINDIR%==. goto Win32_path
-SET SCITECH_BIN=%SCITECH%\bin;%SCITECH%\bin-dos
-goto path_set
-
-REM: The following sets up the path to the SciTech command line utilities
-REM: for the development operating system. This version uses the Win32
-REM: hosted tools by default, so you can use long filenames.
-
-:Win32_path
-SET SCITECH_BIN=%SCITECH%\bin;%SCITECH%\bin-win32
-
-:path_set
-
-REM: Set the TMP variable for dmake if this is not already set
-
-SET TMP=%SCITECH%
-
-REM: Set the following environment variable to use the Netwide Assembler
-REM: (NASM) provided with the MGL tools to build all assembler modules.
-REM: If you have Turbo Assembler 4.0 or later and you wish to use it,
-REM: you can use it by removing the following line.
-
-SET USE_NASM=1
-
-REM: The following is used to set up DDK directories for device driver
-REM: development. They can safely be ignored unless you are using the
-REM: SciTech makefile utilities to build device drivers.
-
-SET DDKDRIVE=c:
-SET MSSDK=c:\c\win32sdk
-SET W95_DDKROOT=c:\c\95ddk
-SET W98_DDKROOT=c:\c\98ddk
-SET NT_DDKROOT=c:\c\ntddk
-SET W2K_DDKROOT=c:\c\2000ddk
-SET MASM_ROOT=c:\c\masm611
-SET VTOOLSD=c:\c\vtd95
-SET SOFTICE_PATH=c:\c\sint
-
-REM: The following define the locations of all the compilers that you may
-REM: be using. Change them to reflect where you have installed your
-REM: compilers.
-
-SET BC3_PATH=c:\c\bc3
-SET BC4_PATH=c:\c\bc45
-SET BC5_PATH=c:\c\bc50
-SET BCB5_PATH=c:\c\bcb50
-SET VC_PATH=c:\c\msvc
-SET VC4_PATH=c:\c\vc42
-SET VC5_PATH=c:\c\vc50
-SET VC6_PATH=c:\c\vc60
-SET SC70_PATH=c:\c\sc75
-SET WC10A_PATH=c:\c\wc10a
-SET WC10_PATH=c:\c\wc10
-SET WC11_PATH=c:\c\wc11
-SET TNT_PATH=c:\c\tnt
-SET DJ_PATH=c:\c\djgpp
-SET GCC2_PATH=c:\unix\usr
-
-REM: The following define the locations of the IDE and compiler path
-REM: tools for Visual C++. If you do a standard installation, you wont
-REM: need to change this. If however you did a custom install and changed
-REM: the paths to these directory, you will need to modify this to suit.
-
-SET VC5_MSDevDir=%VC5_PATH%\sharedide
-SET VC5_MSVCDir=%VC5_PATH%\vc
-SET VC6_MSDevDir=%VC6_PATH%\common\msdev98
-SET VC6_MSVCDir=%VC6_PATH%\vc98
-
diff --git a/board/MAI/bios_emulator/scitech/bin/vc40-c32.bat b/board/MAI/bios_emulator/scitech/bin/vc40-c32.bat
deleted file mode 100755 (executable)
index 71f7d8e..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-@echo off
-REM Setup environment variables for Visual C++ 4.2 32 bit edition
-
-if .%CHECKED%==.1 goto checked_build
-set LIB=%SCITECH_LIB%\LIB\RELEASE\WIN32\VC4;%VC4_PATH%\LIB;%TNT_PATH%\LIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-set LIB=%SCITECH_LIB%\LIB\DEBUG\WIN32\VC4;%VC4_PATH%\LIB;%TNT_PATH%\LIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-set TOOLROOTDIR=%VC4_PATH%
-set C_INCLUDE=%VC4_PATH%\INCLUDE;%TNT_PATH%\INCLUDE;
-set INCLUDE=.;INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%C_INCLUDE%
-set INIT=%VC4_PATH%
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\VC32.MK
-SET USE_TNT=
-SET USE_WIN16=
-SET USE_WIN32=1
-SET WIN32_GUI=
-SET USE_VXD=
-SET USE_NTDRV=
-SET USE_RTTARGET=
-SET USE_SNAP=
-SET VC_LIBBASE=VC4
-PATH %SCITECH_BIN%;%VC4_PATH%\BIN;%TNT_PATH%\BIN;%DEFPATH%%VC32_CD_PATH%
-
-REM: Enable Win32 SDK if desired (sdk on command line)
-if NOT .%1%==.sdk goto done
-call win32sdk.bat
-
-:done
-echo Visual C++ 4.2 32 bit Windows compilation environment set up
diff --git a/board/MAI/bios_emulator/scitech/bin/vc40-d16.bat b/board/MAI/bios_emulator/scitech/bin/vc40-d16.bat
deleted file mode 100755 (executable)
index 9817493..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-@echo off
-REM Setup environment variables for Visual C++ 1.52c 16 bit edition
-
-if .%CHECKED%==.1 goto checked_build
-set LIB=%SCITECH_LIB%\LIB\RELEASE\DOS16\VC4;%VC_PATH%\LIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-set LIB=%SCITECH_LIB%\LIB\DEBUG\DOS16\VC4;%VC_PATH%\LIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-set TOOLROOTDIR=%VC_PATH%
-set INCLUDE=.;INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%VC_PATH%\INCLUDE;
-set INIT=%VC_PATH%
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\VC16.MK
-SET USE_WIN16=
-SET USE_WIN32=
-SET USE_RTTARGET=
-SET USE_SNAP=
-SET VC_LIBBASE=VC4
-PATH %SCITECH_BIN%;%VC_PATH%\BIN;%DEFPATH%%VC_CD_PATH%
-
-echo Visual C++ 1.52c 16 DOS bit compilation environment set up.
-
diff --git a/board/MAI/bios_emulator/scitech/bin/vc40-drv9x.bat b/board/MAI/bios_emulator/scitech/bin/vc40-drv9x.bat
deleted file mode 100755 (executable)
index 62e3521..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-@echo off
-REM Setup environment variables for Visual C++ 4.2 32 bit edition
-
-REM: First setup for Win32 console development
-call vc40-c32.bat > NUL
-
-REM: Extra stuff to set up for Windows 9x DDK development
-set MASTER_MAKE=1
-set DDKROOT=%W95_DDKROOT%
-set SDKROOT=%MSSDK%
-set C16_ROOT=%VC_PATH%
-set C32_ROOT=%VC4_PATH%
-
-if .%CHECKED%==.1 goto checked_build
-echo Release build enabled.
-goto done
-:checked_build
-echo Checked debug build enabled.
-goto done
-:done
-echo Visual C++ 4.2 Windows 9x driver compilation environment set up
diff --git a/board/MAI/bios_emulator/scitech/bin/vc40-drvnt.bat b/board/MAI/bios_emulator/scitech/bin/vc40-drvnt.bat
deleted file mode 100755 (executable)
index 83b6780..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-@echo off
-REM Setup environment variables for Visual C++ 4.2 32 bit edition
-
-REM: First setup for Win32 console development (with Platform SDK)
-call vc40-c32.bat sdk > NUL
-
-REM: Extra stuff to set up for Windows NT DDK development
-SET BASEDIR=%NT_DDKROOT%
-SET PATH=%NT_DDKROOT%\bin;%PATH%
-
-if .%CHECKED%==.1 goto checked_build
-echo Release build enabled.
-goto done
-:checked_build
-echo Checked debug build enabled.
-goto done
-:done
-echo Visual C++ 4.2 Windows NT driver compilation environment set up
diff --git a/board/MAI/bios_emulator/scitech/bin/vc40-snp.bat b/board/MAI/bios_emulator/scitech/bin/vc40-snp.bat
deleted file mode 100755 (executable)
index 7997044..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-@echo off
-REM Setup environment variables for Visual C++ 4.2 32 bit edition
-
-if .%CHECKED%==.1 goto checked_build
-set LIB=%SCITECH_LIB%\LIB\RELEASE\SNAP\VC4;%VC4_PATH%\LIB;%TNT_PATH%\LIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-set LIB=%SCITECH_LIB%\LIB\DEBUG\SNAP\VC4;%VC4_PATH%\LIB;%TNT_PATH%\LIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-set TOOLROOTDIR=%VC4_PATH%
-set INCLUDE=.;INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE
-set INIT=%VC4_PATH%
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\VC32.MK
-SET USE_TNT=
-SET USE_WIN16=
-SET USE_WIN32=
-SET WIN32_GUI=
-SET USE_VXD=
-SET USE_NTDRV=
-SET USE_RTTARGET=
-SET USE_SNAP=1
-SET VC_LIBBASE=VC4
-PATH %SCITECH_BIN%;%VC4_PATH%\BIN;%TNT_PATH%\BIN;%DEFPATH%%VC32_CD_PATH%
-
-echo Visual C++ 4.2 Snap compilation environment set up
-
diff --git a/board/MAI/bios_emulator/scitech/bin/vc40-tnt.bat b/board/MAI/bios_emulator/scitech/bin/vc40-tnt.bat
deleted file mode 100755 (executable)
index b0fc936..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-@echo off
-REM Setup environment variables for Visual C++ 4.2 32 bit edition
-
-if .%CHECKED%==.1 goto checked_build
-set LIB=%SCITECH_LIB%\LIB\RELEASE\DOS32\VC4;%VC4_PATH%\LIB;%TNT_PATH%\COFFLIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-set LIB=%SCITECH_LIB%\LIB\DEBUG\DOS32\VC4;%VC4_PATH%\LIB;%TNT_PATH%\COFFLIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-set TOOLROOTDIR=%VC4_PATH%
-set INCLUDE=.;INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%VC4_PATH%\INCLUDE;%TNT_PATH%\INCLUDE;
-set INIT=%VC4_PATH%
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\VC32.MK
-SET USE_WIN16=
-SET USE_WIN32=
-SET USE_TNT=
-SET USE_VXD=
-SET USE_NTDRV=
-SET USE_RTTARGET=
-SET USE_SNAP=
-SET VC_LIBBASE=VC4
-PATH %SCITECH_BIN%;%VC4_PATH%\BIN;%TNT_PATH%\BIN;%DEFPATH%%VC32_CD_PATH%
-
-REM If you set the following to a 1, a TNT DosStyle app will be created.
-REM Otherwise a TNT NtStyle app will be created. NtStyle apps will *only*
-REM run under real DOS when using our libraries, since we require access
-REM to functions that the Win32 API does not support (such as direct access
-REM to video memory, calling Int 10h BIOS functions etc). DosStyle apps
-REM will however run fine in both DOS and a Win95 DOS box (NT DOS boxes don't
-REM work too well).
-REM
-REM If you are using the RealTime DOS extender, your apps *must* be NtStyle,
-REM and hence will never be able to run under Win95 or WinNT, only DOS.
-
-SET DOSSTYLE=
-
-echo Visual C++ 4.2 32-bit DOS compilation environment set up (TNT).
diff --git a/board/MAI/bios_emulator/scitech/bin/vc40-w16.bat b/board/MAI/bios_emulator/scitech/bin/vc40-w16.bat
deleted file mode 100755 (executable)
index 2849a20..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-@echo off
-REM Setup environment variables for Visual C++ 1.52c 16 bit edition
-
-if .%CHECKED%==.1 goto checked_build
-set LIB=%SCITECH_LIB%\LIB\RELEASE\WIN16\VC4;%VC_PATH%\LIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-set LIB=%SCITECH_LIB%\LIB\DEBUG\WIN16\VC4;%VC_PATH%\LIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-set TOOLROOTDIR=%VC_PATH%
-set INCLUDE=.;INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%VC_PATH%\INCLUDE;
-set INIT=%VC_PATH%
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\VC16.MK
-SET USE_WIN16=1
-SET USE_WIN32=
-SET VC_LIBBASE=VC4
-SET USE_RTTARGET=
-SET USE_SNAP=
-PATH %SCITECH_BIN%;%VC_PATH%\BIN;%DEFPATH%%VC_CD_PATH%
-
-echo Visual C++ 1.52c 16 bit Windows compilation environment set up.
diff --git a/board/MAI/bios_emulator/scitech/bin/vc40-w32.bat b/board/MAI/bios_emulator/scitech/bin/vc40-w32.bat
deleted file mode 100755 (executable)
index d93a624..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-@echo off
-REM Setup environment variables for Visual C++ 4.2 32 bit edition
-
-if .%CHECKED%==.1 goto checked_build
-set LIB=%SCITECH_LIB%\LIB\RELEASE\WIN32\VC4;%VC4_PATH%\LIB;%TNT_PATH%\LIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-set LIB=%SCITECH_LIB%\LIB\DEBUG\WIN32\VC4;%VC4_PATH%\LIB;%TNT_PATH%\LIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-set TOOLROOTDIR=%VC4_PATH%
-set C_INCLUDE=%VC4_PATH%\INCLUDE;%TNT_PATH%\INCLUDE;
-set INCLUDE=.;INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%C_INCLUDE%
-set INIT=%VC4_PATH%
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\VC32.MK
-SET USE_TNT=
-SET USE_WIN16=
-SET USE_WIN32=1
-SET WIN32_GUI=1
-SET USE_VXD=
-SET USE_NTDRV=
-SET USE_RTTARGET=
-SET USE_SNAP=
-SET VC_LIBBASE=VC4
-PATH %SCITECH_BIN%;%VC4_PATH%\BIN;%TNT_PATH%\BIN;%DEFPATH%%VC32_CD_PATH%
-
-REM: Enable Win32 SDK if desired (sdk on command line)
-if NOT .%1%==.sdk goto done
-call win32sdk.bat
-
-:done
-echo Visual C++ 4.2 32 bit Windows compilation environment set up
-
diff --git a/board/MAI/bios_emulator/scitech/bin/vc40-x11.bat b/board/MAI/bios_emulator/scitech/bin/vc40-x11.bat
deleted file mode 100755 (executable)
index a420a54..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-@echo off
-REM Setup environment variables for Visual C++ 4.2 32 bit edition
-
-SET LIB=%VC4_PATH%\LIB;.
-SET TOOLROOTDIR=%VC4_PATH%
-SET INCLUDE=\xc\include;%VC4_PATH%\INCLUDE
-SET INIT=%VC4_PATH%
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\VC32.MK
-SET USE_TNT=
-SET USE_WIN16=
-SET USE_WIN32=1
-SET WIN32_GUI=1
-SET USE_VXD=
-SET USE_NTDRV=
-SET USE_RTTARGET=
-SET USE_SNAP=
-SET VC_LIBBASE=VC4
-PATH %SCITECH_BIN%;%VC4_PATH%\BIN;%DEFPATH%
-
-echo Visual C++ 4.2 X11 compilation environment set up
diff --git a/board/MAI/bios_emulator/scitech/bin/vc50-c32.bat b/board/MAI/bios_emulator/scitech/bin/vc50-c32.bat
deleted file mode 100755 (executable)
index 62d27b9..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-@echo off
-REM Setup environment variables for Visual C++ 5.0 32 bit edition
-
-SET MSDevDir=%VC5_MSDevDir%
-SET MSVCDir=%VC5_MSVCDir%
-
-if .%CHECKED%==.1 goto checked_build
-set LIB=%SCITECH_LIB%\LIB\RELEASE\WIN32\VC5;%MSVCDir%\LIB;%TNT_PATH%\LIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-set LIB=%SCITECH_LIB%\LIB\DEBUG\WIN32\VC5;%MSVCDir%\LIB;%TNT_PATH%\LIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-set TOOLROOTDIR=%MSVCDir%
-set C_INCLUDE=%MSVCDir%\INCLUDE;%TNT_PATH%\INCLUDE;
-set INCLUDE=.;INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%C_INCLUDE%
-set INIT=%MSVCDir%
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\VC32.MK
-SET USE_TNT=
-SET USE_WIN16=
-SET USE_WIN32=1
-SET WIN32_GUI=
-SET USE_VXD=
-SET USE_NTDRV=
-SET USE_RTTARGET=
-SET USE_SNAP=
-SET VC_LIBBASE=vc5
-PATH %SCITECH_BIN%;%MSVCDir%\BIN;%MSDevDir%\BIN;%TNT_PATH%\BIN;%DEFPATH%%VC32_CD_PATH%
-
-REM: Enable Win32 SDK if desired (sdk on command line)
-if NOT .%1%==.sdk goto done
-call win32sdk.bat
-
-:done
-echo Visual C++ 5.0 32-bit Windows console compilation environment set up
diff --git a/board/MAI/bios_emulator/scitech/bin/vc50-d16.bat b/board/MAI/bios_emulator/scitech/bin/vc50-d16.bat
deleted file mode 100755 (executable)
index c789c50..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-@echo off
-REM Setup environment variables for Visual C++ 1.52c 16 bit edition
-
-if .%CHECKED%==.1 goto checked_build
-set LIB=%SCITECH_LIB%\LIB\RELEASE\DOS16\VC5;%VC_PATH%\LIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-set LIB=%SCITECH_LIB%\LIB\DEBUG\DOS16\VC5;%VC_PATH%\LIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-set TOOLROOTDIR=%VC_PATH%
-set INCLUDE=.;INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%VC_PATH%\INCLUDE;
-set INIT=%VC_PATH%
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\VC16.MK
-SET USE_WIN16=
-SET USE_WIN32=
-SET USE_RTTARGET=
-SET USE_SNAP=
-SET VC_LIBBASE=vc5
-PATH %SCITECH_BIN%;%VC_PATH%\BIN;%DEFPATH%%VC_CD_PATH%
-
-echo Visual C++ 1.52c 16-bit DOS compilation environment set up.
diff --git a/board/MAI/bios_emulator/scitech/bin/vc50-drv9x.bat b/board/MAI/bios_emulator/scitech/bin/vc50-drv9x.bat
deleted file mode 100755 (executable)
index 27a4a14..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-@echo off
-REM Setup environment variables for Visual C++ 6.0 32 bit edition
-
-REM: First setup for Win32 console development
-call vc60-c32.bat > NUL
-
-REM: Extra stuff to set up for Windows 9x DDK development
-set MASTER_MAKE=1
-set DDKROOT=%W95_DDKROOT%
-set SDKROOT=%MSSDK%
-set C16_ROOT=%VC_PATH%
-set C32_ROOT=%VC6_PATH%
-
-if .%CHECKED%==.1 goto checked_build
-echo Release build enabled.
-goto done
-:checked_build
-echo Checked debug build enabled.
-goto done
-:done
-echo Visual C++ 6.0 Windows 9x driver compilation environment set up
diff --git a/board/MAI/bios_emulator/scitech/bin/vc50-drvnt.bat b/board/MAI/bios_emulator/scitech/bin/vc50-drvnt.bat
deleted file mode 100755 (executable)
index 17b2f25..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-@echo off
-REM Setup environment variables for Visual C++ 6.0 32 bit edition
-
-REM: First setup for Win32 console development (with Platform SDK)
-call vc60-c32.bat sdk > NUL
-
-REM: Now setup stuff for the NT DDK build environment
-call ntddk.bat
-
-if .%CHECKED%==.1 goto checked_build
-echo Release build enabled.
-goto done
-:checked_build
-echo Checked debug build enabled.
-goto done
-:done
-echo Visual C++ 6.0 Windows NT driver compilation environment set up
diff --git a/board/MAI/bios_emulator/scitech/bin/vc50-rtt.bat b/board/MAI/bios_emulator/scitech/bin/vc50-rtt.bat
deleted file mode 100755 (executable)
index afb2fb1..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-@echo off
-REM Setup environment variables for Visual C++ 5.0 32 bit edition
-
-if .%CHECKED%==.1 goto checked_build
-set LIB=%SCITECH_LIB%\LIB\RELEASE\WIN32\VC5;%VC5_PATH%\VC\LIB;%TNT_PATH%\LIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-set LIB=%SCITECH_LIB%\LIB\DEBUG\WIN32\VC5;%VC5_PATH%\VC\LIB;%TNT_PATH%\LIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-set TOOLROOTDIR=%VC5_PATH%\VC
-set INCLUDE=.;INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%VC5_PATH%\VC\INCLUDE;%TNT_PATH%\INCLUDE;
-set INIT=%VC5_PATH%\VC
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\VC32.MK
-SET USE_TNT=
-SET USE_WIN16=
-SET USE_WIN32=
-SET WIN32_GUI=
-SET USE_VXD=
-SET USE_NTDRV=
-SET USE_RTTARGET=1
-SET USE_SNAP=
-SET VC_LIBBASE=vc5
-PATH %SCITECH_BIN%;%VC5_PATH%\VC\BIN;%VC5_PATH%\SHAREDIDE\BIN;%TNT_PATH%\BIN;%DEFPATH%%VC32_CD_PATH%
-
-echo Visual C++ 5.0 RTTarget-32 compilation environment set up
diff --git a/board/MAI/bios_emulator/scitech/bin/vc50-snp.bat b/board/MAI/bios_emulator/scitech/bin/vc50-snp.bat
deleted file mode 100755 (executable)
index 22d2e13..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-@echo off REM Setup environment variables for Visual C++ 5.0 32 bit
-edition
-
-SET MSDevDir=%VC5_MSDevDir%
-SET MSVCDir=%VC5_MSVCDir%
-
-if .%CHECKED%==.1 goto checked_build
-set LIB=%SCITECH_LIB%\LIB\RELEASE\SNAP\VC5;%MSVCDir%\LIB;%TNT_PATH%\LIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-set LIB=%SCITECH_LIB%\LIB\DEBUG\SNAP\VC5;%MSVCDir%\LIB;%TNT_PATH%\LIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-set TOOLROOTDIR=%MSVCDir%
-set INCLUDE=.;INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE
-set INIT=%MSVCDir%
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\VC32.MK
-SET USE_TNT=
-SET USE_WIN16=
-SET USE_WIN32=
-SET WIN32_GUI=
-SET USE_VXD=
-SET USE_NTDRV=
-SET USE_RTTARGET=
-SET USE_SNAP=1
-SET VC_LIBBASE=vc5
-PATH %SCITECH_BIN%;%MSVCDir%\BIN;%MSDevDir%\BIN;%TNT_PATH%\BIN;%DEFPATH%%VC32_CD_PATH%
-
-echo Visual C++ 5.0 Snap compilation environment set up
diff --git a/board/MAI/bios_emulator/scitech/bin/vc50-tnt.bat b/board/MAI/bios_emulator/scitech/bin/vc50-tnt.bat
deleted file mode 100755 (executable)
index 6b09199..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-@echo off
-REM Setup environment variables for Visual C++ 5.0 32 bit edition
-
-if .%CHECKED%==.1 goto checked_build
-set LIB=%SCITECH_LIB%\LIB\RELEASE\DOS32\VC5;%VC5_PATH%\VC\LIB;%TNT_PATH%\COFFLIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-set LIB=%SCITECH_LIB%\LIB\RELEASE\DOS32\VC5;%VC5_PATH%\VC\LIB;%TNT_PATH%\COFFLIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-set TOOLROOTDIR=%VC5_PATH%\VC
-set INCLUDE=.;INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%VC5_PATH%\VC\INCLUDE;%TNT_PATH%\INCLUDE;
-set INIT=%VC5_PATH%\VC
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\VC32.MK
-SET USE_WIN16=
-SET USE_WIN32=
-SET USE_TNT=
-SET USE_VXD=
-SET USE_NTDRV=
-SET USE_RTTARGET=
-SET USE_SNAP=
-SET VC_LIBBASE=vc5
-PATH %SCITECH_BIN%;%VC5_PATH%\VC\BIN;%VC5_PATH%\SHAREDIDE\BIN;%TNT_PATH%\BIN;%DEFPATH%%VC32_CD_PATH%
-
-REM If you set the following to a 1, a TNT DosStyle app will be created.
-REM Otherwise a TNT NtStyle app will be created. NtStyle apps will *only*
-REM run under real DOS when using our libraries, since we require access
-REM to functions that the Win32 API does not support (such as direct access
-REM to video memory, calling Int 10h BIOS functions etc). DosStyle apps
-REM will however run fine in both DOS and a Win95 DOS box (NT DOS boxes don't
-REM work too well).
-REM
-REM If you are using the RealTime DOS extender, your apps *must* be NtStyle,
-REM and hence will never be able to run under Win95 or WinNT, only DOS.
-
-SET DOSSTYLE=
-
-echo Visual C++ 5.0 32-bit compilation environment set up (with TNT).
diff --git a/board/MAI/bios_emulator/scitech/bin/vc50-w16.bat b/board/MAI/bios_emulator/scitech/bin/vc50-w16.bat
deleted file mode 100755 (executable)
index 52ab495..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-@echo off
-REM Setup environment variables for Visual C++ 1.52c 16 bit edition
-
-if .%CHECKED%==.1 goto checked_build
-set LIB=%SCITECH_LIB%\LIB\RELEASE\WIN16\VC5;%VC_PATH%\LIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-set LIB=%SCITECH_LIB%\LIB\DEBUG\WIN16\VC5;%VC_PATH%\LIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-set TOOLROOTDIR=%VC_PATH%
-set INCLUDE=.;INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%VC_PATH%\INCLUDE;
-set INIT=%VC_PATH%
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\VC16.MK
-SET USE_WIN16=1
-SET USE_WIN32=
-SET USE_RTTARGET=
-SET USE_SNAP=
-SET VC_LIBBASE=vc5
-PATH %SCITECH_BIN%;%VC_PATH%\BIN;%DEFPATH%%VC_CD_PATH%
-
-echo Visual C++ 1.52c 16-bit Windows compilation environment set up.
-
diff --git a/board/MAI/bios_emulator/scitech/bin/vc50-w32.bat b/board/MAI/bios_emulator/scitech/bin/vc50-w32.bat
deleted file mode 100755 (executable)
index 07bc5e5..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-@echo off
-REM Setup environment variables for Visual C++ 5.0 32 bit edition
-
-SET MSDevDir=%VC5_MSDevDir%
-SET MSVCDir=%VC5_MSVCDir%
-
-if .%CHECKED%==.1 goto checked_build
-set LIB=%SCITECH_LIB%\LIB\RELEASE\WIN32\VC5;%MSVCDir%\LIB;%TNT_PATH%\LIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-set LIB=%SCITECH_LIB%\LIB\DEBUG\WIN32\VC5;%MSVCDir%\LIB;%TNT_PATH%\LIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-set TOOLROOTDIR=%MSVCDir%
-set C_INCLUDE=%MSVCDir%\INCLUDE;%TNT_PATH%\INCLUDE;
-set INCLUDE=.;INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%C_INCLUDE%
-set INIT=%MSVCDir%
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\VC32.MK
-SET USE_TNT=
-SET USE_WIN16=
-SET USE_WIN32=1
-SET WIN32_GUI=1
-SET USE_VXD=
-SET USE_NTDRV=
-SET USE_RTTARGET=
-SET USE_SNAP=
-SET VC_LIBBASE=vc5
-PATH %SCITECH_BIN%;%MSVCDir%\BIN;%MSDevDir%\BIN;%TNT_PATH%\BIN;%DEFPATH%%VC32_CD_PATH%
-
-REM: Enable Win32 SDK if desired (sdk on command line)
-if NOT .%1%==.sdk goto done
-call win32sdk.bat
-
-:done
-echo Visual C++ 5.0 32-bit Windows console compilation environment set up
diff --git a/board/MAI/bios_emulator/scitech/bin/vc50-x11.bat b/board/MAI/bios_emulator/scitech/bin/vc50-x11.bat
deleted file mode 100755 (executable)
index fe286bd..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-@echo off
-REM Setup environment variables for Visual C++ 5.0 32 bit edition
-
-SET LIB=%VC5_PATH%\VC\LIB;.
-SET TOOLROOTDIR=%VC5_PATH%\VC
-SET INCLUDE=\xc\include;%VC5_PATH%\VC\INCLUDE
-SET INIT=%VC5_PATH%\VC
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\VC32.MK
-SET USE_TNT=
-SET USE_WIN16=
-SET USE_WIN32=1
-SET WIN32_GUI=1
-SET USE_VXD=
-SET USE_NTDRV=
-SET USE_RTTARGET=
-SET USE_SNAP=
-SET VC_LIBBASE=vc5
-PATH %SCITECH_BIN%;%VC5_PATH%\VC\BIN;%VC5_PATH%\SHAREDIDE\BIN;%DEFPATH%
-
-echo Visual C++ 5.0 X11 compilation environment set up
diff --git a/board/MAI/bios_emulator/scitech/bin/vc60-c32.bat b/board/MAI/bios_emulator/scitech/bin/vc60-c32.bat
deleted file mode 100755 (executable)
index e98417d..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-@echo off
-REM Setup environment variables for Visual C++ 6.0 32 bit edition
-
-SET MSDevDir=%VC6_MSDevDir%
-SET MSVCDir=%VC6_MSVCDir%
-
-if .%CHECKED%==.1 goto checked_build
-set LIB=%SCITECH_LIB%\LIB\RELEASE\WIN32\VC6;%MSVCDir%\LIB;%TNT_PATH%\LIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-set LIB=%SCITECH_LIB%\LIB\DEBUG\WIN32\VC6;%MSVCDir%\LIB;%TNT_PATH%\LIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-set TOOLROOTDIR=%MSVCDir%
-set C_INCLUDE=%MSVCDir%\INCLUDE;%TNT_PATH%\INCLUDE
-set INCLUDE=.;INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%C_INCLUDE%
-set INIT=%MSVCDir%
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\VC32.MK
-SET USE_TNT=
-SET USE_WIN16=
-SET USE_WIN32=1
-SET WIN32_GUI=
-SET USE_VXD=
-SET USE_NTDRV=
-SET USE_RTTARGET=
-SET USE_SNAP=
-SET VC_LIBBASE=vc6
-PATH %SCITECH_BIN%;%MSVCDir%\BIN;%MSDevDir%\BIN;%TNT_PATH%\BIN;%DEFPATH%%VC32_CD_PATH%
-
-REM: Enable Win32 SDK if desired (sdk on command line)
-if NOT .%1%==.sdk goto done
-call win32sdk.bat
-
-:done
-echo Visual C++ 6.0 32-bit Windows console compilation environment set up
diff --git a/board/MAI/bios_emulator/scitech/bin/vc60-d16.bat b/board/MAI/bios_emulator/scitech/bin/vc60-d16.bat
deleted file mode 100755 (executable)
index 10855e0..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-@echo off
-REM Setup environment variables for Visual C++ 1.52c 16 bit edition
-
-if .%CHECKED%==.1 goto checked_build
-set LIB=%SCITECH_LIB%\LIB\RELEASE\DOS16\VC6;%VC_PATH%\LIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-set LIB=%SCITECH_LIB%\LIB\DEBUG\DOS16\VC6;%VC_PATH%\LIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-set TOOLROOTDIR=%VC_PATH%
-set INCLUDE=.;INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%VC_PATH%\INCLUDE;
-set INIT=%VC_PATH%
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\VC16.MK
-SET USE_WIN16=
-SET USE_WIN32=
-SET USE_RTTARGET=
-SET USE_SNAP=
-SET VC_LIBBASE=vc6
-PATH %SCITECH_BIN%;%VC_PATH%\BIN;%DEFPATH%%VC_CD_PATH%
-
-echo Visual C++ 1.52c 16-bit DOS compilation environment set up.
diff --git a/board/MAI/bios_emulator/scitech/bin/vc60-drv9x.bat b/board/MAI/bios_emulator/scitech/bin/vc60-drv9x.bat
deleted file mode 100755 (executable)
index 27a4a14..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-@echo off
-REM Setup environment variables for Visual C++ 6.0 32 bit edition
-
-REM: First setup for Win32 console development
-call vc60-c32.bat > NUL
-
-REM: Extra stuff to set up for Windows 9x DDK development
-set MASTER_MAKE=1
-set DDKROOT=%W95_DDKROOT%
-set SDKROOT=%MSSDK%
-set C16_ROOT=%VC_PATH%
-set C32_ROOT=%VC6_PATH%
-
-if .%CHECKED%==.1 goto checked_build
-echo Release build enabled.
-goto done
-:checked_build
-echo Checked debug build enabled.
-goto done
-:done
-echo Visual C++ 6.0 Windows 9x driver compilation environment set up
diff --git a/board/MAI/bios_emulator/scitech/bin/vc60-drvnt.bat b/board/MAI/bios_emulator/scitech/bin/vc60-drvnt.bat
deleted file mode 100755 (executable)
index 17b2f25..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-@echo off
-REM Setup environment variables for Visual C++ 6.0 32 bit edition
-
-REM: First setup for Win32 console development (with Platform SDK)
-call vc60-c32.bat sdk > NUL
-
-REM: Now setup stuff for the NT DDK build environment
-call ntddk.bat
-
-if .%CHECKED%==.1 goto checked_build
-echo Release build enabled.
-goto done
-:checked_build
-echo Checked debug build enabled.
-goto done
-:done
-echo Visual C++ 6.0 Windows NT driver compilation environment set up
diff --git a/board/MAI/bios_emulator/scitech/bin/vc60-drvw2k.bat b/board/MAI/bios_emulator/scitech/bin/vc60-drvw2k.bat
deleted file mode 100755 (executable)
index f304293..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-@echo off
-REM Setup environment variables for Visual C++ 6.0 32 bit edition
-
-REM: First setup for Win32 console development (with Platform SDK)
-call vc60-c32.bat sdk > NUL
-
-REM: Now setup stuff for the NT DDK build environment
-call w2kddk.bat
-
-if .%CHECKED%==.1 goto checked_build
-echo Release build enabled.
-goto done
-:checked_build
-echo Checked debug build enabled.
-goto done
-:done
-echo Visual C++ 6.0 Windows Windows 2000 driver compilation environment set up
diff --git a/board/MAI/bios_emulator/scitech/bin/vc60-snp.bat b/board/MAI/bios_emulator/scitech/bin/vc60-snp.bat
deleted file mode 100755 (executable)
index 5348ef9..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-@echo off
-REM Setup environment variables for Visual C++ 6.0 32 bit edition
-
-SET MSDevDir=%VC6_MSDevDir%
-SET MSVCDir=%VC6_MSVCDir%
-
-if .%CHECKED%==.1 goto checked_build
-set LIB=%SCITECH_LIB%\LIB\RELEASE\SNAP\VC6;%MSVCDir%\LIB;%TNT_PATH%\LIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-set LIB=%SCITECH_LIB%\LIB\DEBUG\SNAP\VC6;%MSVCDir%\LIB;%TNT_PATH%\LIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-set TOOLROOTDIR=%MSVCDir%
-set INCLUDE=.;INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE
-set INIT=%MSVCDir%
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\VC32.MK
-SET USE_TNT=
-SET USE_WIN16=
-SET USE_WIN32=
-SET WIN32_GUI=
-SET USE_VXD=
-SET USE_NTDRV=
-SET USE_RTTARGET=
-SET USE_SNAP=1
-SET VC_LIBBASE=vc6
-PATH %SCITECH_BIN%;%MSVCDir%\BIN;%MSDevDir%\BIN;%TNT_PATH%\BIN;%DEFPATH%%VC32_CD_PATH%
-
-echo Visual C++ 6.0 Snap compilation environment set up
diff --git a/board/MAI/bios_emulator/scitech/bin/vc60-tnt.bat b/board/MAI/bios_emulator/scitech/bin/vc60-tnt.bat
deleted file mode 100755 (executable)
index 1d8b5e3..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-@echo off
-REM Setup environment variables for Visual C++ 6.0 32 bit edition
-
-if .%CHECKED%==.1 goto checked_build
-set LIB=%SCITECH_LIB%\LIB\RELEASE\DOS32\VC6;%VC6_PATH%\VC98\LIB;%TNT_PATH%\COFFLIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-set LIB=%SCITECH_LIB%\LIB\RELEASE\DOS32\VC6;%VC6_PATH%\VC98\LIB;%TNT_PATH%\COFFLIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-set TOOLROOTDIR=%VC6_PATH%\VC98
-set INCLUDE=.;INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%VC6_PATH%\VC98\INCLUDE;%TNT_PATH%\INCLUDE;
-set INIT=%VC6_PATH%\VC98
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\VC32.MK
-SET USE_WIN16=
-SET USE_WIN32=
-SET USE_TNT=
-SET USE_VXD=
-SET USE_NTDRV=
-SET USE_RTTARGET=
-SET USE_SNAP=
-SET VC_LIBBASE=vc6 PATH
-%SCITECH_BIN%;%VC6_PATH%\VC98\BIN;%VC6_PATH%\COMMON\MSDEV98\BIN;%TNT_PATH%\BIN;%DEFPATH%%VC32_CD_PATH%
-
-REM If you set the following to a 1, a TNT DosStyle app will be created.
-REM Otherwise a TNT NtStyle app will be created. NtStyle apps will *only*
-REM run under real DOS when using our libraries, since we require access
-REM to functions that the Win32 API does not support (such as direct access
-REM to video memory, calling Int 10h BIOS functions etc). DosStyle apps
-REM will however run fine in both DOS and a Win95 DOS box (NT DOS boxes don't
-REM work too well).
-REM
-REM If you are using the RealTime DOS extender, your apps *must* be NtStyle,
-REM and hence will never be able to run under Win95 or WinNT, only DOS.
-
-SET DOSSTYLE=
-
-echo Visual C++ 6.0 32-bit compilation environment set up (with TNT).
diff --git a/board/MAI/bios_emulator/scitech/bin/vc60-w16.bat b/board/MAI/bios_emulator/scitech/bin/vc60-w16.bat
deleted file mode 100755 (executable)
index 70175c3..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-@echo off
-REM Setup environment variables for Visual C++ 1.52c 16 bit edition
-
-if .%CHECKED%==.1 goto checked_build
-set LIB=%SCITECH_LIB%\LIB\RELEASE\WIN16\VC6;%VC_PATH%\LIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-set LIB=%SCITECH_LIB%\LIB\DEBUG\WIN16\VC6;%VC_PATH%\LIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-set TOOLROOTDIR=%VC_PATH%
-set INCLUDE=.;INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%VC_PATH%\INCLUDE;
-set INIT=%VC_PATH%
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\VC16.MK
-SET USE_WIN16=1
-SET USE_WIN32=
-SET USE_RTTARGET=
-SET USE_SNAP=
-SET VC_LIBBASE=vc6
-PATH %SCITECH_BIN%;%VC_PATH%\BIN;%DEFPATH%%VC_CD_PATH%
-
-echo Visual C++ 1.52c 16-bit Windows compilation environment set up.
-
diff --git a/board/MAI/bios_emulator/scitech/bin/vc60-w32.bat b/board/MAI/bios_emulator/scitech/bin/vc60-w32.bat
deleted file mode 100755 (executable)
index 2f8e7ab..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-@echo off
-REM Setup environment variables for Visual C++ 6.0 32 bit edition
-
-SET MSDevDir=%VC6_MSDevDir%
-SET MSVCDir=%VC6_MSVCDir%
-
-if .%CHECKED%==.1 goto checked_build
-set LIB=%SCITECH_LIB%\LIB\RELEASE\WIN32\VC6;%MSVCDir%\LIB;%TNT_PATH%\LIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-set LIB=%SCITECH_LIB%\LIB\DEBUG\WIN32\VC6;%MSVCDir%\LIB;%TNT_PATH%\LIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-set TOOLROOTDIR=%MSVCDir%
-set C_INCLUDE=%MSVCDir%\INCLUDE;%TNT_PATH%\INCLUDE
-set INCLUDE=.;INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%C_INCLUDE%
-set INIT=%MSVCDir%
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\VC32.MK
-SET USE_TNT=
-SET USE_WIN16=
-SET USE_WIN32=1
-SET WIN32_GUI=1
-SET USE_VXD=
-SET USE_NTDRV=
-SET USE_RTTARGET=
-SET USE_SNAP=
-SET VC_LIBBASE=vc6
-PATH %SCITECH_BIN%;%MSVCDir%\BIN;%MSDevDir%\BIN;%TNT_PATH%\BIN;%DEFPATH%%VC32_CD_PATH%
-
-REM: Enable Win32 SDK if desired (sdk on command line)
-if NOT .%1%==.sdk goto done
-call win32sdk.bat
-
-:done
-echo Visual C++ 6.0 32-bit Windows compilation environment set up
diff --git a/board/MAI/bios_emulator/scitech/bin/vc60-x11.bat b/board/MAI/bios_emulator/scitech/bin/vc60-x11.bat
deleted file mode 100755 (executable)
index 57b23d2..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-@echo off
-REM Setup environment variables for Visual C++ 6.0 32 bit edition
-
-SET LIB=%VC6_PATH%\VC98\LIB;.
-SET TOOLROOTDIR=%VC6_PATH%\VC98
-SET INCLUDE=\xc\include;%VC6_PATH%\VC98\INCLUDE;
-SET INIT=%VC6_PATH%\VC98
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\VC32.MK
-SET USE_TNT=
-SET USE_WIN16=
-SET USE_WIN32=1
-SET WIN32_GUI=1
-SET USE_VXD=
-SET USE_NTDRV=
-SET USE_RTTARGET=
-SET USE_SNAP=
-SET VC_LIBBASE=vc6
-PATH %SCITECH_BIN%;%VC6_PATH%\VC98\BIN;%VC6_PATH%\COMMON\MSDEV98\BIN;%DEFPATH%
-
-echo Visual C++ 6.0 X11 compilation environment set up
diff --git a/board/MAI/bios_emulator/scitech/bin/w2kddk.bat b/board/MAI/bios_emulator/scitech/bin/w2kddk.bat
deleted file mode 100755 (executable)
index 92858d1..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-@echo off
-REM: Set up environment variables for Microsoft Windows NT DDK development.
-REM: Note that we have hard coded this for Windows NT i386 development.
-
-SET USE_NTDRV=1
-SET USE_W2KDRV=1
-SET BASEDIR=%W2K_DDKROOT%
-SET PATH=%BASEDIR%\bin;%PATH%
-SET NTMAKEENV=%BASEDIR%\inc
-SET BUILD_MAKE_PROGRAM=nmake.exe
-SET BUILD_DEFAULT=-ei -nmake -i
-SET BUILD_DEFAULT_TARGETS=-386
-SET _OBJ_DIR=obj
-SET NEW_CRTS=1
-SET _NTROOT=%BASEDIR%
-SET INCLUDE=%BASEDIR%\inc;%BASEDIR%\inc\ddk;%INCLUDE%
-
-if .%CHECKED%==.1 goto checked
-
-REM: set up an NT free build environment
-SET DDKBUILDENV=free
-SET C_DEFINES=-D_IDWBUILD
-SET NTDBGFILES=1
-SET NTDEBUG=
-SET NTDEBUGTYPE=
-SET MSC_OPTIMIZATION=
-set LIB=%BASEDIR%\libfre\i386;%SCITECH_LIB%\LIB\RELEASE\W2KDRV\VC6;%MSVCDir%\LIB;.
-
-goto done
-
-:checked
-
-REM: set up an NT checked build environment
-SET DDKBUILDENV=checked
-SET C_DEFINES=-D_IDWBUILD -DRDRDBG -DSRVDBG
-SET NTDBGFILES=
-SET NTDEBUG=ntsd
-SET NTDEBUGTYPE=both
-SET MSC_OPTIMIZATION=/Od /Oi
-set LIB=%BASEDIR%\libchk\i386;%SCITECH_LIB%\LIB\DEBUG\W2KDRV\VC6;%MSVCDir%\LIB;.
-
-:done
diff --git a/board/MAI/bios_emulator/scitech/bin/wc10-c32.bat b/board/MAI/bios_emulator/scitech/bin/wc10-c32.bat
deleted file mode 100755 (executable)
index 2d738f3..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-@echo off
-REM Setup for compiling with Watcom C/C++ 10.6 in 32 bit mode
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\WIN32\WC10;%WC10_PATH%\LIB386;%WC10_PATH%\LIB386\NT;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\WIN32\WC10;%WC10_PATH%\LIB386;%WC10_PATH%\LIB386\NT;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET EDPATH=%WC10_PATH%\EDDAT
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%WC10_PATH%\H;%WC10_PATH%\H\NT;
-SET WATCOM=%WC10_PATH%
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\WC32.MK
-SET USE_TNT=
-SET USE_X32=
-SET USE_X32VM=
-SET USE_WIN16=
-SET USE_WIN32=1
-SET USE_WIN386=
-SET WIN32_GUI=
-SET USE_OS216=
-SET USE_OS232=
-SET USE_OS2GUI=
-SET USE_SNAP=
-SET USE_QNX4=
-SET WC_LIBBASE=WC10
-PATH %SCITECH_BIN%;%WC10_PATH%\BINNT;%WC10_PATH%\BINW;%DEFPATH%%WC_CD_PATH%
-
-echo Watcom C/C++ 10.6 Win32 console compilation environment set up
diff --git a/board/MAI/bios_emulator/scitech/bin/wc10-d16.bat b/board/MAI/bios_emulator/scitech/bin/wc10-d16.bat
deleted file mode 100755 (executable)
index 5c53a90..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-@echo off
-REM Setup for compiling with Watcom C/C++ 10.6 in 32 bit mode (DOS4GW)
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\DOS16\WC10;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\DOS16\WC10;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET EDPATH=%WC10_PATH%\EDDAT
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%WC10_PATH%\H;%WC10_PATH%\H\WIN;
-SET WATCOM=%WC10_PATH%
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\WC16.MK
-SET USE_WIN16=
-SET USE_WIN32=
-SET USE_OS216=
-SET USE_OS232=
-SET USE_OS2GUI=
-SET USE_SNAP=
-SET USE_QNX4=
-SET WC_LIBBASE=WC10
-SET EDPATH=%WC10_PATH%\EDDAT
-PATH %SCITECH_BIN%;%WC10_PATH%\BINNT;%WC10_PATH%\BINW;%DEFPATH%%WC_CD_PATH%
-
-echo Watcom C/C++ 10.6 16-bit DOS compilation environment set up.
diff --git a/board/MAI/bios_emulator/scitech/bin/wc10-d32.bat b/board/MAI/bios_emulator/scitech/bin/wc10-d32.bat
deleted file mode 100755 (executable)
index a5c7210..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-@echo off
-REM Setup for compiling with Watcom C/C++ 10.6 in 32 bit mode (DOS4GW)
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\DOS32\WC10;%WC10_PATH%\LIB386;%WC10_PATH%\LIB386\DOS;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\DOS32\WC10;%WC10_PATH%\LIB386;%WC10_PATH%\LIB386\DOS;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET EDPATH=%WC10_PATH%\EDDAT
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%WC10_PATH%\H;
-SET WATCOM=%WC10_PATH%
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\WC32.MK
-SET USE_TNT=
-SET USE_X32=
-SET USE_X32VM=
-SET USE_WIN16=
-SET USE_WIN32=
-SET USE_WIN386=
-SET USE_OS216=
-SET USE_OS232=
-SET USE_OS2GUI=
-SET USE_SNAP=
-SET USE_QNX4=
-SET WC_LIBBASE=WC10
-PATH %SCITECH_BIN%;%WC10_PATH%\BINNT;%WC10_PATH%\BINW;%DJ_PATH%\BIN;%DEFPATH%%WC_CD_PATH%
-
-echo Watcom C/C++ 10.6 32-bit DOS compilation environment set up (DOS4GW)
-
diff --git a/board/MAI/bios_emulator/scitech/bin/wc10-o16.bat b/board/MAI/bios_emulator/scitech/bin/wc10-o16.bat
deleted file mode 100755 (executable)
index 579dece..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-@echo off
-REM Setup for compiling with Watcom C/C++ 10.6 in 16-bit OS/2 mode
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\lib\release\os216\wc10;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\lib\debug\os216\wc10;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET EDPATH=%WC10_PATH%\eddat
-SET INCLUDE=include;%SCITECH%\include;%PRIVATE%\include;%WC10_PATH%\h\os2;%WC10_PATH%\h
-SET WATCOM=%WC10_PATH%
-SET MAKESTARTUP=%SCITECH%\makedefs\wc16.mk
-SET USE_WIN16=
-SET USE_WIN32=
-SET USE_WIN386=
-SET USE_OS216=1
-SET USE_OS232=
-SET USE_OS2GUI=
-SET USE_SNAP=
-SET USE_QNX4=
-SET WC_LIBBASE=wc10
-SET EDPATH=%WC10_PATH%\EDDAT
-PATH %SCITECH_BIN%;%WC10_PATH%\BINNT;%WC10_PATH%\BINW;%DEFPATH%%WC_CD_PATH%
-
-echo Watcom C/C++ 10.6 16-bit OS/2 compilation environment set up.
diff --git a/board/MAI/bios_emulator/scitech/bin/wc10-o32.bat b/board/MAI/bios_emulator/scitech/bin/wc10-o32.bat
deleted file mode 100755 (executable)
index 3404b42..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-@echo off
-REM Setup for compiling with Watcom C/C++ 10.6 in 32-bit OS/2 mode
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\lib\release\os232\wc10;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\lib\debug\os232\wc10;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET EDPATH=%WC10_PATH%\eddat
-SET INCLUDE=include;%SCITECH%\include;%PRIVATE%\include;%WC10_PATH%\h\os2;%WC10_PATH%\h
-SET WATCOM=%WC10_PATH%
-SET MAKESTARTUP=%SCITECH%\makedefs\wc32.mk
-SET USE_WIN16=
-SET USE_WIN32=
-SET USE_WIN386=
-SET USE_OS216=
-SET USE_OS232=1
-SET USE_OS2GUI=
-SET USE_SNAP=
-SET USE_QNX4=
-SET WC_LIBBASE=wc10
-SET EDPATH=%WC10_PATH%\EDDAT
-PATH %SCITECH_BIN%;%WC10_PATH%\BINNT;%WC10_PATH%\BINW;%DEFPATH%%WC_CD_PATH%
-
-echo Watcom C/C++ 10.6 32-bit OS/2 console compilation environment set up.
diff --git a/board/MAI/bios_emulator/scitech/bin/wc10-p32.bat b/board/MAI/bios_emulator/scitech/bin/wc10-p32.bat
deleted file mode 100755 (executable)
index 57057de..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-@echo off
-REM Setup for compiling with Watcom C/C++ 10.6 in 32-bit OS/2 mode
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\lib\release\os232\wc10;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\lib\debug\os232\wc10;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET EDPATH=%WC10_PATH%\eddat
-SET INCLUDE=include;%SCITECH%\include;%PRIVATE%\include;%WC10_PATH%\h\os2;%WC10_PATH%\h
-SET WATCOM=%WC10_PATH%
-SET MAKESTARTUP=%SCITECH%\makedefs\wc32.mk
-SET USE_WIN16=
-SET USE_WIN32=
-SET USE_WIN386=
-SET USE_OS216=
-SET USE_OS232=1
-SET USE_OS2GUI=1
-SET USE_SNAP=
-SET USE_QNX4=
-SET WC_LIBBASE=wc10
-SET EDPATH=%WC10_PATH%\EDDAT
-PATH %SCITECH_BIN%;%WC10_PATH%\BINNT;%WC10_PATH%\BINW;%DEFPATH%%WC_CD_PATH%
-
-echo Watcom C/C++ 10.6 32-bit OS/2 GUI compilation environment set up.
diff --git a/board/MAI/bios_emulator/scitech/bin/wc10-qnx.bat b/board/MAI/bios_emulator/scitech/bin/wc10-qnx.bat
deleted file mode 100755 (executable)
index 46f8659..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-@echo off
-REM Setup for compiling with Watcom C/C++ 10.6 in 32 bit mode (QNX 4)
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\QNX4\WC10;%WC10_PATH%\LIB386;%WC10_PATH%\LIB386\QNX;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\QNX4\WC10;%WC10_PATH%\LIB386;%WC10_PATH%\LIB386\QNX;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET EDPATH=%WC10_PATH%\EDDAT
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%WC10_PATH%\QH;
-SET WATCOM=%WC10_PATH%
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\WC32.MK
-SET USE_TNT=
-SET USE_X32=
-SET USE_X32VM=
-SET USE_WIN16=
-SET USE_WIN32=
-SET USE_WIN386=
-SET USE_OS216=
-SET USE_OS232=
-SET USE_OS2GUI=
-SET USE_SNAP=
-SET USE_QNX4=1
-SET WC_LIBBASE=WC10
-PATH %SCITECH_BIN%;%WC10_PATH%\BINNT;%WC10_PATH%\BINW;%DJ_PATH%\BIN;%DEFPATH%%WC_CD_PATH%
-
-echo Watcom C/C++ 10.6 32-bit QNX compilation environment set up
-
diff --git a/board/MAI/bios_emulator/scitech/bin/wc10-snp.bat b/board/MAI/bios_emulator/scitech/bin/wc10-snp.bat
deleted file mode 100755 (executable)
index 1fde624..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-@echo off
-REM Setup for compiling with Watcom C/C++ 10.6 in 32 bit mode
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\SNAP\WC10;%WC10_PATH%\LIB386;%WC10_PATH%\LIB386\NT;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\SNAP\WC10;%WC10_PATH%\LIB386;%WC10_PATH%\LIB386\NT;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET EDPATH=%WC10_PATH%\EDDAT
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%WC10_PATH%\H
-SET WATCOM=%WC10_PATH%
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\WC32.MK
-SET USE_TNT=
-SET USE_X32=
-SET USE_X32VM=
-SET USE_WIN16=
-SET USE_WIN32=
-SET USE_WIN386=
-SET WIN32_GUI=
-SET USE_OS216=
-SET USE_OS232=
-SET USE_OS2GUI=
-SET USE_SNAP=1
-SET USE_QNX4=
-SET WC_LIBBASE=WC10
-PATH %SCITECH_BIN%;%WC10_PATH%\BINNT;%WC10_PATH%\BINW;%DEFPATH%%WC_CD_PATH%
-
-echo Watcom C/C++ 10.6 Snap compilation environment set up
diff --git a/board/MAI/bios_emulator/scitech/bin/wc10-tnt.bat b/board/MAI/bios_emulator/scitech/bin/wc10-tnt.bat
deleted file mode 100755 (executable)
index d12f042..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-@echo off
-REM Setup for compiling with Watcom C/C++ 10.6 in 32 bit mode with Phar Lap TNT
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\DOS32\WC10;%WC10_PATH%\LIB386;%WC10_PATH%\LIB386\DOS;%TNT_PATH%\LIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\DOS32\WC10;%WC10_PATH%\LIB386;%WC10_PATH%\LIB386\DOS;%TNT_PATH%\LIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET EDPATH=%WC10_PATH%\EDDAT
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%WC10_PATH%\H;%WC10_PATH%\H\NT;%TNT_PATH%\INCLUDE
-SET WATCOM=%WC10_PATH%
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\WC32.MK
-SET USE_TNT=1
-SET USE_X32=
-SET USE_X32VM=
-SET USE_WIN16=
-SET USE_WIN32=
-SET USE_WIN386=
-SET USE_OS216=
-SET USE_OS232=
-SET USE_OS2GUI=
-SET USE_SNAP=
-SET USE_QNX4=
-SET WC_LIBBASE=WC10
-PATH %SCITECH_BIN%;%WC10_PATH%\BINNT;%WC10_PATH%\BINW;%DEFPATH%%WC_CD_PATH%
-
-REM If you set the following to a 1, a TNT DosStyle app will be created.
-REM Otherwise a TNT NtStyle app will be created. NtStyle apps will *only*
-REM run under real DOS when using our libraries, since we require access
-REM to functions that the Win32 API does not support (such as direct access
-REM to video memory, calling Int 10h BIOS functions etc). DosStyle apps
-REM will however run fine in both DOS and a Win95 DOS box (NT DOS boxes don't
-REM work too well).
-REM
-REM If you are using the RealTime DOS extender, your apps *must* be NtStyle,
-REM and hence will never be able to run under Win95 or WinNT, only DOS.
-
-SET DOSSTYLE=1
-
-echo Watcom C/C++ 10.6 32-bit DOS compilation environment set up (TNT).
diff --git a/board/MAI/bios_emulator/scitech/bin/wc10-w16.bat b/board/MAI/bios_emulator/scitech/bin/wc10-w16.bat
deleted file mode 100755 (executable)
index e8ba871..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-@echo off
-REM Setup for compiling with Watcom C/C++ 10.6 in 16 bit Windows mode
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\WIN16\WC10;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\WIN16\WC10;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET EDPATH=%WC10_PATH%\EDDAT
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%WC10_PATH%\H;%WC10_PATH%\H\WIN;
-SET WATCOM=%WC10_PATH%
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\WC16.MK
-SET USE_WIN16=1
-SET USE_WIN32=
-SET USE_WIN386=
-SET USE_OS216=
-SET USE_OS232=
-SET USE_OS2GUI=
-SET USE_SNAP=
-SET USE_QNX4=
-SET WC_LIBBASE=WC10
-SET EDPATH=%WC10_PATH%\EDDAT
-PATH %SCITECH_BIN%;%WC10_PATH%\BINNT;%WC10_PATH%\BINW;%DEFPATH%%WC_CD_PATH%
-
-echo Watcom C/C++ 10.6 16-bit Windows compilation environment set up.
-
diff --git a/board/MAI/bios_emulator/scitech/bin/wc10-w32.bat b/board/MAI/bios_emulator/scitech/bin/wc10-w32.bat
deleted file mode 100755 (executable)
index 839bdde..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-@echo off
-REM Setup for compiling with Watcom C/C++ 10.6 in 32 bit mode
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\WIN32\WC10;%WC10_PATH%\LIB386;%WC10_PATH%\LIB386\NT;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\WIN32\WC10;%WC10_PATH%\LIB386;%WC10_PATH%\LIB386\NT;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET EDPATH=%WC10_PATH%\EDDAT
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%WC10_PATH%\H;%WC10_PATH%\H\NT;
-SET WATCOM=%WC10_PATH%
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\WC32.MK
-SET USE_TNT=
-SET USE_X32=
-SET USE_X32VM=
-SET USE_WIN16=
-SET USE_WIN32=1
-SET USE_WIN386=
-SET WIN32_GUI=1
-SET USE_OS216=
-SET USE_OS232=
-SET USE_OS2GUI=
-SET USE_SNAP=
-SET USE_QNX4=
-SET WC_LIBBASE=WC10
-PATH %SCITECH_BIN%;%WC10_PATH%\BINNT;%WC10_PATH%\BINW;%DEFPATH%%WC_CD_PATH%
-
-echo Watcom C/C++ 10.6 Win32 GUI compilation environment set up
diff --git a/board/MAI/bios_emulator/scitech/bin/wc10-x11.bat b/board/MAI/bios_emulator/scitech/bin/wc10-x11.bat
deleted file mode 100755 (executable)
index fc783d8..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-@echo off
-REM Setup for compiling with Watcom C/C++ 10.6 in 32 bit mode
-
-SET LIB=%WC10_PATH%\LIB386;%WC10_PATH%\LIB386\NT;.
-SET EDPATH=%WC10_PATH%\EDDAT
-SET INCLUDE=%WC10_PATH%\H;%WC10_PATH%\H\NT;
-SET WATCOM=%WC10_PATH%
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\WC32.MK
-SET USE_TNT=
-SET USE_X32=
-SET USE_X32VM=
-SET USE_WIN16=
-SET USE_WIN32=1
-SET USE_WIN386=
-SET WIN32_GUI=1
-SET USE_OS216=
-SET USE_OS232=
-SET USE_OS2GUI=
-SET USE_SNAP=
-SET USE_QNX4=
-SET WC_LIBBASE=WC10
-PATH %SCITECH_BIN%;%WC10_PATH%\BINNT;%WC10_PATH%\BINW;%DEFPATH%%WC_CD_PATH%
-
-echo Watcom C/C++ 10.6 X11 compilation environment set up
diff --git a/board/MAI/bios_emulator/scitech/bin/wc10ac32.bat b/board/MAI/bios_emulator/scitech/bin/wc10ac32.bat
deleted file mode 100755 (executable)
index 6e0c24d..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-@echo off
-REM Setup for compiling with Watcom C/C++ 10.0a in 32 bit mode
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\WIN32\WC10A;%WC10A_PATH%\LIB386;%WC10A_PATH%\LIB386\NT;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\WIN32\WC10A;%WC10A_PATH%\LIB386;%WC10A_PATH%\LIB386\NT;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET EDPATH=%WC10A_PATH%\EDDAT
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%WC10A_PATH%\H;%WC10A_PATH%\H\NT;
-SET WATCOM=%WC10A_PATH%
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\WC32.MK
-SET USE_TNT=
-SET USE_X32=
-SET USE_X32VM=
-SET USE_WIN16=
-SET USE_WIN32=1
-SET USE_WIN386=
-SET WIN32_GUI=
-SET USE_OS216=
-SET USE_OS232=
-SET USE_OS2GUI=
-SET USE_SNAP=
-SET WC_LIBBASE=WC10A
-PATH %SCITECH_BIN%;%WC10A_PATH%\BINNT;%WC10A_PATH%\BINB;%DEFPATH%%WC_CD_PATH%
-
-echo Watcom C/C++ 10.0a Win32 console compilation environment set up
diff --git a/board/MAI/bios_emulator/scitech/bin/wc10ad16.bat b/board/MAI/bios_emulator/scitech/bin/wc10ad16.bat
deleted file mode 100755 (executable)
index f9ecb67..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-@echo off
-REM Setup for compiling with Watcom C/C++ 10.0a in 32 bit mode (DOS4GW)
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\DOS16\WC10A;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\DOS16\WC10A;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET EDPATH=%WC10A_PATH%\EDDAT
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%WC10A_PATH%\H;%WC10A_PATH%\H\WIN;
-SET WATCOM=%WC10A_PATH%
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\WC16.MK
-SET USE_WIN16=
-SET USE_WIN32=
-SET USE_OS216=
-SET USE_OS232=
-SET USE_OS2GUI=
-SET USE_SNAP=
-SET WC_LIBBASE=WC10A
-SET EDPATH=%WC10A_PATH%\EDDAT
-PATH %SCITECH_BIN%;%WC10A_PATH%\BINNT;%WC10A_PATH%\BINB;%DEFPATH%%WC_CD_PATH%
-
-echo Watcom C/C++ 10.0a 16-bit DOS compilation environment set up.
diff --git a/board/MAI/bios_emulator/scitech/bin/wc10ad32.bat b/board/MAI/bios_emulator/scitech/bin/wc10ad32.bat
deleted file mode 100755 (executable)
index d52b79a..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-@echo off
-REM Setup for compiling with Watcom C/C++ 10.0a in 32 bit mode (DOS4GW)
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\DOS32\WC10A;%WC10A_PATH%\LIB386;%WC10A_PATH%\LIB386\DOS;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\DOS32\WC10A;%WC10A_PATH%\LIB386;%WC10A_PATH%\LIB386\DOS;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET EDPATH=%WC10A_PATH%\EDDAT
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%WC10A_PATH%\H;
-SET WATCOM=%WC10A_PATH%
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\WC32.MK
-SET USE_TNT=
-SET USE_X32=
-SET USE_X32VM=
-SET USE_WIN16=
-SET USE_WIN32=
-SET USE_WIN386=
-SET USE_OS216=
-SET USE_OS232=
-SET USE_OS2GUI=
-SET USE_SNAP=
-SET WC_LIBBASE=WC10A
-PATH %SCITECH_BIN%;%WC10A_PATH%\BINNT;%WC10A_PATH%\BINB;%DEFPATH%%WC_CD_PATH%
-
-echo Watcom C/C++ 10.0a 32-bit DOS compilation environment set up (DOS4GW)
diff --git a/board/MAI/bios_emulator/scitech/bin/wc10ao16.bat b/board/MAI/bios_emulator/scitech/bin/wc10ao16.bat
deleted file mode 100755 (executable)
index ba7351d..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-@echo off
-REM Setup for compiling with Watcom C/C++ 10.0a in 16-bit OS/2 mode
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\lib\release\os216\wc10;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\lib\debug\os216\wc10;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET EDPATH=%WC10A_PATH%\eddat
-SET INCLUDE=include;%SCITECH%\include;%PRIVATE%\include;%WC10A_PATH%\h\os2;%WC10A_PATH%\h
-SET WATCOM=%WC10A_PATH%
-SET MAKESTARTUP=%SCITECH%\makedefs\wc16.mk
-SET USE_WIN16=
-SET USE_WIN32=
-SET USE_WIN386=
-SET USE_OS216=1
-SET USE_OS232=
-SET USE_OS2GUI=
-SET USE_SNAP=
-SET WC_LIBBASE=wc10
-SET EDPATH=%WC10A_PATH%\EDDAT
-PATH %SCITECH_BIN%;%WC10A_PATH%\BINNT;%WC10A_PATH%\BINB;%DEFPATH%%WC_CD_PATH%
-
-echo Watcom C/C++ 10.0a 16-bit OS/2 compilation environment set up.
diff --git a/board/MAI/bios_emulator/scitech/bin/wc10ao32.bat b/board/MAI/bios_emulator/scitech/bin/wc10ao32.bat
deleted file mode 100755 (executable)
index f3caa59..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-@echo off
-REM Setup for compiling with Watcom C/C++ 10.0a in 32-bit OS/2 mode
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\lib\release\os232\wc10;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\lib\debug\os232\wc10;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET EDPATH=%WC10AA_PATH%\eddat
-SET INCLUDE=include;%SCITECH%\include;%PRIVATE%\include;%WC10AA_PATH%\h\os2;%WC10AA_PATH%\h
-SET WATCOM=%WC10AA_PATH%
-SET MAKESTARTUP=%SCITECH%\makedefs\wc32.mk
-SET USE_WIN16=
-SET USE_WIN32=
-SET USE_WIN386=
-SET USE_OS216=
-SET USE_OS232=1
-SET USE_OS2GUI=
-SET USE_SNAP=
-SET WC_LIBBASE=WC10A
-SET EDPATH=%WC10AA_PATH%\EDDAT
-PATH %SCITECH_BIN%;%WC10AA_PATH%\BINNT;%WC10AA6_PATH%\BINB;%DEFPATH%%WC_CD_PATH%
-
-echo Watcom C/C++ 10.0a 32-bit OS/2 console compilation environment set up.
diff --git a/board/MAI/bios_emulator/scitech/bin/wc10ap32.bat b/board/MAI/bios_emulator/scitech/bin/wc10ap32.bat
deleted file mode 100755 (executable)
index 8d21c62..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-@echo off
-REM Setup for compiling with Watcom C/C++ 10.0a in 32-bit OS/2 mode
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\lib\release\os232\wc10;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\lib\debug\os232\wc10;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET EDPATH=%WC10_PATH%\eddat
-SET INCLUDE=include;%SCITECH%\include;%PRIVATE%\include;%WC10_PATH%\h\os2;%WC10_PATH%\h
-SET WATCOM=%WC10_PATH%
-SET MAKESTARTUP=%SCITECH%\makedefs\wc32.mk
-SET USE_WIN16=
-SET USE_WIN32=
-SET USE_WIN386=
-SET USE_OS216=
-SET USE_OS232=1
-SET USE_OS2GUI=1
-SET USE_SNAP=
-SET WC_LIBBASE=WC10A
-SET EDPATH=%WC10_PATH%\EDDAT
-PATH %SCITECH_BIN%;%WC10_PATH%\BINNT;%WC10_PATH%\BINB;%DEFPATH%%WC_CD_PATH%
-
-echo Watcom C/C++ 10.0a 32-bit OS/2 GUI compilation environment set up.
diff --git a/board/MAI/bios_emulator/scitech/bin/wc10asnp.bat b/board/MAI/bios_emulator/scitech/bin/wc10asnp.bat
deleted file mode 100755 (executable)
index 28f857c..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-@echo off
-REM Setup for compiling with Watcom C/C++ 10.0a in 32 bit mode
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\SNAP\WC10A;%WC10A_PATH%\LIB386;%WC10A_PATH%\LIB386\NT;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\SNAP\WC10A;%WC10A_PATH%\LIB386;%WC10A_PATH%\LIB386\NT;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET EDPATH=%WC10A_PATH%\EDDAT
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE
-SET WATCOM=%WC10A_PATH%
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\WC32.MK
-SET USE_TNT=
-SET USE_X32=
-SET USE_X32VM=
-SET USE_WIN16=
-SET USE_WIN32=1
-SET USE_WIN386=
-SET WIN32_GUI=
-SET USE_OS216=
-SET USE_OS232=
-SET USE_OS2GUI=
-SET USE_SNAP=1
-SET WC_LIBBASE=WC10A
-PATH %SCITECH_BIN%;%WC10A_PATH%\BINNT;%WC10A_PATH%\BINB;%DEFPATH%%WC_CD_PATH%
-
-echo Watcom C/C++ 10.0a Snap compilation environment set up
diff --git a/board/MAI/bios_emulator/scitech/bin/wc10atnt.bat b/board/MAI/bios_emulator/scitech/bin/wc10atnt.bat
deleted file mode 100755 (executable)
index a2b3219..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-@echo off
-REM Setup for compiling with Watcom C/C++ 10.0a in 32 bit mode with Phar Lap TNT
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\DOS32\WC10A;%WC10A_PATH%\LIB386;%WC10A_PATH%\LIB386\DOS;%TNT_PATH%\LIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\DOS32\WC10A;%WC10A_PATH%\LIB386;%WC10A_PATH%\LIB386\DOS;%TNT_PATH%\LIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET EDPATH=%WC10A_PATH%\EDDAT
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%WC10A_PATH%\H;%WC10A_PATH%\H\NT;%TNT_PATH%\INCLUDE
-SET WATCOM=%WC10A_PATH%
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\WC32.MK
-SET USE_TNT=1
-SET USE_X32=
-SET USE_X32VM=
-SET USE_WIN16=
-SET USE_WIN32=
-SET USE_WIN386=
-SET USE_OS216=
-SET USE_OS232=
-SET USE_OS2GUI=
-SET USE_SNAP=
-SET WC_LIBBASE=WC10A
-PATH %SCITECH_BIN%;%WC10A_PATH%\BINNT;%WC10A_PATH%\BINB;%DEFPATH%%WC_CD_PATH%
-
-REM If you set the following to a 1, a TNT DosStyle app will be created.
-REM Otherwise a TNT NtStyle app will be created. NtStyle apps will *only*
-REM run under real DOS when using our libraries, since we require access
-REM to functions that the Win32 API does not support (such as direct access
-REM to video memory, calling Int 10h BIOS functions etc). DosStyle apps
-REM will however run fine in both DOS and a Win95 DOS box (NT DOS boxes don't
-REM work too well).
-REM
-REM If you are using the RealTime DOS extender, your apps *must* be NtStyle,
-REM and hence will never be able to run under Win95 or WinNT, only DOS.
-
-SET DOSSTYLE=1
-
-echo Watcom C/C++ 10.0a 32-bit DOS compilation environment set up (TNT).
diff --git a/board/MAI/bios_emulator/scitech/bin/wc10aw16.bat b/board/MAI/bios_emulator/scitech/bin/wc10aw16.bat
deleted file mode 100755 (executable)
index 94011cc..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-@echo off
-REM Setup for compiling with Watcom C/C++ 10.0a in 16 bit Windows mode
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\WIN16\WC10A;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\WIN16\WC10A;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET EDPATH=%WC10A_PATH%\EDDAT
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%WC10A_PATH%\H;%WC10A_PATH%\H\WIN;
-SET WATCOM=%WC10A_PATH%
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\WC16.MK
-SET USE_WIN16=1
-SET USE_WIN32=
-SET USE_WIN386=
-SET USE_OS216=
-SET USE_OS232=
-SET USE_OS2GUI=
-SET USE_SNAP=
-SET WC_LIBBASE=WC10A
-SET EDPATH=%WC10A_PATH%\EDDAT
-PATH %SCITECH_BIN%;%WC10A_PATH%\BINNT;%WC10A_PATH%\BINB;%DEFPATH%%WC_CD_PATH%
-
-echo Watcom C/C++ 10.0a 16-bit Windows compilation environment set up.
-
diff --git a/board/MAI/bios_emulator/scitech/bin/wc10aw32.bat b/board/MAI/bios_emulator/scitech/bin/wc10aw32.bat
deleted file mode 100755 (executable)
index 1e14dbc..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-@echo off
-REM Setup for compiling with Watcom C/C++ 10.0a in 32 bit mode
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\WIN32\WC10A;%WC10A_PATH%\LIB386;%WC10A_PATH%\LIB386\NT;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\WIN32\WC10A;%WC10A_PATH%\LIB386;%WC10A_PATH%\LIB386\NT;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET EDPATH=%WC10A_PATH%\EDDAT
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%WC10A_PATH%\H;%WC10A_PATH%\H\NT;
-SET WATCOM=%WC10A_PATH%
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\WC32.MK
-SET USE_TNT=
-SET USE_X32=
-SET USE_X32VM=
-SET USE_WIN16=
-SET USE_WIN32=1
-SET USE_WIN386=
-SET WIN32_GUI=1
-SET USE_OS216=
-SET USE_OS232=
-SET USE_OS2GUI=
-SET USE_SNAP=
-SET WC_LIBBASE=WC10A
-PATH %SCITECH_BIN%;%WC10A_PATH%\BINNT;%WC10A_PATH%\BINB;%DEFPATH%%WC_CD_PATH%
-
-echo Watcom C/C++ 10.0a Win32 GUI compilation environment set up
diff --git a/board/MAI/bios_emulator/scitech/bin/wc11-c32.bat b/board/MAI/bios_emulator/scitech/bin/wc11-c32.bat
deleted file mode 100755 (executable)
index e753129..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-@echo off
-REM Setup for compiling with Watcom C/C++ 11.0 in 32 bit mode
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\WIN32\WC11;%WC11_PATH%\LIB386;%WC11_PATH%\LIB386\NT;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\WIN32\WC11;%WC11_PATH%\LIB386;%WC11_PATH%\LIB386\NT;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET EDPATH=%WC11_PATH%\EDDAT
-SET C_INCLUDE=%WC11_PATH%\H;%WC11_PATH%\H\NT
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%C_INCLUDE%
-SET WATCOM=%WC11_PATH%
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\WC32.MK
-SET USE_TNT=
-SET USE_X32=
-SET USE_X32VM=
-SET USE_WIN16=
-SET USE_WIN32=1
-SET USE_WIN386=
-SET WIN32_GUI=
-SET USE_OS216=
-SET USE_OS232=
-SET USE_OS2GUI=
-SET USE_SNAP=
-SET USE_QNX4=
-SET WC_LIBBASE=WC11
-PATH %SCITECH_BIN%;%WC11_PATH%\BINNT;%WC11_PATH%\BINW;%DEFPATH%%WC_CD_PATH%
-
-REM: Enable Win32 SDK if desired (sdk on command line)
-if NOT .%1%==.sdk goto done
-call win32sdk.bat
-
-:done
-echo Watcom C/C++ 11.0 Win32 console compilation environment set up.
diff --git a/board/MAI/bios_emulator/scitech/bin/wc11-d16.bat b/board/MAI/bios_emulator/scitech/bin/wc11-d16.bat
deleted file mode 100755 (executable)
index 4338ada..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-@echo off
-REM SETup for compiling with Watcom C/C++ 11.0 in 16 bit mode
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\DOS16\WC11;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\DOS16\WC11;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET EDPATH=%WC11_PATH%\EDDAT
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%WC11_PATH%\H;%WC11_PATH%\H\WIN;
-SET WATCOM=%WC11_PATH%
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\WC16.MK
-SET USE_WIN16=
-SET USE_WIN32=
-SET USE_OS216=
-SET USE_OS232=
-SET USE_OS2GUI=
-SET USE_SNAP=
-SET USE_QNX4=
-SET WC_LIBBASE=WC11
-SET EDPATH=%WC11_PATH%\EDDAT
-PATH %SCITECH_BIN%;%WC11_PATH%\BINNT;%WC11_PATH%\BINW;%DEFPATH%%WC_CD_PATH%
-
-echo Watcom C/C++ 11.0 16-bit DOS compilation environment set up.
diff --git a/board/MAI/bios_emulator/scitech/bin/wc11-d32.bat b/board/MAI/bios_emulator/scitech/bin/wc11-d32.bat
deleted file mode 100755 (executable)
index e5a54d4..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-@echo off
-REM Setup for compiling with Watcom C/C++ 11.0 in 32 bit mode (DOS4GW)
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\DOS32\WC11;%WC11_PATH%\LIB386;%WC11_PATH%\LIB386\DOS;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\DOS32\WC11;%WC11_PATH%\LIB386;%WC11_PATH%\LIB386\DOS;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET EDPATH=%WC11_PATH%\EDDAT
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%WC11_PATH%\H;
-SET WATCOM=%WC11_PATH%
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\WC32.MK
-SET USE_TNT=
-SET USE_X32=
-SET USE_X32VM=
-SET USE_WIN16=
-SET USE_WIN32=
-SET USE_WIN386=
-SET USE_OS216=
-SET USE_OS232=
-SET USE_OS2GUI=
-SET USE_SNAP=
-SET USE_QNX4=
-SET WC_LIBBASE=WC11
-PATH %SCITECH_BIN%;%WC11_PATH%\BINNT;%WC11_PATH%\BINW;%DJ_PATH%\BIN;%DEFPATH%%WC_CD_PATH%
-
-echo Watcom C/C++ 11.0 32-bit DOS compilation environment set up (DOS4GW).
diff --git a/board/MAI/bios_emulator/scitech/bin/wc11-o16.bat b/board/MAI/bios_emulator/scitech/bin/wc11-o16.bat
deleted file mode 100755 (executable)
index d46754a..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-@echo off
-REM Setup for compiling with Watcom C/C++ 11.0 in 16-bit OS/2 mode
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\lib\release\os216\wc11;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\lib\debug\os216\wc11;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET EDPATH=%WC11_PATH%\eddat
-SET INCLUDE=include;%SCITECH%\include;%PRIVATE%\include;%WC11_PATH%\h\os2;%WC11_PATH%\h
-SET WATCOM=%WC11_PATH%
-SET MAKESTARTUP=%SCITECH%\makedefs\wc16.mk
-SET USE_WIN16=
-SET USE_WIN32=
-SET USE_WIN386=
-SET USE_OS216=1
-SET USE_OS232=
-SET USE_OS2GUI=
-SET USE_SNAP=
-SET USE_QNX4=
-SET WC_LIBBASE=wc11
-SET EDPATH=%WC11_PATH%\EDDAT
-PATH %SCITECH_BIN%;%WC11_PATH%\BINNT;%WC11_PATH%\BINW;%DEFPATH%%WC_CD_PATH%
-
-echo Watcom C/C++ 11.0 16-bit OS/2 compilation environment set up.
diff --git a/board/MAI/bios_emulator/scitech/bin/wc11-o32.bat b/board/MAI/bios_emulator/scitech/bin/wc11-o32.bat
deleted file mode 100755 (executable)
index 37f5dc7..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-@echo off
-REM Setup for compiling with Watcom C/C++ 11.0 in 32-bit OS/2 mode
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\lib\release\os232\wc11;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\lib\debug\os232\wc11;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET EDPATH=%WC11_PATH%\eddat
-SET INCLUDE=include;%SCITECH%\include;%PRIVATE%\include;%WC11_PATH%\h\os2;%WC11_PATH%\h
-SET WATCOM=%WC11_PATH%
-SET MAKESTARTUP=%SCITECH%\makedefs\wc32.mk
-SET USE_WIN16=
-SET USE_WIN32=
-SET USE_WIN386=
-SET USE_OS216=
-SET USE_OS232=1
-SET USE_OS2GUI=
-SET USE_SNAP=
-SET USE_QNX4=
-SET WC_LIBBASE=wc11
-SET EDPATH=%WC11_PATH%\EDDAT
-PATH %SCITECH_BIN%;%WC11_PATH%\BINNT;%WC11_PATH%\BINW;%DEFPATH%%WC_CD_PATH%
-
-echo Watcom C/C++ 11.0 32-bit OS/2 console compilation environment set up.
diff --git a/board/MAI/bios_emulator/scitech/bin/wc11-p32.bat b/board/MAI/bios_emulator/scitech/bin/wc11-p32.bat
deleted file mode 100755 (executable)
index 348cbbd..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-@echo off
-REM Setup for compiling with Watcom C/C++ 11.0 in 32-bit OS/2 mode
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\lib\release\os232\wc11;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\lib\debug\os232\wc11;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET EDPATH=%WC11_PATH%\eddat
-SET INCLUDE=include;%SCITECH%\include;%PRIVATE%\include;%WC11_PATH%\h\os2;%WC11_PATH%\h
-SET WATCOM=%WC11_PATH%
-SET MAKESTARTUP=%SCITECH%\makedefs\wc32.mk
-SET USE_WIN16=
-SET USE_WIN32=
-SET USE_WIN386=
-SET USE_OS216=
-SET USE_OS232=1
-SET USE_OS2GUI=1
-SET USE_SNAP=
-SET USE_QNX4=
-SET WC_LIBBASE=wc11
-SET EDPATH=%WC11_PATH%\EDDAT
-PATH %SCITECH_BIN%;%WC11_PATH%\BINNT;%WC11_PATH%\BINW;%DEFPATH%%WC_CD_PATH%
-
-echo Watcom C/C++ 11.0 32-bit OS/2 GUI compilation environment set up.
diff --git a/board/MAI/bios_emulator/scitech/bin/wc11-qnx.bat b/board/MAI/bios_emulator/scitech/bin/wc11-qnx.bat
deleted file mode 100755 (executable)
index 1fd60fe..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-@echo off
-REM Setup for compiling with Watcom C/C++ 11.0 in 32 bit mode (QNX 4)
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\QNX4\WC11;%WC11_PATH%\LIB386;%WC11_PATH%\LIB386\QNX;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\QNX4\WC11;%WC11_PATH%\LIB386;%WC11_PATH%\LIB386\QNX;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET EDPATH=%WC11_PATH%\EDDAT
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%WC11_PATH%\QH;
-SET WATCOM=%WC11_PATH%
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\WC32.MK
-SET USE_TNT=
-SET USE_X32=
-SET USE_X32VM=
-SET USE_WIN16=
-SET USE_WIN32=
-SET USE_WIN386=
-SET USE_OS216=
-SET USE_OS232=
-SET USE_OS2GUI=
-SET USE_SNAP=
-SET USE_QNX4=1
-SET WC_LIBBASE=WC11
-PATH %SCITECH_BIN%;%WC11_PATH%\BINNT;%WC11_PATH%\BINW;%DJ_PATH%\BIN;%DEFPATH%%WC_CD_PATH%
-
-echo Watcom C/C++ 11.0 32-bit QNX compilation environment set up
-
diff --git a/board/MAI/bios_emulator/scitech/bin/wc11-snp.bat b/board/MAI/bios_emulator/scitech/bin/wc11-snp.bat
deleted file mode 100755 (executable)
index 6d2ac57..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-@echo off
-REM Setup for compiling with Watcom C/C++ 11.0 in 32 bit mode
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\SNAP\WC11;%WC11_PATH%\LIB386;%WC11_PATH%\LIB386\NT;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\SNAP\WC11;%WC11_PATH%\LIB386;%WC11_PATH%\LIB386\NT;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET EDPATH=%WC11_PATH%\EDDAT
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%WC11_PATH%\H
-SET WATCOM=%WC11_PATH%
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\WC32.MK
-SET USE_TNT=
-SET USE_X32=
-SET USE_X32VM=
-SET USE_WIN16=
-SET USE_WIN32=
-SET USE_WIN386=
-SET WIN32_GUI=
-SET USE_OS216=
-SET USE_OS232=
-SET USE_OS2GUI=
-SET USE_SNAP=1
-SET USE_QNX4=
-SET WC_LIBBASE=WC11
-PATH %SCITECH_BIN%;%WC11_PATH%\BINNT;%WC11_PATH%\BINW;%DEFPATH%%WC_CD_PATH%
-
-echo Watcom C/C++ 11.0 Snap compilation environment set up.
diff --git a/board/MAI/bios_emulator/scitech/bin/wc11-tnt.bat b/board/MAI/bios_emulator/scitech/bin/wc11-tnt.bat
deleted file mode 100755 (executable)
index 44dbf24..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-@echo off
-REM Setup for compiling with Watcom C/C++ 11.0 in 32 bit mode with Phar Lap TNT
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\DOS32\WC11;%WC11_PATH%\LIB386;%WC11_PATH%\LIB386\DOS;%TNT_PATH%\LIB;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\DOS32\WC11;%WC11_PATH%\LIB386;%WC11_PATH%\LIB386\DOS;%TNT_PATH%\LIB;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET EDPATH=%WC11_PATH%\EDDAT
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%WC11_PATH%\H;%WC11_PATH%\H\NT;%TNT_PATH%\INCLUDE
-SET WATCOM=%WC11_PATH%
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\WC32.MK
-SET USE_TNT=1
-SET USE_X32=
-SET USE_X32VM=
-SET USE_WIN16=
-SET USE_WIN32=
-SET USE_WIN386=
-SET USE_OS216=
-SET USE_OS232=
-SET USE_OS2GUI=
-SET USE_SNAP=
-SET USE_QNX4=
-SET WC_LIBBASE=WC11
-PATH %SCITECH_BIN%;%WC11_PATH%\BINNT;%WC11_PATH%\BINW;%DEFPATH%%WC_CD_PATH%
-
-REM If you set the following to a 1, a TNT DosStyle app will be created.
-REM Otherwise a TNT NtStyle app will be created. NtStyle apps will *only*
-REM run under real DOS when using our libraries, since we require access
-REM to functions that the Win32 API does not support (such as direct access
-REM to video memory, calling Int 10h BIOS functions etc). DosStyle apps
-REM will however run fine in both DOS and a Win95 DOS box (NT DOS boxes don't
-REM work too well).
-REM
-REM If you are using the RealTime DOS extender, your apps *must* be NtStyle,
-REM and hence will never be able to run under Win95 or WinNT, only DOS.
-
-SET DOSSTYLE=1
-
-echo Watcom C/C++ 11.0 32-bit DOS compilation environment set up (TNT).
diff --git a/board/MAI/bios_emulator/scitech/bin/wc11-w16.bat b/board/MAI/bios_emulator/scitech/bin/wc11-w16.bat
deleted file mode 100755 (executable)
index e65c70e..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-@echo off
-REM Setup for compiling with Watcom C/C++ 11.0 in 16 bit Windows mode
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\WIN16\WC11;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\WIN16\WC11;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET EDPATH=%WC11_PATH%\EDDAT
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%WC11_PATH%\H;%WC11_PATH%\H\WIN;
-SET WATCOM=%WC11_PATH%
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\WC16.MK
-SET USE_WIN16=1
-SET USE_WIN32=
-SET USE_WIN386=
-SET USE_OS216=
-SET USE_OS232=
-SET USE_OS2GUI=
-SET USE_SNAP=
-SET USE_QNX4=
-SET WC_LIBBASE=WC11
-SET EDPATH=%WC11_PATH%\EDDAT
-PATH %SCITECH_BIN%;%WC11_PATH%\BINNT;%WC11_PATH%\BINW;%DEFPATH%%WC_CD_PATH%
-
-echo Watcom C/C++ 11.0 16-bit Windows compilation environment set up.
diff --git a/board/MAI/bios_emulator/scitech/bin/wc11-w32.bat b/board/MAI/bios_emulator/scitech/bin/wc11-w32.bat
deleted file mode 100755 (executable)
index 764cdbd..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-@echo off
-REM Setup for compiling with Watcom C/C++ 11.0 in 32 bit mode
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\WIN32\WC11;%WC11_PATH%\LIB386;%WC11_PATH%\LIB386\NT;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\WIN32\WC11;%WC11_PATH%\LIB386;%WC11_PATH%\LIB386\NT;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET EDPATH=%WC11_PATH%\EDDAT
-SET C_INCLUDE=%WC11_PATH%\H;%WC11_PATH%\H\NT
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%C_INCLUDE%
-SET WATCOM=%WC11_PATH%
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\WC32.MK
-SET USE_TNT=
-SET USE_X32=
-SET USE_X32VM=
-SET USE_WIN16=
-SET USE_WIN32=1
-SET USE_WIN386=
-SET WIN32_GUI=1
-SET USE_OS216=
-SET USE_OS232=
-SET USE_OS2GUI=
-SET USE_SNAP=
-SET USE_QNX4=
-SET WC_LIBBASE=WC11
-PATH %SCITECH_BIN%;%WC11_PATH%\BINNT;%WC11_PATH%\BINW;%DEFPATH%%WC_CD_PATH%
-
-REM: Enable Win32 SDK if desired (sdk on command line)
-if NOT .%1%==.sdk goto done
-call win32sdk.bat
-
-:done
-echo Watcom C/C++ 11.0 Win32 GUI compilation environment set up.
diff --git a/board/MAI/bios_emulator/scitech/bin/wc11-x11.bat b/board/MAI/bios_emulator/scitech/bin/wc11-x11.bat
deleted file mode 100755 (executable)
index c2569a3..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-@echo off
-REM Setup for compiling with Watcom C/C++ 11.0 in 32 bit mode
-
-if .%CHECKED%==.1 goto checked_build
-SET LIB=%SCITECH_LIB%\LIB\RELEASE\WIN32\WC11;%WC11_PATH%\LIB386;%WC11_PATH%\LIB386\NT;.
-echo Release build enabled.
-goto setvars
-
-:checked_build
-SET LIB=%SCITECH_LIB%\LIB\DEBUG\WIN32\WC11;%WC11_PATH%\LIB386;%WC11_PATH%\LIB386\NT;.
-echo Checked debug build enabled.
-goto setvars
-
-:setvars
-SET EDPATH=%WC11_PATH%\EDDAT
-SET INCLUDE=INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%WC11_PATH%\H;%WC11_PATH%\H\NT;
-SET WATCOM=%WC11_PATH%
-SET MAKESTARTUP=%SCITECH%\MAKEDEFS\WC32.MK
-SET USE_TNT=
-SET USE_X32=
-SET USE_X32VM=
-SET USE_WIN16=
-SET USE_WIN32=1
-SET USE_WIN386=
-SET WIN32_GUI=1
-SET USE_OS216=
-SET USE_OS232=
-SET USE_OS2GUI=
-SET USE_SNAP=
-SET USE_QNX4=
-SET WC_LIBBASE=WC11
-PATH %SCITECH_BIN%;%WC11_PATH%\BINNT;%WC11_PATH%\BINW;%DEFPATH%%WC_CD_PATH%
-
-echo Watcom C/C++ 11.0 Win32 GUI compilation environment set up.
diff --git a/board/MAI/bios_emulator/scitech/bin/win32sdk.bat b/board/MAI/bios_emulator/scitech/bin/win32sdk.bat
deleted file mode 100755 (executable)
index 3c7f017..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-@echo off
-REM: Set up environment variables for Microsoft Platform SDK development
-REM: Note that we have hard coded this for Windows NT i386 development.
-
-SET MSTOOLS=%MSSDK%
-SET DXSDKROOT=%MSTOOLS%
-SET INETSDK=%MSTOOLS%
-SET BKOFFICE=%MSTOOLS%
-SET BASEMAKE=%BKOFFICE%\INCLUDE\BKOffice.Mak
-SET INCLUDE=.;INCLUDE;%SCITECH%\INCLUDE;%PRIVATE%\INCLUDE;%MSTOOLS%\INCLUDE;%C_INCLUDE%
-if .%1%==.borland goto borland
-SET LIB=%MSTOOLS%\LIB;%LIB%
-goto notborland
-:borland
-SET LIB=%MSTOOLS%\LIB\BORLAND;%LIB%
-:notborland
-SET PATH=%MSTOOLS%\Bin\;%MSTOOLS%\Bin\WinNT;%PATH%
-SET CPU=i386
-
-echo Microsoft Platform SDK support enbabled.
diff --git a/board/MAI/bios_emulator/scitech/include/biosemu.h b/board/MAI/bios_emulator/scitech/include/biosemu.h
deleted file mode 100644 (file)
index 82c33a7..0000000
+++ /dev/null
@@ -1,154 +0,0 @@
-/****************************************************************************
-*
-*                        BIOS emulator and interface
-*                      to Realmode X86 Emulator Library
-*
-*               Copyright (C) 1996-1999 SciTech Software, Inc.
-*
-*  ========================================================================
-*
-*  Permission to use, copy, modify, distribute, and sell this software and
-*  its documentation for any purpose is hereby granted without fee,
-*  provided that the above copyright notice appear in all copies and that
-*  both that copyright notice and this permission notice appear in
-*  supporting documentation, and that the name of the authors not be used
-*  in advertising or publicity pertaining to distribution of the software
-*  without specific, written prior permission.  The authors makes no
-*  representations about the suitability of this software for any purpose.
-*  It is provided "as is" without express or implied warranty.
-*
-*  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-*  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-*  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-*  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-*  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-*  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-*  PERFORMANCE OF THIS SOFTWARE.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Any
-* Developer:    Kendall Bennett
-*
-* Description:  Header file for the real mode x86 BIOS emulator, which is
-*               used to warmboot any number of VGA compatible PCI/AGP
-*               controllers under any OS, on any processor family that
-*               supports PCI. We also allow the user application to call
-*               real mode BIOS functions and Int 10h functions (including
-*               the VESA BIOS).
-*
-****************************************************************************/
-
-#ifndef __BIOSEMU_H
-#define __BIOSEMU_H
-
-#include "x86emu.h"
-#include "pmapi.h"
-#include "pcilib.h"
-
-/*---------------------- Macros and type definitions ----------------------*/
-
-#pragma pack(1)
-
-/****************************************************************************
-REMARKS:
-Data structure used to describe the details specific to a particular VGA
-controller. This information is used to allow the VGA controller to be
-swapped on the fly within the BIOS emulator.
-
-HEADER:
-biosemu.h
-
-MEMBERS:
-pciInfo         - PCI device information block for the controller
-BIOSImage       - Pointer to a read/write copy of the BIOS image
-BIOSImageLen    - Length of the BIOS image
-LowMem          - Copy of key low memory areas
-****************************************************************************/
-typedef struct {
-    PCIDeviceInfo   *pciInfo;
-    void            *BIOSImage;
-    ulong           BIOSImageLen;
-    uchar           LowMem[1536];
-    } BE_VGAInfo;
-
-/****************************************************************************
-REMARKS:
-Data structure used to describe the details for the BIOS emulator system
-environment as used by the X86 emulator library.
-
-HEADER:
-biosemu.h
-
-MEMBERS:
-vgaInfo         - VGA BIOS information structure
-biosmem_base    - Base of the BIOS image
-biosmem_limit   - Limit of the BIOS image
-busmem_base     - Base of the VGA bus memory
-****************************************************************************/
-typedef struct {
-    BE_VGAInfo      vgaInfo;
-    ulong           biosmem_base;
-    ulong           biosmem_limit;
-    ulong           busmem_base;
-    } BE_sysEnv;
-
-/****************************************************************************
-REMARKS:
-Structure defining all the BIOS Emulator API functions as exported from
-the Binary Portable DLL.
-{secret}
-****************************************************************************/
-typedef struct {
-    ulong   dwSize;
-    ibool   (PMAPIP BE_init)(u32 debugFlags,int memSize,BE_VGAInfo *info);
-    void    (PMAPIP BE_setVGA)(BE_VGAInfo *info);
-    void    (PMAPIP BE_getVGA)(BE_VGAInfo *info);
-    void *  (PMAPIP BE_mapRealPointer)(uint r_seg,uint r_off);
-    void *  (PMAPIP BE_getVESABuf)(uint *len,uint *rseg,uint *roff);
-    void    (PMAPIP BE_callRealMode)(uint seg,uint off,RMREGS *regs,RMSREGS *sregs);
-    int     (PMAPIP BE_int86)(int intno,RMREGS *in,RMREGS *out);
-    int     (PMAPIP BE_int86x)(int intno,RMREGS *in,RMREGS *out,RMSREGS *sregs);
-    void *  reserved1;
-    void    (PMAPIP BE_exit)(void);
-    } BE_exports;
-
-/****************************************************************************
-REMARKS:
-Function pointer type for the Binary Portable DLL initialisation entry point.
-{secret}
-****************************************************************************/
-typedef BE_exports * (PMAPIP BE_initLibrary_t)(PM_imports *PMImp);
-
-#pragma pack()
-
-/*---------------------------- Global variables ---------------------------*/
-
-#ifdef  __cplusplus
-extern "C" {                        /* Use "C" linkage when in C++ mode */
-#endif
-
-/* {secret} Global BIOS emulator system environment */
-extern BE_sysEnv _BE_env;
-
-/*-------------------------- Function Prototypes --------------------------*/
-
-/* BIOS emulator library entry points */
-
-ibool   PMAPI BE_init(u32 debugFlags,int memSize,BE_VGAInfo *info);
-void    PMAPI BE_setVGA(BE_VGAInfo *info);
-void    PMAPI BE_getVGA(BE_VGAInfo *info);
-void    PMAPI BE_setDebugFlags(u32 debugFlags);
-void *  PMAPI BE_mapRealPointer(uint r_seg,uint r_off);
-void *  PMAPI BE_getVESABuf(uint *len,uint *rseg,uint *roff);
-void    PMAPI BE_callRealMode(uint seg,uint off,RMREGS *regs,RMSREGS *sregs);
-int     PMAPI BE_int86(int intno,RMREGS *in,RMREGS *out);
-int     PMAPI BE_int86x(int intno,RMREGS *in,RMREGS *out,RMSREGS *sregs);
-void    PMAPI BE_exit(void);
-
-#ifdef  __cplusplus
-}                                   /* End of "C" linkage for C++       */
-#endif
-
-#endif /* __BIOSEMU_H */
diff --git a/board/MAI/bios_emulator/scitech/include/event.h b/board/MAI/bios_emulator/scitech/include/event.h
deleted file mode 100644 (file)
index beeac87..0000000
+++ /dev/null
@@ -1,696 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Any
-*
-* Description:  Header file for the SciTech cross platform event library
-*
-****************************************************************************/
-
-#ifndef __EVENT_H
-#define __EVENT_H
-
-#include "scitech.h"
-
-/*---------------------- Macros and type definitions ----------------------*/
-
-#pragma pack(1)
-
-/* 'C' calling conventions always */
-
-#define EVTAPI  _ASMAPI
-#define EVTAPIP _ASMAPIP
-
-/* Event message masks for keyDown events */
-
-#define EVT_ASCIIMASK   0x00FF      /* ASCII code of key pressed        */
-#define EVT_SCANMASK    0xFF00      /* Scan code of key pressed         */
-#define EVT_COUNTMASK   0x7FFF0000L /* Count for KEYREPEAT's            */
-
-/* Macros to extract values from the message fields */
-
-#define EVT_asciiCode(m)    ( (uchar) (m & EVT_ASCIIMASK) )
-#define EVT_scanCode(m)     ( (uchar) ( (m & EVT_SCANMASK) >> 8 ) )
-#define EVT_repeatCount(m)  ( (short) ( (m & EVT_COUNTMASK) >> 16 ) )
-
-/****************************************************************************
-REMARKS:
-Defines the set of ASCII codes reported by the event library functions
-in the message field. Use the EVT_asciiCode macro to extract the code
-from the event structure.
-
-HEADER:
-event.h
-****************************************************************************/
-typedef enum {
-    ASCII_ctrlA             = 0x01,
-    ASCII_ctrlB             = 0x02,
-    ASCII_ctrlC             = 0x03,
-    ASCII_ctrlD             = 0x04,
-    ASCII_ctrlE             = 0x05,
-    ASCII_ctrlF             = 0x06,
-    ASCII_ctrlG             = 0x07,
-    ASCII_backspace         = 0x08,
-    ASCII_ctrlH             = 0x08,
-    ASCII_tab               = 0x09,
-    ASCII_ctrlI             = 0x09,
-    ASCII_ctrlJ             = 0x0A,
-    ASCII_ctrlK             = 0x0B,
-    ASCII_ctrlL             = 0x0C,
-    ASCII_enter             = 0x0D,
-    ASCII_ctrlM             = 0x0D,
-    ASCII_ctrlN             = 0x0E,
-    ASCII_ctrlO             = 0x0F,
-    ASCII_ctrlP             = 0x10,
-    ASCII_ctrlQ             = 0x11,
-    ASCII_ctrlR             = 0x12,
-    ASCII_ctrlS             = 0x13,
-    ASCII_ctrlT             = 0x14,
-    ASCII_ctrlU             = 0x15,
-    ASCII_ctrlV             = 0x16,
-    ASCII_ctrlW             = 0x17,
-    ASCII_ctrlX             = 0x18,
-    ASCII_ctrlY             = 0x19,
-    ASCII_ctrlZ             = 0x1A,
-    ASCII_esc               = 0x1B,
-    ASCII_space             = 0x20,
-    ASCII_exclamation       = 0x21, /* ! */
-    ASCII_quote             = 0x22, /* " */
-    ASCII_pound             = 0x23, /* # */
-    ASCII_dollar            = 0x24, /* $ */
-    ASCII_percent           = 0x25, /* % */
-    ASCII_ampersand         = 0x26, /* & */
-    ASCII_apostrophe        = 0x27, /* ' */
-    ASCII_leftBrace         = 0x28, /* ( */
-    ASCII_rightBrace        = 0x29, /* ) */
-    ASCII_times             = 0x2A, /* * */
-    ASCII_plus              = 0x2B, /* + */
-    ASCII_comma             = 0x2C, /* , */
-    ASCII_minus             = 0x2D, /* - */
-    ASCII_period            = 0x2E, /* . */
-    ASCII_divide            = 0x2F, /* / */
-    ASCII_0                 = 0x30,
-    ASCII_1                 = 0x31,
-    ASCII_2                 = 0x32,
-    ASCII_3                 = 0x33,
-    ASCII_4                 = 0x34,
-    ASCII_5                 = 0x35,
-    ASCII_6                 = 0x36,
-    ASCII_7                 = 0x37,
-    ASCII_8                 = 0x38,
-    ASCII_9                 = 0x39,
-    ASCII_colon             = 0x3A, /* : */
-    ASCII_semicolon         = 0x3B, /* ; */
-    ASCII_lessThan          = 0x3C, /* < */
-    ASCII_equals            = 0x3D, /* = */
-    ASCII_greaterThan       = 0x3E, /* > */
-    ASCII_question          = 0x3F, /* ? */
-    ASCII_at                = 0x40, /* @ */
-    ASCII_A                 = 0x41,
-    ASCII_B                 = 0x42,
-    ASCII_C                 = 0x43,
-    ASCII_D                 = 0x44,
-    ASCII_E                 = 0x45,
-    ASCII_F                 = 0x46,
-    ASCII_G                 = 0x47,
-    ASCII_H                 = 0x48,
-    ASCII_I                 = 0x49,
-    ASCII_J                 = 0x4A,
-    ASCII_K                 = 0x4B,
-    ASCII_L                 = 0x4C,
-    ASCII_M                 = 0x4D,
-    ASCII_N                 = 0x4E,
-    ASCII_O                 = 0x4F,
-    ASCII_P                 = 0x50,
-    ASCII_Q                 = 0x51,
-    ASCII_R                 = 0x52,
-    ASCII_S                 = 0x53,
-    ASCII_T                 = 0x54,
-    ASCII_U                 = 0x55,
-    ASCII_V                 = 0x56,
-    ASCII_W                 = 0x57,
-    ASCII_X                 = 0x58,
-    ASCII_Y                 = 0x59,
-    ASCII_Z                 = 0x5A,
-    ASCII_leftSquareBrace   = 0x5B, /* [ */
-    ASCII_backSlash         = 0x5C, /* \ */
-    ASCII_rightSquareBrace  = 0x5D, /* ] */
-    ASCII_caret             = 0x5E, /* ^ */
-    ASCII_underscore        = 0x5F, /* _ */
-    ASCII_leftApostrophe    = 0x60, /* ` */
-    ASCII_a                 = 0x61,
-    ASCII_b                 = 0x62,
-    ASCII_c                 = 0x63,
-    ASCII_d                 = 0x64,
-    ASCII_e                 = 0x65,
-    ASCII_f                 = 0x66,
-    ASCII_g                 = 0x67,
-    ASCII_h                 = 0x68,
-    ASCII_i                 = 0x69,
-    ASCII_j                 = 0x6A,
-    ASCII_k                 = 0x6B,
-    ASCII_l                 = 0x6C,
-    ASCII_m                 = 0x6D,
-    ASCII_n                 = 0x6E,
-    ASCII_o                 = 0x6F,
-    ASCII_p                 = 0x70,
-    ASCII_q                 = 0x71,
-    ASCII_r                 = 0x72,
-    ASCII_s                 = 0x73,
-    ASCII_t                 = 0x74,
-    ASCII_u                 = 0x75,
-    ASCII_v                 = 0x76,
-    ASCII_w                 = 0x77,
-    ASCII_x                 = 0x78,
-    ASCII_y                 = 0x79,
-    ASCII_z                 = 0x7A,
-    ASCII_leftCurlyBrace    = 0x7B, /* { */
-    ASCII_verticalBar       = 0x7C, /* | */
-    ASCII_rightCurlyBrace   = 0x7D, /* } */
-    ASCII_tilde             = 0x7E  /* ~ */
-    } EVT_asciiCodesType;
-
-/****************************************************************************
-REMARKS:
-Defines the set of scan codes reported by the event library functions
-in the message field. Use the EVT_scanCode macro to extract the code
-from the event structure. Note that the scan codes reported will be the
-same across all keyboards (assuming the placement of keys on a 101 key US
-keyboard), but the translated ASCII values may be different depending on
-the country code pages in use.
-
-NOTE:   Scan codes in the event library are not really hardware scan codes,
-       but rather virtual scan codes as generated by a low level keyboard
-       interface driver. All virtual codes begin with scan code 0x60 and
-       range up from there.
-
-HEADER:
-event.h
-****************************************************************************/
-typedef enum {
-    KB_padEnter             = 0x60, /* Keypad keys */
-    KB_padMinus             = 0x4A,
-    KB_padPlus              = 0x4E,
-    KB_padTimes             = 0x37,
-    KB_padDivide            = 0x61,
-    KB_padLeft              = 0x62,
-    KB_padRight             = 0x63,
-    KB_padUp                = 0x64,
-    KB_padDown              = 0x65,
-    KB_padInsert            = 0x66,
-    KB_padDelete            = 0x67,
-    KB_padHome              = 0x68,
-    KB_padEnd               = 0x69,
-    KB_padPageUp            = 0x6A,
-    KB_padPageDown          = 0x6B,
-    KB_padCenter            = 0x4C,
-    KB_F1                   = 0x3B, /* Function keys */
-    KB_F2                   = 0x3C,
-    KB_F3                   = 0x3D,
-    KB_F4                   = 0x3E,
-    KB_F5                   = 0x3F,
-    KB_F6                   = 0x40,
-    KB_F7                   = 0x41,
-    KB_F8                   = 0x42,
-    KB_F9                   = 0x43,
-    KB_F10                  = 0x44,
-    KB_F11                  = 0x57,
-    KB_F12                  = 0x58,
-    KB_left                 = 0x4B, /* Cursor control keys */
-    KB_right                = 0x4D,
-    KB_up                   = 0x48,
-    KB_down                 = 0x50,
-    KB_insert               = 0x52,
-    KB_delete               = 0x53,
-    KB_home                 = 0x47,
-    KB_end                  = 0x4F,
-    KB_pageUp               = 0x49,
-    KB_pageDown             = 0x51,
-    KB_capsLock             = 0x3A,
-    KB_numLock              = 0x45,
-    KB_scrollLock           = 0x46,
-    KB_leftShift            = 0x2A,
-    KB_rightShift           = 0x36,
-    KB_leftCtrl             = 0x1D,
-    KB_rightCtrl            = 0x6C,
-    KB_leftAlt              = 0x38,
-    KB_rightAlt             = 0x6D,
-    KB_leftWindows          = 0x5B,
-    KB_rightWindows         = 0x5C,
-    KB_menu                 = 0x5D,
-    KB_sysReq               = 0x54,
-    KB_esc                  = 0x01, /* Normal keyboard keys */
-    KB_1                    = 0x02,
-    KB_2                    = 0x03,
-    KB_3                    = 0x04,
-    KB_4                    = 0x05,
-    KB_5                    = 0x06,
-    KB_6                    = 0x07,
-    KB_7                    = 0x08,
-    KB_8                    = 0x09,
-    KB_9                    = 0x0A,
-    KB_0                    = 0x0B,
-    KB_minus                = 0x0C,
-    KB_equals               = 0x0D,
-    KB_backSlash            = 0x2B,
-    KB_backspace            = 0x0E,
-    KB_tab                  = 0x0F,
-    KB_Q                    = 0x10,
-    KB_W                    = 0x11,
-    KB_E                    = 0x12,
-    KB_R                    = 0x13,
-    KB_T                    = 0x14,
-    KB_Y                    = 0x15,
-    KB_U                    = 0x16,
-    KB_I                    = 0x17,
-    KB_O                    = 0x18,
-    KB_P                    = 0x19,
-    KB_leftSquareBrace      = 0x1A,
-    KB_rightSquareBrace     = 0x1B,
-    KB_enter                = 0x1C,
-    KB_A                    = 0x1E,
-    KB_S                    = 0x1F,
-    KB_D                    = 0x20,
-    KB_F                    = 0x21,
-    KB_G                    = 0x22,
-    KB_H                    = 0x23,
-    KB_J                    = 0x24,
-    KB_K                    = 0x25,
-    KB_L                    = 0x26,
-    KB_semicolon            = 0x27,
-    KB_apostrophe           = 0x28,
-    KB_Z                    = 0x2C,
-    KB_X                    = 0x2D,
-    KB_C                    = 0x2E,
-    KB_V                    = 0x2F,
-    KB_B                    = 0x30,
-    KB_N                    = 0x31,
-    KB_M                    = 0x32,
-    KB_comma                = 0x33,
-    KB_period               = 0x34,
-    KB_divide               = 0x35,
-    KB_space                = 0x39,
-    KB_tilde                = 0x29
-    } EVT_scanCodesType;
-
-/****************************************************************************
-REMARKS:
-Defines the mask for the joystick axes that are present
-
-HEADER:
-event.h
-
-MEMBERS:
-EVT_JOY_AXIS_X1     - Joystick 1, X axis is present
-EVT_JOY_AXIS_Y1     - Joystick 1, Y axis is present
-EVT_JOY_AXIS_X2     - Joystick 2, X axis is present
-EVT_JOY_AXIS_Y2     - Joystick 2, Y axis is present
-EVT_JOY_AXIS_ALL    - Mask for all axes
-****************************************************************************/
-typedef enum {
-    EVT_JOY_AXIS_X1     = 0x00000001,
-    EVT_JOY_AXIS_Y1     = 0x00000002,
-    EVT_JOY_AXIS_X2     = 0x00000004,
-    EVT_JOY_AXIS_Y2     = 0x00000008,
-    EVT_JOY_AXIS_ALL    = 0x0000000F
-    } EVT_eventJoyAxisType;
-
-/****************************************************************************
-REMARKS:
-Defines the event message masks for joystick events
-
-HEADER:
-event.h
-
-MEMBERS:
-EVT_JOY1_BUTTONA    - Joystick 1, button A is down
-EVT_JOY1_BUTTONB    - Joystick 1, button B is down
-EVT_JOY2_BUTTONA    - Joystick 2, button A is down
-EVT_JOY2_BUTTONB    - Joystick 2, button B is down
-****************************************************************************/
-typedef enum {
-    EVT_JOY1_BUTTONA    = 0x00000001,
-    EVT_JOY1_BUTTONB    = 0x00000002,
-    EVT_JOY2_BUTTONA    = 0x00000004,
-    EVT_JOY2_BUTTONB    = 0x00000008
-    } EVT_eventJoyMaskType;
-
-/****************************************************************************
-REMARKS:
-Defines the event message masks for mouse events
-
-HEADER:
-event.h
-
-MEMBERS:
-EVT_LEFTBMASK   - Left button is held down
-EVT_RIGHTBMASK  - Right button is held down
-EVT_MIDDLEBMASK - Middle button is held down
-EVT_BOTHBMASK   - Both left and right held down together
-EVT_ALLBMASK    - All buttons pressed
-EVT_DBLCLICK    - Set if mouse down event was a double click
-****************************************************************************/
-typedef enum {
-    EVT_LEFTBMASK   = 0x00000001,
-    EVT_RIGHTBMASK  = 0x00000002,
-    EVT_MIDDLEBMASK = 0x00000004,
-    EVT_BOTHBMASK   = 0x00000007,
-    EVT_ALLBMASK    = 0x00000007,
-    EVT_DBLCLICK    = 0x00010000
-    } EVT_eventMouseMaskType;
-
-/****************************************************************************
-REMARKS:
-Defines the event modifier masks. These are the masks used to extract
-the modifier information from the modifiers field of the event_t structure.
-Note that the values in the modifiers field represent the values of these
-modifier keys at the time the event occurred, not the time you decided
-to process the event.
-
-HEADER:
-event.h
-
-MEMBERS:
-EVT_LEFTBUT     - Set if left mouse button was down
-EVT_RIGHTBUT    - Set if right mouse button was down
-EVT_MIDDLEBUT   - Set if the middle button was down
-EVT_RIGHTSHIFT  - Set if right shift was down
-EVT_LEFTSHIFT   - Set if left shift was down
-EVT_RIGHTCTRL   - Set if right ctrl key was down
-EVT_RIGHTALT    - Set if right alt key was down
-EVT_LEFTCTRL    - Set if left ctrl key was down
-EVT_LEFTALT     - Set if left alt key was down
-EVT_SHIFTKEY    - Mask for any shift key down
-EVT_CTRLSTATE   - Set if ctrl key was down
-EVT_ALTSTATE    - Set if alt key was down
-EVT_CAPSLOCK    - Caps lock is active
-EVT_NUMLOCK     - Num lock is active
-EVT_SCROLLLOCK  - Scroll lock is active
-****************************************************************************/
-typedef enum {
-    EVT_LEFTBUT     = 0x00000001,
-    EVT_RIGHTBUT    = 0x00000002,
-    EVT_MIDDLEBUT   = 0x00000004,
-    EVT_RIGHTSHIFT  = 0x00000008,
-    EVT_LEFTSHIFT   = 0x00000010,
-    EVT_RIGHTCTRL   = 0x00000020,
-    EVT_RIGHTALT    = 0x00000040,
-    EVT_LEFTCTRL    = 0x00000080,
-    EVT_LEFTALT     = 0x00000100,
-    EVT_SHIFTKEY    = 0x00000018,
-    EVT_CTRLSTATE   = 0x000000A0,
-    EVT_ALTSTATE    = 0x00000140,
-    EVT_SCROLLLOCK  = 0x00000200,
-    EVT_NUMLOCK     = 0x00000400,
-    EVT_CAPSLOCK    = 0x00000800
-    } EVT_eventModMaskType;
-
-/****************************************************************************
-REMARKS:
-Defines the event codes returned in the event_t structures what field. Note
-that these are defined as a set of mutually exlusive bit fields, so you
-can test for multiple event types using the combined event masks defined
-in the EVT_eventMaskType enumeration.
-
-HEADER:
-event.h
-
-MEMBERS:
-EVT_NULLEVT     - A null event
-EVT_KEYDOWN     - Key down event
-EVT_KEYREPEAT   - Key repeat event
-EVT_KEYUP       - Key up event
-EVT_MOUSEDOWN   - Mouse down event
-EVT_MOUSEAUTO   - Mouse down autorepeat event
-EVT_MOUSEUP     - Mouse up event
-EVT_MOUSEMOVE   - Mouse movement event
-EVT_JOYCLICK    - Joystick button state change event
-EVT_JOYMOVE     - Joystick movement event
-EVT_USEREVT     - First user event
-****************************************************************************/
-typedef enum {
-    EVT_NULLEVT     = 0x00000000,
-    EVT_KEYDOWN     = 0x00000001,
-    EVT_KEYREPEAT   = 0x00000002,
-    EVT_KEYUP       = 0x00000004,
-    EVT_MOUSEDOWN   = 0x00000008,
-    EVT_MOUSEAUTO   = 0x00000010,
-    EVT_MOUSEUP     = 0x00000020,
-    EVT_MOUSEMOVE   = 0x00000040,
-    EVT_JOYCLICK    = 0x00000080,
-    EVT_JOYMOVE     = 0x00000100,
-    EVT_USEREVT     = 0x00000200
-    } EVT_eventType;
-
-/****************************************************************************
-REMARKS:
-Defines the event code masks you can use to test for multiple types of
-events, since the event codes are mutually exlusive bit fields.
-
-HEADER:
-event.h
-
-MEMBERS:
-EVT_KEYEVT      - Mask for any key event
-EVT_MOUSEEVT    - Mask for any mouse event
-EVT_MOUSECLICK  - Mask for any mouse click event
-EVT_JOYEVT      - Mask for any joystick event
-EVT_EVERYEVT    - Mask for any event
-****************************************************************************/
-typedef enum {
-    EVT_KEYEVT      = (EVT_KEYDOWN | EVT_KEYREPEAT | EVT_KEYUP),
-    EVT_MOUSEEVT    = (EVT_MOUSEDOWN | EVT_MOUSEAUTO | EVT_MOUSEUP | EVT_MOUSEMOVE),
-    EVT_MOUSECLICK  = (EVT_MOUSEDOWN | EVT_MOUSEUP),
-    EVT_JOYEVT      = (EVT_JOYCLICK | EVT_JOYMOVE),
-    EVT_EVERYEVT    = 0x7FFFFFFF
-    } EVT_eventMaskType;
-
-/****************************************************************************
-REMARKS:
-Structure describing the information contained in an event extracted from
-the event queue.
-
-HEADER:
-event.h
-
-MEMBERS:
-which       - Window identifier for message for use by high level window manager
-             code (i.e. MegaVision GUI or Windows API).
-what        - Type of event that occurred. Will be one of the values defined by
-             the EVT_eventType enumeration.
-when        - Time that the event occurred in milliseconds since startup
-where_x     - X coordinate of the mouse cursor location at the time of the event
-             (in screen coordinates). For joystick events this represents
-             the position of the first joystick X axis.
-where_y     - Y coordinate of the mouse cursor location at the time of the event
-             (in screen coordinates). For joystick events this represents
-             the position of the first joystick Y axis.
-relative_x  - Relative movement of the mouse cursor in the X direction (in
-             units of mickeys, or 1/200th of an inch). For joystick events
-             this represents the position of the second joystick X axis.
-relative_y  - Relative movement of the mouse cursor in the Y direction (in
-             units of mickeys, or 1/200th of an inch). For joystick events
-             this represents the position of the second joystick Y axis.
-message     - Event specific message for the event. For use events this can be
-             any user specific information. For keyboard events this contains
-             the ASCII code in bits 0-7, the keyboard scan code in bits 8-15 and
-             the character repeat count in bits 16-30. You can use the
-             EVT_asciiCode, EVT_scanCode and EVT_repeatCount macros to extract
-             this information from the message field. For mouse events this
-             contains information about which button was pressed, and will be a
-             combination of the flags defined by the EVT_eventMouseMaskType
-             enumeration. For joystick events, this conatins information
-             about which buttons were pressed, and will be a combination of
-             the flags defined by the EVT_eventJoyMaskType enumeration.
-modifiers   - Contains additional information about the state of the keyboard
-             shift modifiers (Ctrl, Alt and Shift keys) when the event
-             occurred. For mouse events it will also contain the state of
-             the mouse buttons. Will be a combination of the values defined
-             by the EVT_eventModMaskType enumeration.
-next        - Internal use; do not use.
-prev        - Internal use; do not use.
-****************************************************************************/
-typedef struct {
-    ulong       which;
-    ulong       what;
-    ulong       when;
-    int         where_x;
-    int         where_y;
-    int         relative_x;
-    int         relative_y;
-    ulong       message;
-    ulong       modifiers;
-    int         next;
-    int         prev;
-    } event_t;
-
-/****************************************************************************
-REMARKS:
-Structure describing an entry in the code page table. A table of translation
-codes for scan codes to ASCII codes is provided in this table to be used
-by the keyboard event libraries. On some OS'es the keyboard translation is
-handled by the OS, but for DOS and embedded systems you must register a
-different code page translation table if you want to support keyboards
-other than the US English keyboard (the default).
-
-NOTE:   Entries in code page tables *must* be in ascending order for the
-       scan codes as we do a binary search on the tables for the ASCII
-       code equivalents.
-
-HEADER:
-event.h
-
-MEMBERS:
-scanCode    - Scan code to translate (really the virtual scan code).
-asciiCode   - ASCII code for this scan code.
-****************************************************************************/
-typedef struct {
-    uchar       scanCode;
-    uchar       asciiCode;
-    } codepage_entry_t;
-
-/****************************************************************************
-REMARKS:
-Structure describing a complete code page translation table. The table
-contains translation tables for normal keys, shifted keys and ctrl keys.
-The Ctrl key always has precedence over the shift table, and the shift
-table is used when the shift key is down or the CAPSLOCK key is down.
-
-HEADER:
-event.h
-
-MEMBERS:
-name            - Name of the code page table (ie: "US English")
-normal          - Code page for translating normal keys
-normalLen       - Length of normal translation table
-caps            - Code page for translating keys when CAPSLOCK is down
-capsLen         - Length of CAPSLOCK translation table
-shift           - Code page for shifted keys (ie: shift key is held down)
-shiftLen        - Length of shifted translation table
-shiftCaps       - Code page for shifted keys when CAPSLOCK is down
-shiftCapsLen    - Length of shifted CAPSLOCK translation table
-ctrl            - Code page for ctrl'ed keys (ie: ctrl key is held down)
-ctrlLen         - Length of ctrl'ed translation table
-numPad          - Code page for NUMLOCK'ed keypad keys
-numPadLen       - Length of NUMLOCK'ed translation table
-****************************************************************************/
-typedef struct {
-    char                name[20];
-    codepage_entry_t    *normal;
-    int                 normalLen;
-    codepage_entry_t    *caps;
-    int                 capsLen;
-    codepage_entry_t    *shift;
-    int                 shiftLen;
-    codepage_entry_t    *shiftCaps;
-    int                 shiftCapsLen;
-    codepage_entry_t    *ctrl;
-    int                 ctrlLen;
-    codepage_entry_t    *numPad;
-    int                 numPadLen;
-    } codepage_t;
-
-/* {secret} */
-typedef ibool (EVTAPIP _EVT_userEventFilter)(event_t *evt);
-/* {secret} */
-typedef void (EVTAPIP _EVT_mouseMoveHandler)(int x,int y);
-/* {secret} */
-typedef void (EVTAPIP _EVT_heartBeatCallback)(void *params);
-
-/* Macro to find the size of a static array */
-
-#define EVT_ARR_SIZE(a)         (sizeof(a)/sizeof((a)[0]))
-
-#pragma pack()
-
-/*--------------------------- Global variables ----------------------------*/
-
-#ifdef  __cplusplus
-extern "C" {            /* Use "C" linkage when in C++ mode */
-#endif
-
-/* Standard code page tables */
-
-extern codepage_t _CP_US_English;
-
-/*------------------------- Function Prototypes ---------------------------*/
-
-/* Public API functions for user applications */
-
-ibool   EVTAPI EVT_getNext(event_t *evt,ulong mask);
-ibool   EVTAPI EVT_peekNext(event_t *evt,ulong mask);
-ibool   EVTAPI EVT_post(ulong which,ulong what,ulong message,ulong modifiers);
-void    EVTAPI EVT_flush(ulong mask);
-void    EVTAPI EVT_halt(event_t *evt,ulong mask);
-ibool   EVTAPI EVT_isKeyDown(uchar scanCode);
-void    EVTAPI EVT_setMousePos(int x,int y);
-void    EVTAPI EVT_getMousePos(int *x,int *y);
-
-/* Function to enable/disable updating of keyboard LED status indicators */
-
-void    EVTAPI EVT_allowLEDS(ibool enable);
-
-/* Function to install a custom keyboard code page. Default is US English */
-
-codepage_t *EVTAPI EVT_getCodePage(void);
-void    EVTAPI EVT_setCodePage(codepage_t *page);
-
-/* Functions for fine grained joystick calibration */
-
-void    EVTAPI EVT_pollJoystick(void);
-int     EVTAPI EVT_joyIsPresent(void);
-void    EVTAPI EVT_joySetUpperLeft(void);
-void    EVTAPI EVT_joySetLowerRight(void);
-void    EVTAPI EVT_joySetCenter(void);
-
-/* Install user supplied event filter callback */
-
-void    EVTAPI EVT_setUserEventFilter(_EVT_userEventFilter filter);
-
-/* Install user supplied event heartbeat callback function */
-
-void    EVTAPI EVT_setHeartBeatCallback(_EVT_heartBeatCallback callback,void *params);
-void    EVTAPI EVT_getHeartBeatCallback(_EVT_heartBeatCallback *callback,void **params);
-
-/* Internal functions to initialise and kill the event manager. MGL
- * applications should never call these functions directly as the MGL
- * libraries do it for you.
- */
-
-/* {secret} */
-void    EVTAPI EVT_init(_EVT_mouseMoveHandler mouseMove);
-/* {secret} */
-void    EVTAPI EVT_setMouseRange(int xRes,int yRes);
-/* {secret} */
-void    EVTAPI EVT_suspend(void);
-/* {secret} */
-void    EVTAPI EVT_resume(void);
-/* {secret} */
-void    EVTAPI EVT_exit(void);
-
-#ifdef  __cplusplus
-}                       /* End of "C" linkage for C++   */
-#endif  /* __cplusplus */
-
-#endif  /* __EVENT_H */
diff --git a/board/MAI/bios_emulator/scitech/include/mtrr.h b/board/MAI/bios_emulator/scitech/include/mtrr.h
deleted file mode 100644 (file)
index b29812c..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Any
-*
-* Description:  Include file defining the external ring 0 helper functions
-*               needed by the MTRR module. These functions may be included
-*               directly for native ring 0 device drivers, or they may
-*               be calls down to a ring 0 helper device driver where
-*               appropriate (or the entire MTRR module may be located in
-*               the device driver if the device driver is 32-bit).
-*
-****************************************************************************/
-
-#ifndef __MTRR_H
-#define __MTRR_H
-
-#include "scitech.h"
-
-/*--------------------------- Function Prototypes -------------------------*/
-
-#ifdef  __cplusplus
-extern "C" {            /* Use "C" linkage when in C++ mode */
-#endif
-
-/* Internal functions (requires ring 0 access or helper functions!) */
-
-void    MTRR_init(void);
-int     MTRR_enableWriteCombine(ulong base,ulong size,uint type);
-
-/* External assembler helper functions */
-
-ibool   _ASMAPI _MTRR_isRing0(void);
-ulong   _ASMAPI _MTRR_disableInt(void);
-void    _ASMAPI _MTRR_restoreInt(ulong flags);
-ulong   _ASMAPI _MTRR_saveCR4(void);
-void    _ASMAPI _MTRR_restoreCR4(ulong cr4Val);
-uchar   _ASMAPI _MTRR_getCx86(uchar reg);
-void    _ASMAPI _MTRR_setCx86(uchar reg,uchar data);
-#ifdef  __16BIT__
-void    _ASMAPI _MTRR_readMSR(ulong reg, ulong far *eax, ulong far *edx);
-#else
-void    _ASMAPI _MTRR_readMSR(ulong reg, ulong *eax, ulong *edx);
-#endif
-void    _ASMAPI _MTRR_writeMSR(ulong reg, ulong eax, ulong edx);
-
-#ifdef  __cplusplus
-}                       /* End of "C" linkage for C++   */
-#endif
-
-#endif  /* __MTRR_H */
diff --git a/board/MAI/bios_emulator/scitech/include/pcilib.h b/board/MAI/bios_emulator/scitech/include/pcilib.h
deleted file mode 100644 (file)
index 238f8ef..0000000
+++ /dev/null
@@ -1,413 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Any
-*
-* Description:  Header file for interface routines to the PCI bus.
-*
-****************************************************************************/
-
-#ifndef __PCILIB_H
-#define __PCILIB_H
-
-#include "scitech.h"
-
-/*---------------------- Macros and type definitions ----------------------*/
-
-#pragma pack(1)
-
-/* Defines for PCIDeviceInfo.HeaderType */
-
-typedef enum {
-    PCI_deviceType                  = 0x00,
-    PCI_bridgeType                  = 0x01,
-    PCI_cardBusBridgeType           = 0x02,
-    PCI_multiFunctionType           = 0x80
-    } PCIHeaderTypeFlags;
-
-/* Defines for PCIDeviceInfo.Command */
-
-typedef enum {
-    PCI_enableIOSpace               = 0x0001,
-    PCI_enableMemorySpace           = 0x0002,
-    PCI_enableBusMaster             = 0x0004,
-    PCI_enableSpecialCylces         = 0x0008,
-    PCI_enableWriteAndInvalidate    = 0x0010,
-    PCI_enableVGACompatiblePalette  = 0x0020,
-    PCI_enableParity                = 0x0040,
-    PCI_enableWaitCycle             = 0x0080,
-    PCI_enableSerr                  = 0x0100,
-    PCI_enableFastBackToBack        = 0x0200
-    } PCICommandFlags;
-
-/* Defines for PCIDeviceInfo.Status */
-
-typedef enum {
-    PCI_statusCapabilitiesList      = 0x0010,
-    PCI_status66MhzCapable          = 0x0020,
-    PCI_statusUDFSupported          = 0x0040,
-    PCI_statusFastBackToBack        = 0x0080,
-    PCI_statusDataParityDetected    = 0x0100,
-    PCI_statusDevSel                = 0x0600,
-    PCI_statusSignaledTargetAbort   = 0x0800,
-    PCI_statusRecievedTargetAbort   = 0x1000,
-    PCI_statusRecievedMasterAbort   = 0x2000,
-    PCI_statusSignaledSystemError   = 0x4000,
-    PCI_statusDetectedParityError   = 0x8000
-    } PCIStatusFlags;
-
-/* PCI capability IDs */
-
-typedef enum {
-    PCI_capsPowerManagement         = 0x01,
-    PCI_capsAGP                     = 0x02,
-    PCI_capsMSI                     = 0x05
-    } PCICapsType;
-
-/* PCI AGP rate definitions */
-
-typedef enum {
-    PCI_AGPRate1X                   = 0x1,
-    PCI_AGPRate2X                   = 0x2,
-    PCI_AGPRate4X                   = 0x4
-    } PCIAGPRateType;
-
-/* NOTE: We define all bitfield's as uint's, specifically so that the IBM
- *       Visual Age C++ compiler does not complain. We need them to be
- *       32-bits wide, and this is the width of an unsigned integer, but
- *       we can't use a ulong to make this explicit or we get errors.
- */
-
-/* Structure defining a PCI slot identifier */
-
-typedef union {
-    struct {
-       uint    Zero:2;
-       uint    Register:6;
-       uint    Function:3;
-       uint    Device:5;
-       uint    Bus:8;
-       uint    Reserved:7;
-       uint    Enable:1;
-       } p;
-    ulong   i;
-    } PCIslot;
-
-/* Structure defining the regular (type 0) PCI configuration register
- * layout. We use this in a union below so we can describe all types of
- * PCI configuration spaces with a single structure.
- */
-
-typedef struct {
-    ulong   BaseAddress10;
-    ulong   BaseAddress14;
-    ulong   BaseAddress18;
-    ulong   BaseAddress1C;
-    ulong   BaseAddress20;
-    ulong   BaseAddress24;
-    ulong   CardbusCISPointer;
-    ushort  SubSystemVendorID;
-    ushort  SubSystemID;
-    ulong   ROMBaseAddress;
-    uchar   CapabilitiesPointer;
-    uchar   reserved1;
-    uchar   reserved2;
-    uchar   reserved3;
-    ulong   reserved4;
-    uchar   InterruptLine;
-    uchar   InterruptPin;
-    uchar   MinimumGrant;
-    uchar   MaximumLatency;
-
-    /* These are not in the actual config space, but we enumerate them */
-    ulong   BaseAddress10Len;
-    ulong   BaseAddress14Len;
-    ulong   BaseAddress18Len;
-    ulong   BaseAddress1CLen;
-    ulong   BaseAddress20Len;
-    ulong   BaseAddress24Len;
-    ulong   ROMBaseAddressLen;
-    } PCIType0Info;
-
-/* Structure defining PCI to PCI bridge (type 1) PCI configuration register
- * layout. We use this in a union below so we can describe all types of
- * PCI configuration spaces with a single structure.
- */
-
-typedef struct {
-    ulong   BaseAddress10;
-    ulong   BaseAddress14;
-    uchar   PrimaryBusNumber;
-    uchar   SecondayBusNumber;
-    uchar   SubordinateBusNumber;
-    uchar   SecondaryLatencyTimer;
-    uchar   IOBase;
-    uchar   IOLimit;
-    ushort  SecondaryStatus;
-    ushort  MemoryBase;
-    ushort  MemoryLimit;
-    ushort  PrefetchableMemoryBase;
-    ushort  PrefetchableMemoryLimit;
-    ulong   PrefetchableBaseHi;
-    ulong   PrefetchableLimitHi;
-    ushort  IOBaseHi;
-    ushort  IOLimitHi;
-    uchar   CapabilitiesPointer;
-    uchar   reserved1;
-    uchar   reserved2;
-    uchar   reserved3;
-    ulong   ROMBaseAddress;
-    uchar   InterruptLine;
-    uchar   InterruptPin;
-    ushort  BridgeControl;
-    } PCIType1Info;
-
-/* PCI to CardBus bridge (type 2) configuration information */
-typedef struct {
-    ulong   SocketRegistersBaseAddress;
-    uchar   CapabilitiesPointer;
-    uchar   reserved1;
-    ushort  SecondaryStatus;
-    uchar   PrimaryBus;
-    uchar   SecondaryBus;
-    uchar   SubordinateBus;
-    uchar   SecondaryLatency;
-    struct  {
-       ulong   Base;
-       ulong   Limit;
-       } Range[4];
-    uchar   InterruptLine;
-    uchar   InterruptPin;
-    ushort  BridgeControl;
-    } PCIType2Info;
-
-/* Structure defining the PCI configuration space information for a
- * single PCI device on the PCI bus. We enumerate all this information
- * for all PCI devices on the bus.
- */
-
-typedef struct {
-    ulong               dwSize;
-    PCIslot             slot;
-    ulong               mech1;
-    ushort              VendorID;
-    ushort              DeviceID;
-    ushort              Command;
-    ushort              Status;
-    uchar               RevID;
-    uchar               Interface;
-    uchar               SubClass;
-    uchar               BaseClass;
-    uchar               CacheLineSize;
-    uchar               LatencyTimer;
-    uchar               HeaderType;
-    uchar               BIST;
-    union {
-       PCIType0Info    type0;
-       PCIType1Info    type1;
-       PCIType2Info    type2;
-       } u;
-    } PCIDeviceInfo;
-
-/* PCI Capability header structure. All PCI capabilities have the
- * following header.
- *
- * capsID is used to identify the type of the structure as define above.
- *
- * next is the offset in PCI configuration space (0x40-0xFC) of the
- * next capability structure in the list, or 0x00 if there are no more
- * entries.
- */
-
-typedef struct {
-    uchar   capsID;
-    uchar   next;
-    } PCICapsHeader;
-
-/* Structure defining the PCI AGP status register contents */
-
-typedef struct {
-    uint    rate:3;
-    uint    rsvd1:1;
-    uint    fastWrite:1;
-    uint    fourGB:1;
-    uint    rsvd2:3;
-    uint    sideBandAddressing:1;
-    uint    rsvd3:14;
-    uint    requestQueueDepthMaximum:8;
-    } PCIAGPStatus;
-
-/* Structure defining the PCI AGP command register contents */
-
-typedef struct {
-    uint    rate:3;
-    uint    rsvd1:1;
-    uint    fastWriteEnable:1;
-    uint    fourGBEnable:1;
-    uint    rsvd2:2;
-    uint    AGPEnable:1;
-    uint    SBAEnable:1;
-    uint    rsvd3:14;
-    uint    requestQueueDepth:8;
-    } PCIAGPCommand;
-
-/* AGP Capability structure */
-
-typedef struct {
-    PCICapsHeader   h;
-    ushort          majMin;
-    PCIAGPStatus    AGPStatus;
-    PCIAGPCommand   AGPCommand;
-    } PCIAGPCapability;
-
-/* Structure for obtaining the PCI IRQ routing information */
-
-typedef struct {
-    uchar   bus;
-    uchar   device;
-    uchar   linkA;
-    ushort  mapA;
-    uchar   linkB;
-    ushort  mapB;
-    uchar   linkC;
-    ushort  mapC;
-    uchar   linkD;
-    ushort  mapD;
-    uchar   slot;
-    uchar   reserved;
-    } PCIRouteInfo;
-
-typedef struct {
-    ushort          BufferSize;
-    PCIRouteInfo    *DataBuffer;
-    } PCIRoutingOptionsBuffer;
-
-#define NUM_PCI_REG                 (sizeof(PCIDeviceInfo) / 4) - 10
-#define PCI_BRIDGE_CLASS            0x06
-#define PCI_HOST_BRIDGE_SUBCLASS    0x00
-#define PCI_EARLY_VGA_CLASS         0x00
-#define PCI_EARLY_VGA_SUBCLASS      0x01
-#define PCI_DISPLAY_CLASS           0x03
-#define PCI_DISPLAY_VGA_SUBCLASS    0x00
-#define PCI_DISPLAY_XGA_SUBCLASS    0x01
-#define PCI_DISPLAY_OTHER_SUBCLASS  0x80
-#define PCI_MM_CLASS                0x04
-#define PCI_AUDIO_SUBCLASS          0x01
-
-/* Macros to detect specific classes of devices */
-
-#define PCI_IS_3DLABS_NONVGA_CLASS(pci) \
-   (((pci)->BaseClass == PCI_DISPLAY_CLASS && (pci)->SubClass == PCI_DISPLAY_OTHER_SUBCLASS) \
- && ((pci)->VendorID == 0x3D3D || (pci)->VendorID == 0x104C))
-
-#define PCI_IS_DISPLAY_CLASS(pci) \
-   (((pci)->BaseClass == PCI_DISPLAY_CLASS && (pci)->SubClass == PCI_DISPLAY_VGA_SUBCLASS) \
- || ((pci)->BaseClass == PCI_DISPLAY_CLASS && (pci)->SubClass == PCI_DISPLAY_XGA_SUBCLASS) \
- || ((pci)->BaseClass == PCI_EARLY_VGA_CLASS && (pci)->SubClass == PCI_EARLY_VGA_SUBCLASS) \
- || PCI_IS_3DLABS_NONVGA_CLASS(pci))
-
-/* Function codes to pass to PCI_accessReg */
-
-#define PCI_READ_BYTE               0
-#define PCI_READ_WORD               1
-#define PCI_READ_DWORD              2
-#define PCI_WRITE_BYTE              3
-#define PCI_WRITE_WORD              4
-#define PCI_WRITE_DWORD             5
-
-/* Macros to read/write PCI registers. These assume a global PCI array
- * of device information.
- */
-
-#define PCI_readPCIRegB(index,device)   \
-    PCI_accessReg(index,0,0,&PCI[DeviceIndex[device]])
-
-#define PCI_readPCIRegW(index,device)   \
-    PCI_accessReg(index,0,1,&PCI[DeviceIndex[device]])
-
-#define PCI_readPCIRegL(index,device)   \
-    PCI_accessReg(index,0,2,&PCI[DeviceIndex[device]])
-
-#define PCI_writePCIRegB(index,value,device)    \
-    PCI_accessReg(index,value,3,&PCI[DeviceIndex[device]])
-
-#define PCI_writePCIRegW(index,value,device)    \
-    PCI_accessReg(index,value,4,&PCI[DeviceIndex[device]])
-
-#define PCI_writePCIRegL(index,value,device)    \
-    PCI_accessReg(index,value,5,&PCI[DeviceIndex[device]])
-
-#pragma pack()
-
-/*-------------------------- Function Prototypes --------------------------*/
-
-#ifdef  __cplusplus
-extern "C" {                        /* Use "C" linkage when in C++ mode */
-#endif
-
-/* Function to determine the number of PCI devices in the system */
-
-int     _ASMAPI PCI_getNumDevices(void);
-
-/* Function to enumerate all device on the PCI bus */
-
-int     _ASMAPI PCI_enumerate(PCIDeviceInfo info[]);
-
-/* Function to access PCI configuration registers */
-
-ulong   _ASMAPI PCI_accessReg(int index,ulong value,int func,PCIDeviceInfo *info);
-
-/* Function to get PCI IRQ routing options for a card */
-
-int     _ASMAPI PCI_getIRQRoutingOptions(int numDevices,PCIRouteInfo *buffer);
-
-/* Function to re-route the PCI IRQ setting for a device */
-
-ibool   _ASMAPI PCI_setHardwareIRQ(PCIDeviceInfo *info,uint intPin,uint IRQ);
-
-/* Function to generate a special cyle on the specified PCI bus */
-
-void    _ASMAPI PCI_generateSpecialCyle(uint bus,ulong specialCycleData);
-
-/* Function to determine the size of a PCI base address register */
-
-ulong   _ASMAPI PCI_findBARSize(int bar,PCIDeviceInfo *pci);
-
-/* Function to read a block of PCI configuration space registers */
-
-void    _ASMAPI PCI_readRegBlock(PCIDeviceInfo *info,int index,void *dst,int count);
-
-/* Function to write a block of PCI configuration space registers */
-
-void    _ASMAPI PCI_writeRegBlock(PCIDeviceInfo *info,int index,void *src,int count);
-
-/* Function to return the 32-bit PCI BIOS entry point */
-
-ulong   _ASMAPI PCIBIOS_getEntry(void);
-
-#ifdef  __cplusplus
-}                                   /* End of "C" linkage for C++       */
-#endif
-
-#endif  /* __PCILIB_H */
diff --git a/board/MAI/bios_emulator/scitech/include/pm_help.h b/board/MAI/bios_emulator/scitech/include/pm_help.h
deleted file mode 100644 (file)
index 536a2ba..0000000
+++ /dev/null
@@ -1,166 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Win32, OS/2
-*
-* Description:  Include file for the SciTech Portability Manager 32-bit
-*               helper VxD for Windows 9x for and the 16-bit ring 0
-*               helper device driver for OS/2.
-*
-*               This file documents all the public services used by the
-*               SciTech Portability Manager library and SciTech Nucleus
-*               loader library.
-*
-****************************************************************************/
-
-#ifndef __PMHELP_H
-#define __PMHELP_H
-
-/* Include version information */
-
-#include "sdd/sddver.h"
-#define PMHELP_Major            SDD_RELEASE_MAJOR
-#define PMHELP_Minor            SDD_RELEASE_MINOR
-#define PMHELP_VERSION          ((PMHELP_Major << 8) | PMHELP_Minor)
-
-#ifdef  __OS2__
-
-/****************************************************************************
-* Public OS/2 Support functions
-****************************************************************************/
-
-#include "scitech.h"
-#include "nucleus/graphics.h"
-
-/* Name of device driver */
-
-#define PMHELP_NAME                 (PSZ)"sddhelp$"
-
-/* Main IOCTL function to talk to device driver */
-
-#define PMHELP_IOCTL                0x0080
-
-/* Macro definition for defining IOCTL function control codes for the SDDHELP
- * device driver for OS/2. Similar to that used for the DOS/Win32 version.
- */
-
-#define PMHELP_CTL_CODE(name,value) \
-    PMHELP_##name = value
-
-typedef enum {
-    /* Version function used by all drivers */
-    PMHELP_CTL_CODE(GETVER                      ,0x0001),
-    PMHELP_CTL_CODE(MAPPHYS                     ,0x0002),
-    PMHELP_CTL_CODE(ALLOCLOCKED                 ,0x0003),
-    PMHELP_CTL_CODE(FREELOCKED                  ,0x0004),
-    PMHELP_CTL_CODE(GETGDT32                    ,0x0005),
-    PMHELP_CTL_CODE(MALLOCSHARED                ,0x0007),
-    PMHELP_CTL_CODE(FREESHARED                  ,0x0008),
-    PMHELP_CTL_CODE(MAPTOPROCESS                ,0x0009),
-    PMHELP_CTL_CODE(FREEPHYS                    ,0x000A),
-    PMHELP_CTL_CODE(FLUSHTLB                    ,0x000B),
-    PMHELP_CTL_CODE(SAVECR4                     ,0x000C),
-    PMHELP_CTL_CODE(RESTORECR4                  ,0x000D),
-    PMHELP_CTL_CODE(READMSR                     ,0x000E),
-    PMHELP_CTL_CODE(WRITEMSR                    ,0x000F),
-    PMHELP_CTL_CODE(GETPHYSICALADDR             ,0x0010),
-    PMHELP_CTL_CODE(GETPHYSICALADDRRANGE        ,0x0011),
-    PMHELP_CTL_CODE(LOCKPAGES                   ,0x0012),
-    PMHELP_CTL_CODE(UNLOCKPAGES                 ,0x0013),
-    PMHELP_CTL_CODE(GETSHAREDEXP                ,0x0042),
-    PMHELP_CTL_CODE(SETSHAREDEXP                ,0x0043),
-    PMHELP_CTL_CODE(GETSTACKSWITCHRTN           ,0x0044),
-    PMHELP_CTL_CODE(GETBUILDNO                  ,0x0050),
-    } PMHELP_ctlCodes;
-
-#else
-
-/****************************************************************************
-* Public DOS/Windows Support functions
-****************************************************************************/
-
-#ifdef  DEVICE_MAIN
-#include <vtoolsc.h>
-#define PMHELP_Init_Order   (VDD_INIT_ORDER-1)
-#define RETURN_LONGS(n)     *p->dioc_bytesret = (n) * sizeof(ulong)
-#endif  /* DEVICE_MAIN */
-#include "scitech.h"
-#include "nucleus/graphics.h"
-
-/* We connect to the SDDHELP.VXD module if it is staticly loaded (as part
- * of SciTech Display Doctor), otherwise we dynamically load the PMHELP.VXD
- * public helper VxD.
- */
-
-#define PMHELP_DeviceID         0x0000
-#define SDDHELP_DeviceID        0x3DF8
-#define VXDLDR_DeviceID         0x0027
-#define SDDHELP_MODULE          "SDDHELP"
-#define SDDHELP_NAME            "SDDHELP.VXD"
-#define PMHELP_MODULE           "PMHELP"
-#define PMHELP_NAME             "PMHELP.VXD"
-#define PMHELP_DDBNAME          "pmhelp  "
-#define SDDHELP_MODULE_PATH     "\\\\.\\" SDDHELP_MODULE
-#define PMHELP_MODULE_PATH      "\\\\.\\" PMHELP_MODULE
-#define PMHELP_VXD_PATH         "\\\\.\\" PMHELP_NAME
-
-/* Macro definition for defining IOCTL function control codes for the PMHELP
- * device drivers for Windows 9x and NT. This macro is basically derived from
- * the CTL_CODE macro in the Windows 2000 DDK, but we hard code it here to
- * avoid having to #include any of the Windows 2000 DDK header files. We also
- * define both a 16-bit and 32-bit version of the control code within the same
- * macro to simplify future additions.
- *
- * Essentially the Win32 macro would normally expand to the following:
- *
- *  CTL_CODE(FILE_DEVICE_VIDEO,0x800+value,METHOD_BUFFERED,FILE_ANY_ACCESS)
- */
-
-#define PMHELP_CTL_CODE(name,value)                                             \
-    PMHELP_##name = value,                                                      \
-    PMHELP_##name##32 = ((0x23 << 16) | (0 << 14) | ((0x800+value) << 2) | (0))
-
-typedef enum {
-    /* Include all the control codes. We keep them in a separate header
-     * file so we can include them in multiple places to make this
-     * more versatile.
-     */
-    #include "pm_wctl.h"
-    } PMHELP_ctlCodes;
-
-/* For real mode VxD calls, we put the function number into the high
- * order word of EAX, and a value of 0x4FFF in AX. This allows our
- * VxD handler which is set up to handle Int 10's to recognise a native
- * PMHELP API call from a real mode DOS program.
- */
-
-#ifdef  REALMODE
-#define API_NUM(num)    (((ulong)(num) << 16) | 0x4FFF)
-#else
-#define API_NUM(num)    (num)
-#endif
-
-#endif  /* !__OS2__ */
-
-#endif  /* __PMHELP_H */
diff --git a/board/MAI/bios_emulator/scitech/include/pm_wctl.h b/board/MAI/bios_emulator/scitech/include/pm_wctl.h
deleted file mode 100644 (file)
index 20aa15e..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Win32, OS/2
-*
-* Description:  Header file to define all the control codes for the DOS
-*               and Win32 device driver API's for calling from ring 3
-*               into the ring 0 device drivers.
-*
-****************************************************************************/
-
-/* Version function used by all drivers */
-PMHELP_CTL_CODE(GETVER                      ,0x0000),
-
-/* Functions used by obsolete 16-bit DOS TSR */
-PMHELP_CTL_CODE(RDREGB                      ,0x0003),
-PMHELP_CTL_CODE(WRREGB                      ,0x0004),
-PMHELP_CTL_CODE(RDREGW                      ,0x0005),
-PMHELP_CTL_CODE(WRREGW                      ,0x0006),
-PMHELP_CTL_CODE(RDREGL                      ,0x0008),
-PMHELP_CTL_CODE(WRREGL                      ,0x0009),
-
-/* Functions used by obsolete WinDirect */
-PMHELP_CTL_CODE(MAPPHYS                     ,0x000F),
-PMHELP_CTL_CODE(GETVESABUF                  ,0x0013),
-
-/* Functions used by PM library */
-PMHELP_CTL_CODE(DPMIINT86                   ,0x0014),
-PMHELP_CTL_CODE(INT86                       ,0x0015),
-PMHELP_CTL_CODE(INT86X                      ,0x0016),
-PMHELP_CTL_CODE(CALLREALMODE                ,0x0017),
-PMHELP_CTL_CODE(ALLOCLOCKED                 ,0x0018),
-PMHELP_CTL_CODE(FREELOCKED                  ,0x0019),
-PMHELP_CTL_CODE(ENABLELFBCOMB               ,0x001A),
-PMHELP_CTL_CODE(GETPHYSICALADDR             ,0x001B),
-PMHELP_CTL_CODE(MALLOCSHARED                ,0x001D),
-PMHELP_CTL_CODE(FREESHARED                  ,0x001F),
-PMHELP_CTL_CODE(LOCKDATAPAGES               ,0x0020),
-PMHELP_CTL_CODE(UNLOCKDATAPAGES             ,0x0021),
-PMHELP_CTL_CODE(LOCKCODEPAGES               ,0x0022),
-PMHELP_CTL_CODE(UNLOCKCODEPAGES             ,0x0023),
-PMHELP_CTL_CODE(GETCALLGATE                 ,0x0024),
-PMHELP_CTL_CODE(SETCNTPATH                  ,0x0025),
-PMHELP_CTL_CODE(GETPDB                      ,0x0026),
-PMHELP_CTL_CODE(FLUSHTLB                    ,0x0027),
-PMHELP_CTL_CODE(GETPHYSICALADDRRANGE        ,0x0028),
-PMHELP_CTL_CODE(ALLOCPAGE                   ,0x0029),
-PMHELP_CTL_CODE(FREEPAGE                    ,0x002A),
-PMHELP_CTL_CODE(ENABLERING3IOPL             ,0x002B),
-PMHELP_CTL_CODE(DISABLERING3IOPL            ,0x002C),
-PMHELP_CTL_CODE(GASETLOCALPATH              ,0x002D),
-PMHELP_CTL_CODE(GAGETEXPORTS                ,0x002E),
-PMHELP_CTL_CODE(GATHUNK                     ,0x002F),
-PMHELP_CTL_CODE(SETNUCLEUSPATH              ,0x0030),
diff --git a/board/MAI/bios_emulator/scitech/include/pmapi.h b/board/MAI/bios_emulator/scitech/include/pmapi.h
deleted file mode 100644 (file)
index 7ddace7..0000000
+++ /dev/null
@@ -1,1148 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Any
-*
-* Description:  Header file for the OS Portability Manager Library, which
-*               contains functions to implement OS specific services in a
-*               generic, cross platform API. Porting the OS Portability
-*               Manager library is the first step to porting any SciTech
-*               products to a new platform.
-*
-****************************************************************************/
-
-#ifndef __PMAPI_H
-#define __PMAPI_H
-
-#include "scitech.h"
-#include "pcilib.h"
-#include "ztimerc.h"
-#if !defined(__WIN32_VXD__) && !defined(__OS2_VDD__) && !defined(__NT_DRIVER__)
-#include <stdio.h>
-#include <stdlib.h>
-#endif
-
-/*--------------------------- Macros and Typedefs -------------------------*/
-
-/* You will need to define one of the following before you compile this
- * library for it to work correctly with the DOS extender that you are
- * using when compiling for extended DOS:
- *
- *      TNT         - Phar Lap TNT DOS Extender
- *      DOS4GW      - Rational DOS/4GW, DOS/4GW Pro, Causeway and PMODE/W
- *      DJGPP       - DJGPP port of GNU C++
- *
- * If none is specified, we will automatically determine which operating
- * system is being targetted and the following will be defined (provided by
- * scitech.h header file):
- *
- *      __MSDOS16__     - Default for 16 bit MSDOS mode
- *      __MSDOS32__     - Default for 32 bit MSDOS
- *      __WINDOWS16__   - Default for 16 bit Windows
- *      __WINDOWS32__   - Default for 32 bit Windows
- *
- * One of the following will be defined automatically for you to select
- * which memory model is in effect:
- *
- *      REALMODE    - 16 bit real mode (large memory model)
- *      PM286       - 16 protected mode (large memory model)
- *      PM386       - 32 protected mode (flat memory model)
- */
-
-#if defined(__UNIX__) && !defined(_MAX_PATH)
-#define _MAX_PATH 256
-#endif
-
-#if defined(TNT) || defined(DOSX) || defined(X32VM) || defined(DPMI32)      \
-    || defined(DOS4GW) || defined(DJGPP) || defined(__WINDOWS32__)          \
-    || defined(__MSDOS32__) || defined(__UNIX__) || defined(__WIN32_VXD__) \
-    || defined(__32BIT__) || defined(__SMX32__) || defined(__RTTARGET__)
-#define PM386
-#elif defined(DPMI16) || defined(__WINDOWS16__)
-#define PM286
-#else
-#define REALMODE
-#endif
-
-#pragma pack(1)
-
-/* Provide the typedefs for the PM_int386 functions, which issue native
- * interrupts in real or protected mode and can pass extended registers
- * around.
- */
-
-struct _PMDWORDREGS {
-    ulong   eax,ebx,ecx,edx,esi,edi,cflag;
-    };
-
-struct _PMWORDREGS {
-    ushort  ax,ax_hi;
-    ushort  bx,bx_hi;
-    ushort  cx,cx_hi;
-    ushort  dx,dx_hi;
-    ushort  si,si_hi;
-    ushort  di,di_hi;
-    ushort  cflag,cflag_hi;
-    };
-
-struct _PMBYTEREGS {
-    uchar   al, ah; ushort ax_hi;
-    uchar   bl, bh; ushort bx_hi;
-    uchar   cl, ch; ushort cx_hi;
-    uchar   dl, dh; ushort dx_hi;
-    };
-
-typedef union {
-    struct  _PMDWORDREGS e;
-    struct  _PMWORDREGS  x;
-    struct  _PMBYTEREGS  h;
-    } PMREGS;
-
-typedef struct {
-    ushort  es;
-    ushort  cs;
-    ushort  ss;
-    ushort  ds;
-    ushort  fs;
-    ushort  gs;
-    } PMSREGS;
-
-/* Provide definitions for the real mode register structures passed to
- * the PM_int86() and PM_int86x() routines. Note that we provide our own
- * functions to do this for 16-bit code that calls the PM_int386 functions.
- */
-
-typedef PMREGS  RMREGS;
-typedef PMSREGS RMSREGS;
-
-typedef struct {
-    long    edi;
-    long    esi;
-    long    ebp;
-    long    reserved;
-    long    ebx;
-    long    edx;
-    long    ecx;
-    long    eax;
-    short   flags;
-    short   es,ds,fs,gs,ip,cs,sp,ss;
-    } DPMI_regs;
-
-#ifdef  __MSDOS__
-/* Register structure passed to PM_VxDCall function */
-typedef struct {
-    ulong   eax;
-    ulong   ebx;
-    ulong   ecx;
-    ulong   edx;
-    ulong   esi;
-    ulong   edi;
-    ushort  ds,es;
-    } VXD_regs;
-#endif
-
-#define PM_MAX_DRIVE                3
-#define PM_MAX_PATH                 256
-#define PM_FILE_INVALID             (void*)0xFFFFFFFF
-
-/* Structure for generic directory traversal and management. Also the same
- * values are passed to PM_setFileAttr to change the file attributes.
- */
-
-typedef struct {
-    ulong   dwSize;
-    ulong   attrib;
-    ulong   sizeLo;
-    ulong   sizeHi;
-    char    name[PM_MAX_PATH];
-    } PM_findData;
-
-/* Macro to compute the byte offset of a field in a structure of type type */
-
-#define PM_FIELD_OFFSET(type,field) ((long)&(((type*)0)->field))
-
-/* Marcto to compute the address of the base of the structure given its type,
- * and an address of a field within the structure.
- */
-
-#define PM_CONTAINING_RECORD(address, type, field)      \
-    ((type*)(                                           \
-    (char*)(address) -                                  \
-    (char*)(&((type*)0)->field)))
-
-/* Flags stored in the PM_findData structure, and also values passed to
- * PM_setFileAttr to change the file attributes.
- */
-
-#define PM_FILE_NORMAL              0x00000000
-#define PM_FILE_READONLY            0x00000001
-#define PM_FILE_DIRECTORY           0x00000002
-#define PM_FILE_ARCHIVE             0x00000004
-#define PM_FILE_HIDDEN              0x00000008
-#define PM_FILE_SYSTEM              0x00000010
-
-/* Flags returned by the PM_splitpath function */
-
-#define PM_HAS_WILDCARDS 0x01
-#define PM_HAS_EXTENSION 0x02
-#define PM_HAS_FILENAME  0x04
-#define PM_HAS_DIRECTORY 0x08
-#define PM_HAS_DRIVE     0x10
-
-/* Structure passed to the PM_setFileTime functions */
-typedef struct {
-    short   sec;        /* Seconds */
-    short   min;        /* Minutes */
-    short   hour;       /* Hour (0--23) */
-    short   day;        /* Day of month (1--31) */
-    short   mon;        /* Month (0--11) */
-    short   year;       /* Year (calendar year minus 1900) */
-    } PM_time;
-
-/* Define a macro for creating physical base addresses from segment:offset */
-
-#define MK_PHYS(s,o)  (((ulong)(s) << 4) + (ulong)(o))
-
-/* Define the different types of modes supported. This is a global variable
- * that can be used to determine the type at runtime which will contain
- * one of these values.
- */
-
-typedef enum {
-    PM_realMode,
-    PM_286,
-    PM_386
-    } PM_mode_enum;
-
-/* Define types passed to PM_enableWriteCombine */
-
-#define PM_MTRR_UNCACHABLE  0
-#define PM_MTRR_WRCOMB      1
-#define PM_MTRR_WRTHROUGH   4
-#define PM_MTRR_WRPROT      5
-#define PM_MTRR_WRBACK      6
-#define PM_MTRR_MAX         6
-
-/* Error codes returned by PM_enableWriteCombine */
-
-#define PM_MTRR_ERR_OK                  0
-#define PM_MTRR_NOT_SUPPORTED           -1
-#define PM_MTRR_ERR_PARAMS              -2
-#define PM_MTRR_ERR_NOT_4KB_ALIGNED     -3
-#define PM_MTRR_ERR_BELOW_1MB           -4
-#define PM_MTRR_ERR_NOT_ALIGNED         -5
-#define PM_MTRR_ERR_OVERLAP             -6
-#define PM_MTRR_ERR_TYPE_MISMATCH       -7
-#define PM_MTRR_ERR_NONE_FREE           -8
-#define PM_MTRR_ERR_NOWRCOMB            -9
-#define PM_MTRR_ERR_NO_OS_SUPPORT       -10
-
-/* Values passed to the PM_DMACProgram function */
-
-#define PM_DMA_READ_ONESHOT     0x44    /* One-shot DMA read        */
-#define PM_DMA_WRITE_ONESHOT    0x48    /* One-shot DMA write       */
-#define PM_DMA_READ_AUTOINIT    0x54    /* Auto-init DMA read       */
-#define PM_DMA_WRITE_AUTOINIT   0x58    /* Auto-init DMA write      */
-
-/* Flags passed to suspend application callback */
-
-#define PM_DEACTIVATE       1
-#define PM_REACTIVATE       2
-
-/* Return codes that the application can return from the suspend application
- * callback registered with the PM library. See the MGL documentation for
- * more details.
- */
-#define PM_SUSPEND_APP      0
-#define PM_NO_SUSPEND_APP   1
-
-/****************************************************************************
-REMARKS:
-This enumeration defines the type values passed to the PM_agpReservePhysical
-function, to define how the physical memory mapping should be handled.
-
-The PM_agpUncached type indicates that the memory should be allocated as
-uncached memory.
-
-The PM_agpWriteCombine type indicates that write combining should be enabled
-for physical memory mapping. This is used for framebuffer write combing and
-speeds up direct framebuffer writes to the memory.
-
-The PM_agpIntelDCACHE type indicates that memory should come from the Intel
-i81x Display Cache (or DCACHE) memory pool. This flag is specific to the
-Intel i810 and i815 controllers, and should not be passed for any other
-controller type.
-
-HEADER:
-pmapi.h
-
-MEMBERS:
-PM_agpUncached      - Indicates that the memory should be uncached
-PM_agpWriteCombine  - Indicates that the memory should be write combined
-PM_agpIntelDCACHE   - Indicates that the memory should come from DCACHE pool
-****************************************************************************/
-typedef enum {
-    PM_agpUncached,
-    PM_agpWriteCombine,
-    PM_agpIntelDCACHE
-    } PM_agpMemoryType;
-
-/* Defines the size of an system memory page */
-
-#define PM_PAGE_SIZE        4096
-
-/* Type definition for a physical memory address */
-
-typedef unsigned long PM_physAddr;
-
-/* Define a bad physical address returned by map physical functions */
-
-#define PM_BAD_PHYS_ADDRESS 0xFFFFFFFF
-
-/* Type definition for the 12-byte lock handle for locking linear memory */
-
-typedef struct {
-    ulong   h[3];
-    } PM_lockHandle;
-
-/* 'C' calling conventions always       */
-
-#define PMAPI   _ASMAPI
-#define PMAPIP  _ASMAPIP
-
-/* Internal typedef to override DPMI_int86 handler */
-
-typedef ibool (PMAPIP DPMI_handler_t)(DPMI_regs *regs);
-void PMAPI DPMI_setInt10Handler(DPMI_handler_t handler);
-
-/* Type definitions for a window handle for console modes */
-
-#if     defined(__DRIVER__) || defined(__WIN32_VXD__) || defined(__NT_DRIVER__)
-typedef void        *PM_HWND;   /* Pointer for portable drivers         */
-typedef void        *PM_MODULE; /* Module handle for portable drivers   */
-#elif   defined(__WINDOWS__)
-#ifdef  DECLARE_HANDLE
-typedef HWND        PM_HWND;    /* Real window handle                   */
-typedef HINSTANCE   PM_MODULE;  /* Win32 DLL handle                     */
-#else
-typedef void        *PM_HWND;   /* Place holder if windows.h not included */
-typedef void        *PM_MODULE; /* Place holder if windows.h not included */
-#endif
-#elif   defined(__USE_X11__)
-typedef struct {
-    Window      *window;
-    Display     *display;
-    } PM_HWND;                  /* X11 window handle */
-#elif   defined(__OS2__)
-typedef void    *PM_HWND;
-typedef void    *PM_MODULE;
-#elif   defined(__LINUX__)
-typedef int     PM_HWND;        /* Console id for fullscreen Linux */
-typedef void    *PM_MODULE;
-#elif   defined(__QNX__)
-typedef int     PM_HWND;        /* Console id for fullscreen QNX */
-typedef void    *PM_MODULE;
-#elif   defined(__RTTARGET__)
-typedef int     PM_HWND;        /* Placeholder for RTTarget-32 */
-typedef void    *PM_MODULE;
-#elif   defined(__REALDOS__)
-typedef int     PM_HWND;        /* Placeholder for fullscreen DOS */
-typedef void    *PM_MODULE;     /* Placeholder for fullscreen DOS */
-#elif   defined(__SMX32__)
-typedef int     PM_HWND;        /* Placeholder for fullscreen SMX */
-typedef void    *PM_MODULE;
-#elif   defined(__SNAP__)
-typedef void    *PM_HWND;
-typedef void    *PM_MODULE;
-#else
-#error  PM library not ported to this platform yet!
-#endif
-
-/* Type definition for code pointers */
-
-typedef void (*__codePtr)();
-
-/* Type definition for a C based interrupt handler */
-
-typedef void (PMAPIP PM_intHandler)(void);
-typedef ibool (PMAPIP PM_irqHandler)(void);
-
-/* Hardware IRQ handle used to save and restore the hardware IRQ */
-
-typedef void *PM_IRQHandle;
-
-/* Type definition for the fatal cleanup handler */
-
-typedef void (PMAPIP PM_fatalCleanupHandler)(void);
-
-/* Type defifinition for save state callback function */
-
-typedef int (PMAPIP PM_saveState_cb)(int flags);
-
-/* Type definintion for enum write combined callback function */
-
-typedef void (PMAPIP PM_enumWriteCombine_t)(ulong base,ulong length,uint type);
-
-/* Structure defining all the PM API functions as exported to
- * the binary portable DLL's.
- */
-
-typedef struct {
-    ulong   dwSize;
-    int     (PMAPIP PM_getModeType)(void);
-    void *  (PMAPIP PM_getBIOSPointer)(void);
-    void *  (PMAPIP PM_getA0000Pointer)(void);
-    void *  (PMAPIP PM_mapPhysicalAddr)(ulong base,ulong limit,ibool isCached);
-    void *  (PMAPIP PM_mallocShared)(long size);
-    void *  reserved1;
-    void    (PMAPIP PM_freeShared)(void *ptr);
-    void *  (PMAPIP PM_mapToProcess)(void *linear,ulong limit);
-    void *  (PMAPIP PM_mapRealPointer)(uint r_seg,uint r_off);
-    void *  (PMAPIP PM_allocRealSeg)(uint size,uint *r_seg,uint *r_off);
-    void    (PMAPIP PM_freeRealSeg)(void *mem);
-    void *  (PMAPIP PM_allocLockedMem)(uint size,ulong *physAddr,ibool contiguous,ibool below16Meg);
-    void    (PMAPIP PM_freeLockedMem)(void *p,uint size,ibool contiguous);
-    void    (PMAPIP PM_callRealMode)(uint seg,uint off, RMREGS *regs,RMSREGS *sregs);
-    int     (PMAPIP PM_int86)(int intno, RMREGS *in, RMREGS *out);
-    int     (PMAPIP PM_int86x)(int intno, RMREGS *in, RMREGS *out,RMSREGS *sregs);
-    void    (PMAPIP DPMI_int86)(int intno, DPMI_regs *regs);
-    void    (PMAPIP PM_availableMemory)(ulong *physical,ulong *total);
-    void *  (PMAPIP PM_getVESABuf)(uint *len,uint *rseg,uint *roff);
-    long    (PMAPIP PM_getOSType)(void);
-    void    (PMAPIP PM_fatalError)(const char *msg);
-    void    (PMAPIP PM_setBankA)(int bank);
-    void    (PMAPIP PM_setBankAB)(int bank);
-    void    (PMAPIP PM_setCRTStart)(int x,int y,int waitVRT);
-    char *  (PMAPIP PM_getCurrentPath)(char *path,int maxLen);
-    const char * (PMAPIP PM_getVBEAFPath)(void);
-    const char * (PMAPIP PM_getNucleusPath)(void);
-    const char * (PMAPIP PM_getNucleusConfigPath)(void);
-    const char * (PMAPIP PM_getUniqueID)(void);
-    const char * (PMAPIP PM_getMachineName)(void);
-    ibool   (PMAPIP VF_available)(void);
-    void *  (PMAPIP VF_init)(ulong baseAddr,int bankSize,int codeLen,void *bankFunc);
-    void    (PMAPIP VF_exit)(void);
-    PM_HWND (PMAPIP PM_openConsole)(PM_HWND hwndUser,int device,int xRes,int yRes,int bpp,ibool fullScreen);
-    int     (PMAPIP PM_getConsoleStateSize)(void);
-    void    (PMAPIP PM_saveConsoleState)(void *stateBuf,PM_HWND hwndConsole);
-    void    (PMAPIP PM_restoreConsoleState)(const void *stateBuf,PM_HWND hwndConsole);
-    void    (PMAPIP PM_closeConsole)(PM_HWND hwndConsole);
-    void    (PMAPIP PM_setOSCursorLocation)(int x,int y);
-    void    (PMAPIP PM_setOSScreenWidth)(int width,int height);
-    int     (PMAPIP PM_enableWriteCombine)(ulong base,ulong length,uint type);
-    void    (PMAPIP PM_backslash)(char *filename);
-    int     (PMAPIP PM_lockDataPages)(void *p,uint len,PM_lockHandle *lockHandle);
-    int     (PMAPIP PM_unlockDataPages)(void *p,uint len,PM_lockHandle *lockHandle);
-    int     (PMAPIP PM_lockCodePages)(__codePtr p,uint len,PM_lockHandle *lockHandle);
-    int     (PMAPIP PM_unlockCodePages)(__codePtr p,uint len,PM_lockHandle *lockHandle);
-    ibool   (PMAPIP PM_setRealTimeClockHandler)(PM_intHandler ih,int frequency);
-    void    (PMAPIP PM_setRealTimeClockFrequency)(int frequency);
-    void    (PMAPIP PM_restoreRealTimeClockHandler)(void);
-    ibool   (PMAPIP PM_doBIOSPOST)(ushort axVal,ulong BIOSPhysAddr,void *BIOSPtr,ulong BIOSLen);
-    char    (PMAPIP PM_getBootDrive)(void);
-    void    (PMAPIP PM_freePhysicalAddr)(void *ptr,ulong limit);
-    uchar   (PMAPIP PM_inpb)(int port);
-    ushort  (PMAPIP PM_inpw)(int port);
-    ulong   (PMAPIP PM_inpd)(int port);
-    void    (PMAPIP PM_outpb)(int port,uchar val);
-    void    (PMAPIP PM_outpw)(int port,ushort val);
-    void    (PMAPIP PM_outpd)(int port,ulong val);
-    void *  reserved2;
-    void    (PMAPIP PM_setSuspendAppCallback)(PM_saveState_cb saveState);
-    ibool   (PMAPIP PM_haveBIOSAccess)(void);
-    int     (PMAPIP PM_kbhit)(void);
-    int     (PMAPIP PM_getch)(void);
-    ibool   (PMAPIP PM_findBPD)(const char *dllname,char *bpdpath);
-    ulong   (PMAPIP PM_getPhysicalAddr)(void *p);
-    void    (PMAPIP PM_sleep)(ulong milliseconds);
-    int     (PMAPIP PM_getCOMPort)(int port);
-    int     (PMAPIP PM_getLPTPort)(int port);
-    PM_MODULE (PMAPIP PM_loadLibrary)(const char *szDLLName);
-    void *  (PMAPIP PM_getProcAddress)(PM_MODULE hModule,const char *szProcName);
-    void    (PMAPIP PM_freeLibrary)(PM_MODULE hModule);
-    int     (PMAPIP PCI_enumerate)(PCIDeviceInfo info[]);
-    ulong   (PMAPIP PCI_accessReg)(int index,ulong value,int func,PCIDeviceInfo *info);
-    ibool   (PMAPIP PCI_setHardwareIRQ)(PCIDeviceInfo *info,uint intPin,uint IRQ);
-    void    (PMAPIP PCI_generateSpecialCyle)(uint bus,ulong specialCycleData);
-    void *  reserved3;
-    ulong   (PMAPIP PCIBIOS_getEntry)(void);
-    uint    (PMAPIP CPU_getProcessorType)(void);
-    ibool   (PMAPIP CPU_haveMMX)(void);
-    ibool   (PMAPIP CPU_have3DNow)(void);
-    ibool   (PMAPIP CPU_haveSSE)(void);
-    ibool   (PMAPIP CPU_haveRDTSC)(void);
-    ulong   (PMAPIP CPU_getProcessorSpeed)(ibool accurate);
-    void    (PMAPIP ZTimerInit)(void);
-    void    (PMAPIP LZTimerOn)(void);
-    ulong   (PMAPIP LZTimerLap)(void);
-    void    (PMAPIP LZTimerOff)(void);
-    ulong   (PMAPIP LZTimerCount)(void);
-    void    (PMAPIP LZTimerOnExt)(LZTimerObject *tm);
-    ulong   (PMAPIP LZTimerLapExt)(LZTimerObject *tm);
-    void    (PMAPIP LZTimerOffExt)(LZTimerObject *tm);
-    ulong   (PMAPIP LZTimerCountExt)(LZTimerObject *tm);
-    void    (PMAPIP ULZTimerOn)(void);
-    ulong   (PMAPIP ULZTimerLap)(void);
-    void    (PMAPIP ULZTimerOff)(void);
-    ulong   (PMAPIP ULZTimerCount)(void);
-    ulong   (PMAPIP ULZReadTime)(void);
-    ulong   (PMAPIP ULZElapsedTime)(ulong start,ulong finish);
-    void    (PMAPIP ULZTimerResolution)(ulong *resolution);
-    void *  (PMAPIP PM_findFirstFile)(const char *filename,PM_findData *findData);
-    ibool   (PMAPIP PM_findNextFile)(void *handle,PM_findData *findData);
-    void    (PMAPIP PM_findClose)(void *handle);
-    void    (PMAPIP PM_makepath)(char *p,const char *drive,const char *dir,const char *name,const char *ext);
-    int     (PMAPIP PM_splitpath)(const char *fn,char *drive,char *dir,char *name,char *ext);
-    ibool   (PMAPIP PM_driveValid)(char drive);
-    void    (PMAPIP PM_getdcwd)(int drive,char *dir,int len);
-    void    (PMAPIP PM_setFileAttr)(const char *filename,uint attrib);
-    ibool   (PMAPIP PM_mkdir)(const char *filename);
-    ibool   (PMAPIP PM_rmdir)(const char *filename);
-    uint    (PMAPIP PM_getFileAttr)(const char *filename);
-    ibool   (PMAPIP PM_getFileTime)(const char *filename,ibool gmtTime,PM_time *time);
-    ibool   (PMAPIP PM_setFileTime)(const char *filename,ibool gmtTime,PM_time *time);
-    char *  (PMAPIP CPU_getProcessorName)(void);
-    int     (PMAPIP PM_getVGAStateSize)(void);
-    void    (PMAPIP PM_saveVGAState)(void *stateBuf);
-    void    (PMAPIP PM_restoreVGAState)(const void *stateBuf);
-    void    (PMAPIP PM_vgaBlankDisplay)(void);
-    void    (PMAPIP PM_vgaUnblankDisplay)(void);
-    void    (PMAPIP PM_blockUntilTimeout)(ulong milliseconds);
-    void    (PMAPIP _PM_add64)(u32 a_low,s32 a_high,u32 b_low,s32 b_high,__i64 *result);
-    void    (PMAPIP _PM_sub64)(u32 a_low,s32 a_high,u32 b_low,s32 b_high,__i64 *result);
-    void    (PMAPIP _PM_mul64)(u32 a_low,s32 a_high,u32 b_low,s32 b_high,__i64 *result);
-    void    (PMAPIP _PM_div64)(u32 a_low,s32 a_high,u32 b_low,s32 b_high,__i64 *result);
-    void    (PMAPIP _PM_shr64)(u32 a_low,s32 a_high,s32 shift,__i64 *result);
-    void    (PMAPIP _PM_sar64)(u32 a_low,s32 a_high,s32 shift,__i64 *result);
-    void    (PMAPIP _PM_shl64)(u32 a_low,s32 a_high,s32 shift,__i64 *result);
-    void    (PMAPIP _PM_neg64)(u32 a_low,s32 a_high,__i64 *result);
-    ulong   (PMAPIP PCI_findBARSize)(int bar,PCIDeviceInfo *pci);
-    void    (PMAPIP PCI_readRegBlock)(PCIDeviceInfo *info,int index,void *dst,int count);
-    void    (PMAPIP PCI_writeRegBlock)(PCIDeviceInfo *info,int index,void *src,int count);
-    void    (PMAPIP PM_flushTLB)(void);
-    void    (PMAPIP PM_useLocalMalloc)(void * (*malloc)(size_t size),void * (*calloc)(size_t nelem,size_t size),void * (*realloc)(void *ptr,size_t size),void (*free)(void *p));
-    void *  (PMAPIP PM_malloc)(size_t size);
-    void *  (PMAPIP PM_calloc)(size_t nelem,size_t size);
-    void *  (PMAPIP PM_realloc)(void *ptr,size_t size);
-    void    (PMAPIP PM_free)(void *p);
-    ibool   (PMAPIP PM_getPhysicalAddrRange)(void *p,ulong length,ulong *physAddress);
-    void *  (PMAPIP PM_allocPage)(ibool locked);
-    void    (PMAPIP PM_freePage)(void *p);
-    ulong   (PMAPIP PM_agpInit)(void);
-    void    (PMAPIP PM_agpExit)(void);
-    ibool   (PMAPIP PM_agpReservePhysical)(ulong numPages,int type,void **physContext,PM_physAddr *physAddr);
-    ibool   (PMAPIP PM_agpReleasePhysical)(void *physContext);
-    ibool   (PMAPIP PM_agpCommitPhysical)(void *physContext,ulong numPages,ulong startOffset,PM_physAddr *physAddr);
-    ibool   (PMAPIP PM_agpFreePhysical)(void *physContext,ulong numPages,ulong startOffset);
-    int     (PMAPIP PCI_getNumDevices)(void);
-    void    (PMAPIP PM_setLocalBPDPath)(const char *path);
-    void *  (PMAPIP PM_loadDirectDraw)(int device);
-    void    (PMAPIP PM_unloadDirectDraw)(int device);
-    PM_HWND (PMAPIP PM_getDirectDrawWindow)(void);
-    void    (PMAPIP PM_doSuspendApp)(void);
-    } PM_imports;
-
-#pragma pack()
-
-/*---------------------------- Global variables ---------------------------*/
-
-#ifdef  __cplusplus
-extern "C" {            /* Use "C" linkage when in C++ mode */
-#endif
-
-#ifdef  __WIN32_VXD__
-#define VESA_BUF_SIZE 1024
-extern uchar *_PM_rmBufAddr;
-#endif
-
-/* {secret} Pointer to global exports structure.
- * Should not be used by application programs.
- */
-extern PM_imports _VARAPI _PM_imports;
-
-/* {secret} */
-extern void * (*__PM_malloc)(size_t size);
-/* {secret} */
-extern void * (*__PM_calloc)(size_t nelem,size_t size);
-/* {secret} */
-extern void * (*__PM_realloc)(void *ptr,size_t size);
-/* {secret} */
-extern void (*__PM_free)(void *p);
-
-/*--------------------------- Function Prototypes -------------------------*/
-
-/* Routine to initialise the host side PM library. Note used from DLL's */
-
-void    PMAPI PM_init(void);
-
-/* Routine to return either PM_realMode, PM_286 or PM_386 */
-
-int     PMAPI PM_getModeType(void);
-
-/* Routine to return a selector to the BIOS data area at segment 0x40 */
-
-void *  PMAPI PM_getBIOSPointer(void);
-
-/* Routine to return a linear pointer to the VGA frame buffer memory */
-
-void *  PMAPI PM_getA0000Pointer(void);
-
-/* Routines to map/free physical memory into the current DS segment. In
- * some environments (32-bit DOS is one), after the mapping has been
- * allocated, it cannot be freed. Hence you should only allocate the
- * mapping once and cache the value for use by other parts of your
- * application. If the mapping cannot be createed, this function will
- * return a NULL pointer.
- *
- * This routine will also work for memory addresses below 1Mb, but the
- * mapped address cannot cross the 1Mb boundary.
- */
-
-void *  PMAPI PM_mapPhysicalAddr(ulong base,ulong limit,ibool isCached);
-void    PMAPI PM_freePhysicalAddr(void *ptr,ulong limit);
-
-/* Routine to determine the physical address of a linear address. It is
- * up to the caller to ensure the entire address range for a linear
- * block of memory is page aligned if that is required.
- */
-
-ulong   PMAPI PM_getPhysicalAddr(void *p);
-ibool   PMAPI PM_getPhysicalAddrRange(void *p,ulong length,ulong *physAddress);
-
-/* Routines for memory allocation. By default these functions use the regular
- * C runtime library malloc/free functions, but you can use the
- * PM_useLocalMalloc function to override the default memory allocator with
- * your own memory allocator. This will ensure that all memory allocation
- * used by SciTech products will use your overridden memory allocator
- * functions.
- *
- * Note that BPD files automatically map the C runtime library
- * malloc/calloc/realloc/free calls from inside the BPD to the PM library
- * versions by default.
- */
-
-void    PMAPI PM_useLocalMalloc(void * (*malloc)(size_t size),void * (*calloc)(size_t nelem,size_t size),void * (*realloc)(void *ptr,size_t size),void (*free)(void *p));
-void *  PMAPI PM_malloc(size_t size);
-void *  PMAPI PM_calloc(size_t nelem,size_t size);
-void *  PMAPI PM_realloc(void *ptr,size_t size);
-void    PMAPI PM_free(void *p);
-
-/* Routine to allocate a memory block in the global shared region that
- * is common to all tasks and accessible from ring 0 code.
- */
-
-void *  PMAPI PM_mallocShared(long size);
-
-/* Routine to free the allocated shared memory block */
-
-void    PMAPI PM_freeShared(void *ptr);
-
-/* Attach a previously allocated linear mapping to a new process */
-
-void *  PMAPI PM_mapToProcess(void *linear,ulong limit);
-
-/* Macros to extract byte, word and long values from a char pointer */
-
-#define PM_getByte(p)       *((volatile uchar*)(p))
-#define PM_getWord(p)       *((volatile ushort*)(p))
-#define PM_getLong(p)       *((volatile ulong*)(p))
-#define PM_setByte(p,v)     PM_getByte(p) = (v)
-#define PM_setWord(p,v)     PM_getWord(p) = (v)
-#define PM_setLong(p,v)     PM_getLong(p) = (v)
-
-/* Routine for accessing a low 1Mb memory block. You dont need to free this
- * pointer, but in 16 bit protected mode the selector allocated will be
- * re-used the next time this routine is called.
- */
-
-void *  PMAPI PM_mapRealPointer(uint r_seg,uint r_off);
-
-/* Routine to allocate a block of conventional memory below the 1Mb
- * limit so that it can be accessed from real mode. Ensure that you free
- * the segment when you are done with it.
- *
- * This routine returns a selector and offset to the segment that has been
- * allocated, and also returns the real mode segment and offset which can
- * be passed to real mode routines. Will return 0 if memory could not be
- * allocated.
- *
- * Please note that with some DOS extenders, memory allocated with the
- * following function cannot be freed, hence it will be allocated for the
- * life of your program. Thus if you need to call a bunch of different
- * real-mode routines in your program, allocate a single large buffer at
- * program startup that can be re-used throughout the program execution.
- */
-
-void *  PMAPI PM_allocRealSeg(uint size,uint *r_seg,uint *r_off);
-void    PMAPI PM_freeRealSeg(void *mem);
-
-/* Routine to allocate a block of locked memory, and return both the
- * linear and physical addresses of the memory. You should always
- * allocate locked memory blocks in page sized chunks (ie: 4K on IA32).
- * If the memory is not contiguous, you will need to use the
- * PM_getPhysicalAddr function to get the physical address of linear
- * pages within the memory block (the returned physical address will be
- * for the first address in the memory block only).
- */
-
-void *  PMAPI PM_allocLockedMem(uint size,ulong *physAddr,ibool contiguous,ibool below16Meg);
-void    PMAPI PM_freeLockedMem(void *p,uint size,ibool contiguous);
-
-/* Routine to allocate and free paged sized blocks of shared memory.
- * Addressable from all processes, but not from a ring 0 context
- * under OS/2. Note that under OS/2 PM_mapSharedPages must be called
- * to map the memory blocks into the shared memory address space
- * of each connecting process.
- */
-
-void *  PMAPI PM_allocPage(ibool locked);
-void    PMAPI PM_freePage(void *p);
-#ifdef __OS2__
-void    PMAPI PM_mapSharedPages(void);
-#endif
-
-/* Routine to return true if we have access to the BIOS on the host OS */
-
-ibool   PMAPI PM_haveBIOSAccess(void);
-
-/* Routine to call a real mode assembly language procedure. Register
- * values are passed in and out in the 'regs' and 'sregs' structures. We
- * do not provide any method of copying data from the protected mode stack
- * to the real mode stack, so if you need to pass data to real mode, you will
- * need to write a real mode assembly language hook to recieve the values
- * in registers, and to pass the data through a real mode block allocated
- * with the PM_allocRealSeg() routine.
- */
-
-void    PMAPI PM_callRealMode(uint seg,uint off, RMREGS *regs,RMSREGS *sregs);
-
-/* Routines to generate real mode interrupts using the same interface that
- * is used by int86() and int86x() in realmode. This routine is need to
- * call certain BIOS and DOS functions that are not supported by some
- * DOS extenders. No translation is done on any of the register values,
- * so they must be correctly set up and translated by the calling program.
- *
- * Normally the DOS extenders will allow you to use the normal int86()
- * function directly and will pass on unhandled calls to real mode to be
- * handled by the real mode handler. However calls to int86x() with real
- * mode segment values to be loaded will cause a GPF if used with the
- * standard int86x(), so you should use these routines if you know you
- * want to call a real mode handler.
- */
-
-int     PMAPI PM_int86(int intno, RMREGS *in, RMREGS *out);
-int     PMAPI PM_int86x(int intno, RMREGS *in, RMREGS *out,RMSREGS *sregs);
-
-/* Routine to generate a real mode interrupt. This is identical to the
- * above function, but takes a DPMI_regs structure for the registers
- * which has a lot more information. It is only available from 32-bit
- * protected mode.
- */
-
-void    PMAPI DPMI_int86(int intno, DPMI_regs *regs);
-
-/* Function to return the amount of available physical and total memory.
- * The results of this function are *only* valid before you have made any
- * calls to malloc() and free(). If you need to keep track of exactly how
- * much memory is currently allocated, you need to call this function to
- * get the total amount of memory available and then keep track of
- * the available memory every time you call malloc() and free().
- */
-
-void    PMAPI PM_availableMemory(ulong *physical,ulong *total);
-
-/* Return the address of a global VESA real mode transfer buffer for use
- * by applications.
- */
-
-void *  PMAPI PM_getVESABuf(uint *len,uint *rseg,uint *roff);
-
-/* Handle fatal error conditions */
-
-void    PMAPI PM_fatalError(const char *msg);
-
-/* Function to set a cleanup error handler called when PM_fatalError
- * is called. This allows us to the console back into a normal state
- * if we get a failure from deep inside a BPD file. This function is
- * not exported to BPD files, and is only used by code compiled for the
- * OS.
- */
-
-void    PMAPI PM_setFatalErrorCleanup(PM_fatalCleanupHandler cleanup);
-
-/* Return the OS type flag as defined in <drvlib/os/os.h> */
-
-long    PMAPI PM_getOSType(void);
-
-/* Functions to set a VBE bank via an Int 10h */
-
-void    PMAPI PM_setBankA(int bank);
-void    PMAPI PM_setBankAB(int bank);
-void    PMAPI PM_setCRTStart(int x,int y,int waitVRT);
-
-/* Return the current working directory */
-
-char *  PMAPI PM_getCurrentPath(char *path,int maxLen);
-
-/* Return paths to the VBE/AF and Nucleus directories */
-
-const char * PMAPI PM_getVBEAFPath(void);
-const char * PMAPI PM_getNucleusPath(void);
-const char * PMAPI PM_getNucleusConfigPath(void);
-
-/* Find the path to a binary portable DLL */
-
-void    PMAPI PM_setLocalBPDPath(const char *path);
-ibool   PMAPI PM_findBPD(const char *dllname,char *bpdpath);
-
-/* Returns the drive letter of the boot drive for DOS, OS/2 and Windows */
-
-char    PMAPI PM_getBootDrive(void);
-
-/* Return a network unique machine identifier as a string */
-
-const char * PMAPI PM_getUniqueID(void);
-
-/* Return the network machine name as a string */
-
-const char * PMAPI PM_getMachineName(void);
-
-/* Functions to install and remove the virtual linear framebuffer
- * emulation code. For unsupported DOS extenders and when running under
- * a DPMI host like Windows or OS/2, this function will return a NULL.
- */
-
-ibool   PMAPI VF_available(void);
-void *  PMAPI VF_init(ulong baseAddr,int bankSize,int codeLen,void *bankFunc);
-void    PMAPI VF_exit(void);
-
-/* Functions to wait for a keypress and read a key for command line
- * environments such as DOS, Win32 console and Unix.
- */
-
-int     PMAPI PM_kbhit(void);
-int     PMAPI PM_getch(void);
-
-/* Functions to create either a fullscreen or windowed console on the
- * desktop, and to allow the resolution of fullscreen consoles to be
- * changed on the fly without closing the console. For non-windowed
- * environments (such as a Linux or OS/2 fullscreen console), these
- * functions enable console graphics mode and restore console text mode.
- *
- * The suspend application callback is used to allow the application to
- * save the state of the fullscreen console mode to allow temporary
- * switching to another console or back to the regular GUI desktop. It
- * is also called to restore the fullscreen graphics state after the
- * fullscreen console regains the focus.
- *
- * The device parameter allows for the console to be opened on a different
- * display controllers (0 is always the primary controller).
- */
-
-PM_HWND PMAPI PM_openConsole(PM_HWND hwndUser,int device,int xRes,int yRes,int bpp,ibool fullScreen);
-int     PMAPI PM_getConsoleStateSize(void);
-void    PMAPI PM_saveConsoleState(void *stateBuf,PM_HWND hwndConsole);
-void    PMAPI PM_setSuspendAppCallback(PM_saveState_cb saveState);
-void    PMAPI PM_restoreConsoleState(const void *stateBuf,PM_HWND hwndConsole);
-void    PMAPI PM_closeConsole(PM_HWND hwndConsole);
-
-/* Functions to modify OS console information */
-
-void    PMAPI PM_setOSCursorLocation(int x,int y);
-void    PMAPI PM_setOSScreenWidth(int width,int height);
-
-/* Function to emable Intel PPro/PII write combining */
-
-int     PMAPI PM_enableWriteCombine(ulong base,ulong length,uint type);
-int     PMAPI PM_enumWriteCombine(PM_enumWriteCombine_t callback);
-
-/* Function to add a path separator to the end of a filename (if not present) */
-
-void    PMAPI PM_backslash(char *filename);
-
-/* Routines to lock and unlock regions of memory under a virtual memory
- * environment. These routines _must_ be used to lock all hardware
- * and mouse interrupt handlers installed, _AND_ any global data that
- * these handler manipulate, so that they will always be present in memory
- * to handle the incoming interrupts.
- *
- * Note that it is important to call the correct routine depending on
- * whether the area being locked is code or data, so that under 32 bit
- * PM we will get the selector value correct.
- */
-
-int     PMAPI PM_lockDataPages(void *p,uint len,PM_lockHandle *lockHandle);
-int     PMAPI PM_unlockDataPages(void *p,uint len,PM_lockHandle *lockHandle);
-int     PMAPI PM_lockCodePages(__codePtr p,uint len,PM_lockHandle *lockHandle);
-int     PMAPI PM_unlockCodePages(__codePtr p,uint len,PM_lockHandle *lockHandle);
-
-/* Routines to install and remove Real Time Clock interrupt handlers. The
- * frequency of the real time clock can be changed by calling
- * PM_setRealTimeClockFrequeny, and the value can be any power of 2 value
- * from 2Hz to 8192Hz.
- *
- * Note that you _must_ lock the memory containing the interrupt
- * handlers with the PM_lockPages() function otherwise you may encounter
- * problems in virtual memory environments.
- *
- * NOTE: User space versions of the PM library should fail these functions.
- */
-
-ibool   PMAPI PM_setRealTimeClockHandler(PM_intHandler ih,int frequency);
-void    PMAPI PM_setRealTimeClockFrequency(int frequency);
-void    PMAPI PM_restoreRealTimeClockHandler(void);
-
-/* Routines to install and remove hardware interrupt handlers.
- *
- * Note that you _must_ lock the memory containing the interrupt
- * handlers with the PM_lockPages() function otherwise you may encounter
- * problems in virtual memory environments.
- *
- * NOTE: User space versions of the PM library should fail these functions.
- */
-
-PM_IRQHandle PMAPI PM_setIRQHandler(int IRQ,PM_irqHandler ih);
-void    PMAPI PM_restoreIRQHandler(PM_IRQHandle irqHandle);
-
-/* Functions to program DMA using the legacy ISA DMA controller */
-
-void    PMAPI PM_DMACEnable(int channel);
-void    PMAPI PM_DMACDisable(int channel);
-void    PMAPI PM_DMACProgram(int channel,int mode,ulong bufferPhys,int count);
-ulong   PMAPI PM_DMACPosition(int channel);
-
-/* Function to post secondary graphics controllers using the BIOS */
-
-ibool   PMAPI PM_doBIOSPOST(ushort axVal,ulong BIOSPhysAddr,void *mappedBIOS,ulong BIOSLen);
-
-/* Function to init the AGP functions and return the AGP aperture size in MB */
-
-ulong   PMAPI PM_agpInit(void);
-void    PMAPI PM_agpExit(void);
-
-/* Functions to reserve and release physical AGP memory ranges */
-
-ibool   PMAPI PM_agpReservePhysical(ulong numPages,int type,void **physContext,PM_physAddr *physAddr);
-ibool   PMAPI PM_agpReleasePhysical(void *physContext);
-
-/* Functions to commit and free physical AGP memory ranges */
-
-ibool   PMAPI PM_agpCommitPhysical(void *physContext,ulong numPages,ulong startOffset,PM_physAddr *physAddr);
-ibool   PMAPI PM_agpFreePhysical(void *physContext,ulong numPages,ulong startOffset);
-
-/* Functions to do I/O port manipulation directly from C code. These
- * functions are portable and will work on any processor architecture
- * to access I/O space registers on PCI devices.
- */
-
-uchar   PMAPI PM_inpb(int port);
-ushort  PMAPI PM_inpw(int port);
-ulong   PMAPI PM_inpd(int port);
-void    PMAPI PM_outpb(int port,uchar val);
-void    PMAPI PM_outpw(int port,ushort val);
-void    PMAPI PM_outpd(int port,ulong val);
-
-/* Functions to determine the I/O port locations for COM and LPT ports.
- * The functions are zero based, so for COM1 or LPT1 pass in a value of 0,
- * for COM2 or LPT2 pass in a value of 1 etc.
- */
-
-int     PMAPI PM_getCOMPort(int port);
-int     PMAPI PM_getLPTPort(int port);
-
-/* Internal functions that need prototypes */
-
-void    PMAPI _PM_getRMvect(int intno, long *realisr);
-void    PMAPI _PM_setRMvect(int intno, long realisr);
-void    PMAPI _PM_freeMemoryMappings(void);
-
-/* Function to override the default debug log file location */
-
-void    PMAPI PM_setDebugLog(const char *logFilePath);
-
-/* Function to put the process to sleep for the specified milliseconds */
-
-void    PMAPI PM_sleep(ulong milliseconds);
-
-/* Function to block until 'milliseconds' have passed since last call */
-
-void    PMAPI PM_blockUntilTimeout(ulong milliseconds);
-
-/* Functions for directory traversal and management */
-
-void *  PMAPI PM_findFirstFile(const char *filename,PM_findData *findData);
-ibool   PMAPI PM_findNextFile(void *handle,PM_findData *findData);
-void    PMAPI PM_findClose(void *handle);
-void    PMAPI PM_makepath(char *p,const char *drive,const char *dir,const char *name,const char *ext);
-int     PMAPI PM_splitpath(const char *fn,char *drive,char *dir,char *name,char *ext);
-ibool   PMAPI PM_driveValid(char drive);
-void    PMAPI PM_getdcwd(int drive,char *dir,int len);
-uint    PMAPI PM_getFileAttr(const char *filename);
-void    PMAPI PM_setFileAttr(const char *filename,uint attrib);
-ibool   PMAPI PM_getFileTime(const char *filename,ibool gmTime,PM_time *time);
-ibool   PMAPI PM_setFileTime(const char *filename,ibool gmTime,PM_time *time);
-ibool   PMAPI PM_mkdir(const char *filename);
-ibool   PMAPI PM_rmdir(const char *filename);
-
-/* Functions to handle loading OS specific shared libraries */
-
-PM_MODULE PMAPI PM_loadLibrary(const char *szDLLName);
-void *  PMAPI PM_getProcAddress(PM_MODULE hModule,const char *szProcName);
-void    PMAPI PM_freeLibrary(PM_MODULE hModule);
-
-/* Functions and macros for 64-bit arithmetic */
-
-void    PMAPI _PM_add64(u32 a_low,s32 a_high,u32 b_low,s32 b_high,__i64 *result);
-void    PMAPI _PM_sub64(u32 a_low,s32 a_high,u32 b_low,s32 b_high,__i64 *result);
-void    PMAPI _PM_mul64(u32 a_low,s32 a_high,u32 b_low,s32 b_high,__i64 *result);
-void    PMAPI _PM_div64(u32 a_low,s32 a_high,u32 b_low,s32 b_high,__i64 *result);
-void    PMAPI _PM_shr64(u32 a_low,s32 a_high,s32 shift,__i64 *result);
-void    PMAPI _PM_sar64(u32 a_low,s32 a_high,s32 shift,__i64 *result);
-void    PMAPI _PM_shl64(u32 a_low,s32 a_high,s32 shift,__i64 *result);
-void    PMAPI _PM_neg64(u32 a_low,s32 a_high,__i64 *result);
-#ifdef __NATIVE_INT64__
-#define PM_add64(r,a,b)     (r) = (a) + (b)
-#define PM_add64_32(r,a,b)  (r) = (a) + (b)
-#define PM_sub64(r,a,b)     (r) = (a) - (b)
-#define PM_sub64_32(r,a,b)  (r) = (a) - (b)
-#define PM_mul64(r,a,b)     (r) = (a) * (b)
-#define PM_mul64_32(r,a,b)  (r) = (a) * (b)
-#define PM_div64(r,a,b)     (r) = (a) / (b)
-#define PM_div64_32(r,a,b)  (r) = (a) / (b)
-#define PM_shr64(r,a,s)     (r) = (a) >> (s)
-#define PM_sar64(r,a,s)     (r) = ((s64)(a)) >> (s)
-#define PM_shl64(r,a,s)     (r) = (u64)(a) << (s)
-#define PM_neg64(r,a,s)     (r) = -(a)
-#define PM_not64(r,a,s)     (r) = ~(a)
-#define PM_eq64(a,b)        (a) == (b)
-#define PM_gt64(a,b)        (a) > (b)
-#define PM_lt64(a,b)        (a) < (b)
-#define PM_geq64(a,b)       (a) >= (b)
-#define PM_leq64(a,b)       (a) <= (b)
-#define PM_64to32(a)        (u32)(a)
-#define PM_64tos32(a)       (s32)(a)
-#define PM_set64(a,b,c)     (a) = ((u64)(b) << 32) + (c)
-#define PM_set64_32(a,b)    (a) = (b)
-#else
-#define PM_add64(r,a,b)     _PM_add64((a).low,(a).high,(b).low,(b).high,&(r))
-#define PM_add64_32(r,a,b)  _PM_add64((a).low,(a).high,b,0,&(r))
-#define PM_sub64(r,a,b)     _PM_sub64((a).low,(a).high,(b).low,(b).high,&(r))
-#define PM_sub64_32(r,a,b)  _PM_sub64((a).low,(a).high,b,0,&(r))
-#define PM_mul64(r,a,b)     _PM_mul64((a).low,(a).high,(b).low,(b).high,&(r))
-#define PM_mul64_32(r,a,b)  _PM_mul64((a).low,(a).high,b,0,&(r))
-#define PM_div64(r,a,b)     _PM_div64((a).low,(a).high,(b).low,(b).high,&(r))
-#define PM_div64_32(r,a,b)  _PM_div64((a).low,(a).high,b,0,&(r))
-#define PM_shr64(r,a,s)     _PM_shr64((a).low,(a).high,s,&(r))
-#define PM_sar64(r,a,s)     _PM_sar64((a).low,(a).high,s,&(r))
-#define PM_shl64(r,a,s)     _PM_shl64((a).low,(a).high,s,&(r))
-#define PM_neg64(r,a,s)     _PM_neg64((a).low,(a).high,&(r))
-#define PM_not64(r,a,s)     (r).low = ~(a).low, (r).high = ~(a).high
-#define PM_eq64(a,b)        ((a).low == (b).low && (a).high == (b).high)
-#define PM_gt64(a,b)        (((a).high > (b).high) || ((a).high == (b).high && (a).low > (b).low))
-#define PM_lt64(a,b)        (((a).high < (b).high) || ((a).high == (b).high && (a).low < (b).low))
-#define PM_geq64(a,b)       (PM_eq64(a,b) || PM_gt64(a,b))
-#define PM_leq64(a,b)       (PM_eq64(a,b) || PM_lt64(a,b))
-#define PM_64to32(a)        (u32)(a.low)
-#define PM_64tos32(a)       ((a).high < 0) ? -(a).low : (a).low)
-#define PM_set64(a,b,c)     (a).high = (b), (a).low = (c)
-#define PM_set64_32(a,b)    (a).high = 0, (a).low = (b)
-#endif
-
-/* Function to enable IOPL access if required */
-
-int     PMAPI PM_setIOPL(int iopl);
-
-/* Function to flush the TLB and CPU caches */
-
-void    PMAPI PM_flushTLB(void);
-
-/* DOS specific fucntions */
-
-#ifdef  __MSDOS__
-uint    PMAPI PMHELP_getVersion(void);
-void    PMAPI PM_VxDCall(VXD_regs *regs);
-#endif
-
-/* Functions to save and restore the VGA hardware state */
-
-int     PMAPI PM_getVGAStateSize(void);
-void    PMAPI PM_saveVGAState(void *stateBuf);
-void    PMAPI PM_restoreVGAState(const void *stateBuf);
-void    PMAPI PM_vgaBlankDisplay(void);
-void    PMAPI PM_vgaUnblankDisplay(void);
-
-/* Functions to load and unload DirectDraw libraries. Only used on
- * Windows platforms.
- */
-
-void *  PMAPI PM_loadDirectDraw(int device);
-void    PMAPI PM_unloadDirectDraw(int device);
-PM_HWND PMAPI PM_getDirectDrawWindow(void);
-void    PMAPI PM_doSuspendApp(void);
-
-/* Functions to install, start, stop and remove NT services. Valid only
- * for Win32 apps running on Windows NT.
- */
-
-#ifdef __WINDOWS32__
-ulong   PMAPI PM_installService(const char *szDriverName,const char *szServiceName,const char *szLoadGroup,ulong dwServiceType);
-ulong   PMAPI PM_startService(const char *szServiceName);
-ulong   PMAPI PM_stopService(const char *szServiceName);
-ulong   PMAPI PM_removeService(const char *szServiceName);
-#endif
-
-/* Routines to generate native interrupts (ie: protected mode interrupts
- * for protected mode apps) using an interface the same as that use by
- * int86() and int86x() in realmode. These routines are required because
- * many 32 bit compilers use different register structures and different
- * functions causing major portability headaches. Thus we provide our
- * own and solve it all in one fell swoop, and we also get a routine to
- * put stuff into 32 bit registers from real mode ;-)
- */
-
-void    PMAPI PM_segread(PMSREGS *sregs);
-int     PMAPI PM_int386(int intno, PMREGS *in, PMREGS *out);
-int     PMAPI PM_int386x(int intno, PMREGS *in, PMREGS *out,PMSREGS *sregs);
-
-/* Call the X86 emulator or the real BIOS in our test harness */
-
-#if defined(TEST_HARNESS) && !defined(PMLIB)
-#define PM_mapRealPointer(r_seg,r_off)      _PM_imports.PM_mapRealPointer(r_seg,r_off)
-#define PM_getVESABuf(len,rseg,roff)        _PM_imports.PM_getVESABuf(len,rseg,roff)
-#define PM_callRealMode(seg,off,regs,sregs) _PM_imports.PM_callRealMode(seg,off,regs,sregs)
-#define PM_int86(intno,in,out)              _PM_imports.PM_int86(intno,in,out)
-#define PM_int86x(intno,in,out,sregs)       _PM_imports.PM_int86x(intno,in,out,sregs)
-#endif
-
-#ifdef  __cplusplus
-}                       /* End of "C" linkage for C++   */
-#endif
-
-/* Include OS extensions for interrupt handling */
-
-#if defined(__REALDOS__) || defined(__SMX32__)
-#include "pmint.h"
-#endif
-
-#endif /* __PMAPI_H */
diff --git a/board/MAI/bios_emulator/scitech/include/pmimp.h b/board/MAI/bios_emulator/scitech/include/pmimp.h
deleted file mode 100644 (file)
index 817f5e6..0000000
+++ /dev/null
@@ -1,193 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Any
-*
-* Description:  Header file declaring all the PM imports structure for the
-*               current version of the PM library. Included in all code
-*               that needs to pass the PM imports to BPD files.
-*
-****************************************************************************/
-
-PM_imports  _VARAPI _PM_imports = {
-    sizeof(PM_imports),
-    PM_getModeType,
-    PM_getBIOSPointer,
-    PM_getA0000Pointer,
-    PM_mapPhysicalAddr,
-    PM_mallocShared,
-    NULL,
-    PM_freeShared,
-    PM_mapToProcess,
-    PM_mapRealPointer,
-    PM_allocRealSeg,
-    PM_freeRealSeg,
-    PM_allocLockedMem,
-    PM_freeLockedMem,
-    PM_callRealMode,
-    PM_int86,
-    PM_int86x,
-    DPMI_int86,
-    PM_availableMemory,
-    PM_getVESABuf,
-    PM_getOSType,
-    PM_fatalError,
-    PM_setBankA,
-    PM_setBankAB,
-    PM_setCRTStart,
-    PM_getCurrentPath,
-    PM_getVBEAFPath,
-    PM_getNucleusPath,
-    PM_getNucleusConfigPath,
-    PM_getUniqueID,
-    PM_getMachineName,
-    VF_available,
-    VF_init,
-    VF_exit,
-    PM_openConsole,
-    PM_getConsoleStateSize,
-    PM_saveConsoleState,
-    PM_restoreConsoleState,
-    PM_closeConsole,
-    PM_setOSCursorLocation,
-    PM_setOSScreenWidth,
-    PM_enableWriteCombine,
-    PM_backslash,
-    PM_lockDataPages,
-    PM_unlockDataPages,
-    PM_lockCodePages,
-    PM_unlockCodePages,
-    PM_setRealTimeClockHandler,
-    PM_setRealTimeClockFrequency,
-    PM_restoreRealTimeClockHandler,
-    PM_doBIOSPOST,
-    PM_getBootDrive,
-    PM_freePhysicalAddr,
-    PM_inpb,
-    PM_inpw,
-    PM_inpd,
-    PM_outpb,
-    PM_outpw,
-    PM_outpd,
-    NULL,
-    PM_setSuspendAppCallback,
-    PM_haveBIOSAccess,
-    PM_kbhit,
-    PM_getch,
-    PM_findBPD,
-    PM_getPhysicalAddr,
-    PM_sleep,
-    PM_getCOMPort,
-    PM_getLPTPort,
-    PM_loadLibrary,
-    PM_getProcAddress,
-    PM_freeLibrary,
-    PCI_enumerate,
-    PCI_accessReg,
-    PCI_setHardwareIRQ,
-    PCI_generateSpecialCyle,
-    NULL,
-    PCIBIOS_getEntry,
-    CPU_getProcessorType,
-    CPU_haveMMX,
-    CPU_have3DNow,
-    CPU_haveSSE,
-    CPU_haveRDTSC,
-    CPU_getProcessorSpeed,
-    ZTimerInit,
-    LZTimerOn,
-    LZTimerLap,
-    LZTimerOff,
-    LZTimerCount,
-    LZTimerOnExt,
-    LZTimerLapExt,
-    LZTimerOffExt,
-    LZTimerCountExt,
-    ULZTimerOn,
-    ULZTimerLap,
-    ULZTimerOff,
-    ULZTimerCount,
-    ULZReadTime,
-    ULZElapsedTime,
-    ULZTimerResolution,
-    PM_findFirstFile,
-    PM_findNextFile,
-    PM_findClose,
-    PM_makepath,
-    PM_splitpath,
-    PM_driveValid,
-    PM_getdcwd,
-    PM_setFileAttr,
-    PM_mkdir,
-    PM_rmdir,
-    PM_getFileAttr,
-    PM_getFileTime,
-    PM_setFileTime,
-    CPU_getProcessorName,
-    PM_getVGAStateSize,
-    PM_saveVGAState,
-    PM_restoreVGAState,
-    PM_vgaBlankDisplay,
-    PM_vgaUnblankDisplay,
-    PM_blockUntilTimeout,
-    _PM_add64,
-    _PM_sub64,
-    _PM_mul64,
-    _PM_div64,
-    _PM_shr64,
-    _PM_sar64,
-    _PM_shl64,
-    _PM_neg64,
-    PCI_findBARSize,
-    PCI_readRegBlock,
-    PCI_writeRegBlock,
-    PM_flushTLB,
-    PM_useLocalMalloc,
-    PM_malloc,
-    PM_calloc,
-    PM_realloc,
-    PM_free,
-    PM_getPhysicalAddrRange,
-    PM_allocPage,
-    PM_freePage,
-    PM_agpInit,
-    PM_agpExit,
-    PM_agpReservePhysical,
-    PM_agpReleasePhysical,
-    PM_agpCommitPhysical,
-    PM_agpFreePhysical,
-    PCI_getNumDevices,
-    PM_setLocalBPDPath,
-#ifdef __WINDOWS32__
-    PM_loadDirectDraw,
-    PM_unloadDirectDraw,
-    PM_getDirectDrawWindow,
-    PM_doSuspendApp,
-#else
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-#endif
-    };
diff --git a/board/MAI/bios_emulator/scitech/include/pmint.h b/board/MAI/bios_emulator/scitech/include/pmint.h
deleted file mode 100644 (file)
index 7d76dad..0000000
+++ /dev/null
@@ -1,211 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Real mode and 16/32 bit Protected Mode
-*
-* Description:  Header file for the interrupt handling extensions to the OS
-*               Portability Manager Library. These extensions includes
-*               simplified interrupt handling, allowing all common interrupt
-*               handlers to be hooked and handled directly with normal C
-*               functions, both in 16 bit and 32 bit modes. Note however that
-*               simplified handling does not mean slow performance! All low
-*               level interrupt handling is done efficiently in assembler
-*               for speed (well actually necessary to insulate the
-*               application from the lack of far pointers in 32 bit PM). The
-*               interrupt handlers currently supported are:
-*
-*                   Mouse (0x33 callback)
-*                   Timer Tick (0x8)
-*                   Keyboard (0x9 and 0x15)
-*                   Control C/Break (0x23/0x1B)
-*                   Critical Error (0x24)
-*
-****************************************************************************/
-
-#ifndef __PMINT_H
-#define __PMINT_H
-
-/*--------------------------- Macros and Typedefs -------------------------*/
-
-#ifdef __SMX32__
-/* PC interrupts (Ensure consistent with pme.inc) */
-#define PM_IRQ0      0x40
-#define PM_IRQ1      (PM_IRQ0+1)
-#define PM_IRQ6      (PM_IRQ0+6)
-#define PM_IRQ14     (PM_IRQ0+14)
-#endif
-
-/* Define the different types of interrupt handlers that we support     */
-
-typedef uint    (PMAPIP PM_criticalHandler)(uint axValue,uint diValue);
-typedef void    (PMAPIP PM_breakHandler)(uint breakHit);
-typedef short   (PMAPIP PM_key15Handler)(short scanCode);
-typedef void    (PMAPIP PM_mouseHandler)(uint event, uint butstate,int x,int y,int mickeyX,int mickeyY);
-
-/* Create a type for representing far pointers in both 16 and 32 bit
- * protected mode.
- */
-
-#ifdef  PM386
-typedef struct {
-    long    off;
-    short   sel;
-    } PMFARPTR;
-#define PMNULL  {0,0}
-#else
-typedef void *PMFARPTR;
-#define PMNULL  NULL
-#endif
-
-/*--------------------------- Function Prototypes -------------------------*/
-
-#ifdef  __cplusplus
-extern "C" {            /* Use "C" linkage when in C++ mode */
-#endif
-
-/* Routine to load save default data segment selector value into a code
- * segment variable, and another to load the value into the DS register.
- */
-
-void    PMAPI PM_loadDS(void);
-void    PMAPI PM_saveDS(void);
-
-/* Routine to install a mouse interrupt handling routine. The
- * mouse handler routine is a normal C function, and the PM library
- * will take care of passing the correct parameters to the function,
- * and switching to a local stack.
- *
- * Note that you _must_ lock the memory containing the mouse interrupt
- * handler with the PM_lockPages() function otherwise you may encounter
- * problems in virtual memory environments.
- */
-
-int     PMAPI PM_setMouseHandler(int mask,PM_mouseHandler mh);
-void    PMAPI PM_restoreMouseHandler(void);
-
-/* Routine to reset the mouse driver, and re-install the current
- * mouse interrupt handler if one was currently installed (since the
- * mouse reset will automatically remove this handler.
- */
-
-void    PMAPI PM_resetMouseDriver(int hardReset);
-
-/* Routine to reset the mouse driver, and re-install the current
- * mouse interrupt handler if one was currently installed (since the
- * mouse reset will automatically remove this handler.
- */
-
-void    PMAPI PM_resetMouseDriver(int hardReset);
-
-/* Routines to install and remove timer interrupt handlers.
- *
- * Note that you _must_ lock the memory containing the interrupt
- * handlers with the PM_lockPages() function otherwise you may encounter
- * problems in virtual memory environments.
- */
-
-void    PMAPI PM_setTimerHandler(PM_intHandler ih);
-void    PMAPI PM_chainPrevTimer(void);
-void    PMAPI PM_restoreTimerHandler(void);
-
-/* Routines to install and keyboard interrupt handlers.
- *
- * Note that you _must_ lock the memory containing the interrupt
- * handlers with the PM_lockPages() function otherwise you may encounter
- * problems in virtual memory environments.
- */
-
-void    PMAPI PM_setKeyHandler(PM_intHandler ih);
-void    PMAPI PM_chainPrevKey(void);
-void    PMAPI PM_restoreKeyHandler(void);
-
-/* Routines to hook and unhook the alternate Int 15h keyboard intercept
- * callout routine. Your event handler will need to return the following:
- *
- *  scanCode    - Let the BIOS process scan code (chains to previous handler)
- *  0           - You have processed the scan code so flush from BIOS
- *
- * Note that this is not available under all DOS extenders, but does
- * work under real mode, DOS4GW and X32-VM. It does not work under the
- * PowerPack 32 bit DOS extenders. If you figure out how to do it let us know!
- */
-
-void    PMAPI PM_setKey15Handler(PM_key15Handler ih);
-void    PMAPI PM_restoreKey15Handler(void);
-
-/* Routines to install and remove the control c/break interrupt handlers.
- * Interrupt handling is performed by the PM/Pro library, and you can call
- * the supplied routines to test the status of the Ctrl-C and Ctrl-Break
- * flags. If you pass the value TRUE for 'clearFlag' to these routines,
- * the internal flags will be reset in order to catch another Ctrl-C or
- * Ctrl-Break interrupt.
- */
-
-void    PMAPI PM_installBreakHandler(void);
-int     PMAPI PM_ctrlCHit(int clearFlag);
-int     PMAPI PM_ctrlBreakHit(int clearFlag);
-void    PMAPI PM_restoreBreakHandler(void);
-
-/* Routine to install an alternate break handler that will call your
- * code directly. This is not available under all DOS extenders, but does
- * work under real mode, DOS4GW and X32-VM. It does not work under the
- * PowerPack 32 bit DOS extenders. If you figure out how to do it let us know!
- *
- * Note that you should either install one or the other, but not both!
- */
-
-void    PMAPI PM_installAltBreakHandler(PM_breakHandler bh);
-
-/* Routines to install and remove the critical error handler. The interrupt
- * is handled by the PM/Pro library, and the operation will always be failed.
- * You can check the status of the critical error handler with the
- * appropriate function. If you pass the value TRUE for 'clearFlag', the
- * internal flag will be reset ready to catch another critical error.
- */
-
-void    PMAPI PM_installCriticalHandler(void);
-int     PMAPI PM_criticalError(int *axValue, int *diValue, int clearFlag);
-void    PMAPI PM_restoreCriticalHandler(void);
-
-/* Routine to install an alternate critical handler that will call your
- * code directly. This is not available under all DOS extenders, but does
- * work under real mode, DOS4GW and X32-VM. It does not work under the
- * PowerPack 32 bit DOS extenders. If you figure out how to do it let us know!
- *
- * Note that you should either install one or the other, but not both!
- */
-
-void    PMAPI PM_installAltCriticalHandler(PM_criticalHandler);
-
-/* Functions to manage protected mode only interrupt handlers */
-
-void    PMAPI PM_getPMvect(int intno, PMFARPTR *isr);
-void    PMAPI PM_setPMvect(int intno, PM_intHandler ih);
-void    PMAPI PM_restorePMvect(int intno, PMFARPTR isr);
-
-#ifdef  __cplusplus
-}                       /* End of "C" linkage for C++   */
-#endif
-
-#endif /* __PMINT_H */
diff --git a/board/MAI/bios_emulator/scitech/include/scitech.h b/board/MAI/bios_emulator/scitech/include/scitech.h
deleted file mode 100644 (file)
index 8d5eee9..0000000
+++ /dev/null
@@ -1,712 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech Multi-platform Graphics Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  any
-*
-* Description:  General header file for operating system portable code.
-*
-****************************************************************************/
-
-#ifndef __SCITECH_H
-#define __SCITECH_H
-
-/* We have the following defines to identify the compilation environment:
- *
- *  __16BIT__       Compiling for 16 bit code (any environment)
- *  __32BIT__       Compiling for 32 bit code (any environment)
- *  __MSDOS__       Compiling for MS-DOS (includes __WINDOWS16__, __WIN386__)
- *  __REALDOS__     Compiling for MS-DOS (excludes __WINDOWS16__)
- *  __MSDOS16__     Compiling for 16 bit MS-DOS
- *  __MSDOS32__     Compiling for 32 bit MS-DOS
- *  __WINDOWS__     Compiling for Windows
- *  __WINDOWS16__   Compiling for 16 bit Windows (__MSDOS__ also defined)
- *  __WINDOWS32__   Compiling for 32 bit Windows
- *  __WIN32_VXD__   Compiling for a 32-bit C based VxD
- *  __NT_DRIVER__   Compiling for a 32-bit C based NT device driver
- *  __OS2__         Compiling for OS/2
- *  __OS2_16__      Compiling for 16 bit OS/2
- *  __OS2_32__      Compiling for 32 bit OS/2
- *  __UNIX__        Compiling for Unix
- *  __QNX__         Compiling for the QNX realtime OS (Unix compatible)
- *  __LINUX__       Compiling for the Linux OS (Unix compatible)
- *  __FREEBSD__     Compiling for the FreeBSD OS (Unix compatible)
- *  __BEOS__        Compiling for the BeOS (Unix compatible)
- *  __SMX32__       Compiling for the SMX 32-bit Real Time OS
- *  __ENEA_OSE__    Compiling for the OSE embedded OS
- *  __RTTARGET__    Compiling for the RTTarget 32-bit embedded OS
- *  __MACOS__       Compiling for the MacOS platform (PowerPC)
- *  __DRIVER__      Compiling for a 32-bit binary compatible driver
- *  __CONSOLE__     Compiling for a fullscreen OS console mode
- *  __SNAP__        Compiling as a Snap executeable or dynamic library
- *
- *  __INTEL__       Compiling for Intel CPU's
- *  __ALPHA__       Compiling for DEC Alpha CPU's
- *  __MIPS__        Compiling for MIPS CPU's
- *  __PPC__         Compiling for PowerPC CPU's
- *  __MC68K__       Compiling for Motorola 680x0
- *
- *  __BIG_ENDIAN__  Compiling for a big endian processor
- *
- */
-
-#ifdef  __SC__
-#if     __INTSIZE == 4
-#define __SC386__
-#endif
-#endif
-
-/* Determine some things that are compiler specific */
-
-#ifdef  __GNUC__
-#ifdef  __cplusplus
-/* G++ currently fucks this up! */
-#define __cdecl
-#define __stdcall
-#else
-#undef  __cdecl
-#undef  __stdcall
-#define __cdecl     __attribute__ ((cdecl))
-#define __stdcall   __attribute__ ((stdcall))
-#endif
-#define __FLAT__            /* GCC is always 32 bit flat model          */
-#define __HAS_BOOL__        /* Latest GNU C++ has ibool type            */
-#define __HAS_LONG_LONG__   /* GNU C supports long long type            */
-#include <stdio.h>          /* Bring in for definition of NULL          */
-#endif
-
-#ifdef  __BORLANDC__
-#if (__BORLANDC__ >= 0x500) || defined(CLASSLIB_DEFS_H)
-#define __HAS_BOOL__        /* Borland C++ 5.0 defines ibool type       */
-#endif
-#if (__BORLANDC__ >= 0x502) && !defined(VTOOLSD) && !defined(__SMX32__)
-#define __HAS_INT64__       /* Borland C++ 5.02 supports __int64 type   */
-#endif
-#endif
-
-#if defined(_MSC_VER) && !defined(__SC__) && !defined(VTOOLSD) && !defined(__SMX32__)
-#define __HAS_INT64__       /* Visual C++ supports __int64 type         */
-#endif
-
-#if defined(__WATCOMC__) && (__WATCOMC__ >= 1100) && !defined(VTOOLSD) && !defined(__SMX32__)
-#define __HAS_INT64__       /* Watcom C++ 11.0 supports __int64 type    */
-#endif
-
-/*---------------------------------------------------------------------------
- * Determine the compile time environment. This must be done for each
- * supported platform so that we can determine at compile time the target
- * environment, hopefully without requiring #define's from the user.
- *-------------------------------------------------------------------------*/
-
-/* 32-bit binary compatible driver. Compiled as Win32, but as OS neutral */
-#ifdef  __DRIVER__
-#ifndef __32BIT__
-#define __32BIT__
-#endif
-#undef  __WINDOWS__
-#undef  _WIN32
-#undef  __WIN32__
-#undef  __NT__
-
-/* 32-bit Snap exe or dll. Compiled as Win32, but as OS neutral */
-#elif   defined(__SNAP__)
-#ifndef __32BIT__
-#define __32BIT__
-#endif
-#undef  __WINDOWS__
-#undef  _WIN32
-#undef  __WIN32__
-#undef  __NT__
-
-/* 32-bit Windows VxD compile environment */
-#elif   defined(__vtoolsd_h_) || defined(VTOOLSD)
-#include <vtoolsc.h>
-#define __WIN32_VXD__
-#ifndef __32BIT__
-#define __32BIT__
-#endif
-#define _MAX_PATH   256
-#undef __WINDOWS32__
-
-/* 32-bit Windows NT driver compile environment: TODO!! */
-#elif   defined(__NT_DRIVER__)
-#include "ntdriver.h"
-#ifndef __32BIT__
-#define __32BIT__
-#endif
-#define _MAX_PATH   256
-#undef __WINDOWS32__
-
-/* 32-bit SMX compile environment */
-#elif   defined(__SMX32__)
-#ifndef __MSDOS__
-#define __MSDOS__
-#endif
-#ifndef __32BIT__
-#define __32BIT__
-#endif
-#ifndef __CONSOLE__
-#define __CONSOLE__
-#endif
-
-/* 32-bit Enea OSE environment */
-#elif   defined(__ENEA_OSE__)
-#ifndef __32BIT__
-#define __32BIT__
-#endif
-#ifndef __CONSOLE__
-#define __CONSOLE__
-#endif
-
-/* 32-bit RTTarget-32 environment */
-#elif   defined(__RTTARGET__)
-#ifndef __32BIT__
-#define __32BIT__
-#endif
-#ifndef __CONSOLE__
-#define __CONSOLE__
-#endif
-
-/* 32-bit extended DOS compile environment */
-#elif   defined(__MSDOS__) || defined(__MSDOS32__) || defined(__DOS__) || defined(__DPMI32__) || (defined(M_I86) && (!defined(__SC386__) && !defined(M_I386))) || defined(TNT)
-#ifndef __MSDOS__
-#define __MSDOS__
-#endif
-#if     defined(__MSDOS32__) || defined(__386__) || defined(__FLAT__) || defined(__NT__) || defined(__SC386__)
-#ifndef __MSDOS32__
-#define __MSDOS32__
-#endif
-#ifndef __32BIT__
-#define __32BIT__
-#endif
-#ifndef __REALDOS__
-#define __REALDOS__
-#endif
-#ifndef __CONSOLE__
-#define __CONSOLE__
-#endif
-
-/* 16-bit Windows compile environment */
-#elif   (defined(_Windows) || defined(_WINDOWS)) && !defined(__DPMI16__)
-#ifndef __16BIT__
-#define __16BIT__
-#endif
-#ifndef __WINDOWS16__
-#define __WINDOWS16__
-#endif
-#ifndef __WINDOWS__
-#define __WINDOWS__
-#endif
-#ifndef __MSDOS__
-#define __MSDOS__
-#endif
-
-/* 16-bit DOS compile environment */
-#else
-#ifndef __16BIT__
-#define __16BIT__
-#endif
-#ifndef __MSDOS16__
-#define __MSDOS16__
-#endif
-#ifndef __REALDOS__
-#define __REALDOS__
-#endif
-#ifndef __CONSOLE__
-#define __CONSOLE__
-#endif
-#endif
-
-/* 32-bit Windows compile environment */
-#elif   defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
-#ifndef __32BIT__
-#define __32BIT__
-#endif
-#ifndef __WINDOWS32__
-#define __WINDOWS32__
-#endif
-#ifndef _WIN32
-#define _WIN32                  /* Microsoft Win32 SDK headers use _WIN32 */
-#endif
-#ifndef WIN32
-#define WIN32                   /* OpenGL headers use WIN32 */
-#endif
-#ifndef __WINDOWS__
-#define __WINDOWS__
-#endif
-
-/* 32-bit OS/2 VDD compile environment */
-/* We're assuming (for now) that CL386 must be used */
-#elif   defined(MSDOS) && defined(M_I386)
-/* fixes necessary to compile with CL386 */
-#define __cdecl  _cdecl
-typedef unsigned int size_t;
-
-#include <mvdm.h>
-
-/* This should probably be somewhere else...                 */
-/* Inline eligible functions (we have no CRT libs for CL386) */
-#pragma intrinsic (strcpy, strcmp, strlen, strcat)
-#pragma intrinsic (memcmp, memcpy, memset)
-
-#define __OS2_VDD__
-#ifndef __32BIT__
-#define __32BIT__
-#endif
-#define CCHMAXPATH  256
-#define _MAX_PATH   256
-#ifndef __OS2__
-#define __OS2__
-#endif
-#ifndef __OS2_32__
-#define __OS2_32__
-#endif
-
-/* 16-bit OS/2 compile environment */
-#elif   defined(__OS2_16__)
-#ifndef __OS2__
-#define __OS2__
-#endif
-#ifndef __16BIT__
-#define __16BIT__
-#endif
-#ifndef __OS2_PM__
-#ifndef __CONSOLE__
-#define __CONSOLE__
-#endif
-#endif
-
-/* 32-bit OS/2 compile environment */
-#elif   defined(__OS2__) || defined(__OS2_32__)
-#ifndef __OS2__
-#define __OS2__
-#endif
-#ifndef __OS2_32__
-#define __OS2_32__
-#endif
-#ifndef __32BIT__
-#define __32BIT__
-#endif
-#ifndef __OS2_PM__
-#ifndef __CONSOLE__
-#define __CONSOLE__
-#endif
-#endif
-
-/* 32-bit QNX compile environment */
-#elif   defined(__QNX__)
-#ifndef __32BIT__
-#define __32BIT__
-#endif
-#ifndef __UNIX__
-#define __UNIX__
-#endif
-#ifdef  __GNUC__
-#define stricmp strcasecmp
-#endif
-#if !defined(__PHOTON__) && !defined(__X11__)
-#ifndef __CONSOLE__
-#define __CONSOLE__
-#endif
-#endif
-
-/* 32-bit Linux compile environment */
-#elif   defined(__LINUX__) || defined(linux)
-#ifndef __LINUX__
-#define __LINUX__
-#endif
-#ifndef __32BIT__
-#define __32BIT__
-#endif
-#ifndef __UNIX__
-#define __UNIX__
-#endif
-#ifdef  __GNUC__
-#define stricmp strcasecmp
-#endif
-#ifndef __X11__
-#ifndef __CONSOLE__
-#define __CONSOLE__
-#endif
-#endif
-
-/* 32-bit FreeBSD compile environment */
-#elif   defined(__FREEBSD__)
-#ifndef __FREEBSD__
-#define __FREEBSD__
-#endif
-#ifndef __32BIT__
-#define __32BIT__
-#endif
-#ifndef __UNIX__
-#define __UNIX__
-#endif
-#ifdef  __GNUC__
-#define stricmp strcasecmp
-#endif
-#ifndef __X11__
-#ifndef __CONSOLE__
-#define __CONSOLE__
-#endif
-#endif
-
-/* 32-bit BeOS compile environment */
-#elif   defined(__BEOS__)
-#ifndef __32BIT__
-#define __32BIT__
-#endif
-#ifndef __UNIX__
-#define __UNIX__
-#endif
-#ifdef  __GNUC__
-#define stricmp strcasecmp
-#endif
-
-/* Unsupported OS! */
-#else
-#error  This platform is not currently supported!
-#endif
-
-/* Determine the CPU type that we are compiling for */
-
-#if     defined(__M_ALPHA) || defined(__ALPHA_) || defined(__ALPHA) || defined(__alpha)
-#ifndef __ALPHA__
-#define __ALPHA__
-#endif
-#elif   defined(__M_PPC) || defined(__POWERC)
-#ifndef __PPC__
-#define __PPC__
-#endif
-#elif   defined(__M_MRX000)
-#ifndef __MIPS__
-#define __MIPS__
-#endif
-#else
-#ifndef __INTEL__
-#define __INTEL__               /* Assume Intel if nothing found */
-#endif
-#endif
-
-/* We have the following defines to define the calling conventions for
- * publicly accesible functions:
- *
- *  _PUBAPI  - Compiler default calling conventions for all public 'C' functions
- *  _ASMAPI  - Calling conventions for all public assembler functions
- *  _VARAPI  - Modifiers for variables; Watcom C++ mangles C++ globals
- *  _STDCALL - Win32 __stdcall where possible, __cdecl if not supported
- */
-
-#if defined(_MSC_VER) && defined(_WIN32) && !defined(__SC__)
-#define __PASCAL    __stdcall
-#else
-#define __PASCAL    __pascal
-#endif
-
-#if defined(NO_STDCALL)
-#define _STDCALL    __cdecl
-#else
-#define _STDCALL    __stdcall
-#endif
-
-#ifdef  __WATCOMC__
-#if (__WATCOMC__ >= 1050)
-#define _VARAPI     __cdecl
-#else
-#define _VARAPI
-#endif
-#else
-#define _VARAPI
-#endif
-
-#if defined(__IBMC__) || defined(__IBMCPP__)
-#define PTR_DECL_IN_FRONT
-#endif
-
-/* Define the calling conventions for all public functions. For simplicity
- * we define all public functions as __cdecl calling conventions, so that
- * they are the same across all compilers and runtime DLL's.
- */
-
-#define _PUBAPI __cdecl
-#define _ASMAPI __cdecl
-
-/* Determine the syntax for declaring a function pointer with a
- * calling conventions override. Most compilers require the calling
- * convention to be declared in front of the '*', but others require
- * it to be declared after the '*'. We handle both in here depending
- * on what the compiler requires.
- */
-
-#ifdef  PTR_DECL_IN_FRONT
-#define _PUBAPIP    * _PUBAPI
-#define _ASMAPIP    * _ASMAPI
-#else
-#define _PUBAPIP    _PUBAPI *
-#define _ASMAPIP    _ASMAPI *
-#endif
-
-/* Useful macros */
-
-#define PRIVATE static
-#define PUBLIC
-
-/* This HAS to be 0L for 16-bit real mode code to work!!! */
-
-#ifndef NULL
-#       define _NULL 0L
-#       define NULL _NULL
-#endif
-
-#ifndef MAX
-#       define MAX(a,b) ( ((a) > (b)) ? (a) : (b))
-#endif
-#ifndef MIN
-#       define MIN(a,b) ( ((a) < (b)) ? (a) : (b))
-#endif
-#ifndef ABS
-#       define ABS(a)   ((a) >= 0 ? (a) : -(a))
-#endif
-#ifndef SIGN
-#       define SIGN(a)  ((a) > 0 ? 1 : -1)
-#endif
-
-/* General typedefs */
-
-#ifndef __GENDEFS
-#define __GENDEFS
-#if defined(__BEOS__)
-#include <SupportDefs.h>
-#else
-#ifdef __LINUX__
-#include <sys/types.h>
-#ifdef __STRICT_ANSI__
-typedef unsigned short      ushort;
-typedef unsigned long       ulong;
-typedef unsigned int        uint;
-#endif
-#ifdef  __KERNEL__
-#define __GENDEFS_2
-#endif
-#else
-#if !(defined(__QNXNTO__) && defined(GENERAL_STRUCT))
-typedef unsigned short      ushort;
-typedef unsigned long       ulong;
-#endif
-typedef unsigned int        uint;
-#endif
-typedef unsigned char       uchar;
-#endif
-typedef int                 ibool;      /* Integer boolean type         */
-#ifdef  USE_BOOL                        /* Only for older code          */
-#ifndef __cplusplus
-#define bool                ibool       /* Standard C                   */
-#else
-#ifndef __HAS_BOOL__
-#define bool                ibool       /* Older C++ compilers          */
-#endif
-#endif  /* __cplusplus */
-#endif  /* USE_BOOL */
-#endif  /* __GENDEFS */
-
-/* More general typedefs compatible with Linux kernel code */
-
-#ifndef __GENDEFS_2
-#define __GENDEFS_2
-typedef char                s8;
-typedef unsigned char       u8;
-typedef short               s16;
-typedef unsigned short      u16;
-#ifdef  __16BIT__
-typedef long                s32;
-typedef unsigned long       u32;
-#else
-typedef int                 s32;
-typedef unsigned int        u32;
-#endif
-typedef struct {
-    u32 low;
-    s32 high;
-    } __i64;
-#ifdef  __HAS_LONG_LONG__
-#define __NATIVE_INT64__
-typedef long long           s64;
-typedef unsigned long long  u64;
-#elif   defined(__HAS_INT64__) && !defined(__16BIT__)
-#define __NATIVE_INT64__
-typedef __int64             s64;
-typedef unsigned __int64    u64;
-#else
-typedef __i64               s64;
-typedef __i64               u64;
-#endif
-#endif
-
-/* Boolean truth values */
-
-#undef  false
-#undef  true
-#undef  NO
-#undef  YES
-#undef  FALSE
-#undef  TRUE
-#define false       0
-#define true        1
-#define NO          0
-#define YES         1
-#define FALSE       0
-#define TRUE        1
-
-/* Inline debugger interrupts for Watcom C++ and Borland C++ */
-
-#ifdef  __WATCOMC__
-void DebugInt(void);
-#pragma aux DebugInt =              \
-    "int    3";
-void DebugVxD(void);
-#pragma aux DebugVxD =              \
-    "int    1";
-#elif   defined(__BORLANDC__)
-#define DebugInt()  __emit__(0xCC)
-#define DebugVxD()  {__emit__(0xCD); __emit__(0x01);}
-#elif   defined(_MSC_VER)
-#define DebugInt()  _asm int 0x3
-#define DebugVxD()  _asm int 0x1
-#elif   defined(__GNUC__)
-#define DebugInt()  asm volatile ("int $0x3")
-#define DebugVxD()  asm volatile ("int $0x1")
-#else
-void _ASMAPI DebugInt(void);
-void _ASMAPI DebugVxD(void);
-#endif
-
-/* Macros to break once and never break again */
-
-#define DebugIntOnce()              \
-{                                   \
-    static ibool firstTime = true;  \
-    if (firstTime) {                \
-       firstTime = false;          \
-       DebugInt();                 \
-       }                           \
-}
-
-#define DebugVxDOnce()              \
-{                                   \
-    static ibool firstTime = true;  \
-    if (firstTime) {                \
-       firstTime = false;          \
-       DebugVxD();                 \
-       }                           \
-}
-
-/* Macros for linux string compatibility functions */
-
-#ifdef  __LINUX__
-#define stricmp strcasecmp
-#define strnicmp strncasecmp
-#endif
-
-/* Macros for NT driver string compatibility functions */
-
-#ifdef __NT_DRIVER__
-#define stricmp _stricmp
-#define strnicmp _strnicmp
-#endif
-
-/* Get rid of some helaciously annoying Visual C++ warnings! */
-
-#if defined(_MSC_VER) && !defined(__MWERKS__) && !defined(__SC__)
-#pragma warning(disable:4761)   /* integral size mismatch in argument; conversion supplied */
-#pragma warning(disable:4244)   /* conversion from 'unsigned short ' to 'unsigned char ', possible loss of data */
-#pragma warning(disable:4018)   /* '<' : signed/unsigned mismatch */
-#pragma warning(disable:4305)   /* 'initializing' : truncation from 'const double' to 'float' */
-#endif
-
-/*---------------------------------------------------------------------------
- * Set of debugging macros used by the libraries. If the debug flag is
- * set, they are turned on depending on the setting of the flag. User code
- * can override the default functions called when a check fails, and the
- * MGL does this so it can restore the system from graphics mode to display
- * an error message. These functions also log information to the
- * scitech.log file in the root directory of the hard drive when problems
- * show up.
- *
- * If you set the value of CHECKED to be 2, it will also enable code to
- * insert hard coded debugger interrupt into the source code at the line of
- * code where the check fail. This is useful if you run the code under a
- * debugger as it will break inside the debugger before exiting with a
- * failure condition.
- *
- * Also for code compiled to run under Windows, we also call the
- * OutputDebugString function to send the message to the system debugger
- * such as Soft-ICE or WDEB386. Hence if you get any non-fatal warnings you
- * will see those on the debugger terminal as well as in the log file.
- *-------------------------------------------------------------------------*/
-
-#ifdef  __cplusplus
-extern "C" {            /* Use "C" linkage when in C++ mode */
-#endif
-
-extern void (*_CHK_fail)(int fatal,const char *msg,const char *cond,const char *file,int line);
-void _CHK_defaultFail(int fatal,const char *msg,const char *cond,const char *file,int line);
-
-#ifdef  CHECKED
-#       define  CHK(x)      x
-#if     CHECKED > 1
-#       define  CHECK(p)                                            \
-       ((p) ? (void)0 : DebugInt(),                                \
-           _CHK_fail(1,"Check failed: '%s', file %s, line %d\n",   \
-           #p, __FILE__, __LINE__))
-#       define  WARN(p)                                             \
-       ((p) ? (void)0 : DebugInt(),                                \
-           _CHK_fail(0,"Warning: '%s', file %s, line %d\n",        \
-           #p, __FILE__, __LINE__))
-#else
-#       define  CHECK(p)                                            \
-       ((p) ? (void)0 :                                            \
-           _CHK_fail(1,"Check failed: '%s', file %s, line %d\n",   \
-           #p, __FILE__, __LINE__))
-#       define  WARN(p)                                             \
-       ((p) ? (void)0 :                                            \
-           _CHK_fail(0,"Warning: '%s', file %s, line %d\n",        \
-           #p, __FILE__, __LINE__))
-#endif
-#       define  LOGFATAL(msg)                                       \
-           _CHK_fail(1,"Fatal error: '%s', file %s, line %d\n",    \
-           msg, __FILE__, __LINE__)
-#       define  LOGWARN(msg)                                        \
-           _CHK_fail(0,"Warning: '%s', file %s, line %d\n",        \
-           msg, __FILE__, __LINE__)
-#else
-#       define  CHK(x)
-#       define  CHECK(p)        ((void)0)
-#       define  WARN(p)         ((void)0)
-#       define  LOGFATAL(msg)   ((void)0)
-#       define  LOGWARN(msg)    ((void)0)
-#endif
-
-#ifdef  __cplusplus
-}                       /* End of "C" linkage for C++   */
-#endif
-
-#endif  /* __SCITECH_H */
diff --git a/board/MAI/bios_emulator/scitech/include/scitech.mac b/board/MAI/bios_emulator/scitech/include/scitech.mac
deleted file mode 100644 (file)
index 27a2fc0..0000000
+++ /dev/null
@@ -1,1321 +0,0 @@
-;****************************************************************************
-;*
-;*  ========================================================================
-;*
-;*    The contents of this file are subject to the SciTech MGL Public
-;*    License Version 1.0 (the "License"); you may not use this file
-;*    except in compliance with the License. You may obtain a copy of
-;*    the License at http://www.scitechsoft.com/mgl-license.txt
-;*
-;*    Software distributed under the License is distributed on an
-;*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-;*    implied. See the License for the specific language governing
-;*    rights and limitations under the License.
-;*
-;*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-;*
-;*    The Initial Developer of the Original Code is SciTech Software, Inc.
-;*    All Rights Reserved.
-;*
-;*  ========================================================================
-;*
-;* Language:    NetWide Assembler (NASM) or Turbo Assembler (TASM)
-;* Environment: Any Intel Environment
-;*
-;* Description: Macros to provide memory model independant assembly language
-;*              module for C programming. Supports the large and flat memory
-;*              models.
-;*
-;*              The defines that you should use when assembling modules that
-;*              use this macro package are:
-;*
-;*                  __LARGE__   Assemble for 16-bit large model
-;*                  __FLAT__    Assemble for 32-bit FLAT memory model
-;*                  __NOU__     No underscore for all external C labels
-;*                  __NOU_VAR__ No underscore for global variables only
-;*
-;*              The default settings are for 16-bit large memory model with
-;*              leading underscores for symbol names.
-;*
-;*              The main intent of the macro file is to enable programmers
-;*              to write _one_ set of source that can be assembled to run
-;*              in either 16 bit real and protected modes or 32 bit
-;*              protected mode without the need to riddle the code with
-;*              'if flatmodel' style conditional assembly (it is still there
-;*              but nicely hidden by a macro layer that enhances the
-;*              readability and understandability of the resulting code).
-;*
-;****************************************************************************
-
-; Include the appropriate version in here depending on the assembler. NASM
-; appears to always try and parse code, even if it is in a non-compiling
-; block of a ifdef expression, and hence crashes if we include the TASM
-; macro package in the same header file. Hence we split the macros up into
-; two separate header files.
-
-ifdef __NASM_MAJOR__
-
-;============================================================================
-; Macro package when compiling with NASM.
-;============================================================================
-
-; Turn off underscores for globals if disabled for all externals
-
-%ifdef  __NOU__
-%define __NOU_VAR__
-%endif
-
-; Define the __WINDOWS__ symbol if we are compiling for any Windows
-; environment
-
-%ifdef  __WINDOWS16__
-%define __WINDOWS__         1
-%endif
-%ifdef  __WINDOWS32__
-%define __WINDOWS__         1
-%define __WINDOWS32_386__   1
-%endif
-
-; Macros for accessing 'generic' registers
-
-%ifdef  __FLAT__
-%idefine _ax    eax
-%idefine _bx    ebx
-%idefine _cx    ecx
-%idefine _dx    edx
-%idefine _si    esi
-%idefine _di    edi
-%idefine _bp    ebp
-%idefine _sp    esp
-%idefine _es
-%idefine UCHAR  BYTE        ; Size of a character
-%idefine USHORT WORD        ; Size of a short
-%idefine UINT   DWORD       ; Size of an integer
-%idefine ULONG  DWORD       ; Size of a long
-%idefine BOOL   DWORD       ; Size of a boolean
-%idefine DPTR   DWORD       ; Size of a data pointer
-%idefine FDPTR  FWORD       ; Size of a far data pointer
-%idefine NDPTR  DWORD       ; Size of a near data pointer
-%idefine CPTR   DWORD       ; Size of a code pointer
-%idefine FCPTR  FWORD       ; Size of a far code pointer
-%idefine NCPTR  DWORD       ; Size of a near code pointer
-%idefine FPTR   NEAR        ; Distance for function pointers
-%idefine DUINT  dd          ; Declare a integer variable
-%idefine intsize 4
-%idefine flatmodel 1
-%else
-%idefine _ax    ax
-%idefine _bx    bx
-%idefine _cx    cx
-%idefine _dx    dx
-%idefine _si    si
-%idefine _di    di
-%idefine _bp    bp
-%idefine _sp    sp
-%idefine _es    es:
-%idefine UCHAR  BYTE        ; Size of a character
-%idefine USHORT WORD        ; Size of a short
-%idefine UINT   WORD        ; Size of an integer
-%idefine ULONG  DWORD       ; Size of a long
-%idefine BOOL   WORD        ; Size of a boolean
-%idefine DPTR   DWORD       ; Size of a data pointer
-%idefine FDPTR  DWORD       ; Size of a far data pointer
-%idefine NDPTR  WORD        ; Size of a near data pointer
-%idefine CPTR   DWORD       ; Size of a code pointer
-%idefine FCPTR  DWORD       ; Size of a far code pointer
-%idefine NCPTR  WORD        ; Size of a near code pointer
-%idefine FPTR   FAR         ; Distance for function pointers
-%idefine DUINT  dw          ; Declare a integer variable
-%idefine intsize 2
-%endif
-%idefine invert ~
-%idefine offset
-%idefine use_nasm
-
-; Convert all jumps to near jumps, since NASM does not so this automatically
-
-%idefine jo     jo near
-%idefine jno    jno near
-%idefine jz     jz near
-%idefine jnz    jnz near
-%idefine je     je near
-%idefine jne    jne near
-%idefine jb     jb  near
-%idefine jbe    jbe near
-%idefine ja     ja  near
-%idefine jae    jae near
-%idefine jl     jl  near
-%idefine jle    jle near
-%idefine jg     jg  near
-%idefine jge    jge near
-%idefine jc     jc  near
-%idefine jnc    jnc near
-%idefine js     js  near
-%idefine jns    jns near
-
-%ifdef  DOUBLE
-%idefine    REAL    QWORD
-%idefine    DREAL   dq
-%else
-%idefine    REAL    DWORD
-%idefine    DREAL   dd
-%endif
-
-; Boolean truth values (same as those in debug.h)
-
-%idefine False      0
-%idefine True       1
-%idefine No         0
-%idefine Yes        1
-%idefine Yes        1
-
-; Macro to be invoked at the start of all modules to set up segments for
-; later use. Does nothing for NASM.
-
-%imacro header 1
-%endmacro
-
-; Macro to begin a data segment
-
-%imacro begdataseg 1
-%ifdef __GNUC__
-segment .data public class=DATA use32 flat
-%else
-%ifdef flatmodel
-segment _DATA public align=4 class=DATA use32 flat
-%else
-segment _DATA public align=4 class=DATA use16
-%endif
-%endif
-%endmacro
-
-; Macro to end a data segment
-
-%imacro enddataseg 1
-%endmacro
-
-; Macro to begin a code segment
-
-%imacro begcodeseg 1
-%ifdef __PIC__
-%ifdef __LINUX__
-        extern _GLOBAL_OFFSET_TABLE_
-%else
-        extern __GLOBAL_OFFSET_TABLE_
-%endif
-%endif
-%ifdef __GNUC__
-segment .text public class=CODE use32 flat
-%else
-%ifdef flatmodel
-segment _TEXT public align=16 class=CODE use32 flat
-%else
-segment %1_TEXT public align=16 class=CODE use16
-%endif
-%endif
-%endmacro
-
-; Macro to begin a near code segment
-
-%imacro begcodeseg_near 0
-%ifdef __GNUC__
-segment .text public class=CODE use32 flat
-%else
-%ifdef flatmodel
-segment _TEXT public align=16 class=CODE use32 flat
-%else
-segment _TEXT public align=16 class=CODE use16
-%endif
-%endif
-%endmacro
-
-; Macro to end a code segment
-
-%imacro endcodeseg 1
-%endmacro
-
-; Macro to end a near code segment
-
-%imacro endcodeseg_near 0
-%endmacro
-
-; Macro for an extern C symbol. If the C compiler requires leading
-; underscores, then the underscores are added to the symbol names, otherwise
-; they are left off. The symbol name is referenced in the assembler code
-; using the non-underscored symbol name.
-
-%imacro cextern 2
-%ifdef  __NOU_VAR__
-extern %1
-%else
-extern _%1
-%define %1 _%1
-%endif
-%endmacro
-
-%imacro cexternfunc 2
-%ifdef  __NOU__
-extern %1
-%else
-extern _%1
-%define %1 _%1
-%endif
-%endmacro
-
-; Macro for a public C symbol. If the C compiler requires leading
-; underscores, then the underscores are added to the symbol names, otherwise
-; they are left off. The symbol name is referenced in the assembler code
-; using the non-underscored symbol name.
-
-%imacro cpublic 1
-%ifdef  __NOU_VAR__
-global %1
-%1:
-%else
-global _%1
-_%1:
-%define %1 _%1
-%endif
-%endmacro
-
-; Macro for an global C symbol. If the C compiler requires leading
-; underscores, then the underscores are added to the symbol names, otherwise
-; they are left off. The symbol name is referenced in the assembler code
-; using the non-underscored symbol name.
-
-%imacro cglobal 1
-%ifdef  __NOU_VAR__
-global %1
-%else
-global _%1
-%define %1 _%1
-%endif
-%endmacro
-
-; Macro for an global C function symbol. If the C compiler requires leading
-; underscores, then the underscores are added to the symbol names, otherwise
-; they are left off. The symbol name is referenced in the assembler code
-; using the non-underscored symbol name.
-
-%imacro cglobalfunc 1
-%ifdef __PIC__
-global %1:function
-%else
-%ifdef  __NOU__
-global %1
-%else
-global _%1
-%define %1 _%1
-%endif
-%endif
-%endmacro
-
-; Macro to start a C callable function. This will be a far function for
-; 16-bit code, and a near function for 32-bit code.
-
-%imacro cprocstatic 1
-%push cproc
-%1:
-%ifdef flatmodel
-%stacksize flat
-%define ret retn
-%else
-%stacksize large
-%define ret retf
-%endif
-%assign %$localsize 0
-%endmacro
-
-%imacro cprocstart 1
-%push cproc
-    cglobalfunc %1
-%1:
-%ifdef flatmodel
-%stacksize flat
-%define ret retn
-%else
-%stacksize large
-%define ret retf
-%endif
-%assign %$localsize 0
-%endmacro
-
-; This macro sets up a procedure to be exported from a 16 bit DLL. Since the
-; calling conventions are always _far _pascal for 16 bit DLL's, we actually
-; rename this routine with an extra underscore with 'C' calling conventions
-; and a small DLL stub will be provided by the high level code to call the
-; assembler routine.
-
-%imacro cprocstartdll16 1
-%ifdef  __WINDOWS16__
-cprocstart  _%1
-%else
-cprocstart  %1
-%endif
-%endmacro
-
-; Macro to start a C callable near function.
-
-%imacro cprocnear 1
-%push cproc
-    cglobalfunc %1
-%1:
-%define ret retn
-%ifdef flatmodel
-%stacksize flat
-%else
-%stacksize small
-%endif
-%assign %$localsize 0
-%endmacro
-
-; Macro to start a C callable far function.
-
-%imacro cprocfar 1
-%push cproc
-    cglobalfunc %1
-%1:
-%define ret retf
-%ifdef flatmodel
-%stacksize flat
-%else
-%stacksize large
-%endif
-%assign %$localsize 0
-%endmacro
-
-; Macro to end a C function
-
-%imacro cprocend 0
-%pop
-%endmacro
-
-; Macros for entering and exiting C callable functions. Note that we must
-; always save and restore the SI and DI registers for C functions, and for
-; 32 bit C functions we also need to save and restore EBX and clear the
-; direction flag.
-
-%imacro enter_c 0
-        push    _bp
-        mov     _bp,_sp
-%ifnidn %$localsize,0
-        sub     _sp,%$localsize
-%endif
-%ifdef  flatmodel
-        push    ebx
-%endif
-        push    _si
-        push    _di
-%endmacro
-
-%imacro leave_c 0
-        pop     _di
-        pop     _si
-%ifdef  flatmodel
-        pop     ebx
-        cld
-%endif
-%ifnidn %$localsize,0
-        mov     _sp,_bp
-%endif
-        pop     _bp
-%endmacro
-
-%imacro   use_ebx 0
-%ifdef flatmodel
-        push    ebx
-%endif
-%endmacro
-
-%imacro   unuse_ebx 0
-%ifdef flatmodel
-        pop     ebx
-%endif
-%endmacro
-
-; Macros for saving and restoring the value of DS,ES,FS,GS when it is to
-; be used in assembly routines. This evaluates to nothing in the flat memory
-; model, but is saves and restores DS in the large memory model.
-
-%imacro use_ds 0
-%ifndef flatmodel
-        push    ds
-%endif
-%endmacro
-
-%imacro unuse_ds 0
-%ifndef flatmodel
-        pop     ds
-%endif
-%endmacro
-
-%imacro use_es 0
-%ifndef flatmodel
-        push    es
-%endif
-%endmacro
-
-%imacro unuse_es 0
-%ifndef flatmodel
-        pop     es
-%endif
-%endmacro
-
-; Macros for loading the address of a data pointer into a segment and
-; index register pair. The %imacro explicitly loads DS or ES in the 16 bit
-; memory model, or it simply loads the offset into the register in the flat
-; memory model since DS and ES always point to all addressable memory. You
-; must use the correct _REG (ie: _BX) %imacros for documentation purposes.
-
-%imacro _lds    2
-%ifdef flatmodel
-        mov     %1,%2
-%else
-        lds     %1,%2
-%endif
-%endmacro
-
-%imacro   _les  2
-%ifdef flatmodel
-        mov     %1,%2
-%else
-        les     %1,%2
-%endif
-%endmacro
-
-; Macros for adding and subtracting a value from registers. Two value are
-; provided, one for 16 bit modes and another for 32 bit modes (the extended
-; register is used in 32 bit modes).
-
-%imacro   _add  3
-%ifdef flatmodel
-        add     e%1, %3
-%else
-        add     %1, %2
-%endif
-%endmacro
-
-%imacro _sub    3
-%ifdef flatmodel
-        sub     e%1, %3
-%else
-        sub     %1, %2
-%endif
-%endmacro
-
-; Macro to clear the high order word for the 32 bit extended registers.
-; This is used to convert an unsigned 16 bit value to an unsigned 32 bit
-; value, and will evaluate to nothing in 16 bit modes.
-
-%imacro clrhi   1
-%ifdef  flatmodel
-        movzx   e%1,%1
-%endif
-%endmacro
-
-%imacro sgnhi   1
-%ifdef  flatmodel
-        movsx   e%1,%1
-%endif
-%endmacro
-
-; Macro to load an extended register with an integer value in either mode
-
-%imacro loadint 2
-%ifdef flatmodel
-        mov     e%1,%2
-%else
-        xor     e%1,e%1
-        mov     %1,%2
-%endif
-%endmacro
-
-; Macros to load and store integer values with string instructions
-
-%imacro LODSINT 0
-%ifdef flatmodel
-        lodsd
-%else
-        lodsw
-%endif
-%endmacro
-
-%imacro STOSINT 0
-%ifdef flatmodel
-        stosd
-%else
-        stosw
-%endif
-%endmacro
-
-; Macros to provide resb, resw, resd compatibility with NASM
-
-%imacro dclb 1
-times %1 db 0
-%endmacro
-
-%imacro dclw 1
-times %1 dw 0
-%endmacro
-
-%imacro dcld 1
-times %1 dd 0
-%endmacro
-
-; Macro to get the addres of the GOT for Linux/FreeBSD shared
-; libraries into the EBX register.
-
-%imacro     get_GOT 1
-            call    %%getgot
-%%getgot:   pop     %1
-            add     %1,_GLOBAL_OFFSET_TABLE_+$$-%%getgot wrt ..gotpc
-%endmacro
-
-; Macro to get the address of a *local* variable that is global to
-; a single module in a manner that will work correctly when compiled
-; into a Linux shared library. Note that this will *not* work for
-; variables that are defined as global to all modules. For that
-; use the LEA_G macro
-
-%macro      LEA_L    2
-%ifdef __PIC__
-        get_GOT %1
-        lea     %1,[%1+%2 wrt ..gotoff]
-%else
-        lea     %1,[%2]
-%endif
-%endmacro
-
-; Same macro as above but for global variables public to *all*
-; modules.
-
-%macro      LEA_G    2
-%ifdef __PIC__
-        get_GOT %1
-        mov     %1,[%1+%2 wrt ..got]
-%else
-        lea     %1,[%2]
-%endif
-%endmacro
-
-; macros to declare assembler function stubs for function structures
-
-%imacro BEGIN_STUBS_DEF 2
-begdataseg  _STUBS
-%ifdef  __NOU_VAR__
-extern %1
-%define STUBS_START %1
-%else
-extern _%1
-%define STUBS_START _%1
-%endif
-enddataseg  _STUBS
-begcodeseg  _STUBS
-%assign off %2
-%endmacro
-
-%imacro   DECLARE_STUB  1
-%ifdef __PIC__
-        global %1:function
-%1:
-        get_GOT eax
-        mov     eax,[eax+STUBS_START wrt ..got]
-        jmp     [eax+off]
-%else
-%ifdef  __NOU__
-        global %1
-%1:
-%else
-        global _%1
-_%1:
-%endif
-        jmp     [DWORD STUBS_START+off]
-%endif
-%assign off off+4
-%endmacro
-
-%imacro   SKIP_STUB  1
-%assign off off+4
-%endmacro
-
-%imacro DECLARE_STDCALL 2
-%ifdef  STDCALL_MANGLE
-        global _%1@%2
-_%1@%2:
-%else
-%ifdef STDCALL_USCORE
-        global _%1
-_%1:
-%else
-        global %1
-%1:
-%endif
-%endif
-        jmp     [DWORD STUBS_START+off]
-%assign off off+4
-%endmacro
-
-%imacro   END_STUBS_DEF 0
-endcodeseg  _STUBS
-%endmacro
-
-; macros to declare assembler import stubs for binary loadable drivers
-
-%imacro BEGIN_IMPORTS_DEF   1
-BEGIN_STUBS_DEF %1,4
-%endmacro
-
-%imacro   DECLARE_IMP   2
-DECLARE_STUB    %1
-%endmacro
-
-%imacro   SKIP_IMP   2
-SKIP_STUB    %1
-%endmacro
-
-%imacro   SKIP_IMP2   1
-DECLARE_STUB    %1
-%endmacro
-
-%imacro   SKIP_IMP3   1
-SKIP_STUB    %1
-%endmacro
-
-%imacro   END_IMPORTS_DEF 0
-END_STUBS_DEF
-%endmacro
-
-else    ; __NASM_MAJOR__
-
-;============================================================================
-; Macro package when compiling with TASM.
-;============================================================================
-
-; Turn off underscores for globals if disabled for all externals
-
-ifdef   __NOU__
-__NOU_VAR__         = 1
-endif
-
-; Define the __WINDOWS__ symbol if we are compiling for any Windows
-; environment
-
-ifdef   __WINDOWS16__
-__WINDOWS__         = 1
-endif
-ifdef   __WINDOWS32__
-__WINDOWS__         = 1
-__WINDOWS32_386__   = 1
-endif
-ifdef   __WIN386__
-__WINDOWS__         = 1
-__WINDOWS32_386__   = 1
-endif
-ifdef   __VXD__
-__WINDOWS__         = 1
-__WINDOWS32_386__   = 1
-        MASM
-        .386
-        NO_SEGMENTS = 1
-        include vmm.inc         ; IGNORE DEPEND
-        include vsegment.inc    ; IGNORE DEPEND
-        IDEAL
-endif
-
-; Macros for accessing 'generic' registers
-
-ifdef   __FLAT__
-        _ax         EQU eax     ; EAX is used for accumulator
-        _bx         EQU ebx     ; EBX is used for accumulator
-        _cx         EQU ecx     ; ECX is used for looping
-        _dx         EQU edx     ; EDX is used for data register
-        _si         EQU esi     ; ESI is the source index register
-        _di         EQU edi     ; EDI is the destination index register
-        _bp         EQU ebp     ; EBP is used for base pointer register
-        _sp         EQU esp     ; ESP is used for stack pointer register
-        _es         EQU         ; ES and DS are the same in 32 bit PM
-        typedef UCHAR BYTE      ; Size of a character
-        typedef USHORT WORD     ; Size of a short
-        typedef UINT DWORD      ; Size of an integer
-        typedef ULONG DWORD     ; Size of a long
-        typedef BOOL DWORD      ; Size of a boolean
-        typedef DPTR DWORD      ; Size of a data pointer
-        typedef FDPTR FWORD     ; Size of a far data pointer
-        typedef NDPTR DWORD     ; Size of a near data pointer
-        typedef CPTR DWORD      ; Size of a code pointer
-        typedef FCPTR FWORD     ; Size of a far code pointer
-        typedef NCPTR DWORD     ; Size of a near code pointer
-        typedef DUINT DWORD     ; Declare a integer variable
-        FPTR        EQU NEAR    ; Distance for function pointers
-        intsize     =   4       ; Size of an integer
-        flatmodel   =   1       ; This is a flat memory model
-        P386                    ; Turn on 386 code generation
-        MODEL       FLAT        ; Set up for 32 bit simplified FLAT model
-else
-        _ax         EQU ax      ; AX is used for accumulator
-        _bx         EQU bx      ; BX is used for accumulator
-        _cx         EQU cx      ; CX is used for looping
-        _dx         EQU dx      ; DX is used for data register
-        _si         EQU si      ; SI is the source index register
-        _di         EQU di      ; DI is the destination index register
-        _bp         EQU bp      ; BP is used for base pointer register
-        _sp         EQU sp      ; SP is used for stack pointer register
-        _es         EQU es:     ; ES is used for segment override
-        typedef UCHAR BYTE      ; Size of a character
-        typedef USHORT WORD     ; Size of a short
-        typedef UINT WORD       ; Size of an integer
-        typedef ULONG DWORD     ; Size of a long
-        typedef BOOL WORD       ; Size of a boolean
-        typedef DPTR DWORD      ; Size of a data pointer
-        typedef FDPTR DWORD     ; Size of a far data pointer
-        typedef NDPTR WORD      ; Size of a near data pointer
-        typedef CPTR DWORD      ; Size of a code pointer
-        typedef FCPTR DWORD     ; Size of a far code pointer
-        typedef NCPTR WORD      ; Size of a near code pointer
-        typedef DUINT WORD      ; Declare a integer variable
-        FPTR        EQU FAR     ; Distance for function pointers
-        intsize     =   2       ; Size of an integer
-        P386                    ; Turn on 386 code generation
-endif
-        invert      EQU not
-
-; Provide a typedef for real floating point numbers
-
-ifdef   DOUBLE
-typedef REAL    QWORD
-typedef DREAL   QWORD
-else
-typedef REAL    DWORD
-typedef DREAL   DWORD
-endif
-
-; Macros to access the floating point stack registers to convert them
-; from NASM style to TASM style
-
-st0         EQU     st(0)
-st1         EQU     st(1)
-st2         EQU     st(2)
-st3         EQU     st(3)
-st4         EQU     st(4)
-st5         EQU     st(5)
-st6         EQU     st(6)
-st7         EQU     st(7)
-st8         EQU     st(8)
-
-; Boolean truth values (same as those in debug.h)
-
-ifndef  __VXD__
-False       =       0
-True        =       1
-No          =       0
-Yes         =       1
-Yes         =       1
-endif
-
-; Macros for the _DATA data segment. This segment contains initialised data.
-
-MACRO   begdataseg name
-ifdef   __VXD__
-        MASM
-VXD_LOCKED_DATA_SEG
-        IDEAL
-else
-ifdef   flatmodel
-        DATASEG
-else
-SEGMENT _DATA DWORD PUBLIC USE16 'DATA'
-endif
-endif
-ENDM
-
-MACRO   enddataseg name
-ifdef   __VXD__
-        MASM
-VXD_LOCKED_DATA_ENDS
-        IDEAL
-else
-ifndef  flatmodel
-ENDS    _DATA
-endif
-endif
-ENDM
-
-; Macro for the main code segment.
-
-MACRO   begcodeseg name
-ifdef   __VXD__
-        MASM
-VXD_LOCKED_CODE_SEG
-        IDEAL
-else
-ifdef   flatmodel
-        CODESEG
-        ASSUME  CS:FLAT,DS:FLAT,SS:FLAT
-else
-SEGMENT &name&_TEXT PARA PUBLIC USE16 'CODE'
-        ASSUME CS:&name&_TEXT,DS:_DATA
-endif
-endif
-ENDM
-
-; Macro for a near code segment
-
-MACRO   begcodeseg_near
-ifdef   flatmodel
-        CODESEG
-        ASSUME  CS:FLAT,DS:FLAT,SS:FLAT
-else
-SEGMENT _TEXT PARA PUBLIC USE16 'CODE'
-        ASSUME CS:_TEXT,DS:_DATA
-endif
-ENDM
-
-MACRO   endcodeseg name
-ifdef   __VXD__
-        MASM
-VXD_LOCKED_CODE_ENDS
-        IDEAL
-else
-ifndef  flatmodel
-ENDS    &name&_TEXT
-endif
-endif
-ENDM
-
-MACRO   endcodeseg_near
-ifndef  flatmodel
-ENDS    _TEXT
-endif
-ENDM
-
-; Macro to be invoked at the start of all modules to set up segments for
-; later use.
-
-MACRO   header name
-begdataseg name
-enddataseg name
-ENDM
-
-; Macro for an extern C symbol. If the C compiler requires leading
-; underscores, then the underscores are added to the symbol names, otherwise
-; they are left off. The symbol name is referenced in the assembler code
-; using the non-underscored symbol name.
-
-MACRO   cextern name,size
-ifdef   __NOU_VAR__
-        EXTRN   name:size
-else
-        EXTRN   _&name&:size
-name    EQU     _&name&
-endif
-ENDM
-
-MACRO   cexternfunc name,size
-ifdef   __NOU__
-        EXTRN   name:size
-else
-        EXTRN   _&name&:size
-name    EQU     _&name&
-endif
-ENDM
-
-MACRO   stdexternfunc   name,num_args,size
-ifdef   STDCALL_MANGLE
-        EXTRN   _&name&@&num_args&:size
-name    EQU     _&name&@&num_args
-else
-        EXTRN   name:size
-endif
-ENDM
-
-; Macro for a public C symbol. If the C compiler requires leading
-; underscores, then the underscores are added to the symbol names, otherwise
-; they are left off. The symbol name is referenced in the assembler code
-; using the non-underscored symbol name.
-
-MACRO   cpublic name
-ifdef   __NOU_VAR__
-name:
-        PUBLIC  name
-else
-_&name&:
-        PUBLIC  _&name&
-name    EQU     _&name&
-endif
-ENDM
-
-; Macro for an global C symbol. If the C compiler requires leading
-; underscores, then the underscores are added to the symbol names, otherwise
-; they are left off. The symbol name is referenced in the assembler code
-; using the non-underscored symbol name.
-
-MACRO   cglobal name
-ifdef   __NOU_VAR__
-        PUBLIC  name
-else
-        PUBLIC  _&name&
-name    EQU     _&name&
-endif
-ENDM
-
-; Macro for an global C function symbol. If the C compiler requires leading
-; underscores, then the underscores are added to the symbol names, otherwise
-; they are left off. The symbol name is referenced in the assembler code
-; using the non-underscored symbol name.
-
-MACRO   cglobalfunc name
-ifdef   __NOU__
-        PUBLIC  name
-else
-        PUBLIC  _&name&
-name    EQU     _&name&
-endif
-ENDM
-
-; Macro to start a C callable function. This will be a far function for
-; 16-bit code, and a near function for 32-bit code.
-
-MACRO   cprocstatic name        ; Set up model independant private proc
-ifdef flatmodel
-PROC    name NEAR
-else
-PROC    name FAR
-endif
-LocalSize   = 0
-ENDM
-
-MACRO   cprocstart name         ; Set up model independant proc
-ifdef flatmodel
-ifdef   __NOU__
-PROC    name NEAR
-else
-PROC    _&name& NEAR
-endif
-else
-ifdef   __NOU__
-PROC    name FAR
-else
-PROC    _&name& FAR
-endif
-endif
-LocalSize   = 0
-        cglobalfunc name
-ENDM
-
-MACRO   cprocnear name          ; Set up near proc
-ifdef   __NOU__
-PROC    name NEAR
-else
-PROC    _&name& NEAR
-endif
-LocalSize   = 0
-        cglobalfunc name
-ENDM
-
-MACRO   cprocfar name           ; Set up far proc
-ifdef   __NOU__
-PROC    name FAR
-else
-PROC    _&name& FAR
-endif
-LocalSize   = 0
-        cglobalfunc name
-ENDM
-
-MACRO   cprocend               ; End procedure macro
-ENDP
-ENDM
-
-; This macro sets up a procedure to be exported from a 16 bit DLL. Since the
-; calling conventions are always _far _pascal for 16 bit DLL's, we actually
-; rename this routine with an extra underscore with 'C' calling conventions
-; and a small DLL stub will be provided by the high level code to call the
-; assembler routine.
-
-MACRO   cprocstartdll16 name
-ifdef   __WINDOWS16__
-cprocstart  _&name&
-else
-cprocstart  name
-endif
-ENDM
-
-; Macros for entering and exiting C callable functions. Note that we must
-; always save and restore the SI and DI registers for C functions, and for
-; 32 bit C functions we also need to save and restore EBX and clear the
-; direction flag.
-
-MACRO   save_c_regs
-ifdef   flatmodel
-        push    ebx
-endif
-        push    _si
-        push    _di
-ENDM
-
-MACRO   enter_c
-        push    _bp
-        mov     _bp,_sp
-    IFDIFI  <LocalSize>,<0>
-        sub     _sp,LocalSize
-    ENDIF
-        save_c_regs
-ENDM
-
-MACRO   restore_c_regs
-        pop     _di
-        pop     _si
-ifdef   flatmodel
-        pop     ebx
-endif
-ENDM
-
-MACRO   leave_c
-        restore_c_regs
-        cld
-    IFDIFI  <LocalSize>,<0>
-        mov     _sp,_bp
-    ENDIF
-        pop     _bp
-ENDM
-
-MACRO   use_ebx
-ifdef flatmodel
-        push    ebx
-endif
-ENDM
-
-MACRO   unuse_ebx
-ifdef flatmodel
-        pop     ebx
-endif
-ENDM
-
-; Macros for saving and restoring the value of DS,ES,FS,GS when it is to
-; be used in assembly routines. This evaluates to nothing in the flat memory
-; model, but is saves and restores DS in the large memory model.
-
-MACRO   use_ds
-ifndef flatmodel
-        push    ds
-endif
-ENDM
-
-MACRO   unuse_ds
-ifndef flatmodel
-        pop     ds
-endif
-ENDM
-
-MACRO   use_es
-ifndef flatmodel
-        push    es
-endif
-ENDM
-
-MACRO   unuse_es
-ifndef flatmodel
-        pop     es
-endif
-ENDM
-
-; Macros for loading the address of a data pointer into a segment and
-; index register pair. The macro explicitly loads DS or ES in the 16 bit
-; memory model, or it simply loads the offset into the register in the flat
-; memory model since DS and ES always point to all addressable memory. You
-; must use the correct _REG (ie: _BX) macros for documentation purposes.
-
-MACRO   _lds    reg, addr
-ifdef flatmodel
-        mov     reg,addr
-else
-        lds     reg,addr
-endif
-ENDM
-
-MACRO   _les    reg, addr
-ifdef flatmodel
-        mov     reg,addr
-else
-        les     reg,addr
-endif
-ENDM
-
-; Macros for adding and subtracting a value from registers. Two value are
-; provided, one for 16 bit modes and another for 32 bit modes (the extended
-; register is used in 32 bit modes).
-
-MACRO   _add    reg, val16, val32
-ifdef flatmodel
-        add     e&reg&, val32
-else
-        add     reg, val16
-endif
-ENDM
-
-MACRO   _sub    reg, val16, val32
-ifdef flatmodel
-        sub     e&reg&, val32
-else
-        sub     reg, val16
-endif
-ENDM
-
-; Macro to clear the high order word for the 32 bit extended registers.
-; This is used to convert an unsigned 16 bit value to an unsigned 32 bit
-; value, and will evaluate to nothing in 16 bit modes.
-
-MACRO   clrhi   reg
-ifdef   flatmodel
-        movzx   e&reg&,reg
-endif
-ENDM
-
-MACRO   sgnhi   reg
-ifdef   flatmodel
-        movsx   e&reg&,reg
-endif
-ENDM
-
-; Macro to load an extended register with an integer value in either mode
-
-MACRO   loadint reg,val
-ifdef flatmodel
-        mov     e&reg&,val
-else
-        xor     e&reg&,e&reg&
-        mov     reg,val
-endif
-ENDM
-
-; Macros to load and store integer values with string instructions
-
-MACRO   LODSINT
-ifdef flatmodel
-        lodsd
-else
-        lodsw
-endif
-ENDM
-
-MACRO   STOSINT
-ifdef flatmodel
-        stosd
-else
-        stosw
-endif
-ENDM
-
-; Macros to provide resb, resw, resd compatibility with NASM
-
-MACRO   dclb    count
-db  count dup (0)
-ENDM
-
-MACRO   dclw    count
-dw  count dup (0)
-ENDM
-
-MACRO   dcld    count
-dd  count dup (0)
-ENDM
-
-; Macros to provide resb, resw, resd compatibility with NASM
-
-MACRO   resb    count
-db  count dup (?)
-ENDM
-
-MACRO   resw    count
-dw  count dup (?)
-ENDM
-
-MACRO   resd    count
-dd  count dup (?)
-ENDM
-
-; Macros to declare assembler stubs for function structures
-
-MACRO   BEGIN_STUBS_DEF name, firstOffset
-begdataseg  _STUBS
-ifdef   __NOU_VAR__
-        EXTRN   name:DWORD
-STUBS_START =   name
-else
-        EXTRN   _&name&:DWORD
-name    EQU     _&name&
-STUBS_START =   _&name
-endif
-enddataseg  _STUBS
-begcodeseg  _STUBS
-off = firstOffset
-ENDM
-
-MACRO   DECLARE_STUB    name
-ifdef   __NOU__
-name:
-        PUBLIC  name
-else
-_&name:
-        PUBLIC  _&name
-endif
-        jmp     [DWORD STUBS_START+off]
-off = off + 4
-ENDM
-
-MACRO   SKIP_STUB    name
-off = off + 4
-ENDM
-
-MACRO   DECLARE_STDCALL name,num_args
-ifdef   STDCALL_MANGLE
-_&name&@&num_args&:
-        PUBLIC  _&name&@&num_args&
-else
-name:
-        PUBLIC  name
-endif
-        jmp     [DWORD STUBS_START+off]
-off = off + 4
-ENDM
-
-MACRO   END_STUBS_DEF
-endcodeseg  _STUBS
-ENDM
-
-MACRO   BEGIN_IMPORTS_DEF   name
-BEGIN_STUBS_DEF name,4
-ENDM
-
-ifndef LOCAL_DECLARE_IMP
-MACRO   DECLARE_IMP name, numArgs
-DECLARE_STUB    name
-ENDM
-
-MACRO   SKIP_IMP name
-SKIP_STUB       name
-ENDM
-
-MACRO   SKIP_IMP2 name, numArgs
-DECLARE_STUB    name
-ENDM
-
-MACRO   SKIP_IMP3 name
-SKIP_STUB       name
-ENDM
-endif
-
-MACRO   END_IMPORTS_DEF
-END_STUBS_DEF
-ENDM
-
-MACRO   LEA_L    reg,name
-        lea     reg,[name]
-ENDM
-
-MACRO   LEA_G    reg,name
-        lea     reg,[name]
-ENDM
-
-endif
-
diff --git a/board/MAI/bios_emulator/scitech/include/x86emu.h b/board/MAI/bios_emulator/scitech/include/x86emu.h
deleted file mode 100644 (file)
index 1d87d4e..0000000
+++ /dev/null
@@ -1,194 +0,0 @@
-/****************************************************************************
-*
-*                       Realmode X86 Emulator Library
-*
-*               Copyright (C) 1996-1999 SciTech Software, Inc.
-*                    Copyright (C) David Mosberger-Tang
-*                      Copyright (C) 1999 Egbert Eich
-*
-*  ========================================================================
-*
-*  Permission to use, copy, modify, distribute, and sell this software and
-*  its documentation for any purpose is hereby granted without fee,
-*  provided that the above copyright notice appear in all copies and that
-*  both that copyright notice and this permission notice appear in
-*  supporting documentation, and that the name of the authors not be used
-*  in advertising or publicity pertaining to distribution of the software
-*  without specific, written prior permission.  The authors makes no
-*  representations about the suitability of this software for any purpose.
-*  It is provided "as is" without express or implied warranty.
-*
-*  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-*  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-*  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-*  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-*  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-*  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-*  PERFORMANCE OF THIS SOFTWARE.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Any
-* Developer:    Kendall Bennett
-*
-* Description:  Header file for public specific functions.
-*               Any application linking against us should only
-*               include this header
-*
-****************************************************************************/
-
-#ifndef __X86EMU_X86EMU_H
-#define __X86EMU_X86EMU_H
-
-#ifdef SCITECH
-#include "scitech.h"
-#define X86API  _ASMAPI
-#define X86APIP _ASMAPIP
-typedef int X86EMU_pioAddr;
-#else
-#include "x86emu/types.h"
-#define X86API
-#define X86APIP *
-#endif
-#include "x86emu/regs.h"
-
-/*---------------------- Macros and type definitions ----------------------*/
-
-#pragma pack(1)
-
-/****************************************************************************
-REMARKS:
-Data structure containing ponters to programmed I/O functions used by the
-emulator. This is used so that the user program can hook all programmed
-I/O for the emulator to handled as necessary by the user program. By
-default the emulator contains simple functions that do not do access the
-hardware in any way. To allow the emualtor access the hardware, you will
-need to override the programmed I/O functions using the X86EMU_setupPioFuncs
-function.
-
-HEADER:
-x86emu.h
-
-MEMBERS:
-inb     - Function to read a byte from an I/O port
-inw     - Function to read a word from an I/O port
-inl     - Function to read a dword from an I/O port
-outb    - Function to write a byte to an I/O port
-outw    - Function to write a word to an I/O port
-outl    - Function to write a dword to an I/O port
-****************************************************************************/
-typedef struct {
-    u8      (X86APIP inb)(X86EMU_pioAddr addr);
-    u16     (X86APIP inw)(X86EMU_pioAddr addr);
-    u32     (X86APIP inl)(X86EMU_pioAddr addr);
-    void    (X86APIP outb)(X86EMU_pioAddr addr, u8 val);
-    void    (X86APIP outw)(X86EMU_pioAddr addr, u16 val);
-    void    (X86APIP outl)(X86EMU_pioAddr addr, u32 val);
-    } X86EMU_pioFuncs;
-
-/****************************************************************************
-REMARKS:
-Data structure containing ponters to memory access functions used by the
-emulator. This is used so that the user program can hook all memory
-access functions as necessary for the emulator. By default the emulator
-contains simple functions that only access the internal memory of the
-emulator. If you need specialised functions to handle access to different
-types of memory (ie: hardware framebuffer accesses and BIOS memory access
-etc), you will need to override this using the X86EMU_setupMemFuncs
-function.
-
-HEADER:
-x86emu.h
-
-MEMBERS:
-rdb     - Function to read a byte from an address
-rdw     - Function to read a word from an address
-rdl     - Function to read a dword from an address
-wrb     - Function to write a byte to an address
-wrw     - Function to write a word to an address
-wrl     - Function to write a dword to an address
-****************************************************************************/
-typedef struct {
-    u8      (X86APIP rdb)(u32 addr);
-    u16     (X86APIP rdw)(u32 addr);
-    u32     (X86APIP rdl)(u32 addr);
-    void    (X86APIP wrb)(u32 addr, u8 val);
-    void    (X86APIP wrw)(u32 addr, u16 val);
-    void    (X86APIP wrl)(u32 addr, u32 val);
-    } X86EMU_memFuncs;
-
-/****************************************************************************
-  Here are the default memory read and write
-  function in case they are needed as fallbacks.
-***************************************************************************/
-extern u8 X86API rdb(u32 addr);
-extern u16 X86API rdw(u32 addr);
-extern u32 X86API rdl(u32 addr);
-extern void X86API wrb(u32 addr, u8 val);
-extern void X86API wrw(u32 addr, u16 val);
-extern void X86API wrl(u32 addr, u32 val);
-
-#pragma pack()
-
-/*--------------------- type definitions -----------------------------------*/
-
-typedef void (X86APIP X86EMU_intrFuncs)(int num);
-extern X86EMU_intrFuncs _X86EMU_intrTab[256];
-
-/*-------------------------- Function Prototypes --------------------------*/
-
-#ifdef  __cplusplus
-extern "C" {                        /* Use "C" linkage when in C++ mode */
-#endif
-
-void    X86EMU_setupMemFuncs(X86EMU_memFuncs *funcs);
-void    X86EMU_setupPioFuncs(X86EMU_pioFuncs *funcs);
-void    X86EMU_setupIntrFuncs(X86EMU_intrFuncs funcs[]);
-void    X86EMU_prepareForInt(int num);
-
-/* decode.c */
-
-void    X86EMU_exec(void);
-void    X86EMU_halt_sys(void);
-
-#ifdef  DEBUG
-#define HALT_SYS()  \
-    printk("halt_sys: file %s, line %d\n", __FILE__, __LINE__), \
-    X86EMU_halt_sys()
-#else
-#define HALT_SYS()  X86EMU_halt_sys()
-#endif
-
-/* Debug options */
-
-#define DEBUG_DECODE_F          0x0001  /* print decoded instruction  */
-#define DEBUG_TRACE_F           0x0002  /* dump regs before/after execution */
-#define DEBUG_STEP_F            0x0004
-#define DEBUG_DISASSEMBLE_F     0x0008
-#define DEBUG_BREAK_F           0x0010
-#define DEBUG_SVC_F             0x0020
-#define DEBUG_SAVE_CS_IP        0x0040
-#define DEBUG_FS_F              0x0080
-#define DEBUG_PROC_F            0x0100
-#define DEBUG_SYSINT_F          0x0200 /* bios system interrupts. */
-#define DEBUG_TRACECALL_F       0x0400
-#define DEBUG_INSTRUMENT_F      0x0800
-#define DEBUG_MEM_TRACE_F       0x1000
-#define DEBUG_IO_TRACE_F        0x2000
-#define DEBUG_TRACECALL_REGS_F  0x4000
-#define DEBUG_DECODE_NOPRINT_F  0x8000
-#define DEBUG_EXIT              0x10000
-#define DEBUG_SYS_F             (DEBUG_SVC_F|DEBUG_FS_F|DEBUG_PROC_F)
-
-void    X86EMU_trace_regs(void);
-void    X86EMU_trace_xregs(void);
-void    X86EMU_dump_memory(u16 seg, u16 off, u32 amt);
-int     X86EMU_trace_on(void);
-int     X86EMU_trace_off(void);
-
-#ifdef  __cplusplus
-}                                   /* End of "C" linkage for C++       */
-#endif
-
-#endif /* __X86EMU_X86EMU_H */
diff --git a/board/MAI/bios_emulator/scitech/include/x86emu/fpu_regs.h b/board/MAI/bios_emulator/scitech/include/x86emu/fpu_regs.h
deleted file mode 100644 (file)
index 777b03c..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-/****************************************************************************
-*
-*                       Realmode X86 Emulator Library
-*
-*               Copyright (C) 1996-1999 SciTech Software, Inc.
-*                    Copyright (C) David Mosberger-Tang
-*                      Copyright (C) 1999 Egbert Eich
-*
-*  ========================================================================
-*
-*  Permission to use, copy, modify, distribute, and sell this software and
-*  its documentation for any purpose is hereby granted without fee,
-*  provided that the above copyright notice appear in all copies and that
-*  both that copyright notice and this permission notice appear in
-*  supporting documentation, and that the name of the authors not be used
-*  in advertising or publicity pertaining to distribution of the software
-*  without specific, written prior permission.  The authors makes no
-*  representations about the suitability of this software for any purpose.
-*  It is provided "as is" without express or implied warranty.
-*
-*  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-*  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-*  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-*  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-*  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-*  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-*  PERFORMANCE OF THIS SOFTWARE.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Any
-* Developer:    Kendall Bennett
-*
-* Description:  Header file for FPU register definitions.
-*
-****************************************************************************/
-
-#ifndef __X86EMU_FPU_REGS_H
-#define __X86EMU_FPU_REGS_H
-
-#ifdef X86_FPU_SUPPORT
-
-#pragma pack(1)
-
-/* Basic 8087 register can hold any of the following values: */
-
-union x86_fpu_reg_u {
-    s8                  tenbytes[10];
-    double              dval;
-    float               fval;
-    s16                 sval;
-    s32                 lval;
-    };
-
-struct x86_fpu_reg {
-    union x86_fpu_reg_u reg;
-    char                tag;
-    };
-
-/*
- * Since we are not going to worry about the problems of aliasing
- * registers, every time a register is modified, its result type is
- * set in the tag fields for that register.  If some operation
- * attempts to access the type in a way inconsistent with its current
- * storage format, then we flag the operation.  If common, we'll
- * attempt the conversion.
- */
-
-#define  X86_FPU_VALID          0x80
-#define  X86_FPU_REGTYP(r)      ((r) & 0x7F)
-
-#define  X86_FPU_WORD           0x0
-#define  X86_FPU_SHORT          0x1
-#define  X86_FPU_LONG           0x2
-#define  X86_FPU_FLOAT          0x3
-#define  X86_FPU_DOUBLE         0x4
-#define  X86_FPU_LDBL           0x5
-#define  X86_FPU_BSD            0x6
-
-#define  X86_FPU_STKTOP  0
-
-struct x86_fpu_registers {
-    struct x86_fpu_reg  x86_fpu_stack[8];
-    int                 x86_fpu_flags;
-    int                 x86_fpu_config;         /* rounding modes, etc. */
-    short               x86_fpu_tos, x86_fpu_bos;
-    };
-
-#pragma pack()
-
-/*
- * There are two versions of the following macro.
- *
- * One version is for opcode D9, for which there are more than 32
- * instructions encoded in the second byte of the opcode.
- *
- * The other version, deals with all the other 7 i87 opcodes, for
- * which there are only 32 strings needed to describe the
- * instructions.
- */
-
-#endif /* X86_FPU_SUPPORT */
-
-#ifdef DEBUG
-# define DECODE_PRINTINSTR32(t,mod,rh,rl)       \
-    DECODE_PRINTF(t[(mod<<3)+(rh)]);
-# define DECODE_PRINTINSTR256(t,mod,rh,rl)      \
-    DECODE_PRINTF(t[(mod<<6)+(rh<<3)+(rl)]);
-#else
-# define DECODE_PRINTINSTR32(t,mod,rh,rl)
-# define DECODE_PRINTINSTR256(t,mod,rh,rl)
-#endif
-
-#endif /* __X86EMU_FPU_REGS_H */
diff --git a/board/MAI/bios_emulator/scitech/include/x86emu/regs.h b/board/MAI/bios_emulator/scitech/include/x86emu/regs.h
deleted file mode 100644 (file)
index a12017b..0000000
+++ /dev/null
@@ -1,331 +0,0 @@
-/****************************************************************************
-*
-*                       Realmode X86 Emulator Library
-*
-*               Copyright (C) 1996-1999 SciTech Software, Inc.
-*                    Copyright (C) David Mosberger-Tang
-*                      Copyright (C) 1999 Egbert Eich
-*
-*  ========================================================================
-*
-*  Permission to use, copy, modify, distribute, and sell this software and
-*  its documentation for any purpose is hereby granted without fee,
-*  provided that the above copyright notice appear in all copies and that
-*  both that copyright notice and this permission notice appear in
-*  supporting documentation, and that the name of the authors not be used
-*  in advertising or publicity pertaining to distribution of the software
-*  without specific, written prior permission.  The authors makes no
-*  representations about the suitability of this software for any purpose.
-*  It is provided "as is" without express or implied warranty.
-*
-*  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-*  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-*  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-*  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-*  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-*  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-*  PERFORMANCE OF THIS SOFTWARE.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Any
-* Developer:    Kendall Bennett
-*
-* Description:  Header file for x86 register definitions.
-*
-****************************************************************************/
-
-#ifndef __X86EMU_REGS_H
-#define __X86EMU_REGS_H
-
-/*---------------------- Macros and type definitions ----------------------*/
-
-#pragma pack(1)
-
-/*
- * General EAX, EBX, ECX, EDX type registers.  Note that for
- * portability, and speed, the issue of byte swapping is not addressed
- * in the registers.  All registers are stored in the default format
- * available on the host machine.  The only critical issue is that the
- * registers should line up EXACTLY in the same manner as they do in
- * the 386.  That is:
- *
- * EAX & 0xff  === AL
- * EAX & 0xffff == AX
- *
- * etc.  The result is that alot of the calculations can then be
- * done using the native instruction set fully.
- */
-
-#ifdef  __BIG_ENDIAN__
-
-typedef struct {
-    u32 e_reg;
-    } I32_reg_t;
-
-typedef struct {
-    u16 filler0, x_reg;
-    } I16_reg_t;
-
-typedef struct {
-    u8 filler0, filler1, h_reg, l_reg;
-    } I8_reg_t;
-
-#else /* !__BIG_ENDIAN__ */
-
-typedef struct {
-    u32 e_reg;
-    } I32_reg_t;
-
-typedef struct {
-    u16 x_reg;
-    } I16_reg_t;
-
-typedef struct {
-    u8 l_reg, h_reg;
-    } I8_reg_t;
-
-#endif /* BIG_ENDIAN */
-
-typedef union {
-    I32_reg_t   I32_reg;
-    I16_reg_t   I16_reg;
-    I8_reg_t    I8_reg;
-    } i386_general_register;
-
-struct i386_general_regs {
-    i386_general_register A, B, C, D;
-    };
-
-typedef struct i386_general_regs Gen_reg_t;
-
-struct i386_special_regs {
-    i386_general_register SP, BP, SI, DI, IP;
-    u32 FLAGS;
-    };
-
-/*
- * Segment registers here represent the 16 bit quantities
- * CS, DS, ES, SS.
- */
-
-struct i386_segment_regs {
-    u16 CS, DS, SS, ES, FS, GS;
-    };
-
-/* 8 bit registers */
-#define R_AH  gen.A.I8_reg.h_reg
-#define R_AL  gen.A.I8_reg.l_reg
-#define R_BH  gen.B.I8_reg.h_reg
-#define R_BL  gen.B.I8_reg.l_reg
-#define R_CH  gen.C.I8_reg.h_reg
-#define R_CL  gen.C.I8_reg.l_reg
-#define R_DH  gen.D.I8_reg.h_reg
-#define R_DL  gen.D.I8_reg.l_reg
-
-/* 16 bit registers */
-#define R_AX  gen.A.I16_reg.x_reg
-#define R_BX  gen.B.I16_reg.x_reg
-#define R_CX  gen.C.I16_reg.x_reg
-#define R_DX  gen.D.I16_reg.x_reg
-
-/* 32 bit extended registers */
-#define R_EAX  gen.A.I32_reg.e_reg
-#define R_EBX  gen.B.I32_reg.e_reg
-#define R_ECX  gen.C.I32_reg.e_reg
-#define R_EDX  gen.D.I32_reg.e_reg
-
-/* special registers */
-#define R_SP  spc.SP.I16_reg.x_reg
-#define R_BP  spc.BP.I16_reg.x_reg
-#define R_SI  spc.SI.I16_reg.x_reg
-#define R_DI  spc.DI.I16_reg.x_reg
-#define R_IP  spc.IP.I16_reg.x_reg
-#define R_FLG spc.FLAGS
-
-/* special registers */
-#define R_SP  spc.SP.I16_reg.x_reg
-#define R_BP  spc.BP.I16_reg.x_reg
-#define R_SI  spc.SI.I16_reg.x_reg
-#define R_DI  spc.DI.I16_reg.x_reg
-#define R_IP  spc.IP.I16_reg.x_reg
-#define R_FLG spc.FLAGS
-
-/* special registers */
-#define R_ESP  spc.SP.I32_reg.e_reg
-#define R_EBP  spc.BP.I32_reg.e_reg
-#define R_ESI  spc.SI.I32_reg.e_reg
-#define R_EDI  spc.DI.I32_reg.e_reg
-#define R_EIP  spc.IP.I32_reg.e_reg
-#define R_EFLG spc.FLAGS
-
-/* segment registers */
-#define R_CS  seg.CS
-#define R_DS  seg.DS
-#define R_SS  seg.SS
-#define R_ES  seg.ES
-#define R_FS  seg.FS
-#define R_GS  seg.GS
-
-/* flag conditions   */
-#define FB_CF 0x0001            /* CARRY flag  */
-#define FB_PF 0x0004            /* PARITY flag */
-#define FB_AF 0x0010            /* AUX  flag   */
-#define FB_ZF 0x0040            /* ZERO flag   */
-#define FB_SF 0x0080            /* SIGN flag   */
-#define FB_TF 0x0100            /* TRAP flag   */
-#define FB_IF 0x0200            /* INTERRUPT ENABLE flag */
-#define FB_DF 0x0400            /* DIR flag    */
-#define FB_OF 0x0800            /* OVERFLOW flag */
-
-/* 80286 and above always have bit#1 set */
-#define F_ALWAYS_ON  (0x0002)   /* flag bits always on */
-
-/*
- * Define a mask for only those flag bits we will ever pass back
- * (via PUSHF)
- */
-#define F_MSK (FB_CF|FB_PF|FB_AF|FB_ZF|FB_SF|FB_TF|FB_IF|FB_DF|FB_OF)
-
-/* following bits masked in to a 16bit quantity */
-
-#define F_CF 0x0001             /* CARRY flag  */
-#define F_PF 0x0004             /* PARITY flag */
-#define F_AF 0x0010             /* AUX  flag   */
-#define F_ZF 0x0040             /* ZERO flag   */
-#define F_SF 0x0080             /* SIGN flag   */
-#define F_TF 0x0100             /* TRAP flag   */
-#define F_IF 0x0200             /* INTERRUPT ENABLE flag */
-#define F_DF 0x0400             /* DIR flag    */
-#define F_OF 0x0800             /* OVERFLOW flag */
-
-#define TOGGLE_FLAG(flag)       (M.x86.R_FLG ^= (flag))
-#define SET_FLAG(flag)          (M.x86.R_FLG |= (flag))
-#define CLEAR_FLAG(flag)        (M.x86.R_FLG &= ~(flag))
-#define ACCESS_FLAG(flag)       (M.x86.R_FLG & (flag))
-#define CLEARALL_FLAG(m)        (M.x86.R_FLG = 0)
-
-#define CONDITIONAL_SET_FLAG(COND,FLAG) \
-  if (COND) SET_FLAG(FLAG); else CLEAR_FLAG(FLAG)
-
-#define F_PF_CALC 0x010000      /* PARITY flag has been calced    */
-#define F_ZF_CALC 0x020000      /* ZERO flag has been calced      */
-#define F_SF_CALC 0x040000      /* SIGN flag has been calced      */
-
-#define F_ALL_CALC      0xff0000        /* All have been calced   */
-
-/*
- * Emulator machine state.
- * Segment usage control.
- */
-#define SYSMODE_SEG_DS_SS       0x00000001
-#define SYSMODE_SEGOVR_CS       0x00000002
-#define SYSMODE_SEGOVR_DS       0x00000004
-#define SYSMODE_SEGOVR_ES       0x00000008
-#define SYSMODE_SEGOVR_FS       0x00000010
-#define SYSMODE_SEGOVR_GS       0x00000020
-#define SYSMODE_SEGOVR_SS       0x00000040
-#define SYSMODE_PREFIX_REPE     0x00000080
-#define SYSMODE_PREFIX_REPNE    0x00000100
-#define SYSMODE_PREFIX_DATA     0x00000200
-#define SYSMODE_PREFIX_ADDR     0x00000400
-#define SYSMODE_INTR_PENDING    0x10000000
-#define SYSMODE_EXTRN_INTR      0x20000000
-#define SYSMODE_HALTED          0x40000000
-
-#define SYSMODE_SEGMASK (SYSMODE_SEG_DS_SS      | \
-                        SYSMODE_SEGOVR_CS      | \
-                        SYSMODE_SEGOVR_DS      | \
-                        SYSMODE_SEGOVR_ES      | \
-                        SYSMODE_SEGOVR_FS      | \
-                        SYSMODE_SEGOVR_GS      | \
-                        SYSMODE_SEGOVR_SS)
-#define SYSMODE_CLRMASK (SYSMODE_SEG_DS_SS      | \
-                        SYSMODE_SEGOVR_CS      | \
-                        SYSMODE_SEGOVR_DS      | \
-                        SYSMODE_SEGOVR_ES      | \
-                        SYSMODE_SEGOVR_FS      | \
-                        SYSMODE_SEGOVR_GS      | \
-                        SYSMODE_SEGOVR_SS      | \
-                        SYSMODE_PREFIX_DATA    | \
-                        SYSMODE_PREFIX_ADDR)
-
-#define  INTR_SYNCH           0x1
-#define  INTR_ASYNCH          0x2
-#define  INTR_HALTED          0x4
-
-typedef struct {
-    struct i386_general_regs    gen;
-    struct i386_special_regs    spc;
-    struct i386_segment_regs    seg;
-    /*
-     * MODE contains information on:
-     *  REPE prefix             2 bits  repe,repne
-     *  SEGMENT overrides       5 bits  normal,DS,SS,CS,ES
-     *  Delayed flag set        3 bits  (zero, signed, parity)
-     *  reserved                6 bits
-     *  interrupt #             8 bits  instruction raised interrupt
-     *  BIOS video segregs      4 bits
-     *  Interrupt Pending       1 bits
-     *  Extern interrupt        1 bits
-     *  Halted                  1 bits
-     */
-    long                        mode;
-    u8                          intno;
-    volatile int                intr;   /* mask of pending interrupts */
-    int                         debug;
-#ifdef DEBUG
-    int                         check;
-    u16                         saved_ip;
-    u16                         saved_cs;
-    int                         enc_pos;
-    int                         enc_str_pos;
-    char                        decode_buf[32]; /* encoded byte stream  */
-    char                        decoded_buf[256]; /* disassembled strings */
-#endif
-    } X86EMU_regs;
-
-/****************************************************************************
-REMARKS:
-Structure maintaining the emulator machine state.
-
-MEMBERS:
-x86             - X86 registers
-mem_base        - Base real mode memory for the emulator
-mem_size        - Size of the real mode memory block for the emulator
-****************************************************************************/
-typedef struct {
-    X86EMU_regs     x86;
-    unsigned long   mem_base;
-    unsigned long   mem_size;
-    void*           private;
-    } X86EMU_sysEnv;
-
-#pragma pack()
-
-/*----------------------------- Global Variables --------------------------*/
-
-#ifdef  __cplusplus
-extern "C" {                        /* Use "C" linkage when in C++ mode */
-#endif
-
-/* Global emulator machine state.
- *
- * We keep it global to avoid pointer dereferences in the code for speed.
- */
-
-extern    X86EMU_sysEnv _X86EMU_env;
-#define   M             _X86EMU_env
-
-/*-------------------------- Function Prototypes --------------------------*/
-
-/* Function to log information at runtime */
-
-/*void    printk(const char *fmt, ...); */
-
-#ifdef  __cplusplus
-}                                   /* End of "C" linkage for C++       */
-#endif
-
-#endif /* __X86EMU_REGS_H */
diff --git a/board/MAI/bios_emulator/scitech/include/x86emu/types.h b/board/MAI/bios_emulator/scitech/include/x86emu/types.h
deleted file mode 100644 (file)
index 0a17c54..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/****************************************************************************
-*
-*                       Realmode X86 Emulator Library
-*
-*               Copyright (C) 1996-1999 SciTech Software, Inc.
-*                    Copyright (C) David Mosberger-Tang
-*                      Copyright (C) 1999 Egbert Eich
-*
-*  ========================================================================
-*
-*  Permission to use, copy, modify, distribute, and sell this software and
-*  its documentation for any purpose is hereby granted without fee,
-*  provided that the above copyright notice appear in all copies and that
-*  both that copyright notice and this permission notice appear in
-*  supporting documentation, and that the name of the authors not be used
-*  in advertising or publicity pertaining to distribution of the software
-*  without specific, written prior permission.  The authors makes no
-*  representations about the suitability of this software for any purpose.
-*  It is provided "as is" without express or implied warranty.
-*
-*  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-*  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-*  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-*  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-*  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-*  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-*  PERFORMANCE OF THIS SOFTWARE.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Any
-* Developer:    Kendall Bennett
-*
-* Description:  Header file for x86 emulator type definitions.
-*
-****************************************************************************/
-
-#ifndef __X86EMU_TYPES_H
-#define __X86EMU_TYPES_H
-
-#include <sys/types.h>
-
-/*---------------------- Macros and type definitions ----------------------*/
-
-/* Currently only for Linux/32bit */
-#if defined(__GNUC__) && !defined(NO_LONG_LONG)
-#define __HAS_LONG_LONG__
-#endif
-
-typedef unsigned char       u8;
-typedef unsigned short      u16;
-typedef unsigned int        u32;
-#ifdef __HAS_LONG_LONG__
-typedef unsigned long long  u64;
-#endif
-
-typedef char                s8;
-typedef short               s16;
-typedef long                s32;
-#ifdef __HAS_LONG_LONG__
-typedef long long           s64;
-#endif
-
-/*typedef unsigned int      uint;*/
-typedef int                 sint;
-
-typedef u16 X86EMU_pioAddr;
-
-#endif  /* __X86EMU_TYPES_H */
diff --git a/board/MAI/bios_emulator/scitech/lib/debug/linux/gcc/glibc.so/readme.txt b/board/MAI/bios_emulator/scitech/lib/debug/linux/gcc/glibc.so/readme.txt
deleted file mode 100644 (file)
index 0d87eff..0000000
+++ /dev/null
@@ -1 +0,0 @@
-This file is just to ensure that the directory is created.
diff --git a/board/MAI/bios_emulator/scitech/lib/debug/linux/gcc/glibc/readme.txt b/board/MAI/bios_emulator/scitech/lib/debug/linux/gcc/glibc/readme.txt
deleted file mode 100644 (file)
index 0d87eff..0000000
+++ /dev/null
@@ -1 +0,0 @@
-This file is just to ensure that the directory is created.
diff --git a/board/MAI/bios_emulator/scitech/lib/debug/linux/gcc/libc.so/readme.txt b/board/MAI/bios_emulator/scitech/lib/debug/linux/gcc/libc.so/readme.txt
deleted file mode 100644 (file)
index 0d87eff..0000000
+++ /dev/null
@@ -1 +0,0 @@
-This file is just to ensure that the directory is created.
diff --git a/board/MAI/bios_emulator/scitech/lib/debug/linux/gcc/libc/readme.txt b/board/MAI/bios_emulator/scitech/lib/debug/linux/gcc/libc/readme.txt
deleted file mode 100644 (file)
index 0d87eff..0000000
+++ /dev/null
@@ -1 +0,0 @@
-This file is just to ensure that the directory is created.
diff --git a/board/MAI/bios_emulator/scitech/lib/release/linux/gcc/glibc.so/readme.txt b/board/MAI/bios_emulator/scitech/lib/release/linux/gcc/glibc.so/readme.txt
deleted file mode 100644 (file)
index 0d87eff..0000000
+++ /dev/null
@@ -1 +0,0 @@
-This file is just to ensure that the directory is created.
diff --git a/board/MAI/bios_emulator/scitech/lib/release/linux/gcc/glibc/readme.txt b/board/MAI/bios_emulator/scitech/lib/release/linux/gcc/glibc/readme.txt
deleted file mode 100644 (file)
index 0d87eff..0000000
+++ /dev/null
@@ -1 +0,0 @@
-This file is just to ensure that the directory is created.
diff --git a/board/MAI/bios_emulator/scitech/lib/release/linux/gcc/libc.so/readme.txt b/board/MAI/bios_emulator/scitech/lib/release/linux/gcc/libc.so/readme.txt
deleted file mode 100644 (file)
index 0d87eff..0000000
+++ /dev/null
@@ -1 +0,0 @@
-This file is just to ensure that the directory is created.
diff --git a/board/MAI/bios_emulator/scitech/lib/release/linux/gcc/libc/readme.txt b/board/MAI/bios_emulator/scitech/lib/release/linux/gcc/libc/readme.txt
deleted file mode 100644 (file)
index 0d87eff..0000000
+++ /dev/null
@@ -1 +0,0 @@
-This file is just to ensure that the directory is created.
diff --git a/board/MAI/bios_emulator/scitech/makedefs/bc16.mk b/board/MAI/bios_emulator/scitech/makedefs/bc16.mk
deleted file mode 100644 (file)
index aa4fe76..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-#############################################################################
-#
-#                                      SciTech Multi-platform Graphics Library
-#
-#  ========================================================================
-#
-#    The contents of this file are subject to the SciTech MGL Public
-#    License Version 1.0 (the "License"); you may not use this file
-#    except in compliance with the License. You may obtain a copy of
-#    the License at http://www.scitechsoft.com/mgl-license.txt
-#
-#    Software distributed under the License is distributed on an
-#    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-#    implied. See the License for the specific language governing
-#    rights and limitations under the License.
-#
-#    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-#
-#    The Initial Developer of the Original Code is SciTech Software, Inc.
-#    All Rights Reserved.
-#
-#  ========================================================================
-#
-# Descripton:   Generic DMAKE startup makefile definitions file. Assumes
-#               that the SCITECH environment variable has been set to point
-#               to where all our stuff is installed. You should not need
-#               to change anything in this file.
-#
-#               Borland C++ 4.x 16 bit version. Supports 16 bit DOS,
-#               DPMI16 DOS extender and 16 bit Windows development.
-#
-#############################################################################
-
-# Include standard startup script definitions
-.IMPORT: SCITECH
-.INCLUDE: "$(SCITECH)\makedefs\startup.mk"
-
-# Import enivornment variables that we use
-.IMPORT .IGNORE : USE_WIN16 USE_BC5 BC_LIBBASE USE_WIN95
-
-# Default commands for compiling, assembling linking and archiving
-   CC           := bcc
-   CFLAGS       := -ml -H=bcc.sym -i60 -d -dc -4 -f287
-.IF $(USE_TASM32)
-   AS           := tasm32
-.ELIF $(USE_TASMX)
-   AS           := tasmx
-.ELSE
-   AS           := tasm
-.ENDIF
-   ASFLAGS      := /t /mx /m /iINCLUDE /iINCLUDE /i$(SCITECH)\INCLUDE
-   LD           := bclink tlink.exe
-   LDFLAGS      := -c
-   RC           := brc
-   RCFLAGS      :=
-.IF $(USE_BC5)
-.IF $(USE_WIN95)
-   WIN_VERSION  := -V4.0
-.ENDIF
-.ENDIF
-   LIBR         := tlib
-   LIBFLAGS     := /C /P32
-   ILIB         := implib
-   ILIBFLAGS    := -c
-
-# Optionally turn on debugging information
-.IF $(DBG)
-   CFLAGS       += -v
-   LDFLAGS      += -v
-   ASFLAGS      += /zi
-   LIBFLAGS     += /P128
-.ELSE
-   LDFLAGS      += -x
-   ASFLAGS      += /q
-.END
-
-# Optionally turn on optimisations
-.IF $(OPT)
-   CFLAGS       += -O2 -k-
-.ELIF $(OPT_SIZE)
-   CFLAGS       += -O1 -k-
-.END
-
-# Optionally turn on direct i387 FPU instructions
-
-.IF $(FPU)
-   CFLAGS       += -DFPU387
-   ASFLAGS      += -DFPU387
-.END
-
-# Optionally compile a beta release version of a product
-.IF $(BETA)
-   CFLAGS       += -DBETA
-   ASFLAGS      += -DBETA
-.END
-
-# Optionally compile as Win16
-.IF $(USE_WIN16)
-.IF $(BUILD_DLL)
-   CFLAGS       += -WD -Fs- -DBUILD_DLL
-   ASFLAGS      += -DBUILD_DLL
-.ELSE
-   CFLAGS       += -W -Fs-
-.ENDIF
-   DEF_LIBS            := import.lib mathwl.lib cwl.lib
-   DX_ASFLAGS   += -D__WINDOWS16__
-   LIB_OS       = WIN16
-.ELSE
-   USE_REALDOS := 1
-   DEF_LIBS     := mathl.lib fp87.lib cl.lib
-   LIB_OS       = DOS16
-.END
-
-# Place to look for PMODE library files
-
-.IF $(USE_DPMI16)
-PMLIB           := dpmi16\pm.lib
-.ELSE
-PMLIB           := pm.lib
-.END
-
-# Define the base directory for library files
-
-.IF $(CHECKED)
-LIB_BASE_DIR   := $(SCITECH_LIB)\lib\debug
-CFLAGS                 += -DCHECKED=1
-.ELSE
-LIB_BASE_DIR   := $(SCITECH_LIB)\lib\release
-.ENDIF
-
-# Define where to install library files
-   LIB_BASE     := $(LIB_BASE_DIR)\$(LIB_OS)\$(BC_LIBBASE)
-   LIB_DEST     := $(LIB_BASE)
-
-# Define which file contains our rules
-
-   RULES_MAK   := bc16.mk
diff --git a/board/MAI/bios_emulator/scitech/makedefs/bc3.mk b/board/MAI/bios_emulator/scitech/makedefs/bc3.mk
deleted file mode 100644 (file)
index 133d80e..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-#############################################################################
-#
-#                                      SciTech Multi-platform Graphics Library
-#
-#  ========================================================================
-#
-#    The contents of this file are subject to the SciTech MGL Public
-#    License Version 1.0 (the "License"); you may not use this file
-#    except in compliance with the License. You may obtain a copy of
-#    the License at http://www.scitechsoft.com/mgl-license.txt
-#
-#    Software distributed under the License is distributed on an
-#    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-#    implied. See the License for the specific language governing
-#    rights and limitations under the License.
-#
-#    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-#
-#    The Initial Developer of the Original Code is SciTech Software, Inc.
-#    All Rights Reserved.
-#
-#  ========================================================================
-#
-# Descripton:   Generic DMAKE startup makefile definitions file. Assumes
-#               that the SCITECH environment variable has been set to point
-#               to where all our stuff is installed. You should not need
-#               to change anything in this file.
-#
-#               Borland C++ 3.1 version. Supports 16 bit DOS development.
-#
-#############################################################################
-
-# Include standard startup script definitions
-.IMPORT: SCITECH
-.INCLUDE: "$(SCITECH)\makedefs\startup.mk"
-
-# Default commands for compiling, assembling linking and archiving
-   CC           := bcc
-   CFLAGS       := -ml -H=bcc.sym -i60 -d
-.IF $(USE_TASM32)
-   AS           := tasm32
-.ELIF $(USE_TASMX)
-   AS           := tasmx
-.ELSE
-   AS           := tasm
-.ENDIF
-   ASFLAGS      := /t /mx /m /iINCLUDE /i$(SCITECH)\INCLUDE
-   LD           := bclink tlink.exe
-   LDFLAGS      := -c
-   LIB          := tlib
-   LIBFLAGS     := /C
-
-# Optionally turn on debugging information
-.IF $(DBG)
-   CFLAGS       += -v
-   LDFLAGS      += -v
-   ASFLAGS      += /zi
-   LIBFLAGS     += /P128
-.ELSE
-   LDFLAGS      += -x
-   ASFLAGS      += /q
-.END
-
-# Optionally turn on optimisations
-.IF $(OPT)
-   CFLAGS       += -3 -O2
-.ELIF $(OPT_SIZE)
-   CFLAGS       += -3 -O1
-.END
-
-# Optionally turn on direct i387 FPU instructions
-
-.IF $(FPU)
-   CFLAGS       += -f287 -DFPU387
-   ASFLAGS      += -DFPU387
-.END
-
-# Optionally compile a beta release version of a product
-.IF $(BETA)
-   CFLAGS       += -DBETA
-   ASFLAGS      += -DBETA
-.END
-   USE_REALDOS := 1
-
-# Define the default libraries to link with
-   DEF_LIBS            := mathl.lib cl.lib
-
-# Define the base directory for library files
-
-.IF $(CHECKED)
-LIB_BASE_DIR   := $(SCITECH_LIB)\lib\debug
-CFLAGS                 += -DCHECKED=1
-.ELSE
-LIB_BASE_DIR   := $(SCITECH_LIB)\lib\release
-.ENDIF
-
-# Define where to install library files
-   LIB_DEST     := $(LIB_BASE_DIR)\dos16\bc3
-
-# Define which file contains our rules
-
-   RULES_MAK   := bc3.mk
diff --git a/board/MAI/bios_emulator/scitech/makedefs/bc32.mk b/board/MAI/bios_emulator/scitech/makedefs/bc32.mk
deleted file mode 100644 (file)
index 246de1d..0000000
+++ /dev/null
@@ -1,201 +0,0 @@
-#############################################################################
-#
-#                                      SciTech Multi-platform Graphics Library
-#
-#  ========================================================================
-#
-#    The contents of this file are subject to the SciTech MGL Public
-#    License Version 1.0 (the "License"); you may not use this file
-#    except in compliance with the License. You may obtain a copy of
-#    the License at http://www.scitechsoft.com/mgl-license.txt
-#
-#    Software distributed under the License is distributed on an
-#    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-#    implied. See the License for the specific language governing
-#    rights and limitations under the License.
-#
-#    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-#
-#    The Initial Developer of the Original Code is SciTech Software, Inc.
-#    All Rights Reserved.
-#
-#  ========================================================================
-#
-# Descripton:   Generic DMAKE startup makefile definitions file. Assumes
-#               that the SCITECH environment variable has been set to point
-#               to where all our stuff is installed. You should not need
-#               to change anything in this file.
-#
-#               Borland C++ 4.0 32 bit version. Supports Borland's DOS Power
-#               Pack DPMI32 DOS extender, Phar Lap's TNT DOS Extender and
-#               32 bit Windows development.
-#
-#############################################################################
-
-# Include standard startup script definitions
-.IMPORT: SCITECH
-.INCLUDE: "$(SCITECH)\makedefs\startup.mk"
-
-# Import enivornment variables that we use
-.IMPORT .IGNORE : USE_SMX32 USE_TNT USE_WIN32 USE_BC5 USE_VXD BC_LIBBASE
-.IMPORT .IGNORE : VTOOLSD
-
-# We are compiling for a 32 bit envionment
-   _32BIT_      := 1
-
-# Default commands for compiling, assembling linking and archiving
-   CC           := bcc32
-.IF $(USE_VXD)
-   CFLAGS       := -4 -i60 -d -w-stu
-.ELSE
-   CFLAGS       := -4 -H=bcc32.sym -i60 -d -w-stu
-.ENDIF
-.IF $(USE_NASM)
-   AS                  := nasm
-   ASFLAGS      := -t -f obj -d__FLAT__ -iINCLUDE -i$(SCITECH)\INCLUDE
-.ELSE
-.IF $(USE_TASM32)
-   AS           := tasm32
-.ELIF $(USE_TASMX)
-   AS           := tasmx
-.ELSE
-   AS           := tasm
-.ENDIF
-   ASFLAGS      := /t /mx /m /w-res /w-mcp /D__FLAT__ /iINCLUDE /i$(SCITECH)\INCLUDE
-.ENDIF
-   LD           := bclink tlink32.exe
-   LDFLAGS      := -c
-   RC           := brc32
-.IF $(USE_BC5)
-   WIN_VERSION  := -V4.0
-   RCFLAGS      := -32
-.ELSE
-   RCFLAGS      := -w32
-.ENDIF
-   LIB          := tlib
-   LIBFLAGS     := /C
-   ILIB         := implib
-   ILIBFLAGS    := -c
-   INTEL_X86   := 1
-   NMSYM               := $(SOFTICE_PATH)\nmsym.exe
-   NMSYMFLAGS  := /TRANSLATE:source,package,always /PROMPT /SOURCE:$(SCITECH)\src\pm;$(SCITECH)\src\pm\common;$(SCITECH)\src\pm\win32
-
-# Optionally turn on debugging information
-.IF $(DBG)
-   CFLAGS       += -v
-   LDFLAGS      += -v
-   LIBFLAGS     += /P256
-.IF $(USE_NASM)
-   ASFLAGS      += -F borland -g
-.ELSE
-   ASFLAGS      += /zi
-.ENDIF
-.ELSE
-   LDFLAGS      += -x
-   LIBFLAGS            += /P128
-.IF $(USE_NASM)
-   ASFLAGS      += -F null
-.ELSE
-   ASFLAGS      += /q
-.ENDIF
-.END
-
-# Optionally disable nagging warnings if MAX_WARN is not on
-.IF $(MAX_WARN)
-.ELSE
-   CFLAGS              += -w-aus -w-par -w-hid -w-pia
-.ENDIF
-
-# Optionally turn on optimisations (-5 -O2 breaks BC++ 4.0-4.5 sometimes)
-.IF $(OPT)
-   CFLAGS       += -5 -O2 -k-
-.ELIF $(OPT_SIZE)
-   CFLAGS       += -5 -O1 -k-
-.END
-
-# Optionally turn on direct i387 FPU instructions
-.IF $(FPU)
-   CFLAGS       += -DFPU387
-   ASFLAGS      += -dFPU387
-.END
-
-# Optionally compile a beta release version of a product
-.IF $(BETA)
-   CFLAGS       += -DBETA
-   ASFLAGS      += -dBETA
-.END
-
-# Optionally use Phar Lap's TNT DOS Extender, otherwise use the DOS Power Pack
-.IF $(USE_TNT)
-   CFLAGS       += -D__MSDOS__
-   DX_CFLAGS    += -DTNT
-   DX_ASFLAGS   += -dTNT
-   LIB_OS       = DOS32
-   DEF_LIBS            := import32.lib cw32.lib dosx32.lib tntapi.lib
-.ELIF $(USE_VXD)
-   LDFLAGS             += -n -P- -x
-   CFLAGS       += -RT- -x- -Oi -VC -I$(VTOOLSD)\INCLUDE -DIS_32 -DWANTVXDWRAPS -DVTOOLSD -DWIN40 -DWIN40_OR_LATER -DDEFSEG=1 -zC_LTEXT -zALCODE -zR_LDATA -zTLCODE
-   DEF_LIBS            := $(VTOOLSD)\lib\cfbc440d.lib $(VTOOLSD)\lib\wr0bc440.lib $(VTOOLSD)\lib\wr1bc440.lib $(VTOOLSD)\lib\wr2bc440.lib $(VTOOLSD)\lib\wr3bc440.lib $(VTOOLSD)\lib\rtbc440d.lib
-   DX_ASFLAGS   += -d__VXD__ -d__BORLANDC__=1 -I$(VTOOLSD)\INCLUDE -I$(VTOOLSD)\LIB\INCLUDE
-   LIB_OS       = VXD
-.ELIF $(USE_WIN32)
-.IF $(WIN32_GUI)
-.ELSE
-    CFLAGS       += -D__CONSOLE__
-.ENDIF
-.IF $(BUILD_DLL)
-   CFLAGS       += -WD -DBUILD_DLL
-   ASFLAGS      += -dBUILD_DLL
-.ELSE
-   CFLAGS       += -W -WM
-.ENDIF
-.IF $(USE_BC5)
-.ELSE
-   CFLAGS              += -D_WIN32
-.ENDIF
-   DEF_LIBS            := import32.lib cw32mt.lib
-   DX_ASFLAGS   += -d__WINDOWS32__
-   LIB_OS       = WIN32
-.ELIF $(USE_SMX32)
-   CFLAGS       += -D__SMX32__ -DPME32
-   DX_CFLAGS    +=
-   DX_ASFLAGS   += -d__SMX32__ -dDPMI32 -dPME32
-   USE_REALDOS := 1
-   LIB_OS       = SMX32
-   DEF_LIBS     := cw32mt.lib
-.ELSE
-   USE_DPMI32   := 1
-   CFLAGS       += -D__MSDOS__
-   DX_CFLAGS    += -WX -DDPMI32
-   DX_ASFLAGS   += -dDPMI32
-   USE_REALDOS := 1
-   LIB_OS       = DOS32
-   DEF_LIBS            :=
-.END
-
-# Define the base directory for library files
-
-.IF $(CHECKED)
-LIB_BASE_DIR   := $(SCITECH_LIB)\lib\debug
-CFLAGS                 += -DCHECKED=1
-.ELSE
-LIB_BASE_DIR   := $(SCITECH_LIB)\lib\release
-.ENDIF
-
-# Define where to install library files
-   LIB_BASE     := $(LIB_BASE_DIR)\$(LIB_OS)\$(BC_LIBBASE)
-   LIB_DEST     := $(LIB_BASE)
-
-# Place to look for PMODE library files
-
-.IF $(USE_TNT)
-PMLIB           := $(LIB_BASE)\tnt\pm.lib
-.ELIF $(USE_DPMI32)
-PMLIB           := $(LIB_BASE)\dpmi32\pm.lib
-.ELSE
-PMLIB           := $(LIB_BASE)\pm.lib
-.END
-
-# Define which file contains our rules
-
-   RULES_MAK   := bc32.mk
diff --git a/board/MAI/bios_emulator/scitech/makedefs/bcos2.mk b/board/MAI/bios_emulator/scitech/makedefs/bcos2.mk
deleted file mode 100644 (file)
index 23aeb7c..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-#############################################################################
-#
-#                                      SciTech Multi-platform Graphics Library
-#
-#  ========================================================================
-#
-#    The contents of this file are subject to the SciTech MGL Public
-#    License Version 1.0 (the "License"); you may not use this file
-#    except in compliance with the License. You may obtain a copy of
-#    the License at http://www.scitechsoft.com/mgl-license.txt
-#
-#    Software distributed under the License is distributed on an
-#    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-#    implied. See the License for the specific language governing
-#    rights and limitations under the License.
-#
-#    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-#
-#    The Initial Developer of the Original Code is SciTech Software, Inc.
-#    All Rights Reserved.
-#
-#  ========================================================================
-#
-# Descripton:   Generic DMAKE startup makefile definitions file. Assumes
-#               that the SCITECH environment variable has been set to point
-#               to where all our stuff is installed. You should not need
-#               to change anything in this file.
-#
-#               Borland C++ 2.0 32-bit OS/2 version.
-#
-#############################################################################
-
-# Include standard startup script definitions
-.IMPORT: SCITECH
-.INCLUDE: "$(SCITECH)\makedefs\startup.mk"
-
-# Import enivornment variables that we use
-.IMPORT .IGNORE : USE_OS2GUI BC_LIBBASE
-
-# We are compiling for a 32 bit envionment
-   _32BIT_      := 1
-
-# Default commands for compiling, assembling linking and archiving
-   CC           := bcc
-   CFLAGS       := -w- -4 -H=bcc32.sym -i60 -d
-.IF $(USE_NASM)
-   AS           := nasm
-   ASFLAGS      := -t -f obj -d__FLAT__ -iINCLUDE -i$(SCITECH)\INCLUDE
-.ELSE
-   AS           := tasm
-   ASFLAGS      := /t /mx /m /D__FLAT__ /D__OS2__ /iINCLUDE /i$(SCITECH)\INCLUDE
-.ENDIF
-   LD           := bclink tlink.exe
-   LDFLAGS      := -c
-   RC           := brcc
-   RCFLAGS      :=
-   LIB          := tlib
-   LIBFLAGS     := /C /P32
-   ILIB         := implib
-   ILIBFLAGS    := -c
-.IF $(USE_OS2GUI)
-   CFLAGS              += -D__OS2_PM__
-.ENDIF
-
-# Optionally turn on debugging information
-.IF $(DBG)
-   CFLAGS       += -v
-   LDFLAGS      += -v
-   LIBFLAGS     += /P128
-.IF $(USE_NASM)
-   ASFLAGS      += -F borland
-.ELSE
-   ASFLAGS      += /zi
-.ENDIF
-.ELSE
-   LDFLAGS      += -x
-.IF $(USE_NASM)
-   ASFLAGS      += -F null
-.ELSE
-   ASFLAGS      += /q
-.ENDIF
-.END
-
-# Optionally turn on optimisations
-.IF $(OPT)
-   CFLAGS       += -5 -O2 -k-
-.ELIF $(OPT_SIZE)
-   CFLAGS       += -5 -O1 -k-
-.END
-
-# Optionally turn on direct i387 FPU instructions
-.IF $(FPU)
-   CFLAGS       += -DFPU387
-   ASFLAGS      += -dFPU387
-.END
-
-# Optionally compile a beta release version of a product
-.IF $(BETA)
-   CFLAGS       += -DBETA
-   ASFLAGS      += -dBETA
-.END
-
-# Optionally use Phar Lap's TNT DOS Extender, otherwise use the DOS Power Pack
-.IF $(BUILD_DLL)
-   CFLAGS       += -sd -sm -DBUILD_DLL
-   ASFLAGS      += -dBUILD_DLL
-.ELSE
-   CFLAGS       += -sm
-.ENDIF
-   DEF_LIBS    := os2.lib c2mt.lib
-   DX_ASFLAGS   += -d__OS2__
-   LIB_OS       = os232
-
-# Define the base directory for library files
-
-.IF $(CHECKED)
-LIB_BASE_DIR   := $(SCITECH_LIB)\lib\debug
-CFLAGS          += -DCHECKED=1
-.ELSE
-LIB_BASE_DIR   := $(SCITECH_LIB)\lib\release
-.ENDIF
-
-# Define where to install library files
-   LIB_BASE     := $(LIB_BASE_DIR)\$(LIB_OS)\$(BC_LIBBASE)
-   LIB_DEST     := $(LIB_BASE)
-
-# Place to look for PMODE library files
-
-.IF $(USE_OS2GUI)
-DEF_LIBS        += pm_pm.lib
-.ELSE
-DEF_LIBS        += pm.lib
-.ENDIF
-
-# Define which file contains our rules
-
-   RULES_MAK   := bcos2.mk
diff --git a/board/MAI/bios_emulator/scitech/makedefs/cl16.mk b/board/MAI/bios_emulator/scitech/makedefs/cl16.mk
deleted file mode 100644 (file)
index 0f29a15..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-#############################################################################
-#
-#                                      SciTech Multi-platform Graphics Library
-#
-#  ========================================================================
-#
-#    The contents of this file are subject to the SciTech MGL Public
-#    License Version 1.0 (the "License"); you may not use this file
-#    except in compliance with the License. You may obtain a copy of
-#    the License at http://www.scitechsoft.com/mgl-license.txt
-#
-#    Software distributed under the License is distributed on an
-#    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-#    implied. See the License for the specific language governing
-#    rights and limitations under the License.
-#
-#    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-#
-#    The Initial Developer of the Original Code is SciTech Software, Inc.
-#    All Rights Reserved.
-#
-#  ========================================================================
-#
-# Descripton:   Generic DMAKE startup makefile definitions file. Assumes
-#               that the SCITECH environment variable has been set to point
-#               to where all our stuff is installed. You should not need
-#               to change anything in this file.
-#
-#               Microsoft C 6.0 16 bit version. Supports 16 bit
-#               OS/2 development.
-#
-#############################################################################
-
-# Include standard startup script definitions
-.IMPORT: SCITECH
-.INCLUDE: "$(SCITECH)\makedefs\startup.mk"
-
-# Import enivornment variables that we use
-.IMPORT .IGNORE : VC_LIBBASE
-.IMPORT .IGNORE : USE_MASM
-
-# Default commands for compiling, assembling linking and archiving
-   CC           := cl       # C-compiler and flags
-   CFLAGS       := /w /Gs
-   ASFLAGS      := /t /mx /m /D__COMM__ /iINCLUDE /i$(SCITECH)\INCLUDE
-.IF $(USE_TASM32)
-   AS           := tasm32
-.ELIF $(USE_TASMX)
-   AS           := tasmx    # Assembler and flags
-.ELIF $(USE_MASM)
-   AS           := masm    # Assembler and flags
-   ASFLAGS      := /D__COMM__ /iINCLUDE /i$(SCITECH)\INCLUDE
-.ELSE
-   AS           := tasm     # Assembler and flags
-.ENDIF
-   LD           := cl       # Loader and flags
-   LDFLAGS       = $(CFLAGS)
-   RC           := rc       # WIndows resource compiler
-   RCFLAGS      :=
-   LIB          := lib      # Librarian
-   LIBFLAGS     := /NOI /NOE
-   ILIB         := implib   # Import librarian
-   ILIBFLAGS    := /noignorecase
-
-# Optionally turn on debugging information
-.IF $(DBG)
-   CFLAGS       += /Zi  # Turn on debugging for C compiler
-   ASFLAGS      += /zi      # Turn on debugging for assembler
-.ELSE
-   ASFLAGS      += /q       # Suppress object records not needed for linking
-.END
-
-# Optionally turn on optimisations
-.IF $(OPT)
-   CFLAGS       += /Ox
-.END
-
-# Optionally turn on direct i387 FPU instructions
-
-.IF $(FPU)
-   CFLAGS       += /FPi87 /DFPU387
-   ASFLAGS      += /DFPU387 /DFPU_REG_RTN
-.END
-
-# Optionally compile a beta release version of a product
-.IF $(BETA)
-   CFLAGS       += /DBETA
-   ASFLAGS      += /DBETA
-.END
-
-# Use a larger stack during linking if requested ???? How the fuck do you
-# specify linker options on the CL command line?????
-
-.IF $(STKSIZE)
-.ENDIF
-
-# Optionally compile for 16 bit Windows
-.IF $(USE_WIN16)
-.IF $(BUILD_DLL)
-   CFLAGS       += /GD /Alfw /DBUILD_DLL
-   ASFLAGS      += -DBUILD_DLL
-.ELSE
-   CFLAGS       += /GA /AL
-.ENDIF
-   DX_ASFLAGS   += -D__WINDOWS16__
-   LIB_OS       = WIN16
-.ELSE
-   USE_REALDOS := 1
-   CFLAGS       += /AL
-   LIB_OS       = DOS16
-.END
-
-# Place to look for PMODE library files
-
-PMLIB           := pm.lib
-
-# Define the base directory for library files
-
-.IF $(CHECKED)
-LIB_BASE_DIR   := $(SCITECH_LIB)\lib\debug
-CFLAGS                 += -DCHECKED=1
-.ELSE
-LIB_BASE_DIR   := $(SCITECH_LIB)\lib\release
-.ENDIF
-
-# Define where to install library files
-   LIB_BASE     := $(LIB_BASE_DIR)\$(LIB_OS)\$(VC_LIBBASE)
-   LIB_DEST     := $(LIB_BASE)
-
-# Define which file contains our rules
-
-   RULES_MAK   := cl16.mk
diff --git a/board/MAI/bios_emulator/scitech/makedefs/cl386.mk b/board/MAI/bios_emulator/scitech/makedefs/cl386.mk
deleted file mode 100644 (file)
index 52157f9..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-#############################################################################
-#
-#                                       SciTech Multi-platform Graphics Library
-#
-#  ========================================================================
-#
-#    The contents of this file are subject to the SciTech MGL Public
-#    License Version 1.0 (the "License"); you may not use this file
-#    except in compliance with the License. You may obtain a copy of
-#    the License at http://www.scitechsoft.com/mgl-license.txt
-#
-#    Software distributed under the License is distributed on an
-#    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-#    implied. See the License for the specific language governing
-#    rights and limitations under the License.
-#
-#    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-#
-#    The Initial Developer of the Original Code is SciTech Software, Inc.
-#    All Rights Reserved.
-#
-#  ========================================================================
-#
-# Descripton:   Generic DMAKE startup makefile definitions file. Assumes
-#               that the SCITECH environment variable has been set to point
-#               to where all our stuff is installed. You should not need
-#               to change anything in this file.
-#
-#               Microsoft 386 C 6.0 32 bit. Supports 32 bit
-#               OS/2 development.
-#
-#############################################################################
-
-# Include standard startup script definitions
-.IMPORT: SCITECH
-.INCLUDE: "$(SCITECH)\makedefs\startup.mk"
-
-# Import enivornment variables that we use
-.IMPORT .IGNORE : CL_LIBBASE USE_VDD
-.IMPORT .IGNORE : USE_MASM
-
-# Default commands for compiling, assembling linking and archiving
-   CC           := cl386       # C-compiler and flags
-   # NB: The -Zf flag is ABSOLUTELY NECESSARY to compile IBM's OS/2 headers.
-   #     It isn't documented anywhere but obviously adds support for 48-bit
-   #     far pointers (ie. _far is valid in 32-bit code). Great.
-   CFLAGS       := -G3s -Zf -D__386__
-   ASFLAGS      := /t /mx /m /oi /D__FLAT__ /DSTDCALL_MANGLE /D__NOU_VAR__ /iINCLUDE /i$(SCITECH)\INCLUDE
-.IF $(USE_TASM32)
-   AS           := tasm32
-.ELIF $(USE_TASMX)
-   AS           := tasmx   # Assembler and flags
-.ELIF $(USE_MASM)
-   AS           := masm    # Assembler and flags
-   ASFLAGS      := /t /mx /D__FLAT__ /DSTDCALL_MANGLE /D__NOU_VAR__ /iINCLUDE /i$(SCITECH)\INCLUDE
-.ELSE
-   AS           := tasm     # Assembler and flags
-.ENDIF
-   LD           := link386  # Linker and flags
-   LDFLAGS       = $(CFLAGS)
-   RC           := rc       # Windows resource compiler
-   RCFLAGS      :=
-   LIB          := lib      # Librarian
-   LIBFLAGS     := /NOI /NOE
-   ILIB         := implib   # Import librarian
-   ILIBFLAGS    := /noignorecase
-
-# Optionally turn on debugging information
-.IF $(DBG)
-   CFLAGS       += -Zi      # Turn on debugging for C compiler
-   ASFLAGS      += /zi      # Turn on debugging for assembler
-.ELSE
-   ASFLAGS      += /q       # Suppress object records not needed for linking
-.END
-
-# Optionally turn on optimisations
-.IF $(OPT)
-   CFLAGS       += /Ox
-.END
-
-# Optionally turn on direct i387 FPU instructions
-
-.IF $(FPU)
-   CFLAGS       += /FPi87 /DFPU387
-   ASFLAGS      += /DFPU387 /DFPU_REG_RTN
-.END
-
-# Optionally compile a beta release version of a product
-.IF $(BETA)
-   CFLAGS       += /DBETA
-   ASFLAGS      += /DBETA
-.END
-
-# Use a larger stack during linking if requested ???? How the fuck do you
-# specify linker options on the CL command line?????
-
-.IF $(STKSIZE)
-.ENDIF
-
-# Place to look for PMODE library files
-
-PMLIB           := pm.lib
-
-# Define the base directory for library files
-
-.IF $(CHECKED)
-LIB_BASE_DIR    := $(SCITECH_LIB)\lib\debug
-CFLAGS                  += -DCHECKED=1
-.ELSE
-LIB_BASE_DIR    := $(SCITECH_LIB)\lib\release
-.ENDIF
-
-# Define where to install library files
-   LIB_OS       = os232
-   LIB_BASE     := $(LIB_BASE_DIR)\$(LIB_OS)\$(CL_LIBBASE)
-   LIB_DEST     := $(LIB_BASE)
-
-# Define which file contains our rules
-
-   RULES_MAK    := cl386.mk
diff --git a/board/MAI/bios_emulator/scitech/makedefs/common.mk b/board/MAI/bios_emulator/scitech/makedefs/common.mk
deleted file mode 100644 (file)
index d337152..0000000
+++ /dev/null
@@ -1,180 +0,0 @@
-#############################################################################
-#
-#                                      SciTech Multi-platform Graphics Library
-#
-#  ========================================================================
-#
-#    The contents of this file are subject to the SciTech MGL Public
-#    License Version 1.0 (the "License"); you may not use this file
-#    except in compliance with the License. You may obtain a copy of
-#    the License at http://www.scitechsoft.com/mgl-license.txt
-#
-#    Software distributed under the License is distributed on an
-#    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-#    implied. See the License for the specific language governing
-#    rights and limitations under the License.
-#
-#    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-#
-#    The Initial Developer of the Original Code is SciTech Software, Inc.
-#    All Rights Reserved.
-#
-#  ========================================================================
-#
-# Descripton:   Common makefile targets used by all SciTech Software
-#               makefiles. This file includes targets for cleaning the
-#               current directory, and maintaining the source files with
-#               RCS.
-#
-#############################################################################
-
-# Override global OpenGL includes when compiling against MGL version
-
-.IF $(USE_MGL_OPENGL)
-.IF $(UNIX_HOST)
-CFLAGS         += -I$(SCITECH)/include/mglgl
-DEPEND_INC     += $(SCITECH)/include/mglgl
-.ELSE
-CFLAGS         += -I$(SCITECH)\include\mglgl
-DEPEND_INC     += $(SCITECH)\include/mglgl
-.ENDIF
-.ENDIF
-
-# Define where to install all compiled DLL files
-
-.IF $(UNIX_HOST)
-.IF $(CHECKED)
-DLL_DEST    := $(SCITECH_LIB)/redist/debug
-.ELSE
-DLL_DEST    := $(SCITECH_LIB)/redist/release
-.ENDIF
-.ELSE
-.IF $(CHECKED)
-DLL_DEST    := $(SCITECH_LIB)\redist\debug
-.ELSE
-DLL_DEST    := $(SCITECH_LIB)\redist\release
-.ENDIF
-.ENDIF
-
-# Target to build the library and DLL file if specified
-
-.IF $(LIBFILE)
-
-lib: $(LIBFILE)
-
-.IF $(DLLFILE)
-
-# Build and install a DLL file, or simply build import library and install
-
-.IF $(BUILD_DLL)
-
-$(DLLFILE): $(OBJECTS)
-$(LIBFILE): $(DLLFILE)
-install: $(LIBFILE) $(DLLFILE)
-       $(INSTALL) $(LIBFILE) $(LIB_DEST)$(LIB_EXTENDER)
-       $(INSTALL) $(DLLFILE) $(DLL_DEST)
-.IF $(USE_SOFTICE)
-       $(INSTALL) $(DLLFILE:s/.dll/.nms) $(DLL_DEST)
-.ENDIF
-.ELSE
-
-$(LIBFILE): $(DLL_DEST)\$(DLLFILE)
-install: $(LIBFILE)
-       $(INSTALL) $(LIBFILE) $(LIB_DEST)$(LIB_EXTENDER)
-
-.ENDIF
-.ELSE
-
-.IF $(BUILD_DLL)
-
-# Build and install a Unix shared library
-
-$(LIBFILE): $(OBJECTS)
-install: $(LIBFILE)
-       $(INSTALL) $(LIBFILE) $(LIB_DEST)$(LIB_EXTENDER)
-       $(INSTALL) $(LIBFILE) $(DLL_DEST)/$(LIBFILE).$(VERSION)
-
-.ELSE
-
-# Build and install a normal library file
-
-.IF $(USE_DLL)
-.ELSE
-$(LIBFILE): $(OBJECTS)
-install: $(LIBFILE)
-       $(INSTALL) $(LIBFILE) $(LIB_DEST)$(LIB_EXTENDER)
-.ENDIF
-.ENDIF
-.ENDIF
-.ENDIF
-
-# Build and install a VxD file, including debug information
-
-.IF $(VXDFILE)
-$(VXDFILE:s/.vxd/.dll): $(OBJECTS)
-$(VXDFILE): $(VXDFILE:s/.vxd/.dll)
-install: $(VXDFILE)
-       $(INSTALL) $(VXDFILE) $(DLL_DEST)
-.IF $(DBG)
-       $(INSTALL) $(VXDFILE:s/.vxd/.nms) $(DLL_DEST)
-.ENDIF
-.ENDIF
-
-# Clean up directory removing all files not needed to make the library.
-
-__CLEAN_FILES := *.obj *.o *.sym *.bak *.tdk *.swp *.map *.err *.csm *.lib *.aps *.nms *.sys
-__CLEAN_FILES += *.~* *.td *.tr *.tr? *.td? *.rws *.res *.exp *.ilk *.pdb *.pch *.a bcc32.*
-__CLEAN_FILES += $(LIBCLEAN)
-__CLEANEXE_FILES := $(__CLEAN_FILES) *$E *.drv *.rex *.dll *.vxd *.nms *.pel *.smf *.so.*
-
-.PHONY clean:
-       @$(RM) -f -S $(mktmp $(__CLEAN_FILES:t"\n"))
-
-.PHONY cleanexe:
-       @$(RM) -f -S $(mktmp $(__CLEANEXE_FILES:t"\n"))
-
-# Define the source directories to find common files
-
-.IF $(NO_SCITECH_COMMON)
-.ELSE
-.SOURCE:                  $(SCITECH)/src/common
-.ENDIF
-
-# Create the include file dependencies using the MKUTIL makedep program if
-# the list of dependent object files is defined
-
-.IF $(DEPEND_OBJ)
-depend:
-       @$(RM) -f makefile.dep
-.IF $(DEPEND_SRC)
-.IF $(DEPEND_INC)
-       @makedep -amakefile.dep -r -s -I@$(mktmp $(DEPEND_INC:s/\/\\)) -S@$(mktmp $(DEPEND_SRC:s/\/\\);$(SCITECH)/src/common) @$(mktmp $(DEPEND_OBJ:t"\n")\n)
-.ELSE
-       @makedep -amakefile.dep -r -s -S@$(mktmp $(DEPEND_SRC:s/\/\\);$(SCITECH)/src/common) @$(mktmp $(DEPEND_OBJ:t"\n")\n)
-.ENDIF
-.ELSE
-.IF $(DEPEND_INC)
-       @makedep -amakefile.dep -r -s -I@$(mktmp $(DEPEND_INC:s/\/\\)) -S@$(mktmp $(SCITECH)/src/common) @$(mktmp $(DEPEND_OBJ:t"\n")\n)
-.ELSE
-       @makedep -amakefile.dep -r -s -S@$(mktmp $(SCITECH)/src/common) @$(mktmp $(DEPEND_OBJ:t"\n")\n)
-.ENDIF
-.ENDIF
-       @$(ECHO) Object file dependency information generated.
-.ENDIF
-
-# Set up for compiling Snap executeables and dynamic link libraries
-
-.IF $(USE_SNAP)
-#CFLAGS        += -I$(PRIVATE)\include\drvlib -I$(SCITECH)\include\drvlib -D__SNAP__
-CFLAGS         += -D__SNAP__
-ASFLAGS        += -d__SNAP__
-#EXELIBS               += snap$L
-.ENDIF
-
-# Include rule definitions for the compiler
-
-.INCLUDE: "$(SCITECH)/makedefs/rules/$(RULES_MAK)"
-
-# Include file dependencies
-
-.INCLUDE .IGNORE: "makefile.dep"
diff --git a/board/MAI/bios_emulator/scitech/makedefs/emx.mk b/board/MAI/bios_emulator/scitech/makedefs/emx.mk
deleted file mode 100644 (file)
index f569790..0000000
+++ /dev/null
@@ -1,194 +0,0 @@
-#############################################################################
-#
-#                                      SciTech Multi-platform Graphics Library
-#
-#  ========================================================================
-#
-#    The contents of this file are subject to the SciTech MGL Public
-#    License Version 1.0 (the "License"); you may not use this file
-#    except in compliance with the License. You may obtain a copy of
-#    the License at http://www.scitechsoft.com/mgl-license.txt
-#
-#    Software distributed under the License is distributed on an
-#    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-#    implied. See the License for the specific language governing
-#    rights and limitations under the License.
-#
-#    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-#
-#    The Initial Developer of the Original Code is SciTech Software, Inc.
-#    All Rights Reserved.
-#
-#  ========================================================================
-#
-# Descripton:   Generic DMAKE startup makefile definitions file. Assumes
-#               that the SCITECH environment variable has been set to point
-#               to where all our stuff is installed. You should not need
-#               to change anything in this file.
-#
-#               OS/2 version for EMX/GNU C/C++.
-#
-#############################################################################
-
-# Include standard startup script definitions
-.IMPORT: SCITECH
-.INCLUDE: "$(SCITECH)\makedefs\startup.mk"
-
-# Disable warnings for macros redefined here that were given
-# on the command line.
-__.SILENT       := $(.SILENT)
-.SILENT         := yes
-
-# Import enivornment variables that we use common to all compilers
-.IMPORT .IGNORE : TEMP SHELL INCLUDE LIB SCITECH PRIVATE SCITECH_LIB
-.IMPORT .IGNORE : DBG OPT OPT_SIZE CRTDLL SHW BETA CHECKED NO_EXCEPT NO_RTTI
-.IMPORT .IGNORE : FULLSCREEN SHOW_ARGS
-   TMPDIR       := $(TEMP)
-
-# Standard file suffix definitions
-   L            := .lib         # Libraries
-   E            := .exe         # Executables
-   O            := .obj         # Objects
-   A            := .asm         # Assembler sources
-   S            := .s           # GNU assembler sources
-   P            := .cpp         # C++ sources
-
-# File prefix/suffix definitions. The following prefixes are defined, and are
-# used primarily to abstract between the Unix style libXX.a naming convention
-# and the DOS/Windows/OS2 naming convention of XX.lib.
-   LP           :=              # LP - Library file prefix (name of file on disk)
-   LL           := -l           # Library link prefix (name of library on link command line)
-   LE           :=              # Library link suffix (extension of library on link command line)
-
-# Import enivornment variables that we use
-.IMPORT .IGNORE : EMX_LIBBASE USE_OS232 USE_OS2GUI
-
-# We are compiling for a 32 bit envionment
-   _32BIT_      := 1
-
-# DMAKE uses this recipe to remove intermediate targets
-.REMOVE :; $(RM) -f $<
-
-# Turn warnings back to previous setting.
-.SILENT := $(__.SILENT)
-
-# We dont use TABS in our makefiles
-.NOTABS         := yes
-
-# Default commands for compiling, assembling linking and archiving.
-   CC           := gcc
-   CFLAGS       := -Zmt -Zomf -Wall -I. -I$(INCLUDE)
-   CXX          := gcc -x c++ -fno-exceptions -fno-rtti
-.IF $(USE_NASM)
-   AS           := nasm
-   ASFLAGS      := -t -f obj -F null -d__FLAT__ -d__NOU__ -iINCLUDE -i$(SCITECH)\INCLUDE
-.ELSE
-   AS           := tasm     # Assembler and flags
-   ASFLAGS      := /t /mx /m /oi /D__FLAT__ /D__NOU__ /iINCLUDE /i$(SCITECH)\INCLUDE
-.ENDIF
-   LD           := gcc
-   LDXX         := gcc -x c++
-   LDFLAGS      := -L. -Zomf -Zmt
-   LIB          := emxomfar
-   LIBFLAGS     := -p32 rcv
-
-   YACC         := bison -y
-   LEX          := flex
-   SED          := sed
-
-# Optionally turn off exceptions and RTTI for C++ code
-.IF $(NO_EXCEPT)
-   CXX          += -fno-exceptions
-.ENDIF
-.IF $(NO_RTTI)
-   CXX          += -fno-rtti
-.ENDIF
-
-# Optionally turn on debugging information
-.IF $(DBG)
-   CFLAGS       += -g
-.ELSE
-# Without -s, emx always runs LINK386 with the /DEBUG option
-   CFLAGS       += -s
-   LDFLAGS      += -s
-# NASM does not support debugging information yet
-   ASFLAGS      +=
-.ENDIF
-
-# Optionally turn on optimisations
-.IF $(OPT_MAX)
-   CFLAGS       += -O6
-.ELIF $(OPT)
-   CFLAGS       += -O3 -fomit-frame-pointer
-.ELIF $(OPT_SIZE)
-   CFLAGS       += -Os
-.ENDIF
-
-# Optionally turn on direct i387 FPU instructions
-.IF $(FPU)
-   CFLAGS       += -DFPU387
-   ASFLAGS      += -dFPU387
-.END
-
-# Optionally compile a beta release version of a product
-.IF $(BETA)
-   CFLAGS       += -DBETA
-   ASFLAGS      += -dBETA
-.ENDIF
-
-# Disable standard C runtime library
-.IF $(NO_RUNTIME)
-CFLAGS                  += -fno-builtin -nostdinc
-.ENDIF
-
-# Link against EMX DLLs (CRTDLL=1) or link with static C runtime libraries
-.IF $(CRTDLL)
-  LDFLAGS       += -Zcrtdll
-.ELSE
-  CFLAGS               += -Zsys
-  LDFLAGS       += -Zsys
-.ENDIF
-
-# Target environment dependant flags
-   CFLAGS       += -D__OS2_32__
-   CFLAGS       += -D__OS2__
-   ASFLAGS      += -d__OS2__
-
-# Define the base directory for library files
-
-.IF $(CHECKED)
-LIB_BASE_DIR    := $(SCITECH_LIB)/lib/debug
-CFLAGS          += -DCHECKED=1
-.ELSE
-LIB_BASE_DIR    := $(SCITECH_LIB)/lib/release
-.ENDIF
-
-# Define where to install library files
-   LIB_DEST     := $(LIB_BASE_DIR)\OS232\$(EMX_LIBBASE)
-   LDFLAGS      += -L$(LIB_DEST)
-
-# Build 32-bit OS/2 apps
-.IF $(BUILD_DLL)
-   CFLAGS       += -Zdll -DBUILD_DLL
-   LDFLAGS      += -Zdll
-   ASFLAGS      += -dBUILD_DLL
-.ELSE
-.IF $(USE_OS2GUI)
-   CFLAGS       += -D__OS2_PM__
-   LDFLAGS      += -Zlinker /PMTYPE:PM
-.ELSE
-.IF $(FULLSCREEN)
-   LDFLAGS      += -Zlinker /PMTYPE:NOVIO
-.ELSE
-   LDFLAGS      += -Zlinker /PMTYPE:VIO
-.ENDIF
-.ENDIF
-.ENDIF
-
-# Place to look for PMODE library files
-
-PMLIB           := -lpm
-
-# Define which file contains our rules
-
-   RULES_MAK    := emx.mk
diff --git a/board/MAI/bios_emulator/scitech/makedefs/gcc_beos.mk b/board/MAI/bios_emulator/scitech/makedefs/gcc_beos.mk
deleted file mode 100644 (file)
index 0d62fdf..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-#############################################################################
-#
-#                                      SciTech Multi-platform Graphics Library
-#
-#  ========================================================================
-#
-#    The contents of this file are subject to the SciTech MGL Public
-#    License Version 1.0 (the "License"); you may not use this file
-#    except in compliance with the License. You may obtain a copy of
-#    the License at http://www.scitechsoft.com/mgl-license.txt
-#
-#    Software distributed under the License is distributed on an
-#    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-#    implied. See the License for the specific language governing
-#    rights and limitations under the License.
-#
-#    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-#
-#    The Initial Developer of the Original Code is SciTech Software, Inc.
-#    All Rights Reserved.
-#
-#  ========================================================================
-#
-# Descripton:   Generic DMAKE startup makefile definitions file. Assumes
-#               that the SCITECH environment variable has been set to point
-#               to where all our stuff is installed. You should not need
-#               to change anything in this file.
-#
-#               BeOS version for GNU C/C++.
-#
-#############################################################################
-
-# Disable warnings for macros redefined here that were given
-# on the command line.
-__.SILENT       := $(.SILENT)
-.SILENT         := yes
-
-# Import enivornment variables that we use common to all compilers
-.IMPORT .IGNORE : TEMP SHELL INCLUDE LIB SCITECH PRIVATE SCITECH_LIB
-.IMPORT .IGNORE : DBG OPT OPT_SIZE SHW BETA CHECKED USE_X11 USE_LINUX
-.IMPORT .IGNORE : USE_EGCS USE_PGCC STATIC_LIBS LIBC
-   TMPDIR       := $(TEMP)
-
-# Standard file suffix definitions
-#
-# NOTE: BeOS does not require any extenion for executeable files, but you
-#       can use an extension if you wish. We use the .x extension for building
-#       executeable files so that we can use implicit rules to make the
-#       makefiles simpler and more portable between systems. When you install
-#       the files to a local bin directory, you will probably want to remove
-#       the .x extension.
-   L            := .a          # Libraries
-   E            := .x          # Executables
-   O            := .o          # Objects
-   A            := .asm        # Assembler sources
-   S            := .s       # GNU assembler sources
-   P            := .cpp        # C++ sources
-
-# File prefix/suffix definitions. The following prefixes are defined, and are
-# used primarily to abstract between the Unix style libXX.a naming convention
-# and the DOS/Windows/OS2 naming convention of XX.lib.
-   LP           := lib      # LP - Library file prefix (name of file on disk)
-   LL           := -l          # Library link prefix (name of library on link command line)
-   LE           :=                 # Library link suffix (extension of library on link command line)
-
-# We use the Unix shell at all times
-   SHELLFLAGS   := -c
-
-# Definition of $(MAKE) macro for recursive makes.
-   MAKE = $(MAKECMD) $(MFLAGS)
-
-# Macro to install a library file
-   INSTALL      := cp
-
-# DMAKE uses this recipe to remove intermediate targets
-.REMOVE :; $(RM) -f $<
-
-# Turn warnings back to previous setting.
-.SILENT := $(__.SILENT)
-
-# We dont use TABS in our makefiles
-.NOTABS         := yes
-
-# Define that we are compiling for BeOS
-   USE_BEOS     := 1
-
-# Default commands for compiling, assembling linking and archiving.
-   CC           := gcc
-   CFLAGS       := -Wall -I. -Iinclude $(INCLUDE)
-   CXX          := g++
-   AS           := nasm
-   ASFLAGS      := -f elf -d__FLAT__ -iinclude -i$(SCITECH)/include -d__NOU__
-   LD           := gcc
-   LDFLAGS      := -L.
-   LIB          := ar
-   LIBFLAGS     := rcs
-
-# Link to static libraries if requested
-.IF $(STATIC_LIBS)
-   LDFLAGS      += -static
-.ENDIF
-
-# Optionally turn on debugging information
-.IF $(DBG)
-   CFLAGS       += -g
-.ELSE
-# NASM does not support debugging information yet
-   ASFLAGS      +=
-.ENDIF
-
-# Optionally turn on optimisations
-.IF $(OPT_MAX)
-   CFLAGS       += -O6
-.ELIF $(OPT)
-   CFLAGS       += -O2
-.ELIF $(OPT_SIZE)
-   CFLAGS       += -O1
-.ENDIF
-
-# Optionally turn on direct i387 FPU instructions
-.IF $(FPU)
-   CFLAGS       += -DFPU387
-   ASFLAGS      += -dFPU387
-.END
-
-# Optionally compile a beta release version of a product
-.IF $(BETA)
-   CFLAGS       += -DBETA
-   ASFLAGS      += -dBETA
-.ENDIF
-
-# Disable standard C runtime library
-
-.IF $(NO_RUNTIME)
-CFLAGS                 += -fno-builtin -nostdinc
-.ENDIF
-
-# Target environment dependant flags
-   CFLAGS       += -D__BEOS__
-   ASFLAGS      += -d__BEOS__ -d__UNIX__
-
-# Define the base directory for library files
-
-.IF $(CHECKED)
-LIB_BASE_DIR   := $(SCITECH_LIB)/lib/debug
-CFLAGS         += -DCHECKED=1
-.ELSE
-LIB_BASE_DIR   := $(SCITECH_LIB)/lib/release
-.ENDIF
-
-# Define where to install library files
-LIB_DEST     := $(LIB_BASE_DIR)/beos/gcc
-LDFLAGS      += -L$(LIB_DEST)
-
-# Place to look for PMODE library files
-
-PMLIB           := -lpm
-
-# Define which file contains our rules
-
-   RULES_MAK   := gcc_beos.mk
diff --git a/board/MAI/bios_emulator/scitech/makedefs/gcc_dos.mk b/board/MAI/bios_emulator/scitech/makedefs/gcc_dos.mk
deleted file mode 100644 (file)
index 65589c8..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-#############################################################################
-#
-#                                      SciTech Multi-platform Graphics Library
-#
-#  ========================================================================
-#
-#    The contents of this file are subject to the SciTech MGL Public
-#    License Version 1.0 (the "License"); you may not use this file
-#    except in compliance with the License. You may obtain a copy of
-#    the License at http://www.scitechsoft.com/mgl-license.txt
-#
-#    Software distributed under the License is distributed on an
-#    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-#    implied. See the License for the specific language governing
-#    rights and limitations under the License.
-#
-#    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-#
-#    The Initial Developer of the Original Code is SciTech Software, Inc.
-#    All Rights Reserved.
-#
-#  ========================================================================
-#
-# Descripton:   Generic DMAKE startup makefile definitions file. Assumes
-#               that the SCITECH environment variable has been set to point
-#               to where all our stuff is installed. You should not need
-#               to change anything in this file.
-#
-#               DJGPP V2 port of GNU C/C++ to DOS with DPMI only.
-#
-#############################################################################
-
-# Include standard startup script definitions
-.IMPORT: SCITECH
-.INCLUDE: "$(SCITECH)\makedefs\startup.mk"
-
-# Override some file suffix definitions
-   L            := .a     # Libraries
-   O            := .o     # Objects
-
-# Override the file prefix/suffix definitions for library naming.
-   LP           := lib         # LP - Library file prefix (name of file on disk)
-   LL           := -l          # Library link prefix (name of library on link command line)
-   LE           :=                     # Library link suffix (extension of library on link command line)
-
-# Import enivornment variables that we use
-.IMPORT .IGNORE : DJ_LIBBASE
-
-# We are compiling for a 32 bit envionment
-   _32BIT_      := 1
-
-# Default commands for compiling, assembling linking and archiving
-   CC           := gcc      # C-compiler and flags
-   CFLAGS       := -Wall
-   AS                  := nasm
-   ASFLAGS      := -t -f coff -F null -d__FLAT__ -d__GNUC__ -dSTDCALL_USCORE -iINCLUDE -i$(SCITECH)\INCLUDE
-   LD           := dj_ld    # Loader and flags
-   LDFLAGS      :=
-   LIB          := ar       # Librarian
-   LIBFLAGS     := rs
-   USE_NASM            := 1
-   USE_GCC             := 1
-
-# Optionally turn on debugging information
-.IF $(DBG)
-   CFLAGS       += -g       # Turn on debugging for C compiler
-.END
-
-# Optionally turn on optimisations
-.IF $(OPT)
-   CFLAGS       += -O2
-.ELIF $(OPT_SIZE)
-   CFLAGS       += -O1
-.END
-
-# Optionally turn on direct i387 FPU instructions
-
-.IF $(FPU)
-   CFLAGS       += -DFPU387
-   ASFLAGS      += -dFPU387
-.END
-
-# Optionally compile a beta release version of a product
-.IF $(BETA)
-   CFLAGS       += -DBETA
-   ASFLAGS      += -dBETA
-.END
-
-# DOS extender dependant flags
-   DX_CFLAGS    +=
-   DX_ASFLAGS   += -dDJGPP
-   USE_REALDOS := 1
-
-# Define the base directory for library files
-
-.IF $(CHECKED)
-LIB_BASE_DIR   := $(SCITECH_LIB)\lib\debug
-CFLAGS                 += -DCHECKED=1
-.ELSE
-LIB_BASE_DIR   := $(SCITECH_LIB)\lib\release
-.ENDIF
-
-# Define where to install library files
-   LIB_DEST     := $(LIB_BASE_DIR)\DOS32\$(DJ_LIBBASE)
-
-# Place to look for PMODE library files
-
-PMLIB           := -lpm
-
-# Define which file contains our rules
-
-   RULES_MAK   := dj32.mk
diff --git a/board/MAI/bios_emulator/scitech/makedefs/gcc_freebsd.mk b/board/MAI/bios_emulator/scitech/makedefs/gcc_freebsd.mk
deleted file mode 100644 (file)
index 0cb4b85..0000000
+++ /dev/null
@@ -1,174 +0,0 @@
-#############################################################################
-#
-#                                      SciTech Multi-platform Graphics Library
-#
-#  ========================================================================
-#
-#    The contents of this file are subject to the SciTech MGL Public
-#    License Version 1.0 (the "License"); you may not use this file
-#    except in compliance with the License. You may obtain a copy of
-#    the License at http://www.scitechsoft.com/mgl-license.txt
-#
-#    Software distributed under the License is distributed on an
-#    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-#    implied. See the License for the specific language governing
-#    rights and limitations under the License.
-#
-#    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-#
-#    The Initial Developer of the Original Code is SciTech Software, Inc.
-#    All Rights Reserved.
-#
-#  ========================================================================
-#
-# Descripton:   Generic DMAKE startup makefile definitions file. Assumes
-#               that the SCITECH environment variable has been set to point
-#               to where all our stuff is installed. You should not need
-#               to change anything in this file.
-#
-#               Linux version for GNU C/C++.
-#
-#############################################################################
-
-# Disable warnings for macros redefined here that were given
-# on the command line.
-__.SILENT       := $(.SILENT)
-.SILENT         := yes
-
-# Import enivornment variables that we use common to all compilers
-.IMPORT .IGNORE : TEMP SHELL INCLUDE LIB SCITECH PRIVATE SCITECH_LIB
-.IMPORT .IGNORE : DBG OPT OPT_SIZE SHW BETA CHECKED USE_X11 USE_FREEBSD
-.IMPORT .IGNORE : USE_EGCS USE_PGCC STATIC_LIBS
-   TMPDIR       := $(TEMP)
-
-# Standard file suffix definitions
-#
-# NOTE: Linux does not require any extenion for executeable files, but you
-#       can use an extension if you wish. We use the .x extension for building
-#       executeable files so that we can use implicit rules to make the
-#       makefiles simpler and more portable between systems. When you install
-#       the files to a local bin directory, you will probably want to remove
-#       the .x extension.
-   L            := .a          # Libraries
-   E            := .x          # Executables
-   O            := .o          # Objects
-   A            := .asm        # Assembler sources
-   S            := .s       # GNU assembler sources
-   P            := .cpp        # C++ sources
-
-# File prefix/suffix definitions. The following prefixes are defined, and are
-# used primarily to abstract between the Unix style libXX.a naming convention
-# and the DOS/Windows/OS2 naming convention of XX.lib.
-   LP           := lib      # LP - Library file prefix (name of file on disk)
-   LL           := -l          # Library link prefix (name of library on link command line)
-   LE           :=                 # Library link suffix (extension of library on link command line)
-
-# We use the Unix shell at all times
-   SHELL               := /bin/sh
-   SHELLFLAGS   := -c
-
-# Definition of $(MAKE) macro for recursive makes.
-   MAKE = $(MAKECMD) $(MFLAGS)
-
-# Macro to install a library file
-   INSTALL      := cp
-
-# DMAKE uses this recipe to remove intermediate targets
-.REMOVE :; $(RM) -f $<
-
-# Turn warnings back to previous setting.
-.SILENT := $(__.SILENT)
-
-# We dont use TABS in our makefiles
-.NOTABS         := yes
-
-# Define that we are compiling for FreeBSD
-   USE_LINUX    := 1
-
-# Default commands for compiling, assembling linking and archiving.
-.IF $(USE_EGCS)
-   CC           := egcs
-.ELIF $(USE_PGCC)
-   CC          := pgcc
-.ELSE
-   CC           := gcc
-.ENDIF
-   CFLAGS       := -Wall -I. -Iinclude $(INCLUDE)
-   CXX          := g++
-   AS           := nasm
-# TODO: On earlier versions of FreeBSD (<3.0) a.out is used instead of ELF
-   ASFLAGS      := -f elf -d__FLAT__ -iinclude -i$(SCITECH)/include -d__NOU__
-   LD           := g++
-   LDFLAGS      := -L.
-   LIB          := ar
-   LIBFLAGS     := rcs
-
-# Link to static libraries if requested
-.IF $(STATIC_LIBS)
-   LDFLAGS      += -static
-.ENDIF
-
-# Optionally turn on debugging information
-.IF $(DBG)
-   CFLAGS       += -g
-.ELSE
-# NASM does not support debugging information yet
-   ASFLAGS      +=
-.ENDIF
-
-# Optionally turn on optimisations
-.IF $(OPT_MAX)
-   CFLAGS       += -O6
-.ELIF $(OPT)
-   CFLAGS       += -O2
-.ELIF $(OPT_SIZE)
-   CFLAGS       += -O1
-.ENDIF
-
-# Optionally turn on direct i387 FPU instructions
-.IF $(FPU)
-   CFLAGS       += -DFPU387
-   ASFLAGS      += -dFPU387
-.END
-
-# Optionally compile a beta release version of a product
-.IF $(BETA)
-   CFLAGS       += -DBETA
-   ASFLAGS      += -dBETA
-.ENDIF
-
-# Disable standard C runtime library
-
-.IF $(NO_RUNTIME)
-CFLAGS                 += -fno-builtin -nostdinc
-.ENDIF
-
-# Compile flag for whether to build X11 or non-X11 lib
-.IF $(USE_X11)
-   CFLAGS       += -D__X11__
-.ENDIF
-
-# Target environment dependant flags
-   CFLAGS       += -D__FREEBSD__
-   ASFLAGS      += -d__FREEBSD__ -d__UNIX__
-
-# Define the base directory for library files
-
-.IF $(CHECKED)
-LIB_BASE_DIR   := $(SCITECH_LIB)/lib/debug
-CFLAGS         += -DCHECKED=1
-.ELSE
-LIB_BASE_DIR   := $(SCITECH_LIB)/lib/release
-.ENDIF
-
-# Define where to install library files
-   LIB_DEST     := $(LIB_BASE_DIR)/freebsd/gcc
-   LDFLAGS      += -L$(LIB_DEST)
-
-# Place to look for PMODE library files
-
-PMLIB           := -lpm
-
-# Define which file contains our rules
-
-   RULES_MAK   := gcc_freebsd.mk
diff --git a/board/MAI/bios_emulator/scitech/makedefs/gcc_linux.mk b/board/MAI/bios_emulator/scitech/makedefs/gcc_linux.mk
deleted file mode 100644 (file)
index 72c4ced..0000000
+++ /dev/null
@@ -1,180 +0,0 @@
-#############################################################################
-#
-#                                      SciTech Multi-platform Graphics Library
-#
-#  ========================================================================
-#
-#    The contents of this file are subject to the SciTech MGL Public
-#    License Version 1.0 (the "License"); you may not use this file
-#    except in compliance with the License. You may obtain a copy of
-#    the License at http://www.scitechsoft.com/mgl-license.txt
-#
-#    Software distributed under the License is distributed on an
-#    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-#    implied. See the License for the specific language governing
-#    rights and limitations under the License.
-#
-#    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-#
-#    The Initial Developer of the Original Code is SciTech Software, Inc.
-#    All Rights Reserved.
-#
-#  ========================================================================
-#
-# Descripton:   Generic DMAKE startup makefile definitions file. Assumes
-#               that the SCITECH environment variable has been set to point
-#               to where all our stuff is installed. You should not need
-#               to change anything in this file.
-#
-#               Linux version for GNU C/C++.
-#
-#############################################################################
-
-# Include standard startup script definitions
-.IMPORT: SCITECH
-.INCLUDE: "$(SCITECH)/makedefs/startup.mk"
-
-# Import enivornment variables that we use
-.IMPORT .IGNORE : GCC2_LIBBASE
-
-# Override some file suffix definitions
-   L            := .a     # Libraries
-   O            := .o     # Objects
-
-# Override the file prefix/suffix definitions for library naming.
-   LP           := lib         # LP - Library file prefix (name of file on disk)
-   LL           := -l          # Library link prefix (name of library on link command line)
-   LE           :=                     # Library link suffix (extension of library on link command line)
-
-# We are compiling for a 32 bit envionment
-   _32BIT_      := 1
-
-# Define that we are compiling for Linux
-   USE_LINUX    := 1
-
-# Default commands for compiling, assembling linking and archiving.
-   CC           := gcc
-   CFLAGS       := -Wall -I. -Iinclude -I$(SCITECH:s,\,/)/include -I$(PRIVATE:s,\,/)/include
-   SHOW_CFLAGS := -c
-   CXX          := g++
-   AS           := nasm
-   ASFLAGS      := -t -f elf -d__FLAT__ -d__GNUC__ -iinclude -i$(SCITECH)/include -d__NOU__
-   SHOW_ASFLAGS        := -f elf
-   LD           := gcc
-   LDXX                        := g++
-   LDFLAGS      := -L.
-   LIB          := ar
-   LIBFLAGS     := rcs
-   YACC                        := bison -y
-   LEX                 := flex
-   SED                 := sed
-
-# Optionally turn on debugging information
-.IF $(DBG)
-   CFLAGS       += -g
-   SHOW_CFLAGS  += -g
-.ELSE
-# NASM does not support debugging information yet
-   ASFLAGS      +=
-.ENDIF
-
-# Optionally turn on optimisations
-.IF $(OPT_MAX)
-   CFLAGS       += -O6
-   SHOW_CFLAGS  += -O6
-.ELIF $(OPT)
-   CFLAGS       += -O2
-   SHOW_CFLAGS  += -O2
-.ELIF $(OPT_SIZE)
-   CFLAGS       += -O1
-   SHOW_CFLAGS  += -O1
-.ENDIF
-
-# Optionally turn on direct i387 FPU instructions
-.IF $(FPU)
-   CFLAGS       += -DFPU387
-   ASFLAGS      += -dFPU387
-.END
-
-# Optionally compile a beta release version of a product
-.IF $(BETA)
-   CFLAGS       += -DBETA
-   SHOW_CFLAGS  += -DBETA
-   ASFLAGS      += -dBETA
-   SHOW_ASFLAGS += -dBETA
-.ENDIF
-
-# Disable standard C runtime library
-
-.IF $(NO_RUNTIME)
-CFLAGS                 += -fno-builtin -nostdinc
-.ENDIF
-
-# Compile flag for whether to build X11 or non-X11 lib
-.IF $(USE_X11)
-   CFLAGS       += -D__X11__
-.ENDIF
-
-# Target environment dependant flags
-   CFLAGS       += -D__LINUX__
-   ASFLAGS      += -d__LINUX__ -d__UNIX__
-
-# Define the base directory for library files
-
-.IF $(CHECKED)
-LIB_BASE_DIR   := $(SCITECH_LIB)/lib/debug
-CFLAGS             += -DCHECKED=1
-SHOW_CFLAGS        += -DCHECKED=1
-.ELSE
-LIB_BASE_DIR   := $(SCITECH_LIB)/lib/release
-.ENDIF
-
-# Define where to install library files
-.IF $(LIBC)
-   LIB_DEST_SHARED  := $(LIB_BASE_DIR)/linux/gcc/libc.so
-   LIB_DEST_STATIC  := $(LIB_BASE_DIR)/linux/gcc/libc
-.ELSE
-   LIB_DEST_SHARED  := $(LIB_BASE_DIR)/linux/gcc/glibc.so
-   LIB_DEST_STATIC  := $(LIB_BASE_DIR)/linux/gcc/glibc
-.ENDIF
-
-# Link to static libraries if requested
-.IF $(STATIC_LIBS_ALL)
-   LDFLAGS      += -static
-   STATIC_LIBS  := 1
-.ENDIF
-
-# Link to static libraries if requested
-.IF $(STATIC_LIBS)
-   LDFLAGS      += -L$(LIB_DEST_STATIC)
-.ELSE
-   LDFLAGS      += -L$(LIB_DEST_SHARED) -L$(LIB_DEST_STATIC)
-.ENDIF
-
-# Optionally enable some  dynamic libraries to be built
-.IF $(BUILD_DLL)
-.IF $(VERSIONMAJ)
-.ELSE
-   VERSIONMAJ  := 5
-   VERSIONMIN  := 0
-.ENDIF
-   VERSION      := $(VERSIONMAJ).$(VERSIONMIN)
-   LIB             := gcc -shared
-   LIBFLAGS        :=
-   L               := .so
-   CFLAGS          += -fPIC
-   SHOW_CFLAGS += -fPIC
-   ASFLAGS      += -D__PIC__
-   SHOW_ASFLAGS += -D__PIC__
-   LIB_DEST     := $(LIB_DEST_SHARED)
-.ELSE
-   LIB_DEST     := $(LIB_DEST_STATIC)
-.ENDIF
-
-# Place to look for PMODE library files
-
-PMLIB           := -lpm
-
-# Define which file contains our rules
-
-   RULES_MAK   := gcc_linux.mk
diff --git a/board/MAI/bios_emulator/scitech/makedefs/gcc_win32.mk b/board/MAI/bios_emulator/scitech/makedefs/gcc_win32.mk
deleted file mode 100644 (file)
index 21ccf97..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-#############################################################################
-#
-#                                      SciTech Multi-platform Graphics Library
-#
-#  ========================================================================
-#
-#    The contents of this file are subject to the SciTech MGL Public
-#    License Version 1.0 (the "License"); you may not use this file
-#    except in compliance with the License. You may obtain a copy of
-#    the License at http://www.scitechsoft.com/mgl-license.txt
-#
-#    Software distributed under the License is distributed on an
-#    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-#    implied. See the License for the specific language governing
-#    rights and limitations under the License.
-#
-#    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-#
-#    The Initial Developer of the Original Code is SciTech Software, Inc.
-#    All Rights Reserved.
-#
-#  ========================================================================
-#
-# Descripton:   Generic DMAKE startup makefile definitions file. Assumes
-#               that the SCITECH environment variable has been set to point
-#               to where all our stuff is installed. You should not need
-#               to change anything in this file.
-#
-#               Cygwin port of GNU C/C++ to Win32.
-#
-#############################################################################
-
-# Include standard startup script definitions
-.IMPORT: SCITECH
-.INCLUDE: "$(SCITECH)\makedefs\startup.mk"
-
-# Import enivornment variables that we use
-.IMPORT .IGNORE : GCC2_LIBBASE
-
-# Override some file suffix definitions
-   L            := .a     # Libraries
-   O            := .o     # Objects
-
-# Override the file prefix/suffix definitions for library naming.
-   LP           := lib         # LP - Library file prefix (name of file on disk)
-   LL           := -l          # Library link prefix (name of library on link command line)
-   LE           :=                     # Library link suffix (extension of library on link command line)
-
-# We are compiling for a 32 bit envionment
-   _32BIT_      := 1
-
-# Default commands for compiling, assembling linking and archiving
-   CC           := gcc      # C-compiler and flags
-   CFLAGS       := -Wall -I. -Iinclude -I$(SCITECH:s,\,/)/include -I$(PRIVATE:s,\,/)/include
-   SHOW_CFLAGS := -c
-   CXX          := g++
-   AS                  := nasm
-   ASFLAGS      := -t -f coff -F null -d__FLAT__ -d__GNUC__ -dSTDCALL_USCORE -iINCLUDE -i$(SCITECH)\INCLUDE
-   SHOW_ASFLAGS        := -f coff
-   LD           := gcc         # Loader and flags
-   LDXX                        := g++
-.IF $(WIN32_GUI)
-   LDFLAGS      := -L. -mwindows -e _mainCRTStartup
-.ELSE
-   LDFLAGS      := -L.
-.ENDIF
-   RC           := windres
-   RCFLAGS             := -O coff
-   LIB          := ar       # Librarian
-   LIBFLAGS     := rcs
-   YACC                        := bison -y
-   LEX                 := flex
-   SED                 := sed
-
-# Optionally turn on debugging information
-.IF $(DBG)
-   CFLAGS       += -g
-   SHOW_CFLAGS  += -g
-.ELSE
-# NASM does not support debugging information yet
-   ASFLAGS      +=
-.ENDIF
-
-# Optionally turn on optimisations
-.IF $(OPT_MAX)
-   CFLAGS       += -O6
-   SHOW_CFLAGS  += -O6
-.ELIF $(OPT)
-   CFLAGS       += -O2
-   SHOW_CFLAGS  += -O2
-.ELIF $(OPT_SIZE)
-   CFLAGS       += -O1
-   SHOW_CFLAGS  += -O1
-.ENDIF
-
-# Optionally turn on direct i387 FPU instructions
-
-.IF $(FPU)
-   CFLAGS       += -DFPU387
-   ASFLAGS      += -dFPU387
-.END
-
-# Optionally compile a beta release version of a product
-.IF $(BETA)
-   CFLAGS       += -DBETA
-   SHOW_CFLAGS  += -DBETA
-   ASFLAGS      += -dBETA
-   SHOW_ASFLAGS += -dBETA
-.ENDIF
-
-# DOS extender dependant flags
-   DX_CFLAGS    +=
-   DX_ASFLAGS   += -dGCC_WIN32
-
-# Define the base directory for library files
-
-.IF $(CHECKED)
-LIB_BASE_DIR   := $(SCITECH_LIB)\lib\debug
-CFLAGS                 += -DCHECKED=1
-SHOW_CFLAGS        += -DCHECKED=1
-.ELSE
-LIB_BASE_DIR   := $(SCITECH_LIB)\lib\release
-.ENDIF
-
-# Define where to install library files
-   LIB_DEST     := $(LIB_BASE_DIR)\WIN32\$(GCC2_LIBBASE)
-   LDFLAGS      += -L$(LIB_DEST)
-
-# Place to look for PMODE library files
-
-PMLIB           := -lpm
-
-# Define which file contains our rules
-
-   RULES_MAK   := gcc_win32.mk
diff --git a/board/MAI/bios_emulator/scitech/makedefs/hc32.mk b/board/MAI/bios_emulator/scitech/makedefs/hc32.mk
deleted file mode 100644 (file)
index f0b065a..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-#############################################################################
-#
-#                                      SciTech Multi-platform Graphics Library
-#
-#  ========================================================================
-#
-#    The contents of this file are subject to the SciTech MGL Public
-#    License Version 1.0 (the "License"); you may not use this file
-#    except in compliance with the License. You may obtain a copy of
-#    the License at http://www.scitechsoft.com/mgl-license.txt
-#
-#    Software distributed under the License is distributed on an
-#    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-#    implied. See the License for the specific language governing
-#    rights and limitations under the License.
-#
-#    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-#
-#    The Initial Developer of the Original Code is SciTech Software, Inc.
-#    All Rights Reserved.
-#
-#  ========================================================================
-#
-# Descripton:   Generic DMAKE startup makefile definitions file. Assumes
-#               that the SCITECH environment variable has been set to point
-#               to where all our stuff is installed. You should not need
-#               to change anything in this file.
-#
-#               Metaware High C/C++ 3.21 32 bit version. Supports Phar Lap's
-#               TNT DOS Extender.
-#
-#############################################################################
-
-# Include standard startup script definitions
-.IMPORT: SCITECH
-.INCLUDE: "$(SCITECH)\makedefs\startup.mk"
-
-# We are compiling for a 32 bit envionment
-   _32BIT_      := 1
-
-# Default commands for compiling, assembling linking and archiving
-   CC           := hc386    # C-compiler and flags
-   CFLAGS       :=
-.IF $(USE_TASM32)
-   AS           := tasm32
-.ELIF $(USE_TASMX)
-   AS           := tasmx    # Assembler and flags
-.ELSE
-   AS           := tasm     # Assembler and flags
-.ENDIF
-   ASFLAGS      := /t /mx /m /D__FLAT__ /iINCLUDE /i$(SCITECH)\INCLUDE
-   LD           := hc386
-   LDFLAGS       = $(CFLAGS)
-   LIB          := 386lib   # TNT 386|lib Librarian
-   LIBFLAGS     := -TC
-
-# Optionally turn on debugging information
-.IF $(DBG)
-   CFLAGS       += -g       # Turn on debugging for C compiler
-   ASFLAGS      += /zi      # Turn on debugging for assembler
-.ELSE
-   ASFLAGS      += /q       # Suppress object records not needed for linking
-.END
-
-# Optionally turn on optimisations
-.IF $(OPT)
-   CFLAGS       += -586 -O
-.ELIF $(OPT_SIZE)
-   CFLAGS       += -586 -O1
-.ELSE
-   CFLAGS       += -O0
-.END
-
-# Optionally turn on direct i387 FPU instructions
-
-.IF $(FPU)
-   CFLAGS       += -DFPU387
-   ASFLAGS      += -DFPU387
-.END
-
-# Optionally compile a beta release version of a product
-.IF $(BETA)
-   CFLAGS       += -DBETA
-   ASFLAGS      += -DBETA
-.END
-
-# DOS extender dependant flags
-   USE_TNT      := 1
-   USE_REALDOS := 1
-   DX_CFLAGS    += -DTNT
-   DX_ASFLAGS   += -DTNT
-   LDFLAGS      += -LH:\TNT\LIB
-
-# Place to look for PMODE library files
-
-PMLIB           := tnt\pm.lib
-
-# Define the base directory for library files
-
-.IF $(CHECKED)
-LIB_BASE_DIR   := $(SCITECH_LIB)\lib\debug
-CFLAGS                 += -DCHECKED=1
-.ELSE
-LIB_BASE_DIR   := $(SCITECH_LIB)\lib\release
-.ENDIF
-
-# Define where to install library files
-   LIB_BASE     := $(LIB_BASE_DIR)\DOS32\HC
-   LIB_DEST     := $(LIB_BASE)
-
-# Define which file contains our rules
-
-   RULES_MAK   := hc32.mk
diff --git a/board/MAI/bios_emulator/scitech/makedefs/qnx4.mk b/board/MAI/bios_emulator/scitech/makedefs/qnx4.mk
deleted file mode 100644 (file)
index f583af3..0000000
+++ /dev/null
@@ -1,164 +0,0 @@
-#############################################################################
-#
-#                                      SciTech Multi-platform Graphics Library
-#
-#  ========================================================================
-#
-#    The contents of this file are subject to the SciTech MGL Public
-#    License Version 1.0 (the "License"); you may not use this file
-#    except in compliance with the License. You may obtain a copy of
-#    the License at http://www.scitechsoft.com/mgl-license.txt
-#
-#    Software distributed under the License is distributed on an
-#    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-#    implied. See the License for the specific language governing
-#    rights and limitations under the License.
-#
-#    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-#
-#    The Initial Developer of the Original Code is SciTech Software, Inc.
-#    All Rights Reserved.
-#
-#  ========================================================================
-#
-# Descripton:   Generic DMAKE startup makefile definitions file. Assumes
-#               that the SCITECH environment variable has been set to point
-#               to where all our stuff is installed. You should not need
-#               to change anything in this file.
-#
-#               QNX version for Watcom C.
-#
-#############################################################################
-
-# Disable warnings for macros redefined here that were given
-# on the command line.
-__.SILENT       := $(.SILENT)
-.SILENT         := yes
-
-# Import enivornment variables that we use common to all compilers
-.IMPORT .IGNORE : TEMP SHELL INCLUDE LIB SCITECH PRIVATE SCITECH_LIB
-.IMPORT .IGNORE : DBG OPT OPT_SIZE SHW BETA CHECKED USE_QNX USE_QNX4
-.IMPORT .IGNORE : USE_PHOTON USE_X11 USE_BIOS SHOW_ARGS MAX_WARN WC_LIBBASE
-   TMPDIR       := $(TEMP)
-
-# Standard file suffix definitions
-#
-# NOTE: Qnx does not require any extension for executeable files, but you
-#       can use an extension if you wish. We use the .x extension for building
-#       executeable files so that we can use implicit rules to make the
-#       makefiles simpler and more portable between systems. When you install
-#       the files to a local bin directory, you will probably want to remove
-#       the .x extension.
-   L            := .a          # Libraries
-   E            := .exe        # Executables
-   O            := .o          # Objects
-   A            := .asm        # Assembler sources
-   S            := .s       # GNU assembler sources
-   P            := .cpp        # C++ sources
-
-# File prefix/suffix definitions. The following prefixes are defined, and are
-# used primarily to abstract between the Unix style libXX.a naming convention
-# and the DOS/Windows/OS2 naming convention of XX.lib.
-   LP           := lib      # LP - Library file prefix (name of file on disk)
-   LL           := -l          # Library link prefix (name of library on link command line)
-   LE           :=                 # Library link suffix (extension of library on link command line)
-
-# We use the Unix shell at all times
-   SHELL               := /bin/sh
-   SHELLFLAGS   := -c
-
-# Definition of $(MAKE) macro for recursive makes.
-   MAKE = $(MAKECMD) $(MFLAGS)
-
-# Macro to install a library file
-   INSTALL      := cp
-
-# DMAKE uses this recipe to remove intermediate targets
-.REMOVE :; $(RM) -f $<
-
-# Turn warnings back to previous setting.
-.SILENT := $(__.SILENT)
-
-# We dont use TABS in our makefiles
-.NOTABS         := yes
-
-# Define that we are compiling for QNX
-   USE_QNX     := 1
-
-# Default commands for compiling, assembling linking and archiving.
-   CC           := wcc386
-   CFLAGS       := -I. -Iinclude $(INCLUDE)
-   CXX          := wpp386
-   AS           := nasm
-   ASFLAGS      := -t -f obj -d__FLAT__ -dSTDCALL_MANGLE -iinclude -i$(SCITECH)/include
-   LD           := cc
-   LDFLAGS      := -L.
-   LIB          := ar
-   LIBFLAGS     := rc
-
-# Set the compiler warning level
-.IF $(MAX_WARN)
-   CFLAGS       += -w4
-.ELSE
-   CFLAGS       += -w1
-.ENDIF
-
-# Optionally turn on debugging information
-.IF $(DBG)
-   CFLAGS       += -d2
-   LDFLAGS      += -g2
-.ELSE
-# NASM does not support debugging information yet
-   ASFLAGS      +=
-.ENDIF
-
-# Optionally turn on optimisations
-.IF $(OPT)
-   CFLAGS       += -onatx-5r-fp5
-.ELIF $(OPT_SIZE)
-   CFLAGS       += -onaslmr-5r-fp5
-.ELIF $(NOOPT)
-   CFLAGS       += -od-5r
-.END
-
-# Compile flag for whether to build photon or non-photon lib
-.IF $(USE_PHOTON)
-   CFLAGS       += -D__PHOTON__
-.ENDIF
-
-# Compile flag for whether to build X11 or non-X11 lib
-.IF $(USE_X11)
-   CFLAGS       += -D__X11__
-.ENDIF
-
-# Optionally compile a beta release version of a product
-.IF $(BETA)
-   CFLAGS       += -DBETA
-   ASFLAGS      += -dBETA
-.ENDIF
-
-# Target environment dependant flags
-   CFLAGS       += -D__QNX__ -D__UNIX__
-   ASFLAGS      += -d__QNX__ -d__UNIX__
-
-# Define the base directory for library files
-
-.IF $(CHECKED)
-  LIB_BASE_DIR := $(SCITECH_LIB)/lib/debug
-  CFLAGS               += -DCHECKED=1
-.ELSE
-  LIB_BASE_DIR := $(SCITECH_LIB)/lib/release
-.ENDIF
-
-# Define where to install library files
-   LIB_BASE     := $(LIB_BASE_DIR)/qnx4/$(WC_LIBBASE)
-   LIB_DEST     := $(LIB_BASE)
-   LDFLAGS      += -L$(LIB_DEST)
-
-# Place to look for PMODE library files
-
-PMLIB           := -lpm
-
-# Define which file contains our rules
-
-   RULES_MAK   := qnx4.mk
diff --git a/board/MAI/bios_emulator/scitech/makedefs/qnxnto.mk b/board/MAI/bios_emulator/scitech/makedefs/qnxnto.mk
deleted file mode 100644 (file)
index 5168ed2..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-#############################################################################
-#
-#                                      SciTech Multi-platform Graphics Library
-#
-#  ========================================================================
-#
-#    The contents of this file are subject to the SciTech MGL Public
-#    License Version 1.0 (the "License"); you may not use this file
-#    except in compliance with the License. You may obtain a copy of
-#    the License at http://www.scitechsoft.com/mgl-license.txt
-#
-#    Software distributed under the License is distributed on an
-#    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-#    implied. See the License for the specific language governing
-#    rights and limitations under the License.
-#
-#    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-#
-#    The Initial Developer of the Original Code is SciTech Software, Inc.
-#    All Rights Reserved.
-#
-#  ========================================================================
-#
-# Descripton:   Generic DMAKE startup makefile definitions file. Assumes
-#               that the SCITECH environment variable has been set to point
-#               to where all our stuff is installed. You should not need
-#               to change anything in this file.
-#
-#               QNX Neutrino version for GNU C/C++
-#
-#############################################################################
-
-# Disable warnings for macros redefined here that were given
-# on the command line.
-__.SILENT       := $(.SILENT)
-.SILENT         := yes
-
-# Import enivornment variables that we use common to all compilers
-.IMPORT .IGNORE : TEMP SHELL INCLUDE LIB SCITECH PRIVATE SCITECH_LIB
-.IMPORT .IGNORE : DBG OPT OPT_SIZE SHW BETA CHECKED USE_QNX USE_QNXNTO
-.IMPORT .IGNORE : USE_EGCS USE_PHOTON USE_X11 USE_BIOS
-   TMPDIR       := $(TEMP)
-
-# Standard file suffix definitions
-#
-# NOTE: Qnx does not require any extension for executeable files, but you
-#       can use an extension if you wish. We use the .x extension for building
-#       executeable files so that we can use implicit rules to make the
-#       makefiles simpler and more portable between systems. When you install
-#       the files to a local bin directory, you will probably want to remove
-#       the .x extension.
-   L            := .a          # Libraries
-   E            := .x          # Executables
-   O            := .o          # Objects
-   A            := .asm        # Assembler sources
-   S            := .s       # GNU assembler sources
-   P            := .cpp        # C++ sources
-
-# File prefix/suffix definitions. The following prefixes are defined, and are
-# used primarily to abstract between the Unix style libXX.a naming convention
-# and the DOS/Windows/OS2 naming convention of XX.lib.
-   LP           := lib      # LP - Library file prefix (name of file on disk)
-   LL           := -l          # Library link prefix (name of library on link command line)
-   LE           :=                 # Library link suffix (extension of library on link command line)
-
-# We use the Unix shell at all times
-   SHELL               := /bin/sh
-   SHELLFLAGS   := -c
-
-# Definition of $(MAKE) macro for recursive makes.
-   MAKE = $(MAKECMD) $(MFLAGS)
-
-# Macro to install a library file
-   INSTALL      := cp
-
-# DMAKE uses this recipe to remove intermediate targets
-.REMOVE :; $(RM) -f $<
-
-# Turn warnings back to previous setting.
-.SILENT := $(__.SILENT)
-
-# We dont use TABS in our makefiles
-.NOTABS         := yes
-
-# Define that we are compiling for QNX
-   USE_QNX     := 1
-
-# Default commands for compiling, assembling linking and archiving.
-   CC           := qcc
-   CFLAGS       := -Vgcc_ntox86 -I. -Iinclude $(INCLUDE)
-   CPPFLAGS     := -Vgcc_ntox86 -I. -Iinclude $(INCLUDE)
-   CXX          := QCC
-   AS           := nasm
-   ASFLAGS      := -t -f elf -d__FLAT__ -d__GNUC__ -dSTDCALL_MANGLE -iinclude -i$(SCITECH)/include -d__NOU__
-   LD           := qcc
-   LDFLAGS      := -Vgcc_ntox86 -L. -lm
-   LIB          := ar
-   LIBFLAGS     := rc
-
-# Optionally turn on debugging information
-.IF $(DBG)
-   CFLAGS       += -g2
-   LDFLAGS      += -g2
-.ELSE
-# NASM does not support debugging information yet
-   ASFLAGS      +=
-.ENDIF
-
-# Optionally turn on optimisations
-.IF $(OPT_MAX)
-   CFLAGS       += -Ot
-.ELIF $(OPT)
-   CFLAGS       += -O
-.ELIF $(OPT_SIZE)
-   CFLAGS       += -Os
-.ENDIF
-
-# Compile flag for whether to build photon or non-photon lib
-.IF $(USE_PHOTON)
-   CFLAGS       += -D__PHOTON__
-.ENDIF
-
-# Compile flag for whether to build X11 or non-X11 lib
-.IF $(USE_X11)
-   CFLAGS       += -D__X11__
-.ENDIF
-
-# Optionally compile a beta release version of a product
-.IF $(BETA)
-   CFLAGS       += -DBETA
-   ASFLAGS      += -dBETA
-.ENDIF
-
-# Target environment dependant flags
-   CFLAGS       += -D__QNX__ -D__UNIX__
-   ASFLAGS      += -d__QNX__ -d__UNIX__
-
-# Define the base directory for library files
-
-.IF $(CHECKED)
-  LIB_BASE_DIR := $(SCITECH_LIB)/lib/debug
-  CFLAGS               += -DCHECKED=1
-.ELSE
-  LIB_BASE_DIR := $(SCITECH_LIB)/lib/release
-.ENDIF
-
-# Define where to install library files
-   LIB_DEST    := $(LIB_BASE_DIR)/qnxnto
-   LDFLAGS      += -L$(LIB_DEST)
-
-# Place to look for PMODE library files
-
-PMLIB           := -lpm
-
-# Define which file contains our rules
-
-   RULES_MAK   := qnxnto.mk
diff --git a/board/MAI/bios_emulator/scitech/makedefs/rules/bc16.mk b/board/MAI/bios_emulator/scitech/makedefs/rules/bc16.mk
deleted file mode 100644 (file)
index 67ae910..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-#############################################################################
-#
-#                                      SciTech Multi-platform Graphics Library
-#
-#  ========================================================================
-#
-#    The contents of this file are subject to the SciTech MGL Public
-#    License Version 1.0 (the "License"); you may not use this file
-#    except in compliance with the License. You may obtain a copy of
-#    the License at http://www.scitechsoft.com/mgl-license.txt
-#
-#    Software distributed under the License is distributed on an
-#    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-#    implied. See the License for the specific language governing
-#    rights and limitations under the License.
-#
-#    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-#
-#    The Initial Developer of the Original Code is SciTech Software, Inc.
-#    All Rights Reserved.
-#
-#  ========================================================================
-#
-# Descripton:   Rules makefile definitions, which define the rules used to
-#                              build targets. We include them here at the end of the
-#                              makefile so the generic project makefiles can override
-#                              certain things with macros (such as linking C++ programs
-#                              differently).
-#
-#############################################################################
-
-# Take out PMLIB if we don't need to link with it
-
-.IF $(NO_PMLIB)
-PMLIB :=
-.ENDIF
-
-# Implicit generation rules for making object files
-%$O: %.c ; $(CC) @$(mktmp $(CFLAGS:s/\/\\)) -c $<
-%$O: %$P ; $(CC) @$(mktmp $(CFLAGS:s/\/\\)) -c $<
-%$O: %$A ; $(AS) @$(mktmp $(ASFLAGS:s/\/\\)) $(<:s,/,\)
-
-# Implicit rule for building resource files
-%$R: %.rc ; $(RC) $(RCFLAGS) -r $<
-
-# Implicit rule for building a DLL using a response file
-%$D:      ; $(LD) $(mktmp $(LDFLAGS) -C -Twd c0dl.obj+\n$(&:s/\/\\)\n$@\n$*.map\n$(DEF_LIBS) $(EXELIBS)\n$*.def)
-
-# Implicit rule for building a library file using response file
-.IF $(BUILD_DLL)
-%$L: ;
-    @$(RM) $@
-    $(ILIB) $(ILIBFLAGS) $@ $?
-.ELIF $(IMPORT_DLL)
-%$L: ;
-    @$(RM) $@
-    $(ILIB) $(ILIBFLAGS) $@ $?
-.ELSE
-%$L: ;
-    @$(RM) $@
-    $(LIBR) $(LIBFLAGS) $@ @$(mktmp +$(&:t" &\n+")\n)
-.ENDIF
-
-# Implicit rule for building an executable file using response file
-.IF $(USE_WIN16)
-%$E: ; $(LD) $(mktmp $(LDFLAGS) -C -Twe $(WIN_VERSION) c0wl.obj+\n$(&:s/\/\\)\n$@\n$*.map\n$(DEF_LIBS) $(EXELIBS)\n$*.def)
-.ELSE
-%$E: ; $(LD) $(mktmp $(LDFLAGS) -Tde c0l.obj+\n$(&:s/\/\\)\n$@\n$*.map\n$(PMLIB) $(DEF_LIBS) $(EXELIBS))
-.ENDIF
diff --git a/board/MAI/bios_emulator/scitech/makedefs/rules/bc3.mk b/board/MAI/bios_emulator/scitech/makedefs/rules/bc3.mk
deleted file mode 100644 (file)
index d4d071c..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-#############################################################################
-#
-#                                      SciTech Multi-platform Graphics Library
-#
-#  ========================================================================
-#
-#    The contents of this file are subject to the SciTech MGL Public
-#    License Version 1.0 (the "License"); you may not use this file
-#    except in compliance with the License. You may obtain a copy of
-#    the License at http://www.scitechsoft.com/mgl-license.txt
-#
-#    Software distributed under the License is distributed on an
-#    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-#    implied. See the License for the specific language governing
-#    rights and limitations under the License.
-#
-#    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-#
-#    The Initial Developer of the Original Code is SciTech Software, Inc.
-#    All Rights Reserved.
-#
-#  ========================================================================
-#
-# Descripton:   Rules makefile definitions, which define the rules used to
-#                              build targets. We include them here at the end of the
-#                              makefile so the generic project makefiles can override
-#                              certain things with macros (such as linking C++ programs
-#                              differently).
-#
-#############################################################################
-
-# Implicit generation rules for making object files
-%$O: %.c ; $(CC) @$(mktmp $(CFLAGS)) -c $<
-%$O: %$P ; $(CC) @$(mktmp $(CFLAGS)) -c $<
-%$O: %$A ; $(AS) @$(mktmp $(ASFLAGS)) $(<:s,/,\)
-
-# Implicit rule for building a library file using response file
-%$L: ;
-    @$(RM) $@
-    $(LIBR) $(LIBFLAGS) $@ @$(mktmp +$(&:t" &\n+")\n)
-
-# Implicit rule for building an executable file using response file
-%$E: ; $(LD) $(mktmp $(LDFLAGS) -Tde c0l.obj+\n$(&:s/\/\\)\n$@\n$*.map\n$(DEF_LIBS) $(EXELIBS))
diff --git a/board/MAI/bios_emulator/scitech/makedefs/rules/bc32.mk b/board/MAI/bios_emulator/scitech/makedefs/rules/bc32.mk
deleted file mode 100644 (file)
index e3ce25b..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-#############################################################################
-#
-#                                      SciTech Multi-platform Graphics Library
-#
-#  ========================================================================
-#
-#    The contents of this file are subject to the SciTech MGL Public
-#    License Version 1.0 (the "License"); you may not use this file
-#    except in compliance with the License. You may obtain a copy of
-#    the License at http://www.scitechsoft.com/mgl-license.txt
-#
-#    Software distributed under the License is distributed on an
-#    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-#    implied. See the License for the specific language governing
-#    rights and limitations under the License.
-#
-#    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-#
-#    The Initial Developer of the Original Code is SciTech Software, Inc.
-#    All Rights Reserved.
-#
-#  ========================================================================
-#
-# Descripton:   Rules makefile definitions, which define the rules used to
-#                              build targets. We include them here at the end of the
-#                              makefile so the generic project makefiles can override
-#                              certain things with macros (such as linking C++ programs
-#                              differently).
-#
-#############################################################################
-
-# Take out PMLIB if we don't need to link with it
-
-.IF $(NO_PMLIB)
-PMLIB :=
-.ENDIF
-
-.IF $(USE_VXD)
-
-# Implicit rule generation to build VxD's
-
-%$O: %.c ;
-       $(CC) @$(mktmp $(CFLAGS:s/\/\\)) -c $(<:s,/,\)
-       @$(VTOOLSD)\bin\segalias.exe -p $(VTOOLSD)\include\default.seg $@
-
-%$O: %$P ;
-       $(CC) @$(mktmp $(CFLAGS:s/\/\\)) -c $(<:s,/,\)
-       @$(VTOOLSD)\bin\segalias.exe -p $(VTOOLSD)\include\default.seg $@
-
-%$O: %$A ; $(AS) @$(mktmp $(ASFLAGS:s/\/\\)) $(<:s,/,\)
-
-%$L: ; $(LIB) $(LIBFLAGS) $@ @$(mktmp -+$(?:t" &\n-+")\n)
-
-%.dll: ;
-       @$(CP) $(mktmp EXPORTS\n_The_DDB @1) $*.def
-       tlink32.exe @$(mktmp $(LDFLAGS) -Tpd $(VTOOLSD:s/\/\\)\lib\icrtbc4.obj+\n$(&:s/\/\\)\n$*.dll\n$*.map\n$(DEF_LIBS:s/\/\\) $(PMLIB:s/\/\\) $(EXELIBS:s/\/\\)\n$*.def)
-       @$(RM) -S $(mktmp $*.def)
-
-%.vxd: %.dll ;
-       @$(CP) $(mktmp DYNAMIC\nATTRIB ICODE INIT\nATTRIB LCODE LOCKED\nATTRIB PCODE PAGEABLE\nATTRIB SCODE STATIC\nATTRIB DBOCODE DEBUG\nMERGE ICODE INITDAT0 INITDATA) $*.pel
-       @$(VTOOLSD)\bin\vxdver.exe $*.vrc $*.res
-       @$(VTOOLSD)\bin\pele.exe -d -s $*.smf -c $*.pel -o $@ -k 400 $*.dll
-       @$(VTOOLSD)\bin\sethdr.exe -n $* -x $@ -r $*.res
-.IF $(DBG)
-       $(NMSYM) /TRANS:source,package /SOURCE:$(VXDSOURCE) $*.smf
-.ENDIF
-       @$(RM) -S $(mktmp $*.pel)
-
-.ELSE
-
-# Implicit generation rules for making object files, libraries and exe's
-
-%$O: %.c ; $(CC) @$(mktmp $(CFLAGS:s/\/\\)) -c $(<:s,/,\)
-%$O: %$P ; $(CC) @$(mktmp $(CFLAGS:s/\/\\)) -c $(<:s,/,\)
-.IF $(USE_NASM)
-%$O: %$A ; $(AS) @$(mktmp -o $@ $(ASFLAGS:s/\/\\)) $(<:s,/,\)
-.ELSE
-%$O: %$A ; $(AS) @$(mktmp $(ASFLAGS:s/\/\\)) $(<:s,/,\)
-.ENDIF
-
-# Implicit rule for building resource files
-%$R: %.rc ; $(RC) $(RCFLAGS) -r $<
-
-# Implicit rule for building a DLL using a response file
-.IF $(IMPORT_DLL)
-.ELSE
-.IF $(NO_RUNTIME)
-%$D: ; $(LD) $(mktmp $(LDFLAGS) -Tpd -aa $(&:s/\/\\)\n$@\n$*.map\n$(EXELIBS)\n$*.def)
-.ELSE
-%$D: ;
-       makedef $(@:b)
-       $(LD) $(mktmp $(LDFLAGS) -Tpd -aa c0d32.obj+\n$(&:s/\/\\)\n$@\n$*.map\n$(DEF_LIBS:s/\/\\) $(PMLIB:s/\/\\) $(EXELIBS)\n$*.def)
-.IF $(DBG)
-.IF $(USE_SOFTICE)
-       $(NMSYM) $(NMSYMFLAGS);$(SI_SOURCE) $@
-       tdstrp32 $@
-.ENDIF
-.ENDIF
-.ENDIF
-.ENDIF
-
-# Implicit rule for building a library file using response file
-.IF $(BUILD_DLL)
-%$L: ;
-    @$(RM) $@
-    $(ILIB) $(ILIBFLAGS) $@ $?
-.ELIF $(IMPORT_DLL)
-%$L: ;
-    @$(RM) $@
-    $(ILIB) $(ILIBFLAGS) $@ $?
-.ELSE
-%$L: ;
-    @$(RM) $@
-    $(LIB) $(LIBFLAGS) $@ @$(mktmp +$(&:t" &\n+")\n)
-.ENDIF
-
-# Implicit rule for building an executable file using response file
-
-.IF $(USE_WIN32)
-.IF $(WIN32_GUI)
-%$E: ;
-       $(LD) $(mktmp $(LDFLAGS) -Tpe -aa $(WIN_VERSION) c0w32.obj+\n$(&:s/\/\\)\n$@\n$*.map\n$(DEF_LIBS:s/\/\\) $(PMLIB:s/\/\\) $(EXELIBS)\n$*.def)
-.IF $(DBG)
-.IF $(USE_SOFTICE)
-       $(NMSYM) $(NMSYMFLAGS);$(SI_SOURCE) $@
-       tdstrp32 $@
-.ENDIF
-.ENDIF
-.ELSE
-%$E: ;
-       $(LD) $(mktmp $(LDFLAGS) -Tpe -ap c0x32.obj+\n$(&:s/\/\\)\n$@\n$*.map\n$(DEF_LIBS:s/\/\\) $(PMLIB:s/\/\\) $(EXELIBS)\n$*.def)
-.IF $(USE_SOFTICE)
-       $(NMSYM) $(NMSYMFLAGS);$(SI_SOURCE) $@
-       tdstrp32 $@
-.ENDIF
-.ENDIF
-.ELIF $(USE_TNT)
-%$E: ;
-       @$(CP) $(mktmp stub 'gotnt.exe') $*.def
-       @$(LD) $(mktmp $(LDFLAGS) -Tpe -ap c0x32.obj+\n$(&:s/\/\\)\n$@\n$*.map\n$(DEF_LIBS) $(PMLIB:s/\/\\) $(EXELIBS)\n$*.def)
-.IF $(DOSSTYLE)
-       @markphar $@
-.ENDIF
-       @$(RM) -S $(mktmp $*.def)
-.ELIF $(USE_SMX32)
-%$E: ; $(LD) $(mktmp $(LDFLAGS) -Tpe -ap c0x32.obj+\n$(&:s/\/\\)\n$@\n$*.map\n$(DEF_LIBS) $(PMLIB:s/\/\\) $(EXELIBS)\n$*.def)
-.ELSE
-%$E: ; $(LD) $(mktmp $(LDFLAGS) -Tpe -ap c0x32.obj+\n$(&:s/\/\\)\n$@\n$*.map\n$(DEF_LIBS) $(PMLIB:s/\/\\) $(EXELIBS)\n$*.def)
-.END
-
-.ENDIF
diff --git a/board/MAI/bios_emulator/scitech/makedefs/rules/bcos2.mk b/board/MAI/bios_emulator/scitech/makedefs/rules/bcos2.mk
deleted file mode 100644 (file)
index f473fec..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-#############################################################################
-#
-#                                      SciTech Multi-platform Graphics Library
-#
-#  ========================================================================
-#
-#    The contents of this file are subject to the SciTech MGL Public
-#    License Version 1.0 (the "License"); you may not use this file
-#    except in compliance with the License. You may obtain a copy of
-#    the License at http://www.scitechsoft.com/mgl-license.txt
-#
-#    Software distributed under the License is distributed on an
-#    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-#    implied. See the License for the specific language governing
-#    rights and limitations under the License.
-#
-#    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-#
-#    The Initial Developer of the Original Code is SciTech Software, Inc.
-#    All Rights Reserved.
-#
-#  ========================================================================
-#
-# Descripton:   Rules makefile definitions, which define the rules used to
-#                              build targets. We include them here at the end of the
-#                              makefile so the generic project makefiles can override
-#                              certain things with macros (such as linking C++ programs
-#                              differently).
-#
-#############################################################################
-
-# Implicit generation rules for making object files
-%$O: %.c ; $(CC) @$(mktmp $(CFLAGS:s/\/\\)) -c $(<:s,/,\)
-%$O: %$P ; $(CC) @$(mktmp $(CFLAGS:s/\/\\)) -c $(<:s,/,\)
-.IF $(USE_NASM)
-%$O: %$A ; $(AS) @$(mktmp -o $@ $(ASFLAGS:s/\/\\)) $(<:s,/,\)
-.ELSE
-%$O: %$A ; $(AS) @$(mktmp $(ASFLAGS:s/\/\\)) $(<:s,/,\)
-.ENDIF
-
-# Implicit rule for building resource files
-%$R: %.rc ; $(RC) $(RCFLAGS) -r $<
-
-# Implicit rule for building a DLL using a response file
-%$D: ;
-       makedef $(@:b)
-       $(LD) $(mktmp $(LDFLAGS) -Tod -aa c02d.obj+\n$(&:s/\/\\)\n$@\n$*.map\n$(DEF_LIBS:s/\/\\) $(EXELIBS)\n$*.def)
-
-# Implicit rule for building a library file using response file
-.IF $(BUILD_DLL)
-%$L: ;
-    @$(RM) $@
-    $(ILIB) $(ILIBFLAGS) $@ $?
-.ELIF $(IMPORT_DLL)
-%$L: ;
-    @$(RM) $@
-    $(ILIB) $(ILIBFLAGS) $@ $?
-.ELSE
-%$L: ;
-    @$(RM) $@
-    $(LIB) $(LIBFLAGS) $@ @$(mktmp +$(&:t" &\n+")\n)
-.ENDIF
-
-# Implicit rule for building an executable file using response file
-
-.IF $(USE_OS2GUI)
-%$E: ; $(LD) $(mktmp $(LDFLAGS) -Toe -aa c02.obj+\n$(&:s/\/\\)\n$@\n$*.map\n$(DEF_LIBS:s/\/\\) $(EXELIBS)\n$*.def)
-.ELSE
-%$E: ; $(LD) $(mktmp $(LDFLAGS) -Toe -ap c02.obj+\n$(&:s/\/\\)\n$@\n$*.map\n$(DEF_LIBS:s/\/\\) $(EXELIBS)\n$*.def)
-.ENDIF
diff --git a/board/MAI/bios_emulator/scitech/makedefs/rules/cl16.mk b/board/MAI/bios_emulator/scitech/makedefs/rules/cl16.mk
deleted file mode 100644 (file)
index 6489a3e..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-#############################################################################
-#
-#                                      SciTech Multi-platform Graphics Library
-#
-#  ========================================================================
-#
-#    The contents of this file are subject to the SciTech MGL Public
-#    License Version 1.0 (the "License"); you may not use this file
-#    except in compliance with the License. You may obtain a copy of
-#    the License at http://www.scitechsoft.com/mgl-license.txt
-#
-#    Software distributed under the License is distributed on an
-#    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-#    implied. See the License for the specific language governing
-#    rights and limitations under the License.
-#
-#    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-#
-#    The Initial Developer of the Original Code is SciTech Software, Inc.
-#    All Rights Reserved.
-#
-#  ========================================================================
-#
-# Descripton:   Rules makefile definitions, which define the rules used to
-#                              build targets. We include them here at the end of the
-#                              makefile so the generic project makefiles can override
-#                              certain things with macros (such as linking C++ programs
-#                              differently).
-#
-#############################################################################
-
-# Take out PMLIB if we don't need to link with it
-
-.IF $(NO_PMLIB)
-PMLIB :=
-.ENDIF
-
-# Implicit generation rules for making object files
-%$O: %.c ; $(CC) /nologo $(CFLAGS) /c $<
-%$O: %$P ; $(CC) /nologo $(CFLAGS) /c $<
-%$O: %$A ; $(AS) $(ASFLAGS) $< $* NUL NUL
-
-# Implicit rule for building resource files
-%$R: %.rc ; $(RC) $(RCFLAGS) -r $<
-
-# Implicit rule for building a DLL using a response file
-#%$D: ; rclink $(LD) $(RC) $@ $(mktmp $(LDFLAGS:s/\/\\) -e$@\n$(&:t"\n":s/\/\\)\n$(EXELIBS))
-#%$D: ; $(LD) $(LDFLAGS) /Fe$@ $& $(EXELIBS)
-%$D: ;  link @default.rsp
-
-
-# Implicit rule for building a library file using response file
-.IF $(BUILD_DLL)
-%$L:      ; $(ILIB) $(ILIBFLAGS) $@ $?
-.ELIF $(IMPORT_DLL)
-%$L:      ; $(ILIB) $(ILIBFLAGS) $@ $?
-.ELSE
-%$L: ; $(LIB) /nologo $(LIBFLAGS) $@ @$(mktmp -+$(?:t" &\n-+") &\n,,\n)
-.ENDIF
-
-# Implicit rule for building an executable file using response file
-.IF $(USE_WIN16)
-#%$E: ; rclink $(LD) $(RC) $@ $(mktmp $(LDFLAGS) /Fe$@ $(&:s/\/\\) $(EXELIBS))
-%$E: ; $(LD) @$(mktmp $(LDFLAGS) /Fe$@ $(&:s/\/\\) $(EXELIBS))
-.ELSE
-%$E: ; $(LD) @$(mktmp $(LDFLAGS) /Fe$@ $(&:s/\/\\) $(PMLIB) $(EXELIBS))
-.ENDIF
diff --git a/board/MAI/bios_emulator/scitech/makedefs/rules/cl386.mk b/board/MAI/bios_emulator/scitech/makedefs/rules/cl386.mk
deleted file mode 100644 (file)
index f50b274..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-#############################################################################
-#
-#                                      SciTech Multi-platform Graphics Library
-#
-#  ========================================================================
-#
-#    The contents of this file are subject to the SciTech MGL Public
-#    License Version 1.0 (the "License"); you may not use this file
-#    except in compliance with the License. You may obtain a copy of
-#    the License at http://www.scitechsoft.com/mgl-license.txt
-#
-#    Software distributed under the License is distributed on an
-#    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-#    implied. See the License for the specific language governing
-#    rights and limitations under the License.
-#
-#    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-#
-#    The Initial Developer of the Original Code is SciTech Software, Inc.
-#    All Rights Reserved.
-#
-#  ========================================================================
-#
-# Descripton:   Rules makefile definitions, which define the rules used to
-#                              build targets. We include them here at the end of the
-#                              makefile so the generic project makefiles can override
-#                              certain things with macros (such as linking C++ programs
-#                              differently).
-#
-#############################################################################
-
-# Take out PMLIB if we don't need to link with it
-
-.IF $(NO_PMLIB)
-PMLIB :=
-.ENDIF
-
-# Implicit generation rules for making object files
-%$O: %.c ; $(CC) -nologo $(CFLAGS) -c $<
-%$O: %$P ; $(CC) -nologo $(CFLAGS) -c $<
-%$O: %$A ; $(AS) $(ASFLAGS) $< $* NUL NUL
-
-# Implicit rule for building resource files
-%$R: %.rc ; $(RC) $(RCFLAGS) -r $<
-
-# Implicit rule for building a DLL using a response file
-#%$D: ; rclink $(LD) $(RC) $@ $(mktmp $(LDFLAGS:s/\/\\) -e$@\n$(&:t"\n":s/\/\\)\n$(EXELIBS))
-#%$D: ; $(LD) $(LDFLAGS) /Fe$@ $& $(EXELIBS)
-%$D: ;  link386 @default.rsp
-
-# Implicit rule for building a device driver using a response file
-%.SYS: ;  link386 @default.rsp
-
-# Implicit rule for building a library file using response file
-.IF $(BUILD_DLL)
-%$L:      ; $(ILIB) $(ILIBFLAGS) $@ $?
-.ELIF $(IMPORT_DLL)
-%$L:      ; $(ILIB) $(ILIBFLAGS) $@ $?
-.ELSE
-%$L: ; $(LIB) /nologo $(LIBFLAGS) $@ @$(mktmp -+$(?:t" &\n-+") &\n,,\n)
-.ENDIF
-
-# Implicit rule for building an executable file using response file
-.IF $(USE_WIN16)
-#%$E: ; rclink $(LD) $(RC) $@ $(mktmp $(LDFLAGS) /Fe$@ $(&:s/\/\\) $(EXELIBS))
-%$E: ; $(LD) @$(mktmp $(LDFLAGS) /Fe$@ $(&:s/\/\\) $(EXELIBS))
-.ELSE
-%$E: ; $(LD) @$(mktmp $(LDFLAGS) /Fe$@ $(&:s/\/\\) $(PMLIB) $(EXELIBS))
-.ENDIF
diff --git a/board/MAI/bios_emulator/scitech/makedefs/rules/dj32.mk b/board/MAI/bios_emulator/scitech/makedefs/rules/dj32.mk
deleted file mode 100644 (file)
index 9f917bb..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-#############################################################################
-#
-#                                      SciTech Multi-platform Graphics Library
-#
-#  ========================================================================
-#
-#    The contents of this file are subject to the SciTech MGL Public
-#    License Version 1.0 (the "License"); you may not use this file
-#    except in compliance with the License. You may obtain a copy of
-#    the License at http://www.scitechsoft.com/mgl-license.txt
-#
-#    Software distributed under the License is distributed on an
-#    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-#    implied. See the License for the specific language governing
-#    rights and limitations under the License.
-#
-#    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-#
-#    The Initial Developer of the Original Code is SciTech Software, Inc.
-#    All Rights Reserved.
-#
-#  ========================================================================
-#
-# Descripton:   Rules makefile definitions, which define the rules used to
-#                              build targets. We include them here at the end of the
-#                              makefile so the generic project makefiles can override
-#                              certain things with macros (such as linking C++ programs
-#                              differently).
-#
-#############################################################################
-
-# Take out PMLIB if we don't need to link with it
-
-.IF $(NO_PMLIB)
-PMLIB :=
-.ENDIF
-
-# Implicit generation rules for making object files
-%$O: %.c ; $(CC) @$(mktmp $(CFLAGS:s/\/\\) -c) $(<:s,/,\)
-%$O: %$P ; $(CC) @$(mktmp $(CFLAGS:s/\/\\) -c) $(<:s,/,\)
-%$O: %$A ; $(AS) @$(mktmp -o $@ $(ASFLAGS:s/\/\\)) $(<:s,/,\)
-
-# Implicit rule for building a library file using response file
-%$L:      ; $(LIB) $(LIBFLAGS) $@ @$(mktmp $(&:s/\/\\)\n)
-
-# Implicit rule for building an executable file using response file
-%$E:      ; $(LD) $(LDFLAGS) $@ @$(mktmp $(&:s/\/\\) $(EXELIBS) $(PMLIB) -lstdcxx -lm)
diff --git a/board/MAI/bios_emulator/scitech/makedefs/rules/emx.mk b/board/MAI/bios_emulator/scitech/makedefs/rules/emx.mk
deleted file mode 100644 (file)
index 26d223a..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-#############################################################################
-#
-#                                      SciTech Multi-platform Graphics Library
-#
-#  ========================================================================
-#
-#    The contents of this file are subject to the SciTech MGL Public
-#    License Version 1.0 (the "License"); you may not use this file
-#    except in compliance with the License. You may obtain a copy of
-#    the License at http://www.scitechsoft.com/mgl-license.txt
-#
-#    Software distributed under the License is distributed on an
-#    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-#    implied. See the License for the specific language governing
-#    rights and limitations under the License.
-#
-#    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-#
-#    The Initial Developer of the Original Code is SciTech Software, Inc.
-#    All Rights Reserved.
-#
-#  ========================================================================
-#
-# Descripton:   Rules makefile definitions, which define the rules used to
-#                              build targets. We include them here at the end of the
-#                              makefile so the generic project makefiles can override
-#                              certain things with macros (such as linking C++ programs
-#                              differently).
-#
-#               OS/2 version for EMX/GNU C/C++.
-#
-#############################################################################
-
-# Take out PMLIB if we don't need to link with it
-
-.IF $(NO_PMLIB)
-PMLIB :=
-.ENDIF
-
-# Implicit generation rules for making object files
-%$O: %.c ;
-.IF $(SHOW_ARGS)
-       $(CC) -c $(CFLAGS) $(<:s,\,/)
-.ELSE
-       @echo $(CC) -c $(<:s,\,/)
-       @$(CC) -c $(CFLAGS) $(<:s,\,/)
-.ENDIF
-
-%$O: %$P ;
-.IF $(SHOW_ARGS)
-       $(CXX) -c $(CFLAGS) $(<:s,\,/)
-.ELSE
-       @echo $(CXX) -c $(<:s,\,/)
-       @$(CXX) -c $(CFLAGS) $(<:s,\,/)
-.ENDIF
-
-%$O: %$A ;
-.IF $(USE_NASM)
-.IF $(SHOW_ARGS)
-       $(AS) -o $@ $(ASFLAGS) $(<:s,\,/)
-.ELSE
-       @echo $(AS) $(<:s,\,/)
-       @$(AS) @$(mktmp -o $@ $(ASFLAGS)) $(<:s,\,/)
-.ENDIF
-.ELSE
-.IF $(SHOW_ARGS)
-
-    $(AS)  @$(mktmp $(ASFLAGS:s/\/\\)) $(<:s,/,\)
-.ELSE
-       @echo $(AS) $(<:s,/,\)
-    $(AS)  @$(mktmp $(ASFLAGS:s/\/\\)) $(<:s,/,\)
-.ENDIF
-.ENDIF
-
-# Implicit rule for building a library file using response file
-%$L:     ;
-.IF $(SHOW_ARGS)
-       $(LIB) $(LIBFLAGS) $@ $(&:s,\,/)
-.ELSE
-       @echo $(LIB) $@
-       @$(LIB) $(LIBFLAGS) $@ @$(mktmp $(?:t"\n"))
-.ENDIF
-
-# Implicit rule for building an executable file using response file
-%$E:     ;
-.IF $(SHOW_ARGS)
-       $(LD) $(LDFLAGS) -o $@ $(&:s,\,/) $(EXELIBS) $(PMLIB) -lgpp -lstdcpp
-.ELSE
-       @echo $(LD) $@
-       @$(LD) $(LDFLAGS) -o $@ $(&:s,\,/) $(EXELIBS) $(PMLIB) -lgpp -lstdcpp
-.ENDIF
diff --git a/board/MAI/bios_emulator/scitech/makedefs/rules/gcc_beos.mk b/board/MAI/bios_emulator/scitech/makedefs/rules/gcc_beos.mk
deleted file mode 100644 (file)
index 681b698..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-#############################################################################
-#
-#                                      SciTech Multi-platform Graphics Library
-#
-#  ========================================================================
-#
-#    The contents of this file are subject to the SciTech MGL Public
-#    License Version 1.0 (the "License"); you may not use this file
-#    except in compliance with the License. You may obtain a copy of
-#    the License at http://www.scitechsoft.com/mgl-license.txt
-#
-#    Software distributed under the License is distributed on an
-#    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-#    implied. See the License for the specific language governing
-#    rights and limitations under the License.
-#
-#    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-#
-#    The Initial Developer of the Original Code is SciTech Software, Inc.
-#    All Rights Reserved.
-#
-#  ========================================================================
-#
-# Descripton:   Rules makefile definitions, which define the rules used to
-#                              build targets. We include them here at the end of the
-#                              makefile so the generic project makefiles can override
-#                              certain things with macros (such as linking C++ programs
-#                              differently).
-#
-#############################################################################
-
-# Take out PMLIB if we don't need to link with it
-
-.IF $(NO_PMLIB)
-PMLIB :=
-.ENDIF
-
-# Implicit generation rules for making object files from source files
-%$O: %.c ; $(CC) $(CFLAGS) -c $<
-%$O: %$P ; $(CXX) $(CFLAGS) -c $<
-%$O: %$A ; $(AS) $(ASFLAGS) $<
-
-# Implicit rule for building a library file
-%$L:     ; $(LIB) $(LIBFLAGS) $@ $&
-
-# Implicit rule for building an executable file
-%$E:     ; $(LD) $(LDFLAGS) -o $@ $& $(EXELIBS) $(PMLIB)
diff --git a/board/MAI/bios_emulator/scitech/makedefs/rules/gcc_freebsd.mk b/board/MAI/bios_emulator/scitech/makedefs/rules/gcc_freebsd.mk
deleted file mode 100644 (file)
index 9b4d236..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-#############################################################################
-#
-#                                      SciTech Multi-platform Graphics Library
-#
-#  ========================================================================
-#
-#    The contents of this file are subject to the SciTech MGL Public
-#    License Version 1.0 (the "License"); you may not use this file
-#    except in compliance with the License. You may obtain a copy of
-#    the License at http://www.scitechsoft.com/mgl-license.txt
-#
-#    Software distributed under the License is distributed on an
-#    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-#    implied. See the License for the specific language governing
-#    rights and limitations under the License.
-#
-#    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-#
-#    The Initial Developer of the Original Code is SciTech Software, Inc.
-#    All Rights Reserved.
-#
-#  ========================================================================
-#
-# Descripton:   Rules makefile definitions, which define the rules used to
-#                              build targets. We include them here at the end of the
-#                              makefile so the generic project makefiles can override
-#                              certain things with macros (such as linking C++ programs
-#                              differently).
-#
-#############################################################################
-
-# Take out PMLIB if we don't need to link with it
-
-.IF $(NO_PMLIB)
-PMLIB :=
-.ENDIF
-
-# Implicit generation rules for making object files from source files
-%$O: %.c ; $(CC) $(CFLAGS) -c $<
-%$O: %$P ; $(CXX) $(CFLAGS) -c $<
-%$O: %$A ; $(AS) -o $@ $(ASFLAGS) $<
-
-# Implicit rule for building a library file
-%$L:     ; $(LIB) $(LIBFLAGS) $@ $&
-
-# Implicit rule for building an executable file
-%$E:     ; $(LD) $(LDFLAGS) -o $@ $& $(EXELIBS) $(PMLIB) -lm
diff --git a/board/MAI/bios_emulator/scitech/makedefs/rules/gcc_linux.mk b/board/MAI/bios_emulator/scitech/makedefs/rules/gcc_linux.mk
deleted file mode 100644 (file)
index 5f91fe5..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-#############################################################################
-#
-#                                      SciTech Multi-platform Graphics Library
-#
-#  ========================================================================
-#
-#    The contents of this file are subject to the SciTech MGL Public
-#    License Version 1.0 (the "License"); you may not use this file
-#    except in compliance with the License. You may obtain a copy of
-#    the License at http://www.scitechsoft.com/mgl-license.txt
-#
-#    Software distributed under the License is distributed on an
-#    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-#    implied. See the License for the specific language governing
-#    rights and limitations under the License.
-#
-#    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-#
-#    The Initial Developer of the Original Code is SciTech Software, Inc.
-#    All Rights Reserved.
-#
-#  ========================================================================
-#
-# Descripton:   Rules makefile definitions, which define the rules used to
-#                              build targets. We include them here at the end of the
-#                              makefile so the generic project makefiles can override
-#                              certain things with macros (such as linking C++ programs
-#                              differently).
-#
-#############################################################################
-
-# Take out PMLIB if we don't need to link with it
-
-.IF $(NO_PMLIB)
-PMLIB :=
-.ENDIF
-
-.IF $(USE_CXX_LINKER)
-LD     := $(LDXX)
-.ENDIF
-
-# Implicit generation rules for making object files from source files
-%$O: %.c ;
-.IF $(SHOW_ARGS)
-    $(CC) -c $(CFLAGS) $<
-.ELSE
-    @$(ECHO) $(CC) $(SHOW_CFLAGS) $<
-    @$(CC) -c $(CFLAGS) $<
-.ENDIF
-
-%$O: %$P ;
-.IF $(SHOW_ARGS)
-    $(CXX) -c $(CFLAGS) $<
-.ELSE
-    @$(ECHO) $(CXX) $(SHOW_CFLAGS) $<
-    @$(CXX) -c $(CFLAGS) $<
-.ENDIF
-
-%$O: %$A ;
-.IF $(SHOW_ARGS)
-    $(AS) -o $@ $(ASFLAGS) $<
-.ELSE
-    @$(ECHO) $(AS) $(SHOW_ASFLAGS) $<
-    @$(AS) @$(mktmp -o $@ $(ASFLAGS)) $<
-.ENDIF
-
-# Implicit rule for building a library file
-.IF $(BUILD_DLL)
-%$L:     ;
-.IF $(SHOW_ARGS)
-    $(LIB) $(LIBFLAGS) -Wl,-soname,$@.$(VERSIONMAJ) -o $@ $& $(LIBS)
-.ELSE
-    @$(ECHO) $(LIB) $@
-    @$(LIB) $(LIBFLAGS) -Wl,-soname,$@.$(VERSIONMAJ) -o $@ $& $(LIBS)
-.ENDIF
-.ELSE
-%$L:     ;
-.IF $(SHOW_ARGS)
-    $(LIB) $(LIBFLAGS) $@ $&
-.ELSE
-    @$(ECHO) $(LIB) $@
-    @$(LIB) $(LIBFLAGS) $@ $&
-.ENDIF
-.ENDIF
-
-# Implicit rule for building an executable file
-%$E:     ;
-.IF $(SHOW_ARGS)
-    $(LD) $(LDFLAGS) -o $@ $& $(EXELIBS) $(PMLIB) -lm
-.ELSE
-    @$(ECHO) ld $@
-    @$(LD) $(LDFLAGS) -o $@ $& $(EXELIBS) $(PMLIB) -lm
-.ENDIF
diff --git a/board/MAI/bios_emulator/scitech/makedefs/rules/gcc_win32.mk b/board/MAI/bios_emulator/scitech/makedefs/rules/gcc_win32.mk
deleted file mode 100644 (file)
index 485d166..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-#############################################################################
-#
-#                                      SciTech Multi-platform Graphics Library
-#
-#  ========================================================================
-#
-#    The contents of this file are subject to the SciTech MGL Public
-#    License Version 1.0 (the "License"); you may not use this file
-#    except in compliance with the License. You may obtain a copy of
-#    the License at http://www.scitechsoft.com/mgl-license.txt
-#
-#    Software distributed under the License is distributed on an
-#    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-#    implied. See the License for the specific language governing
-#    rights and limitations under the License.
-#
-#    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-#
-#    The Initial Developer of the Original Code is SciTech Software, Inc.
-#    All Rights Reserved.
-#
-#  ========================================================================
-#
-# Descripton:   Rules makefile definitions, which define the rules used to
-#                              build targets. We include them here at the end of the
-#                              makefile so the generic project makefiles can override
-#                              certain things with macros (such as linking C++ programs
-#                              differently).
-#
-#############################################################################
-
-# Take out PMLIB if we don't need to link with it
-
-.IF $(NO_PMLIB)
-PMLIB :=
-.ENDIF
-
-.IF $(USE_CXX_LINKER)
-LD     := $(LDXX)
-.ENDIF
-
-# Implicit generation rules for making object files from source files
-%$O: %.c ;
-.IF $(SHOW_ARGS)
-    $(CC) -c $(CFLAGS:s/\/\\) $(<:s,/,\)
-.ELSE
-    @$(ECHO) $(CC) $(SHOW_CFLAGS:s/\/\\) $(<:s,/,\)
-    @$(CC) -c $(CFLAGS:s/\/\\) $(<:s,/,\)
-.ENDIF
-
-%$O: %$P ;
-.IF $(SHOW_ARGS)
-    $(CXX) -c $(CFLAGS:s/\/\\) $(<:s,/,\)
-.ELSE
-    @$(ECHO) $(CXX) $(SHOW_CFLAGS:s/\/\\) $(<:s,/,\)
-    @$(CXX) -c $(CFLAGS:s/\/\\) $(<:s,/,\)
-.ENDIF
-
-%$O: %$A ;
-.IF $(SHOW_ARGS)
-    $(AS) -o $(ASFLAGS:s/\/\\) $(<:s,/,\)
-.ELSE
-    @$(ECHO) $(AS) $(SHOW_ASFLAGS:s/\/\\) $(<:s,/,\)
-    @$(AS) @$(mktmp -o $@ $(ASFLAGS:s/\/\\)) $(<:s,/,\)
-.ENDIF
-
-# Implicit rule for building resource files
-%$R: %.rc ; $(RC) $< $(RCFLAGS) -o $@
-
-# Implicit rule for building a DLL
-# TODO!
-#%$D: ; +rclink $(LD) $(RC) $@ $(mktmp $(LDFLAGS) /Fe$@ $(&:t"\n"s/\/\\) $(PMLIB) $(EXELIBS) $(DEF_LIBS) $(LDENDFLAGS))
-
-# Implicit rule for building a library file
-%$L:     ;
-.IF $(SHOW_ARGS)
-    $(LIB) $(LIBFLAGS) $@ $&
-.ELSE
-    @$(ECHO) $(LIB) $@
-    @$(LIB) $(LIBFLAGS) $@ @$(mktmp $(&:s/\/\\)\n)
-.ENDIF
-
-# Implicit rule for building an executable file
-%$E:     ;
-.IF $(SHOW_ARGS)
-    $(LD) $(LDFLAGS) -o $@ $& $(EXELIBS) $(PMLIB) -lm
-.ELSE
-    @$(ECHO) ld $@
-    @$(LD) $(LDFLAGS) -o $@ @$(mktmp $(&:s/\/\\) $(EXELIBS) $(PMLIB) -lm)
-.ENDIF
diff --git a/board/MAI/bios_emulator/scitech/makedefs/rules/hc32.mk b/board/MAI/bios_emulator/scitech/makedefs/rules/hc32.mk
deleted file mode 100644 (file)
index 011e9ab..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-#############################################################################
-#
-#                                      SciTech Multi-platform Graphics Library
-#
-#  ========================================================================
-#
-#    The contents of this file are subject to the SciTech MGL Public
-#    License Version 1.0 (the "License"); you may not use this file
-#    except in compliance with the License. You may obtain a copy of
-#    the License at http://www.scitechsoft.com/mgl-license.txt
-#
-#    Software distributed under the License is distributed on an
-#    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-#    implied. See the License for the specific language governing
-#    rights and limitations under the License.
-#
-#    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-#
-#    The Initial Developer of the Original Code is SciTech Software, Inc.
-#    All Rights Reserved.
-#
-#  ========================================================================
-#
-# Descripton:   Rules makefile definitions, which define the rules used to
-#                              build targets. We include them here at the end of the
-#                              makefile so the generic project makefiles can override
-#                              certain things with macros (such as linking C++ programs
-#                              differently).
-#
-#############################################################################
-
-# Take out PMLIB if we don't need to link with it
-
-.IF $(NO_PMLIB)
-PMLIB :=
-.ENDIF
-
-# Implicit generation rules for making object files
-%$O: %.c ; $(CC) $(CFLAGS) -c $<
-%$O: %$P ; $(CC) $(CFLAGS) -c $<
-.IF $(USE_NASM)
-%$O: %$A ; $(AS) @$(mktmp -o $@ $(ASFLAGS:s/\/\\)) $(<:s,/,\)
-.ELSE
-%$O: %$A ; $(AS) @$(mktmp $(ASFLAGS:s/\/\\)) $(<:s,/,\)
-.ENDIF
-
-# Implicit rule for building a library file using response file
-%$L:      ; $(LIB) $(LIBFLAGS) $@ @$(mktmp,$*.rsp -R $?)
-
-# Implicit rule for building an executable file using response file
-%$E:      ; $(LD) $(LDFLAGS) -o $@ @$(mktmp $(&:s/\/\\) $(PMLIB) $(EXELIBS) -ldosx32.lib)
diff --git a/board/MAI/bios_emulator/scitech/makedefs/rules/qnx4.mk b/board/MAI/bios_emulator/scitech/makedefs/rules/qnx4.mk
deleted file mode 100644 (file)
index 55dc035..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-#############################################################################
-#
-#                                      SciTech Multi-platform Graphics Library
-#
-#  ========================================================================
-#
-#    The contents of this file are subject to the SciTech MGL Public
-#    License Version 1.0 (the "License"); you may not use this file
-#    except in compliance with the License. You may obtain a copy of
-#    the License at http://www.scitechsoft.com/mgl-license.txt
-#
-#    Software distributed under the License is distributed on an
-#    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-#    implied. See the License for the specific language governing
-#    rights and limitations under the License.
-#
-#    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-#
-#    The Initial Developer of the Original Code is SciTech Software, Inc.
-#    All Rights Reserved.
-#
-#  ========================================================================
-#
-# Descripton:   Rules makefile definitions, which define the rules used to
-#                              build targets. We include them here at the end of the
-#                              makefile so the generic project makefiles can override
-#                              certain things with macros (such as linking C++ programs
-#                              differently).
-#
-#############################################################################
-
-# Take out PMLIB if we don't need to link with it
-
-.IF $(NO_PMLIB)
-PMLIB :=
-.ENDIF
-
-# Whether to link in real VBIOS library, or just the stub library
-
-.IF $(USE_BIOS)
-VBIOSLIB := -lvbios.lib
-.ELSE
-VBIOSLIB := -lvbstubs.lib
-.END
-
-# Require special privledges for Nucleus programs (requires root access)
-
-.IF $(USE_NUCLEUS)
-LDFLAGS                += -T1
-.ENDIF
-
-# Implicit generation rules for making object files from source files
-%$O: %.c ;
-.IF $(SHOW_ARGS)
-    $(CC) $(CFLAGS) $<
-.ELSE
-    @echo $(CC) -c $<
-       +@$(CC) $(CFLAGS) $< > /dev/null
-.ENDIF
-
-%$O: %$P ;
-.IF $(SHOW_ARGS)
-       $(CXX) $(CFLAGS) $<
-.ELSE
-       @echo $(CXX) -c $<
-       +@$(CXX) $(CFLAGS) $< > /dev/null
-.ENDIF
-
-%$O: %$A ;
-.IF $(SHOW_ARGS)
-    $(AS) -o $@ $(ASFLAGS) $<
-.ELSE
-    @echo $(AS) $<
-       @$(AS) -o $@ $(ASFLAGS) $<
-.ENDIF
-
-# Implicit rule for building a library file
-%$L:     ;
-.IF $(SHOW_ARGS)
-    $(LIB) $(LIBFLAGS) -q $@ $&
-.ELSE
-    @echo $(LIB) $@
-       +@$(LIB) $(LIBFLAGS) -q $@ $& > /dev/null
-.ENDIF
-
-
-# Implicit rule for building an executable file
-%$E:     ;
-.IF $(SHOW_ARGS)
-       $(LD) $(LDFLAGS) -o $@ $& $(EXELIBS) $(PMLIB) $(VBIOSLIB)
-.ELSE
-       @echo wlink $@
-       +@$(LD) $(LDFLAGS) -o $@ $& $(EXELIBS) $(PMLIB) $(VBIOSLIB) > /dev/null
-.ENDIF
diff --git a/board/MAI/bios_emulator/scitech/makedefs/rules/qnxnto.mk b/board/MAI/bios_emulator/scitech/makedefs/rules/qnxnto.mk
deleted file mode 100644 (file)
index c43ad1f..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-#############################################################################
-#
-#                                      SciTech Multi-platform Graphics Library
-#
-#  ========================================================================
-#
-#    The contents of this file are subject to the SciTech MGL Public
-#    License Version 1.0 (the "License"); you may not use this file
-#    except in compliance with the License. You may obtain a copy of
-#    the License at http://www.scitechsoft.com/mgl-license.txt
-#
-#    Software distributed under the License is distributed on an
-#    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-#    implied. See the License for the specific language governing
-#    rights and limitations under the License.
-#
-#    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-#
-#    The Initial Developer of the Original Code is SciTech Software, Inc.
-#    All Rights Reserved.
-#
-#  ========================================================================
-#
-# Descripton:   Rules makefile definitions, which define the rules used to
-#                              build targets. We include them here at the end of the
-#                              makefile so the generic project makefiles can override
-#                              certain things with macros (such as linking C++ programs
-#                              differently).
-#
-#############################################################################
-
-# Take out PMLIB if we don't need to link with it
-
-.IF $(NO_PMLIB)
-PMLIB :=
-.ENDIF
-
-# Whether to link in real VBIOS library, or just the stub library
-
-.IF $(USE_BIOS)
-VBIOSLIB := -lvbios
-.ELSE
-VBIOSLIB := -lvbstubs
-.END
-
-# Implicit generation rules for making object files from source files
-%$O: %.c ; $(CC) $(CFLAGS) -c $<
-%$O: %$P ; $(CXX) $(CPPFLAGS) -c $<
-%$O: %$A ; $(AS) -o $@ $(ASFLAGS) $<
-
-# Implicit rule for building a library file
-%$L:     ; $(LIB) $(LIBFLAGS) $@ $&
-
-# Implicit rule for building an executable file
-%$E:     ; $(LD) $(LDFLAGS) -o $@ $& $(EXELIBS) $(PMLIB) $(VBIOSLIB)
diff --git a/board/MAI/bios_emulator/scitech/makedefs/rules/sc16.mk b/board/MAI/bios_emulator/scitech/makedefs/rules/sc16.mk
deleted file mode 100644 (file)
index b33bcd8..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-#############################################################################
-#
-#                                      SciTech Multi-platform Graphics Library
-#
-#  ========================================================================
-#
-#    The contents of this file are subject to the SciTech MGL Public
-#    License Version 1.0 (the "License"); you may not use this file
-#    except in compliance with the License. You may obtain a copy of
-#    the License at http://www.scitechsoft.com/mgl-license.txt
-#
-#    Software distributed under the License is distributed on an
-#    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-#    implied. See the License for the specific language governing
-#    rights and limitations under the License.
-#
-#    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-#
-#    The Initial Developer of the Original Code is SciTech Software, Inc.
-#    All Rights Reserved.
-#
-#  ========================================================================
-#
-# Descripton:   Rules makefile definitions, which define the rules used to
-#                              build targets. We include them here at the end of the
-#                              makefile so the generic project makefiles can override
-#                              certain things with macros (such as linking C++ programs
-#                              differently).
-#
-#############################################################################
-
-# Take out PMLIB if we don't need to link with it
-
-.IF $(NO_PMLIB)
-PMLIB :=
-.ENDIF
-
-# Implicit generation rules for making object files
-%$O: %.c ; $(CC) $(CFLAGS) -c $<
-%$O: %$P ; $(CC) $(CFLAGS) -c $<
-%$O: %$A ; $(AS) @$(mktmp $(ASFLAGS)) $(<:s,/,\)
-
-# Implicit rule for building resource files
-%$R: %.rc ; $(RC) $(RCFLAGS) -r $<
-
-# Implicit rule for building a DLL using a response file
-%$D: ; $(LD) $(LDFLAGS) @$(mktmp $(&:s/\/\\) $(EXELIBS))
-
-# Implicit rule for building a library file using response file
-.IF $(BUILD_DLL)
-%$L: ; $(ILIB) $(ILIBFLAGS) $@ $?
-.ELIF $(IMPORT_DLL)
-%$L: ; $(ILIB) $(ILIBFLAGS) $@ $?
-.ELSE
-%$L: ; $(LIB) $(LIBFLAGS) $@ @$(mktmp -+$(?:t" &\n-+")\n)
-.ENDIF
-
-# Implicit rule for building an executable file using response file
-.IF $(USE_WIN16)
-%$E: ; $(LD) $(LDFLAGS) @$(mktmp $(&:s/\/\\) $(EXELIBS))
-.ELSE
-%$E: ; $(LD) $(LDFLAGS) @$(mktmp $(&:s/\/\\) $(PMLIB) $(EXELIBS))
-.ENDIF
diff --git a/board/MAI/bios_emulator/scitech/makedefs/rules/sc32.mk b/board/MAI/bios_emulator/scitech/makedefs/rules/sc32.mk
deleted file mode 100644 (file)
index 2231906..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-#############################################################################
-#
-#                                      SciTech Multi-platform Graphics Library
-#
-#  ========================================================================
-#
-#    The contents of this file are subject to the SciTech MGL Public
-#    License Version 1.0 (the "License"); you may not use this file
-#    except in compliance with the License. You may obtain a copy of
-#    the License at http://www.scitechsoft.com/mgl-license.txt
-#
-#    Software distributed under the License is distributed on an
-#    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-#    implied. See the License for the specific language governing
-#    rights and limitations under the License.
-#
-#    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-#
-#    The Initial Developer of the Original Code is SciTech Software, Inc.
-#    All Rights Reserved.
-#
-#  ========================================================================
-#
-# Descripton:   Rules makefile definitions, which define the rules used to
-#                              build targets. We include them here at the end of the
-#                              makefile so the generic project makefiles can override
-#                              certain things with macros (such as linking C++ programs
-#                              differently).
-#
-#############################################################################
-
-# Take out PMLIB if we don't need to link with it
-
-.IF $(NO_PMLIB)
-PMLIB :=
-.ENDIF
-
-# Implicit generation rules for making object files
-%$O: %.c ; $(CC) $(CFLAGS) -c $<
-%$O: %$P ; $(CC) $(CFLAGS) -c $<
-.IF $(USE_NASM)
-%$O: %$A ; $(AS) @$(mktmp -o $@ $(ASFLAGS:s/\/\\)) $(<:s,/,\)
-.ELSE
-%$O: %$A ; $(AS) @$(mktmp $(ASFLAGS:s/\/\\)) $(<:s,/,\)
-.ENDIF
-
-# Implicit rule for building resource files
-%$R: %.rc ; $(RC) $(RCFLAGS) -r $<
-
-# Implicit rule for building a DLL using a response file
-%$D: ; $(LD) $(LDFLAGS) @$(mktmp,$*.lnk $(&:s/\/\\) $(EXELIBS) kernel32.lib user32.lib gdi32.lib winmm.lib comdlg32.lib advapi32.lib)
-
-# Implicit rule for building a library file using response file
-.IF $(BUILD_DLL)
-%$L: ; $(ILIB) $(ILIBFLAGS) $@ $?
-.ELIF $(IMPORT_DLL)
-%$L: ; $(ILIB) $(ILIBFLAGS) $@ $?
-.ELSE
-%$L: ; $(LIB) $(LIBFLAGS) $@ @$(mktmp -+$(?:t" &\n-+")\n)
-.ENDIF
-
-# Implicit rule for building an executable file using response file
-.IF $(USE_TNT)
-%$E: ; $(LD) $(LDFLAGS) @$(mktmp,$*.lnk $(&:s/\/\\) $(PMLIB) $(EXELIBS))
-.ELIF $(USE_WIN32)
-%$E: ; $(LD) $(LDFLAGS) @$(mktmp,$*.lnk $(&:s/\/\\) $(EXELIBS) kernel32.lib user32.lib gdi32.lib winmm.lib comdlg32.lib advapi32.lib)
-.ELSE
-%$E: ; $(LD) $(LDFLAGS) @$(mktmp,$*.lnk $(&:s/\/\\) $(PMLIB) $(EXELIBS))
-.ENDIF
diff --git a/board/MAI/bios_emulator/scitech/makedefs/rules/va32.mk b/board/MAI/bios_emulator/scitech/makedefs/rules/va32.mk
deleted file mode 100644 (file)
index 1a20319..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-#############################################################################
-#
-#                                       SciTech Multi-platform Graphics Library
-#
-#  ========================================================================
-#
-#    The contents of this file are subject to the SciTech MGL Public
-#    License Version 1.0 (the "License"); you may not use this file
-#    except in compliance with the License. You may obtain a copy of
-#    the License at http://www.scitechsoft.com/mgl-license.txt
-#
-#    Software distributed under the License is distributed on an
-#    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-#    implied. See the License for the specific language governing
-#    rights and limitations under the License.
-#
-#    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-#
-#    The Initial Developer of the Original Code is SciTech Software, Inc.
-#    All Rights Reserved.
-#
-#  ========================================================================
-#
-# Descripton:   Rules makefile definitions, which define the rules used to
-#                               build targets. We include them here at the end of the
-#                               makefile so the generic project makefiles can override
-#                               certain things with macros (such as linking C++ programs
-#                               differently).
-#
-#############################################################################
-
-# Take out PMLIB if we don't need to link with it
-
-.IF $(NO_PMLIB)
-PMLIB :=
-.ENDIF
-
-# Implicit generation rules for making object files
-%$O: %.c ; $(CC)  -c @$(mktmp $(CFLAGS:s/\/\\))  $(<:s,/,\)
-%$O: %$P ; $(CPP) -c @$(mktmp $(CFLAGS:s/\/\\))  $(<:s,/,\)
-.IF $(USE_NASM)
-%$O: %$A ; $(AS)  @$(mktmp -o $@ $(ASFLAGS:s/\/\\)) $(<:s,/,\)
-.ELSE
-%$O: %$A ; $(AS)  @$(mktmp $(ASFLAGS:s/\/\\)) $(<:s,/,\)
-.ENDIF
-
-# Implicit rule for building resource files
-%$R: %.rc ; $(RC) $(RCFLAGS) -r $<
-
-# Implicit rule for building help files
-%.hlp: %.ipf; $(IPFC) $(IPFCFLAGS) $<
-
-# Implicit rule for building a DLL using a response file
-.IF $(USE_OS2GUI)
-%$D: ; rclink $(LD) $(RC) $@ $(mktmp $(LDFLAGS) $(&:t"+\n":s/\/\\)\n$@\n$*.map\n$(EXELIBS) $(PMLIB)\n$*.def\n)
-.ELSE
-%$D: ; $(LD) /nofree /nol @$(mktmp $(LDFLAGS) $(&:t"+\n":s/\/\\)\n$@\n$*.map\n$(EXELIBS) $(PMLIB)\n$*.def\n)
-.ENDIF
-
-# Implicit rule for building a library file using response file
-.IF $(BUILD_DLL)
-%$L: ; $(ILIB) $(ILIBFLAGS) $@ $?
-.ELIF $(IMPORT_DLL)
-%$L: ; $(ILIB) $(ILIBFLAGS) $@ $?
-.ELSE
-%$L: ; $(LIB) $(LIBFLAGS) @$(mktmp $@-+$(?:t"&\n-+":s/\/\\);)
-.ENDIF
-
-# Implicit rule for building an executable file using response file
-.IF $(USE_OS2GUI)
-%$E: ;
-       rclink $(LD) $(RC) $@ $(mktmp $(LDFLAGS) $(&:t"+\n":s/\/\\)\n$@\n$*.map\n$(EXELIBS) $(PMLIB)\n$*.def\n)
-.IF $(LXLITE)
-       lxlite $@
-.ENDIF
-.ELSE
-%$E: ;
-       rclink $(LD) $(RC) $@ $(mktmp $(LDFLAGS) $(&:t"+\n":s/\/\\)\n$@\n$*.map\n$(EXELIBS) $(PMLIB)\n\n)
-.IF $(LXLITE)
-       lxlite $@
-.ENDIF
-.ENDIF
diff --git a/board/MAI/bios_emulator/scitech/makedefs/rules/va365.mk b/board/MAI/bios_emulator/scitech/makedefs/rules/va365.mk
deleted file mode 100644 (file)
index 2b41801..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-#############################################################################
-#
-#                                       SciTech Multi-platform Graphics Library
-#
-#  ========================================================================
-#
-#    The contents of this file are subject to the SciTech MGL Public
-#    License Version 1.0 (the "License"); you may not use this file
-#    except in compliance with the License. You may obtain a copy of
-#    the License at http://www.scitechsoft.com/mgl-license.txt
-#
-#    Software distributed under the License is distributed on an
-#    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-#    implied. See the License for the specific language governing
-#    rights and limitations under the License.
-#
-#    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-#
-#    The Initial Developer of the Original Code is SciTech Software, Inc.
-#    All Rights Reserved.
-#
-#  ========================================================================
-#
-# Descripton:   Rules makefile definitions, which define the rules used to
-#                               build targets. We include them here at the end of the
-#                               makefile so the generic project makefiles can override
-#                               certain things with macros (such as linking C++ programs
-#                               differently).
-#
-#############################################################################
-
-# Take out PMLIB if we don't need to link with it
-
-.IF $(NO_PMLIB)
-PMLIB :=
-.ENDIF
-
-# Implicit generation rules for making object files
-%$O: %.c ; $(CC) -c @$(mktmp $(CFLAGS:s/\/\\))  $(<:s,/,\)
-%$O: %$P ; $(CPP) -c @$(mktmp $(CFLAGS:s/\/\\))  $(<:s,/,\)
-.IF $(USE_NASM)
-%$O: %$A ; $(AS) @$(mktmp -o $@ $(ASFLAGS:s/\/\\)) $(<:s,/,\)
-.ELSE
-%$O: %$A ; $(AS) @$(mktmp $(ASFLAGS:s/\/\\)) $(<:s,/,\)
-.ENDIF
-
-# Implicit rule for building resource files
-%$R: %.rc ; $(RC) $(RCFLAGS) -r $<
-
-# Implicit rule for building a DLL using a response file
-.IF $(USE_OS2GUI)
-%$D: ; rclink $(LD) $(RC) $@ $(mktmp $(LDFLAGS) $(&:t"+\n":s/\/\\)\n$@\n$*.map\n$(EXELIBS) $(PMLIB)\n$*.def\n)
-.ELSE
-%$D: ; $(LD) /nofree /nol @$(mktmp $(LDFLAGS) $(&:t"+\n":s/\/\\)\n$@\n$*.map\n$(EXELIBS) $(PMLIB)\n$*.def\n)
-.ENDIF
-
-# Implicit rule for building a library file using response file
-.IF $(BUILD_DLL)
-%$L: ; $(ILIB) $(ILIBFLAGS) /out:$@ $?
-.ELIF $(IMPORT_DLL)
-%$L: ; $(ILIB) $(ILIBFLAGS) /out:$@ $?
-.ELSE
-%$L: ; $(LIB) $(LIBFLAGS) /nowarn:86 /out:$@ @$(mktmp $(?:t"\n":s/\/\\))
-.ENDIF
-
-# Implicit rule for building an executable file using response file
-.IF $(USE_OS2GUI)
-%$E: ;
-       rclink $(LD) $(RC) $@ $(mktmp $(LDFLAGS) $(&:t"+\n":s/\/\\)\n$@\n$*.map\n$(EXELIBS) $(PMLIB)\n$*.def\n)
-.IF $(LXLITE)
-       lxlite $@
-.ENDIF
-.ELSE
-%$E: ;
-       rclink $(LD) $(RC) $@ $(mktmp $(LDFLAGS) $(&:t"+\n":s/\/\\)\n$@\n$*.map\n$(EXELIBS) $(PMLIB)\n\n)
-.IF $(LXLITE)
-       lxlite $@
-.ENDIF
-.ENDIF
diff --git a/board/MAI/bios_emulator/scitech/makedefs/rules/vc16.mk b/board/MAI/bios_emulator/scitech/makedefs/rules/vc16.mk
deleted file mode 100644 (file)
index 6ffc270..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-#############################################################################
-#
-#                                      SciTech Multi-platform Graphics Library
-#
-#  ========================================================================
-#
-#    The contents of this file are subject to the SciTech MGL Public
-#    License Version 1.0 (the "License"); you may not use this file
-#    except in compliance with the License. You may obtain a copy of
-#    the License at http://www.scitechsoft.com/mgl-license.txt
-#
-#    Software distributed under the License is distributed on an
-#    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-#    implied. See the License for the specific language governing
-#    rights and limitations under the License.
-#
-#    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-#
-#    The Initial Developer of the Original Code is SciTech Software, Inc.
-#    All Rights Reserved.
-#
-#  ========================================================================
-#
-# Descripton:   Rules makefile definitions, which define the rules used to
-#                              build targets. We include them here at the end of the
-#                              makefile so the generic project makefiles can override
-#                              certain things with macros (such as linking C++ programs
-#                              differently).
-#
-#############################################################################
-
-# Take out PMLIB if we don't need to link with it
-
-.IF $(NO_PMLIB)
-PMLIB :=
-.ENDIF
-
-# Implicit generation rules for making object files
-%$O: %.c ; $(CC) /nologo $(CFLAGS) /c $<
-%$O: %$P ; $(CC) /nologo $(CFLAGS) /c $<
-%$O: %$A ; $(AS) @$(mktmp $(ASFLAGS)) $(<:s,/,\)
-
-# Implicit rule for building resource files
-%$R: %.rc ; $(RC) $(RCFLAGS) -r $<
-
-# Implicit rule for building a DLL using a response file
-%$D: ; rclink $(LD) $(RC) $@ $(mktmp $(LDFLAGS) -e$@\n$(&:t"\n":s/\/\\)\n$(EXELIBS))
-
-# Implicit rule for building a library file using response file
-.IF $(BUILD_DLL)
-%$L: ;
-    @$(RM) $@
-    $(ILIB) $(ILIBFLAGS) $@ $?
-.ELIF $(IMPORT_DLL)
-%$L: ;
-    @$(RM) $@
-    $(ILIB) $(ILIBFLAGS) $@ $?
-.ELSE
-%$L: ;
-    @$(RM) $@
-    $(LIB) $@ /nologo $(LIBFLAGS) @$(mktmp +$(&:t" &\n+") &\n,\n)
-.ENDIF
-
-# Implicit rule for building an executable file using response file
-.IF $(USE_WIN16)
-%$E: ; rclink $(LD) $(RC) $@ $(mktmp $(LDFLAGS) /Fe$@ $(&:s/\/\\) $(EXELIBS))
-#%$E: ; $(LD) @$(mktmp $(LDFLAGS) /Fe$@ $(&:s/\/\\) $(EXELIBS))
-.ELSE
-%$E: ; $(LD) @$(mktmp $(LDFLAGS) /Fe$@ $(&:s/\/\\) $(PMLIB) $(EXELIBS))
-.ENDIF
diff --git a/board/MAI/bios_emulator/scitech/makedefs/rules/vc32.mk b/board/MAI/bios_emulator/scitech/makedefs/rules/vc32.mk
deleted file mode 100644 (file)
index 97f1a0c..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-#############################################################################
-#
-#                                      SciTech Multi-platform Graphics Library
-#
-#  ========================================================================
-#
-#    The contents of this file are subject to the SciTech MGL Public
-#    License Version 1.0 (the "License"); you may not use this file
-#    except in compliance with the License. You may obtain a copy of
-#    the License at http://www.scitechsoft.com/mgl-license.txt
-#
-#    Software distributed under the License is distributed on an
-#    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-#    implied. See the License for the specific language governing
-#    rights and limitations under the License.
-#
-#    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-#
-#    The Initial Developer of the Original Code is SciTech Software, Inc.
-#    All Rights Reserved.
-#
-#  ========================================================================
-#
-# Descripton:   Rules makefile definitions, which define the rules used to
-#                              build targets. We include them here at the end of the
-#                              makefile so the generic project makefiles can override
-#                              certain things with macros (such as linking C++ programs
-#                              differently).
-#
-#############################################################################
-
-# Turn on pre-compiled headers as neccessary
-.IF $(PRECOMP_HDR)
-   CFLAGS       += -YX"$(PRECOMP_HDR)"
-.ENDIF
-
-# Turn on runtime type information as necessary
-.IF $(USE_RTTI)
-       CFLAGS          += /GR
-.ENDIF
-
-# Turn on C++ exception handling as necessary
-.IF $(USE_CPPEXCEPT)
-       CFLAGS          += /GX
-.ENDIF
-
-# Take out PMLIB if we don't need to link with it
-
-.IF $(NO_PMLIB)
-PMLIB :=
-.ENDIF
-
-# Implicit generation rules for making object files
-%$O: %.c ; $(CC) /nologo @$(mktmp $(CFLAGS:s/\/\\)) /c $(<:s,/,\)
-%$O: %$P ; $(CC) /nologo @$(mktmp $(CFLAGS:s/\/\\)) /c $(<:s,/,\)
-.IF $(USE_NASM)
-%$O: %$A ; $(AS) @$(mktmp -o $@ $(ASFLAGS:s/\/\\)) $(<:s,/,\)
-.ELSE
-%$O: %$A ; $(AS) @$(mktmp $(ASFLAGS:s/\/\\)) $(<:s,/,\)
-.ENDIF
-
-# Implicit rule for building resource files
-%$R: %.rc ; $(RC) $(RCFLAGS) -r $<
-
-# Implicit rules for building NT device drivers
-
-%.sys: ;
-       $(LD) /nologo @$(mktmp $(LDFLAGS) /Fe$@ $(&:t"\n"s/\/\\) $(PMLIB) $(EXELIBS) $(DEF_LIBS) $(LDENDFLAGS))
-.IF $(DBG)
-.IF $(USE_SOFTICE)
-       $(NMSYM) $(NMSYMFLAGS);$(SI_SOURCE) $@
-.ENDIF
-.ENDIF
-
-# Implicit rule for building a DLL using a response file
-.IF $(IMPORT_DLL)
-.ELSE
-.IF $(NO_RUNTIME)
-%$D: ; $(LD) /nologo @$(mktmp $(LDFLAGS) /Fe$@ $(&:t"\n"s/\/\\) $(EXELIBS) $(DEF_LIBS) $(LDENDFLAGS))
-.ELSE
-%$D: ;
-       makedef -v $*
-       $(LD) /nologo @$(mktmp $(LDFLAGS) /Fe$@ $(&:t"\n"s/\/\\) $(PMLIB) $(EXELIBS) $(DEF_LIBS) $(LDENDFLAGS))
-.IF $(DBG)
-.IF $(USE_SOFTICE)
-       $(NMSYM) $(NMSYMFLAGS);$(SI_SOURCE) $@
-.ENDIF
-.ENDIF
-.ENDIF
-.ENDIF
-
-# Implicit rule for building a library file using response file. Note that
-# we use a special .VCD file that contains the EXPORT definitions for the
-# Microsoft compiler, since the LIB utility automatically adds leading
-# underscores to exported functions.
-.IF $(IMPORT_DLL)
-%$L: ;
-       makedef -v $(?:b)
-    @$(RM) $@
-       $(ILIB) $(ILIBFLAGS) /DEF:$(?:b).def /OUT:$@
-.ELSE
-%$L: ;
-    @$(RM) $@
-    $(LIB) $(LIBFLAGS) /out:$@ @$(mktmp $(&:t"\n")\n)
-.ENDIF
-
-# Implicit rule for building an executable file using response file
-.IF $(USE_WIN32)
-%$E: ;
-       $(LD) /nologo @$(mktmp $(LDFLAGS) /Fe$@ $(&:t"\n"s/\/\\) $(PMLIB) $(EXELIBS) $(DEF_LIBS) $(LDENDFLAGS))
-.IF $(DBG)
-.IF $(USE_SOFTICE)
-       $(NMSYM) $(NMSYMFLAGS);$(SI_SOURCE) $@
-.ENDIF
-.ENDIF
-.ELSE
-%$E: ;
-       @$(LD) /nologo @$(mktmp $(LDFLAGS) /Fe$@ $(&:t"\n"s/\/\\) $(PMLIB) $(EXELIBS) $(DEF_LIBS) $(LDENDFLAGS))
-.IF $(DOSSTYLE)
-       @markphar $@
-.ENDIF
-.ENDIF
diff --git a/board/MAI/bios_emulator/scitech/makedefs/rules/wc16.mk b/board/MAI/bios_emulator/scitech/makedefs/rules/wc16.mk
deleted file mode 100644 (file)
index d1ca917..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-#############################################################################
-#
-#                                      SciTech Multi-platform Graphics Library
-#
-#  ========================================================================
-#
-#    The contents of this file are subject to the SciTech MGL Public
-#    License Version 1.0 (the "License"); you may not use this file
-#    except in compliance with the License. You may obtain a copy of
-#    the License at http://www.scitechsoft.com/mgl-license.txt
-#
-#    Software distributed under the License is distributed on an
-#    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-#    implied. See the License for the specific language governing
-#    rights and limitations under the License.
-#
-#    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-#
-#    The Initial Developer of the Original Code is SciTech Software, Inc.
-#    All Rights Reserved.
-#
-#  ========================================================================
-#
-# Descripton:   Rules makefile definitions, which define the rules used to
-#                              build targets. We include them here at the end of the
-#                              makefile so the generic project makefiles can override
-#                              certain things with macros (such as linking C++ programs
-#                              differently).
-#
-#############################################################################
-
-# Take out PMLIB if we don't need to link with it
-
-.IF $(NO_PMLIB)
-PMLIB :=
-.ENDIF
-
-# Implicit generation rules for making object files
-%$O: %.c ; $(CC) @$(mktmp $(CFLAGS)) $<
-%$O: %$P ; $(CPP) @$(mktmp $(CFLAGS)) $<
-%$O: %$A ; $(AS) @$(mktmp $(ASFLAGS)) $(<:s,/,\)
-
-# Implicit rule for building resource files
-%$R: %.rc ; $(RC) $(RCFLAGS) -r $<
-
-# Implicit rule for building a library file using response file
-.IF $(BUILD_DLL)
-%$L: ;
-    @$(RM) $@
-    $(ILIB) $(ILIBFLAGS) $@ +$?
-.ELIF $(IMPORT_DLL)
-%$L: ;
-    @$(RM) $@
-    $(ILIB) $(ILIBFLAGS) $@ +$?
-.ELSE
-%$L: ;
-    @$(RM) $@
-    $(LIB) $(LIBFLAGS) $@ @$(mktmp,$*.rsp +$(&:t"\n+":s/\/\\)\n)
-.ENDIF
-
-# Implicit rule for building an executable file using response file
-.IF $(USE_WIN16)
-.IF $(BUILD_DLL)
-%$E: ;
-       @trimlib $(mktmp $(LDFLAGS) OP quiet SYS windows_dll\nN $@\nF $(&:t",":s/\/\\)\nLIBR $(EXELIBS:t",")) $*.lnk
-       rclink $(LD) $(RC) $@ $*.lnk
-       @$(RM) -S $(mktmp $*.lnk)
-.ELSE
-%$E: ;
-       @trimlib $(mktmp $(LDFLAGS) OP quiet SYS windows\nN $@\nF $(&:t",":s/\/\\)\nLIBR $(EXELIBS:t",")) $*.lnk
-       rclink $(LD) $(RC) $@ $*.lnk
-       @$(RM) -S $(mktmp $*.lnk)
-.ENDIF
-.ELSE
-%$E: ;
-       @trimlib $(mktmp OP quiet\nN $@\nF $(&:t",":s/\/\\)\nLIBR $(PMLIB) $(EXELIBS:t",")) $*.lnk
-       $(LD) $(LDFLAGS) @$*.lnk
-       @$(RM) -S $(mktmp $*.lnk)
-.ENDIF
diff --git a/board/MAI/bios_emulator/scitech/makedefs/rules/wc32.mk b/board/MAI/bios_emulator/scitech/makedefs/rules/wc32.mk
deleted file mode 100644 (file)
index 39b8819..0000000
+++ /dev/null
@@ -1,264 +0,0 @@
-#############################################################################
-#
-#                                      SciTech Multi-platform Graphics Library
-#
-#  ========================================================================
-#
-#    The contents of this file are subject to the SciTech MGL Public
-#    License Version 1.0 (the "License"); you may not use this file
-#    except in compliance with the License. You may obtain a copy of
-#    the License at http://www.scitechsoft.com/mgl-license.txt
-#
-#    Software distributed under the License is distributed on an
-#    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-#    implied. See the License for the specific language governing
-#    rights and limitations under the License.
-#
-#    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-#
-#    The Initial Developer of the Original Code is SciTech Software, Inc.
-#    All Rights Reserved.
-#
-#  ========================================================================
-#
-# Descripton:   Rules makefile definitions, which define the rules used to
-#                              build targets. We include them here at the end of the
-#                              makefile so the generic project makefiles can override
-#                              certain things with macros (such as linking C++ programs
-#                              differently).
-#
-#############################################################################
-
-# Take out PMLIB if we don't need to link with it
-
-.IF $(NO_PMLIB)
-PMLIB :=
-.ENDIF
-
-# Use a larger stack during linking if requested, or use a default stack
-# of 200k. The usual default stack provided by Watcom C++ is *way* to small
-# for real 32 bit code development. We also need a *huge* stack for OpenGL
-# software rendering also!
-.IF $(USE_QNX4)
-    # Not necessary for QNX code.
-.ELSE
-.IF $(STKSIZE)
-    LDFLAGS            += OP STACK=$(STKSIZE)
-.ELSE
-       LDFLAGS         += OP STACK=204800
-.ENDIF
-.ENDIF
-
-# Turn on runtime type information as necessary
-.IF $(USE_RTTI)
-       CPFLAGS         += -xr
-.ENDIF
-
-# Optionally turn on pre-compiled headers
-.IF $(PRECOMP_HDR)
-       CFLAGS          += -fhq
-.ENDIF
-
-.IF $(USE_QNX)
-# Whether to link in real VBIOS library, or just the stub library
-.IF $(USE_BIOS)
-VBIOSLIB := vbios.lib,
-.ELSE
-VBIOSLIB := vbstubs.lib,
-.END
-# Require special privledges for Nucleus programs (requires root access)
-.IF $(USE_NUCLEUS)
-LDFLAGS                += OP PRIV=1
-.ENDIF
-.ENDIF
-
-# Implicit generation rules for making object files
-.IF $(WC_LIBBASE) == WC10A
-%$O: %.c ; $(CC) $(CFLAGS) $(<:s,/,\)
-%$O: %$P ; $(CPP) $(CFLAGS) $(<:s,/,\)
-.ELSE
-%$O: %.c ; $(CC) @$(mktmp $(CFLAGS:s/\/\\)) $(<:s,/,\)
-%$O: %$P ; $(CPP) @$(mktmp $(CPFLAGS:s/\/\\) $(CFLAGS:s/\/\\)) $(<:s,/,\)
-.ENDIF
-.IF $(USE_NASM)
-%$O: %$A ; $(AS) @$(mktmp -o $@ $(ASFLAGS:s/\/\\)) $(<:s,/,\)
-.ELSE
-%$O: %$A ; $(AS) @$(mktmp $(ASFLAGS:s/\/\\)) $(<:s,/,\)
-.ENDIF
-
-# Implit rule to compile .S assembler files. The first version
-# uses GAS directly and the second uses a pre-processor to
-# produce NASM code.
-
-.IF $(USE_GAS)
-.IF $(WC_LIBBASE) == WC11
-%$O: %$S ; $(GAS) -c @$(mktmp $(GAS_FLAGS:s/\/\\)) $(<:s,/,\)
-.ELSE
-# Black magic to build asm sources with Watcom 10.6 (requires sed)
-%$O: %$S ;
-       $(GAS) -c @$(mktmp $(GAS_FLAGS:s/\/\\)) $(<:s,/,\)
-       wdisasm \\ -a $(*:s,/,\).o > $(*:s,/,\).lst
-       sed -e "s/\.text/_TEXT/; s/\.data/_DATA/; s/\.bss/_BSS/; s/\.386/\.586/; s/lar *ecx,cx/lar ecx,ecx/" $(*:s,/,\).lst > $(*:s,/,\).asm
-       wasm \\ $(WFLAGS) -zq -fr=nul -fp3 -fo=$@ $(*:s,/,\).asm
-       $(RM) -S $(mktmp $(*:s,/,\).o)
-       $(RM) -S $(mktmp $(*:s,/,\).lst)
-       $(RM) -S $(mktmp $(*:s,/,\).asm)
-.ENDIF
-.ELSE
-%$O: %$S ;
-       @gcpp -DNASM_ASSEMBLER -D__WATCOMC__ -EP $(<:s,/,\) > $(*:s,/,\).asm
-       nasm @$(mktmp -f obj -o $@) $(*:s,/,\).asm
-       @$(RM) -S $(mktmp $(*:s,/,\).asm)
-.ENDIF
-
-# Special target to build dllstart.asm using Borland TASM
-dllstart.obj: dllstart.asm
-       $(DLL_TASM) @$(mktmp /t /mx /m /D__FLAT__ /i$(SCITECH)\INCLUDE /q) $(PRIVATE)\src\common\dllstart.asm
-
-# Implicit rule for building resource files
-%$R: %.rc ; $(RC) $(RCFLAGS) -r $<
-
-# Implicit rule for building a DLL using a response file
-.IF $(IMPORT_DLL)
-.ELSE
-.IF $(USE_OS232)
-%$D: ;
-       @trimlib $(mktmp $(LDFLAGS) OP quiet SYS os2v2 dll\nN $@\nF $(&:t",\n":s/\/\\)\nLIBR $(EXELIBS:t",")) $*.lnk
-       rclink $(LD) $(RC) $@ $*.lnk
-.IF $(LEAVE_LINKFILE)
-.ELSE
-       @$(RM) -S $(mktmp *.lnk)
-.ENDIF
-.ELIF $(USE_WIN32)
-%$D: ;
-       @trimlib $(mktmp $(LDFLAGS) OP quiet SYS nt_dll\nN $@\nF $(&:t",\n":s/\/\\)\nLIBR $(PMLIB)$(DEFLIBS)$(EXELIBS:t",")) $*.lnk
-       rclink $(LD) $(RC) $@ $*.lnk
-.IF $(LEAVE_LINKFILE)
-.ELSE
-       @$(RM) -S $(mktmp *.lnk)
-.ENDIF
-.ELSE
-%$D: ;
-       @trimlib $(mktmp $(LDFLAGS) OP quiet SYS win386\nN $*.rex\nF $(&:t",\n":s/\/\\)\nLIBR $(EXELIBS:t",")) $*.lnk
-       rclink $(LD) $(RC) $@ $*.lnk
-       wbind $* -d -q -n
-.IF $(LEAVE_LINKFILE)
-.ELSE
-       @$(RM) -S $(mktmp *.lnk)
-.ENDIF
-.ENDIF
-.ENDIF
-
-# Implicit rule for building a library file using response file
-.IF $(BUILD_DLL)
-%$L: ;
-       @$(RM) $@
-       $(ILIB) $(ILIBFLAGS) $@ +$?
-.ELIF $(IMPORT_DLL)
-%$L: ;
-       @$(RM) $@
-       $(ILIB) $(ILIBFLAGS) $@ +$?
-.ELSE
-%$L: ;
-    @$(RM) $@
-    $(LIB) $(LIBFLAGS) $@ @$(mktmp,$*.rsp +$(&:t"\n+":s/\/\\)\n)
-.ENDIF
-
-# Implicit rule for building an executable file using response file
-.IF $(USE_X32)
-%$E: ;
-       @trimlib $(mktmp OP quiet\nN $@\nF $(&:t",":s/\/\\)\nLIBR $(PMLIB)$(EXELIBS:t",")) $*.lnk
-       $(LD) $(LDFLAGS) @$*.lnk
-       x32fix $@
-.IF $(LEAVE_LINKFILE)
-.ELSE
-       @$(RM) -S $(mktmp *.lnk)
-.ENDIF
-.ELIF $(USE_OS232)
-.IF $(USE_OS2GUI)
-%$E: ;
-       @trimlib $(mktmp $(LDFLAGS) OP quiet SYS os2v2_pm\nN $@\nF $(&:t",":s/\/\\)\nLIBR $(PMLIB)$(EXELIBS:t",")) $*.lnk
-       rclink $(LD) $(RC) $@ $*.lnk
-.IF $(LEAVE_LINKFILE)
-.ELSE
-       @$(RM) -S $(mktmp *.lnk)
-.ENDIF
-.IF $(LXLITE)
-       lxlite $@
-.ENDIF
-.ELSE
-%$E: ;
-       @trimlib $(mktmp $(LDFLAGS) OP quiet SYS os2v2\nN $@\nF $(&:t",":s/\/\\)\nLIBR $(PMLIB)$(EXELIBS:t",")) $*.lnk
-       rclink $(LD) $(RC) $@ $*.lnk
-.IF $(LEAVE_LINKFILE)
-.ELSE
-       @$(RM) -S $(mktmp *.lnk)
-.ENDIF
-.IF $(LXLITE)
-       lxlite $@
-.ENDIF
-.ENDIF
-.ELIF $(USE_SNAP)
-%$E: ;
-       @trimlib $(mktmp $(LDFLAGS) OP quiet SYS nt\nN $@\nF $(&:t",":s/\/\\)\nLIBR $(DEFLIBS)$(EXELIBS:t",")) $*.lnk
-       rclink $(LD) $(RC) $@ $*.lnk
-.IF $(LEAVE_LINKFILE)
-.ELSE
-       @$(RM) -S $(mktmp *.lnk)
-.ENDIF
-.ELIF $(USE_WIN32)
-.IF $(WIN32_GUI)
-%$E: ;
-       @trimlib $(mktmp $(LDFLAGS) OP quiet SYS win95\nN $@\nF $(&:t",":s/\/\\)\nLIBR $(PMLIB)$(DEFLIBS)$(EXELIBS:t",")) $*.lnk
-       rclink $(LD) $(RC) $@ $*.lnk
-.IF $(LEAVE_LINKFILE)
-.ELSE
-       @$(RM) -S $(mktmp *.lnk)
-.ENDIF
-.ELSE
-%$E: ;
-       @trimlib $(mktmp $(LDFLAGS) OP quiet SYS nt\nN $@\nF $(&:t",":s/\/\\)\nLIBR $(PMLIB)$(DEFLIBS)$(EXELIBS:t",")) $*.lnk
-       rclink $(LD) $(RC) $@ $*.lnk
-.IF $(LEAVE_LINKFILE)
-.ELSE
-       @$(RM) -S $(mktmp *.lnk)
-.ENDIF
-.ENDIF
-.ELIF $(USE_WIN386)
-%$E: ;
-       @trimlib $(mktmp $(LDFLAGS) OP quiet SYS win386\nN $*.rex\nF $(&:t",":s/\/\\)\nLIBR $(PMLIB)$(EXELIBS:t",")) $*.lnk
-       rclink $(LD) wbind $*.rex $*.lnk
-.IF $(LEAVE_LINKFILE)
-.ELSE
-       @$(RM) -S $(mktmp *.lnk)
-.ENDIF
-.ELIF $(USE_TNT)
-%$E: ;
-       @trimlib $(mktmp $(LDFLAGS) OP quiet\nN $@\nF $(&:t",":s/\/\\)\nLIBR dosx32.lib,tntapi.lib,$(PMLIB)$(EXELIBS:t",")) $*.lnk
-       $(LD) @$*.lnk
-.IF $(LEAVE_LINKFILE)
-.ELSE
-       @$(RM) -S $(mktmp *.lnk)
-.ENDIF
-.IF $(DOSSTYLE)
-       @markphar $@
-.ENDIF
-.ELIF $(USE_QNX4)
-%$E: ;
-       @trimlib $(mktmp $(LDFLAGS) OP quiet\nN $@\nF $(&:t",":s/\/\\)\nLIBR $(PMLIB)$(VBIOSLIB)$(EXELIBS:t",")) $*.lnk
-       @+if exist $*.exe attrib -s $*.exe > NUL
-       $(LD) @$*.lnk
-       @attrib +s $*.exe
-.IF $(LEAVE_LINKFILE)
-.ELSE
-       @$(RM) -S $(mktmp *.lnk)
-.ENDIF
-.ELSE
-%$E: ;
-       @trimlib $(mktmp $(LDFLAGS) OP quiet\nN $@\nF $(&:t",":s/\/\\)\nLIBR $(PMLIB)$(EXELIBS:t",")) $*.lnk
-       $(LD) @$*.lnk
-.IF $(LEAVE_LINKFILE)
-.ELSE
-       @$(RM) -S $(mktmp *.lnk)
-.ENDIF
-.ENDIF
diff --git a/board/MAI/bios_emulator/scitech/makedefs/sc16.mk b/board/MAI/bios_emulator/scitech/makedefs/sc16.mk
deleted file mode 100644 (file)
index 099ad45..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-#############################################################################
-#
-#                                      SciTech Multi-platform Graphics Library
-#
-#  ========================================================================
-#
-#    The contents of this file are subject to the SciTech MGL Public
-#    License Version 1.0 (the "License"); you may not use this file
-#    except in compliance with the License. You may obtain a copy of
-#    the License at http://www.scitechsoft.com/mgl-license.txt
-#
-#    Software distributed under the License is distributed on an
-#    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-#    implied. See the License for the specific language governing
-#    rights and limitations under the License.
-#
-#    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-#
-#    The Initial Developer of the Original Code is SciTech Software, Inc.
-#    All Rights Reserved.
-#
-#  ========================================================================
-#
-# Descripton:   Generic DMAKE startup makefile definitions file. Assumes
-#               that the SCITECH environment variable has been set to point
-#               to where all our stuff is installed. You should not need
-#               to change anything in this file.
-#
-#               Symantec C++ 6.x/7.x 16 bit version. Supports 16 bit DOS
-#               and 16 bit Windows development.
-#
-#############################################################################
-
-# Include standard startup script definitions
-.IMPORT: SCITECH
-.INCLUDE: "$(SCITECH)\makedefs\startup.mk"
-
-# Import enivornment variables that we use
-.IMPORT .IGNORE : SC_LIBBASE
-
-# Default commands for compiling, assembling linking and archiving
-   CC           := sc       # C-compiler and flags
-   CFLAGS       := -ml -Jm
-.IF $(USE_TASM32)
-   AS           := tasm32
-.ELIF $(USE_TASMX)
-   AS           := tasmx    # Assembler and flags
-.ELSE
-   AS           := tasm     # Assembler and flags
-.ENDIF
-   ASFLAGS      := /t /mx /m /D__COMM__ /iINCLUDE /i$(SCITECH)\INCLUDE
-   LD           := sc       # Loader and flags
-   LDFLAGS       = $(CFLAGS)
-   RC           := rcc      # WIndows resource compiler
-   RCFLAGS      :=          # Mark as Win32 compatible resources
-   LIB          := lib      # Librarian
-   LIBFLAGS     := /N /B
-   ILIB         := implib   # Import librarian
-   ILIBFLAGS    :=
-
-# Optionally turn on debugging information
-.IF $(DBG)
-   CFLAGS       += -g       # Turn on debugging for C compiler
-.ELSE
-   ASFLAGS      += /q       # Suppress object records not needed for linking
-.END
-
-# Optionally turn on optimisations
-.IF $(OPT)
-   CFLAGS       += -5 -o+all
-.ELIF $(OPT_SIZE)
-   CFLAGS       += -5 -o+space
-.END
-
-# Optionally turn on direct i387 FPU instructions
-
-.IF $(FPU)
-   CFLAGS       += -ff -DFPU387
-   ASFLAGS      += -DFPU387 -DFPU_REG_RTN
-.END
-
-# Optionally compile a beta release version of a product
-.IF $(BETA)
-   CFLAGS       += -DBETA
-   ASFLAGS      += -DBETA
-.END
-
-# User a larger stack if requested
-
-.IF $(STKSIZE)
-    LDFLAGS     += =$(STKSIZE)
-.ENDIF
-
-# Optionally compile for 16 bit Windows
-.IF $(USE_WIN16)
-.IF $(BUILD_DLL)
-   CFLAGS       += -WD -DBUILD_DLL
-   ASFLAGS      += -DBUILD_DLL
-.ELSE
-   CFLAGS       += -WA
-.ENDIF
-   DX_ASFLAGS   += -D__WINDOWS16__
-   LIB_OS       = WIN16
-.ELSE
-   USE_REALDOS := 1
-   LIB_OS       = DOS16
-.END
-
-# Place to look for PMODE library files
-
-PMLIB           := pm.lib
-
-# Define the base directory for library files
-
-.IF $(CHECKED)
-LIB_BASE_DIR   := $(SCITECH_LIB)\lib\debug
-CFLAGS                 += -DCHECKED=1
-.ELSE
-LIB_BASE_DIR   := $(SCITECH_LIB)\lib\release
-.ENDIF
-
-# Define where to install library files
-   LIB_BASE     := $(LIB_BASE_DIR)\$(LIB_OS)\$(SC_LIBBASE)
-   LIB_DEST     := $(LIB_BASE)
-
-# Define which file contains our rules
-
-   RULES_MAK   := sc16.mk
diff --git a/board/MAI/bios_emulator/scitech/makedefs/sc32.mk b/board/MAI/bios_emulator/scitech/makedefs/sc32.mk
deleted file mode 100644 (file)
index 9ca7570..0000000
+++ /dev/null
@@ -1,178 +0,0 @@
-#############################################################################
-#
-#                                      SciTech Multi-platform Graphics Library
-#
-#  ========================================================================
-#
-#    The contents of this file are subject to the SciTech MGL Public
-#    License Version 1.0 (the "License"); you may not use this file
-#    except in compliance with the License. You may obtain a copy of
-#    the License at http://www.scitechsoft.com/mgl-license.txt
-#
-#    Software distributed under the License is distributed on an
-#    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-#    implied. See the License for the specific language governing
-#    rights and limitations under the License.
-#
-#    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-#
-#    The Initial Developer of the Original Code is SciTech Software, Inc.
-#    All Rights Reserved.
-#
-#  ========================================================================
-#
-# Descripton:   Generic DMAKE startup makefile definitions file. Assumes
-#               that the SCITECH environment variable has been set to point
-#               to where all our stuff is installed. You should not need
-#               to change anything in this file.
-#
-#               Symantec C++ 6.x/7.x 32 bit version. Supports the DOSX
-#               extender, FlashTek X32 and Phar Lap's TNT DOS Extender
-#               and 32 bit Windows development.
-#
-#############################################################################
-
-# Include standard startup script definitions
-.IMPORT: SCITECH
-.INCLUDE: "$(SCITECH)\makedefs\startup.mk"
-
-# Import enivornment variables that we use
-.IMPORT .IGNORE : USE_TNT USE_X32 USE_X32VM SC_LIBBASE
-
-# We are compiling for a 32 bit envionment
-   _32BIT_      := 1
-
-# Default commands for compiling, assembling linking and archiving
-   CC           := sc       # C-compiler and flags
-   CFLAGS       := -Jm
-.IF $(USE_TASM32)
-   AS           := tasm32
-.ELIF $(USE_TASMX)
-   AS           := tasmx    # Assembler and flags
-.ELSE
-   AS           := tasm     # Assembler and flags
-.ENDIF
-.IF $(USE_WIN32)
-   ASFLAGS      := /t /mx /m /D__FLAT__ /iINCLUDE /i$(SCITECH)\INCLUDE
-.ELSE
-   ASFLAGS      := /t /mx /m /DES_NOT_DS /D__COMM__ /i$(SCITECH)\INCLUDE
-.ENDIF
-   LD           := sc       # Loader and flags
-   LD_FLAGS      =
-   RC           := rcc      # WIndows resource compiler
-   RCFLAGS      := -32      # Mark as Win32 compatible resources
-   LIB          := lib      # Librarian
-   LIBFLAGS     := /N /B
-   ILIB         := implib   # Import librarian
-   ILIBFLAGS    :=
-
-# Optionally turn on debugging information
-.IF $(DBG)
-   CFLAGS       += -g       # Turn on debugging for C compiler (FlashView)
-.IF $(USE_TNT)
-   LDFLAGS      += -fullsym # Turn on debugging for TNT 386link linker
-.END
-.IF $(USE_X32) or $(USE_X32VM)
-   LDFLAGS      += -L/map   # Turn on debugging for FlashView debugger
-.END
-.ELSE
-   ASFLAGS      += /q       # Suppress object records not needed for linking
-.END
-
-# Optionally turn on optimisations
-.IF $(OPT)
-   CFLAGS       += -5 -o+all
-.ELIF $(OPT_SIZE)
-   CFLAGS       += -5 -o+space
-.END
-
-# Optionally turn on direct i387 FPU instructions
-
-.IF $(FPU)
-   CFLAGS       += -ff -DFPU387
-   ASFLAGS      += -DFPU387 -DFPU_REG_RTN
-.END
-
-# Optionally compile a beta release version of a product
-.IF $(BETA)
-   CFLAGS       += -DBETA
-   ASFLAGS      += -DBETA
-.END
-
-# User a larger stack if requested
-
-.IF $(STKSIZE)
-    LDFLAGS     += =$(STKSIZE)
-.ENDIF
-
-.IF $(USE_TNT)                  # Use Phar Lap's TNT DOS Extender
-   CFLAGS       += -mp
-   DX_CFLAGS    += -DTNT
-   ASFLAGS      += /D__FLAT__
-   DX_ASFLAGS   += -DTNT
-   LD           := 386link
-   LDFLAGS      += @sc32.dos -exe $@
-   LIB_OS       = DOS32
-.ELIF $(USE_X32VM)              # Use FlashTek X-32VM DOS extender
-   CFLAGS       += -mx
-   DX_CFLAGS    += -DX32VM
-   ASFLAGS      += /D__X386__
-   DX_ASFLAGS   += -DX32VM
-   LD           := sc
-   LDFLAGS      += $(CFLAGS) x32v.lib
-   LIB_OS       = DOS32
-.ELIF $(USE_X32)                # Use FlashTek X-32 DOS extender
-   CFLAGS       += -mx
-   DX_CFLAGS    += -DX32VM
-   ASFLAGS      += /D__X386__
-   DX_ASFLAGS   += -DX32VM
-   LD           := sc
-   LDFLAGS      += $(CFLAGS) x32.lib
-   LIB_OS       = DOS32
-.ELIF $(USE_WIN32)              # Build 32 bit Windows NT app
-.IF $(BUILD_DLL)
-   CFLAGS       += -WD -mn
-   ASFLAGS      += -DBUILD_DLL
-.ELSE
-   CFLAGS       += -WA -mn
-.ENDIF
-   DX_ASFLAGS   += -D__WINDOWS32__
-   LIB_OS       = WIN32
-.ELSE                           # Use default Symantec DOSX extender
-   USE_DOSX     := 1
-   USE_REALDOS := 1
-   CFLAGS       += -mx
-   DX_CFLAGS    += -DDOSX
-   ASFLAGS      += /D__X386__
-   DX_ASFLAGS   += -DDOSX
-   LD           := sc
-   LDFLAGS      += $(CFLAGS)
-   LIB_OS       = DOS32
-.END
-
-# Place to look for PMODE library files
-
-.IF $(USE_TNT)
-PMLIB           := tnt\pm.lib
-.ELIF $(USE_X32)
-PMLIB           := x32\pm.lib
-.ELSE
-PMLIB           := dosx\pm.lib
-.END
-
-# Define the base directory for library files
-
-.IF $(CHECKED)
-LIB_BASE_DIR   := $(SCITECH_LIB)\lib\debug
-CFLAGS                 += -DCHECKED=1
-.ELSE
-LIB_BASE_DIR   := $(SCITECH_LIB)\lib\release
-.ENDIF
-
-# Define where to install library files
-   LIB_BASE     := $(LIB_BASE_DIR)\$(LIB_OS)\$(SC_LIBBASE)
-   LIB_DEST     := $(LIB_BASE)
-
-# Define which file contains our rules
-
-   RULES_MAK   := sc32.mk
diff --git a/board/MAI/bios_emulator/scitech/makedefs/startup.mk b/board/MAI/bios_emulator/scitech/makedefs/startup.mk
deleted file mode 100644 (file)
index d8b2ba2..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-#############################################################################
-#
-#                                      SciTech Multi-platform Graphics Library
-#
-#  ========================================================================
-#
-#    The contents of this file are subject to the SciTech MGL Public
-#    License Version 1.0 (the "License"); you may not use this file
-#    except in compliance with the License. You may obtain a copy of
-#    the License at http://www.scitechsoft.com/mgl-license.txt
-#
-#    Software distributed under the License is distributed on an
-#    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-#    implied. See the License for the specific language governing
-#    rights and limitations under the License.
-#
-#    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-#
-#    The Initial Developer of the Original Code is SciTech Software, Inc.
-#    All Rights Reserved.
-#
-#  ========================================================================
-#
-# Descripton:   Generic DMAKE startup makefile definitions file. Assumes
-#               that the SCITECH environment variable has been set to point
-#               to where all our stuff is installed. You should not need
-#               to change anything in this file.
-#
-#               Common startup script that defines all variables common to
-#                              all startup scripts. These define the DMAKE runtime
-#                              environment and the values are dependant on the version of
-#                              DMAKE in use.
-#
-#############################################################################
-
-# Disable warnings for macros redefined here that were given
-# on the command line.
-__.SILENT       := $(.SILENT)
-.SILENT         := yes
-
-# Import enivornment variables that we use common to all compilers
-.IMPORT .IGNORE : TEMP SHELL COMSPEC INCLUDE LIB SCITECH PRIVATE SCITECH_LIB
-.IMPORT .IGNORE : DBG OPT OPT_SIZE SHW BETA USE_WIN32 FPU BUILD_DLL BUILD_FOR_DLL
-.IMPORT .IGNORE : IMPORT_DLL USE_TASMX WIN32_GUI USE_WIN16 USE_NASM CHECKED
-.IMPORT .IGNORE : OS2_SHELL SOFTICE_PATH MAX_WARN USE_SOFTICE USE_TASM32
-.IMPORT .IGNORE : DLL_START_TASM USE_SNAP USE_X11 USE_LINUX STATIC_LIBS LIBC
-.IMPORT .IGNORE : SHOW_ARGS BOOT_STRAP_DMAKE
-   TMPDIR := $(TEMP)
-
-# Determine if the host machine is a Windows/DOS or Unix box
-.IF $(COMSPEC)
-   WIN32_HOST   := 1
-.ELSE
-   USE_NASM     := 1
-   UNIX_HOST    := 1
-.ENDIF
-
-# Setup to either user NASM or TASM as the assembler
-.IF $(USE_NASM)
-.ELSE
-   USE_TASM            := 1
-.ENDIF
-
-.IF $(UNIX_HOST)
-# Standard file suffix definitions
-#
-# NOTE: Linux/Unix does not require any extenion for executeable files, but you
-#       can use an extension if you wish. We use the .exe extension for building
-#       executeable files so that we can use implicit rules to make the
-#       makefiles simpler and more portable between systems (exe also makes it
-#       easier for cross-compile/debugging situations). When you install
-#       the files to a local bin directory, you will probably want to remove
-#       the .exe extension.
-   L            := .a          # Libraries
-   E            := .exe        # Executables for glibc
-   O            := .o          # Objects
-   A            := .asm        # Assembler sources
-   S            := .s       # GNU assembler sources
-   P            := .cpp        # C++ sources
-
-# File prefix/suffix definitions. The following prefixes are defined, and are
-# used primarily to abstract between the Unix style libXX.a naming convention
-# and the DOS/Windows/OS2 naming convention of XX.lib.
-   LP           := lib      # LP - Library file prefix (name of file on disk)
-   LL           := -l          # Library link prefix (name of library on link command line)
-   LE           :=                 # Library link suffix (extension of library on link command line)
-
-# We use the Unix shell at all times
-   SHELL               := /bin/sh
-   SHELLFLAGS   := -c
-
-.ELSE
-# Standard file DOS/Win/OS2 suffix definitions
-   L            := .lib        # Libraries
-.IF $(USE_SNAP)
-   E            := .sxe        # Snap Executables
-   D            := .sll        # Snap Dynamic Link Library file
-.ELSE
-   E            := .exe        # Executables
-   D            := .dll        # Dynamic Link Library file
-.ENDIF
-   O            := .obj        # Objects
-   A            := .asm        # Assembler sources
-   P            := .cpp        # C++ sources
-   R            := .res        # Compiled resource file
-   S                   := .s           # Assyntax.h style assembler
-
-# File prefix/suffix definitions. The following prefixes are defined, and are
-# used primarily to abstract between the Unix style libXX.a naming convention
-# and the DOS/Windows/OS2 naming convention of XX.lib.
-   LP           :=                     # LP - Library file prefix (name of file on disk)
-   LL           :=                     # Library link prefix (name of library on link command line)
-   LE           := .lib                # Library link suffix (extension of library on link command line)
-
-# We use the DOS/Win/OS2 style shell at all times
-   SHELL        := $(COMSPEC)
-   GROUPSHELL   := $(SHELL)
-   SHELLFLAGS   := $(SWITCHAR)c
-   GROUPFLAGS   := $(SHELLFLAGS)
-   SHELLMETAS   := *"?<>
-.IF $(OS2_SHELL)
-   GROUPSUFFIX  := .cmd
-.ELSE
-   GROUPSUFFIX  := .bat
-.ENDIF
-   DIRSEPSTR    := \\
-   DIVFILE       = $(TMPFILE:s,/,\)
-
-.ENDIF
-
-# Standard Unix style shell commands. Since these do not exist on
-# regular DOS/Win/OS2 installations we use our own '' versions
-# instead. To boostrtap a new OS you may wish to use the regular
-# unix versions.
-
-.IF $(BOOT_STRAP_DMAKE)
-   CP                  := cp
-   MD                  := mkdir
-   RM                  := rm
-   ECHO                        := echo
-.ELSE
-   CP                  := k_cp
-   MD                  := k_md
-   RM                  := k_rm
-   ECHO                        := k_echo
-.ENDIF
-
-# Definition of $(MAKE) macro for recursive makes.
-   MAKE = $(MAKECMD) $(MFLAGS)
-
-# Macro to install a library file
-   INSTALL      := $(CP)
-
-# DMAKE uses this recipe to remove intermediate targets
-.REMOVE :; $(RM) -f $<
-
-# Turn warnings back to previous setting.
-.SILENT := $(__.SILENT)
-
-# We dont use TABS in our makefiles
-.NOTABS         := yes
diff --git a/board/MAI/bios_emulator/scitech/makedefs/va32.mk b/board/MAI/bios_emulator/scitech/makedefs/va32.mk
deleted file mode 100644 (file)
index fbca523..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-#############################################################################
-#
-#                                       SciTech Multi-platform Graphics Library
-#
-#  ========================================================================
-#
-#    The contents of this file are subject to the SciTech MGL Public
-#    License Version 1.0 (the "License"); you may not use this file
-#    except in compliance with the License. You may obtain a copy of
-#    the License at http://www.scitechsoft.com/mgl-license.txt
-#
-#    Software distributed under the License is distributed on an
-#    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-#    implied. See the License for the specific language governing
-#    rights and limitations under the License.
-#
-#    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-#
-#    The Initial Developer of the Original Code is SciTech Software, Inc.
-#    All Rights Reserved.
-#
-#  ========================================================================
-#
-# Descripton:   Generic DMAKE startup makefile definitions file. Assumes
-#               that the SCITECH environment variable has been set to point
-#               to where all our stuff is installed. You should not need
-#               to change anything in this file.
-#
-#               IBM VisualAge C++ 3.0 OS/2 32-bit version.
-#
-#############################################################################
-
-# Include standard startup script definitions
-.IMPORT: SCITECH
-.INCLUDE: "$(SCITECH)\makedefs\startup.mk"
-
-# Import enivornment variables that we use
-.IMPORT .IGNORE : VA_LIBBASE USE_OS232 USE_OS2GUI FULLSCREEN NOOPT MAX_WARN
-
-# We are compiling for a 32 bit envionment
-   _32BIT_      := 1
-
-# Default commands for compiling, assembling linking and archiving
-   CC           := icc
-   CPP          := icc
-   CFLAGS       := /Q /G5 /Gl+ /Fi /Si /J- /Ss+ /Sp1 /Gm+ /I.
-.IF $(USE_NASM)
-   AS           := nasm
-   ASFLAGS      := -t -f obj -F null -d__FLAT__ -dSTDCALL_MANGLE -d__NOU_VAR__ -iINCLUDE -i$(SCITECH)\INCLUDE
-.ELSE
-.IF $(USE_TASM32)
-   AS           := tasm32
-.ELIF $(USE_TASMX)
-   AS           := tasmx
-.ELSE
-   AS           := tasm
-.ENDIF
-   ASFLAGS      := /t /mx /m /D__FLAT__ /DSTDCALL_MANGLE /D__NOU_VAR__ /iINCLUDE /i$(SCITECH)\INCLUDE
-.ENDIF
-   LD           := ilink
-   LDFLAGS       = /noi /exepack:2 /packcode /packdata /align:32 /map /noe
-   RC           := rc
-   RCFLAGS      := -n -x2
-   LIB          := ilib
-   LIBFLAGS     := /nologo
-   ILIB         := implib
-   ILIBFLAGS    := /nologo
-   IPFC         := ipfc
-   IPFCFLAGS    :=
-   IBMCOBJ      := 1
-
-# Set the compiler warning level
-.IF $(MAX_WARN)
-   CFLAGS       += /W3
-.ELSE
-   CFLAGS       += /W1
-.ENDIF
-
-# Optionally turn on debugging information
-.IF $(DBG)
-   CFLAGS       += /Ti
-   LDFLAGS      += /DE
-.ELSE
-.IF $(USE_TASM)
-   ASFLAGS      += /q
-.ENDIF
-.END
-
-# Optionally turn on optimisations
-.IF $(OPT)
-   CFLAGS       += /Gfi /O /Oi
-.ELIF $(OPT_SIZE)
-   CFLAGS       += /Gfi /O /Oc
-.ELIF $(NOOPT)
-   CFLAGS       += /O-
-.END
-
-# Optionally turn on direct i387 FPU instructions optimised for Pentium
-.IF $(FPU)
-   CFLAGS       += -DFPU387
-   ASFLAGS      += -dFPU387
-.END
-
-# Optionally compile a beta release version of a product
-.IF $(BETA)
-   CFLAGS       += -DBETA
-   ASFLAGS      += -dBETA
-.END
-
-# Build 32-bit OS/2 apps
-.IF $(BUILD_DLL)
-   CFLAGS       += /Ge- /DBUILD_DLL
-   LDFLAGS      += /DLL /NOE
-   ASFLAGS      += -dBUILD_DLL
-.ELSE
-.IF $(USE_OS2GUI)
-   CFLAGS       += -D__OS2_PM__
-   LDFLAGS      += /PMTYPE:PM
-.ELSE
-.IF $(FULLSCREEN)
-   LDFLAGS      += /PMTYPE:NOVIO
-.ELSE
-   LDFLAGS      += /PMTYPE:VIO
-.ENDIF
-.ENDIF
-.ENDIF
-   DX_ASFLAGS   += -d__OS2__
-   LIB_OS       = os232
-
-# Place to look for PMODE library files
-
-.IF $(USE_OS2GUI)
-.IF $(USE_SDDPMDLL)
-#Note: This is OK for now but might need to be changed if the GUI PM library
-#      were really different
-PMLIB           := sddpmlib.lib
-.ELSE
-PMLIB           := pm_pm.lib
-.ENDIF
-.ELSE
-.IF $(USE_SDDPMDLL)
-PMLIB           := sddpmlib.lib
-.ELSE
-PMLIB           := pm.lib
-.ENDIF
-.ENDIF
-
-# Define the base directory for library files
-
-.IF $(CHECKED)
-LIB_BASE_DIR    := $(SCITECH_LIB)\lib\debug
-CFLAGS          += /DCHECKED=1
-.ELSE
-LIB_BASE_DIR    := $(SCITECH_LIB)\lib\release
-.ENDIF
-
-# Define where to install library files
-   LIB_BASE     := $(LIB_BASE_DIR)\$(LIB_OS)\$(VA_LIBBASE)
-   LIB_DEST     := $(LIB_BASE)
-
-# Define which file contains our rules
-
-   RULES_MAK    := va32.mk
diff --git a/board/MAI/bios_emulator/scitech/makedefs/va365.mk b/board/MAI/bios_emulator/scitech/makedefs/va365.mk
deleted file mode 100644 (file)
index 3a2eccb..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-#############################################################################
-#
-#                                      SciTech Multi-platform Graphics Library
-#
-#  ========================================================================
-#
-#    The contents of this file are subject to the SciTech MGL Public
-#    License Version 1.0 (the "License"); you may not use this file
-#    except in compliance with the License. You may obtain a copy of
-#    the License at http://www.scitechsoft.com/mgl-license.txt
-#
-#    Software distributed under the License is distributed on an
-#    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-#    implied. See the License for the specific language governing
-#    rights and limitations under the License.
-#
-#    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-#
-#    The Initial Developer of the Original Code is SciTech Software, Inc.
-#    All Rights Reserved.
-#
-#  ========================================================================
-#
-# Descripton:   Generic DMAKE startup makefile definitions file. Assumes
-#               that the SCITECH environment variable has been set to point
-#               to where all our stuff is installed. You should not need
-#               to change anything in this file.
-#
-#               IBM VisualAge C++ 3.65 OS/2 32-bit version.
-#
-#############################################################################
-
-# Include standard startup script definitions
-.IMPORT: SCITECH
-.INCLUDE: "$(SCITECH)\makedefs\startup.mk"
-
-# Import enivornment variables that we use
-.IMPORT .IGNORE : VA_LIBBASE USE_OS232 USE_OS2GUI FULLSCREEN NOOPT MAX_WARN
-
-# We are compiling for a 32 bit envionment
-   _32BIT_      := 1
-
-# Default commands for compiling, assembling linking and archiving
-   CC           := icc
-   CPP          := icc
-   CFLAGS       := /Q /G5l /Fi /Si /J- /Ss+ /Sp1 /Gm+ /I.
-.IF $(USE_NASM)
-   AS           := nasm
-   ASFLAGS      := -t -f obj -F null -d__FLAT__ -dSTDCALL_MANGLE -d__NOU_VAR__ -iINCLUDE -i$(SCITECH)\INCLUDE
-.ELSE
-.IF $(USE_TASM32)
-   AS           := tasm32
-.ELIF $(USE_TASMX)
-   AS           := tasmx
-.ELSE
-   AS           := tasm
-.ENDIF
-   ASFLAGS      := /t /mx /m /D__FLAT__ /DSTDCALL_MANGLE /D__NOU_VAR__ /iINCLUDE /i$(SCITECH)\INCLUDE
-.ENDIF
-   LD           := ilink
-   LDFLAGS       = /noi /exepack /packcode /packdata /align:32 /map /noe
-   RC           := rc
-   RCFLAGS      := /nologo
-   LIB          := ilib
-   LIBFLAGS     := /nologo
-   ILIB         := implib
-   ILIBFLAGS    := /nologo
-   IBMCOBJ      := 1
-
-# Set the compiler warning level
-.IF $(MAX_WARN)
-   CFLAGS       += /W3
-.ELSE
-   CFLAGS       += /W1
-.ENDIF
-
-# Optionally turn on debugging information
-.IF $(DBG)
-   CFLAGS       += /Ti
-   LDFLAGS      += /DE
-.ELSE
-.IF $(USE_TASM)
-   ASFLAGS      += /q
-.ENDIF
-.END
-
-# Optionally turn on optimisations
-.IF $(OPT)
-   CFLAGS       += /Gfi /O /Oi
-.ELIF $(OPT_SIZE)
-   CFLAGS       += /Gfi /O /Oc
-.ELIF $(NOOPT)
-   CFLAGS       += /O-
-.END
-
-# Optionally turn on direct i387 FPU instructions optimised for Pentium
-.IF $(FPU)
-   CFLAGS       += -DFPU387
-   ASFLAGS      += -dFPU387
-.END
-
-# Optionally compile a beta release version of a product
-.IF $(BETA)
-   CFLAGS       += -DBETA
-   ASFLAGS      += -dBETA
-.END
-
-# Build 32-bit OS/2 apps
-.IF $(BUILD_DLL)
-   CFLAGS       += /Gme- /DBUILD_DLL
-   LDFLAGS      += /DLL /NOE
-   ASFLAGS      += -dBUILD_DLL
-.ELSE
-.IF $(USE_OS2GUI)
-   CFLAGS       += -D__OS2_PM__
-   LDFLAGS      += /PMTYPE:PM
-.ELSE
-.IF $(FULLSCREEN)
-   LDFLAGS      += /PMTYPE:NOVIO
-.ELSE
-   LDFLAGS      += /PMTYPE:VIO
-.ENDIF
-.ENDIF
-.ENDIF
-   DX_ASFLAGS   += -d__OS2__
-   LIB_OS       = os232
-
-# Place to look for PMODE library files
-
-.IF $(USE_OS2GUI)
-PMLIB           := pm_pm.lib
-.ELSE
-PMLIB           := pm.lib
-.ENDIF
-
-# Define the base directory for library files
-
-.IF $(CHECKED)
-LIB_BASE_DIR    := $(SCITECH_LIB)\lib\debug
-CFLAGS          += /DCHECKED=1
-.ELSE
-LIB_BASE_DIR    := $(SCITECH_LIB)\lib\release
-.ENDIF
-
-# Define where to install library files
-   LIB_BASE     := $(LIB_BASE_DIR)\$(LIB_OS)\$(VA_LIBBASE)
-   LIB_DEST     := $(LIB_BASE)
-
-# Define which file contains our rules
-
-   RULES_MAK    := va365.mk
diff --git a/board/MAI/bios_emulator/scitech/makedefs/vc16.mk b/board/MAI/bios_emulator/scitech/makedefs/vc16.mk
deleted file mode 100644 (file)
index 913bf9c..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-#############################################################################
-#
-#                                      SciTech Multi-platform Graphics Library
-#
-#  ========================================================================
-#
-#    The contents of this file are subject to the SciTech MGL Public
-#    License Version 1.0 (the "License"); you may not use this file
-#    except in compliance with the License. You may obtain a copy of
-#    the License at http://www.scitechsoft.com/mgl-license.txt
-#
-#    Software distributed under the License is distributed on an
-#    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-#    implied. See the License for the specific language governing
-#    rights and limitations under the License.
-#
-#    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-#
-#    The Initial Developer of the Original Code is SciTech Software, Inc.
-#    All Rights Reserved.
-#
-#  ========================================================================
-#
-# Descripton:   Generic DMAKE startup makefile definitions file. Assumes
-#               that the SCITECH environment variable has been set to point
-#               to where all our stuff is installed. You should not need
-#               to change anything in this file.
-#
-#               Microsoft Visual C++ 1.x 16 bit version. Supports 16 bit
-#               DOS and Windows development.
-#
-#############################################################################
-
-# Include standard startup script definitions
-.IMPORT: SCITECH
-.INCLUDE: "$(SCITECH)\makedefs\startup.mk"
-
-# Import enivornment variables that we use
-.IMPORT .IGNORE : VC_LIBBASE
-
-# Default commands for compiling, assembling linking and archiving
-   CC           := cl       # C-compiler and flags
-   CFLAGS       := /YX /w /G3 /Gs
-.IF $(USE_TASM32)
-   AS           := tasm32
-.ELIF $(USE_TASMX)
-   AS           := tasmx    # Assembler and flags
-.ELSE
-   AS           := tasm     # Assembler and flags
-.ENDIF
-   ASFLAGS      := /t /mx /m /D__COMM__ /iINCLUDE /i$(SCITECH)\INCLUDE
-   LD           := cl       # Loader and flags
-   LDFLAGS       = $(CFLAGS)
-   RC           := rc       # WIndows resource compiler
-   RCFLAGS      :=
-   LIB          := lib      # Librarian
-   LIBFLAGS     := /NOI /NOE
-   ILIB         := implib   # Import librarian
-   ILIBFLAGS    := /noignorecase
-
-# Optionally turn on debugging information
-.IF $(DBG)
-   CFLAGS       += /Yd /Zi  # Turn on debugging for C compiler
-   ASFLAGS      += /zi      # Turn on debugging for assembler
-.ELSE
-   ASFLAGS      += /q       # Suppress object records not needed for linking
-.END
-
-# Optionally turn on optimisations
-.IF $(OPT)
-   CFLAGS       += /Ox
-.END
-
-# Optionally turn on direct i387 FPU instructions
-
-.IF $(FPU)
-   CFLAGS       += /FPi87 /DFPU387
-   ASFLAGS      += /DFPU387 /DFPU_REG_RTN
-.END
-
-# Optionally compile a beta release version of a product
-.IF $(BETA)
-   CFLAGS       += /DBETA
-   ASFLAGS      += /DBETA
-.END
-
-# Use a larger stack during linking if requested ???? How the fuck do you
-# specify linker options on the CL command line?????
-
-.IF $(STKSIZE)
-.ENDIF
-
-# Optionally compile for 16 bit Windows
-.IF $(USE_WIN16)
-.IF $(BUILD_DLL)
-   CFLAGS       += /GD /Alfw /DBUILD_DLL
-   ASFLAGS      += -DBUILD_DLL
-.ELSE
-   CFLAGS       += /GA /AL
-.ENDIF
-   DX_ASFLAGS   += -D__WINDOWS16__
-   LIB_OS       = WIN16
-.ELSE
-   USE_REALDOS := 1
-   CFLAGS       += /AL
-   LIB_OS       = DOS16
-.END
-
-# Place to look for PMODE library files
-
-PMLIB           := pm.lib
-
-# Define the base directory for library files
-
-.IF $(CHECKED)
-LIB_BASE_DIR   := $(SCITECH_LIB)\lib\debug
-CFLAGS                 += -DCHECKED=1
-.ELSE
-LIB_BASE_DIR   := $(SCITECH_LIB)\lib\release
-.ENDIF
-
-# Define where to install library files
-   LIB_BASE     := $(LIB_BASE_DIR)\$(LIB_OS)\$(VC_LIBBASE)
-   LIB_DEST     := $(LIB_BASE)
-
-# Define which file contains our rules
-
-   RULES_MAK   := vc16.mk
diff --git a/board/MAI/bios_emulator/scitech/makedefs/vc32.mk b/board/MAI/bios_emulator/scitech/makedefs/vc32.mk
deleted file mode 100644 (file)
index 11c9071..0000000
+++ /dev/null
@@ -1,226 +0,0 @@
-#############################################################################
-#
-#                                      SciTech Multi-platform Graphics Library
-#
-#  ========================================================================
-#
-#    The contents of this file are subject to the SciTech MGL Public
-#    License Version 1.0 (the "License"); you may not use this file
-#    except in compliance with the License. You may obtain a copy of
-#    the License at http://www.scitechsoft.com/mgl-license.txt
-#
-#    Software distributed under the License is distributed on an
-#    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-#    implied. See the License for the specific language governing
-#    rights and limitations under the License.
-#
-#    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-#
-#    The Initial Developer of the Original Code is SciTech Software, Inc.
-#    All Rights Reserved.
-#
-#  ========================================================================
-#
-# Descripton:   Generic DMAKE startup makefile definitions file. Assumes
-#               that the SCITECH environment variable has been set to point
-#               to where all our stuff is installed. You should not need
-#               to change anything in this file.
-#
-#               Microsoft Visual C++ 2.x 32 bit version. Supports Phar Lap
-#               TNT DOS Extender and 32 bit Windows development.
-#
-#############################################################################
-
-# Include standard startup script definitions
-.IMPORT: SCITECH
-.INCLUDE: "$(SCITECH)\makedefs\startup.mk"
-
-# Import enivornment variables that we use
-.IMPORT .IGNORE : TNT_PATH VC_LIBBASE DOSSTYLE USE_TNT USE_RTTARGET MSVCDIR
-.IMPORT .IGNORE : USE_VXD USE_NTDRV USE_W2KDRV NT_DDKROOT USE_RTTI USE_CPPEXCEPT
-
-# We are compiling for a 32 bit envionment
-   _32BIT_      := 1
-
-# Default commands for compiling, assembling linking and archiving
-   CC           := cl       # C-compiler and flags
-   CFLAGS       :=
-.IF $(USE_NASM)
-   AS                  := nasm
-   ASFLAGS      := -t -f win32 -F null -d__FLAT__ -dSTDCALL_MANGLE -iINCLUDE -i$(SCITECH)\INCLUDE
-.ELSE
-.IF $(USE_TASM32)
-   AS           := tasm32
-.ELIF $(USE_TASMX)
-   AS           := tasmx    # Assembler and flags
-.ELSE
-   AS           := tasm     # Assembler and flags
-.ENDIF
-   ASFLAGS      := /t /mx /m /D__FLAT__ /DSTDCALL_MANGLE /iINCLUDE /i$(SCITECH)\INCLUDE
-.ENDIF
-   LD           := cl
-.IF $(USE_WIN32)
-   LDFLAGS       = $(CFLAGS)
-.IF $(USE_NTDRV)
-   LDENDFLAGS   = -link /INCREMENTAL:NO /DRIVER /SUBSYSTEM:NATIVE,4.00 /VERSION:4.00 /MACHINE:I386 /NODEFAULTLIB /DEBUGTYPE:CV /PDB:NONE /ALIGN:0x20 /BASE:0x10000 /ENTRY:DriverEntry@8
-       #/MERGE:_page=page /MERGE:_text=.text /MERGE:.rdata=.text
-.ELIF $(WIN32_GUI)
-   LDENDFLAGS   = -link /INCREMENTAL:NO /DEF:$(@:b).def /SUBSYSTEM:WINDOWS /MACHINE:I386 /DEBUGTYPE:CV /PDB:NONE
-.ELSE
-   LDENDFLAGS   = -link /INCREMENTAL:NO /SUBSYSTEM:CONSOLE /MACHINE:I386 /DEBUGTYPE:CV /PDB:NONE
-.ENDIF
-.ELSE
-   LDFLAGS       = $(CFLAGS)
-   LDENDFLAGS   := -link -stub:$(TNT_PATH:s/\/\\)\\bin\\gotnt.exe /PDB:NONE
-.ENDIF
-   RC           := rc       # Watcom resource compiler
-   RCFLAGS      :=          # Mark as Win32 compatible resources
-   LIB          := lib      # Librarian
-   LIBFLAGS     :=
-   ILIB         := lib      # Import librarian
-   ILIBFLAGS    := /MACHINE:IX86
-   INTEL_X86   := 1
-   NMSYM               := $(SOFTICE_PATH)\nmsym.exe
-.IF $(USE_NTDRV)
-   NMSYMFLAGS  := /TRANSLATE:source,package,always /PROMPT /SOURCE:$(MSVCDIR)\crt\src\intel;$(SCITECH)\src\pm;$(SCITECH)\src\pm\common;$(SCITECH)\src\pm\ntdrv
-.ELSE
-   NMSYMFLAGS  := /TRANSLATE:source,package,always /PROMPT /SOURCE:$(SCITECH)\src\pm;$(SCITECH)\src\pm\common;$(SCITECH)\src\pm\win32
-.ENDIF
-
-# Set the compiler warning level
-.IF $(MAX_WARN)
-   CFLAGS       += -W3
-.ELSE
-   CFLAGS       += -W1
-.ENDIF
-
-# Optionally turn on debugging information
-.IF $(DBG)
-   CFLAGS       += /Yd /Zi  # Turn on debugging for C compiler
-.IF $(USE_TASM)
-   ASFLAGS      += /zi      # Turn on debugging for assembler
-.ENDIF
-.ELSE
-.IF $(USE_TASM)
-   ASFLAGS      += /q       # Suppress object records not needed for linking
-.ENDIF
-.END
-
-# Optionally turn on optimisations
-.IF $(VC_LIBBASE) == vc5
-.IF $(OPT)
-   CFLAGS       += /G6 /O2 /Ox /Oi-
-.ELIF $(OPT_SIZE)
-   CFLAGS       += /G6 /O1
-.END
-.ELSE
-.IF $(OPT)
-   CFLAGS       += /G5 /O2 /Ox
-.ELIF $(OPT_SIZE)
-   CFLAGS       += /G5 /O1
-.END
-.ENDIF
-
-# Optionally turn on direct i387 FPU instructions
-
-.IF $(FPU)
-   CFLAGS       += /DFPU387
-   ASFLAGS      += -dFPU387
-.END
-
-# Optionally compile a beta release version of a product
-.IF $(BETA)
-   CFLAGS       += /DBETA
-   ASFLAGS      += -dBETA
-.END
-
-# Use a larger stack during linking if requested, or use a default stack
-# of 50k. The usual default stack provided by Visual C++ is *way* to small
-# for real 32 bit code development.
-
-.IF $(USE_WIN32)
-       # Not necessary for Win32 code.
-.ELSE
-.IF $(STKSIZE)
-       LDENDFLAGS  += /STACK:$(STKSIZE)
-.ELSE
-       LDENDFLAGS  += /STACK:51200
-.ENDIF
-.ENDIF
-
-# DOS extender dependant flags
-.IF $(USE_NTDRV)                               # Build 32 bit Windows NT driver
-   CFLAGS       += /LD /Zl /Gy /Gz /GF /D__NT_DRIVER__ /D_X86_=1 /Di386=1
-.IF $(DBG)
-   CFLAGS       += /QIf
-.ENDIF
-   ASFLAGS      +=
-   DEF_LIBS            := int64.lib ntoskrnl.lib hal.lib
-   DX_ASFLAGS   += -d__NT_DRIVER__
-.IF $(USE_W2KDRV)                              # Build 32 bit Windows 2000 driver
-   LIB_OS       = W2KDRV
-.ELSE
-   LIB_OS       = NTDRV
-.ENDIF
-.ELIF $(USE_WIN32)              # Build 32 bit Windows NT app
-.IF $(WIN32_GUI)
-.ELSE
-    CFLAGS       += -D__CONSOLE__
-.ENDIF
-.IF $(BUILD_DLL)
-   CFLAGS       += /MT /LD /DBUILD_DLL
-   ASFLAGS      += -dBUILD_DLL
-.IF $(NO_RUNTIME)
-   LDENDFLAGS   += /NODEFAULTLIB
-   CFLAGS              += /Zl
-   DEF_LIBS            :=
-.ELSE
-   DEF_LIBS            := kernel32.lib user32.lib gdi32.lib advapi32.lib shell32.lib winmm.lib comdlg32.lib comctl32.lib ole32.lib oleaut32.lib version.lib winspool.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib rpcrt4.lib
-.ENDIF
-.ELSE
-   CFLAGS       += /MT
-   DEF_LIBS            := kernel32.lib user32.lib gdi32.lib advapi32.lib shell32.lib winmm.lib comdlg32.lib comctl32.lib ole32.lib oleaut32.lib version.lib winspool.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib rpcrt4.lib
-.ENDIF
-   DX_ASFLAGS   += -d__WINDOWS32__
-   LIB_OS       = WIN32
-.ELIF $(USE_RTTARGET)
-   CFLAGS       += -D__RTTARGET__
-   DX_CFLAGS    +=
-   DX_ASFLAGS   += -d__RTTARGET__
-   USE_REALDOS :=
-   LIB_OS       = RTT32
-   DEF_LIBS     := cw32mt.lib
-.ELSE
-   USE_TNT      := 1
-   USE_REALDOS := 1
-   CFLAGS       += /MT /D__MSDOS32__
-   DX_CFLAGS    += -DTNT
-   DX_ASFLAGS   += -dTNT
-   LIB_OS       = DOS32
-   DEF_LIBS            := dosx32.lib tntapi.lib
-.ENDIF
-
-# Define the base directory for library files
-
-.IF $(CHECKED)
-LIB_BASE_DIR   := $(SCITECH_LIB)\lib\debug
-CFLAGS                 += /DCHECKED=1
-.ELSE
-LIB_BASE_DIR   := $(SCITECH_LIB)\lib\release
-.ENDIF
-
-# Define where to install library files
-   LIB_BASE     := $(LIB_BASE_DIR)\$(LIB_OS)\$(VC_LIBBASE)
-   LIB_DEST     := $(LIB_BASE)
-
-# Place to look for PMODE library files
-
-.IF $(USE_TNT)
-PMLIB           := $(LIB_BASE:s/\/\\)\\tnt\\pm.lib
-.ELSE
-PMLIB           := $(LIB_BASE:s/\/\\)\\pm.lib
-.ENDIF
-
-# Define which file contains our rules
-
-   RULES_MAK   := vc32.mk
diff --git a/board/MAI/bios_emulator/scitech/makedefs/wc16.mk b/board/MAI/bios_emulator/scitech/makedefs/wc16.mk
deleted file mode 100644 (file)
index e316f4c..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-#############################################################################
-#
-#                                      SciTech Multi-platform Graphics Library
-#
-#  ========================================================================
-#
-#    The contents of this file are subject to the SciTech MGL Public
-#    License Version 1.0 (the "License"); you may not use this file
-#    except in compliance with the License. You may obtain a copy of
-#    the License at http://www.scitechsoft.com/mgl-license.txt
-#
-#    Software distributed under the License is distributed on an
-#    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-#    implied. See the License for the specific language governing
-#    rights and limitations under the License.
-#
-#    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-#
-#    The Initial Developer of the Original Code is SciTech Software, Inc.
-#    All Rights Reserved.
-#
-#  ========================================================================
-#
-# Descripton:   Generic DMAKE startup makefile definitions file. Assumes
-#               that the SCITECH environment variable has been set to point
-#               to where all our stuff is installed. You should not need
-#               to change anything in this file.
-#
-#               Watcom C++ 10.x 16 bit version. Supports 16-bit DOS,
-#               16-bit Windows development and 16-bit OS/2 development.
-#
-#############################################################################
-
-# Include standard startup script definitions
-.IMPORT: SCITECH
-.INCLUDE: "$(SCITECH)\makedefs\startup.mk"
-
-# Import enivornment variables that we use
-.IMPORT .IGNORE : WC_LIBBASE USE_WIN16 USE_OS216 USE_OS2GUI
-
-# Default commands for compiling, assembling linking and archiving
-   CC           := wcc      # C-compiler and flags
-   CPP          := wpp      # C++-compiler and flags
-   CFLAGS       := -ml-zq-j-w2-s-fh -fhq
-.IF $(USE_TASM32)
-   AS           := tasm32
-.ELIF $(USE_TASMX)
-   AS           := tasmx    # Assembler and flags
-.ELSE
-   AS           := tasm     # Assembler and flags
-.ENDIF
-   AS           := tasm     # Assembler and flags
-   ASFLAGS      := /t /mx /m /D__LARGE__ /iINCLUDE /i$(SCITECH)\INCLUDE
-   LD           := wlink    # Loader and flags
-   LDFLAGS       =
-   RC           := wrc      # Watcom resource compiler
-   RCFLAGS      := /bt=windows
-   LIB          := wlib     # Librarian
-   LIBFLAGS     := -q
-   ILIB         := wlib     # Import librarian
-   ILIBFLAGS    := -c
-
-# Optionally turn on debugging information
-.IF $(DBG)
-   CFLAGS       += -d2      # Turn on debugging for C compiler
-   LIBFLAGS     += -p=128   # Larger page size for libraries with debug info!
-   ASFLAGS      += /zi      # Turn on debugging for assembler
-   LDFLAGS      += D A      # Turn on debugging for linker
-.ELSE
-   ASFLAGS      += /q       # Suppress object records not needed for linking
-.END
-
-# Optionally turn on optimisations
-.IF $(OPT)
-   CFLAGS       += -onatx-5
-.ELIF $(OPT_SIZE)
-   CFLAGS       += -onaslmr-5
-.END
-
-# Optionally turn on direct i387 FPU instructions optimised for Pentium
-
-.IF $(FPU)
-   CFLAGS       += -fpi87-fp5-DFPU387
-   ASFLAGS      += -DFPU387
-.END
-
-# Optionally compile a beta release version of a product
-.IF $(BETA)
-   CFLAGS       += -DBETA
-   ASFLAGS      += -DBETA
-.END
-
-# Use a larger stack during linking if requested
-
-.IF $(STKSIZE)
-    LDFLAGS     += OP STACK=$(STKSIZE)
-.ENDIF
-
-.IF $(USE_OS216)
-.IF $(BUILD_DLL)
-    CFLAGS       += -bd-bt=os2-DBUILD_DLL
-    ASFLAGS      += -DBUILD_DLL
-.ELSE
-    CFLAGS       += -bt=os2
-.ENDIF
-    DX_ASFLAGS   += -D__OS216__
-    LIB_OS       = os216
-.ELIF $(USE_WIN16)
-.IF $(BUILD_DLL)
-    CFLAGS       += -bd-bt=windows-D_WINDOWS-DBUILD_DLL
-    ASFLAGS      += -DBUILD_DLL
-.ELSE
-    CFLAGS       += -bt=windows-D_WINDOWS
-.ENDIF
-    DX_ASFLAGS   += -D__WINDOWS16__
-    LIB_OS       = WIN16
-.ELSE
-    USE_REALDOS  := 1
-       LIB_OS       = DOS16
-.END
-
-# Place to look for PMODE library files
-
-PMLIB           := pm.lib,
-
-# Define the base directory for library files
-
-.IF $(CHECKED)
-LIB_BASE_DIR   := $(SCITECH_LIB)\lib\debug
-CFLAGS                 += -DCHECKED=1
-.ELSE
-LIB_BASE_DIR   := $(SCITECH_LIB)\lib\release
-.ENDIF
-
-# Define where to install library files
-   LIB_BASE     := $(LIB_BASE_DIR)\$(LIB_OS)\$(WC_LIBBASE)
-   LIB_DEST     := $(LIB_BASE)
-
-# Define which file contains our rules
-
-   RULES_MAK   := wc16.mk
diff --git a/board/MAI/bios_emulator/scitech/makedefs/wc32.mk b/board/MAI/bios_emulator/scitech/makedefs/wc32.mk
deleted file mode 100644 (file)
index e5175ca..0000000
+++ /dev/null
@@ -1,353 +0,0 @@
-#############################################################################
-#
-#                                      SciTech Multi-platform Graphics Library
-#
-#  ========================================================================
-#
-#    The contents of this file are subject to the SciTech MGL Public
-#    License Version 1.0 (the "License"); you may not use this file
-#    except in compliance with the License. You may obtain a copy of
-#    the License at http://www.scitechsoft.com/mgl-license.txt
-#
-#    Software distributed under the License is distributed on an
-#    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-#    implied. See the License for the specific language governing
-#    rights and limitations under the License.
-#
-#    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-#
-#    The Initial Developer of the Original Code is SciTech Software, Inc.
-#    All Rights Reserved.
-#
-#  ========================================================================
-#
-# Descripton:   Generic DMAKE startup makefile definitions file. Assumes
-#               that the SCITECH environment variable has been set to point
-#               to where all our stuff is installed. You should not need
-#               to change anything in this file.
-#
-#               Watcom C++ 10.x 32 bit version. Supports Rational's DOS4GW
-#               DOS Extender, PMODE/W, Causeway, FlashTek's X32-VM,
-#               Phar Lap's TNT DOS Extender, 32-bit Windows development and
-#                              32-bit OS/2 development.
-#
-#############################################################################
-
-# Include standard startup script definitions
-.IMPORT: SCITECH
-.INCLUDE: "$(SCITECH)\makedefs\startup.mk"
-
-# Import enivornment variables that we use
-.IMPORT .IGNORE : USE_TNT USE_X32 USE_X32VM USE_PMODEW STKCALL USE_CAUSEWAY
-.IMPORT .IGNORE : USE_WIN386 USE_OS232 USE_OS2GUI WC_LIBBASE NOOPT DOSSTYLE
-.IMPORT .IGNORE : OS2_SHELL USE_CODEVIEW USE_DOS32A USE_QNX4 LEAVE_LINKFILE
-
-# We are compiling for a 32 bit envionment
-   _32BIT_      := 1
-
-# Setup special environment for QNX 4 (Unix'ish)
-.IF $(USE_QNX4)
-   USE_QNX     := 1
-   L            := .a          # Libraries
-   LP           := lib      # LP - Library file prefix (name of file on disk)
-   LL           := lib         # Library link prefix (name of library on link command line)
-   LE           := .a      # Library link suffix (extension of library on link command line)
-.ENDIF
-
-# Default commands for compiling, assembling linking and archiving
-   CC           := wcc386
-   CPP          := wpp386
-   CFLAGS       := -zq-j-s-fpi87
-.IF $(USE_NASM)
-   AS                  := nasm
-   ASFLAGS      := -t -f obj -d__FLAT__ -dSTDCALL_MANGLE -iINCLUDE -i$(SCITECH)\INCLUDE
-.ELSE
-.IF $(USE_TASM32)
-   AS           := tasm32
-   DLL_TASM     := tasm32
-.ELIF $(USE_TASMX)
-   AS           := tasmx
-   DLL_TASM     := tasmx
-.ELSE
-   AS           := tasm
-   DLL_TASM     := tasm
-.ENDIF
-   ASFLAGS      := /t /mx /m /w-res /w-mcp /D__FLAT__ /DSTDCALL_MANGLE /iINCLUDE /i$(SCITECH)\INCLUDE
-   GAS                 := gcc
-   GAS_FLAGS   := -D__WATCOMC__ -D__SW_3S -D__SW_S -U__GNUC__ -UDJGPP -U__unix__ -Wall -I. -I$(SCITECH)\include -x assembler-with-cpp
-.ENDIF
-   LD           := wlink
-   LDFLAGS       =
-.IF $(USE_OS232)
-   RC           := rc
-.ELSE
-   RC           := wrc
-.ENDIF
-.IF $(USE_WIN32)
-   RCFLAGS      := -q /bt=nt
-.ELIF $(USE_OS232)
-.IF $(USE_OS2GUI)
-   CFLAGS              += -D__OS2_PM__
-.ENDIF
-.ELSE
-   RCFLAGS      := -q
-.ENDIF
-   LIB          := wlib
-   LIBFLAGS     := -q
-   ILIB         := wlib
-   ILIBFLAGS    := -c
-   INTEL_X86   := 1
-
-# Set the compiler warning level
-.IF $(MAX_WARN)
-   CFLAGS       += -w4
-.ELSE
-   CFLAGS       += -w1
-.ENDIF
-
-# Optionally turn on debugging information (Codeview format)
-.IF $(DBG)
-.IF $(USE_WIN32)
-.IF $(USE_CODEVIEW)
-   CFLAGS       += -d2 -hc
-   LDFLAGS      += D CODEVIEW OPT CVPACK
-.ELSE
-   CFLAGS       += -d2
-   LDFLAGS             += D A
-.ENDIF
-.ELSE
-   CFLAGS       += -d2
-   LDFLAGS             += D A
-.ENDIF
-   LIBFLAGS     += -p=768
-.IF $(USE_NASM)
-   ASFLAGS      += -F borland -g
-.ELSE
-.IF $(USE_TASM32)
-   ASFLAGS      += /q          # TASM32 fucks up Watcom C++ debug info
-.ELIF $(OS2_SHELL)
-   ASFLAGS      += /q          # TASM for OS/2 fucks up Watcom C++ debug info
-.ELSE
-   ASFLAGS      += /zi
-.ENDIF
-.ENDIF
-.ELSE
-.IF $(USE_NASM)
-   ASFLAGS      += -F null
-.ELSE
-   ASFLAGS      += /q
-.ENDIF
-.END
-
-# Optionally turn on optimisations (with or without stack conventions)
-.IF $(STKCALL)
-.IF $(OPT)
-   CFLAGS       += -onatx-5s-fp5
-.ELIF $(OPT_SIZE)
-   CFLAGS       += -onaslmr-5s-fp5
-.ELIF $(NOOPT)
-   CFLAGS       += -od-5s
-.ELSE
-   CFLAGS       += -3s
-.END
-.ELSE
-.IF $(OPT)
-   CFLAGS       += -onatx-5r-fp5
-.ELIF $(OPT_SIZE)
-   CFLAGS       += -onaslmr-5r-fp5
-.ELIF $(NOOPT)
-   CFLAGS       += -od-5r
-.END
-.END
-
-# Optionally turn on direct i387 FPU instructions optimised for Pentium
-.IF $(FPU)
-   CFLAGS       += -DFPU387
-   ASFLAGS      += -dFPU387
-.END
-
-# Optionally compile a beta release version of a product
-.IF $(BETA)
-   CFLAGS       += -DBETA
-   ASFLAGS      += -dBETA
-.END
-
-.IF $(USE_TNT)                  # Use Phar Lap's TNT DOS Extender
-       CFLAGS       += -bt=nt -DTNT
-       ASFLAGS          += -dTNT
-       LDFLAGS      += SYS NT OP STUB=GOTNT.EXE
-       LIB_OS       = DOS32
-.ELIF $(USE_X32VM)              # Use FlashTek X-32VM DOS extender
-       CFLAGS       += -bt=dos
-       LDFLAGS      += SYS X32RV
-    DX_CFLAGS    += -DX32VM
-       DX_ASFLAGS   += -dX32VM
-    LIB_OS       = DOS32
-.ELIF $(USE_X32)                # Use FlashTek X-32 DOS extender
-       CFLAGS       += -bt=dos
-       LDFLAGS      += SYS X32R
-    DX_CFLAGS    += -DX32VM
-       DX_ASFLAGS   += -dX32VM
-    LIB_OS       = DOS32
-.ELIF $(USE_QNX4)               # Build QNX 4 app
-       CFLAGS       += -bt=qnx386
-       LDFLAGS      += SYS QNX386FLAT OP CASEEXACT OP OFFSET=40k OP STACK=32k
-    CFLAGS      += -D__QNX__ -D__UNIX__
-       ASFLAGS          += -d__QNX__ -d__UNIX__
-    LIB_OS       = QNX4
-.ELIF $(USE_OS232)
-.IF $(BUILD_DLL)
-       CFLAGS       += -bm-bd-bt=os2-sg-DBUILD_DLL
-       ASFLAGS      += -dBUILD_DLL
-.ELSE
-       CFLAGS       += -bm-bt=os2-sg
-.ENDIF
-       DX_ASFLAGS   += -d__OS2__
-    LIB_OS       = os232
-.ELIF $(USE_SNAP)               # Build 32 bit Snap app
-.IF $(BUILD_DLL)
-       CFLAGS       += -bm-bd-bt=nt-DBUILD_DLL
-       ASFLAGS      += -dBUILD_DLL
-.ELSE
-       CFLAGS       += -bm-bt=nt-D_WIN32
-.ENDIF
-       LDFLAGS      += OP nodefaultlibs
-.IF $(STKCALL)
-       DEFLIBS          := clib3s.lib,math3s.lib,noemu387.lib,
-.ELSE
-       DEFLIBS          := clib3r.lib,math3r.lib,noemu387.lib,
-.ENDIF
-       LIB_OS       = SNAP
-.ELIF $(USE_WIN32)              # Build 32 bit Windows NT app
-.IF $(WIN32_GUI)
-.ELSE
-    CFLAGS       += -D__CONSOLE__
-.ENDIF
-.IF $(BUILD_DLL)
-       CFLAGS       += -bm-bd-bt=nt-sg-DBUILD_DLL -D_WIN32
-       ASFLAGS      += -dBUILD_DLL
-.ELSE
-       CFLAGS       += -bm-bt=nt-sg-D_WIN32
-.ENDIF
-       DX_ASFLAGS   += -d__WINDOWS32__
-       LIB_OS       = WIN32
-    DEFLIBS         := kernel32.lib,user32.lib,gdi32.lib,advapi32.lib,shell32.lib,winmm.lib,comdlg32.lib,comctl32.lib,ole32.lib,oleaut32.lib,version.lib,winspool.lib,uuid.lib,wsock32.lib,rpcrt4.lib,
-.ELIF $(USE_WIN386)             # Build 32 bit Win386 extended app
-.IF $(BUILD_DLL)
-    CFLAGS       += -bd-bt=windows-DBUILD_DLL
-       ASFLAGS      += -dBUILD_DLL
-.ELSE
-    CFLAGS       += -bt=windows
-.ENDIF
-       DX_ASFLAGS   += -d__WIN386__
-    LIB_OS       = WIN386
-.ELIF $(USE_PMODEW)             # PMODE/W
-       CFLAGS       += -bt=dos
-       USE_DOS4GW   := 1
-       USE_REALDOS  := 1
-       LDFLAGS      += SYS PMODEW
-       DX_CFLAGS    += -DDOS4GW
-       DX_ASFLAGS   += -dDOS4GW
-       LIB_OS       = DOS32
-.ELIF $(USE_CAUSEWAY)           # Causeway
-       CFLAGS       += -bt=dos
-       USE_DOS4GW   := 1
-       USE_REALDOS  := 1
-       LDFLAGS      += SYS CAUSEWAY
-       DX_CFLAGS    += -DDOS4GW
-       DX_ASFLAGS   += -dDOS4GW
-       LIB_OS       = DOS32
-.ELIF $(USE_DOS32A)             # DOS32/A
-       CFLAGS       += -bt=dos
-       USE_DOS4GW   := 1
-       USE_REALDOS  := 1
-       LDFLAGS      += SYS DOS32A
-       DX_CFLAGS    += -DDOS4GW
-       DX_ASFLAGS   += -dDOS4GW
-       LIB_OS       = DOS32
-.ELSE                           # Use DOS4GW
-       CFLAGS       += -bt=dos
-       USE_DOS4GW   := 1
-       USE_REALDOS  := 1
-       LDFLAGS      += SYS DOS4G
-       DX_CFLAGS    += -DDOS4GW
-       DX_ASFLAGS   += -dDOS4GW
-       LIB_OS       = DOS32
-.END
-
-# Disable linking to default C runtime library and PM library
-
-.IF $(NO_RUNTIME)
-LDFLAGS                         += OP nodefaultlibs
-DEFLIBS          :=
-.ELSE
-
-# Place to look for PM library files
-
-.IF $(USE_SNAP)                # Build 32 bit Snap app or dll
-PMLIB           :=
-.ELIF $(USE_WIN32)
-.IF $(STKCALL)
-PMLIB           := spm.lib,
-.ELSE
-PMLIB           := pm.lib,
-.ENDIF
-.ELIF $(USE_OS232)
-.IF $(STKCALL)
-.IF $(USE_OS2GUI)
-PMLIB           := spm_pm.lib,
-.ELSE
-PMLIB           := spm.lib,
-.ENDIF
-.ELSE
-.IF $(USE_OS2GUI)
-PMLIB           := pm_pm.lib,
-.ELSE
-PMLIB           := pm.lib,
-.ENDIF
-.ENDIF
-.ELIF $(USE_QNX4)
-.IF $(STKCALL)
-PMLIB           := libspm.a,
-.ELSE
-PMLIB           := libpm.a,
-.ENDIF
-.ELIF $(USE_TNT)
-.IF $(STKCALL)
-PMLIB           := tnt\spm.lib,
-.ELSE
-PMLIB           := tnt\pm.lib,
-.ENDIF
-.ELIF $(USE_X32)
-.IF $(STKCALL)
-PMLIB           := x32\spm.lib,
-.ELSE
-PMLIB           := x32\pm.lib,
-.ENDIF
-.ELSE
-.IF $(STKCALL)
-PMLIB           := dos4gw\spm.lib,
-.ELSE
-PMLIB           := dos4gw\pm.lib,
-.ENDIF
-.ENDIF
-.ENDIF
-
-# Define the base directory for library files
-
-.IF $(CHECKED)
-LIB_BASE_DIR   := $(SCITECH_LIB)\lib\debug
-CFLAGS                 += -DCHECKED=1
-.ELSE
-LIB_BASE_DIR   := $(SCITECH_LIB)\lib\release
-.ENDIF
-
-# Define where to install library files
-   LIB_BASE     := $(LIB_BASE_DIR)\$(LIB_OS)\$(WC_LIBBASE)
-   LIB_DEST     := $(LIB_BASE)
-
-    LDFLAGS += op map
-
-# Define which file contains our rules
-
-   RULES_MAK   := wc32.mk
diff --git a/board/MAI/bios_emulator/scitech/src/biosemu/besys.c b/board/MAI/bios_emulator/scitech/src/biosemu/besys.c
deleted file mode 100644 (file)
index 1512ce9..0000000
+++ /dev/null
@@ -1,408 +0,0 @@
-/****************************************************************************
-*
-*                        BIOS emulator and interface
-*                      to Realmode X86 Emulator Library
-*
-*               Copyright (C) 1996-1999 SciTech Software, Inc.
-*
-*  ========================================================================
-*
-*  Permission to use, copy, modify, distribute, and sell this software and
-*  its documentation for any purpose is hereby granted without fee,
-*  provided that the above copyright notice appear in all copies and that
-*  both that copyright notice and this permission notice appear in
-*  supporting documentation, and that the name of the authors not be used
-*  in advertising or publicity pertaining to distribution of the software
-*  without specific, written prior permission.  The authors makes no
-*  representations about the suitability of this software for any purpose.
-*  It is provided "as is" without express or implied warranty.
-*
-*  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-*  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-*  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-*  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-*  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-*  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-*  PERFORMANCE OF THIS SOFTWARE.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Any
-* Developer:    Kendall Bennett
-*
-* Description:  This file includes BIOS emulator I/O and memory access
-*               functions.
-*
-****************************************************************************/
-
-#include "biosemui.h"
-
-/*------------------------------- Macros ----------------------------------*/
-
-/* Macros to read and write values to x86 bus memory. Replace these as
- * necessary if you need to do something special to access memory over
- * the bus on a particular processor family.
- */
-
-#define readb(base,off)     *((u8*)((u32)(base) + (off)))
-#define readw(base,off)     *((u16*)((u32)(base) + (off)))
-#define readl(base,off)     *((u32*)((u32)(base) + (off)))
-#define writeb(v,base,off)  *((u8*)((u32)(base) + (off))) = (v)
-#define writew(v,base,off)  *((u16*)((u32)(base) + (off))) = (v)
-#define writel(v,base,off)  *((u32*)((u32)(base) + (off))) = (v)
-
-/*----------------------------- Implementation ----------------------------*/
-
-#ifdef DEBUG
-# define DEBUG_MEM()        (M.x86.debug & DEBUG_MEM_TRACE_F)
-#else
-# define DEBUG_MEM()
-#endif
-
-/****************************************************************************
-PARAMETERS:
-addr    - Emulator memory address to read
-
-RETURNS:
-Byte value read from emulator memory.
-
-REMARKS:
-Reads a byte value from the emulator memory. We have three distinct memory
-regions that are handled differently, which this function handles.
-****************************************************************************/
-u8 X86API BE_rdb(
-    u32 addr)
-{
-    u8 val = 0;
-
-    if (addr >= 0xC0000 && addr <= _BE_env.biosmem_limit) {
-       val = *(u8*)(_BE_env.biosmem_base + addr - 0xC0000);
-       }
-    else if (addr >= 0xA0000 && addr <= 0xFFFFF) {
-       val = readb(_BE_env.busmem_base, addr - 0xA0000);
-       }
-    else if (addr > M.mem_size - 1) {
-DB(     printk("mem_read: address %#lx out of range!\n", addr);)
-       HALT_SYS();
-       }
-    else {
-       val = *(u8*)(M.mem_base + addr);
-       }
-DB( if (DEBUG_MEM())
-       printk("%#08x 1 -> %#x\n", addr, val);)
-    return val;
-}
-
-/****************************************************************************
-PARAMETERS:
-addr    - Emulator memory address to read
-
-RETURNS:
-Word value read from emulator memory.
-
-REMARKS:
-Reads a word value from the emulator memory. We have three distinct memory
-regions that are handled differently, which this function handles.
-****************************************************************************/
-u16 X86API BE_rdw(
-    u32 addr)
-{
-    u16 val = 0;
-
-    if (addr >= 0xC0000 && addr <= _BE_env.biosmem_limit) {
-#ifdef __BIG_ENDIAN__
-       if (addr & 0x1) {
-           addr -= 0xC0000;
-           val = ( *(u8*)(_BE_env.biosmem_base + addr) |
-                  (*(u8*)(_BE_env.biosmem_base + addr + 1) << 8));
-           }
-       else
-#endif
-           val = *(u16*)(_BE_env.biosmem_base + addr - 0xC0000);
-       }
-    else if (addr >= 0xA0000 && addr <= 0xFFFFF) {
-#ifdef __BIG_ENDIAN__
-       if (addr & 0x1) {
-           addr -= 0xA0000;
-           val = ( readb(_BE_env.busmem_base, addr) |
-                  (readb(_BE_env.busmem_base, addr + 1) << 8));
-           }
-       else
-#endif
-           val = readw(_BE_env.busmem_base, addr - 0xA0000);
-       }
-    else if (addr > M.mem_size - 2) {
-DB(     printk("mem_read: address %#lx out of range!\n", addr);)
-       HALT_SYS();
-       }
-    else {
-#ifdef __BIG_ENDIAN__
-       if (addr & 0x1) {
-           val = ( *(u8*)(M.mem_base + addr) |
-                  (*(u8*)(M.mem_base + addr + 1) << 8));
-           }
-       else
-#endif
-           val = *(u16*)(M.mem_base + addr);
-       }
-DB( if (DEBUG_MEM())
-       printk("%#08x 2 -> %#x\n", addr, val);)
-    return val;
-}
-
-/****************************************************************************
-PARAMETERS:
-addr    - Emulator memory address to read
-
-RETURNS:
-Long value read from emulator memory.
-
-REMARKS:
-Reads a long value from the emulator memory. We have three distinct memory
-regions that are handled differently, which this function handles.
-****************************************************************************/
-u32 X86API BE_rdl(
-    u32 addr)
-{
-    u32 val = 0;
-
-    if (addr >= 0xC0000 && addr <= _BE_env.biosmem_limit) {
-#ifdef __BIG_ENDIAN__
-       if (addr & 0x3) {
-           addr -= 0xC0000;
-           val = ( *(u8*)(_BE_env.biosmem_base + addr + 0) |
-                  (*(u8*)(_BE_env.biosmem_base + addr + 1) << 8) |
-                  (*(u8*)(_BE_env.biosmem_base + addr + 2) << 16) |
-                  (*(u8*)(_BE_env.biosmem_base + addr + 3) << 24));
-           }
-       else
-#endif
-           val = *(u32*)(_BE_env.biosmem_base + addr - 0xC0000);
-       }
-    else if (addr >= 0xA0000 && addr <= 0xFFFFF) {
-#ifdef __BIG_ENDIAN__
-       if (addr & 0x3) {
-           addr -= 0xA0000;
-           val = ( readb(_BE_env.busmem_base, addr) |
-                  (readb(_BE_env.busmem_base, addr + 1) <<  8) |
-                  (readb(_BE_env.busmem_base, addr + 2) << 16) |
-                  (readb(_BE_env.busmem_base, addr + 3) << 24));
-           }
-       else
-#endif
-           val = readl(_BE_env.busmem_base, addr - 0xA0000);
-       }
-    else if (addr > M.mem_size - 4) {
-DB(     printk("mem_read: address %#lx out of range!\n", addr);)
-       HALT_SYS();
-       }
-    else {
-#ifdef __BIG_ENDIAN__
-       if (addr & 0x3) {
-           val = ( *(u8*)(M.mem_base + addr + 0) |
-                  (*(u8*)(M.mem_base + addr + 1) << 8) |
-                  (*(u8*)(M.mem_base + addr + 2) << 16) |
-                  (*(u8*)(M.mem_base + addr + 3) << 24));
-           }
-       else
-#endif
-           val = *(u32*)(M.mem_base + addr);
-       }
-DB( if (DEBUG_MEM())
-       printk("%#08x 4 -> %#x\n", addr, val);)
-    return val;
-}
-
-/****************************************************************************
-PARAMETERS:
-addr    - Emulator memory address to read
-val     - Value to store
-
-REMARKS:
-Writes a byte value to emulator memory. We have three distinct memory
-regions that are handled differently, which this function handles.
-****************************************************************************/
-void X86API BE_wrb(
-    u32 addr,
-    u8 val)
-{
-DB( if (DEBUG_MEM())
-       printk("%#08x 1 <- %#x\n", addr, val);)
-    if (addr >= 0xC0000 && addr <= _BE_env.biosmem_limit) {
-       *(u8*)(_BE_env.biosmem_base + addr - 0xC0000) = val;
-       }
-    else if (addr >= 0xA0000 && addr <= 0xFFFFF) {
-       writeb(val, _BE_env.busmem_base, addr - 0xA0000);
-       }
-    else if (addr > M.mem_size-1) {
-DB(     printk("mem_write: address %#lx out of range!\n", addr);)
-       HALT_SYS();
-       }
-    else {
-       *(u8*)(M.mem_base + addr) = val;
-       }
-}
-
-/****************************************************************************
-PARAMETERS:
-addr    - Emulator memory address to read
-val     - Value to store
-
-REMARKS:
-Writes a word value to emulator memory. We have three distinct memory
-regions that are handled differently, which this function handles.
-****************************************************************************/
-void X86API BE_wrw(
-    u32 addr,
-    u16 val)
-{
-DB( if (DEBUG_MEM())
-       printk("%#08x 2 <- %#x\n", addr, val);)
-    if (addr >= 0xC0000 && addr <= _BE_env.biosmem_limit) {
-#ifdef __BIG_ENDIAN__
-       if (addr & 0x1) {
-           addr -= 0xC0000;
-           *(u8*)(_BE_env.biosmem_base + addr + 0) = (val >> 0) & 0xff;
-           *(u8*)(_BE_env.biosmem_base + addr + 1) = (val >> 8) & 0xff;
-           }
-       else
-#endif
-           *(u16*)(_BE_env.biosmem_base + addr - 0xC0000) = val;
-       }
-    else if (addr >= 0xA0000 && addr <= 0xFFFFF) {
-#ifdef __BIG_ENDIAN__
-       if (addr & 0x1) {
-           addr -= 0xA0000;
-           writeb(val >> 0, _BE_env.busmem_base, addr);
-           writeb(val >> 8, _BE_env.busmem_base, addr + 1);
-           }
-       else
-#endif
-           writew(val, _BE_env.busmem_base, addr - 0xA0000);
-       }
-    else if (addr > M.mem_size-2) {
-DB(     printk("mem_write: address %#lx out of range!\n", addr);)
-       HALT_SYS();
-       }
-    else {
-#ifdef __BIG_ENDIAN__
-       if (addr & 0x1) {
-           *(u8*)(M.mem_base + addr + 0) = (val >> 0) & 0xff;
-           *(u8*)(M.mem_base + addr + 1) = (val >> 8) & 0xff;
-           }
-       else
-#endif
-           *(u16*)(M.mem_base + addr) = val;
-       }
-}
-
-/****************************************************************************
-PARAMETERS:
-addr    - Emulator memory address to read
-val     - Value to store
-
-REMARKS:
-Writes a long value to emulator memory. We have three distinct memory
-regions that are handled differently, which this function handles.
-****************************************************************************/
-void X86API BE_wrl(
-    u32 addr,
-    u32 val)
-{
-DB( if (DEBUG_MEM())
-       printk("%#08x 4 <- %#x\n", addr, val);)
-    if (addr >= 0xC0000 && addr <= _BE_env.biosmem_limit) {
-#ifdef __BIG_ENDIAN__
-       if (addr & 0x1) {
-           addr -= 0xC0000;
-           *(u8*)(M.mem_base + addr + 0) = (val >>  0) & 0xff;
-           *(u8*)(M.mem_base + addr + 1) = (val >>  8) & 0xff;
-           *(u8*)(M.mem_base + addr + 2) = (val >> 16) & 0xff;
-           *(u8*)(M.mem_base + addr + 3) = (val >> 24) & 0xff;
-           }
-       else
-#endif
-           *(u32*)(M.mem_base + addr - 0xC0000) = val;
-       }
-    else if (addr >= 0xA0000 && addr <= 0xFFFFF) {
-#ifdef __BIG_ENDIAN__
-       if (addr & 0x3) {
-           addr -= 0xA0000;
-           writeb(val >>  0, _BE_env.busmem_base, addr);
-           writeb(val >>  8, _BE_env.busmem_base, addr + 1);
-           writeb(val >> 16, _BE_env.busmem_base, addr + 1);
-           writeb(val >> 24, _BE_env.busmem_base, addr + 1);
-           }
-       else
-#endif
-           writel(val, _BE_env.busmem_base, addr - 0xA0000);
-       }
-    else if (addr > M.mem_size-4) {
-DB(     printk("mem_write: address %#lx out of range!\n", addr);)
-       HALT_SYS();
-       }
-    else {
-#ifdef __BIG_ENDIAN__
-       if (addr & 0x1) {
-           *(u8*)(M.mem_base + addr + 0) = (val >>  0) & 0xff;
-           *(u8*)(M.mem_base + addr + 1) = (val >>  8) & 0xff;
-           *(u8*)(M.mem_base + addr + 2) = (val >> 16) & 0xff;
-           *(u8*)(M.mem_base + addr + 3) = (val >> 24) & 0xff;
-           }
-       else
-#endif
-           *(u32*)(M.mem_base + addr) = val;
-       }
-}
-
-/* Debug functions to do ISA/PCI bus port I/O */
-
-#ifdef  DEBUG
-#define DEBUG_IO()          (M.x86.debug & DEBUG_IO_TRACE_F)
-
-u8 X86API BE_inb(int port)
-{
-    u8 val = PM_inpb(port);
-    if (DEBUG_IO())
-       printk("%04X:%04X:  inb.%04X -> %02X\n",M.x86.saved_cs, M.x86.saved_ip, (ushort)port, val);
-    return val;
-}
-
-u16 X86API BE_inw(int port)
-{
-    u16 val = PM_inpw(port);
-    if (DEBUG_IO())
-       printk("%04X:%04X:  inw.%04X -> %04X\n",M.x86.saved_cs, M.x86.saved_ip, (ushort)port, val);
-    return val;
-}
-
-u32 X86API BE_inl(int port)
-{
-    u32 val = PM_inpd(port);
-    if (DEBUG_IO())
-       printk("%04X:%04X:  inl.%04X -> %08X\n",M.x86.saved_cs, M.x86.saved_ip, (ushort)port, val);
-    return val;
-}
-
-void X86API BE_outb(int port, u8 val)
-{
-    if (DEBUG_IO())
-       printk("%04X:%04X: outb.%04X <- %02X\n",M.x86.saved_cs, M.x86.saved_ip, (ushort)port, val);
-    PM_outpb(port,val);
-}
-
-void X86API BE_outw(int port, u16 val)
-{
-    if (DEBUG_IO())
-       printk("%04X:%04X: outw.%04X <- %04X\n",M.x86.saved_cs, M.x86.saved_ip, (ushort)port, val);
-    PM_outpw(port,val);
-}
-
-void X86API BE_outl(int port, u32 val)
-{
-    if (DEBUG_IO())
-       printk("%04X:%04X: outl.%04X <- %08X\n",M.x86.saved_cs, M.x86.saved_ip, (ushort)port, val);
-    PM_outpd(port,val);
-}
-#endif
diff --git a/board/MAI/bios_emulator/scitech/src/biosemu/bios.c b/board/MAI/bios_emulator/scitech/src/biosemu/bios.c
deleted file mode 100644 (file)
index c0f4a4b..0000000
+++ /dev/null
@@ -1,250 +0,0 @@
-/****************************************************************************
-*
-*                        BIOS emulator and interface
-*                      to Realmode X86 Emulator Library
-*
-*               Copyright (C) 1996-1999 SciTech Software, Inc.
-*
-*  ========================================================================
-*
-*  Permission to use, copy, modify, distribute, and sell this software and
-*  its documentation for any purpose is hereby granted without fee,
-*  provided that the above copyright notice appear in all copies and that
-*  both that copyright notice and this permission notice appear in
-*  supporting documentation, and that the name of the authors not be used
-*  in advertising or publicity pertaining to distribution of the software
-*  without specific, written prior permission.  The authors makes no
-*  representations about the suitability of this software for any purpose.
-*  It is provided "as is" without express or implied warranty.
-*
-*  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-*  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-*  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-*  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-*  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-*  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-*  PERFORMANCE OF THIS SOFTWARE.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Any
-* Developer:    Kendall Bennett
-*
-* Description:  Module implementing the BIOS specific functions.
-*
-****************************************************************************/
-
-#include "biosemui.h"
-
-/*----------------------------- Implementation ----------------------------*/
-
-/****************************************************************************
-PARAMETERS:
-intno   - Interrupt number being serviced
-
-REMARKS:
-Handler for undefined interrupts.
-****************************************************************************/
-static void X86API undefined_intr(
-    int intno)
-{
-    if (BE_rdw(intno * 4 + 2) == BIOS_SEG)
-       printk("biosEmu: undefined interrupt %xh called!\n",intno);
-    else
-       X86EMU_prepareForInt(intno);
-}
-
-/****************************************************************************
-PARAMETERS:
-intno   - Interrupt number being serviced
-
-REMARKS:
-This function handles the default system BIOS Int 10h (the default is stored
-in the Int 42h vector by the system BIOS at bootup). We only need to handle
-a small number of special functions used by the BIOS during POST time.
-****************************************************************************/
-static void X86API int42(
-    int intno)
-{
-    if (M.x86.R_AH == 0x12 && M.x86.R_BL == 0x32) {
-       if (M.x86.R_AL == 0) {
-           /* Enable CPU accesses to video memory */
-           PM_outpb(0x3c2, PM_inpb(0x3cc) | (u8)0x02);
-           return;
-           }
-       else if (M.x86.R_AL == 1) {
-           /* Disable CPU accesses to video memory */
-           PM_outpb(0x3c2, PM_inpb(0x3cc) & (u8)~0x02);
-           return;
-           }
-#ifdef  DEBUG
-       else {
-           printk("biosEmu/bios.int42: unknown function AH=0x12, BL=0x32, AL=%#02x\n",M.x86.R_AL);
-           }
-#endif
-       }
-#ifdef  DEBUG
-    else {
-       printk("biosEmu/bios.int42: unknown function AH=%#02x, AL=%#02x, BL=%#02x\n",M.x86.R_AH, M.x86.R_AL, M.x86.R_BL);
-       }
-#endif
-}
-
-/****************************************************************************
-PARAMETERS:
-intno   - Interrupt number being serviced
-
-REMARKS:
-This function handles the default system BIOS Int 10h. If the POST code
-has not yet re-vectored the Int 10h BIOS interrupt vector, we handle this
-by simply calling the int42 interrupt handler above. Very early in the
-BIOS POST process, the vector gets replaced and we simply let the real
-mode interrupt handler process the interrupt.
-****************************************************************************/
-static void X86API int10(
-    int intno)
-{
-    if (BE_rdw(intno * 4 + 2) == BIOS_SEG)
-       int42(intno);
-    else
-       X86EMU_prepareForInt(intno);
-}
-
-/* Result codes returned by the PCI BIOS */
-
-#define SUCCESSFUL          0x00
-#define FUNC_NOT_SUPPORT    0x81
-#define BAD_VENDOR_ID       0x83
-#define DEVICE_NOT_FOUND    0x86
-#define BAD_REGISTER_NUMBER 0x87
-#define SET_FAILED          0x88
-#define BUFFER_TOO_SMALL    0x89
-
-/****************************************************************************
-PARAMETERS:
-intno   - Interrupt number being serviced
-
-REMARKS:
-This function handles the default Int 1Ah interrupt handler for the real
-mode code, which provides support for the PCI BIOS functions. Since we only
-want to allow the real mode BIOS code *only* see the PCI config space for
-its own device, we only return information for the specific PCI config
-space that we have passed in to the init function. This solves problems
-when using the BIOS to warm boot a secondary adapter when there is an
-identical adapter before it on the bus (some BIOS'es get confused in this
-case).
-****************************************************************************/
-static void X86API int1A(
-    unused)
-{
-    u16 pciSlot;
-
-    /* Fail if no PCI device information has been registered */
-    if (!_BE_env.vgaInfo.pciInfo)
-       return;
-    pciSlot = (u16)(_BE_env.vgaInfo.pciInfo->slot.i >> 8);
-    switch (M.x86.R_AX) {
-       case 0xB101:                    /* PCI bios present? */
-           M.x86.R_AL  = 0x00;         /* no config space/special cycle generation support */
-           M.x86.R_EDX = 0x20494350;   /* " ICP" */
-           M.x86.R_BX  = 0x0210;       /* Version 2.10 */
-           M.x86.R_CL  = 0;            /* Max bus number in system */
-           CLEAR_FLAG(F_CF);
-           break;
-       case 0xB102:                    /* Find PCI device */
-           M.x86.R_AH = DEVICE_NOT_FOUND;
-           if (M.x86.R_DX == _BE_env.vgaInfo.pciInfo->VendorID &&
-                   M.x86.R_CX == _BE_env.vgaInfo.pciInfo->DeviceID &&
-                   M.x86.R_SI == 0) {
-               M.x86.R_AH = SUCCESSFUL;
-               M.x86.R_BX = pciSlot;
-               }
-           CONDITIONAL_SET_FLAG((M.x86.R_AH != SUCCESSFUL), F_CF);
-           break;
-       case 0xB103:                    /* Find PCI class code */
-           M.x86.R_AH = DEVICE_NOT_FOUND;
-           if (M.x86.R_CL == _BE_env.vgaInfo.pciInfo->Interface &&
-                   M.x86.R_CH == _BE_env.vgaInfo.pciInfo->SubClass &&
-                   (u8)(M.x86.R_ECX >> 16) == _BE_env.vgaInfo.pciInfo->BaseClass) {
-               M.x86.R_AH = SUCCESSFUL;
-               M.x86.R_BX = pciSlot;
-               }
-           CONDITIONAL_SET_FLAG((M.x86.R_AH != SUCCESSFUL), F_CF);
-           break;
-       case 0xB108:                    /* Read configuration byte */
-           M.x86.R_AH = BAD_REGISTER_NUMBER;
-           if (M.x86.R_BX == pciSlot) {
-               M.x86.R_AH = SUCCESSFUL;
-               M.x86.R_CL = (u8)PCI_accessReg(M.x86.R_DI,0,PCI_READ_BYTE,_BE_env.vgaInfo.pciInfo);
-               }
-           CONDITIONAL_SET_FLAG((M.x86.R_AH != SUCCESSFUL), F_CF);
-           break;
-       case 0xB109:                    /* Read configuration word */
-           M.x86.R_AH = BAD_REGISTER_NUMBER;
-           if (M.x86.R_BX == pciSlot) {
-               M.x86.R_AH = SUCCESSFUL;
-               M.x86.R_CX = (u16)PCI_accessReg(M.x86.R_DI,0,PCI_READ_WORD,_BE_env.vgaInfo.pciInfo);
-               }
-           CONDITIONAL_SET_FLAG((M.x86.R_AH != SUCCESSFUL), F_CF);
-           break;
-       case 0xB10A:                    /* Read configuration dword */
-           M.x86.R_AH = BAD_REGISTER_NUMBER;
-           if (M.x86.R_BX == pciSlot) {
-               M.x86.R_AH = SUCCESSFUL;
-               M.x86.R_ECX = (u32)PCI_accessReg(M.x86.R_DI,0,PCI_READ_DWORD,_BE_env.vgaInfo.pciInfo);
-               }
-           CONDITIONAL_SET_FLAG((M.x86.R_AH != SUCCESSFUL), F_CF);
-           break;
-       case 0xB10B:                    /* Write configuration byte */
-           M.x86.R_AH = BAD_REGISTER_NUMBER;
-           if (M.x86.R_BX == pciSlot) {
-               M.x86.R_AH = SUCCESSFUL;
-               PCI_accessReg(M.x86.R_DI,M.x86.R_CL,PCI_WRITE_BYTE,_BE_env.vgaInfo.pciInfo);
-               }
-           CONDITIONAL_SET_FLAG((M.x86.R_AH != SUCCESSFUL), F_CF);
-           break;
-       case 0xB10C:                    /* Write configuration word */
-           M.x86.R_AH = BAD_REGISTER_NUMBER;
-           if (M.x86.R_BX == pciSlot) {
-               M.x86.R_AH = SUCCESSFUL;
-               PCI_accessReg(M.x86.R_DI,M.x86.R_CX,PCI_WRITE_WORD,_BE_env.vgaInfo.pciInfo);
-               }
-           CONDITIONAL_SET_FLAG((M.x86.R_AH != SUCCESSFUL), F_CF);
-           break;
-       case 0xB10D:                    /* Write configuration dword */
-           M.x86.R_AH = BAD_REGISTER_NUMBER;
-           if (M.x86.R_BX == pciSlot) {
-               M.x86.R_AH = SUCCESSFUL;
-               PCI_accessReg(M.x86.R_DI,M.x86.R_ECX,PCI_WRITE_DWORD,_BE_env.vgaInfo.pciInfo);
-               }
-           CONDITIONAL_SET_FLAG((M.x86.R_AH != SUCCESSFUL), F_CF);
-           break;
-       default:
-           printk("biosEmu/bios.int1a: unknown function AX=%#04x\n", M.x86.R_AX);
-       }
-}
-
-/****************************************************************************
-REMARKS:
-This function initialises the BIOS emulation functions for the specific
-PCI display device. We insulate the real mode BIOS from any other devices
-on the bus, so that it will work correctly thinking that it is the only
-device present on the bus (ie: avoiding any adapters present in from of
-the device we are trying to control).
-****************************************************************************/
-void _BE_bios_init(
-    u32 *intrTab)
-{
-    int                 i;
-    X86EMU_intrFuncs    bios_intr_tab[256];
-
-    for (i = 0; i < 256; ++i) {
-       intrTab[i] = BIOS_SEG << 16;
-       bios_intr_tab[i] = undefined_intr;
-       }
-    bios_intr_tab[0x10] = int10;
-    bios_intr_tab[0x1A] = int1A;
-    bios_intr_tab[0x42] = int42;
-    X86EMU_setupIntrFuncs(bios_intr_tab);
-}
diff --git a/board/MAI/bios_emulator/scitech/src/biosemu/biosemu.c b/board/MAI/bios_emulator/scitech/src/biosemu/biosemu.c
deleted file mode 100644 (file)
index 0052709..0000000
+++ /dev/null
@@ -1,445 +0,0 @@
-/****************************************************************************
-*
-*                        BIOS emulator and interface
-*                      to Realmode X86 Emulator Library
-*
-*               Copyright (C) 1996-1999 SciTech Software, Inc.
-*
-*  ========================================================================
-*
-*  Permission to use, copy, modify, distribute, and sell this software and
-*  its documentation for any purpose is hereby granted without fee,
-*  provided that the above copyright notice appear in all copies and that
-*  both that copyright notice and this permission notice appear in
-*  supporting documentation, and that the name of the authors not be used
-*  in advertising or publicity pertaining to distribution of the software
-*  without specific, written prior permission.  The authors makes no
-*  representations about the suitability of this software for any purpose.
-*  It is provided "as is" without express or implied warranty.
-*
-*  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-*  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-*  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-*  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-*  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-*  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-*  PERFORMANCE OF THIS SOFTWARE.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Any
-* Developer:    Kendall Bennett
-*
-* Description:  Module implementing the system specific functions. This
-*               module is always compiled and linked in the OS depedent
-*               libraries, and never in a binary portable driver.
-*
-****************************************************************************/
-
-#include "biosemui.h"
-#include <string.h>
-#include <stdlib.h>
-
-/*------------------------- Global Variables ------------------------------*/
-
-BE_sysEnv           _BE_env;
-#ifdef  __DRIVER__
-PM_imports  _VARAPI _PM_imports;
-#endif
-static X86EMU_memFuncs _BE_mem = {
-    BE_rdb,
-    BE_rdw,
-    BE_rdl,
-    BE_wrb,
-    BE_wrw,
-    BE_wrl,
-    };
-#ifdef  DEBUG
-static X86EMU_pioFuncs _BE_pio = {
-    BE_inb,
-    BE_inw,
-    BE_inl,
-    BE_outb,
-    BE_outw,
-    BE_outl,
-    };
-#else
-static X86EMU_pioFuncs _BE_pio = {
-    (void*)PM_inpb,
-    (void*)PM_inpw,
-    (void*)PM_inpd,
-    (void*)PM_outpb,
-    (void*)PM_outpw,
-    (void*)PM_outpd,
-    };
-#endif
-
-/*-------------------------- Implementation -------------------------------*/
-
-#define OFF(addr)       (u16)(((addr) >> 0) & 0xffff)
-#define SEG(addr)       (u16)(((addr) >> 4) & 0xf000)
-
-/****************************************************************************
-PARAMETERS:
-debugFlags  - Flags to enable debugging options (debug builds only)
-memSize     - Amount of memory to allocate for real mode machine
-info        - Pointer to default VGA device information
-
-REMARKS:
-This functions initialises the BElib, and uses the passed in
-BIOS image as the BIOS that is used and emulated at 0xC0000.
-****************************************************************************/
-ibool PMAPI BE_init(
-    u32 debugFlags,
-    int memSize,
-    BE_VGAInfo *info)
-{
-#ifndef __DRIVER__
-    PM_init();
-#endif
-    memset(&M,0,sizeof(M));
-    if (memSize < 20480)
-       PM_fatalError("Emulator requires at least 20Kb of memory!\n");
-    if ((M.mem_base = (unsigned long)malloc(memSize)) == NULL)
-       PM_fatalError("Out of memory!");
-    M.mem_size = memSize;
-    _BE_env.busmem_base = (ulong)PM_mapPhysicalAddr(0xA0000,0x5FFFF,true);
-    M.x86.debug = debugFlags;
-    _BE_bios_init((u32*)info->LowMem);
-    X86EMU_setupMemFuncs(&_BE_mem);
-    X86EMU_setupPioFuncs(&_BE_pio);
-    BE_setVGA(info);
-    return true;
-}
-
-/****************************************************************************
-PARAMETERS:
-debugFlags  - Flags to enable debugging options (debug builds only)
-
-REMARKS:
-This function allows the application to enable logging and debug flags
-on a function call basis, so we can specifically enable logging only
-for specific functions that are causing problems in debug mode.
-****************************************************************************/
-void PMAPI BE_setDebugFlags(
-    u32 debugFlags)
-{
-    M.x86.debug = debugFlags;
-}
-
-/****************************************************************************
-PARAMETERS:
-info        - Pointer to VGA device information to make current
-
-REMARKS:
-This function sets the VGA BIOS functions in the emulator to point to the
-specific VGA BIOS in use. This includes swapping the BIOS interrupt
-vectors, BIOS image and BIOS data area to the new BIOS. This allows the
-real mode BIOS to be swapped without resetting the entire emulator.
-****************************************************************************/
-void PMAPI BE_setVGA(
-    BE_VGAInfo *info)
-{
-    _BE_env.vgaInfo.pciInfo = info->pciInfo;
-    _BE_env.vgaInfo.BIOSImage = info->BIOSImage;
-    if (info->BIOSImage) {
-       _BE_env.biosmem_base = (ulong)info->BIOSImage;
-       _BE_env.biosmem_limit = 0xC0000 + info->BIOSImageLen-1;
-       }
-    else {
-       _BE_env.biosmem_base = _BE_env.busmem_base + 0x20000;
-       _BE_env.biosmem_limit = 0xC7FFF;
-       }
-    if (*((u32*)info->LowMem) == 0)
-       _BE_bios_init((u32*)info->LowMem);
-    memcpy((u8*)M.mem_base,info->LowMem,sizeof(info->LowMem));
-}
-
-/****************************************************************************
-PARAMETERS:
-info        - Pointer to VGA device information to retrieve current
-
-REMARKS:
-This function returns the VGA BIOS functions currently active in the
-emulator, so they can be restored at a later date.
-****************************************************************************/
-void PMAPI BE_getVGA(
-    BE_VGAInfo *info)
-{
-    info->pciInfo = _BE_env.vgaInfo.pciInfo;
-    info->BIOSImage = _BE_env.vgaInfo.BIOSImage;
-    memcpy(info->LowMem,(u8*)M.mem_base,sizeof(info->LowMem));
-}
-
-/****************************************************************************
-PARAMETERS:
-r_seg   - Segment for pointer to convert
-r_off   - Offset for pointer to convert
-
-REMARKS:
-This function maps a real mode pointer in the emulator memory to a protected
-mode pointer that can be used to directly access the memory.
-
-NOTE:   The memory is *always* in little endian format, son on non-x86
-       systems you will need to do endian translations to access this
-       memory.
-****************************************************************************/
-void * PMAPI BE_mapRealPointer(
-    uint r_seg,
-    uint r_off)
-{
-    u32 addr = ((u32)r_seg << 4) + r_off;
-
-    if (addr >= 0xC0000 && addr <= _BE_env.biosmem_limit) {
-       return (void*)(_BE_env.biosmem_base + addr - 0xC0000);
-       }
-    else if (addr >= 0xA0000 && addr <= 0xFFFFF) {
-       return (void*)(_BE_env.busmem_base + addr - 0xA0000);
-       }
-    return (void*)(M.mem_base + addr);
-}
-
-/****************************************************************************
-PARAMETERS:
-len     - Return the length of the VESA buffer
-rseg    - Place to store VESA buffer segment
-roff    - Place to store VESA buffer offset
-
-REMARKS:
-This function returns the address of the VESA transfer buffer in real
-mode emulator memory. The VESA transfer buffer is always 1024 bytes long,
-and located at 15Kb into the start of the real mode memory (16Kb is where
-we put the real mode code we execute for issuing interrupts).
-
-NOTE:   The memory is *always* in little endian format, son on non-x86
-       systems you will need to do endian translations to access this
-       memory.
-****************************************************************************/
-void * PMAPI BE_getVESABuf(
-    uint *len,
-    uint *rseg,
-    uint *roff)
-{
-    *len = 1024;
-    *rseg = SEG(0x03C00);
-    *roff = OFF(0x03C00);
-    return (void*)(M.mem_base + ((u32)*rseg << 4) + *roff);
-}
-
-/****************************************************************************
-REMARKS:
-Cleans up and exits the emulator.
-****************************************************************************/
-void PMAPI BE_exit(void)
-{
-    free((void*)M.mem_base);
-    PM_freePhysicalAddr((void*)_BE_env.busmem_base,0x5FFFF);
-}
-
-/****************************************************************************
-PARAMETERS:
-seg     - Segment of code to call
-off     - Offset of code to call
-regs    - Real mode registers to load
-sregs   - Real mode segment registers to load
-
-REMARKS:
-This functions calls a real mode far function at the specified address,
-and loads all the x86 registers from the passed in registers structure.
-On exit the registers returned from the call are returned in the same
-structures.
-****************************************************************************/
-void PMAPI BE_callRealMode(
-    uint seg,
-    uint off,
-    RMREGS *regs,
-    RMSREGS *sregs)
-{
-    M.x86.R_EAX = regs->e.eax;
-    M.x86.R_EBX = regs->e.ebx;
-    M.x86.R_ECX = regs->e.ecx;
-    M.x86.R_EDX = regs->e.edx;
-    M.x86.R_ESI = regs->e.esi;
-    M.x86.R_EDI = regs->e.edi;
-    M.x86.R_DS = sregs->ds;
-    M.x86.R_ES = sregs->es;
-    M.x86.R_FS = sregs->fs;
-    M.x86.R_GS = sregs->gs;
-    M.x86.R_CS = (u16)seg;
-    M.x86.R_IP = (u16)off;
-    M.x86.R_SS = SEG(M.mem_size - 1);
-    M.x86.R_SP = OFF(M.mem_size - 1);
-    X86EMU_exec();
-    regs->e.cflag = M.x86.R_EFLG & F_CF;
-    regs->e.eax = M.x86.R_EAX;
-    regs->e.ebx = M.x86.R_EBX;
-    regs->e.ecx = M.x86.R_ECX;
-    regs->e.edx = M.x86.R_EDX;
-    regs->e.esi = M.x86.R_ESI;
-    regs->e.edi = M.x86.R_EDI;
-    sregs->ds = M.x86.R_DS;
-    sregs->es = M.x86.R_ES;
-    sregs->fs = M.x86.R_FS;
-    sregs->gs = M.x86.R_GS;
-}
-
-/****************************************************************************
-PARAMETERS:
-intno   - Interrupt number to execute
-in      - Real mode registers to load
-out     - Place to store resulting real mode registers
-
-REMARKS:
-This functions calls a real mode interrupt function at the specified address,
-and loads all the x86 registers from the passed in registers structure.
-On exit the registers returned from the call are returned in out stucture.
-****************************************************************************/
-int PMAPI BE_int86(
-    int intno,
-    RMREGS *in,
-    RMREGS *out)
-{
-    M.x86.R_EAX = in->e.eax;
-    M.x86.R_EBX = in->e.ebx;
-    M.x86.R_ECX = in->e.ecx;
-    M.x86.R_EDX = in->e.edx;
-    M.x86.R_ESI = in->e.esi;
-    M.x86.R_EDI = in->e.edi;
-    ((u8*)M.mem_base)[0x4000] = 0xCD;
-    ((u8*)M.mem_base)[0x4001] = (u8)intno;
-    ((u8*)M.mem_base)[0x4002] = 0xC3;
-    M.x86.R_CS = SEG(0x04000);
-    M.x86.R_IP = OFF(0x04000);
-    M.x86.R_SS = SEG(M.mem_size - 1);
-    M.x86.R_SP = OFF(M.mem_size - 1);
-    X86EMU_exec();
-    out->e.cflag = M.x86.R_EFLG & F_CF;
-    out->e.eax = M.x86.R_EAX;
-    out->e.ebx = M.x86.R_EBX;
-    out->e.ecx = M.x86.R_ECX;
-    out->e.edx = M.x86.R_EDX;
-    out->e.esi = M.x86.R_ESI;
-    out->e.edi = M.x86.R_EDI;
-    return out->x.ax;
-}
-
-/****************************************************************************
-PARAMETERS:
-intno   - Interrupt number to execute
-in      - Real mode registers to load
-out     - Place to store resulting real mode registers
-sregs   - Real mode segment registers to load
-
-REMARKS:
-This functions calls a real mode interrupt function at the specified address,
-and loads all the x86 registers from the passed in registers structure.
-On exit the registers returned from the call are returned in out stucture.
-****************************************************************************/
-int PMAPI BE_int86x(
-    int intno,
-    RMREGS *in,
-    RMREGS *out,
-    RMSREGS *sregs)
-{
-    M.x86.R_EAX = in->e.eax;
-    M.x86.R_EBX = in->e.ebx;
-    M.x86.R_ECX = in->e.ecx;
-    M.x86.R_EDX = in->e.edx;
-    M.x86.R_ESI = in->e.esi;
-    M.x86.R_EDI = in->e.edi;
-    M.x86.R_DS = sregs->ds;
-    M.x86.R_ES = sregs->es;
-    M.x86.R_FS = sregs->fs;
-    M.x86.R_GS = sregs->gs;
-    ((u8*)M.mem_base)[0x4000] = 0xCD;
-    ((u8*)M.mem_base)[0x4001] = (u8)intno;
-    ((u8*)M.mem_base)[0x4002] = 0xC3;
-    M.x86.R_CS = SEG(0x04000);
-    M.x86.R_IP = OFF(0x04000);
-    M.x86.R_SS = SEG(M.mem_size - 1);
-    M.x86.R_SP = OFF(M.mem_size - 1);
-    X86EMU_exec();
-    out->e.cflag = M.x86.R_EFLG & F_CF;
-    out->e.eax = M.x86.R_EAX;
-    out->e.ebx = M.x86.R_EBX;
-    out->e.ecx = M.x86.R_ECX;
-    out->e.edx = M.x86.R_EDX;
-    out->e.esi = M.x86.R_ESI;
-    out->e.edi = M.x86.R_EDI;
-    sregs->ds = M.x86.R_DS;
-    sregs->es = M.x86.R_ES;
-    sregs->fs = M.x86.R_FS;
-    sregs->gs = M.x86.R_GS;
-    return out->x.ax;
-}
-
-#ifdef  __DRIVER__
-
-/****************************************************************************
-REMARKS:
-Empty log function for binary portable DLL. The BPD is compiled without
-debug information, so very little is logged anyway so it is simpler this
-way.
-****************************************************************************/
-void printk(const char *msg, ...)
-{
-}
-
-/****************************************************************************
-REMARKS:
-Fatal error handler called when a non-imported function is called by the
-driver. We leave this to a runtime error so that older applications and
-shell drivers will work with newer bpd drivers provided no newer functions
-are required by the driver itself. If they are, the application or shell
-driver needs to be recompiled.
-****************************************************************************/
-static void _PM_fatalErrorHandler(void)
-{
-    PM_fatalError("Unsupported PM_imports import function called! Please re-compile!\n");
-}
-
-/****************************************************************************
-PARAMETERS:
-beImp   - BE library imports
-beImp   - Generic emulator imports
-
-RETURNS:
-Pointer to exported function list
-
-REMARKS:
-This function initialises the BIOS emulator library and returns the list of
-loader library exported functions.
-{secret}
-****************************************************************************/
-BE_exports * _CEXPORT BE_initLibrary(
-    PM_imports *pmImp)
-{
-    static BE_exports _BE_exports = {
-       sizeof(BE_exports),
-       BE_init,
-       BE_setVGA,
-       BE_getVGA,
-       BE_mapRealPointer,
-       BE_getVESABuf,
-       BE_callRealMode,
-       BE_int86,
-       BE_int86x,
-       NULL,
-       BE_exit,
-       };
-    int     i,max;
-    ulong   *p;
-
-    /* Initialize all default imports to point to fatal error handler */
-    /* for upwards compatibility. */
-    max = sizeof(_PM_imports)/sizeof(BE_initLibrary_t);
-    for (i = 0,p = (ulong*)&_PM_imports; i < max; i++)
-       *p++ = (ulong)_PM_fatalErrorHandler;
-
-    /* Now copy all our imported functions */
-    memcpy(&_PM_imports,pmImp,MIN(sizeof(_PM_imports),pmImp->dwSize));
-    return &_BE_exports;
-}
-
-#endif  /* __DRIVER__ */
diff --git a/board/MAI/bios_emulator/scitech/src/biosemu/biosemui.h b/board/MAI/bios_emulator/scitech/src/biosemu/biosemui.h
deleted file mode 100644 (file)
index 23edebc..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/****************************************************************************
-*
-*                        BIOS emulator and interface
-*                      to Realmode X86 Emulator Library
-*
-*               Copyright (C) 1996-1999 SciTech Software, Inc.
-*
-*  ========================================================================
-*
-*  Permission to use, copy, modify, distribute, and sell this software and
-*  its documentation for any purpose is hereby granted without fee,
-*  provided that the above copyright notice appear in all copies and that
-*  both that copyright notice and this permission notice appear in
-*  supporting documentation, and that the name of the authors not be used
-*  in advertising or publicity pertaining to distribution of the software
-*  without specific, written prior permission.  The authors makes no
-*  representations about the suitability of this software for any purpose.
-*  It is provided "as is" without express or implied warranty.
-*
-*  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-*  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-*  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-*  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-*  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-*  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-*  PERFORMANCE OF THIS SOFTWARE.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Any
-* Developer:    Kendall Bennett
-*
-* Description:  Internal header file for the BIOS emulator library.
-*
-****************************************************************************/
-
-#ifndef __BIOSEMUI_H
-#define __BIOSEMUI_H
-
-#include <biosemu.h>
-
-/*---------------------- Macros and type definitions ----------------------*/
-
-#ifdef DEBUG
-#define DB(x)   x
-#else
-#define DB(x)
-#endif
-
-#define BIOS_SEG        0xfff0
-
-#define M               _X86EMU_env
-
-/*-------------------------- Function Prototypes --------------------------*/
-
-/* bios.c */
-
-void    _BE_bios_init(u32 *intrTab);
-void    _BE_setup_funcs(void);
-
-/* besys.c */
-
-u8      X86API BE_rdb(u32 addr);
-u16     X86API BE_rdw(u32 addr);
-u32     X86API BE_rdl(u32 addr);
-void    X86API BE_wrb(u32 addr,u8 val);
-void    X86API BE_wrw(u32 addr,u16 val);
-void    X86API BE_wrl(u32 addr,u32 val);
-#ifdef  DEBUG
-u8      X86API BE_inb(int port);
-u16     X86API BE_inw(int port);
-u32     X86API BE_inl(int port);
-void    X86API BE_outb(int port, u8 val);
-void    X86API BE_outw(int port, u16 val);
-void    X86API BE_outl(int port, u32 val);
-#endif
-
-#endif /* __BIOSEMUI_H */
diff --git a/board/MAI/bios_emulator/scitech/src/biosemu/makefile b/board/MAI/bios_emulator/scitech/src/biosemu/makefile
deleted file mode 100644 (file)
index 80730b2..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-#############################################################################
-#
-#                        BIOS emulator and interface
-#                      to Realmode X86 Emulator Library
-#
-#               Copyright (C) 1996-1999 SciTech Software, Inc.
-#
-#  ========================================================================
-#
-#  Permission to use, copy, modify, distribute, and sell this software and
-#  its documentation for any purpose is hereby granted without fee,
-#  provided that the above copyright notice appear in all copies and that
-#  both that copyright notice and this permission notice appear in
-#  supporting documentation, and that the name of the authors not be used
-#  in advertising or publicity pertaining to distribution of the software
-#  without specific, written prior permission.  The authors makes no
-#  representations about the suitability of this software for any purpose.
-#  It is provided "as is" without express or implied warranty.
-#
-#  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-#  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-#  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-#  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-#  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-#  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-#  PERFORMANCE OF THIS SOFTWARE.
-#
-#  ========================================================================
-#
-# Descripton:   Generic makefile for the x86emu library. Requires
-#               the SciTech Software makefile definitions package to be
-#               installed, which uses the DMAKE make program.
-#
-#############################################################################
-
-.IMPORT .IGNORE: DEBUG
-
-#----------------------------------------------------------------------------
-# Define the lists of object files
-#----------------------------------------------------------------------------
-
-DLL_OBJS        = dllstart$O _pm_imp$O
-BIOS_OBJS       = biosemu$O bios$O besys$O
-X86_OBJS        = sys$O decode$O ops$O ops2$O prim_ops$O fpu$O debug$O
-CFLAGS          += -DSCITECH -I$(SCITECH)\src\x86emu
-
-.IF $(BUILD_DLL)
-
-CFLAGS          += -I$(PRIVATE)\include\drvlib -I$(SCITECH)\include\drvlib -D__DRIVER__
-ASFLAGS         += -d__DRIVER__
-EXELIBS         = drvlib$L
-
-.ELSE
-
-.IF $(DEBUG)
-CFLAGS          += -DDEBUG
-.ENDIF
-OBJECTS         = $(BIOS_OBJS) $(X86_OBJS)
-LIBCLEAN        = *.dll *.lib *.a
-LIBFILE         = $(LP)biosemu$L
-
-.ENDIF
-
-#----------------------------------------------------------------------------
-# Sample test programs
-#----------------------------------------------------------------------------
-
-all: $(LIBFILE) warmboot$E
-
-warmboot$E: warmboot$O $(LIBFILE)
-
-#----------------------------------------------------------------------------
-# Target to build the Binary Portable DLL target
-#----------------------------------------------------------------------------
-
-biosemu.dll: $(DLL_OBJS) $(BIOS_OBJS) $(X86_OBJS)
-
-#----------------------------------------------------------------------------
-# Target to build all Intel binary drivers
-#----------------------------------------------------------------------------
-
-.PHONY mkdrv:
-    @build wc11-w32 biosemu.dll -u BUILD_DLL=1 NO_RUNTIME=1 OPT=1
-    @$(CP) biosemu.dll $(PRIVATE)\nucleus\graphics\biosemu.bpd
-    @dmake cleanexe
-
-.PHONY db:
-    @build wc11-w32 biosemu.dll BUILD_DLL=1 NO_RUNTIME=1 OPT=1
-    @$(CP) biosemu.dll $(PRIVATE)\nucleus\graphics\biosemu.bpd
-
-#----------------------------------------------------------------------------
-# Define the list of object files to create dependency information for
-#----------------------------------------------------------------------------
-
-DEPEND_OBJ      = warmboot$O $(BIOS_OBJS) $(X86_OBJS) $(DLL_OBJS)
-DEPEND_SRC      = $(SCITECH)/src/x86emu;$(PRIVATE)/src/common
-.SOURCE:          $(SCITECH)/src/x86emu $(PRIVATE)/src/common
-
-.INCLUDE: "$(SCITECH)/makedefs/common.mk"
diff --git a/board/MAI/bios_emulator/scitech/src/biosemu/makefile.cross b/board/MAI/bios_emulator/scitech/src/biosemu/makefile.cross
deleted file mode 100644 (file)
index 9141003..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-CC = ppc-elf32-gcc
-AR = ppc-elf32-ar
-
-CFLAGS = -D__DRIVER__ -I../../include -DDEBUG -I.
-
-BIOS_OBJS = biosemu.o bios.o besys.o
-X86_OBJS = sys.o decode.o ops.o prim_ops.o fpu.o debug.o
-
-libbios.a: $(BIOS_OBJS)
-       $(AR) rcs libbios.a $(BIOS_OBJS)
\ No newline at end of file
diff --git a/board/MAI/bios_emulator/scitech/src/biosemu/warmboot.c b/board/MAI/bios_emulator/scitech/src/biosemu/warmboot.c
deleted file mode 100644 (file)
index 98d5fb8..0000000
+++ /dev/null
@@ -1,569 +0,0 @@
-/****************************************************************************
-*
-*                        BIOS emulator and interface
-*                      to Realmode X86 Emulator Library
-*
-*               Copyright (C) 1996-1999 SciTech Software, Inc.
-*
-*  ========================================================================
-*
-*  Permission to use, copy, modify, distribute, and sell this software and
-*  its documentation for any purpose is hereby granted without fee,
-*  provided that the above copyright notice appear in all copies and that
-*  both that copyright notice and this permission notice appear in
-*  supporting documentation, and that the name of the authors not be used
-*  in advertising or publicity pertaining to distribution of the software
-*  without specific, written prior permission.  The authors makes no
-*  representations about the suitability of this software for any purpose.
-*  It is provided "as is" without express or implied warranty.
-*
-*  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-*  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-*  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-*  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-*  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-*  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-*  PERFORMANCE OF THIS SOFTWARE.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Any
-* Developer:    Kendall Bennett
-*
-* Description:  Module to implement warm booting of all PCI/AGP controllers
-*               on the bus. We use the x86 real mode emulator to run the
-*               BIOS on the primary and secondary controllers to bring
-*               the cards up.
-*
-****************************************************************************/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdarg.h>
-#include "biosemu.h"
-#ifndef _MAX_PATH
-#define _MAX_PATH 256
-#endif
-
-/*------------------------- Global Variables ------------------------------*/
-
-static PCIDeviceInfo    PCI[MAX_PCI_DEVICES];
-static int              NumPCI = -1;
-static int              BridgeIndex[MAX_PCI_DEVICES] = {0};
-static int              NumBridges;
-static PCIBridgeInfo    *AGPBridge = NULL;
-static int              DeviceIndex[MAX_PCI_DEVICES] = {0};
-static int              NumDevices;
-static u32              debugFlags = 0;
-static BE_VGAInfo       VGAInfo[MAX_PCI_DEVICES] = {{0}};
-static ibool            useV86 = false;
-static ibool            forcePost = false;
-
-/* Length of the BIOS image */
-
-#define MAX_BIOSLEN         (64 * 1024L)
-#define FINAL_BIOSLEN       (32 * 1024L)
-
-/* Macro to determine if the VGA is enabled and responding */
-
-#define VGA_NOT_ACTIVE()    (forcePost || (PM_inpb(0x3CC) == 0xFF) || ((PM_inpb(0x3CC) & 0x2) == 0))
-
-#define ENABLE_DEVICE(device)   \
-    PCI_writePCIRegB(0x4,PCI[DeviceIndex[device]].Command | 0x7,device)
-
-#define DISABLE_DEVICE(device)  \
-    PCI_writePCIRegB(0x4,0,device)
-
-/* Macros to enable and disable AGP VGA resources */
-
-#define ENABLE_AGP_VGA()    \
-    PCI_accessReg(0x3E,AGPBridge->BridgeControl | 0x8,PCI_WRITE_WORD,(PCIDeviceInfo*)AGPBridge)
-
-#define DISABLE_AGP_VGA()   \
-    PCI_accessReg(0x3E,AGPBridge->BridgeControl & ~0x8,PCI_WRITE_WORD,(PCIDeviceInfo*)AGPBridge)
-
-#define RESTORE_AGP_VGA()   \
-    PCI_accessReg(0x3E,AGPBridge->BridgeControl,PCI_WRITE_WORD,(PCIDeviceInfo*)AGPBridge)
-
-/*-------------------------- Implementation -------------------------------*/
-
-/****************************************************************************
-RETURNS:
-The address to use to map the secondary BIOS (PCI/AGP devices)
-
-REMARKS:
-Searches all the PCI base address registers for the device looking for a
-memory mapping that is large enough to hold our ROM BIOS. We usually end up
-finding the framebuffer mapping (usually BAR 0x10), and we use this mapping
-to map the BIOS for the device into. We use a mapping that is already
-assigned to the device to ensure the memory range will be passed through
-by any PCI->PCI or AGP->PCI bridge that may be present.
-
-NOTE: Usually this function is only used for AGP devices, but it may be
-      used for PCI devices that have already been POST'ed and the BIOS
-      ROM base address has been zero'ed out.
-****************************************************************************/
-static ulong PCI_findBIOSAddr(
-    int device)
-{
-    ulong   base,size;
-    int     bar;
-
-    for (bar = 0x10; bar <= 0x14; bar++) {
-       base = PCI_readPCIRegL(bar,device) & ~0xFF;
-       if (!(base & 0x1)) {
-           PCI_writePCIRegL(bar,0xFFFFFFFF,device);
-           size = PCI_readPCIRegL(bar,device) & ~0xFF;
-           size = ~size+1;
-           PCI_writePCIRegL(bar,0,device);
-           if (size >= MAX_BIOSLEN)
-               return base;
-           }
-       }
-    return 0;
-}
-
-/****************************************************************************
-REMARKS:
-Re-writes the PCI base address registers for the secondary PCI controller
-with the values from our initial PCI bus enumeration. This fixes up the
-values after we have POST'ed the secondary display controller BIOS, which
-may have incorrectly re-programmed the base registers the same as the
-primary display controller (the case for identical S3 cards).
-****************************************************************************/
-static void _PCI_fixupSecondaryBARs(void)
-{
-    int i;
-
-    for (i = 0; i < NumDevices; i++) {
-       PCI_writePCIRegL(0x10,PCI[DeviceIndex[i]].BaseAddress10,i);
-       PCI_writePCIRegL(0x14,PCI[DeviceIndex[i]].BaseAddress14,i);
-       PCI_writePCIRegL(0x18,PCI[DeviceIndex[i]].BaseAddress18,i);
-       PCI_writePCIRegL(0x1C,PCI[DeviceIndex[i]].BaseAddress1C,i);
-       PCI_writePCIRegL(0x20,PCI[DeviceIndex[i]].BaseAddress20,i);
-       PCI_writePCIRegL(0x24,PCI[DeviceIndex[i]].BaseAddress24,i);
-       }
-}
-
-/****************************************************************************
-RETURNS:
-True if successfully initialised, false if not.
-
-REMARKS:
-This function executes the BIOS POST code on the controller. We assume that
-at this stage the controller has its I/O and memory space enabled and
-that all other controllers are in a disabled state.
-****************************************************************************/
-static void PCI_doBIOSPOST(
-    int device,
-    ulong BIOSPhysAddr,
-    void *mappedBIOS,
-    ulong BIOSLen)
-{
-    RMREGS          regs;
-    RMSREGS         sregs;
-
-    /* Determine the value to store in AX for BIOS POST */
-    regs.x.ax = (u16)(PCI[DeviceIndex[device]].slot.i >> 8);
-    if (useV86) {
-       /* Post the BIOS using the PM functions (ie: v86 mode on Linux) */
-       if (!PM_doBIOSPOST(regs.x.ax,BIOSPhysAddr,mappedBIOS,BIOSLen)) {
-           /* If the PM function fails, this probably means are we are on */
-           /* DOS and can't re-map the real mode 0xC0000 region. In thise */
-           /* case if the device is the primary, we can use the real */
-           /* BIOS at 0xC0000 directly. */
-           if (device == 0)
-               PM_doBIOSPOST(regs.x.ax,0xC0000,mappedBIOS,BIOSLen);
-           }
-       }
-    else {
-       /* Setup the X86 emulator for the VGA BIOS */
-       BE_setVGA(&VGAInfo[device]);
-
-       /* Execute the BIOS POST code */
-       BE_callRealMode(0xC000,0x0003,&regs,&sregs);
-
-       /* Cleanup and exit */
-       BE_getVGA(&VGAInfo[device]);
-       }
-}
-
-/****************************************************************************
-RETURNS:
-True if successfully initialised, false if not.
-
-REMARKS:
-Loads and POST's the secondary controllers BIOS, directly from the BIOS
-image we can extract over the PCI bus.
-****************************************************************************/
-static ibool PCI_postControllers(void)
-{
-    int     device;
-    ulong   BIOSImageLen,mappedBIOSPhys;
-    uchar   *mappedBIOS,*copyOfBIOS;
-    char    filename[_MAX_PATH];
-    FILE    *f;
-
-    /* Disable the primary display controller and AGP VGA pass-through */
-    DISABLE_DEVICE(0);
-    if (AGPBridge)
-       DISABLE_AGP_VGA();
-
-    /* Now POST all the secondary controllers */
-    for (device = 0; device < NumDevices; device++) {
-       /* Skip the device if it is not enabled (probably an ISA device) */
-       if (DeviceIndex[device] == -1)
-           continue;
-
-       /* Enable secondary display controller. If the secondary controller */
-       /* is on the AGP bus, then enable VGA resources for the AGP device. */
-       ENABLE_DEVICE(device);
-       if (AGPBridge && AGPBridge->SecondayBusNumber == PCI[DeviceIndex[device]].slot.p.Bus)
-           ENABLE_AGP_VGA();
-
-       /* Check if the controller has already been POST'ed */
-       if (VGA_NOT_ACTIVE()) {
-           /* Find a viable place to map the secondary PCI BIOS image and map it */
-           printk("Device %d not enabled, so attempting warm boot it\n", device);
-
-           /* For AGP devices (and PCI devices that do have the ROM base */
-           /* address zero'ed out) we have to map the BIOS to a location */
-           /* that is passed by the AGP bridge to the bus. Some AGP devices */
-           /* have the ROM base address already set up for us, and some */
-           /* do not (we map to one of the existing BAR locations in */
-           /* this case). */
-           mappedBIOS = NULL;
-           if (PCI[DeviceIndex[device]].ROMBaseAddress != 0)
-               mappedBIOSPhys = PCI[DeviceIndex[device]].ROMBaseAddress & ~0xF;
-           else
-               mappedBIOSPhys = PCI_findBIOSAddr(device);
-           printk("Mapping BIOS image to 0x%08X\n", mappedBIOSPhys);
-           mappedBIOS = PM_mapPhysicalAddr(mappedBIOSPhys,MAX_BIOSLEN-1,false);
-           PCI_writePCIRegL(0x30,mappedBIOSPhys | 0x1,device);
-           BIOSImageLen = mappedBIOS[2] * 512;
-           if ((copyOfBIOS = malloc(BIOSImageLen)) == NULL)
-               return false;
-           memcpy(copyOfBIOS,mappedBIOS,BIOSImageLen);
-           PM_freePhysicalAddr(mappedBIOS,MAX_BIOSLEN-1);
-
-           /* Allocate memory to store copy of BIOS from secondary controllers */
-           VGAInfo[device].pciInfo = &PCI[DeviceIndex[device]];
-           VGAInfo[device].BIOSImage = copyOfBIOS;
-           VGAInfo[device].BIOSImageLen = BIOSImageLen;
-
-           /* Restore device mappings */
-           PCI_writePCIRegL(0x30,PCI[DeviceIndex[device]].ROMBaseAddress,device);
-           PCI_writePCIRegL(0x10,PCI[DeviceIndex[device]].BaseAddress10,device);
-           PCI_writePCIRegL(0x14,PCI[DeviceIndex[device]].BaseAddress14,device);
-
-           /* Now execute the BIOS POST for the device */
-           if (copyOfBIOS[0] == 0x55 && copyOfBIOS[1] == 0xAA) {
-               printk("Executing BIOS POST for controller.\n");
-               PCI_doBIOSPOST(device,mappedBIOSPhys,copyOfBIOS,BIOSImageLen);
-               }
-
-           /* Reset the size of the BIOS image to the final size */
-           VGAInfo[device].BIOSImageLen = FINAL_BIOSLEN;
-
-           /* Save the BIOS and interrupt vector information to disk */
-           sprintf(filename,"%s/bios.%02d",PM_getNucleusConfigPath(),device);
-           if ((f = fopen(filename,"wb")) != NULL) {
-               fwrite(copyOfBIOS,1,FINAL_BIOSLEN,f);
-               fwrite(VGAInfo[device].LowMem,1,sizeof(VGAInfo[device].LowMem),f);
-               fclose(f);
-               }
-           }
-       else {
-           /* Allocate memory to store copy of BIOS from secondary controllers */
-           if ((copyOfBIOS = malloc(FINAL_BIOSLEN)) == NULL)
-               return false;
-           VGAInfo[device].pciInfo = &PCI[DeviceIndex[device]];
-           VGAInfo[device].BIOSImage = copyOfBIOS;
-           VGAInfo[device].BIOSImageLen = FINAL_BIOSLEN;
-
-           /* Load the BIOS and interrupt vector information from disk */
-           sprintf(filename,"%s/bios.%02d",PM_getNucleusConfigPath(),device);
-           if ((f = fopen(filename,"rb")) != NULL) {
-               fread(copyOfBIOS,1,FINAL_BIOSLEN,f);
-               fread(VGAInfo[device].LowMem,1,sizeof(VGAInfo[device].LowMem),f);
-               fclose(f);
-               }
-           }
-
-       /* Fix up all the secondary PCI base address registers */
-       /* (restores them all from the values we read previously) */
-       _PCI_fixupSecondaryBARs();
-
-       /* Disable the secondary controller and AGP VGA pass-through */
-       DISABLE_DEVICE(device);
-       if (AGPBridge)
-           DISABLE_AGP_VGA();
-       }
-
-    /* Reenable primary display controller and reset AGP bridge control */
-    if (AGPBridge)
-       RESTORE_AGP_VGA();
-    ENABLE_DEVICE(0);
-
-    /* Free physical BIOS image mapping */
-    PM_freePhysicalAddr(mappedBIOS,MAX_BIOSLEN-1);
-
-    /* Restore the X86 emulator BIOS info to primary controller */
-    if (!useV86)
-       BE_setVGA(&VGAInfo[0]);
-    return true;
-}
-
-/****************************************************************************
-REMARKS:
-Enumerates the PCI bus and dumps the PCI configuration information to the
-log file.
-****************************************************************************/
-static void EnumeratePCI(void)
-{
-    int             i,index;
-    PCIBridgeInfo   *info;
-
-    printk("Displaying enumeration of PCI bus (%d devices, %d display devices)\n",
-       NumPCI, NumDevices);
-    for (index = 0; index < NumDevices; index++)
-       printk("  Display device %d is PCI device %d\n",index,DeviceIndex[index]);
-    printk("\n");
-    printk("Bus Slot Fnc DeviceID  SubSystem Rev Class IRQ Int Cmd\n");
-    for (i = 0; i < NumPCI; i++) {
-       printk("%2d   %2d  %2d  %04X:%04X %04X:%04X %02X  %02X:%02X %02X  %02X  %04X   ",
-           PCI[i].slot.p.Bus,
-           PCI[i].slot.p.Device,
-           PCI[i].slot.p.Function,
-           PCI[i].VendorID,
-           PCI[i].DeviceID,
-           PCI[i].SubSystemVendorID,
-           PCI[i].SubSystemID,
-           PCI[i].RevID,
-           PCI[i].BaseClass,
-           PCI[i].SubClass,
-           PCI[i].InterruptLine,
-           PCI[i].InterruptPin,
-           PCI[i].Command);
-       for (index = 0; index < NumDevices; index++) {
-           if (DeviceIndex[index] == i)
-               break;
-           }
-       if (index < NumDevices)
-           printk("<- %d\n", index);
-       else
-           printk("\n");
-       }
-    printk("\n");
-    printk("DeviceID  Stat Ifc Cch Lat Hdr BIST\n");
-    for (i = 0; i < NumPCI; i++) {
-       printk("%04X:%04X %04X  %02X  %02X  %02X  %02X  %02X   ",
-           PCI[i].VendorID,
-           PCI[i].DeviceID,
-           PCI[i].Status,
-           PCI[i].Interface,
-           PCI[i].CacheLineSize,
-           PCI[i].LatencyTimer,
-           PCI[i].HeaderType,
-           PCI[i].BIST);
-       for (index = 0; index < NumDevices; index++) {
-           if (DeviceIndex[index] == i)
-               break;
-           }
-       if (index < NumDevices)
-           printk("<- %d\n", index);
-       else
-           printk("\n");
-       }
-    printk("\n");
-    printk("DeviceID  Base10h  Base14h  Base18h  Base1Ch  Base20h  Base24h  ROMBase\n");
-    for (i = 0; i < NumPCI; i++) {
-       printk("%04X:%04X %08X %08X %08X %08X %08X %08X %08X ",
-           PCI[i].VendorID,
-           PCI[i].DeviceID,
-           PCI[i].BaseAddress10,
-           PCI[i].BaseAddress14,
-           PCI[i].BaseAddress18,
-           PCI[i].BaseAddress1C,
-           PCI[i].BaseAddress20,
-           PCI[i].BaseAddress24,
-           PCI[i].ROMBaseAddress);
-       for (index = 0; index < NumDevices; index++) {
-           if (DeviceIndex[index] == i)
-               break;
-           }
-       if (index < NumDevices)
-           printk("<- %d\n", index);
-       else
-           printk("\n");
-       }
-    printk("\n");
-    printk("DeviceID  BAR10Len BAR14Len BAR18Len BAR1CLen BAR20Len BAR24Len ROMLen\n");
-    for (i = 0; i < NumPCI; i++) {
-       printk("%04X:%04X %08X %08X %08X %08X %08X %08X %08X ",
-           PCI[i].VendorID,
-           PCI[i].DeviceID,
-           PCI[i].BaseAddress10Len,
-           PCI[i].BaseAddress14Len,
-           PCI[i].BaseAddress18Len,
-           PCI[i].BaseAddress1CLen,
-           PCI[i].BaseAddress20Len,
-           PCI[i].BaseAddress24Len,
-           PCI[i].ROMBaseAddressLen);
-       for (index = 0; index < NumDevices; index++) {
-           if (DeviceIndex[index] == i)
-               break;
-           }
-       if (index < NumDevices)
-           printk("<- %d\n", index);
-       else
-           printk("\n");
-       }
-    printk("\n");
-    printk("Displaying enumeration of %d bridge devices\n",NumBridges);
-    printk("\n");
-    printk("DeviceID  P# S# B# IOB  IOL  MemBase  MemLimit PreBase  PreLimit Ctrl\n");
-    for (i = 0; i < NumBridges; i++) {
-       info = (PCIBridgeInfo*)&PCI[BridgeIndex[i]];
-       printk("%04X:%04X %02X %02X %02X %04X %04X %08X %08X %08X %08X %04X\n",
-           info->VendorID,
-           info->DeviceID,
-           info->PrimaryBusNumber,
-           info->SecondayBusNumber,
-           info->SubordinateBusNumber,
-           ((u16)info->IOBase << 8) & 0xF000,
-           info->IOLimit ?
-               ((u16)info->IOLimit << 8) | 0xFFF : 0,
-           ((u32)info->MemoryBase << 16) & 0xFFF00000,
-           info->MemoryLimit ?
-               ((u32)info->MemoryLimit << 16) | 0xFFFFF : 0,
-           ((u32)info->PrefetchableMemoryBase << 16) & 0xFFF00000,
-           info->PrefetchableMemoryLimit ?
-               ((u32)info->PrefetchableMemoryLimit << 16) | 0xFFFFF : 0,
-           info->BridgeControl);
-       }
-    printk("\n");
-}
-
-/****************************************************************************
-RETURNS:
-Number of display devices found.
-
-REMARKS:
-This function enumerates the number of available display devices on the
-PCI bus, and returns the number found.
-****************************************************************************/
-static int PCI_enumerateDevices(void)
-{
-    int             i,j;
-    PCIBridgeInfo   *info;
-
-    /* If this is the first time we have been called, enumerate all */
-    /* devices on the PCI bus. */
-    if (NumPCI == -1) {
-       for (i = 0; i < MAX_PCI_DEVICES; i++)
-           PCI[i].dwSize = sizeof(PCI[i]);
-       if ((NumPCI = PCI_enumerate(PCI,MAX_PCI_DEVICES)) == 0)
-           return -1;
-
-       /* Build a list of all PCI bridge devices */
-       for (i = 0,NumBridges = 0,BridgeIndex[0] = -1; i < NumPCI; i++) {
-           if (PCI[i].BaseClass == PCI_BRIDGE_CLASS) {
-               if (NumBridges < MAX_PCI_DEVICES)
-                   BridgeIndex[NumBridges++] = i;
-               }
-           }
-
-       /* Now build a list of all display class devices */
-       for (i = 0,NumDevices = 1,DeviceIndex[0] = -1; i < NumPCI; i++) {
-           if (PCI_IS_DISPLAY_CLASS(&PCI[i])) {
-               if ((PCI[i].Command & 0x3) == 0x3) {
-                   DeviceIndex[0] = i;
-                   }
-               else {
-                   if (NumDevices < MAX_PCI_DEVICES)
-                       DeviceIndex[NumDevices++] = i;
-                   }
-               if (PCI[i].slot.p.Bus != 0) {
-                   /* This device is on a different bus than the primary */
-                   /* PCI bus, so it is probably an AGP device. Find the */
-                   /* AGP bus device that controls that bus so we can */
-                   /* control it. */
-                   for (j = 0; j < NumBridges; j++) {
-                       info = (PCIBridgeInfo*)&PCI[BridgeIndex[j]];
-                       if (info->SecondayBusNumber == PCI[i].slot.p.Bus) {
-                           AGPBridge = info;
-                           break;
-                           }
-                       }
-                   }
-               }
-           }
-
-       /* Enumerate all PCI and bridge devices to log file */
-       EnumeratePCI();
-       }
-    return NumDevices;
-}
-
-FILE *logfile;
-
-void printk(const char *fmt, ...)
-{
-    va_list argptr;
-    va_start(argptr, fmt);
-    vfprintf(logfile, fmt, argptr);
-    fflush(logfile);
-    va_end(argptr);
-}
-
-int main(int argc,char *argv[])
-{
-    while (argc > 1) {
-       if (stricmp(argv[1],"-usev86") == 0) {
-           useV86 = true;
-           }
-       else if (stricmp(argv[1],"-force") == 0) {
-           forcePost = true;
-           }
-#ifdef  DEBUG
-       else if (stricmp(argv[1],"-decode") == 0) {
-           debugFlags |= DEBUG_DECODE_F;
-           }
-       else if (stricmp(argv[1],"-iotrace") == 0) {
-           debugFlags |= DEBUG_IO_TRACE_F;
-           }
-#endif
-       else {
-           printf("Usage: warmboot [-usev86] [-force] [-decode] [-iotrace]\n");
-           exit(-1);
-           }
-       argc--;
-       argv++;
-       }
-    if ((logfile = fopen("warmboot.log","w")) == NULL)
-       exit(1);
-
-    PM_init();
-    if (!useV86) {
-       /* Initialise the x86 BIOS emulator */
-       BE_init(false,debugFlags,65536,&VGAInfo[0]);
-       }
-
-    /* Enumerate all devices (which POST's them at the same time) */
-    if (PCI_enumerateDevices() < 1) {
-       printk("No PCI display devices found!\n");
-       return -1;
-       }
-
-    /* Post all the display controller BIOS'es */
-    PCI_postControllers();
-
-    /* Cleanup and exit the emulator */
-    if (!useV86)
-       BE_exit();
-    fclose(logfile);
-    return 0;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/common/_aa_imp.asm b/board/MAI/bios_emulator/scitech/src/common/_aa_imp.asm
deleted file mode 100644 (file)
index 61a9024..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-;****************************************************************************
-;*
-;*                     SciTech Nucleus Audio Architecture
-;*
-;*               Copyright (C) 1991-1998 SciTech Software, Inc.
-;*                            All rights reserved.
-;*
-;*  ======================================================================
-;*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-;*  |                                                                    |
-;*  |This copyrighted computer code contains proprietary technology      |
-;*  |owned by SciTech Software, Inc., located at 505 Wall Street,        |
-;*  |Chico, CA 95928 USA (http://www.scitechsoft.com).                   |
-;*  |                                                                    |
-;*  |The contents of this file are subject to the SciTech Nucleus        |
-;*  |License; you may *not* use this file or related software except in  |
-;*  |compliance with the License. You may obtain a copy of the License   |
-;*  |at http://www.scitechsoft.com/nucleus-license.txt                   |
-;*  |                                                                    |
-;*  |Software distributed under the License is distributed on an         |
-;*  |"AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or      |
-;*  |implied. See the License for the specific language governing        |
-;*  |rights and limitations under the License.                           |
-;*  |                                                                    |
-;*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-;*  ======================================================================
-;*
-;* Language:    TASM 4.0 or NASM
-;* Environment: IBM PC 32 bit Protected Mode.
-;*
-;* Description: Module to implement the import stubs for all the Nucleus
-;*              Audio API functions for Intel binary compatible drivers.
-;*
-;****************************************************************************
-
-        IDEAL
-
-include "scitech.mac"           ; Memory model macros
-
-BEGIN_IMPORTS_DEF   _AA_exports
-SKIP_IMP    AA_status                     ; Implemented in C code
-SKIP_IMP    AA_errorMsg                   ; Implemented in C code
-SKIP_IMP    AA_getDaysLeft                ; Implemented in C code
-SKIP_IMP    AA_registerLicense            ; Implemented in C code
-SKIP_IMP    AA_enumerateDevices           ; Implemented in C code
-SKIP_IMP    AA_loadDriver                 ; Implemented in C code
-DECLARE_IMP AA_unloadDriver
-DECLARE_IMP AA_saveOptions
-END_IMPORTS_DEF
-
-        END
diff --git a/board/MAI/bios_emulator/scitech/src/common/_ga_imp.asm b/board/MAI/bios_emulator/scitech/src/common/_ga_imp.asm
deleted file mode 100644 (file)
index 5317600..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-;****************************************************************************
-;*
-;*                  SciTech Nucleus Graphics Architecture
-;*
-;*               Copyright (C) 1991-1998 SciTech Software, Inc.
-;*                            All rights reserved.
-;*
-;*  ======================================================================
-;*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-;*  |                                                                    |
-;*  |This copyrighted computer code contains proprietary technology      |
-;*  |owned by SciTech Software, Inc., located at 505 Wall Street,        |
-;*  |Chico, CA 95928 USA (http://www.scitechsoft.com).                   |
-;*  |                                                                    |
-;*  |The contents of this file are subject to the SciTech Nucleus        |
-;*  |License; you may *not* use this file or related software except in  |
-;*  |compliance with the License. You may obtain a copy of the License   |
-;*  |at http://www.scitechsoft.com/nucleus-license.txt                   |
-;*  |                                                                    |
-;*  |Software distributed under the License is distributed on an         |
-;*  |"AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or      |
-;*  |implied. See the License for the specific language governing        |
-;*  |rights and limitations under the License.                           |
-;*  |                                                                    |
-;*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-;*  ======================================================================
-;*
-;* Language:    TASM 4.0 or NASM
-;* Environment: IBM PC 32 bit Protected Mode.
-;*
-;* Description: Module to implement the import stubs for all the Nucleus
-;*              Graphics API functions for Intel binary compatible drivers.
-;*
-;****************************************************************************
-
-        IDEAL
-
-include "scitech.mac"           ; Memory model macros
-
-BEGIN_IMPORTS_DEF   __GA_exports
-SKIP_IMP    GA_status,0                     ; Implemented in C code
-SKIP_IMP    GA_errorMsg,1                   ; Implemented in C code
-SKIP_IMP    GA_getDaysLeft,1                ; Implemented in C code
-SKIP_IMP    GA_registerLicense,2            ; Implemented in C code
-SKIP_IMP    GA_enumerateDevices,1           ; Implemented in C code
-SKIP_IMP    GA_loadDriver,2                 ; Implemented in C code
-DECLARE_IMP GA_setActiveDevice,1
-SKIP_IMP    GA_reserved1,0                  ; Implemented in C code
-DECLARE_IMP GA_unloadDriver,1
-DECLARE_IMP REF2D_loadDriver,6
-DECLARE_IMP REF2D_unloadDriver,2
-DECLARE_IMP GA_loadRef2d,5
-DECLARE_IMP GA_unloadRef2d,1
-DECLARE_IMP GA_softStereoInit,1
-DECLARE_IMP GA_softStereoOn,0
-DECLARE_IMP GA_softStereoScheduleFlip,2
-DECLARE_IMP GA_softStereoGetFlipStatus,0
-DECLARE_IMP GA_softStereoWaitTillFlipped,0
-DECLARE_IMP GA_softStereoOff,0
-DECLARE_IMP GA_softStereoExit,0
-DECLARE_IMP GA_saveModeProfile,2
-DECLARE_IMP GA_saveOptions,2
-DECLARE_IMP GA_saveCRTCTimings,1
-DECLARE_IMP GA_restoreCRTCTimings,1
-DECLARE_IMP DDC_init,1
-DECLARE_IMP DDC_readEDID,5
-DECLARE_IMP EDID_parse,3
-DECLARE_IMP MCS_begin,1
-DECLARE_IMP MCS_getCapabilitiesString,2
-DECLARE_IMP MCS_isControlSupported,1
-DECLARE_IMP MCS_enableControl,2
-DECLARE_IMP MCS_getControlMax,2
-DECLARE_IMP MCS_getControlValue,2
-DECLARE_IMP MCS_getControlValues,3
-DECLARE_IMP MCS_setControlValue,2
-DECLARE_IMP MCS_setControlValues,3
-DECLARE_IMP MCS_resetControl,1
-DECLARE_IMP MCS_saveCurrentSettings,0
-DECLARE_IMP MCS_getTimingReport,3
-DECLARE_IMP MCS_getSelfTestReport,3
-DECLARE_IMP MCS_end,0
-SKIP_IMP    GA_loadInGUI,1                  ; Implemented in C code
-DECLARE_IMP DDC_writeEDID,6
-DECLARE_IMP GA_useDoubleScan,1
-DECLARE_IMP GA_getMaxRefreshRate,4
-DECLARE_IMP GA_computeCRTCTimings,6
-DECLARE_IMP GA_addMode,5
-DECLARE_IMP GA_addRefresh,5
-DECLARE_IMP GA_delMode,5
-DECLARE_IMP N_getLogName,0
-SKIP_IMP2   N_log
-DECLARE_IMP MDBX_getErrCode,0
-DECLARE_IMP MDBX_getErrorMsg,0
-DECLARE_IMP MDBX_open,1
-DECLARE_IMP MDBX_close,0
-DECLARE_IMP MDBX_first,1
-DECLARE_IMP MDBX_last,1
-DECLARE_IMP MDBX_next,1
-DECLARE_IMP MDBX_prev,1
-DECLARE_IMP MDBX_insert,1
-DECLARE_IMP MDBX_update,1
-DECLARE_IMP MDBX_flush,0
-DECLARE_IMP MDBX_importINF,2
-SKIP_IMP    GA_getGlobalOptions,2           ; Implemented in C code
-DECLARE_IMP GA_setGlobalOptions,1
-DECLARE_IMP GA_saveGlobalOptions,1
-DECLARE_IMP GA_getInternalName,1
-DECLARE_IMP GA_getNucleusConfigPath,0
-DECLARE_IMP GA_getFakePCIID,0
-SKIP_IMP    GA_loadLibrary,3                ; Implemented in C code
-SKIP_IMP    GA_isOEMVersion,1               ; Implemented in C code
-DECLARE_IMP GA_isLiteVersion,1
-DECLARE_IMP GA_getDisplaySerialNo,1
-DECLARE_IMP GA_getDisplayUserName,1
-SKIP_IMP    GA_getCurrentDriver,1           ; Implemented in C code
-SKIP_IMP    GA_getCurrentRef2d,1            ; Implemented in C code
-SKIP_IMP    GA_getLicensedDevices,1         ; Implemented in C code
-DECLARE_IMP DDC_initExt,2
-DECLARE_IMP MCS_beginExt,2
-DECLARE_IMP GA_loadRegionMgr,3
-DECLARE_IMP GA_unloadRegionMgr,1
-DECLARE_IMP GA_getProcAddress,2
-DECLARE_IMP GA_enableVBEMode,5
-DECLARE_IMP GA_disableVBEMode,5
-DECLARE_IMP GA_loadModeProfile,2
-DECLARE_IMP GA_getCRTCTimings,4
-DECLARE_IMP GA_setCRTCTimings,4
-DECLARE_IMP GA_setDefaultRefresh,6
-DECLARE_IMP GA_saveMonitorInfo,2
-DECLARE_IMP GA_detectPnPMonitor,3
-SKIP_IMP3   GA_queryFunctions
-SKIP_IMP3   REF2D_queryFunctions
-END_IMPORTS_DEF
-
-        END
-
diff --git a/board/MAI/bios_emulator/scitech/src/common/_gatimer.asm b/board/MAI/bios_emulator/scitech/src/common/_gatimer.asm
deleted file mode 100644 (file)
index 0194a62..0000000
+++ /dev/null
@@ -1,248 +0,0 @@
-;****************************************************************************
-;*
-;*                  SciTech Nucleus Graphics Architecture
-;*
-;*               Copyright (C) 1991-1998 SciTech Software, Inc.
-;*                            All rights reserved.
-;*
-;*  ======================================================================
-;*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-;*  |                                                                    |
-;*  |This copyrighted computer code contains proprietary technology      |
-;*  |owned by SciTech Software, Inc., located at 505 Wall Street,        |
-;*  |Chico, CA 95928 USA (http://www.scitechsoft.com).                   |
-;*  |                                                                    |
-;*  |The contents of this file are subject to the SciTech Nucleus        |
-;*  |License; you may *not* use this file or related software except in  |
-;*  |compliance with the License. You may obtain a copy of the License   |
-;*  |at http://www.scitechsoft.com/nucleus-license.txt                   |
-;*  |                                                                    |
-;*  |Software distributed under the License is distributed on an         |
-;*  |"AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or      |
-;*  |implied. See the License for the specific language governing        |
-;*  |rights and limitations under the License.                           |
-;*  |                                                                    |
-;*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-;*  ======================================================================
-;*
-;* Language:    80386 Assembler, NASM or TASM
-;* Environment: IBM PC 32 bit Protected Mode.
-;*
-;* Description: Assembly support functions for the Nucleus library for
-;*              the high resolution timing support functions provided by
-;*              the Intel Pentium and compatible processors.
-;*
-;****************************************************************************
-
-        IDEAL
-
-include "scitech.mac"           ; Memory model macros
-
-header  _gatimer
-
-begcodeseg  _gatimer
-
-ifdef   USE_NASM
-%macro mCPU_ID 0
-db  00Fh,0A2h
-%endmacro
-else
-MACRO   mCPU_ID
-db  00Fh,0A2h
-ENDM
-endif
-
-ifdef   USE_NASM
-%macro mRDTSC 0
-db  00Fh,031h
-%endmacro
-else
-MACRO   mRDTSC
-db  00Fh,031h
-ENDM
-endif
-
-;----------------------------------------------------------------------------
-; bool _GA_haveCPUID(void)
-;----------------------------------------------------------------------------
-; Determines if we have support for the CPUID instruction.
-;----------------------------------------------------------------------------
-cprocstart  _GA_haveCPUID
-
-        enter_c
-        pushfd                      ; Get original EFLAGS
-        pop     eax
-        mov     ecx, eax
-        xor     eax, 200000h        ; Flip ID bit in EFLAGS
-        push    eax                 ; Save new EFLAGS value on stack
-        popfd                       ; Replace current EFLAGS value
-        pushfd                      ; Get new EFLAGS
-        pop     eax                 ; Store new EFLAGS in EAX
-        xor     eax, ecx            ; Can not toggle ID bit,
-        jnz     @@1                 ; Processor=80486
-        mov     eax,0               ; We dont have CPUID support
-        jmp     @@Done
-@@1:    mov     eax,1               ; We have CPUID support
-@@Done: leave_c
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; uint _GA_getCPUIDFeatures(void)
-;----------------------------------------------------------------------------
-; Determines the CPU type using the CPUID instruction.
-;----------------------------------------------------------------------------
-cprocstart  _GA_getCPUIDFeatures
-
-        enter_c
-
-        xor     eax, eax            ; Set up for CPUID instruction
-        mCPU_ID                     ; Get and save vendor ID
-        cmp     eax, 1              ; Make sure 1 is valid input for CPUID
-        jl      @@Fail              ; We dont have the CPUID instruction
-        xor     eax, eax
-        inc     eax
-        mCPU_ID                     ; Get family/model/stepping/features
-        mov     eax, edx
-@@Done: leave_c
-        ret
-
-@@Fail: xor     eax,eax
-        jmp     @@Done
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void  _GA_readTimeStamp(GA_largeInteger *time)
-;----------------------------------------------------------------------------
-; Reads the time stamp counter and returns the 64-bit result.
-;----------------------------------------------------------------------------
-cprocstart  _GA_readTimeStamp
-
-        mRDTSC
-        mov     ecx,[esp+4]     ; Access directly without stack frame
-        mov     [ecx],eax
-        mov     [ecx+4],edx
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; N_uint32 GA_TimerDifference(GA_largeInteger *a,GA_largeInteger *b)
-;----------------------------------------------------------------------------
-; Computes the difference between two 64-bit numbers (a-b)
-;----------------------------------------------------------------------------
-cprocstart  GA_TimerDifference
-
-        ARG     a:DPTR, b:DPTR, t:DPTR
-
-        enter_c
-
-        mov     ecx,[a]
-        mov     eax,[ecx]       ; EAX := b.low
-        mov     ecx,[b]
-        sub     eax,[ecx]
-        mov     edx,eax         ; EDX := low difference
-        mov     ecx,[a]
-        mov     eax,[ecx+4]     ; ECX := b.high
-        mov     ecx,[b]
-        sbb     eax,[ecx+4]     ; EAX := high difference
-        mov     eax,edx         ; Return low part
-
-        leave_c
-        ret
-
-cprocend
-
-; Macro to delay briefly to ensure that enough time has elapsed between
-; successive I/O accesses so that the device being accessed can respond
-; to both accesses even on a very fast PC.
-
-ifdef   USE_NASM
-%macro  DELAY_TIMER 0
-        jmp     short $+2
-        jmp     short $+2
-        jmp     short $+2
-%endmacro
-else
-macro   DELAY_TIMER
-        jmp     short $+2
-        jmp     short $+2
-        jmp     short $+2
-endm
-endif
-
-;----------------------------------------------------------------------------
-; void _OS_delay8253(N_uint32 microSeconds);
-;----------------------------------------------------------------------------
-; Delays for the specified number of microseconds, by directly programming
-; the 8253 timer chips.
-;----------------------------------------------------------------------------
-cprocstart  _OS_delay8253
-
-        ARG     microSec:UINT
-
-        enter_c
-
-; Start timer 2 counting
-
-        mov     _ax,[microSec]      ; EAX := count in microseconds
-        mov     ecx,1196
-        mul     ecx
-        mov     ecx,1000
-        div     ecx
-        mov     ecx,eax             ; ECX := count in timer ticks
-        in      al,61h
-        or      al,1
-        out     61h,al
-
-; Set the timer 2 count to 0 again to start the timing interval.
-
-        mov     al,10110100b        ; set up to load initial (timer 2)
-        out     43h,al              ; timer count
-        DELAY_TIMER
-        sub     al,al
-        out     42h,al              ; load count lsb
-        DELAY_TIMER
-        out     42h,al              ; load count msb
-        xor     di,di               ; Allow max 64K loop iterations
-
-@@LoopStart:
-        dec     di                  ; This is a guard against the possibility that
-        jz      @@LoopEnd           ; someone eg. stopped the timer behind our back.
-                                    ; After 64K iterations we bail out no matter what
-                                    ; (and hope it wasn't too soon)
-        mov     al,00000000b        ; latch timer 0
-        out     43h,al
-        DELAY_TIMER
-        in      al,42h              ; least significant byte
-        DELAY_TIMER
-        mov     ah,al
-        in      al,42h              ; most significant byte
-        xchg    ah,al
-        neg     ax                  ; Convert from countdown remaining
-                                    ;  to elapsed count
-        cmp     ax,cx               ; Has delay expired?
-        jb      @@LoopStart         ; No, so loop till done
-
-; Stop timer 2 from counting
-@@LoopEnd:
-        in      al,61H
-        and     al,0FEh
-        out     61H,al
-
-; Some programs have a problem if we change the control port; better change it
-; to something they expect (mode 3 - square wave generator)...
-        mov     al,0B6h
-        out     43h,al
-
-        leave_c
-        ret
-
-cprocend
-
-endcodeseg  _gatimer
-
-        END
-
diff --git a/board/MAI/bios_emulator/scitech/src/common/_pm_imp.asm b/board/MAI/bios_emulator/scitech/src/common/_pm_imp.asm
deleted file mode 100644 (file)
index d4b1179..0000000
+++ /dev/null
@@ -1,195 +0,0 @@
-;****************************************************************************
-;*
-;*                  SciTech OS Portability Manager Library
-;*
-;*               Copyright (C) 1991-1998 SciTech Software, Inc.
-;*                            All rights reserved.
-;*
-;*  ======================================================================
-;*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-;*  |                                                                    |
-;*  |This copyrighted computer code contains proprietary technology      |
-;*  |owned by SciTech Software, Inc., located at 505 Wall Street,        |
-;*  |Chico, CA 95928 USA (http://www.scitechsoft.com).                   |
-;*  |                                                                    |
-;*  |The contents of this file are subject to the SciTech Nucleus        |
-;*  |License; you may *not* use this file or related software except in  |
-;*  |compliance with the License. You may obtain a copy of the License   |
-;*  |at http://www.scitechsoft.com/nucleus-license.txt                   |
-;*  |                                                                    |
-;*  |Software distributed under the License is distributed on an         |
-;*  |"AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or      |
-;*  |implied. See the License for the specific language governing        |
-;*  |rights and limitations under the License.                           |
-;*  |                                                                    |
-;*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-;*  ======================================================================
-;*
-;* Language:    TASM 4.0 or NASM
-;* Environment: IBM PC 32 bit Protected Mode.
-;*
-;* Description: Module to implement the import stubs for all the PM
-;*              API functions for Intel binary portable drivers.
-;*
-;****************************************************************************
-
-        IDEAL
-
-include "scitech.mac"           ; Memory model macros
-
-BEGIN_IMPORTS_DEF   _PM_imports
-DECLARE_IMP PM_getModeType,0
-DECLARE_IMP PM_getBIOSPointer,0
-DECLARE_IMP PM_getA0000Pointer,0
-DECLARE_IMP PM_mapPhysicalAddr,0
-DECLARE_IMP PM_mallocShared,0
-SKIP_IMP    _PM_reserved1,0
-DECLARE_IMP PM_freeShared,0
-DECLARE_IMP PM_mapToProcess,0
-DECLARE_IMP PM_mapRealPointer,0
-DECLARE_IMP PM_allocRealSeg,0
-DECLARE_IMP PM_freeRealSeg,0
-DECLARE_IMP PM_allocLockedMem,0
-DECLARE_IMP PM_freeLockedMem,0
-DECLARE_IMP PM_callRealMode,0
-DECLARE_IMP PM_int86,0
-DECLARE_IMP PM_int86x,0
-DECLARE_IMP DPMI_int86,0
-DECLARE_IMP PM_availableMemory,0
-DECLARE_IMP PM_getVESABuf,0
-DECLARE_IMP PM_getOSType,0
-DECLARE_IMP PM_fatalError,0
-DECLARE_IMP PM_setBankA,0
-DECLARE_IMP PM_setBankAB,0
-DECLARE_IMP PM_setCRTStart,0
-DECLARE_IMP PM_getCurrentPat,0
-DECLARE_IMP PM_getVBEAFPath,0
-DECLARE_IMP PM_getNucleusPath,0
-DECLARE_IMP PM_getNucleusConfigPath,0
-DECLARE_IMP PM_getUniqueID,0
-DECLARE_IMP PM_getMachineName,0
-DECLARE_IMP VF_available,0
-DECLARE_IMP VF_init,0
-DECLARE_IMP VF_exit,0
-DECLARE_IMP PM_openConsole,0
-DECLARE_IMP PM_getConsoleStateSize,0
-DECLARE_IMP PM_saveConsoleState,0
-DECLARE_IMP PM_restoreConsoleState,0
-DECLARE_IMP PM_closeConsole,0
-DECLARE_IMP PM_setOSCursorLocation,0
-DECLARE_IMP PM_setOSScreenWidth,0
-DECLARE_IMP PM_enableWriteCombine,0
-DECLARE_IMP PM_backslash,0
-DECLARE_IMP PM_lockDataPages,0
-DECLARE_IMP PM_unlockDataPages,0
-DECLARE_IMP PM_lockCodePages,0
-DECLARE_IMP PM_unlockCodePages,0
-DECLARE_IMP PM_setRealTimeClockHandler,0
-DECLARE_IMP PM_setRealTimeClockFrequency,0
-DECLARE_IMP PM_restoreRealTimeClockHandler,0
-DECLARE_IMP PM_doBIOSPOST,0
-DECLARE_IMP PM_getBootDrive,0
-DECLARE_IMP PM_freePhysicalAddr,0
-DECLARE_IMP PM_inpb,0
-DECLARE_IMP PM_inpw,0
-DECLARE_IMP PM_inpd,0
-DECLARE_IMP PM_outpb,0
-DECLARE_IMP PM_outpw,0
-DECLARE_IMP PM_outpd,0
-SKIP_IMP    _PM_reserved2,0
-DECLARE_IMP PM_setSuspendAppCallback,0
-DECLARE_IMP PM_haveBIOSAccess,0
-DECLARE_IMP PM_kbhit,0
-DECLARE_IMP PM_getch,0
-DECLARE_IMP PM_findBPD,0
-DECLARE_IMP PM_getPhysicalAddr,0
-DECLARE_IMP PM_sleep,0
-DECLARE_IMP PM_getCOMPort,0
-DECLARE_IMP PM_getLPTPort,0
-DECLARE_IMP PM_loadLibrary,0
-DECLARE_IMP PM_getProcAddress,0
-DECLARE_IMP PM_freeLibrary,0
-DECLARE_IMP PCI_enumerate,0
-DECLARE_IMP PCI_accessReg,0
-DECLARE_IMP PCI_setHardwareIRQ,0
-DECLARE_IMP PCI_generateSpecialCyle,0
-SKIP_IMP    _PM_reserved3,0
-DECLARE_IMP PCIBIOS_getEntry,0
-DECLARE_IMP CPU_getProcessorType,0
-DECLARE_IMP CPU_haveMMX,0
-DECLARE_IMP CPU_have3DNow,0
-DECLARE_IMP CPU_haveSSE,0
-DECLARE_IMP CPU_haveRDTSC,0
-DECLARE_IMP CPU_getProcessorSpeed,0
-DECLARE_IMP ZTimerInit,0
-DECLARE_IMP LZTimerOn,0
-DECLARE_IMP LZTimerLap,0
-DECLARE_IMP LZTimerOff,0
-DECLARE_IMP LZTimerCount,0
-DECLARE_IMP LZTimerOnExt,0
-DECLARE_IMP LZTimerLapExt,0
-DECLARE_IMP LZTimerOffExt,0
-DECLARE_IMP LZTimerCountExt,0
-DECLARE_IMP ULZTimerOn,0
-DECLARE_IMP ULZTimerLap,0
-DECLARE_IMP ULZTimerOff,0
-DECLARE_IMP ULZTimerCount,0
-DECLARE_IMP ULZReadTime,0
-DECLARE_IMP ULZElapsedTime,0
-DECLARE_IMP ULZTimerResolution,0
-DECLARE_IMP PM_findFirstFile,0
-DECLARE_IMP PM_findNextFile,0
-DECLARE_IMP PM_findClose,0
-DECLARE_IMP PM_makepath,0
-DECLARE_IMP PM_splitpath,0
-DECLARE_IMP PM_driveValid,0
-DECLARE_IMP PM_getdcwd,0
-DECLARE_IMP PM_setFileAttr,0
-DECLARE_IMP PM_mkdir,0
-DECLARE_IMP PM_rmdir,0
-DECLARE_IMP PM_getFileAttr,0
-DECLARE_IMP PM_getFileTime,0
-DECLARE_IMP PM_setFileTime,0
-DECLARE_IMP CPU_getProcessorName,0
-DECLARE_IMP PM_getVGAStateSize,0
-DECLARE_IMP PM_saveVGAState,0
-DECLARE_IMP PM_restoreVGAState,0
-DECLARE_IMP PM_vgaBlankDisplay,0
-DECLARE_IMP PM_vgaUnblankDisplay,0
-DECLARE_IMP PM_blockUntilTimeout,0
-DECLARE_IMP _PM_add64,0
-DECLARE_IMP _PM_sub64,0
-DECLARE_IMP _PM_mul64,0
-DECLARE_IMP _PM_div64,0
-DECLARE_IMP _PM_shr64,0
-DECLARE_IMP _PM_sar64,0
-DECLARE_IMP _PM_shl64,0
-DECLARE_IMP _PM_neg64,0
-DECLARE_IMP PCI_findBARSize,0
-DECLARE_IMP PCI_readRegBlock,0
-DECLARE_IMP PCI_writeRegBlock,0
-DECLARE_IMP PM_flushTLB,0
-DECLARE_IMP PM_useLocalMalloc,0
-DECLARE_IMP PM_malloc,0
-DECLARE_IMP PM_calloc,0
-DECLARE_IMP PM_realloc,0
-DECLARE_IMP PM_free,0
-DECLARE_IMP PM_getPhysicalAddrRange,0
-DECLARE_IMP PM_allocPage,0
-DECLARE_IMP PM_freePage,0
-DECLARE_IMP PM_agpInit,0
-DECLARE_IMP PM_agpExit,0
-DECLARE_IMP PM_agpReservePhysical,0
-DECLARE_IMP PM_agpReleasePhysical,0
-DECLARE_IMP PM_agpCommitPhysical,0
-DECLARE_IMP PM_agpFreePhysical,0
-DECLARE_IMP PCI_getNumDevices,0
-DECLARE_IMP PM_setLocalBPDPath,0
-DECLARE_IMP PM_loadDirectDraw,0
-DECLARE_IMP PM_unloadDirectDraw,0
-DECLARE_IMP PM_getDirectDrawWindow,0
-DECLARE_IMP PM_doSuspendApp,0
-END_IMPORTS_DEF
-
-        END
-
diff --git a/board/MAI/bios_emulator/scitech/src/common/aabeos.c b/board/MAI/bios_emulator/scitech/src/common/aabeos.c
deleted file mode 100644 (file)
index ad5698a..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech Nucleus Graphics Architecture
-*
-*               Copyright (C) 1991-1998 SciTech Software, Inc.
-*                            All rights reserved.
-*
-*  ======================================================================
-*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-*  |                                                                    |
-*  |This copyrighted computer code contains proprietary technology      |
-*  |owned by SciTech Software, Inc., located at 505 Wall Street,        |
-*  |Chico, CA 95928 USA (http://www.scitechsoft.com).                   |
-*  |                                                                    |
-*  |The contents of this file are subject to the SciTech Nucleus        |
-*  |License; you may *not* use this file or related software except in  |
-*  |compliance with the License. You may obtain a copy of the License   |
-*  |at http://www.scitechsoft.com/nucleus-license.txt                   |
-*  |                                                                    |
-*  |Software distributed under the License is distributed on an         |
-*  |"AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or      |
-*  |implied. See the License for the specific language governing        |
-*  |rights and limitations under the License.                           |
-*  |                                                                    |
-*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-*  ======================================================================
-*
-* Language:     ANSI C
-* Environment:  Linux
-*
-* Description:  OS specific Nucleus Graphics Architecture services for
-*               the Linux operating system.
-*
-****************************************************************************/
-
-#include "nucleus/graphics.h"
-#include <sys/time.h>
-
-static ibool            haveRDTSC;
-
-/*-------------------------- Implementation -------------------------------*/
-
-/****************************************************************************
-REMARKS:
-Nothing special for this OS.
-****************************************************************************/
-GA_sharedInfo * NAPI GA_getSharedInfo(
-    int device)
-{
-    (void)device;
-    return NULL;
-}
-
-/****************************************************************************
-REMARKS:
-Nothing special for this OS.
-****************************************************************************/
-ibool NAPI GA_getSharedExports(
-    GA_exports *gaExp)
-{
-    (void)gaExp;
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-This function initialises the high precision timing functions for the
-Nucleus loader library.
-****************************************************************************/
-ibool NAPI GA_TimerInit(void)
-{
-    if (_GA_haveCPUID() && (_GA_getCPUIDFeatures() & CPU_HaveRDTSC) != 0)
-       haveRDTSC = true;
-    return true;
-}
-
-/****************************************************************************
-REMARKS:
-This function reads the high resolution timer.
-****************************************************************************/
-void NAPI GA_TimerRead(
-    GA_largeInteger *value)
-{
-    if (haveRDTSC)
-       _GA_readTimeStamp(value);
-    else {
-       struct timeval t;
-       gettimeofday(&t, NULL);
-       value->low = t.tv_sec*1000000 + t.tv_usec;
-       value->high = 0;
-       }
-}
diff --git a/board/MAI/bios_emulator/scitech/src/common/aados.c b/board/MAI/bios_emulator/scitech/src/common/aados.c
deleted file mode 100644 (file)
index 342d2f3..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech Nucleus Graphics Architecture
-*
-*               Copyright (C) 1991-1998 SciTech Software, Inc.
-*                            All rights reserved.
-*
-*  ======================================================================
-*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-*  |                                                                    |
-*  |This copyrighted computer code contains proprietary technology      |
-*  |owned by SciTech Software, Inc., located at 505 Wall Street,        |
-*  |Chico, CA 95928 USA (http://www.scitechsoft.com).                   |
-*  |                                                                    |
-*  |The contents of this file are subject to the SciTech Nucleus        |
-*  |License; you may *not* use this file or related software except in  |
-*  |compliance with the License. You may obtain a copy of the License   |
-*  |at http://www.scitechsoft.com/nucleus-license.txt                   |
-*  |                                                                    |
-*  |Software distributed under the License is distributed on an         |
-*  |"AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or      |
-*  |implied. See the License for the specific language governing        |
-*  |rights and limitations under the License.                           |
-*  |                                                                    |
-*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-*  ======================================================================
-*
-* Language:     ANSI C
-* Environment:  MSDOS
-*
-* Description:  OS specific Nucleus Graphics Architecture services for
-*               the MSDOS operating system.
-*
-****************************************************************************/
-
-#include "pm_help.h"
-#include "pmapi.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-/*-------------------------- Implementation -------------------------------*/
-
-/****************************************************************************
-REMARKS:
-This function initialises the high precision timing functions for the DOS
-Nucleus loader library.
-****************************************************************************/
-ibool NAPI GA_TimerInit(void)
-{
-    if (_GA_haveCPUID() && (_GA_getCPUIDFeatures() & CPU_HaveRDTSC) != 0)
-       return true;
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-This function reads the high resolution timer.
-****************************************************************************/
-void NAPI GA_TimerRead(
-    GA_largeInteger *value)
-{
-    _GA_readTimeStamp(value);
-}
diff --git a/board/MAI/bios_emulator/scitech/src/common/aalib.c b/board/MAI/bios_emulator/scitech/src/common/aalib.c
deleted file mode 100644 (file)
index 5003b22..0000000
+++ /dev/null
@@ -1,225 +0,0 @@
-/****************************************************************************
-*
-*                     SciTech Nucleus Audio Architecture
-*
-*               Copyright (C) 1991-1998 SciTech Software, Inc.
-*                            All rights reserved.
-*
-*  ======================================================================
-*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-*  |                                                                    |
-*  |This copyrighted computer code contains proprietary technology      |
-*  |owned by SciTech Software, Inc., located at 505 Wall Street,        |
-*  |Chico, CA 95928 USA (http://www.scitechsoft.com).                   |
-*  |                                                                    |
-*  |The contents of this file are subject to the SciTech Nucleus        |
-*  |License; you may *not* use this file or related software except in  |
-*  |compliance with the License. You may obtain a copy of the License   |
-*  |at http://www.scitechsoft.com/nucleus-license.txt                   |
-*  |                                                                    |
-*  |Software distributed under the License is distributed on an         |
-*  |"AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or      |
-*  |implied. See the License for the specific language governing        |
-*  |rights and limitations under the License.                           |
-*  |                                                                    |
-*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-*  ======================================================================
-*
-* Language:     ANSI C
-* Environment:  Any 32-bit protected mode environment
-*
-* Description:  C module for the Graphics Accelerator Driver API. Uses
-*               the SciTech PM library for interfacing with DOS
-*               extender specific functions.
-*
-****************************************************************************/
-
-#include "nucleus/audio.h"
-#ifdef __WIN32_VXD__
-#include "sdd/sddhelp.h"
-#else
-#include <stdio.h>
-#include <stdlib.h>
-#endif
-
-/*---------------------------- Global Variables ---------------------------*/
-
-#ifdef  TEST_HARNESS
-extern PM_imports   _VARAPI _PM_imports;
-#else
-AA_exports  _VARAPI _AA_exports;
-static int          loaded = false;
-static PE_MODULE    *hModBPD = NULL;
-
-#ifdef  __DRIVER__
-extern PM_imports _PM_imports;
-#else
-#include "pmimp.h"
-#endif
-
-static N_imports _N_imports = {
-    sizeof(N_imports),
-    _OS_delay,
-    };
-
-#ifdef  __DRIVER__
-extern AA_imports _AA_imports;
-#else
-static AA_imports _AA_imports = {
-    sizeof(AA_imports),
-    };
-#endif
-#endif
-
-/*----------------------------- Implementation ----------------------------*/
-
-#define DLL_NAME        "audio.bpd"
-
-#ifndef TEST_HARNESS
-/****************************************************************************
-REMARKS:
-Fatal error handler for non-exported AA_exports.
-****************************************************************************/
-static void _AA_fatalErrorHandler(void)
-{
-    PM_fatalError("Unsupported Nucleus export function called! Please upgrade your copy of Nucleus!\n");
-}
-
-/****************************************************************************
-REMARKS:
-Loads the Nucleus binary portable DLL into memory and initilises it.
-****************************************************************************/
-static ibool LoadDriver(void)
-{
-    AA_initLibrary_t    AA_initLibrary;
-    AA_exports          *aaExp;
-    char                filename[PM_MAX_PATH];
-    char                bpdpath[PM_MAX_PATH];
-    int                 i,max;
-    ulong               *p;
-
-    /* Check if we have already loaded the driver */
-    if (loaded)
-       return true;
-    PM_init();
-    _AA_exports.dwSize = sizeof(_AA_exports);
-
-    /* Open the BPD file */
-    if (!PM_findBPD(DLL_NAME,bpdpath))
-       return false;
-    strcpy(filename,bpdpath);
-    strcat(filename,DLL_NAME);
-    if ((hModBPD = PE_loadLibrary(filename,false)) == NULL)
-       return false;
-    if ((AA_initLibrary = (AA_initLibrary_t)PE_getProcAddress(hModBPD,"_AA_initLibrary")) == NULL)
-       return false;
-    bpdpath[strlen(bpdpath)-1] = 0;
-    if (strcmp(bpdpath,PM_getNucleusPath()) == 0)
-       strcpy(bpdpath,PM_getNucleusConfigPath());
-    else {
-       PM_backslash(bpdpath);
-       strcat(bpdpath,"config");
-       }
-    if ((aaExp = AA_initLibrary(bpdpath,filename,&_PM_imports,&_N_imports,&_AA_imports)) == NULL)
-       PM_fatalError("AA_initLibrary failed!\n");
-
-    /* Initialize all default imports to point to fatal error handler
-     * for upwards compatibility, and copy the exported functions.
-     */
-    max = sizeof(_AA_exports)/sizeof(AA_initLibrary_t);
-    for (i = 0,p = (ulong*)&_AA_exports; i < max; i++)
-       *p++ = (ulong)_AA_fatalErrorHandler;
-    memcpy(&_AA_exports,aaExp,MIN(sizeof(_AA_exports),aaExp->dwSize));
-    loaded = true;
-    return true;
-}
-
-/* The following are stub entry points that the application calls to
- * initialise the Nucleus loader library, and we use this to load our
- * driver DLL from disk and initialise the library using it.
- */
-
-/* {secret} */
-int NAPI AA_status(void)
-{
-    if (!loaded)
-       return nDriverNotFound;
-    return _AA_exports.AA_status();
-}
-
-/* {secret} */
-const char * NAPI AA_errorMsg(
-    N_int32 status)
-{
-    if (!loaded)
-       return "Unable to load Nucleus device driver!";
-    return _AA_exports.AA_errorMsg(status);
-}
-
-/* {secret} */
-int NAPI AA_getDaysLeft(void)
-{
-    if (!LoadDriver())
-       return -1;
-    return _AA_exports.AA_getDaysLeft();
-}
-
-/* {secret} */
-int NAPI AA_registerLicense(uchar *license)
-{
-    if (!LoadDriver())
-       return 0;
-    return _AA_exports.AA_registerLicense(license);
-}
-
-/* {secret} */
-int NAPI AA_enumerateDevices(void)
-{
-    if (!LoadDriver())
-       return 0;
-    return _AA_exports.AA_enumerateDevices();
-}
-
-/* {secret} */
-AA_devCtx * NAPI AA_loadDriver(N_int32 deviceIndex)
-{
-    if (!LoadDriver())
-       return NULL;
-    return _AA_exports.AA_loadDriver(deviceIndex);
-}
-#endif
-
-typedef struct {
-    N_uint32    low;
-    N_uint32    high;
-    } AA_largeInteger;
-
-void    NAPI _OS_delay8253(N_uint32 microSeconds);
-ibool   NAPI _GA_haveCPUID(void);
-uint    NAPI _GA_getCPUIDFeatures(void);
-void    NAPI _GA_readTimeStamp(AA_largeInteger *time);
-#define CPU_HaveRDTSC   0x00000010
-
-/****************************************************************************
-REMARKS:
-This function delays for the specified number of microseconds
-****************************************************************************/
-void NAPI _OS_delay(
-    N_uint32 microSeconds)
-{
-    static ibool    inited = false;
-    LZTimerObject   tm;
-
-    if (_GA_haveCPUID() && (_GA_getCPUIDFeatures() & CPU_HaveRDTSC) != 0) {
-       if (!inited) {
-           ZTimerInit();
-           inited = true;
-           }
-       LZTimerOnExt(&tm);
-       while (LZTimerLapExt(&tm) < microSeconds)
-           ;
-       LZTimerOnExt(&tm);
-       }
-    else
-       _OS_delay8253(microSeconds);
-}
diff --git a/board/MAI/bios_emulator/scitech/src/common/aalinux.c b/board/MAI/bios_emulator/scitech/src/common/aalinux.c
deleted file mode 100644 (file)
index d3d468e..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech Nucleus Graphics Architecture
-*
-*               Copyright (C) 1991-1998 SciTech Software, Inc.
-*                            All rights reserved.
-*
-*  ======================================================================
-*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-*  |                                                                    |
-*  |This copyrighted computer code contains proprietary technology      |
-*  |owned by SciTech Software, Inc., located at 505 Wall Street,        |
-*  |Chico, CA 95928 USA (http://www.scitechsoft.com).                   |
-*  |                                                                    |
-*  |The contents of this file are subject to the SciTech Nucleus        |
-*  |License; you may *not* use this file or related software except in  |
-*  |compliance with the License. You may obtain a copy of the License   |
-*  |at http://www.scitechsoft.com/nucleus-license.txt                   |
-*  |                                                                    |
-*  |Software distributed under the License is distributed on an         |
-*  |"AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or      |
-*  |implied. See the License for the specific language governing        |
-*  |rights and limitations under the License.                           |
-*  |                                                                    |
-*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-*  ======================================================================
-*
-* Language:     ANSI C
-* Environment:  Linux
-*
-* Description:  OS specific Nucleus Graphics Architecture services for
-*               the Linux operating system.
-*
-****************************************************************************/
-
-#include "nucleus/graphics.h"
-#include <sys/time.h>
-
-/*---------------------------- Global Variables ---------------------------*/
-
-static ibool        haveRDTSC;
-
-/*-------------------------- Implementation -------------------------------*/
-
-/****************************************************************************
-REMARKS:
-Nothing special for this OS.
-****************************************************************************/
-GA_sharedInfo * NAPI GA_getSharedInfo(
-    int device)
-{
-    (void)device;
-    return NULL;
-}
-
-/****************************************************************************
-REMARKS:
-Nothing special for this OS.
-****************************************************************************/
-ibool NAPI GA_getSharedExports(
-    GA_exports *gaExp)
-{
-    (void)gaExp;
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-This function initialises the high precision timing functions for the
-Nucleus loader library.
-****************************************************************************/
-ibool NAPI GA_TimerInit(void)
-{
-    if (_GA_haveCPUID() && (_GA_getCPUIDFeatures() & CPU_HaveRDTSC) != 0)
-       haveRDTSC = true;
-    return true;
-}
-
-/****************************************************************************
-REMARKS:
-This function reads the high resolution timer.
-****************************************************************************/
-void NAPI GA_TimerRead(
-    GA_largeInteger *value)
-{
-    if (haveRDTSC)
-       _GA_readTimeStamp(value);
-    else {
-       struct timeval t;
-       gettimeofday(&t, NULL);
-       value->low = t.tv_sec*1000000 + t.tv_usec;
-       value->high = 0;
-       }
-}
diff --git a/board/MAI/bios_emulator/scitech/src/common/aaos2.c b/board/MAI/bios_emulator/scitech/src/common/aaos2.c
deleted file mode 100644 (file)
index 0ec8c9f..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech Nucleus Graphics Architecture
-*
-*               Copyright (C) 1991-1998 SciTech Software, Inc.
-*                            All rights reserved.
-*
-*  ======================================================================
-*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-*  |                                                                    |
-*  |This copyrighted computer code contains proprietary technology      |
-*  |owned by SciTech Software, Inc., located at 505 Wall Street,        |
-*  |Chico, CA 95928 USA (http://www.scitechsoft.com).                   |
-*  |                                                                    |
-*  |The contents of this file are subject to the SciTech Nucleus        |
-*  |License; you may *not* use this file or related software except in  |
-*  |compliance with the License. You may obtain a copy of the License   |
-*  |at http://www.scitechsoft.com/nucleus-license.txt                   |
-*  |                                                                    |
-*  |Software distributed under the License is distributed on an         |
-*  |"AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or      |
-*  |implied. See the License for the specific language governing        |
-*  |rights and limitations under the License.                           |
-*  |                                                                    |
-*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-*  ======================================================================
-*
-* Language:     ANSI C
-* Environment:  OS/2 32-bit
-*
-* Description:  OS specific Nucleus Graphics Architecture services for
-*               the OS/2 operating system environments.
-*
-****************************************************************************/
-
-#include "pm_help.h"
-#define INCL_DOSERRORS
-#define INCL_DOS
-#define INCL_SUB
-#define INCL_VIO
-#define INCL_KBD
-#include <os2.h>
-
-/*---------------------------- Global Variables ---------------------------*/
-
-static HFILE        hSDDHelp;
-static ulong        outLen;         /* Must not cross 64Kb boundary!    */
-static ulong        result;         /* Must not cross 64Kb boundary!    */
-static ibool        haveRDTSC;
-
-/*-------------------------- Implementation -------------------------------*/
-
-/****************************************************************************
-REMARKS:
-This function returns a pointer to the common graphics driver loaded in the
-helper VxD. The memory for the VxD is shared between all processes via
-the VxD, so that the VxD, 16-bit code and 32-bit code all see the same
-state when accessing the graphics binary portable driver.
-****************************************************************************/
-GA_sharedInfo * NAPI GA_getSharedInfo(
-    int device)
-{
-    /* Initialise the PM library and connect to our runtime DLL's */
-    PM_init();
-
-    /* Open our helper device driver */
-    if (DosOpen(PMHELP_NAME,&hSDDHelp,&result,0,0,
-           FILE_OPEN, OPEN_SHARE_DENYNONE | OPEN_ACCESS_READWRITE,
-           NULL))
-       PM_fatalError("Unable to open SDDHELP$ helper device driver!");
-    outLen = sizeof(result);
-    DosDevIOCtl(hSDDHelp,PMHELP_IOCTL,PMHELP_GETSHAREDINFO,
-       NULL, 0, NULL,
-       &result, outLen, &outLen);
-    DosClose(hSDDHelp);
-    if (result) {
-       /* We have found the shared Nucleus packet. Because not all processes
-        * map to SDDPMI.DLL, we need to ensure that we connect to this
-        * DLL so that it gets mapped into our address space (that is
-        * where the shared Nucleus packet is located). Simply doing a
-        * DosLoadModule on it is enough for this.
-        */
-       HMODULE hModSDDPMI;
-       char    buf[80];
-       DosLoadModule((PSZ)buf,sizeof(buf),(PSZ)"SDDPMI.DLL",&hModSDDPMI);
-       }
-    return (GA_sharedInfo*)result;
-}
-
-/****************************************************************************
-REMARKS:
-Nothing special for this OS.
-****************************************************************************/
-ibool NAPI GA_getSharedExports(
-    GA_exports *gaExp)
-{
-    (void)gaExp;
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-This function initialises the high precision timing functions for the
-Nucleus loader library.
-****************************************************************************/
-ibool NAPI GA_TimerInit(void)
-{
-    if (_GA_haveCPUID() && (_GA_getCPUIDFeatures() & CPU_HaveRDTSC) != 0)
-       haveRDTSC = true;
-    return true;
-}
-
-/****************************************************************************
-REMARKS:
-This function reads the high resolution timer.
-****************************************************************************/
-void NAPI GA_TimerRead(
-    GA_largeInteger *value)
-{
-    if (haveRDTSC)
-       _GA_readTimeStamp(value);
-    else
-       DosTmrQueryTime((QWORD*)value);
-}
diff --git a/board/MAI/bios_emulator/scitech/src/common/aaqnx.c b/board/MAI/bios_emulator/scitech/src/common/aaqnx.c
deleted file mode 100644 (file)
index 13531be..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech Nucleus Graphics Architecture
-*
-*               Copyright (C) 1991-1998 SciTech Software, Inc.
-*                            All rights reserved.
-*
-*  ======================================================================
-*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-*  |                                                                    |
-*  |This copyrighted computer code contains proprietary technology      |
-*  |owned by SciTech Software, Inc., located at 505 Wall Street,        |
-*  |Chico, CA 95928 USA (http://www.scitechsoft.com).                   |
-*  |                                                                    |
-*  |The contents of this file are subject to the SciTech Nucleus        |
-*  |License; you may *not* use this file or related software except in  |
-*  |compliance with the License. You may obtain a copy of the License   |
-*  |at http://www.scitechsoft.com/nucleus-license.txt                   |
-*  |                                                                    |
-*  |Software distributed under the License is distributed on an         |
-*  |"AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or      |
-*  |implied. See the License for the specific language governing        |
-*  |rights and limitations under the License.                           |
-*  |                                                                    |
-*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-*  ======================================================================
-*
-* Language:     ANSI C
-* Environment:  QNX
-*
-* Description:  OS specific Nucleus Graphics Architecture services for
-*               the QNX operating system.
-*
-****************************************************************************/
-
-#include "nucleus/graphics.h"
-#include <time.h>
-
-/*---------------------------- Global Variables ---------------------------*/
-
-static ibool        haveRDTSC;
-
-/*-------------------------- Implementation -------------------------------*/
-
-/****************************************************************************
-REMARKS:
-Nothing special for this OS.
-****************************************************************************/
-GA_sharedInfo * NAPI GA_getSharedInfo(
-    int device)
-{
-    (void)device;
-    return NULL;
-}
-
-/****************************************************************************
-REMARKS:
-Nothing special for this OS.
-****************************************************************************/
-ibool NAPI GA_getSharedExports(
-    GA_exports *gaExp)
-{
-    (void)gaExp;
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-This function initialises the high precision timing functions for the
-Nucleus loader library.
-****************************************************************************/
-ibool NAPI GA_TimerInit(void)
-{
-    if (_GA_haveCPUID() && (_GA_getCPUIDFeatures() & CPU_HaveRDTSC) != 0)
-       haveRDTSC = true;
-    return true;
-}
-
-/****************************************************************************
-REMARKS:
-This function reads the high resolution timer.
-****************************************************************************/
-void NAPI GA_TimerRead(
-    GA_largeInteger *value)
-{
-    if (haveRDTSC)
-       _GA_readTimeStamp(value);
-    else {
-       struct timespec ts;
-
-       clock_gettime(CLOCK_REALTIME, &ts);
-       value->low = (ts.tv_nsec / 1000 + ts.tv_sec * 1000000);
-       value->high = 0;
-       }
-}
diff --git a/board/MAI/bios_emulator/scitech/src/common/aartt.c b/board/MAI/bios_emulator/scitech/src/common/aartt.c
deleted file mode 100644 (file)
index 1a5a67a..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech Nucleus Graphics Architecture
-*
-*               Copyright (C) 1991-1998 SciTech Software, Inc.
-*                            All rights reserved.
-*
-*  ======================================================================
-*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-*  |                                                                    |
-*  |This copyrighted computer code contains proprietary technology      |
-*  |owned by SciTech Software, Inc., located at 505 Wall Street,        |
-*  |Chico, CA 95928 USA (http://www.scitechsoft.com).                   |
-*  |                                                                    |
-*  |The contents of this file are subject to the SciTech Nucleus        |
-*  |License; you may *not* use this file or related software except in  |
-*  |compliance with the License. You may obtain a copy of the License   |
-*  |at http://www.scitechsoft.com/nucleus-license.txt                   |
-*  |                                                                    |
-*  |Software distributed under the License is distributed on an         |
-*  |"AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or      |
-*  |implied. See the License for the specific language governing        |
-*  |rights and limitations under the License.                           |
-*  |                                                                    |
-*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-*  ======================================================================
-*
-* Language:     ANSI C
-* Environment:  RTTarget-32
-*
-* Description:  OS specific Nucleus Graphics Architecture services for
-*               the RTTarget-32 operating system environments.
-*
-****************************************************************************/
-
-#include "nucleus/graphics.h"
-
-/*------------------------- Global Variables ------------------------------*/
-
-static ibool            haveRDTSC;
-
-/*-------------------------- Implementation -------------------------------*/
-
-/****************************************************************************
-REMARKS:
-Nothing special for this OS.
-****************************************************************************/
-GA_sharedInfo * NAPI GA_getSharedInfo(
-    int device)
-{
-    (void)device;
-    return NULL;
-}
-
-/****************************************************************************
-REMARKS:
-Nothing special for this OS.
-****************************************************************************/
-ibool NAPI GA_getSharedExports(
-    GA_exports *gaExp)
-{
-    (void)gaExp;
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-This function initialises the high precision timing functions for the
-Nucleus loader library.
-****************************************************************************/
-ibool NAPI GA_TimerInit(void)
-{
-    if (_GA_haveCPUID() && (_GA_getCPUIDFeatures() & CPU_HaveRDTSC) != 0) {
-       haveRDTSC = true;
-       return true;
-       }
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-This function reads the high resolution timer.
-****************************************************************************/
-void NAPI GA_TimerRead(
-    GA_largeInteger *value)
-{
-    if (haveRDTSC)
-       _GA_readTimeStamp(value);
-}
diff --git a/board/MAI/bios_emulator/scitech/src/common/aasmx.c b/board/MAI/bios_emulator/scitech/src/common/aasmx.c
deleted file mode 100644 (file)
index 163060f..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech Nucleus Graphics Architecture
-*
-*               Copyright (C) 1991-1998 SciTech Software, Inc.
-*                            All rights reserved.
-*
-*  ======================================================================
-*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-*  |                                                                    |
-*  |This copyrighted computer code contains proprietary technology      |
-*  |owned by SciTech Software, Inc., located at 505 Wall Street,        |
-*  |Chico, CA 95928 USA (http://www.scitechsoft.com).                   |
-*  |                                                                    |
-*  |The contents of this file are subject to the SciTech Nucleus        |
-*  |License; you may *not* use this file or related software except in  |
-*  |compliance with the License. You may obtain a copy of the License   |
-*  |at http://www.scitechsoft.com/nucleus-license.txt                   |
-*  |                                                                    |
-*  |Software distributed under the License is distributed on an         |
-*  |"AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or      |
-*  |implied. See the License for the specific language governing        |
-*  |rights and limitations under the License.                           |
-*  |                                                                    |
-*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-*  ======================================================================
-*
-* Language:     ANSI C
-* Environment:  smx32
-*
-* Description:  OS specific Nucleus Graphics Architecture services for
-*               the smx32 platform -- no vxD support.
-*
-****************************************************************************/
-
-#include "pmapi.h"
-#include "nucleus/graphics.h"
-
-/*-------------------------- Implementation -------------------------------*/
-
-/****************************************************************************
-REMARKS:
-Nothing special for this OS.
-****************************************************************************/
-GA_sharedInfo * NAPI GA_getSharedInfo(
-    int device)
-{
-    (void)device;
-    return NULL;
-}
-
-/****************************************************************************
-REMARKS:
-Nothing special for this OS.
-****************************************************************************/
-ibool NAPI GA_getSharedExports(
-    GA_exports *gaExp)
-{
-    (void)gaExp;
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-This function initialises the high precision timing functions for the
-Nucleus loader library.
-****************************************************************************/
-ibool NAPI GA_TimerInit(void)
-{
-    if (_GA_haveCPUID() && (_GA_getCPUIDFeatures() & CPU_HaveRDTSC) != 0)
-       return true;
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-This function reads the high resolution timer.
-****************************************************************************/
-void NAPI GA_TimerRead(
-    GA_largeInteger *value)
-{
-    _GA_readTimeStamp(value);
-}
diff --git a/board/MAI/bios_emulator/scitech/src/common/aavxd.c b/board/MAI/bios_emulator/scitech/src/common/aavxd.c
deleted file mode 100644 (file)
index 221b02b..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech Nucleus Graphics Architecture
-*
-*               Copyright (C) 1991-1998 SciTech Software, Inc.
-*                            All rights reserved.
-*
-*  ======================================================================
-*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-*  |                                                                    |
-*  |This copyrighted computer code contains proprietary technology      |
-*  |owned by SciTech Software, Inc., located at 505 Wall Street,        |
-*  |Chico, CA 95928 USA (http://www.scitechsoft.com).                   |
-*  |                                                                    |
-*  |The contents of this file are subject to the SciTech Nucleus        |
-*  |License; you may *not* use this file or related software except in  |
-*  |compliance with the License. You may obtain a copy of the License   |
-*  |at http://www.scitechsoft.com/nucleus-license.txt                   |
-*  |                                                                    |
-*  |Software distributed under the License is distributed on an         |
-*  |"AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or      |
-*  |implied. See the License for the specific language governing        |
-*  |rights and limitations under the License.                           |
-*  |                                                                    |
-*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-*  ======================================================================
-*
-* Language:     ANSI C
-* Environment:  Win32 VxD
-*
-* Description:  OS specific Nucleus Graphics Architecture services for
-*               the Win32 VxD's.
-*
-****************************************************************************/
-
-#include "sdd/sddhelp.h"
-
-/*------------------------- Global Variables ------------------------------*/
-
-static ibool            haveRDTSC;
-
-/*-------------------------- Implementation -------------------------------*/
-
-/****************************************************************************
-REMARKS:
-Return the internal shared info structure.
-****************************************************************************/
-GA_sharedInfo * NAPI GA_getSharedInfo(
-    int device)
-{
-    static GA_sharedInfo shared = {0,-1};
-    return &shared;
-}
-
-/****************************************************************************
-REMARKS:
-Nothing special for this OS.
-****************************************************************************/
-ibool NAPI GA_getSharedExports(
-    GA_exports *gaExp)
-{
-    (void)gaExp;
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-This function initialises the high precision timing functions for the
-Nucleus loader library.
-****************************************************************************/
-ibool NAPI GA_TimerInit(void)
-{
-    if (_GA_haveCPUID() && (_GA_getCPUIDFeatures() & CPU_HaveRDTSC) != 0) {
-       haveRDTSC = true;
-       }
-    return true;
-}
-
-/****************************************************************************
-REMARKS:
-This function reads the high resolution timer.
-****************************************************************************/
-void NAPI GA_TimerRead(
-    GA_largeInteger *value)
-{
-    if (haveRDTSC)
-       _GA_readTimeStamp(value);
-    else
-       VTD_Get_Real_Time(&value->high,&value->low);
-}
diff --git a/board/MAI/bios_emulator/scitech/src/common/aawin32.c b/board/MAI/bios_emulator/scitech/src/common/aawin32.c
deleted file mode 100644 (file)
index 541df4a..0000000
+++ /dev/null
@@ -1,264 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech Nucleus Graphics Architecture
-*
-*               Copyright (C) 1991-1998 SciTech Software, Inc.
-*                            All rights reserved.
-*
-*  ======================================================================
-*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-*  |                                                                    |
-*  |This copyrighted computer code contains proprietary technology      |
-*  |owned by SciTech Software, Inc., located at 505 Wall Street,        |
-*  |Chico, CA 95928 USA (http://www.scitechsoft.com).                   |
-*  |                                                                    |
-*  |The contents of this file are subject to the SciTech Nucleus        |
-*  |License; you may *not* use this file or related software except in  |
-*  |compliance with the License. You may obtain a copy of the License   |
-*  |at http://www.scitechsoft.com/nucleus-license.txt                   |
-*  |                                                                    |
-*  |Software distributed under the License is distributed on an         |
-*  |"AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or      |
-*  |implied. See the License for the specific language governing        |
-*  |rights and limitations under the License.                           |
-*  |                                                                    |
-*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-*  ======================================================================
-*
-* Language:     ANSI C
-* Environment:  Win32
-*
-* Description:  OS specific Nucleus Graphics Architecture services for
-*               the Win32 operating system environments.
-*
-****************************************************************************/
-
-#include "pm_help.h"
-#include "pmapi.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#define STRICT
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-
-/*------------------------- Global Variables ------------------------------*/
-
-#if GA_MAX_DEVICES > 4
-#error GA_MAX_DEVICES has changed!
-#endif
-
-static ibool            haveRDTSC;
-static GA_largeInteger  countFreq;
-static GA_loadDriver_t  ORG_GA_loadDriver;
-extern HANDLE           _PM_hDevice;
-
-/*-------------------------- Implementation -------------------------------*/
-
-/****************************************************************************
-DESCRIPTION:
-Get the current graphics driver imports from the VxD
-
-REMARKS:
-This function returns a pointer to the common graphics driver loaded in the
-helper VxD. The memory for the VxD is shared between all processes via
-the VxD, so that the VxD, 16-bit code and 32-bit code all see the same
-state when accessing the graphics binary portable driver.
-****************************************************************************/
-GA_sharedInfo * NAPI GA_getSharedInfo(
-    int device)
-{
-    DWORD   inBuf[1];   /* Buffer to send data to VxD       */
-    DWORD   outBuf[2];  /* Buffer to receive data from VxD  */
-    DWORD   count;      /* Count of bytes returned from VxD */
-
-    PM_init();
-    inBuf[0] = device;
-    if (DeviceIoControl(_PM_hDevice, PMHELP_GETSHAREDINFO32, inBuf, sizeof(inBuf),
-           outBuf, sizeof(outBuf), &count, NULL)) {
-       return (GA_sharedInfo*)outBuf[0];
-       }
-    return NULL;
-}
-
-/****************************************************************************
-REMARKS:
-Nothing special for this OS.
-****************************************************************************/
-ibool NAPI GA_getSharedExports(
-    GA_exports *gaExp)
-{
-    (void)gaExp;
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-This function initialises the software stereo module by either calling
-the Nucleus libraries directly, or calling into the VxD if we are running
-on the shared Nucleus libraries loaded by the Windows VxD.
-****************************************************************************/
-static ibool NAPI _GA_softStereoInit(
-    GA_devCtx *dc)
-{
-    if (_PM_hDevice) {
-       DWORD   inBuf[1];   /* Buffer to send data to VxD       */
-       DWORD   outBuf[1];  /* Buffer to receive data from VxD  */
-       DWORD   count;      /* Count of bytes returned from VxD */
-
-       inBuf[0] = (ulong)dc;
-       if (DeviceIoControl(_PM_hDevice, PMHELP_GASTEREOINIT32, inBuf, sizeof(inBuf),
-               outBuf, sizeof(outBuf), &count, NULL)) {
-           return outBuf[0];
-           }
-       }
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-This function turns on software stereo mode, either directly or via the VxD.
-****************************************************************************/
-static void NAPI _GA_softStereoOn(void)
-{
-    if (_PM_hDevice) {
-       DeviceIoControl(_PM_hDevice, PMHELP_GASTEREOON32, NULL, 0,
-           NULL, 0, NULL, NULL);
-       }
-}
-
-/****************************************************************************
-REMARKS:
-This function schedules a software stereo mode page flip, either directly
-or via the VxD.
-****************************************************************************/
-static void NAPI _GA_softStereoScheduleFlip(
-    N_uint32 leftAddr,
-    N_uint32 rightAddr)
-{
-    if (_PM_hDevice) {
-       DWORD   inBuf[2];   /* Buffer to send data to VxD       */
-       DWORD   count;      /* Count of bytes returned from VxD */
-
-       inBuf[0] = (ulong)leftAddr;
-       inBuf[1] = (ulong)rightAddr;
-       DeviceIoControl(_PM_hDevice, PMHELP_GASTEREOFLIP32, inBuf, sizeof(inBuf),
-           NULL, 0, &count, NULL);
-       }
-}
-
-/****************************************************************************
-REMARKS:
-This function turns off software stereo mode, either directly or via the VxD.
-****************************************************************************/
-static N_int32 NAPI _GA_softStereoGetFlipStatus(void)
-{
-    if (_PM_hDevice) {
-       DWORD   outBuf[1];  /* Buffer to receive data from VxD  */
-       DWORD   count;      /* Count of bytes returned from VxD */
-
-       if (DeviceIoControl(_PM_hDevice, PMHELP_GASTEREOFLIPSTATUS32, NULL, 0,
-               outBuf, sizeof(outBuf), &count, NULL)) {
-           return outBuf[0];
-           }
-       }
-    return 0;
-}
-
-/****************************************************************************
-REMARKS:
-This function turns off software stereo mode, either directly or via the VxD.
-****************************************************************************/
-static void NAPI _GA_softStereoWaitTillFlipped(void)
-{
-    while (!_GA_softStereoGetFlipStatus())
-       ;
-}
-
-/****************************************************************************
-REMARKS:
-This function turns off software stereo mode, either directly or via the VxD.
-****************************************************************************/
-static void NAPI _GA_softStereoOff(void)
-{
-    if (_PM_hDevice) {
-       DeviceIoControl(_PM_hDevice, PMHELP_GASTEREOOFF32, NULL, 0,
-           NULL, 0, NULL, NULL);
-       }
-}
-
-/****************************************************************************
-REMARKS:
-This function disable the software stereo handler, either directly or via
-the VxD.
-****************************************************************************/
-static void NAPI _GA_softStereoExit(void)
-{
-    if (_PM_hDevice) {
-       DeviceIoControl(_PM_hDevice, PMHELP_GASTEREOEXIT32, NULL, 0,
-           NULL, 0, NULL, NULL);
-       }
-}
-
-/****************************************************************************
-REMARKS:
-We hook this function in here so that we can avoid the memory detect and
-other destructive sequences in the drivers if we are loading the driver
-from a Win32 application (our display drivers in contrast load them inside
-the VxD directly, but the control panel applets use this function).
-****************************************************************************/
-static GA_devCtx * NAPI _GA_loadDriver(
-    N_int32 deviceIndex,
-    N_int32 shared)
-{
-    GA_devCtx   *dc;
-    DWORD       inBuf[1];
-    DWORD       outBuf[1];
-    N_int32     totalMemory = 0,oldIOPL;
-
-    if (deviceIndex >= GA_MAX_DEVICES)
-       PM_fatalError("DeviceIndex too large in GA_loadDriver!");
-    PM_init();
-    inBuf[0] = deviceIndex;
-    if (DeviceIoControl(_PM_hDevice, PMHELP_GETMEMSIZE32,
-           inBuf, sizeof(inBuf), outBuf, sizeof(outBuf), NULL, NULL))
-       totalMemory = outBuf[0];
-    if (totalMemory == 0)
-       totalMemory = 8192;
-    _GA_exports.GA_forceMemSize(totalMemory,shared);
-    oldIOPL = PM_setIOPL(3);
-    dc = ORG_GA_loadDriver(deviceIndex,shared);
-    PM_setIOPL(oldIOPL);
-    return dc;
-}
-
-/****************************************************************************
-REMARKS:
-This function initialises the high precision timing functions for the
-Nucleus loader library.
-****************************************************************************/
-ibool NAPI GA_TimerInit(void)
-{
-    if (_GA_haveCPUID() && (_GA_getCPUIDFeatures() & CPU_HaveRDTSC) != 0) {
-       haveRDTSC = true;
-       return true;
-       }
-    else if (QueryPerformanceFrequency((LARGE_INTEGER*)&countFreq)) {
-       haveRDTSC = false;
-       return true;
-       }
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-This function reads the high resolution timer.
-****************************************************************************/
-void NAPI GA_TimerRead(
-    GA_largeInteger *value)
-{
-    if (haveRDTSC)
-       _GA_readTimeStamp(value);
-    else
-       QueryPerformanceCounter((LARGE_INTEGER*)value);
-}
diff --git a/board/MAI/bios_emulator/scitech/src/common/agplib.c b/board/MAI/bios_emulator/scitech/src/common/agplib.c
deleted file mode 100644 (file)
index 476eedc..0000000
+++ /dev/null
@@ -1,219 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech Nucleus Graphics Architecture
-*
-*               Copyright (C) 1991-1998 SciTech Software, Inc.
-*                            All rights reserved.
-*
-*  ======================================================================
-*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-*  |                                                                    |
-*  |This copyrighted computer code contains proprietary technology      |
-*  |owned by SciTech Software, Inc., located at 505 Wall Street,        |
-*  |Chico, CA 95928 USA (http://www.scitechsoft.com).                   |
-*  |                                                                    |
-*  |The contents of this file are subject to the SciTech Nucleus        |
-*  |License; you may *not* use this file or related software except in  |
-*  |compliance with the License. You may obtain a copy of the License   |
-*  |at http://www.scitechsoft.com/nucleus-license.txt                   |
-*  |                                                                    |
-*  |Software distributed under the License is distributed on an         |
-*  |"AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or      |
-*  |implied. See the License for the specific language governing        |
-*  |rights and limitations under the License.                           |
-*  |                                                                    |
-*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-*  ======================================================================
-*
-* Language:     ANSI C
-* Environment:  Any 32-bit protected mode environment
-*
-* Description:  C module for the Graphics Accelerator Driver API. Uses
-*               the SciTech PM library for interfacing with DOS
-*               extender specific functions.
-*
-****************************************************************************/
-
-#include "nucleus/graphics.h"
-#include "nucleus/agp.h"
-
-/*---------------------------- Global Variables ---------------------------*/
-
-#ifndef DEBUG_AGP_DRIVER
-static AGP_exports  _AGP_exports;
-static int          loaded = false;
-static PE_MODULE    *hModBPD = NULL;
-
-static N_imports _N_imports = {
-    sizeof(N_imports),
-    _OS_delay,
-    };
-
-static AGP_imports _AGP_imports = {
-    sizeof(AGP_imports),
-    };
-#endif
-
-#include "pmimp.h"
-
-/*----------------------------- Implementation ----------------------------*/
-
-#define DLL_NAME        "agp.bpd"
-
-#ifndef DEBUG_AGP_DRIVER
-/****************************************************************************
-REMARKS:
-Fatal error handler for non-exported GA_exports.
-****************************************************************************/
-static void _AGP_fatalErrorHandler(void)
-{
-    PM_fatalError("Unsupported AGP export function called! Please upgrade your copy of AGP!\n");
-}
-
-/****************************************************************************
-PARAMETERS:
-shared  - True to load the driver into shared memory.
-
-REMARKS:
-Loads the Nucleus binary portable DLL into memory and initilises it.
-****************************************************************************/
-static ibool LoadDriver(void)
-{
-    AGP_initLibrary_t   AGP_initLibrary;
-    AGP_exports         *agpExp;
-    char                filename[PM_MAX_PATH];
-    char                bpdpath[PM_MAX_PATH];
-    int                 i,max;
-    ulong               *p;
-
-    /* Check if we have already loaded the driver */
-    if (loaded)
-       return true;
-    PM_init();
-
-    /* Open the BPD file */
-    if (!PM_findBPD(DLL_NAME,bpdpath))
-       return false;
-    strcpy(filename,bpdpath);
-    strcat(filename,DLL_NAME);
-    if ((hModBPD = PE_loadLibrary(filename,false)) == NULL)
-       return false;
-    if ((AGP_initLibrary = (AGP_initLibrary_t)PE_getProcAddress(hModBPD,"_AGP_initLibrary")) == NULL)
-       return false;
-    bpdpath[strlen(bpdpath)-1] = 0;
-    if (strcmp(bpdpath,PM_getNucleusPath()) == 0)
-       strcpy(bpdpath,PM_getNucleusConfigPath());
-    else {
-       PM_backslash(bpdpath);
-       strcat(bpdpath,"config");
-       }
-    if ((agpExp = AGP_initLibrary(bpdpath,filename,GA_getSystemPMImports(),&_N_imports,&_AGP_imports)) == NULL)
-       PM_fatalError("AGP_initLibrary failed!\n");
-    _AGP_exports.dwSize = sizeof(_AGP_exports);
-    max = sizeof(_AGP_exports)/sizeof(AGP_initLibrary_t);
-    for (i = 0,p = (ulong*)&_AGP_exports; i < max; i++)
-       *p++ = (ulong)_AGP_fatalErrorHandler;
-    memcpy(&_AGP_exports,agpExp,MIN(sizeof(_AGP_exports),agpExp->dwSize));
-    loaded = true;
-    return true;
-}
-
-/* The following are stub entry points that the application calls to
- * initialise the Nucleus loader library, and we use this to load our
- * driver DLL from disk and initialise the library using it.
- */
-
-/* {secret} */
-int NAPI AGP_status(void)
-{
-    if (!loaded)
-       return nDriverNotFound;
-    return _AGP_exports.AGP_status();
-}
-
-/* {secret} */
-const char * NAPI AGP_errorMsg(
-    N_int32 status)
-{
-    if (!loaded)
-       return "Unable to load Nucleus device driver!";
-    return _AGP_exports.AGP_errorMsg(status);
-}
-
-/* {secret} */
-AGP_devCtx * NAPI AGP_loadDriver(N_int32 deviceIndex)
-{
-    if (!LoadDriver())
-       return NULL;
-    return _AGP_exports.AGP_loadDriver(deviceIndex);
-}
-
-/* {secret} */
-void NAPI AGP_unloadDriver(
-    AGP_devCtx *dc)
-{
-    if (loaded)
-       _AGP_exports.AGP_unloadDriver(dc);
-}
-
-/* {secret} */
-void NAPI AGP_getGlobalOptions(
-    AGP_globalOptions *options)
-{
-    if (LoadDriver())
-       _AGP_exports.AGP_getGlobalOptions(options);
-}
-
-/* {secret} */
-void NAPI AGP_setGlobalOptions(
-    AGP_globalOptions *options)
-{
-    if (LoadDriver())
-       _AGP_exports.AGP_setGlobalOptions(options);
-}
-
-/* {secret} */
-void NAPI AGP_saveGlobalOptions(
-    AGP_globalOptions *options)
-{
-    if (loaded)
-       _AGP_exports.AGP_saveGlobalOptions(options);
-}
-#endif
-
-/* {secret} */
-void NAPI _OS_delay8253(N_uint32 microSeconds);
-
-/****************************************************************************
-REMARKS:
-This function delays for the specified number of microseconds
-****************************************************************************/
-void NAPI _OS_delay(
-    N_uint32 microSeconds)
-{
-    static ibool    inited = false;
-    static ibool    haveRDTSC;
-    LZTimerObject   tm;
-
-    if (!inited) {
-#ifndef __WIN32_VXD__
-       /* This has been causing problems in VxD's for some reason, so for now */
-       /* we avoid using it. */
-       if (_GA_haveCPUID() && (_GA_getCPUIDFeatures() & CPU_HaveRDTSC) != 0) {
-           ZTimerInit();
-           haveRDTSC = true;
-           }
-       else
-#endif
-           haveRDTSC = false;
-       inited = true;
-       }
-    if (haveRDTSC) {
-       LZTimerOnExt(&tm);
-       while (LZTimerLapExt(&tm) < microSeconds)
-           ;
-       LZTimerOnExt(&tm);
-       }
-    else
-       _OS_delay8253(microSeconds);
-}
diff --git a/board/MAI/bios_emulator/scitech/src/common/center.c b/board/MAI/bios_emulator/scitech/src/common/center.c
deleted file mode 100644 (file)
index 68e17c2..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-/****************************************************************************
-*
-*                  Display Doctor Windows Interface Code
-*
-*  ======================================================================
-*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-*  |                                                                    |
-*  |This copyrighted computer code is a proprietary trade secret of     |
-*  |SciTech Software, Inc., located at 505 Wall Street, Chico, CA 95928 |
-*  |USA (www.scitechsoft.com).  ANY UNAUTHORIZED POSSESSION, USE,       |
-*  |VIEWING, COPYING, MODIFICATION OR DISSEMINATION OF THIS CODE IS     |
-*  |STRICTLY PROHIBITED BY LAW.  Unless you have current, express       |
-*  |written authorization from SciTech to possess or use this code, you |
-*  |may be subject to civil and/or criminal penalties.                  |
-*  |                                                                    |
-*  |If you received this code in error or you would like to report      |
-*  |improper use, please immediately contact SciTech Software, Inc. at  |
-*  |530-894-8400.                                                       |
-*  |                                                                    |
-*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-*  ======================================================================
-*
-* Language:     C++ 3.0
-* Environment:  Win16
-*
-* Description:  Dialog driven configuration program for UniVBE and
-*               WinDirect Professional products.
-*
-****************************************************************************/
-
-#include "center.h"
-
-/*------------------------------ Implementation ---------------------------*/
-
-void _EXPORT CenterWindow(HWND hWndCenter, HWND parent, BOOL repaint)
-/****************************************************************************
-*
-* Function:     CenterWindow
-* Parameters:   hWndCenter  - Window to center
-*               parent      - Handle for parent window
-*               repaint     - true if window should be re-painted
-*
-* Description:  Centers the specified window within the bounds of the
-*               specified parent window. If the parent window is NULL, then
-*               we center it using the Desktop window.
-*
-****************************************************************************/
-{
-    HWND    hWndParent = (parent ? parent : GetDesktopWindow());
-    RECT    RectParent;
-    RECT    RectCenter;
-    int     CenterX,CenterY,Height,Width;
-
-    GetWindowRect(hWndParent, &RectParent);
-    GetWindowRect(hWndCenter, &RectCenter);
-
-    Width = (RectCenter.right - RectCenter.left);
-    Height = (RectCenter.bottom - RectCenter.top);
-    CenterX = ((RectParent.right - RectParent.left) - Width) / 2;
-    CenterY = ((RectParent.bottom - RectParent.top) - Height) / 2;
-
-    if ((CenterX < 0) || (CenterY < 0)) {
-       /* The Center Window is smaller than the parent window. */
-       if (hWndParent != GetDesktopWindow()) {
-           /* If the parent window is not the desktop use the desktop size. */
-           CenterX = (GetSystemMetrics(SM_CXSCREEN) - Width) / 2;
-           CenterY = (GetSystemMetrics(SM_CYSCREEN) - Height) / 2;
-           }
-       CenterX = (CenterX < 0) ? 0: CenterX;
-       CenterY = (CenterY < 0) ? 0: CenterY;
-       }
-    else {
-       CenterX += RectParent.left;
-       CenterY += RectParent.top;
-       }
-
-    /* Copy the values into RectCenter */
-    RectCenter.left = CenterX;
-    RectCenter.right = CenterX + Width;
-    RectCenter.top = CenterY;
-    RectCenter.bottom = CenterY + Height;
-
-    /* Move the window to the new location */
-    MoveWindow(hWndCenter, RectCenter.left, RectCenter.top,
-           (RectCenter.right - RectCenter.left),
-           (RectCenter.bottom - RectCenter.top), repaint);
-}
-
-void _EXPORT CenterLogo(HWND hWndLogo, HWND hWndParent, int CenterY)
-/****************************************************************************
-*
-* Function:     CenterLogo
-* Parameters:   hWndLogo    - Window to center
-*               hWndParent  - Handle for parent window
-*               CenterY     - Top coordinate for logo
-*
-* Description:  Centers the specified window within the bounds of the
-*               specified parent window in the horizontal direction only.
-*
-****************************************************************************/
-{
-    RECT    RectParent;
-    RECT    RectCenter;
-    int     CenterX,Height,Width;
-
-    GetWindowRect(hWndParent, &RectParent);
-    GetWindowRect(hWndLogo, &RectCenter);
-    Width = (RectCenter.right - RectCenter.left);
-    Height = (RectCenter.bottom - RectCenter.top);
-    CenterX = ((RectParent.right - RectParent.left) - Width) / 2;
-
-    /* Copy the values into RectCenter */
-    RectCenter.left = CenterX;
-    RectCenter.right = CenterX + Width;
-    RectCenter.top = CenterY;
-    RectCenter.bottom = CenterY + Height;
-
-    /* Move the window to the new location */
-    MoveWindow(hWndLogo, RectCenter.left, RectCenter.top,
-           (RectCenter.right - RectCenter.left),
-           (RectCenter.bottom - RectCenter.top), false);
-}
diff --git a/board/MAI/bios_emulator/scitech/src/common/cmdline.c b/board/MAI/bios_emulator/scitech/src/common/cmdline.c
deleted file mode 100644 (file)
index 531e5e1..0000000
+++ /dev/null
@@ -1,428 +0,0 @@
-/****************************************************************************
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  any
-*
-* Description:  This module contains code to parse the command line,
-*               extracting options and parameters in standard System V
-*               style.
-*
-****************************************************************************/
-
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include "cmdline.h"
-
-/*------------------------- Global variables ------------------------------*/
-
-int     nextargv    =   1;          /* Index into argv array            */
-char    *nextchar   =   NULL;       /* Pointer to next character        */
-
-/*-------------------------- Implementation -------------------------------*/
-
-#define IS_SWITCH_CHAR(c)       ((c) == '-')
-#define IS_NOT_SWITCH_CHAR(c)   ((c) != '-')
-
-/****************************************************************************
-DESCRIPTION:
-Parse the command line for specific options
-
-HEADER:
-cmdline.h
-
-PARAMETERS:
-argc        - Value passed to program through argc variable
-argv        - Pointer to the argv array passed to the program
-format      - A string representing the expected format of the command line
-argument    - Pointer to optional argument on command line
-
-RETURNS:
-Character code representing the next option parsed from the command line by
-getcmdopt. Returns ALLDONE (-1) when there are no more parameters to be parsed
-on the command line, PARAMETER (-2) when the argument being parsed is a
-parameter and not an option switch and lastly INVALID (-3) if an error
-occured while parsing the command line.
-
-REMARKS:
-Function to parse the command line option switches in UNIX System V style.
-When getcmdopt is called, it returns the character code of the next valid
-option that is parsed from the command line as specified by the Format
-string. The format string should be in the following form:
-
-    "abcd:e:f:"
-
-where a,b and c represent single switch style options and the character
-code returned by getcmdopt is the only value returned. Also d, e and f
-represent options that expect arguments immediately after them on the
-command line. The argument that follows the option on the command line is
-returned via a reference in the pointer argument. Thus a valid command line
-for this format string might be:
-
-    myprogram -adlines -b -f format infile outfile
-
-where a and b will be returned as single character options with no argument,
-while d is returned with the argument lines and f is returned with the
-argument format.
-
-When getcmdopt returns with PARAMETER (we attempted to parse a paramter, not
-an option), the global variable NextArgv will hold an index in the argv
-array to the argument on the command line AFTER the options, ie in the
-above example the string 'infile'. If the parameter is successfully used,
-NextArgv should be incremented and getcmdopt can be called again to parse any
-more options. Thus you can also have options interspersed throught the
-command line. eg:
-
-    myprogram -adlines infile -b outfile -f format
-
-can be made to be a valid form of the above command line.
-****************************************************************************/
-int getcmdopt(
-    int argc,
-    char **argv,
-    char *format,
-    char **argument)
-{
-    char    ch;
-    char    *formatchar;
-
-    if (argc > nextargv) {
-       if (nextchar == NULL) {
-           nextchar = argv[nextargv];      /* Index next argument      */
-           if (nextchar == NULL) {
-               nextargv++;
-               return ALLDONE;             /* No more options          */
-               }
-           if (IS_NOT_SWITCH_CHAR(*nextchar)) {
-               nextchar = NULL;
-               return PARAMETER;           /* We have a parameter      */
-               }
-           nextchar++;                     /* Move past switch operator */
-           if (IS_SWITCH_CHAR(*nextchar)) {
-               nextchar = NULL;
-               return INVALID;             /* Ignore rest of line      */
-               }
-           }
-       if ((ch = *(nextchar++)) == 0) {
-           nextchar = NULL;
-           return INVALID;                 /* No options on line       */
-           }
-
-       if (ch == ':' ||  (formatchar = strchr(format, ch)) == NULL)
-           return INVALID;
-
-       if (*(++formatchar) == ':') {   /* Expect an argument after option */
-           nextargv++;
-           if (*nextchar == 0) {
-               if (argc <= nextargv)
-                   return INVALID;
-               nextchar = argv[nextargv++];
-               }
-           *argument = nextchar;
-           nextchar = NULL;
-           }
-       else {                      /* We have a switch style option    */
-           if (*nextchar == 0) {
-               nextargv++;
-               nextchar = NULL;
-               }
-           *argument = NULL;
-           }
-       return ch;                  /* return the option specifier      */
-       }
-    nextchar = NULL;
-    nextargv++;
-    return ALLDONE;                 /* no arguments on command line     */
-}
-
-/****************************************************************************
-PARAMETERS:
-optarr      - Description for the option we are parsing
-argument    - String to parse
-
-RETURNS:
-INVALID on error, ALLDONE on success.
-
-REMARKS:
-Parses the argument string depending on the type of argument that is
-expected, filling in the argument for that option. Note that to parse a
-string, we simply return a pointer to argument.
-****************************************************************************/
-static int parse_option(
-    Option *optarr,
-    char *argument)
-{
-    int     num_read;
-
-    switch ((int)(optarr->type)) {
-       case OPT_INTEGER:
-           num_read = sscanf(argument,"%d",(int*)optarr->arg);
-           break;
-       case OPT_HEX:
-           num_read = sscanf(argument,"%x",(int*)optarr->arg);
-           break;
-       case OPT_OCTAL:
-           num_read = sscanf(argument,"%o",(int*)optarr->arg);
-           break;
-       case OPT_UNSIGNED:
-           num_read = sscanf(argument,"%u",(uint*)optarr->arg);
-           break;
-       case OPT_LINTEGER:
-           num_read = sscanf(argument,"%ld",(long*)optarr->arg);
-           break;
-       case OPT_LHEX:
-           num_read = sscanf(argument,"%lx",(long*)optarr->arg);
-           break;
-       case OPT_LOCTAL:
-           num_read = sscanf(argument,"%lo",(long*)optarr->arg);
-           break;
-       case OPT_LUNSIGNED:
-           num_read = sscanf(argument,"%lu",(ulong*)optarr->arg);
-           break;
-       case OPT_FLOAT:
-           num_read = sscanf(argument,"%f",(float*)optarr->arg);
-           break;
-       case OPT_DOUBLE:
-           num_read = sscanf(argument,"%lf",(double*)optarr->arg);
-           break;
-       case OPT_LDOUBLE:
-           num_read = sscanf(argument,"%Lf",(long double*)optarr->arg);
-           break;
-       case OPT_STRING:
-           num_read = 1;           /* This always works    */
-           *((char**)optarr->arg) = argument;
-           break;
-       default:
-           return INVALID;
-       }
-
-    if (num_read == 0)
-       return INVALID;
-    else
-       return ALLDONE;
-}
-
-/****************************************************************************
-HEADER:
-cmdline.h
-
-PARAMETERS:
-argc        - Number of arguments on command line
-argv        - Array of command line arguments
-num_opt     - Number of options in option array
-optarr      - Array to specify how to parse the command line
-do_param    - Routine to handle a command line parameter
-
-RETURNS:
-ALLDONE, INVALID or HELP
-
-REMARKS:
-Function to parse the command line according to a table of options. This
-routine calls getcmdopt above to parse each individual option and attempts
-to parse each option into a variable of the specified type. The routine
-can parse integers and long integers in either decimal, octal, hexadecimal
-notation, unsigned integers and unsigned longs, strings and option switches.
-Option switches are simply boolean variables that get turned on if the
-switch was parsed.
-
-Parameters are extracted from the command line by calling a user supplied
-routine do_param() to handle each parameter as it is encountered. The
-routine do_param() should accept a pointer to the parameter on the command
-line and an integer representing how many parameters have been encountered
-(ie: 1 if this is the first parameter, 10 if it is the 10th etc), and return
-ALLDONE upon successfully parsing it or INVALID if the parameter was invalid.
-
-We return either ALLDONE if all the options were successfully parsed,
-INVALID if an invalid option was encountered or HELP if any of -h, -H or
--? were present on the command line.
-****************************************************************************/
-int getargs(
-    int argc,
-    char *argv[],
-    int num_opt,
-    Option optarr[],
-    int (*do_param)(
-       char *param,
-       int num))
-{
-    int     i,opt;
-    char    *argument;
-    int     param_num = 1;
-    char    cmdstr[MAXARG*2 + 4];
-
-    /* Build the command string from the array of options   */
-
-    strcpy(cmdstr,"hH?");
-    for (i = 0,opt = 3; i < num_opt; i++,opt++) {
-       cmdstr[opt] = optarr[i].opt;
-       if (optarr[i].type != OPT_SWITCH) {
-           cmdstr[++opt] = ':';
-           }
-       }
-    cmdstr[opt] = '\0';
-
-    for (;;) {
-       opt = getcmdopt(argc,argv,cmdstr,&argument);
-       switch (opt) {
-           case 'H':
-           case 'h':
-           case '?':
-               return HELP;
-           case ALLDONE:
-               return ALLDONE;
-           case INVALID:
-               return INVALID;
-           case PARAMETER:
-               if (do_param == NULL)
-                   return INVALID;
-               if (do_param(argv[nextargv],param_num) == INVALID)
-                   return INVALID;
-               nextargv++;
-               param_num++;
-               break;
-           default:
-
-               /* Search for the option in the option array. We are
-                * guaranteed to find it.
-                */
-
-               for (i = 0; i < num_opt; i++) {
-                   if (optarr[i].opt == opt)
-                       break;
-                   }
-               if (optarr[i].type == OPT_SWITCH)
-                   *((ibool*)optarr[i].arg) = true;
-               else {
-                   if (parse_option(&optarr[i],argument) == INVALID)
-                       return INVALID;
-                   }
-               break;
-           }
-       }
-}
-
-/****************************************************************************
-HEADER:
-cmdline.h
-
-PARAMETERS:
-num_opt - Number of options in the table
-optarr  - Table of option descriptions
-
-REMARKS:
-Prints the description of each option in a standard format to the standard
-output device. The description for each option is obtained from the table
-of options.
-****************************************************************************/
-void print_desc(
-    int num_opt,
-    Option optarr[])
-{
-    int     i;
-
-    for (i = 0; i < num_opt; i++) {
-       if (optarr[i].type == OPT_SWITCH)
-           printf("  -%c       %s\n",optarr[i].opt,optarr[i].desc);
-       else
-           printf("  -%c<arg>  %s\n",optarr[i].opt,optarr[i].desc);
-       }
-}
-
-/****************************************************************************
-HEADER:
-cmdline.h
-
-PARAMETERS:
-moduleName  - Module name for program
-cmdLine     - Command line to parse
-pargc       - Pointer to 'argc' parameter
-pargv       - Pointer to 'argv' parameter
-maxArgc     - Maximum argv array index
-
-REMARKS:
-Parses a command line from a single string into the C style 'argc' and
-'argv' format. Most useful for Windows programs where the command line
-is passed in verbatim.
-****************************************************************************/
-int parse_commandline(
-    char *moduleName,
-    char *cmdLine,
-    int *pargc,
-    char *argv[],
-    int maxArgv)
-{
-    static char str[512];
-    static char filename[260];
-    char        *prevWord = NULL;
-    ibool        inQuote = FALSE;
-    ibool        noStrip = FALSE;
-    int         argc;
-
-    argc = 0;
-    strcpy(filename,moduleName);
-    argv[argc++] = filename;
-    cmdLine = strncpy(str, cmdLine, sizeof(str)-1);
-    while (*cmdLine) {
-       switch (*cmdLine) {
-           case '"' :
-               if (prevWord != NULL) {
-                   if (inQuote) {
-                       if (!noStrip)
-                           *cmdLine = '\0';
-                       argv [argc++] = prevWord;
-                       prevWord = NULL;
-                       }
-                   else
-                       noStrip = TRUE;
-                   }
-               inQuote = !inQuote;
-               break;
-           case ' ' :
-           case '\t' :
-               if (!inQuote) {
-                   if (prevWord != NULL) {
-                       *cmdLine = '\0';
-                       argv [argc++] = prevWord;
-                       prevWord = NULL;
-                       noStrip = FALSE;
-                       }
-                   }
-               break;
-           default :
-               if (prevWord == NULL)
-                   prevWord = cmdLine;
-               break;
-               }
-       if (argc >= maxArgv - 1)
-           break;
-       cmdLine++;
-       }
-
-    if ((prevWord != NULL || (inQuote && prevWord != NULL)) && argc < maxArgv - 1) {
-       *cmdLine = '\0';
-       argv [argc++] = prevWord;
-       }
-    argv[argc] = NULL;
-
-    /* Return updated parameters */
-    return (*pargc = argc);
-}
diff --git a/board/MAI/bios_emulator/scitech/src/common/gabeos.c b/board/MAI/bios_emulator/scitech/src/common/gabeos.c
deleted file mode 100644 (file)
index a934bd1..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech Nucleus Graphics Architecture
-*
-*               Copyright (C) 1991-1998 SciTech Software, Inc.
-*                            All rights reserved.
-*
-*  ======================================================================
-*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-*  |                                                                    |
-*  |This copyrighted computer code contains proprietary technology      |
-*  |owned by SciTech Software, Inc., located at 505 Wall Street,        |
-*  |Chico, CA 95928 USA (http://www.scitechsoft.com).                   |
-*  |                                                                    |
-*  |The contents of this file are subject to the SciTech Nucleus        |
-*  |License; you may *not* use this file or related software except in  |
-*  |compliance with the License. You may obtain a copy of the License   |
-*  |at http://www.scitechsoft.com/nucleus-license.txt                   |
-*  |                                                                    |
-*  |Software distributed under the License is distributed on an         |
-*  |"AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or      |
-*  |implied. See the License for the specific language governing        |
-*  |rights and limitations under the License.                           |
-*  |                                                                    |
-*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-*  ======================================================================
-*
-* Language:     ANSI C
-* Environment:  Linux
-*
-* Description:  OS specific Nucleus Graphics Architecture services for
-*               the Linux operating system.
-*
-****************************************************************************/
-
-#include "nucleus/graphics.h"
-#include <sys/time.h>
-
-static ibool            haveRDTSC;
-
-/*-------------------------- Implementation -------------------------------*/
-
-/****************************************************************************
-PARAMETERS:
-path    - Local path to the Nucleus driver files.
-
-REMARKS:
-This function is used by the application program to override the location
-of the Nucleus driver files that are loaded. Normally the loader code
-will look in the system Nucleus directories first, then in the 'drivers'
-directory relative to the current working directory, and finally relative
-to the MGL_ROOT environment variable.
-****************************************************************************/
-void NAPI GA_setLocalPath(
-    const char *path)
-{
-    PM_setLocalBPDPath(path);
-}
-
-/****************************************************************************
-RETURNS:
-Pointer to the system wide PM library imports, or the internal version if none
-
-REMARKS:
-In order to support deploying new Nucleus drivers that may require updated
-PM library functions, we check here to see if there is a system wide version
-of the PM functions available. If so we return those functions for use with
-the system wide Nucleus drivers, otherwise the compiled in version of the PM
-library is used with the application local version of Nucleus.
-****************************************************************************/
-PM_imports * NAPI GA_getSystemPMImports(void)
-{
-    /* TODO: We may very well want to provide a system shared library */
-    /*       that eports the PM functions required by the Nucleus library */
-    /*       for BeOS here. That will eliminate fatal errors loading new */
-    /*       drivers on BeOS! */
-    return &_PM_imports;
-}
-
-/****************************************************************************
-REMARKS:
-Nothing special for this OS.
-****************************************************************************/
-ibool NAPI GA_getSharedExports(
-    GA_exports *gaExp,
-    ibool shared)
-{
-    (void)gaExp;
-    (void)shared;
-    return false;
-}
-
-#ifndef TEST_HARNESS
-/****************************************************************************
-REMARKS:
-Nothing special for this OS
-****************************************************************************/
-ibool NAPI GA_queryFunctions(
-    GA_devCtx *dc,
-    N_uint32 id,
-    void _FAR_ *funcs)
-{
-    return __GA_exports.GA_queryFunctions(dc,id,funcs);
-}
-
-/****************************************************************************
-REMARKS:
-Nothing special for this OS
-****************************************************************************/
-ibool NAPI REF2D_queryFunctions(
-    REF2D_driver *ref2d,
-    N_uint32 id,
-    void _FAR_ *funcs)
-{
-    return __GA_exports.REF2D_queryFunctions(ref2d,id,funcs);
-}
-#endif
-
-/****************************************************************************
-REMARKS:
-This function initialises the high precision timing functions for the
-Nucleus loader library.
-****************************************************************************/
-ibool NAPI GA_TimerInit(void)
-{
-    if (_GA_haveCPUID() && (_GA_getCPUIDFeatures() & CPU_HaveRDTSC) != 0)
-       haveRDTSC = true;
-    return true;
-}
-
-/****************************************************************************
-REMARKS:
-This function reads the high resolution timer.
-****************************************************************************/
-void NAPI GA_TimerRead(
-    GA_largeInteger *value)
-{
-    if (haveRDTSC)
-       _GA_readTimeStamp(value);
-    else {
-       struct timeval t;
-       gettimeofday(&t, NULL);
-       value->low = t.tv_sec*1000000 + t.tv_usec;
-       value->high = 0;
-       }
-}
diff --git a/board/MAI/bios_emulator/scitech/src/common/gados.c b/board/MAI/bios_emulator/scitech/src/common/gados.c
deleted file mode 100644 (file)
index d2be776..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech Nucleus Graphics Architecture
-*
-*               Copyright (C) 1991-1998 SciTech Software, Inc.
-*                            All rights reserved.
-*
-*  ======================================================================
-*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-*  |                                                                    |
-*  |This copyrighted computer code contains proprietary technology      |
-*  |owned by SciTech Software, Inc., located at 505 Wall Street,        |
-*  |Chico, CA 95928 USA (http://www.scitechsoft.com).                   |
-*  |                                                                    |
-*  |The contents of this file are subject to the SciTech Nucleus        |
-*  |License; you may *not* use this file or related software except in  |
-*  |compliance with the License. You may obtain a copy of the License   |
-*  |at http://www.scitechsoft.com/nucleus-license.txt                   |
-*  |                                                                    |
-*  |Software distributed under the License is distributed on an         |
-*  |"AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or      |
-*  |implied. See the License for the specific language governing        |
-*  |rights and limitations under the License.                           |
-*  |                                                                    |
-*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-*  ======================================================================
-*
-* Language:     ANSI C
-* Environment:  MSDOS
-*
-* Description:  OS specific Nucleus Graphics Architecture services for
-*               the MSDOS operating system.
-*
-****************************************************************************/
-
-#include "pm_help.h"
-#include "pmapi.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-/*-------------------------- Implementation -------------------------------*/
-
-/****************************************************************************
-PARAMETERS:
-path    - Local path to the Nucleus driver files.
-
-REMARKS:
-This function is used by the application program to override the location
-of the Nucleus driver files that are loaded. Normally the loader code
-will look in the system Nucleus directories first, then in the 'drivers'
-directory relative to the current working directory, and finally relative
-to the MGL_ROOT environment variable.
-****************************************************************************/
-void NAPI GA_setLocalPath(
-    const char *path)
-{
-    PM_setLocalBPDPath(path);
-}
-
-/****************************************************************************
-RETURNS:
-Pointer to the system wide PM library imports, or the internal version if none
-
-REMARKS:
-Nothing to do here for DOS. Basically since DOS has no system wide shared
-library mechanism we are essentially screwed if the binary API changes.
-By default for 32-bit DOS apps the local Nucleus drivers should always be
-used in preference to the system wide Nucleus drivers.
-****************************************************************************/
-PM_imports * NAPI GA_getSystemPMImports(void)
-{
-    return &_PM_imports;
-}
-
-/****************************************************************************
-REMARKS:
-Nothing special for this OS.
-****************************************************************************/
-ibool NAPI GA_getSharedExports(
-    GA_exports *gaExp,
-    ibool shared)
-{
-    (void)gaExp;
-    (void)shared;
-    return false;
-}
-
-#if !defined(TEST_HARNESS) && !defined(VBETEST)
-/****************************************************************************
-REMARKS:
-Nothing special for this OS
-****************************************************************************/
-ibool NAPI GA_queryFunctions(
-    GA_devCtx *dc,
-    N_uint32 id,
-    void _FAR_ *funcs)
-{
-    return __GA_exports.GA_queryFunctions(dc,id,funcs);
-}
-
-/****************************************************************************
-REMARKS:
-Nothing special for this OS
-****************************************************************************/
-ibool NAPI REF2D_queryFunctions(
-    REF2D_driver *ref2d,
-    N_uint32 id,
-    void _FAR_ *funcs)
-{
-    return __GA_exports.REF2D_queryFunctions(ref2d,id,funcs);
-}
-#endif
-
-/****************************************************************************
-REMARKS:
-This function initialises the high precision timing functions for the DOS
-Nucleus loader library.
-****************************************************************************/
-ibool NAPI GA_TimerInit(void)
-{
-    if (_GA_haveCPUID() && (_GA_getCPUIDFeatures() & CPU_HaveRDTSC) != 0)
-       return true;
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-This function reads the high resolution timer.
-****************************************************************************/
-void NAPI GA_TimerRead(
-    GA_largeInteger *value)
-{
-    _GA_readTimeStamp(value);
-}
diff --git a/board/MAI/bios_emulator/scitech/src/common/galib.c b/board/MAI/bios_emulator/scitech/src/common/galib.c
deleted file mode 100644 (file)
index f2eacc3..0000000
+++ /dev/null
@@ -1,268 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech Nucleus Graphics Architecture
-*
-*               Copyright (C) 1991-1998 SciTech Software, Inc.
-*                            All rights reserved.
-*
-*  ======================================================================
-*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-*  |                                                                    |
-*  |This copyrighted computer code contains proprietary technology      |
-*  |owned by SciTech Software, Inc., located at 505 Wall Street,        |
-*  |Chico, CA 95928 USA (http://www.scitechsoft.com).                   |
-*  |                                                                    |
-*  |The contents of this file are subject to the SciTech Nucleus        |
-*  |License; you may *not* use this file or related software except in  |
-*  |compliance with the License. You may obtain a copy of the License   |
-*  |at http://www.scitechsoft.com/nucleus-license.txt                   |
-*  |                                                                    |
-*  |Software distributed under the License is distributed on an         |
-*  |"AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or      |
-*  |implied. See the License for the specific language governing        |
-*  |rights and limitations under the License.                           |
-*  |                                                                    |
-*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-*  ======================================================================
-*
-* Language:     ANSI C
-* Environment:  Any 32-bit protected mode environment
-*
-* Description:  C module for the Graphics Accelerator Driver API. Uses
-*               the SciTech PM library for interfacing with DOS
-*               extender specific functions.
-*
-****************************************************************************/
-
-#include "nucleus/graphics.h"
-#if defined(__WIN32_VXD__) || defined(__NT_DRIVER__)
-#include "sdd/sddhelp.h"
-#else
-#include <stdio.h>
-#include <stdlib.h>
-#endif
-
-/*---------------------------- Global Variables ---------------------------*/
-
-#ifndef TEST_HARNESS
-GA_exports  _VARAPI __GA_exports;
-static int          loaded = false;
-static PE_MODULE    *hModBPD = NULL;
-
-static N_imports _N_imports = {
-    sizeof(N_imports),
-    _OS_delay,
-    };
-
-static GA_imports _GA_imports = {
-    sizeof(GA_imports),
-    GA_getSharedInfo,
-    GA_TimerInit,
-    GA_TimerRead,
-    GA_TimerDifference,
-    };
-#endif
-
-/*----------------------------- Implementation ----------------------------*/
-
-#define DLL_NAME        "graphics.bpd"
-
-/****************************************************************************
-REMARKS:
-This function is no longer used but we must implement it and return NULL
-for compatibility with older binary drivers.
-****************************************************************************/
-GA_sharedInfo * NAPI GA_getSharedInfo(
-    int device)
-{
-    return NULL;
-}
-
-#ifndef TEST_HARNESS
-/****************************************************************************
-REMARKS:
-Fatal error handler for non-exported GA_exports.
-****************************************************************************/
-static void _GA_fatalErrorHandler(void)
-{
-    PM_fatalError("Unsupported Nucleus export function called! Please upgrade your copy of Nucleus!\n");
-}
-
-/****************************************************************************
-PARAMETERS:
-shared  - True to load the driver into shared memory.
-
-REMARKS:
-Loads the Nucleus binary portable DLL into memory and initilises it.
-****************************************************************************/
-static ibool LoadDriver(
-    ibool shared)
-{
-    GA_initLibrary_t    GA_initLibrary;
-    GA_exports          *gaExp;
-    char                filename[PM_MAX_PATH];
-    char                bpdpath[PM_MAX_PATH];
-    int                 i,max;
-    ulong               *p;
-
-    /* Check if we have already loaded the driver */
-    if (loaded)
-       return true;
-    PM_init();
-
-    /* First try to see if we can find the system wide shared exports
-     * if they are available. Under OS/2 this connects to our global
-     * shared Nucleus loader in SDDPMI.DLL.
-     */
-    __GA_exports.dwSize = sizeof(__GA_exports);
-    if (GA_getSharedExports(&__GA_exports,shared))
-       return loaded = true;
-
-    /* Open the BPD file */
-    if (!PM_findBPD(DLL_NAME,bpdpath))
-       return false;
-    strcpy(filename,bpdpath);
-    strcat(filename,DLL_NAME);
-    if ((hModBPD = PE_loadLibrary(filename,shared)) == NULL)
-       return false;
-    if ((GA_initLibrary = (GA_initLibrary_t)PE_getProcAddress(hModBPD,"_GA_initLibrary")) == NULL)
-       return false;
-    bpdpath[strlen(bpdpath)-1] = 0;
-    if (strcmp(bpdpath,PM_getNucleusPath()) == 0)
-       strcpy(bpdpath,PM_getNucleusConfigPath());
-    else {
-       PM_backslash(bpdpath);
-       strcat(bpdpath,"config");
-       }
-    if ((gaExp = GA_initLibrary(shared,bpdpath,filename,GA_getSystemPMImports(),&_N_imports,&_GA_imports)) == NULL)
-       PM_fatalError("GA_initLibrary failed!\n");
-
-    /* Initialize all default imports to point to fatal error handler
-     * for upwards compatibility, and copy the exported functions.
-     */
-    max = sizeof(__GA_exports)/sizeof(GA_initLibrary_t);
-    for (i = 0,p = (ulong*)&__GA_exports; i < max; i++)
-       *p++ = (ulong)_GA_fatalErrorHandler;
-    memcpy(&__GA_exports,gaExp,MIN(sizeof(__GA_exports),gaExp->dwSize));
-    loaded = true;
-    return true;
-}
-
-/* The following are stub entry points that the application calls to
- * initialise the Nucleus loader library, and we use this to load our
- * driver DLL from disk and initialise the library using it.
- */
-
-/* {secret} */
-int NAPI GA_status(void)
-{
-    if (!loaded)
-       return nDriverNotFound;
-    return __GA_exports.GA_status();
-}
-
-/* {secret} */
-const char * NAPI GA_errorMsg(
-    N_int32 status)
-{
-    if (!loaded)
-       return "Unable to load Nucleus device driver!";
-    return __GA_exports.GA_errorMsg(status);
-}
-
-/* {secret} */
-int NAPI GA_getDaysLeft(N_int32 shared)
-{
-    if (!LoadDriver(shared))
-       return -1;
-    return __GA_exports.GA_getDaysLeft(shared);
-}
-
-/* {secret} */
-int NAPI GA_registerLicense(uchar *license,N_int32 shared)
-{
-    if (!LoadDriver(shared))
-       return 0;
-    return __GA_exports.GA_registerLicense(license,shared);
-}
-
-/* {secret} */
-ibool NAPI GA_loadInGUI(N_int32 shared)
-{
-    if (!LoadDriver(shared))
-       return false;
-    return __GA_exports.GA_loadInGUI(shared);
-}
-
-/* {secret} */
-int NAPI GA_enumerateDevices(N_int32 shared)
-{
-    if (!LoadDriver(shared))
-       return 0;
-    return __GA_exports.GA_enumerateDevices(shared);
-}
-
-/* {secret} */
-GA_devCtx * NAPI GA_loadDriver(N_int32 deviceIndex,N_int32 shared)
-{
-    if (!LoadDriver(shared))
-       return NULL;
-    return __GA_exports.GA_loadDriver(deviceIndex,shared);
-}
-
-/* {secret} */
-void NAPI GA_getGlobalOptions(
-    GA_globalOptions *options,
-    ibool shared)
-{
-    if (LoadDriver(shared))
-       __GA_exports.GA_getGlobalOptions(options,shared);
-}
-
-/* {secret} */
-PE_MODULE * NAPI GA_loadLibrary(
-    const char *szBPDName,
-    ulong *size,
-    ibool shared)
-{
-    if (!LoadDriver(shared))
-       return NULL;
-    return __GA_exports.GA_loadLibrary(szBPDName,size,shared);
-}
-
-/* {secret} */
-GA_devCtx * NAPI GA_getCurrentDriver(
-    N_int32 deviceIndex)
-{
-    /* Bail for older drivers that didn't export this function! */
-    if (!__GA_exports.GA_getCurrentDriver)
-       return NULL;
-    return __GA_exports.GA_getCurrentDriver(deviceIndex);
-}
-
-/* {secret} */
-REF2D_driver * NAPI GA_getCurrentRef2d(
-    N_int32 deviceIndex)
-{
-    /* Bail for older drivers that didn't export this function! */
-    if (!__GA_exports.GA_getCurrentRef2d)
-       return NULL;
-    return __GA_exports.GA_getCurrentRef2d(deviceIndex);
-}
-
-/* {secret} */
-int NAPI GA_isOEMVersion(ibool shared)
-{
-    if (!LoadDriver(shared))
-       return 0;
-    return __GA_exports.GA_isOEMVersion(shared);
-}
-
-/* {secret} */
-N_uint32 * NAPI GA_getLicensedDevices(ibool shared)
-{
-    if (!LoadDriver(shared))
-       return 0;
-    return __GA_exports.GA_getLicensedDevices(shared);
-}
-#endif
diff --git a/board/MAI/bios_emulator/scitech/src/common/galinux.c b/board/MAI/bios_emulator/scitech/src/common/galinux.c
deleted file mode 100644 (file)
index 47e4e85..0000000
+++ /dev/null
@@ -1,148 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech Nucleus Graphics Architecture
-*
-*               Copyright (C) 1991-1998 SciTech Software, Inc.
-*                            All rights reserved.
-*
-*  ======================================================================
-*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-*  |                                                                    |
-*  |This copyrighted computer code contains proprietary technology      |
-*  |owned by SciTech Software, Inc., located at 505 Wall Street,        |
-*  |Chico, CA 95928 USA (http://www.scitechsoft.com).                   |
-*  |                                                                    |
-*  |The contents of this file are subject to the SciTech Nucleus        |
-*  |License; you may *not* use this file or related software except in  |
-*  |compliance with the License. You may obtain a copy of the License   |
-*  |at http://www.scitechsoft.com/nucleus-license.txt                   |
-*  |                                                                    |
-*  |Software distributed under the License is distributed on an         |
-*  |"AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or      |
-*  |implied. See the License for the specific language governing        |
-*  |rights and limitations under the License.                           |
-*  |                                                                    |
-*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-*  ======================================================================
-*
-* Language:     ANSI C
-* Environment:  Linux
-*
-* Description:  OS specific Nucleus Graphics Architecture services for
-*               the Linux operating system.
-*
-****************************************************************************/
-
-#include "nucleus/graphics.h"
-#include <sys/time.h>
-
-/*---------------------------- Global Variables ---------------------------*/
-
-static ibool        haveRDTSC;
-
-/*-------------------------- Implementation -------------------------------*/
-
-/****************************************************************************
-PARAMETERS:
-path    - Local path to the Nucleus driver files.
-
-REMARKS:
-This function is used by the application program to override the location
-of the Nucleus driver files that are loaded. Normally the loader code
-will look in the system Nucleus directories first, then in the 'drivers'
-directory relative to the current working directory, and finally relative
-to the MGL_ROOT environment variable.
-****************************************************************************/
-void NAPI GA_setLocalPath(
-    const char *path)
-{
-    PM_setLocalBPDPath(path);
-}
-
-/****************************************************************************
-RETURNS:
-Pointer to the system wide PM library imports, or the internal version if none
-
-REMARKS:
-In order to support deploying new Nucleus drivers that may require updated
-PM library functions, we check here to see if there is a system wide version
-of the PM functions available. If so we return those functions for use with
-the system wide Nucleus drivers, otherwise the compiled in version of the PM
-library is used with the application local version of Nucleus.
-****************************************************************************/
-PM_imports * NAPI GA_getSystemPMImports(void)
-{
-    /* TODO: We may very well want to provide a system shared library */
-    /*       that eports the PM functions required by the Nucleus library */
-    /*       for Linux here. That will eliminate fatal errors loading new */
-    /*       drivers on Linux! */
-    return &_PM_imports;
-}
-
-/****************************************************************************
-REMARKS:
-Nothing special for this OS.
-****************************************************************************/
-ibool NAPI GA_getSharedExports(
-    GA_exports *gaExp,
-    ibool shared)
-{
-    (void)gaExp;
-    (void)shared;
-    return false;
-}
-
-#ifndef TEST_HARNESS
-/****************************************************************************
-REMARKS:
-Nothing special for this OS
-****************************************************************************/
-ibool NAPI GA_queryFunctions(
-    GA_devCtx *dc,
-    N_uint32 id,
-    void _FAR_ *funcs)
-{
-    return __GA_exports.GA_queryFunctions(dc,id,funcs);
-}
-
-/****************************************************************************
-REMARKS:
-Nothing special for this OS
-****************************************************************************/
-ibool NAPI REF2D_queryFunctions(
-    REF2D_driver *ref2d,
-    N_uint32 id,
-    void _FAR_ *funcs)
-{
-    return __GA_exports.REF2D_queryFunctions(ref2d,id,funcs);
-}
-#endif
-
-/****************************************************************************
-REMARKS:
-This function initialises the high precision timing functions for the
-Nucleus loader library.
-****************************************************************************/
-ibool NAPI GA_TimerInit(void)
-{
-    if (_GA_haveCPUID() && (_GA_getCPUIDFeatures() & CPU_HaveRDTSC) != 0)
-       haveRDTSC = true;
-    return true;
-}
-
-/****************************************************************************
-REMARKS:
-This function reads the high resolution timer.
-****************************************************************************/
-void NAPI GA_TimerRead(
-    GA_largeInteger *value)
-{
-    if (haveRDTSC)
-       _GA_readTimeStamp(value);
-    else {
-       struct timeval t;
-       gettimeofday(&t, NULL);
-       value->low = t.tv_sec*1000000 + t.tv_usec;
-       value->high = 0;
-       }
-}
diff --git a/board/MAI/bios_emulator/scitech/src/common/gantdrv.c b/board/MAI/bios_emulator/scitech/src/common/gantdrv.c
deleted file mode 100644 (file)
index 050f737..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech Nucleus Graphics Architecture
-*
-*               Copyright (C) 1991-1998 SciTech Software, Inc.
-*                            All rights reserved.
-*
-*  ======================================================================
-*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-*  |                                                                    |
-*  |This copyrighted computer code contains proprietary technology      |
-*  |owned by SciTech Software, Inc., located at 505 Wall Street,        |
-*  |Chico, CA 95928 USA (http://www.scitechsoft.com).                   |
-*  |                                                                    |
-*  |The contents of this file are subject to the SciTech Nucleus        |
-*  |License; you may *not* use this file or related software except in  |
-*  |compliance with the License. You may obtain a copy of the License   |
-*  |at http://www.scitechsoft.com/nucleus-license.txt                   |
-*  |                                                                    |
-*  |Software distributed under the License is distributed on an         |
-*  |"AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or      |
-*  |implied. See the License for the specific language governing        |
-*  |rights and limitations under the License.                           |
-*  |                                                                    |
-*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-*  ======================================================================
-*
-* Language:     ANSI C
-* Environment:  NT device driver
-*
-* Description:  OS specific Nucleus Graphics Architecture services for
-*               the NT device drivers.
-*
-****************************************************************************/
-
-#include "sdd/sddhelp.h"
-
-/*------------------------- Global Variables ------------------------------*/
-
-static ibool            haveRDTSC;
-
-/*-------------------------- Implementation -------------------------------*/
-
-/****************************************************************************
-PARAMETERS:
-path    - Local path to the Nucleus driver files.
-
-REMARKS:
-This function is used by the application program to override the location
-of the Nucleus driver files that are loaded. Normally the loader code
-will look in the system Nucleus directories first, then in the 'drivers'
-directory relative to the current working directory, and finally relative
-to the MGL_ROOT environment variable.
-****************************************************************************/
-void NAPI GA_setLocalPath(
-    const char *path)
-{
-    PM_setLocalBPDPath(path);
-}
-
-/****************************************************************************
-RETURNS:
-Pointer to the system wide PM library imports, or the internal version if none
-
-REMARKS:
-Nothing special for this OS.
-****************************************************************************/
-PM_imports * NAPI GA_getSystemPMImports(void)
-{
-    return &_PM_imports;
-}
-
-/****************************************************************************
-REMARKS:
-Nothing special for this OS.
-****************************************************************************/
-ibool NAPI GA_getSharedExports(
-    GA_exports *gaExp,
-    ibool shared)
-{
-    (void)gaExp;
-    (void)shared;
-    return false;
-}
-
-#ifndef TEST_HARNESS
-/****************************************************************************
-REMARKS:
-Nothing special for this OS
-****************************************************************************/
-ibool NAPI GA_queryFunctions(
-    GA_devCtx *dc,
-    N_uint32 id,
-    void _FAR_ *funcs)
-{
-    return __GA_exports.GA_queryFunctions(dc,id,funcs);
-}
-
-/****************************************************************************
-REMARKS:
-Nothing special for this OS
-****************************************************************************/
-ibool NAPI REF2D_queryFunctions(
-    REF2D_driver *ref2d,
-    N_uint32 id,
-    void _FAR_ *funcs)
-{
-    return __GA_exports.REF2D_queryFunctions(ref2d,id,funcs);
-}
-#endif
-
-/****************************************************************************
-REMARKS:
-This function initialises the high precision timing functions for the
-Nucleus loader library.
-****************************************************************************/
-ibool NAPI GA_TimerInit(void)
-{
-    if (_GA_haveCPUID() && (_GA_getCPUIDFeatures() & CPU_HaveRDTSC) != 0) {
-       haveRDTSC = true;
-       }
-    return true;
-}
-
-/****************************************************************************
-REMARKS:
-This function reads the high resolution timer.
-****************************************************************************/
-void NAPI GA_TimerRead(
-    GA_largeInteger *value)
-{
-    if (haveRDTSC)
-       _GA_readTimeStamp(value);
-    else
-       KeQuerySystemTime((LARGE_INTEGER*)value);
-}
diff --git a/board/MAI/bios_emulator/scitech/src/common/gaos2.c b/board/MAI/bios_emulator/scitech/src/common/gaos2.c
deleted file mode 100644 (file)
index 26e6503..0000000
+++ /dev/null
@@ -1,248 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech Nucleus Graphics Architecture
-*
-*               Copyright (C) 1991-1998 SciTech Software, Inc.
-*                            All rights reserved.
-*
-*  ======================================================================
-*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-*  |                                                                    |
-*  |This copyrighted computer code contains proprietary technology      |
-*  |owned by SciTech Software, Inc., located at 505 Wall Street,        |
-*  |Chico, CA 95928 USA (http://www.scitechsoft.com).                   |
-*  |                                                                    |
-*  |The contents of this file are subject to the SciTech Nucleus        |
-*  |License; you may *not* use this file or related software except in  |
-*  |compliance with the License. You may obtain a copy of the License   |
-*  |at http://www.scitechsoft.com/nucleus-license.txt                   |
-*  |                                                                    |
-*  |Software distributed under the License is distributed on an         |
-*  |"AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or      |
-*  |implied. See the License for the specific language governing        |
-*  |rights and limitations under the License.                           |
-*  |                                                                    |
-*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-*  ======================================================================
-*
-* Language:     ANSI C
-* Environment:  OS/2 32-bit
-*
-* Description:  OS specific Nucleus Graphics Architecture services for
-*               the OS/2 operating system environments.
-*
-****************************************************************************/
-
-#include "pm_help.h"
-#define INCL_DOSERRORS
-#define INCL_DOS
-#define INCL_SUB
-#define INCL_VIO
-#define INCL_KBD
-#include <os2.h>
-
-/*--------------------------- Global variables ----------------------------*/
-
-static ibool    haveRDTSC = false;
-static ulong    parms[3];       /* Must not cross 64Kb boundary!    */
-static ulong    result[4];      /* Must not cross 64Kb boundary!    */
-
-/*-------------------------- Implementation -------------------------------*/
-
-/****************************************************************************
-PARAMETERS:
-func        - Helper device driver function to call
-
-RETURNS:
-First return value from the device driver in parmsOut[0]
-
-REMARKS:
-Function to open our helper device driver, call it and close the file
-handle. Note that we have to open the device driver for every call because
-of two problems:
-
- 1. We cannot open a single file handle in a DLL that is shared amongst
-    programs, since every process must have it's own open file handle.
-
- 2. For some reason there appears to be a limit of about 12 open file
-    handles on a device driver in the system. Hence when we open more
-    than about 12 file handles things start to go very strange.
-
-Hence we simply open the file handle every time that we need to call the
-device driver to work around these problems.
-****************************************************************************/
-static ulong CallSDDHelp(
-    int func)
-{
-    static ulong    inLen;          /* Must not cross 64Kb boundary!    */
-    static ulong    outLen;         /* Must not cross 64Kb boundary!    */
-    HFILE           hSDDHelp;
-
-    /* If this code in here fails, we are screwed! Many of our drivers
-     * use this code and don't have a C library, so we simply assume we
-     * can't fail here.
-     */
-    DosOpen(PMHELP_NAME,&hSDDHelp,&result[0],0,0,
-           FILE_OPEN, OPEN_SHARE_DENYNONE | OPEN_ACCESS_READWRITE,
-           NULL);
-    DosDevIOCtl(hSDDHelp,PMHELP_IOCTL,func,
-            &parms, inLen = sizeof(parms), &inLen,
-           &result, outLen = sizeof(result), &outLen);
-    DosClose(hSDDHelp);
-    return result[0];
-}
-
-/****************************************************************************
-PARAMETERS:
-path    - Local path to the Nucleus driver files.
-
-REMARKS:
-This function is used by the application program to override the location
-of the Nucleus driver files that are loaded. Normally the loader code
-will look in the system Nucleus directories first, then in the 'drivers'
-directory relative to the current working directory, and finally relative
-to the MGL_ROOT environment variable.
-****************************************************************************/
-void NAPI GA_setLocalPath(
-    const char *path)
-{
-    PM_setLocalBPDPath(path);
-}
-
-/****************************************************************************
-RETURNS:
-Pointer to the system wide PM library imports, or the internal version if none
-
-REMARKS:
-For OS/2 we don't need to do anything special because Nucleus is always
-loaded via the shared SDDPMI driver when SDD is loaded so we don't need
-a system wide PM library imports function.
-****************************************************************************/
-PM_imports * NAPI GA_getSystemPMImports(void)
-{
-    return &_PM_imports;
-}
-
-/****************************************************************************
-PARAMETERS:
-gaExp   - Place to store the exported functions
-shared  - True if connecting to the shared, global Nucleus driver
-
-REMARKS:
-For OS/2 if SDD is loaded we *always* connect to the shared Nucleus functions
-contained within the SDDPMI driver. This allows the Nucleus functions contained
-within this driver to be utilised by all Nucleus apps in the system and
-maintains a consistent state between versions.
-****************************************************************************/
-ibool NAPI GA_getSharedExports(
-    GA_exports *gaExp,
-    ibool shared)
-{
-    /* In test harness mode, we need to load a local copy of Nucleus */
-#if !defined (TEST_HARNESS) || defined (DEBUG_SDDPMI)
-    HMODULE     hModSDDPMI;
-    char        buf[80];
-    GA_exports  *exp;
-
-    /* Initialise the PM library and connect to our runtime DLL's */
-    PM_init();
-    if (CallSDDHelp(PMHELP_GETSHAREDEXP) != 0) {
-       /* We have found the shared Nucleus exports. Because not all processes
-        * map to SDDPMI.DLL, we need to ensure that we connect to this
-        * DLL so that it gets mapped into our address space (that is
-        * where the shared Nucleus loader code is located). Simply doing a
-        * DosLoadModule on it is enough for this.
-        */
-       DosLoadModule((PSZ)buf,sizeof(buf),(PSZ)"SDDPMI.DLL",&hModSDDPMI);
-       exp = (GA_exports*)result[0];
-       memcpy(gaExp,exp,MIN(gaExp->dwSize,exp->dwSize));
-       return true;
-       }
-#endif
-    (void)shared;
-    return false;
-}
-
-#ifndef TEST_HARNESS
-/****************************************************************************
-REMARKS:
-Nothing special for this OS
-****************************************************************************/
-ibool NAPI GA_queryFunctions(
-    GA_devCtx *dc,
-    N_uint32 id,
-    void _FAR_ *funcs)
-{
-    return __GA_exports.GA_queryFunctions(dc,id,funcs);
-}
-
-/****************************************************************************
-REMARKS:
-Nothing special for this OS
-****************************************************************************/
-ibool NAPI REF2D_queryFunctions(
-    REF2D_driver *ref2d,
-    N_uint32 id,
-    void _FAR_ *funcs)
-{
-    return __GA_exports.REF2D_queryFunctions(ref2d,id,funcs);
-}
-#endif
-
-/****************************************************************************
-REMARKS:
-This function initialises the high precision timing functions for the
-Nucleus loader library.
-****************************************************************************/
-ibool NAPI GA_TimerInit(void)
-{
-    if (_GA_haveCPUID() && (_GA_getCPUIDFeatures() & CPU_HaveRDTSC) != 0)
-       haveRDTSC = true;
-    return true;
-}
-
-/****************************************************************************
-REMARKS:
-This function reads the high resolution timer.
-****************************************************************************/
-void NAPI GA_TimerRead(
-    GA_largeInteger *value)
-{
-    if (haveRDTSC)
-       _GA_readTimeStamp(value);
-    else
-       DosTmrQueryTime((QWORD*)value);
-}
-
-/****************************************************************************
-REMARKS:
-On OS/2, we need special memory allocation functions if we build SDDPMI in
-test harness mode. But if we build GATest etc. in test mode, we want to use
-the normal C runtime functions, so route them back here.
-****************************************************************************/
-
-#if defined (TEST_HARNESS) && !defined (DEBUG_SDDPMI)
-
-/* Undefine these macros first or we'll recurse to hell! */
-#undef malloc
-#undef calloc
-#undef realloc
-#undef free
-
-void *SDDPMI_malloc(size_t size) {
-    return malloc(size);
-}
-
-void *SDDPMI_calloc(size_t num, size_t size) {
-    return calloc(num, size);
-}
-
-void SDDPMI_free(void *ptr) {
-    free(ptr);
-}
-
-void *SDDPMI_realloc(void *ptr, size_t size) {
-    return realloc(ptr, size);
-}
-
-#endif
diff --git a/board/MAI/bios_emulator/scitech/src/common/gaqnx.c b/board/MAI/bios_emulator/scitech/src/common/gaqnx.c
deleted file mode 100644 (file)
index 525d662..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech Nucleus Graphics Architecture
-*
-*               Copyright (C) 1991-1998 SciTech Software, Inc.
-*                            All rights reserved.
-*
-*  ======================================================================
-*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-*  |                                                                    |
-*  |This copyrighted computer code contains proprietary technology      |
-*  |owned by SciTech Software, Inc., located at 505 Wall Street,        |
-*  |Chico, CA 95928 USA (http://www.scitechsoft.com).                   |
-*  |                                                                    |
-*  |The contents of this file are subject to the SciTech Nucleus        |
-*  |License; you may *not* use this file or related software except in  |
-*  |compliance with the License. You may obtain a copy of the License   |
-*  |at http://www.scitechsoft.com/nucleus-license.txt                   |
-*  |                                                                    |
-*  |Software distributed under the License is distributed on an         |
-*  |"AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or      |
-*  |implied. See the License for the specific language governing        |
-*  |rights and limitations under the License.                           |
-*  |                                                                    |
-*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-*  ======================================================================
-*
-* Language:     ANSI C
-* Environment:  QNX
-*
-* Description:  OS specific Nucleus Graphics Architecture services for
-*               the QNX operating system.
-*
-****************************************************************************/
-
-#include "nucleus/graphics.h"
-#include <time.h>
-
-/*---------------------------- Global Variables ---------------------------*/
-
-static ibool        haveRDTSC;
-
-/*-------------------------- Implementation -------------------------------*/
-
-/****************************************************************************
-PARAMETERS:
-path    - Local path to the Nucleus driver files.
-
-REMARKS:
-This function is used by the application program to override the location
-of the Nucleus driver files that are loaded. Normally the loader code
-will look in the system Nucleus directories first, then in the 'drivers'
-directory relative to the current working directory, and finally relative
-to the MGL_ROOT environment variable.
-****************************************************************************/
-void NAPI GA_setLocalPath(
-    const char *path)
-{
-    PM_setLocalBPDPath(path);
-}
-
-/****************************************************************************
-RETURNS:
-Pointer to the system wide PM library imports, or the internal version if none
-
-REMARKS:
-In order to support deploying new Nucleus drivers that may require updated
-PM library functions, we check here to see if there is a system wide version
-of the PM functions available. If so we return those functions for use with
-the system wide Nucleus drivers, otherwise the compiled in version of the PM
-library is used with the application local version of Nucleus.
-****************************************************************************/
-PM_imports * NAPI GA_getSystemPMImports(void)
-{
-    /* TODO: We may very well want to provide a system shared library */
-    /*       that eports the PM functions required by the Nucleus library */
-    /*       for QNX here. That will eliminate fatal errors loading new */
-    /*       drivers on QNX! */
-    return &_PM_imports;
-}
-
-/****************************************************************************
-REMARKS:
-Nothing special for this OS.
-****************************************************************************/
-ibool NAPI GA_getSharedExports(
-    GA_exports *gaExp,
-    ibool shared)
-{
-    (void)gaExp;
-    (void)shared;
-    return false;
-}
-
-#ifndef TEST_HARNESS
-/****************************************************************************
-REMARKS:
-Nothing special for this OS
-****************************************************************************/
-ibool NAPI GA_queryFunctions(
-    GA_devCtx *dc,
-    N_uint32 id,
-    void _FAR_ *funcs)
-{
-    return __GA_exports.GA_queryFunctions(dc,id,funcs);
-}
-
-/****************************************************************************
-REMARKS:
-Nothing special for this OS
-****************************************************************************/
-ibool NAPI REF2D_queryFunctions(
-    REF2D_driver *ref2d,
-    N_uint32 id,
-    void _FAR_ *funcs)
-{
-    return __GA_exports.REF2D_queryFunctions(ref2d,id,funcs);
-}
-#endif
-
-/****************************************************************************
-REMARKS:
-This function initialises the high precision timing functions for the
-Nucleus loader library.
-****************************************************************************/
-ibool NAPI GA_TimerInit(void)
-{
-    if (_GA_haveCPUID() && (_GA_getCPUIDFeatures() & CPU_HaveRDTSC) != 0)
-       haveRDTSC = true;
-    return true;
-}
-
-/****************************************************************************
-REMARKS:
-This function reads the high resolution timer.
-****************************************************************************/
-void NAPI GA_TimerRead(
-    GA_largeInteger *value)
-{
-    if (haveRDTSC)
-       _GA_readTimeStamp(value);
-    else {
-       struct timespec ts;
-
-       clock_gettime(CLOCK_REALTIME, &ts);
-       value->low = (ts.tv_nsec / 1000 + ts.tv_sec * 1000000);
-       value->high = 0;
-       }
-}
diff --git a/board/MAI/bios_emulator/scitech/src/common/gartt.c b/board/MAI/bios_emulator/scitech/src/common/gartt.c
deleted file mode 100644 (file)
index 3a41f59..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech Nucleus Graphics Architecture
-*
-*               Copyright (C) 1991-1998 SciTech Software, Inc.
-*                            All rights reserved.
-*
-*  ======================================================================
-*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-*  |                                                                    |
-*  |This copyrighted computer code contains proprietary technology      |
-*  |owned by SciTech Software, Inc., located at 505 Wall Street,        |
-*  |Chico, CA 95928 USA (http://www.scitechsoft.com).                   |
-*  |                                                                    |
-*  |The contents of this file are subject to the SciTech Nucleus        |
-*  |License; you may *not* use this file or related software except in  |
-*  |compliance with the License. You may obtain a copy of the License   |
-*  |at http://www.scitechsoft.com/nucleus-license.txt                   |
-*  |                                                                    |
-*  |Software distributed under the License is distributed on an         |
-*  |"AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or      |
-*  |implied. See the License for the specific language governing        |
-*  |rights and limitations under the License.                           |
-*  |                                                                    |
-*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-*  ======================================================================
-*
-* Language:     ANSI C
-* Environment:  RTTarget-32
-*
-* Description:  OS specific Nucleus Graphics Architecture services for
-*               the RTTarget-32 operating system environments.
-*
-****************************************************************************/
-
-#include "nucleus/graphics.h"
-
-/*------------------------- Global Variables ------------------------------*/
-
-static ibool            haveRDTSC;
-
-/*-------------------------- Implementation -------------------------------*/
-
-/****************************************************************************
-PARAMETERS:
-path    - Local path to the Nucleus driver files.
-
-REMARKS:
-This function is used by the application program to override the location
-of the Nucleus driver files that are loaded. Normally the loader code
-will look in the system Nucleus directories first, then in the 'drivers'
-directory relative to the current working directory, and finally relative
-to the MGL_ROOT environment variable.
-****************************************************************************/
-void NAPI GA_setLocalPath(
-    const char *path)
-{
-    PM_setLocalBPDPath(path);
-}
-
-/****************************************************************************
-RETURNS:
-Pointer to the system wide PM library imports, or the internal version if none
-
-REMARKS:
-In order to support deploying new Nucleus drivers that may require updated
-PM library functions, we check here to see if there is a system wide version
-of the PM functions available. If so we return those functions for use with
-the system wide Nucleus drivers, otherwise the compiled in version of the PM
-library is used with the application local version of Nucleus.
-****************************************************************************/
-PM_imports * NAPI GA_getSystemPMImports(void)
-{
-    return &_PM_imports;
-}
-
-/****************************************************************************
-REMARKS:
-Nothing special for this OS.
-****************************************************************************/
-ibool NAPI GA_getSharedExports(
-    GA_exports *gaExp,
-    ibool shared)
-{
-    (void)gaExp;
-    (void)shared;
-    return false;
-}
-
-#ifndef TEST_HARNESS
-/****************************************************************************
-REMARKS:
-Nothing special for this OS
-****************************************************************************/
-ibool NAPI GA_queryFunctions(
-    GA_devCtx *dc,
-    N_uint32 id,
-    void _FAR_ *funcs)
-{
-    return __GA_exports.GA_queryFunctions(dc,id,funcs);
-}
-
-/****************************************************************************
-REMARKS:
-Nothing special for this OS
-****************************************************************************/
-ibool NAPI REF2D_queryFunctions(
-    REF2D_driver *ref2d,
-    N_uint32 id,
-    void _FAR_ *funcs)
-{
-    return __GA_exports.REF2D_queryFunctions(ref2d,id,funcs);
-}
-#endif
-
-/****************************************************************************
-REMARKS:
-This function initialises the high precision timing functions for the
-Nucleus loader library.
-****************************************************************************/
-ibool NAPI GA_TimerInit(void)
-{
-    if (_GA_haveCPUID() && (_GA_getCPUIDFeatures() & CPU_HaveRDTSC) != 0) {
-       haveRDTSC = true;
-       return true;
-       }
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-This function reads the high resolution timer.
-****************************************************************************/
-void NAPI GA_TimerRead(
-    GA_largeInteger *value)
-{
-    if (haveRDTSC)
-       _GA_readTimeStamp(value);
-}
diff --git a/board/MAI/bios_emulator/scitech/src/common/gasmx.c b/board/MAI/bios_emulator/scitech/src/common/gasmx.c
deleted file mode 100644 (file)
index ae31941..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech Nucleus Graphics Architecture
-*
-*               Copyright (C) 1991-1998 SciTech Software, Inc.
-*                            All rights reserved.
-*
-*  ======================================================================
-*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-*  |                                                                    |
-*  |This copyrighted computer code contains proprietary technology      |
-*  |owned by SciTech Software, Inc., located at 505 Wall Street,        |
-*  |Chico, CA 95928 USA (http://www.scitechsoft.com).                   |
-*  |                                                                    |
-*  |The contents of this file are subject to the SciTech Nucleus        |
-*  |License; you may *not* use this file or related software except in  |
-*  |compliance with the License. You may obtain a copy of the License   |
-*  |at http://www.scitechsoft.com/nucleus-license.txt                   |
-*  |                                                                    |
-*  |Software distributed under the License is distributed on an         |
-*  |"AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or      |
-*  |implied. See the License for the specific language governing        |
-*  |rights and limitations under the License.                           |
-*  |                                                                    |
-*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-*  ======================================================================
-*
-* Language:     ANSI C
-* Environment:  smx32
-*
-* Description:  OS specific Nucleus Graphics Architecture services for
-*               the smx32 platform -- no vxD support.
-*
-****************************************************************************/
-
-#include "pmapi.h"
-#include "nucleus/graphics.h"
-
-/*-------------------------- Implementation -------------------------------*/
-
-/****************************************************************************
-PARAMETERS:
-path    - Local path to the Nucleus driver files.
-
-REMARKS:
-This function is used by the application program to override the location
-of the Nucleus driver files that are loaded. Normally the loader code
-will look in the system Nucleus directories first, then in the 'drivers'
-directory relative to the current working directory, and finally relative
-to the MGL_ROOT environment variable.
-****************************************************************************/
-void NAPI GA_setLocalPath(
-    const char *path)
-{
-    PM_setLocalBPDPath(path);
-}
-
-/****************************************************************************
-RETURNS:
-Pointer to the system wide PM library imports, or the internal version if none
-
-REMARKS:
-In order to support deploying new Nucleus drivers that may require updated
-PM library functions, we check here to see if there is a system wide version
-of the PM functions available. If so we return those functions for use with
-the system wide Nucleus drivers, otherwise the compiled in version of the PM
-library is used with the application local version of Nucleus.
-****************************************************************************/
-PM_imports * NAPI GA_getSystemPMImports(void)
-{
-    return &_PM_imports;
-}
-
-/****************************************************************************
-REMARKS:
-Nothing special for this OS.
-****************************************************************************/
-ibool NAPI GA_getSharedExports(
-    GA_exports *gaExp,
-    ibool shared)
-{
-    (void)gaExp;
-    (void)shared;
-    return false;
-}
-
-#ifndef TEST_HARNESS
-/****************************************************************************
-REMARKS:
-Nothing special for this OS
-****************************************************************************/
-ibool NAPI GA_queryFunctions(
-    GA_devCtx *dc,
-    N_uint32 id,
-    void _FAR_ *funcs)
-{
-    return __GA_exports.GA_queryFunctions(dc,id,funcs);
-}
-
-/****************************************************************************
-REMARKS:
-Nothing special for this OS
-****************************************************************************/
-ibool NAPI REF2D_queryFunctions(
-    REF2D_driver *ref2d,
-    N_uint32 id,
-    void _FAR_ *funcs)
-{
-    return __GA_exports.REF2D_queryFunctions(ref2d,id,funcs);
-}
-#endif
-
-/****************************************************************************
-REMARKS:
-This function initialises the high precision timing functions for the
-Nucleus loader library.
-****************************************************************************/
-ibool NAPI GA_TimerInit(void)
-{
-    if (_GA_haveCPUID() && (_GA_getCPUIDFeatures() & CPU_HaveRDTSC) != 0)
-       return true;
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-This function reads the high resolution timer.
-****************************************************************************/
-void NAPI GA_TimerRead(
-    GA_largeInteger *value)
-{
-    _GA_readTimeStamp(value);
-}
diff --git a/board/MAI/bios_emulator/scitech/src/common/gavxd.c b/board/MAI/bios_emulator/scitech/src/common/gavxd.c
deleted file mode 100644 (file)
index fc8ba8d..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech Nucleus Graphics Architecture
-*
-*               Copyright (C) 1991-1998 SciTech Software, Inc.
-*                            All rights reserved.
-*
-*  ======================================================================
-*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-*  |                                                                    |
-*  |This copyrighted computer code contains proprietary technology      |
-*  |owned by SciTech Software, Inc., located at 505 Wall Street,        |
-*  |Chico, CA 95928 USA (http://www.scitechsoft.com).                   |
-*  |                                                                    |
-*  |The contents of this file are subject to the SciTech Nucleus        |
-*  |License; you may *not* use this file or related software except in  |
-*  |compliance with the License. You may obtain a copy of the License   |
-*  |at http://www.scitechsoft.com/nucleus-license.txt                   |
-*  |                                                                    |
-*  |Software distributed under the License is distributed on an         |
-*  |"AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or      |
-*  |implied. See the License for the specific language governing        |
-*  |rights and limitations under the License.                           |
-*  |                                                                    |
-*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-*  ======================================================================
-*
-* Language:     ANSI C
-* Environment:  Win32 VxD
-*
-* Description:  OS specific Nucleus Graphics Architecture services for
-*               the Win32 VxD's.
-*
-****************************************************************************/
-
-#include "sdd/sddhelp.h"
-
-/*------------------------- Global Variables ------------------------------*/
-
-static ibool            haveRDTSC;
-
-/*-------------------------- Implementation -------------------------------*/
-
-/****************************************************************************
-PARAMETERS:
-path    - Local path to the Nucleus driver files.
-
-REMARKS:
-This function is used by the application program to override the location
-of the Nucleus driver files that are loaded. Normally the loader code
-will look in the system Nucleus directories first, then in the 'drivers'
-directory relative to the current working directory, and finally relative
-to the MGL_ROOT environment variable.
-****************************************************************************/
-void NAPI GA_setLocalPath(
-    const char *path)
-{
-    PM_setLocalBPDPath(path);
-}
-
-/****************************************************************************
-RETURNS:
-Pointer to the system wide PM library imports, or the internal version if none
-
-REMARKS:
-Nothing special for this OS.
-****************************************************************************/
-PM_imports * NAPI GA_getSystemPMImports(void)
-{
-    return &_PM_imports;
-}
-
-/****************************************************************************
-REMARKS:
-Nothing special for this OS.
-****************************************************************************/
-ibool NAPI GA_getSharedExports(
-    GA_exports *gaExp,
-    ibool shared)
-{
-    (void)gaExp;
-    (void)shared;
-    return false;
-}
-
-#ifndef TEST_HARNESS
-/****************************************************************************
-REMARKS:
-Nothing special for this OS
-****************************************************************************/
-ibool NAPI GA_queryFunctions(
-    GA_devCtx *dc,
-    N_uint32 id,
-    void _FAR_ *funcs)
-{
-    return __GA_exports.GA_queryFunctions(dc,id,funcs);
-}
-
-/****************************************************************************
-REMARKS:
-Nothing special for this OS
-****************************************************************************/
-ibool NAPI REF2D_queryFunctions(
-    REF2D_driver *ref2d,
-    N_uint32 id,
-    void _FAR_ *funcs)
-{
-    return __GA_exports.REF2D_queryFunctions(ref2d,id,funcs);
-}
-#endif
-
-/****************************************************************************
-REMARKS:
-This function initialises the high precision timing functions for the
-Nucleus loader library.
-****************************************************************************/
-ibool NAPI GA_TimerInit(void)
-{
-    if (_GA_haveCPUID() && (_GA_getCPUIDFeatures() & CPU_HaveRDTSC) != 0) {
-       haveRDTSC = true;
-       }
-    return true;
-}
-
-/****************************************************************************
-REMARKS:
-This function reads the high resolution timer.
-****************************************************************************/
-void NAPI GA_TimerRead(
-    GA_largeInteger *value)
-{
-    if (haveRDTSC)
-       _GA_readTimeStamp(value);
-    else
-       VTD_Get_Real_Time(&value->high,&value->low);
-}
diff --git a/board/MAI/bios_emulator/scitech/src/common/gawin32.c b/board/MAI/bios_emulator/scitech/src/common/gawin32.c
deleted file mode 100644 (file)
index 6944334..0000000
+++ /dev/null
@@ -1,255 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech Nucleus Graphics Architecture
-*
-*               Copyright (C) 1991-1998 SciTech Software, Inc.
-*                            All rights reserved.
-*
-*  ======================================================================
-*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-*  |                                                                    |
-*  |This copyrighted computer code contains proprietary technology      |
-*  |owned by SciTech Software, Inc., located at 505 Wall Street,        |
-*  |Chico, CA 95928 USA (http://www.scitechsoft.com).                   |
-*  |                                                                    |
-*  |The contents of this file are subject to the SciTech Nucleus        |
-*  |License; you may *not* use this file or related software except in  |
-*  |compliance with the License. You may obtain a copy of the License   |
-*  |at http://www.scitechsoft.com/nucleus-license.txt                   |
-*  |                                                                    |
-*  |Software distributed under the License is distributed on an         |
-*  |"AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or      |
-*  |implied. See the License for the specific language governing        |
-*  |rights and limitations under the License.                           |
-*  |                                                                    |
-*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-*  ======================================================================
-*
-* Language:     ANSI C
-* Environment:  Win32
-*
-* Description:  OS specific Nucleus Graphics Architecture services for
-*               the Win32 operating system environments.
-*
-****************************************************************************/
-
-#include "pm_help.h"
-#include "pmapi.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#define STRICT
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-
-/*------------------------- Global Variables ------------------------------*/
-
-#define DLL_NAME        "nga_w32.dll"
-
-extern HANDLE           _PM_hDevice;
-static HMODULE          hModDLL = NULL;
-static ibool            useRing0Driver = false;
-static ibool            haveRDTSC;
-static GA_largeInteger  countFreq;
-
-/*-------------------------- Implementation -------------------------------*/
-
-/****************************************************************************
-REMARKS:
-Loads the shared "nga_w32.dll" library from disk and connects to it. This
-library is *always* located in the same directory as the Nucleus
-graphics.bpd file.
-****************************************************************************/
-static ibool LoadSharedDLL(void)
-{
-    char                filename[PM_MAX_PATH];
-    char                bpdpath[PM_MAX_PATH];
-
-    /* Check if we have already loaded the DLL */
-    if (hModDLL)
-       return true;
-    PM_init();
-
-    /* Open the DLL file */
-    if (!PM_findBPD(DLL_NAME,bpdpath))
-       return false;
-    strcpy(filename,bpdpath);
-    strcat(filename,DLL_NAME);
-    if ((hModDLL = LoadLibrary(filename)) == NULL)
-       return false;
-    return true;
-}
-
-/****************************************************************************
-PARAMETERS:
-path    - Local path to the Nucleus driver files.
-
-REMARKS:
-This function is used by the application program to override the location
-of the Nucleus driver files that are loaded. Normally the loader code
-will look in the system Nucleus directories first, then in the 'drivers'
-directory relative to the current working directory, and finally relative
-to the MGL_ROOT environment variable.
-
-Note that for Win32 we also call into the loaded PMHELP device driver
-as necessary to change the local Nucleus path for system wide Nucleus
-drivers.
-****************************************************************************/
-void NAPI GA_setLocalPath(
-    const char *path)
-{
-    DWORD   inBuf[1];
-    DWORD   outBuf[1],outCnt;
-
-    PM_setLocalBPDPath(path);
-    if (_PM_hDevice != INVALID_HANDLE_VALUE) {
-       inBuf[0] = (DWORD)path;
-       DeviceIoControl(_PM_hDevice, PMHELP_GASETLOCALPATH32,
-           inBuf, sizeof(inBuf), outBuf, sizeof(outBuf), &outCnt, NULL);
-       }
-}
-
-/****************************************************************************
-RETURNS:
-Pointer to the system wide PM library imports, or the internal version if none
-
-REMARKS:
-In order to support deploying new Nucleus drivers that may require updated
-PM library functions, we check here to see if there is a system wide version
-of the PM functions available. If so we return those functions for use with
-the system wide Nucleus drivers, otherwise the compiled in version of the PM
-library is used with the application local version of Nucleus.
-****************************************************************************/
-PM_imports * NAPI GA_getSystemPMImports(void)
-{
-    PM_imports * pmImp;
-    PM_imports * (NAPIP _GA_getSystemPMImports)(void);
-
-    if (LoadSharedDLL()) {
-       /* Note that Visual C++ build DLL's with only a single underscore in front
-        * of the exported name while Watcom C provides two of them. We check for
-        * both to allow working with either compiled DLL.
-        */
-       if ((_GA_getSystemPMImports = (void*)GetProcAddress(hModDLL,"_GA_getSystemPMImports")) != NULL) {
-           if ((_GA_getSystemPMImports = (void*)GetProcAddress(hModDLL,"__GA_getSystemPMImports")) != NULL) {
-               pmImp = _GA_getSystemPMImports();
-               memcpy(&_PM_imports,pmImp,MIN(_PM_imports.dwSize,pmImp->dwSize));
-               return pmImp;
-               }
-           }
-       }
-    return &_PM_imports;
-}
-
-/****************************************************************************
-PARAMETERS:
-gaExp   - Place to store the exported functions
-shared  - True if connecting to the shared, global Nucleus driver
-
-REMARKS:
-For Win32 if we are connecting to the shared, global Nucleus driver (loaded
-at ring 0) then we need to load a special nga_w32.dll library which contains
-thunks to call down into the Ring 0 device driver as necessary. If we are
-connecting to the application local Nucleus drivers (ie: Nucleus on DirectDraw
-emulation layer) then we do nothing here.
-****************************************************************************/
-ibool NAPI GA_getSharedExports(
-    GA_exports *gaExp,
-    ibool shared)
-{
-    GA_exports * exp;
-    GA_exports * (NAPIP _GA_getSystemGAExports)(void);
-
-    useRing0Driver = false;
-    if (shared) {
-       if (!LoadSharedDLL())
-           PM_fatalError("Unable to load " DLL_NAME "!");
-       if ((_GA_getSystemGAExports = (void*)GetProcAddress(hModDLL,"_GA_getSystemGAExports")) == NULL)
-           if ((_GA_getSystemGAExports = (void*)GetProcAddress(hModDLL,"__GA_getSystemGAExports")) == NULL)
-               PM_fatalError("Unable to load " DLL_NAME "!");
-       exp = _GA_getSystemGAExports();
-       memcpy(gaExp,exp,MIN(gaExp->dwSize,exp->dwSize));
-       useRing0Driver = true;
-       return true;
-       }
-    return false;
-}
-
-#ifndef TEST_HARNESS
-/****************************************************************************
-REMARKS:
-Nothing special for this OS
-****************************************************************************/
-ibool NAPI GA_queryFunctions(
-    GA_devCtx *dc,
-    N_uint32 id,
-    void _FAR_ *funcs)
-{
-    static ibool (NAPIP _GA_queryFunctions)(GA_devCtx *dc,N_uint32 id,void _FAR_ *funcs) = NULL;
-
-    if (useRing0Driver) {
-       /* Call the version in nga_w32.dll if it is loaded */
-       if (!_GA_queryFunctions) {
-           if ((_GA_queryFunctions = (void*)GetProcAddress(hModDLL,"_GA_queryFunctions")) == NULL)
-               if ((_GA_queryFunctions = (void*)GetProcAddress(hModDLL,"__GA_queryFunctions")) == NULL)
-                   PM_fatalError("Unable to get exports from " DLL_NAME "!");
-           }
-       return _GA_queryFunctions(dc,id,funcs);
-       }
-    return __GA_exports.GA_queryFunctions(dc,id,funcs);
-}
-
-/****************************************************************************
-REMARKS:
-Nothing special for this OS
-****************************************************************************/
-ibool NAPI REF2D_queryFunctions(
-    REF2D_driver *ref2d,
-    N_uint32 id,
-    void _FAR_ *funcs)
-{
-    static ibool (NAPIP _REF2D_queryFunctions)(REF2D_driver *ref2d,N_uint32 id,void _FAR_ *funcs) = NULL;
-
-    if (useRing0Driver) {
-       /* Call the version in nga_w32.dll if it is loaded */
-       if (!_REF2D_queryFunctions) {
-           if ((_REF2D_queryFunctions = (void*)GetProcAddress(hModDLL,"_REF2D_queryFunctions")) == NULL)
-               if ((_REF2D_queryFunctions = (void*)GetProcAddress(hModDLL,"__REF2D_queryFunctions")) == NULL)
-                   PM_fatalError("Unable to get exports from " DLL_NAME "!");
-           }
-       return _REF2D_queryFunctions(ref2d,id,funcs);
-       }
-    return __GA_exports.REF2D_queryFunctions(ref2d,id,funcs);
-}
-#endif
-
-/****************************************************************************
-REMARKS:
-This function initialises the high precision timing functions for the
-Nucleus loader library.
-****************************************************************************/
-ibool NAPI GA_TimerInit(void)
-{
-    if (_GA_haveCPUID() && (_GA_getCPUIDFeatures() & CPU_HaveRDTSC) != 0) {
-       haveRDTSC = true;
-       return true;
-       }
-    else if (QueryPerformanceFrequency((LARGE_INTEGER*)&countFreq)) {
-       haveRDTSC = false;
-       return true;
-       }
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-This function reads the high resolution timer.
-****************************************************************************/
-void NAPI GA_TimerRead(
-    GA_largeInteger *value)
-{
-    if (haveRDTSC)
-       _GA_readTimeStamp(value);
-    else
-       QueryPerformanceCounter((LARGE_INTEGER*)value);
-}
diff --git a/board/MAI/bios_emulator/scitech/src/common/gtfcalc.c b/board/MAI/bios_emulator/scitech/src/common/gtfcalc.c
deleted file mode 100644 (file)
index 1d547e9..0000000
+++ /dev/null
@@ -1,436 +0,0 @@
-/****************************************************************************
-*
-*                   VESA Generalized Timing Formula (GTF)
-*                               Version 1.1
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Developed by: SciTech Software, Inc.
-*
-* Language:     ANSI C
-* Environment:  Any.
-*
-* Description:  C module for generating GTF compatible timings given a set
-*               of input requirements. Translated from the original GTF
-*               1.14 spreadsheet definition.
-*
-*               Compile with #define TESTING to build a command line test
-*               program.
-*
-*               NOTE: The code in here has been written for clarity and
-*                     to follow the original GTF spec as closely as
-*                     possible.
-*
-****************************************************************************/
-
-#include "gtf.h"
-#ifndef __WIN32_VXD__
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <math.h>
-#endif
-
-/*------------------------- Global Variables ------------------------------*/
-
-static GTF_constants GC = {
-    1.8,                    /* Margin size as percentage of display     */
-    8,                      /* Character cell granularity               */
-    1,                      /* Minimum front porch in lines/chars       */
-    3,                      /* Width of V sync in lines                 */
-    8,                      /* Width of H sync as percent of total      */
-    550,                    /* Minimum vertical sync + back porch (us)  */
-    600,                    /* Blanking formula gradient                */
-    40,                     /* Blanking formula offset                  */
-    128,                    /* Blanking formula scaling factor          */
-    20,                     /* Blanking formula scaling factor weight   */
-    };
-
-/*-------------------------- Implementation -------------------------------*/
-
-#ifdef __WIN32_VXD__
-/* These functions are not supported in a VxD, so we stub them out so this
- * module will at least compile. Calling the functions in here will do
- * something wierd!
- */
-double sqrt(double x)
-{ return x; }
-
-double floor(double x)
-{ return x; }
-
-double pow(double x,double y)
-{ return x*y; }
-#endif
-
-static double round(double v)
-{
-    return floor(v + 0.5);
-}
-
-static void GetInternalConstants(GTF_constants *c)
-/****************************************************************************
-*
-* Function:     GetInternalConstants
-* Parameters:   c   - Place to store the internal constants
-*
-* Description:  Calculates the rounded, internal set of GTF constants.
-*               These constants are different to the real GTF constants
-*               that can be set up for the monitor. The calculations to
-*               get these real constants are defined in the 'Work Area'
-*               after the constants are defined in the Excel spreadsheet.
-*
-****************************************************************************/
-{
-    c->margin = GC.margin;
-    c->cellGran = round(GC.cellGran);
-    c->minPorch = round(GC.minPorch);
-    c->vSyncRqd = round(GC.vSyncRqd);
-    c->hSync = GC.hSync;
-    c->minVSyncBP = GC.minVSyncBP;
-    if (GC.k == 0)
-       c->k = 0.001;
-    else
-       c->k = GC.k;
-    c->m = (c->k / 256) * GC.m;
-    c->c = (GC.c - GC.j) * (c->k / 256) + GC.j;
-    c->j = GC.j;
-}
-
-void GTF_calcTimings(double hPixels,double vLines,double freq,
-    int type,ibool wantMargins,ibool wantInterlace,GTF_timings *t)
-/****************************************************************************
-*
-* Function:     GTF_calcTimings
-* Parameters:   hPixels     - X resolution
-*               vLines      - Y resolution
-*               freq        - Frequency (Hz, KHz or MHz depending on type)
-*               type        - 1 - vertical, 2 - horizontal, 3 - dot clock
-*               margins     - True if margins should be generated
-*               interlace   - True if interlaced timings to be generated
-*               t           - Place to store the resulting timings
-*
-* Description:  Calculates a set of GTF timing parameters given a specified
-*               resolution and vertical frequency. The horizontal frequency
-*               and dot clock will be automatically generated by this
-*               routines.
-*
-*               For interlaced modes the CRTC parameters are calculated for
-*               a single field, so will be half what would be used in
-*               a non-interlaced mode.
-*
-****************************************************************************/
-{
-    double          interlace,vFieldRate,hPeriod;
-    double          topMarginLines,botMarginLines;
-    double          leftMarginPixels,rightMarginPixels;
-    double          hPeriodEst,vSyncBP,vBackPorch;
-    double          vTotalLines,vFieldRateEst;
-    double          hTotalPixels,hTotalActivePixels,hBlankPixels;
-    double          idealDutyCycle,hSyncWidth,hSyncBP,hBackPorch;
-    double          idealHPeriod;
-    double          vFreq,hFreq,dotClock;
-    GTF_constants   c;
-
-    /* Get rounded GTF constants used for internal calculations */
-    GetInternalConstants(&c);
-
-    /* Move input parameters into appropriate variables */
-    vFreq = hFreq = dotClock = freq;
-
-    /* Round pixels to character cell granularity */
-    hPixels = round(hPixels / c.cellGran) * c.cellGran;
-
-    /* For interlaced mode halve the vertical parameters, and double
-     * the required field refresh rate.
-     */
-    vFieldRate = vFreq;
-    interlace = 0;
-    if (wantInterlace)
-       dotClock *= 2;
-
-    /* Determine the lines for margins */
-    if (wantMargins) {
-       topMarginLines = round(c.margin / 100 * vLines);
-       botMarginLines = round(c.margin / 100 * vLines);
-       }
-    else {
-       topMarginLines = 0;
-       botMarginLines = 0;
-       }
-
-    if (type != GTF_lockPF) {
-       if (type == GTF_lockVF) {
-           /* Estimate the horizontal period */
-           hPeriodEst = ((1/vFieldRate) - (c.minVSyncBP/1000000)) /
-               (vLines + (2*topMarginLines) + c.minPorch + interlace) * 1000000;
-
-           /* Find the number of lines in vSync + back porch */
-           vSyncBP = round(c.minVSyncBP / hPeriodEst);
-           }
-       else if (type == GTF_lockHF) {
-           /* Find the number of lines in vSync + back porch */
-           vSyncBP = round((c.minVSyncBP * hFreq) / 1000);
-           }
-
-       /* Find the number of lines in the V back porch alone */
-       vBackPorch = vSyncBP - c.vSyncRqd;
-
-       /* Find the total number of lines in the vertical period */
-       vTotalLines = vLines + topMarginLines + botMarginLines + vSyncBP
-           + interlace + c.minPorch;
-
-       if (type == GTF_lockVF) {
-           /* Estimate the vertical frequency */
-           vFieldRateEst = 1000000 / (hPeriodEst * vTotalLines);
-
-           /* Find the actual horizontal period */
-           hPeriod = (hPeriodEst * vFieldRateEst) / vFieldRate;
-
-           /* Find the actual vertical field frequency */
-           vFieldRate = 1000000 / (hPeriod * vTotalLines);
-           }
-       else if (type == GTF_lockHF) {
-           /* Find the actual vertical field frequency */
-           vFieldRate = (hFreq / vTotalLines) * 1000;
-           }
-       }
-
-    /* Find the number of pixels in the left and right margins */
-    if (wantMargins) {
-       leftMarginPixels = round(hPixels * c.margin) / (100 * c.cellGran);
-       rightMarginPixels = round(hPixels * c.margin) / (100 * c.cellGran);
-       }
-    else {
-       leftMarginPixels = 0;
-       rightMarginPixels = 0;
-       }
-
-    /* Find the total number of active pixels in image + margins */
-    hTotalActivePixels = hPixels + leftMarginPixels + rightMarginPixels;
-
-    if (type == GTF_lockVF) {
-       /* Find the ideal blanking duty cycle */
-       idealDutyCycle = c.c - ((c.m * hPeriod) / 1000);
-       }
-    else if (type == GTF_lockHF) {
-       /* Find the ideal blanking duty cycle */
-       idealDutyCycle = c.c - (c.m / hFreq);
-       }
-    else if (type == GTF_lockPF) {
-       /* Find ideal horizontal period from blanking duty cycle formula */
-       idealHPeriod = (((c.c - 100) + (sqrt((pow(100-c.c,2)) +
-           (0.4 * c.m * (hTotalActivePixels + rightMarginPixels +
-           leftMarginPixels) / dotClock)))) / (2 * c.m)) * 1000;
-
-       /* Find the ideal blanking duty cycle */
-       idealDutyCycle = c.c - ((c.m * idealHPeriod) / 1000);
-       }
-
-    /* Find the number of pixels in blanking time */
-    hBlankPixels = round((hTotalActivePixels * idealDutyCycle) /
-       ((100 - idealDutyCycle) * c.cellGran)) * c.cellGran;
-
-    /* Find the total number of pixels */
-    hTotalPixels = hTotalActivePixels + hBlankPixels;
-
-    /* Find the horizontal back porch */
-    hBackPorch = round((hBlankPixels / 2) / c.cellGran) * c.cellGran;
-
-    /* Find the horizontal sync width */
-    hSyncWidth = round(((c.hSync/100) * hTotalPixels) / c.cellGran) * c.cellGran;
-
-    /* Find the horizontal sync + back porch */
-    hSyncBP = hBackPorch + hSyncWidth;
-
-    if (type == GTF_lockPF) {
-       /* Find the horizontal frequency */
-       hFreq = (dotClock / hTotalPixels) * 1000;
-
-       /* Find the number of lines in vSync + back porch */
-       vSyncBP = round((c.minVSyncBP * hFreq) / 1000);
-
-       /* Find the number of lines in the V back porch alone */
-       vBackPorch = vSyncBP - c.vSyncRqd;
-
-       /* Find the total number of lines in the vertical period */
-       vTotalLines = vLines + topMarginLines + botMarginLines + vSyncBP
-           + interlace + c.minPorch;
-
-       /* Find the actual vertical field frequency */
-       vFieldRate = (hFreq / vTotalLines) * 1000;
-       }
-    else {
-       if (type == GTF_lockVF) {
-           /* Find the horizontal frequency */
-           hFreq = 1000 / hPeriod;
-           }
-       else if (type == GTF_lockHF) {
-           /* Find the horizontal frequency */
-           hPeriod = 1000 / hFreq;
-           }
-
-       /* Find the pixel clock frequency */
-       dotClock = hTotalPixels / hPeriod;
-       }
-
-    /* Return the computed frequencies */
-    t->vFreq = vFieldRate;
-    t->hFreq = hFreq;
-    t->dotClock = dotClock;
-
-    /* Determine the vertical timing parameters */
-    t->h.hTotal = (int)hTotalPixels;
-    t->h.hDisp = (int)hTotalActivePixels;
-    t->h.hSyncStart = t->h.hTotal - (int)hSyncBP;
-    t->h.hSyncEnd = t->h.hTotal - (int)hBackPorch;
-    t->h.hFrontPorch = t->h.hSyncStart - t->h.hDisp;
-    t->h.hSyncWidth = (int)hSyncWidth;
-    t->h.hBackPorch = (int)hBackPorch;
-
-    /* Determine the vertical timing parameters */
-    t->v.vTotal = (int)vTotalLines;
-    t->v.vDisp = (int)vLines;
-    t->v.vSyncStart = t->v.vTotal - (int)vSyncBP;
-    t->v.vSyncEnd = t->v.vTotal - (int)vBackPorch;
-    t->v.vFrontPorch = t->v.vSyncStart - t->v.vDisp;
-    t->v.vSyncWidth = (int)c.vSyncRqd;
-    t->v.vBackPorch = (int)vBackPorch;
-    if (wantInterlace) {
-       /* Halve the timings for interlaced modes */
-       t->v.vTotal /= 2;
-       t->v.vDisp /= 2;
-       t->v.vSyncStart /= 2;
-       t->v.vSyncEnd /= 2;
-       t->v.vFrontPorch /= 2;
-       t->v.vSyncWidth /= 2;
-       t->v.vBackPorch /= 2;
-       t->dotClock /= 2;
-       }
-
-    /* Mark as GTF timing using the sync polarities */
-    t->interlace = (wantInterlace) ? 'I' : 'N';
-    t->hSyncPol = '-';
-    t->vSyncPol = '+';
-}
-
-void GTF_getConstants(GTF_constants *constants)
-{ *constants = GC; }
-
-void GTF_setConstants(GTF_constants *constants)
-{ GC = *constants; }
-
-#ifdef  TESTING_GTF
-
-void main(int argc,char *argv[])
-{
-    FILE        *f;
-    double      xPixels,yPixels,freq;
-    ibool       interlace;
-    GTF_timings t;
-
-    if (argc != 5 && argc != 6) {
-       printf("Usage: GTFCALC <xPixels> <yPixels> <freq> [[Hz] [KHz] [MHz]] [I]\n");
-       printf("\n");
-       printf("where <xPixels> is the horizontal resolution of the mode, <yPixels> is the\n");
-       printf("vertical resolution of the mode. The <freq> value will be the frequency to\n");
-       printf("drive the calculations, and will be either the vertical frequency (in Hz)\n");
-       printf("the horizontal frequency (in KHz) or the dot clock (in MHz). To generate\n");
-       printf("timings for an interlaced mode, add 'I' to the end of the command line.\n");
-       printf("\n");
-       printf("For example to generate timings for 640x480 at 60Hz vertical:\n");
-       printf("\n");
-       printf("    GTFCALC 640 480 60 Hz\n");
-       printf("\n");
-       printf("For example to generate timings for 640x480 at 31.5KHz horizontal:\n");
-       printf("\n");
-       printf("    GTFCALC 640 480 31.5 KHz\n");
-       printf("\n");
-       printf("For example to generate timings for 640x480 with a 25.175Mhz dot clock:\n");
-       printf("\n");
-       printf("    GTFCALC 640 480 25.175 MHz\n");
-       printf("\n");
-       printf("GTFCALC will print a summary of the results found, and dump the CRTC\n");
-       printf("values to the UVCONFIG.CRT file in the format used by SciTech Display Doctor.\n");
-       exit(1);
-       }
-
-    /* Get values from command line */
-    xPixels = atof(argv[1]);
-    yPixels = atof(argv[2]);
-    freq = atof(argv[3]);
-    interlace = ((argc == 6) && (argv[5][0] == 'I'));
-
-    /* Compute the CRTC timings */
-    if (toupper(argv[4][0]) == 'H')
-       GTF_calcTimings(xPixels,yPixels,freq,GTF_lockVF,false,interlace,&t);
-    else if (toupper(argv[4][0]) == 'K')
-       GTF_calcTimings(xPixels,yPixels,freq,GTF_lockHF,false,interlace,&t);
-    else if (toupper(argv[4][0]) == 'M')
-       GTF_calcTimings(xPixels,yPixels,freq,GTF_lockPF,false,interlace,&t);
-    else {
-       printf("Unknown command line!\n");
-       exit(1);
-       }
-
-    /* Dump summary info to standard output */
-    printf("CRTC values for %.0fx%.0f @ %.2f %s\n", xPixels, yPixels, freq, argv[4]);
-    printf("\n");
-    printf("  hTotal      = %-4d    vTotal      = %-4d\n",
-       t.h.hTotal, t.v.vTotal);
-    printf("  hDisp       = %-4d    vDisp       = %-4d\n",
-       t.h.hDisp, t.v.vDisp);
-    printf("  hSyncStart  = %-4d    vSyncStart  = %-4d\n",
-       t.h.hSyncStart, t.v.vSyncStart);
-    printf("  hSyncEnd    = %-4d    vSyncEnd    = %-4d\n",
-       t.h.hSyncEnd, t.v.vSyncEnd);
-    printf("  hFrontPorch = %-4d    vFrontPorch = %-4d\n",
-       t.h.hFrontPorch, t.v.vFrontPorch);
-    printf("  hSyncWidth  = %-4d    vSyncWidth  = %-4d\n",
-       t.h.hSyncWidth, t.v.vSyncWidth);
-    printf("  hBackPorch  = %-4d    vBackPorch  = %-4d\n",
-       t.h.hBackPorch, t.v.vBackPorch);
-    printf("\n");
-    printf("  Interlaced  = %s\n", (t.interlace == 'I') ? "Yes" : "No");
-    printf("  H sync pol  = %c\n", t.hSyncPol);
-    printf("  V sync pol  = %c\n", t.vSyncPol);
-    printf("\n");
-    printf("  Vert freq   = %.2f Hz\n", t.vFreq);
-    printf("  Horiz freq  = %.2f KHz\n", t.hFreq);
-    printf("  Dot Clock   = %.2f Mhz\n",    t.dotClock);
-
-    /* Dump to file in format used by SciTech Display Doctor */
-    if ((f = fopen("UVCONFIG.CRT","w")) != NULL) {
-       fprintf(f, "[%.0f %.0f]\n", xPixels, yPixels);
-       fprintf(f, "%d %d %d %d '%c' %s\n",
-           t.h.hTotal, t.h.hDisp,
-           t.h.hSyncStart, t.h.hSyncEnd,
-           t.hSyncPol, (t.interlace == 'I') ? "I" : "NI");
-       fprintf(f, "%d %d %d %d '%c'\n",
-           t.v.vTotal, t.v.vDisp,
-           t.v.vSyncStart, t.v.vSyncEnd,
-           t.vSyncPol);
-       fprintf(f, "%.2f\n", t.dotClock);
-       fclose(f);
-       }
-}
-
-#endif  /* TESTING */
diff --git a/board/MAI/bios_emulator/scitech/src/common/libcimp.c b/board/MAI/bios_emulator/scitech/src/common/libcimp.c
deleted file mode 100644 (file)
index ab73ad5..0000000
+++ /dev/null
@@ -1,827 +0,0 @@
-/****************************************************************************
-*
-*                       SciTech MGL Graphics Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Any
-*
-* Description:  Module to implement a the OS specific side of the Binary
-*               Portable DLL C runtime library. The functions in here
-*               are imported into the Binary Portable DLL's to implement
-*               OS specific services.
-*
-****************************************************************************/
-
-#include "pmapi.h"
-#if defined(__WIN32_VXD__) || defined(__NT_DRIVER__)
-#include "drvlib/peloader.h"
-#include "drvlib/attrib.h"
-#include "drvlib/libc/init.h"
-#define __BUILDING_PE_LOADER__
-#include "drvlib/libc/file.h"
-#if defined(__WIN32_VXD__)
-#include "vxdfile.h"
-#endif
-#else
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <malloc.h>
-#include <time.h>
-#include <signal.h>
-#include <fcntl.h>
-#if defined(__GNUC__) || defined(__UNIX__)
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#else
-#include <io.h>
-#endif
-#include "drvlib/attrib.h"
-#include "drvlib/libc/init.h"
-#define __BUILDING_PE_LOADER__
-#include "drvlib/libc/file.h"
-#if defined(__WINDOWS__) || defined(TNT) || defined(__RTTARGET__)
-#define WIN32_LEAN_AND_MEAN
-#define STRICT
-#include <windows.h>
-#endif
-#ifdef  __MSDOS__
-#include <dos.h>
-#endif
-#ifdef  __OS2__
-#define INCL_DOS
-#define INCL_DOSERRORS
-#define INCL_SUB
-#include <os2.h>
-#endif
-#endif
-
-/* No text or binary modes for Unix */
-
-#ifndef O_BINARY
-#define O_BINARY    0
-#define O_TEXT      0
-#endif
-
-/*--------------------------- Global variables ----------------------------*/
-
-#if defined(__WIN32_VXD__) || defined(__NT_DRIVER__)
-#define MAX_FILES   16
-static FILE *openHandles[MAX_FILES] = {NULL};
-#endif
-
-/* <stdlib.h> stub functions */
-void    _CDECL stub_abort(void);
-int     _CDECL stub_atexit(void (*)(void));
-void *  _CDECL stub_calloc(size_t _nelem, size_t _size);
-void    _CDECL stub_exit(int _status);
-void    _CDECL stub_free(void *_ptr);
-char *  _CDECL stub_getenv(const char *_name);
-void *  _CDECL stub_malloc(size_t _size);
-void *  _CDECL stub_realloc(void *_ptr, size_t _size);
-int     _CDECL stub_system(const char *_s);
-int     _CDECL stub_putenv(const char *_val);
-
-/* <libc/file.h> stub functions */
-int     _CDECL stub_open(const char *_path, int _oflag, unsigned _mode);
-int     _CDECL stub_access(const char *_path, int _amode);
-int     _CDECL stub_close(int _fildes);
-off_t   _CDECL stub_lseek(int _fildes, off_t _offset, int _whence);
-size_t  _CDECL stub_read(int _fildes, void *_buf, size_t _nbyte);
-int     _CDECL stub_unlink(const char *_path);
-size_t  _CDECL stub_write(int _fildes, const void *_buf, size_t _nbyte);
-int     _CDECL stub_isatty(int _fildes);
-
-/* <stdio.h> stub functions */
-int     _CDECL stub_remove(const char *_filename);
-int     _CDECL stub_rename(const char *_old, const char *_new);
-
-/* <time.h> stub functions */
-time_t  _CDECL stub_time(time_t *_tod);
-
-/* <signal.h> stub functions */
-int     _CDECL stub_raise(int);
-void *  _CDECL stub_signal(int, void *);
-
-/* <drvlib/attrib.h> functions */
-#define stub_OS_setfileattr    _OS_setfileattr
-#define stub_OS_getcurrentdate _OS_getcurrentdate
-
-LIBC_imports    _VARAPI ___imports = {
-    sizeof(LIBC_imports),
-
-    /* <stdlib.h> exports */
-    stub_abort,
-    stub_atexit,
-    stub_calloc,
-    stub_exit,
-    stub_free,
-    stub_getenv,
-    stub_malloc,
-    stub_realloc,
-    stub_system,
-    stub_putenv,
-
-    /* <libc/file.h> exports */
-    stub_open,
-    stub_access,
-    stub_close,
-    stub_lseek,
-    stub_read,
-    stub_unlink,
-    stub_write,
-    stub_isatty,
-
-    /* <stdio.h> exports */
-    stub_remove,
-    stub_rename,
-
-    /* <signal.h> functions */
-    stub_raise,
-    stub_signal,
-
-    /* <time.h> exports */
-    stub_time,
-
-    /* <drvlib/attrib.h> exports */
-    stub_OS_setfileattr,
-    stub_OS_getcurrentdate,
-    };
-
-/*---------------------- Stub function implementation ---------------------*/
-
-/* <stdlib.h> stub functions */
-void _CDECL stub_abort(void)
-{
-#if !defined( __WIN32_VXD__) && !defined(__NT_DRIVER__)
-    abort();
-#endif
-}
-
-int _CDECL stub_atexit(void (*func)(void))
-{
-#if !defined( __WIN32_VXD__) && !defined(__NT_DRIVER__)
-    return atexit((void(*)(void))func);
-#else
-    return -1;
-#endif
-}
-
-void * _CDECL stub_calloc(size_t _nelem, size_t _size)
-{ return __PM_calloc(_nelem,_size); }
-
-void _CDECL stub_exit(int _status)
-{
-#if !defined( __WIN32_VXD__) && !defined(__NT_DRIVER__)
-    exit(_status);
-#endif
-}
-
-void _CDECL stub_free(void *_ptr)
-{ __PM_free(_ptr); }
-
-char * _CDECL stub_getenv(const char *_name)
-{
-#if defined( __WIN32_VXD__) || defined(__NT_DRIVER__)
-    return NULL;
-#else
-    return getenv(_name);
-#endif
-}
-
-void * _CDECL stub_malloc(size_t _size)
-{ return __PM_malloc(_size); }
-
-void * _CDECL stub_realloc(void *_ptr, size_t _size)
-{ return __PM_realloc(_ptr,_size); }
-
-int _CDECL stub_system(const char *_s)
-{
-#if defined(__WINDOWS__) || defined(__WIN32_VXD__) || defined(__NT_DRIVER__) || defined(__SMX32__) || defined(__RTTARGET__)
-    (void)_s;
-    return -1;
-#else
-    return system(_s);
-#endif
-}
-
-int _CDECL stub_putenv(const char *_val)
-{
-#if defined( __WIN32_VXD__) || defined(__NT_DRIVER__)
-    return -1;
-#else
-    return putenv((char*)_val);
-#endif
-}
-
-time_t _CDECL stub_time(time_t *_tod)
-{
-#if defined( __WIN32_VXD__) || defined(__NT_DRIVER__)
-    return 0;
-#else
-    return time(_tod);
-#endif
-}
-
-#if     defined(__MSDOS__)
-
-#if defined(TNT) && defined(_MSC_VER)
-
-void _CDECL _OS_setfileattr(const char *filename,unsigned attrib)
-{ SetFileAttributes((LPSTR)filename, (DWORD)attrib); }
-
-#else
-
-void _CDECL _OS_setfileattr(const char *filename,unsigned attrib)
-{ _dos_setfileattr(filename,attrib); }
-
-#endif
-
-#elif   defined(__WIN32_VXD__)
-
-#define USE_LOCAL_FILEIO
-#define USE_LOCAL_GETDATE
-
-/* <libc/file.h> stub functions */
-int _CDECL stub_open(const char *_path, int _oflag, unsigned _mode)
-{
-    char    mode[10];
-    int     i;
-
-    /* Find an empty file handle to use */
-    for (i = 3; i < MAX_FILES; i++) {
-       if (!openHandles[i])
-           break;
-       }
-    if (openHandles[i])
-       return -1;
-
-    /* Find the open flags to use */
-    if (_oflag & ___O_TRUNC)
-       strcpy(mode,"w");
-    else if (_oflag & ___O_CREAT)
-       strcpy(mode,"a");
-    else
-       strcpy(mode,"r");
-    if (_oflag & ___O_BINARY)
-       strcat(mode,"b");
-    if (_oflag & ___O_TEXT)
-       strcat(mode,"t");
-
-    /* Open the file and store the file handle */
-    if ((openHandles[i] = fopen(_path,mode)) == NULL)
-       return -1;
-    return i;
-}
-
-int _CDECL stub_access(const char *_path, int _amode)
-{ return -1; }
-
-int _CDECL stub_close(int _fildes)
-{
-    if (_fildes >= 3 && openHandles[_fildes]) {
-       fclose(openHandles[_fildes]);
-       openHandles[_fildes] = NULL;
-       }
-    return 0;
-}
-
-off_t _CDECL stub_lseek(int _fildes, off_t _offset, int _whence)
-{
-    if (_fildes >= 3) {
-       fseek(openHandles[_fildes],_offset,_whence);
-       return ftell(openHandles[_fildes]);
-       }
-    return 0;
-}
-
-size_t _CDECL stub_read(int _fildes, void *_buf, size_t _nbyte)
-{
-    if (_fildes >= 3)
-       return fread(_buf,1,_nbyte,openHandles[_fildes]);
-    return 0;
-}
-
-int _CDECL stub_unlink(const char *_path)
-{
-    WORD error;
-
-    if (initComplete) {
-       if (R0_DeleteFile((char*)_path,0,&error))
-           return 0;
-       return -1;
-       }
-    else
-       return i_remove(_path);
-}
-
-size_t _CDECL stub_write(int _fildes, const void *_buf, size_t _nbyte)
-{
-    if (_fildes >= 3)
-       return fwrite(_buf,1,_nbyte,openHandles[_fildes]);
-    return _nbyte;
-}
-
-int _CDECL stub_isatty(int _fildes)
-{ return 0; }
-
-/* <stdio.h> stub functions */
-int _CDECL stub_remove(const char *_filename)
-{ return stub_unlink(_filename); }
-
-int _CDECL stub_rename(const char *_old, const char *_new)
-{ return -1; }
-
-void _CDECL _OS_setfileattr(const char *filename,unsigned attrib)
-{
-    WORD error;
-    if (initComplete)
-       R0_SetFileAttributes((char*)filename,attrib,&error);
-}
-
-/* Return the current date in days since 1/1/1980 */
-ulong _CDECL _OS_getcurrentdate(void)
-{
-    DWORD   date;
-    VTD_Get_Date_And_Time(&date);
-    return date;
-}
-
-#elif   defined(__NT_DRIVER__)
-
-#define USE_LOCAL_FILEIO
-#define USE_LOCAL_GETDATE
-
-/* <libc/file.h> stub functions */
-int _CDECL stub_open(const char *_path, int _oflag, unsigned _mode)
-{
-    char    mode[10];
-    int     i;
-
-    /* Find an empty file handle to use */
-    for (i = 3; i < MAX_FILES; i++) {
-       if (!openHandles[i])
-           break;
-       }
-    if (openHandles[i])
-       return -1;
-
-    /* Find the open flags to use */
-    if (_oflag & ___O_TRUNC)
-       strcpy(mode,"w");
-    else if (_oflag & ___O_CREAT)
-       strcpy(mode,"a");
-    else
-       strcpy(mode,"r");
-    if (_oflag & ___O_BINARY)
-       strcat(mode,"b");
-    if (_oflag & ___O_TEXT)
-       strcat(mode,"t");
-
-    /* Open the file and store the file handle */
-    if ((openHandles[i] = fopen(_path,mode)) == NULL)
-       return -1;
-    return i;
-}
-
-int _CDECL stub_close(int _fildes)
-{
-    if (_fildes >= 3 && openHandles[_fildes]) {
-       fclose(openHandles[_fildes]);
-       openHandles[_fildes] = NULL;
-       }
-    return 0;
-}
-
-off_t _CDECL stub_lseek(int _fildes, off_t _offset, int _whence)
-{
-    if (_fildes >= 3) {
-       fseek(openHandles[_fildes],_offset,_whence);
-       return ftell(openHandles[_fildes]);
-       }
-    return 0;
-}
-
-size_t _CDECL stub_read(int _fildes, void *_buf, size_t _nbyte)
-{
-    if (_fildes >= 3)
-       return fread(_buf,1,_nbyte,openHandles[_fildes]);
-    return 0;
-}
-
-size_t _CDECL stub_write(int _fildes, const void *_buf, size_t _nbyte)
-{
-    if (_fildes >= 3)
-       return fwrite(_buf,1,_nbyte,openHandles[_fildes]);
-    return _nbyte;
-}
-
-int _CDECL stub_access(const char *_path, int _amode)
-{ return -1; }
-
-int _CDECL stub_isatty(int _fildes)
-{ return 0; }
-
-int _CDECL stub_unlink(const char *_path)
-{
-    /* TODO: Implement this! */
-    return -1;
-}
-
-/* <stdio.h> stub functions */
-int _CDECL stub_remove(const char *_filename)
-{ return stub_unlink(_filename); }
-
-int _CDECL stub_rename(const char *_old, const char *_new)
-{
-    /* TODO: Implement this! */
-    return -1;
-}
-
-void _CDECL _OS_setfileattr(const char *filename,unsigned attrib)
-{
-    uint _attr = 0;
-    if (attrib & __A_RDONLY)
-       _attr |= FILE_ATTRIBUTE_READONLY;
-    if (attrib & __A_HIDDEN)
-       _attr |= FILE_ATTRIBUTE_HIDDEN;
-    if (attrib & __A_SYSTEM)
-       _attr |= FILE_ATTRIBUTE_SYSTEM;
-    PM_setFileAttr(filename,_attr);
-}
-
-/* Return the current date in days since 1/1/1980 */
-ulong _CDECL _OS_getcurrentdate(void)
-{
-    TIME_FIELDS tm;
-    _int64      count,count_1_1_1980;
-
-    tm.Year         = 1980;
-    tm.Month        = 1;
-    tm.Day          = 1;
-    tm.Hour         = 0;
-    tm.Minute       = 0;
-    tm.Second       = 0;
-    tm.Milliseconds = 0;
-    tm.Weekday      = 0;
-    RtlTimeFieldsToTime(&tm,(PLARGE_INTEGER)&count_1_1_1980);
-    KeQuerySystemTime((PLARGE_INTEGER)&count);
-    return (ulong)( (count - count_1_1_1980) / ((_int64)24 * (_int64)3600 * (_int64)10000000) );
-}
-
-#elif   defined(__WINDOWS32__) || defined(__RTTARGET__)
-
-void _CDECL _OS_setfileattr(const char *filename,unsigned attrib)
-{ SetFileAttributes((LPSTR)filename, (DWORD)attrib); }
-
-#elif   defined(__OS2__)
-
-#define USE_LOCAL_FILEIO
-
-#ifndef W_OK
-#define W_OK                    0x02
-#endif
-
-void _CDECL _OS_setfileattr(const char *filename,unsigned attrib)
-{
-    FILESTATUS3 s;
-    if (DosQueryPathInfo((PSZ)filename,FIL_STANDARD,(PVOID)&s,sizeof(s)))
-       return;
-    s.attrFile = attrib;
-    DosSetPathInfo((PSZ)filename,FIL_STANDARD,(PVOID)&s,sizeof(s),0L);
-}
-
-/* <libc/file.h> stub functions */
-
-#define BUF_SIZE    4096
-
-/* Note: the implementation of the standard Unix-ish handle-based I/O isn't
- *       complete - but that wasn't the intent either. Note also that we
- *       don't presently support text file I/O, so all text files end
- *       up in Unix format (and are not translated!).
- */
-int _CDECL stub_open(const char *_path, int _oflag, unsigned _mode)
-{
-    HFILE   handle;
-    ULONG   error, actiontaken, openflag, openmode;
-    char    path[PM_MAX_PATH];
-
-    /* Determine open flags */
-    if (_oflag & ___O_CREAT) {
-       if (_oflag & ___O_EXCL)
-           openflag = OPEN_ACTION_FAIL_IF_EXISTS | OPEN_ACTION_CREATE_IF_NEW;
-       else if (_oflag & ___O_TRUNC)
-           openflag = OPEN_ACTION_REPLACE_IF_EXISTS | OPEN_ACTION_CREATE_IF_NEW;
-       else
-           openflag = OPEN_ACTION_OPEN_IF_EXISTS | OPEN_ACTION_CREATE_IF_NEW;
-       }
-    else if (_oflag & ___O_TRUNC)
-       openflag = OPEN_ACTION_REPLACE_IF_EXISTS;
-    else
-       openflag = OPEN_ACTION_OPEN_IF_EXISTS;
-
-    /* Determine open mode flags */
-    if (_oflag & ___O_RDONLY)
-       openmode = OPEN_ACCESS_READONLY | OPEN_SHARE_DENYNONE;
-    else if (_oflag & ___O_WRONLY)
-       openmode = OPEN_ACCESS_WRITEONLY | OPEN_SHARE_DENYWRITE;
-    else
-       openmode = OPEN_ACCESS_READWRITE | OPEN_SHARE_DENYWRITE;
-
-    /* Copy the path to a variable on the stack. We need to do this
-     * for OS/2 as when the drivers are loaded into shared kernel
-     * memory, we can't pass an address from that memory range to
-     * this function.
-     */
-    strcpy(path,_path);
-    if (DosOpen(path, &handle, &actiontaken, 0, FILE_NORMAL,
-           openflag, openmode, NULL) != NO_ERROR)
-       return -1;
-
-    /* Handle append mode of operation */
-    if (_oflag & ___O_APPEND) {
-       if (DosSetFilePtr(handle, 0, FILE_END, &error) != NO_ERROR)
-           return -1;
-       }
-    return handle;
-}
-
-int _CDECL stub_access(const char *_path, int _amode)
-{
-    char        path[PM_MAX_PATH];
-    FILESTATUS  fs;
-
-    /* Copy the path to a variable on the stack. We need to do this
-     * for OS/2 as when the drivers are loaded into shared kernel
-     * memory, we can't pass an address from that memory range to
-     * this function.
-     */
-    strcpy(path,_path);
-    if (DosQueryPathInfo(path, FIL_STANDARD, &fs, sizeof(fs)) != NO_ERROR)
-       return -1;
-    if ((_amode & W_OK) && (fs.attrFile & FILE_READONLY))
-       return -1;
-    return 0;
-}
-
-int _CDECL stub_close(int _fildes)
-{
-    if (DosClose(_fildes) != NO_ERROR)
-       return -1;
-    return 0;
-}
-
-off_t _CDECL stub_lseek(int _fildes, off_t _offset, int _whence)
-{
-    ULONG  cbActual, origin;
-
-    switch (_whence) {
-       case SEEK_CUR:
-           origin = FILE_CURRENT;
-           break;
-       case SEEK_END:
-           origin = FILE_END;
-           break;
-       default:
-           origin = FILE_BEGIN;
-       }
-    if (DosSetFilePtr(_fildes, _offset, origin, &cbActual) != NO_ERROR)
-       return -1;
-    return cbActual;
-}
-
-size_t _CDECL stub_read(int _fildes, void *_buf, size_t _nbyte)
-{
-    ULONG   cbActual = 0,cbRead;
-    uchar   *p = _buf;
-    uchar   file_io_buf[BUF_SIZE];
-
-    /* We need to perform the physical read in chunks into a
-     * a temporary static buffer, since the buffer passed in may be
-     * in kernel space and will cause DosRead to bail internally.
-     */
-    while (_nbyte > BUF_SIZE) {
-       if (DosRead(_fildes, file_io_buf, BUF_SIZE, &cbRead) != NO_ERROR)
-           return -1;
-       cbActual += cbRead;
-       memcpy(p,file_io_buf,BUF_SIZE);
-       p += BUF_SIZE;
-       _nbyte -= BUF_SIZE;
-       }
-    if (_nbyte) {
-       if (DosRead(_fildes, file_io_buf, _nbyte, &cbRead) != NO_ERROR)
-           return -1;
-       cbActual += cbRead;
-       memcpy(p,file_io_buf,_nbyte);
-       }
-    return cbActual;
-}
-
-size_t _CDECL stub_write(int _fildes, const void *_buf, size_t _nbyte)
-{
-    ULONG   cbActual = 0,cbWrite;
-    uchar   *p = (PVOID)_buf;
-    uchar   file_io_buf[BUF_SIZE];
-
-    /* We need to perform the physical write in chunks from a
-     * a temporary static buffer, since the buffer passed in may be
-     * in kernel space and will cause DosWrite to bail internally.
-     */
-    while (_nbyte > BUF_SIZE) {
-       memcpy(file_io_buf,p,BUF_SIZE);
-       if (DosWrite(_fildes, file_io_buf, BUF_SIZE, &cbWrite) != NO_ERROR)
-           return -1;
-       cbActual += cbWrite;
-       p += BUF_SIZE;
-       _nbyte -= BUF_SIZE;
-       }
-    if (_nbyte) {
-       memcpy(file_io_buf,p,_nbyte);
-       if (DosWrite(_fildes, file_io_buf, _nbyte, &cbWrite) != NO_ERROR)
-           return -1;
-       cbActual += cbWrite;
-       }
-    return cbActual;
-}
-
-int _CDECL stub_unlink(const char *_path)
-{
-    char    path[PM_MAX_PATH];
-
-    /* Copy the path to a variable on the stack. We need to do this
-     * for OS/2 as when the drivers are loaded into shared kernel
-     * memory, we can't pass an address from that memory range to
-     * this function.
-     */
-    strcpy(path,_path);
-    if (DosDelete(path) != NO_ERROR)
-       return -1;
-    return 0;
-}
-
-int _CDECL stub_isatty(int _fildes)
-{
-    ULONG  htype, flags;
-
-    if (DosQueryHType(_fildes, &htype, &flags) != NO_ERROR)
-       return 0;
-    return ((htype & 0xFF) == HANDTYPE_DEVICE);
-}
-
-/* <stdio.h> stub functions */
-int _CDECL stub_remove(const char *_path)
-{
-    char    path[PM_MAX_PATH];
-
-    /* Copy the path to a variable on the stack. We need to do this
-     * for OS/2 as when the drivers are loaded into shared kernel
-     * memory, we can't pass an address from that memory range to
-     * this function.
-     */
-    strcpy(path,_path);
-    if (DosDelete(path) != NO_ERROR)
-       return -1;
-    return 0;
-}
-
-int _CDECL stub_rename(const char *_old, const char *_new)
-{
-    char    old[PM_MAX_PATH];
-    char    new[PM_MAX_PATH];
-
-    /* Copy the path to a variable on the stack. We need to do this
-     * for OS/2 as when the drivers are loaded into shared kernel
-     * memory, we can't pass an address from that memory range to
-     * this function.
-     */
-    strcpy(old,_old);
-    strcpy(new,_new);
-    if (DosMove(old, new) != NO_ERROR)
-       return -1;
-    return 0;
-}
-
-#else
-
-void _CDECL _OS_setfileattr(const char *filename,unsigned attrib)
-{ /* Unable to set hidden, system attributes on Unix. */ }
-
-#endif
-
-#ifndef USE_LOCAL_FILEIO
-
-/* <libc/file.h> stub functions */
-int _CDECL stub_open(const char *_path, int _oflag, unsigned _mode)
-{
-    int oflag_tab[] = {
-       ___O_RDONLY,    O_RDONLY,
-       ___O_WRONLY,    O_WRONLY,
-       ___O_RDWR,      O_RDWR,
-       ___O_BINARY,    O_BINARY,
-       ___O_TEXT,      O_TEXT,
-       ___O_CREAT,     O_CREAT,
-       ___O_EXCL,      O_EXCL,
-       ___O_TRUNC,     O_TRUNC,
-       ___O_APPEND,    O_APPEND,
-       };
-    int i,oflag = 0;
-
-    /* Translate the oflag's to the OS dependent versions */
-    for (i = 0; i < sizeof(oflag_tab) / sizeof(int); i += 2) {
-       if (_oflag & oflag_tab[i])
-           oflag |= oflag_tab[i+1];
-       }
-    return open(_path,oflag,_mode);
-}
-
-int _CDECL stub_access(const char *_path, int _amode)
-{ return access(_path,_amode); }
-
-int _CDECL stub_close(int _fildes)
-{ return close(_fildes); }
-
-off_t _CDECL stub_lseek(int _fildes, off_t _offset, int _whence)
-{ return lseek(_fildes,_offset,_whence); }
-
-size_t _CDECL stub_read(int _fildes, void *_buf, size_t _nbyte)
-{ return read(_fildes,_buf,_nbyte); }
-
-int _CDECL stub_unlink(const char *_path)
-{ return unlink(_path); }
-
-size_t _CDECL stub_write(int _fildes, const void *_buf, size_t _nbyte)
-{ return write(_fildes,_buf,_nbyte); }
-
-int _CDECL stub_isatty(int _fildes)
-{ return isatty(_fildes); }
-
-/* <stdio.h> stub functions */
-int _CDECL stub_remove(const char *_filename)
-{ return remove(_filename); }
-
-int _CDECL stub_rename(const char *_old, const char *_new)
-{ return rename(_old,_new); }
-
-#endif
-
-#ifndef USE_LOCAL_GETDATE
-
-/* Return the current date in days since 1/1/1980 */
-ulong _CDECL _OS_getcurrentdate(void)
-{
-    struct tm refTime;
-    refTime.tm_year = 80;
-    refTime.tm_mon  = 0;
-    refTime.tm_mday = 1;
-    refTime.tm_hour = 0;
-    refTime.tm_min  = 0;
-    refTime.tm_sec  = 0;
-    refTime.tm_isdst = -1;
-    return (time(NULL) - mktime(&refTime)) / (24 * 3600L);
-}
-
-#endif
-
-int _CDECL stub_raise(int sig)
-{
-#if defined(__WIN32_VXD__) || defined(__NT_DRIVER__) || defined(__SMX32__)
-    return -1;
-#else
-    return raise(sig);
-#endif
-}
-
-#ifdef __WINDOWS32__
-typedef void (*__code_ptr)(int);
-#else
-typedef void (*__code_ptr)();
-#endif
-
-void * _CDECL stub_signal(int sig, void *handler)
-{
-#if defined(__WIN32_VXD__) || defined(__NT_DRIVER__) || defined(__SMX32__)
-    return NULL;
-#else
-    return (void*)signal(sig,(__code_ptr)handler);
-#endif
-}
diff --git a/board/MAI/bios_emulator/scitech/src/common/makefile b/board/MAI/bios_emulator/scitech/src/common/makefile
deleted file mode 100644 (file)
index 5aac038..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-#############################################################################
-#
-#                   Copyright (C) 1996 SciTech Software.
-#                           All rights reserved.
-#
-# Descripton:   Makefile for UniVBE(tm), UniPOWER(tm), UVBELib(tm) and
-#               DPMSLib library files. Requires Borland C++ 4.52 to build
-#               some components.
-#
-# $Date: 2002/10/02 15:35:20 $ $Author: hfrieden $
-#
-#############################################################################
-
-CFLAGS += -DTESTING_GTF
-
-gtfcalc$E:  gtfcalc$O
-
-.INCLUDE: "$(SCITECH)/makedefs/common.mk"
diff --git a/board/MAI/bios_emulator/scitech/src/common/peloader.c b/board/MAI/bios_emulator/scitech/src/common/peloader.c
deleted file mode 100644 (file)
index a134bb0..0000000
+++ /dev/null
@@ -1,586 +0,0 @@
-/****************************************************************************
-*
-*                       SciTech MGL Graphics Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Any
-*
-* Description:  Module to implement a simple Portable Binary DLL loader
-*               library. This library can be used to load PE DLL's under
-*               any Intel based OS, provided the DLL's do not have any
-*               imports in the import table.
-*
-*               NOTE: This loader module expects the DLL's to be built with
-*                     Watcom C++ and may produce unexpected results with
-*                     DLL's linked by another compiler.
-*
-****************************************************************************/
-
-#include "drvlib/peloader.h"
-#include "pmapi.h"
-#include "drvlib/os/os.h"
-#include "drvlib/libc/init.h"
-#if (defined(__WINDOWS32__) || defined(__DRIVER__)) && defined(CHECKED)
-#define WIN32_LEAN_AND_MEAN
-#define STRICT
-#include <windows.h>
-#endif
-#include "drvlib/pe.h"
-
-/*--------------------------- Global variables ----------------------------*/
-
-static int          result = PE_ok;
-
-/*------------------------- Implementation --------------------------------*/
-
-/****************************************************************************
-PARAMETERS:
-f           - Handle to open file to read driver from
-startOffset - Offset to the start of the driver within the file
-
-RETURNS:
-Handle to loaded PE DLL, or NULL on failure.
-
-REMARKS:
-This function loads a Portable Binary DLL library from disk, relocates
-the code and returns a handle to the loaded library. This function is the
-same as the regular PE_loadLibrary except that it take a handle to an
-open file and an offset within that file for the DLL to load.
-****************************************************************************/
-static int PE_readHeader(
-    FILE *f,
-    long startOffset,
-    FILE_HDR *filehdr,
-    OPTIONAL_HDR *opthdr)
-{
-    EXE_HDR exehdr;
-    ulong   offset,signature;
-
-    /* Read the EXE header and check for valid header signature */
-    result = PE_invalidDLLImage;
-    fseek(f, startOffset, SEEK_SET);
-    if (fread(&exehdr, 1, sizeof(exehdr), f) != sizeof(exehdr))
-       return false;
-    if (exehdr.signature != 0x5A4D)
-       return false;
-
-    /* Now seek to the start of the PE header defined at offset 0x3C
-     * in the MS-DOS EXE header, and read the signature and check it.
-     */
-    fseek(f, startOffset+0x3C, SEEK_SET);
-    if (fread(&offset, 1, sizeof(offset), f) != sizeof(offset))
-       return false;
-    fseek(f, startOffset+offset, SEEK_SET);
-    if (fread(&signature, 1, sizeof(signature), f) != sizeof(signature))
-       return false;
-    if (signature != 0x00004550)
-       return false;
-
-    /* Now read the PE file header and check that it is correct */
-    if (fread(filehdr, 1, sizeof(*filehdr), f) != sizeof(*filehdr))
-       return false;
-    if (filehdr->Machine != IMAGE_FILE_MACHINE_I386)
-       return false;
-    if (!(filehdr->Characteristics & IMAGE_FILE_32BIT_MACHINE))
-       return false;
-    if (!(filehdr->Characteristics & IMAGE_FILE_DLL))
-       return false;
-    if (fread(opthdr, 1, sizeof(*opthdr), f) != sizeof(*opthdr))
-       return false;
-    if (opthdr->Magic != 0x10B)
-       return false;
-
-    /* Success, so return true! */
-    return true;
-}
-
-/****************************************************************************
-PARAMETERS:
-f           - Handle to open file to read driver from
-startOffset - Offset to the start of the driver within the file
-
-RETURNS:
-Size of the DLL file on disk, or -1 on error
-
-REMARKS:
-This function scans the headers for a Portable Binary DLL to determine the
-length of the DLL file on disk.
-{secret}
-****************************************************************************/
-ulong PEAPI PE_getFileSize(
-    FILE *f,
-    ulong startOffset)
-{
-    FILE_HDR        filehdr;
-    OPTIONAL_HDR    opthdr;
-    SECTION_HDR     secthdr;
-    ulong           size;
-    int             i;
-
-    /* Read the PE file headers from disk */
-    if (!PE_readHeader(f,startOffset,&filehdr,&opthdr))
-       return 0xFFFFFFFF;
-
-    /* Scan all the section headers summing up the total size */
-    size = opthdr.SizeOfHeaders;
-    for (i = 0; i < filehdr.NumberOfSections; i++) {
-       if (fread(&secthdr, 1, sizeof(secthdr), f) != sizeof(secthdr))
-           return 0xFFFFFFFF;
-       size += secthdr.SizeOfRawData;
-       }
-    return size;
-}
-
-/****************************************************************************
-DESCRIPTION:
-Loads a Portable Binary DLL into memory from an open file
-
-HEADER:
-peloader.h
-
-PARAMETERS:
-f           - Handle to open file to read driver from
-startOffset - Offset to the start of the driver within the file
-size        - Place to store the size of the driver loaded
-shared      - True to load module into shared memory
-
-RETURNS:
-Handle to loaded PE DLL, or NULL on failure.
-
-REMARKS:
-This function loads a Portable Binary DLL library from disk, relocates
-the code and returns a handle to the loaded library. This function is the
-same as the regular PE_loadLibrary except that it take a handle to an
-open file and an offset within that file for the DLL to load.
-
-SEE ALSO:
-PE_loadLibrary, PE_getProcAddress, PE_freeLibrary
-****************************************************************************/
-PE_MODULE * PEAPI PE_loadLibraryExt(
-    FILE *f,
-    ulong startOffset,
-    ulong *size,
-    ibool shared)
-{
-    FILE_HDR        filehdr;
-    OPTIONAL_HDR    opthdr;
-    SECTION_HDR     secthdr;
-    ulong           offset,pageOffset;
-    ulong           text_off,text_addr,text_size;
-    ulong           data_off,data_addr,data_size,data_end;
-    ulong           export_off,export_addr,export_size,export_end;
-    ulong           reloc_off,reloc_size;
-    ulong           image_size;
-    int             i,delta,numFixups;
-    ushort          relocType,*fixup;
-    PE_MODULE       *hMod = NULL;
-    void            *reloc = NULL;
-    BASE_RELOCATION *baseReloc;
-    InitLibC_t      InitLibC;
-
-    /* Read the PE file headers from disk */
-    if (!PE_readHeader(f,startOffset,&filehdr,&opthdr))
-       return NULL;
-
-    /* Scan all the section headers and find the necessary sections */
-    text_off = data_off = reloc_off = export_off = 0;
-    text_addr = text_size = 0;
-    data_addr = data_size = data_end = 0;
-    export_addr = export_size = export_end = 0;
-    reloc_size = 0;
-    for (i = 0; i < filehdr.NumberOfSections; i++) {
-       if (fread(&secthdr, 1, sizeof(secthdr), f) != sizeof(secthdr))
-           goto Error;
-       if (strcmp(secthdr.Name, ".edata") == 0 || strcmp(secthdr.Name, ".rdata") == 0) {
-           /* Exports section */
-           export_off = secthdr.PointerToRawData;
-           export_addr = secthdr.VirtualAddress;
-           export_size = secthdr.SizeOfRawData;
-           export_end = export_addr + export_size;
-           }
-       else if (strcmp(secthdr.Name, ".idata") == 0) {
-           /* Imports section, ignore */
-           }
-       else if (strcmp(secthdr.Name, ".reloc") == 0) {
-           /* Relocations section */
-           reloc_off = secthdr.PointerToRawData;
-           reloc_size = secthdr.SizeOfRawData;
-           }
-       else if (!text_off && secthdr.Characteristics & IMAGE_SCN_CNT_CODE) {
-           /* Code section */
-           text_off = secthdr.PointerToRawData;
-           text_addr = secthdr.VirtualAddress;
-           text_size = secthdr.SizeOfRawData;
-           }
-       else if (!data_off && secthdr.Characteristics & IMAGE_SCN_CNT_INITIALIZED_DATA) {
-           /* Data section */
-           data_off = secthdr.PointerToRawData;
-           data_addr = secthdr.VirtualAddress;
-           data_size = secthdr.SizeOfRawData;
-           data_end = data_addr + data_size;
-           }
-       }
-
-    /* Check to make sure that we have all the sections we need */
-    if (!text_off || !data_off || !export_off || !reloc_off) {
-       result = PE_invalidDLLImage;
-       goto Error;
-       }
-
-    /* Find the size of the image to load allocate memory for it */
-    image_size = MAX(export_end,data_end) - text_addr;
-    *size = sizeof(PE_MODULE) + image_size + 4096;
-    if (shared)
-       hMod = PM_mallocShared(*size);
-    else
-       hMod = PM_malloc(*size);
-    reloc = PM_malloc(reloc_size);
-    if (!hMod || !reloc) {
-       result = PE_outOfMemory;
-       goto Error;
-       }
-
-    hMod->text = (uchar*)ROUND_4K((ulong)hMod + sizeof(PE_MODULE));
-    hMod->data = (uchar*)((ulong)hMod->text + (data_addr - text_addr));
-    hMod->export = (uchar*)((ulong)hMod->text + (export_addr - text_addr));
-    hMod->textBase = text_addr;
-    hMod->dataBase = data_addr;
-    hMod->exportBase = export_addr;
-    hMod->exportDir = opthdr.DataDirectory[0].RelVirtualAddress - export_addr;
-    hMod->shared = shared;
-
-    /* Now read the section images from disk */
-    result = PE_invalidDLLImage;
-    fseek(f, startOffset+text_off, SEEK_SET);
-    if (fread(hMod->text, 1, text_size, f) != text_size)
-       goto Error;
-    fseek(f, startOffset+data_off, SEEK_SET);
-    if (fread(hMod->data, 1, data_size, f) != data_size)
-       goto Error;
-    fseek(f, startOffset+export_off, SEEK_SET);
-    if (fread(hMod->export, 1, export_size, f) != export_size)
-       goto Error;
-    fseek(f, startOffset+reloc_off, SEEK_SET);
-    if (fread(reloc, 1, reloc_size, f) != reloc_size)
-       goto Error;
-
-    /* Now perform relocations on all sections in the image */
-    delta = (ulong)hMod->text - opthdr.ImageBase - text_addr;
-    baseReloc = (BASE_RELOCATION*)reloc;
-    for (;;) {
-       /* Check for termination condition */
-       if (!baseReloc->PageRVA || !baseReloc->BlockSize)
-           break;
-
-       /* Do fixups */
-       pageOffset = baseReloc->PageRVA - hMod->textBase;
-       numFixups = (baseReloc->BlockSize - sizeof(BASE_RELOCATION)) / sizeof(ushort);
-       fixup = (ushort*)(baseReloc + 1);
-       for (i = 0; i < numFixups; i++) {
-           relocType = *fixup >> 12;
-           if (relocType) {
-               offset = pageOffset + (*fixup & 0x0FFF);
-               *(ulong*)(hMod->text + offset) += delta;
-               }
-           fixup++;
-           }
-
-       /* Move to next relocation block */
-       baseReloc = (BASE_RELOCATION*)((ulong)baseReloc + baseReloc->BlockSize);
-       }
-
-    /* Initialise the C runtime library for the loaded DLL */
-    result = PE_unableToInitLibC;
-    if ((InitLibC = (InitLibC_t)PE_getProcAddress(hMod,"_InitLibC")) == NULL)
-       goto Error;
-    if (!InitLibC(&___imports,PM_getOSType()))
-       goto Error;
-
-    /* Clean up, close the file and return the loaded module handle */
-    PM_free(reloc);
-    result = PE_ok;
-    return hMod;
-
-Error:
-    if (shared)
-       PM_freeShared(hMod);
-    else
-       PM_free(hMod);
-    PM_free(reloc);
-    return NULL;
-}
-
-/****************************************************************************
-DESCRIPTION:
-Loads a Portable Binary DLL into memory
-
-HEADER:
-peloader.h
-
-PARAMETERS:
-szDLLName   - Name of the PE DLL library to load
-shared      - True to load module into shared memory
-
-RETURNS:
-Handle to loaded PE DLL, or NULL on failure.
-
-REMARKS:
-This function loads a Portable Binary DLL library from disk, relocates
-the code and returns a handle to the loaded library. This function
-will only work on DLL's that do not have any imports, since we don't
-resolve import dependencies in this function.
-
-SEE ALSO:
-PE_getProcAddress, PE_freeLibrary
-****************************************************************************/
-PE_MODULE * PEAPI PE_loadLibrary(
-    const char *szDLLName,
-    ibool shared)
-{
-    PE_MODULE   *hMod;
-
-#if (defined(__WINDOWS32__) || defined(__DRIVER__)) && defined(CHECKED)
-    if (!shared) {
-       PM_MODULE       hInst;
-       InitLibC_t      InitLibC;
-
-       /* For Win32 if are building checked libraries for debugging, we use
-        * the real Win32 DLL functions so that we can debug the resulting DLL
-        * files with the Win32 debuggers. Note that we can't do this if
-        * we need to load the files into a shared memory context.
-        */
-       if ((hInst = PM_loadLibrary(szDLLName)) == NULL) {
-           result = PE_fileNotFound;
-           return NULL;
-           }
-
-       /* Initialise the C runtime library for the loaded DLL */
-       result = PE_unableToInitLibC;
-       if ((InitLibC = (void*)PM_getProcAddress(hInst,"_InitLibC")) == NULL)
-           return NULL;
-       if (!InitLibC(&___imports,PM_getOSType()))
-           return NULL;
-
-       /* Allocate the PE_MODULE structure */
-       if ((hMod = PM_malloc(sizeof(*hMod))) == NULL)
-           return NULL;
-       hMod->text = (void*)hInst;
-       hMod->shared = -1;
-
-       /* DLL loaded successfully so return module handle */
-       result = PE_ok;
-       return hMod;
-       }
-    else
-#endif
-       {
-       FILE        *f;
-       ulong       size;
-
-       /* Attempt to open the file on disk */
-       if (shared < 0)
-           shared = 0;
-       if ((f = fopen(szDLLName,"rb")) == NULL) {
-           result = PE_fileNotFound;
-           return NULL;
-           }
-       hMod = PE_loadLibraryExt(f,0,&size,shared);
-       fclose(f);
-       return hMod;
-       }
-}
-
-/****************************************************************************
-DESCRIPTION:
-Loads a Portable Binary DLL into memory
-
-HEADER:
-peloader.h
-
-PARAMETERS:
-szDLLName   - Name of the PE DLL library to load
-shared      - True to load module into shared memory
-
-RETURNS:
-Handle to loaded PE DLL, or NULL on failure.
-
-REMARKS:
-This function is the same as the regular PE_loadLibrary function, except
-that it looks for the drivers in the MGL_ROOT/drivers directory or a
-/drivers directory relative to the current directory.
-
-SEE ALSO:
-PE_loadLibraryMGL, PE_getProcAddress, PE_freeLibrary
-****************************************************************************/
-PE_MODULE * PEAPI PE_loadLibraryMGL(
-    const char *szDLLName,
-    ibool shared)
-{
-#if !defined(__WIN32_VXD__) && !defined(__NT_DRIVER__)
-    PE_MODULE   *hMod;
-#endif
-    char        path[256] = "";
-
-    /* We look in the 'drivers' directory, optionally under the MGL_ROOT
-     * environment variable directory.
-     */
-#if !defined(__WIN32_VXD__) && !defined(__NT_DRIVER__)
-    if (getenv("MGL_ROOT")) {
-       strcpy(path,getenv("MGL_ROOT"));
-       PM_backslash(path);
-       }
-    strcat(path,"drivers");
-    PM_backslash(path);
-    strcat(path,szDLLName);
-    if ((hMod = PE_loadLibrary(path,shared)) != NULL)
-       return hMod;
-#endif
-    strcpy(path,"drivers");
-    PM_backslash(path);
-    strcat(path,szDLLName);
-    return PE_loadLibrary(path,shared);
-}
-
-/****************************************************************************
-DESCRIPTION:
-Gets a function address from a Portable Binary DLL
-
-HEADER:
-peloader.h
-
-PARAMETERS:
-hModule     - Handle to a loaded PE DLL library
-szProcName  - Name of the function to get the address of
-
-RETURNS:
-Pointer to the function, or NULL on failure.
-
-REMARKS:
-This function searches for the named, exported function in a loaded PE
-DLL library, and returns the address of the function. If the function is
-not found in the library, this function return NULL.
-
-SEE ALSO:
-PE_loadLibrary, PE_freeLibrary
-****************************************************************************/
-void * PEAPI PE_getProcAddress(
-    PE_MODULE *hModule,
-    const char *szProcName)
-{
-#if (defined(__WINDOWS32__) || defined(__DRIVER__)) && defined(CHECKED)
-    if (hModule->shared == -1)
-       return (void*)PM_getProcAddress(hModule->text,szProcName);
-    else
-#endif
-       {
-       uint                i;
-       EXPORT_DIRECTORY    *exports;
-       ulong               funcOffset;
-       ulong               *AddressTable;
-       ulong               *NameTable;
-       ushort              *OrdinalTable;
-       char                *name;
-
-       /* Find the address of the export tables from the export section */
-       if (!hModule)
-           return NULL;
-       exports = (EXPORT_DIRECTORY*)(hModule->export + hModule->exportDir);
-       AddressTable = (ulong*)(hModule->export + exports->AddressTableRVA - hModule->exportBase);
-       NameTable = (ulong*)(hModule->export + exports->NameTableRVA - hModule->exportBase);
-       OrdinalTable = (ushort*)(hModule->export + exports->OrdinalTableRVA - hModule->exportBase);
-
-       /* Search the export name table to find the function name */
-       for (i = 0; i < exports->NumberOfNamePointers; i++) {
-           name = (char*)(hModule->export + NameTable[i] - hModule->exportBase);
-           if (strcmp(name,szProcName) == 0)
-               break;
-           }
-       if (i == exports->NumberOfNamePointers)
-           return NULL;
-       funcOffset = AddressTable[OrdinalTable[i]];
-       if (!funcOffset)
-           return NULL;
-       return (void*)(hModule->text + funcOffset - hModule->textBase);
-       }
-}
-
-/****************************************************************************
-DESCRIPTION:
-Frees a loaded Portable Binary DLL
-
-HEADER:
-peloader.h
-
-PARAMETERS:
-hModule     - Handle to a loaded PE DLL library to free
-
-REMARKS:
-This function frees a loaded PE DLL library from memory.
-
-SEE ALSO:
-PE_getProcAddress, PE_loadLibrary
-****************************************************************************/
-void PEAPI PE_freeLibrary(
-    PE_MODULE *hModule)
-{
-    TerminateLibC_t TerminateLibC;
-
-#if (defined(__WINDOWS32__) || defined(__DRIVER__)) && defined(CHECKED)
-    if (hModule->shared == -1) {
-       /* Run the C runtime library exit code on module unload */
-       if ((TerminateLibC = (TerminateLibC_t)PM_getProcAddress(hModule->text,"_TerminateLibC")) != NULL)
-           TerminateLibC();
-       PM_freeLibrary(hModule->text);
-       PM_free(hModule);
-       }
-    else
-#endif
-       {
-       if (hModule) {
-           /* Run the C runtime library exit code on module unload */
-           if ((TerminateLibC = (TerminateLibC_t)PE_getProcAddress(hModule,"_TerminateLibC")) != NULL)
-               TerminateLibC();
-           if (hModule->shared)
-               PM_freeShared(hModule);
-           else
-               PM_free(hModule);
-           }
-       }
-}
-
-/****************************************************************************
-DESCRIPTION:
-Returns the error code for the last operation
-
-HEADER:
-peloader.h
-
-RETURNS:
-Error code for the last operation.
-
-SEE ALSO:
-PE_getProcAddress, PE_loadLibrary
-****************************************************************************/
-int PEAPI PE_getError(void)
-{
-    return result;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/common/vesavbe.c b/board/MAI/bios_emulator/scitech/src/common/vesavbe.c
deleted file mode 100644 (file)
index a669e5c..0000000
+++ /dev/null
@@ -1,1214 +0,0 @@
-/****************************************************************************
-*
-*           The SuperVGA Kit - UniVBE Software Development Kit
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  IBM PC Real Mode and 16/32 bit Protected Mode.
-*
-* Description:  Module to implement a C callable interface to the standard
-*               VESA VBE routines. You should rip out this module and use it
-*               directly in your own applications, or you can use the
-*               high level SDK functions.
-*
-*               MUST be compiled in the LARGE or FLAT models.
-*
-****************************************************************************/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "vesavbe.h"
-#include "pmapi.h"
-#include "drvlib/os/os.h"
-
-/*---------------------------- Global Variables ---------------------------*/
-
-#define VBE_SUCCESS     0x004F
-#define MAX_LIN_PTRS    10
-
-static uint         VESABuf_len = 1024;/* Length of the VESABuf buffer  */
-static ibool        haveRiva128;    /* True if we have a Riva128        */
-static VBE_state    defState = {0}; /* Default state buffer             */
-static VBE_state    *state = &defState; /* Pointer to current buffer    */
-static int          VBE_shared = 0;
-#ifndef REALMODE
-static char         localBuf[512];  /* Global PM string translate buf   */
-#define MAX_LOCAL_BUF &localBuf[511]
-#endif
-
-/*----------------------------- Implementation ----------------------------*/
-
-/* static function in WinDirect for passing 32-bit registers to BIOS */
-int PMAPI WD_int386(int intno, RMREGS *in, RMREGS *out);
-
-void VBEAPI VBE_init(void)
-/****************************************************************************
-*
-* Function:     VBE_init
-*
-* Description:  Initialises the VBE transfer buffer in real mode DC.memory.
-*               This routine is called by the VESAVBE module every time
-*               it needs to use the transfer buffer, so we simply allocate
-*               it once and then return.
-*
-****************************************************************************/
-{
-    if (!state->VESABuf_ptr) {
-       /* Allocate a global buffer for communicating with the VESA VBE */
-       if ((state->VESABuf_ptr = PM_getVESABuf(&VESABuf_len, &state->VESABuf_rseg, &state->VESABuf_roff)) == NULL)
-           PM_fatalError("VESAVBE.C: Real mode memory allocation failed!");
-       }
-}
-
-void * VBEAPI VBE_getRMBuf(uint *len,uint *rseg,uint *roff)
-/****************************************************************************
-*
-* Function:     VBE_getRMBuf
-*
-* Description:  This function returns the location and length of the real
-*               mode memory buffer for calling real mode functions.
-*
-****************************************************************************/
-{
-    *len = VESABuf_len;
-    *rseg = state->VESABuf_rseg;
-    *roff = state->VESABuf_roff;
-    return state->VESABuf_ptr;
-}
-
-void VBEAPI VBE_setStateBuffer(VBE_state *s)
-/****************************************************************************
-*
-* Function:     VBE_setStateBuffer
-*
-* Description:  This functions sets the internal state buffer for the
-*               VBE module to the passed in buffer. By default the internal
-*               global buffer is used, but you must use separate buffers
-*               for each device in a multi-controller environment.
-*
-****************************************************************************/
-{
-    state = s;
-}
-
-void VBEAPI VBE_callESDI(RMREGS *regs, void *buffer, int size)
-/****************************************************************************
-*
-* Function:     VBE_callESDI
-* Parameters:   regs    - Registers to load when calling VBE
-*               buffer  - Buffer to copy VBE info block to
-*               size    - Size of buffer to fill
-*
-* Description:  Calls the VESA VBE and passes in a buffer for the VBE to
-*               store information in, which is then copied into the users
-*               buffer space. This works in protected mode as the buffer
-*               passed to the VESA VBE is allocated in conventional
-*               memory, and is then copied into the users memory block.
-*
-****************************************************************************/
-{
-    RMSREGS sregs;
-
-    if (!state->VESABuf_ptr)
-       PM_fatalError("You *MUST* call VBE_init() before you can call the VESAVBE.C module!");
-    sregs.es = (ushort)state->VESABuf_rseg;
-    regs->x.di = (ushort)state->VESABuf_roff;
-    memcpy(state->VESABuf_ptr, buffer, size);
-    PM_int86x(0x10, regs, regs, &sregs);
-    memcpy(buffer, state->VESABuf_ptr, size);
-}
-
-#ifndef REALMODE
-static char *VBE_copyStrToLocal(char *p,char *realPtr,char *max)
-/****************************************************************************
-*
-* Function:     VBE_copyStrToLocal
-* Parameters:   p       - Flat model buffer to copy to
-*               realPtr - Real mode pointer to copy
-* Returns:      Pointer to the next byte after string
-*
-* Description:  Copies the string from the real mode location pointed to
-*               by 'realPtr' into the flat model buffer pointed to by
-*               'p'. We return a pointer to the next byte past the copied
-*               string.
-*
-****************************************************************************/
-{
-    uchar   *v;
-
-    v = PM_mapRealPointer((uint)((ulong)realPtr >> 16), (uint)((ulong)realPtr & 0xFFFF));
-    while (*v != 0 && p < max)
-       *p++ = *v++;
-    *p++ = 0;
-    return p;
-}
-
-static void VBE_copyShortToLocal(ushort *p,ushort *realPtr)
-/****************************************************************************
-*
-* Function:     VBE_copyShortToLocal
-* Parameters:   p       - Flat model buffer to copy to
-*               realPtr - Real mode pointer to copy
-*
-* Description:  Copies the mode table from real mode memory to the flat
-*               model buffer.
-*
-****************************************************************************/
-{
-    ushort  *v;
-
-    v = PM_mapRealPointer((uint)((ulong)realPtr >> 16),(uint)((ulong)realPtr & 0xFFFF));
-    while (*v != 0xFFFF)
-       *p++ = *v++;
-    *p = 0xFFFF;
-}
-#endif
-
-int VBEAPI VBE_detectEXT(VBE_vgaInfo *vgaInfo,ibool forceUniVBE)
-/****************************************************************************
-*
-* Function:     VBE_detect
-* Parameters:   vgaInfo - Place to store the VGA information block
-* Returns:      VBE version number, or 0 if not detected.
-*
-* Description:  Detects if a VESA VBE is out there and functioning
-*               correctly. If we detect a VBE interface we return the
-*               VGAInfoBlock returned by the VBE and the VBE version number.
-*
-****************************************************************************/
-{
-    RMREGS  regs;
-
-    regs.x.ax = 0x4F00;     /* Get SuperVGA information */
-    if (forceUniVBE) {
-       regs.x.bx = 0x1234;
-       regs.x.cx = 0x4321;
-       }
-    else {
-       regs.x.bx = 0;
-       regs.x.cx = 0;
-       }
-    strncpy(vgaInfo->VESASignature,"VBE2",4);
-    VBE_callESDI(&regs, vgaInfo, sizeof(*vgaInfo));
-    if (regs.x.ax != VBE_SUCCESS)
-       return 0;
-    if (strncmp(vgaInfo->VESASignature,"VESA",4) != 0)
-       return 0;
-
-    /* Check for bogus BIOSes that return a VBE version number that is
-     * not correct, and fix it up. We also check the OemVendorNamePtr for a
-     * valid value, and if it is invalid then we also reset to VBE 1.2.
-     */
-    if (vgaInfo->VESAVersion >= 0x200 && vgaInfo->OemVendorNamePtr == 0)
-       vgaInfo->VESAVersion = 0x102;
-#ifndef REALMODE
-    /* Relocate all the indirect information (mode tables, OEM strings
-     * etc) from the low 1Mb memory region into a static buffer in
-     * our default data segment. We do this to insulate the application
-     * from mapping the strings from real mode to protected mode.
-     */
-    {
-       char *p,*p2;
-     p2 = VBE_copyStrToLocal(localBuf,vgaInfo->OemStringPtr,MAX_LOCAL_BUF);
-     vgaInfo->OemStringPtr = localBuf;
-     if (vgaInfo->VESAVersion >= 0x200) {
-        p = VBE_copyStrToLocal(p2,vgaInfo->OemVendorNamePtr,MAX_LOCAL_BUF);
-        vgaInfo->OemVendorNamePtr = p2;
-        p2 = VBE_copyStrToLocal(p,vgaInfo->OemProductNamePtr,MAX_LOCAL_BUF);
-        vgaInfo->OemProductNamePtr = p;
-        p = VBE_copyStrToLocal(p2,vgaInfo->OemProductRevPtr,MAX_LOCAL_BUF);
-        vgaInfo->OemProductRevPtr = p2;
-        VBE_copyShortToLocal((ushort*)p,vgaInfo->VideoModePtr);
-        vgaInfo->VideoModePtr = (ushort*)p;
-        }
-     else {
-        VBE_copyShortToLocal((ushort*)p2,vgaInfo->VideoModePtr);
-        vgaInfo->VideoModePtr = (ushort*)p2;
-        }
-    }
-#endif
-    state->VBEMemory = vgaInfo->TotalMemory * 64;
-
-    /* Check for Riva128 based cards since they have broken triple buffering
-     * and stereo support.
-     */
-    haveRiva128 = false;
-    if (vgaInfo->VESAVersion >= 0x300 &&
-          (strstr(vgaInfo->OemStringPtr,"NVidia") != NULL ||
-           strstr(vgaInfo->OemStringPtr,"Riva") != NULL)) {
-       haveRiva128 = true;
-       }
-
-    /* Check for Matrox G400 cards which claim to be VBE 3.0
-     * compliant yet they don't implement the refresh rate control
-     * functions.
-     */
-    if (vgaInfo->VESAVersion >= 0x300 && (strcmp(vgaInfo->OemProductNamePtr,"Matrox G400") == 0))
-       vgaInfo->VESAVersion = 0x200;
-    return (state->VBEVersion = vgaInfo->VESAVersion);
-}
-
-int VBEAPI VBE_detect(VBE_vgaInfo *vgaInfo)
-/****************************************************************************
-*
-* Function:     VBE_detect
-* Parameters:   vgaInfo - Place to store the VGA information block
-* Returns:      VBE version number, or 0 if not detected.
-*
-* Description:  Detects if a VESA VBE is out there and functioning
-*               correctly. If we detect a VBE interface we return the
-*               VGAInfoBlock returned by the VBE and the VBE version number.
-*
-****************************************************************************/
-{
-    return VBE_detectEXT(vgaInfo,false);
-}
-
-ibool VBEAPI VBE_getModeInfo(int mode,VBE_modeInfo *modeInfo)
-/****************************************************************************
-*
-* Function:     VBE_getModeInfo
-* Parameters:   mode        - VBE mode to get information for
-*               modeInfo    - Place to store VBE mode information
-* Returns:      True on success, false if function failed.
-*
-* Description:  Obtains information about a specific video mode from the
-*               VBE. You should use this function to find the video mode
-*               you wish to set, as the new VBE 2.0 mode numbers may be
-*               completely arbitrary.
-*
-****************************************************************************/
-{
-    RMREGS  regs;
-    int     bits;
-
-    regs.x.ax = 0x4F01;             /* Get mode information         */
-    regs.x.cx = (ushort)mode;
-    VBE_callESDI(&regs, modeInfo, sizeof(*modeInfo));
-    if (regs.x.ax != VBE_SUCCESS)
-       return false;
-    if ((modeInfo->ModeAttributes & vbeMdAvailable) == 0)
-       return false;
-
-    /* Map out triple buffer and stereo flags for NVidia Riva128
-     * chips.
-     */
-    if (haveRiva128) {
-       modeInfo->ModeAttributes &= ~vbeMdTripleBuf;
-       modeInfo->ModeAttributes &= ~vbeMdStereo;
-       }
-
-    /* Support old style RGB definitions for VBE 1.1 BIOSes */
-    bits = modeInfo->BitsPerPixel;
-    if (modeInfo->MemoryModel == vbeMemPK && bits > 8) {
-       modeInfo->MemoryModel = vbeMemRGB;
-       switch (bits) {
-           case 15:
-               modeInfo->RedMaskSize = 5;
-               modeInfo->RedFieldPosition = 10;
-               modeInfo->GreenMaskSize = 5;
-               modeInfo->GreenFieldPosition = 5;
-               modeInfo->BlueMaskSize = 5;
-               modeInfo->BlueFieldPosition = 0;
-               modeInfo->RsvdMaskSize = 1;
-               modeInfo->RsvdFieldPosition = 15;
-               break;
-           case 16:
-               modeInfo->RedMaskSize = 5;
-               modeInfo->RedFieldPosition = 11;
-               modeInfo->GreenMaskSize = 5;
-               modeInfo->GreenFieldPosition = 5;
-               modeInfo->BlueMaskSize = 5;
-               modeInfo->BlueFieldPosition = 0;
-               modeInfo->RsvdMaskSize = 0;
-               modeInfo->RsvdFieldPosition = 0;
-               break;
-           case 24:
-               modeInfo->RedMaskSize = 8;
-               modeInfo->RedFieldPosition = 16;
-               modeInfo->GreenMaskSize = 8;
-               modeInfo->GreenFieldPosition = 8;
-               modeInfo->BlueMaskSize = 8;
-               modeInfo->BlueFieldPosition = 0;
-               modeInfo->RsvdMaskSize = 0;
-               modeInfo->RsvdFieldPosition = 0;
-               break;
-           }
-       }
-
-    /* Convert the 32k direct color modes of VBE 1.2+ BIOSes to
-     * be recognised as 15 bits per pixel modes.
-     */
-    if (bits == 16 && modeInfo->RsvdMaskSize == 1)
-       modeInfo->BitsPerPixel = 15;
-
-    /* Fix up bogus BIOS'es that report incorrect reserved pixel masks
-     * for 32K color modes. Quite a number of BIOS'es have this problem,
-     * and this affects our OS/2 drivers in VBE fallback mode.
-     */
-    if (bits == 15 && (modeInfo->RsvdMaskSize != 1 || modeInfo->RsvdFieldPosition != 15)) {
-       modeInfo->RsvdMaskSize = 1;
-       modeInfo->RsvdFieldPosition = 15;
-       }
-    return true;
-}
-
-long VBEAPI VBE_getPageSize(VBE_modeInfo *mi)
-/****************************************************************************
-*
-* Function:     VBE_getPageSize
-* Parameters:   mi  - Pointer to mode information block
-* Returns:      Caculated page size in bytes rounded to correct boundary
-*
-* Description:  Computes the page size in bytes for the specified mode
-*               information block, rounded up to the appropriate boundary
-*               (8k, 16k, 32k or 64k). Pages >= 64k in size are always
-*               rounded to the nearest 64k boundary (so the start of a
-*               page is always bank aligned).
-*
-****************************************************************************/
-{
-    long size;
-
-    size = (long)mi->BytesPerScanLine * (long)mi->YResolution;
-    if (mi->BitsPerPixel == 4) {
-       /* We have a 16 color video mode, so round up the page size to
-        * 8k, 16k, 32k or 64k boundaries depending on how large it is.
-        */
-
-       size = (size + 0x1FFFL) & 0xFFFFE000L;
-       if (size != 0x2000) {
-           size = (size + 0x3FFFL) & 0xFFFFC000L;
-           if (size != 0x4000) {
-               size = (size + 0x7FFFL) & 0xFFFF8000L;
-               if (size != 0x8000)
-                   size = (size + 0xFFFFL) & 0xFFFF0000L;
-               }
-           }
-       }
-    else size = (size + 0xFFFFL) & 0xFFFF0000L;
-    return size;
-}
-
-ibool VBEAPI VBE_setVideoModeExt(int mode,VBE_CRTCInfo *crtc)
-/****************************************************************************
-*
-* Function:     VBE_setVideoModeExt
-* Parameters:   mode    - SuperVGA video mode to set.
-* Returns:      True if the mode was set, false if not.
-*
-* Description:  Attempts to set the specified video mode. This version
-*               includes support for the VBE/Core 3.0 refresh rate control
-*               mechanism.
-*
-****************************************************************************/
-{
-    RMREGS  regs;
-
-    if (state->VBEVersion < 0x200 && mode < 0x100) {
-       /* Some VBE implementations barf terribly if you try to set non-VBE
-        * video modes with the VBE set mode call. VBE 2.0 implementations
-        * must be able to handle this.
-        */
-       regs.h.al = (ushort)mode;
-       regs.h.ah = 0;
-       PM_int86(0x10,&regs,&regs);
-       }
-    else {
-       if (state->VBEVersion < 0x300 && (mode & vbeRefreshCtrl))
-           return false;
-       regs.x.ax = 0x4F02;
-       regs.x.bx = (ushort)mode;
-       if ((mode & vbeRefreshCtrl) && crtc)
-           VBE_callESDI(&regs, crtc, sizeof(*crtc));
-       else
-           PM_int86(0x10,&regs,&regs);
-       if (regs.x.ax != VBE_SUCCESS)
-           return false;
-       }
-    return true;
-}
-
-ibool VBEAPI VBE_setVideoMode(int mode)
-/****************************************************************************
-*
-* Function:     VBE_setVideoMode
-* Parameters:   mode    - SuperVGA video mode to set.
-* Returns:      True if the mode was set, false if not.
-*
-* Description:  Attempts to set the specified video mode.
-*
-****************************************************************************/
-{
-    return VBE_setVideoModeExt(mode,NULL);
-}
-
-int VBEAPI VBE_getVideoMode(void)
-/****************************************************************************
-*
-* Function:     VBE_getVideoMode
-* Returns:      Current video mode
-*
-****************************************************************************/
-{
-    RMREGS  regs;
-
-    regs.x.ax = 0x4F03;
-    PM_int86(0x10,&regs,&regs);
-    if (regs.x.ax != VBE_SUCCESS)
-       return -1;
-    return regs.x.bx;
-}
-
-ibool VBEAPI VBE_setBank(int window,int bank)
-/****************************************************************************
-*
-* Function:     VBE_setBank
-* Parameters:   window  - Window to set
-*               bank    - Bank number to set window to
-* Returns:      True on success, false on failure.
-*
-****************************************************************************/
-{
-    RMREGS  regs;
-
-    regs.x.ax = 0x4F05;
-    regs.h.bh = 0;
-    regs.h.bl = window;
-    regs.x.dx = bank;
-    PM_int86(0x10,&regs,&regs);
-    return regs.x.ax == VBE_SUCCESS;
-}
-
-int VBEAPI VBE_getBank(int window)
-/****************************************************************************
-*
-* Function:     VBE_setBank
-* Parameters:   window  - Window to read
-* Returns:      Bank number for the window (-1 on failure)
-*
-****************************************************************************/
-{
-    RMREGS  regs;
-
-    regs.x.ax = 0x4F05;
-    regs.h.bh = 1;
-    regs.h.bl = window;
-    PM_int86(0x10,&regs,&regs);
-    if (regs.x.ax != VBE_SUCCESS)
-       return -1;
-    return regs.x.dx;
-}
-
-ibool VBEAPI VBE_setPixelsPerLine(int pixelsPerLine,int *newBytes,
-    int *newPixels,int *maxScanlines)
-/****************************************************************************
-*
-* Function:     VBE_setPixelsPerLine
-* Parameters:   pixelsPerLine   - Pixels per scanline
-*               newBytes        - Storage for bytes per line value set
-*               newPixels       - Storage for pixels per line value set
-*               maxScanLines    - Storage for maximum number of scanlines
-* Returns:      True on success, false on failure
-*
-* Description:  Sets the scanline length for the video mode to the specified
-*               number of pixels per scanline. If you need more granularity
-*               in TrueColor modes, use the VBE_setBytesPerLine routine
-*               (only valid for VBE 2.0).
-*
-****************************************************************************/
-{
-    RMREGS  regs;
-
-    regs.x.ax = 0x4F06;
-    regs.h.bl = 0;
-    regs.x.cx = pixelsPerLine;
-    PM_int86(0x10,&regs,&regs);
-    *newBytes = regs.x.bx;
-    *newPixels = regs.x.cx;
-    *maxScanlines = regs.x.dx;
-    return regs.x.ax == VBE_SUCCESS;
-}
-
-ibool VBEAPI VBE_setBytesPerLine(int bytesPerLine,int *newBytes,
-    int *newPixels,int *maxScanlines)
-/****************************************************************************
-*
-* Function:     VBE_setBytesPerLine
-* Parameters:   pixelsPerLine   - Pixels per scanline
-*               newBytes        - Storage for bytes per line value set
-*               newPixels       - Storage for pixels per line value set
-*               maxScanLines    - Storage for maximum number of scanlines
-* Returns:      True on success, false on failure
-*
-* Description:  Sets the scanline length for the video mode to the specified
-*               number of bytes per scanline (valid for VBE 2.0 only).
-*
-****************************************************************************/
-{
-    RMREGS  regs;
-
-    regs.x.ax = 0x4F06;
-    regs.h.bl = 2;
-    regs.x.cx = bytesPerLine;
-    PM_int86(0x10,&regs,&regs);
-    *newBytes = regs.x.bx;
-    *newPixels = regs.x.cx;
-    *maxScanlines = regs.x.dx;
-    return regs.x.ax == VBE_SUCCESS;
-}
-
-ibool VBEAPI VBE_getScanlineLength(int *bytesPerLine,int *pixelsPerLine,
-    int *maxScanlines)
-/****************************************************************************
-*
-* Function:     VBE_getScanlineLength
-* Parameters:   bytesPerLine    - Storage for bytes per scanline
-*               pixelsPerLine   - Storage for pixels per scanline
-*               maxScanLines    - Storage for maximum number of scanlines
-* Returns:      True on success, false on failure
-*
-****************************************************************************/
-{
-    RMREGS  regs;
-
-    regs.x.ax = 0x4F06;
-    regs.h.bl = 1;
-    PM_int86(0x10,&regs,&regs);
-    *bytesPerLine = regs.x.bx;
-    *pixelsPerLine = regs.x.cx;
-    *maxScanlines = regs.x.dx;
-    return regs.x.ax == VBE_SUCCESS;
-}
-
-ibool VBEAPI VBE_getMaxScanlineLength(int *maxBytes,int *maxPixels)
-/****************************************************************************
-*
-* Function:     VBE_getMaxScanlineLength
-* Parameters:   maxBytes    - Maximum scanline width in bytes
-*               maxPixels   - Maximum scanline width in pixels
-* Returns:      True if successful, false if function failed
-*
-****************************************************************************/
-{
-    RMREGS  regs;
-
-    regs.x.ax = 0x4F06;
-    regs.h.bl = 3;
-    PM_int86(0x10,&regs,&regs);
-    *maxBytes = regs.x.bx;
-    *maxPixels = regs.x.cx;
-    return regs.x.ax == VBE_SUCCESS;
-}
-
-ibool VBEAPI VBE_setDisplayStart(int x,int y,ibool waitVRT)
-/****************************************************************************
-*
-* Function:     VBE_setDisplayStart
-* Parameters:   x,y     - Position of the first pixel to display
-*               waitVRT - True to wait for retrace, false if not
-* Returns:      True if function was successful.
-*
-* Description:  Sets the new starting display position to implement
-*               hardware scrolling.
-*
-****************************************************************************/
-{
-    RMREGS  regs;
-
-    regs.x.ax = 0x4F07;
-    if (waitVRT)
-       regs.x.bx = 0x80;
-    else regs.x.bx = 0x00;
-    regs.x.cx = x;
-    regs.x.dx = y;
-    PM_int86(0x10,&regs,&regs);
-    return regs.x.ax == VBE_SUCCESS;
-}
-
-ibool VBEAPI VBE_getDisplayStart(int *x,int *y)
-/****************************************************************************
-*
-* Function:     VBE_getDisplayStart
-* Parameters:   x,y - Place to store starting address value
-* Returns:      True if function was successful.
-*
-****************************************************************************/
-{
-    RMREGS  regs;
-
-    regs.x.ax = 0x4F07;
-    regs.x.bx = 0x01;
-    PM_int86(0x10,&regs,&regs);
-    *x = regs.x.cx;
-    *y = regs.x.dx;
-    return regs.x.ax == VBE_SUCCESS;
-}
-
-ibool VBEAPI VBE_setDisplayStartAlt(ulong startAddr,ibool waitVRT)
-/****************************************************************************
-*
-* Function:     VBE_setDisplayStartAlt
-* Parameters:   startAddr   - 32-bit starting address in display memory
-*               waitVRT     - True to wait for vertical retrace, false if not
-* Returns:      True if function was successful, false if not supported.
-*
-* Description:  Sets the new starting display position to the specified
-*               32-bit display start address. Note that this function is
-*               different the the version above, since it takes a 32-bit
-*               byte offset in video memory as the starting address which
-*               gives the programmer maximum control over the stat address.
-*
-*               NOTE: Requires VBE/Core 3.0
-*
-****************************************************************************/
-{
-    RMREGS  regs;
-
-    if (state->VBEVersion >= 0x300) {
-       regs.x.ax = 0x4F07;
-       regs.x.bx = waitVRT ? 0x82 : 0x02;
-       regs.e.ecx = startAddr;
-       PM_int86(0x10,&regs,&regs);
-       return regs.x.ax == VBE_SUCCESS;
-       }
-    return false;
-}
-
-int VBEAPI VBE_getDisplayStartStatus(void)
-/****************************************************************************
-*
-* Function:     VBE_getDisplayStartStatus
-* Returns:      0 if last flip not occurred, 1 if already flipped
-*               -1 if not supported
-*
-* Description:  Returns the status of the previous display start request.
-*               If this function is supported the programmer can implement
-*               hardware triple buffering using this function.
-*
-*               NOTE: Requires VBE/Core 3.0
-*
-****************************************************************************/
-{
-    RMREGS  regs;
-
-    if (state->VBEVersion >= 0x300) {
-       regs.x.ax = 0x4F07;
-       regs.x.bx = 0x0004;
-       PM_int86(0x10,&regs,&regs);
-       if (regs.x.ax == VBE_SUCCESS)
-           return (regs.x.cx != 0);
-       }
-    return -1;
-}
-
-ibool VBEAPI VBE_enableStereoMode(void)
-/****************************************************************************
-*
-* Function:     VBE_enableStereoMode
-* Returns:      True if stereo mode enabled, false if not supported.
-*
-* Description:  Puts the system into hardware stereo mode for LC shutter
-*               glasses, where the display swaps between two display start
-*               addresses every vertical retrace.
-*
-*               NOTE: Requires VBE/Core 3.0
-*
-****************************************************************************/
-{
-    RMREGS  regs;
-
-    if (state->VBEVersion >= 0x300) {
-       regs.x.ax = 0x4F07;
-       regs.x.bx = 0x0005;
-       PM_int86(0x10,&regs,&regs);
-       return regs.x.ax == VBE_SUCCESS;
-       }
-    return false;
-}
-
-ibool VBEAPI VBE_disableStereoMode(void)
-/****************************************************************************
-*
-* Function:     VBE_disableStereoMode
-* Returns:      True if stereo mode disabled, false if not supported.
-*
-* Description:  Puts the system back into normal, non-stereo display mode
-*               after having stereo mode enabled.
-*
-*               NOTE: Requires VBE/Core 3.0
-*
-****************************************************************************/
-{
-    RMREGS  regs;
-
-    if (state->VBEVersion >= 0x300) {
-       regs.x.ax = 0x4F07;
-       regs.x.bx = 0x0006;
-       PM_int86(0x10,&regs,&regs);
-       return regs.x.ax == VBE_SUCCESS;
-       }
-    return false;
-}
-
-ibool VBEAPI VBE_setStereoDisplayStart(ulong leftAddr,ulong rightAddr,
-    ibool waitVRT)
-/****************************************************************************
-*
-* Function:     VBE_setStereoDisplayStart
-* Parameters:   leftAddr    - 32-bit start address for left image
-*               rightAddr   - 32-bit start address for right image
-*               waitVRT     - True to wait for vertical retrace, false if not
-* Returns:      True if function was successful, false if not supported.
-*
-* Description:  Sets the new starting display position to the specified
-*               32-bit display start address. Note that this function is
-*               different the the version above, since it takes a 32-bit
-*               byte offset in video memory as the starting address which
-*               gives the programmer maximum control over the stat address.
-*
-*               NOTE: Requires VBE/Core 3.0
-*
-****************************************************************************/
-{
-    RMREGS  regs;
-
-    if (state->VBEVersion >= 0x300) {
-       regs.x.ax = 0x4F07;
-       regs.x.bx = waitVRT ? 0x83 : 0x03;
-       regs.e.ecx = leftAddr;
-       regs.e.edx = rightAddr;
-       PM_int86(0x10,&regs,&regs);
-       return regs.x.ax == VBE_SUCCESS;
-       }
-    return false;
-}
-
-ulong VBEAPI VBE_getClosestClock(ushort mode,ulong pixelClock)
-/****************************************************************************
-*
-* Function:     VBE_getClosestClock
-* Parameters:   mode        - VBE mode to be used (include vbeLinearBuffer)
-*               pixelClock  - Desired pixel clock
-* Returns:      Closest pixel clock to desired clock (-1 if not supported)
-*
-* Description:  Calls the VBE/Core 3.0 interface to determine the closest
-*               pixel clock to the requested value. The BIOS will always
-*               search for a pixel clock that is no more than 1% below the
-*               requested clock or somewhere higher than the clock. If the
-*               clock is higher note that it may well be many Mhz higher
-*               that requested and the application will have to check that
-*               the returned value is suitable for it's needs. This function
-*               returns the actual pixel clock that will be programmed by
-*               the hardware.
-*
-*               Note that if the pixel clock will be used with a linear
-*               framebuffer mode, make sure you pass in the linear
-*               framebuffer flag to this function.
-*
-*               NOTE: Requires VBE/Core 3.0
-*
-****************************************************************************/
-{
-    RMREGS  regs;
-
-    if (state->VBEVersion >= 0x300) {
-       regs.x.ax = 0x4F0B;
-       regs.h.bl = 0x00;
-       regs.e.ecx = pixelClock;
-       regs.x.dx = mode;
-       PM_int86(0x10,&regs,&regs);
-       if (regs.x.ax == VBE_SUCCESS)
-           return regs.e.ecx;
-       }
-    return -1;
-}
-
-ibool VBEAPI VBE_setDACWidth(int width)
-/****************************************************************************
-*
-* Function:     VBE_setDACWidth
-* Parameters:   width   - Width to set the DAC to
-* Returns:      True on success, false on failure
-*
-****************************************************************************/
-{
-    RMREGS  regs;
-
-    regs.x.ax = 0x4F08;
-    regs.h.bl = 0x00;
-    regs.h.bh = width;
-    PM_int86(0x10,&regs,&regs);
-    return regs.x.ax == VBE_SUCCESS;
-}
-
-int VBEAPI VBE_getDACWidth(void)
-/****************************************************************************
-*
-* Function:     VBE_getDACWidth
-* Returns:      Current width of the palette DAC
-*
-****************************************************************************/
-{
-    RMREGS  regs;
-
-    regs.x.ax = 0x4F08;
-    regs.h.bl = 0x01;
-    PM_int86(0x10,&regs,&regs);
-    if (regs.x.ax != VBE_SUCCESS)
-       return -1;
-    return regs.h.bh;
-}
-
-ibool VBEAPI VBE_setPalette(int start,int num,VBE_palette *pal,ibool waitVRT)
-/****************************************************************************
-*
-* Function:     VBE_setPalette
-* Parameters:   start   - Starting palette index to program
-*               num     - Number of palette indexes to program
-*               pal     - Palette buffer containing values
-*               waitVRT - Wait for vertical retrace flag
-* Returns:      True on success, false on failure
-*
-* Description:  Sets a block of palette registers by calling the VBE 2.0
-*               BIOS. This function will fail on VBE 1.2 implementations.
-*
-****************************************************************************/
-{
-    RMREGS  regs;
-
-    regs.x.ax = 0x4F09;
-    regs.h.bl = waitVRT ? 0x80 : 0x00;
-    regs.x.cx = num;
-    regs.x.dx = start;
-    VBE_callESDI(&regs, pal, sizeof(VBE_palette) * num);
-    return regs.x.ax == VBE_SUCCESS;
-}
-
-void * VBEAPI VBE_getBankedPointer(VBE_modeInfo *modeInfo)
-/****************************************************************************
-*
-* Function:     VBE_getBankedPointer
-* Parameters:   modeInfo    - Mode info block for video mode
-* Returns:      Selector to the linear framebuffer (0 on failure)
-*
-* Description:  Returns a near pointer to the VGA framebuffer area.
-*
-****************************************************************************/
-{
-    /* We just map the pointer every time, since the pointer will always
-     * be in real mode memory, so we wont actually be mapping any real
-     * memory.
-     *
-     * NOTE: We cannot currently map a near pointer to the banked frame
-     *       buffer for Watcom Win386, so we create a 16:16 far pointer to
-     *       the video memory. All the assembler code will render to the
-     *       video memory by loading the selector rather than using a
-     *       near pointer.
-     */
-    ulong seg = (ushort)modeInfo->WinASegment;
-    if (seg != 0) {
-       if (seg == 0xA000)
-           return (void*)PM_getA0000Pointer();
-       else
-           return (void*)PM_mapPhysicalAddr(seg << 4,0xFFFF,true);
-       }
-    return NULL;
-}
-
-#ifndef REALMODE
-
-void * VBEAPI VBE_getLinearPointer(VBE_modeInfo *modeInfo)
-/****************************************************************************
-*
-* Function:     VBE_getLinearPointer
-* Parameters:   modeInfo    - Mode info block for video mode
-* Returns:      Selector to the linear framebuffer (0 on failure)
-*
-* Description:  Returns a near pointer to the linear framebuffer for the video
-*               mode.
-*
-****************************************************************************/
-{
-    static ulong physPtr[MAX_LIN_PTRS] = {0};
-    static void *linPtr[MAX_LIN_PTRS] = {0};
-    static int numPtrs = 0;
-    int i;
-
-    /* Search for an already mapped pointer */
-    for (i = 0; i < numPtrs; i++) {
-       if (physPtr[i] == modeInfo->PhysBasePtr)
-           return linPtr[i];
-       }
-    if (numPtrs < MAX_LIN_PTRS) {
-       physPtr[numPtrs] = modeInfo->PhysBasePtr;
-       linPtr[numPtrs] = PM_mapPhysicalAddr(modeInfo->PhysBasePtr,(state->VBEMemory * 1024L)-1,true);
-       return linPtr[numPtrs++];
-       }
-    return NULL;
-}
-
-static void InitPMCode(void)
-/****************************************************************************
-*
-* Function:     InitPMCode  - 32 bit protected mode version
-*
-* Description:  Finds the address of and relocates the protected mode
-*               code block from the VBE 2.0 into a local memory block. The
-*               memory block is allocated with malloc() and must be freed
-*               with VBE_freePMCode() after graphics processing is complete.
-*
-*               Note that this buffer _must_ be recopied after each mode set,
-*               as the routines will change depending on the underlying
-*               video mode.
-*
-****************************************************************************/
-{
-    RMREGS      regs;
-    RMSREGS     sregs;
-    uchar       *code;
-    int         pmLen;
-
-    if (!state->pmInfo && state->VBEVersion >= 0x200) {
-       regs.x.ax = 0x4F0A;
-       regs.x.bx = 0;
-       PM_int86x(0x10,&regs,&regs,&sregs);
-       if (regs.x.ax != VBE_SUCCESS)
-           return;
-       if (VBE_shared)
-           state->pmInfo = PM_mallocShared(regs.x.cx);
-       else
-           state->pmInfo = PM_malloc(regs.x.cx);
-       if (state->pmInfo == NULL)
-           return;
-       state->pmInfo32 = state->pmInfo;
-       pmLen = regs.x.cx;
-
-       /* Relocate the block into our local data segment */
-       code = PM_mapRealPointer(sregs.es,regs.x.di);
-       memcpy(state->pmInfo,code,pmLen);
-
-       /* Now do a sanity check on the information we recieve to ensure
-        * that is is correct. Some BIOS return totally bogus information
-        * in here (Matrox is one)! Under DOS this works OK, but under OS/2
-        * we are screwed.
-        */
-       if (state->pmInfo->setWindow >= pmLen ||
-           state->pmInfo->setDisplayStart >= pmLen ||
-           state->pmInfo->setPalette >= pmLen ||
-           state->pmInfo->IOPrivInfo >= pmLen) {
-           if (VBE_shared)
-               PM_freeShared(state->pmInfo);
-           else
-               PM_free(state->pmInfo);
-           state->pmInfo32 = state->pmInfo = NULL;
-           return;
-           }
-
-       /* Read the IO priveledge info and determine if we need to
-        * pass a selector to MMIO registers to the bank switch code.
-        * Since we no longer support selector allocation, we no longer
-        * support this mechanism so we disable the protected mode
-        * interface in this case.
-        */
-       if (state->pmInfo->IOPrivInfo && !state->MMIOSel) {
-           ushort *p = (ushort*)((uchar*)state->pmInfo + state->pmInfo->IOPrivInfo);
-           while (*p != 0xFFFF)
-               p++;
-           p++;
-           if (*p != 0xFFFF)
-               VBE_freePMCode();
-           }
-       }
-}
-
-void * VBEAPI VBE_getSetBank(void)
-/****************************************************************************
-*
-* Function:     VBE_getSetBank
-* Returns:      Pointer to the 32 VBE 2.0 bit bank switching routine.
-*
-****************************************************************************/
-{
-    if (state->VBEVersion >= 0x200) {
-       InitPMCode();
-       if (state->pmInfo)
-           return (uchar*)state->pmInfo + state->pmInfo->setWindow;
-       }
-    return NULL;
-}
-
-void * VBEAPI VBE_getSetDisplayStart(void)
-/****************************************************************************
-*
-* Function:     VBE_getSetDisplayStart
-* Returns:      Pointer to the 32 VBE 2.0 bit CRT start address routine.
-*
-****************************************************************************/
-{
-    if (state->VBEVersion >= 0x200) {
-       InitPMCode();
-       if (state->pmInfo)
-           return (uchar*)state->pmInfo + state->pmInfo->setDisplayStart;
-       }
-    return NULL;
-}
-
-void * VBEAPI VBE_getSetPalette(void)
-/****************************************************************************
-*
-* Function:     VBE_getSetPalette
-* Returns:      Pointer to the 32 VBE 2.0 bit palette programming routine.
-*
-****************************************************************************/
-{
-    if (state->VBEVersion >= 0x200) {
-       InitPMCode();
-       if (state->pmInfo)
-           return (uchar*)state->pmInfo + state->pmInfo->setPalette;
-       }
-    return NULL;
-}
-
-void VBEAPI VBE_freePMCode(void)
-/****************************************************************************
-*
-* Function:     VBE_freePMCode
-*
-* Description:  This routine frees the protected mode code blocks that
-*               we copied from the VBE 2.0 interface. This routine must
-*               be after you have finished graphics processing to free up
-*               the memory occupied by the routines. This is necessary
-*               because the PM info memory block must be re-copied after
-*               every video mode set from the VBE 2.0 implementation.
-*
-****************************************************************************/
-{
-    if (state->pmInfo) {
-       if (VBE_shared)
-           PM_freeShared(state->pmInfo);
-       else
-           PM_free(state->pmInfo);
-       state->pmInfo = NULL;
-       state->pmInfo32 = NULL;
-       }
-}
-
-void VBEAPI VBE_sharePMCode(void)
-/****************************************************************************
-*
-* Function:     VBE_sharePMCode
-*
-* Description:  Enables internal sharing of the PM code buffer for OS/2.
-*
-****************************************************************************/
-{
-    VBE_shared = true;
-}
-
-/* Set of code stubs used to build the final bank switch code */
-
-#define VBE20_adjustOffset  7
-
-static uchar VBE20A_bankFunc32_Start[] = {
-    0x53,0x51,                  /*  push    ebx,ecx     */
-    0x8B,0xD0,                  /*  mov     edx,eax     */
-    0x33,0xDB,                  /*  xor     ebx,ebx     */
-    0xB1,0x00,                  /*  mov     cl,0        */
-    0xD2,0xE2,                  /*  shl     dl,cl       */
-    };
-
-static uchar VBE20_bankFunc32_End[] = {
-    0x59,0x5B,                  /*  pop     ecx,ebx     */
-    };
-
-static uchar bankFunc32[100];
-
-#define copy(p,b,a) memcpy(b,a,sizeof(a)); (p) = (b) + sizeof(a)
-
-ibool VBEAPI VBE_getBankFunc32(int *codeLen,void **bankFunc,int dualBanks,
-    int bankAdjust)
-/****************************************************************************
-*
-* Function:     VBE_getBankFunc32
-* Parameters:   codeLen     - Place to store length of code
-*               bankFunc    - Place to store pointer to bank switch code
-*               dualBanks   - True if dual banks are in effect
-*               bankAdjust  - Bank shift adjustment factor
-* Returns:      True on success, false if not compatible.
-*
-* Description:  Creates a local 32 bit bank switch function from the
-*               VBE 2.0 bank switch code that is compatible with the
-*               virtual flat framebuffer devices (does not have a return
-*               instruction at the end and takes the bank number in EAX
-*               not EDX). Note that this 32 bit code cannot include int 10h
-*               instructions, so we can only do this if we have VBE 2.0
-*               or later.
-*
-*               Note that we need to know the length of the 32 bit
-*               bank switch function, which the standard VBE 2.0 spec
-*               does not provide. In order to support this we have
-*               extended the VBE 2.0 state->pmInfo structure in UniVBE 5.2 in a
-*               way to support this, and we hope that this will become
-*               a VBE 2.0 ammendment.
-*
-*               Note also that we cannot run the linear framebuffer
-*               emulation code with bank switching routines that require
-*               a selector to the memory mapped registers passed in ES.
-*
-****************************************************************************/
-{
-    int     len;
-    uchar   *code;
-    uchar   *p;
-
-    InitPMCode();
-    if (state->VBEVersion >= 0x200 && state->pmInfo32 && !state->MMIOSel) {
-       code = (uchar*)state->pmInfo32 + state->pmInfo32->setWindow;
-       if (state->pmInfo32->extensionSig == VBE20_EXT_SIG)
-           len = state->pmInfo32->setWindowLen-1;
-       else {
-           /* We are running on a system without the UniVBE 5.2 extension.
-            * We do as best we can by scanning through the code for the
-            * ret function to determine the length. This is not foolproof,
-            * but is the best we can do.
-            */
-           p = code;
-           while (*p != 0xC3)
-               p++;
-           len = p - code;
-           }
-       if ((len + sizeof(VBE20A_bankFunc32_Start) + sizeof(VBE20_bankFunc32_End)) > sizeof(bankFunc32))
-           PM_fatalError("32-bit bank switch function too long!");
-       copy(p,bankFunc32,VBE20A_bankFunc32_Start);
-       memcpy(p,code,len);
-       p += len;
-       copy(p,p,VBE20_bankFunc32_End);
-       *codeLen = p - bankFunc32;
-       bankFunc32[VBE20_adjustOffset] = (uchar)bankAdjust;
-       *bankFunc = bankFunc32;
-       return true;
-       }
-    return false;
-}
-
-#endif
diff --git a/board/MAI/bios_emulator/scitech/src/pm/beos/cpuinfo.c b/board/MAI/bios_emulator/scitech/src/pm/beos/cpuinfo.c
deleted file mode 100644 (file)
index cb3afe2..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/****************************************************************************
-*
-*                         Ultra Long Period Timer
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  *** TODO: ADD YOUR OS ENVIRONMENT NAME HERE ***
-*
-* Description:  Module to implement OS specific services to measure the
-*               CPU frequency.
-*
-****************************************************************************/
-
-#include <OS.h>
-
-/*----------------------------- Implementation ----------------------------*/
-
-/****************************************************************************
-REMARKS:
-Increase the thread priority to maximum, if possible.
-****************************************************************************/
-static int SetMaxThreadPriority(void)
-{
-    thread_id thid = find_thread(NULL);
-    thread_info tinfo;
-    get_thread_info(thid, &tinfo);
-    set_thread_priority(thid, B_REAL_TIME_PRIORITY);
-    return tinfo.priority;
-}
-
-/****************************************************************************
-REMARKS:
-Restore the original thread priority.
-****************************************************************************/
-static void RestoreThreadPriority(
-    int priority)
-{
-    thread_id thid = find_thread(NULL);
-    set_thread_priority(thid, priority);
-}
-
-/****************************************************************************
-REMARKS:
-Initialise the counter and return the frequency of the counter.
-****************************************************************************/
-static void GetCounterFrequency(
-    CPU_largeInteger *freq)
-{
-    /* TODO: Return the frequency of the counter in here. You should try to */
-    /*       normalise this value to be around 100,000 ticks per second. */
-    freq->low = 1000000;
-    freq->high = 0;
-}
-
-/****************************************************************************
-REMARKS:
-Read the counter and return the counter value.
-
-TODO: Implement this to read the counter. It should be done as a macro
-      for accuracy.
-****************************************************************************/
-#define GetCounter(t) { *((bigtime_t*) t) = system_time(); }
diff --git a/board/MAI/bios_emulator/scitech/src/pm/beos/event.c b/board/MAI/bios_emulator/scitech/src/pm/beos/event.c
deleted file mode 100644 (file)
index 93c6c0a..0000000
+++ /dev/null
@@ -1,199 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  BeOS
-*
-* Description:  BeOS implementation for the SciTech cross platform
-*               event library.
-*
-****************************************************************************/
-
-/*---------------------------- Global Variables ---------------------------*/
-
-static ushort       keyUpMsg[256] = {0};/* Table of key up messages     */
-static int          rangeX,rangeY;      /* Range of mouse coordinates   */
-
-/*---------------------------- Implementation -----------------------------*/
-
-/* These are not used under non-DOS systems */
-#define _EVT_disableInt()       1
-#define _EVT_restoreInt(flags)
-
-/****************************************************************************
-PARAMETERS:
-scanCode    - Scan code to test
-
-REMARKS:
-This macro determines if a specified key is currently down at the
-time that the call is made.
-****************************************************************************/
-#define _EVT_isKeyDown(scanCode)    (keyUpMsg[scanCode] != 0)
-
-/****************************************************************************
-REMARKS:
-This function is used to return the number of ticks since system
-startup in milliseconds. This should be the same value that is placed into
-the time stamp fields of events, and is used to implement auto mouse down
-events.
-****************************************************************************/
-ulong _EVT_getTicks(void)
-{
-    /* TODO: Implement this for your OS! */
-}
-
-/****************************************************************************
-REMARKS:
-Pumps all messages in the application message queue into our event queue.
-****************************************************************************/
-static void _EVT_pumpMessages(void)
-{
-    /* TODO: The purpose of this function is to read all keyboard and mouse */
-    /*       events from the OS specific event queue, translate them and post */
-    /*       them into the SciTech event queue. */
-    /* */
-    /* NOTE: There are a couple of important things that this function must */
-    /*       take care of: */
-    /* */
-    /*  1. Support for KEYDOWN, KEYREPEAT and KEYUP is required. */
-    /* */
-    /*  2. Support for reading hardware scan code as well as ASCII */
-    /*     translated values is required. Games use the scan codes rather */
-    /*     than ASCII values. Scan codes go into the high order byte of the */
-    /*     keyboard message field. */
-    /* */
-    /*  3. Support for at least reading mouse motion data (mickeys) from the */
-    /*     mouse is required. Using the mickey values, we can then translate */
-    /*     to mouse cursor coordinates scaled to the range of the current */
-    /*     graphics display mode. Mouse values are scaled based on the */
-    /*     global 'rangeX' and 'rangeY'. */
-    /* */
-    /*  4. Support for a timestamp for the events is required, which is */
-    /*     defined as the number of milliseconds since some event (usually */
-    /*     system startup). This is the timestamp when the event occurred */
-    /*     (ie: at interrupt time) not when it was stuff into the SciTech */
-    /*     event queue. */
-    /* */
-    /*  5. Support for mouse double click events. If the OS has a native */
-    /*     mechanism to determine this, it should be used. Otherwise the */
-    /*     time stamp information will be used by the generic event code */
-    /*     to generate double click events. */
-}
-
-/****************************************************************************
-REMARKS:
-This macro/function is used to converts the scan codes reported by the
-keyboard to our event libraries normalised format. We only have one scan
-code for the 'A' key, and use shift modifiers to determine if it is a
-Ctrl-F1, Alt-F1 etc. The raw scan codes from the keyboard work this way,
-but the OS gives us 'cooked' scan codes, we have to translate them back
-to the raw format.
-****************************************************************************/
-#define _EVT_maskKeyCode(evt)
-
-/****************************************************************************
-REMARKS:
-Safely abort the event module upon catching a fatal error.
-****************************************************************************/
-void _EVT_abort()
-{
-    EVT_exit();
-    PM_fatalError("Unhandled exception!");
-}
-
-/****************************************************************************
-PARAMETERS:
-mouseMove   - Callback function to call wheneve the mouse needs to be moved
-
-REMARKS:
-Initiliase the event handling module. Here we install our mouse handling ISR
-to be called whenever any button's are pressed or released. We also build
-the free list of events in the event queue.
-
-We use handler number 2 of the mouse libraries interrupt handlers for our
-event handling routines.
-****************************************************************************/
-void EVTAPI EVT_init(
-    _EVT_mouseMoveHandler mouseMove)
-{
-    /* Initialise the event queue */
-    _mouseMove = mouseMove;
-    initEventQueue();
-    memset(keyUpMsg,0,sizeof(keyUpMsg));
-
-    /* TODO: Do any OS specific initialisation here */
-
-    /* Catch program termination signals so we can clean up properly */
-    signal(SIGABRT, _EVT_abort);
-    signal(SIGFPE, _EVT_abort);
-    signal(SIGINT, _EVT_abort);
-}
-
-/****************************************************************************
-REMARKS
-Changes the range of coordinates returned by the mouse functions to the
-specified range of values. This is used when changing between graphics
-modes set the range of mouse coordinates for the new display mode.
-****************************************************************************/
-void EVTAPI EVT_setMouseRange(
-    int xRes,
-    int yRes)
-{
-    rangeX = xRes;
-    rangeY = yRes;
-}
-
-/****************************************************************************
-REMARKS:
-Initiailises the internal event handling modules. The EVT_suspend function
-can be called to suspend event handling (such as when shelling out to DOS),
-and this function can be used to resume it again later.
-****************************************************************************/
-void EVT_resume(void)
-{
-    /* Do nothing for non DOS systems */
-}
-
-/****************************************************************************
-REMARKS
-Suspends all of our event handling operations. This is also used to
-de-install the event handling code.
-****************************************************************************/
-void EVT_suspend(void)
-{
-    /* Do nothing for non DOS systems */
-}
-
-/****************************************************************************
-REMARKS
-Exits the event module for program terminatation.
-****************************************************************************/
-void EVT_exit(void)
-{
-    /* Restore signal handlers */
-    signal(SIGABRT, SIG_DFL);
-    signal(SIGFPE, SIG_DFL);
-    signal(SIGINT, SIG_DFL);
-
-    /* TODO: Do any OS specific cleanup in here */
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/beos/oshdr.h b/board/MAI/bios_emulator/scitech/src/pm/beos/oshdr.h
deleted file mode 100644 (file)
index 043d73e..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  BeOS
-*
-* Description:  Include file to include all OS specific header files.
-*
-****************************************************************************/
-
-/* This is where you include OS specific headers for the event handling */
-/* library. */
diff --git a/board/MAI/bios_emulator/scitech/src/pm/beos/pm.c b/board/MAI/bios_emulator/scitech/src/pm/beos/pm.c
deleted file mode 100644 (file)
index 2dcb1b8..0000000
+++ /dev/null
@@ -1,539 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  BeOS
-*
-* Description:  Implementation for the OS Portability Manager Library, which
-*               contains functions to implement OS specific services in a
-*               generic, cross platform API. Porting the OS Portability
-*               Manager library is the first step to porting any SciTech
-*               products to a new platform.
-*
-****************************************************************************/
-
-#include "pmapi.h"
-#include "drvlib/os/os.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-/* TODO: Include any BeOS specific headers here! */
-
-/*--------------------------- Global variables ----------------------------*/
-
-static void (PMAPIP fatalErrorCleanup)(void) = NULL;
-
-/*----------------------------- Implementation ----------------------------*/
-
-void PMAPI PM_init(void)
-{
-    /* TODO: Do any initialisation in here. This includes getting IOPL */
-    /*       access for the process calling PM_init. This will get called */
-    /*       more than once. */
-
-    /* TODO: If you support the supplied MTRR register stuff (you need to */
-    /*       be at ring 0 for this!), you should initialise it in here. */
-
-/* MTRR_init(); */
-}
-
-long PMAPI PM_getOSType(void)
-{ return _OS_BEOS; }
-
-int PMAPI PM_getModeType(void)
-{ return PM_386; }
-
-void PMAPI PM_backslash(char *s)
-{
-    uint pos = strlen(s);
-    if (s[pos-1] != '/') {
-       s[pos] = '/';
-       s[pos+1] = '\0';
-       }
-}
-
-void PMAPI PM_setFatalErrorCleanup(
-    void (PMAPIP cleanup)(void))
-{
-    fatalErrorCleanup = cleanup;
-}
-
-void PMAPI PM_fatalError(const char *msg)
-{
-    /* TODO: If you are running in a GUI environment without a console, */
-    /*       this needs to be changed to bring up a fatal error message */
-    /*       box and terminate the program. */
-    if (fatalErrorCleanup)
-       fatalErrorCleanup();
-    fprintf(stderr,"%s\n", msg);
-    exit(1);
-}
-
-void * PMAPI PM_getVESABuf(uint *len,uint *rseg,uint *roff)
-{
-    /* No BIOS access for the BeOS */
-    return NULL;
-}
-
-int PMAPI PM_kbhit(void)
-{
-    /* TODO: This function checks if a key is available to be read. This */
-    /*       should be implemented, but is mostly used by the test programs */
-    /*       these days. */
-    return true;
-}
-
-int PMAPI PM_getch(void)
-{
-    /* TODO: This returns the ASCII code of the key pressed. This */
-    /*       should be implemented, but is mostly used by the test programs */
-    /*       these days. */
-    return 0xD;
-}
-
-int PMAPI PM_openConsole(void)
-{
-    /* TODO: Opens up a fullscreen console for graphics output. If your */
-    /*       console does not have graphics/text modes, this can be left */
-    /*       empty. The main purpose of this is to disable console switching */
-    /*       when in graphics modes if you can switch away from fullscreen */
-    /*       consoles (if you want to allow switching, this can be done */
-    /*       elsewhere with a full save/restore state of the graphics mode). */
-    return 0;
-}
-
-int PMAPI PM_getConsoleStateSize(void)
-{
-    /* TODO: Returns the size of the console state buffer used to save the */
-    /*       state of the console before going into graphics mode. This is */
-    /*       used to restore the console back to normal when we are done. */
-    return 1;
-}
-
-void PMAPI PM_saveConsoleState(void *stateBuf,int console_id)
-{
-    /* TODO: Saves the state of the console into the state buffer. This is */
-    /*       used to restore the console back to normal when we are done. */
-    /*       We will always restore 80x25 text mode after being in graphics */
-    /*       mode, so if restoring text mode is all you need to do this can */
-    /*       be left empty. */
-}
-
-void PMAPI PM_restoreConsoleState(const void *stateBuf,int console_id)
-{
-    /* TODO: Restore the state of the console from the state buffer. This is */
-    /*       used to restore the console back to normal when we are done. */
-    /*       We will always restore 80x25 text mode after being in graphics */
-    /*       mode, so if restoring text mode is all you need to do this can */
-    /*       be left empty. */
-}
-
-void PMAPI PM_closeConsole(int console_id)
-{
-    /* TODO: Close the console when we are done, going back to text mode. */
-}
-
-void PM_setOSCursorLocation(int x,int y)
-{
-    /* TODO: Set the OS console cursor location to the new value. This is */
-    /*       generally used for new OS ports (used mostly for DOS). */
-}
-
-void PM_setOSScreenWidth(int width,int height)
-{
-    /* TODO: Set the OS console screen width. This is generally unused for */
-    /*       new OS ports. */
-}
-
-ibool PMAPI PM_setRealTimeClockHandler(PM_intHandler ih, int frequency)
-{
-    /* TODO: Install a real time clock interrupt handler. Normally this */
-    /*       will not be supported from most OS'es in user land, so an */
-    /*       alternative mechanism is needed to enable software stereo. */
-    /*       Hence leave this unimplemented unless you have a high priority */
-    /*       mechanism to call the 32-bit callback when the real time clock */
-    /*       interrupt fires. */
-    return false;
-}
-
-void PMAPI PM_setRealTimeClockFrequency(int frequency)
-{
-    /* TODO: Set the real time clock interrupt frequency. Used for stereo */
-    /*       LC shutter glasses when doing software stereo. Usually sets */
-    /*       the frequency to around 2048 Hz. */
-}
-
-void PMAPI PM_restoreRealTimeClockHandler(void)
-{
-    /* TODO: Restores the real time clock handler. */
-}
-
-char * PMAPI PM_getCurrentPath(
-    char *path,
-    int maxLen)
-{
-    return getcwd(path,maxLen);
-}
-
-char PMAPI PM_getBootDrive(void)
-{ return '/'; }
-
-const char * PMAPI PM_getVBEAFPath(void)
-{ return PM_getNucleusConfigPath(); }
-
-const char * PMAPI PM_getNucleusPath(void)
-{
-    char *env = getenv("NUCLEUS_PATH");
-    return env ? env : "/usr/lib/nucleus";
-}
-
-const char * PMAPI PM_getNucleusConfigPath(void)
-{
-    static char path[256];
-    strcpy(path,PM_getNucleusPath());
-    PM_backslash(path);
-    strcat(path,"config");
-    return path;
-}
-
-const char * PMAPI PM_getUniqueID(void)
-{
-    /* TODO: Return a unique ID for the machine. If a unique ID is not */
-    /*       available, return the machine name. */
-    static char buf[128];
-    gethostname(buf, 128);
-    return buf;
-}
-
-const char * PMAPI PM_getMachineName(void)
-{
-    /* TODO: Return the network machine name for the machine. */
-    static char buf[128];
-    gethostname(buf, 128);
-    return buf;
-}
-
-void * PMAPI PM_getBIOSPointer(void)
-{
-    /* No BIOS access on the BeOS */
-    return NULL;
-}
-
-void * PMAPI PM_getA0000Pointer(void)
-{
-    static void *bankPtr;
-    if (!bankPtr)
-       bankPtr = PM_mapPhysicalAddr(0xA0000,0xFFFF,true);
-    return bankPtr;
-}
-
-void * PMAPI PM_mapPhysicalAddr(ulong base,ulong limit,ibool isCached)
-{
-    /* TODO: This function maps a physical memory address to a linear */
-    /*       address in the address space of the calling process. */
-
-    /* NOTE: This function *must* be able to handle any phsyical base */
-    /*       address, and hence you will have to handle rounding of */
-    /*       the physical base address to a page boundary (ie: 4Kb on */
-    /*       x86 CPU's) to be able to properly map in the memory */
-    /*       region. */
-
-    /* NOTE: If possible the isCached bit should be used to ensure that */
-    /*       the PCD (Page Cache Disable) and PWT (Page Write Through) */
-    /*       bits are set to disable caching for a memory mapping used */
-    /*       for MMIO register access. We also disable caching using */
-    /*       the MTRR registers for Pentium Pro and later chipsets so if */
-    /*       MTRR support is enabled for your OS then you can safely ignore */
-    /*       the isCached flag and always enable caching in the page */
-    /*       tables. */
-    return NULL;
-}
-
-void PMAPI PM_freePhysicalAddr(void *ptr,ulong limit)
-{
-    /* TODO: This function will free a physical memory mapping previously */
-    /*       allocated with PM_mapPhysicalAddr() if at all possible. If */
-    /*       you can't free physical memory mappings, simply do nothing. */
-}
-
-ulong PMAPI PM_getPhysicalAddr(void *p)
-{
-    /* TODO: This function should find the physical address of a linear */
-    /*       address. */
-    return 0xFFFFFFFFUL;
-}
-
-void PMAPI PM_sleep(ulong milliseconds)
-{
-    /* TODO: Put the process to sleep for milliseconds */
-}
-
-int PMAPI PM_getCOMPort(int port)
-{
-    /* TODO: Re-code this to determine real values using the Plug and Play */
-    /*       manager for the OS. */
-    switch (port) {
-       case 0: return 0x3F8;
-       case 1: return 0x2F8;
-       }
-    return 0;
-}
-
-int PMAPI PM_getLPTPort(int port)
-{
-    /* TODO: Re-code this to determine real values using the Plug and Play */
-    /*       manager for the OS. */
-    switch (port) {
-       case 0: return 0x3BC;
-       case 1: return 0x378;
-       case 2: return 0x278;
-       }
-    return 0;
-}
-
-void * PMAPI PM_mallocShared(long size)
-{
-    /* TODO: This is used to allocate memory that is shared between process */
-    /*       that all access the common Nucleus drivers via a common display */
-    /*       driver DLL. If your OS does not support shared memory (or if */
-    /*       the display driver does not need to allocate shared memory */
-    /*       for each process address space), this should just call PM_malloc. */
-    return PM_malloc(size);
-}
-
-void PMAPI PM_freeShared(void *ptr)
-{
-    /* TODO: Free the shared memory block. This will be called in the context */
-    /*       of the original calling process that allocated the shared */
-    /*       memory with PM_mallocShared. Simply call free if you do not */
-    /*       need this. */
-    PM_free(ptr);
-}
-
-void * PMAPI PM_mapToProcess(void *base,ulong limit)
-{
-    /* TODO: This function is used to map a physical memory mapping */
-    /*       previously allocated with PM_mapPhysicalAddr into the */
-    /*       address space of the calling process. If the memory mapping */
-    /*       allocated by PM_mapPhysicalAddr is global to all processes, */
-    /*       simply return the pointer. */
-    return base;
-}
-
-void * PMAPI PM_mapRealPointer(uint r_seg,uint r_off)
-{
-    /* No BIOS access on the BeOS */
-    return NULL;
-}
-
-void * PMAPI PM_allocRealSeg(uint size,uint *r_seg,uint *r_off)
-{
-    /* No BIOS access on the BeOS */
-    return NULL;
-}
-
-void PMAPI PM_freeRealSeg(void *mem)
-{
-    /* No BIOS access on the BeOS */
-}
-
-void PMAPI DPMI_int86(int intno, DPMI_regs *regs)
-{
-    /* No BIOS access on the BeOS */
-}
-
-int PMAPI PM_int86(int intno, RMREGS *in, RMREGS *out)
-{
-    /* No BIOS access on the BeOS */
-    return 0;
-}
-
-int PMAPI PM_int86x(int intno, RMREGS *in, RMREGS *out,
-    RMSREGS *sregs)
-{
-    /* No BIOS access on the BeOS */
-    return 0;
-}
-
-void PMAPI PM_callRealMode(uint seg,uint off, RMREGS *in,
-    RMSREGS *sregs)
-{
-    /* No BIOS access on the BeOS */
-}
-
-void PMAPI PM_availableMemory(ulong *physical,ulong *total)
-{
-    /* TODO: Report the amount of available memory, both the amount of */
-    /*       physical memory left and the amount of virtual memory left. */
-    /*       If the OS does not provide these services, report 0's. */
-    *physical = *total = 0;
-}
-
-void * PMAPI PM_allocLockedMem(uint size,ulong *physAddr,ibool contiguous,ibool below16Meg)
-{
-    /* TODO: Allocate a block of locked, physical memory of the specified */
-    /*       size. This is used for bus master operations. If this is not */
-    /*       supported by the OS, return NULL and bus mastering will not */
-    /*       be used. */
-    return NULL;
-}
-
-void PMAPI PM_freeLockedMem(void *p,uint size,ibool contiguous)
-{
-    /* TODO: Free a memory block allocated with PM_allocLockedMem. */
-}
-
-void PMAPI PM_setBankA(int bank)
-{
-    /* No BIOS access on the BeOS */
-}
-
-void PMAPI PM_setBankAB(int bank)
-{
-    /* No BIOS access on the BeOS */
-}
-
-void PMAPI PM_setCRTStart(int x,int y,int waitVRT)
-{
-    /* No BIOS access on the BeOS */
-}
-
-ibool PMAPI PM_enableWriteCombine(ulong base,ulong length,uint type)
-{
-    /* TODO: This function should enable Pentium Pro and Pentium II MTRR */
-    /*       write combining for the passed in physical memory base address */
-    /*       and length. Normally this is done via calls to an OS specific */
-    /*       device driver as this can only be done at ring 0. */
-    /* */
-    /* NOTE: This is a *very* important function to implement! If you do */
-    /*       not implement, graphics performance on the latest Intel chips */
-    /*       will be severly impaired. For sample code that can be used */
-    /*       directly in a ring 0 device driver, see the MSDOS implementation */
-    /*       which includes assembler code to do this directly (if the */
-    /*       program is running at ring 0). */
-    return false;
-}
-
-ibool PMAPI PM_doBIOSPOST(ushort axVal,ulong BIOSPhysAddr,void *mappedBIOS)
-{
-    /* TODO: This function is used to run the BIOS POST code on a secondary */
-    /*       controller to initialise it for use. This is not necessary */
-    /*       for multi-controller operation, but it will make it a lot */
-    /*       more convenicent for end users (otherwise they have to boot */
-    /*       the system once with the secondary controller as primary, and */
-    /*       then boot with both controllers installed). */
-    /* */
-    /*       Even if you don't support full BIOS access, it would be */
-    /*       adviseable to be able to POST the secondary controllers in the */
-    /*       system using this function as a minimum requirement. Some */
-    /*       graphics hardware has registers that contain values that only */
-    /*       the BIOS knows about, which makes bring up a card from cold */
-    /*       reset difficult if the BIOS has not POST'ed it. */
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-Function to find the first file matching a search criteria in a directory.
-****************************************************************************/
-ulong PMAPI PM_findFirstFile(
-    const char *filename,
-    PM_findData *findData)
-{
-    (void)filename;
-    (void)findData;
-    return PM_FILE_INVALID;
-}
-
-/****************************************************************************
-REMARKS:
-Function to find the next file matching a search criteria in a directory.
-****************************************************************************/
-ibool PMAPI PM_findNextFile(
-    ulong handle,
-    PM_findData *findData)
-{
-    (void)handle;
-    (void)findData;
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-Function to close the find process
-****************************************************************************/
-void PMAPI PM_findClose(
-    ulong handle)
-{
-    (void)handle;
-}
-
-/****************************************************************************
-REMARKS:
-Function to determine if a drive is a valid drive or not. Under Unix this
-function will return false for anything except a value of 3 (considered
-the root drive, and equivalent to C: for non-Unix systems). The drive
-numbering is:
-
-    1   - Drive A:
-    2   - Drive B:
-    3   - Drive C:
-    etc
-
-****************************************************************************/
-ibool PMAPI PM_driveValid(
-    char drive)
-{
-    if (drive == 3)
-       return true;
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-Function to get the current working directory for the specififed drive.
-Under Unix this will always return the current working directory regardless
-of what the value of 'drive' is.
-****************************************************************************/
-void PMAPI PM_getdcwd(
-    int drive,
-    char *dir,
-    int len)
-{
-    (void)drive;
-    getcwd(dir,len);
-}
-
-/****************************************************************************
-REMARKS:
-Function to change the file attributes for a specific file.
-****************************************************************************/
-void PMAPI PM_setFileAttr(
-    const char *filename,
-    uint attrib)
-{
-    /* TODO: Set the file attributes for a file */
-    (void)filename;
-    (void)attrib;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/beos/vflat.c b/board/MAI/bios_emulator/scitech/src/pm/beos/vflat.c
deleted file mode 100644 (file)
index 579ef2c..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Any
-*
-* Description:  Dummy module; no virtual framebuffer for this OS
-*
-****************************************************************************/
-
-#include "pmapi.h"
-
-ibool PMAPI VF_available(void)
-{
-    return false;
-}
-
-void * PMAPI VF_init(ulong baseAddr,int bankSize,int codeLen,void *bankFunc)
-{
-    baseAddr = baseAddr;
-    bankSize = bankSize;
-    codeLen = codeLen;
-    bankFunc = bankFunc;
-    return NULL;
-}
-
-void PMAPI VF_exit(void)
-{
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/beos/ztimer.c b/board/MAI/bios_emulator/scitech/src/pm/beos/ztimer.c
deleted file mode 100644 (file)
index a528b73..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-/****************************************************************************
-*
-*                         Ultra Long Period Timer
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  *** TODO: ADD YOUR OS ENVIRONMENT NAME HERE ***
-*
-* Description:  OS specific implementation for the Zen Timer functions.
-*
-****************************************************************************/
-
-/*----------------------------- Implementation ----------------------------*/
-
-/****************************************************************************
-REMARKS:
-Initialise the Zen Timer module internals.
-****************************************************************************/
-void _ZTimerInit(void)
-{
-    /* TODO: Do any specific internal initialisation in here */
-}
-
-/****************************************************************************
-REMARKS:
-Start the Zen Timer counting.
-****************************************************************************/
-static void _LZTimerOn(
-    LZTimerObject *tm)
-{
-    /* TODO: Start the Zen Timer counting. This should be a macro if */
-    /*       possible. */
-}
-
-/****************************************************************************
-REMARKS:
-Compute the lap time since the timer was started.
-****************************************************************************/
-static ulong _LZTimerLap(
-    LZTimerObject *tm)
-{
-    /* TODO: Compute the lap time between the current time and when the */
-    /*       timer was started. */
-    return 0;
-}
-
-/****************************************************************************
-REMARKS:
-Stop the Zen Timer counting.
-****************************************************************************/
-static void _LZTimerOff(
-    LZTimerObject *tm)
-{
-    /* TODO: Stop the timer counting. Should be a macro if possible. */
-}
-
-/****************************************************************************
-REMARKS:
-Compute the elapsed time in microseconds between start and end timings.
-****************************************************************************/
-static ulong _LZTimerCount(
-    LZTimerObject *tm)
-{
-    /* TODO: Compute the elapsed time and return it. Always microseconds. */
-    return 0;
-}
-
-/****************************************************************************
-REMARKS:
-Define the resolution of the long period timer as microseconds per timer tick.
-****************************************************************************/
-#define ULZTIMER_RESOLUTION 1
-
-/****************************************************************************
-REMARKS:
-Read the Long Period timer from the OS
-****************************************************************************/
-static ulong _ULZReadTime(void)
-{
-    /* TODO: Read the long period timer from the OS. The resolution of this */
-    /*       timer should be around 1/20 of a second for timing long */
-    /*       periods if possible. */
-}
-
-/****************************************************************************
-REMARKS:
-Compute the elapsed time from the BIOS timer tick. Note that we check to see
-whether a midnight boundary has passed, and if so adjust the finish time to
-account for this. We cannot detect if more that one midnight boundary has
-passed, so if this happens we will be generating erronous results.
-****************************************************************************/
-ulong _ULZElapsedTime(ulong start,ulong finish)
-{ return finish - start; }
diff --git a/board/MAI/bios_emulator/scitech/src/pm/codepage/us_eng.c b/board/MAI/bios_emulator/scitech/src/pm/codepage/us_eng.c
deleted file mode 100644 (file)
index 9aa8714..0000000
+++ /dev/null
@@ -1,285 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Any
-*
-* Description:  Keyboard translation code pages for US English keyboards.
-*
-****************************************************************************/
-
-#include "event.h"
-
-/*--------------------------- Global variables ----------------------------*/
-
-/* This table is used for all normal key translations, and is the fallback
- * table if the key is not found in any of the other translation tables.
- * If the code is not found in this table, the ASCII code is set to 0 to
- * indicate that there is no ASCII code equivalent for this key.
- */
-static codepage_entry_t US_normal[] = {
-    {0x01,  0x1B},
-    {0x02,  '1'},
-    {0x03,  '2'},
-    {0x04,  '3'},
-    {0x05,  '4'},
-    {0x06,  '5'},
-    {0x07,  '6'},
-    {0x08,  '7'},
-    {0x09,  '8'},
-    {0x0A,  '9'},
-    {0x0B,  '0'},
-    {0x0C,  '-'},
-    {0x0D,  '='},
-    {0x0E,  0x08},
-    {0x0F,  0x09},
-    {0x10,  'q'},
-    {0x11,  'w'},
-    {0x12,  'e'},
-    {0x13,  'r'},
-    {0x14,  't'},
-    {0x15,  'y'},
-    {0x16,  'u'},
-    {0x17,  'i'},
-    {0x18,  'o'},
-    {0x19,  'p'},
-    {0x1A,  '['},
-    {0x1B,  ']'},
-    {0x1C,  0x0D},
-    {0x1E,  'a'},
-    {0x1F,  's'},
-    {0x20,  'd'},
-    {0x21,  'f'},
-    {0x22,  'g'},
-    {0x23,  'h'},
-    {0x24,  'j'},
-    {0x25,  'k'},
-    {0x26,  'l'},
-    {0x27,  ';'},
-    {0x28,  '\''},
-    {0x29,  '`'},
-    {0x2B,  '\\'},
-    {0x2C,  'z'},
-    {0x2D,  'x'},
-    {0x2E,  'c'},
-    {0x2F,  'v'},
-    {0x30,  'b'},
-    {0x31,  'n'},
-    {0x32,  'm'},
-    {0x33,  ','},
-    {0x34,  '.'},
-    {0x35,  '/'},
-    {0x37,  '*'},           /* Keypad */
-    {0x39,  ' '},
-    {0x4A,  '-'},           /* Keypad */
-    {0x4E,  '+'},           /* Keypad */
-    {0x60,  0x0D},          /* Keypad */
-    {0x61,  '/'},           /* Keypad */
-    };
-
-/* This table is used for when CAPSLOCK is active and the shift or ctrl
- * keys are not down. If the code is not found in this table, the normal
- * table above is then searched.
- */
-static codepage_entry_t US_caps[] = {
-    {0x10,  'Q'},
-    {0x11,  'W'},
-    {0x12,  'E'},
-    {0x13,  'R'},
-    {0x14,  'T'},
-    {0x15,  'Y'},
-    {0x16,  'U'},
-    {0x17,  'I'},
-    {0x18,  'O'},
-    {0x19,  'P'},
-    {0x1E,  'A'},
-    {0x1F,  'S'},
-    {0x20,  'D'},
-    {0x21,  'F'},
-    {0x22,  'G'},
-    {0x23,  'H'},
-    {0x24,  'J'},
-    {0x25,  'K'},
-    {0x26,  'L'},
-    {0x2C,  'Z'},
-    {0x2D,  'X'},
-    {0x2E,  'C'},
-    {0x2F,  'V'},
-    {0x30,  'B'},
-    {0x31,  'N'},
-    {0x32,  'M'},
-    };
-
-/* This table is used for when shift key is down, but the ctrl key is not
- * down and CAPSLOCK is not active. If the code is not found in this table,
- * the normal table above is then searched.
- */
-static codepage_entry_t US_shift[] = {
-    {0x02,  '!'},
-    {0x03,  '@'},
-    {0x04,  '#'},
-    {0x05,  '$'},
-    {0x06,  '%'},
-    {0x07,  '^'},
-    {0x08,  '&'},
-    {0x09,  '*'},
-    {0x0A,  '('},
-    {0x0B,  ')'},
-    {0x0C,  '_'},
-    {0x0D,  '+'},
-    {0x10,  'Q'},
-    {0x11,  'W'},
-    {0x12,  'E'},
-    {0x13,  'R'},
-    {0x14,  'T'},
-    {0x15,  'Y'},
-    {0x16,  'U'},
-    {0x17,  'I'},
-    {0x18,  'O'},
-    {0x19,  'P'},
-    {0x1A,  '{'},
-    {0x1B,  '}'},
-    {0x1E,  'A'},
-    {0x1F,  'S'},
-    {0x20,  'D'},
-    {0x21,  'F'},
-    {0x22,  'G'},
-    {0x23,  'H'},
-    {0x24,  'J'},
-    {0x25,  'K'},
-    {0x26,  'L'},
-    {0x27,  ':'},
-    {0x28,  '"'},
-    {0x29,  '~'},
-    {0x2B,  '|'},
-    {0x2C,  'Z'},
-    {0x2D,  'X'},
-    {0x2E,  'C'},
-    {0x2F,  'V'},
-    {0x30,  'B'},
-    {0x31,  'N'},
-    {0x32,  'M'},
-    {0x33,  '<'},
-    {0x34,  '>'},
-    {0x35,  '?'},
-    };
-
-/* This table is used for when CAPSLOCK is active and the shift key is
- * down, but the ctrl key is not. If the code is not found in this table,
- * the shift table above is then searched.
- */
-static codepage_entry_t US_shiftCaps[] = {
-    {0x10,  'q'},
-    {0x11,  'w'},
-    {0x12,  'e'},
-    {0x13,  'r'},
-    {0x14,  't'},
-    {0x15,  'y'},
-    {0x16,  'u'},
-    {0x17,  'i'},
-    {0x18,  'o'},
-    {0x19,  'p'},
-    {0x1E,  'a'},
-    {0x1F,  's'},
-    {0x20,  'd'},
-    {0x21,  'f'},
-    {0x22,  'g'},
-    {0x23,  'h'},
-    {0x24,  'j'},
-    {0x25,  'k'},
-    {0x26,  'l'},
-    {0x2C,  'z'},
-    {0x2D,  'x'},
-    {0x2E,  'c'},
-    {0x2F,  'v'},
-    {0x30,  'b'},
-    {0x31,  'n'},
-    {0x32,  'm'},
-    };
-
-/* This table is used for all key translations when the ctrl key is down,
- * regardless of the state of the shift key and CAPSLOCK. If the code is
- * not found in this table, the ASCII code is set to 0 to indicate that
- * there is no ASCII code equivalent for this key.
- */
-static codepage_entry_t US_ctrl[] = {
-    {0x01,  0x1B},
-    {0x06,  0x1E},
-    {0x0C,  0x1F},
-    {0x0E,  0x7F},
-    {0x10,  0x11},
-    {0x11,  0x17},
-    {0x12,  0x05},
-    {0x13,  0x12},
-    {0x14,  0x14},
-    {0x15,  0x19},
-    {0x16,  0x16},
-    {0x17,  0x09},
-    {0x18,  0x0F},
-    {0x19,  0x10},
-    {0x1A,  0x1B},
-    {0x1B,  0x1D},
-    {0x1C,  0x0A},
-    {0x1E,  0x01},
-    {0x1F,  0x13},
-    {0x20,  0x04},
-    {0x21,  0x06},
-    {0x22,  0x07},
-    {0x23,  0x08},
-    {0x24,  0x0A},
-    {0x25,  0x0B},
-    {0x26,  0x0C},
-    {0x2B,  0x1C},
-    {0x2C,  0x1A},
-    {0x2D,  0x18},
-    {0x2E,  0x03},
-    {0x2F,  0x16},
-    {0x30,  0x02},
-    {0x31,  0x0E},
-    {0x32,  0x0D},
-    {0x39,  ' '},
-    };
-
-static codepage_entry_t US_numPad[] = {
-    {0x4C,  '5'},
-    {0x62,  '4'},
-    {0x63,  '6'},
-    {0x64,  '8'},
-    {0x65,  '2'},
-    {0x66,  '0'},
-    {0x67,  '.'},
-    {0x68,  '7'},
-    {0x69,  '1'},
-    {0x6A,  '9'},
-    {0x6B,  '3'},
-    };
-
-codepage_t _CP_US_English = {
-    "US English",
-    US_normal,      EVT_ARR_SIZE(US_normal),
-    US_caps,        EVT_ARR_SIZE(US_caps),
-    US_shift,       EVT_ARR_SIZE(US_shift),
-    US_shiftCaps,   EVT_ARR_SIZE(US_shiftCaps),
-    US_ctrl,        EVT_ARR_SIZE(US_ctrl),
-    US_numPad,      EVT_ARR_SIZE(US_numPad),
-    };
diff --git a/board/MAI/bios_emulator/scitech/src/pm/common.c b/board/MAI/bios_emulator/scitech/src/pm/common.c
deleted file mode 100644 (file)
index d5a8e8f..0000000
+++ /dev/null
@@ -1,480 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Any
-*
-* Description:  Module containing code common to all platforms.
-*
-****************************************************************************/
-
-#include "pmapi.h"
-#include "drvlib/os/os.h"
-#if defined(__WIN32_VXD__) || defined(__OS2_VDD__) || defined(__NT_DRIVER__)
-#include "sdd/sddhelp.h"
-#else
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#endif
-
-/*---------------------------- Global variables ---------------------------*/
-
-/* {secret} */
-long _VARAPI    ___drv_os_type = _OS_UNSUPPORTED;
-static char     localBPDPath[PM_MAX_PATH] = "";
-
-/*----------------------------- Implementation ----------------------------*/
-
-/****************************************************************************
-PARAMETERS:
-path    - Local path to the Nucleus BPD driver files.
-
-REMARKS:
-This function is used by the application program to override the location
-of the Nucleus driver files that are loaded. Normally the loader code
-will look in the system Nucleus directories first, then in the 'drivers'
-directory relative to the current working directory, and finally relative
-to the MGL_ROOT environment variable. By default the local BPD path is
-always set to the current directory if not initialised.
-****************************************************************************/
-void PMAPI PM_setLocalBPDPath(
-    const char *path)
-{
-    PM_init();
-    strncpy(localBPDPath,path,sizeof(localBPDPath));
-    localBPDPath[sizeof(localBPDPath)-1] = 0;
-}
-
-/****************************************************************************
-PARAMETERS:
-bpdpath     - Place to store the actual path to the file
-cachedpath  - Place to store the cached BPD driver path
-trypath     - Path to try to find the BPD file in
-subpath     - Optional sub path to append to trypath
-dllname     - Name of the Binary Portable DLL to load
-
-RETURNS:
-True if found, false if not.
-
-REMARKS:
-Trys the specified path to see if the BPD file can be found or not. If so,
-the path used is returned in bpdpath and cachedpath.
-****************************************************************************/
-static ibool TryPath(
-    char *bpdpath,
-    char *cachedpath,
-    const char *trypath,
-    const char *subpath,
-    const char *dllname)
-{
-    char    filename[256];
-    FILE    *f;
-
-    strcpy(bpdpath, trypath);
-    PM_backslash(bpdpath);
-    strcat(bpdpath,subpath);
-    PM_backslash(bpdpath);
-    strcpy(filename,bpdpath);
-    strcat(filename,dllname);
-    if ((f = fopen(filename,"rb")) == NULL)
-       return false;
-    if (cachedpath)
-       strcpy(cachedpath,bpdpath);
-    fclose(f);
-    return true;
-}
-
-/****************************************************************************
-RETURNS:
-True if local override enabled, false if not.
-
-REMARKS:
-Tests to see if the local override option is enabled, and if so it will
-look for the Nucleus drivers in the local application directories in
-preference to the Nucleus system directories.
-****************************************************************************/
-static ibool GetLocalOverride(void)
-{
-    char            filename[256];
-    FILE            *f;
-    static ibool    local_override = -1;
-
-    if (local_override == -1) {
-       local_override = false;
-       strcpy(filename,PM_getNucleusPath());
-       PM_backslash(filename);
-       strcat(filename,"graphics.ini");
-       if ((f = fopen(filename,"r")) != NULL) {
-           while (!feof(f) && fgets(filename,sizeof(filename),f)) {
-               if (strnicmp(filename,"uselocal",8) == 0) {
-                   local_override = ((*(filename+9) - '0') == 1);
-                   break;
-                   }
-               }
-           fclose(f);
-           }
-       }
-    return local_override;
-}
-
-/****************************************************************************
-DESCRIPTION:
-Sets the location of the debug log file.
-
-HEADER:
-pmapi.h
-
-PARAMETERS:
-dllname - Name of the Binary Portable DLL to load
-bpdpath - Place to store the actual path to the file
-
-RETURNS:
-True if found, false if not.
-
-REMARKS:
-Finds the location of a specific Binary Portable DLL, by searching all
-the standard SciTech Nucleus driver locations.
-****************************************************************************/
-ibool PMAPI PM_findBPD(
-    const char *dllname,
-    char *bpdpath)
-{
-    static char cachedpath[PM_MAX_PATH] = "";
-
-    /* On the first call determine the path to the Nucleus drivers */
-    if (cachedpath[0] == 0) {
-       /* First try in the global system Nucleus driver path if
-        * the local override setting is not enabled.
-        */
-       PM_init();
-       if (!GetLocalOverride()) {
-           if (TryPath(bpdpath,cachedpath,PM_getNucleusPath(),"",dllname))
-               return true;
-           }
-
-       /* Next try in the local application directory if available */
-       if (localBPDPath[0] != 0) {
-           if (TryPath(bpdpath,cachedpath,localBPDPath,"",dllname))
-               return true;
-           }
-       else {
-#if !defined(__WIN32_VXD__) && !defined(__NT_DRIVER__)
-           char    *mgl_root;
-           if ((mgl_root = getenv("MGL_ROOT")) != NULL) {
-               if (TryPath(bpdpath,cachedpath,mgl_root,"drivers",dllname))
-                   return true;
-               }
-#endif
-           PM_getCurrentPath(bpdpath,PM_MAX_PATH);
-           if (TryPath(bpdpath,cachedpath,bpdpath,"drivers",dllname))
-               return true;
-           }
-
-       /* Finally try in the global system path again so that we
-        * will still find the drivers in the global system path if
-        * the local override option is on, but the application does
-        * not have any local override drivers.
-        */
-       if (TryPath(bpdpath,cachedpath,PM_getNucleusPath(),"",dllname))
-           return true;
-
-       /* Whoops, we can't find the BPD file! */
-       return false;
-       }
-
-    /* Always try in the previously discovered path */
-    return TryPath(bpdpath,NULL,cachedpath,"",dllname);
-}
-
-/****************************************************************************
-REMARKS:
-Copies a string into another, and returns dest + strlen(src).
-****************************************************************************/
-static char *_stpcpy(
-    char *_dest,
-    const char *_src)
-{
-    if (!_dest || !_src)
-       return 0;
-    while ((*_dest++ = *_src++) != 0)
-       ;
-    return --_dest;
-}
-
-/****************************************************************************
-REMARKS:
-Copies a string into another, stopping at the maximum length. The string
-is properly terminated (unlike strncpy).
-****************************************************************************/
-static void safe_strncpy(
-    char *dst,
-    const char *src,
-    unsigned maxlen)
-{
-    if (dst) {
-       if(strlen(src) >= maxlen) {
-           strncpy(dst, src, maxlen);
-           dst[maxlen] = 0;
-           }
-       else
-           strcpy(dst, src);
-       }
-}
-
-/****************************************************************************
-REMARKS:
-Determins if the dot separator is present in the string.
-****************************************************************************/
-static int findDot(
-    char *p)
-{
-    if (*(p-1) == '.')
-       p--;
-    switch (*--p) {
-       case ':':
-           if (*(p-2) != '\0')
-               break;
-       case '/':
-       case '\\':
-       case '\0':
-           return true;
-       }
-    return false;
-}
-
-/****************************************************************************
-DESCRIPTION:
-Make a full pathname from split components.
-
-HEADER:
-pmapi.h
-
-PARAMETERS:
-path    - Place to store full path
-drive   - Drive component for path
-dir     - Directory component for path
-name    - Filename component for path
-ext     - Extension component for path
-
-REMARKS:
-Function to make a full pathname from split components. Under Unix the
-drive component will usually be empty. If the drive, dir, name, or ext
-parameters are null or empty, they are not inserted in the path string.
-Otherwise, if the drive doesn't end with a colon, one is inserted in the
-path. If the dir doesn't end in a slash, one is inserted in the path.
-If the ext doesn't start with a dot, one is inserted in the path.
-
-The maximum sizes for the path string is given by the constant PM_MAX_PATH,
-which includes space for the null-terminator.
-
-SEE ALSO:
-PM_splitPath
-****************************************************************************/
-void PMAPI PM_makepath(
-    char *path,
-    const char *drive,
-    const char *dir,
-    const char *name,
-    const char *ext)
-{
-    if (drive && *drive) {
-       *path++ = *drive;
-       *path++ = ':';
-       }
-    if (dir && *dir) {
-       path = _stpcpy(path,dir);
-       if (*(path-1) != '\\' && *(path-1) != '/')
-#ifdef  __UNIX__
-           *path++ = '/';
-#else
-           *path++ = '\\';
-#endif
-       }
-    if (name)
-       path = _stpcpy(path,name);
-    if (ext && *ext) {
-       if (*ext != '.')
-           *path++ = '.';
-       path = _stpcpy(path,ext);
-       }
-    *path = 0;
-}
-
-/****************************************************************************
-DESCRIPTION:
-Split a full pathname into components.
-
-HEADER:
-pmapi.h
-
-PARAMETERS:
-path    - Full path to split
-drive   - Drive component for path
-dir     - Directory component for path
-name    - Filename component for path
-ext     - Extension component for path
-
-RETURNS:
-Flags indicating what components were parsed.
-
-REMARKS:
-Function to split a full pathmame into separate components in the form
-
-    X:\DIR\SUBDIR\NAME.EXT
-
-and splits path into its four components. It then stores those components
-in the strings pointed to by drive, dir, name and ext. (Each component is
-required but can be a NULL, which means the corresponding component will be
-parsed but not stored).
-
-The maximum sizes for these strings are given by the constants PM_MAX_DRIVE
-and PM_MAX_PATH. PM_MAX_DRIVE is always 4, and PM_MAX_PATH is usually at
-least 256 characters. Under Unix the dir, name and ext components may be
-up to the full path in length.
-
-SEE ALSO:
-PM_makePath
-****************************************************************************/
-int PMAPI PM_splitpath(
-    const char *path,
-    char *drive,
-    char *dir,
-    char *name,
-    char *ext)
-{
-    char    *p;
-    int     temp,ret;
-    char    buf[PM_MAX_PATH+2];
-
-    /* Set all string to default value zero */
-    ret = 0;
-    if (drive)  *drive = 0;
-    if (dir)    *dir = 0;
-    if (name)   *name = 0;
-    if (ext)    *ext = 0;
-
-    /* Copy filename into template up to PM_MAX_PATH characters */
-    p = buf;
-    if ((temp = strlen(path)) > PM_MAX_PATH)
-       temp = PM_MAX_PATH;
-    *p++ = 0;
-    strncpy(p, path, temp);
-    *(p += temp) = 0;
-
-    /* Split the filename and fill corresponding nonzero pointers */
-    temp = 0;
-    for (;;) {
-       switch (*--p) {
-           case '.':
-               if (!temp && (*(p+1) == '\0'))
-                   temp = findDot(p);
-               if ((!temp) && ((ret & PM_HAS_EXTENSION) == 0)) {
-                   ret |= PM_HAS_EXTENSION;
-                   safe_strncpy(ext, p, PM_MAX_PATH - 1);
-                   *p = 0;
-                   }
-               continue;
-           case ':':
-               if (p != &buf[2])
-                   continue;
-           case '\0':
-               if (temp) {
-                   if (*++p)
-                       ret |= PM_HAS_DIRECTORY;
-                   safe_strncpy(dir, p, PM_MAX_PATH - 1);
-                   *p-- = 0;
-                   break;
-                   }
-           case '/':
-           case '\\':
-               if (!temp) {
-                   temp++;
-                   if (*++p)
-                       ret |= PM_HAS_FILENAME;
-                   safe_strncpy(name, p, PM_MAX_PATH - 1);
-                   *p-- = 0;
-                   if (*p == 0 || (*p == ':' && p == &buf[2]))
-                       break;
-                   }
-               continue;
-           case '*':
-           case '?':
-               if (!temp)
-                   ret |= PM_HAS_WILDCARDS;
-           default:
-               continue;
-           }
-       break;
-       }
-    if (*p == ':') {
-       if (buf[1])
-           ret |= PM_HAS_DRIVE;
-       safe_strncpy(drive, &buf[1], PM_MAX_DRIVE - 1);
-       }
-    return ret;
-}
-
-/****************************************************************************
-DESCRIPTION:
-Block until a specific time has elapsed since the last call
-
-HEADER:
-pmapi.h
-
-PARAMETERS:
-milliseconds    - Number of milliseconds for delay
-
-REMARKS:
-This function will block the calling thread or process until the specified
-number of milliseconds have passed since the /last/ call to this function.
-The first time this function is called, it will return immediately. On
-subsquent calls it will block until the specified time has elapsed, or it
-will return immediately if the time has already elapsed.
-
-This function is useful to provide constant time functionality in a
-program, such as a frame rate limiter for graphics applications etc.
-
-SEE ALSO:
-PM_sleep
-****************************************************************************/
-void PMAPI PM_blockUntilTimeout(
-    ulong milliseconds)
-{
-    ulong                   microseconds = milliseconds * 1000L,msDelay;
-    static LZTimerObject    tm;
-    static ibool            firstTime = true;
-
-    if (firstTime) {
-       firstTime = false;
-       LZTimerOnExt(&tm);
-       }
-    else {
-       if ((msDelay = (microseconds - LZTimerLapExt(&tm)) / 1000L) > 0)
-           PM_sleep(msDelay);
-       while (LZTimerLapExt(&tm) < microseconds)
-           ;
-       LZTimerOffExt(&tm);
-       LZTimerOnExt(&tm);
-       }
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/common/_cpuinfo.asm b/board/MAI/bios_emulator/scitech/src/pm/common/_cpuinfo.asm
deleted file mode 100644 (file)
index 60ebed7..0000000
+++ /dev/null
@@ -1,600 +0,0 @@
-;****************************************************************************
-;*
-;*                  SciTech OS Portability Manager Library
-;*
-;*  ========================================================================
-;*
-;*    The contents of this file are subject to the SciTech MGL Public
-;*    License Version 1.0 (the "License"); you may not use this file
-;*    except in compliance with the License. You may obtain a copy of
-;*    the License at http://www.scitechsoft.com/mgl-license.txt
-;*
-;*    Software distributed under the License is distributed on an
-;*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-;*    implied. See the License for the specific language governing
-;*    rights and limitations under the License.
-;*
-;*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-;*
-;*    The Initial Developer of the Original Code is SciTech Software, Inc.
-;*    All Rights Reserved.
-;*
-;*  ========================================================================
-;*
-;* Language:    NASM or TASM Assembler
-;* Environment: Intel 32 bit Protected Mode.
-;*
-;* Description: Code to determine the Intel processor type.
-;*
-;****************************************************************************
-
-        IDEAL
-
-include "scitech.mac"
-
-header      _cpuinfo
-
-begdataseg  _cpuinfo                ; Start of data segment
-
-cache_id    db  "01234567890123456"
-intel_id    db  "GenuineIntel"      ; Intel vendor ID
-cyrix_id    db  "CyrixInstead"      ; Cyrix vendor ID
-amd_id      db  "AuthenticAMD"      ; AMD vendor ID
-idt_id      db  "CentaurHauls"      ; IDT vendor ID
-
-CPU_IDT     EQU 01000h              ; Flag for IDT processors
-CPU_Cyrix   EQU 02000h              ; Flag for Cyrix processors
-CPU_AMD     EQU 04000h              ; Flag for AMD processors
-CPU_Intel   EQU 08000h              ; Flag for Intel processors
-
-enddataseg  _cpuinfo
-
-begcodeseg  _cpuinfo                ; Start of code segment
-
-ifdef   USE_NASM
-%macro mCPU_ID 0
-db  00Fh,0A2h
-%endmacro
-else
-MACRO   mCPU_ID
-db  00Fh,0A2h
-ENDM
-endif
-
-ifdef   USE_NASM
-%macro mRDTSC 0
-db  00Fh,031h
-%endmacro
-else
-MACRO   mRDTSC
-db  00Fh,031h
-ENDM
-endif
-
-;----------------------------------------------------------------------------
-; bool _CPU_check80386(void)
-;----------------------------------------------------------------------------
-; Determines if we have an i386 processor.
-;----------------------------------------------------------------------------
-cprocstart  _CPU_check80386
-
-        enter_c
-
-        xor     edx,edx             ; EDX = 0, not an 80386
-        mov     bx, sp
-ifdef   USE_NASM
-        and     sp, ~3
-else
-        and     sp, not 3
-endif
-        pushfd                      ; Push original EFLAGS
-        pop     eax                 ; Get original EFLAGS
-        mov     ecx, eax            ; Save original EFLAGS
-        xor     eax, 40000h         ; Flip AC bit in EFLAGS
-        push    eax                 ; Save new EFLAGS value on
-                                    ;   stack
-        popfd                       ; Replace current EFLAGS value
-        pushfd                      ; Get new EFLAGS
-        pop     eax                 ; Store new EFLAGS in EAX
-        xor     eax, ecx            ; Can't toggle AC bit,
-                                    ;   processor=80386
-        jnz     @@Done              ; Jump if not an 80386 processor
-        inc     edx                 ; We have an 80386
-
-@@Done: push    ecx
-        popfd
-        mov     sp, bx
-        mov     eax, edx
-        leave_c
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; bool _CPU_check80486(void)
-;----------------------------------------------------------------------------
-; Determines if we have an i486 processor.
-;----------------------------------------------------------------------------
-cprocstart  _CPU_check80486
-
-        enter_c
-
-; Distinguish between the i486 and Pentium by the ability to set the ID flag
-; in the EFLAGS register. If the ID flag is set, then we can use the CPUID
-; instruction to determine the final version of the chip. Otherwise we
-; simply have an 80486.
-
-; Distinguish between the i486 and Pentium by the ability to set the ID flag
-; in the EFLAGS register. If the ID flag is set, then we can use the CPUID
-; instruction to determine the final version of the chip. Otherwise we
-; simply have an 80486.
-
-        pushfd                      ; Get original EFLAGS
-        pop     eax
-        mov     ecx, eax
-        xor     eax, 200000h        ; Flip ID bit in EFLAGS
-        push    eax                 ; Save new EFLAGS value on stack
-        popfd                       ; Replace current EFLAGS value
-        pushfd                      ; Get new EFLAGS
-        pop     eax                 ; Store new EFLAGS in EAX
-        xor     eax, ecx            ; Can not toggle ID bit,
-        jnz     @@1                 ; Processor=80486
-        mov     eax,1               ; We dont have a Pentium
-        jmp     @@Done
-@@1:    mov     eax,0               ; We have Pentium or later
-@@Done: leave_c
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; bool _CPU_checkClone(void)
-;----------------------------------------------------------------------------
-; Checks if the i386 or i486 processor is a clone or genuine Intel.
-;----------------------------------------------------------------------------
-cprocstart  _CPU_checkClone
-
-        enter_c
-
-        mov     ax,5555h            ; Check to make sure this is a 32-bit processor
-        xor     dx,dx
-        mov     cx,2h
-        div     cx                  ; Perform Division
-        clc
-        jnz     @@NoClone
-        jmp     @@Clone
-@@NoClone:
-        stc
-@@Clone:
-        pushfd
-        pop     eax                 ; Get the flags
-        and     eax,1
-        xor     eax,1               ; EAX=0 is probably Intel, EAX=1 is a Clone
-
-        leave_c
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; bool _CPU_haveCPUID(void)
-;----------------------------------------------------------------------------
-; Determines if we have support for the CPUID instruction.
-;----------------------------------------------------------------------------
-cprocstart  _CPU_haveCPUID
-
-        enter_c
-
-ifdef flatmodel
-        pushfd                      ; Get original EFLAGS
-        pop     eax
-        mov     ecx, eax
-        xor     eax, 200000h        ; Flip ID bit in EFLAGS
-        push    eax                 ; Save new EFLAGS value on stack
-        popfd                       ; Replace current EFLAGS value
-        pushfd                      ; Get new EFLAGS
-        pop     eax                 ; Store new EFLAGS in EAX
-        xor     eax, ecx            ; Can not toggle ID bit,
-        jnz     @@1                 ; Processor=80486
-        mov     eax,0               ; We dont have CPUID support
-        jmp     @@Done
-@@1:    mov     eax,1               ; We have CPUID support
-else
-        mov     eax,0               ; CPUID requires 32-bit pmode
-endif
-@@Done: leave_c
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; uint _CPU_checkCPUID(void)
-;----------------------------------------------------------------------------
-; Determines the CPU type using the CPUID instruction.
-;----------------------------------------------------------------------------
-cprocstart  _CPU_checkCPUID
-
-        enter_c
-
-        xor     eax, eax            ; Set up for CPUID instruction
-        mCPU_ID                     ; Get and save vendor ID
-        cmp     eax, 1              ; Make sure 1 is valid input for CPUID
-        jl      @@Fail              ; We dont have the CPUID instruction
-        xor     eax,eax             ; Assume vendor is unknown
-
-; Check for GenuineIntel processors
-
-        LEA_L   esi,intel_id
-        cmp     [DWORD esi], ebx
-        jne     @@NotIntel
-        cmp     [DWORD esi+4], edx
-        jne     @@NotIntel
-        cmp     [DWORD esi+8], ecx
-        jne     @@NotIntel
-        mov     eax,CPU_Intel       ; Flag that we have GenuineIntel
-        jmp     @@FoundVendor
-
-; Check for CyrixInstead processors
-
-@@NotIntel:
-        LEA_L   esi,cyrix_id
-        cmp     [DWORD esi], ebx
-        jne     @@NotCyrix
-        cmp     [DWORD esi+4], edx
-        jne     @@NotCyrix
-        cmp     [DWORD esi+8], ecx
-        jne     @@NotCyrix
-        mov     eax,CPU_Cyrix       ; Flag that we have CyrixInstead
-        jmp     @@FoundVendor
-
-; Check for AuthenticAMD processors
-
-@@NotCyrix:
-        LEA_L   esi,amd_id
-        cmp     [DWORD esi], ebx
-        jne     @@NotAMD
-        cmp     [DWORD esi+4], edx
-        jne     @@NotAMD
-        cmp     [DWORD esi+8], ecx
-        jne     @@NotAMD
-        mov     eax,CPU_AMD         ; Flag that we have AuthenticAMD
-        jmp     @@FoundVendor
-
-; Check for CentaurHauls processors
-
-@@NotAMD:
-        LEA_L   esi,idt_id
-        cmp     [DWORD esi], ebx
-        jne     @@NotIDT
-        cmp     [DWORD esi+4], edx
-        jne     @@NotIDT
-        cmp     [DWORD esi+8], ecx
-        jne     @@NotIDT
-        mov     eax,CPU_IDT         ; Flag that we have AuthenticIDT
-        jmp     @@FoundVendor
-
-@@NotIDT:
-
-@@FoundVendor:
-        push    eax
-        xor     eax, eax
-        inc     eax
-        mCPU_ID                     ; Get family/model/stepping/features
-        and     eax, 0F00h
-        shr     eax, 8              ; Isolate family
-        and     eax, 0Fh
-        pop     ecx
-        or      eax,ecx             ; Combine in the clone flag
-@@Done: leave_c
-        ret
-
-@@Fail: xor     eax,eax
-        jmp     @@Done
-
-cprocend
-
-;----------------------------------------------------------------------------
-; uint _CPU_getCPUIDModel(void)
-;----------------------------------------------------------------------------
-; Determines the CPU type using the CPUID instruction.
-;----------------------------------------------------------------------------
-cprocstart  _CPU_getCPUIDModel
-
-        enter_c
-
-        xor     eax, eax            ; Set up for CPUID instruction
-        mCPU_ID                     ; Get and save vendor ID
-        cmp     eax, 1              ; Make sure 1 is valid input for CPUID
-        jl      @@Fail              ; We dont have the CPUID instruction
-        xor     eax, eax
-        inc     eax
-        mCPU_ID                     ; Get family/model/stepping/features
-        and     eax, 0F0h
-        shr     eax, 4              ; Isolate model
-@@Done: leave_c
-        ret
-
-@@Fail: xor     eax,eax
-        jmp     @@Done
-
-cprocend
-
-;----------------------------------------------------------------------------
-; uint _CPU_getCPUIDStepping(void)
-;----------------------------------------------------------------------------
-; Determines the CPU type using the CPUID instruction.
-;----------------------------------------------------------------------------
-cprocstart  _CPU_getCPUIDStepping
-
-        enter_c
-
-        xor     eax, eax            ; Set up for CPUID instruction
-        mCPU_ID                     ; Get and save vendor ID
-        cmp     eax, 1              ; Make sure 1 is valid input for CPUID
-        jl      @@Fail              ; We dont have the CPUID instruction
-        xor     eax, eax
-        inc     eax
-        mCPU_ID                     ; Get family/model/stepping/features
-        and     eax, 00Fh           ; Isolate stepping
-@@Done: leave_c
-        ret
-
-@@Fail: xor     eax,eax
-        jmp     @@Done
-
-cprocend
-
-;----------------------------------------------------------------------------
-; uint _CPU_getCPUIDFeatures(void)
-;----------------------------------------------------------------------------
-; Determines the CPU type using the CPUID instruction.
-;----------------------------------------------------------------------------
-cprocstart  _CPU_getCPUIDFeatures
-
-        enter_c
-
-        xor     eax, eax            ; Set up for CPUID instruction
-        mCPU_ID                     ; Get and save vendor ID
-        cmp     eax, 1              ; Make sure 1 is valid input for CPUID
-        jl      @@Fail              ; We dont have the CPUID instruction
-        xor     eax, eax
-        inc     eax
-        mCPU_ID                     ; Get family/model/stepping/features
-        mov     eax, edx
-@@Done: leave_c
-        ret
-
-@@Fail: xor     eax,eax
-        jmp     @@Done
-
-cprocend
-
-;----------------------------------------------------------------------------
-; uint _CPU_getCacheSize(void)
-;----------------------------------------------------------------------------
-; Determines the CPU cache size for Intel processors
-;----------------------------------------------------------------------------
-cprocstart  _CPU_getCacheSize
-
-        enter_c
-        xor     eax, eax            ; Set up for CPUID instruction
-        mCPU_ID                     ; Get and save vendor ID
-        cmp     eax,2               ; Make sure 2 is valid input for CPUID
-        jl      @@Fail              ; We dont have the CPUID instruction
-        mov     eax,2
-        mCPU_ID                     ; Get cache descriptors
-        LEA_L   esi,cache_id        ; Get address of cache ID (-fPIC aware)
-        shr     eax,8
-        mov     [esi+0],eax
-        mov     [esi+3],ebx
-        mov     [esi+7],ecx
-        mov     [esi+11],edx
-        xor     eax,eax
-        LEA_L   esi,cache_id        ; Get address of cache ID (-fPIC aware)
-        mov     edi,15
-@@ScanLoop:
-        cmp     [BYTE esi],41h
-        mov     eax,128
-        je      @@Done
-        cmp     [BYTE esi],42h
-        mov     eax,256
-        je      @@Done
-        cmp     [BYTE esi],43h
-        mov     eax,512
-        je      @@Done
-        cmp     [BYTE esi],44h
-        mov     eax,1024
-        je      @@Done
-        cmp     [BYTE esi],45h
-        mov     eax,2048
-        je      @@Done
-        inc     esi
-        dec     edi
-        jnz     @@ScanLoop
-
-@@Done: leave_c
-        ret
-
-@@Fail: xor     eax,eax
-        jmp     @@Done
-
-cprocend
-
-;----------------------------------------------------------------------------
-; uint _CPU_have3DNow(void)
-;----------------------------------------------------------------------------
-; Determines the CPU type using the CPUID instruction.
-;----------------------------------------------------------------------------
-cprocstart  _CPU_have3DNow
-
-        enter_c
-
-        mov     eax,80000000h       ; Query for extended functions
-        mCPU_ID                     ; Get extended function limit
-        cmp     eax,80000001h
-        jbe     @@Fail              ; Nope, we dont have function 800000001h
-        mov     eax,80000001h       ; Setup extended function 800000001h
-        mCPU_ID                     ; and get the information
-        test    edx,80000000h       ; Bit 31 is set if 3DNow! present
-        jz      @@Fail              ; Nope, we dont have 3DNow support
-        mov     eax,1               ; Yep, we have 3DNow! support!
-@@Done: leave_c
-        ret
-
-@@Fail: xor     eax,eax
-        jmp     @@Done
-
-cprocend
-
-;----------------------------------------------------------------------------
-; ulong _CPU_quickRDTSC(void)
-;----------------------------------------------------------------------------
-; Reads the time stamp counter and returns the low order 32-bits
-;----------------------------------------------------------------------------
-cprocstart  _CPU_quickRDTSC
-
-        mRDTSC
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void _CPU_runBSFLoop(ulong interations)
-;----------------------------------------------------------------------------
-; Runs a loop of BSF instructions for the specified number of iterations
-;----------------------------------------------------------------------------
-cprocstart  _CPU_runBSFLoop
-
-        ARG     iterations:ULONG
-
-        push    _bp
-        mov     _bp,_sp
-        push    _bx
-
-        mov     edx,[iterations]
-        mov     eax,80000000h
-        mov     ebx,edx
-
-        ALIGN   4
-
-@@loop: bsf     ecx,eax
-        dec     ebx
-        jnz     @@loop
-
-        pop     _bx
-        pop     _bp
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void  _CPU_readTimeStamp(CPU_largeInteger *time);
-;----------------------------------------------------------------------------
-; Reads the time stamp counter and returns the 64-bit result.
-;----------------------------------------------------------------------------
-cprocstart  _CPU_readTimeStamp
-
-        mRDTSC
-        mov     ecx,[esp+4]     ; Access directly without stack frame
-        mov     [ecx],eax
-        mov     [ecx+4],edx
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; ulong _CPU_diffTime64(CPU_largeInteger *t1,CPU_largeInteger *t2,CPU_largeInteger *t)
-;----------------------------------------------------------------------------
-; Computes the difference between two 64-bit numbers.
-;----------------------------------------------------------------------------
-cprocstart  _CPU_diffTime64
-
-        ARG     t1:DPTR, t2:DPTR, t:DPTR
-
-        enter_c
-
-        mov     ecx,[t2]
-        mov     eax,[ecx]       ; EAX := t2.low
-        mov     ecx,[t1]
-        sub     eax,[ecx]
-        mov     edx,eax         ; EDX := low difference
-        mov     ecx,[t2]
-        mov     eax,[ecx+4]     ; ECX := t2.high
-        mov     ecx,[t1]
-        sbb     eax,[ecx+4]     ; EAX := high difference
-
-        mov     ebx,[t]         ; Store the result
-        mov     [ebx],edx       ; Store low part
-        mov     [ebx+4],eax     ; Store high part
-        mov     eax,edx         ; Return low part
-ifndef flatmodel
-        shld    edx,eax,16      ; Return in DX:AX
-endif
-        leave_c
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; ulong _CPU_calcMicroSec(CPU_largeInteger *count,ulong freq);
-;----------------------------------------------------------------------------
-; Computes the value in microseconds for the elapsed time with maximum
-; precision. The formula we use is:
-;
-;   us = (((diff * 0x100000) / freq) * 1000000) / 0x100000)
-;
-; The power of two multiple before the first divide allows us to scale the
-; 64-bit difference using simple shifts, and then the divide brings the
-; final result into the range to fit into a 32-bit integer.
-;----------------------------------------------------------------------------
-cprocstart  _CPU_calcMicroSec
-
-        ARG     count:DPTR, freq:ULONG
-
-        enter_c
-
-        mov     ecx,[count]
-        mov     eax,[ecx]       ; EAX := low part
-        mov     edx,[ecx+4]     ; EDX := high part
-        shld    edx,eax,20
-        shl     eax,20          ; diff * 0x100000
-        div     [DWORD freq]    ; (diff * 0x100000) / freq
-        mov     ecx,1000000
-        xor     edx,edx
-        mul     ecx             ; ((diff * 0x100000) / freq) * 1000000)
-        shrd    eax,edx,20      ; ((diff * 0x100000) / freq) * 1000000) / 0x100000
-ifndef flatmodel
-        shld    edx,eax,16      ; Return in DX:AX
-endif
-        leave_c
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; ulong _CPU_mulDiv(ulong a,ulong b,ulong c);
-;----------------------------------------------------------------------------
-; Computes the following with 64-bit integer precision:
-;
-;   result = (a * b) / c
-;
-;----------------------------------------------------------------------------
-cprocstart  _CPU_mulDiv
-
-        ARG     a:ULONG, b:ULONG, c:ULONG
-
-        enter_c
-        mov     eax,[a]
-        imul    [ULONG b]
-        idiv    [ULONG c]
-ifndef flatmodel
-        shld    edx,eax,16      ; Return in DX:AX
-endif
-        leave_c
-        ret
-
-cprocend
-
-endcodeseg  _cpuinfo
-
-        END
diff --git a/board/MAI/bios_emulator/scitech/src/pm/common/_dma.asm b/board/MAI/bios_emulator/scitech/src/pm/common/_dma.asm
deleted file mode 100644 (file)
index 2b6e1e8..0000000
+++ /dev/null
@@ -1,246 +0,0 @@
-;****************************************************************************
-;*
-;*                  SciTech OS Portability Manager Library
-;*
-;*  ========================================================================
-;*
-;*    The contents of this file are subject to the SciTech MGL Public
-;*    License Version 1.0 (the "License"); you may not use this file
-;*    except in compliance with the License. You may obtain a copy of
-;*    the License at http://www.scitechsoft.com/mgl-license.txt
-;*
-;*    Software distributed under the License is distributed on an
-;*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-;*    implied. See the License for the specific language governing
-;*    rights and limitations under the License.
-;*
-;*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-;*
-;*    The Initial Developer of the Original Code is SciTech Software, Inc.
-;*    All Rights Reserved.
-;*
-;*  ========================================================================
-;*
-;* Language:    80386 Assembler, TASM 4.0 or NASM
-;* Environment: 16/32 bit Ring 0 device driver
-;*
-;* Description: Assembler support routines for ISA DMA controller.
-;*
-;****************************************************************************
-
-        IDEAL
-
-include "scitech.mac"           ; Memory model macros
-
-header      _dma                ; Set up memory model
-
-begdataseg  _dma                ; Start of data segment
-
-cpublic _PM_DMADataStart
-
-; DMA register I/O addresses for channels 0-7 (except 4)
-
-DMAC_page       db 087h,083h,081h,082h, -1,08Bh,089h,08Ah
-DMAC_addr       db 000h,002h,004h,006h, -1,0C4h,0C8h,0CCh
-DMAC_cnt        db 001h,003h,005h,007h, -1,0C6h,0CAh,0CEh
-DMAC_mask       db 00Ah,00Ah,00Ah,00Ah, -1,0D4h,0D4h,0D4h
-DMAC_mode       db 00Bh,00Bh,00Bh,00Bh, -1,0D6h,0D6h,0D6h
-DMAC_FF         db 00Ch,00Ch,00Ch,00Ch, -1,0D8h,0D8h,0D8h
-
-cpublic _PM_DMADataEnd
-
-enddataseg  _dma
-
-begcodeseg  _dma                ; Start of code segment
-
-ifdef   flatmodel
-
-cpublic _PM_DMACodeStart
-
-;----------------------------------------------------------------------------
-; void PM_DMACDisable(int channel);
-;----------------------------------------------------------------------------
-; Masks DMA channel, inhibiting DMA transfers
-;----------------------------------------------------------------------------
-cprocstart  PM_DMACDisable
-
-        ARG     channel:UINT
-
-        push    ebp
-        mov     ebp,esp
-        mov     ecx,[channel]       ; ECX indexes DMAC register tables
-        mov     dh,0                ; DH = 0 for DMAC register port access
-        mov     al,cl
-        and     al,11b
-        or      al,100b             ; AL = (channel & 3) | "set mask bit"
-        mov     dl,[DMAC_mask+ecx]
-        out     dx,al
-        pop     ebp
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void PM_DMACEnable(int channel);
-;----------------------------------------------------------------------------
-; Unmasks DMA channel, enabling DMA transfers
-;----------------------------------------------------------------------------
-cprocstart  PM_DMACEnable
-
-        ARG     channel:UINT
-
-        push    ebp
-        mov     ebp,esp
-        mov     ecx,[channel]       ; ECX indexes DMAC register tables
-        mov     dh,0                ; DH = 0 for DMAC register port access
-        mov     al,cl
-        and     al,11b              ; AL = (channel & 3), "set mask bit"=0
-        mov     dl,[DMAC_mask+ecx]
-        out     dx,al
-        pop     ebp
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void PM_DMACProgram(int channel,int mode,ulong bufferPhys,int count);
-;----------------------------------------------------------------------------
-; Purpose: Program DMA controller to perform transfer from first 16MB
-; based on previously selected mode and channel. DMA transfer may be enabled
-; by subsequent call to PM_DMACEnable.
-;
-; Entry:    channel - DMA channel in use (0-7)
-;           mode    - Selected DMAMODE type for transfer
-;           buffer  - 32-bit physical address of DMA buffer
-;           count   - DMA byte count (1-65536 bytes)
-;----------------------------------------------------------------------------
-cprocstart  PM_DMACProgram
-
-        ARG     channel:UINT, mode:UINT, bufferPhys:ULONG, count:UINT
-
-        enter_c
-        pushfd
-        cli                         ; Disable interrupts
-
-; Mask DMA channel to disable it
-
-        mov     ebx,[channel]       ; EBX indexes DMAC register tables
-        mov     dh,0                ; DH = 0 for DMAC register port access
-        mov     al,bl
-        and     al,11b
-        or      al,100b             ; AL = (channel & 3) | "set mask bit"
-        mov     dl,[DMAC_mask+ebx]
-        out     dx,al
-
-; Generate IOW to clear FF toggle state
-
-        mov     al,0
-        mov     dl,[DMAC_FF+ebx]
-        out     dx,al
-
-; Compute buffer address to program
-
-        mov     eax,[bufferPhys]    ; AX := DMA address offset
-        mov     ecx,eax
-        shr     ecx,16              ; CL := bufferPhys >> 16 (DMA page)
-        mov     esi,[count]         ; ESI = # of bytes to transfer
-        cmp     ebx,4               ; 16-bit channel?
-        jb      @@WriteDMAC         ; No, program DMAC
-        shr     eax,1               ; Yes, convert address and count
-        shr     esi,1               ; to 16-bit, 128K/page format
-
-; Set the DMA address word (bits 0-15)
-
-@@WriteDMAC:
-        mov     dl,[DMAC_addr+ebx]
-        out     dx,al
-        mov     al,ah
-        out     dx,al
-
-; Set DMA transfer count
-
-        mov     eax,esi
-        dec     eax                 ; ESI = # of bytes to transfer - 1
-        mov     dl,[DMAC_cnt+ebx]
-        out     dx,al
-        mov     al,ah
-        out     dx,al
-
-; Set DMA page byte (bits 16-23)
-
-        mov     al,cl
-        mov     dl,[DMAC_page+ebx]
-        out     dx,al
-
-; Set the DMA channel mode
-
-        mov     al,bl
-        and     al,11b
-        or      al,[BYTE mode]      ; EAX = (channel & 3) | mode
-        mov     dl,[DMAC_mode+ebx]
-        out     dx,al
-
-        pop     eax                 ; SMP safe interrupt state restore!
-        test    eax,200h
-        jz      @@1
-        sti
-@@1:    leave_c
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; ulong PMAPI PM_DMACPosition(int channel);
-;----------------------------------------------------------------------------
-; Returns the current position in a dma transfer. Interrupts should be
-; disabled before calling this function.
-;----------------------------------------------------------------------------
-cprocstart  PM_DMACPosition
-
-        ARG     channel:UINT
-
-        enter_c
-        mov     ecx,[channel]       ; ECX indexes DMAC register tables
-        mov     dh,0                ; DH = 0 for DMAC register port access
-
-; Generate IOW to clear FF toggle state
-
-        mov     al,0
-        mov     dl,[DMAC_FF+ebx]
-        out     dx,al
-        xor     eax,eax
-        xor     ecx,ecx
-
-; Now read the current position for the channel
-
-@@ReadLoop:
-        mov     dl,[DMAC_cnt+ebx]
-        out     dx,al
-        in      al,dx
-        mov     cl,al
-        in      al,dx
-        mov     ch,al               ; ECX := first count read
-        in      al,dx
-        mov     ah,al
-        in      al,dx
-        xchg    al,ah               ; EAX := second count read
-        sub     ecx,eax
-        cmp     ecx,40h
-        jg      @@ReadLoop
-        cmp     ebx,4               ; 16-bit channel?
-        jb      @@Exit              ; No, we are done
-        shl     eax,1               ; Yes, adjust to byte address
-
-@@Exit: leave_c
-        ret
-
-cprocend
-
-
-cpublic _PM_DMACodeEnd
-
-endif
-
-endcodeseg  _dma
-
-        END                     ; End of module
diff --git a/board/MAI/bios_emulator/scitech/src/pm/common/_int64.asm b/board/MAI/bios_emulator/scitech/src/pm/common/_int64.asm
deleted file mode 100644 (file)
index fdec1b5..0000000
+++ /dev/null
@@ -1,309 +0,0 @@
-;****************************************************************************
-;*
-;*                  SciTech OS Portability Manager Library
-;*
-;*  ========================================================================
-;*
-;*    The contents of this file are subject to the SciTech MGL Public
-;*    License Version 1.0 (the "License"); you may not use this file
-;*    except in compliance with the License. You may obtain a copy of
-;*    the License at http://www.scitechsoft.com/mgl-license.txt
-;*
-;*    Software distributed under the License is distributed on an
-;*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-;*    implied. See the License for the specific language governing
-;*    rights and limitations under the License.
-;*
-;*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-;*
-;*    The Initial Developer of the Original Code is SciTech Software, Inc.
-;*    All Rights Reserved.
-;*
-;*  ========================================================================
-;*
-;* Language:    NASM or TASM Assembler
-;* Environment: Intel 32 bit Protected Mode.
-;*
-;* Description: Code for 64-bit arhithmetic
-;*
-;****************************************************************************
-
-        IDEAL
-
-include "scitech.mac"
-
-header      _int64
-
-begcodeseg  _int64                  ; Start of code segment
-
-a_low       EQU 04h                 ; Access a_low directly on stack
-a_high      EQU 08h                 ; Access a_high directly on stack
-b_low       EQU 0Ch                 ; Access b_low directly on stack
-shift       EQU 0Ch                 ; Access shift directly on stack
-result_2    EQU 0Ch                 ; Access result directly on stack
-b_high      EQU 10h                 ; Access b_high directly on stack
-result_3    EQU 10h                 ; Access result directly on stack
-result_4    EQU 14h                 ; Access result directly on stack
-
-;----------------------------------------------------------------------------
-; void _PM_add64(u32 a_low,u32 a_high,u32 b_low,u32 b_high,__u64 *result);
-;----------------------------------------------------------------------------
-; Adds two 64-bit numbers.
-;----------------------------------------------------------------------------
-cprocstart  _PM_add64
-
-        mov     eax,[esp+a_low]
-        add     eax,[esp+b_low]
-        mov     edx,[esp+a_high]
-        adc     edx,[esp+b_high]
-        mov     ecx,[esp+result_4]
-        mov     [ecx],eax
-        mov     [ecx+4],edx
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void _PM_sub64(u32 a_low,u32 a_high,u32 b_low,u32 b_high,__u64 *result);
-;----------------------------------------------------------------------------
-; Subtracts two 64-bit numbers.
-;----------------------------------------------------------------------------
-cprocstart  _PM_sub64
-
-        mov     eax,[esp+a_low]
-        sub     eax,[esp+b_low]
-        mov     edx,[esp+a_high]
-        sbb     edx,[esp+b_high]
-        mov     ecx,[esp+result_4]
-        mov     [ecx],eax
-        mov     [ecx+4],edx
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void _PM_mul64(u32 a_high,u32 a_low,u32 b_high,u32 b_low,__u64 *result);
-;----------------------------------------------------------------------------
-; Multiples two 64-bit numbers.
-;----------------------------------------------------------------------------
-cprocstart  _PM_mul64
-
-        mov     eax,[esp+a_high]
-        mov     ecx,[esp+b_high]
-        or      ecx,eax
-        mov     ecx,[esp+b_low]
-        jnz     @@FullMultiply
-        mov     eax,[esp+a_low]         ; EDX:EAX = b.low * a.low
-        mul     ecx
-        mov     ecx,[esp+result_4]
-        mov     [ecx],eax
-        mov     [ecx+4],edx
-        ret
-
-@@FullMultiply:
-        push    ebx
-        mul     ecx                     ; EDX:EAX = a.high * b.low
-        mov     ebx,eax
-        mov     eax,[esp+a_low+4]
-        mul     [DWORD esp+b_high+4]    ; EDX:EAX = b.high * a.low
-        add     ebx,eax
-        mov     eax,[esp+a_low+4]
-        mul     ecx                     ; EDX:EAX = a.low * b.low
-        add     edx,ebx
-        pop     ebx
-        mov     ecx,[esp+result_4]
-        mov     [ecx],eax
-        mov     [ecx+4],edx
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void _PM_div64(u32 a_low,u32 a_high,u32 b_low,u32 b_high,__u64 *result);
-;----------------------------------------------------------------------------
-; Divides two 64-bit numbers.
-;----------------------------------------------------------------------------
-cprocstart  _PM_div64
-
-        push    edi
-        push    esi
-        push    ebx
-        xor     edi,edi
-        mov     eax,[esp+a_high+0Ch]
-        or      eax,eax
-        jns     @@ANotNeg
-
-; Dividend is negative, so negate it and save result for later
-
-        inc     edi
-        mov     edx,[esp+a_low+0Ch]
-        neg     eax
-        neg     edx
-        sbb     eax,0
-        mov     [esp+a_high+0Ch],eax
-        mov     [esp+a_low+0Ch],edx
-
-@@ANotNeg:
-        mov     eax,[esp+b_high+0Ch]
-        or      eax,eax
-        jns     @@BNotNeg
-
-; Divisor is negative, so negate it and save result for later
-
-        inc     edi
-        mov     edx,[esp+b_low+0Ch]
-        neg     eax
-        neg     edx
-        sbb     eax,0
-        mov     [esp+b_high+0Ch],eax
-        mov     [esp+b_low+0Ch],edx
-
-@@BNotNeg:
-        or      eax,eax
-        jnz     @@BHighNotZero
-
-; b.high is zero, so handle this faster
-
-        mov     ecx,[esp+b_low+0Ch]
-        mov     eax,[esp+a_high+0Ch]
-        xor     edx,edx
-        div     ecx
-        mov     ebx,eax
-        mov     eax,[esp+a_low+0Ch]
-        div     ecx
-        mov     edx,ebx
-        jmp     @@BHighZero
-
-@@BHighNotZero:
-        mov     ebx,eax
-        mov     ecx,[esp+b_low+0Ch]
-        mov     edx,[esp+a_high+0Ch]
-        mov     eax,[esp+a_low+0Ch]
-
-; Shift values right until b.high becomes zero
-
-@@ShiftLoop:
-        shr     ebx,1
-        rcr     ecx,1
-        shr     edx,1
-        rcr     eax,1
-        or      ebx,ebx
-        jnz     @@ShiftLoop
-
-; Now complete the divide process
-
-        div     ecx
-        mov     esi,eax
-        mul     [DWORD esp+b_high+0Ch]
-        mov     ecx,eax
-        mov     eax,[esp+b_low+0Ch]
-        mul     esi
-        add     edx,ecx
-        jb      @@8
-        cmp     edx,[esp+a_high+0Ch]
-        ja      @@8
-        jb      @@9
-        cmp     eax,[esp+a_low+0Ch]
-        jbe     @@9
-@@8:    dec     esi
-@@9:    xor     edx,edx
-        mov     eax,esi
-
-@@BHighZero:
-        dec     edi
-        jnz     @@Done
-
-; The result needs to be negated as either a or b was negative
-
-        neg     edx
-        neg     eax
-        sbb     edx,0
-
-@@Done: pop     ebx
-        pop     esi
-        pop     edi
-        mov     ecx,[esp+result_4]
-        mov     [ecx],eax
-        mov     [ecx+4],edx
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; __i64 _PM_shr64(u32 a_low,s32 a_high,s32 shift,__u64 *result);
-;----------------------------------------------------------------------------
-; Shift a 64-bit number right
-;----------------------------------------------------------------------------
-cprocstart  _PM_shr64
-
-        mov     eax,[esp+a_low]
-        mov     edx,[esp+a_high]
-        mov     cl,[esp+shift]
-        shrd    edx,eax,cl
-        mov     ecx,[esp+result_3]
-        mov     [ecx],eax
-        mov     [ecx+4],edx
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; __i64 _PM_sar64(u32 a_low,s32 a_high,s32 shift,__u64 *result);
-;----------------------------------------------------------------------------
-; Shift a 64-bit number right (signed)
-;----------------------------------------------------------------------------
-cprocstart  _PM_sar64
-
-        mov     eax,[esp+a_low]
-        mov     edx,[esp+a_high]
-        mov     cl,[esp+shift]
-        sar     edx,cl
-        rcr     eax,cl
-        mov     ecx,[esp+result_3]
-        mov     [ecx],eax
-        mov     [ecx+4],edx
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; __i64 _PM_shl64(u32 a_low,s32 a_high,s32 shift,__u64 *result);
-;----------------------------------------------------------------------------
-; Shift a 64-bit number left
-;----------------------------------------------------------------------------
-cprocstart  _PM_shl64
-
-        mov     eax,[esp+a_low]
-        mov     edx,[esp+a_high]
-        mov     cl,[esp+shift]
-        shld    edx,eax,cl
-        mov     ecx,[esp+result_3]
-        mov     [ecx],eax
-        mov     [ecx+4],edx
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; __i64 _PM_neg64(u32 a_low,s32 a_high,__u64 *result);
-;----------------------------------------------------------------------------
-; Shift a 64-bit number left
-;----------------------------------------------------------------------------
-cprocstart  _PM_neg64
-
-        mov     eax,[esp+a_low]
-        mov     edx,[esp+a_high]
-        neg     eax
-        neg     edx
-        sbb     eax,0
-        mov     ecx,[esp+result_2]
-        mov     [ecx],eax
-        mov     [ecx+4],edx
-        ret
-
-cprocend
-
-
-endcodeseg  _int64
-
-        END
diff --git a/board/MAI/bios_emulator/scitech/src/pm/common/_joy.asm b/board/MAI/bios_emulator/scitech/src/pm/common/_joy.asm
deleted file mode 100644 (file)
index 0ff1ecf..0000000
+++ /dev/null
@@ -1,230 +0,0 @@
-;****************************************************************************
-;*
-;*                  SciTech OS Portability Manager Library
-;*
-;*  ========================================================================
-;*
-;*    The contents of this file are subject to the SciTech MGL Public
-;*    License Version 1.0 (the "License"); you may not use this file
-;*    except in compliance with the License. You may obtain a copy of
-;*    the License at http://www.scitechsoft.com/mgl-license.txt
-;*
-;*    Software distributed under the License is distributed on an
-;*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-;*    implied. See the License for the specific language governing
-;*    rights and limitations under the License.
-;*
-;*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-;*
-;*    The Initial Developer of the Original Code is SciTech Software, Inc.
-;*    All Rights Reserved.
-;*
-;*  ========================================================================
-;*
-;* Language:    80386 Assembler
-;* Environment: Intel x86, any OS
-;*
-;* Description: Assembly language support routines for reading analogue
-;*              joysticks.
-;*
-;****************************************************************************
-
-        ideal
-
-include "scitech.mac"           ; Memory model macros
-
-ifdef flatmodel
-
-header  _joy                    ; Set up memory model
-
-begcodeseg  _joy                ; Start of code segment
-
-;----------------------------------------------------------------------------
-; initTimer
-;----------------------------------------------------------------------------
-; Sets up 8253 timer 2 (PC speaker) to start timing, but not produce output.
-;----------------------------------------------------------------------------
-cprocstatic initTimer
-
-; Start timer 2 counting
-
-        in      al,61h
-        and     al,0FDh             ; Disable speaker output (just in case)
-        or      al,1
-        out     61h,al
-
-; Set the timer 2 count to 0 again to start the timing interval.
-
-        mov     al,10110100b        ; set up to load initial (timer 2)
-        out     43h,al              ; timer count
-        sub     al,al
-        out     42h,al              ; load count lsb
-        out     42h,al              ; load count msb
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; readTimer2
-;----------------------------------------------------------------------------
-; Reads the number of ticks from the 8253 timer chip using channel 2 (PC
-; speaker). This is non-destructive and does not screw up other libraries.
-;----------------------------------------------------------------------------
-cprocstatic readTimer
-
-        xor     al,al               ; Latch timer 0 command
-        out     43h,al              ; Latch timer
-        in      al,42h              ; least significant byte
-        mov     ah,al
-        in      al,42h              ; most significant byte
-        xchg    ah,al
-        and     eax,0FFFFh
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; exitTimer
-;----------------------------------------------------------------------------
-; Stops the 8253 timer 2 (PC speaker) counting
-;----------------------------------------------------------------------------
-cprocstatic exitTimer
-
-; Stop timer 2 from counting
-
-        push    eax
-        in      al,61h
-        and     al,0FEh
-        out     61h,al
-        
-; Some programs have a problem if we change the control port; better change it
-; to something they expect (mode 3 - square wave generator)...
-        mov     al,0B6h
-        out     43h,al
-        
-        pop     eax
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; int _EVT_readJoyAxis(int jmask,int *axis);
-;----------------------------------------------------------------------------
-; Function to poll the joystick to read the current axis positions.
-;----------------------------------------------------------------------------
-cprocstart  _EVT_readJoyAxis
-
-        ARG     jmask:UINT, axis:DPTR
-
-        LOCAL   firstTick:UINT, lastTick:UINT, totalTicks:UINT = LocalSize
-
-        enter_c
-
-        mov     ebx,[jmask]
-        mov     edi,[axis]
-        mov     ecx,(1193180/100)
-        and     ebx,01111b          ; Mask out supported axes
-        mov     dx,201h             ; DX := joystick I/O port
-        call    initTimer           ; Start timer 2 counting
-        call    readTimer           ; Returns counter in EAX
-        mov     [lastTick],eax
-
-@@WaitStable:
-        in      al,dx
-        and     al,bl               ; Wait for the axes in question to be
-        jz      @@Stable            ;  done reading...
-        call    readTimer           ; Returns counter in EAX
-        xchg    eax,[lastTick]
-        cmp     eax,[lastTick]
-        jb      @@1
-        sub     eax,[lastTick]
-@@1:    add     [totalTicks],eax
-        cmp     [totalTicks],ecx    ; Check for timeout
-        jae     @@Stable
-        jmp     @@WaitStable
-
-@@Stable:
-        mov     al,0FFh
-        out     dx,al               ; Start joystick reading
-        call    initTimer           ; Start timer 2 counting
-        call    readTimer           ; Returns counter in EAX
-        mov     [firstTick],eax     ; Store initial count
-        mov     [lastTick],eax
-        mov     [DWORD totalTicks],0
-        cli
-
-@@PollLoop:
-        in      al,dx               ; Read Joystick port
-        not     al
-        and     al,bl               ; Mask off channels we don't want to read
-        jnz     @@AxisFlipped       ; See if any of the channels flipped
-        call    readTimer           ; Returns counter in EAX
-        xchg    eax,[lastTick]
-        cmp     eax,[lastTick]
-        jb      @@2
-        sub     eax,[lastTick]
-@@2:    add     [totalTicks],eax
-        cmp     [totalTicks],ecx    ; Check for timeout
-        jae     @@TimedOut
-        jmp     @@PollLoop
-
-@@AxisFlipped:
-        xor     esi,esi
-        mov     ah,1
-        test    al,ah
-        jnz     @@StoreCount        ; Joystick 1, X axis flipped
-        add     esi,4
-        mov     ah,2
-        test    al,ah
-        jnz     @@StoreCount        ; Joystick 1, Y axis flipped
-        add     esi,4
-        mov     ah,4
-        test    al,ah
-        jnz     @@StoreCount        ; Joystick 2, X axis flipped
-        add     esi,4               ; Joystick 2, Y axis flipped
-        mov     ah,8
-
-@@StoreCount:
-        or      bh,ah               ; Indicate this axis is active
-        xor     bl,ah               ; Unmark the channels that just tripped
-        call    readTimer           ; Returns counter in EAX
-        xchg    eax,[lastTick]
-        cmp     eax,[lastTick]
-        jb      @@3
-        sub     eax,[lastTick]
-@@3:    add     [totalTicks],eax
-        mov     eax,[totalTicks]
-        mov     [edi+esi],eax       ; Record the time this channel flipped
-        cmp     bl,0                ; If there are more channels to read,
-        jne     @@PollLoop          ;   keep looping
-
-@@TimedOut:
-        sti
-        call    exitTimer           ; Stop timer 2 counting
-        movzx   eax,bh              ; Return the mask of working axes
-        leave_c
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; int _EVT_readJoyButtons(void);
-;----------------------------------------------------------------------------
-; Function to poll the current joystick buttons
-;----------------------------------------------------------------------------
-cprocstart  _EVT_readJoyButtons
-
-        mov     dx,0201h
-        in      al,dx
-        shr     al,4
-        not     al
-        and     eax,0Fh
-        ret
-
-cprocend
-
-endcodeseg  _joy
-
-endif
-
-        END                         ; End of module
diff --git a/board/MAI/bios_emulator/scitech/src/pm/common/_mtrr.asm b/board/MAI/bios_emulator/scitech/src/pm/common/_mtrr.asm
deleted file mode 100644 (file)
index 1e0a696..0000000
+++ /dev/null
@@ -1,272 +0,0 @@
-;****************************************************************************
-;*
-;*                  SciTech OS Portability Manager Library
-;*
-;*  ========================================================================
-;*
-;*    The contents of this file are subject to the SciTech MGL Public
-;*    License Version 1.0 (the "License"); you may not use this file
-;*    except in compliance with the License. You may obtain a copy of
-;*    the License at http://www.scitechsoft.com/mgl-license.txt
-;*
-;*    Software distributed under the License is distributed on an
-;*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-;*    implied. See the License for the specific language governing
-;*    rights and limitations under the License.
-;*
-;*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-;*
-;*    The Initial Developer of the Original Code is SciTech Software, Inc.
-;*    All Rights Reserved.
-;*
-;*  ========================================================================
-;*
-;* Language:    80386 Assembler, TASM 4.0 or NASM
-;* Environment: 16/32 bit Ring 0 device driver
-;*
-;* Description: Assembler support routines for the Memory Type Range Register
-;*              (MTRR) module.
-;*
-;****************************************************************************
-
-        IDEAL
-
-include "scitech.mac"           ; Memory model macros
-
-header      _mtrr               ; Set up memory model
-
-begdataseg  _mtrr
-
-ifdef   DOS4GW
-    cextern _PM_haveCauseWay,UINT
-endif
-
-enddataseg  _mtrr
-
-begcodeseg  _mtrr               ; Start of code segment
-
-P586
-
-;----------------------------------------------------------------------------
-; ibool _MTRR_isRing0(void);
-;----------------------------------------------------------------------------
-; Checks to see if we are running at ring 0. This check is only relevant
-; for 32-bit DOS4GW and compatible programs. If we are not running under
-; DOS4GW, then we simply assume we are a ring 0 device driver.
-;----------------------------------------------------------------------------
-cprocnear   _MTRR_isRing0
-
-; Are we running under CauseWay?
-
-ifdef   DOS4GW
-        enter_c
-        mov     ax,cs
-        and     eax,3
-        xor     eax,3
-        jnz     @@Exit
-
-; CauseWay runs the apps at ring 3, but implements support for specific
-; ring 0 instructions that we need to get stuff done under real DOS.
-
-        mov     eax,1
-        cmp     [UINT _PM_haveCauseWay],0
-        jnz     @@Exit
-@@Fail: xor     eax,eax
-@@Exit: leave_c
-        ret
-else
-ifdef __SMX32__
-        mov     eax,1                   ; SMX is ring 0!
-        ret
-else
-ifdef __VXD__
-        mov     eax,1                   ; VxD is ring 0!
-        ret
-else
-ifdef __NT_DRIVER__
-        mov     eax,1                   ; NT/W2K is ring 0!
-        ret
-else
-else
-        xor     eax,eax                 ; Assume ring 3 for 32-bit DOS
-        ret
-endif
-endif
-endif
-endif
-
-cprocend
-
-;----------------------------------------------------------------------------
-; ulong _MTRR_disableInt(void);
-;----------------------------------------------------------------------------
-; Return processor interrupt status and disable interrupts.
-;----------------------------------------------------------------------------
-cprocstart  _MTRR_disableInt
-
-        pushfd                  ; Put flag word on stack
-        cli                     ; Disable interrupts!
-        pop     eax             ; deposit flag word in return register
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void _MTRR_restoreInt(ulong ps);
-;----------------------------------------------------------------------------
-; Restore processor interrupt status.
-;----------------------------------------------------------------------------
-cprocstart  _MTRR_restoreInt
-
-        ARG     ps:ULONG
-
-        push    ebp
-        mov     ebp,esp         ; Set up stack frame
-        mov     ecx,[ps]
-        test    ecx,200h        ; SMP safe interrupt flag restore!
-        jz      @@1
-        sti
-@@1:    pop     ebp
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; ulong _MTRR_saveCR4(void);
-;----------------------------------------------------------------------------
-; Save the value of CR4 and clear the Page Global Enable (bit 7). We also
-; disable and flush the caches.
-;----------------------------------------------------------------------------
-cprocstart  _MTRR_saveCR4
-
-        enter_c
-
-; Save value of CR4 and clear Page Global Enable (bit 7)
-
-        mov     ebx,cr4
-        mov     eax,ebx
-        and     al,7Fh
-        mov     cr4,eax
-
-; Disable and flush caches
-
-        mov     eax,cr0
-        or      eax,40000000h
-        wbinvd
-        mov     cr0,eax
-        wbinvd
-
-; Return value from CR4
-
-        mov     eax,ebx
-        leave_c
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void _MTRR_restoreCR4(ulong cr4Val)
-;----------------------------------------------------------------------------
-; Save the value of CR4 and clear the Page Global Enable (bit 7). We also
-; disable and flush the caches.
-;----------------------------------------------------------------------------
-cprocstart  _MTRR_restoreCR4
-
-        ARG     cr4Val:ULONG
-
-        enter_c
-
-; Enable caches
-
-        mov     eax,cr0
-        and     eax,0BFFFFFFFh
-        mov     cr0,eax
-        mov     eax,[cr4Val]
-        mov     cr4,eax
-        leave_c
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; uchar _MTRR_getCx86(uchar reg);
-;----------------------------------------------------------------------------
-; Read a Cyrix CPU indexed register
-;----------------------------------------------------------------------------
-cprocstart  _MTRR_getCx86
-
-        ARG     reg:UCHAR
-
-        enter_c
-        mov     al,[reg]
-        out     22h,al
-        in      al,23h
-        leave_c
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; uchar _MTRR_setCx86(uchar reg,uchar val);
-;----------------------------------------------------------------------------
-; Write a Cyrix CPU indexed register
-;----------------------------------------------------------------------------
-cprocstart  _MTRR_setCx86
-
-        ARG     reg:UCHAR, val:UCHAR
-
-        enter_c
-        mov     al,[reg]
-        out     22h,al
-        mov     al,[val]
-        out     23h,al
-        leave_c
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void _MTRR_readMSR(uong reg, ulong FAR *eax, ulong FAR *edx);
-;----------------------------------------------------------------------------
-; Writes the specific Machine Status Register used on the newer Intel
-; Pentium Pro and Pentium II motherboards.
-;----------------------------------------------------------------------------
-cprocnear   _MTRR_readMSR
-
-        ARG     reg:ULONG, v_eax:DPTR, v_edx:DPTR
-
-        enter_c
-        mov     ecx,[reg]
-        rdmsr
-        mov     ebx,[v_eax]
-        mov     [ebx],eax
-        mov     ebx,[v_edx]
-        mov     [ebx],edx
-        leave_c
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void _MTRR_writeMSR(uong reg, ulong eax, ulong edx);
-;----------------------------------------------------------------------------
-; Writes the specific Machine Status Register used on the newer Intel
-; Pentium Pro and Pentium II motherboards.
-;----------------------------------------------------------------------------
-cprocnear   _MTRR_writeMSR
-
-        ARG     reg:ULONG, v_eax:ULONG, v_edx:ULONG
-
-        enter_c
-        mov     ecx,[reg]
-        mov     eax,[v_eax]
-        mov     edx,[v_edx]
-        wrmsr
-        leave_c
-        ret
-
-cprocend
-
-endcodeseg  _mtrr
-
-        END                     ; End of module
diff --git a/board/MAI/bios_emulator/scitech/src/pm/common/_pcihelp.asm b/board/MAI/bios_emulator/scitech/src/pm/common/_pcihelp.asm
deleted file mode 100644 (file)
index 5b8dbcc..0000000
+++ /dev/null
@@ -1,358 +0,0 @@
-;****************************************************************************
-;*
-;*                  SciTech OS Portability Manager Library
-;*
-;*  ========================================================================
-;*
-;*    The contents of this file are subject to the SciTech MGL Public
-;*    License Version 1.0 (the "License"); you may not use this file
-;*    except in compliance with the License. You may obtain a copy of
-;*    the License at http://www.scitechsoft.com/mgl-license.txt
-;*
-;*    Software distributed under the License is distributed on an
-;*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-;*    implied. See the License for the specific language governing
-;*    rights and limitations under the License.
-;*
-;*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-;*
-;*    The Initial Developer of the Original Code is SciTech Software, Inc.
-;*    All Rights Reserved.
-;*
-;*  ========================================================================
-;*
-;* Language:    80386 Assembler, TASM 4.0 or NASM
-;* Environment: Any
-;*
-;* Description: Helper assembler functions for PCI access module.
-;*
-;****************************************************************************
-
-        IDEAL
-
-include "scitech.mac"           ; Memory model macros
-
-header  _pcilib
-
-begcodeseg  _pcilib
-
-ifdef flatmodel
-
-;----------------------------------------------------------------------------
-; uchar _ASMAPI _BIOS32_service(
-;   ulong service,
-;   ulong func,
-;   ulong *physBase,
-;   ulong *length,
-;   ulong *serviceOffset,
-;   PCIBIOS_entry entry);
-;----------------------------------------------------------------------------
-; Call the BIOS32 services directory
-;----------------------------------------------------------------------------
-cprocstart   _BIOS32_service
-
-        ARG     service:ULONG, func:ULONG, physBase:DPTR, len:DPTR, off:DPTR, entry:QWORD
-
-        enter_c
-        mov     eax,[service]
-        mov     ebx,[func]
-ifdef   USE_NASM
-        call far dword [entry]
-else
-        call    [FWORD entry]
-endif
-        mov     esi,[physBase]
-        mov     [esi],ebx
-        mov     esi,[len]
-        mov     [esi],ecx
-        mov     esi,[off]
-        mov     [esi],edx
-        leave_c
-        ret
-
-cprocend
-
-endif
-
-;----------------------------------------------------------------------------
-; ushort _ASMAPI _PCIBIOS_isPresent(ulong i_eax,ulong *o_edx,ushort *oeax,
-;   uchar *o_cl,PCIBIOS_entry entry)
-;----------------------------------------------------------------------------
-; Call the PCI BIOS to determine if it is present.
-;----------------------------------------------------------------------------
-cprocstart   _PCIBIOS_isPresent
-
-        ARG     i_eax:ULONG, o_edx:DPTR, oeax:DPTR, o_cl:DPTR, entry:QWORD
-
-        enter_c
-        mov     eax,[i_eax]
-ifdef   flatmodel
-ifdef   USE_NASM
-        call far dword [entry]
-else
-        call    [FWORD entry]
-endif
-else
-        int     1Ah
-endif
-        _les    _si,[o_edx]
-        mov     [_ES _si],edx
-        _les    _si,[oeax]
-        mov     [_ES _si],ax
-        _les    _si,[o_cl]
-        mov     [_ES _si],cl
-        mov     ax,bx
-        leave_c
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; ulong _PCIBIOS_service(ulong r_eax,ulong r_ebx,ulong r_edi,ulong r_ecx,
-;   PCIBIOS_entry entry)
-;----------------------------------------------------------------------------
-; Call the PCI BIOS services, either via the 32-bit protected mode entry
-; point or via the Int 1Ah 16-bit interrupt.
-;----------------------------------------------------------------------------
-cprocstart   _PCIBIOS_service
-
-        ARG     r_eax:ULONG, r_ebx:ULONG, r_edi:ULONG, r_ecx:ULONG, entry:QWORD
-
-        enter_c
-        mov     eax,[r_eax]
-        mov     ebx,[r_ebx]
-        mov     edi,[r_edi]
-        mov     ecx,[r_ecx]
-ifdef   flatmodel
-ifdef   USE_NASM
-        call far dword [entry]
-else
-        call    [FWORD entry]
-endif
-else
-        int     1Ah
-endif
-        mov     eax,ecx
-ifndef  flatmodel
-        shld    edx,eax,16      ; Return result in DX:AX
-endif
-        leave_c
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; int _PCIBIOS_getRouting(PCIRoutingOptionsBuffer *buf,PCIBIOS_entry entry);
-;----------------------------------------------------------------------------
-; Get the routing options for PCI devices
-;----------------------------------------------------------------------------
-cprocstart   _PCIBIOS_getRouting
-
-        ARG     buf:DPTR, entry:QWORD
-
-        enter_c
-        mov     eax,0B10Eh
-        mov     bx,0
-        _les    _di,[buf]
-ifdef   flatmodel
-ifdef   USE_NASM
-        call far dword [entry]
-else
-        call    [FWORD entry]
-endif
-else
-        int     1Ah
-endif
-        movzx   eax,ah
-        leave_c
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; ibool _PCIBIOS_setIRQ(int busDev,int intPin,int IRQ,PCIBIOS_entry entry);
-;----------------------------------------------------------------------------
-; Change the IRQ routing for the PCI device
-;----------------------------------------------------------------------------
-cprocstart   _PCIBIOS_setIRQ
-
-        ARG     busDev:UINT, intPin:UINT, IRQ:UINT, entry:QWORD
-
-        enter_c
-        mov     eax,0B10Fh
-        mov     bx,[USHORT busDev]
-        mov     cl,[BYTE intPin]
-        mov     ch,[BYTE IRQ]
-ifdef   flatmodel
-ifdef   USE_NASM
-        call far dword [entry]
-else
-        call    [FWORD entry]
-endif
-else
-        int     1Ah
-endif
-        mov     eax,1
-        jnc     @@1
-        xor     eax,eax         ; Function failed!
-@@1:    leave_c
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; ulong _PCIBIOS_specialCycle(int bus,ulong data,PCIBIOS_entry entry);
-;----------------------------------------------------------------------------
-; Generate a special cycle via the PCI BIOS.
-;----------------------------------------------------------------------------
-cprocstart   _PCIBIOS_specialCycle
-
-        ARG     bus:UINT, data:ULONG, entry:QWORD
-
-        enter_c
-        mov     eax,0B106h
-        mov     bh,[BYTE bus]
-        mov     ecx,[data]
-ifdef   flatmodel
-ifdef   USE_NASM
-        call far dword [entry]
-else
-        call    [FWORD entry]
-endif
-else
-        int     1Ah
-endif
-        leave_c
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; ushort _PCI_getCS(void)
-;----------------------------------------------------------------------------
-cprocstart   _PCI_getCS
-
-        mov     ax,cs
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; int PM_inpb(int port)
-;----------------------------------------------------------------------------
-; Reads a byte from the specified port
-;----------------------------------------------------------------------------
-cprocstart  PM_inpb
-
-        ARG     port:UINT
-
-        push    _bp
-        mov     _bp,_sp
-        xor     _ax,_ax
-        mov     _dx,[port]
-        in      al,dx
-        pop     _bp
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; int PM_inpw(int port)
-;----------------------------------------------------------------------------
-; Reads a word from the specified port
-;----------------------------------------------------------------------------
-cprocstart  PM_inpw
-
-        ARG     port:UINT
-
-        push    _bp
-        mov     _bp,_sp
-        xor     _ax,_ax
-        mov     _dx,[port]
-        in      ax,dx
-        pop     _bp
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; ulong PM_inpd(int port)
-;----------------------------------------------------------------------------
-; Reads a word from the specified port
-;----------------------------------------------------------------------------
-cprocstart  PM_inpd
-
-        ARG     port:UINT
-
-        push    _bp
-        mov     _bp,_sp
-        mov     _dx,[port]
-        in      eax,dx
-ifndef flatmodel
-        shld    edx,eax,16      ; DX:AX = result
-endif
-        pop     _bp
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void PM_outpb(int port,int value)
-;----------------------------------------------------------------------------
-; Write a byte to the specified port.
-;----------------------------------------------------------------------------
-cprocstart  PM_outpb
-
-        ARG     port:UINT, value:UINT
-
-        push    _bp
-        mov     _bp,_sp
-        mov     _dx,[port]
-        mov     _ax,[value]
-        out     dx,al
-        pop     _bp
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void PM_outpw(int port,int value)
-;----------------------------------------------------------------------------
-; Write a word to the specified port.
-;----------------------------------------------------------------------------
-cprocstart  PM_outpw
-
-        ARG     port:UINT, value:UINT
-
-        push    _bp
-        mov     _bp,_sp
-        mov     _dx,[port]
-        mov     _ax,[value]
-        out     dx,ax
-        pop     _bp
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void PM_outpd(int port,ulong value)
-;----------------------------------------------------------------------------
-; Write a word to the specified port.
-;----------------------------------------------------------------------------
-cprocstart  PM_outpd
-
-        ARG     port:UINT, value:ULONG
-
-        push    _bp
-        mov     _bp,_sp
-        mov     _dx,[port]
-        mov     eax,[value]
-        out     dx,eax
-        pop     _bp
-        ret
-
-cprocend
-
-endcodeseg  _pcilib
-
-        END
diff --git a/board/MAI/bios_emulator/scitech/src/pm/common/agp.c b/board/MAI/bios_emulator/scitech/src/pm/common/agp.c
deleted file mode 100644 (file)
index d53bc88..0000000
+++ /dev/null
@@ -1,189 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  32-bit Ring 0 device driver
-*
-* Description:  Generic module to implement AGP support functions using the
-*               SciTech Nucleus AGP support drivers. If the OS provides
-*               native AGP support, this module should *NOT* be used. Instead
-*               wrappers should be placed around the OS support functions
-*               to implement this functionality.
-*
-****************************************************************************/
-
-#include "pmapi.h"
-#ifndef REALMODE
-#include "nucleus/agp.h"
-
-/*--------------------------- Global variables ----------------------------*/
-
-static AGP_devCtx       *agp;
-static AGP_driverFuncs  driver;
-
-/*----------------------------- Implementation ----------------------------*/
-
-/****************************************************************************
-RETURNS:
-Size of AGP aperture in MB on success, 0 on failure.
-
-REMARKS:
-This function initialises the AGP driver in the system and returns the
-size of the available AGP aperture in megabytes.
-****************************************************************************/
-ulong PMAPI PM_agpInit(void)
-{
-    if ((agp = AGP_loadDriver(0)) == NULL)
-       return 0;
-    driver.dwSize = sizeof(driver);
-    if (!agp->QueryFunctions(AGP_GET_DRIVERFUNCS,&driver))
-       return 0;
-    switch (driver.GetApertureSize()) {
-       case agpSize4MB:    return 4;
-       case agpSize8MB:    return 8;
-       case agpSize16MB:   return 16;
-       case agpSize32MB:   return 32;
-       case agpSize64MB:   return 64;
-       case agpSize128MB:  return 128;
-       case agpSize256MB:  return 256;
-       case agpSize512MB:  return 512;
-       case agpSize1GB:    return 1024;
-       case agpSize2GB:    return 2048;
-       }
-    return 0;
-}
-
-/****************************************************************************
-REMARKS:
-This function closes down the loaded AGP driver.
-****************************************************************************/
-void PMAPI PM_agpExit(void)
-{
-    AGP_unloadDriver(agp);
-}
-
-/****************************************************************************
-PARAMETERS:
-numPages    - Number of memory pages that should be reserved
-type        - Type of memory to allocate
-physContext - Returns the physical context handle for the mapping
-physAddr    - Returns the physical address for the mapping
-
-RETURNS:
-True on success, false on failure.
-
-REMARKS:
-This function reserves a range of physical memory addresses on the system
-bus which the AGP controller will respond to. If this function succeeds,
-the AGP controller can respond to the reserved physical address range on
-the bus. However you must first call AGP_commitPhysical to cause this memory
-to actually be committed for use before it can be accessed.
-****************************************************************************/
-ibool PMAPI PM_agpReservePhysical(
-    ulong numPages,
-    int type,
-    void **physContext,
-    PM_physAddr *physAddr)
-{
-    switch (type) {
-       case PM_agpUncached:
-           type = agpUncached;
-           break;
-       case PM_agpWriteCombine:
-           type = agpWriteCombine;
-           break;
-       case PM_agpIntelDCACHE:
-           type = agpIntelDCACHE;
-           break;
-       default:
-           return false;
-       }
-    return driver.ReservePhysical(numPages,type,physContext,physAddr) == nOK;
-}
-
-/****************************************************************************
-PARAMETERS:
-physContext - Physical AGP context to release
-
-RETURNS:
-True on success, false on failure.
-
-REMARKS:
-This function releases a range of physical memory addresses on the system
-bus which the AGP controller will respond to. All committed memory for
-the physical address range covered by the context will be released.
-****************************************************************************/
-ibool PMAPI PM_agpReleasePhysical(
-    void *physContext)
-{
-    return driver.ReleasePhysical(physContext) == nOK;
-}
-
-/****************************************************************************
-PARAMETERS:
-physContext - Physical AGP context to commit memory for
-numPages    - Number of pages to be committed
-startOffset - Offset in pages into the reserved physical context
-physAddr    - Returns the physical address of the committed memory
-
-RETURNS:
-True on success, false on failure.
-
-REMARKS:
-This function commits into the specified physical context that was previously
-reserved by a call to ReservePhysical. You can use the startOffset and
-numPages parameters to only commit portions of the reserved memory range at
-a time.
-****************************************************************************/
-ibool PMAPI PM_agpCommitPhysical(
-    void *physContext,
-    ulong numPages,
-    ulong startOffset,
-    PM_physAddr *physAddr)
-{
-    return driver.CommitPhysical(physContext,numPages,startOffset,physAddr) == nOK;
-}
-
-/****************************************************************************
-PARAMETERS:
-physContext - Physical AGP context to free memory for
-numPages    - Number of pages to be freed
-startOffset - Offset in pages into the reserved physical context
-
-RETURNS:
-True on success, false on failure.
-
-REMARKS:
-This function frees memory previously committed by the CommitPhysical
-function. Note that you can free a portion of a memory range that was
-previously committed if you wish.
-****************************************************************************/
-ibool PMAPI PM_agpFreePhysical(
-    void *physContext,
-    ulong numPages,
-    ulong startOffset)
-{
-    return driver.FreePhysical(physContext,numPages,startOffset) == nOK;
-}
-
-#endif  /* !REALMODE */
diff --git a/board/MAI/bios_emulator/scitech/src/pm/common/keyboard.c b/board/MAI/bios_emulator/scitech/src/pm/common/keyboard.c
deleted file mode 100644 (file)
index 36867bd..0000000
+++ /dev/null
@@ -1,449 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Any
-*
-* Description:  Direct keyboard event handling module. This module contains
-*               code to process raw scan code information, convert it to
-*               virtual scan codes and do code page translation to ASCII
-*               for different international keyboard layouts.
-*
-****************************************************************************/
-
-/*---------------------------- Implementation -----------------------------*/
-
-/****************************************************************************
-PARAMETERS:
-scanCode    - Keyboard scan code to translate
-table       - Code page table to search
-count       - Number of entries in the code page table
-
-REMARKS:
-This function translates the scan codes from keyboard scan codes to ASCII
-codes using a binary search on the code page table.
-****************************************************************************/
-static uchar translateScan(
-    uchar scanCode,
-    codepage_entry_t *table,
-    int count)
-{
-    codepage_entry_t    *test;
-    int                 n,pivot,val;
-
-    for (n = count; n > 0; ) {
-       pivot = n >> 1;
-       test = table + pivot;
-       val = scanCode - test->scanCode;
-       if (val < 0)
-           n = pivot;
-       else if (val == 0)
-           return test->asciiCode;
-       else {
-           table = test + 1;
-           n -= pivot + 1;
-           }
-       }
-    return 0;
-}
-
-/****************************************************************************
-REMARKS:
-This macro/function is used to converts the scan codes reported by the
-keyboard to our event libraries normalised format. We only have one scan
-code for the 'A' key, and use shift modifiers to determine if it is a
-Ctrl-F1, Alt-F1 etc. The raw scan codes from the keyboard work this way,
-but the OS gives us 'cooked' scan codes, we have to translate them back
-to the raw format.
-{secret}
-****************************************************************************/
-void _EVT_maskKeyCode(
-    event_t *evt)
-{
-    int ascii,scan = EVT_scanCode(evt->message);
-
-    evt->message &= ~0xFF;
-    if (evt->modifiers & EVT_NUMLOCK) {
-       if ((ascii = translateScan(scan,EVT.codePage->numPad,EVT.codePage->numPadLen)) != 0) {
-           evt->message |= ascii;
-           return;
-           }
-       }
-    if (evt->modifiers & EVT_CTRLSTATE) {
-       evt->message |= translateScan(scan,EVT.codePage->ctrl,EVT.codePage->ctrlLen);
-       return;
-       }
-    if (evt->modifiers & EVT_CAPSLOCK) {
-       if (evt->modifiers & EVT_SHIFTKEY) {
-           if ((ascii = translateScan(scan,EVT.codePage->shiftCaps,EVT.codePage->shiftCapsLen)) != 0) {
-               evt->message |= ascii;
-               return;
-               }
-           }
-       else {
-           if ((ascii = translateScan(scan,EVT.codePage->caps,EVT.codePage->capsLen)) != 0) {
-               evt->message |= ascii;
-               return;
-               }
-           }
-       }
-    if (evt->modifiers & EVT_SHIFTKEY) {
-       if ((ascii = translateScan(scan,EVT.codePage->shift,EVT.codePage->shiftLen)) != 0) {
-           evt->message |= ascii;
-           return;
-           }
-       }
-    evt->message |= translateScan(scan,EVT.codePage->normal,EVT.codePage->normalLen);
-}
-
-/****************************************************************************
-REMARKS:
-Returns true if the key with the specified scan code is being held down.
-****************************************************************************/
-static ibool _EVT_isKeyDown(
-    uchar scanCode)
-{
-    if (scanCode > 0x7F)
-       return false;
-    else
-       return EVT.keyTable[scanCode] != 0;
-}
-
-/****************************************************************************
-PARAMETERS:
-what        - Event code
-message     - Event message (ASCII code and scan code)
-
-REMARKS:
-Adds a new keyboard event to the event queue. This routine is called from
-within the keyboard interrupt subroutine!
-
-NOTE:   Interrupts are OFF when this routine is called by the keyboard ISR,
-       and we leave them OFF the entire time.
-****************************************************************************/
-static void addKeyEvent(
-    uint what,
-    uint message)
-{
-    event_t evt;
-
-    if (EVT.count < EVENTQSIZE) {
-       /* Save information in event record */
-       evt.when = _EVT_getTicks();
-       evt.what = what;
-       evt.message = message | 0x10000UL;
-       evt.where_x = 0;
-       evt.where_y = 0;
-       evt.relative_x = 0;
-       evt.relative_y = 0;
-       evt.modifiers = EVT.keyModifiers;
-       if (evt.what == EVT_KEYREPEAT) {
-           if (EVT.oldKey != -1)
-               EVT.evtq[EVT.oldKey].message += 0x10000UL;
-           else {
-               EVT.oldKey = EVT.freeHead;
-               addEvent(&evt);         /* Add to tail of event queue   */
-               }
-           }
-       else {
-#ifdef __QNX__
-           _EVT_maskKeyCode(&evt);
-#endif
-           addEvent(&evt);             /* Add to tail of event queue   */
-           }
-       EVT.oldMove = -1;
-       }
-}
-
-/****************************************************************************
-REMARKS:
-This function waits for the keyboard controller to set the ready-for-write
-bit.
-****************************************************************************/
-static int kbWaitForWriteReady(void)
-{
-    int timeout = 8192;
-    while ((timeout > 0) && (PM_inpb(0x64) & 0x02))
-       timeout--;
-    return (timeout > 0);
-}
-
-/****************************************************************************
-REMARKS:
-This function waits for the keyboard controller to set the ready-for-read
-bit.
-****************************************************************************/
-static int kbWaitForReadReady(void)
-{
-    int timeout = 8192;
-    while ((timeout > 0) && (!(PM_inpb(0x64) & 0x01)))
-       timeout--;
-    return (timeout > 0);
-}
-
-/****************************************************************************
-PARAMETERS:
-data    - Data to send to the keyboard
-
-REMARKS:
-This function sends a data byte to the keyboard controller.
-****************************************************************************/
-static int kbSendData(
-    uchar data)
-{
-    int resends = 4;
-    int timeout, temp;
-
-    do {
-       if (!kbWaitForWriteReady())
-           return 0;
-       PM_outpb(0x60,data);
-       timeout = 8192;
-       while (--timeout > 0) {
-           if (!kbWaitForReadReady())
-               return 0;
-           temp = PM_inpb(0x60);
-           if (temp == 0xFA)
-               return 1;
-           if (temp == 0xFE)
-               break;
-           }
-       } while ((resends-- > 0) && (timeout > 0));
-    return 0;
-}
-
-/****************************************************************************
-PARAMETERS:
-modifiers   - Keyboard modifier flags
-
-REMARKS:
-This function re-programs the LED's on the keyboard to the values stored
-in the passed in modifier flags. If the 'allowLEDS' flag is false, this
-function does nothing.
-****************************************************************************/
-static void setLEDS(
-    uint modifiers)
-{
-    if (EVT.allowLEDS) {
-       if (!kbSendData(0xED) || !kbSendData((modifiers>>9) & 7)) {
-           kbSendData(0xF4);
-           }
-       }
-}
-
-/****************************************************************************
-REMARKS:
-Function to process raw scan codes read from the keyboard controller.
-
-NOTE:   Interrupts are OFF when this routine is called by the keyboard ISR,
-       and we leave them OFF the entire time.
-{secret}
-****************************************************************************/
-void processRawScanCode(
-    int scan)
-{
-    static int  pauseLoop = 0;
-    static int  extended = 0;
-    int         what;
-
-    if (pauseLoop) {
-       /* Skip scan codes until the pause key sequence has been read */
-       pauseLoop--;
-       }
-    else if (scan == 0xE0) {
-       /* This signals the start of an extended scan code sequence */
-       extended = 1;
-       }
-    else if (scan == 0xE1) {
-       /* The Pause key sends a strange scan code sequence, which is:
-        *
-        *  E1 1D 52 E1 9D D2
-        *
-        * However there is never any release code nor any auto-repeat for
-        * this key. For this reason we simply ignore the key and skip the
-        * next 5 scan codes read from the keyboard.
-        */
-       pauseLoop = 5;
-       }
-    else {
-       /* Process the scan code normally (it may be an extended code
-        * however!). Bit 7 means key was released, and bits 0-6 are the
-        * scan code.
-        */
-       what = (scan & 0x80) ? EVT_KEYUP : EVT_KEYDOWN;
-       scan &= 0x7F;
-       if (extended) {
-           extended = 0;
-           if (scan == 0x2A || scan == 0x36) {
-               /* Ignore these extended scan code sequences. These are
-                * used by the keyboard controller to wrap around certain
-                * key sequences for the keypad (and when NUMLOCK is down
-                * internally).
-                */
-               return;
-               }
-
-           /* Convert extended codes for key sequences that we map to
-            * virtual scan codes so the user can detect them in their
-            * code.
-            */
-           switch (scan) {
-               case KB_leftCtrl:   scan = KB_rightCtrl;    break;
-               case KB_leftAlt:    scan = KB_rightAlt;     break;
-               case KB_divide:     scan = KB_padDivide;    break;
-               case KB_enter:      scan = KB_padEnter;     break;
-               case KB_padTimes:   scan = KB_sysReq;       break;
-               }
-           }
-       else {
-           /* Convert regular scan codes for key sequences that we map to
-            * virtual scan codes so the user can detect them in their
-            * code.
-            */
-           switch (scan) {
-               case KB_left:       scan = KB_padLeft;      break;
-               case KB_right:      scan = KB_padRight;     break;
-               case KB_up:         scan = KB_padUp;        break;
-               case KB_down:       scan = KB_padDown;      break;
-               case KB_insert:     scan = KB_padInsert;    break;
-               case KB_delete:     scan = KB_padDelete;    break;
-               case KB_home:       scan = KB_padHome;      break;
-               case KB_end:        scan = KB_padEnd;       break;
-               case KB_pageUp:     scan = KB_padPageUp;    break;
-               case KB_pageDown:   scan = KB_padPageDown;  break;
-               }
-           }
-
-       /* Determine if the key is an UP, DOWN or REPEAT and maintain the
-        * up/down status of all keys in our global key array.
-        */
-       if (what == EVT_KEYDOWN) {
-           if (EVT.keyTable[scan])
-               what = EVT_KEYREPEAT;
-           else
-               EVT.keyTable[scan] = scan;
-           }
-       else {
-           EVT.keyTable[scan] = 0;
-           }
-
-       /* Handle shift key modifiers */
-       if (what != EVT_KEYREPEAT) {
-           switch (scan) {
-               case KB_capsLock:
-                   if (what == EVT_KEYDOWN)
-                       EVT.keyModifiers ^= EVT_CAPSLOCK;
-                   setLEDS(EVT.keyModifiers);
-                   break;
-               case KB_numLock:
-                   if (what == EVT_KEYDOWN)
-                       EVT.keyModifiers ^= EVT_NUMLOCK;
-                   setLEDS(EVT.keyModifiers);
-                   break;
-               case KB_scrollLock:
-                   if (what == EVT_KEYDOWN)
-                       EVT.keyModifiers ^= EVT_SCROLLLOCK;
-                   setLEDS(EVT.keyModifiers);
-                   break;
-               case KB_leftShift:
-                   if (what == EVT_KEYUP)
-                       EVT.keyModifiers &= ~EVT_LEFTSHIFT;
-                   else
-                       EVT.keyModifiers |= EVT_LEFTSHIFT;
-                   break;
-               case KB_rightShift:
-                   if (what == EVT_KEYUP)
-                       EVT.keyModifiers &= ~EVT_RIGHTSHIFT;
-                   else
-                       EVT.keyModifiers |= EVT_RIGHTSHIFT;
-                   break;
-               case KB_leftCtrl:
-                   if (what == EVT_KEYUP)
-                       EVT.keyModifiers &= ~EVT_LEFTCTRL;
-                   else
-                       EVT.keyModifiers |= EVT_LEFTCTRL;
-                   break;
-               case KB_rightCtrl:
-                   if (what == EVT_KEYUP)
-                       EVT.keyModifiers &= ~EVT_RIGHTCTRL;
-                   else
-                       EVT.keyModifiers |= EVT_RIGHTCTRL;
-                   break;
-               case KB_leftAlt:
-                   if (what == EVT_KEYUP)
-                       EVT.keyModifiers &= ~EVT_LEFTALT;
-                   else
-                       EVT.keyModifiers |= EVT_LEFTALT;
-                   break;
-               case KB_rightAlt:
-                   if (what == EVT_KEYUP)
-                       EVT.keyModifiers &= ~EVT_RIGHTALT;
-                   else
-                       EVT.keyModifiers |= EVT_RIGHTALT;
-                   break;
-#ifdef SUPPORT_CTRL_ALT_DEL
-               case KB_delete:
-                   if ((EVT.keyModifiers & EVT_CTRLSTATE) && (EVT.keyModifiers & EVT_ALTSTATE))
-                       Reboot();
-                   break;
-#endif
-               }
-           }
-
-       /* Add the untranslated key code to the event queue. All
-        * translation to ASCII from the key codes occurs when the key
-        * is extracted from the queue, saving time in the low level
-        * interrupt handler.
-        */
-       addKeyEvent(what,scan << 8);
-       }
-}
-
-/****************************************************************************
-DESCRIPTION:
-Enables/disables the update of the keyboard LED status indicators.
-
-HEADER:
-event.h
-
-PARAMETERS:
-enable  - True to enable, false to disable
-
-REMARKS:
-Enables the update of the keyboard LED status indicators. Sometimes it may
-be convenient in the application to turn off the updating of the LED
-status indicators (such as if a game is using the CAPSLOCK key for some
-function). Passing in a value of FALSE to this function will turn off all
-the LEDS, and stop updating them when the internal status changes (note
-however that internally we still keep track of the toggle key status!).
-****************************************************************************/
-void EVTAPI EVT_allowLEDS(
-    ibool enable)
-{
-    EVT.allowLEDS = true;
-    if (enable)
-       setLEDS(EVT.keyModifiers);
-    else
-       setLEDS(0);
-    EVT.allowLEDS = enable;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/common/malloc.c b/board/MAI/bios_emulator/scitech/src/pm/common/malloc.c
deleted file mode 100644 (file)
index 83ef221..0000000
+++ /dev/null
@@ -1,205 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Any
-*
-* Description:  Module for implementing the PM library overrideable memory
-*               allocator functions.
-*
-****************************************************************************/
-
-#include "pmapi.h"
-
-/*--------------------------- Global variables ----------------------------*/
-
-void * (*__PM_malloc)(size_t size)              = malloc;
-void * (*__PM_calloc)(size_t nelem,size_t size) = calloc;
-void * (*__PM_realloc)(void *ptr,size_t size)   = realloc;
-void (*__PM_free)(void *p)                      = free;
-
-/*----------------------------- Implementation ----------------------------*/
-
-/****************************************************************************
-DESCRIPTION:
-Use local memory allocation routines.
-
-HEADER:
-pmapi.h
-
-PARAMETERS:
-malloc  - Pointer to new malloc routine to use
-calloc  - Pointer to new caalloc routine to use
-realloc - Pointer to new realloc routine to use
-free    - Pointer to new free routine to use
-
-REMARKS:
-Tells the PM library to use a set of user specified memory allocation
-routines instead of using the normal malloc/calloc/realloc/free standard
-C library functions. This is useful if you wish to use a third party
-debugging malloc library or perhaps a set of faster memory allocation
-functions with the PM library, or any apps that use the PM library (such as
-the MGL). Once you have registered your memory allocation routines, all
-calls to PM_malloc, PM_calloc, PM_realloc and PM_free will be revectored to
-your local memory allocation routines.
-
-This is also useful if you need to keep track of just how much physical
-memory your program has been using. You can use the PM_availableMemory
-function to find out how much physical memory is available when the program
-starts, and then you can use your own local memory allocation routines to
-keep track of how much memory has been used and freed.
-
-NOTE: This function should be called right at the start of your application,
-      before you initialise any other components or libraries.
-
-NOTE: Code compiled into Binary Portable DLL's and Drivers automatically
-      end up calling these functions via the BPD C runtime library.
-
-SEE ALSO:
-PM_malloc, PM_calloc, PM_realloc, PM_free, PM_availableMemory
-****************************************************************************/
-void PMAPI PM_useLocalMalloc(
-    void * (*malloc)(size_t size),
-    void * (*calloc)(size_t nelem,size_t size),
-    void * (*realloc)(void *ptr,size_t size),
-    void (*free)(void *p))
-{
-    __PM_malloc = malloc;
-    __PM_calloc = calloc;
-    __PM_realloc = realloc;
-    __PM_free = free;
-}
-
-/****************************************************************************
-DESCRIPTION:
-Allocate a block of memory.
-
-HEADER:
-pmapi.h
-
-PARAMETERS:
-size    - Size of block to allocate in bytes
-
-RETURNS:
-Pointer to allocated block, or NULL if out of memory.
-
-REMARKS:
-Allocates a block of memory of length size. If you have changed the memory
-allocation routines with the PM_useLocalMalloc function, then calls to this
-function will actually make calls to the local memory allocation routines
-that you have registered.
-
-SEE ALSO:
-PM_calloc, PM_realloc, PM_free, PM_useLocalMalloc
-****************************************************************************/
-void * PMAPI PM_malloc(
-    size_t size)
-{
-    return __PM_malloc(size);
-}
-
-/****************************************************************************
-DESCRIPTION:
-Allocate and clear a large memory block.
-
-HEADER:
-pmapi.h
-
-PARAMETERS:
-nelem   - number of contiguous size-byte units to allocate
-size    - size of unit in bytes
-
-RETURNS:
-Pointer to allocated memory if successful, NULL if out of memory.
-
-REMARKS:
-Allocates a block of memory of length (size * nelem), and clears the
-allocated area with zeros (0). If you have changed the memory allocation
-routines with the PM_useLocalMalloc function, then calls to this function
-will actually make calls to the local memory allocation routines that you
-have registered.
-
-SEE ALSO:
-PM_malloc, PM_realloc, PM_free, PM_useLocalMalloc
-****************************************************************************/
-void * PMAPI PM_calloc(
-    size_t nelem,
-    size_t size)
-{
-    return __PM_calloc(nelem,size);
-}
-
-/****************************************************************************
-DESCRIPTION:
-Re-allocate a block of memory
-
-HEADER:
-pmapi.h
-
-PARAMETERS:
-ptr     - Pointer to block to resize
-size    - size of unit in bytes
-
-RETURNS:
-Pointer to allocated memory if successful, NULL if out of memory.
-
-REMARKS:
-This function reallocates a block of memory that has been previously been
-allocated to the new of size. The new size may be smaller or larger than
-the original block of memory. If you have changed the memory allocation
-routines with the PM_useLocalMalloc function, then calls to this function
-will actually make calls to the local memory allocation routines that you
-have registered.
-
-SEE ALSO:
-PM_malloc, PM_calloc, PM_free, PM_useLocalMalloc
-****************************************************************************/
-void * PMAPI PM_realloc(
-    void *ptr,
-    size_t size)
-{
-    return __PM_realloc(ptr,size);
-}
-
-/****************************************************************************
-DESCRIPTION:
-Frees a block of memory.
-
-HEADER:
-pmapi.h
-
-PARAMETERS:
-p   - Pointer to memory block to free
-
-REMARKS:
-Frees a block of memory previously allocated with either PM_malloc,
-PM_calloc or PM_realloc.
-
-SEE ALSO:
-PM_malloc, PM_calloc, PM_realloc, PM_useLocalMalloc
-****************************************************************************/
-void PMAPI PM_free(
-    void *p)
-{
-    __PM_free(p);
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/common/mtrr.c b/board/MAI/bios_emulator/scitech/src/pm/common/mtrr.c
deleted file mode 100644 (file)
index eed5f45..0000000
+++ /dev/null
@@ -1,867 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-*               Heavily based on code copyright (C) Richard Gooch
-*
-* Language:     ANSI C
-* Environment:  32-bit Ring 0 device driver
-*
-* Description:  Generic Memory Type Range Register (MTRR) functions to
-*               manipulate the MTRR registers on supported CPU's. This code
-*               *must* run at ring 0, so you can't normally include this
-*               code directly in normal applications (the except is DOS4GW
-*               apps which run at ring 0 under real DOS). Thus this code
-*               will normally be compiled into a ring 0 device driver for
-*               the target operating system.
-*
-****************************************************************************/
-
-#include "pmapi.h"
-#include "ztimerc.h"
-#include "mtrr.h"
-
-#ifndef REALMODE
-
-/*--------------------------- Global variables ----------------------------*/
-
-/* Intel pre-defined MTRR registers */
-
-#define NUM_FIXED_RANGES        88
-#define INTEL_cap_MSR           0x0FE
-#define INTEL_defType_MSR       0x2FF
-#define INTEL_fix64K_00000_MSR  0x250
-#define INTEL_fix16K_80000_MSR  0x258
-#define INTEL_fix16K_A0000_MSR  0x259
-#define INTEL_fix4K_C0000_MSR   0x268
-#define INTEL_fix4K_C8000_MSR   0x269
-#define INTEL_fix4K_D0000_MSR   0x26A
-#define INTEL_fix4K_D8000_MSR   0x26B
-#define INTEL_fix4K_E0000_MSR   0x26C
-#define INTEL_fix4K_E8000_MSR   0x26D
-#define INTEL_fix4K_F0000_MSR   0x26E
-#define INTEL_fix4K_F8000_MSR   0x26F
-
-/* Macros to find the address of a paricular MSR register */
-
-#define INTEL_physBase_MSR(reg) (0x200 + 2 * (reg))
-#define INTEL_physMask_MSR(reg) (0x200 + 2 * (reg) + 1)
-
-/* Cyrix CPU configuration register indexes */
-#define CX86_CCR0 0xC0
-#define CX86_CCR1 0xC1
-#define CX86_CCR2 0xC2
-#define CX86_CCR3 0xC3
-#define CX86_CCR4 0xE8
-#define CX86_CCR5 0xE9
-#define CX86_CCR6 0xEA
-#define CX86_DIR0 0xFE
-#define CX86_DIR1 0xFF
-#define CX86_ARR_BASE 0xC4
-#define CX86_RCR_BASE 0xDC
-
-/* Structure to maintain machine state while updating MTRR registers */
-
-typedef struct {
-    ulong   flags;
-    ulong   defTypeLo;
-    ulong   defTypeHi;
-    ulong   cr4Val;
-    ulong   ccr3;
-    } MTRRContext;
-
-static int      numMTRR = -1;
-static int      cpuFamily,cpuType,cpuStepping;
-static void     (*getMTRR)(uint reg,ulong *base,ulong *size,int *type) = NULL;
-static void     (*setMTRR)(uint reg,ulong base,ulong size,int type) = NULL;
-static int      (*getFreeRegion)(ulong base,ulong size) = NULL;
-
-/*----------------------------- Implementation ----------------------------*/
-
-/****************************************************************************
-RETURNS:
-Returns non-zero if we have the write-combining memory type
-****************************************************************************/
-static int MTRR_haveWriteCombine(void)
-{
-    ulong   config,dummy;
-
-    switch (cpuFamily) {
-       case CPU_AMD:
-           if (cpuType < CPU_AMDAthlon) {
-               /* AMD K6-2 stepping 8 and later support the MTRR registers.
-                * The earlier K6-2 steppings (300Mhz models) do not
-                * support MTRR's.
-                */
-               if ((cpuType < CPU_AMDK6_2) || (cpuType == CPU_AMDK6_2 && cpuStepping < 8))
-                   return 0;
-               return 1;
-               }
-           /* Fall through for AMD Athlon which uses P6 style MTRR's */
-       case CPU_Intel:
-           _MTRR_readMSR(INTEL_cap_MSR,&config,&dummy);
-           return (config & (1 << 10));
-       case CPU_Cyrix:
-           /* Cyrix 6x86 and later support the MTRR registers */
-           if (cpuType < CPU_Cyrix6x86)
-               return 0;
-           return 1;
-       }
-    return 0;
-}
-
-/****************************************************************************
-PARAMETERS:
-base    - The starting physical base address of the region
-size    - The size in bytes of the region
-
-RETURNS:
-The index of the region on success, else -1 on error.
-
-REMARKS:
-Generic function to find the location of a free MTRR register to be used
-for creating a new mapping.
-****************************************************************************/
-static int GENERIC_getFreeRegion(
-    ulong base,
-    ulong size)
-{
-    int     i,ltype;
-    ulong   lbase,lsize;
-
-    for (i = 0; i < numMTRR; i++) {
-       getMTRR(i,&lbase,&lsize,&ltype);
-       if (lsize < 1)
-           return i;
-       }
-    (void)base;
-    (void)size;
-    return -1;
-}
-
-/****************************************************************************
-PARAMETERS:
-base    - The starting physical base address of the region
-size    - The size in bytes of the region
-
-RETURNS:
-The index of the region on success, else -1 on error.
-
-REMARKS:
-Generic function to find the location of a free MTRR register to be used
-for creating a new mapping.
-****************************************************************************/
-static int AMDK6_getFreeRegion(
-    ulong base,
-    ulong size)
-{
-    int     i,ltype;
-    ulong   lbase,lsize;
-
-    for (i = 0; i < numMTRR; i++) {
-       getMTRR(i,&lbase,&lsize,&ltype);
-       if (lsize < 1)
-           return i;
-       }
-    (void)base;
-    (void)size;
-    return -1;
-}
-
-/****************************************************************************
-PARAMETERS:
-base    - The starting physical base address of the region
-size    - The size in bytes of the region
-
-RETURNS:
-The index of the region on success, else -1 on error.
-
-REMARKS:
-Cyrix specific function to find the location of a free MTRR register to be
-used for creating a new mapping.
-****************************************************************************/
-static int CYRIX_getFreeRegion(
-    ulong base,
-    ulong size)
-{
-    int     i,ltype;
-    ulong   lbase, lsize;
-
-    if (size > 0x2000000UL) {
-       /* If we are to set up a region >32M then look at ARR7 immediately */
-       getMTRR(7,&lbase,&lsize,&ltype);
-       if (lsize < 1)
-           return 7;
-       }
-    else {
-       /* Check ARR0-6 registers */
-       for (i = 0; i < 7; i++) {
-           getMTRR(i,&lbase,&lsize,&ltype);
-           if (lsize < 1)
-               return i;
-           }
-       /* Try ARR7 but its size must be at least 256K */
-       getMTRR(7,&lbase,&lsize,&ltype);
-       if ((lsize < 1) && (size >= 0x40000))
-           return i;
-       }
-    (void)base;
-    return -1;
-}
-
-/****************************************************************************
-PARAMETERS:
-c   - Place to store the machine context across the call
-
-REMARKS:
-Puts the processor into a state where MTRRs can be safely updated
-****************************************************************************/
-static void MTRR_beginUpdate(
-    MTRRContext *c)
-{
-    c->flags = _MTRR_disableInt();
-    if (cpuFamily != CPU_AMD || (cpuFamily == CPU_AMD && cpuType >= CPU_AMDAthlon)) {
-       switch (cpuFamily) {
-           case CPU_Intel:
-           case CPU_AMD:
-               /* Disable MTRRs, and set the default type to uncached */
-               c->cr4Val = _MTRR_saveCR4();
-               _MTRR_readMSR(INTEL_defType_MSR,&c->defTypeLo,&c->defTypeHi);
-               _MTRR_writeMSR(INTEL_defType_MSR,c->defTypeLo & 0xF300UL,c->defTypeHi);
-               break;
-           case CPU_Cyrix:
-               c->ccr3 = _MTRR_getCx86(CX86_CCR3);
-               _MTRR_setCx86(CX86_CCR3, (uchar)((c->ccr3 & 0x0F) | 0x10));
-               break;
-           }
-       }
-}
-
-/****************************************************************************
-PARAMETERS:
-c   - Place to restore the machine context from
-
-REMARKS:
-Restores the processor after updating any of the registers
-****************************************************************************/
-static void MTRR_endUpdate(
-    MTRRContext *c)
-{
-    if (cpuFamily != CPU_AMD || (cpuFamily == CPU_AMD && cpuType >= CPU_AMDAthlon)) {
-       PM_flushTLB();
-       switch (cpuFamily) {
-           case CPU_Intel:
-           case CPU_AMD:
-               _MTRR_writeMSR(INTEL_defType_MSR,c->defTypeLo,c->defTypeHi);
-               _MTRR_restoreCR4(c->cr4Val);
-               break;
-           case CPU_Cyrix:
-               _MTRR_setCx86(CX86_CCR3,(uchar)c->ccr3);
-               break;
-           }
-       }
-
-    /* Re-enable interrupts (if enabled previously) */
-    _MTRR_restoreInt(c->flags);
-}
-
-/****************************************************************************
-PARAMETERS:
-reg     - MTRR register to read
-base    - Place to store the starting physical base address of the region
-size    - Place to store the size in bytes of the region
-type    - Place to store the type of the MTRR register
-
-REMARKS:
-Intel specific function to read the value of a specific MTRR register.
-****************************************************************************/
-static void INTEL_getMTRR(
-    uint reg,
-    ulong *base,
-    ulong *size,
-    int *type)
-{
-    ulong hi,maskLo,baseLo;
-
-    _MTRR_readMSR(INTEL_physMask_MSR(reg),&maskLo,&hi);
-    if ((maskLo & 0x800) == 0) {
-       /* MTRR is disabled, so it is free */
-       *base = 0;
-       *size = 0;
-       *type = 0;
-       return;
-       }
-    _MTRR_readMSR(INTEL_physBase_MSR(reg),&baseLo,&hi);
-    maskLo = (maskLo & 0xFFFFF000UL);
-    *size = ~(maskLo - 1);
-    *base = (baseLo & 0xFFFFF000UL);
-    *type = (baseLo & 0xFF);
-}
-
-/****************************************************************************
-PARAMETERS:
-reg     - MTRR register to set
-base    - The starting physical base address of the region
-size    - The size in bytes of the region
-type    - Type to place into the MTRR register
-
-REMARKS:
-Intel specific function to set the value of a specific MTRR register to
-the passed in base, size and type.
-****************************************************************************/
-static void INTEL_setMTRR(
-    uint reg,
-    ulong base,
-    ulong size,
-    int type)
-{
-    MTRRContext c;
-
-    MTRR_beginUpdate(&c);
-    if (size == 0) {
-       /* The invalid bit is kept in the mask, so we simply clear the
-        * relevant mask register to disable a range.
-        */
-       _MTRR_writeMSR(INTEL_physMask_MSR(reg),0,0);
-       }
-    else {
-       _MTRR_writeMSR(INTEL_physBase_MSR(reg),base | type,0);
-       _MTRR_writeMSR(INTEL_physMask_MSR(reg),~(size - 1) | 0x800,0);
-       }
-    MTRR_endUpdate(&c);
-}
-
-/****************************************************************************
-REMARKS:
-Disabled banked write combing for Intel processors. We always disable this
-because it invariably causes problems with older hardware.
-****************************************************************************/
-static void INTEL_disableBankedWriteCombine(void)
-{
-    MTRRContext c;
-
-    MTRR_beginUpdate(&c);
-    _MTRR_writeMSR(INTEL_fix16K_A0000_MSR,0,0);
-    MTRR_endUpdate(&c);
-}
-
-/****************************************************************************
-PARAMETERS:
-reg     - MTRR register to set
-base    - The starting physical base address of the region
-size    - The size in bytes of the region
-type    - Type to place into the MTRR register
-
-REMARKS:
-Intel specific function to set the value of a specific MTRR register to
-the passed in base, size and type.
-****************************************************************************/
-static void AMD_getMTRR(
-    uint reg,
-    ulong *base,
-    ulong *size,
-    int *type)
-{
-    ulong   low,high;
-
-    /*  Upper dword is region 1, lower is region 0  */
-    _MTRR_readMSR(0xC0000085, &low, &high);
-    if (reg == 1)
-       low = high;
-
-    /* Find the base and type for the region */
-    *base = low & 0xFFFE0000;
-    *type = 0;
-    if (low & 1)
-       *type = PM_MTRR_UNCACHABLE;
-    if (low & 2)
-       *type = PM_MTRR_WRCOMB;
-    if ((low & 3) == 0) {
-       *size = 0;
-       return;
-       }
-
-    /* This needs a little explaining. The size is stored as an
-     * inverted mask of bits of 128K granularity 15 bits long offset
-     * 2 bits
-     *
-     * So to get a size we do invert the mask and add 1 to the lowest
-     * mask bit (4 as its 2 bits in). This gives us a size we then shift
-     * to turn into 128K blocks
-     *
-     *  eg              111 1111 1111 1100      is 512K
-     *
-     *  invert          000 0000 0000 0011
-     *  +1              000 0000 0000 0100
-     *  *128K   ...
-     */
-    low = (~low) & 0x0FFFC;
-    *size = (low + 4) << 15;
-}
-
-/****************************************************************************
-PARAMETERS:
-reg     - MTRR register to set
-base    - The starting physical base address of the region
-size    - The size in bytes of the region
-type    - Type to place into the MTRR register
-
-REMARKS:
-Intel specific function to set the value of a specific MTRR register to
-the passed in base, size and type.
-****************************************************************************/
-static void AMD_setMTRR(
-    uint reg,
-    ulong base,
-    ulong size,
-    int type)
-{
-    ulong       low,high,newVal;
-    MTRRContext c;
-
-    MTRR_beginUpdate(&c);
-    _MTRR_readMSR(0xC0000085, &low, &high);
-    if (size == 0) {
-       /* Clear register to disable */
-       if (reg)
-           high = 0;
-       else
-           low = 0;
-       }
-    else {
-       /* Set the register to the base (already shifted for us), the
-        * type (off by one) and an inverted bitmask of the size
-        * The size is the only odd bit. We are fed say 512K
-        * We invert this and we get 111 1111 1111 1011 but
-        * if you subtract one and invert you get the desired
-        * 111 1111 1111 1100 mask
-        */
-       newVal = (((~(size-1)) >> 15) & 0x0001FFFC) | base | (type+1);
-       if (reg)
-           high = newVal;
-       else
-           low = newVal;
-       }
-
-    /* The writeback rule is quite specific. See the manual. Its
-     * disable local interrupts, write back the cache, set the MTRR
-     */
-    PM_flushTLB();
-    _MTRR_writeMSR(0xC0000085, low, high);
-    MTRR_endUpdate(&c);
-}
-
-/****************************************************************************
-PARAMETERS:
-reg     - MTRR register to set
-base    - The starting physical base address of the region
-size    - The size in bytes of the region
-type    - Type to place into the MTRR register
-
-REMARKS:
-Intel specific function to set the value of a specific MTRR register to
-the passed in base, size and type.
-****************************************************************************/
-static void CYRIX_getMTRR(
-    uint reg,
-    ulong *base,
-    ulong *size,
-    int *type)
-{
-    MTRRContext c;
-    uchar       arr = CX86_ARR_BASE + reg*3;
-    uchar       rcr,shift;
-
-    /* Save flags and disable interrupts */
-    MTRR_beginUpdate(&c);
-    ((uchar*)base)[3]  = _MTRR_getCx86(arr);
-    ((uchar*)base)[2]  = _MTRR_getCx86((uchar)(arr+1));
-    ((uchar*)base)[1]  = _MTRR_getCx86((uchar)(arr+2));
-    rcr = _MTRR_getCx86((uchar)(CX86_RCR_BASE + reg));
-    MTRR_endUpdate(&c);
-
-    /* Enable interrupts if it was enabled previously */
-    shift = ((uchar*)base)[1] & 0x0f;
-    *base &= 0xFFFFF000UL;
-
-    /* Power of two, at least 4K on ARR0-ARR6, 256K on ARR7
-     * Note: shift==0xF means 4G, this is unsupported.
-     */
-    if (shift)
-       *size = (reg < 7 ? 0x800UL : 0x20000UL) << shift;
-    else
-       *size = 0;
-
-    /* Bit 0 is Cache Enable on ARR7, Cache Disable on ARR0-ARR6 */
-    if (reg < 7) {
-       switch (rcr) {
-           case  1: *type = PM_MTRR_UNCACHABLE; break;
-           case  8: *type = PM_MTRR_WRBACK;     break;
-           case  9: *type = PM_MTRR_WRCOMB;     break;
-           case 24:
-           default: *type = PM_MTRR_WRTHROUGH;  break;
-           }
-       }
-    else {
-       switch (rcr) {
-           case  0: *type = PM_MTRR_UNCACHABLE; break;
-           case  8: *type = PM_MTRR_WRCOMB;     break;
-           case  9: *type = PM_MTRR_WRBACK;     break;
-           case 25:
-           default: *type = PM_MTRR_WRTHROUGH;  break;
-           }
-       }
-}
-
-/****************************************************************************
-PARAMETERS:
-reg     - MTRR register to set
-base    - The starting physical base address of the region
-size    - The size in bytes of the region
-type    - Type to place into the MTRR register
-
-REMARKS:
-Intel specific function to set the value of a specific MTRR register to
-the passed in base, size and type.
-****************************************************************************/
-static void CYRIX_setMTRR(
-    uint reg,
-    ulong base,
-    ulong size,
-    int type)
-{
-    MTRRContext c;
-    uchar       arr = CX86_ARR_BASE + reg*3;
-    uchar       arr_type,arr_size;
-
-    /* Count down from 32M (ARR0-ARR6) or from 2G (ARR7) */
-    size >>= (reg < 7 ? 12 : 18);
-    size &= 0x7FFF; /* Make sure arr_size <= 14 */
-    for (arr_size = 0; size; arr_size++, size >>= 1)
-       ;
-    if (reg < 7) {
-       switch (type) {
-           case PM_MTRR_UNCACHABLE:    arr_type =  1; break;
-           case PM_MTRR_WRCOMB:        arr_type =  9; break;
-           case PM_MTRR_WRTHROUGH:     arr_type = 24; break;
-           default:                    arr_type =  8; break;
-           }
-       }
-    else {
-       switch (type) {
-           case PM_MTRR_UNCACHABLE:    arr_type =  0; break;
-           case PM_MTRR_WRCOMB:        arr_type =  8; break;
-           case PM_MTRR_WRTHROUGH:     arr_type = 25; break;
-           default:                    arr_type =  9; break;
-           }
-       }
-    MTRR_beginUpdate(&c);
-    _MTRR_setCx86((uchar)arr,     ((uchar*)&base)[3]);
-    _MTRR_setCx86((uchar)(arr+1), ((uchar*)&base)[2]);
-    _MTRR_setCx86((uchar)(arr+2), (uchar)((((uchar*)&base)[1]) | arr_size));
-    _MTRR_setCx86((uchar)(CX86_RCR_BASE + reg), (uchar)arr_type);
-    MTRR_endUpdate(&c);
-}
-
-/****************************************************************************
-REMARKS:
-On Cyrix 6x86(MX) and MII the ARR3 is special: it has connection
-with the SMM (System Management Mode) mode. So we need the following:
-Check whether SMI_LOCK (CCR3 bit 0) is set
-  if it is set, ARR3 cannot be changed  (it cannot be changed until the
-    next processor reset)
-  if it is reset, then we can change it, set all the needed bits:
-   - disable access to SMM memory through ARR3 range (CCR1 bit 7 reset)
-   - disable access to SMM memory (CCR1 bit 2 reset)
-   - disable SMM mode (CCR1 bit 1 reset)
-   - disable write protection of ARR3 (CCR6 bit 1 reset)
-   - (maybe) disable ARR3
-Just to be sure, we enable ARR usage by the processor (CCR5 bit 5 set)
-****************************************************************************/
-static void CYRIX_initARR(void)
-{
-    MTRRContext c;
-    uchar       ccr[7];
-    int         ccrc[7] = { 0, 0, 0, 0, 0, 0, 0 };
-
-    /* Begin updating */
-    MTRR_beginUpdate(&c);
-
-    /* Save all CCRs locally */
-    ccr[0] = _MTRR_getCx86(CX86_CCR0);
-    ccr[1] = _MTRR_getCx86(CX86_CCR1);
-    ccr[2] = _MTRR_getCx86(CX86_CCR2);
-    ccr[3] = (uchar)c.ccr3;
-    ccr[4] = _MTRR_getCx86(CX86_CCR4);
-    ccr[5] = _MTRR_getCx86(CX86_CCR5);
-    ccr[6] = _MTRR_getCx86(CX86_CCR6);
-    if (ccr[3] & 1)
-       ccrc[3] = 1;
-    else {
-       /* Disable SMM mode (bit 1), access to SMM memory (bit 2) and
-        * access to SMM memory through ARR3 (bit 7).
-        */
-       if (ccr[6] & 0x02) {
-           ccr[6] &= 0xFD;
-           ccrc[6] = 1;        /* Disable write protection of ARR3. */
-           _MTRR_setCx86(CX86_CCR6,ccr[6]);
-           }
-       }
-
-    /* If we changed CCR1 in memory, change it in the processor, too. */
-    if (ccrc[1])
-       _MTRR_setCx86(CX86_CCR1,ccr[1]);
-
-    /* Enable ARR usage by the processor */
-    if (!(ccr[5] & 0x20)) {
-       ccr[5] |= 0x20;
-       ccrc[5] = 1;
-       _MTRR_setCx86(CX86_CCR5,ccr[5]);
-       }
-
-    /* We are finished updating */
-    MTRR_endUpdate(&c);
-}
-
-/****************************************************************************
-REMARKS:
-Initialise the MTRR module, by detecting the processor type and determining
-if the processor supports the MTRR functionality.
-****************************************************************************/
-void MTRR_init(void)
-{
-    int     i,cpu,ltype;
-    ulong   eax,edx,lbase,lsize;
-
-    /* Check that we have a compatible CPU */
-    if (numMTRR == -1) {
-       numMTRR = 0;
-       if (!_MTRR_isRing0())
-           return;
-       cpu = CPU_getProcessorType();
-       cpuFamily = cpu & CPU_familyMask;
-       cpuType = cpu & CPU_mask;
-       cpuStepping = (cpu & CPU_steppingMask) >> CPU_steppingShift;
-       switch (cpuFamily) {
-           case CPU_Intel:
-               /* Intel Pentium Pro and later support the MTRR registers */
-               if (cpuType < CPU_PentiumPro)
-                   return;
-               _MTRR_readMSR(INTEL_cap_MSR,&eax,&edx);
-               numMTRR = eax & 0xFF;
-               getMTRR = INTEL_getMTRR;
-               setMTRR = INTEL_setMTRR;
-               getFreeRegion = GENERIC_getFreeRegion;
-               INTEL_disableBankedWriteCombine();
-               break;
-           case CPU_AMD:
-               /* AMD K6-2 and later support the MTRR registers */
-               if ((cpuType < CPU_AMDK6_2) || (cpuType == CPU_AMDK6_2 && cpuStepping < 8))
-                   return;
-               if (cpuType < CPU_AMDAthlon) {
-                   numMTRR = 2;        /* AMD CPU's have 2 MTRR's */
-                   getMTRR = AMD_getMTRR;
-                   setMTRR = AMD_setMTRR;
-                   getFreeRegion = AMDK6_getFreeRegion;
-
-                   /* For some reason some IBM systems with K6-2 processors
-                    * have write combined enabled for the system BIOS
-                    * region from 0xE0000 to 0xFFFFFF. We need *both* MTRR's
-                    * for our own graphics drivers, so if we detect any
-                    * regions below the 1Meg boundary, we remove them
-                    * so we can use this MTRR register ourselves.
-                    */
-                   for (i = 0; i < numMTRR; i++) {
-                       getMTRR(i,&lbase,&lsize,&ltype);
-                       if (lbase < 0x100000)
-                           setMTRR(i,0,0,0);
-                       }
-                   }
-               else {
-                   /* AMD Athlon uses P6 style MTRR's */
-                   _MTRR_readMSR(INTEL_cap_MSR,&eax,&edx);
-                   numMTRR = eax & 0xFF;
-                   getMTRR = INTEL_getMTRR;
-                   setMTRR = INTEL_setMTRR;
-                   getFreeRegion = GENERIC_getFreeRegion;
-                   INTEL_disableBankedWriteCombine();
-                   }
-               break;
-           case CPU_Cyrix:
-               /* Cyrix 6x86 and later support the MTRR registers */
-               if (cpuType < CPU_Cyrix6x86 || cpuType >= CPU_CyrixMediaGX)
-                   return;
-               numMTRR = 8;        /* Cyrix CPU's have 8 ARR's */
-               getMTRR = CYRIX_getMTRR;
-               setMTRR = CYRIX_setMTRR;
-               getFreeRegion = CYRIX_getFreeRegion;
-               CYRIX_initARR();
-               break;
-           default:
-               return;
-           }
-       }
-}
-
-/****************************************************************************
-PARAMETERS:
-base    - The starting physical base address of the region
-size    - The size in bytes of the region
-type    - Type to place into the MTRR register
-
-RETURNS:
-Error code describing the result.
-
-REMARKS:
-Function to enable write combining for the specified region of memory.
-****************************************************************************/
-int MTRR_enableWriteCombine(
-    ulong base,
-    ulong size,
-    uint type)
-{
-    int     i;
-    int     ltype;
-    ulong   lbase,lsize,last;
-
-    /* Check that we have a CPU that supports MTRR's and type is valid */
-    if (numMTRR <= 0) {
-       if (!_MTRR_isRing0())
-           return PM_MTRR_ERR_NO_OS_SUPPORT;
-       return PM_MTRR_NOT_SUPPORTED;
-       }
-    if (type >= PM_MTRR_MAX)
-       return PM_MTRR_ERR_PARAMS;
-
-    /* If the type is WC, check that this processor supports it */
-    if (!MTRR_haveWriteCombine())
-       return PM_MTRR_ERR_NOWRCOMB;
-
-    /* Adjust the boundaries depending on the CPU type */
-    switch (cpuFamily) {
-       case CPU_AMD:
-           if (cpuType < CPU_AMDAthlon) {
-               /* Apply the K6 block alignment and size rules. In order:
-                *  o Uncached or gathering only
-                *  o 128K or bigger block
-                *  o Power of 2 block
-                *  o base suitably aligned to the power
-                */
-               if (type > PM_MTRR_WRCOMB && (size < (1 << 17) || (size & ~(size-1))-size || (base & (size-1))))
-                   return PM_MTRR_ERR_NOT_ALIGNED;
-               break;
-               }
-           /* Fall through for AMD Athlon which uses P6 style MTRR's */
-       case CPU_Intel:
-       case CPU_Cyrix:
-           if ((base & 0xFFF) || (size & 0xFFF)) {
-               /* Base and size must be multiples of 4Kb */
-               return PM_MTRR_ERR_NOT_4KB_ALIGNED;
-               }
-           if (base < 0x100000) {
-               /* Base must be >= 1Mb */
-               return PM_MTRR_ERR_BELOW_1MB;
-               }
-
-           /* Check upper bits of base and last are equal and lower bits
-            * are 0 for base and 1 for last
-            */
-           last = base + size - 1;
-           for (lbase = base; !(lbase & 1) && (last & 1); lbase = lbase >> 1, last = last >> 1)
-               ;
-           if (lbase != last) {
-               /* Base is not aligned on the correct boundary */
-               return PM_MTRR_ERR_NOT_ALIGNED;
-               }
-           break;
-       default:
-           return PM_MTRR_NOT_SUPPORTED;
-       }
-
-    /* Search for existing MTRR */
-    for (i = 0; i < numMTRR; ++i) {
-       getMTRR(i,&lbase,&lsize,&ltype);
-       if (lbase == 0 && lsize == 0)
-           continue;
-       if (base > lbase + (lsize-1))
-           continue;
-       if ((base < lbase) && (base+size-1 < lbase))
-           continue;
-
-       /* Check that we don't overlap an existing region */
-       if (type != PM_MTRR_UNCACHABLE) {
-           if ((base < lbase) || (base+size-1 > lbase+lsize-1))
-               return PM_MTRR_ERR_OVERLAP;
-           }
-       else if (base == lbase && size == lsize) {
-           /* The region already exists so leave it alone */
-           return PM_MTRR_ERR_OK;
-           }
-
-       /* New region is enclosed by an existing region, so only allow
-        * a new type to be created if we are setting a region to be
-        * uncacheable (such as MMIO registers within a framebuffer).
-        */
-       if (ltype != (int)type) {
-           if (type == PM_MTRR_UNCACHABLE)
-               continue;
-           return PM_MTRR_ERR_TYPE_MISMATCH;
-           }
-       return PM_MTRR_ERR_OK;
-       }
-
-    /* Search for an empty MTRR */
-    if ((i = getFreeRegion(base,size)) < 0)
-       return PM_MTRR_ERR_NONE_FREE;
-    setMTRR(i,base,size,type);
-    return PM_MTRR_ERR_OK;
-}
-
-/****************************************************************************
-PARAMETERS:
-callback    - Function to callback with write combine information
-
-REMARKS:
-Function to enumerate all write combine regions currently enabled for the
-processor.
-****************************************************************************/
-int PMAPI PM_enumWriteCombine(
-    PM_enumWriteCombine_t callback)
-{
-    int     i,ltype;
-    ulong   lbase,lsize;
-
-    /* Check that we have a CPU that supports MTRR's and type is valid */
-    if (numMTRR <= 0) {
-       if (!_MTRR_isRing0())
-           return PM_MTRR_ERR_NO_OS_SUPPORT;
-       return PM_MTRR_NOT_SUPPORTED;
-       }
-
-    /* Enumerate all existing MTRR's */
-    for (i = 0; i < numMTRR; ++i) {
-       getMTRR(i,&lbase,&lsize,&ltype);
-       callback(lbase,lsize,ltype);
-       }
-    return PM_MTRR_ERR_OK;
-}
-#endif
diff --git a/board/MAI/bios_emulator/scitech/src/pm/common/pcilib.c b/board/MAI/bios_emulator/scitech/src/pm/common/pcilib.c
deleted file mode 100644 (file)
index 1d542fc..0000000
+++ /dev/null
@@ -1,747 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Any
-*
-* Description:  Module for interfacing to the PCI bus and configuration
-*               space registers.
-*
-****************************************************************************/
-
-#include "pmapi.h"
-#include "pcilib.h"
-#if !defined(__WIN32_VXD__) && !defined(__NT_DRIVER__)
-#include <string.h>
-#endif
-
-/*---------------------- Macros and type definitions ----------------------*/
-
-#pragma pack(1)
-
-/* Length of the memory mapping for the PCI BIOS */
-
-#define BIOS_LIMIT          (128 * 1024L - 1)
-
-/* Macros for accessing the PCI BIOS functions from 32-bit protected mode */
-
-#define BIOS32_SIGNATURE    (((ulong)'_' << 0) + ((ulong)'3' << 8) + ((ulong)'2' << 16) + ((ulong)'_' << 24))
-#define PCI_SIGNATURE       (((ulong)'P' << 0) + ((ulong)'C' << 8) + ((ulong)'I' << 16) + ((ulong)' ' << 24))
-#define PCI_SERVICE         (((ulong)'$' << 0) + ((ulong)'P' << 8) + ((ulong)'C' << 16) + ((ulong)'I' << 24))
-#define PCI_BIOS_PRESENT    0xB101
-#define FIND_PCI_DEVICE     0xB102
-#define FIND_PCI_CLASS      0xB103
-#define GENERATE_SPECIAL    0xB106
-#define READ_CONFIG_BYTE    0xB108
-#define READ_CONFIG_WORD    0xB109
-#define READ_CONFIG_DWORD   0xB10A
-#define WRITE_CONFIG_BYTE   0xB10B
-#define WRITE_CONFIG_WORD   0xB10C
-#define WRITE_CONFIG_DWORD  0xB10D
-#define GET_IRQ_ROUTING_OPT 0xB10E
-#define SET_PCI_IRQ         0xB10F
-
-/* This is the standard structure used to identify the entry point to the
- * BIOS32 Service Directory, as documented in PCI 2.1 BIOS Specicition.
- */
-
-typedef union {
-    struct {
-       ulong signature;        /* _32_                                 */
-       ulong entry;            /* 32 bit physical address              */
-       uchar revision;         /* Revision level, 0                    */
-       uchar length;           /* Length in paragraphs should be 01    */
-       uchar checksum;         /* All bytes must add up to zero        */
-       uchar reserved[5];      /* Must be zero                         */
-       } fields;
-    char chars[16];
-    } PCI_bios32;
-
-/* Structure for a far pointer to call the PCI BIOS services with */
-
-typedef struct {
-    ulong   address;
-    ushort  segment;
-    } PCIBIOS_entry;
-
-/* Macros to copy a structure that includes dwSize members */
-
-#define COPY_STRUCTURE(d,s) memcpy(d,s,MIN((s)->dwSize,(d)->dwSize))
-
-#pragma pack()
-
-/*--------------------------- Global variables ----------------------------*/
-
-static uchar            *BIOSImage = NULL;  /* BIOS image mapping       */
-static int              PCIBIOSVersion = -1;/* PCI BIOS version         */
-static PCIBIOS_entry    PCIEntry;           /* PCI services entry point */
-static ulong            PCIPhysEntry = 0;   /* Physical address         */
-
-/*----------------------------- Implementation ----------------------------*/
-
-/* External assembler helper functions */
-
-uchar   _ASMAPI _BIOS32_service(ulong service,ulong function,ulong *physBase,ulong *length,ulong *serviceOffset,PCIBIOS_entry entry);
-ushort  _ASMAPI _PCIBIOS_isPresent(ulong i_eax,ulong *o_edx,ushort *o_ax,uchar *o_cl,PCIBIOS_entry entry);
-ulong   _ASMAPI _PCIBIOS_service(ulong r_eax,ulong r_ebx,ulong r_edi,ulong r_ecx,PCIBIOS_entry entry);
-int     _ASMAPI _PCIBIOS_getRouting(PCIRoutingOptionsBuffer *buf,PCIBIOS_entry entry);
-ibool   _ASMAPI _PCIBIOS_setIRQ(int busDev,int intPin,int IRQ,PCIBIOS_entry entry);
-ulong   _ASMAPI _PCIBIOS_specialCycle(int bus,ulong data,PCIBIOS_entry entry);
-ushort  _ASMAPI _PCI_getCS(void);
-
-/****************************************************************************
-REMARKS:
-This functions returns the physical address of the PCI BIOS entry point.
-****************************************************************************/
-ulong _ASMAPI PCIBIOS_getEntry(void)
-{ return PCIPhysEntry; }
-
-/****************************************************************************
-PARAMETERS:
-hwType  - Place to store the PCI hardware access mechanism flags
-lastBus - Place to store the index of the last PCI bus in the system
-
-RETURNS:
-Version number of the PCI BIOS found.
-
-REMARKS:
-This function determines if the PCI BIOS is present in the system, and if
-so returns the information returned by the PCI BIOS detect function.
-****************************************************************************/
-static int PCIBIOS_detect(
-    uchar *hwType,
-    uchar *lastBus)
-{
-    ulong   signature;
-    ushort  stat,version;
-
-#ifndef __16BIT__
-    PCIBIOS_entry   BIOSEntry = {0};
-    uchar           *BIOSEnd;
-    PCI_bios32      *BIOSDir;
-    ulong           physBase,length,offset;
-
-    /* Bail if we have already detected no BIOS is present */
-    if (PCIBIOSVersion == 0)
-       return 0;
-
-    /* First scan the memory from 0xE0000 to 0xFFFFF looking for the
-     * BIOS32 service directory, so we can determine if we can call it
-     * from 32-bit protected mode.
-     */
-    if (PCIBIOSVersion == -1) {
-       PCIBIOSVersion = 0;
-       BIOSImage = PM_mapPhysicalAddr(0xE0000,BIOS_LIMIT,false);
-       if (!BIOSImage)
-           return 0;
-       BIOSEnd = BIOSImage + 0x20000;
-       for (BIOSDir = (PCI_bios32*)BIOSImage; BIOSDir < (PCI_bios32*)BIOSEnd; BIOSDir++) {
-           uchar   sum;
-           int     i,length;
-
-           if (BIOSDir->fields.signature != BIOS32_SIGNATURE)
-               continue;
-           length = BIOSDir->fields.length * 16;
-           if (!length)
-               continue;
-           for (sum = i = 0; i < length ; i++)
-               sum += BIOSDir->chars[i];
-           if (sum != 0)
-               continue;
-           BIOSEntry.address = (ulong)BIOSImage + (BIOSDir->fields.entry - 0xE0000);
-           BIOSEntry.segment = _PCI_getCS();
-           break;
-           }
-
-       /* If we found the BIOS32 directory, call it to get the address of the
-        * PCI services.
-        */
-       if (BIOSEntry.address == 0)
-           return 0;
-       if (_BIOS32_service(PCI_SERVICE,0,&physBase,&length,&offset,BIOSEntry) != 0)
-           return 0;
-       PCIPhysEntry = physBase + offset;
-       PCIEntry.address = (ulong)BIOSImage + (PCIPhysEntry - 0xE0000);
-       PCIEntry.segment = _PCI_getCS();
-       }
-#endif
-    /* We found the BIOS entry, so now do the version check */
-    version = _PCIBIOS_isPresent(PCI_BIOS_PRESENT,&signature,&stat,lastBus,PCIEntry);
-    if (version > 0 && ((stat >> 8) == 0) && signature == PCI_SIGNATURE) {
-       *hwType = stat & 0xFF;
-       return PCIBIOSVersion = version;
-       }
-    return 0;
-}
-
-/****************************************************************************
-PARAMETERS:
-info    - Array of PCIDeviceInfo structures to check against
-index   - Index of the current device to check
-
-RETURNS:
-True if the device is a duplicate, false if not.
-
-REMARKS:
-This function goes through the list of all devices preceeding the newly
-found device in the info structure, and checks that the device is not a
-duplicate of a previous device. Some devices incorrectly enumerate
-themselves at different function addresses so we check here to exclude
-those cases.
-****************************************************************************/
-static ibool CheckDuplicate(
-    PCIDeviceInfo *info,
-    PCIDeviceInfo *prev)
-{
-    /* Ignore devices with a vendor ID of 0 */
-    if (info->VendorID == 0)
-       return true;
-
-    /* NOTE: We only check against the current device on
-     *       the bus to ensure that we do not exclude
-     *       multiple controllers of the same device ID.
-     */
-    if (info->slot.p.Bus == prev->slot.p.Bus &&
-       info->slot.p.Device == prev->slot.p.Device &&
-       info->DeviceID == prev->DeviceID)
-       return true;
-    return false;
-}
-
-/****************************************************************************
-PARAMETERS:
-info        - Array of PCIDeviceInfo structures to fill in
-maxDevices  - Maximum number of of devices to enumerate into array
-
-RETURNS:
-Number of PCI devices found and enumerated on the PCI bus, 0 if not PCI.
-
-REMARKS:
-Function to enumerate all available devices on the PCI bus into an array
-of configuration information blocks.
-****************************************************************************/
-static int PCI_enumerateMech1(
-    PCIDeviceInfo info[])
-{
-    int             bus,device,function,i,numFound = 0;
-    ulong           *lp,tmp;
-    PCIslot         slot = {{0,0,0,0,0,0,1}};
-    PCIDeviceInfo   pci,prev = {0};
-
-    /* Try PCI access mechanism 1 */
-    PM_outpb(0xCFB,0x01);
-    tmp = PM_inpd(0xCF8);
-    PM_outpd(0xCF8,slot.i);
-    if ((PM_inpd(0xCF8) == slot.i) && (PM_inpd(0xCFC) != 0xFFFFFFFFUL)) {
-       /* PCI access mechanism 1 - the preferred mechanism */
-       for (bus = 0; bus < 8; bus++) {
-           slot.p.Bus = bus;
-           for (device = 0; device < 32; device++) {
-               slot.p.Device = device;
-               for (function = 0; function < 8; function++) {
-                   slot.p.Function = function;
-                   slot.p.Register = 0;
-                   PM_outpd(0xCF8,slot.i);
-                   if (PM_inpd(0xCFC) != 0xFFFFFFFFUL) {
-                       memset(&pci,0,sizeof(pci));
-                       pci.dwSize = sizeof(pci);
-                       pci.mech1 = 1;
-                       pci.slot = slot;
-                       lp = (ulong*)&(pci.VendorID);
-                       for (i = 0; i < NUM_PCI_REG; i++, lp++) {
-                           slot.p.Register = i;
-                           PM_outpd(0xCF8,slot.i);
-                           *lp = PM_inpd(0xCFC);
-                           }
-                       if (!CheckDuplicate(&pci,&prev)) {
-                           if (info)
-                               COPY_STRUCTURE(&info[numFound],&pci);
-                           ++numFound;
-                           }
-                       prev = pci;
-                       }
-                   }
-               }
-           }
-
-       /* Disable PCI config cycle on exit */
-       PM_outpd(0xCF8,0);
-       return numFound;
-       }
-    PM_outpd(0xCF8,tmp);
-
-    /* No hardware access mechanism 1 found */
-    return 0;
-}
-
-/****************************************************************************
-PARAMETERS:
-info        - Array of PCIDeviceInfo structures to fill in
-maxDevices  - Maximum number of of devices to enumerate into array
-
-RETURNS:
-Number of PCI devices found and enumerated on the PCI bus, 0 if not PCI.
-
-REMARKS:
-Function to enumerate all available devices on the PCI bus into an array
-of configuration information blocks.
-****************************************************************************/
-static int PCI_enumerateMech2(
-    PCIDeviceInfo info[])
-{
-    int             bus,device,function,i,numFound = 0;
-    ushort          deviceIO;
-    ulong           *lp;
-    PCIslot         slot = {{0,0,0,0,0,0,1}};
-    PCIDeviceInfo   pci,prev = {0};
-
-    /* Try PCI access mechanism 2 */
-    PM_outpb(0xCFB,0x00);
-    PM_outpb(0xCF8,0x00);
-    PM_outpb(0xCFA,0x00);
-    if (PM_inpb(0xCF8) == 0x00 && PM_inpb(0xCFB) == 0x00) {
-       /* PCI access mechanism 2 - the older mechanism for legacy busses */
-       for (bus = 0; bus < 2; bus++) {
-           slot.p.Bus = bus;
-           PM_outpb(0xCFA,(uchar)bus);
-           for (device = 0; device < 16; device++) {
-               slot.p.Device = device;
-               deviceIO = 0xC000 + (device << 8);
-               for (function = 0; function < 8; function++) {
-                   slot.p.Function = function;
-                   slot.p.Register = 0;
-                   PM_outpb(0xCF8,(uchar)((function << 1) | 0x10));
-                   if (PM_inpd(deviceIO) != 0xFFFFFFFFUL) {
-                       memset(&pci,0,sizeof(pci));
-                       pci.dwSize = sizeof(pci);
-                       pci.mech1 = 0;
-                       pci.slot = slot;
-                       lp = (ulong*)&(pci.VendorID);
-                       for (i = 0; i < NUM_PCI_REG; i++, lp++) {
-                           slot.p.Register = i;
-                           *lp = PM_inpd(deviceIO + (i << 2));
-                           }
-                       if (!CheckDuplicate(&pci,&prev)) {
-                           if (info)
-                               COPY_STRUCTURE(&info[numFound],&pci);
-                           ++numFound;
-                           }
-                       prev = pci;
-                       }
-                   }
-               }
-           }
-
-       /* Disable PCI config cycle on exit */
-       PM_outpb(0xCF8,0);
-       return numFound;
-       }
-
-    /* No hardware access mechanism 2 found */
-    return 0;
-}
-
-/****************************************************************************
-REMARKS:
-This functions reads a configuration dword via the PCI BIOS.
-****************************************************************************/
-static ulong PCIBIOS_readDWORD(
-    int index,
-    ulong slot)
-{
-    return (ulong)_PCIBIOS_service(READ_CONFIG_DWORD,slot >> 8,index,0,PCIEntry);
-}
-
-/****************************************************************************
-PARAMETERS:
-info        - Array of PCIDeviceInfo structures to fill in
-maxDevices  - Maximum number of of devices to enumerate into array
-
-RETURNS:
-Number of PCI devices found and enumerated on the PCI bus, 0 if not PCI.
-
-REMARKS:
-Function to enumerate all available devices on the PCI bus into an array
-of configuration information blocks.
-****************************************************************************/
-static int PCI_enumerateBIOS(
-    PCIDeviceInfo info[])
-{
-    uchar           hwType,lastBus;
-    int             bus,device,function,i,numFound = 0;
-    ulong           *lp;
-    PCIslot         slot = {{0,0,0,0,0,0,1}};
-    PCIDeviceInfo   pci,prev = {0};
-
-    if (PCIBIOS_detect(&hwType,&lastBus)) {
-       /* PCI BIOS access - the ultimate fallback */
-       for (bus = 0; bus <= lastBus; bus++) {
-           slot.p.Bus = bus;
-           for (device = 0; device < 32; device++) {
-               slot.p.Device = device;
-               for (function = 0; function < 8; function++) {
-                   slot.p.Function = function;
-                   if (PCIBIOS_readDWORD(0,slot.i) != 0xFFFFFFFFUL) {
-                       memset(&pci,0,sizeof(pci));
-                       pci.dwSize = sizeof(pci);
-                       pci.mech1 = 2;
-                       pci.slot = slot;
-                       lp = (ulong*)&(pci.VendorID);
-                       for (i = 0; i < NUM_PCI_REG; i++, lp++)
-                           *lp = PCIBIOS_readDWORD(i << 2,slot.i);
-                       if (!CheckDuplicate(&pci,&prev)) {
-                           if (info)
-                               COPY_STRUCTURE(&info[numFound],&pci);
-                           ++numFound;
-                           }
-                       prev = pci;
-                       }
-                   }
-               }
-           }
-       }
-
-    /* Return number of devices found */
-    return numFound;
-}
-
-/****************************************************************************
-PARAMETERS:
-info        - Array of PCIDeviceInfo structures to fill in
-maxDevices  - Maximum number of of devices to enumerate into array
-
-RETURNS:
-Number of PCI devices found and enumerated on the PCI bus, 0 if not PCI.
-
-REMARKS:
-Function to enumerate all available devices on the PCI bus into an array
-of configuration information blocks.
-****************************************************************************/
-int _ASMAPI PCI_enumerate(
-    PCIDeviceInfo info[])
-{
-    int numFound;
-
-    /* First try via the direct access mechanisms which are faster if we
-     * have them (nearly always). The BIOS is used as a fallback, and for
-     * stuff we can't do directly.
-     */
-    if ((numFound = PCI_enumerateMech1(info)) == 0) {
-       if ((numFound = PCI_enumerateMech2(info)) == 0) {
-           if ((numFound = PCI_enumerateBIOS(info)) == 0)
-               return 0;
-           }
-       }
-    return numFound;
-}
-
-/****************************************************************************
-PARAMETERS:
-info        - Array of PCIDeviceInfo structures to fill in
-maxDevices  - Maximum number of of devices to enumerate into array
-
-RETURNS:
-Number of PCI devices found and enumerated on the PCI bus, 0 if not PCI.
-
-REMARKS:
-Function to enumerate all available devices on the PCI bus into an array
-of configuration information blocks.
-****************************************************************************/
-int _ASMAPI PCI_getNumDevices(void)
-{
-    return PCI_enumerate(NULL);
-}
-
-/****************************************************************************
-PARAMETERS:
-bar - Base address to measure
-pci - PCI device to access
-
-RETURNS:
-Size of the PCI base address in bytes
-
-REMARKS:
-This function measures the size of the PCI base address register in bytes,
-by writing all F's to the register, and reading the value back. The size
-of the base address is determines by the bits that are hardwired to zero's.
-****************************************************************************/
-ulong _ASMAPI PCI_findBARSize(
-    int bar,
-    PCIDeviceInfo *pci)
-{
-    ulong   base,size = 0;
-
-    base = PCI_accessReg(bar,0,PCI_READ_DWORD,pci);
-    if (base && !(base & 0x1)) {
-       /* For some strange reason some devices don't properly decode
-        * their base address registers (Intel PCI/PCI bridges!), and
-        * we read completely bogus values. We check for that here
-        * and clear out those BAR's.
-        *
-        * We check for that here because at least the low 12 bits
-        * of the address range must be zeros, since the page size
-        * on IA32 processors is always 4Kb.
-        */
-       if ((base & 0xFFF) == 0) {
-           PCI_accessReg(bar,0xFFFFFFFF,PCI_WRITE_DWORD,pci);
-           size = PCI_accessReg(bar,0,PCI_READ_DWORD,pci) & ~0xFF;
-           size = ~size+1;
-           PCI_accessReg(bar,base,PCI_WRITE_DWORD,pci);
-           }
-       }
-    pci->slot.p.Register = 0;
-    return size;
-}
-
-/****************************************************************************
-PARAMETERS:
-index   - DWORD index of the register to access
-value   - Value to write to the register for write access
-func    - Function to implement
-
-RETURNS:
-The value read from the register for read operations
-
-REMARKS:
-The function code are defined as follows
-
-code    - function
-0       - Read BYTE
-1       - Read WORD
-2       - Read DWORD
-3       - Write BYTE
-4       - Write WORD
-5       - Write DWORD
-****************************************************************************/
-ulong _ASMAPI PCI_accessReg(
-    int index,
-    ulong value,
-    int func,
-    PCIDeviceInfo *info)
-{
-    int iobase;
-
-    if (info->mech1 == 2) {
-       /* Use PCI BIOS access since we dont have direct hardware access */
-       switch (func) {
-           case PCI_READ_BYTE:
-               return (uchar)_PCIBIOS_service(READ_CONFIG_BYTE,info->slot.i >> 8,index,0,PCIEntry);
-           case PCI_READ_WORD:
-               return (ushort)_PCIBIOS_service(READ_CONFIG_WORD,info->slot.i >> 8,index,0,PCIEntry);
-           case PCI_READ_DWORD:
-               return (ulong)_PCIBIOS_service(READ_CONFIG_DWORD,info->slot.i >> 8,index,0,PCIEntry);
-           case PCI_WRITE_BYTE:
-               _PCIBIOS_service(WRITE_CONFIG_BYTE,info->slot.i >> 8,index,value,PCIEntry);
-               break;
-           case PCI_WRITE_WORD:
-               _PCIBIOS_service(WRITE_CONFIG_WORD,info->slot.i >> 8,index,value,PCIEntry);
-               break;
-           case PCI_WRITE_DWORD:
-               _PCIBIOS_service(WRITE_CONFIG_DWORD,info->slot.i >> 8,index,value,PCIEntry);
-               break;
-           }
-       }
-    else {
-       /* Use direct hardware access mechanisms */
-       if (info->mech1) {
-           /* PCI access mechanism 1 */
-           iobase = 0xCFC + (index & 3);
-           info->slot.p.Register = index >> 2;
-           PM_outpd(0xCF8,info->slot.i);
-           }
-       else {
-           /* PCI access mechanism 2 */
-           PM_outpb(0xCF8,(uchar)((info->slot.p.Function << 1) | 0x10));
-           PM_outpb(0xCFA,(uchar)info->slot.p.Bus);
-           iobase = 0xC000 + (info->slot.p.Device << 8) + index;
-           }
-       switch (func) {
-           case PCI_READ_BYTE:
-           case PCI_READ_WORD:
-           case PCI_READ_DWORD:    value = PM_inpd(iobase);        break;
-           case PCI_WRITE_BYTE:    PM_outpb(iobase,(uchar)value);  break;
-           case PCI_WRITE_WORD:    PM_outpw(iobase,(ushort)value); break;
-           case PCI_WRITE_DWORD:   PM_outpd(iobase,(ulong)value);  break;
-           }
-       PM_outpd(0xCF8,0);
-       }
-    return value;
-}
-
-/****************************************************************************
-PARAMETERS:
-numDevices  - Number of devices to query info for
-
-RETURNS:
-0 on success, -1 on error, number of devices to enumerate if numDevices = 0
-
-REMARKS:
-This function reads the PCI routing information. If you pass a value of
-0 for numDevices, this function will return with the number of devices
-needed in the routing buffer that will be filled in by the BIOS.
-****************************************************************************/
-ibool _ASMAPI PCI_getIRQRoutingOptions(
-    int numDevices,
-    PCIRouteInfo *buffer)
-{
-    PCIRoutingOptionsBuffer buf;
-    int                     ret;
-
-    if (PCIPhysEntry) {
-       buf.BufferSize = numDevices * sizeof(PCIRouteInfo);
-       buf.DataBuffer = buffer;
-       if ((ret = _PCIBIOS_getRouting(&buf,PCIEntry)) == 0x89)
-           return buf.BufferSize / sizeof(PCIRouteInfo);
-       if (ret != 0)
-           return -1;
-       return 0;
-       }
-
-    /* We currently only support this via the PCI BIOS functions */
-    return -1;
-}
-
-/****************************************************************************
-PARAMETERS:
-info    - PCI device information for the specified device
-intPin  - Value to store in the PCI InterruptPin register
-IRQ     - New ISA IRQ to map the PCI interrupt to (0-15)
-
-RETURNS:
-True on success, or false if this function failed.
-
-REMARKS:
-This function changes the PCI IRQ routing for the specified device to the
-desired PCI interrupt and the desired ISA bus compatible IRQ. This function
-may not be supported by the PCI BIOS, in which case this function will
-fail.
-****************************************************************************/
-ibool _ASMAPI PCI_setHardwareIRQ(
-    PCIDeviceInfo *info,
-    uint intPin,
-    uint IRQ)
-{
-    if (PCIPhysEntry) {
-       if (_PCIBIOS_setIRQ(info->slot.i >> 8,intPin,IRQ,PCIEntry)) {
-           info->u.type0.InterruptPin = intPin;
-           info->u.type0.InterruptLine = IRQ;
-           return true;
-           }
-       return false;
-       }
-
-    /* We currently only support this via the PCI BIOS functions */
-    return false;
-}
-
-/****************************************************************************
-PARAMETERS:
-bus                 - Bus number to generate the special cycle for
-specialCycleData    - Data to send for the special cyle
-
-REMARKS:
-This function generates a special cycle on the specified bus using with
-the specified data.
-****************************************************************************/
-void _ASMAPI PCI_generateSpecialCyle(
-    uint bus,
-    ulong specialCycleData)
-{
-    if (PCIPhysEntry)
-       _PCIBIOS_specialCycle(bus,specialCycleData,PCIEntry);
-    /* We currently only support this via the PCI BIOS functions */
-}
-
-/****************************************************************************
-PARAMETERS:
-info    - PCI device information block for device to access
-index   - Index of register to start reading from
-dst     - Place to store the values read from configuration space
-count   - Count of bytes to read from configuration space
-
-REMARKS:
-This function is used to read a block of PCI configuration space registers
-from the configuration space into the passed in data block. This function
-will properly handle reading non-DWORD aligned data from the configuration
-space correctly.
-****************************************************************************/
-void _ASMAPI PCI_readRegBlock(
-    PCIDeviceInfo *info,
-    int index,
-    void *dst,
-    int count)
-{
-    uchar   *pb;
-    ulong   *pd;
-    int     i;
-    int     startCount = (index & 3);
-    int     middleCount = (count - startCount) >> 2;
-    int     endCount = count - middleCount * 4 - startCount;
-
-    for (i = 0,pb = dst; i < startCount; i++, index++) {
-       *pb++ = (uchar)PCI_accessReg(index,0,PCI_READ_BYTE,info);
-       }
-    for (i = 0,pd = (ulong*)pb; i < middleCount; i++, index += 4) {
-       *pd++ = (ulong)PCI_accessReg(index,0,PCI_READ_DWORD,info);
-       }
-    for (i = 0,pb = (uchar*)pd; i < endCount; i++, index++) {
-       *pb++ = (uchar)PCI_accessReg(index,0,PCI_READ_BYTE,info);
-       }
-}
-
-/****************************************************************************
-PARAMETERS:
-info    - PCI device information block for device to access
-index   - Index of register to start reading from
-dst     - Place to store the values read from configuration space
-count   - Count of bytes to read from configuration space
-
-REMARKS:
-This function is used to write a block of PCI configuration space registers
-to the configuration space from the passed in data block. This function
-will properly handle writing non-DWORD aligned data to the configuration
-space correctly.
-****************************************************************************/
-void _ASMAPI PCI_writeRegBlock(
-    PCIDeviceInfo *info,
-    int index,
-    void *src,
-    int count)
-{
-    uchar   *pb;
-    ulong   *pd;
-    int     i;
-    int     startCount = (index & 3);
-    int     middleCount = (count - startCount) >> 2;
-    int     endCount = count - middleCount * 4 - startCount;
-
-    for (i = 0,pb = src; i < startCount; i++, index++) {
-       PCI_accessReg(index,*pb++,PCI_WRITE_BYTE,info);
-       }
-    for (i = 0,pd = (ulong*)pb; i < middleCount; i++, index += 4) {
-       PCI_accessReg(index,*pd++,PCI_WRITE_DWORD,info);
-       }
-    for (i = 0,pb = (uchar*)pd; i < endCount; i++, index++) {
-       PCI_accessReg(index,*pb++,PCI_WRITE_BYTE,info);
-       }
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/common/unixio.c b/board/MAI/bios_emulator/scitech/src/pm/common/unixio.c
deleted file mode 100644 (file)
index c3a66a7..0000000
+++ /dev/null
@@ -1,306 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Any
-*
-* Description:  Module containing Unix I/O functions.
-*
-****************************************************************************/
-
-#include "pmapi.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <dirent.h>
-
-/*----------------------------- Implementation ----------------------------*/
-
-/* {secret} */
-typedef struct {
-    DIR     *d;
-    char    path[PM_MAX_PATH];
-    char    mask[PM_MAX_PATH];
-    } PM_findHandle;
-
-/****************************************************************************
-REMARKS:
-Internal function to convert the find data to the generic interface.
-****************************************************************************/
-static void convertFindData(
-    PM_findData *findData,
-    struct dirent *blk,
-    const char *path)
-{
-    ulong       dwSize = findData->dwSize;
-    struct stat st;
-    char        filename[PM_MAX_PATH];
-
-    memset(findData,0,findData->dwSize);
-    findData->dwSize = dwSize;
-    strcpy(filename,path);
-    PM_backslash(filename);
-    strcat(filename,blk->d_name);
-    stat(filename,&st);
-    if (!(st.st_mode & S_IWRITE))
-       findData->attrib |= PM_FILE_READONLY;
-    if (st.st_mode & S_IFDIR)
-       findData->attrib |= PM_FILE_DIRECTORY;
-    findData->sizeLo = st.st_size;
-    findData->sizeHi = 0;
-    strncpy(findData->name,blk->d_name,PM_MAX_PATH);
-    findData->name[PM_MAX_PATH-1] = 0;
-}
-
-/****************************************************************************
-REMARKS:
-Determines if a file name matches the passed in pattern.
-****************************************************************************/
-static ibool filematch(
-    char *pattern,
-    char *dirpath,
-    struct dirent *dire)
-{
-    struct stat st;
-    int         i = 0,j = 0,lastchar = '\0';
-    char        fullpath[PM_MAX_PATH];
-
-    strcpy(fullpath,dirpath);
-    PM_backslash(fullpath);
-    strcat(fullpath, dire->d_name);
-    if (stat(fullpath, &st) != 0)
-       return false;
-    for (; i < (int)strlen(dire->d_name) && j < (int)strlen(pattern); i++, j++) {
-       if (pattern[j] == '*' && lastchar != '\\') {
-           if (pattern[j+1] == '\0')
-               return true;
-           while (dire->d_name[i++] != pattern[j+1]) {
-               if (dire->d_name[i] == '\0')
-                   return false;
-               }
-           i -= 2;
-           }
-       else if (dire->d_name[i] != pattern[j] &&
-               !(pattern[j] == '?' && lastchar != '\\'))
-           return false;
-       lastchar = pattern[i];
-       }
-    if (j == (int)strlen(pattern) && i == (int)strlen(dire->d_name))
-       return true;
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-Function to find the first file matching a search criteria in a directory.
-****************************************************************************/
-void * PMAPI PM_findFirstFile(
-    const char *filename,
-    PM_findData *findData)
-{
-    PM_findHandle   *d;
-    struct dirent   *dire;
-    char            name[PM_MAX_PATH];
-    char            ext[PM_MAX_PATH];
-
-    if ((d = PM_malloc(sizeof(*d))) == NULL)
-       return PM_FILE_INVALID;
-    PM_splitpath(filename,NULL,d->path,name,ext);
-    strcpy(d->mask,name);
-    strcat(d->mask,ext);
-    if (strlen(d->path) == 0)
-       strcpy(d->path, ".");
-    if (d->path[strlen(d->path)-1] == '/')
-       d->path[strlen(d->path)-1] = 0;
-    if ((d->d = opendir(d->path)) != NULL) {
-       while ((dire = readdir(d->d)) != NULL) {
-           if (filematch(d->mask,d->path,dire)) {
-               convertFindData(findData,dire,d->path);
-               return d;
-               }
-           }
-       closedir(d->d);
-       }
-    PM_free(d);
-    return PM_FILE_INVALID;
-}
-
-/****************************************************************************
-REMARKS:
-Function to find the next file matching a search criteria in a directory.
-****************************************************************************/
-ibool PMAPI PM_findNextFile(
-    void *handle,
-    PM_findData *findData)
-{
-    PM_findHandle   *d = handle;
-    struct dirent   *dire;
-
-    while ((dire = readdir(d->d)) != NULL) {
-       if (filematch(d->mask,d->path,dire)) {
-           convertFindData(findData,dire,d->path);
-           return true;
-           }
-       }
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-Function to close the find process
-****************************************************************************/
-void PMAPI PM_findClose(
-    void *handle)
-{
-    PM_findHandle   *d = handle;
-
-    closedir(d->d);
-    free(d);
-}
-
-/****************************************************************************
-REMARKS:
-Function to determine if a drive is a valid drive or not. Under Unix this
-function will return false for anything except a value of 3 (considered
-the root drive, and equivalent to C: for non-Unix systems). The drive
-numbering is:
-
-    1   - Drive A:
-    2   - Drive B:
-    3   - Drive C:
-    etc
-
-****************************************************************************/
-ibool PMAPI PM_driveValid(
-    char drive)
-{
-    if (drive == 3)
-       return true;
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-Function to get the current working directory for the specififed drive.
-Under Unix this will always return the current working directory regardless
-of what the value of 'drive' is.
-****************************************************************************/
-void PMAPI PM_getdcwd(
-    int drive,
-    char *dir,
-    int len)
-{
-    (void)drive;
-    getcwd(dir,len);
-}
-
-/****************************************************************************
-REMARKS:
-Function to change the file attributes for a specific file.
-****************************************************************************/
-void PMAPI PM_setFileAttr(
-    const char *filename,
-    uint attrib)
-{
-    struct stat st;
-    mode_t      mode;
-
-    stat(filename,&st);
-    mode = st.st_mode;
-    if (attrib & PM_FILE_READONLY)
-       mode &= ~S_IWRITE;
-    else
-       mode |= S_IWRITE;
-    chmod(filename,mode);
-}
-
-/****************************************************************************
-REMARKS:
-Function to get the file attributes for a specific file.
-****************************************************************************/
-uint PMAPI PM_getFileAttr(
-    const char *filename)
-{
-    struct stat st;
-
-    stat(filename,&st);
-    if (st.st_mode & S_IWRITE)
-       return 0;
-    return PM_FILE_READONLY;
-}
-
-/****************************************************************************
-REMARKS:
-Function to create a directory.
-****************************************************************************/
-ibool PMAPI PM_mkdir(
-    const char *filename)
-{
-    return mkdir(filename,0x1FF) == 0;
-}
-
-/****************************************************************************
-REMARKS:
-Function to remove a directory.
-****************************************************************************/
-ibool PMAPI PM_rmdir(
-    const char *filename)
-{
-    return rmdir(filename) == 0;
-}
-
-/****************************************************************************
-REMARKS:
-Function to get the file time and date for a specific file.
-****************************************************************************/
-ibool PMAPI PM_getFileTime(
-    const char *filename,
-    ibool gmTime,
-    PM_time *time)
-{
-    /* TODO: Implement this! */
-    (void)filename;
-    (void)gmTime;
-    (void)time;
-    PM_fatalError("PM_getFileTime not implemented yet!");
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-Function to set the file time and date for a specific file.
-****************************************************************************/
-ibool PMAPI PM_setFileTime(
-    const char *filename,
-    ibool gmTime,
-    PM_time *time)
-{
-    /* TODO: Implement this! */
-    (void)filename;
-    (void)gmTime;
-    (void)time;
-    PM_fatalError("PM_setFileTime not implemented yet!");
-    return false;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/common/vgastate.c b/board/MAI/bios_emulator/scitech/src/pm/common/vgastate.c
deleted file mode 100644 (file)
index 8056e9a..0000000
+++ /dev/null
@@ -1,377 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-*                   Portions copyright (C) Josh Vanderhoof
-*
-* Language:     ANSI C
-* Environment:  Any
-*
-* Description:  Functions to save and restore the VGA hardware state.
-*
-****************************************************************************/
-
-#include "pmapi.h"
-#if defined(__WIN32_VXD__) || defined(__NT_DRIVER__)
-#include "sdd/sddhelp.h"
-#else
-#include <string.h>
-#endif
-
-/*--------------------------- Global variables ----------------------------*/
-
-/* VGA index register ports */
-#define CRT_I   0x3D4       /* CRT Controller Index                     */
-#define ATT_IW  0x3C0       /* Attribute Controller Index & Data        */
-#define GRA_I   0x3CE       /* Graphics Controller Index                */
-#define SEQ_I   0x3C4       /* Sequencer Index                          */
-
-/* VGA data register ports */
-#define CRT_D   0x3D5       /* CRT Controller Data Register             */
-#define ATT_R   0x3C1       /* Attribute Controller Data Read Register  */
-#define GRA_D   0x3CF       /* Graphics Controller Data Register        */
-#define SEQ_D   0x3C5       /* Sequencer Data Register                  */
-#define MIS_R   0x3CC       /* Misc Output Read Register                */
-#define MIS_W   0x3C2       /* Misc Output Write Register               */
-#define IS1_R   0x3DA       /* Input Status Register 1                  */
-#define PEL_IW  0x3C8       /* PEL Write Index                          */
-#define PEL_IR  0x3C7       /* PEL Read Index                           */
-#define PEL_D   0x3C9       /* PEL Data Register                        */
-
-/* standard VGA indexes max counts */
-#define CRT_C   24          /* 24  CRT Controller Registers             */
-#define ATT_C   21          /* 21  Attribute Controller Registers       */
-#define GRA_C   9           /* 9   Graphics Controller Registers        */
-#define SEQ_C   5           /* 5   Sequencer Registers                  */
-#define MIS_C   1           /* 1   Misc Output Register                 */
-#define PAL_C   768         /* 768 Palette Registers                    */
-#define FONT_C  8192        /* Total size of character generator RAM    */
-
-/* VGA registers saving indexes */
-#define CRT     0           /* CRT Controller Registers start           */
-#define ATT     (CRT+CRT_C) /* Attribute Controller Registers start     */
-#define GRA     (ATT+ATT_C) /* Graphics Controller Registers start      */
-#define SEQ     (GRA+GRA_C) /* Sequencer Registers                      */
-#define MIS     (SEQ+SEQ_C) /* General Registers                        */
-#define PAL     (MIS+MIS_C) /* VGA Palette Registers                    */
-#define FONT    (PAL+PAL_C) /* VGA font data                            */
-
-/* Macros for port I/O with arguments reversed */
-
-#define _port_out(v,p)  PM_outpb(p,(uchar)(v))
-#define _port_in(p)     PM_inpb(p)
-
-/*----------------------------- Implementation ----------------------------*/
-
-/****************************************************************************
-REMARKS:
-Returns the size of the VGA state buffer.
-****************************************************************************/
-int PMAPI PM_getVGAStateSize(void)
-{
-    return CRT_C + ATT_C + GRA_C + SEQ_C + MIS_C + PAL_C + FONT_C;
-}
-
-/****************************************************************************
-REMARKS:
-Delay for a short period of time.
-****************************************************************************/
-static void vga_delay(void)
-{
-    int i;
-
-    /* For the loop here we program the POST register. The length of this
-     * delay is dependant only on ISA bus speed, but it is enough for
-     * what we need.
-     */
-    for (i = 0; i <= 10; i++)
-       PM_outpb(0x80, 0);
-}
-
-/****************************************************************************
-PARAMETERS:
-port    - I/O port to read value from
-index   - Port index to read
-
-RETURNS:
-Byte read from 'port' register 'index'.
-****************************************************************************/
-static ushort vga_rdinx(
-    ushort port,
-    ushort index)
-{
-    PM_outpb(port,(uchar)index);
-    return PM_inpb(port+1);
-}
-
-/****************************************************************************
-PARAMETERS:
-port    - I/O port to write to
-index   - Port index to write
-value   - Byte to write to port
-
-REMARKS:
-Writes a byte value to the 'port' register 'index'.
-****************************************************************************/
-static void vga_wrinx(
-    ushort port,
-    ushort index,
-    ushort value)
-{
-    PM_outpb(port,(uchar)index);
-    PM_outpb(port+1,(uchar)value);
-}
-
-/****************************************************************************
-REMARKS:
-Save the color palette values
-****************************************************************************/
-static void vga_savepalette(
-    uchar *pal)
-{
-    int i;
-
-    _port_out(0, PEL_IR);
-    for (i = 0; i < 768; i++) {
-       vga_delay();
-       *pal++ = _port_in(PEL_D);
-       }
-}
-
-/****************************************************************************
-REMARKS:
-Restore the color palette values
-****************************************************************************/
-static void vga_restorepalette(
-    const uchar *pal)
-{
-    int i;
-
-    /* restore saved palette */
-    _port_out(0, PEL_IW);
-    for (i = 0; i < 768; i++) {
-       vga_delay();
-       _port_out(*pal++, PEL_D);
-       }
-}
-
-/****************************************************************************
-REMARKS:
-Read the font data from the VGA character generator RAM
-****************************************************************************/
-static void vga_saveFont(
-    uchar *data)
-{
-    uchar   *A0000Ptr = PM_getA0000Pointer();
-    uchar   save[7];
-
-    /* Enable access to character generator RAM */
-    save[0] = (uchar)vga_rdinx(SEQ_I,0x00);
-    save[1] = (uchar)vga_rdinx(SEQ_I,0x02);
-    save[2] = (uchar)vga_rdinx(SEQ_I,0x04);
-    save[3] = (uchar)vga_rdinx(SEQ_I,0x00);
-    save[4] = (uchar)vga_rdinx(GRA_I,0x04);
-    save[5] = (uchar)vga_rdinx(GRA_I,0x05);
-    save[6] = (uchar)vga_rdinx(GRA_I,0x06);
-    vga_wrinx(SEQ_I,0x00,0x01);
-    vga_wrinx(SEQ_I,0x02,0x04);
-    vga_wrinx(SEQ_I,0x04,0x07);
-    vga_wrinx(SEQ_I,0x00,0x03);
-    vga_wrinx(GRA_I,0x04,0x02);
-    vga_wrinx(GRA_I,0x05,0x00);
-    vga_wrinx(GRA_I,0x06,0x00);
-
-    /* Copy character generator RAM */
-    memcpy(data,A0000Ptr,FONT_C);
-
-    /* Restore VGA state */
-    vga_wrinx(SEQ_I,0x00,save[0]);
-    vga_wrinx(SEQ_I,0x02,save[1]);
-    vga_wrinx(SEQ_I,0x04,save[2]);
-    vga_wrinx(SEQ_I,0x00,save[3]);
-    vga_wrinx(GRA_I,0x04,save[4]);
-    vga_wrinx(GRA_I,0x05,save[5]);
-    vga_wrinx(GRA_I,0x06,save[6]);
-}
-
-/****************************************************************************
-REMARKS:
-Downloads the font data to the VGA character generator RAM
-****************************************************************************/
-static void vga_restoreFont(
-    const uchar *data)
-{
-    uchar   *A0000Ptr = PM_getA0000Pointer();
-
-    /* Enable access to character generator RAM */
-    vga_wrinx(SEQ_I,0x00,0x01);
-    vga_wrinx(SEQ_I,0x02,0x04);
-    vga_wrinx(SEQ_I,0x04,0x07);
-    vga_wrinx(SEQ_I,0x00,0x03);
-    vga_wrinx(GRA_I,0x04,0x02);
-    vga_wrinx(GRA_I,0x05,0x00);
-    vga_wrinx(GRA_I,0x06,0x00);
-
-    /* Copy font back to character generator RAM */
-    memcpy(A0000Ptr,data,FONT_C);
-}
-
-/****************************************************************************
-REMARKS:
-Save the state of all VGA compatible registers
-****************************************************************************/
-void PMAPI PM_saveVGAState(
-    void *stateBuf)
-{
-    uchar   *regs = stateBuf;
-    int     i;
-
-    /* Save state of VGA registers */
-    for (i = 0; i < CRT_C; i++) {
-       _port_out(i, CRT_I);
-       regs[CRT + i] = _port_in(CRT_D);
-       }
-    for (i = 0; i < ATT_C; i++) {
-       _port_in(IS1_R);
-       vga_delay();
-       _port_out(i, ATT_IW);
-       vga_delay();
-       regs[ATT + i] = _port_in(ATT_R);
-       vga_delay();
-       }
-    for (i = 0; i < GRA_C; i++) {
-       _port_out(i, GRA_I);
-       regs[GRA + i] = _port_in(GRA_D);
-       }
-    for (i = 0; i < SEQ_C; i++) {
-       _port_out(i, SEQ_I);
-       regs[SEQ + i] = _port_in(SEQ_D);
-       }
-    regs[MIS] = _port_in(MIS_R);
-
-    /* Save the VGA palette values */
-    vga_savepalette(&regs[PAL]);
-
-    /* Save the VGA character generator RAM */
-    vga_saveFont(&regs[FONT]);
-
-    /* Turn the VGA display back on */
-    PM_vgaUnblankDisplay();
-}
-
-/****************************************************************************
-REMARKS:
-Retore the state of all VGA compatible registers
-****************************************************************************/
-void PMAPI PM_restoreVGAState(
-    const void *stateBuf)
-{
-    const uchar *regs = stateBuf;
-    int         i;
-
-    /* Blank the display before we start the restore */
-    PM_vgaBlankDisplay();
-
-    /* Restore the VGA character generator RAM */
-    vga_restoreFont(&regs[FONT]);
-
-    /* Restore the VGA palette values */
-    vga_restorepalette(&regs[PAL]);
-
-    /* Restore the state of the VGA compatible registers */
-    _port_out(regs[MIS], MIS_W);
-
-    /* Delay to allow clock change to settle */
-    for (i = 0; i < 10; i++)
-       vga_delay();
-
-    /* Synchronous reset on */
-    _port_out(0x00,SEQ_I);
-    _port_out(0x01,SEQ_D);
-
-    /* Write seqeuencer registers */
-    _port_out(1, SEQ_I);
-    _port_out(regs[SEQ + 1] | 0x20, SEQ_D);
-    for (i = 2; i < SEQ_C; i++) {
-       _port_out(i, SEQ_I);
-       _port_out(regs[SEQ + i], SEQ_D);
-       }
-
-    /* Synchronous reset off */
-    _port_out(0x00,SEQ_I);
-    _port_out(0x03,SEQ_D);
-
-    /* Deprotect CRT registers 0-7 and write CRTC */
-    _port_out(0x11, CRT_I);
-    _port_out(_port_in(CRT_D) & 0x7F, CRT_D);
-    for (i = 0; i < CRT_C; i++) {
-       _port_out(i, CRT_I);
-       _port_out(regs[CRT + i], CRT_D);
-       }
-    for (i = 0; i < GRA_C; i++) {
-       _port_out(i, GRA_I);
-       _port_out(regs[GRA + i], GRA_D);
-       }
-    for (i = 0; i < ATT_C; i++) {
-       _port_in(IS1_R);        /* reset flip-flop */
-       vga_delay();
-       _port_out(i, ATT_IW);
-       vga_delay();
-       _port_out(regs[ATT + i], ATT_IW);
-       vga_delay();
-       }
-
-    /* Ensure the VGA screen is turned on */
-    PM_vgaUnblankDisplay();
-}
-
-/****************************************************************************
-REMARKS:
-Disables the VGA display for screen output making it blank.
-****************************************************************************/
-void PMAPI PM_vgaBlankDisplay(void)
-{
-    /* Turn screen off */
-    _port_out(0x01, SEQ_I);
-    _port_out(_port_in(SEQ_D) | 0x20, SEQ_D);
-
-    /* Disable video output */
-    _port_in(IS1_R);
-    vga_delay();
-     _port_out(0x00, ATT_IW);
-}
-
-/****************************************************************************
-REMARKS:
-Enables the VGA display for screen output.
-****************************************************************************/
-void PMAPI PM_vgaUnblankDisplay(void)
-{
-    /* Turn screen back on */
-    _port_out(0x01, SEQ_I);
-    _port_out(_port_in(SEQ_D) & 0xDF, SEQ_D);
-
-    /* Enable video output */
-    _port_in(IS1_R);
-    vga_delay();
-    _port_out(0x20, ATT_IW);
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/cpuinfo.c b/board/MAI/bios_emulator/scitech/src/pm/cpuinfo.c
deleted file mode 100644 (file)
index ac62e81..0000000
+++ /dev/null
@@ -1,808 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Any
-*
-* Description:  Main module to implement the Zen Timer support functions.
-*
-****************************************************************************/
-
-#include "ztimer.h"
-#include "pmapi.h"
-#include "oshdr.h"
-#if !defined(__WIN32_VXD__) && !defined(__OS2_VDD__) && !defined(__NT_DRIVER__)
-#include <stdio.h>
-#include <string.h>
-#endif
-
-/*----------------------------- Implementation ----------------------------*/
-
-/* External Intel assembler functions */
-#ifdef  __INTEL__
-/* {secret} */
-ibool   _ASMAPI _CPU_haveCPUID(void);
-/* {secret} */
-ibool   _ASMAPI _CPU_check80386(void);
-/* {secret} */
-ibool   _ASMAPI _CPU_check80486(void);
-/* {secret} */
-uint    _ASMAPI _CPU_checkCPUID(void);
-/* {secret} */
-uint    _ASMAPI _CPU_getCPUIDModel(void);
-/* {secret} */
-uint    _ASMAPI _CPU_getCPUIDStepping(void);
-/* {secret} */
-uint    _ASMAPI _CPU_getCPUIDFeatures(void);
-/* {secret} */
-uint    _ASMAPI _CPU_getCacheSize(void);
-/* {secret} */
-uint    _ASMAPI _CPU_have3DNow(void);
-/* {secret} */
-ibool   _ASMAPI _CPU_checkClone(void);
-/* {secret} */
-void    _ASMAPI _CPU_readTimeStamp(CPU_largeInteger *time);
-/* {secret} */
-void    _ASMAPI _CPU_runBSFLoop(ulong iterations);
-/* {secret} */
-ulong   _ASMAPI _CPU_mulDiv(ulong a,ulong b,ulong c);
-/* {secret} */
-void ZTimerQuickInit(void);
-#define CPU_HaveMMX     0x00800000
-#define CPU_HaveRDTSC   0x00000010
-#define CPU_HaveSSE     0x02000000
-#endif
-
-#if     defined(__SMX32__)
-#include "smx/cpuinfo.c"
-#elif   defined(__RTTARGET__)
-#include "rttarget/cpuinfo.c"
-#elif   defined(__REALDOS__)
-#include "dos/cpuinfo.c"
-#elif   defined(__NT_DRIVER__)
-#include "ntdrv/cpuinfo.c"
-#elif   defined(__WIN32_VXD__)
-#include "vxd/cpuinfo.c"
-#elif   defined(__WINDOWS32__)
-#include "win32/cpuinfo.c"
-#elif   defined(__OS2_VDD__)
-#include "vdd/cpuinfo.c"
-#elif   defined(__OS2__)
-#include "os2/cpuinfo.c"
-#elif   defined(__LINUX__)
-#include "linux/cpuinfo.c"
-#elif   defined(__QNX__)
-#include "qnx/cpuinfo.c"
-#elif   defined(__BEOS__)
-#include "beos/cpuinfo.c"
-#else
-#error  CPU library not ported to this platform yet!
-#endif
-
-/*------------------------ Public interface routines ----------------------*/
-
-/****************************************************************************
-REMARKS:
-Read an I/O port location.
-****************************************************************************/
-static uchar rdinx(
-    int port,
-    int index)
-{
-    PM_outpb(port,(uchar)index);
-    return PM_inpb(port+1);
-}
-
-/****************************************************************************
-REMARKS:
-Write an I/O port location.
-****************************************************************************/
-static void wrinx(
-    ushort port,
-    ushort index,
-    ushort value)
-{
-    PM_outpb(port,(uchar)index);
-    PM_outpb(port+1,(uchar)value);
-}
-
-/****************************************************************************
-REMARKS:
-Enables the Cyrix CPUID instruction to properly detect MediaGX and 6x86
-processors.
-****************************************************************************/
-static void _CPU_enableCyrixCPUID(void)
-{
-    uchar   ccr3;
-
-    PM_init();
-    ccr3 = rdinx(0x22,0xC3);
-    wrinx(0x22,0xC3,(uchar)(ccr3 | 0x10));
-    wrinx(0x22,0xE8,(uchar)(rdinx(0x22,0xE8) | 0x80));
-    wrinx(0x22,0xC3,ccr3);
-}
-
-/****************************************************************************
-DESCRIPTION:
-Returns the type of processor in the system.
-
-HEADER:
-ztimer.h
-
-RETURNS:
-Numerical identifier for the installed processor
-
-REMARKS:
-Returns the type of processor in the system. Note that if the CPU is an
-unknown Pentium family processor that we don't have an enumeration for,
-the return value will be greater than or equal to the value of CPU_UnkPentium
-(depending on the value returned by the CPUID instruction).
-
-SEE ALSO:
-CPU_getProcessorSpeed, CPU_haveMMX, CPU_getProcessorName
-****************************************************************************/
-uint ZAPI CPU_getProcessorType(void)
-{
-#if     defined(__INTEL__)
-    uint            cpu,vendor,model,cacheSize;
-    static ibool    firstTime = true;
-
-    if (_CPU_haveCPUID()) {
-       cpu = _CPU_checkCPUID();
-       vendor = cpu & ~CPU_mask;
-       if (vendor == CPU_Intel) {
-           /* Check for Intel processors */
-           switch (cpu & CPU_mask) {
-               case 4: cpu = CPU_i486;         break;
-               case 5: cpu = CPU_Pentium;      break;
-               case 6:
-                   if ((model = _CPU_getCPUIDModel()) == 1)
-                       cpu = CPU_PentiumPro;
-                   else if (model <= 6) {
-                       cacheSize = _CPU_getCacheSize();
-                       if ((model == 5 && cacheSize == 0) ||
-                           (model == 5 && cacheSize == 256) ||
-                           (model == 6 && cacheSize == 128))
-                           cpu = CPU_Celeron;
-                       else
-                           cpu = CPU_PentiumII;
-                       }
-                   else if (model >= 7) {
-                       /* Model 7 == Pentium III */
-                       /* Model 8 == Celeron/Pentium III Coppermine */
-                       cacheSize = _CPU_getCacheSize();
-                       if ((model == 8 && cacheSize == 128))
-                           cpu = CPU_Celeron;
-                       else
-                           cpu = CPU_PentiumIII;
-                       }
-                   break;
-               default:
-                   cpu = CPU_UnkIntel;
-               }
-           }
-       else if (vendor == CPU_Cyrix) {
-           /* Check for Cyrix processors */
-           switch (cpu & CPU_mask) {
-               case 4:
-                   if ((model = _CPU_getCPUIDModel()) == 4)
-                       cpu = CPU_CyrixMediaGX;
-                   else
-                       cpu = CPU_UnkCyrix;
-                   break;
-               case 5:
-                   if ((model = _CPU_getCPUIDModel()) == 2)
-                       cpu = CPU_Cyrix6x86;
-                   else if (model == 4)
-                       cpu = CPU_CyrixMediaGXm;
-                   else
-                       cpu = CPU_UnkCyrix;
-                   break;
-               case 6:
-                   if ((model = _CPU_getCPUIDModel()) <= 1)
-                       cpu = CPU_Cyrix6x86MX;
-                   else
-                       cpu = CPU_UnkCyrix;
-                   break;
-               default:
-                   cpu = CPU_UnkCyrix;
-               }
-           }
-       else if (vendor == CPU_AMD) {
-           /* Check for AMD processors */
-           switch (cpu & CPU_mask) {
-               case 4:
-                   if ((model = _CPU_getCPUIDModel()) == 0)
-                       cpu = CPU_AMDAm5x86;
-                   else
-                       cpu = CPU_AMDAm486;
-                   break;
-               case 5:
-                   if ((model = _CPU_getCPUIDModel()) <= 3)
-                       cpu = CPU_AMDK5;
-                   else if (model <= 7)
-                       cpu = CPU_AMDK6;
-                   else if (model == 8)
-                       cpu = CPU_AMDK6_2;
-                   else if (model == 9)
-                       cpu = CPU_AMDK6_III;
-                   else if (model == 13) {
-                       if (_CPU_getCPUIDStepping() <= 3)
-                           cpu = CPU_AMDK6_IIIplus;
-                       else
-                           cpu = CPU_AMDK6_2plus;
-                       }
-                   else
-                       cpu = CPU_UnkAMD;
-                   break;
-               case 6:
-                   if ((model = _CPU_getCPUIDModel()) == 3)
-                       cpu = CPU_AMDDuron;
-                   else
-                       cpu = CPU_AMDAthlon;
-                   break;
-               default:
-                   cpu = CPU_UnkAMD;
-               }
-           }
-       else if (vendor == CPU_IDT) {
-           /* Check for IDT WinChip processors */
-           switch (cpu & CPU_mask) {
-               case 5:
-                   if ((model = _CPU_getCPUIDModel()) <= 4)
-                       cpu = CPU_WinChipC6;
-                   else if (model == 8)
-                       cpu = CPU_WinChip2;
-                   else
-                       cpu = CPU_UnkIDT;
-                   break;
-               default:
-                   cpu = CPU_UnkIDT;
-               }
-           }
-       else {
-           /* Assume a Pentium compatible Intel clone */
-           cpu = CPU_Pentium;
-           }
-       return cpu | vendor | (_CPU_getCPUIDStepping() << CPU_steppingShift);
-       }
-    else {
-       if (_CPU_check80386())
-           cpu = CPU_i386;
-       else  if (_CPU_check80486()) {
-           /* If we get here we may have a Cyrix processor so we can try
-            * enabling the CPUID instruction and trying again.
-            */
-           if (firstTime) {
-               firstTime = false;
-               _CPU_enableCyrixCPUID();
-               return CPU_getProcessorType();
-               }
-           cpu = CPU_i486;
-           }
-       else
-           cpu = CPU_Pentium;
-       if (!_CPU_checkClone())
-           return cpu | CPU_Intel;
-       return cpu;
-       }
-#elif   defined(__ALPHA__)
-    return CPU_Alpha;
-#elif   defined(__MIPS__)
-    return CPU_Mips;
-#elif   defined(__PPC__)
-    return CPU_PowerPC;
-#endif
-}
-
-/****************************************************************************
-DESCRIPTION:
-Returns true if the processor supports Intel MMX extensions.
-
-HEADER:
-ztimer.h
-
-RETURNS:
-True if MMX is available, false if not.
-
-REMARKS:
-This function determines if the processor supports the Intel MMX extended
-instruction set.
-
-SEE ALSO:
-CPU_getProcessorType, CPU_getProcessorSpeed, CPU_have3DNow, CPU_haveSSE,
-CPU_getProcessorName
-****************************************************************************/
-ibool ZAPI CPU_haveMMX(void)
-{
-#ifdef  __INTEL__
-    if (_CPU_haveCPUID())
-       return (_CPU_getCPUIDFeatures() & CPU_HaveMMX) != 0;
-    return false;
-#else
-    return false;
-#endif
-}
-
-/****************************************************************************
-DESCRIPTION:
-Returns true if the processor supports AMD 3DNow! extensions.
-
-HEADER:
-ztimer.h
-
-RETURNS:
-True if 3DNow! is available, false if not.
-
-REMARKS:
-This function determines if the processor supports the AMD 3DNow! extended
-instruction set.
-
-SEE ALSO:
-CPU_getProcessorType, CPU_getProcessorSpeed, CPU_haveMMX, CPU_haveSSE,
-CPU_getProcessorName
-****************************************************************************/
-ibool ZAPI CPU_have3DNow(void)
-{
-#ifdef  __INTEL__
-    if (_CPU_haveCPUID())
-       return _CPU_have3DNow();
-    return false;
-#else
-    return false;
-#endif
-}
-
-/****************************************************************************
-DESCRIPTION:
-Returns true if the processor supports Intel KNI extensions.
-
-HEADER:
-ztimer.h
-
-RETURNS:
-True if Intel KNI is available, false if not.
-
-REMARKS:
-This function determines if the processor supports the Intel KNI extended
-instruction set.
-
-SEE ALSO:
-CPU_getProcessorType, CPU_getProcessorSpeed, CPU_haveMMX, CPU_have3DNow,
-CPU_getProcessorName
-****************************************************************************/
-ibool ZAPI CPU_haveSSE(void)
-{
-#ifdef  __INTEL__
-    if (_CPU_haveCPUID())
-       return (_CPU_getCPUIDFeatures() & CPU_HaveSSE) != 0;
-    return false;
-#else
-    return false;
-#endif
-}
-
-/****************************************************************************
-RETURNS:
-True if the RTSC instruction is available, false if not.
-
-REMARKS:
-This function determines if the processor supports the Intel RDTSC
-instruction, for high precision timing. If the processor is not an Intel or
-Intel clone CPU, this function will always return false.
-
-DESCRIPTION:
-Returns true if the processor supports RDTSC extensions.
-
-HEADER:
-ztimer.h
-
-RETURNS:
-True if RTSC is available, false if not.
-
-REMARKS:
-This function determines if the processor supports the RDTSC instruction
-for reading the processor time stamp counter.
-
-SEE ALSO:
-CPU_getProcessorType, CPU_getProcessorSpeed, CPU_haveMMX, CPU_have3DNow,
-CPU_getProcessorName
-****************************************************************************/
-ibool ZAPI CPU_haveRDTSC(void)
-{
-#ifdef  __INTEL__
-    if (_CPU_haveCPUID())
-       return (_CPU_getCPUIDFeatures() & CPU_HaveRDTSC) != 0;
-    return false;
-#else
-    return false;
-#endif
-}
-
-#ifdef  __INTEL__
-
-#define ITERATIONS      16000
-#define SAMPLINGS       2
-#define INNER_LOOPS     400
-
-/****************************************************************************
-REMARKS:
-If processor does not support time stamp reading, but is at least a 386 or
-above, utilize method of timing a loop of BSF instructions which take a
-known number of cycles to run on i386(tm), i486(tm), and Pentium(R)
-processors.
-****************************************************************************/
-static ulong GetBSFCpuSpeed(
-    ulong cycles)
-{
-    CPU_largeInteger t0,t1,count_freq;
-    ulong   ticks;              /* Microseconds elapsed during test     */
-    ulong   current;            /* Variable to store time elapsed       */
-    int     i,j,iPriority;
-    ulong   lowest  = (ulong)-1;
-
-    iPriority = SetMaxThreadPriority();
-    GetCounterFrequency(&count_freq);
-    for (i = 0; i < SAMPLINGS; i++) {
-       GetCounter(&t0);
-       for (j = 0; j < INNER_LOOPS; j++)
-           _CPU_runBSFLoop(ITERATIONS);
-       GetCounter(&t1);
-       current = t1.low - t0.low;
-       if (current < lowest)
-           lowest = current;
-       }
-    RestoreThreadPriority(iPriority);
-
-    /* Compute frequency */
-    ticks = _CPU_mulDiv(lowest,1000000,count_freq.low);
-    if ((ticks % count_freq.low) > (count_freq.low/2))
-       ticks++;            /* Round up if necessary */
-    if (ticks == 0)
-       return 0;
-    return ((cycles*INNER_LOOPS)/ticks);
-}
-
-#define TOLERANCE       1
-
-/****************************************************************************
-REMARKS:
-On processors supporting the Read Time Stamp opcode, compare elapsed
-time on the High-Resolution Counter with elapsed cycles on the Time
-Stamp Register.
-
-The inner loop runs up to 20 times oruntil the average of the previous
-three calculated frequencies is within 1 MHz of each of the individual
-calculated frequencies. This resampling increases the accuracy of the
-results since outside factors could affect this calculation.
-****************************************************************************/
-static ulong GetRDTSCCpuSpeed(
-    ibool accurate)
-{
-    CPU_largeInteger    t0,t1,s0,s1,count_freq;
-    u64                 stamp0, stamp1, ticks0, ticks1;
-    u64                 total_cycles, cycles, hz, freq;
-    u64                 total_ticks, ticks;
-    int                 tries,iPriority;
-    ulong               maxCount;
-
-    PM_set64_32(total_cycles,0);
-    PM_set64_32(total_ticks,0);
-    maxCount = accurate ? 600000 : 30000;
-    iPriority = SetMaxThreadPriority();
-    GetCounterFrequency(&count_freq);
-    PM_set64(freq,count_freq.high,count_freq.low);
-    for (tries = 0; tries < 3; tries++) {
-       /* Loop until 100 ticks have passed since last read of hi-res
-        * counter. This accounts for overhead later.
-        */
-       GetCounter(&t0);
-       t1.low = t0.low;
-       t1.high = t0.high;
-       while ((t1.low - t0.low) < 100) {
-           GetCounter(&t1);
-           _CPU_readTimeStamp(&s0);
-           }
-
-       /* Loop until 30000 ticks have passed since last read of hi-res counter.
-        * This allows for elapsed time for sampling. For a hi-res frequency
-        * of 1MHz, this is about 0.03 of a second. The frequency reported
-        * by the OS dependent code should be tuned to provide a good
-        * sample period depending on the accuracy of the OS timers (ie:
-        * if the accuracy is lower, lower the frequency to spend more time
-        * in the inner loop to get better accuracy).
-        */
-       t0.low = t1.low;
-       t0.high = t1.high;
-       while ((t1.low - t0.low) < maxCount) {
-           GetCounter(&t1);
-           _CPU_readTimeStamp(&s1);
-           }
-
-       /* Find the difference during the timing loop */
-       PM_set64(stamp0,s0.high,s0.low);
-       PM_set64(stamp1,s1.high,s1.low);
-       PM_set64(ticks0,t0.high,t0.low);
-       PM_set64(ticks1,t1.high,t1.low);
-       PM_sub64(cycles,stamp1,stamp0);
-       PM_sub64(ticks,ticks1,ticks0);
-
-       /* Sum up the results */
-       PM_add64(total_ticks,total_ticks,ticks);
-       PM_add64(total_cycles,total_cycles,cycles);
-       }
-    RestoreThreadPriority(iPriority);
-
-    /* Compute frequency in Hz */
-    PM_mul64(hz,total_cycles,freq);
-    PM_div64(hz,hz,total_ticks);
-    return PM_64to32(hz);
-}
-
-#endif  /* __INTEL__ */
-
-/****************************************************************************
-DESCRIPTION:
-Returns the speed of the processor in MHz.
-
-HEADER:
-ztimer.h
-
-PARAMETERS:
-accurate    - True of the speed should be measured accurately
-
-RETURNS:
-Processor speed in MHz.
-
-REMARKS:
-This function returns the speed of the CPU in MHz. Note that if the speed
-cannot be determined, this function will return 0.
-
-If the accurate parameter is set to true, this function will spend longer
-profiling the speed of the CPU, and will not round the CPU speed that is
-reported. This is important for highly accurate timing using the Pentium
-RDTSC instruction, but it does take a lot longer for the profiling to
-produce accurate results.
-
-SEE ALSO:
-CPU_getProcessorSpeedInHz, CPU_getProcessorType, CPU_haveMMX,
-CPU_getProcessorName
-****************************************************************************/
-ulong ZAPI CPU_getProcessorSpeed(
-    ibool accurate)
-{
-#if defined(__INTEL__)
-    /* Number of cycles needed to execute a single BSF instruction on i386+
-     * processors.
-     */
-    ulong   cpuSpeed;
-    uint    i;
-    static  ulong intel_cycles[] = {
-       115,47,43,
-       };
-    static  ulong cyrix_cycles[] = {
-       38,38,52,52,
-       };
-    static  ulong amd_cycles[] = {
-       49,
-       };
-    static  ulong known_speeds[] = {
-       1000,950,900,850,800,750,700,650,600,550,500,450,433,400,350,
-       333,300,266,233,200,166,150,133,120,100,90,75,66,60,50,33,20,0,
-       };
-
-    if (CPU_haveRDTSC()) {
-       cpuSpeed = (GetRDTSCCpuSpeed(accurate) + 500000) / 1000000;
-       }
-    else {
-       int type = CPU_getProcessorType();
-       int processor = type & CPU_mask;
-       int vendor = type & CPU_familyMask;
-       if (vendor == CPU_Intel)
-           cpuSpeed = GetBSFCpuSpeed(ITERATIONS * intel_cycles[processor - CPU_i386]);
-       else if (vendor == CPU_Cyrix)
-           cpuSpeed = GetBSFCpuSpeed(ITERATIONS * cyrix_cycles[processor - CPU_Cyrix6x86]);
-       else if (vendor == CPU_AMD)
-           cpuSpeed = GetBSFCpuSpeed(ITERATIONS * amd_cycles[0]);
-       else
-           return 0;
-       }
-
-    /* Now normalise the results given known processors speeds, if the
-     * speed we measure is within 2MHz of the expected values
-     */
-    if (!accurate) {
-       for (i = 0; known_speeds[i] != 0; i++) {
-           if (cpuSpeed >= (known_speeds[i]-3) && cpuSpeed <= (known_speeds[i]+3)) {
-               return known_speeds[i];
-               }
-           }
-       }
-    return cpuSpeed;
-#else
-    return 0;
-#endif
-}
-
-/****************************************************************************
-DESCRIPTION:
-Returns the speed of the processor in Hz.
-
-HEADER:
-ztimer.h
-
-RETURNS:
-Accurate processor speed in Hz.
-
-REMARKS:
-This function returns the accurate speed of the CPU in Hz. Note that if the
-speed cannot be determined, this function will return 0.
-
-This function is similar to the CPU_getProcessorSpeed function, except that
-it attempts to accurately measure the CPU speed in Hz. This is used
-internally in the Zen Timer libraries to provide accurate real world timing
-information. This is important for highly accurate timing using the Pentium
-RDTSC instruction, but it does take a lot longer for the profiling to
-produce accurate results.
-
-SEE ALSO:
-CPU_getProcessorSpeed, CPU_getProcessorType, CPU_haveMMX,
-CPU_getProcessorName
-****************************************************************************/
-ulong ZAPI CPU_getProcessorSpeedInHZ(
-    ibool accurate)
-{
-#if defined(__INTEL__)
-    if (CPU_haveRDTSC()) {
-       return GetRDTSCCpuSpeed(accurate);
-       }
-    return CPU_getProcessorSpeed(false) * 1000000;
-#else
-    return 0;
-#endif
-}
-
-/****************************************************************************
-DESCRIPTION:
-Returns a string defining the speed and name of the processor.
-
-HEADER:
-ztimer.h
-
-RETURNS:
-Processor name string.
-
-REMARKS:
-This function returns an English string describing the speed and name of the
-CPU.
-
-SEE ALSO:
-CPU_getProcessorType, CPU_haveMMX, CPU_getProcessorName
-****************************************************************************/
-char * ZAPI CPU_getProcessorName(void)
-{
-#if defined(__INTEL__)
-    static int  cpu,speed = -1;
-    static char name[80];
-
-    if (speed == -1) {
-       cpu = CPU_getProcessorType();
-       speed = CPU_getProcessorSpeed(false);
-       }
-    sprintf(name,"%d MHz ", speed);
-    switch (cpu & CPU_mask) {
-       case CPU_i386:
-           strcat(name,"Intel i386 processor");
-           break;
-       case CPU_i486:
-           strcat(name,"Intel i486 processor");
-           break;
-       case CPU_Pentium:
-           strcat(name,"Intel Pentium processor");
-           break;
-       case CPU_PentiumPro:
-           strcat(name,"Intel Pentium Pro processor");
-           break;
-       case CPU_PentiumII:
-           strcat(name,"Intel Pentium II processor");
-           break;
-       case CPU_Celeron:
-           strcat(name,"Intel Celeron processor");
-           break;
-       case CPU_PentiumIII:
-           strcat(name,"Intel Pentium III processor");
-           break;
-       case CPU_UnkIntel:
-           strcat(name,"Unknown Intel processor");
-           break;
-       case CPU_Cyrix6x86:
-           strcat(name,"Cyrix 6x86 processor");
-           break;
-       case CPU_Cyrix6x86MX:
-           strcat(name,"Cyrix 6x86MX processor");
-           break;
-       case CPU_CyrixMediaGX:
-           strcat(name,"Cyrix MediaGX processor");
-           break;
-       case CPU_CyrixMediaGXm:
-           strcat(name,"Cyrix MediaGXm processor");
-           break;
-       case CPU_UnkCyrix:
-           strcat(name,"Unknown Cyrix processor");
-           break;
-       case CPU_AMDAm486:
-           strcat(name,"AMD Am486 processor");
-           break;
-       case CPU_AMDAm5x86:
-           strcat(name,"AMD Am5x86 processor");
-           break;
-       case CPU_AMDK5:
-           strcat(name,"AMD K5 processor");
-           break;
-       case CPU_AMDK6:
-           strcat(name,"AMD K6 processor");
-           break;
-       case CPU_AMDK6_2:
-           strcat(name,"AMD K6-2 processor");
-           break;
-       case CPU_AMDK6_III:
-           strcat(name,"AMD K6-III processor");
-           break;
-       case CPU_AMDK6_2plus:
-           strcat(name,"AMD K6-2+ processor");
-           break;
-       case CPU_AMDK6_IIIplus:
-           strcat(name,"AMD K6-III+ processor");
-           break;
-       case CPU_UnkAMD:
-           strcat(name,"Unknown AMD processor");
-           break;
-       case CPU_AMDAthlon:
-           strcat(name,"AMD Athlon processor");
-           break;
-       case CPU_AMDDuron:
-           strcat(name,"AMD Duron processor");
-           break;
-       case CPU_WinChipC6:
-           strcat(name,"IDT WinChip C6 processor");
-           break;
-       case CPU_WinChip2:
-           strcat(name,"IDT WinChip 2 processor");
-           break;
-       case CPU_UnkIDT:
-           strcat(name,"Unknown IDT processor");
-           break;
-       default:
-           strcat(name,"Unknown processor");
-       }
-    if (CPU_haveMMX())
-       strcat(name," with MMX(R)");
-    if (CPU_have3DNow())
-       strcat(name,", 3DNow!(R)");
-    if (CPU_haveSSE())
-       strcat(name,", SSE(R)");
-    return name;
-#else
-    return "Unknown";
-#endif
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/debug.c b/board/MAI/bios_emulator/scitech/src/pm/debug.c
deleted file mode 100644 (file)
index 751bf09..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Any
-*
-* Description:  Main module containing debug checking features.
-*
-****************************************************************************/
-
-#include "pmapi.h"
-#ifdef  __WIN32_VXD__
-#include "vxdfile.h"
-#elif defined(__NT_DRIVER__)
-#include "ntdriver.h"
-#elif defined(__OS2_VDD__)
-#include "vddfile.h"
-#else
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#endif
-
-/*---------------------------- Global variables ---------------------------*/
-
-/* {secret} */
-void (*_CHK_fail)(int fatal,const char *msg,const char *cond,const char *file,int line) = _CHK_defaultFail;
-static char logFile[256] = "";
-
-/*----------------------------- Implementation ----------------------------*/
-
-#ifdef  CHECKED
-void _CHK_defaultFail(
-    int fatal,
-    const char *msg,
-    const char *cond,
-    const char *file,
-    int line)
-{
-    FILE    *f;
-    char    buf[256];
-
-    if (logFile[0] == 0) {
-       strcpy(logFile,PM_getNucleusPath());
-       PM_backslash(logFile);
-       strcat(logFile,"scitech.log");
-       }
-    if ((f = fopen(logFile,"a+")) != NULL) {
-#if defined(__WIN32_VXD__) || defined(__OS2_VDD__) || defined(__NT_DRIVER__)
-       sprintf(buf,msg,cond,file,line);
-       fwrite(buf,1,strlen(buf),f);
-#else
-       fprintf(f,msg,cond,file,line);
-#endif
-       fclose(f);
-       }
-    if (fatal) {
-       sprintf(buf,"Check failed: check '%s' for details", logFile);
-       PM_fatalError(buf);
-       }
-}
-#endif
-
-/****************************************************************************
-DESCRIPTION:
-Sets the location of the debug log file.
-
-HEADER:
-pmapi.h
-
-PARAMETERS:
-logFilePath - Full file and path name to debug log file.
-
-REMARKS:
-Sets the name and location of the debug log file. The debug log file is
-created and written to when runtime checks, warnings and failure conditions
-are logged to disk when code is compiled in CHECKED mode. By default the
-log file is called 'scitech.log' and goes into the current SciTech Nucleus
-path for the application. You can use this function to set the filename
-and location of the debug log file to your own application specific
-directory.
-****************************************************************************/
-void PMAPI PM_setDebugLog(
-    const char *logFilePath)
-{
-    strcpy(logFile,logFilePath);
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/dos/_event.asm b/board/MAI/bios_emulator/scitech/src/pm/dos/_event.asm
deleted file mode 100644 (file)
index 36dcaab..0000000
+++ /dev/null
@@ -1,194 +0,0 @@
-;****************************************************************************
-;*
-;*                  SciTech Multi-platform Graphics Library
-;*
-;*  ========================================================================
-;*
-;*    The contents of this file are subject to the SciTech MGL Public
-;*    License Version 1.0 (the "License"); you may not use this file
-;*    except in compliance with the License. You may obtain a copy of
-;*    the License at http://www.scitechsoft.com/mgl-license.txt
-;*
-;*    Software distributed under the License is distributed on an
-;*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-;*    implied. See the License for the specific language governing
-;*    rights and limitations under the License.
-;*
-;*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-;*
-;*    The Initial Developer of the Original Code is SciTech Software, Inc.
-;*    All Rights Reserved.
-;*
-;*  ========================================================================
-;*
-;* Language:    80386 Assembler
-;* Environment: IBM PC (MS DOS)
-;*
-;* Description: Assembly language support routines for the event module.
-;*
-;****************************************************************************
-
-        ideal
-
-include "scitech.mac"           ; Memory model macros
-
-ifdef flatmodel
-
-header  _event                  ; Set up memory model
-
-begdataseg  _event
-
-    cextern  _EVT_biosPtr,DPTR
-
-ifdef   USE_NASM
-%define KB_HEAD     WORD esi+01Ah   ; Keyboard buffer head in BIOS data area
-%define KB_TAIL     WORD esi+01Ch   ; Keyboard buffer tail in BIOS data area
-%define KB_START    WORD esi+080h   ; Start of keyboard buffer in BIOS data area
-%define KB_END      WORD esi+082h   ; End of keyboard buffer in BIOS data area
-else
-KB_HEAD     EQU WORD esi+01Ah       ; Keyboard buffer head in BIOS data area
-KB_TAIL     EQU WORD esi+01Ch       ; Keyboard buffer tail in BIOS data area
-KB_START    EQU WORD esi+080h       ; Start of keyboard buffer in BIOS data area
-KB_END      EQU WORD esi+082h       ; End of keyboard buffer in BIOS data area
-endif
-
-enddataseg  _event
-
-begcodeseg  _event              ; Start of code segment
-
-    cpublic _EVT_codeStart
-
-;----------------------------------------------------------------------------
-; int _EVT_getKeyCode(void)
-;----------------------------------------------------------------------------
-; Returns the key code for the next available key by extracting it from
-; the BIOS keyboard buffer.
-;----------------------------------------------------------------------------
-cprocstart  _EVT_getKeyCode
-
-        enter_c
-
-        mov     esi,[_EVT_biosPtr]
-        xor     ebx,ebx
-        xor     eax,eax
-        mov     bx,[KB_HEAD]
-        cmp     bx,[KB_TAIL]
-        jz      @@Done
-        xor     eax,eax
-        mov     ax,[esi+ebx]    ; EAX := character from keyboard buffer
-        inc     _bx
-        inc     _bx
-        cmp     bx,[KB_END]     ; Hit the end of the keyboard buffer?
-        jl      @@1
-        mov     bx,[KB_START]
-@@1:    mov     [KB_HEAD],bx    ; Update keyboard buffer head pointer
-
-@@Done: leave_c
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void _EVT_pumpMessages(void)
-;----------------------------------------------------------------------------
-; This function would normally do nothing, however due to strange bugs
-; in the Windows 3.1 and OS/2 DOS boxes, we don't get any hardware keyboard
-; interrupts unless we periodically call the BIOS keyboard functions. Hence
-; this function gets called every time that we check for events, and works
-; around this problem (in essence it tells the DOS VDM to pump the
-; keyboard events to our program ;-).
-;
-; Note that this bug is not present under Win 9x DOS boxes.
-;----------------------------------------------------------------------------
-cprocstart  _EVT_pumpMessages
-
-        mov     ah,11h          ; Function - Check keyboard status
-        int     16h             ; Call BIOS
-        
-        mov     ax, 0Bh         ; Reset Move Mouse
-        int     33h
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; int _EVT_disableInt(void);
-;----------------------------------------------------------------------------
-; Return processor interrupt status and disable interrupts.
-;----------------------------------------------------------------------------
-cprocstart  _EVT_disableInt
-
-        pushf                   ; Put flag word on stack
-        cli                     ; Disable interrupts!
-        pop     eax             ; deposit flag word in return register
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void _EVT_restoreInt(int ps);
-;----------------------------------------------------------------------------
-; Restore processor interrupt status.
-;----------------------------------------------------------------------------
-cprocstart  _EVT_restoreInt
-
-        ARG     ps:UINT
-
-        push    ebp
-        mov     ebp,esp         ; Set up stack frame
-        push    [DWORD ps]
-        popf                    ; Restore processor status (and interrupts)
-        pop     ebp
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; int EVT_rdinx(int port,int index)
-;----------------------------------------------------------------------------
-; Reads an indexed register value from an I/O port.
-;----------------------------------------------------------------------------
-cprocstart  EVT_rdinx
-
-        ARG     port:UINT, index:UINT
-
-        push    ebp
-        mov     ebp,esp
-        mov     edx,[port]
-        mov     al,[BYTE index]
-        out     dx,al
-        inc     dx
-        in      al,dx
-        movzx   eax,al
-        pop     ebp
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void EVT_wrinx(int port,int index,int value)
-;----------------------------------------------------------------------------
-; Writes an indexed register value to an I/O port.
-;----------------------------------------------------------------------------
-cprocstart  EVT_wrinx
-
-        ARG     port:UINT, index:UINT, value:UINT
-
-        push    ebp
-        mov     ebp,esp
-        mov     edx,[port]
-        mov     al,[BYTE index]
-        mov     ah,[BYTE value]
-        out     dx,ax
-        pop     ebp
-        ret
-
-cprocend
-
-    cpublic _EVT_codeEnd
-
-endcodeseg  _event
-
-endif
-
-        END                         ; End of module
diff --git a/board/MAI/bios_emulator/scitech/src/pm/dos/_lztimer.asm b/board/MAI/bios_emulator/scitech/src/pm/dos/_lztimer.asm
deleted file mode 100644 (file)
index a4a9c79..0000000
+++ /dev/null
@@ -1,438 +0,0 @@
-;****************************************************************************
-;*
-;*                  SciTech OS Portability Manager Library
-;*
-;*  ========================================================================
-;*
-;*    The contents of this file are subject to the SciTech MGL Public
-;*    License Version 1.0 (the "License"); you may not use this file
-;*    except in compliance with the License. You may obtain a copy of
-;*    the License at http://www.scitechsoft.com/mgl-license.txt
-;*
-;*    Software distributed under the License is distributed on an
-;*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-;*    implied. See the License for the specific language governing
-;*    rights and limitations under the License.
-;*
-;*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-;*
-;*    The Initial Developer of the Original Code is SciTech Software, Inc.
-;*    All Rights Reserved.
-;*
-;*  ========================================================================
-;*
-;* Language:    NASM or TASM Assembler
-;* Environment: IBM PC (MS DOS)
-;*
-;* Description: Uses the 8253 timer and the BIOS time-of-day count to time
-;*              the performance of code that takes less than an hour to
-;*              execute.
-;*
-;*              The routines in this package only works with interrupts
-;*              enabled, and in fact will explicitly turn interrupts on
-;*              in order to ensure we get accurate results from the timer.
-;*
-;*  Externally 'C' callable routines:
-;*
-;*  LZ_timerOn:     Saves the BIOS time of day count and starts the
-;*                  long period Zen Timer.
-;*
-;*  LZ_timerLap:    Latches the current count, and keeps the timer running
-;*
-;*  LZ_timerOff:    Stops the long-period Zen Timer and saves the timer
-;*                  count and the BIOS time of day count.
-;*
-;*  LZ_timerCount:  Returns an unsigned long representing the timed count
-;*                  in microseconds. If more than an hour passed during
-;*                  the timing interval, LZ_timerCount will return the
-;*                  value 0xFFFFFFFF (an invalid count).
-;*
-;*  Note:   If either more than an hour passes between calls to LZ_timerOn
-;*          and LZ_timerOff, an error is reported. For timing code that takes
-;*          more than a few minutes to execute, use the low resolution
-;*          Ultra Long Period Zen Timer code, which should be accurate
-;*          enough for most purposes.
-;*
-;*  Note:   Each block of code being timed should ideally be run several
-;*          times, with at least two similar readings required to
-;*          establish a true measurement, in order to eliminate any
-;*          variability caused by interrupts.
-;*
-;*  Note:   Interrupts must not be disabled for more than 54 ms at a
-;*          stretch during the timing interval. Because interrupts are
-;*          enabled, key, mice, and other devices that generate interrupts
-;*          should not be used during the timing interval.
-;*
-;*  Note:   Any extra code running off the timer interrupt (such as
-;*          some memory resident utilities) will increase the time
-;*          measured by the Zen Timer.
-;*
-;*  Note:   These routines can introduce inaccuracies of up to a few
-;*          tenths of a second into the system clock count for each
-;*          code section being timed. Consequently, it's a good idea to
-;*          reboot at the conclusion of timing sessions. (The
-;*          battery-backed clock, if any, is not affected by the Zen
-;*          timer.)
-;*
-;*  All registers and all flags are preserved by all routines, except
-;*  interrupts which are always turned on
-;*
-;****************************************************************************
-
-        IDEAL
-
-include "scitech.mac"
-
-;****************************************************************************
-;
-; Equates used by long period Zen Timer
-;
-;****************************************************************************
-
-; Base address of 8253 timer chip
-
-BASE_8253       equ     40h
-
-; The address of the timer 0 count registers in the 8253
-
-TIMER_0_8253    equ     BASE_8253 + 0
-
-; The address of the mode register in the 8253
-
-MODE_8253       equ     BASE_8253 + 3
-
-; The address of the BIOS timer count variable in the BIOS data area.
-
-TIMER_COUNT     equ     6Ch
-
-; Macro to delay briefly to ensure that enough time has elapsed between
-; successive I/O accesses so that the device being accessed can respond
-; to both accesses even on a very fast PC.
-
-ifdef   USE_NASM
-%macro  DELAY 0
-        jmp     short $+2
-        jmp     short $+2
-        jmp     short $+2
-%endmacro
-else
-macro   DELAY
-        jmp     short $+2
-        jmp     short $+2
-        jmp     short $+2
-endm
-endif
-
-header      _lztimer
-
-begdataseg  _lztimer
-
-        cextern  _ZTimerBIOSPtr,DPTR
-
-StartBIOSCount      dd  0       ; Starting BIOS count dword
-EndBIOSCount        dd  0       ; Ending BIOS count dword
-EndTimedCount       dw  0       ; Timer 0 count at the end of timing period
-
-enddataseg  _lztimer
-
-begcodeseg  _lztimer                ; Start of code segment
-
-;----------------------------------------------------------------------------
-; void LZ_timerOn(void);
-;----------------------------------------------------------------------------
-; Starts the Long period Zen timer counting.
-;----------------------------------------------------------------------------
-cprocstart  LZ_timerOn
-
-; Set the timer 0 of the 8253 to mode 2 (divide-by-N), to cause
-; linear counting rather than count-by-two counting. Also stops
-; timer 0 until the timer count is loaded, except on PS/2 computers.
-
-        mov     al,00110100b        ; mode 2
-        out     MODE_8253,al
-
-; Set the timer count to 0, so we know we won't get another timer
-; interrupt right away. Note: this introduces an inaccuracy of up to 54 ms
-; in the system clock count each time it is executed.
-
-        DELAY
-        sub     al,al
-        out     TIMER_0_8253,al     ; lsb
-        DELAY
-        out     TIMER_0_8253,al     ; msb
-
-; Store the timing start BIOS count
-
-        use_es
-ifdef   flatmodel
-        mov     ebx,[_ZTimerBIOSPtr]
-else
-        les     bx,[_ZTimerBIOSPtr]
-endif
-        cli                         ; No interrupts while we grab the count
-        mov     eax,[_ES _bx+TIMER_COUNT]
-        sti
-        mov     [StartBIOSCount],eax
-        unuse_es
-
-; Set the timer count to 0 again to start the timing interval.
-
-        mov     al,00110100b        ; set up to load initial
-        out     MODE_8253,al        ; timer count
-        DELAY
-        sub     al,al
-        out     TIMER_0_8253,al     ; load count lsb
-        DELAY
-        out     TIMER_0_8253,al     ; load count msb
-
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void LZ_timerOff(void);
-;----------------------------------------------------------------------------
-; Stops the long period Zen timer and saves count.
-;----------------------------------------------------------------------------
-cprocstart  LZ_timerOff
-
-; Latch the timer count.
-
-        mov     al,00000000b        ; latch timer 0
-        out     MODE_8253,al
-        cli                         ; Stop the BIOS count
-
-; Read the BIOS count. (Since interrupts are disabled, the BIOS
-; count won't change).
-
-        use_es
-ifdef   flatmodel
-        mov     ebx,[_ZTimerBIOSPtr]
-else
-        les     bx,[_ZTimerBIOSPtr]
-endif
-        mov     eax,[_ES _bx+TIMER_COUNT]
-        mov     [EndBIOSCount],eax
-        unuse_es
-
-; Read out the count we latched earlier.
-
-        in      al,TIMER_0_8253     ; least significant byte
-        DELAY
-        mov     ah,al
-        in      al,TIMER_0_8253     ; most significant byte
-        xchg    ah,al
-        neg     ax                  ; Convert from countdown remaining
-                                    ;  to elapsed count
-        mov     [EndTimedCount],ax
-        sti                         ; Let the BIOS count continue
-
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; unsigned long LZ_timerLap(void)
-;----------------------------------------------------------------------------
-; Latches the current count and converts it to a microsecond timing value,
-; but leaves the timer still running. We dont check for and overflow,
-; where the time has gone over an hour in this routine, since we want it
-; to execute as fast as possible.
-;----------------------------------------------------------------------------
-cprocstart  LZ_timerLap
-
-        push    ebx                 ; Save EBX for 32 bit code
-
-; Latch the timer count.
-
-        mov     al,00000000b        ; latch timer 0
-        out     MODE_8253,al
-        cli                         ; Stop the BIOS count
-
-; Read the BIOS count. (Since interrupts are disabled, the BIOS
-; count wont change).
-
-        use_es
-ifdef   flatmodel
-        mov     ebx,[_ZTimerBIOSPtr]
-else
-        les     bx,[_ZTimerBIOSPtr]
-endif
-        mov     eax,[_ES _bx+TIMER_COUNT]
-        mov     [EndBIOSCount],eax
-        unuse_es
-
-; Read out the count we latched earlier.
-
-        in      al,TIMER_0_8253     ; least significant byte
-        DELAY
-        mov     ah,al
-        in      al,TIMER_0_8253     ; most significant byte
-        xchg    ah,al
-        neg     ax                  ; Convert from countdown remaining
-                                    ;  to elapsed count
-        mov     [EndTimedCount],ax
-        sti                         ; Let the BIOS count continue
-
-; See if a midnight boundary has passed and adjust the finishing BIOS
-; count by the number of ticks in 24 hours. We wont be able to detect
-; more than 24 hours, but at least we can time across a midnight
-; boundary
-
-        mov     eax,[EndBIOSCount]      ; Is end < start?
-        cmp     eax,[StartBIOSCount]
-        jae     @@CalcBIOSTime          ; No, calculate the time taken
-
-; Adjust the finishing time by adding the number of ticks in 24 hours
-; (1573040).
-
-        add     [DWORD EndBIOSCount],1800B0h
-
-; Convert the BIOS time to microseconds
-
-@@CalcBIOSTime:
-        mov     ax,[WORD EndBIOSCount]
-        sub     ax,[WORD StartBIOSCount]
-        mov     dx,54925            ; Number of microseconds each
-                                    ;  BIOS count represents.
-        mul     dx
-        mov     bx,ax               ; set aside BIOS count in
-        mov     cx,dx               ;  microseconds
-
-; Convert timer count to microseconds
-
-        push    _si
-        mov     ax,[EndTimedCount]
-        mov     si,8381
-        mul     si
-        mov     si,10000
-        div     si                  ; * 0.8381 = * 8381 / 10000
-        pop     _si
-
-; Add the timer and BIOS counts together to get an overall time in
-; microseconds.
-
-        add     ax,bx
-        adc     cx,0
-ifdef flatmodel
-        shl     ecx,16
-        mov     cx,ax
-        mov     eax,ecx             ; EAX := timer count
-else
-        mov     dx,cx
-endif
-        pop     ebx                 ; Restore EBX for 32 bit code
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; unsigned long LZ_timerCount(void);
-;----------------------------------------------------------------------------
-; Returns an unsigned long representing the net time in microseconds.
-;
-; If an hour has passed while timing, we return 0xFFFFFFFF as the count
-; (which is not a possible count in itself).
-;----------------------------------------------------------------------------
-cprocstart  LZ_timerCount
-
-        push    ebx                 ; Save EBX for 32 bit code
-
-; See if a midnight boundary has passed and adjust the finishing BIOS
-; count by the number of ticks in 24 hours. We wont be able to detect
-; more than 24 hours, but at least we can time across a midnight
-; boundary
-
-        mov     eax,[EndBIOSCount]      ; Is end < start?
-        cmp     eax,[StartBIOSCount]
-        jae     @@CheckForHour          ; No, check for hour passing
-
-; Adjust the finishing time by adding the number of ticks in 24 hours
-; (1573040).
-
-        add     [DWORD EndBIOSCount],1800B0h
-
-; See if more than an hour passed during timing. If so, notify the user.
-
-@@CheckForHour:
-        mov     ax,[WORD StartBIOSCount+2]
-        cmp     ax,[WORD EndBIOSCount+2]
-        jz      @@CalcBIOSTime      ; Hour count didn't change, so
-                                    ;  everything is fine
-
-        inc     ax
-        cmp     ax,[WORD EndBIOSCount+2]
-        jnz     @@TestTooLong       ; Two hour boundaries passed, so the
-                                    ;  results are no good
-        mov     ax,[WORD EndBIOSCount]
-        cmp     ax,[WORD StartBIOSCount]
-        jb      @@CalcBIOSTime      ; a single hour boundary passed. That's
-                                    ; OK, so long as the total time wasn't
-                                    ; more than an hour.
-
-; Over an hour elapsed passed during timing, which renders
-; the results invalid. Notify the user. This misses the case where a
-; multiple of 24 hours has passed, but we'll rely on the perspicacity of
-; the user to detect that case :-).
-
-@@TestTooLong:
-ifdef   flatmodel
-        mov     eax,0FFFFFFFFh
-else
-        mov     ax,0FFFFh
-        mov     dx,0FFFFh
-endif
-        jmp     short @@Done
-
-; Convert the BIOS time to microseconds
-
-@@CalcBIOSTime:
-        mov     ax,[WORD EndBIOSCount]
-        sub     ax,[WORD StartBIOSCount]
-        mov     dx,54925            ; Number of microseconds each
-                                    ;  BIOS count represents.
-        mul     dx
-        mov     bx,ax               ; set aside BIOS count in
-        mov     cx,dx               ;  microseconds
-
-; Convert timer count to microseconds
-
-        push    _si
-        mov     ax,[EndTimedCount]
-        mov     si,8381
-        mul     si
-        mov     si,10000
-        div     si                  ; * 0.8381 = * 8381 / 10000
-        pop     _si
-
-; Add the timer and BIOS counts together to get an overall time in
-; microseconds.
-
-        add     ax,bx
-        adc     cx,0
-ifdef flatmodel
-        shl     ecx,16
-        mov     cx,ax
-        mov     eax,ecx             ; EAX := timer count
-else
-        mov     dx,cx
-endif
-
-@@Done: pop     ebx                 ; Restore EBX for 32 bit code
-        ret
-
-cprocend
-
-cprocstart   LZ_disable
-        cli
-        ret
-cprocend
-
-cprocstart   LZ_enable
-        sti
-        ret
-cprocend
-
-endcodeseg  _lztimer
-
-        END
diff --git a/board/MAI/bios_emulator/scitech/src/pm/dos/_pm.asm b/board/MAI/bios_emulator/scitech/src/pm/dos/_pm.asm
deleted file mode 100644 (file)
index 42b5cf3..0000000
+++ /dev/null
@@ -1,656 +0,0 @@
-;****************************************************************************
-;*
-;*                  SciTech OS Portability Manager Library
-;*
-;*  ========================================================================
-;*
-;*    The contents of this file are subject to the SciTech MGL Public
-;*    License Version 1.0 (the "License"); you may not use this file
-;*    except in compliance with the License. You may obtain a copy of
-;*    the License at http://www.scitechsoft.com/mgl-license.txt
-;*
-;*    Software distributed under the License is distributed on an
-;*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-;*    implied. See the License for the specific language governing
-;*    rights and limitations under the License.
-;*
-;*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-;*
-;*    The Initial Developer of the Original Code is SciTech Software, Inc.
-;*    All Rights Reserved.
-;*
-;*  ========================================================================
-;*
-;* Language:    80386 Assembler, TASM 4.0 or NASM
-;* Environment: IBM PC Real mode and 16/32 bit protected mode
-;*
-;* Description: Low level assembly support for the PM library specific to
-;*              MSDOS.
-;*
-;****************************************************************************
-
-        IDEAL
-
-include "scitech.mac"               ; Memory model macros
-
-header      _pmdos                  ; Set up memory model
-
-begdataseg  _pmdos
-
-ifndef  flatmodel
-
-struc   rmregs_s
-ax          dw  ?
-ax_high     dw  ?
-bx          dw  ?
-bx_high     dw  ?
-cx          dw  ?
-cx_high     dw  ?
-dx          dw  ?
-dx_high     dw  ?
-si          dw  ?
-si_high     dw  ?
-di          dw  ?
-di_high     dw  ?
-cflag       dw  ?
-cflag_high  dw  ?
-ends    rmregs_s
-RMREGS  = (rmregs_s PTR es:bx)
-
-struc   rmsregs_s
-es      dw  ?
-cs      dw  ?
-ss      dw  ?
-ds      dw  ?
-ends    rmsregs_s
-RMSREGS = (rmsregs_s PTR es:bx)
-
-endif   ; !flatmodel
-
-ifdef flatmodel
-    cextern _PM_savedDS,USHORT
-    cextern _PM_VXD_off,UINT
-    cextern _PM_VXD_sel,UINT
-ifdef   DOS4GW
-    cextern _PM_haveCauseWay,UINT
-endif
-endif
-intel_id        db  "GenuineIntel"  ; Intel vendor ID
-
-PMHELP_GETPDB       EQU 0026h
-PMHELP_FLUSHTLB     EQU 0027h
-
-enddataseg  _pmdos
-
-P586
-
-begcodeseg  _pmdos                  ; Start of code segment
-
-ifndef  flatmodel
-
-;----------------------------------------------------------------------------
-; void PM_callRealMode(unsigned s,unsigned o, RMREGS *regs,
-;   RMSREGS *sregs)
-;----------------------------------------------------------------------------
-; Calls a real mode procedure, loading the appropriate registers values
-; from the passed in structures. Only the DS and ES register are loaded
-; from the SREGS structure.
-;----------------------------------------------------------------------------
-cprocstart  PM_callRealMode
-
-        ARG     s:WORD, o:WORD, regs:DWORD, sregs:DWORD
-
-        LOCAL   addr:DWORD, bxVal:WORD, esVal:WORD, flags:WORD = LocalSize
-
-        enter_c
-        push    ds
-        push    es
-
-        mov     ax,[o]              ; Build the address to call in 'addr'
-        mov     [WORD addr],ax
-        mov     ax,[s]
-        mov     [WORD addr+2],ax
-
-        les     bx,[sregs]
-        mov     ax,[RMSREGS.ds]
-        mov     ds,ax               ; DS := passed in value
-        mov     ax,[RMSREGS.es]
-        mov     [esVal],ax
-        les     bx,[regs]
-        mov     ax,[RMREGS.bx]
-        mov     [bxVal],ax
-        mov     ax,[RMREGS.ax]      ; AX := passed in value
-        mov     cx,[RMREGS.cx]      ; CX := passed in value
-        mov     dx,[RMREGS.dx]      ; DX := passed in value
-        mov     si,[RMREGS.si]      ; SI := passed in value
-        mov     di,[RMREGS.di]      ; DI := passed in value
-        push    bp
-        push    [esVal]
-        pop     es                  ; ES := passed in value
-        mov     bx,[bxVal]          ; BX := passed in value
-
-        call    [addr]              ; Call the specified routine
-
-        pushf                       ; Save flags for later
-        pop     [flags]
-
-        pop     bp
-        push    es
-        pop     [esVal]
-        push    bx
-        pop     [bxVal]
-        les     bx,[sregs]
-        push    ds
-        pop     [RMSREGS.ds]        ; Save value of DS
-        push    [esVal]
-        pop     [RMSREGS.es]        ; Save value of ES
-        les     bx,[regs]
-        mov     [RMREGS.ax],ax      ; Save value of AX
-        mov     [RMREGS.cx],cx      ; Save value of CX
-        mov     [RMREGS.dx],dx      ; Save value of DX
-        mov     [RMREGS.si],si      ; Save value of SI
-        mov     [RMREGS.di],di      ; Save value of DI
-        mov     ax,[flags]          ; Return flags
-        and     ax,1h               ; Isolate carry flag
-        mov     [RMREGS.cflag],ax   ; Save carry flag status
-        mov     ax,[bxVal]
-        mov     [RMREGS.bx],ax      ; Save value of BX
-
-        pop     es
-        pop     ds
-        leave_c
-        ret
-
-cprocend
-
-endif
-
-;----------------------------------------------------------------------------
-; void PM_segread(PMSREGS *sregs)
-;----------------------------------------------------------------------------
-; Read the current value of all segment registers
-;----------------------------------------------------------------------------
-cprocstartdll16 PM_segread
-
-        ARG     sregs:DPTR
-
-        enter_c
-
-        mov     ax,es
-        _les    _si,[sregs]
-        mov     [_ES _si],ax
-        mov     [_ES _si+2],cs
-        mov     [_ES _si+4],ss
-        mov     [_ES _si+6],ds
-        mov     [_ES _si+8],fs
-        mov     [_ES _si+10],gs
-
-        leave_c
-        ret
-
-cprocend
-
-; Create a table of the 256 different interrupt calls that we can jump
-; into
-
-ifdef   USE_NASM
-
-%assign intno 0
-
-intTable:
-%rep    256
-        db      0CDh
-        db      intno
-%assign intno   intno + 1
-        ret
-        nop
-%endrep
-
-else
-
-intno = 0
-
-intTable:
-        REPT    256
-        db      0CDh
-        db      intno
-intno = intno + 1
-        ret
-        nop
-        ENDM
-
-endif
-
-;----------------------------------------------------------------------------
-; _PM_genInt    - Generate the appropriate interrupt
-;----------------------------------------------------------------------------
-cprocnear   _PM_genInt
-
-        push    _ax                     ; Save _ax
-        push    _bx                     ; Save _bx
-ifdef flatmodel
-        mov     ebx,[UINT esp+12]       ; EBX := interrupt number
-else
-        mov     bx,sp                   ; Make sure ESP is zeroed
-        mov     bx,[UINT ss:bx+6]       ; BX := interrupt number
-endif
-        mov     _ax,offset intTable     ; Point to interrupt generation table
-        shl     _bx,2                   ; _BX := index into table
-        add     _ax,_bx                 ; _AX := pointer to interrupt code
-ifdef flatmodel
-        xchg    eax,[esp+4]             ; Restore eax, and set for int
-else
-        mov     bx,sp
-        xchg    ax,[ss:bx+2]            ; Restore ax, and set for int
-endif
-        pop     _bx                     ; restore _bx
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; int PM_int386x(int intno, PMREGS *in, PMREGS *out,PMSREGS *sregs)
-;----------------------------------------------------------------------------
-; Issues a software interrupt in protected mode. This routine has been
-; written to allow user programs to load CS and DS with different values
-; other than the default.
-;----------------------------------------------------------------------------
-cprocstartdll16 PM_int386x
-
-        ARG     intno:UINT, inptr:DPTR, outptr:DPTR, sregs:DPTR
-
-        LOCAL   flags:UINT, sv_ds:UINT, sv_esi:ULONG = LocalSize
-
-        enter_c
-        push    ds
-        push    es                  ; Save segment registers
-        push    fs
-        push    gs
-
-        _lds    _si,[sregs]         ; DS:_SI -> Load segment registers
-        mov     es,[_si]
-        mov     bx,[_si+6]
-        mov     [sv_ds],_bx         ; Save value of user DS on stack
-        mov     fs,[_si+8]
-        mov     gs,[_si+10]
-
-        _lds    _si,[inptr]         ; Load CPU registers
-        mov     eax,[_si]
-        mov     ebx,[_si+4]
-        mov     ecx,[_si+8]
-        mov     edx,[_si+12]
-        mov     edi,[_si+20]
-        mov     esi,[_si+16]
-
-        push    ds                  ; Save value of DS
-        push    _bp                 ; Some interrupts trash this!
-        clc                         ; Generate the interrupt
-        push    [UINT intno]
-        mov     ds,[WORD sv_ds]     ; Set value of user's DS selector
-        call    _PM_genInt
-        pop     _bp                 ; Pop intno from stack (flags unchanged)
-        pop     _bp                 ; Restore value of stack frame pointer
-        pop     ds                  ; Restore value of DS
-
-        pushf                       ; Save flags for later
-        pop     [UINT flags]
-        push    esi                 ; Save ESI for later
-        pop     [DWORD sv_esi]
-        push    ds                  ; Save DS for later
-        pop     [UINT sv_ds]
-
-        _lds    _si,[outptr]        ; Save CPU registers
-        mov     [_si],eax
-        mov     [_si+4],ebx
-        mov     [_si+8],ecx
-        mov     [_si+12],edx
-        push    [DWORD sv_esi]
-        pop     [DWORD _si+16]
-        mov     [_si+20],edi
-
-        mov     _bx,[flags]         ; Return flags
-        and     ebx,1h              ; Isolate carry flag
-        mov     [_si+24],ebx        ; Save carry flag status
-
-        _lds    _si,[sregs]         ; Save segment registers
-        mov     [_si],es
-        mov     _bx,[sv_ds]
-        mov     [_si+6],bx          ; Get returned DS from stack
-        mov     [_si+8],fs
-        mov     [_si+10],gs
-
-        pop     gs                  ; Restore segment registers
-        pop     fs
-        pop     es
-        pop     ds
-        leave_c
-        ret
-
-cprocend
-
-ifndef flatmodel
-_PM_savedDS     dw  _DATA           ; Saved value of DS
-endif
-
-;----------------------------------------------------------------------------
-; void PM_saveDS(void)
-;----------------------------------------------------------------------------
-; Save the value of DS into a section of the code segment, so that we can
-; quickly load this value at a later date in the PM_loadDS() routine from
-; inside interrupt handlers etc. The method to do this is different
-; depending on the DOS extender being used.
-;----------------------------------------------------------------------------
-cprocstartdll16 PM_saveDS
-
-ifdef flatmodel
-        mov     [_PM_savedDS],ds    ; Store away in data segment
-endif
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void PM_loadDS(void)
-;----------------------------------------------------------------------------
-; Routine to load the DS register with the default value for the current
-; DOS extender. Only the DS register is loaded, not the ES register, so
-; if you wish to call C code, you will need to also load the ES register
-; in 32 bit protected mode.
-;----------------------------------------------------------------------------
-cprocstartdll16 PM_loadDS
-
-        mov     ds,[cs:_PM_savedDS] ; We can access the proper DS through CS
-        ret
-
-cprocend
-
-ifdef flatmodel
-
-;----------------------------------------------------------------------------
-; ibool DPMI_allocateCallback(void (*pmcode)(), void *rmregs, long *RMCB)
-;----------------------------------------------------------------------------
-cprocstart  _DPMI_allocateCallback
-
-        ARG     pmcode:CPTR, rmregs:DPTR, RMCB:DPTR
-
-        enter_c
-        push    ds
-        push    es
-
-        push    cs
-        pop     ds
-        mov     esi,[pmcode]    ; DS:ESI -> protected mode code to call
-        mov     edi,[rmregs]    ; ES:EDI -> real mode register buffer
-        mov     ax,303h         ; AX := allocate realmode callback function
-        int     31h
-        mov     eax,0           ; Return failure!
-        jc      @@Fail
-
-        mov     eax,[RMCB]
-        shl     ecx,16
-        mov     cx,dx
-        mov     [es:eax],ecx    ; Return real mode address
-        mov     eax,1           ; Return success!
-
-@@Fail: pop     es
-        pop     ds
-        leave_c
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void DPMI_freeCallback(long RMCB)
-;----------------------------------------------------------------------------
-cprocstart  _DPMI_freeCallback
-
-        ARG     RMCB:ULONG
-
-        enter_c
-
-        mov     cx,[WORD RMCB+2]
-        mov     dx,[WORD RMCB]  ; CX:DX := real mode callback
-        mov     ax,304h
-        int     31h
-
-        leave_c
-        ret
-
-cprocend
-
-endif
-
-; Macro to delay briefly to ensure that enough time has elapsed between
-; successive I/O accesses so that the device being accessed can respond
-; to both accesses even on a very fast PC.
-
-ifdef   USE_NASM
-%macro  DELAY 0
-        jmp     short $+2
-        jmp     short $+2
-        jmp     short $+2
-%endmacro
-%macro  IODELAYN 1
-%rep    %1
-        DELAY
-%endrep
-%endmacro
-else
-macro   DELAY
-        jmp     short $+2
-        jmp     short $+2
-        jmp     short $+2
-endm
-macro   IODELAYN    N
-    rept    N
-        DELAY
-    endm
-endm
-endif
-
-;----------------------------------------------------------------------------
-; uchar _PM_readCMOS(int index)
-;----------------------------------------------------------------------------
-; Read the value of a specific CMOS register. We do this with both
-; normal interrupts and NMI disabled.
-;----------------------------------------------------------------------------
-cprocstart  _PM_readCMOS
-
-        ARG     index:UINT
-
-        push    _bp
-        mov     _bp,_sp
-        pushfd
-        mov     al,[BYTE index]
-        or      al,80h              ; Add disable NMI flag
-        cli
-        out     70h,al
-        IODELAYN 5
-        in      al,71h
-        mov     ah,al
-        xor     al,al
-        IODELAYN 5
-        out     70h,al              ; Re-enable NMI
-        sti
-        mov     al,ah               ; Return value in AL
-        popfd
-        pop     _bp
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void _PM_writeCMOS(int index,uchar value)
-;----------------------------------------------------------------------------
-; Read the value of a specific CMOS register. We do this with both
-; normal interrupts and NMI disabled.
-;----------------------------------------------------------------------------
-cprocstart  _PM_writeCMOS
-
-        ARG     index:UINT, value:UCHAR
-
-        push    _bp
-        mov     _bp,_sp
-        pushfd
-        mov     al,[BYTE index]
-        or      al,80h              ; Add disable NMI flag
-        cli
-        out     70h,al
-        IODELAYN 5
-        mov     al,[value]
-        out     71h,al
-        xor     al,al
-        IODELAYN 5
-        out     70h,al              ; Re-enable NMI
-        sti
-        popfd
-        pop     _bp
-        ret
-
-cprocend
-
-ifdef   flatmodel
-
-;----------------------------------------------------------------------------
-; int _PM_pagingEnabled(void)
-;----------------------------------------------------------------------------
-; Returns 1 if paging is enabled, 0 if not or -1 if not at ring 0
-;----------------------------------------------------------------------------
-cprocstart  _PM_pagingEnabled
-
-        mov     eax,-1
-ifdef   DOS4GW
-        mov     cx,cs
-        and     ecx,3
-        jz      @@Ring0
-        cmp     [UINT _PM_haveCauseWay],0
-        jnz     @@Ring0
-        jmp     @@Exit
-
-@@Ring0:
-        mov     eax,cr0                 ; Load CR0
-        shr     eax,31                  ; Isolate paging enabled bit
-endif
-@@Exit: ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; _PM_getPDB - Return the Page Table Directory Base address
-;----------------------------------------------------------------------------
-cprocstart  _PM_getPDB
-
-ifdef   DOS4GW
-        mov     ax,cs
-        and     eax,3
-        jz      @@Ring0
-        cmp     [UINT _PM_haveCauseWay],0
-        jnz     @@Ring0
-endif
-
-; Call VxD if running at ring 3 in a DOS box
-
-        cmp     [WORD _PM_VXD_sel],0
-        jz      @@Fail
-        mov     eax,PMHELP_GETPDB
-ifdef   USE_NASM
-        call    far dword [_PM_VXD_off]
-else
-        call    [FCPTR _PM_VXD_off]
-endif
-        ret
-
-@@Ring0:
-ifdef   DOS4GW
-        mov     eax,cr3
-        and     eax,0FFFFF000h
-        ret
-endif
-@@Fail: xor     eax,eax
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; PM_flushTLB - Flush the Translation Lookaside buffer
-;----------------------------------------------------------------------------
-cprocstart  PM_flushTLB
-
-        mov     ax,cs
-        and     eax,3
-        jz      @@Ring0
-ifdef   DOS4GW
-        cmp     [UINT _PM_haveCauseWay],0
-        jnz     @@Ring0
-endif
-
-; Call VxD if running at ring 3 in a DOS box
-
-        cmp     [WORD _PM_VXD_sel],0
-        jz      @@Fail
-        mov     eax,PMHELP_FLUSHTLB
-ifdef   USE_NASM
-        call    far dword [_PM_VXD_off]
-else
-        call    [FCPTR _PM_VXD_off]
-endif
-        ret
-
-@@Ring0:
-ifdef   DOS4GW
-        wbinvd                  ; Flush the CPU cache
-        mov     eax,cr3
-        mov     cr3,eax         ; Flush the TLB
-endif
-@@Fail: ret
-
-cprocend
-
-endif
-
-;----------------------------------------------------------------------------
-; void _PM_VxDCall(VXD_regs far *r,uint off,uint sel);
-;----------------------------------------------------------------------------
-cprocstart  _PM_VxDCall
-
-        ARG     r:DPTR, off:UINT, sel:UINT
-
-        enter_c
-
-; Load all registers from the registers structure
-
-        mov     ebx,[r]
-        mov     eax,[ebx+0]
-        mov     ecx,[ebx+8]
-        mov     edx,[ebx+12]
-        mov     esi,[ebx+16]
-        mov     edi,[ebx+20]
-        mov     ebx,[ebx+4]         ; Trashes BX structure pointer!
-
-; Call the VxD entry point (on stack)
-
-ifdef   USE_NASM
-        call far dword [off]
-else
-        call    [FCPTR off]
-endif
-
-; Save all registers back in the structure
-
-        push    ebx                 ; Push EBX onto stack for later
-        mov     ebx,[r]
-        mov     [ebx+0],eax
-        mov     [ebx+8],ecx
-        mov     [ebx+12],edx
-        mov     [ebx+16],esi
-        mov     [ebx+20],edi
-        pop     [DWORD ebx+4]       ; Save value of EBX from stack
-
-        leave_c
-        ret
-
-cprocend
-
-endcodeseg  _pmdos
-
-        END                     ; End of module
diff --git a/board/MAI/bios_emulator/scitech/src/pm/dos/_pmdos.asm b/board/MAI/bios_emulator/scitech/src/pm/dos/_pmdos.asm
deleted file mode 100644 (file)
index 5c741f3..0000000
+++ /dev/null
@@ -1,1105 +0,0 @@
-;****************************************************************************
-;*
-;*                  SciTech OS Portability Manager Library
-;*
-;*  ========================================================================
-;*
-;*    The contents of this file are subject to the SciTech MGL Public
-;*    License Version 1.0 (the "License"); you may not use this file
-;*    except in compliance with the License. You may obtain a copy of
-;*    the License at http://www.scitechsoft.com/mgl-license.txt
-;*
-;*    Software distributed under the License is distributed on an
-;*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-;*    implied. See the License for the specific language governing
-;*    rights and limitations under the License.
-;*
-;*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-;*
-;*    The Initial Developer of the Original Code is SciTech Software, Inc.
-;*    All Rights Reserved.
-;*
-;*  ========================================================================
-;*
-;* Language:    80386 Assembler, TASM 4.0 or NASM
-;* Environment: IBM PC Real mode and 16/32 bit protected mode
-;*
-;* Description: Low level assembly support for the PM library specific to
-;*              MSDOS interrupt handling.
-;*
-;****************************************************************************
-
-        IDEAL
-
-include "scitech.mac"           ; Memory model macros
-
-header      _pmdos              ; Set up memory model
-
-; Define the size of our local stacks. For real mode code they cant be
-; that big, but for 32 bit protected mode code we can make them nice and
-; large so that complex C functions can be used.
-
-ifdef flatmodel
-MOUSE_STACK EQU 4096
-TIMER_STACK EQU 4096
-KEY_STACK   EQU 1024
-INT10_STACK EQU 1024
-IRQ_STACK   EQU 1024
-else
-MOUSE_STACK EQU 1024
-TIMER_STACK EQU 512
-KEY_STACK   EQU 256
-INT10_STACK EQU 256
-IRQ_STACK   EQU 256
-endif
-
-ifdef   USE_NASM
-
-; Macro to load DS and ES registers with correct value.
-
-%imacro   LOAD_DS 0
-%ifdef  flatmodel
-        mov     ds,[cs:_PM_savedDS]
-        mov     es,[cs:_PM_savedDS]
-%else
-        push    ax
-        mov     ax,_DATA
-        mov     ds,ax
-        pop     ax
-%endif
-%endmacro
-
-; Note that interrupts we disable interrupts during the following stack
-; %imacro for correct operation, but we do not enable them again. Normally
-; these %imacros are used within interrupt handlers so interrupts should
-; already be off. We turn them back on explicitly later if the user code
-; needs them to be back on.
-
-; Macro to switch to a new local stack.
-
-%imacro NEWSTK  1
-        cli
-        mov     [seg_%1],ss
-        mov     [ptr_%1],_sp
-        mov     [TempSeg],ds
-        mov     ss,[TempSeg]
-        mov     _sp,offset %1
-%endmacro
-
-; %imacro to switch back to the old stack.
-
-%imacro   RESTSTK   1
-        cli
-        mov     ss,[seg_%1]
-        mov     _sp,[ptr_%1]
-%endmacro
-
-; %imacro to swap the current stack with the one saved away.
-
-%imacro SWAPSTK 1
-        cli
-        mov     ax,ss
-        xchg    ax,[seg_%1]
-        mov     ss,ax
-        xchg    _sp,[ptr_%1]
-%endmacro
-
-else
-
-; Macro to load DS and ES registers with correct value.
-
-MACRO   LOAD_DS
-ifdef   flatmodel
-        mov     ds,[cs:_PM_savedDS]
-        mov     es,[cs:_PM_savedDS]
-else
-        push    ax
-        mov     ax,_DATA
-        mov     ds,ax
-        pop     ax
-endif
-ENDM
-
-; Note that interrupts we disable interrupts during the following stack
-; macro for correct operation, but we do not enable them again. Normally
-; these macros are used within interrupt handlers so interrupts should
-; already be off. We turn them back on explicitly later if the user code
-; needs them to be back on.
-
-; Macro to switch to a new local stack.
-
-MACRO   NEWSTK  stkname
-        cli
-        mov     [seg_&stkname&],ss
-        mov     [ptr_&stkname&],_sp
-        mov     [TempSeg],ds
-        mov     ss,[TempSeg]
-        mov     _sp,offset stkname
-ENDM
-
-; Macro to switch back to the old stack.
-
-MACRO   RESTSTK stkname
-        cli
-        mov     ss,[seg_&stkname&]
-        mov     _sp,[ptr_&stkname&]
-ENDM
-
-; Macro to swap the current stack with the one saved away.
-
-MACRO   SWAPSTK stkname
-        cli
-        mov     ax,ss
-        xchg    ax,[seg_&stkname&]
-        mov     ss,ax
-        xchg    _sp,[ptr_&stkname&]
-ENDM
-
-endif
-
-begdataseg  _pmdos
-
-ifdef flatmodel
-    cextern _PM_savedDS,USHORT
-endif
-    cextern _PM_critHandler,CPTR
-    cextern _PM_breakHandler,CPTR
-    cextern _PM_timerHandler,CPTR
-    cextern _PM_rtcHandler,CPTR
-    cextern _PM_keyHandler,CPTR
-    cextern _PM_key15Handler,CPTR
-    cextern _PM_mouseHandler,CPTR
-    cextern _PM_int10Handler,CPTR
-
-    cextern _PM_ctrlCPtr,DPTR
-    cextern _PM_ctrlBPtr,DPTR
-    cextern _PM_critPtr,DPTR
-
-    cextern _PM_prevTimer,FCPTR
-    cextern _PM_prevRTC,FCPTR
-    cextern _PM_prevKey,FCPTR
-    cextern _PM_prevKey15,FCPTR
-    cextern _PM_prevBreak,FCPTR
-    cextern _PM_prevCtrlC,FCPTR
-    cextern _PM_prevCritical,FCPTR
-    cextern _PM_prevRealTimer,ULONG
-    cextern _PM_prevRealRTC,ULONG
-    cextern _PM_prevRealKey,ULONG
-    cextern _PM_prevRealKey15,ULONG
-    cextern _PM_prevRealInt10,ULONG
-
-cpublic _PM_pmdosDataStart
-
-; Allocate space for all of the local stacks that we need. These stacks
-; are not very large, but should be large enough for most purposes
-; (generally you want to handle these interrupts quickly, simply storing
-; the information for later and then returning). If you need bigger
-; stacks then change the appropriate value in here.
-
-            ALIGN   4
-            dclb MOUSE_STACK    ; Space for local stack (small)
-MsStack:                        ; Stack starts at end!
-ptr_MsStack DUINT   0           ; Place to store old stack offset
-seg_MsStack dw      0           ; Place to store old stack segment
-
-            ALIGN   4
-            dclb INT10_STACK    ; Space for local stack (small)
-Int10Stack:                     ; Stack starts at end!
-ptr_Int10Stack  DUINT   0       ; Place to store old stack offset
-seg_Int10Stack  dw      0       ; Place to store old stack segment
-
-            ALIGN   4
-            dclb TIMER_STACK    ; Space for local stack (small)
-TmStack:                        ; Stack starts at end!
-ptr_TmStack DUINT   0           ; Place to store old stack offset
-seg_TmStack dw      0           ; Place to store old stack segment
-
-            ALIGN   4
-            dclb TIMER_STACK    ; Space for local stack (small)
-RtcStack:                       ; Stack starts at end!
-ptr_RtcStack DUINT  0           ; Place to store old stack offset
-seg_RtcStack dw     0           ; Place to store old stack segment
-RtcInside   dw      0           ; Are we still handling current interrupt
-
-            ALIGN   4
-            dclb KEY_STACK      ; Space for local stack (small)
-KyStack:                        ; Stack starts at end!
-ptr_KyStack DUINT   0           ; Place to store old stack offset
-seg_KyStack dw      0           ; Place to store old stack segment
-KyInside    dw      0           ; Are we still handling current interrupt
-
-            ALIGN   4
-            dclb KEY_STACK      ; Space for local stack (small)
-Ky15Stack:                      ; Stack starts at end!
-ptr_Ky15Stack   DUINT   0       ; Place to store old stack offset
-seg_Ky15Stack   dw      0       ; Place to store old stack segment
-
-TempSeg     dw      0           ; Place to store stack segment
-
-cpublic _PM_pmdosDataEnd
-
-enddataseg  _pmdos
-
-begcodeseg  _pmdos              ; Start of code segment
-
-cpublic _PM_pmdosCodeStart
-
-;----------------------------------------------------------------------------
-; PM_mouseISR - Mouse interrupt subroutine dispatcher
-;----------------------------------------------------------------------------
-; Interrupt subroutine called by the mouse driver upon interrupts, to
-; dispatch control to high level C based subroutines. Interrupts are on
-; when we call the user code.
-;
-; It is _extremely_ important to save the state of the extended registers
-; as these may well be trashed by the routines called from here and not
-; restored correctly by the mouse interface module.
-;
-; NOTE: This routine switches to a local stack before calling any C code,
-;       and hence is _not_ re-entrant. For mouse handlers this is not a
-;       problem, as the mouse driver arbitrates calls to the user mouse
-;       handler for us.
-;
-; Entry:    AX  - Condition mask giving reason for call
-;           BX  - Mouse button state
-;           CX  - Horizontal cursor coordinate
-;           DX  - Vertical cursor coordinate
-;           SI  - Horizontal mickey value
-;           DI  - Vertical mickey value
-;
-;----------------------------------------------------------------------------
-ifdef   DJGPP
-cprocstart  _PM_mouseISR
-else
-cprocfar    _PM_mouseISR
-endif
-
-        push    ds              ; Save value of DS
-        push    es
-        pushad                  ; Save _all_ extended registers
-        cld                     ; Clear direction flag
-
-        LOAD_DS                 ; Load DS register
-        NEWSTK  MsStack         ; Switch to local stack
-
-; Call the installed high level C code routine
-
-        clrhi   dx              ; Clear out high order values
-        clrhi   cx
-        clrhi   bx
-        clrhi   ax
-        sgnhi   si
-        sgnhi   di
-
-        push    _di
-        push    _si
-        push    _dx
-        push    _cx
-        push    _bx
-        push    _ax
-        sti                     ; Enable interrupts
-        call    [CPTR _PM_mouseHandler]
-        _add    sp,12,24
-
-        RESTSTK MsStack         ; Restore previous stack
-
-        popad                   ; Restore all extended registers
-        pop     es
-        pop     ds
-        ret                     ; We are done!!
-
-cprocend
-
-;----------------------------------------------------------------------------
-; PM_timerISR - Timer interrupt subroutine dispatcher
-;----------------------------------------------------------------------------
-; Hardware interrupt handler for the timer interrupt, to dispatch control
-; to high level C based subroutines. We save the state of all registers
-; in this routine, and switch to a local stack. Interrupts are *off*
-; when we call the user code.
-;
-; NOTE: This routine switches to a local stack before calling any C code,
-;       and hence is _not_ re-entrant. Make sure your C code executes as
-;       quickly as possible, since a timer overrun will simply hang the
-;       system.
-;----------------------------------------------------------------------------
-cprocfar    _PM_timerISR
-
-        push    ds              ; Save value of DS
-        push    es
-        pushad                  ; Save _all_ extended registers
-        cld                     ; Clear direction flag
-
-        LOAD_DS                 ; Load DS register
-
-        NEWSTK  TmStack         ; Switch to local stack
-        call    [CPTR _PM_timerHandler]
-        RESTSTK TmStack         ; Restore previous stack
-
-        popad                   ; Restore all extended registers
-        pop     es
-        pop     ds
-        iret                    ; Return from interrupt
-
-cprocend
-
-;----------------------------------------------------------------------------
-; PM_chainPrevTimer - Chain to previous timer interrupt and return
-;----------------------------------------------------------------------------
-; Chains to the previous timer interrupt routine and returns control
-; back to the high level interrupt handler.
-;----------------------------------------------------------------------------
-cprocstart  PM_chainPrevTimer
-
-ifdef   TNT
-        push    eax
-        push    ebx
-        push    ecx
-        pushfd                  ; Push flags on stack to simulate interrupt
-        mov     ax,250Eh        ; Call real mode procedure function
-        mov     ebx,[_PM_prevRealTimer]
-        mov     ecx,1           ; Copy real mode flags to real mode stack
-        int     21h             ; Call the real mode code
-        popfd
-        pop     ecx
-        pop     ebx
-        pop     eax
-        ret
-else
-        SWAPSTK TmStack         ; Swap back to previous stack
-        pushf                   ; Save state of interrupt flag
-        pushf                   ; Push flags on stack to simulate interrupt
-ifdef   USE_NASM
-        call far dword [_PM_prevTimer]
-else
-        call    [_PM_prevTimer]
-endif
-        popf                    ; Restore state of interrupt flag
-        SWAPSTK TmStack         ; Swap back to C stack again
-        ret
-endif
-
-cprocend
-
-; Macro to delay briefly to ensure that enough time has elapsed between
-; successive I/O accesses so that the device being accessed can respond
-; to both accesses even on a very fast PC.
-
-ifdef   USE_NASM
-%macro  DELAY 0
-        jmp     short $+2
-        jmp     short $+2
-        jmp     short $+2
-%endmacro
-%macro  IODELAYN 1
-%rep    %1
-        DELAY
-%endrep
-%endmacro
-else
-macro   DELAY
-        jmp     short $+2
-        jmp     short $+2
-        jmp     short $+2
-endm
-macro   IODELAYN    N
-    rept    N
-        DELAY
-    endm
-endm
-endif
-
-;----------------------------------------------------------------------------
-; PM_rtcISR - Real time clock interrupt subroutine dispatcher
-;----------------------------------------------------------------------------
-; Hardware interrupt handler for the timer interrupt, to dispatch control
-; to high level C based subroutines. We save the state of all registers
-; in this routine, and switch to a local stack. Interrupts are *off*
-; when we call the user code.
-;
-; NOTE: This routine switches to a local stack before calling any C code,
-;       and hence is _not_ re-entrant. Make sure your C code executes as
-;       quickly as possible, since a timer overrun will simply hang the
-;       system.
-;----------------------------------------------------------------------------
-cprocfar    _PM_rtcISR
-
-        push    ds                  ; Save value of DS
-        push    es
-        pushad                      ; Save _all_ extended registers
-        cld                         ; Clear direction flag
-
-; Clear priority interrupt controller and re-enable interrupts so we
-; dont lock things up for long.
-
-        mov     al,20h
-        out     0A0h,al
-        out     020h,al
-
-; Clear real-time clock timeout
-
-        in      al,70h              ; Read CMOS index register
-        push    _ax                 ;  and save for later
-        IODELAYN 3
-        mov     al,0Ch
-        out     70h,al
-        IODELAYN 5
-        in      al,71h
-
-; Call the C interrupt handler function
-
-        LOAD_DS                     ; Load DS register
-        cmp     [BYTE RtcInside],1  ; Check for mutual exclusion
-        je      @@Exit
-        mov     [BYTE RtcInside],1
-        NEWSTK  RtcStack            ; Switch to local stack
-        sti                         ; Re-enable interrupts
-        call    [CPTR _PM_rtcHandler]
-        RESTSTK RtcStack            ; Restore previous stack
-        mov     [BYTE RtcInside],0
-
-@@Exit: pop     _ax
-        out     70h,al              ; Restore CMOS index register
-        popad                       ; Restore all extended registers
-        pop     es
-        pop     ds
-        iret                        ; Return from interrupt
-
-cprocend
-
-ifdef flatmodel
-;----------------------------------------------------------------------------
-; PM_irqISRTemplate - Hardware interrupt handler IRQ template
-;----------------------------------------------------------------------------
-; Hardware interrupt handler for any interrupt, to dispatch control
-; to high level C based subroutines. We save the state of all registers
-; in this routine, and switch to a local stack. Interrupts are *off*
-; when we call the user code.
-;
-; NOTE: This routine switches to a local stack before calling any C code,
-;       and hence is _not_ re-entrant. Make sure your C code executes as
-;       quickly as possible.
-;----------------------------------------------------------------------------
-cprocfar    _PM_irqISRTemplate
-
-        push    ebx
-        mov     ebx,0           ; Relocation adjustment factor
-        jmp     __IRQEntry
-
-; Global variables stored in the IRQ thunk code segment
-
-_CHandler       dd      0       ; Pointer to C interrupt handler
-_PrevIRQ        dd      0       ; Previous IRQ handler
-                dd      0
-_IRQ            dd      0       ; IRQ we are hooked for
-ptr_IRQStack    DUINT   0       ; Place to store old stack offset
-seg_IRQStack    dw      0       ; Place to store old stack segment
-_Inside         db      0       ; Mutual exclusion flag
-        ALIGN   4
-        dclb IRQ_STACK          ; Space for local stack
-_IRQStack:                      ; Stack starts at end!
-
-; Check for and reject spurious IRQ 7 signals
-
-__IRQEntry:
-        cmp     [BYTE cs:ebx+_IRQ],7    ; Spurious IRQs occur only on IRQ 7
-        jmp     @@ValidIRQ
-        push    eax
-        mov     al,1011b            ; OCW3: read ISR
-        out     20h,al              ; (Intel Peripheral Components, 1991,
-        in      al,20h              ; p. 3-188)
-        shl     al,1                ; Set C = bit 7 (IRQ 7) of ISR register
-        pop     eax
-        jc      @@ValidIRQ
-        iret                        ; Return from interrupt
-
-; Save all registers for duration of IRQ handler
-
-@@ValidIRQ:
-        push    ds                  ; Save value of DS
-        push    es
-        pushad                      ; Save _all_ extended registers
-        cld                         ; Clear direction flag
-        LOAD_DS                     ; Load DS register
-
-; Send an EOI to the PIC
-
-        mov     al,20h              ; Send EOI to PIC
-        cmp     [BYTE ebx+_IRQ],8   ; Clear PIC1 first if IRQ >= 8
-        jb      @@1
-        out     0A0h,al
-@@1:    out     20h,al
-
-; Check for mutual exclusion
-
-        cmp     [BYTE ebx+_Inside],1
-        je      @@ChainOldHandler
-        mov     [BYTE ebx+_Inside],1
-
-; Call the C interrupt handler function
-
-        mov     [ebx+seg_IRQStack],ss   ; Switch to local stack
-        mov     [ebx+ptr_IRQStack],esp
-        mov     [TempSeg],ds
-        mov     ss,[TempSeg]
-        lea     esp,[ebx+_IRQStack]
-        sti                             ; Re-enable interrupts
-        push    ebx
-        call    [DWORD ebx+_CHandler]
-        pop     ebx
-        cli
-        mov     ss,[ebx+seg_IRQStack]   ; Restore previous stack
-        mov     esp,[ebx+ptr_IRQStack]
-        or      eax,eax
-        jz      @@ChainOldHandler   ; Chain if not handled for shared IRQ
-
-@@Exit: mov     [BYTE ebx+_Inside],0
-        popad                       ; Restore all extended registers
-        pop     es
-        pop     ds
-        pop     ebx
-        iret                        ; Return from interrupt
-
-@@ChainOldHandler:
-        cmp     [DWORD ebx+_PrevIRQ],0
-        jz      @@Exit
-        mov     [BYTE ebx+_Inside],0
-        mov     eax,[DWORD ebx+_PrevIRQ]
-        mov     ebx,[DWORD ebx+_PrevIRQ+4]
-        mov     [DWORD _PrevIRQ],eax
-        mov     [DWORD _PrevIRQ+4],ebx
-        popad                       ; Restore all extended registers
-        pop     es
-        pop     ds
-        pop     ebx
-        jmp     [cs:_PrevIRQ]       ; Chain to previous IRQ handler
-
-cprocend
-cpublic _PM_irqISRTemplateEnd
-endif
-
-;----------------------------------------------------------------------------
-; PM_keyISR - keyboard interrupt subroutine dispatcher
-;----------------------------------------------------------------------------
-; Hardware interrupt handler for the keyboard interrupt, to dispatch control
-; to high level C based subroutines. We save the state of all registers
-; in this routine, and switch to a local stack. Interrupts are *off*
-; when we call the user code.
-;
-; NOTE: This routine switches to a local stack before calling any C code,
-;       and hence is _not_ re-entrant. However we ensure within this routine
-;       mutual exclusion to the keyboard handling routine.
-;----------------------------------------------------------------------------
-cprocfar    _PM_keyISR
-
-        push    ds              ; Save value of DS
-        push    es
-        pushad                  ; Save _all_ extended registers
-        cld                     ; Clear direction flag
-
-        LOAD_DS                 ; Load DS register
-
-        cmp     [BYTE KyInside],1   ; Check for mutual exclusion
-        je      @@Reissued
-
-        mov     [BYTE KyInside],1
-        NEWSTK  KyStack         ; Switch to local stack
-        call    [CPTR _PM_keyHandler]   ; Call C code
-        RESTSTK KyStack         ; Restore previous stack
-        mov     [BYTE KyInside],0
-
-@@Exit: popad                   ; Restore all extended registers
-        pop     es
-        pop     ds
-        iret                    ; Return from interrupt
-
-; When the BIOS keyboard handler needs to change the SHIFT status lights
-; on the keyboard, in the process of doing this the keyboard controller
-; re-issues another interrupt, while the current handler is still executing.
-; If we recieve another interrupt while still handling the current one,
-; then simply chain directly to the previous handler.
-;
-; Note that for most DOS extenders, the real mode interrupt handler that we
-; install takes care of this for us.
-
-@@Reissued:
-ifdef   TNT
-        push    eax
-        push    ebx
-        push    ecx
-        pushfd                  ; Push flags on stack to simulate interrupt
-        mov     ax,250Eh        ; Call real mode procedure function
-        mov     ebx,[_PM_prevRealKey]
-        mov     ecx,1           ; Copy real mode flags to real mode stack
-        int     21h             ; Call the real mode code
-        popfd
-        pop     ecx
-        pop     ebx
-        pop     eax
-else
-        pushf
-ifdef   USE_NASM
-        call far dword [_PM_prevKey]
-else
-        call    [_PM_prevKey]
-endif
-endif
-        jmp     @@Exit
-
-cprocend
-
-;----------------------------------------------------------------------------
-; PM_chainPrevkey - Chain to previous key interrupt and return
-;----------------------------------------------------------------------------
-; Chains to the previous key interrupt routine and returns control
-; back to the high level interrupt handler.
-;----------------------------------------------------------------------------
-cprocstart  PM_chainPrevKey
-
-ifdef   TNT
-        push    eax
-        push    ebx
-        push    ecx
-        pushfd                  ; Push flags on stack to simulate interrupt
-        mov     ax,250Eh        ; Call real mode procedure function
-        mov     ebx,[_PM_prevRealKey]
-        mov     ecx,1           ; Copy real mode flags to real mode stack
-        int     21h             ; Call the real mode code
-        popfd
-        pop     ecx
-        pop     ebx
-        pop     eax
-        ret
-else
-
-; YIKES! For some strange reason, when execution returns from the
-; previous keyboard handler, interrupts are re-enabled!! Since we expect
-; interrupts to remain off during the duration of our handler, this can
-; cause havoc. However our stack macros always turn off interrupts, so they
-; will be off when we exit this routine. Obviously there is a tiny weeny
-; window when interrupts will be enabled, but there is nothing we can
-; do about this.
-
-        SWAPSTK KyStack         ; Swap back to previous stack
-        pushf                   ; Push flags on stack to simulate interrupt
-ifdef   USE_NASM
-        call far dword [_PM_prevKey]
-else
-        call    [_PM_prevKey]
-endif
-        SWAPSTK KyStack         ; Swap back to C stack again
-        ret
-endif
-
-cprocend
-
-;----------------------------------------------------------------------------
-; PM_key15ISR - Int 15h keyboard interrupt subroutine dispatcher
-;----------------------------------------------------------------------------
-; This routine gets called if we have been called to handle the Int 15h
-; keyboard interrupt callout from real mode.
-;
-;   Entry:  AX  - Hardware scan code to process
-;   Exit:   AX  - Hardware scan code to process (0 to ignore)
-;----------------------------------------------------------------------------
-cprocfar    _PM_key15ISR
-
-        push    ds
-        push    es
-        LOAD_DS
-        cmp     ah,4Fh
-        jnz     @@NotOurs       ; Quit if not keyboard callout
-
-        pushad
-        cld                     ; Clear direction flag
-        xor     ah,ah           ; AX := scan code
-        NEWSTK  Ky15Stack       ; Switch to local stack
-        push    _ax
-        call    [CPTR _PM_key15Handler] ; Call C code
-        _add    sp,2,4
-        RESTSTK Ky15Stack       ; Restore previous stack
-        test    ax,ax
-        jz      @@1
-        stc                     ; Set carry to process as normal
-        jmp     @@2
-@@1:    clc                     ; Clear carry to ignore scan code
-@@2:    popad
-        jmp     @@Exit          ; We are done
-
-@@NotOurs:
-ifdef   TNT
-        push    eax
-        push    ebx
-        push    ecx
-        pushfd                  ; Push flags on stack to simulate interrupt
-        mov     ax,250Eh        ; Call real mode procedure function
-        mov     ebx,[_PM_prevRealKey15]
-        mov     ecx,1           ; Copy real mode flags to real mode stack
-        int     21h             ; Call the real mode code
-        popfd
-        pop     ecx
-        pop     ebx
-        pop     eax
-else
-        pushf
-ifdef   USE_NASM
-        call far dword [_PM_prevKey15]
-else
-        call    [_PM_prevKey15]
-endif
-endif
-@@Exit: pop     es
-        pop     ds
-ifdef flatmodel
-        retf    4
-else
-        retf    2
-endif
-
-cprocend
-
-;----------------------------------------------------------------------------
-; PM_breakISR - Control Break interrupt subroutine dispatcher
-;----------------------------------------------------------------------------
-; Hardware interrupt handler for the Ctrl-Break interrupt. We simply set
-; the Ctrl-Break flag to a 1 and leave (note that this is accessed through
-; a far pointer, as it may well be located in conventional memory).
-;----------------------------------------------------------------------------
-cprocfar    _PM_breakISR
-
-        sti
-        push    ds              ; Save value of DS
-        push    es
-        push    _bx
-
-        LOAD_DS                 ; Load DS register
-ifdef flatmodel
-        mov     ebx,[_PM_ctrlBPtr]
-else
-        les     bx,[_PM_ctrlBPtr]
-endif
-        mov     [UINT _ES _bx],1
-
-; Run alternate break handler code if installed
-
-        cmp     [CPTR _PM_breakHandler],0
-        je      @@Exit
-
-        pushad
-        mov     _ax,1
-        push    _ax
-        call    [CPTR _PM_breakHandler] ; Call C code
-        pop     _ax
-        popad
-
-@@Exit: pop     _bx
-        pop     es
-        pop     ds
-        iret                    ; Return from interrupt
-
-cprocend
-
-;----------------------------------------------------------------------------
-; int PM_ctrlBreakHit(int clearFlag)
-;----------------------------------------------------------------------------
-; Returns the current state of the Ctrl-Break flag and possibly clears it.
-;----------------------------------------------------------------------------
-cprocstart  PM_ctrlBreakHit
-
-        ARG     clearFlag:UINT
-
-        enter_c
-        pushf                   ; Save interrupt status
-        push    es
-ifdef flatmodel
-        mov     ebx,[_PM_ctrlBPtr]
-else
-        les     bx,[_PM_ctrlBPtr]
-endif
-        cli                     ; No interrupts thanks!
-        mov     _ax,[_ES _bx]
-        test    [BYTE clearFlag],1
-        jz      @@Done
-        mov     [UINT _ES _bx],0
-
-@@Done: pop     es
-        popf                    ; Restore interrupt status
-        leave_c
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; PM_ctrlCISR - Control Break interrupt subroutine dispatcher
-;----------------------------------------------------------------------------
-; Hardware interrupt handler for the Ctrl-C interrupt. We simply set
-; the Ctrl-C flag to a 1 and leave (note that this is accessed through
-; a far pointer, as it may well be located in conventional memory).
-;----------------------------------------------------------------------------
-cprocfar    _PM_ctrlCISR
-
-        sti
-        push    ds              ; Save value of DS
-        push    es
-        push    _bx
-
-        LOAD_DS                 ; Load DS register
-ifdef flatmodel
-        mov     ebx,[_PM_ctrlCPtr]
-else
-        les     bx,[_PM_ctrlCPtr]
-endif
-        mov     [UINT _ES _bx],1
-
-; Run alternate break handler code if installed
-
-        cmp     [CPTR _PM_breakHandler],0
-        je      @@Exit
-
-        pushad
-        mov     _ax,0
-        push    _ax
-        call    [CPTR _PM_breakHandler] ; Call C code
-        pop     _ax
-        popad
-
-@@Exit: pop     _bx
-        pop     es
-        pop     ds
-        iret                    ; Return from interrupt
-        iretd
-
-cprocend
-
-;----------------------------------------------------------------------------
-; int PM_ctrlCHit(int clearFlag)
-;----------------------------------------------------------------------------
-; Returns the current state of the Ctrl-C flag and possibly clears it.
-;----------------------------------------------------------------------------
-cprocstart  PM_ctrlCHit
-
-        ARG     clearFlag:UINT
-
-        enter_c
-        pushf                   ; Save interrupt status
-        push    es
-ifdef flatmodel
-        mov     ebx,[_PM_ctrlCPtr]
-else
-        les     bx,[_PM_ctrlCPtr]
-endif
-        cli                     ; No interrupts thanks!
-        mov     _ax,[_ES _bx]
-        test    [BYTE clearFlag],1
-        jz      @@Done
-        mov     [UINT _ES _bx],0
-
-@@Done:
-        pop     es
-        popf                    ; Restore interrupt status
-        leave_c
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; PM_criticalISR - Control Error handler interrupt subroutine dispatcher
-;----------------------------------------------------------------------------
-; Interrupt handler for the MSDOS Critical Error interrupt, to dispatch
-; control to high level C based subroutines. We save the state of all
-; registers in this routine, and switch to a local stack. We also pass
-; the values of the AX and DI registers to the as pointers, so that the
-; values can be modified before returning to MSDOS.
-;----------------------------------------------------------------------------
-cprocfar    _PM_criticalISR
-
-        sti
-        push    ds              ; Save value of DS
-        push    es
-        push    _bx             ; Save register values changed
-        cld                     ; Clear direction flag
-
-        LOAD_DS                 ; Load DS register
-ifdef flatmodel
-        mov     ebx,[_PM_critPtr]
-else
-        les     bx,[_PM_critPtr]
-endif
-        mov     [_ES _bx],ax
-        mov     [_ES _bx+2],di
-
-; Run alternate critical handler code if installed
-
-        cmp     [CPTR _PM_critHandler],0
-        je      @@NoAltHandler
-
-        pushad
-        push    _di
-        push    _ax
-        call    [CPTR _PM_critHandler]  ; Call C code
-        _add    sp,4,8
-        popad
-
-        pop     _bx
-        pop     es
-        pop     ds
-        iret                    ; Return from interrupt
-
-@@NoAltHandler:
-        mov     ax,3            ; Tell MSDOS to fail the operation
-        pop     _bx
-        pop     es
-        pop     ds
-        iret                    ; Return from interrupt
-
-cprocend
-
-;----------------------------------------------------------------------------
-; int PM_criticalError(int *axVal,int *diVal,int clearFlag)
-;----------------------------------------------------------------------------
-; Returns the current state of the critical error flags, and the values that
-; MSDOS passed in the AX and DI registers to our handler.
-;----------------------------------------------------------------------------
-cprocstart  PM_criticalError
-
-        ARG     axVal:DPTR, diVal:DPTR, clearFlag:UINT
-
-        enter_c
-        pushf                   ; Save interrupt status
-        push    es
-ifdef flatmodel
-        mov     ebx,[_PM_critPtr]
-else
-        les     bx,[_PM_critPtr]
-endif
-        cli                     ; No interrupts thanks!
-        xor     _ax,_ax
-        xor     _di,_di
-        mov     ax,[_ES _bx]
-        mov     di,[_ES _bx+2]
-        test    [BYTE clearFlag],1
-        jz      @@NoClear
-        mov     [ULONG _ES _bx],0
-@@NoClear:
-        _les    _bx,[axVal]
-        mov     [_ES _bx],_ax
-        _les    _bx,[diVal]
-        mov     [_ES _bx],_di
-        pop     es
-        popf                    ; Restore interrupt status
-        leave_c
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void PM_setMouseHandler(int mask, PM_mouseHandler mh)
-;----------------------------------------------------------------------------
-cprocstart  _PM_setMouseHandler
-
-        ARG     mouseMask:UINT
-
-        enter_c
-        push    es
-
-        mov     ax,0Ch          ; AX := Function 12 - install interrupt sub
-        mov     _cx,[mouseMask] ; CX := mouse mask
-        mov     _dx,offset _PM_mouseISR
-        push    cs
-        pop     es              ; ES:_DX -> mouse handler
-        int     33h             ; Call mouse driver
-
-        pop     es
-        leave_c
-        ret
-
-cprocend
-
-ifdef flatmodel
-
-;----------------------------------------------------------------------------
-; void PM_mousePMCB(void)
-;----------------------------------------------------------------------------
-; Mouse realmode callback routine. Upon entry to this routine, we recieve
-; the following from the DPMI server:
-;
-;   Entry:  DS:_SI  -> Real mode stack at time of call
-;           ES:_DI  -> Real mode register data structure
-;           SS:_SP  -> Locked protected mode stack to use
-;----------------------------------------------------------------------------
-cprocfar    _PM_mousePMCB
-
-        pushad
-        mov     eax,[es:_di+1Ch]    ; Load register values from real mode
-        mov     ebx,[es:_di+10h]
-        mov     ecx,[es:_di+18h]
-        mov     edx,[es:_di+14h]
-        mov     esi,[es:_di+04h]
-        mov     edi,[es:_di]
-        call    _PM_mouseISR        ; Call the mouse handler
-        popad
-
-        mov     ax,[ds:_si]
-        mov     [es:_di+2Ah],ax     ; Plug in return IP address
-        mov     ax,[ds:_si+2]
-        mov     [es:_di+2Ch],ax     ; Plug in return CS value
-        add     [WORD es:_di+2Eh],4 ; Remove return address from stack
-        iret                        ; Go back to real mode!
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void PM_int10PMCB(void)
-;----------------------------------------------------------------------------
-; int10 realmode callback routine. Upon entry to this routine, we recieve
-; the following from the DPMI server:
-;
-;   Entry:  DS:ESI  -> Real mode stack at time of call
-;           ES:EDI  -> Real mode register data structure
-;           SS:ESP  -> Locked protected mode stack to use
-;----------------------------------------------------------------------------
-cprocfar        _PM_int10PMCB
-
-        pushad
-        push    ds
-        push    es
-        push    fs
-
-        pushfd
-        pop     eax
-        mov     [es:edi+20h],ax     ; Save return flag status
-        mov     ax,[ds:esi]
-        mov     [es:edi+2Ah],ax     ; Plug in return IP address
-        mov     ax,[ds:esi+2]
-        mov     [es:edi+2Ch],ax     ; Plug in return CS value
-        add     [WORD es:edi+2Eh],4 ; Remove return address from stack
-
-; Call the install int10 handler in protected mode. This function gets called
-; with DS set to the current data selector, and ES:EDI pointing the the
-; real mode DPMI register structure at the time of the interrupt. The
-; handle must be written in assembler to be able to extract the real mode
-; register values from the structure
-
-        push    es
-        pop     fs                  ; FS:EDI -> real mode registers
-        LOAD_DS
-        NEWSTK  Int10Stack          ; Switch to local stack
-
-        call    [_PM_int10Handler]
-
-        RESTSTK Int10Stack          ; Restore previous stack
-        pop     fs
-        pop     es
-        pop     ds
-        popad
-        iret                        ; Go back to real mode!
-
-cprocend
-
-endif
-
-cpublic _PM_pmdosCodeEnd
-
-endcodeseg  _pmdos
-
-        END                     ; End of module
diff --git a/board/MAI/bios_emulator/scitech/src/pm/dos/_vflat.asm b/board/MAI/bios_emulator/scitech/src/pm/dos/_vflat.asm
deleted file mode 100644 (file)
index 34985a9..0000000
+++ /dev/null
@@ -1,652 +0,0 @@
-;****************************************************************************
-;*
-;*                  SciTech OS Portability Manager Library
-;*
-;*  ========================================================================
-;*
-;*    The contents of this file are subject to the SciTech MGL Public
-;*    License Version 1.0 (the "License"); you may not use this file
-;*    except in compliance with the License. You may obtain a copy of
-;*    the License at http://www.scitechsoft.com/mgl-license.txt
-;*
-;*    Software distributed under the License is distributed on an
-;*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-;*    implied. See the License for the specific language governing
-;*    rights and limitations under the License.
-;*
-;*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-;*
-;*    The Initial Developer of the Original Code is SciTech Software, Inc.
-;*    All Rights Reserved.
-;*
-;*  ========================================================================
-;*
-;*            Based on original code Copyright 1994 Otto Chrons
-;*
-;* Language:    80386 Assembler, TASM 4.0 or later
-;* Environment: IBM PC 32 bit protected mode
-;*
-;* Description: Low level page fault handler for virtual linear framebuffers.
-;*
-;****************************************************************************
-
-        IDEAL
-        JUMPS
-
-include "scitech.mac"           ; Memory model macros
-
-header      _vflat              ; Set up memory model
-
-VFLAT_START     EQU 0F0000000h
-VFLAT_END       EQU 0F03FFFFFh
-PAGE_PRESENT    EQU 1
-PAGE_NOTPRESENT EQU 0
-PAGE_READ       EQU 0
-PAGE_WRITE      EQU 2
-
-ifdef   DOS4GW
-
-;----------------------------------------------------------------------------
-; DOS4G/W flat linear framebuffer emulation.
-;----------------------------------------------------------------------------
-
-begdataseg  _vflat
-
-; Near pointers to the page directory base and our page tables. All of
-; this memory is always located in the first Mb of DOS memory.
-
-PDBR            dd  0               ; Page directory base register (CR3)
-accessPageAddr  dd  0
-accessPageTable dd  0
-
-; CauseWay page directory & 1st page table linear addresses.
-
-CauseWayDIRLinear dd 0
-CauseWay1stLinear dd 0
-
-; Place to store a copy of the original Page Table Directory before we
-; intialised our virtual buffer code.
-
-pageDirectory:  resd 1024           ; Saved page table directory
-
-ValidCS         dw  0               ; Valid CS for page faults
-Ring0CS         dw  0               ; Our ring 0 code selector
-LastPage        dd  0               ; Last page we mapped in
-BankFuncBuf:    resb 101            ; Place to store bank switch code
-BankFuncPtr     dd  offset BankFuncBuf
-
-INT14Gate:
-INT14Offset     dd      0           ; eip of original vector
-INT14Selector   dw      0           ; cs of original vector
-
-        cextern _PM_savedDS,USHORT
-        cextern VF_haveCauseWay,BOOL
-
-enddataseg  _vflat
-
-begcodeseg  _vflat              ; Start of code segment
-
-        cextern VF_malloc,FPTR
-
-;----------------------------------------------------------------------------
-; PF_handler64k - Page fault handler for 64k banks
-;----------------------------------------------------------------------------
-; The handler below is a 32 bit ring 0 page fault handler.  It receives
-; control immediately after any page fault or after an IRQ6 (hardware
-; interrupt). This provides the fastest possible handling of page faults
-; since it jump directly here.  If this is a page fault, the number
-; immediately on the stack will be an error code, at offset 4 will be
-; the eip of the faulting instruction, at offset 8 will be the cs of the
-; faulting instruction.  If it is a hardware interrupt, it will not have
-; the error code and the eflags will be at offset 8.
-;----------------------------------------------------------------------------
-cprocfar    PF_handler64k
-
-; Check if this is a processor exeception or a page fault
-
-        push    eax
-        mov     ax,[cs:ValidCS]     ; Use CS override to access data
-        cmp     [ss:esp+12],ax      ; Is this a page fault?
-        jne     @@ToOldHandler      ; Nope, jump to the previous handler
-
-; Get address of page fault and check if within our handlers range
-
-        mov     eax,cr2             ; EBX has page fault linear address
-        cmp     eax,VFLAT_START     ; Is the fault less than ours?
-        jb      @@ToOldHandler      ; Yep, go to previous handler
-        cmp     eax,VFLAT_END       ; Is the fault more than ours?
-        jae     @@ToOldHandler      ; Yep, go to previous handler
-
-; This is our page fault, so we need to handle it
-
-        pushad
-        push    ds
-        push    es
-        mov     ebx,eax             ; EBX := page fault address
-        and     ebx,invert 0FFFFh   ; Mask to 64k bank boundary
-        mov     ds,[cs:_PM_savedDS]; Load segment registers
-        mov     es,[cs:_PM_savedDS]
-
-; Map in the page table for our virtual framebuffer area for modification
-
-        mov     edi,[PDBR]          ; EDI points to page directory
-        mov     edx,ebx             ; EDX = linear address
-        shr     edx,22              ; EDX = offset to page directory
-        mov     edx,[edx*4+edi]     ; EDX = physical page table address
-        mov     eax,edx
-        mov     edx,[accessPageTable]
-        or      eax,7
-        mov     [edx],eax
-        mov     eax,cr3
-        mov     cr3,eax             ; Update page table cache
-
-; Mark all pages valid for the new page fault area
-
-        mov     esi,ebx             ; ESI := linear address for page
-        shr     esi,10
-        and     esi,0FFFh           ; Offset into page table
-        add     esi,[accessPageAddr]
-ifdef   USE_NASM
-%assign off 0
-%rep 16
-        or      [DWORD esi+off],0000000001h ; Enable pages
-%assign off off+4
-%endrep
-else
-off = 0
-REPT    16
-        or      [DWORD esi+off],0000000001h ; Enable pages
-off = off+4
-ENDM
-endif
-
-; Mark all pages invalid for the previously mapped area
-
-        xchg    esi,[LastPage]      ; Save last page for next page fault
-        test    esi,esi
-        jz      @@DoneMapping       ; Dont update if first time round
-ifdef   USE_NASM
-%assign off 0
-%rep 16
-        or      [DWORD esi+off],0FFFFFFFEh  ; Disable pages
-%assign off off+4
-%endrep
-else
-off = 0
-REPT    16
-        and     [DWORD esi+off],0FFFFFFFEh  ; Disable pages
-off = off+4
-ENDM
-endif
-
-@@DoneMapping:
-        mov     eax,cr3
-        mov     cr3,eax             ; Flush the TLB
-
-; Now program the new SuperVGA starting bank address
-
-        mov     eax,ebx             ; EAX := page fault address
-        shr     eax,16
-        and     eax,0FFh            ; Mask to 0-255
-        call    [BankFuncPtr]       ; Call the bank switch function
-
-        pop     es
-        pop     ds
-        popad
-        pop     eax
-        add     esp,4               ; Pop the error code from stack
-        iretd                       ; Return to faulting instruction
-
-@@ToOldHandler:
-        pop     eax
-ifdef   USE_NASM
-        jmp far dword [cs:INT14Gate]; Chain to previous handler
-else
-        jmp     [FWORD cs:INT14Gate]; Chain to previous handler
-endif
-
-cprocend
-
-;----------------------------------------------------------------------------
-; PF_handler4k  - Page fault handler for 4k banks
-;----------------------------------------------------------------------------
-; The handler below is a 32 bit ring 0 page fault handler.  It receives
-; control immediately after any page fault or after an IRQ6 (hardware
-; interrupt). This provides the fastest possible handling of page faults
-; since it jump directly here.  If this is a page fault, the number
-; immediately on the stack will be an error code, at offset 4 will be
-; the eip of the faulting instruction, at offset 8 will be the cs of the
-; faulting instruction.  If it is a hardware interrupt, it will not have
-; the error code and the eflags will be at offset 8.
-;----------------------------------------------------------------------------
-cprocfar    PF_handler4k
-
-; Fill in when we have tested all the 64Kb code
-
-ifdef   USE_NASM
-        jmp far dword [cs:INT14Gate]; Chain to previous handler
-else
-        jmp     [FWORD cs:INT14Gate]; Chain to previous handler
-endif
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void InstallFaultHandler(void *baseAddr,int bankSize)
-;----------------------------------------------------------------------------
-; Installes the page fault handler directly int the interrupt descriptor
-; table for maximum performance. This of course requires ring 0 access,
-; but none of this stuff will run without ring 0!
-;----------------------------------------------------------------------------
-cprocstart  InstallFaultHandler
-
-        ARG     baseAddr:ULONG, bankSize:UINT
-
-        enter_c
-
-        mov     [DWORD LastPage],0  ; No pages have been mapped
-        mov     ax,cs
-        mov     [ValidCS],ax        ; Save CS value for page faults
-
-; Put address of our page fault handler into the IDT directly
-
-        sub     esp,6               ; Allocate space on stack
-ifdef   USE_NASM
-        sidt    [ss:esp]            ; Store pointer to IDT
-else
-        sidt    [FWORD ss:esp]      ; Store pointer to IDT
-endif
-        pop     ax                  ; add esp,2
-        pop     eax                 ; Absolute address of IDT
-        add     eax,14*8            ; Point to Int #14
-
-; Note that Interrupt gates do not have the high and low word of the
-; offset in adjacent words in memory, there are 4 bytes separating them.
-
-        mov     ecx,[eax]           ; Get cs and low 16 bits of offset
-        mov     edx,[eax+6]         ; Get high 16 bits of offset in dx
-        shl     edx,16
-        mov     dx,cx               ; edx has offset
-        mov     [INT14Offset],edx   ; Save offset
-        shr     ecx,16
-        mov     [INT14Selector],cx  ; Save original cs
-        mov     [eax+2],cs          ; Install new cs
-        mov     edx,offset PF_handler64k
-        cmp     [UINT bankSize],4
-        jne     @@1
-        mov     edx,offset PF_handler4k
-@@1:    mov     [eax],dx            ; Install low word of offset
-        shr     edx,16
-        mov     [eax+6],dx          ; Install high word of offset
-
-        leave_c
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void RemoveFaultHandler(void)
-;----------------------------------------------------------------------------
-; Closes down the virtual framebuffer services and restores the previous
-; page fault handler.
-;----------------------------------------------------------------------------
-cprocstart  RemoveFaultHandler
-
-        enter_c
-
-; Remove page fault handler from IDT
-
-        sub     esp,6               ; Allocate space on stack
-ifdef   USE_NASM
-        sidt    [ss:esp]            ; Store pointer to IDT
-else
-        sidt    [FWORD ss:esp]      ; Store pointer to IDT
-endif
-
-        pop     ax                  ; add esp,2
-        pop     eax                 ; Absolute address of IDT
-        add     eax,14*8            ; Point to Int #14
-        mov     cx,[INT14Selector]
-        mov     [eax+2],cx          ; Restore original CS
-        mov     edx,[INT14Offset]
-        mov     [eax],dx            ; Install low word of offset
-        shr     edx,16
-        mov     [eax+6],dx          ; Install high word of offset
-
-        leave_c
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void InstallBankFunc(int codeLen,void *bankFunc)
-;----------------------------------------------------------------------------
-; Installs the bank switch function by relocating it into our data segment
-; and making it into a callable function. We do it this way to make the
-; code identical to the way that the VflatD devices work under Windows.
-;----------------------------------------------------------------------------
-cprocstart  InstallBankFunc
-
-        ARG     codeLen:UINT, bankFunc:DPTR
-
-        enter_c
-
-        mov     esi,[bankFunc]      ; Copy the code into buffer
-        mov     edi,offset BankFuncBuf
-        mov     ecx,[codeLen]
-    rep movsb
-        mov     [BYTE edi],0C3h     ; Terminate the function with a near ret
-
-        leave_c
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; int InitPaging(void)
-;----------------------------------------------------------------------------
-; Initializes paging system. If paging is not enabled, builds a page table
-; directory and page tables for physical memory
-;
-;   Exit:       0   - Successful
-;               -1  - Couldn't initialize paging mechanism
-;----------------------------------------------------------------------------
-cprocstart  InitPaging
-
-        push    ebx
-        push    ecx
-        push    edx
-        push    esi
-        push    edi
-
-; Are we running under CauseWay?
-
-        mov     ax,0FFF9h
-        int     31h
-        jc      @@NotCauseway
-        cmp     ecx,"CAUS"
-        jnz     @@NotCauseway
-        cmp     edx,"EWAY"
-        jnz     @@NotCauseway
-
-        mov     [BOOL VF_haveCauseWay],1
-        mov     [CauseWayDIRLinear],esi
-        mov     [CauseWay1stLinear],edi
-
-; Check for DPMI
-
-        mov     ax,0ff00h
-        push    es
-        int     31h
-        pop     es
-        shr     edi,2
-        and     edi,3
-        cmp     edi,2
-        jz      @@ErrExit               ; Not supported under DPMI
-
-        mov     eax,[CauseWayDIRLinear]
-        jmp     @@CopyCR3
-
-@@NotCauseway:
-        mov     ax,cs
-        test    ax,3                    ; Which ring are we running
-        jnz     @@ErrExit               ; Needs zero ring to access
-                                        ; page tables (CR3)
-        mov     eax,cr0                 ; Load CR0
-        test    eax,80000000h           ; Is paging enabled?
-        jz      @@ErrExit               ; No, we must have paging!
-
-        mov     eax,cr3                 ; Load directory address
-        and     eax,0FFFFF000h
-
-@@CopyCR3:
-        mov     [PDBR],eax              ; Save it
-        mov     esi,eax
-        mov     edi,offset pageDirectory
-        mov     ecx,1024
-        cld
-        rep     movsd                   ; Copy the original page table directory
-        cmp     [DWORD accessPageAddr],0; Check if we have allocated page
-        jne     @@HaveRealMem           ; table already (we cant free it)
-
-        mov     eax,0100h               ; DPMI DOS allocate
-        mov     ebx,8192/16
-        int     31h                     ; Allocate 8192 bytes
-        and     eax,0FFFFh
-        shl     eax,4                   ; EAX points to newly allocated memory
-        add     eax,4095
-        and     eax,0FFFFF000h          ; Page align
-        mov     [accessPageAddr],eax
-
-@@HaveRealMem:
-        mov     eax,[accessPageAddr]    ; EAX -> page table in 1st Mb
-        shr     eax,12
-        and     eax,3FFh                ; Page table offset
-        shl     eax,2
-        cmp     [BOOL VF_haveCauseWay],0
-        jz      @@NotCW0
-        mov     ebx,[CauseWay1stLinear]
-        jmp     @@Put1st
-
-@@NotCW0:
-        mov     ebx,[PDBR]
-        mov     ebx,[ebx]
-        and     ebx,0FFFFF000h          ; Page table for 1st megabyte
-
-@@Put1st:
-        add     eax,ebx
-        mov     [accessPageTable],eax
-        sub     eax,eax                 ; No error
-        jmp     @@Exit
-
-@@ErrExit:
-        mov     eax,-1
-
-@@Exit: pop     edi
-        pop     esi
-        pop     edx
-        pop     ecx
-        pop     ebx
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void ClosePaging(void)
-;----------------------------------------------------------------------------
-; Closes the paging system
-;----------------------------------------------------------------------------
-cprocstart  ClosePaging
-
-        push    eax
-        push    ecx
-        push    edx
-        push    esi
-        push    edi
-
-        mov     eax,[accessPageAddr]
-        call    AccessPage              ; Restore AccessPage mapping
-        mov     edi,[PDBR]
-        mov     esi,offset pageDirectory
-        mov     ecx,1024
-        cld
-        rep     movsd                   ; Restore the original page table directory
-
-@@Exit: pop     edi
-        pop     esi
-        pop     edx
-        pop     ecx
-        pop     eax
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; long AccessPage(long phys)
-;----------------------------------------------------------------------------
-; Maps a known page to given physical memory
-;   Entry:      EAX - Physical memory
-;   Exit:       EAX - Linear memory address of mapped phys mem
-;----------------------------------------------------------------------------
-cprocstatic     AccessPage
-
-        push    edx
-        mov     edx,[accessPageTable]
-        or      eax,7
-        mov     [edx],eax
-        mov     eax,cr3
-        mov     cr3,eax                 ; Update page table cache
-        mov     eax,[accessPageAddr]
-        pop     edx
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; long GetPhysicalAddress(long linear)
-;----------------------------------------------------------------------------
-; Returns the physical address of linear address
-;   Entry:      EAX - Linear address to convert
-;   Exit:       EAX - Physical address
-;----------------------------------------------------------------------------
-cprocstatic     GetPhysicalAddress
-
-        push    ebx
-        push    edx
-        mov     edx,eax
-        shr     edx,22                  ; EDX is the directory offset
-        mov     ebx,[PDBR]
-        mov     edx,[edx*4+ebx]         ; Load page table address
-        push    eax
-        mov     eax,edx
-        call    AccessPage              ; Access the page table
-        mov     edx,eax
-        pop     eax
-        shr     eax,12
-        and     eax,03FFh               ; EAX offset into page table
-        mov     eax,[edx+eax*4]         ; Load physical address
-        and     eax,0FFFFF000h
-        pop     edx
-        pop     ebx
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void CreatePageTable(long pageDEntry)
-;----------------------------------------------------------------------------
-; Creates a page table for specific address (4MB)
-;       Entry:  EAX - Page directory entry (top 10-bits of address)
-;----------------------------------------------------------------------------
-cprocstatic     CreatePageTable
-
-        push    ebx
-        push    ecx
-        push    edx
-        push    edi
-        mov     ebx,eax                 ; Save address
-        mov     eax,8192
-        push    eax
-        call    VF_malloc              ; Allocate page table directory
-        add     esp,4
-        add     eax,0FFFh
-        and     eax,0FFFFF000h          ; Page align (4KB)
-        mov     edi,eax                 ; Save page table linear address
-        sub     eax,eax                 ; Fill with zero
-        mov     ecx,1024
-        cld
-        rep     stosd                   ; Clear page table
-        sub     edi,4096
-        mov     eax,edi
-        call    GetPhysicalAddress
-        mov     edx,[PDBR]
-        or      eax,7                   ; Present/write/user bit
-        mov     [edx+ebx*4],eax         ; Save physical address into page directory
-        mov     eax,cr3
-        mov     cr3,eax                 ; Update page table cache
-        pop     edi
-        pop     edx
-        pop     ecx
-        pop     ebx
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void MapPhysical2Linear(ulong pAddr, ulong lAddr, int pages, int flags);
-;----------------------------------------------------------------------------
-; Maps physical memory into linear memory
-;   Entry:      pAddr   - Physical address
-;               lAddr   - Linear address
-;               pages   - Number of 4K pages to map
-;               flags   - Page flags
-;                           bit 0   =       present
-;                           bit 1   =       Read(0)/Write(1)
-;----------------------------------------------------------------------------
-cprocstart  MapPhysical2Linear
-
-        ARG     pAddr:ULONG, lAddr:ULONG, pages:UINT, pflags:UINT
-
-        enter_c
-
-        and     [ULONG pAddr],0FFFFF000h; Page boundary
-        and     [ULONG lAddr],0FFFFF000h; Page boundary
-        mov     ecx,[pflags]
-        and     ecx,11b                 ; Just two bits
-        or      ecx,100b                ; Supervisor bit
-        mov     [pflags],ecx
-
-        mov     edx,[lAddr]
-        shr     edx,22                  ; EDX = Directory
-        mov     esi,[PDBR]
-        mov     edi,[pages]             ; EDI page count
-        mov     ebx,[lAddr]
-
-@@CreateLoop:
-        mov     ecx,[esi+edx*4]         ; Load page table address
-        test    ecx,1                   ; Is it present?
-        jnz     @@TableOK
-        mov     eax,edx
-        call    CreatePageTable         ; Create a page table
-@@TableOK:
-        mov     eax,ebx
-        shr     eax,12
-        and     eax,3FFh
-        sub     eax,1024
-        neg     eax                     ; EAX = page count in this table
-        inc     edx                     ; Next table
-        mov     ebx,0                   ; Next time we'll map 1K pages
-        sub     edi,eax                 ; Subtract mapped pages from page count
-        jns     @@CreateLoop            ; Create more tables if necessary
-
-        mov     ecx,[pages]             ; ECX = Page count
-        mov     esi,[lAddr]
-        shr     esi,12                  ; Offset part isn't needed
-        mov     edi,[pAddr]
-@@MappingLoop:
-        mov     eax,esi
-        shr     eax,10                  ; EAX = offset to page directory
-        mov     ebx,[PDBR]
-        mov     eax,[eax*4+ebx]         ; EAX = page table address
-        call    AccessPage
-        mov     ebx,esi
-        and     ebx,3FFh                ; EBX = offset to page table
-        mov     edx,edi
-        add     edi,4096                ; Next physical address
-        inc     esi                     ; Next linear page
-        or      edx,[pflags]            ; Update flags...
-        mov     [eax+ebx*4],edx         ; Store page table entry
-        loop    @@MappingLoop
-        mov     eax,cr3
-        mov     cr3,eax                 ; Update page table cache
-
-        leave_c
-        ret
-
-cprocend
-
-endcodeseg  _vflat
-
-endif
-
-        END                     ; End of module
diff --git a/board/MAI/bios_emulator/scitech/src/pm/dos/cpuinfo.c b/board/MAI/bios_emulator/scitech/src/pm/dos/cpuinfo.c
deleted file mode 100644 (file)
index ee117c7..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/****************************************************************************
-*
-*                         Ultra Long Period Timer
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  DOS
-*
-* Description:  MSDOS specific code for the CPU detection module.
-*
-****************************************************************************/
-
-/*----------------------------- Implementation ----------------------------*/
-
-/* External timing function */
-
-void __ZTimerInit(void);
-
-/****************************************************************************
-REMARKS:
-Do nothing for DOS because we don't have thread priorities.
-****************************************************************************/
-#define SetMaxThreadPriority()      0
-
-/****************************************************************************
-REMARKS:
-Do nothing for DOS because we don't have thread priorities.
-****************************************************************************/
-#define RestoreThreadPriority(i)    (void)(i)
-
-/****************************************************************************
-REMARKS:
-Initialise the counter and return the frequency of the counter.
-****************************************************************************/
-static void GetCounterFrequency(
-    CPU_largeInteger *freq)
-{
-    ulong   resolution;
-
-    __ZTimerInit();
-    ULZTimerResolution(&resolution);
-    freq->low = (ulong)(10000000000.0 / resolution);
-    freq->high = 0;
-}
-
-/****************************************************************************
-REMARKS:
-Read the counter and return the counter value.
-****************************************************************************/
-#define GetCounter(t)                   \
-{                                       \
-    (t)->low = ULZReadTime() * 10000L;  \
-    (t)->high = 0;                      \
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/dos/event.c b/board/MAI/bios_emulator/scitech/src/pm/dos/event.c
deleted file mode 100644 (file)
index a969d11..0000000
+++ /dev/null
@@ -1,494 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  32-bit DOS
-*
-* Description:  32-bit DOS implementation for the SciTech cross platform
-*               event library.
-*
-****************************************************************************/
-
-/*--------------------------- Global variables ----------------------------*/
-
-ibool _VARAPI   _EVT_useEvents = true;  /* True to use event handling   */
-ibool _VARAPI   _EVT_installed = 0;     /* Event handers installed?     */
-uchar _VARAPI   *_EVT_biosPtr = NULL;   /* Pointer to the BIOS data area */
-static ibool    haveMouse = false;      /* True if we have a mouse      */
-
-/*---------------------------- Implementation -----------------------------*/
-
-/* External assembler functions */
-
-void    EVTAPI _EVT_pollJoystick(void);
-uint    EVTAPI _EVT_disableInt(void);
-uint    EVTAPI _EVT_restoreInt(uint flags);
-void    EVTAPI _EVT_codeStart(void);
-void    EVTAPI _EVT_codeEnd(void);
-void    EVTAPI _EVT_cCodeStart(void);
-void    EVTAPI _EVT_cCodeEnd(void);
-int     EVTAPI _EVT_getKeyCode(void);
-void    EVTAPI _EVT_pumpMessages(void);
-int     EVTAPI EVT_rdinx(int port,int index);
-void    EVTAPI EVT_wrinx(int port,int index,int value);
-
-#ifdef NO_KEYBOARD_INTERRUPT
-/****************************************************************************
-REMARKS:
-This function is used to pump all keyboard messages from the BIOS keyboard
-handler into our event queue. This can be used to avoid using the
-installable keyboard handler if this is causing problems.
-****************************************************************************/
-static void EVTAPI _EVT_pumpMessages(void)
-{
-    RMREGS  regs;
-       uint    key,ps;
-
-       /* Since the keyboard ISR has not been installed if NO_IDE_BUG has
-        * been defined, we first check for any pending keyboard events
-        * here, and if there are some insert them into the event queue to
-        * be picked up later - what a kludge.
-        */
-       while ((key = _EVT_getKeyCode()) != 0) {
-               ps = _EVT_disableInt();
-               addKeyEvent(EVT_KEYDOWN, key);
-               _EVT_restoreInt(ps);
-               }
-
-    regs.x.ax = 0x0B;           /* Reset Move Mouse */
-    PM_int86(0x33,&regs,&regs);
-}
-#endif
-
-/****************************************************************************
-REMARKS:
-This function is used to return the number of ticks since system
-startup in milliseconds. This should be the same value that is placed into
-the time stamp fields of events, and is used to implement auto mouse down
-events.
-****************************************************************************/
-ulong _EVT_getTicks(void)
-{
-    return (ulong)PM_getLong(_EVT_biosPtr+0x6C) * 55UL;
-}
-
-/****************************************************************************
-REMARKS:
-Reboots the machine from DOS (warm boot)
-****************************************************************************/
-static void Reboot(void)
-{
-    PMREGS  regs;
-    PMSREGS sregs;
-
-    ushort *rebootType = PM_mapRealPointer(0x40,0x72);
-    *rebootType = 0x1234;
-    PM_callRealMode(0xFFFF,0x0000,&regs,&sregs);
-}
-
-/****************************************************************************
-REMARKS:
-Include generic raw scancode keyboard module.
-****************************************************************************/
-#define SUPPORT_CTRL_ALT_DEL
-#include "common/keyboard.c"
-
-/****************************************************************************
-REMARKS:
-This function fools the DOS mouse driver into thinking that it is running
-in graphics mode, rather than text mode so we always get virtual coordinates
-correctly rather than character coordinates.
-****************************************************************************/
-int _EVT_foolMouse(void)
-{
-    int oldmode = PM_getByte(_EVT_biosPtr+0x49);
-    PM_setByte(_EVT_biosPtr+0x49,0x10);
-    oldmode |= (EVT_rdinx(0x3C4,0x2) << 8);
-    return oldmode;
-}
-
-/****************************************************************************
-REMARKS:
-This function unfools the DOS mouse driver after we have finished calling it.
-****************************************************************************/
-void _EVT_unfoolMouse(
-    int oldmode)
-{
-    PM_setByte(_EVT_biosPtr+0x49,oldmode);
-
-    /* Some mouse drivers reset the plane mask register for VGA plane 4
-     * modes, which screws up the display on some VGA compatible controllers
-     * in SuperVGA modes. We reset the value back again in here to solve
-     * the problem.
-     */
-    EVT_wrinx(0x3C4,0x2,oldmode >> 8);
-}
-
-/****************************************************************************
-REMARKS:
-Determines if we have a mouse attached and functioning.
-****************************************************************************/
-static ibool detectMouse(void)
-{
-    RMREGS  regs;
-    RMSREGS sregs;
-    uchar   *p;
-    ibool   retval;
-
-    regs.x.ax = 0x3533;                 /* Get interrupt vector 0x33    */
-    PM_int86x(0x21,&regs,&regs,&sregs);
-
-    /* Check that interrupt vector 0x33 is not a zero, and that the first
-     * instruction in the interrupt vector is not an IRET instruction
-     */
-    p = PM_mapRealPointer(sregs.es, regs.x.bx);
-    retval = ((sregs.es != 0) || (regs.x.bx != 0)) && (PM_getByte(p) != 207);
-    return retval;
-}
-
-/****************************************************************************
-PARAMETERS:
-what        - Event code
-message     - Event message
-x,y         - Mouse position at time of event
-but_stat    - Mouse button status at time of event
-
-REMARKS:
-Adds a new mouse event to the event queue. This routine is called from within
-the mouse interrupt subroutine, so it must be efficient.
-
-NOTE:   Interrupts MUST be OFF while this routine is called to ensure we have
-       mutually exclusive access to our internal data structures for
-       interrupt driven systems (like under DOS).
-****************************************************************************/
-static void addMouseEvent(
-    uint what,
-    uint message,
-    int x,
-    int y,
-    int mickeyX,
-    int mickeyY,
-    uint but_stat)
-{
-    event_t evt;
-
-    if (EVT.count < EVENTQSIZE) {
-       /* Save information in event record. */
-       evt.when = _EVT_getTicks();
-       evt.what = what;
-       evt.message = message;
-       evt.modifiers = but_stat;
-       evt.where_x = x;                /* Save mouse event position    */
-       evt.where_y = y;
-       evt.relative_x = mickeyX;
-       evt.relative_y = mickeyY;
-       evt.modifiers |= EVT.keyModifiers;
-       addEvent(&evt);                 /* Add to tail of event queue   */
-       }
-}
-
-/****************************************************************************
-PARAMETERS:
-mask        - Event mask
-butstate    - Button state
-x           - Mouse x coordinate
-y           - Mouse y coordinate
-
-REMARKS:
-Mouse event handling routine. This gets called when a mouse event occurs,
-and we call the addMouseEvent() routine to add the appropriate mouse event
-to the event queue.
-
-Note: Interrupts are ON when this routine is called by the mouse driver code.
-****************************************************************************/
-static void EVTAPI mouseISR(
-    uint mask,
-    uint butstate,
-    int x,
-    int y,
-    int mickeyX,
-    int mickeyY)
-{
-    uint    ps;
-    uint    buttonMask;
-
-    if (mask & 1) {
-       /* Save the current mouse coordinates */
-       EVT.mx = x; EVT.my = y;
-
-       /* If the last event was a movement event, then modify the last
-        * event rather than post a new one, so that the queue will not
-        * become saturated. Before we modify the data structures, we
-        * MUST ensure that interrupts are off.
-        */
-       ps = _EVT_disableInt();
-       if (EVT.oldMove != -1) {
-           EVT.evtq[EVT.oldMove].where_x = x;  /* Modify existing one  */
-           EVT.evtq[EVT.oldMove].where_y = y;
-           EVT.evtq[EVT.oldMove].relative_x += mickeyX;
-           EVT.evtq[EVT.oldMove].relative_y += mickeyY;
-           }
-       else {
-           EVT.oldMove = EVT.freeHead;         /* Save id of this move event   */
-           addMouseEvent(EVT_MOUSEMOVE,0,x,y,mickeyX,mickeyY,butstate);
-           }
-       _EVT_restoreInt(ps);
-       }
-    if (mask & 0x2A) {
-       ps = _EVT_disableInt();
-       buttonMask = 0;
-       if (mask & 2)  buttonMask |= EVT_LEFTBMASK;
-       if (mask & 8)  buttonMask |= EVT_RIGHTBMASK;
-       if (mask & 32) buttonMask |= EVT_MIDDLEBMASK;
-       addMouseEvent(EVT_MOUSEDOWN,buttonMask,x,y,0,0,butstate);
-       EVT.oldMove = -1;
-       _EVT_restoreInt(ps);
-       }
-    if (mask & 0x54) {
-       ps = _EVT_disableInt();
-       buttonMask = 0;
-       if (mask & 2)  buttonMask |= EVT_LEFTBMASK;
-       if (mask & 8)  buttonMask |= EVT_RIGHTBMASK;
-       if (mask & 32) buttonMask |= EVT_MIDDLEBMASK;
-       addMouseEvent(EVT_MOUSEUP,buttonMask,x,y,0,0,butstate);
-       EVT.oldMove = -1;
-       _EVT_restoreInt(ps);
-       }
-    EVT.oldKey = -1;
-}
-
-/****************************************************************************
-REMARKS:
-Keyboard interrupt handler function.
-
-NOTE:   Interrupts are OFF when this routine is called by the keyboard ISR,
-       and we leave them OFF the entire time.
-****************************************************************************/
-static void EVTAPI keyboardISR(void)
-{
-    processRawScanCode(PM_inpb(0x60));
-    PM_outpb(0x20,0x20);
-}
-
-/****************************************************************************
-REMARKS:
-Safely abort the event module upon catching a fatal error.
-****************************************************************************/
-void _EVT_abort()
-{
-    EVT_exit();
-    PM_fatalError("Unhandled exception!");
-}
-
-/****************************************************************************
-PARAMETERS:
-mouseMove   - Callback function to call wheneve the mouse needs to be moved
-
-REMARKS:
-Initiliase the event handling module. Here we install our mouse handling ISR
-to be called whenever any button's are pressed or released. We also build
-the free list of events in the event queue.
-
-We use handler number 2 of the mouse libraries interrupt handlers for our
-event handling routines.
-****************************************************************************/
-void EVTAPI EVT_init(
-    _EVT_mouseMoveHandler mouseMove)
-{
-    int     i;
-
-    PM_init();
-    EVT.mouseMove = mouseMove;
-    _EVT_biosPtr = PM_getBIOSPointer();
-    EVT_resume();
-
-    /* Grab all characters pending in the keyboard buffer and stuff
-     * them into our event buffer. This allows us to pick up any keypresses
-     * while the program is initialising.
-     */
-    while ((i = _EVT_getKeyCode()) != 0)
-       addKeyEvent(EVT_KEYDOWN,i);
-}
-
-/****************************************************************************
-REMARKS:
-Initiailises the internal event handling modules. The EVT_suspend function
-can be called to suspend event handling (such as when shelling out to DOS),
-and this function can be used to resume it again later.
-****************************************************************************/
-void EVTAPI EVT_resume(void)
-{
-    static int      locked = 0;
-    int             stat;
-    uchar           mods;
-    PM_lockHandle   lh; /* Unused in DOS */
-
-    if (_EVT_useEvents) {
-       /* Initialise the event queue and enable our interrupt handlers */
-       initEventQueue();
-#ifndef NO_KEYBOARD_INTERRUPT
-       PM_setKeyHandler(keyboardISR);
-#endif
-#ifndef NO_MOUSE_INTERRUPT
-       if ((haveMouse = detectMouse()) != 0) {
-           int oldmode = _EVT_foolMouse();
-           PM_setMouseHandler(0xFFFF,mouseISR);
-           _EVT_unfoolMouse(oldmode);
-           }
-#endif
-
-       /* Read the keyboard modifier flags from the BIOS to get the
-        * correct initialisation state. The only state we care about is
-        * the correct toggle state flags such as SCROLLLOCK, NUMLOCK and
-        * CAPSLOCK.
-        */
-       EVT.keyModifiers = 0;
-       mods = PM_getByte(_EVT_biosPtr+0x17);
-       if (mods & 0x10)
-           EVT.keyModifiers |= EVT_SCROLLLOCK;
-       if (mods & 0x20)
-           EVT.keyModifiers |= EVT_NUMLOCK;
-       if (mods & 0x40)
-           EVT.keyModifiers |= EVT_CAPSLOCK;
-
-       /* Lock all of the code and data used by our protected mode interrupt
-        * handling routines, so that it will continue to work correctly
-        * under real mode.
-        */
-       if (!locked) {
-           /* It is difficult to ensure that we lock our global data, so we
-            * do this by taking the address of a variable locking all data
-            * 2Kb on either side. This should properly cover the global data
-            * used by the module (the other alternative is to declare the
-            * variables in assembler, in which case we know it will be
-            * correct).
-            */
-           stat  = !PM_lockDataPages(&EVT,sizeof(EVT),&lh);
-           stat |= !PM_lockDataPages(&_EVT_biosPtr,sizeof(_EVT_biosPtr),&lh);
-           stat |= !PM_lockCodePages((__codePtr)_EVT_cCodeStart,(int)_EVT_cCodeEnd-(int)_EVT_cCodeStart,&lh);
-           stat |= !PM_lockCodePages((__codePtr)_EVT_codeStart,(int)_EVT_codeEnd-(int)_EVT_codeStart,&lh);
-           if (stat) {
-               PM_fatalError("Page locking services failed - interrupt handling not safe!");
-               exit(1);
-               }
-           locked = 1;
-           }
-
-       /* Catch program termination signals so we can clean up properly */
-       signal(SIGABRT, _EVT_abort);
-       signal(SIGFPE, _EVT_abort);
-       signal(SIGINT, _EVT_abort);
-       _EVT_installed = true;
-       }
-}
-
-/****************************************************************************
-REMARKS
-Changes the range of coordinates returned by the mouse functions to the
-specified range of values. This is used when changing between graphics
-modes set the range of mouse coordinates for the new display mode.
-****************************************************************************/
-void EVTAPI EVT_setMouseRange(
-    int xRes,
-    int yRes)
-{
-    RMREGS  regs;
-
-    if (haveMouse) {
-       int oldmode = _EVT_foolMouse();
-       PM_resetMouseDriver(1);
-       regs.x.ax = 7;  /* Mouse function 7 - Set horizontal min and max */
-       regs.x.cx = 0;
-       regs.x.dx = xRes;
-       PM_int86(0x33,&regs,&regs);
-       regs.x.ax = 8;  /* Mouse function 8 - Set vertical min and max   */
-       regs.x.cx = 0;
-       regs.x.dx = yRes;
-       PM_int86(0x33,&regs,&regs);
-       _EVT_unfoolMouse(oldmode);
-       }
-}
-
-/****************************************************************************
-REMARKS
-Modifes the mouse coordinates as necessary if scaling to OS coordinates,
-and sets the OS mouse cursor position.
-****************************************************************************/
-void _EVT_setMousePos(
-    int *x,
-    int *y)
-{
-    RMREGS  regs;
-
-    if (haveMouse) {
-       int oldmode = _EVT_foolMouse();
-       regs.x.ax = 4;      /* Mouse function 4 - Set mouse position    */
-       regs.x.cx = *x;     /* New horizontal coordinate                */
-       regs.x.dx = *y;     /* New vertical coordinate                  */
-       PM_int86(0x33,&regs,&regs);
-       _EVT_unfoolMouse(oldmode);
-       }
-}
-
-/****************************************************************************
-REMARKS
-Suspends all of our event handling operations. This is also used to
-de-install the event handling code.
-****************************************************************************/
-void EVTAPI EVT_suspend(void)
-{
-    uchar   mods;
-
-    if (_EVT_installed) {
-       /* Restore the interrupt handlers */
-       PM_restoreKeyHandler();
-       if (haveMouse)
-           PM_restoreMouseHandler();
-       signal(SIGABRT, SIG_DFL);
-       signal(SIGFPE, SIG_DFL);
-       signal(SIGINT, SIG_DFL);
-
-       /* Set the keyboard modifier flags in the BIOS to our values */
-       EVT_allowLEDS(true);
-       mods = PM_getByte(_EVT_biosPtr+0x17) & ~0x70;
-       if (EVT.keyModifiers & EVT_SCROLLLOCK)
-           mods |= 0x10;
-       if (EVT.keyModifiers & EVT_NUMLOCK)
-           mods |= 0x20;
-       if (EVT.keyModifiers & EVT_CAPSLOCK)
-           mods |= 0x40;
-       PM_setByte(_EVT_biosPtr+0x17,mods);
-
-       /* Flag that we are no longer installed */
-       _EVT_installed = false;
-       }
-}
-
-/****************************************************************************
-REMARKS
-Exits the event module for program terminatation.
-****************************************************************************/
-void EVTAPI EVT_exit(void)
-{
-    EVT_suspend();
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/dos/oshdr.h b/board/MAI/bios_emulator/scitech/src/pm/dos/oshdr.h
deleted file mode 100644 (file)
index 35e8e00..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  32-bit DOS
-*
-* Description:  Include file to include all OS specific header files.
-*
-****************************************************************************/
diff --git a/board/MAI/bios_emulator/scitech/src/pm/dos/pm.c b/board/MAI/bios_emulator/scitech/src/pm/dos/pm.c
deleted file mode 100644 (file)
index 2ad9e34..0000000
+++ /dev/null
@@ -1,2243 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  16/32 bit DOS
-*
-* Description:  Implementation for the OS Portability Manager Library, which
-*               contains functions to implement OS specific services in a
-*               generic, cross platform API. Porting the OS Portability
-*               Manager library is the first step to porting any SciTech
-*               products to a new platform.
-*
-****************************************************************************/
-
-#include "pmapi.h"
-#include "drvlib/os/os.h"
-#include "ztimerc.h"
-#include "mtrr.h"
-#include "pm_help.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <dos.h>
-#include <conio.h>
-#ifdef  __GNUC__
-#include <unistd.h>
-#include <sys/nearptr.h>
-#include <sys/stat.h>
-#else
-#include <direct.h>
-#endif
-#ifdef  __BORLANDC__
-#pragma warn -par
-#endif
-
-/*--------------------------- Global variables ----------------------------*/
-
-typedef struct {
-    int     oldMode;
-    int     old50Lines;
-    } DOS_stateBuf;
-
-#define MAX_RM_BLOCKS   10
-
-static struct {
-    void    *p;
-    uint    tag;
-    } rmBlocks[MAX_RM_BLOCKS];
-
-static uint     VESABuf_len = 1024;     /* Length of the VESABuf buffer     */
-static void     *VESABuf_ptr = NULL;    /* Near pointer to VESABuf          */
-static uint     VESABuf_rseg;           /* Real mode segment of VESABuf     */
-static uint     VESABuf_roff;           /* Real mode offset of VESABuf      */
-static void     (PMAPIP fatalErrorCleanup)(void) = NULL;
-ushort _VARAPI  _PM_savedDS = 0;
-#ifdef  DOS4GW
-static ulong    PDB = 0,*pPDB = NULL;
-#endif
-#ifndef REALMODE
-static char     VXD_name[] = PMHELP_NAME;
-static char     VXD_module[] = PMHELP_MODULE;
-static char     VXD_DDBName[] = PMHELP_DDBNAME;
-static uint     VXD_version = -1;
-static uint     VXD_loadOff = 0;
-static uint     VXD_loadSel = 0;
-uint _VARAPI    _PM_VXD_off = 0;
-uint _VARAPI    _PM_VXD_sel = 0;
-int _VARAPI     _PM_haveCauseWay = -1;
-
-/* Memory mapping cache */
-
-#define MAX_MEMORY_MAPPINGS 100
-typedef struct {
-    ulong   physical;
-    ulong   linear;
-    ulong   limit;
-    } mmapping;
-static mmapping     maps[MAX_MEMORY_MAPPINGS] = {0};
-static int          numMaps = 0;
-
-/* Page sized block cache */
-
-#define PAGES_PER_BLOCK     100
-#define FREELIST_NEXT(p)    (*(void**)(p))
-typedef struct pageblock {
-    struct pageblock    *next;
-    struct pageblock    *prev;
-    void                *freeListStart;
-    void                *freeList;
-    void                *freeListEnd;
-    int                 freeCount;
-    } pageblock;
-static pageblock    *pageBlocks = NULL;
-#endif
-
-/* Start of all page tables in CauseWay */
-
-#define CW_PAGE_TABLE_START (1024UL*4096UL*1023UL)
-
-/*----------------------------- Implementation ----------------------------*/
-
-/* External assembler functions */
-
-ulong   _ASMAPI _PM_getPDB(void);
-int     _ASMAPI _PM_pagingEnabled(void);
-void    _ASMAPI _PM_VxDCall(VXD_regs *regs,uint off,uint sel);
-
-#ifndef REALMODE
-/****************************************************************************
-REMARKS:
-Exit function to unload the dynamically loaded VxD
-****************************************************************************/
-static void UnloadVxD(void)
-{
-    PMSREGS     sregs;
-    VXD_regs    r;
-
-    r.eax = 2;
-    r.ebx = 0;
-    r.edx = (uint)VXD_module;
-    PM_segread(&sregs);
-#ifdef  __16BIT__
-    r.ds = ((ulong)VXD_module) >> 16;
-#else
-    r.ds = sregs.ds;
-#endif
-    r.es = sregs.es;
-    _PM_VxDCall(&r,VXD_loadOff,VXD_loadSel);
-}
-
-/****************************************************************************
-REMARKS:
-External function to call the PMHELP helper VxD.
-****************************************************************************/
-void PMAPI PM_VxDCall(
-    VXD_regs *regs)
-{
-    if (_PM_VXD_sel != 0 || _PM_VXD_off != 0)
-       _PM_VxDCall(regs,_PM_VXD_off,_PM_VXD_sel);
-}
-
-/****************************************************************************
-RETURNS:
-BCD coded version number of the VxD, or 0 if not loaded (ie: 0x202 - 2.2)
-
-REMARKS:
-This function gets the version number for the VxD that we have connected to.
-****************************************************************************/
-uint PMAPI PMHELP_getVersion(void)
-{
-    VXD_regs    r;
-
-    /* Call the helper VxD to determine the version number */
-    if (_PM_VXD_sel != 0 || _PM_VXD_off != 0) {
-       memset(&r,0,sizeof(r));
-       r.eax = API_NUM(PMHELP_GETVER);
-       _PM_VxDCall(&r,_PM_VXD_off,_PM_VXD_sel);
-       return VXD_version = (uint)r.eax;
-       }
-    return VXD_version = 0;
-}
-
-/****************************************************************************
-DESCRIPTION:
-Connects to the helper VxD and returns the version number
-
-RETURNS:
-True if the VxD was found and loaded, false otherwise.
-
-REMARKS:
-This function connects to the VxD (loading it if it is dynamically loadable)
-and returns the version number of the VxD.
-****************************************************************************/
-static ibool PMHELP_connect(void)
-{
-    PMREGS      regs;
-    PMSREGS     sregs;
-    VXD_regs    r;
-
-    /* Bail early if we have alread connected */
-    if (VXD_version != -1)
-       return VXD_version != 0;
-
-    /* Get the static SDDHELP.VXD entry point if available */
-    PM_segread(&sregs);
-    regs.x.ax = 0x1684;
-    regs.x.bx = SDDHELP_DeviceID;
-    regs.x.di = 0;
-    sregs.es = 0;
-    PM_int386x(0x2F,&regs,&regs,&sregs);
-    _PM_VXD_sel = sregs.es;
-    _PM_VXD_off = regs.x.di;
-    if (_PM_VXD_sel != 0 || _PM_VXD_off != 0) {
-       if (PMHELP_getVersion() >= PMHELP_VERSION)
-           return true;
-       }
-
-    /* If we get here, then either SDDHELP.VXD is not loaded, or it is an
-     * earlier version. In this case try to dynamically load the PMHELP.VXD
-     * helper VxD instead.
-     */
-    PM_segread(&sregs);
-    regs.x.ax = 0x1684;
-    regs.x.bx = VXDLDR_DeviceID;
-    regs.x.di = 0;
-    sregs.es = 0;
-    PM_int386x(0x2F,&regs,&regs,&sregs);
-    VXD_loadSel = sregs.es;
-    VXD_loadOff = regs.x.di;
-    if (VXD_loadSel == 0 && VXD_loadOff == 0)
-       return VXD_version = 0;
-    r.eax = 1;
-    r.ebx = 0;
-    r.edx = (uint)VXD_name;
-    PM_segread(&sregs);
-    r.ds = sregs.ds;
-    r.es = sregs.es;
-    _PM_VxDCall(&r,VXD_loadOff,VXD_loadSel);
-    if (r.eax != 0)
-       return VXD_version = 0;
-
-    /* Get the dynamic VxD entry point so we can call it */
-    atexit(UnloadVxD);
-    PM_segread(&sregs);
-    regs.x.ax = 0x1684;
-    regs.x.bx = 0;
-    regs.e.edi = (uint)VXD_DDBName;
-    PM_int386x(0x2F,&regs,&regs,&sregs);
-    _PM_VXD_sel = sregs.es;
-    _PM_VXD_off = regs.x.di;
-    if (_PM_VXD_sel == 0 && _PM_VXD_off == 0)
-       return VXD_version = 0;
-    if (PMHELP_getVersion() >= PMHELP_VERSION)
-       return true;
-    return VXD_version = 0;
-}
-#endif
-
-/****************************************************************************
-REMARKS:
-Initialise the PM library. First we try to connect to a static SDDHELP.VXD
-helper VxD, and check that it is a version we can use. If not we try to
-dynamically load the PMHELP.VXD helper VxD
-****************************************************************************/
-void PMAPI PM_init(void)
-{
-#ifndef REALMODE
-    PMREGS  regs;
-
-    /* Check if we are running under CauseWay under real DOS */
-    if (_PM_haveCauseWay == -1) {
-       /* Check if we are running under DPMI in which case we will not be
-        * able to use our special ring 0 CauseWay functions.
-        */
-       _PM_haveCauseWay = false;
-       regs.x.ax = 0xFF00;
-       PM_int386(0x31,&regs,&regs);
-       if (regs.x.cflag || !(regs.e.edi & 8)) {
-           /* We are not under DPMI, so now check if CauseWay is active */
-           regs.x.ax = 0xFFF9;
-           PM_int386(0x31,&regs,&regs);
-           if (!regs.x.cflag && regs.e.ecx == 0x43415553 && regs.e.edx == 0x45574159)
-               _PM_haveCauseWay = true;
-           }
-
-       /* Now connect to PMHELP.VXD and initialise MTRR module */
-       if (!PMHELP_connect())
-           MTRR_init();
-       }
-#endif
-}
-
-/****************************************************************************
-PARAMETERS:
-base    - The starting physical base address of the region
-size    - The size in bytes of the region
-type    - Type to place into the MTRR register
-
-RETURNS:
-Error code describing the result.
-
-REMARKS:
-Function to enable write combining for the specified region of memory.
-****************************************************************************/
-int PMAPI PM_enableWriteCombine(
-    ulong base,
-    ulong size,
-    uint type)
-{
-#ifndef REALMODE
-    VXD_regs    regs;
-
-    if (PMHELP_connect()) {
-       memset(&regs,0,sizeof(regs));
-       regs.eax = API_NUM(PMHELP_ENABLELFBCOMB);
-       regs.ebx = base;
-       regs.ecx = size;
-       regs.edx = type;
-       _PM_VxDCall(&regs,_PM_VXD_off,_PM_VXD_sel);
-       return regs.eax;
-       }
-    return MTRR_enableWriteCombine(base,size,type);
-#else
-    return PM_MTRR_NOT_SUPPORTED;
-#endif
-}
-
-ibool PMAPI PM_haveBIOSAccess(void)
-{ return true; }
-
-long PMAPI PM_getOSType(void)
-{ return _OS_DOS; }
-
-int PMAPI PM_getModeType(void)
-{
-#if defined(REALMODE)
-    return PM_realMode;
-#elif defined(PM286)
-    return PM_286;
-#elif defined(PM386)
-    return PM_386;
-#endif
-}
-
-void PMAPI PM_backslash(char *s)
-{
-    uint pos = strlen(s);
-    if (s[pos-1] != '\\') {
-       s[pos] = '\\';
-       s[pos+1] = '\0';
-       }
-}
-
-void PMAPI PM_setFatalErrorCleanup(
-    void (PMAPIP cleanup)(void))
-{
-    fatalErrorCleanup = cleanup;
-}
-
-void PMAPI PM_fatalError(const char *msg)
-{
-    if (fatalErrorCleanup)
-       fatalErrorCleanup();
-    fprintf(stderr,"%s\n", msg);
-    exit(1);
-}
-
-static void ExitVBEBuf(void)
-{
-    if (VESABuf_ptr)
-       PM_freeRealSeg(VESABuf_ptr);
-    VESABuf_ptr = 0;
-}
-
-void * PMAPI PM_getVESABuf(uint *len,uint *rseg,uint *roff)
-{
-    if (!VESABuf_ptr) {
-       /* Allocate a global buffer for communicating with the VESA VBE */
-       if ((VESABuf_ptr = PM_allocRealSeg(VESABuf_len, &VESABuf_rseg, &VESABuf_roff)) == NULL)
-           return NULL;
-       atexit(ExitVBEBuf);
-       }
-    *len = VESABuf_len;
-    *rseg = VESABuf_rseg;
-    *roff = VESABuf_roff;
-    return VESABuf_ptr;
-}
-
-int PMAPI PM_int386(int intno, PMREGS *in, PMREGS *out)
-{
-    PMSREGS sregs;
-    PM_segread(&sregs);
-    return PM_int386x(intno,in,out,&sregs);
-}
-
-/* Routines to set and get the real mode interrupt vectors, by making
- * direct real mode calls to DOS and bypassing the DOS extenders API.
- * This is the safest way to handle this, as some servers try to be
- * smart about changing real mode vectors.
- */
-
-void PMAPI _PM_getRMvect(int intno, long *realisr)
-{
-    RMREGS  regs;
-    RMSREGS sregs;
-
-    PM_saveDS();
-    regs.h.ah = 0x35;
-    regs.h.al = intno;
-    PM_int86x(0x21, &regs, &regs, &sregs);
-    *realisr = ((long)sregs.es << 16) | regs.x.bx;
-}
-
-void PMAPI _PM_setRMvect(int intno, long realisr)
-{
-    RMREGS  regs;
-    RMSREGS sregs;
-
-    PM_saveDS();
-    regs.h.ah = 0x25;
-    regs.h.al = intno;
-    sregs.ds = (int)(realisr >> 16);
-    regs.x.dx = (int)(realisr & 0xFFFF);
-    PM_int86x(0x21, &regs, &regs, &sregs);
-}
-
-void PMAPI _PM_addRealModeBlock(void *mem,uint tag)
-{
-    int i;
-
-    for (i = 0; i < MAX_RM_BLOCKS; i++) {
-       if (rmBlocks[i].p == NULL) {
-           rmBlocks[i].p = mem;
-           rmBlocks[i].tag = tag;
-           return;
-           }
-       }
-    PM_fatalError("To many real mode memory block allocations!");
-}
-
-uint PMAPI _PM_findRealModeBlock(void *mem)
-{
-    int i;
-
-    for (i = 0; i < MAX_RM_BLOCKS; i++) {
-       if (rmBlocks[i].p == mem)
-           return rmBlocks[i].tag;
-       }
-    PM_fatalError("Could not find prior real mode memory block allocation!");
-    return 0;
-}
-
-char * PMAPI PM_getCurrentPath(
-    char *path,
-    int maxLen)
-{
-    return getcwd(path,maxLen);
-}
-
-char PMAPI PM_getBootDrive(void)
-{ return 'C'; }
-
-const char * PMAPI PM_getVBEAFPath(void)
-{ return "c:\\"; }
-
-const char * PMAPI PM_getNucleusPath(void)
-{
-    static char path[256];
-    char        *env;
-
-    if ((env = getenv("NUCLEUS_PATH")) != NULL)
-       return env;
-    if ((env = getenv("WINBOOTDIR")) != NULL) {
-       /* Running in a Windows 9x DOS box or DOS mode */
-       strcpy(path,env);
-       strcat(path,"\\system\\nucleus");
-       return path;
-       }
-    if ((env = getenv("SystemRoot")) != NULL) {
-       /* Running in an NT/2K DOS box */
-       strcpy(path,env);
-       strcat(path,"\\system32\\nucleus");
-       return path;
-       }
-    return "c:\\nucleus";
-}
-
-const char * PMAPI PM_getNucleusConfigPath(void)
-{
-    static char path[256];
-    strcpy(path,PM_getNucleusPath());
-    PM_backslash(path);
-    strcat(path,"config");
-    return path;
-}
-
-const char * PMAPI PM_getUniqueID(void)
-{ return "DOS"; }
-
-const char * PMAPI PM_getMachineName(void)
-{ return "DOS"; }
-
-int PMAPI PM_kbhit(void)
-{
-    return kbhit();
-}
-
-int PMAPI PM_getch(void)
-{
-    return getch();
-}
-
-PM_HWND PMAPI PM_openConsole(PM_HWND hwndUser,int device,int xRes,int yRes,int bpp,ibool fullScreen)
-{
-    /* Not used for DOS */
-    (void)hwndUser;
-    (void)device;
-    (void)xRes;
-    (void)yRes;
-    (void)bpp;
-    (void)fullScreen;
-    return 0;
-}
-
-int PMAPI PM_getConsoleStateSize(void)
-{
-    return sizeof(DOS_stateBuf);
-}
-
-void PMAPI PM_saveConsoleState(void *stateBuf,PM_HWND hwndConsole)
-{
-    RMREGS          regs;
-    DOS_stateBuf    *sb = stateBuf;
-
-    /* Save the old video mode state */
-    regs.h.ah = 0x0F;
-    PM_int86(0x10,&regs,&regs);
-    sb->oldMode = regs.h.al & 0x7F;
-    sb->old50Lines = false;
-    if (sb->oldMode == 0x3) {
-       regs.x.ax = 0x1130;
-       regs.x.bx = 0;
-       regs.x.dx = 0;
-       PM_int86(0x10,&regs,&regs);
-       sb->old50Lines = (regs.h.dl == 42 || regs.h.dl == 49);
-       }
-    (void)hwndConsole;
-}
-
-void PMAPI PM_setSuspendAppCallback(int (_ASMAPIP saveState)(int flags))
-{
-    /* Not used for DOS */
-    (void)saveState;
-}
-
-void PMAPI PM_restoreConsoleState(const void *stateBuf,PM_HWND hwndConsole)
-{
-    RMREGS              regs;
-    const DOS_stateBuf  *sb = stateBuf;
-
-    /* Retore 50 line mode if set */
-    if (sb->old50Lines) {
-       regs.x.ax = 0x1112;
-       regs.x.bx = 0;
-       PM_int86(0x10,&regs,&regs);
-       }
-    (void)hwndConsole;
-}
-
-void PMAPI PM_closeConsole(PM_HWND hwndConsole)
-{
-    /* Not used for DOS */
-    (void)hwndConsole;
-}
-
-void PMAPI PM_setOSCursorLocation(int x,int y)
-{
-    uchar *_biosPtr = PM_getBIOSPointer();
-    PM_setByte(_biosPtr+0x50,x);
-    PM_setByte(_biosPtr+0x51,y);
-}
-
-void PMAPI PM_setOSScreenWidth(int width,int height)
-{
-    uchar *_biosPtr = PM_getBIOSPointer();
-    PM_setWord(_biosPtr+0x4A,width);
-    PM_setWord(_biosPtr+0x4C,width*2);
-    PM_setByte(_biosPtr+0x84,height-1);
-    if (height > 25) {
-       PM_setWord(_biosPtr+0x60,0x0607);
-       PM_setByte(_biosPtr+0x85,0x08);
-       }
-    else {
-       PM_setWord(_biosPtr+0x60,0x0D0E);
-       PM_setByte(_biosPtr+0x85,0x016);
-       }
-}
-
-void * PMAPI PM_mallocShared(long size)
-{
-    return PM_malloc(size);
-}
-
-void PMAPI PM_freeShared(void *ptr)
-{
-    PM_free(ptr);
-}
-
-#define GetRMVect(intno,isr)    *(isr) = ((ulong*)rmZeroPtr)[intno]
-#define SetRMVect(intno,isr)    ((ulong*)rmZeroPtr)[intno] = (isr)
-
-ibool PMAPI PM_doBIOSPOST(
-    ushort axVal,
-    ulong BIOSPhysAddr,
-    void *mappedBIOS,
-    ulong BIOSLen)
-{
-    static int      firstTime = true;
-    static uchar    *rmZeroPtr;
-    long            Current10,Current6D,Current42;
-    RMREGS          regs;
-    RMSREGS         sregs;
-
-    /* Create a zero memory mapping for us to use */
-    if (firstTime) {
-       rmZeroPtr = PM_mapPhysicalAddr(0,0x7FFF,true);
-       firstTime = false;
-       }
-
-    /* Remap the secondary BIOS to 0xC0000 physical */
-    if (BIOSPhysAddr != 0xC0000L || BIOSLen > 32768) {
-       /* DOS cannot virtually remap the BIOS, so we can only work if all
-        * the secondary controllers are identical, and we then use the
-        * BIOS on the first controller for all the remaining controllers.
-        *
-        * For OS'es that do virtual memory, and remapping of 0xC0000
-        * physical (perhaps a copy on write mapping) should be all that
-        * is needed.
-        */
-       return false;
-       }
-
-    /* Save current handlers of int 10h and 6Dh */
-    GetRMVect(0x10,&Current10);
-    GetRMVect(0x6D,&Current6D);
-
-    /* POST the secondary BIOS */
-    GetRMVect(0x42,&Current42);
-    SetRMVect(0x10,Current42);  /* Restore int 10h to STD-BIOS */
-    regs.x.ax = axVal;
-    PM_callRealMode(0xC000,0x0003,&regs,&sregs);
-
-    /* Restore current handlers */
-    SetRMVect(0x10,Current10);
-    SetRMVect(0x6D,Current6D);
-
-    /* Second the primary BIOS mappin 1:1 for 0xC0000 physical */
-    if (BIOSPhysAddr != 0xC0000L) {
-       /* DOS does not support this */
-       (void)mappedBIOS;
-       }
-    return true;
-}
-
-void PMAPI PM_sleep(ulong milliseconds)
-{
-    ulong           microseconds = milliseconds * 1000L;
-    LZTimerObject   tm;
-
-    LZTimerOnExt(&tm);
-    while (LZTimerLapExt(&tm) < microseconds)
-       ;
-    LZTimerOffExt(&tm);
-}
-
-int PMAPI PM_getCOMPort(int port)
-{
-    switch (port) {
-       case 0: return 0x3F8;
-       case 1: return 0x2F8;
-       }
-    return 0;
-}
-
-int PMAPI PM_getLPTPort(int port)
-{
-    switch (port) {
-       case 0: return 0x3BC;
-       case 1: return 0x378;
-       case 2: return 0x278;
-       }
-    return 0;
-}
-
-PM_MODULE PMAPI PM_loadLibrary(
-    const char *szDLLName)
-{
-    (void)szDLLName;
-    return NULL;
-}
-
-void * PMAPI PM_getProcAddress(
-    PM_MODULE hModule,
-    const char *szProcName)
-{
-    (void)hModule;
-    (void)szProcName;
-    return NULL;
-}
-
-void PMAPI PM_freeLibrary(
-    PM_MODULE hModule)
-{
-    (void)hModule;
-}
-
-int PMAPI PM_setIOPL(
-    int level)
-{
-    return level;
-}
-
-/****************************************************************************
-REMARKS:
-Internal function to convert the find data to the generic interface.
-****************************************************************************/
-static void convertFindData(
-    PM_findData *findData,
-    struct find_t *blk)
-{
-    ulong   dwSize = findData->dwSize;
-
-    memset(findData,0,findData->dwSize);
-    findData->dwSize = dwSize;
-    if (blk->attrib & _A_RDONLY)
-       findData->attrib |= PM_FILE_READONLY;
-    if (blk->attrib & _A_SUBDIR)
-       findData->attrib |= PM_FILE_DIRECTORY;
-    if (blk->attrib & _A_ARCH)
-       findData->attrib |= PM_FILE_ARCHIVE;
-    if (blk->attrib & _A_HIDDEN)
-       findData->attrib |= PM_FILE_HIDDEN;
-    if (blk->attrib & _A_SYSTEM)
-       findData->attrib |= PM_FILE_SYSTEM;
-    findData->sizeLo = blk->size;
-    strncpy(findData->name,blk->name,PM_MAX_PATH);
-    findData->name[PM_MAX_PATH-1] = 0;
-}
-
-#define FIND_MASK   (_A_RDONLY | _A_ARCH | _A_SUBDIR | _A_HIDDEN | _A_SYSTEM)
-
-/****************************************************************************
-REMARKS:
-Function to find the first file matching a search criteria in a directory.
-****************************************************************************/
-void * PMAPI PM_findFirstFile(
-    const char *filename,
-    PM_findData *findData)
-{
-    struct find_t *blk;
-
-    if ((blk = PM_malloc(sizeof(*blk))) == NULL)
-       return PM_FILE_INVALID;
-    if (_dos_findfirst((char*)filename,FIND_MASK,blk) == 0) {
-       convertFindData(findData,blk);
-       return blk;
-       }
-    return PM_FILE_INVALID;
-}
-
-/****************************************************************************
-REMARKS:
-Function to find the next file matching a search criteria in a directory.
-****************************************************************************/
-ibool PMAPI PM_findNextFile(
-    void *handle,
-    PM_findData *findData)
-{
-    struct find_t *blk = handle;
-
-    if (_dos_findnext(blk) == 0) {
-       convertFindData(findData,blk);
-       return true;
-       }
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-Function to close the find process
-****************************************************************************/
-void PMAPI PM_findClose(
-    void *handle)
-{
-    PM_free(handle);
-}
-
-/****************************************************************************
-REMARKS:
-Function to determine if a drive is a valid drive or not. Under Unix this
-function will return false for anything except a value of 3 (considered
-the root drive, and equivalent to C: for non-Unix systems). The drive
-numbering is:
-
-    1   - Drive A:
-    2   - Drive B:
-    3   - Drive C:
-    etc
-
-****************************************************************************/
-ibool PMAPI PM_driveValid(
-    char drive)
-{
-    RMREGS  regs;
-    regs.h.dl = (uchar)(drive - 'A' + 1);
-    regs.h.ah = 0x36;               /* Get disk information service */
-    PM_int86(0x21,&regs,&regs);
-    return regs.x.ax != 0xFFFF;     /* AX = 0xFFFF if disk is invalid */
-}
-
-/****************************************************************************
-REMARKS:
-Function to get the current working directory for the specififed drive.
-Under Unix this will always return the current working directory regardless
-of what the value of 'drive' is.
-****************************************************************************/
-void PMAPI PM_getdcwd(
-    int drive,
-    char *dir,
-    int len)
-{
-    uint oldDrive,maxDrives;
-    _dos_getdrive(&oldDrive);
-    _dos_setdrive(drive,&maxDrives);
-    getcwd(dir,len);
-    _dos_setdrive(oldDrive,&maxDrives);
-}
-
-/****************************************************************************
-REMARKS:
-Function to change the file attributes for a specific file.
-****************************************************************************/
-void PMAPI PM_setFileAttr(
-    const char *filename,
-    uint attrib)
-{
-#if defined(TNT) && defined(_MSC_VER)
-    DWORD attr = 0;
-
-    if (attrib & PM_FILE_READONLY)
-       attr |= FILE_ATTRIBUTE_READONLY;
-    if (attrib & PM_FILE_ARCHIVE)
-       attr |= FILE_ATTRIBUTE_ARCHIVE;
-    if (attrib & PM_FILE_HIDDEN)
-       attr |= FILE_ATTRIBUTE_HIDDEN;
-    if (attrib & PM_FILE_SYSTEM)
-       attr |= FILE_ATTRIBUTE_SYSTEM;
-    SetFileAttributes((LPSTR)filename, attr);
-#else
-    uint attr = 0;
-
-    if (attrib & PM_FILE_READONLY)
-       attr |= _A_RDONLY;
-    if (attrib & PM_FILE_ARCHIVE)
-       attr |= _A_ARCH;
-    if (attrib & PM_FILE_HIDDEN)
-       attr |= _A_HIDDEN;
-    if (attrib & PM_FILE_SYSTEM)
-       attr |= _A_SYSTEM;
-    _dos_setfileattr(filename,attr);
-#endif
-}
-
-/****************************************************************************
-REMARKS:
-Function to create a directory.
-****************************************************************************/
-ibool PMAPI PM_mkdir(
-    const char *filename)
-{
-#ifdef  __GNUC__
-    return mkdir(filename,S_IRUSR) == 0;
-#else
-    return mkdir(filename) == 0;
-#endif
-}
-
-/****************************************************************************
-REMARKS:
-Function to remove a directory.
-****************************************************************************/
-ibool PMAPI PM_rmdir(
-    const char *filename)
-{
-    return rmdir(filename) == 0;
-}
-
-/*-------------------------------------------------------------------------*/
-/* Generic DPMI routines common to 16/32 bit code                          */
-/*-------------------------------------------------------------------------*/
-
-#ifndef REALMODE
-ulong PMAPI DPMI_mapPhysicalToLinear(ulong physAddr,ulong limit)
-{
-    PMREGS  r;
-    int     i;
-    ulong   baseAddr,baseOfs,roundedLimit;
-
-    /* We can't map memory below 1Mb, but the linear address are already
-     * mapped 1:1 for this memory anyway so we just return the base address.
-     */
-    if (physAddr < 0x100000L)
-       return physAddr;
-
-    /* Search table of existing mappings to see if we have already mapped
-     * a region of memory that will serve this purpose. We do this because
-     * DPMI 0.9 does not allow us to free physical memory mappings, and if
-     * the mappings get re-used in the program we want to avoid allocating
-     * more mappings than necessary.
-     */
-    for (i = 0; i < numMaps; i++) {
-       if (maps[i].physical == physAddr && maps[i].limit == limit)
-           return maps[i].linear;
-       }
-
-    /* Find a free slot in our physical memory mapping table */
-    for (i = 0; i < numMaps; i++) {
-       if (maps[i].limit == 0)
-           break;
-       }
-    if (i == numMaps) {
-       i = numMaps++;
-       if (i == MAX_MEMORY_MAPPINGS)
-           return NULL;
-       }
-
-    /* Round the physical address to a 4Kb boundary and the limit to a
-     * 4Kb-1 boundary before passing the values to DPMI as some extenders
-     * will fail the calls unless this is the case. If we round the
-     * physical address, then we also add an extra offset into the address
-     * that we return.
-     */
-    baseOfs = physAddr & 4095;
-    baseAddr = physAddr & ~4095;
-    roundedLimit = ((limit+baseOfs+1+4095) & ~4095)-1;
-    r.x.ax = 0x800;
-    r.x.bx = baseAddr >> 16;
-    r.x.cx = baseAddr & 0xFFFF;
-    r.x.si = roundedLimit >> 16;
-    r.x.di = roundedLimit & 0xFFFF;
-    PM_int386(0x31, &r, &r);
-    if (r.x.cflag)
-       return 0xFFFFFFFFUL;
-    maps[i].physical = physAddr;
-    maps[i].limit = limit;
-    maps[i].linear = ((ulong)r.x.bx << 16) + r.x.cx + baseOfs;
-    return maps[i].linear;
-}
-
-int PMAPI DPMI_setSelectorBase(ushort sel,ulong linAddr)
-{
-    PMREGS  r;
-
-    r.x.ax = 7;                     /* DPMI set selector base address   */
-    r.x.bx = sel;
-    r.x.cx = linAddr >> 16;
-    r.x.dx = linAddr & 0xFFFF;
-    PM_int386(0x31, &r, &r);
-    if (r.x.cflag)
-       return 0;
-    return 1;
-}
-
-ulong PMAPI DPMI_getSelectorBase(ushort sel)
-{
-    PMREGS  r;
-
-    r.x.ax = 6;                     /* DPMI get selector base address   */
-    r.x.bx = sel;
-    PM_int386(0x31, &r, &r);
-    return ((ulong)r.x.cx << 16) + r.x.dx;
-}
-
-int PMAPI DPMI_setSelectorLimit(ushort sel,ulong limit)
-{
-    PMREGS  r;
-
-    r.x.ax = 8;                     /* DPMI set selector limit          */
-    r.x.bx = sel;
-    r.x.cx = limit >> 16;
-    r.x.dx = limit & 0xFFFF;
-    PM_int386(0x31, &r, &r);
-    if (r.x.cflag)
-       return 0;
-    return 1;
-}
-
-uint PMAPI DPMI_createSelector(ulong base,ulong limit)
-{
-    uint    sel;
-    PMREGS  r;
-
-    /* Allocate 1 descriptor */
-    r.x.ax = 0;
-    r.x.cx = 1;
-    PM_int386(0x31, &r, &r);
-    if (r.x.cflag) return 0;
-    sel = r.x.ax;
-
-    /* Set the descriptor access rights (for a 32 bit page granular
-     * segment).
-     */
-    if (limit >= 0x10000L) {
-       r.x.ax = 9;
-       r.x.bx = sel;
-       r.x.cx = 0x40F3;
-       PM_int386(0x31, &r, &r);
-       }
-
-    /* Map physical memory and create selector */
-    if ((base = DPMI_mapPhysicalToLinear(base,limit)) == 0xFFFFFFFFUL)
-       return 0;
-    if (!DPMI_setSelectorBase(sel,base))
-       return 0;
-    if (!DPMI_setSelectorLimit(sel,limit))
-       return 0;
-    return sel;
-}
-
-void PMAPI DPMI_freeSelector(uint sel)
-{
-    PMREGS  r;
-
-    r.x.ax = 1;
-    r.x.bx = sel;
-    PM_int386(0x31, &r, &r);
-}
-
-int PMAPI DPMI_lockLinearPages(ulong linear,ulong len)
-{
-    PMREGS  r;
-
-    r.x.ax = 0x600;                     /* DPMI Lock Linear Region      */
-    r.x.bx = (linear >> 16);            /* Linear address in BX:CX      */
-    r.x.cx = (linear & 0xFFFF);
-    r.x.si = (len >> 16);               /* Length in SI:DI              */
-    r.x.di = (len & 0xFFFF);
-    PM_int386(0x31, &r, &r);
-    return (!r.x.cflag);
-}
-
-int PMAPI DPMI_unlockLinearPages(ulong linear,ulong len)
-{
-    PMREGS  r;
-
-    r.x.ax = 0x601;                     /* DPMI Unlock Linear Region    */
-    r.x.bx = (linear >> 16);            /* Linear address in BX:CX      */
-    r.x.cx = (linear & 0xFFFF);
-    r.x.si = (len >> 16);               /* Length in SI:DI              */
-    r.x.di = (len & 0xFFFF);
-    PM_int386(0x31, &r, &r);
-    return (!r.x.cflag);
-}
-
-/****************************************************************************
-REMARKS:
-Adjust the page table caching bits directly. Requires ring 0 access and
-only works with DOS4GW and compatible extenders (CauseWay also works since
-it has direct support for the ring 0 instructions we need from ring 3). Will
-not work in a DOS box, but we call into the ring 0 helper VxD so we should
-never get here in a DOS box anyway (assuming the VxD is present). If we
-do get here and we are in windows, this code will be skipped.
-****************************************************************************/
-static void PM_adjustPageTables(
-    ulong linear,
-    ulong limit,
-    ibool isCached)
-{
-#ifdef  DOS4GW
-    int     startPDB,endPDB,iPDB,startPage,endPage,start,end,iPage;
-    ulong   andMask,orMask,pageTable,*pPageTable;
-
-    andMask = ~0x18;
-    orMask = (isCached) ? 0x00 : 0x18;
-    if (_PM_pagingEnabled() == 1 && (PDB = _PM_getPDB()) != 0) {
-       if (_PM_haveCauseWay) {
-           /* CauseWay is a little different in the page table handling.
-            * The code that we use for DOS4G/W does not appear to work
-            * with CauseWay correctly as it does not appear to allow us
-            * to map the page tables directly. Instead we can directly
-            * access the page table entries in extended memory where
-            * CauseWay always locates them (starting at 1024*4096*1023)
-            */
-           startPage = (linear >> 12);
-           endPage = ((linear+limit) >> 12);
-           pPageTable = (ulong*)CW_PAGE_TABLE_START;
-           for (iPage = startPage; iPage <= endPage; iPage++)
-               pPageTable[iPage] = (pPageTable[iPage] & andMask) | orMask;
-           }
-       else {
-           pPDB = (ulong*)DPMI_mapPhysicalToLinear(PDB,0xFFF);
-           if (pPDB) {
-               startPDB = (linear >> 22) & 0x3FF;
-               startPage = (linear >> 12) & 0x3FF;
-               endPDB = ((linear+limit) >> 22) & 0x3FF;
-               endPage = ((linear+limit) >> 12) & 0x3FF;
-               for (iPDB = startPDB; iPDB <= endPDB; iPDB++) {
-                   pageTable = pPDB[iPDB] & ~0xFFF;
-                   pPageTable = (ulong*)DPMI_mapPhysicalToLinear(pageTable,0xFFF);
-                   start = (iPDB == startPDB) ? startPage : 0;
-                   end = (iPDB == endPDB) ? endPage : 0x3FF;
-                   for (iPage = start; iPage <= end; iPage++)
-                       pPageTable[iPage] = (pPageTable[iPage] & andMask) | orMask;
-                   }
-               }
-           }
-       PM_flushTLB();
-       }
-#endif
-}
-
-void * PMAPI DPMI_mapPhysicalAddr(ulong base,ulong limit,ibool isCached)
-{
-    PMSREGS     sregs;
-    ulong       linAddr;
-    ulong       DSBaseAddr;
-
-    /* Get the base address for the default DS selector */
-    PM_segread(&sregs);
-    DSBaseAddr = DPMI_getSelectorBase(sregs.ds);
-    if ((base < 0x100000) && (DSBaseAddr == 0)) {
-       /* DS is zero based, so we can directly access the first 1Mb of
-        * system memory (like under DOS4GW).
-        */
-       return (void*)base;
-       }
-
-    /* Map the memory to a linear address using DPMI function 0x800 */
-    if ((linAddr = DPMI_mapPhysicalToLinear(base,limit)) == 0xFFFFFFFF) {
-       if (base >= 0x100000)
-           return NULL;
-       /* If the linear address mapping fails but we are trying to
-        * map an area in the first 1Mb of system memory, then we must
-        * be running under a Windows or OS/2 DOS box. Under these
-        * environments we can use the segment wrap around as a fallback
-        * measure, as this does work properly.
-        */
-       linAddr = base;
-       }
-
-    /* Now expand the default DS selector to 4Gb so we can access it */
-    if (!DPMI_setSelectorLimit(sregs.ds,0xFFFFFFFFUL))
-       return NULL;
-
-    /* Finally enable caching for the page tables that we just mapped in,
-     * since DOS4GW and PMODE/W create the page table entries without
-     * caching enabled which hurts the performance of the linear framebuffer
-     * as it disables write combining on Pentium Pro and above processors.
-     *
-     * For those processors cache disabling is better handled through the
-     * MTRR registers anyway (we can write combine a region but disable
-     * caching) so that MMIO register regions do not screw up.
-     */
-    if (DSBaseAddr == 0)
-       PM_adjustPageTables(linAddr,limit,isCached);
-
-    /* Now return the base address of the memory into the default DS */
-    return (void*)(linAddr - DSBaseAddr);
-}
-
-#if defined(PM386)
-
-/* Some DOS extender implementations do not directly support calling a
- * real mode procedure from protected mode. However we can simulate what
- * we need temporarily hooking the INT 6Ah vector with a small real mode
- * stub that will call our real mode code for us.
- */
-
-static uchar int6AHandler[] = {
-    0x00,0x00,0x00,0x00,        /*  __PMODE_callReal variable           */
-    0xFB,                       /*  sti                                 */
-    0x2E,0xFF,0x1E,0x00,0x00,   /*  call    [cs:__PMODE_callReal]       */
-    0xCF,                       /*  iretf                               */
-    };
-static uchar *crPtr = NULL; /* Pointer to of int 6A handler         */
-static uint crRSeg,crROff;  /* Real mode seg:offset of handler      */
-
-void PMAPI PM_callRealMode(uint seg,uint off, RMREGS *in,
-    RMSREGS *sregs)
-{
-    uchar   *p;
-    uint    oldSeg,oldOff;
-
-    if (!crPtr) {
-       /* Allocate and copy the memory block only once */
-       crPtr = PM_allocRealSeg(sizeof(int6AHandler), &crRSeg, &crROff);
-       memcpy(crPtr,int6AHandler,sizeof(int6AHandler));
-       }
-    PM_setWord(crPtr,off);              /* Plug in address to call  */
-    PM_setWord(crPtr+2,seg);
-    p = PM_mapRealPointer(0,0x6A * 4);
-    oldOff = PM_getWord(p);             /* Save old handler address */
-    oldSeg = PM_getWord(p+2);
-    PM_setWord(p,crROff+4);             /* Hook 6A handler          */
-    PM_setWord(p+2,crRSeg);
-    PM_int86x(0x6A, in, in, sregs);     /* Call real mode code      */
-    PM_setWord(p,oldOff);               /* Restore old handler      */
-    PM_setWord(p+2,oldSeg);
-}
-
-#endif  /* PM386 */
-
-#endif  /* !REALMODE */
-
-/****************************************************************************
-REMARKS:
-Allocates a block of locked, physically contiguous memory. The memory
-may be required to be below the 16Meg boundary.
-****************************************************************************/
-void * PMAPI PM_allocLockedMem(
-    uint size,
-    ulong *physAddr,
-    ibool contiguous,
-    ibool below16Meg)
-{
-    uchar           *p,*roundedP;
-    uint            r_seg,r_off;
-    uint            roundedSize = (size + 4 + 0xFFF) & ~0xFFF;
-    PM_lockHandle   lh; /* Unused in DOS */
-#ifndef REALMODE
-    VXD_regs        regs;
-
-    /* If we have connected to our helper VxD in a Windows DOS box, use the
-     * helper VxD services to allocate the memory that we need.
-     */
-    if (VXD_version) {
-       memset(&regs,0,sizeof(regs));
-       regs.eax = API_NUM(PMHELP_ALLOCLOCKED);
-       regs.ebx = size;
-       regs.ecx = (ulong)physAddr;
-       regs.edx = contiguous | (below16Meg << 8);
-       _PM_VxDCall(&regs,_PM_VXD_off,_PM_VXD_sel);
-       return (void*)regs.eax;
-       }
-
-    /* If the memory is not contiguous, we simply need to allocate it
-     * using regular memory allocation services, and lock it down
-     * in memory.
-     *
-     * For contiguous memory blocks, the only way to guarantee contiguous physical
-     * memory addresses under DOS is to allocate the memory below the
-     * 1Meg boundary as real mode memory.
-     *
-     * Note that we must page align the memory block, and we also must
-     * keep track of the non-aligned pointer so we can properly free
-     * it later. Hence we actually allocate 4 bytes more than the
-     * size rounded up to the next 4K boundary.
-     */
-    if (!contiguous)
-       p = PM_malloc(roundedSize);
-    else
-#endif
-       p = PM_allocRealSeg(roundedSize,&r_seg,&r_off);
-    if (p == NULL)
-       return NULL;
-    roundedP = (void*)(((ulong)p + 0xFFF) & ~0xFFF);
-    *((ulong*)(roundedP + size)) = (ulong)p;
-    PM_lockDataPages(roundedP,size,&lh);
-    if ((*physAddr = PM_getPhysicalAddr(roundedP)) == 0xFFFFFFFF) {
-       PM_freeLockedMem(roundedP,size,contiguous);
-       return NULL;
-       }
-
-    /* Disable caching for the memory since it is probably a DMA buffer */
-#ifndef REALMODE
-    PM_adjustPageTables((ulong)roundedP,size-1,false);
-#endif
-    return roundedP;
-}
-
-/****************************************************************************
-REMARKS:
-Free a block of locked memory.
-****************************************************************************/
-void PMAPI PM_freeLockedMem(void *p,uint size,ibool contiguous)
-{
-#ifndef REALMODE
-    VXD_regs        regs;
-    PM_lockHandle   lh; /* Unused in DOS */
-
-    if (!p)
-       return;
-    if (VXD_version) {
-       memset(&regs,0,sizeof(regs));
-       regs.eax = API_NUM(PMHELP_FREELOCKED);
-       regs.ebx = (ulong)p;
-       regs.ecx = size;
-       regs.edx = contiguous;
-       _PM_VxDCall(&regs,_PM_VXD_off,_PM_VXD_sel);
-       return;
-       }
-    PM_unlockDataPages(p,size,&lh);
-    if (!contiguous)
-       free(*((void**)((uchar*)p + size)));
-    else
-#endif
-       PM_freeRealSeg(*((void**)((char*)p + size)));
-}
-
-#ifndef REALMODE
-/****************************************************************************
-REMARKS:
-Allocates a new block of pages for the page block manager.
-****************************************************************************/
-static pageblock *PM_addNewPageBlock(void)
-{
-    int         i,size;
-    pageblock   *newBlock;
-    char        *p,*next;
-
-    /* Allocate memory for the new page block, and add to head of list */
-    size = PAGES_PER_BLOCK * PM_PAGE_SIZE + (PM_PAGE_SIZE-1) + sizeof(pageblock);
-    if ((newBlock = PM_malloc(size)) == NULL)
-       return NULL;
-    newBlock->prev = NULL;
-    newBlock->next = pageBlocks;
-    if (pageBlocks)
-       pageBlocks->prev = newBlock;
-    pageBlocks = newBlock;
-
-    /* Initialise the page aligned free list for the page block */
-    newBlock->freeCount = PAGES_PER_BLOCK;
-    newBlock->freeList = p = (char*)(((ulong)(newBlock + 1) + (PM_PAGE_SIZE-1)) & ~(PM_PAGE_SIZE-1));
-    newBlock->freeListStart = newBlock->freeList;
-    newBlock->freeListEnd = p + (PAGES_PER_BLOCK-1) * PM_PAGE_SIZE;
-    for (i = 0; i < PAGES_PER_BLOCK; i++,p = next)
-       FREELIST_NEXT(p) = next = p + PM_PAGE_SIZE;
-    FREELIST_NEXT(p - PM_PAGE_SIZE) = NULL;
-    return newBlock;
-}
-#endif
-
-/****************************************************************************
-REMARKS:
-Allocates a page aligned and page sized block of memory
-****************************************************************************/
-void * PMAPI PM_allocPage(
-    ibool locked)
-{
-#ifndef REALMODE
-    VXD_regs        regs;
-    pageblock       *block;
-    void            *p;
-    PM_lockHandle   lh; /* Unused in DOS */
-
-    /* Call the helper VxD for this service if we are running in a DOS box */
-    if (VXD_version) {
-       memset(&regs,0,sizeof(regs));
-       regs.eax = API_NUM(PMHELP_ALLOCPAGE);
-       regs.ebx = locked;
-       _PM_VxDCall(&regs,_PM_VXD_off,_PM_VXD_sel);
-       return (void*)regs.eax;
-       }
-
-    /* Scan the block list looking for any free blocks. Allocate a new
-     * page block if no free blocks are found.
-     */
-    for (block = pageBlocks; block != NULL; block = block->next) {
-       if (block->freeCount)
-           break;
-       }
-    if (block == NULL && (block = PM_addNewPageBlock()) == NULL)
-       return NULL;
-    block->freeCount--;
-    p = block->freeList;
-    block->freeList = FREELIST_NEXT(p);
-    if (locked)
-       PM_lockDataPages(p,PM_PAGE_SIZE,&lh);
-    return p;
-#else
-    return NULL;
-#endif
-}
-
-/****************************************************************************
-REMARKS:
-Free a page aligned and page sized block of memory
-****************************************************************************/
-void PMAPI PM_freePage(
-    void *p)
-{
-#ifndef REALMODE
-    VXD_regs    regs;
-    pageblock   *block;
-
-    /* Call the helper VxD for this service if we are running in a DOS box */
-    if (VXD_version) {
-       memset(&regs,0,sizeof(regs));
-       regs.eax = API_NUM(PMHELP_FREEPAGE);
-       regs.ebx = (ulong)p;
-       _PM_VxDCall(&regs,_PM_VXD_off,_PM_VXD_sel);
-       return;
-       }
-
-    /* First find the page block that this page belongs to */
-    for (block = pageBlocks; block != NULL; block = block->next) {
-       if (p >= block->freeListStart && p <= block->freeListEnd)
-           break;
-       }
-    CHECK(block != NULL);
-
-    /* Now free the block by adding it to the free list */
-    FREELIST_NEXT(p) = block->freeList;
-    block->freeList = p;
-    if (++block->freeCount == PAGES_PER_BLOCK) {
-       /* If all pages in the page block are now free, free the entire
-        * page block itself.
-        */
-       if (block == pageBlocks) {
-           /* Delete from head */
-           pageBlocks = block->next;
-           if (block->next)
-               block->next->prev = NULL;
-           }
-       else {
-           /* Delete from middle of list */
-           CHECK(block->prev != NULL);
-           block->prev->next = block->next;
-           if (block->next)
-               block->next->prev = block->prev;
-           }
-       PM_free(block);
-       }
-#else
-    (void)p;
-#endif
-}
-
-/*-------------------------------------------------------------------------*/
-/* DOS Real Mode support.                                                  */
-/*-------------------------------------------------------------------------*/
-
-#ifdef REALMODE
-
-#ifndef MK_FP
-#define MK_FP(s,o)  ( (void far *)( ((ulong)(s) << 16) + \
-                   (ulong)(o) ))
-#endif
-
-void * PMAPI PM_mapRealPointer(uint r_seg,uint r_off)
-{ return MK_FP(r_seg,r_off); }
-
-void * PMAPI PM_getBIOSPointer(void)
-{
-    return MK_FP(0x40,0);
-}
-
-void * PMAPI PM_getA0000Pointer(void)
-{
-    return MK_FP(0xA000,0);
-}
-
-void * PMAPI PM_mapPhysicalAddr(ulong base,ulong limit,ibool isCached)
-{
-    uint sel = base >> 4;
-    uint off = base & 0xF;
-    limit = limit;
-    return MK_FP(sel,off);
-}
-
-void PMAPI PM_freePhysicalAddr(void *ptr,ulong limit)
-{ ptr = ptr; }
-
-ulong PMAPI PM_getPhysicalAddr(void *p)
-{
-    return ((((ulong)p >> 16) << 4) + (ushort)p);
-}
-
-ibool PMAPI PM_getPhysicalAddrRange(void *p,ulong length,ulong *physAddress)
-{ return false; }
-
-void * PMAPI PM_mapToProcess(void *base,ulong limit)
-{ return (void*)base; }
-
-void * PMAPI PM_allocRealSeg(uint size,uint *r_seg,uint *r_off)
-{
-    /* Call malloc() to allocate the memory for us */
-    void *p = PM_malloc(size);
-    *r_seg = FP_SEG(p);
-    *r_off = FP_OFF(p);
-    return p;
-}
-
-void PMAPI PM_freeRealSeg(void *mem)
-{
-    if (mem) PM_free(mem);
-}
-
-int PMAPI PM_int86(int intno, RMREGS *in, RMREGS *out)
-{
-    return PM_int386(intno,in,out);
-}
-
-int PMAPI PM_int86x(int intno, RMREGS *in, RMREGS *out,
-    RMSREGS *sregs)
-{
-    return PM_int386x(intno,in,out,sregs);
-}
-
-void PMAPI PM_availableMemory(ulong *physical,ulong *total)
-{
-    PMREGS regs;
-
-    regs.h.ah = 0x48;
-    regs.x.bx = 0xFFFF;
-    PM_int86(0x21,&regs,&regs);
-    *physical = *total = regs.x.bx * 16UL;
-}
-
-#endif
-
-/*-------------------------------------------------------------------------*/
-/* Phar Lap TNT DOS Extender support.                                      */
-/*-------------------------------------------------------------------------*/
-
-#ifdef TNT
-
-#include <pldos32.h>
-#include <pharlap.h>
-#include <hw386.h>
-
-static uchar *zeroPtr = NULL;
-
-void * PMAPI PM_getBIOSPointer(void)
-{
-    if (!zeroPtr)
-       zeroPtr = PM_mapPhysicalAddr(0,0xFFFFF,true);
-    return (void*)(zeroPtr + 0x400);
-}
-
-void * PMAPI PM_getA0000Pointer(void)
-{
-    static void *bankPtr;
-    if (!bankPtr)
-       bankPtr = PM_mapPhysicalAddr(0xA0000,0xFFFF,true);
-    return bankPtr;
-}
-
-void * PMAPI PM_mapPhysicalAddr(ulong base,ulong limit,ibool isCached)
-{
-    CONFIG_INF  config;
-    ULONG       offset;
-    int         err;
-    ulong       baseAddr,baseOfs,newLimit;
-    VXD_regs    regs;
-
-    /* If we have connected to our helper VxD in a Windows DOS box, use
-     * the helper VxD services to map memory instead of the DPMI services.
-     * We do this because the helper VxD can properly disable caching
-     * where necessary, which we can only do directly here if we are
-     * running at ring 0 (ie: under real DOS).
-     */
-    if (VXD_version == -1)
-       PM_init();
-    if (VXD_version) {
-       memset(&regs,0,sizeof(regs));
-       regs.eax = API_NUM(PMHELP_MAPPHYS);
-       regs.ebx = base;
-       regs.ecx = limit;
-       regs.edx = isCached;
-       _PM_VxDCall(&regs,_PM_VXD_off,_PM_VXD_sel);
-       return (void*)regs.eax;
-       }
-
-    /* Round the physical address to a 4Kb boundary and the limit to a
-     * 4Kb-1 boundary before passing the values to TNT. If we round the
-     * physical address, then we also add an extra offset into the address
-     * that we return.
-     */
-    baseOfs = base & 4095;
-    baseAddr = base & ~4095;
-    newLimit = ((limit+baseOfs+1+4095) & ~4095)-1;
-    _dx_config_inf(&config, (UCHAR*)&config);
-    err = _dx_map_phys(config.c_ds_sel,baseAddr,(newLimit + 4095) / 4096,&offset);
-    if (err == 130) {
-       /* If the TNT function failed, we are running in a DPMI environment
-        * and this function does not work. However we know how to handle
-        * DPMI properly, so we use our generic DPMI functions to do
-        * what the TNT runtime libraries can't.
-        */
-       return DPMI_mapPhysicalAddr(base,limit,isCached);
-       }
-    if (err == 0)
-       return (void*)(offset + baseOfs);
-    return NULL;
-}
-
-void PMAPI PM_freePhysicalAddr(void *ptr,ulong limit)
-{
-}
-
-ulong PMAPI PM_getPhysicalAddr(void *p)
-{ return 0xFFFFFFFFUL; }
-
-ibool PMAPI PM_getPhysicalAddrRange(void *p,ulong length,ulong *physAddress)
-{ return false; }
-
-void * PMAPI PM_mapToProcess(void *base,ulong limit)
-{ return (void*)base; }
-
-void * PMAPI PM_mapRealPointer(uint r_seg,uint r_off)
-{
-    if (!zeroPtr)
-       zeroPtr = PM_mapPhysicalAddr(0,0xFFFFF);
-    return (void*)(zeroPtr + MK_PHYS(r_seg,r_off));
-}
-
-void * PMAPI PM_allocRealSeg(uint size,uint *r_seg,uint *r_off)
-{
-    USHORT  addr,t;
-    void    *p;
-
-    if (_dx_real_alloc((size + 0xF) >> 4,&addr,&t) != 0)
-       return 0;
-    *r_seg = addr;                  /* Real mode segment address    */
-    *r_off = 0;                     /* Real mode segment offset     */
-    p = PM_mapRealPointer(*r_seg,*r_off);
-    _PM_addRealModeBlock(p,addr);
-    return p;
-}
-
-void PMAPI PM_freeRealSeg(void *mem)
-{
-    if (mem) _dx_real_free(_PM_findRealModeBlock(mem));
-}
-
-#define INDPMI(reg)     rmregs.reg = regs->reg
-#define OUTDPMI(reg)    regs->reg = rmregs.reg
-
-void PMAPI DPMI_int86(int intno, DPMI_regs *regs)
-{
-    SWI_REGS    rmregs;
-
-    memset(&rmregs, 0, sizeof(rmregs));
-    INDPMI(eax); INDPMI(ebx); INDPMI(ecx); INDPMI(edx); INDPMI(esi); INDPMI(edi);
-
-    _dx_real_int(intno,&rmregs);
-
-    OUTDPMI(eax); OUTDPMI(ebx); OUTDPMI(ecx); OUTDPMI(edx); OUTDPMI(esi); OUTDPMI(edi);
-    regs->flags = rmregs.flags;
-}
-
-#define IN(reg)     rmregs.reg = in->e.reg
-#define OUT(reg)    out->e.reg = rmregs.reg
-
-int PMAPI PM_int86(int intno, RMREGS *in, RMREGS *out)
-{
-    SWI_REGS    rmregs;
-
-    memset(&rmregs, 0, sizeof(rmregs));
-    IN(eax); IN(ebx); IN(ecx); IN(edx); IN(esi); IN(edi);
-
-    _dx_real_int(intno,&rmregs);
-
-    OUT(eax); OUT(ebx); OUT(ecx); OUT(edx); OUT(esi); OUT(edi);
-    out->x.cflag = rmregs.flags & 0x1;
-    return out->x.ax;
-}
-
-int PMAPI PM_int86x(int intno, RMREGS *in, RMREGS *out,
-    RMSREGS *sregs)
-{
-    SWI_REGS    rmregs;
-
-    memset(&rmregs, 0, sizeof(rmregs));
-    IN(eax); IN(ebx); IN(ecx); IN(edx); IN(esi); IN(edi);
-    rmregs.es = sregs->es;
-    rmregs.ds = sregs->ds;
-
-    _dx_real_int(intno,&rmregs);
-
-    OUT(eax); OUT(ebx); OUT(ecx); OUT(edx); OUT(esi); OUT(edi);
-    sregs->es = rmregs.es;
-    sregs->cs = rmregs.cs;
-    sregs->ss = rmregs.ss;
-    sregs->ds = rmregs.ds;
-    out->x.cflag = rmregs.flags & 0x1;
-    return out->x.ax;
-}
-
-void PMAPI PM_availableMemory(ulong *physical,ulong *total)
-{
-    PMREGS  r;
-    uint    data[25];
-
-    r.x.ax = 0x2520;                /* Get free memory info */
-    r.x.bx = 0;
-    r.e.edx = (uint)data;
-    PM_int386(0x21, &r, &r);
-    *physical = data[21] * 4096;
-    *total = data[23] * 4096;
-}
-
-#endif
-
-/*-------------------------------------------------------------------------*/
-/* Symantec C++ DOSX and FlashTek X-32/X-32VM support                      */
-/*-------------------------------------------------------------------------*/
-
-#if defined(DOSX) || defined(X32VM)
-
-#ifdef  X32VM
-#include <x32.h>
-
-#define _x386_mk_protected_ptr(p)   _x32_mk_protected_ptr((void*)p)
-#define _x386_free_protected_ptr(p) _x32_free_protected_ptr(p)
-#define _x386_zero_base_ptr         _x32_zero_base_ptr
-#else
-extern void *_x386_zero_base_ptr;
-#endif
-
-void * PMAPI PM_mapRealPointer(uint r_seg,uint r_off)
-{
-    return (void*)((ulong)_x386_zero_base_ptr + MK_PHYS(r_seg,r_off));
-}
-
-void * PMAPI PM_allocRealSeg(uint size,uint *r_seg,uint *r_off)
-{
-    PMREGS  r;
-
-    r.h.ah = 0x48;                  /* DOS function 48h - allocate mem  */
-    r.x.bx = (size + 0xF) >> 4;     /* Number of paragraphs to allocate */
-    PM_int386(0x21, &r, &r);        /* Call DOS extender                */
-    if (r.x.cflag)
-       return 0;                   /* Could not allocate the memory    */
-    *r_seg = r.e.eax;
-    *r_off = 0;
-    return PM_mapRealPointer(*r_seg,*r_off);
-}
-
-void PMAPI PM_freeRealSeg(void *mem)
-{
-    /* Cannot de-allocate this memory */
-    mem = mem;
-}
-
-#pragma pack(1)
-
-typedef struct {
-    ushort  intno;
-    ushort  ds;
-    ushort  es;
-    ushort  fs;
-    ushort  gs;
-    ulong   eax;
-    ulong   edx;
-    } _RMREGS;
-
-#pragma pack()
-
-#define IN(reg)     regs.e.reg = in->e.reg
-#define OUT(reg)    out->e.reg = regs.e.reg
-
-int PMAPI PM_int86(int intno, RMREGS *in, RMREGS *out)
-{
-    _RMREGS rmregs;
-    PMREGS  regs;
-    PMSREGS pmsregs;
-
-    rmregs.intno = intno;
-    rmregs.eax = in->e.eax;
-    rmregs.edx = in->e.edx;
-    IN(ebx); IN(ecx); IN(esi); IN(edi);
-    regs.x.ax = 0x2511;
-    regs.e.edx = (uint)(&rmregs);
-    PM_segread(&pmsregs);
-    PM_int386x(0x21,&regs,&regs,&pmsregs);
-
-    OUT(eax); OUT(ebx); OUT(ecx); OUT(esi); OUT(edi);
-    out->x.dx = rmregs.edx;
-    out->x.cflag = regs.x.cflag;
-    return out->x.ax;
-}
-
-int PMAPI PM_int86x(int intno, RMREGS *in, RMREGS *out, RMSREGS *sregs)
-{
-    _RMREGS rmregs;
-    PMREGS  regs;
-    PMSREGS pmsregs;
-
-    rmregs.intno = intno;
-    rmregs.eax = in->e.eax;
-    rmregs.edx = in->e.edx;
-    rmregs.es = sregs->es;
-    rmregs.ds = sregs->ds;
-    IN(ebx); IN(ecx); IN(esi); IN(edi);
-    regs.x.ax = 0x2511;
-    regs.e.edx = (uint)(&rmregs);
-    PM_segread(&pmsregs);
-    PM_int386x(0x21,&regs,&regs,&pmsregs);
-
-    OUT(eax); OUT(ebx); OUT(ecx); OUT(esi); OUT(edi);
-    sregs->es = rmregs.es;
-    sregs->ds = rmregs.ds;
-    out->x.dx = rmregs.edx;
-    out->x.cflag = regs.x.cflag;
-    return out->x.ax;
-}
-
-void * PMAPI PM_getBIOSPointer(void)
-{
-    return (void*)((ulong)_x386_zero_base_ptr + 0x400);
-}
-
-void * PMAPI PM_getA0000Pointer(void)
-{
-    return (void*)((ulong)_x386_zero_base_ptr + 0xA0000);
-}
-
-void * PMAPI PM_mapPhysicalAddr(ulong base,ulong limit,ibool isCached)
-{
-    VXD_regs    regs;
-
-    /* If we have connected to our helper VxD in a Windows DOS box, use
-     * the helper VxD services to map memory instead of the DPMI services.
-     * We do this because the helper VxD can properly disable caching
-     * where necessary, which we can only do directly here if we are
-     * running at ring 0 (ie: under real DOS).
-     */
-    if (VXD_version == -1)
-       PM_init();
-    if (VXD_version) {
-       memset(&regs,0,sizeof(regs));
-       regs.eax = API_NUM(PMHELP_MAPPHYS);
-       regs.ebx = base;
-       regs.ecx = limit;
-       regs.edx = isCached;
-       _PM_VxDCall(&regs,_PM_VXD_off,_PM_VXD_sel);
-       return (void*)regs.eax;
-       }
-
-    if (base > 0x100000)
-       return _x386_map_physical_address((void*)base,limit);
-    return (void*)((ulong)_x386_zero_base_ptr + base);
-}
-
-void PMAPI PM_freePhysicalAddr(void *ptr,ulong limit)
-{
-    /* Mapping cannot be freed */
-}
-
-ulong PMAPI PM_getPhysicalAddr(void *p)
-{ return 0xFFFFFFFFUL; }
-
-ibool PMAPI PM_getPhysicalAddrRange(void *p,ulong length,ulong *physAddress)
-{ return false; }
-
-void * PMAPI PM_mapToProcess(void *base,ulong limit)
-{ return (void*)base; }
-
-ulong _cdecl _X32_getPhysMem(void);
-
-void PMAPI PM_availableMemory(ulong *physical,ulong *total)
-{
-    PMREGS  regs;
-
-    /* Get total memory available, including virtual memory */
-    regs.x.ax = 0x350B;
-    PM_int386(0x21,&regs,&regs);
-    *total = regs.e.eax;
-
-    /* Get physical memory available */
-    *physical = _X32_getPhysMem();
-    if (*physical > *total)
-       *physical = *total;
-}
-
-#endif
-
-/*-------------------------------------------------------------------------*/
-/* Borland's DPMI32, Watcom DOS4GW and DJGPP DPMI support routines         */
-/*-------------------------------------------------------------------------*/
-
-#if defined(DPMI32) || defined(DOS4GW) || defined(DJGPP)
-
-void * PMAPI PM_getBIOSPointer(void)
-{
-    return PM_mapPhysicalAddr(0x400,0xFFFF,true);
-}
-
-void * PMAPI PM_getA0000Pointer(void)
-{
-    return PM_mapPhysicalAddr(0xA0000,0xFFFF,true);
-}
-
-void * PMAPI PM_mapPhysicalAddr(ulong base,ulong limit,ibool isCached)
-{
-    VXD_regs    regs;
-
-#ifdef  DJGPP
-    /* Enable near pointers for DJGPP V2 */
-    __djgpp_nearptr_enable();
-#endif
-    /* If we have connected to our helper VxD in a Windows DOS box, use
-     * the helper VxD services to map memory instead of the DPMI services.
-     * We do this because the helper VxD can properly disable caching
-     * where necessary, which we can only do directly here if we are
-     * running at ring 0 (ie: under real DOS).
-     */
-    if (VXD_version == -1)
-       PM_init();
-    if (VXD_version) {
-       memset(&regs,0,sizeof(regs));
-       regs.eax = API_NUM(PMHELP_MAPPHYS);
-       regs.ebx = base;
-       regs.ecx = limit;
-       regs.edx = isCached;
-       _PM_VxDCall(&regs,_PM_VXD_off,_PM_VXD_sel);
-       return (void*)regs.eax;
-       }
-    return DPMI_mapPhysicalAddr(base,limit,isCached);
-}
-
-void PMAPI PM_freePhysicalAddr(void *ptr,ulong limit)
-{
-    /* Mapping cannot be freed */
-    (void)ptr;
-    (void)limit;
-}
-
-ulong PMAPI PM_getPhysicalAddr(void *p)
-{
-    ulong   physAddr;
-    if (!PM_getPhysicalAddrRange(p,1,&physAddr))
-       return 0xFFFFFFFF;
-    return physAddr | ((ulong)p & 0xFFF);
-}
-
-ibool PMAPI PM_getPhysicalAddrRange(
-    void *p,
-    ulong length,
-    ulong *physAddress)
-{
-    VXD_regs    regs;
-    ulong       pte;
-    PMSREGS     sregs;
-    ulong       DSBaseAddr;
-
-    /* If we have connected to our helper VxD in a Windows DOS box, use the
-     * helper VxD services to find the physical address of an address.
-     */
-    if (VXD_version) {
-       memset(&regs,0,sizeof(regs));
-       regs.eax = API_NUM(PMHELP_GETPHYSICALADDRRANGE);
-       regs.ebx = (ulong)p;
-       regs.ecx = (ulong)length;
-       regs.edx = (ulong)physAddress;
-       _PM_VxDCall(&regs,_PM_VXD_off,_PM_VXD_sel);
-       return regs.eax;
-       }
-
-    /* Find base address for default DS selector */
-    PM_segread(&sregs);
-    DSBaseAddr = DPMI_getSelectorBase(sregs.ds);
-
-    /* Otherwise directly access the page tables to determine the
-     * physical memory address. Note that we touch the memory before
-     * calling, otherwise the memory may not be paged in correctly.
-     */
-    pte = *((ulong*)p);
-#ifdef  DOS4GW
-    if (_PM_pagingEnabled() == 0) {
-       int     count;
-       ulong   linAddr = (ulong)p;
-
-       /* When paging is disabled physical=linear */
-       for (count = (length+0xFFF) >> 12; count > 0; count--) {
-           *physAddress++ = linAddr;
-           linAddr += 4096;
-           }
-       return true;
-       }
-    else if ((PDB = _PM_getPDB()) != 0 && DSBaseAddr == 0) {
-       int     startPDB,endPDB,iPDB,startPage,endPage,start,end,iPage;
-       ulong   pageTable,*pPageTable,linAddr = (ulong)p;
-       ulong   limit = length-1;
-
-       pPDB = (ulong*)DPMI_mapPhysicalToLinear(PDB,0xFFF);
-       if (pPDB) {
-           startPDB = (linAddr >> 22) & 0x3FFL;
-           startPage = (linAddr >> 12) & 0x3FFL;
-           endPDB = ((linAddr+limit) >> 22) & 0x3FFL;
-           endPage = ((linAddr+limit) >> 12) & 0x3FFL;
-           for (iPDB = startPDB; iPDB <= endPDB; iPDB++) {
-               pageTable = pPDB[iPDB] & ~0xFFFL;
-               pPageTable = (ulong*)DPMI_mapPhysicalToLinear(pageTable,0xFFF);
-               start = (iPDB == startPDB) ? startPage : 0;
-               end = (iPDB == endPDB) ? endPage : 0x3FFL;
-               for (iPage = start; iPage <= end; iPage++)
-                   *physAddress++ = (pPageTable[iPage] & ~0xFFF);
-               }
-           return true;
-           }
-       }
-#endif
-    return false;
-}
-
-void * PMAPI PM_mapToProcess(void *base,ulong limit)
-{
-    (void)limit;
-    return (void*)base;
-}
-
-void * PMAPI PM_mapRealPointer(uint r_seg,uint r_off)
-{
-    static uchar *zeroPtr = NULL;
-
-    if (!zeroPtr)
-       zeroPtr = PM_mapPhysicalAddr(0,0xFFFFF,true);
-    return (void*)(zeroPtr + MK_PHYS(r_seg,r_off));
-}
-
-void * PMAPI PM_allocRealSeg(uint size,uint *r_seg,uint *r_off)
-{
-    PMREGS      r;
-    void        *p;
-
-    r.x.ax = 0x100;                 /* DPMI allocate DOS memory         */
-    r.x.bx = (size + 0xF) >> 4;     /* number of paragraphs             */
-    PM_int386(0x31, &r, &r);
-    if (r.x.cflag)
-       return NULL;                /* DPMI call failed                 */
-    *r_seg = r.x.ax;                /* Real mode segment                */
-    *r_off = 0;
-    p = PM_mapRealPointer(*r_seg,*r_off);
-    _PM_addRealModeBlock(p,r.x.dx);
-    return p;
-}
-
-void PMAPI PM_freeRealSeg(void *mem)
-{
-    PMREGS  r;
-
-    if (mem) {
-       r.x.ax = 0x101;                     /* DPMI free DOS memory         */
-       r.x.dx = _PM_findRealModeBlock(mem);/* DX := selector from 0x100    */
-       PM_int386(0x31, &r, &r);
-       }
-}
-
-static DPMI_handler_t   DPMI_int10 = NULL;
-
-void PMAPI DPMI_setInt10Handler(DPMI_handler_t handler)
-{
-    DPMI_int10 = handler;
-}
-
-void PMAPI DPMI_int86(int intno, DPMI_regs *regs)
-{
-    PMREGS      r;
-    PMSREGS     sr;
-
-    if (intno == 0x10 && DPMI_int10) {
-       if (DPMI_int10(regs))
-           return;
-       }
-    PM_segread(&sr);
-    r.x.ax = 0x300;                 /* DPMI issue real interrupt    */
-    r.h.bl = intno;
-    r.h.bh = 0;
-    r.x.cx = 0;
-    sr.es = sr.ds;
-    r.e.edi = (uint)regs;
-    PM_int386x(0x31, &r, &r, &sr);  /* Issue the interrupt          */
-}
-
-#define IN(reg)     rmregs.reg = in->e.reg
-#define OUT(reg)    out->e.reg = rmregs.reg
-
-int PMAPI PM_int86(int intno, RMREGS *in, RMREGS *out)
-{
-    DPMI_regs   rmregs;
-
-    memset(&rmregs, 0, sizeof(rmregs));
-    IN(eax); IN(ebx); IN(ecx); IN(edx); IN(esi); IN(edi);
-
-    DPMI_int86(intno,&rmregs);      /* DPMI issue real interrupt    */
-
-    OUT(eax); OUT(ebx); OUT(ecx); OUT(edx); OUT(esi); OUT(edi);
-    out->x.cflag = rmregs.flags & 0x1;
-    return out->x.ax;
-}
-
-int PMAPI PM_int86x(int intno, RMREGS *in, RMREGS *out,
-    RMSREGS *sregs)
-{
-    DPMI_regs   rmregs;
-
-    memset(&rmregs, 0, sizeof(rmregs));
-    IN(eax); IN(ebx); IN(ecx); IN(edx); IN(esi); IN(edi);
-    rmregs.es = sregs->es;
-    rmregs.ds = sregs->ds;
-
-    DPMI_int86(intno,&rmregs);      /* DPMI issue real interrupt    */
-
-    OUT(eax); OUT(ebx); OUT(ecx); OUT(edx); OUT(esi); OUT(edi);
-    sregs->es = rmregs.es;
-    sregs->cs = rmregs.cs;
-    sregs->ss = rmregs.ss;
-    sregs->ds = rmregs.ds;
-    out->x.cflag = rmregs.flags & 0x1;
-    return out->x.ax;
-}
-
-#pragma pack(1)
-
-typedef struct {
-       uint    LargestBlockAvail;
-       uint    MaxUnlockedPage;
-       uint    LargestLockablePage;
-       uint    LinAddrSpace;
-       uint    NumFreePagesAvail;
-       uint    NumPhysicalPagesFree;
-       uint    TotalPhysicalPages;
-       uint    FreeLinAddrSpace;
-       uint    SizeOfPageFile;
-       uint    res[3];
-       } MemInfo;
-
-#pragma pack()
-
-void PMAPI PM_availableMemory(ulong *physical,ulong *total)
-{
-    PMREGS  r;
-    PMSREGS sr;
-    MemInfo memInfo;
-
-    PM_segread(&sr);
-    r.x.ax = 0x500;                 /* DPMI get free memory info */
-    sr.es = sr.ds;
-    r.e.edi = (uint)&memInfo;
-    PM_int386x(0x31, &r, &r, &sr);  /* Issue the interrupt */
-    *physical = memInfo.NumPhysicalPagesFree * 4096;
-    *total = memInfo.LargestBlockAvail;
-    if (*total < *physical)
-       *physical = *total;
-}
-
-#endif
-
-#ifndef __16BIT__
-
-/****************************************************************************
-REMARKS:
-Call the VBE/Core software interrupt to change display banks.
-****************************************************************************/
-void PMAPI PM_setBankA(
-    int bank)
-{
-    DPMI_regs   regs;
-    memset(&regs, 0, sizeof(regs));
-    regs.eax = 0x4F05;
-    regs.ebx = 0x0000;
-    regs.edx = bank;
-    DPMI_int86(0x10,&regs);
-}
-
-/****************************************************************************
-REMARKS:
-Call the VBE/Core software interrupt to change display banks.
-****************************************************************************/
-void PMAPI PM_setBankAB(
-    int bank)
-{
-    DPMI_regs   regs;
-    memset(&regs, 0, sizeof(regs));
-    regs.eax = 0x4F05;
-    regs.ebx = 0x0000;
-    regs.edx = bank;
-    DPMI_int86(0x10,&regs);
-    regs.eax = 0x4F05;
-    regs.ebx = 0x0001;
-    regs.edx = bank;
-    DPMI_int86(0x10,&regs);
-}
-
-/****************************************************************************
-REMARKS:
-Call the VBE/Core software interrupt to change display start address.
-****************************************************************************/
-void PMAPI PM_setCRTStart(
-    int x,
-    int y,
-    int waitVRT)
-{
-    DPMI_regs   regs;
-    memset(&regs, 0, sizeof(regs));
-    regs.eax = 0x4F07;
-    regs.ebx = waitVRT;
-    regs.ecx = x;
-    regs.edx = y;
-    DPMI_int86(0x10,&regs);
-}
-
-#endif
-
-/****************************************************************************
-REMARKS:
-Function to get the file attributes for a specific file.
-****************************************************************************/
-uint PMAPI PM_getFileAttr(
-    const char *filename)
-{
-    /* TODO: Implement this! */
-    return 0;
-}
-
-/****************************************************************************
-REMARKS:
-Function to get the file time and date for a specific file.
-****************************************************************************/
-ibool PMAPI PM_getFileTime(
-    const char *filename,
-    ibool gmTime,
-    PM_time *time)
-{
-    /* TODO: Implement this! */
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-Function to set the file time and date for a specific file.
-****************************************************************************/
-ibool PMAPI PM_setFileTime(
-    const char *filename,
-    ibool gmTime,
-    PM_time *time)
-{
-    /* TODO: Implement this! */
-    return false;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/dos/pmdos.c b/board/MAI/bios_emulator/scitech/src/pm/dos/pmdos.c
deleted file mode 100644 (file)
index eecc2da..0000000
+++ /dev/null
@@ -1,1637 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  16/32 bit DOS
-*
-* Description:  Implementation for the OS Portability Manager Library, which
-*               contains functions to implement OS specific services in a
-*               generic, cross platform API. Porting the OS Portability
-*               Manager library is the first step to porting any SciTech
-*               products to a new platform.
-*
-****************************************************************************/
-
-#include "pmapi.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <dos.h>
-
-/*--------------------------- Global variables ----------------------------*/
-
-#ifndef REALMODE
-static int  globalDataStart;
-#endif
-
-PM_criticalHandler  _VARAPI _PM_critHandler = NULL;
-PM_breakHandler     _VARAPI _PM_breakHandler = NULL;
-PM_intHandler       _VARAPI _PM_timerHandler = NULL;
-PM_intHandler       _VARAPI _PM_rtcHandler = NULL;
-PM_intHandler       _VARAPI _PM_keyHandler = NULL;
-PM_key15Handler     _VARAPI _PM_key15Handler = NULL;
-PM_mouseHandler     _VARAPI _PM_mouseHandler = NULL;
-PM_intHandler       _VARAPI _PM_int10Handler = NULL;
-int                 _VARAPI _PM_mouseMask;
-
-uchar *     _VARAPI _PM_ctrlCPtr;               /* Location of Ctrl-C flag      */
-uchar *     _VARAPI _PM_ctrlBPtr;               /* Location of Ctrl-Break flag  */
-uchar *     _VARAPI _PM_critPtr;                /* Location of Critical error Bf*/
-PMFARPTR    _VARAPI _PM_prevTimer = PMNULL;     /* Previous timer handler       */
-PMFARPTR    _VARAPI _PM_prevRTC = PMNULL;       /* Previous RTC handler         */
-PMFARPTR    _VARAPI _PM_prevKey = PMNULL;       /* Previous key handler         */
-PMFARPTR    _VARAPI _PM_prevKey15 = PMNULL;     /* Previous key15 handler       */
-PMFARPTR    _VARAPI _PM_prevBreak = PMNULL;     /* Previous break handler       */
-PMFARPTR    _VARAPI _PM_prevCtrlC = PMNULL;     /* Previous CtrlC handler       */
-PMFARPTR    _VARAPI _PM_prevCritical = PMNULL;  /* Previous critical handler    */
-long        _VARAPI _PM_prevRealTimer;          /* Previous real mode timer     */
-long        _VARAPI _PM_prevRealRTC;            /* Previous real mode RTC       */
-long        _VARAPI _PM_prevRealKey;            /* Previous real mode key       */
-long        _VARAPI _PM_prevRealKey15;          /* Previous real mode key15     */
-long        _VARAPI _PM_prevRealInt10;          /* Previous real mode int 10h   */
-static uchar        _PM_oldCMOSRegA;            /* CMOS register A contents     */
-static uchar        _PM_oldCMOSRegB;            /* CMOS register B contents     */
-static uchar        _PM_oldRTCPIC2;             /* Mask value for RTC IRQ8      */
-
-/* Structure to maintain information about hardware interrupt handlers,
- * include a copy of the hardware IRQ assembler thunk (one for each
- * hooked interrupt handler).
- */
-
-typedef struct {
-    uchar       IRQ;
-    uchar       IRQVect;
-    uchar       prevPIC;
-    uchar       prevPIC2;
-    PMFARPTR    prevHandler;
-    long        prevRealhandler;
-    uchar       thunk[1];
-    /* IRQ assembler thunk follows ... */
-    } _PM_IRQHandle;
-
-/*----------------------------- Implementation ----------------------------*/
-
-/* Globals for locking interrupt handlers in _pmdos.asm */
-
-#ifndef REALMODE
-extern int  _VARAPI _PM_pmdosDataStart;
-extern int  _VARAPI _PM_pmdosDataEnd;
-extern int  _VARAPI _PM_DMADataStart;
-extern int  _VARAPI _PM_DMADataEnd;
-void _ASMAPI _PM_pmdosCodeStart(void);
-void _ASMAPI _PM_pmdosCodeEnd(void);
-void _ASMAPI _PM_DMACodeStart(void);
-void _ASMAPI _PM_DMACodeEnd(void);
-#endif
-
-/* Protected mode interrupt handlers, also called by PM callbacks below */
-
-void _ASMAPI _PM_timerISR(void);
-void _ASMAPI _PM_rtcISR(void);
-void _ASMAPI _PM_irqISRTemplate(void);
-void _ASMAPI _PM_irqISRTemplateEnd(void);
-void _ASMAPI _PM_keyISR(void);
-void _ASMAPI _PM_key15ISR(void);
-void _ASMAPI _PM_breakISR(void);
-void _ASMAPI _PM_ctrlCISR(void);
-void _ASMAPI _PM_criticalISR(void);
-void _ASMAPI _PM_mouseISR(void);
-void _ASMAPI _PM_int10PMCB(void);
-
-/* Protected mode DPMI callback handlers */
-
-void _ASMAPI _PM_mousePMCB(void);
-
-/* Routine to install a mouse handler function */
-
-void _ASMAPI _PM_setMouseHandler(int mask);
-
-/* Routine to allocate DPMI real mode callback routines */
-
-ibool _ASMAPI _DPMI_allocateCallback(void (_ASMAPI *pmcode)(),void *rmregs,long *RMCB);
-void _ASMAPI _DPMI_freeCallback(long RMCB);
-
-/* DPMI helper functions in PMLITE.C */
-
-ulong   PMAPI DPMI_mapPhysicalToLinear(ulong physAddr,ulong limit);
-int     PMAPI DPMI_setSelectorBase(ushort sel,ulong linAddr);
-ulong   PMAPI DPMI_getSelectorBase(ushort sel);
-int     PMAPI DPMI_setSelectorLimit(ushort sel,ulong limit);
-uint    PMAPI DPMI_createSelector(ulong base,ulong limit);
-void    PMAPI DPMI_freeSelector(uint sel);
-int     PMAPI DPMI_lockLinearPages(ulong linear,ulong len);
-int     PMAPI DPMI_unlockLinearPages(ulong linear,ulong len);
-
-/* Functions to read and write CMOS registers */
-
-uchar   PMAPI _PM_readCMOS(int index);
-void    PMAPI _PM_writeCMOS(int index,uchar value);
-
-/*-------------------------------------------------------------------------*/
-/* Generic routines common to all environments                             */
-/*-------------------------------------------------------------------------*/
-
-void PMAPI PM_resetMouseDriver(int hardReset)
-{
-    RMREGS          regs;
-    PM_mouseHandler oldHandler = _PM_mouseHandler;
-
-    PM_restoreMouseHandler();
-    regs.x.ax = hardReset ? 0 : 33;
-    PM_int86(0x33, &regs, &regs);
-    if (oldHandler)
-       PM_setMouseHandler(_PM_mouseMask, oldHandler);
-}
-
-void PMAPI PM_setRealTimeClockFrequency(int frequency)
-{
-    static short convert[] = {
-       8192,
-       4096,
-       2048,
-       1024,
-       512,
-       256,
-       128,
-       64,
-       32,
-       16,
-       8,
-       4,
-       2,
-       -1,
-       };
-    int i;
-
-    /* First clear any pending RTC timeout if not cleared */
-    _PM_readCMOS(0x0C);
-    if (frequency == 0) {
-       /* Disable RTC timout */
-       _PM_writeCMOS(0x0A,_PM_oldCMOSRegA);
-       _PM_writeCMOS(0x0B,_PM_oldCMOSRegB & 0x0F);
-       }
-    else {
-       /* Convert frequency value to RTC clock indexes */
-       for (i = 0; convert[i] != -1; i++) {
-           if (convert[i] == frequency)
-               break;
-           }
-
-       /* Set RTC timout value and enable timeout */
-       _PM_writeCMOS(0x0A,0x20 | (i+3));
-       _PM_writeCMOS(0x0B,(_PM_oldCMOSRegB & 0x0F) | 0x40);
-       }
-}
-
-#ifndef REALMODE
-
-static void PMAPI lockPMHandlers(void)
-{
-    static int      locked = 0;
-    int             stat;
-    PM_lockHandle   lh; /* Unused in DOS */
-
-    /* Lock all of the code and data used by our protected mode interrupt
-     * handling routines, so that it will continue to work correctly
-     * under real mode.
-     */
-    if (!locked) {
-       PM_saveDS();
-       stat  = !PM_lockDataPages(&globalDataStart-2048,4096,&lh);
-       stat |= !PM_lockDataPages(&_PM_pmdosDataStart,(int)&_PM_pmdosDataEnd - (int)&_PM_pmdosDataStart,&lh);
-       stat |= !PM_lockCodePages((__codePtr)_PM_pmdosCodeStart,(int)_PM_pmdosCodeEnd-(int)_PM_pmdosCodeStart,&lh);
-       stat |= !PM_lockDataPages(&_PM_DMADataStart,(int)&_PM_DMADataEnd - (int)&_PM_DMADataStart,&lh);
-       stat |= !PM_lockCodePages((__codePtr)_PM_DMACodeStart,(int)_PM_DMACodeEnd-(int)_PM_DMACodeStart,&lh);
-       if (stat) {
-           printf("Page locking services failed - interrupt handling not safe!\n");
-           exit(1);
-           }
-       locked = 1;
-       }
-}
-
-#endif
-
-/*-------------------------------------------------------------------------*/
-/* DOS Real Mode support.                                                  */
-/*-------------------------------------------------------------------------*/
-
-#ifdef REALMODE
-
-#ifndef MK_FP
-#define MK_FP(s,o)  ( (void far *)( ((ulong)(s) << 16) + \
-                   (ulong)(o) ))
-#endif
-
-int PMAPI PM_setMouseHandler(int mask, PM_mouseHandler mh)
-{
-    PM_saveDS();
-    _PM_mouseHandler = mh;
-    _PM_setMouseHandler(_PM_mouseMask = mask);
-    return 1;
-}
-
-void PMAPI PM_restoreMouseHandler(void)
-{
-    union REGS      regs;
-
-    if (_PM_mouseHandler) {
-       regs.x.ax = 33;
-       int86(0x33, &regs, &regs);
-       _PM_mouseHandler = NULL;
-       }
-}
-
-void PMAPI PM_setTimerHandler(PM_intHandler th)
-{
-    _PM_getRMvect(0x8, (long*)&_PM_prevTimer);
-    _PM_timerHandler = th;
-    _PM_setRMvect(0x8, (long)_PM_timerISR);
-}
-
-void PMAPI PM_restoreTimerHandler(void)
-{
-    if (_PM_timerHandler) {
-       _PM_setRMvect(0x8, (long)_PM_prevTimer);
-       _PM_timerHandler = NULL;
-       }
-}
-
-ibool PMAPI PM_setRealTimeClockHandler(PM_intHandler th,int frequency)
-{
-    /* Save the old CMOS real time clock values */
-    _PM_oldCMOSRegA = _PM_readCMOS(0x0A);
-    _PM_oldCMOSRegB = _PM_readCMOS(0x0B);
-
-    /* Set the real time clock interrupt handler */
-    _PM_getRMvect(0x70, (long*)&_PM_prevRTC);
-    _PM_rtcHandler = th;
-    _PM_setRMvect(0x70, (long)_PM_rtcISR);
-
-    /* Program the real time clock default frequency */
-    PM_setRealTimeClockFrequency(frequency);
-
-    /* Unmask IRQ8 in the PIC2 */
-    _PM_oldRTCPIC2 = PM_inpb(0xA1);
-    PM_outpb(0xA1,_PM_oldRTCPIC2 & 0xFE);
-    return true;
-}
-
-void PMAPI PM_restoreRealTimeClockHandler(void)
-{
-    if (_PM_rtcHandler) {
-       /* Restore CMOS registers and mask RTC clock */
-       _PM_writeCMOS(0x0A,_PM_oldCMOSRegA);
-       _PM_writeCMOS(0x0B,_PM_oldCMOSRegB);
-       PM_outpb(0xA1,(PM_inpb(0xA1) & 0xFE) | (_PM_oldRTCPIC2 & ~0xFE));
-
-       /* Restore the interrupt vector */
-       _PM_setRMvect(0x70, (long)_PM_prevRTC);
-       _PM_rtcHandler = NULL;
-       }
-}
-
-void PMAPI PM_setKeyHandler(PM_intHandler kh)
-{
-    _PM_getRMvect(0x9, (long*)&_PM_prevKey);
-    _PM_keyHandler = kh;
-    _PM_setRMvect(0x9, (long)_PM_keyISR);
-}
-
-void PMAPI PM_restoreKeyHandler(void)
-{
-    if (_PM_keyHandler) {
-       _PM_setRMvect(0x9, (long)_PM_prevKey);
-       _PM_keyHandler = NULL;
-       }
-}
-
-void PMAPI PM_setKey15Handler(PM_key15Handler kh)
-{
-    _PM_getRMvect(0x15, (long*)&_PM_prevKey15);
-    _PM_key15Handler = kh;
-    _PM_setRMvect(0x15, (long)_PM_key15ISR);
-}
-
-void PMAPI PM_restoreKey15Handler(void)
-{
-    if (_PM_key15Handler) {
-       _PM_setRMvect(0x15, (long)_PM_prevKey15);
-       _PM_key15Handler = NULL;
-       }
-}
-
-void PMAPI PM_installAltBreakHandler(PM_breakHandler bh)
-{
-    static int  ctrlCFlag,ctrlBFlag;
-
-    _PM_ctrlCPtr = (uchar*)&ctrlCFlag;
-    _PM_ctrlBPtr = (uchar*)&ctrlBFlag;
-    _PM_getRMvect(0x1B, (long*)&_PM_prevBreak);
-    _PM_getRMvect(0x23, (long*)&_PM_prevCtrlC);
-    _PM_breakHandler = bh;
-    _PM_setRMvect(0x1B, (long)_PM_breakISR);
-    _PM_setRMvect(0x23, (long)_PM_ctrlCISR);
-}
-
-void PMAPI PM_installBreakHandler(void)
-{
-    PM_installAltBreakHandler(NULL);
-}
-
-void PMAPI PM_restoreBreakHandler(void)
-{
-    if (_PM_prevBreak) {
-       _PM_setRMvect(0x1B, (long)_PM_prevBreak);
-       _PM_setRMvect(0x23, (long)_PM_prevCtrlC);
-       _PM_prevBreak = NULL;
-       _PM_breakHandler = NULL;
-       }
-}
-
-void PMAPI PM_installAltCriticalHandler(PM_criticalHandler ch)
-{
-    static  short critBuf[2];
-
-    _PM_critPtr = (uchar*)critBuf;
-    _PM_getRMvect(0x24, (long*)&_PM_prevCritical);
-    _PM_critHandler = ch;
-    _PM_setRMvect(0x24, (long)_PM_criticalISR);
-}
-
-void PMAPI PM_installCriticalHandler(void)
-{
-    PM_installAltCriticalHandler(NULL);
-}
-
-void PMAPI PM_restoreCriticalHandler(void)
-{
-    if (_PM_prevCritical) {
-       _PM_setRMvect(0x24, (long)_PM_prevCritical);
-       _PM_prevCritical = NULL;
-       _PM_critHandler = NULL;
-       }
-}
-
-int PMAPI PM_lockDataPages(void *p,uint len,PM_lockHandle *lh)
-{
-    p = p;  len = len;      /* Do nothing for real mode */
-    return 1;
-}
-
-int PMAPI PM_unlockDataPages(void *p,uint len,PM_lockHandle *lh)
-{
-    p = p;  len = len;      /* Do nothing for real mode */
-    return 1;
-}
-
-int PMAPI PM_lockCodePages(void (*p)(),uint len,PM_lockHandle *lh)
-{
-    p = p;  len = len;      /* Do nothing for real mode */
-    return 1;
-}
-
-int PMAPI PM_unlockCodePages(void (*p)(),uint len,PM_lockHandle *lh)
-{
-    p = p;  len = len;      /* Do nothing for real mode */
-    return 1;
-}
-
-void PMAPI PM_getPMvect(int intno, PMFARPTR *isr)
-{
-    long t;
-    _PM_getRMvect(intno,&t);
-    *isr = (void*)t;
-}
-
-void PMAPI PM_setPMvect(int intno, PM_intHandler isr)
-{
-    PM_saveDS();
-    _PM_setRMvect(intno,(long)isr);
-}
-
-void PMAPI PM_restorePMvect(int intno, PMFARPTR isr)
-{
-    _PM_setRMvect(intno,(long)isr);
-}
-
-#endif
-
-/*-------------------------------------------------------------------------*/
-/* Phar Lap TNT DOS Extender support.                                      */
-/*-------------------------------------------------------------------------*/
-
-#ifdef TNT
-
-#include <pldos32.h>
-#include <pharlap.h>
-#include <hw386.h>
-
-static long prevRealBreak;      /* Previous real mode break handler     */
-static long prevRealCtrlC;      /* Previous real mode CtrlC handler     */
-static long prevRealCritical;   /* Prev real mode critical handler      */
-static uchar *mousePtr;
-
-/* The following real mode routine is used to call a 32 bit protected
- * mode FAR function from real mode. We use this for passing up control
- * from the real mode mouse callback to our protected mode code.
- */
-
-static UCHAR realHandler[] = {      /* Real mode code generic handler   */
-    0x00,0x00,0x00,0x00,            /* __PM_callProtp                   */
-    0x00,0x00,                      /* __PM_protCS                      */
-    0x00,0x00,0x00,0x00,            /* __PM_protHandler                 */
-    0x66,0x60,                      /*  pushad                          */
-    0x1E,                           /*  push    ds                      */
-    0x6A,0x00,                      /*  push    0                       */
-    0x6A,0x00,                      /*  push    0                       */
-    0x2E,0xFF,0x36,0x04,0x00,       /*  push    [cs:__PM_protCS]        */
-    0x66,0x2E,0xFF,0x36,0x06,0x00,  /*  push    [cs:__PM_protHandler]   */
-    0x2E,0xFF,0x1E,0x00,0x00,       /*  call    [cs:__PM_callProtp]     */
-    0x83,0xC4,0x0A,                 /*  add     sp,10                   */
-    0x1F,                           /*  pop     ds                      */
-    0x66,0x61,                      /*  popad                           */
-    0xCB,                           /*  retf                            */
-    };
-
-/* The following functions installs the above realmode callback mechanism
- * in real mode memory for calling the protected mode routine.
- */
-
-uchar * installCallback(void (PMAPI *pmCB)(),uint *rseg, uint *roff)
-{
-    CONFIG_INF  config;
-    REALPTR     realBufAdr,callProtp;
-    ULONG       bufSize;
-    FARPTR      protBufAdr;
-    uchar       *p;
-
-    /* Get address of real mode routine to call up to protected mode    */
-    _dx_rmlink_get(&callProtp, &realBufAdr, &bufSize, &protBufAdr);
-    _dx_config_inf(&config, (UCHAR*)&config);
-
-    /* Fill in the values in the real mode code segment so that it will
-     * call the correct routine.
-     */
-    *((REALPTR*)&realHandler[0]) = callProtp;
-    *((USHORT*)&realHandler[4]) = config.c_cs_sel;
-    *((ULONG*)&realHandler[6]) = (ULONG)pmCB;
-
-    /* Copy the real mode handler to real mode memory   */
-    if ((p = PM_allocRealSeg(sizeof(realHandler),rseg,roff)) == NULL)
-       return NULL;
-    memcpy(p,realHandler,sizeof(realHandler));
-
-    /* Skip past global variabls in real mode code segment */
-    *roff += 0x0A;
-    return p;
-}
-
-int PMAPI PM_setMouseHandler(int mask, PM_mouseHandler mh)
-{
-    RMREGS      regs;
-    RMSREGS     sregs;
-    uint        rseg,roff;
-
-    lockPMHandlers();           /* Ensure our handlers are locked   */
-
-    if ((mousePtr = installCallback(_PM_mouseISR, &rseg, &roff)) == NULL)
-       return 0;
-    _PM_mouseHandler = mh;
-
-    /* Install the real mode mouse handler  */
-    sregs.es = rseg;
-    regs.x.dx = roff;
-    regs.x.cx = _PM_mouseMask = mask;
-    regs.x.ax = 0xC;
-    PM_int86x(0x33, &regs, &regs, &sregs);
-    return 1;
-}
-
-void PMAPI PM_restoreMouseHandler(void)
-{
-    RMREGS  regs;
-
-    if (_PM_mouseHandler) {
-       regs.x.ax = 33;
-       PM_int86(0x33, &regs, &regs);
-       PM_freeRealSeg(mousePtr);
-       _PM_mouseHandler = NULL;
-       }
-}
-
-void PMAPI PM_getPMvect(int intno, PMFARPTR *isr)
-{
-    FARPTR  ph;
-
-    _dx_pmiv_get(intno, &ph);
-    isr->sel = FP_SEL(ph);
-    isr->off = FP_OFF(ph);
-}
-
-void PMAPI PM_setPMvect(int intno, PM_intHandler isr)
-{
-    CONFIG_INF  config;
-    FARPTR      ph;
-
-    PM_saveDS();
-    _dx_config_inf(&config, (UCHAR*)&config);
-    FP_SET(ph,(uint)isr,config.c_cs_sel);
-    _dx_pmiv_set(intno,ph);
-}
-
-void PMAPI PM_restorePMvect(int intno, PMFARPTR isr)
-{
-    FARPTR  ph;
-
-    FP_SET(ph,isr.off,isr.sel);
-    _dx_pmiv_set(intno,ph);
-}
-
-static void getISR(int intno, PMFARPTR *pmisr, long *realisr)
-{
-    PM_getPMvect(intno,pmisr);
-    _PM_getRMvect(intno, realisr);
-}
-
-static void restoreISR(int intno, PMFARPTR pmisr, long realisr)
-{
-    _PM_setRMvect(intno,realisr);
-    PM_restorePMvect(intno,pmisr);
-}
-
-static void setISR(int intno, void (PMAPI *isr)())
-{
-    CONFIG_INF  config;
-    FARPTR      ph;
-
-    lockPMHandlers();           /* Ensure our handlers are locked   */
-
-    _dx_config_inf(&config, (UCHAR*)&config);
-    FP_SET(ph,(uint)isr,config.c_cs_sel);
-    _dx_apmiv_set(intno,ph);
-}
-
-void PMAPI PM_setTimerHandler(PM_intHandler th)
-{
-    getISR(0x8, &_PM_prevTimer, &_PM_prevRealTimer);
-    _PM_timerHandler = th;
-    setISR(0x8, _PM_timerISR);
-}
-
-void PMAPI PM_restoreTimerHandler(void)
-{
-    if (_PM_timerHandler) {
-       restoreISR(0x8, _PM_prevTimer, _PM_prevRealTimer);
-       _PM_timerHandler = NULL;
-       }
-}
-
-ibool PMAPI PM_setRealTimeClockHandler(PM_intHandler th,int frequency)
-{
-    /* Save the old CMOS real time clock values */
-    _PM_oldCMOSRegA = _PM_readCMOS(0x0A);
-    _PM_oldCMOSRegB = _PM_readCMOS(0x0B);
-
-    /* Set the real time clock interrupt handler */
-    getISR(0x70, &_PM_prevRTC, &_PM_prevRealRTC);
-    _PM_rtcHandler = th;
-    setISR(0x70, _PM_rtcISR);
-
-    /* Program the real time clock default frequency */
-    PM_setRealTimeClockFrequency(frequency);
-
-    /* Unmask IRQ8 in the PIC2 */
-    _PM_oldRTCPIC2 = PM_inpb(0xA1);
-    PM_outpb(0xA1,_PM_oldRTCPIC2 & 0xFE);
-    return true;
-}
-
-void PMAPI PM_restoreRealTimeClockHandler(void)
-{
-    if (_PM_rtcHandler) {
-       /* Restore CMOS registers and mask RTC clock */
-       _PM_writeCMOS(0x0A,_PM_oldCMOSRegA);
-       _PM_writeCMOS(0x0B,_PM_oldCMOSRegB);
-       PM_outpb(0xA1,(PM_inpb(0xA1) & 0xFE) | (_PM_oldRTCPIC2 & ~0xFE));
-
-       /* Restore the interrupt vector */
-       restoreISR(0x70, _PM_prevRTC, _PM_prevRealRTC);
-       _PM_rtcHandler = NULL;
-       }
-}
-
-void PMAPI PM_setKeyHandler(PM_intHandler kh)
-{
-    getISR(0x9, &_PM_prevKey, &_PM_prevRealKey);
-    _PM_keyHandler = kh;
-    setISR(0x9, _PM_keyISR);
-}
-
-void PMAPI PM_restoreKeyHandler(void)
-{
-    if (_PM_keyHandler) {
-       restoreISR(0x9, _PM_prevKey, _PM_prevRealKey);
-       _PM_keyHandler = NULL;
-       }
-}
-
-void PMAPI PM_setKey15Handler(PM_key15Handler kh)
-{
-    getISR(0x15, &_PM_prevKey15, &_PM_prevRealKey15);
-    _PM_key15Handler = kh;
-    setISR(0x15, _PM_key15ISR);
-}
-
-void PMAPI PM_restoreKey15Handler(void)
-{
-    if (_PM_key15Handler) {
-       restoreISR(0x15, _PM_prevKey15, _PM_prevRealKey15);
-       _PM_key15Handler = NULL;
-       }
-}
-
-void PMAPI PM_installAltBreakHandler(PM_breakHandler bh)
-{
-    static int  ctrlCFlag,ctrlBFlag;
-
-    _PM_ctrlCPtr = (uchar*)&ctrlCFlag;
-    _PM_ctrlBPtr = (uchar*)&ctrlBFlag;
-    getISR(0x1B, &_PM_prevBreak, &prevRealBreak);
-    getISR(0x23, &_PM_prevCtrlC, &prevRealCtrlC);
-    _PM_breakHandler = bh;
-    setISR(0x1B, _PM_breakISR);
-    setISR(0x23, _PM_ctrlCISR);
-}
-
-void PMAPI PM_installBreakHandler(void)
-{
-    PM_installAltBreakHandler(NULL);
-}
-
-void PMAPI PM_restoreBreakHandler(void)
-{
-    if (_PM_prevBreak.sel) {
-       restoreISR(0x1B, _PM_prevBreak, prevRealBreak);
-       restoreISR(0x23, _PM_prevCtrlC, prevRealCtrlC);
-       _PM_prevBreak.sel = 0;
-       _PM_breakHandler = NULL;
-       }
-}
-
-void PMAPI PM_installAltCriticalHandler(PM_criticalHandler ch)
-{
-    static short    critBuf[2];
-
-    _PM_critPtr = (uchar*)critBuf;
-    getISR(0x24, &_PM_prevCritical, &prevRealCritical);
-    _PM_critHandler = ch;
-    setISR(0x24, _PM_criticalISR);
-}
-
-void PMAPI PM_installCriticalHandler(void)
-{
-    PM_installAltCriticalHandler(NULL);
-}
-
-void PMAPI PM_restoreCriticalHandler(void)
-{
-    if (_PM_prevCritical.sel) {
-       restoreISR(0x24, _PM_prevCritical, prevRealCritical);
-       _PM_prevCritical.sel = 0;
-       _PM_critHandler = NULL;
-       }
-}
-
-int PMAPI PM_lockDataPages(void *p,uint len,PM_lockHandle *lh)
-{
-    return (_dx_lock_pgsn(p,len) == 0);
-}
-
-int PMAPI PM_unlockDataPages(void *p,uint len,PM_lockHandle *lh)
-{
-    return (_dx_ulock_pgsn(p,len) == 0);
-}
-
-int PMAPI PM_lockCodePages(void (*p)(),uint len,PM_lockHandle *lh)
-{
-    CONFIG_INF  config;
-    FARPTR      fp;
-
-    _dx_config_inf(&config, (UCHAR*)&config);
-    FP_SET(fp,p,config.c_cs_sel);
-    return (_dx_lock_pgs(fp,len) == 0);
-}
-
-int PMAPI PM_unlockCodePages(void (*p)(),uint len,PM_lockHandle *lh)
-{
-    CONFIG_INF  config;
-    FARPTR      fp;
-
-    _dx_config_inf(&config, (UCHAR*)&config);
-    FP_SET(fp,p,config.c_cs_sel);
-    return (_dx_ulock_pgs(fp,len) == 0);
-}
-
-#endif
-
-/*-------------------------------------------------------------------------*/
-/* Symantec C++ DOSX and FlashTek X-32/X-32VM support                      */
-/*-------------------------------------------------------------------------*/
-
-#if defined(DOSX) || defined(X32VM)
-
-#ifdef  X32VM
-#include <x32.h>
-#endif
-
-static long prevRealBreak;      /* Previous real mode break handler     */
-static long prevRealCtrlC;      /* Previous real mode CtrlC handler     */
-static long prevRealCritical;   /* Prev real mode critical handler      */
-
-static uint mouseSel = 0,mouseOff;
-
-/* The following real mode routine is used to call a 32 bit protected
- * mode FAR function from real mode. We use this for passing up control
- * from the real mode mouse callback to our protected mode code.
- */
-
-static char realHandler[] = {       /* Real mode code generic handler   */
-    0x00,0x00,0x00,0x00,            /* __PM_callProtp                   */
-    0x00,0x00,                      /* __PM_protCS                      */
-    0x00,0x00,0x00,0x00,            /* __PM_protHandler                 */
-    0x1E,                           /*  push    ds                      */
-    0x6A,0x00,                      /*  push    0                       */
-    0x6A,0x00,                      /*  push    0                       */
-    0x2E,0xFF,0x36,0x04,0x00,       /*  push    [cs:__PM_protCS]        */
-    0x66,0x2E,0xFF,0x36,0x06,0x00,  /*  push    [cs:__PM_protHandler]   */
-    0x2E,0xFF,0x1E,0x00,0x00,       /*  call    [cs:__PM_callProtp]     */
-    0x83,0xC4,0x0A,                 /*  add     sp,10                   */
-    0x1F,                           /*  pop     ds                      */
-    0xCB,                           /*  retf                            */
-    };
-
-/* The following functions installs the above realmode callback mechanism
- * in real mode memory for calling the protected mode routine.
- */
-
-int installCallback(void (PMAPI *pmCB)(),uint *psel, uint *poff,
-    uint *rseg, uint *roff)
-{
-    PMREGS          regs;
-    PMSREGS         sregs;
-
-    regs.x.ax = 0x250D;
-    PM_segread(&sregs);
-    PM_int386x(0x21,&regs,&regs,&sregs);    /* Get RM callback address  */
-
-    /* Fill in the values in the real mode code segment so that it will
-     * call the correct routine.
-     */
-    *((ulong*)&realHandler[0]) = regs.e.eax;
-    *((ushort*)&realHandler[4]) = sregs.cs;
-    *((ulong*)&realHandler[6]) = (ulong)pmCB;
-
-    /* Copy the real mode handler to real mode memory (only allocate the
-     * buffer once since we cant dealloate it with X32).
-     */
-    if (*psel == 0) {
-       if (!PM_allocRealSeg(sizeof(realHandler),psel,poff,rseg,roff))
-           return 0;
-       }
-    PM_memcpyfn(*psel,*poff,realHandler,sizeof(realHandler));
-
-    /* Skip past global variables in real mode code segment */
-    *roff += 0x0A;
-    return 1;
-}
-
-int PMAPI PM_setMouseHandler(int mask, PM_mouseHandler mh)
-{
-    RMREGS      regs;
-    RMSREGS     sregs;
-    uint    rseg,roff;
-
-    lockPMHandlers();           /* Ensure our handlers are locked   */
-
-    if (!installCallback(_PM_mouseISR, &mouseSel, &mouseOff, &rseg, &roff))
-       return 0;
-    _PM_mouseHandler = mh;
-
-    /* Install the real mode mouse handler  */
-    sregs.es = rseg;
-    regs.x.dx = roff;
-    regs.x.cx = _PM_mouseMask = mask;
-    regs.x.ax = 0xC;
-    PM_int86x(0x33, &regs, &regs, &sregs);
-    return 1;
-}
-
-void PMAPI PM_restoreMouseHandler(void)
-{
-    RMREGS  regs;
-
-    if (_PM_mouseHandler) {
-       regs.x.ax = 33;
-       PM_int86(0x33, &regs, &regs);
-       _PM_mouseHandler = NULL;
-       }
-}
-
-void PMAPI PM_getPMvect(int intno, PMFARPTR *isr)
-{
-    PMREGS  regs;
-    PMSREGS sregs;
-
-    PM_segread(&sregs);
-    regs.x.ax = 0x2502;         /* Get PM interrupt vector              */
-    regs.x.cx = intno;
-    PM_int386x(0x21, &regs, &regs, &sregs);
-    isr->sel = sregs.es;
-    isr->off = regs.e.ebx;
-}
-
-void PMAPI PM_setPMvect(int intno, PM_intHandler isr)
-{
-    PMFARPTR    pmisr;
-    PMSREGS     sregs;
-
-    PM_saveDS();
-    PM_segread(&sregs);
-    pmisr.sel = sregs.cs;
-    pmisr.off = (uint)isr;
-    PM_restorePMvect(intno, pmisr);
-}
-
-void PMAPI PM_restorePMvect(int intno, PMFARPTR isr)
-{
-    PMREGS  regs;
-    PMSREGS sregs;
-
-    PM_segread(&sregs);
-    regs.x.ax = 0x2505;         /* Set PM interrupt vector              */
-    regs.x.cx = intno;
-    sregs.ds = isr.sel;
-    regs.e.edx = isr.off;
-    PM_int386x(0x21, &regs, &regs, &sregs);
-}
-
-static void getISR(int intno, PMFARPTR *pmisr, long *realisr)
-{
-    PM_getPMvect(intno,pmisr);
-    _PM_getRMvect(intno,realisr);
-}
-
-static void restoreISR(int intno, PMFARPTR pmisr, long realisr)
-{
-    PMREGS  regs;
-    PMSREGS sregs;
-
-    PM_segread(&sregs);
-    regs.x.ax = 0x2507;         /* Set real and PM vectors              */
-    regs.x.cx = intno;
-    sregs.ds = pmisr.sel;
-    regs.e.edx = pmisr.off;
-    regs.e.ebx = realisr;
-    PM_int386x(0x21, &regs, &regs, &sregs);
-}
-
-static void setISR(int intno, void *isr)
-{
-    PMREGS  regs;
-    PMSREGS sregs;
-
-    lockPMHandlers();           /* Ensure our handlers are locked       */
-
-    PM_segread(&sregs);
-    regs.x.ax = 0x2506;         /* Hook real and protected vectors      */
-    regs.x.cx = intno;
-    sregs.ds = sregs.cs;
-    regs.e.edx = (uint)isr;
-    PM_int386x(0x21, &regs, &regs, &sregs);
-}
-
-void PMAPI PM_setTimerHandler(PM_intHandler th)
-{
-    getISR(0x8, &_PM_prevTimer, &_PM_prevRealTimer);
-    _PM_timerHandler = th;
-    setISR(0x8, _PM_timerISR);
-}
-
-void PMAPI PM_restoreTimerHandler(void)
-{
-    if (_PM_timerHandler) {
-       restoreISR(0x8, _PM_prevTimer, _PM_prevRealTimer);
-       _PM_timerHandler = NULL;
-       }
-}
-
-ibool PMAPI PM_setRealTimeClockHandler(PM_intHandler th,int frequency)
-{
-    /* Save the old CMOS real time clock values */
-    _PM_oldCMOSRegA = _PM_readCMOS(0x0A);
-    _PM_oldCMOSRegB = _PM_readCMOS(0x0B);
-
-    /* Set the real time clock interrupt handler */
-    getISR(0x70, &_PM_prevRTC, &_PM_prevRealRTC);
-    _PM_rtcHandler = th;
-    setISR(0x70, _PM_rtcISR);
-
-    /* Program the real time clock default frequency */
-    PM_setRealTimeClockFrequency(frequency);
-
-    /* Unmask IRQ8 in the PIC2 */
-    _PM_oldRTCPIC2 = PM_inpb(0xA1);
-    PM_outpb(0xA1,_PM_oldRTCPIC2 & 0xFE);
-    return true;
-}
-
-void PMAPI PM_restoreRealTimeClockHandler(void)
-{
-    if (_PM_rtcHandler) {
-       /* Restore CMOS registers and mask RTC clock */
-       _PM_writeCMOS(0x0A,_PM_oldCMOSRegA);
-       _PM_writeCMOS(0x0B,_PM_oldCMOSRegB);
-       PM_outpb(0xA1,(PM_inpb(0xA1) & 0xFE) | (_PM_oldRTCPIC2 & ~0xFE));
-
-       /* Restore the interrupt vector */
-       restoreISR(0x70, _PM_prevRTC, _PM_prevRealRTC);
-       _PM_rtcHandler = NULL;
-       }
-}
-
-void PMAPI PM_setKeyHandler(PM_intHandler kh)
-{
-    getISR(0x9, &_PM_prevKey, &_PM_prevRealKey);
-    _PM_keyHandler = kh;
-    setISR(0x9, _PM_keyISR);
-}
-
-void PMAPI PM_restoreKeyHandler(void)
-{
-    if (_PM_keyHandler) {
-       restoreISR(0x9, _PM_prevKey, _PM_prevRealKey);
-       _PM_keyHandler = NULL;
-       }
-}
-
-void PMAPI PM_setKey15Handler(PM_key15Handler kh)
-{
-    getISR(0x15, &_PM_prevKey15, &_PM_prevRealKey15);
-    _PM_key15Handler = kh;
-    setISR(0x15, _PM_key15ISR);
-}
-
-void PMAPI PM_restoreKey15Handler(void)
-{
-    if (_PM_key15Handler) {
-       restoreISR(0x15, _PM_prevKey15, _PM_prevRealKey15);
-       _PM_key15Handler = NULL;
-       }
-}
-
-void PMAPI PM_installAltBreakHandler(PM_breakHandler bh)
-{
-    static int  ctrlCFlag,ctrlBFlag;
-
-    _PM_ctrlCPtr = (uchar*)&ctrlCFlag;
-    _PM_ctrlBPtr = (uchar*)&ctrlBFlag;
-    getISR(0x1B, &_PM_prevBreak, &prevRealBreak);
-    getISR(0x23, &_PM_prevCtrlC, &prevRealCtrlC);
-    _PM_breakHandler = bh;
-    setISR(0x1B, _PM_breakISR);
-    setISR(0x23, _PM_ctrlCISR);
-}
-
-void PMAPI PM_installBreakHandler(void)
-{
-    PM_installAltBreakHandler(NULL);
-}
-
-void PMAPI PM_restoreBreakHandler(void)
-{
-    if (_PM_prevBreak.sel) {
-       restoreISR(0x1B, _PM_prevBreak, prevRealBreak);
-       restoreISR(0x23, _PM_prevCtrlC, prevRealCtrlC);
-       _PM_prevBreak.sel = 0;
-       _PM_breakHandler = NULL;
-       }
-}
-
-void PMAPI PM_installAltCriticalHandler(PM_criticalHandler ch)
-{
-    static short    critBuf[2];
-
-    _PM_critPtr = (uchar*)critBuf;
-    getISR(0x24, &_PM_prevCritical, &prevRealCritical);
-    _PM_critHandler = ch;
-    setISR(0x24, _PM_criticalISR);
-}
-
-void PMAPI PM_installCriticalHandler(void)
-{
-    PM_installAltCriticalHandler(NULL);
-}
-
-void PMAPI PM_restoreCriticalHandler(void)
-{
-    if (_PM_prevCritical.sel) {
-       restoreISR(0x24, _PM_prevCritical, prevRealCritical);
-       _PM_prevCritical.sel = 0;
-       _PM_critHandler = NULL;
-       }
-}
-
-int PMAPI PM_lockDataPages(void *p,uint len,PM_lockHandle *lh)
-{
-    return (_x386_memlock(p,len) == 0);
-}
-
-int PMAPI PM_unlockDataPages(void *p,uint len,PM_lockHandle *lh)
-{
-    return (_x386_memunlock(p,len) == 0);
-}
-
-int PMAPI PM_lockCodePages(void (*p)(),uint len,PM_lockHandle *lh)
-{
-    return (_x386_memlock(p,len) == 0);
-}
-
-int PMAPI PM_unlockCodePages(void (*p)(),uint len,PM_lockHandle *lh)
-{
-    return (_x386_memunlock(p,len) == 0);
-}
-
-#endif
-
-/*-------------------------------------------------------------------------*/
-/* Borland's DPMI32 DOS Power Pack Extender support.                       */
-/*-------------------------------------------------------------------------*/
-
-#ifdef  DPMI32
-#define GENERIC_DPMI32          /* Use generic 32 bit DPMI routines */
-
-void PMAPI PM_getPMvect(int intno, PMFARPTR *isr)
-{
-    PMREGS  regs;
-
-    regs.x.ax = 0x204;
-    regs.h.bl = intno;
-    PM_int386(0x31,&regs,&regs);
-    isr->sel = regs.x.cx;
-    isr->off = regs.e.edx;
-}
-
-void PMAPI PM_setPMvect(int intno, PM_intHandler isr)
-{
-    PMSREGS sregs;
-    PMREGS  regs;
-
-    PM_saveDS();
-    regs.x.ax = 0x205;          /* Set protected mode vector        */
-    regs.h.bl = intno;
-    PM_segread(&sregs);
-    regs.x.cx = sregs.cs;
-    regs.e.edx = (uint)isr;
-    PM_int386(0x31,&regs,&regs);
-}
-
-void PMAPI PM_restorePMvect(int intno, PMFARPTR isr)
-{
-    PMREGS  regs;
-
-    regs.x.ax = 0x205;
-    regs.h.bl = intno;
-    regs.x.cx = isr.sel;
-    regs.e.edx = isr.off;
-    PM_int386(0x31,&regs,&regs);
-}
-#endif
-
-/*-------------------------------------------------------------------------*/
-/* Watcom C/C++ with Rational DOS/4GW support.                             */
-/*-------------------------------------------------------------------------*/
-
-#ifdef  DOS4GW
-#define GENERIC_DPMI32          /* Use generic 32 bit DPMI routines */
-
-#define MOUSE_SUPPORTED         /* DOS4GW directly supports mouse   */
-
-/* We use the normal DOS services to save and restore interrupts handlers
- * for Watcom C++, because using the direct DPMI functions does not
- * appear to work properly. At least if we use the DPMI functions, we
- * dont get the auto-passup feature that we need to correctly trap
- * real and protected mode interrupts without installing Bi-model
- * interrupt handlers.
- */
-
-void PMAPI PM_getPMvect(int intno, PMFARPTR *isr)
-{
-    PMREGS  regs;
-    PMSREGS sregs;
-
-    PM_segread(&sregs);
-    regs.h.ah = 0x35;
-    regs.h.al = intno;
-    PM_int386x(0x21,&regs,&regs,&sregs);
-    isr->sel = sregs.es;
-    isr->off = regs.e.ebx;
-}
-
-void PMAPI PM_setPMvect(int intno, PM_intHandler isr)
-{
-    PMREGS  regs;
-    PMSREGS sregs;
-
-    PM_saveDS();
-    PM_segread(&sregs);
-    regs.h.ah = 0x25;
-    regs.h.al = intno;
-    sregs.ds = sregs.cs;
-    regs.e.edx = (uint)isr;
-    PM_int386x(0x21,&regs,&regs,&sregs);
-}
-
-void PMAPI PM_restorePMvect(int intno, PMFARPTR isr)
-{
-    PMREGS  regs;
-    PMSREGS sregs;
-
-    PM_segread(&sregs);
-    regs.h.ah = 0x25;
-    regs.h.al = intno;
-    sregs.ds = isr.sel;
-    regs.e.edx = isr.off;
-    PM_int386x(0x21,&regs,&regs,&sregs);
-}
-
-int PMAPI PM_setMouseHandler(int mask, PM_mouseHandler mh)
-{
-    lockPMHandlers();           /* Ensure our handlers are locked   */
-
-    _PM_mouseHandler = mh;
-    _PM_setMouseHandler(_PM_mouseMask = mask);
-    return 1;
-}
-
-void PMAPI PM_restoreMouseHandler(void)
-{
-    PMREGS  regs;
-
-    if (_PM_mouseHandler) {
-       regs.x.ax = 33;
-       PM_int386(0x33, &regs, &regs);
-       _PM_mouseHandler = NULL;
-       }
-}
-
-#endif
-
-/*-------------------------------------------------------------------------*/
-/* DJGPP port of GNU C++ support.                                          */
-/*-------------------------------------------------------------------------*/
-
-#ifdef DJGPP
-#define GENERIC_DPMI32          /* Use generic 32 bit DPMI routines */
-
-void PMAPI PM_getPMvect(int intno, PMFARPTR *isr)
-{
-    PMREGS  regs;
-
-    regs.x.ax = 0x204;
-    regs.h.bl = intno;
-    PM_int386(0x31,&regs,&regs);
-    isr->sel = regs.x.cx;
-    isr->off = regs.e.edx;
-}
-
-void PMAPI PM_setPMvect(int intno, PM_intHandler isr)
-{
-    PMSREGS sregs;
-    PMREGS  regs;
-
-    PM_saveDS();
-    regs.x.ax = 0x205;          /* Set protected mode vector        */
-    regs.h.bl = intno;
-    PM_segread(&sregs);
-    regs.x.cx = sregs.cs;
-    regs.e.edx = (uint)isr;
-    PM_int386(0x31,&regs,&regs);
-}
-
-void PMAPI PM_restorePMvect(int intno, PMFARPTR isr)
-{
-    PMREGS  regs;
-
-    regs.x.ax = 0x205;
-    regs.h.bl = intno;
-    regs.x.cx = isr.sel;
-    regs.e.edx = isr.off;
-    PM_int386(0x31,&regs,&regs);
-}
-
-#endif
-
-/*-------------------------------------------------------------------------*/
-/* Generic 32 bit DPMI routines                                            */
-/*-------------------------------------------------------------------------*/
-
-#if defined(GENERIC_DPMI32)
-
-static long prevRealBreak;      /* Previous real mode break handler     */
-static long prevRealCtrlC;      /* Previous real mode CtrlC handler     */
-static long prevRealCritical;   /* Prev real mode critical handler      */
-
-#ifndef MOUSE_SUPPORTED
-
-/* The following real mode routine is used to call a 32 bit protected
- * mode FAR function from real mode. We use this for passing up control
- * from the real mode mouse callback to our protected mode code.
- */
-
-static long mouseRMCB;          /* Mouse real mode callback address     */
-static uchar *mousePtr;
-static char mouseRegs[0x32];    /* Real mode regs for mouse callback    */
-static uchar mouseHandler[] = {
-    0x00,0x00,0x00,0x00,        /* _realRMCB                            */
-    0x2E,0xFF,0x1E,0x00,0x00,   /*  call    [cs:_realRMCB]              */
-    0xCB,                       /*  retf                                */
-    };
-
-int PMAPI PM_setMouseHandler(int mask, PM_mouseHandler mh)
-{
-    RMREGS      regs;
-    RMSREGS     sregs;
-    uint        rseg,roff;
-
-    lockPMHandlers();           /* Ensure our handlers are locked   */
-
-    /* Copy the real mode handler to real mode memory   */
-    if ((mousePtr = PM_allocRealSeg(sizeof(mouseHandler),&rseg,&roff)) == NULL)
-       return 0;
-    memcpy(mousePtr,mouseHandler,sizeof(mouseHandler));
-    if (!_DPMI_allocateCallback(_PM_mousePMCB, mouseRegs, &mouseRMCB))
-       PM_fatalError("Unable to allocate real mode callback!\n");
-    PM_setLong(mousePtr,mouseRMCB);
-
-    /* Install the real mode mouse handler  */
-    _PM_mouseHandler = mh;
-    sregs.es = rseg;
-    regs.x.dx = roff+4;
-    regs.x.cx = _PM_mouseMask = mask;
-    regs.x.ax = 0xC;
-    PM_int86x(0x33, &regs, &regs, &sregs);
-    return 1;
-}
-
-void PMAPI PM_restoreMouseHandler(void)
-{
-    RMREGS  regs;
-
-    if (_PM_mouseHandler) {
-       regs.x.ax = 33;
-       PM_int86(0x33, &regs, &regs);
-       PM_freeRealSeg(mousePtr);
-       _DPMI_freeCallback(mouseRMCB);
-       _PM_mouseHandler = NULL;
-       }
-}
-
-#endif
-
-static void getISR(int intno, PMFARPTR *pmisr, long *realisr)
-{
-    PM_getPMvect(intno,pmisr);
-    _PM_getRMvect(intno,realisr);
-}
-
-static void restoreISR(int intno, PMFARPTR pmisr, long realisr)
-{
-    _PM_setRMvect(intno,realisr);
-    PM_restorePMvect(intno,pmisr);
-}
-
-static void setISR(int intno, void (* PMAPI pmisr)())
-{
-    lockPMHandlers();           /* Ensure our handlers are locked   */
-    PM_setPMvect(intno,pmisr);
-}
-
-void PMAPI PM_setTimerHandler(PM_intHandler th)
-{
-    getISR(0x8, &_PM_prevTimer, &_PM_prevRealTimer);
-    _PM_timerHandler = th;
-    setISR(0x8, _PM_timerISR);
-}
-
-void PMAPI PM_restoreTimerHandler(void)
-{
-    if (_PM_timerHandler) {
-       restoreISR(0x8, _PM_prevTimer, _PM_prevRealTimer);
-       _PM_timerHandler = NULL;
-       }
-}
-
-ibool PMAPI PM_setRealTimeClockHandler(PM_intHandler th,int frequency)
-{
-    /* Save the old CMOS real time clock values */
-    _PM_oldCMOSRegA = _PM_readCMOS(0x0A);
-    _PM_oldCMOSRegB = _PM_readCMOS(0x0B);
-
-    /* Set the real time clock interrupt handler */
-    getISR(0x70, &_PM_prevRTC, &_PM_prevRealRTC);
-    _PM_rtcHandler = th;
-    setISR(0x70, _PM_rtcISR);
-
-    /* Program the real time clock default frequency */
-    PM_setRealTimeClockFrequency(frequency);
-
-    /* Unmask IRQ8 in the PIC2 */
-    _PM_oldRTCPIC2 = PM_inpb(0xA1);
-    PM_outpb(0xA1,_PM_oldRTCPIC2 & 0xFE);
-    return true;
-}
-
-void PMAPI PM_restoreRealTimeClockHandler(void)
-{
-    if (_PM_rtcHandler) {
-       /* Restore CMOS registers and mask RTC clock */
-       _PM_writeCMOS(0x0A,_PM_oldCMOSRegA);
-       _PM_writeCMOS(0x0B,_PM_oldCMOSRegB);
-       PM_outpb(0xA1,(PM_inpb(0xA1) & 0xFE) | (_PM_oldRTCPIC2 & ~0xFE));
-
-       /* Restore the interrupt vector */
-       restoreISR(0x70, _PM_prevRTC, _PM_prevRealRTC);
-       _PM_rtcHandler = NULL;
-       }
-}
-
-PM_IRQHandle PMAPI PM_setIRQHandler(
-    int IRQ,
-    PM_irqHandler ih)
-{
-    int             thunkSize,PICmask,chainPrevious;
-    ulong           offsetAdjust;
-    _PM_IRQHandle   *handle;
-
-    thunkSize = (ulong)_PM_irqISRTemplateEnd - (ulong)_PM_irqISRTemplate;
-    if ((handle = PM_malloc(sizeof(_PM_IRQHandle) + thunkSize)) == NULL)
-       return NULL;
-    handle->IRQ = IRQ;
-    handle->prevPIC = PM_inpb(0x21);
-    handle->prevPIC2 = PM_inpb(0xA1);
-    if (IRQ < 8) {
-       handle->IRQVect = (IRQ + 8);
-       PICmask = (1 << IRQ);
-       chainPrevious = ((handle->prevPIC & PICmask) == 0);
-       }
-    else {
-       handle->IRQVect = (0x60 + IRQ + 8);
-       PICmask = ((1 << IRQ) | 0x4);
-       chainPrevious = ((handle->prevPIC2 & (PICmask >> 8)) == 0);
-       }
-
-    /* Copy and setup the assembler thunk */
-    offsetAdjust = (ulong)handle->thunk - (ulong)_PM_irqISRTemplate;
-    memcpy(handle->thunk,_PM_irqISRTemplate,thunkSize);
-    *((ulong*)&handle->thunk[2]) = offsetAdjust;
-    *((ulong*)&handle->thunk[11+0]) = (ulong)ih;
-    if (chainPrevious) {
-       *((ulong*)&handle->thunk[11+4]) = handle->prevHandler.off;
-       *((ulong*)&handle->thunk[11+8]) = handle->prevHandler.sel;
-       }
-    else {
-       *((ulong*)&handle->thunk[11+4]) = 0;
-       *((ulong*)&handle->thunk[11+8]) = 0;
-       }
-    *((ulong*)&handle->thunk[11+12]) = IRQ;
-
-    /* Set the real time clock interrupt handler */
-    getISR(handle->IRQVect, &handle->prevHandler, &handle->prevRealhandler);
-    setISR(handle->IRQVect, (PM_intHandler)handle->thunk);
-
-    /* Unmask the IRQ in the PIC */
-    PM_outpb(0xA1,handle->prevPIC2 & ~(PICmask >> 8));
-    PM_outpb(0x21,handle->prevPIC & ~PICmask);
-    return handle;
-}
-
-void PMAPI PM_restoreIRQHandler(
-    PM_IRQHandle irqHandle)
-{
-    int             PICmask;
-    _PM_IRQHandle   *handle = irqHandle;
-
-    /* Restore PIC mask for the interrupt */
-    if (handle->IRQ < 8)
-       PICmask = (1 << handle->IRQ);
-    else
-       PICmask = ((1 << handle->IRQ) | 0x4);
-    PM_outpb(0xA1,(PM_inpb(0xA1) & ~(PICmask >> 8)) | (handle->prevPIC2 & (PICmask >> 8)));
-    PM_outpb(0x21,(PM_inpb(0x21) & ~PICmask) | (handle->prevPIC & PICmask));
-
-    /* Restore the interrupt vector */
-    restoreISR(handle->IRQVect, handle->prevHandler, handle->prevRealhandler);
-
-    /* Finally free the thunk */
-    PM_free(handle);
-}
-
-void PMAPI PM_setKeyHandler(PM_intHandler kh)
-{
-    getISR(0x9, &_PM_prevKey, &_PM_prevRealKey);
-    _PM_keyHandler = kh;
-    setISR(0x9, _PM_keyISR);
-}
-
-void PMAPI PM_restoreKeyHandler(void)
-{
-    if (_PM_keyHandler) {
-       restoreISR(0x9, _PM_prevKey, _PM_prevRealKey);
-       _PM_keyHandler = NULL;
-       }
-}
-
-void PMAPI PM_setKey15Handler(PM_key15Handler kh)
-{
-    getISR(0x15, &_PM_prevKey15, &_PM_prevRealKey15);
-    _PM_key15Handler = kh;
-    setISR(0x15, _PM_key15ISR);
-}
-
-void PMAPI PM_restoreKey15Handler(void)
-{
-    if (_PM_key15Handler) {
-       restoreISR(0x15, _PM_prevKey15, _PM_prevRealKey15);
-       _PM_key15Handler = NULL;
-       }
-}
-
-/* Real mode Ctrl-C and Ctrl-Break handler. This handler simply sets a
- * flag in the real mode code segment and exit. We save the location
- * of this flag in real mode memory so that both the real mode and
- * protected mode code will be modifying the same flags.
- */
-
-#ifndef DOS4GW
-static uchar ctrlHandler[] = {
-    0x00,0x00,0x00,0x00,            /*  ctrlBFlag                       */
-    0x66,0x2E,0xC7,0x06,0x00,0x00,
-    0x01,0x00,0x00,0x00,            /*  mov     [cs:ctrlBFlag],1        */
-    0xCF,                           /*  iretf                           */
-    };
-#endif
-
-void PMAPI PM_installAltBreakHandler(PM_breakHandler bh)
-{
-#ifndef DOS4GW
-    uint    rseg,roff;
-#else
-    static int  ctrlCFlag,ctrlBFlag;
-
-    _PM_ctrlCPtr = (uchar*)&ctrlCFlag;
-    _PM_ctrlBPtr = (uchar*)&ctrlBFlag;
-#endif
-
-    getISR(0x1B, &_PM_prevBreak, &prevRealBreak);
-    getISR(0x23, &_PM_prevCtrlC, &prevRealCtrlC);
-    _PM_breakHandler = bh;
-    setISR(0x1B, _PM_breakISR);
-    setISR(0x23, _PM_ctrlCISR);
-
-#ifndef DOS4GW
-    /* Hook the real mode vectors for these handlers, as these are not
-     * normally reflected by the DPMI server up to protected mode
-     */
-    _PM_ctrlBPtr = PM_allocRealSeg(sizeof(ctrlHandler)*2, &rseg, &roff);
-    memcpy(_PM_ctrlBPtr,ctrlHandler,sizeof(ctrlHandler));
-    memcpy(_PM_ctrlBPtr+sizeof(ctrlHandler),ctrlHandler,sizeof(ctrlHandler));
-    _PM_ctrlCPtr = _PM_ctrlBPtr + sizeof(ctrlHandler);
-    _PM_setRMvect(0x1B,((long)rseg << 16) | (roff+4));
-    _PM_setRMvect(0x23,((long)rseg << 16) | (roff+sizeof(ctrlHandler)+4));
-#endif
-}
-
-void PMAPI PM_installBreakHandler(void)
-{
-    PM_installAltBreakHandler(NULL);
-}
-
-void PMAPI PM_restoreBreakHandler(void)
-{
-    if (_PM_prevBreak.sel) {
-       restoreISR(0x1B, _PM_prevBreak, prevRealBreak);
-       restoreISR(0x23, _PM_prevCtrlC, prevRealCtrlC);
-       _PM_prevBreak.sel = 0;
-       _PM_breakHandler = NULL;
-#ifndef DOS4GW
-       PM_freeRealSeg(_PM_ctrlBPtr);
-#endif
-       }
-}
-
-/* Real mode Critical Error handler. This handler simply saves the AX and
- * DI values in the real mode code segment and exits. We save the location
- * of this flag in real mode memory so that both the real mode and
- * protected mode code will be modifying the same flags.
- */
-
-#ifndef DOS4GW
-static uchar criticalHandler[] = {
-    0x00,0x00,                      /*  axCode                          */
-    0x00,0x00,                      /*  diCode                          */
-    0x2E,0xA3,0x00,0x00,            /*  mov     [cs:axCode],ax          */
-    0x2E,0x89,0x3E,0x02,0x00,       /*  mov     [cs:diCode],di          */
-    0xB8,0x03,0x00,                 /*  mov     ax,3                    */
-    0xCF,                           /*  iretf                           */
-    };
-#endif
-
-void PMAPI PM_installAltCriticalHandler(PM_criticalHandler ch)
-{
-#ifndef DOS4GW
-    uint    rseg,roff;
-#else
-    static  short   critBuf[2];
-
-    _PM_critPtr = (uchar*)critBuf;
-#endif
-
-    getISR(0x24, &_PM_prevCritical, &prevRealCritical);
-    _PM_critHandler = ch;
-    setISR(0x24, _PM_criticalISR);
-
-#ifndef DOS4GW
-    /* Hook the real mode vector, as this is not normally reflected by the
-     * DPMI server up to protected mode.
-     */
-    _PM_critPtr = PM_allocRealSeg(sizeof(criticalHandler)*2, &rseg, &roff);
-    memcpy(_PM_critPtr,criticalHandler,sizeof(criticalHandler));
-    _PM_setRMvect(0x24,((long)rseg << 16) | (roff+4));
-#endif
-}
-
-void PMAPI PM_installCriticalHandler(void)
-{
-    PM_installAltCriticalHandler(NULL);
-}
-
-void PMAPI PM_restoreCriticalHandler(void)
-{
-    if (_PM_prevCritical.sel) {
-       restoreISR(0x24, _PM_prevCritical, prevRealCritical);
-       PM_freeRealSeg(_PM_critPtr);
-       _PM_prevCritical.sel = 0;
-       _PM_critHandler = NULL;
-       }
-}
-
-int PMAPI PM_lockDataPages(void *p,uint len,PM_lockHandle *lh)
-{
-    PMSREGS sregs;
-    PM_segread(&sregs);
-    return DPMI_lockLinearPages((uint)p + DPMI_getSelectorBase(sregs.ds),len);
-}
-
-int PMAPI PM_unlockDataPages(void *p,uint len,PM_lockHandle *lh)
-{
-    PMSREGS sregs;
-    PM_segread(&sregs);
-    return DPMI_unlockLinearPages((uint)p + DPMI_getSelectorBase(sregs.ds),len);
-}
-
-int PMAPI PM_lockCodePages(void (*p)(),uint len,PM_lockHandle *lh)
-{
-    PMSREGS sregs;
-    PM_segread(&sregs);
-    return DPMI_lockLinearPages((uint)p + DPMI_getSelectorBase(sregs.cs),len);
-}
-
-int PMAPI PM_unlockCodePages(void (*p)(),uint len,PM_lockHandle *lh)
-{
-    PMSREGS sregs;
-    PM_segread(&sregs);
-    return DPMI_unlockLinearPages((uint)p + DPMI_getSelectorBase(sregs.cs),len);
-}
-
-#endif
diff --git a/board/MAI/bios_emulator/scitech/src/pm/dos/vflat.c b/board/MAI/bios_emulator/scitech/src/pm/dos/vflat.c
deleted file mode 100644 (file)
index c3e9b6c..0000000
+++ /dev/null
@@ -1,251 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  32-bit DOS
-*
-* Description:  Main C module for the VFlat framebuffer routines. The page
-*               fault handler is always installed to handle up to a 4Mb
-*               framebuffer with a window size of 4Kb or 64Kb in size.
-*
-****************************************************************************/
-
-#include "pmapi.h"
-#include <stdlib.h>
-#include <dos.h>
-
-/*-------------------------------------------------------------------------*/
-/* DOS4G/W, PMODE/W and CauseWay support.                                  */
-/*-------------------------------------------------------------------------*/
-
-#if defined(DOS4GW)
-
-#define VFLAT_START_ADDR    0xF0000000U
-#define VFLAT_END_ADDR      0xF03FFFFFU
-#define VFLAT_LIMIT         (VFLAT_END_ADDR - VFLAT_START_ADDR)
-#define PAGE_PRESENT        1
-#define PAGE_NOTPRESENT     0
-#define PAGE_READ           0
-#define PAGE_WRITE          2
-
-PRIVATE ibool   installed = false;
-PRIVATE ibool   haveDPMI = false;
-PUBLIC  ibool   _ASMAPI VF_haveCauseWay = false;
-PUBLIC  uchar * _ASMAPI VF_zeroPtr = NULL;
-
-/* Low level assembler code */
-
-int     _ASMAPI InitPaging(void);
-void    _ASMAPI ClosePaging(void);
-void    _ASMAPI MapPhysical2Linear(ulong pAddr, ulong lAddr, int pages, int flags);
-void    _ASMAPI InstallFaultHandler(ulong baseAddr,int bankSize);
-void    _ASMAPI RemoveFaultHandler(void);
-void    _ASMAPI InstallBankFunc(int codeLen,void *bankFunc);
-
-void * _ASMAPI VF_malloc(uint size)
-{ return PM_malloc(size); }
-
-void _ASMAPI VF_free(void *p)
-{ PM_free(p); }
-
-PRIVATE ibool CheckDPMI(void)
-/****************************************************************************
-*
-* Function:     CheckDPMI
-* Returns:      True if we are running under DPMI
-*
-****************************************************************************/
-{
-    PMREGS  regs;
-
-    if (haveDPMI)
-       return true;
-
-    /* Check if we are running under DPMI in which case we will not be
-     * able to install our page fault handlers. We can however use the
-     * DVA.386 or VFLATD.386 virtual device drivers if they are present.
-     */
-    regs.x.ax = 0xFF00;
-    PM_int386(0x31,&regs,&regs);
-    if (!regs.x.cflag && (regs.e.edi & 8))
-       return (haveDPMI = true);
-    return false;
-}
-
-ibool PMAPI VF_available(void)
-/****************************************************************************
-*
-* Function:     VF_available
-* Returns:      True if virtual buffer is available, false if not.
-*
-****************************************************************************/
-{
-    if (!VF_zeroPtr)
-       VF_zeroPtr = PM_mapPhysicalAddr(0,0xFFFFFFFF,true);
-    if (CheckDPMI())
-       return false;
-
-    /* Standard DOS4GW, PMODE/W and Causeway */
-    if (InitPaging() == -1)
-       return false;
-    ClosePaging();
-    return true;
-}
-
-void * PMAPI InitDPMI(ulong baseAddr,int bankSize,int codeLen,void *bankFunc)
-/****************************************************************************
-*
-* Function:     InitDOS4GW
-* Parameters:   baseAddr    - Base address of framebuffer bank window
-*               bankSize    - Physical size of banks in Kb (4 or 64)
-*               codeLen     - Length of 32 bit bank switch function
-*               bankFunc    - Pointer to protected mode bank function
-* Returns:      Near pointer to virtual framebuffer, or NULL on failure.
-*
-* Description:  Installs the virtual linear framebuffer handling for
-*               DPMI environments. This requires the DVA.386 or VFLATD.386
-*               virtual device drivers to be installed and functioning.
-*
-****************************************************************************/
-{
-    (void)baseAddr;
-    (void)bankSize;
-    (void)codeLen;
-    (void)bankFunc;
-    return NULL;
-}
-
-void * PMAPI InitDOS4GW(ulong baseAddr,int bankSize,int codeLen,void *bankFunc)
-/****************************************************************************
-*
-* Function:     InitDOS4GW
-* Parameters:   baseAddr    - Base address of framebuffer bank window
-*               bankSize    - Physical size of banks in Kb (4 or 64)
-*               codeLen     - Length of 32 bit bank switch function
-*               bankFunc    - Pointer to protected mode bank function
-* Returns:      Near pointer to virtual framebuffer, or NULL on failure.
-*
-* Description:  Installs the virtual linear framebuffer handling for
-*               the DOS4GW extender.
-*
-****************************************************************************/
-{
-    int     i;
-
-    if (InitPaging() == -1)
-       return NULL;            /* Cannot do hardware paging!       */
-
-    /* Map 4MB of video memory into linear address space (read/write) */
-    if (bankSize == 64) {
-       for (i = 0; i < 64; i++) {
-           MapPhysical2Linear(baseAddr,VFLAT_START_ADDR+(i<<16),16,
-               PAGE_WRITE | PAGE_NOTPRESENT);
-           }
-       }
-    else {
-       for (i = 0; i < 1024; i++) {
-           MapPhysical2Linear(baseAddr,VFLAT_START_ADDR+(i<<12),1,
-               PAGE_WRITE | PAGE_NOTPRESENT);
-           }
-       }
-
-    /* Install our page fault handler and banks switch function */
-    InstallFaultHandler(baseAddr,bankSize);
-    InstallBankFunc(codeLen,bankFunc);
-    installed = true;
-    return (void*)VFLAT_START_ADDR;
-}
-
-void * PMAPI VF_init(ulong baseAddr,int bankSize,int codeLen,void *bankFunc)
-/****************************************************************************
-*
-* Function:     VF_init
-* Parameters:   baseAddr    - Base address of framebuffer bank window
-*               bankSize    - Physical size of banks in Kb (4 or 64)
-*               codeLen     - Length of 32 bit bank switch function
-*               bankFunc    - Pointer to protected mode bank function
-* Returns:      Near pointer to virtual framebuffer, or NULL on failure.
-*
-* Description:  Installs the virtual linear framebuffer handling.
-*
-****************************************************************************/
-{
-    if (installed)
-       return (void*)VFLAT_START_ADDR;
-    if (codeLen > 100)
-       return NULL;                /* Bank function is too large!      */
-    if (!VF_zeroPtr)
-       VF_zeroPtr = PM_mapPhysicalAddr(0,0xFFFFFFFF,true);
-    if (CheckDPMI())
-       return InitDPMI(baseAddr,bankSize,codeLen,bankFunc);
-    return InitDOS4GW(baseAddr,bankSize,codeLen,bankFunc);
-}
-
-void PMAPI VF_exit(void)
-/****************************************************************************
-*
-* Function:     VF_exit
-*
-* Description:  Closes down the virtual framebuffer services and
-*               restores the previous page fault handler.
-*
-****************************************************************************/
-{
-    if (installed) {
-       if (haveDPMI) {
-           /* DPMI support */
-           }
-       else {
-           /* Standard DOS4GW and PMODE/W support */
-           RemoveFaultHandler();
-           ClosePaging();
-           }
-       installed = false;
-       }
-}
-
-/*-------------------------------------------------------------------------*/
-/* Support mapped out for other compilers.                                 */
-/*-------------------------------------------------------------------------*/
-
-#else
-
-ibool PMAPI VF_available(void)
-{
-    return false;
-}
-
-void * PMAPI VF_init(ulong baseAddr,int bankSize,int codeLen,void *bankFunc)
-{
-    (void)baseAddr;
-    (void)bankSize;
-    (void)codeLen;
-    (void)bankFunc;
-    return NULL;
-}
-
-void PMAPI VF_exit(void)
-{
-}
-
-#endif
diff --git a/board/MAI/bios_emulator/scitech/src/pm/dos/ztimer.c b/board/MAI/bios_emulator/scitech/src/pm/dos/ztimer.c
deleted file mode 100644 (file)
index 53ab16c..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-/****************************************************************************
-*
-*                         Ultra Long Period Timer
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  MSDOS
-*
-* Description:  OS specific implementation for the Zen Timer functions.
-*
-****************************************************************************/
-
-
-/*---------------------------- Global variables ---------------------------*/
-
-uchar * _VARAPI _ZTimerBIOSPtr;
-
-/*----------------------------- Implementation ----------------------------*/
-
-/* External assembler functions */
-
-void    _ASMAPI LZ_timerOn(void);
-ulong   _ASMAPI LZ_timerLap(void);
-void    _ASMAPI LZ_timerOff(void);
-ulong   _ASMAPI LZ_timerCount(void);
-void    _ASMAPI LZ_disable(void);
-void    _ASMAPI LZ_enable(void);
-
-/****************************************************************************
-REMARKS:
-Initialise the Zen Timer module internals.
-****************************************************************************/
-void __ZTimerInit(void)
-{
-    _ZTimerBIOSPtr = PM_getBIOSPointer();
-}
-
-/****************************************************************************
-REMARKS:
-Call the assembler Zen Timer functions to do the timing.
-****************************************************************************/
-#define __LZTimerOn(tm)     LZ_timerOn()
-
-/****************************************************************************
-REMARKS:
-Call the assembler Zen Timer functions to do the timing.
-****************************************************************************/
-#define __LZTimerLap(tm)        LZ_timerLap()
-
-/****************************************************************************
-REMARKS:
-Call the assembler Zen Timer functions to do the timing.
-****************************************************************************/
-#define __LZTimerOff(tm)        LZ_timerOff()
-
-/****************************************************************************
-REMARKS:
-Call the assembler Zen Timer functions to do the timing.
-****************************************************************************/
-#define __LZTimerCount(tm)  LZ_timerCount()
-
-/****************************************************************************
-REMARKS:
-Define the resolution of the long period timer as microseconds per timer tick.
-****************************************************************************/
-#define ULZTIMER_RESOLUTION     54925
-
-/****************************************************************************
-REMARKS:
-Read the Long Period timer value from the BIOS timer tick.
-****************************************************************************/
-static ulong __ULZReadTime(void)
-{
-    ulong   ticks;
-    LZ_disable();            /* Turn of interrupts               */
-    ticks = PM_getLong(_ZTimerBIOSPtr+0x6C);
-    LZ_enable();             /* Turn on interrupts again         */
-    return ticks;
-}
-
-/****************************************************************************
-REMARKS:
-Compute the elapsed time from the BIOS timer tick. Note that we check to see
-whether a midnight boundary has passed, and if so adjust the finish time to
-account for this. We cannot detect if more that one midnight boundary has
-passed, so if this happens we will be generating erronous results.
-****************************************************************************/
-ulong __ULZElapsedTime(ulong start,ulong finish)
-{
-    if (finish < start)
-       finish += 1573040L;         /* Number of ticks in 24 hours      */
-    return finish - start;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/event.c b/board/MAI/bios_emulator/scitech/src/pm/event.c
deleted file mode 100644 (file)
index b6f4586..0000000
+++ /dev/null
@@ -1,1115 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Any
-*
-* Description:  Main implementation for the SciTech cross platform event
-*               library. This module contains all the generic cross platform
-*               code, and pulls in modules specific to each target OS
-*               environment.
-*
-****************************************************************************/
-
-#include "event.h"
-#include "pmapi.h"
-#include <time.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "oshdr.h"
-
-/*--------------------------- Global variables ----------------------------*/
-
-#define EVENTQSIZE      100     /* Number of events in event queue      */
-#define JOY_NUM_AXES    4       /* Number of joystick axes supported    */
-
-static struct {
-    int         mx,my;              /* Current mouse position           */
-    int         head;               /* Head of event queue              */
-    int         tail;               /* Tail of event queue              */
-    int         freeHead;           /* Head of free list                */
-    int         count;              /* No. of items currently in queue  */
-    event_t     evtq[EVENTQSIZE];   /* The queue structure itself       */
-    int         oldMove;            /* Previous movement event          */
-    int         oldKey;             /* Previous key repeat event        */
-    int         oldJoyMove;         /* Previous joystick movement event */
-    int         joyMask;            /* Mask of joystick axes present    */
-    int         joyMin[JOY_NUM_AXES];
-    int         joyCenter[JOY_NUM_AXES];
-    int         joyMax[JOY_NUM_AXES];
-    int         joyPrev[JOY_NUM_AXES];
-    int         joyButState;
-    ulong       doubleClick;
-    ulong       autoRepeat;
-    ulong       autoDelay;
-    ulong       autoTicks;
-    ulong       doubleClickThresh;
-    ulong       firstAuto;
-    int         autoMouse_x;
-    int         autoMouse_y;
-    event_t     downMouse;
-    ulong       keyModifiers;       /* Current keyboard modifiers       */
-    uchar       keyTable[128];      /* Table of key up/down flags       */
-    ibool       allowLEDS;          /* True if LEDS should change       */
-    _EVT_userEventFilter    userEventCallback;
-    _EVT_mouseMoveHandler   mouseMove;
-    _EVT_heartBeatCallback  heartBeat;
-    void                    *heartBeatParams;
-    codepage_t              *codePage;
-    } EVT;
-
-/*---------------------------- Implementation -----------------------------*/
-
-#if defined(__REALDOS__) || defined(__SMX32__)
-/* {secret} */
-void EVTAPI _EVT_cCodeStart(void) {}
-#endif
-
-/* External assembler functions */
-
-int EVTAPI _EVT_readJoyAxis(int mask,int *axis);
-int EVTAPI _EVT_readJoyButtons(void);
-
-/* Forward declaration */
-
-ulong _EVT_getTicks(void);
-
-/****************************************************************************
-PARAMETERS:
-evt - Event to add to the event queue
-
-REMARKS:
-Adds an event to the event queue by tacking it onto the tail of the event
-queue. This routine assumes that at least one spot is available on the
-freeList for the event to be inserted.
-
-NOTE:   Interrupts MUST be OFF while this routine is called to ensure we have
-       mutually exclusive access to our internal data structures for
-       interrupt driven systems (like under DOS).
-****************************************************************************/
-static void addEvent(
-    event_t *evt)
-{
-    int evtID;
-
-    /* Check for mouse double click events */
-    if (evt->what & EVT_MOUSEEVT) {
-       EVT.autoMouse_x = evt->where_x;
-       EVT.autoMouse_y = evt->where_y;
-       if ((evt->what & EVT_MOUSEDOWN) && !(evt->message & EVT_DBLCLICK)) {
-           /* Determine if the last mouse event was a double click event */
-           uint diff_x = ABS(evt->where_x - EVT.downMouse.where_x);
-           uint diff_y = ABS(evt->where_y - EVT.downMouse.where_y);
-           if ((evt->message == EVT.downMouse.message)
-               && ((evt->when - EVT.downMouse.when) <= EVT.doubleClick)
-               && (diff_x <= EVT.doubleClickThresh)
-               && (diff_y <= EVT.doubleClickThresh)) {
-               evt->message |= EVT_DBLCLICK;
-               EVT.downMouse = *evt;
-               EVT.downMouse.when = 0;
-               }
-           else
-               EVT.downMouse = *evt;
-           EVT.autoTicks = _EVT_getTicks();
-           }
-       else if (evt->what & EVT_MOUSEUP) {
-           EVT.downMouse.what = EVT_NULLEVT;
-           EVT.firstAuto = true;
-           }
-       }
-
-    /* Call user supplied callback to modify the event if desired */
-    if (EVT.userEventCallback) {
-       if (!EVT.userEventCallback(evt))
-           return;
-       }
-
-    /* Get spot to place the event from the free list */
-    evtID = EVT.freeHead;
-    EVT.freeHead = EVT.evtq[EVT.freeHead].next;
-
-    /* Add to the EVT.tail of the event queue   */
-    evt->next = -1;
-    evt->prev = EVT.tail;
-    if (EVT.tail != -1)
-       EVT.evtq[EVT.tail].next = evtID;
-    else
-       EVT.head = evtID;
-    EVT.tail = evtID;
-    EVT.evtq[evtID] = *evt;
-    EVT.count++;
-}
-
-/****************************************************************************
-REMARKS:
-Internal function to initialise the event queue to the empty state.
-****************************************************************************/
-static void initEventQueue(void)
-{
-    int i;
-
-    /* Build free list, and initialize global data structures */
-    for (i = 0; i < EVENTQSIZE; i++)
-       EVT.evtq[i].next = i+1;
-    EVT.evtq[EVENTQSIZE-1].next = -1;       /* Terminate list           */
-    EVT.count = EVT.freeHead = 0;
-    EVT.head = EVT.tail = -1;
-    EVT.oldMove = -1;
-    EVT.oldKey = -1;
-    EVT.oldJoyMove = -1;
-    EVT.joyButState = 0;
-    EVT.mx = EVT.my = 0;
-    EVT.keyModifiers = 0;
-    EVT.allowLEDS = true;
-
-    /* Set default values for mouse double click and mouse auto events */
-    EVT.doubleClick = 440;
-    EVT.autoRepeat = 55;
-    EVT.autoDelay = 330;
-    EVT.autoTicks = 0;
-    EVT.doubleClickThresh = 5;
-    EVT.firstAuto = true;
-    EVT.autoMouse_x = EVT.autoMouse_y = 0;
-    memset(&EVT.downMouse,0,sizeof(EVT.downMouse));
-
-    /* Setup default pointers for event library */
-    EVT.userEventCallback = NULL;
-    EVT.codePage = &_CP_US_English;
-
-    /* Initialise the joystick module and do basic calibration (which assumes
-     * the joystick is centered.
-     */
-    EVT.joyMask = EVT_joyIsPresent();
-}
-
-#if defined(NEED_SCALE_JOY_AXIS) || !defined(USE_OS_JOYSTICK)
-/****************************************************************************
-REMARKS:
-This function scales a joystick axis value to normalised form.
-****************************************************************************/
-static int scaleJoyAxis(
-    int raw,
-    int axis)
-{
-    int scaled,range;
-
-    /* Make sure the joystick is calibrated properly */
-    if (EVT.joyCenter[axis] - EVT.joyMin[axis] < 5)
-       return raw;
-    if (EVT.joyMax[axis] - EVT.joyCenter[axis] < 5)
-       return raw;
-
-    /* Now scale the coordinates to -128 to 127 */
-    raw -= EVT.joyCenter[axis];
-    if (raw < 0)
-       range = EVT.joyCenter[axis]-EVT.joyMin[axis];
-    else
-       range = EVT.joyMax[axis]-EVT.joyCenter[axis];
-    scaled = (raw * 128) / range;
-    if (scaled < -128)
-       scaled = -128;
-    if (scaled > 127)
-       scaled = 127;
-    return scaled;
-}
-#endif
-
-#if     defined(__SMX32__)
-#include "smx/event.c"
-#elif   defined(__RTTARGET__)
-#include "rttarget/event.c"
-#elif   defined(__REALDOS__)
-#include "dos/event.c"
-#elif   defined(__WINDOWS32__)
-#include "win32/event.c"
-#elif   defined(__OS2__)
-#if     defined(__OS2_PM__)
-#include "os2pm/event.c"
-#else
-#include "os2/event.c"
-#endif
-#elif   defined(__LINUX__)
-#if     defined(__USE_X11__)
-#include "x11/event.c"
-#else
-#include "linux/event.c"
-#endif
-#elif   defined(__QNX__)
-#if     defined(__USE_PHOTON__)
-#include "photon/event.c"
-#elif   defined(__USE_X11__)
-#include "x11/event.c"
-#else
-#include "qnx/event.c"
-#endif
-#elif   defined(__BEOS__)
-#include "beos/event.c"
-#else
-#error  Event library not ported to this platform yet!
-#endif
-
-/*------------------------ Public interface routines ----------------------*/
-
-/* If USE_OS_JOYSTICK is defined, the OS specific libraries will implement
- * the joystick code rather than using the generic OS portable version.
- */
-
-#ifndef USE_OS_JOYSTICK
-/****************************************************************************
-DESCRIPTION:
-Returns the mask indicating what joystick axes are attached.
-
-HEADER:
-event.h
-
-REMARKS:
-This function is used to detect the attached joysticks, and determine
-what axes are present and functioning. This function will re-detect any
-attached joysticks when it is called, so if the user forgot to attach
-the joystick when the application started, you can call this function to
-re-detect any newly attached joysticks.
-
-SEE ALSO:
-EVT_joySetLowerRight, EVT_joySetCenter, EVT_joyIsPresent
-****************************************************************************/
-int EVTAPI EVT_joyIsPresent(void)
-{
-    int mask,i;
-
-    memset(EVT.joyMin,0,sizeof(EVT.joyMin));
-    memset(EVT.joyCenter,0,sizeof(EVT.joyCenter));
-    memset(EVT.joyMax,0,sizeof(EVT.joyMax));
-    memset(EVT.joyPrev,0,sizeof(EVT.joyPrev));
-    EVT.joyButState = 0;
-#ifdef __LINUX__
-    PM_init();
-#endif
-    mask = _EVT_readJoyAxis(EVT_JOY_AXIS_ALL,EVT.joyCenter);
-    if (mask) {
-       for (i = 0; i < JOY_NUM_AXES; i++)
-           EVT.joyMax[i] = EVT.joyCenter[i]*2;
-       }
-    return mask;
-}
-
-/****************************************************************************
-DESCRIPTION:
-Polls the joystick for position and button information.
-
-HEADER:
-event.h
-
-REMARKS:
-This routine is used to poll analogue joysticks for button and position
-information. It should be called once for each main loop of the user
-application, just before processing all pending events via EVT_getNext.
-All information polled from the joystick will be posted to the event
-queue for later retrieval.
-
-Note:   Most analogue joysticks will provide readings that change even
-       though the joystick has not moved. Hence if you call this routine
-       you will likely get an EVT_JOYMOVE event every time through your
-       event loop.
-
-SEE ALSO:
-EVT_getNext, EVT_peekNext, EVT_joySetUpperLeft, EVT_joySetLowerRight,
-EVT_joySetCenter, EVT_joyIsPresent
-****************************************************************************/
-void EVTAPI EVT_pollJoystick(void)
-{
-    event_t evt;
-    int     i,axis[JOY_NUM_AXES],newButState,mask,moved,ps;
-
-    if (EVT.joyMask) {
-       /* Read joystick axes and post movement events if they have
-        * changed since the last time we polled. Until the events are
-        * actually flushed, we keep modifying the same joystick movement
-        * event, so you won't get multiple movement event
-        */
-       mask = _EVT_readJoyAxis(EVT.joyMask,axis);
-       newButState = _EVT_readJoyButtons();
-       moved = false;
-       for (i = 0; i < JOY_NUM_AXES; i++) {
-           if (mask & (EVT_JOY_AXIS_X1 << i))
-               axis[i] = scaleJoyAxis(axis[i],i);
-           else
-               axis[i] = EVT.joyPrev[i];
-           if (axis[i] != EVT.joyPrev[i])
-               moved = true;
-           }
-       if (moved) {
-           memcpy(EVT.joyPrev,axis,sizeof(EVT.joyPrev));
-           ps = _EVT_disableInt();
-           if (EVT.oldJoyMove != -1) {
-               /* Modify the existing joystick movement event */
-               EVT.evtq[EVT.oldJoyMove].message = newButState;
-               EVT.evtq[EVT.oldJoyMove].where_x = EVT.joyPrev[0];
-               EVT.evtq[EVT.oldJoyMove].where_y = EVT.joyPrev[1];
-               EVT.evtq[EVT.oldJoyMove].relative_x = EVT.joyPrev[2];
-               EVT.evtq[EVT.oldJoyMove].relative_y = EVT.joyPrev[3];
-               }
-           else if (EVT.count < EVENTQSIZE) {
-               /* Add a new joystick movement event */
-               EVT.oldJoyMove = EVT.freeHead;
-               memset(&evt,0,sizeof(evt));
-               evt.what = EVT_JOYMOVE;
-               evt.message = EVT.joyButState;
-               evt.where_x = EVT.joyPrev[0];
-               evt.where_y = EVT.joyPrev[1];
-               evt.relative_x = EVT.joyPrev[2];
-               evt.relative_y = EVT.joyPrev[3];
-               addEvent(&evt);
-               }
-           _EVT_restoreInt(ps);
-           }
-
-       /* Read the joystick buttons, and post events to reflect the change
-        * in state for the joystick buttons.
-        */
-       if (newButState != EVT.joyButState) {
-           if (EVT.count < EVENTQSIZE) {
-               /* Add a new joystick click event */
-               ps = _EVT_disableInt();
-               memset(&evt,0,sizeof(evt));
-               evt.what = EVT_JOYCLICK;
-               evt.message = newButState;
-               EVT.evtq[EVT.oldJoyMove].where_x = EVT.joyPrev[0];
-               EVT.evtq[EVT.oldJoyMove].where_y = EVT.joyPrev[1];
-               EVT.evtq[EVT.oldJoyMove].relative_x = EVT.joyPrev[2];
-               EVT.evtq[EVT.oldJoyMove].relative_y = EVT.joyPrev[3];
-               addEvent(&evt);
-               _EVT_restoreInt(ps);
-               }
-           EVT.joyButState = newButState;
-           }
-       }
-}
-
-/****************************************************************************
-DESCRIPTION:
-Calibrates the joystick upper left position
-
-HEADER:
-event.h
-
-REMARKS:
-This function can be used to zero in on better joystick calibration factors,
-which may work better than the default simplistic calibration (which assumes
-the joystick is centered when the event library is initialised).
-To use this function, ask the user to hold the stick in the upper left
-position and then have them press a key or button. and then call this
-function. This function will then read the joystick and update the
-calibration factors.
-
-Usually, assuming that the stick was centered when the event library was
-initialized, you really only need to call EVT_joySetLowerRight since the
-upper left position is usually always 0,0 on most joysticks. However, the
-safest procedure is to call all three calibration functions.
-
-SEE ALSO:
-EVT_joySetUpperLeft, EVT_joySetLowerRight, EVT_joyIsPresent
-****************************************************************************/
-void EVTAPI EVT_joySetUpperLeft(void)
-{
-    _EVT_readJoyAxis(EVT_JOY_AXIS_ALL,EVT.joyMin);
-}
-
-/****************************************************************************
-DESCRIPTION:
-Calibrates the joystick lower right position
-
-HEADER:
-event.h
-
-REMARKS:
-This function can be used to zero in on better joystick calibration factors,
-which may work better than the default simplistic calibration (which assumes
-the joystick is centered when the event library is initialised).
-To use this function, ask the user to hold the stick in the lower right
-position and then have them press a key or button. and then call this
-function. This function will then read the joystick and update the
-calibration factors.
-
-Usually, assuming that the stick was centered when the event library was
-initialized, you really only need to call EVT_joySetLowerRight since the
-upper left position is usually always 0,0 on most joysticks. However, the
-safest procedure is to call all three calibration functions.
-
-SEE ALSO:
-EVT_joySetUpperLeft, EVT_joySetCenter, EVT_joyIsPresent
-****************************************************************************/
-void EVTAPI EVT_joySetLowerRight(void)
-{
-    _EVT_readJoyAxis(EVT_JOY_AXIS_ALL,EVT.joyMax);
-}
-
-/****************************************************************************
-DESCRIPTION:
-Calibrates the joystick center position
-
-HEADER:
-event.h
-
-REMARKS:
-This function can be used to zero in on better joystick calibration factors,
-which may work better than the default simplistic calibration (which assumes
-the joystick is centered when the event library is initialised).
-To use this function, ask the user to hold the stick in the center
-position and then have them press a key or button. and then call this
-function. This function will then read the joystick and update the
-calibration factors.
-
-Usually, assuming that the stick was centered when the event library was
-initialized, you really only need to call EVT_joySetLowerRight since the
-upper left position is usually always 0,0 on most joysticks. However, the
-safest procedure is to call all three calibration functions.
-
-SEE ALSO:
-EVT_joySetUpperLeft, EVT_joySetLowerRight, EVT_joySetCenter
-****************************************************************************/
-void EVTAPI EVT_joySetCenter(void)
-{
-    _EVT_readJoyAxis(EVT_JOY_AXIS_ALL,EVT.joyCenter);
-}
-#endif
-
-/****************************************************************************
-DESCRIPTION:
-Posts a user defined event to the event queue
-
-HEADER:
-event.h
-
-RETURNS:
-True if event was posted, false if event queue is full.
-
-PARAMETERS:
-what        - Type code for message to post
-message     - Event specific message to post
-modifiers   - Event specific modifier flags to post
-
-REMARKS:
-This routine is used to post user defined events to the event queue.
-
-SEE ALSO:
-EVT_flush, EVT_getNext, EVT_peekNext, EVT_halt
-****************************************************************************/
-ibool EVTAPI EVT_post(
-    ulong which,
-    ulong what,
-    ulong message,
-    ulong modifiers)
-{
-    event_t evt;
-    uint    ps;
-
-    if (EVT.count < EVENTQSIZE) {
-       /* Save information in event record */
-       ps = _EVT_disableInt();
-       evt.which = which;
-       evt.when = _EVT_getTicks();
-       evt.what = what;
-       evt.message = message;
-       evt.modifiers = modifiers;
-       addEvent(&evt);             /* Add to EVT.tail of event queue   */
-       _EVT_restoreInt(ps);
-       return true;
-       }
-    else
-       return false;
-}
-
-/****************************************************************************
-DESCRIPTION:
-Flushes all events of a specified type from the event queue.
-
-PARAMETERS:
-mask    - Mask specifying the types of events that should be removed
-
-HEADER:
-event.h
-
-REMARKS:
-Flushes (removes) all pending events of the specified type from the event
-queue. You may combine the masks for different event types with a simple
-logical OR.
-
-SEE ALSO:
-EVT_getNext, EVT_halt, EVT_peekNext
-****************************************************************************/
-void EVTAPI EVT_flush(
-    ulong mask)
-{
-    event_t evt;
-
-    do {                            /* Flush all events */
-       EVT_getNext(&evt,mask);
-       } while (evt.what != EVT_NULLEVT);
-}
-
-/****************************************************************************
-DESCRIPTION:
-Halts until and event of the specified type is recieved.
-
-HEADER:
-event.h
-
-PARAMETERS:
-evt     - Pointer to
-mask    - Mask specifying the types of events that should be removed
-
-REMARKS:
-This functions halts exceution until an event of the specified type is
-recieved into the event queue. It does not flush the event queue of events
-before performing the busy loop. However this function does throw away
-any events other than the ones you have requested via the event mask, to
-avoid the event queue filling up with unwanted events (like EVT_KEYUP or
-EVT_MOUSEMOVE events).
-
-SEE ALSO:
-EVT_getNext, EVT_flush, EVT_peekNext
-****************************************************************************/
-void EVTAPI EVT_halt(
-    event_t *evt,
-    ulong mask)
-{
-    do {                            /* Wait for an event    */
-       if (mask & (EVT_JOYEVT))
-           EVT_pollJoystick();
-       EVT_getNext(evt,EVT_EVERYEVT);
-       } while (!(evt->what & mask));
-}
-
-/****************************************************************************
-DESCRIPTION:
-Peeks at the next pending event in the event queue.
-
-HEADER:
-event.h
-
-RETURNS:
-True if an event is pending, false if not.
-
-PARAMETERS:
-evt     - Pointer to structure to return the event info in
-mask    - Mask specifying the types of events that should be removed
-
-REMARKS:
-Peeks at the next pending event of the specified type in the event queue. The
-mask parameter is used to specify the type of events to be peeked at, and
-can be any logical combination of any of the flags defined by the
-EVT_eventType enumeration.
-
-In contrast to EVT_getNext, the event is not removed from the event queue.
-You may combine the masks for different event types with a simple logical OR.
-
-SEE ALSO:
-EVT_flush, EVT_getNext, EVT_halt
-****************************************************************************/
-ibool EVTAPI EVT_peekNext(
-    event_t *evt,
-    ulong mask)
-{
-    int     evtID;
-    uint    ps;
-
-    if (EVT.heartBeat)
-       EVT.heartBeat(EVT.heartBeatParams);
-    _EVT_pumpMessages();                /* Pump all messages into queue */
-    EVT.mouseMove(EVT.mx,EVT.my);       /* Move the mouse cursor        */
-    evt->what = EVT_NULLEVT;            /* Default to null event        */
-    if (EVT.count) {
-       /* It is possible that an event be posted while we are trying
-        * to access the event queue. This would create problems since
-        * we may end up with invalid data for our event queue pointers. To
-        * alleviate this, all interrupts are suspended while we manipulate
-        * our pointers.
-        */
-       ps = _EVT_disableInt();             /* disable interrupts       */
-       for (evtID = EVT.head; evtID != -1; evtID = EVT.evtq[evtID].next) {
-           if (EVT.evtq[evtID].what & mask)
-               break;                      /* Found an event           */
-           }
-       if (evtID == -1) {
-           _EVT_restoreInt(ps);
-           return false;                   /* Event was not found      */
-           }
-       *evt = EVT.evtq[evtID];                 /* Return the event         */
-       _EVT_restoreInt(ps);
-       if (evt->what & EVT_KEYEVT)
-           _EVT_maskKeyCode(evt);
-       }
-    return evt->what != EVT_NULLEVT;
-}
-
-/****************************************************************************
-DESCRIPTION:
-Retrieves the next pending event from the event queue.
-
-PARAMETERS:
-evt     - Pointer to structure to return the event info in
-mask    - Mask specifying the types of events that should be removed
-
-HEADER:
-event.h
-
-RETURNS:
-True if an event was pending, false if not.
-
-REMARKS:
-Retrieves the next pending event from the event queue, and stores it in a
-event_t structure. The mask parameter is used to specify the type of events
-to be removed, and can be any logical combination of any of the flags defined
-by the EVT_eventType enumeration.
-
-The what field of the event contains the event code of the event that was
-extracted. All application specific events should begin with the EVT_USEREVT
-code and build from there. Since the event code is stored in an integer,
-there is a maximum of 32 different event codes that can be distinguished.
-You can store extra information about the event in the message field to
-distinguish between events of the same class (for instance the button used in
-a EVT_MOUSEDOWN event).
-
-If an event of the specified type was not in the event queue, the what field
-of the event will be set to NULLEVT, and the return value will return false.
-
-Note:   You should /always/ use the EVT_EVERYEVT mask for extracting events
-       from your main event loop handler. Using a mask for only a specific
-       type of event for long periods of time will cause the event queue to
-       fill up with events of the type you are ignoring, eventually causing
-       the application to hang when the event queue becomes full.
-
-SEE ALSO:
-EVT_flush, EVT_halt, EVT_peekNext
-****************************************************************************/
-ibool EVTAPI EVT_getNext(
-    event_t *evt,
-    ulong mask)
-{
-    int     evtID,next,prev;
-    uint    ps;
-
-    if (EVT.heartBeat)
-       EVT.heartBeat(EVT.heartBeatParams);
-    _EVT_pumpMessages();                /* Pump all messages into queue */
-    EVT.mouseMove(EVT.mx,EVT.my);       /* Move the mouse cursor        */
-    evt->what = EVT_NULLEVT;            /* Default to null event        */
-    if (EVT.count) {
-       /* It is possible that an event be posted while we are trying
-        * to access the event queue. This would create problems since
-        * we may end up with invalid data for our event queue pointers. To
-        * alleviate this, all interrupts are suspended while we manipulate
-        * our pointers.
-        */
-       ps = _EVT_disableInt();             /* disable interrupts       */
-       for (evtID = EVT.head; evtID != -1; evtID = EVT.evtq[evtID].next) {
-           if (EVT.evtq[evtID].what & mask)
-               break;                      /* Found an event           */
-           }
-       if (evtID == -1) {
-           _EVT_restoreInt(ps);
-           return false;                   /* Event was not found      */
-           }
-       next = EVT.evtq[evtID].next;
-       prev = EVT.evtq[evtID].prev;
-       if (prev != -1)
-           EVT.evtq[prev].next = next;
-       else
-           EVT.head = next;
-       if (next != -1)
-           EVT.evtq[next].prev = prev;
-       else
-           EVT.tail = prev;
-       *evt = EVT.evtq[evtID];                 /* Return the event         */
-       EVT.evtq[evtID].next = EVT.freeHead;        /* and return to free list  */
-       EVT.freeHead = evtID;
-       EVT.count--;
-       if (evt->what == EVT_MOUSEMOVE)
-           EVT.oldMove = -1;
-       if (evt->what == EVT_KEYREPEAT)
-           EVT.oldKey = -1;
-       if (evt->what == EVT_JOYMOVE)
-           EVT.oldJoyMove = -1;
-       _EVT_restoreInt(ps);                /* enable interrupts        */
-       if (evt->what & EVT_KEYEVT)
-           _EVT_maskKeyCode(evt);
-       }
-
-    /* If there is no event pending, check if we should generate an auto
-     * mouse down event if the mouse is still currently down.
-     */
-    if (evt->what == EVT_NULLEVT && EVT.autoRepeat && (mask & EVT_MOUSEAUTO) && (EVT.downMouse.what & EVT_MOUSEDOWN)) {
-       ulong ticks = _EVT_getTicks();
-       if ((ticks - EVT.autoTicks) >= (EVT.autoRepeat + (EVT.firstAuto ? EVT.autoDelay : 0))) {
-           evt->what = EVT_MOUSEAUTO;
-           evt->message = EVT.downMouse.message;
-           evt->modifiers = EVT.downMouse.modifiers;
-           evt->where_x = EVT.autoMouse_x;
-           evt->where_y = EVT.autoMouse_y;
-           evt->relative_x = 0;
-           evt->relative_y = 0;
-           EVT.autoTicks = evt->when = ticks;
-           EVT.firstAuto = false;
-           }
-       }
-    return evt->what != EVT_NULLEVT;
-}
-
-/****************************************************************************
-DESCRIPTION:
-Installs a user supplied event filter callback for event handling.
-
-HEADER:
-event.h
-
-PARAMETERS:
-userEventFilter - Address of user supplied event filter callback
-
-REMARKS:
-This function allows the application programmer to install an event filter
-callback for event handling. Once you install your callback, the MGL
-event handling routines will call your callback with a pointer to the
-new event that will be placed into the event queue. Your callback can the
-modify the contents of the event before it is placed into the queue (for
-instance adding custom information or perhaps high precision timing
-information).
-
-If your callback returns FALSE, the event will be ignore and will not be
-posted to the event queue. You should always return true from your event
-callback unless you plan to use the events immediately that they are
-recieved.
-
-Note:   Your event callback may be called in response to a hardware
-       interrupt and will be executing in the context of the hardware
-       interrupt handler under MSDOS (ie: keyboard interrupt or mouse
-       interrupt). For this reason the code pages for the callback that
-       you register must be locked in memory with the PM_lockCodePages
-       function. You must also lock down any data pages that your function
-       needs to reference as well.
-
-Note:   You can also use this filter callback to process events at the
-       time they are activated by the user (ie: when the user hits the
-       key or moves the mouse), but make sure your code runs as fast as
-       possible as it will be executing inside the context of an interrupt
-       handler on some systems.
-
-SEE ALSO:
-EVT_getNext, EVT_peekNext
-****************************************************************************/
-void EVTAPI EVT_setUserEventFilter(
-    _EVT_userEventFilter filter)
-{
-    EVT.userEventCallback = filter;
-}
-
-/****************************************************************************
-DESCRIPTION:
-Installs a user supplied event heartbeat callback function.
-
-HEADER:
-event.h
-
-PARAMETERS:
-callback    - Address of user supplied event heartbeat callback
-params      - Parameters to pass to the event heartbeat function
-
-REMARKS:
-This function allows the application programmer to install an event heatbeat
-function that gets called every time that EVT_getNext or EVT_peekNext
-is called. This is primarily useful for simulating text mode cursors inside
-event handling code when running in graphics modes as opposed to hardware
-text modes.
-
-SEE ALSO:
-EVT_getNext, EVT_peekNext, EVT_getHeartBeatCallback
-****************************************************************************/
-void EVTAPI EVT_setHeartBeatCallback(
-    _EVT_heartBeatCallback callback,
-    void *params)
-{
-    EVT.heartBeat = callback;
-    EVT.heartBeatParams = params;
-}
-
-
-/****************************************************************************
-DESCRIPTION:
-Returns the current user supplied event heartbeat callback function.
-
-HEADER:
-event.h
-
-PARAMETERS:
-callback    - Place to store the address of user supplied event heartbeat callback
-params      - Place to store the parameters to pass to the event heartbeat function
-
-REMARKS:
-This function retrieves the current event heatbeat function that gets called
-every time that EVT_getNext or EVT_peekNext is called.
-
-SEE ALSO:
-EVT_getNext, EVT_peekNext, EVT_setHeartBeatCallback
-****************************************************************************/
-void EVTAPI EVT_getHeartBeatCallback(
-    _EVT_heartBeatCallback *callback,
-    void **params)
-{
-    *callback = EVT.heartBeat;
-    *params = EVT.heartBeatParams;
-}
-
-/****************************************************************************
-DESCRIPTION:
-Determines if a specified key is currently down.
-
-PARAMETERS:
-scanCode    - Scan code to test
-
-RETURNS:
-True of the specified key is currently held down.
-
-HEADER:
-event.h
-
-REMARKS:
-This function determines if a specified key is currently down at the
-time that the call is made. You simply need to pass in the scan code of
-the key that you wish to test, and the MGL will tell you if it is currently
-down or not. The MGL does this by keeping track of the up and down state
-of all the keys.
-****************************************************************************/
-ibool EVTAPI EVT_isKeyDown(
-    uchar scanCode)
-{
-    return _EVT_isKeyDown(scanCode);
-}
-
-/****************************************************************************
-DESCRIPTION:
-Set the mouse position for the event module
-
-PARAMETERS:
-x   - X coordinate to move the mouse cursor position to
-y   - Y coordinate to move the mouse cursor position to
-
-HEADER:
-event.h
-
-REMARKS:
-This function moves the mouse cursor position for the event module to the
-specified location.
-
-SEE ALSO:
-EVT_getMousePos
-****************************************************************************/
-void EVTAPI EVT_setMousePos(
-    int x,
-    int y)
-{
-    EVT.mx = x;
-    EVT.my = y;
-    _EVT_setMousePos(&EVT.mx,&EVT.my);
-    EVT.mouseMove(EVT.mx,EVT.my);
-}
-
-/****************************************************************************
-DESCRIPTION:
-Returns the current mouse cursor location.
-
-HEADER:
-event.h
-
-PARAMETERS:
-x   - Place to store value for mouse x coordinate (screen coordinates)
-y   - Place to store value for mouse y coordinate (screen coordinates)
-
-REMARKS:
-Obtains the current mouse cursor position in screen coordinates. Normally the
-mouse cursor location is tracked using the mouse movement events that are
-posted to the event queue when the mouse moves, however this routine
-provides an alternative method of polling the mouse cursor location.
-
-SEE ALSO:
-EVT_setMousePos
-****************************************************************************/
-void EVTAPI EVT_getMousePos(
-    int *x,
-    int *y)
-{
-    *x = EVT.mx;
-    *y = EVT.my;
-}
-
-/****************************************************************************
-DESCRIPTION:
-Returns the currently active code page for translation of keyboard characters.
-
-HEADER:
-event.h
-
-RETURNS:
-Pointer to the currently active code page translation table.
-
-REMARKS:
-This function is returns a pointer to the currently active code page
-translation table. See EVT_setCodePage for more information.
-
-SEE ALSO:
-EVT_setCodePage
-****************************************************************************/
-codepage_t * EVTAPI EVT_getCodePage(void)
-{
-    return EVT.codePage;
-}
-
-/****************************************************************************
-DESCRIPTION:
-Sets the currently active code page for translation of keyboard characters.
-
-HEADER:
-event.h
-
-PARAMETERS:
-page    - New code page to make active
-
-REMARKS:
-This function is used to set a new code page translation table that is used
-to translate virtual scan code values to ASCII characters for different
-keyboard configurations. The default is usually US English, although if
-possible the PM library will auto-detect the correct code page translation
-for the target OS if OS services are available to determine what type of
-keyboard is currently attached.
-
-SEE ALSO:
-EVT_getCodePage
-****************************************************************************/
-void EVTAPI EVT_setCodePage(
-    codepage_t *page)
-{
-    EVT.codePage = page;
-}
-
-/* The following contains fake C prototypes and documentation for the
- * macro functions in the event.h header file. These exist soley so
- * that DocJet will correctly pull in the documentation for these functions.
- */
-#ifdef  INCLUDE_DOC_FUNCTIONS
-
-/****************************************************************************
-DESCRIPTION:
-Macro to extract the ASCII code from a message.
-
-PARAMETERS:
-message - Message to extract ASCII code from
-
-RETURNS:
-ASCII code extracted from the message.
-
-HEADER:
-event.h
-
-REMARKS:
-Macro to extract the ASCII code from the message field of the event_t
-structure. You pass the message field to the macro as the parameter and
-the ASCII code is the result, for example:
-
-    event_t EVT.myEvent;
-    uchar   code;
-    code = EVT_asciiCode(EVT.myEvent.message);
-
-SEE ALSO:
-EVT_scanCode, EVT_repeatCount
-****************************************************************************/
-uchar EVT_asciiCode(
-    ulong message);
-
-/****************************************************************************
-DESCRIPTION:
-Macro to extract the keyboard scan code from a message.
-
-HEADER:
-event.h
-
-PARAMETERS:
-message - Message to extract scan code from
-
-RETURNS:
-Keyboard scan code extracted from the message.
-
-REMARKS:
-Macro to extract the keyboard scan code from the message field of the event
-structure. You pass the message field to the macro as the parameter and
-the scan code is the result, for example:
-
-    event_t EVT.myEvent;
-    uchar   code;
-    code = EVT_scanCode(EVT.myEvent.message);
-
-NOTE:   Scan codes in the event library are not really hardware scan codes,
-       but rather virtual scan codes as generated by a low level keyboard
-       interface driver. All virtual scan code values are defined by the
-       EVT_scanCodesType enumeration, and will be identical across all
-       supports OS'es and platforms.
-
-SEE ALSO:
-EVT_asciiCode, EVT_repeatCount
-****************************************************************************/
-uchar EVT_scanCode(
-    ulong message);
-
-/****************************************************************************
-DESCRIPTION:
-Macro to extract the repeat count from a message.
-
-HEADER:
-event.h
-
-PARAMETERS:
-message - Message to extract repeat count from
-
-RETURNS:
-Repeat count extracted from the message.
-
-REMARKS:
-Macro to extract the repeat count from the message field of the event
-structure. The repeat count is the number of times that the key repeated
-before there was another keyboard event to be place in the queue, and
-allows the event handling code to avoid keyboard buffer overflow
-conditions when a single key is held down by the user. If you are processing
-a key repeat code, you will probably want to check this field to see how
-many key repeats you should process for this message.
-
-SEE ALSO:
-EVT_asciiCode, EVT_repeatCount
-****************************************************************************/
-short EVT_repeatCount(
-    ulong message);
-
-#endif  /* DOC FUNCTIONS */
-
-#if defined(__REALDOS__) || defined(__SMX32__)
-/* {secret} */
-void EVTAPI _EVT_cCodeEnd(void) {}
-#endif
diff --git a/board/MAI/bios_emulator/scitech/src/pm/linux/cpuinfo.c b/board/MAI/bios_emulator/scitech/src/pm/linux/cpuinfo.c
deleted file mode 100644 (file)
index e88d210..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/****************************************************************************
-*
-*                         Ultra Long Period Timer
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Linux
-*
-* Description:  Linux specific code for the CPU detection module.
-*
-****************************************************************************/
-
-#include <ztimer.h>
-
-/*----------------------------- Implementation ----------------------------*/
-
-/****************************************************************************
-REMARKS:
-TODO: We should implement this for Linux!
-****************************************************************************/
-#define SetMaxThreadPriority()  0
-
-/****************************************************************************
-REMARKS:
-TODO: We should implement this for Linux!
-****************************************************************************/
-#define RestoreThreadPriority(i)
-
-/****************************************************************************
-REMARKS:
-Initialise the counter and return the frequency of the counter.
-****************************************************************************/
-static void GetCounterFrequency(
-    CPU_largeInteger *freq)
-{
-    freq->low = 1000000;
-    freq->high = 0;
-}
-
-/****************************************************************************
-REMARKS:
-Read the counter and return the counter value.
-****************************************************************************/
-#define GetCounter(t)                           \
-{                                               \
-    struct timeval tv;                          \
-    gettimeofday(&tv,NULL);                     \
-    (t)->low = tv.tv_sec*1000000 + tv.tv_usec;  \
-    (t)->high = 0;                              \
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/linux/event.c b/board/MAI/bios_emulator/scitech/src/pm/linux/event.c
deleted file mode 100644 (file)
index ce38732..0000000
+++ /dev/null
@@ -1,1360 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech Multi-platform Graphics Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Linux
-*
-* Description:  Linux fullscreen console implementation for the SciTech
-*               cross platform event library.
-*               Portions ripped straigth from the gpm source code for mouse
-*               handling.
-*
-****************************************************************************/
-
-/*---------------------------- Global Variables ---------------------------*/
-
-extern int              _PM_console_fd;
-static ushort           keyUpMsg[256] = {0};
-static int              _EVT_mouse_fd = 0;
-static int              range_x, range_y;
-static int              opt_baud = 1200, opt_sample = 100;
-#ifdef USE_OS_JOYSTICK
-static short            *axis0 = NULL, *axis1 = NULL;
-static uchar            *buts0 = NULL, *buts1 = NULL;
-static int              joystick0_fd = 0, joystick1_fd = 0;
-static int              js_version = 0;
-#endif
-
-/* This defines the supported mouse drivers */
-
-typedef enum {
-    EVT_noMouse = -1,
-    EVT_microsoft = 0,
-    EVT_ps2,
-    EVT_mousesystems,
-    EVT_gpm,
-    EVT_MMseries,
-    EVT_logitech,
-    EVT_busmouse,
-    EVT_mouseman,
-    EVT_intellimouse,
-    EVT_intellimouse_ps2,
-    } mouse_drivers_t;
-
-static mouse_drivers_t mouse_driver = EVT_noMouse;
-static char mouse_dev[20] = "/dev/mouse";
-
-typedef struct {
-    char    *name;
-    int     flags;
-    void    (*init)(void);
-    uchar   proto[4];
-    int     packet_len;
-    int     read;
-    } mouse_info;
-
-#define STD_FLG (CREAD | CLOCAL | HUPCL)
-
-static void _EVT_mouse_init(void);
-static void _EVT_logitech_init(void);
-static void _EVT_pnpmouse_init(void);
-
-mouse_info mouse_infos[] = {
-    {"Microsoft",       CS7 | B1200 | STD_FLG,              _EVT_mouse_init,    {0x40, 0x40, 0x40, 0x00}, 3, 1},
-    {"PS2",             STD_FLG,                            NULL,               {0xc0, 0x00, 0x00, 0x00}, 3, 1},
-    {"MouseSystems",    CS8 | CSTOPB | STD_FLG,             _EVT_mouse_init,    {0xf8, 0x80, 0x00, 0x00}, 5, 5},
-    {"GPM",             CS8 | CSTOPB | STD_FLG,             NULL,               {0xf8, 0x80, 0x00, 0x00}, 5, 5},
-    {"MMSeries",        CS8 | PARENB | PARODD | STD_FLG,    _EVT_mouse_init,    {0xe0, 0x80, 0x80, 0x00}, 3, 1},
-    {"Logitech",        CS8 | CSTOPB | STD_FLG,             _EVT_logitech_init, {0xe0, 0x80, 0x80, 0x00}, 3, 3},
-    {"BusMouse",        STD_FLG,                            NULL,               {0xf8, 0x80, 0x00, 0x00}, 3, 3},
-    {"MouseMan",        CS7 | STD_FLG,                      _EVT_mouse_init,    {0x40, 0x40, 0x40, 0x00}, 3, 1},
-    {"IntelliMouse",    CS7 | STD_FLG,                      _EVT_pnpmouse_init, {0xc0, 0x40, 0xc0, 0x00}, 4, 1},
-    {"IMPS2",           CS7 | STD_FLG,                      NULL,               {0xc0, 0x40, 0xc0, 0x00}, 4, 1}, /* ? */
-    };
-
-#define NB_MICE (sizeof(mouse_infos)/sizeof(mouse_info))
-
-/* The name of the environment variables that are used to change the defaults above */
-
-#define ENV_MOUSEDRV "MGL_MOUSEDRV"
-#define ENV_MOUSEDEV "MGL_MOUSEDEV"
-#define ENV_MOUSESPD "MGL_MOUSESPD"
-#define ENV_JOYDEV0  "MGL_JOYDEV1"
-#define ENV_JOYDEV1  "MGL_JOYDEV2"
-
-/* Scancode mappings on Linux for special keys */
-
-typedef struct {
-    int scan;
-    int map;
-    } keymap;
-
-/* TODO: Fix this and set it up so we can do a binary search! */
-
-keymap keymaps[] = {
-    {96, KB_padEnter},
-    {74, KB_padMinus},
-    {78, KB_padPlus},
-    {55, KB_padTimes},
-    {98, KB_padDivide},
-    {71, KB_padHome},
-    {72, KB_padUp},
-    {73, KB_padPageUp},
-    {75, KB_padLeft},
-    {76, KB_padCenter},
-    {77, KB_padRight},
-    {79, KB_padEnd},
-    {80, KB_padDown},
-    {81, KB_padPageDown},
-    {82, KB_padInsert},
-    {83, KB_padDelete},
-    {105,KB_left},
-    {108,KB_down},
-    {106,KB_right},
-    {103,KB_up},
-    {110,KB_insert},
-    {102,KB_home},
-    {104,KB_pageUp},
-    {111,KB_delete},
-    {107,KB_end},
-    {109,KB_pageDown},
-    {125,KB_leftWindows},
-    {126,KB_rightWindows},
-    {127,KB_menu},
-    {100,KB_rightAlt},
-    {97,KB_rightCtrl},
-    };
-
-/* And the keypad with num lock turned on (changes the ASCII code only) */
-
-keymap keypad[] = {
-    {71, ASCII_7},
-    {72, ASCII_8},
-    {73, ASCII_9},
-    {75, ASCII_4},
-    {76, ASCII_5},
-    {77, ASCII_6},
-    {79, ASCII_1},
-    {80, ASCII_2},
-    {81, ASCII_3},
-    {82, ASCII_0},
-    {83, ASCII_period},
-    };
-
-#define NB_KEYMAPS (sizeof(keymaps)/sizeof(keymaps[0]))
-#define NB_KEYPAD (sizeof(keypad)/sizeof(keypad[0]))
-
-typedef struct {
-    int     sample;
-    char    code[2];
-    } sample_rate;
-
-sample_rate sampletab[]={
-    {  0,"O"},
-    { 15,"J"},
-    { 27,"K"},
-    { 42,"L"},
-    { 60,"R"},
-    { 85,"M"},
-    {125,"Q"},
-    {1E9,"N"},
-    };
-
-/* Number of keycodes to read at a time from the console */
-
-#define KBDREADBUFFERSIZE 32
-
-/*---------------------------- Implementation -----------------------------*/
-
-/* These are not used under Linux */
-#define _EVT_disableInt()       1
-#define _EVT_restoreInt(flaps)
-
-/****************************************************************************
-PARAMETERS:
-scanCode    - Scan code to test
-
-REMARKS:
-This macro determines if a specified key is currently down at the
-time that the call is made.
-****************************************************************************/
-#define _EVT_isKeyDown(scanCode)    (keyUpMsg[scanCode] != 0)
-
-/****************************************************************************
-REMARKS:
-This function is used to return the number of ticks since system
-startup in milliseconds. This should be the same value that is placed into
-the time stamp fields of events, and is used to implement auto mouse down
-events.
-****************************************************************************/
-ulong _EVT_getTicks(void)
-{
-    static uint     starttime = 0;
-    struct timeval  t;
-
-    gettimeofday(&t, NULL);
-    if (starttime == 0)
-      starttime = t.tv_sec * 1000 + (t.tv_usec/1000);
-    return ((t.tv_sec * 1000 + (t.tv_usec/1000)) - starttime);
-}
-
-/****************************************************************************
-REMARKS:
-Small Unix function that checks for availability on a file using select()
-****************************************************************************/
-static ibool dataReady(
-    int fd)
-{
-    static struct timeval   t = { 0L, 0L };
-    fd_set                  fds;
-
-    FD_ZERO(&fds);
-    FD_SET(fd, &fds);
-    return select(fd+1, &fds, NULL, NULL, &t) > 0;
-}
-
-/****************************************************************************
-REMARKS:
-Reads mouse data according to the selected mouse driver.
-****************************************************************************/
-static ibool readMouseData(
-    int *buttons,
-    int *dx,
-    int *dy)
-{
-    static uchar    data[32],prev = 0;
-    int             cnt = 0,ret;
-    mouse_info      *drv;
-
-    /* Read the first byte to check for the protocol */
-    drv = &mouse_infos[mouse_driver];
-    if (read(_EVT_mouse_fd, data, drv->read) != drv->read) {
-       perror("read");
-       return false;
-       }
-    if ((data[0] & drv->proto[0]) != drv->proto[1])
-       return false;
-
-    /* Load a whole protocol packet */
-    cnt += drv->read;
-    while (cnt < drv->packet_len) {
-       ret = read(_EVT_mouse_fd, data+cnt, drv->read);
-       if (ret == drv->read)
-           cnt += ret;
-       else {
-           perror("read");
-           return false;
-           }
-       }
-    if ((data[1] & drv->proto[2]) != drv->proto[3])
-       return false;
-
-    /* Now decode the protocol packet */
-    switch (mouse_driver) {
-       case EVT_microsoft:
-           if (data[0] == 0x40 && !(prev|data[1]|data[2]))
-               *buttons = 2;   /* Third button on MS compatible mouse */
-           else
-               *buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4);
-           prev = *buttons;
-           *dx = (char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F));
-           *dy = (char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F));
-           break;
-       case EVT_ps2:
-           *buttons = !!(data[0]&1) * 4 + !!(data[0]&2) * 1 + !!(data[0]&4) * 2;
-           if (data[1] != 0)
-               *dx = (data[0] & 0x10) ? data[1]-256 : data[1];
-           else
-               *dx = 0;
-           if (data[2] != 0)
-               *dy = -((data[0] & 0x20) ? data[2]-256 : data[2]);
-           else
-               *dy = 0;
-           break;
-       case EVT_mousesystems: case EVT_gpm:
-           *buttons = (~data[0]) & 0x07;
-           *dx = (char)(data[1]) + (char)(data[3]);
-           *dy = -((char)(data[2]) + (char)(data[4]));
-           break;
-       case EVT_logitech:
-           *buttons= data[0] & 0x07;
-           *dx = (data[0] & 0x10) ?   data[1] : - data[1];
-           *dy = (data[0] & 0x08) ? - data[2] :   data[2];
-           break;
-       case EVT_busmouse:
-           *buttons= (~data[0]) & 0x07;
-           *dx = (char)data[1];
-           *dy = -(char)data[2];
-           break;
-       case EVT_MMseries:
-           *buttons = data[0] & 0x07;
-           *dx = (data[0] & 0x10) ?   data[1] : - data[1];
-           *dy = (data[0] & 0x08) ? - data[2] :   data[2];
-           break;
-       case EVT_intellimouse:
-           *buttons = ((data[0] & 0x20) >> 3)  /* left */
-                    | ((data[3] & 0x10) >> 3)  /* middle */
-                    | ((data[0] & 0x10) >> 4); /* right */
-           *dx = (char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F));
-           *dy = (char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F));
-           break;
-       case EVT_intellimouse_ps2:
-           *buttons = (data[0] & 0x04) >> 1 /* Middle */
-               | (data[0] & 0x02) >> 1 /* Right */
-               | (data[0] & 0x01) << 2; /* Left */
-           *dx = (data[0] & 0x10) ?    data[1]-256  :  data[1];
-           *dy = (data[0] & 0x20) ?  -(data[2]-256) : -data[2];
-           break;
-       case EVT_mouseman: {
-           static int      getextra;
-           static uchar    prev=0;
-           uchar           b;
-
-           /* The damned MouseMan has 3/4 bytes packets. The extra byte
-            * is only there if the middle button is active.
-            * I get the extra byte as a packet with magic numbers in it.
-            * and then switch to 4-byte mode.
-            */
-           if (data[1] == 0xAA && data[2] == 0x55) {
-               /* Got unexpected fourth byte */
-               if ((b = (*data>>4)) > 0x3)
-                   return false;  /* just a sanity check */
-               *dx = *dy = 0;
-               drv->packet_len=4;
-               getextra=0;
-               }
-           else {
-               /* Got 3/4, as expected */
-               /* Motion is independent of packetlen... */
-               *dx = (char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F));
-               *dy = (char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F));
-               prev = ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4);
-               if (drv->packet_len==4)
-                   b = data[3]>>4;
-               }
-           if (drv->packet_len == 4) {
-               if (b == 0) {
-                   drv->packet_len = 3;
-                   getextra = 1;
-                   }
-               else {
-                   if (b & 0x2)
-                       prev |= 2;
-                   }
-               }
-           *buttons = prev;
-
-           /* This "chord-middle" behaviour was reported by David A. van Leeuwen */
-           if (((prev ^ *buttons) & 5) == 5)
-               *buttons = *buttons ? 2 : 0;
-           prev = *buttons;
-           break;
-           }
-       case EVT_noMouse:
-           return false;
-           break;
-       }
-    return true;
-}
-
-/****************************************************************************
-REMARKS:
-Map a keypress via the key mapping table
-****************************************************************************/
-static int getKeyMapping(
-    keymap *tab,
-    int nb,
-    int key)
-{
-    int i;
-
-    for(i = 0; i < nb; i++) {
-       if (tab[i].scan == key)
-           return tab[i].map;
-       }
-    return key;
-}
-
-#ifdef USE_OS_JOYSTICK
-
-static char js0_axes = 0, js0_buttons = 0;
-static char js1_axes = 0, js1_buttons = 0;
-static char joystick0_dev[20] = "/dev/js0";
-static char joystick1_dev[20] = "/dev/js1";
-
-/****************************************************************************
-REMARKS:
-Create a joystick event from the joystick data
-****************************************************************************/
-static void makeJoyEvent(
-    event_t *evt)
-{
-    evt->message = 0;
-    if (buts0 && axis0) {
-       if (buts0[0]) evt->message |= EVT_JOY1_BUTTONA;
-       if (buts0[1]) evt->message |= EVT_JOY1_BUTTONB;
-       evt->where_x = axis0[0];
-       evt->where_y = axis0[1];
-       }
-    else
-       evt->where_x = evt->where_y = 0;
-    if (buts1 && axis1) {
-       if (buts1[0]) evt->message |= EVT_JOY2_BUTTONA;
-       if (buts1[1]) evt->message |= EVT_JOY2_BUTTONB;
-       evt->where_x = axis1[0];
-       evt->where_y = axis1[1];
-       }
-    else
-       evt->where_x = evt->where_y = 0;
-}
-
-/****************************************************************************
-REMARKS:
-Read the joystick axis data
-****************************************************************************/
-int EVTAPI _EVT_readJoyAxis(
-    int jmask,
-    int *axis)
-{
-    int mask = 0;
-
-    if ((js_version & ~0xffff) == 0) {
-       /* Old 0.x driver */
-       struct JS_DATA_TYPE js;
-       if (joystick0_fd && read(joystick0_fd, &js, JS_RETURN) == JS_RETURN) {
-           if (jmask & EVT_JOY_AXIS_X1)
-               axis[0] = js.x;
-           if (jmask & EVT_JOY_AXIS_Y1)
-               axis[1] = js.y;
-           mask |= EVT_JOY_AXIS_X1|EVT_JOY_AXIS_Y1;
-           }
-       if (joystick1_fd && read(joystick1_fd, &js, JS_RETURN) == JS_RETURN) {
-           if (jmask & EVT_JOY_AXIS_X2)
-               axis[2] = js.x;
-           if (jmask & EVT_JOY_AXIS_Y2)
-               axis[3] = js.y;
-           mask |= EVT_JOY_AXIS_X2|EVT_JOY_AXIS_Y2;
-           }
-       }
-    else {
-       if (axis0) {
-           if (jmask & EVT_JOY_AXIS_X1)
-               axis[0] = axis0[0];
-           if (jmask & EVT_JOY_AXIS_Y1)
-               axis[1] = axis0[1];
-           mask |= EVT_JOY_AXIS_X1 | EVT_JOY_AXIS_Y1;
-           }
-       if (axis1) {
-           if (jmask & EVT_JOY_AXIS_X2)
-               axis[2] = axis1[0];
-           if (jmask & EVT_JOY_AXIS_Y2)
-               axis[3] = axis1[1];
-           mask |= EVT_JOY_AXIS_X2 | EVT_JOY_AXIS_Y2;
-           }
-       }
-    return mask;
-}
-
-/****************************************************************************
-REMARKS:
-Read the joystick button data
-****************************************************************************/
-int EVTAPI _EVT_readJoyButtons(void)
-{
-    int buts = 0;
-
-    if ((js_version & ~0xffff) == 0) {
-       /* Old 0.x driver */
-       struct JS_DATA_TYPE js;
-       if (joystick0_fd && read(joystick0_fd, &js, JS_RETURN) == JS_RETURN)
-           buts = js.buttons;
-       if (joystick1_fd && read(joystick1_fd, &js, JS_RETURN) == JS_RETURN)
-           buts |= js.buttons << 2;
-       }
-    else {
-       if (buts0)
-           buts |= EVT_JOY1_BUTTONA*buts0[0] + EVT_JOY1_BUTTONB*buts0[1];
-       if (buts1)
-           buts |= EVT_JOY2_BUTTONA*buts1[0] + EVT_JOY2_BUTTONB*buts1[1];
-       }
-    return buts;
-}
-
-/****************************************************************************
-DESCRIPTION:
-Returns the mask indicating what joystick axes are attached.
-
-HEADER:
-event.h
-
-REMARKS:
-This function is used to detect the attached joysticks, and determine
-what axes are present and functioning. This function will re-detect any
-attached joysticks when it is called, so if the user forgot to attach
-the joystick when the application started, you can call this function to
-re-detect any newly attached joysticks.
-
-SEE ALSO:
-EVT_joySetLowerRight, EVT_joySetCenter, EVT_joyIsPresent
-****************************************************************************/
-int EVTAPI EVT_joyIsPresent(void)
-{
-    static int      mask = 0;
-    int             i;
-    char            *tmp, name0[128], name1[128];
-    static ibool    inited = false;
-
-    if (inited)
-       return mask;
-    memset(EVT.joyMin,0,sizeof(EVT.joyMin));
-    memset(EVT.joyCenter,0,sizeof(EVT.joyCenter));
-    memset(EVT.joyMax,0,sizeof(EVT.joyMax));
-    memset(EVT.joyPrev,0,sizeof(EVT.joyPrev));
-    EVT.joyButState = 0;
-    if ((tmp = getenv(ENV_JOYDEV0)) != NULL)
-       strcpy(joystick0_dev,tmp);
-    if ((tmp = getenv(ENV_JOYDEV1)) != NULL)
-       strcpy(joystick1_dev,tmp);
-    if ((joystick0_fd = open(joystick0_dev, O_RDONLY)) < 0)
-       joystick0_fd = 0;
-    if ((joystick1_fd = open(joystick1_dev, O_RDONLY)) < 0)
-       joystick1_fd = 0;
-    if (!joystick0_fd && !joystick1_fd) /* No joysticks detected */
-       return 0;
-    inited = true;
-    if (ioctl(joystick0_fd ? joystick0_fd : joystick1_fd, JSIOCGVERSION, &js_version) < 0)
-       return 0;
-
-    /* Initialise joystick 0 */
-    if (joystick0_fd) {
-       ioctl(joystick0_fd, JSIOCGNAME(sizeof(name0)), name0);
-       if (js_version & ~0xffff) {
-           struct js_event js;
-
-           ioctl(joystick0_fd, JSIOCGAXES, &js0_axes);
-           ioctl(joystick0_fd, JSIOCGBUTTONS, &js0_buttons);
-           axis0 = PM_calloc((int)js0_axes, sizeof(short));
-           buts0 = PM_malloc((int)js0_buttons);
-           /* Read the initial events */
-           while(dataReady(joystick0_fd)
-                 && read(joystick0_fd, &js, sizeof(struct js_event)) == sizeof(struct js_event)
-                 && (js.type & JS_EVENT_INIT)
-                 ) {
-               if (js.type & JS_EVENT_BUTTON)
-                   buts0[js.number] = js.value;
-               else if (js.type & JS_EVENT_AXIS)
-                   axis0[js.number] = scaleJoyAxis(js.value,js.number);
-               }
-           }
-       else {
-           js0_axes = 2;
-           js0_buttons = 2;
-           axis0 = PM_calloc((int)js0_axes, sizeof(short));
-           buts0 = PM_malloc((int)js0_buttons);
-           }
-       }
-
-    /* Initialise joystick 1 */
-    if (joystick1_fd) {
-       ioctl(joystick1_fd, JSIOCGNAME(sizeof(name1)), name1);
-       if (js_version & ~0xffff) {
-           struct js_event js;
-
-           ioctl(joystick1_fd, JSIOCGAXES, &js1_axes);
-           ioctl(joystick1_fd, JSIOCGBUTTONS, &js1_buttons);
-           axis1 = PM_calloc((int)js1_axes, sizeof(short));
-           buts1 = PM_malloc((int)js1_buttons);
-           /* Read the initial events */
-           while(dataReady(joystick1_fd)
-                 && read(joystick1_fd, &js, sizeof(struct js_event))==sizeof(struct js_event)
-                 && (js.type & JS_EVENT_INIT)
-                 ) {
-               if (js.type & JS_EVENT_BUTTON)
-                   buts1[js.number] = js.value;
-               else if (js.type & JS_EVENT_AXIS)
-                   axis1[js.number] = scaleJoyAxis(js.value,js.number<<2);
-               }
-           }
-       else {
-           js1_axes = 2;
-           js1_buttons = 2;
-           axis1 = PM_calloc((int)js1_axes, sizeof(short));
-           buts1 = PM_malloc((int)js1_buttons);
-           }
-       }
-
-#ifdef  CHECKED
-    fprintf(stderr,"Using joystick driver version %d.%d.%d\n",
-           js_version >> 16, (js_version >> 8) & 0xff, js_version & 0xff);
-    if (joystick0_fd)
-       fprintf(stderr,"Joystick 1 (%s): %s\n", joystick0_dev, name0);
-    if (joystick1_fd)
-       fprintf(stderr,"Joystick 2 (%s): %s\n", joystick1_dev, name1);
-#endif
-    mask = _EVT_readJoyAxis(EVT_JOY_AXIS_ALL,EVT.joyCenter);
-    if (mask) {
-       for (i = 0; i < JOY_NUM_AXES; i++)
-           EVT.joyMax[i] = EVT.joyCenter[i]*2;
-       }
-    return mask;
-}
-
-/****************************************************************************
-DESCRIPTION:
-Polls the joystick for position and button information.
-
-HEADER:
-event.h
-
-REMARKS:
-This routine is used to poll analogue joysticks for button and position
-information. It should be called once for each main loop of the user
-application, just before processing all pending events via EVT_getNext.
-All information polled from the joystick will be posted to the event
-queue for later retrieval.
-
-Note:   Most analogue joysticks will provide readings that change even
-       though the joystick has not moved. Hence if you call this routine
-       you will likely get an EVT_JOYMOVE event every time through your
-       event loop.
-
-SEE ALSO:
-EVT_getNext, EVT_peekNext, EVT_joySetUpperLeft, EVT_joySetLowerRight,
-EVT_joySetCenter, EVT_joyIsPresent
-****************************************************************************/
-void EVTAPI EVT_pollJoystick(void)
-{
-    event_t evt;
-    int     i,axis[JOY_NUM_AXES],newButState,mask,moved,ps;
-
-    if ((js_version & ~0xFFFF) == 0 && EVT.joyMask) {
-       /* Read joystick axes and post movement events if they have
-        * changed since the last time we polled. Until the events are
-        * actually flushed, we keep modifying the same joystick movement
-        * event, so you won't get multiple movement event
-        */
-       mask = _EVT_readJoyAxis(EVT.joyMask,axis);
-       newButState = _EVT_readJoyButtons();
-       moved = false;
-       for (i = 0; i < JOY_NUM_AXES; i++) {
-           if (mask & (EVT_JOY_AXIS_X1 << i))
-               axis[i] = scaleJoyAxis(axis[i],i);
-           else
-               axis[i] = EVT.joyPrev[i];
-           if (axis[i] != EVT.joyPrev[i])
-               moved = true;
-           }
-       if (moved) {
-           memcpy(EVT.joyPrev,axis,sizeof(EVT.joyPrev));
-           ps = _EVT_disableInt();
-           if (EVT.oldJoyMove != -1) {
-               /* Modify the existing joystick movement event */
-               EVT.evtq[EVT.oldJoyMove].message = newButState;
-               EVT.evtq[EVT.oldJoyMove].where_x = EVT.joyPrev[0];
-               EVT.evtq[EVT.oldJoyMove].where_y = EVT.joyPrev[1];
-               EVT.evtq[EVT.oldJoyMove].relative_x = EVT.joyPrev[2];
-               EVT.evtq[EVT.oldJoyMove].relative_y = EVT.joyPrev[3];
-               }
-           else if (EVT.count < EVENTQSIZE) {
-               /* Add a new joystick movement event */
-               EVT.oldJoyMove = EVT.freeHead;
-               memset(&evt,0,sizeof(evt));
-               evt.what = EVT_JOYMOVE;
-               evt.message = EVT.joyButState;
-               evt.where_x = EVT.joyPrev[0];
-               evt.where_y = EVT.joyPrev[1];
-               evt.relative_x = EVT.joyPrev[2];
-               evt.relative_y = EVT.joyPrev[3];
-               addEvent(&evt);
-               }
-           _EVT_restoreInt(ps);
-           }
-
-       /* Read the joystick buttons, and post events to reflect the change
-        * in state for the joystick buttons.
-        */
-       if (newButState != EVT.joyButState) {
-           if (EVT.count < EVENTQSIZE) {
-               /* Add a new joystick movement event */
-               ps = _EVT_disableInt();
-               memset(&evt,0,sizeof(evt));
-               evt.what = EVT_JOYCLICK;
-               evt.message = newButState;
-               EVT.evtq[EVT.oldJoyMove].where_x = EVT.joyPrev[0];
-               EVT.evtq[EVT.oldJoyMove].where_y = EVT.joyPrev[1];
-               EVT.evtq[EVT.oldJoyMove].relative_x = EVT.joyPrev[2];
-               EVT.evtq[EVT.oldJoyMove].relative_y = EVT.joyPrev[3];
-               addEvent(&evt);
-               _EVT_restoreInt(ps);
-               }
-           EVT.joyButState = newButState;
-           }
-       }
-}
-
-/****************************************************************************
-DESCRIPTION:
-Calibrates the joystick upper left position
-
-HEADER:
-event.h
-
-REMARKS:
-This function can be used to zero in on better joystick calibration factors,
-which may work better than the default simplistic calibration (which assumes
-the joystick is centered when the event library is initialised).
-To use this function, ask the user to hold the stick in the upper left
-position and then have them press a key or button. and then call this
-function. This function will then read the joystick and update the
-calibration factors.
-
-Usually, assuming that the stick was centered when the event library was
-initialized, you really only need to call EVT_joySetLowerRight since the
-upper left position is usually always 0,0 on most joysticks. However, the
-safest procedure is to call all three calibration functions.
-
-SEE ALSO:
-EVT_joySetUpperLeft, EVT_joySetLowerRight, EVT_joyIsPresent
-****************************************************************************/
-void EVTAPI EVT_joySetUpperLeft(void)
-{
-    _EVT_readJoyAxis(EVT_JOY_AXIS_ALL,EVT.joyMin);
-}
-
-/****************************************************************************
-DESCRIPTION:
-Calibrates the joystick lower right position
-
-HEADER:
-event.h
-
-REMARKS:
-This function can be used to zero in on better joystick calibration factors,
-which may work better than the default simplistic calibration (which assumes
-the joystick is centered when the event library is initialised).
-To use this function, ask the user to hold the stick in the lower right
-position and then have them press a key or button. and then call this
-function. This function will then read the joystick and update the
-calibration factors.
-
-Usually, assuming that the stick was centered when the event library was
-initialized, you really only need to call EVT_joySetLowerRight since the
-upper left position is usually always 0,0 on most joysticks. However, the
-safest procedure is to call all three calibration functions.
-
-SEE ALSO:
-EVT_joySetUpperLeft, EVT_joySetCenter, EVT_joyIsPresent
-****************************************************************************/
-void EVTAPI EVT_joySetLowerRight(void)
-{
-    _EVT_readJoyAxis(EVT_JOY_AXIS_ALL,EVT.joyMax);
-}
-
-/****************************************************************************
-DESCRIPTION:
-Calibrates the joystick center position
-
-HEADER:
-event.h
-
-REMARKS:
-This function can be used to zero in on better joystick calibration factors,
-which may work better than the default simplistic calibration (which assumes
-the joystick is centered when the event library is initialised).
-To use this function, ask the user to hold the stick in the center
-position and then have them press a key or button. and then call this
-function. This function will then read the joystick and update the
-calibration factors.
-
-Usually, assuming that the stick was centered when the event library was
-initialized, you really only need to call EVT_joySetLowerRight since the
-upper left position is usually always 0,0 on most joysticks. However, the
-safest procedure is to call all three calibration functions.
-
-SEE ALSO:
-EVT_joySetUpperLeft, EVT_joySetLowerRight, EVT_joySetCenter
-****************************************************************************/
-void EVTAPI EVT_joySetCenter(void)
-{
-    _EVT_readJoyAxis(EVT_JOY_AXIS_ALL,EVT.joyCenter);
-}
-#endif
-
-/****************************************************************************
-REMARKS:
-Pumps all messages in the message queue from Linux into our event queue.
-****************************************************************************/
-static void _EVT_pumpMessages(void)
-{
-    event_t                 evt;
-    int                     i,numkeys, c;
-    ibool                   release;
-    static struct kbentry   ke;
-    static char             buf[KBDREADBUFFERSIZE];
-    static ushort           repeatKey[128] = {0};
-
-    /* Poll keyboard events */
-    while (dataReady(_PM_console_fd) && (numkeys = read(_PM_console_fd, buf, KBDREADBUFFERSIZE)) > 0) {
-       for (i = 0; i < numkeys; i++) {
-           c = buf[i];
-           release = c & 0x80;
-           c &= 0x7F;
-
-           /* TODO:    This is wrong! We need this to be the time stamp at */
-           /*          ** interrupt ** time!! One solution would be to */
-           /*          put the keyboard and mouse polling loops into */
-           /*          a separate thread that can block on I/O to the */
-           /*          necessay file descriptor. */
-           evt.when = _EVT_getTicks();
-
-           if (release) {
-               /* Key released */
-               evt.what = EVT_KEYUP;
-               switch (c) {
-                   case KB_leftShift:
-                       _PM_modifiers &= ~EVT_LEFTSHIFT;
-                       break;
-                   case KB_rightShift:
-                       _PM_modifiers &= ~EVT_RIGHTSHIFT;
-                       break;
-                   case 29:
-                       _PM_modifiers &= ~(EVT_LEFTCTRL|EVT_CTRLSTATE);
-                       break;
-                   case 97:            /* Control */
-                       _PM_modifiers &= ~EVT_CTRLSTATE;
-                       break;
-                   case 56:
-                       _PM_modifiers &= ~(EVT_LEFTALT|EVT_ALTSTATE);
-                       break;
-                   case 100:
-                       _PM_modifiers &= ~EVT_ALTSTATE;
-                       break;
-                   default:
-                   }
-               evt.modifiers = _PM_modifiers;
-               evt.message = keyUpMsg[c];
-               if (EVT.count < EVENTQSIZE)
-                   addEvent(&evt);
-               keyUpMsg[c] = 0;
-               repeatKey[c] = 0;
-               }
-           else {
-               /* Key pressed */
-               evt.what = EVT_KEYDOWN;
-               switch (c) {
-                   case KB_leftShift:
-                       _PM_modifiers |= EVT_LEFTSHIFT;
-                       break;
-                   case KB_rightShift:
-                       _PM_modifiers |= EVT_RIGHTSHIFT;
-                       break;
-                   case 29:
-                       _PM_modifiers |= EVT_LEFTCTRL|EVT_CTRLSTATE;
-                       break;
-                   case 97:            /* Control */
-                       _PM_modifiers |= EVT_CTRLSTATE;
-                       break;
-                   case 56:
-                       _PM_modifiers |= EVT_LEFTALT|EVT_ALTSTATE;
-                       break;
-                   case 100:
-                       _PM_modifiers |= EVT_ALTSTATE;
-                       break;
-                   case KB_capsLock:   /* Caps Lock */
-                       _PM_leds ^= LED_CAP;
-                       ioctl(_PM_console_fd, KDSETLED, _PM_leds);
-                       break;
-                   case KB_numLock:    /* Num Lock */
-                       _PM_leds ^= LED_NUM;
-                       ioctl(_PM_console_fd, KDSETLED, _PM_leds);
-                       break;
-                   case KB_scrollLock: /* Scroll Lock */
-                       _PM_leds ^= LED_SCR;
-                       ioctl(_PM_console_fd, KDSETLED, _PM_leds);
-                       break;
-                   default:
-                   }
-               evt.modifiers = _PM_modifiers;
-               if (keyUpMsg[c]) {
-                   evt.what = EVT_KEYREPEAT;
-                   evt.message = keyUpMsg[c] | (repeatKey[c]++ << 16);
-                   }
-               else {
-                   int asc;
-
-                   evt.message = getKeyMapping(keymaps, NB_KEYMAPS, c) << 8;
-                   ke.kb_index = c;
-                   ke.kb_table = 0;
-                   if ((_PM_modifiers & EVT_SHIFTKEY) || (_PM_leds & LED_CAP))
-                       ke.kb_table |= K_SHIFTTAB;
-                   if (_PM_modifiers & (EVT_LEFTALT | EVT_ALTSTATE))
-                       ke.kb_table |= K_ALTTAB;
-                   if (ioctl(_PM_console_fd, KDGKBENT, (unsigned long)&ke)<0)
-                       perror("ioctl(KDGKBENT)");
-                   if ((_PM_leds & LED_NUM) && (getKeyMapping(keypad, NB_KEYPAD, c)!=c)) {
-                       asc = getKeyMapping(keypad, NB_KEYPAD, c);
-                       }
-                   else {
-                       switch (c) {
-                           case 14:
-                               asc = ASCII_backspace;
-                               break;
-                           case 15:
-                               asc = ASCII_tab;
-                               break;
-                           case 28:
-                           case 96:
-                               asc = ASCII_enter;
-                               break;
-                           case 1:
-                               asc = ASCII_esc;
-                           default:
-                               asc = ke.kb_value & 0xFF;
-                               if (asc < 0x1B)
-                                   asc = 0;
-                               break;
-                           }
-                       }
-                   if ((_PM_modifiers & (EVT_CTRLSTATE|EVT_LEFTCTRL)) && isalpha(asc))
-                       evt.message |= toupper(asc) - 'A' + 1;
-                   else
-                       evt.message |= asc;
-                   keyUpMsg[c] = evt.message;
-                   repeatKey[c]++;
-                   }
-               if (EVT.count < EVENTQSIZE)
-                   addEvent(&evt);
-               }
-           }
-       }
-
-    /* Poll mouse events */
-    if (_EVT_mouse_fd) {
-       int         dx, dy, buts;
-       static int  oldbuts;
-
-       while (dataReady(_EVT_mouse_fd)) {
-           if (readMouseData(&buts, &dx, &dy)) {
-               EVT.mx += dx;
-               EVT.my += dy;
-               if (EVT.mx < 0) EVT.mx = 0;
-               if (EVT.my < 0) EVT.my = 0;
-               if (EVT.mx > range_x) EVT.mx = range_x;
-               if (EVT.my > range_y) EVT.my = range_y;
-               evt.where_x = EVT.mx;
-               evt.where_y = EVT.my;
-               evt.relative_x = dx;
-               evt.relative_y = dy;
-
-               /* TODO:    This is wrong! We need this to be the time stamp at */
-               /*          ** interrupt ** time!! One solution would be to */
-               /*          put the keyboard and mouse polling loops into */
-               /*          a separate thread that can block on I/O to the */
-               /*          necessay file descriptor. */
-               evt.when = _EVT_getTicks();
-               evt.modifiers = _PM_modifiers;
-               if (buts & 4)
-                   evt.modifiers |= EVT_LEFTBUT;
-               if (buts & 1)
-                   evt.modifiers |= EVT_RIGHTBUT;
-               if (buts & 2)
-                   evt.modifiers |= EVT_MIDDLEBUT;
-
-               /* Left click events */
-               if ((buts&4) != (oldbuts&4)) {
-                   if (buts&4)
-                       evt.what = EVT_MOUSEDOWN;
-                   else
-                       evt.what = EVT_MOUSEUP;
-                   evt.message = EVT_LEFTBMASK;
-                   EVT.oldMove = -1;
-                   if (EVT.count < EVENTQSIZE)
-                       addEvent(&evt);
-                   }
-
-               /* Right click events */
-               if ((buts&1) != (oldbuts&1)) {
-                   if (buts&1)
-                       evt.what = EVT_MOUSEDOWN;
-                   else
-                       evt.what = EVT_MOUSEUP;
-                   evt.message = EVT_RIGHTBMASK;
-                   EVT.oldMove = -1;
-                   if (EVT.count < EVENTQSIZE)
-                       addEvent(&evt);
-                   }
-
-               /* Middle click events */
-               if ((buts&2) != (oldbuts&2)) {
-                   if (buts&2)
-                       evt.what = EVT_MOUSEDOWN;
-                   else
-                       evt.what = EVT_MOUSEUP;
-                   evt.message = EVT_MIDDLEBMASK;
-                   EVT.oldMove = -1;
-                   if (EVT.count < EVENTQSIZE)
-                       addEvent(&evt);
-                   }
-
-               /* Mouse movement event */
-               if (dx || dy) {
-                   evt.what = EVT_MOUSEMOVE;
-                   evt.message = 0;
-                   if (EVT.oldMove != -1) {
-                       /* Modify existing movement event */
-                       EVT.evtq[EVT.oldMove].where_x = evt.where_x;
-                       EVT.evtq[EVT.oldMove].where_y = evt.where_y;
-                       }
-                   else {
-                       /* Save id of this movement event */
-                       EVT.oldMove = EVT.freeHead;
-                       if (EVT.count < EVENTQSIZE)
-                           addEvent(&evt);
-                       }
-                   }
-               oldbuts = buts;
-               }
-           }
-       }
-
-#ifdef USE_OS_JOYSTICK
-    /* Poll joystick events using the 1.x joystick driver API in the 2.2 kernels */
-    if (js_version & ~0xffff) {
-       static struct js_event  js;
-
-       /* Read joystick axis 0 */
-       evt.when = 0;
-       evt.modifiers = _PM_modifiers;
-       if (joystick0_fd && dataReady(joystick0_fd) &&
-               read(joystick0_fd, &js, sizeof(js)) == sizeof(js)) {
-           if (js.type & JS_EVENT_BUTTON) {
-               if (js.number < 2) { /* Only 2 buttons for now :( */
-                   buts0[js.number] = js.value;
-                   evt.what = EVT_JOYCLICK;
-                   makeJoyEvent(&evt);
-                   if (EVT.count < EVENTQSIZE)
-                       addEvent(&evt);
-                   }
-               }
-           else if (js.type & JS_EVENT_AXIS) {
-               axis0[js.number] = scaleJoyAxis(js.value,js.number);
-               evt.what = EVT_JOYMOVE;
-               if (EVT.oldJoyMove != -1) {
-                   makeJoyEvent(&EVT.evtq[EVT.oldJoyMove]);
-                   }
-               else if (EVT.count < EVENTQSIZE) {
-                   EVT.oldJoyMove = EVT.freeHead;
-                   makeJoyEvent(&evt);
-                   addEvent(&evt);
-                   }
-               }
-           }
-
-       /* Read joystick axis 1 */
-       if (joystick1_fd && dataReady(joystick1_fd) &&
-               read(joystick1_fd, &js, sizeof(js))==sizeof(js)) {
-           if (js.type & JS_EVENT_BUTTON) {
-               if (js.number < 2) { /* Only 2 buttons for now :( */
-                   buts1[js.number] = js.value;
-                   evt.what = EVT_JOYCLICK;
-                   makeJoyEvent(&evt);
-                   if (EVT.count < EVENTQSIZE)
-                       addEvent(&evt);
-                   }
-               }
-           else if (js.type & JS_EVENT_AXIS) {
-               axis1[js.number] = scaleJoyAxis(js.value,js.number<<2);
-               evt.what = EVT_JOYMOVE;
-               if (EVT.oldJoyMove != -1) {
-                   makeJoyEvent(&EVT.evtq[EVT.oldJoyMove]);
-                   }
-               else if (EVT.count < EVENTQSIZE) {
-                   EVT.oldJoyMove = EVT.freeHead;
-                   makeJoyEvent(&evt);
-                   addEvent(&evt);
-                   }
-               }
-           }
-       }
-#endif
-}
-
-/****************************************************************************
-REMARKS:
-This macro/function is used to converts the scan codes reported by the
-keyboard to our event libraries normalised format. We only have one scan
-code for the 'A' key, and use shift _PM_modifiers to determine if it is a
-Ctrl-F1, Alt-F1 etc. The raw scan codes from the keyboard work this way,
-but the OS gives us 'cooked' scan codes, we have to translate them back
-to the raw format.
-****************************************************************************/
-#define _EVT_maskKeyCode(evt)
-
-/****************************************************************************
-REMARKS:
-Set the speed of the serial port
-****************************************************************************/
-static int setspeed(
-    int fd,
-    int old,
-    int new,
-    unsigned short flags)
-{
-    struct termios tty;
-    char *c;
-
-    tcgetattr(fd, &tty);
-    tty.c_iflag = IGNBRK | IGNPAR;
-    tty.c_oflag = 0;
-    tty.c_lflag = 0;
-    tty.c_line = 0;
-    tty.c_cc[VTIME] = 0;
-    tty.c_cc[VMIN] = 1;
-    switch (old) {
-       case 9600:  tty.c_cflag = flags | B9600; break;
-       case 4800:  tty.c_cflag = flags | B4800; break;
-       case 2400:  tty.c_cflag = flags | B2400; break;
-       case 1200:
-       default:    tty.c_cflag = flags | B1200; break;
-       }
-    tcsetattr(fd, TCSAFLUSH, &tty);
-    switch (new) {
-       case 9600:  c = "*q";  tty.c_cflag = flags | B9600; break;
-       case 4800:  c = "*p";  tty.c_cflag = flags | B4800; break;
-       case 2400:  c = "*o";  tty.c_cflag = flags | B2400; break;
-       case 1200:
-       default:    c = "*n";  tty.c_cflag = flags | B1200; break;
-       }
-    write(fd, c, 2);
-    usleep(100000);
-    tcsetattr(fd, TCSAFLUSH, &tty);
-    return 0;
-}
-
-/****************************************************************************
-REMARKS:
-Generic mouse driver init code
-****************************************************************************/
-static void _EVT_mouse_init(void)
-{
-    int i;
-
-    /* Change from any available speed to the chosen one */
-    for (i = 9600; i >= 1200; i /= 2)
-       setspeed(_EVT_mouse_fd, i, opt_baud, mouse_infos[mouse_driver].flags);
-}
-
-/****************************************************************************
-REMARKS:
-Logitech mouse driver init code
-****************************************************************************/
-static void _EVT_logitech_init(void)
-{
-    int         i;
-    struct stat buf;
-    int         busmouse;
-
-    /* is this a serial- or a bus- mouse? */
-    if (fstat(_EVT_mouse_fd,&buf) == -1)
-       perror("fstat");
-    i = MAJOR(buf.st_rdev);
-    if (stat("/dev/ttyS0",&buf) == -1)
-       perror("stat");
-    busmouse=(i != MAJOR(buf.st_rdev));
-
-    /* Fix the howmany field, so that serial mice have 1, while busmice have 3 */
-    mouse_infos[mouse_driver].read = busmouse ? 3 : 1;
-
-    /* Change from any available speed to the chosen one */
-    for (i = 9600; i >= 1200; i /= 2)
-       setspeed(_EVT_mouse_fd, i, opt_baud, mouse_infos[mouse_driver].flags);
-
-    /* This stuff is peculiar of logitech mice, also for the serial ones */
-    write(_EVT_mouse_fd, "S", 1);
-    setspeed(_EVT_mouse_fd, opt_baud, opt_baud,CS8 |PARENB |PARODD |CREAD |CLOCAL |HUPCL);
-
-    /* Configure the sample rate */
-    for (i = 0; opt_sample <= sampletab[i].sample; i++)
-       ;
-    write(_EVT_mouse_fd,sampletab[i].code,1);
-}
-
-/****************************************************************************
-REMARKS:
-Microsoft Intellimouse init code
-****************************************************************************/
-static void _EVT_pnpmouse_init(void)
-{
-    struct termios tty;
-
-    tcgetattr(_EVT_mouse_fd, &tty);
-    tty.c_iflag = IGNBRK | IGNPAR;
-    tty.c_oflag = 0;
-    tty.c_lflag = 0;
-    tty.c_line = 0;
-    tty.c_cc[VTIME] = 0;
-    tty.c_cc[VMIN] = 1;
-    tty.c_cflag = mouse_infos[mouse_driver].flags | B1200;
-    tcsetattr(_EVT_mouse_fd, TCSAFLUSH, &tty); /* set parameters */
-}
-
-/****************************************************************************
-PARAMETERS:
-mouseMove   - Callback function to call wheneve the mouse needs to be moved
-
-REMARKS:
-Initiliase the event handling module. Here we install our mouse handling ISR
-to be called whenever any button's are pressed or released. We also build
-the free list of events in the event queue.
-
-We use handler number 2 of the mouse libraries interrupt handlers for our
-event handling routines.
-****************************************************************************/
-void EVTAPI EVT_init(
-    _EVT_mouseMoveHandler mouseMove)
-{
-    int         i;
-    char        *tmp;
-
-    /* Initialise the event queue */
-    EVT.mouseMove = mouseMove;
-    initEventQueue();
-    for (i = 0; i < 256; i++)
-       keyUpMsg[i] = 0;
-
-    /* Keyboard initialization */
-    if (_PM_console_fd == -1)
-       PM_fatalError("You must first call PM_openConsole to use the EVT functions!");
-    _PM_keyboard_rawmode();
-    fcntl(_PM_console_fd,F_SETFL,fcntl(_PM_console_fd,F_GETFL) | O_NONBLOCK);
-
-    /* Mouse initialization */
-    if ((tmp = getenv(ENV_MOUSEDRV)) != NULL) {
-       for (i = 0; i < NB_MICE; i++) {
-           if (!strcasecmp(tmp, mouse_infos[i].name)) {
-               mouse_driver = i;
-               break;
-               }
-           }
-       if (i == NB_MICE) {
-           fprintf(stderr,"Unknown mouse driver: %s\n", tmp);
-           mouse_driver = EVT_noMouse;
-           _EVT_mouse_fd = 0;
-           }
-       }
-    if (mouse_driver != EVT_noMouse) {
-       if (mouse_driver == EVT_gpm)
-           strcpy(mouse_dev,"/dev/gpmdata");
-       if ((tmp = getenv(ENV_MOUSEDEV)) != NULL)
-           strcpy(mouse_dev,tmp);
-#ifdef  CHECKED
-       fprintf(stderr,"Using the %s MGL mouse driver on %s.\n", mouse_infos[mouse_driver].name, mouse_dev);
-#endif
-       if ((_EVT_mouse_fd = open(mouse_dev, O_RDWR)) < 0) {
-           perror("open");
-           fprintf(stderr, "Unable to open mouse device %s, dropping mouse support.\n", mouse_dev);
-           sleep(1);
-           mouse_driver = EVT_noMouse;
-           _EVT_mouse_fd = 0;
-           }
-       else {
-           char c;
-
-           /* Init and flush the mouse pending input queue */
-           if (mouse_infos[mouse_driver].init)
-               mouse_infos[mouse_driver].init();
-           while(dataReady(_EVT_mouse_fd) && read(_EVT_mouse_fd, &c, 1) == 1)
-               ;
-           }
-       }
-}
-
-/****************************************************************************
-REMARKS
-Changes the range of coordinates returned by the mouse functions to the
-specified range of values. This is used when changing between graphics
-modes set the range of mouse coordinates for the new display mode.
-****************************************************************************/
-void EVTAPI EVT_setMouseRange(
-    int xRes,
-    int yRes)
-{
-    range_x = xRes;
-    range_y = yRes;
-}
-
-/****************************************************************************
-REMARKS
-Modifes the mouse coordinates as necessary if scaling to OS coordinates,
-and sets the OS mouse cursor position.
-****************************************************************************/
-#define _EVT_setMousePos(x,y)
-
-/****************************************************************************
-REMARKS:
-Initiailises the internal event handling modules. The EVT_suspend function
-can be called to suspend event handling (such as when shelling out to DOS),
-and this function can be used to resume it again later.
-****************************************************************************/
-void EVT_resume(void)
-{
-    /* Do nothing for Linux */
-}
-
-/****************************************************************************
-REMARKS
-Suspends all of our event handling operations. This is also used to
-de-install the event handling code.
-****************************************************************************/
-void EVT_suspend(void)
-{
-    /* Do nothing for Linux */
-}
-
-/****************************************************************************
-REMARKS
-Exits the event module for program terminatation.
-****************************************************************************/
-void EVT_exit(void)
-{
-    /* Restore signal handlers */
-    _PM_restore_kb_mode();
-    if (_EVT_mouse_fd) {
-       close(_EVT_mouse_fd);
-       _EVT_mouse_fd = 0;
-       }
-#ifdef USE_OS_JOYSTICK
-    if (joystick0_fd) {
-       close(joystick0_fd);
-       free(axis0);
-       free(buts0);
-       joystick0_fd = 0;
-       }
-    if (joystick1_fd) {
-       close(joystick1_fd);
-       free(axis1);
-       free(buts1);
-       joystick1_fd = 0;
-       }
-#endif
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/linux/event.svga b/board/MAI/bios_emulator/scitech/src/pm/linux/event.svga
deleted file mode 100644 (file)
index c0358a0..0000000
+++ /dev/null
@@ -1,1058 +0,0 @@
-/****************************************************************************
-*
-*           The SuperVGA Kit - UniVBE Software Development Kit
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  IBM PC (MS DOS)
-*
-* Description:  Routines to provide a Linux event queue, which automatically
-*               handles keyboard and mouse events for the Linux compatability
-*               libraries. Based on the event handling code in the MGL.
-*
-****************************************************************************/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <ctype.h>
-#include <termios.h>
-#include <signal.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <errno.h>
-#include <sys/time.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <linux/keyboard.h>
-#include <linux/kd.h>
-#include <linux/vt.h>
-#include <gpm.h>
-#include "pm.h"
-#include "vesavbe.h"
-#include "wdirect.h"
-
-/*--------------------------- Global variables ----------------------------*/
-
-#define EVENTQSIZE  100             /* Number of events in event queue  */
-
-static int      head = -1;          /* Head of event queue              */
-static int      tail = -1;          /* Tail of event queue              */
-static int      freeHead = -1;      /* Head of free list                */
-static int      count = 0;          /* No. of items currently in queue  */
-static WD_event evtq[EVENTQSIZE];   /* The queue structure itself      */
-static int      oldMove = -1;       /* Previous movement event          */
-static int      oldKey = -1;        /* Previous key repeat event        */
-static int      mx,my;              /* Current mouse position           */
-static int      xRes,yRes;          /* Screen resolution coordinates    */
-static void     *stateBuf;          /* Pointer to console state buffer  */
-static int      conn;               /* GPM file descriptor for mouse handling */
-static int      tty_fd;             /* File descriptor for /dev/console */
-extern int      tty_vc;             /* Virtual console ID, from the PM/Pro library */
-static ibool    key_down[128];      /* State of all keyboard keys       */
-static struct termios old_conf;     /* Saved terminal configuration     */
-static int      oldkbmode;          /* and previous keyboard mode       */
-struct vt_mode  oldvtmode;          /* Old virtual terminal mode        */
-static int      old_flags;          /* Old flags for fcntl              */
-static ulong    key_modifiers;      /* Keyboard modifiers               */
-static int      forbid_vt_release=0;/* Flag to forbid release of VT     */
-static int      forbid_vt_acquire=0;/* Flag to forbid cature of VT      */
-static int      oldmode;            /* Old SVGA mode saved for VT switch*/
-static int      initmode;           /* Initial text mode                */
-static ibool    installed = false;  /* True if we are installed         */
-static void     (_ASMAPI *moveCursor)(int x,int y) = NULL;
-static int      (_ASMAPI *suspendAppCallback)(int flags) = NULL;
-
-#if 0
-/* Keyboard Translation table from scancodes to ASCII */
-
-static uchar keyTable[128] =
-"\0\0331234567890-=\010"
-"\011qwertyuiop[]\015"
-"\0asdfghjkl;'`\0\\"
-"zxcvbnm,./\0*\0 \0"
-"\0\0\0\0\0\0\0\0\0\0\0\0"      /* Function keys */
-"789-456+1230.\0\0\0\0\0"       /* Keypad keys */
-"\0\0\0\0\0\0\0\015\0/";
-
-static uchar keyTableShifted[128] =
-"\0\033!@#$%^&*()_+\010"
-"\011QWERTYUIOP{}\015"
-"\0ASDFGHJKL:\"~\0|"
-"ZXCVBNM<>?\0*\0 \0"
-"\0\0\0\0\0\0\0\0\0\0\0\0"      /* Function keys */
-"789-456+1230.\0\0\0\0\0"       /* Keypad keys */
-"\0\0\0\0\0\0\0\015\0/";
-#endif
-
-/* Macros to keep track of the CAPS and NUM lock states */
-
-#define EVT_CAPSSTATE   0x0100
-#define EVT_NUMSTATE    0x0200
-
-/* Helper macros for dealing with timers */
-
-#define TICKS_TO_USEC(t) ((t)*65536.0/1.193180)
-#define USEC_TO_TICKS(u) ((u)*1.193180/65536.0)
-
-/* Number of keycodes to read at a time from the console */
-
-#define KBDREADBUFFERSIZE 32
-
-/*---------------------------- Implementation -----------------------------*/
-
-/****************************************************************************
-REMARKS:
-Returns the current time stamp in units of 18.2 ticks per second.
-****************************************************************************/
-static ulong getTimeStamp(void)
-{
-    return (ulong)(clock() / (CLOCKS_PER_SEC / 18.2));
-}
-
-/****************************************************************************
-PARAMETERS:
-evt - Event to place onto event queue
-
-REMARKS:
-Adds an event to the event queue by tacking it onto the tail of the event
-queue. This routine assumes that at least one spot is available on the
-freeList for the event to be inserted.
-****************************************************************************/
-static void addEvent(
-    WD_event *evt)
-{
-    int         evtID;
-
-    /* Get spot to place the event from the free list */
-    evtID = freeHead;
-    freeHead = evtq[freeHead].next;
-
-    /* Add to the tail of the event queue   */
-    evt->next = -1;
-    evt->prev = tail;
-    if (tail != -1)
-        evtq[tail].next = evtID;
-    else
-        head = evtID;
-    tail = evtID;
-    evtq[evtID] = *evt;
-    count++;
-}
-
-/****************************************************************************
-PARAMETERS:
-what        - Event code
-message     - Event message
-modifiers   - keyboard modifiers
-x           - Mouse X position at time of event
-y           - Mouse Y position at time of event
-but_stat    - Mouse button status at time of event
-
-REMARKS:
-Adds a new mouse event to the event queue. This routine is called from
-within the mouse interrupt subroutine, so it must be efficient.
-****************************************************************************/
-static void addMouseEvent(
-    uint what,
-    uint message,
-    int x,
-    int y,
-    uint but_stat)
-{
-    WD_event    evt;
-
-    if (count < EVENTQSIZE) {
-        evt.what = what;
-        evt.when = getTimeStamp();
-        evt.message = message;
-        evt.modifiers = but_stat | key_modifiers;
-        evt.where_x = x;
-        evt.where_y = y;
-        fprintf(stderr, "(%d,%d), buttons %ld\n", x,y, evt.modifiers);
-        addEvent(&evt);                 /* Add to tail of event queue   */
-        }
-}
-
-/****************************************************************************
-PARAMETERS:
-scancode    - Raw keyboard scan code
-modifiers   - Keyboard modifiers flags
-
-REMARKS:
-Converts the raw scan code into the appropriate ASCII code using the scan
-code and the keyboard modifier flags.
-****************************************************************************/
-static ulong getKeyMessage(
-    uint scancode,
-    ulong modifiers)
-{
-    ushort  code = scancode << 8;
-    ushort  ascii;
-    struct kbentry ke;
-
-    ke.kb_index = scancode;
-
-    /* Find the basic ASCII code for the scan code */
-    if (modifiers & EVT_CAPSSTATE) {
-        if (modifiers & EVT_SHIFTKEY)
-          ke.kb_table = K_NORMTAB;
-        //          ascii = tolower(keyTableShifted[scancode]);
-        else
-          ke.kb_table = K_SHIFTTAB;
-        //          ascii = toupper(keyTable[scancode]);
-        }
-    else {
-        if (modifiers & EVT_SHIFTKEY)
-          ke.kb_table = K_SHIFTTAB;
-          // ascii = keyTableShifted[scancode];
-        else
-          ke.kb_table = K_NORMTAB;
-          // ascii = keyTable[scancode];
-        }
-    if(modifiers & EVT_ALTSTATE)
-      ke.kb_table |= K_ALTTAB;
-
-    if (ioctl(tty_fd, KDGKBENT, (unsigned long)&ke)) {
-        fprintf(stderr, "KDGKBENT at index %d in table %d: ",
-            scancode, ke.kb_table);
-        return 0;
-    }
-    ascii = ke.kb_value;
-
-    /* Add ASCII code if key is not alt'ed or ctrl'ed */
-    if (!(modifiers & (EVT_ALTSTATE | EVT_CTRLSTATE)))
-        code |= ascii;
-
-    return code;
-}
-
-/****************************************************************************
-PARAMETERS:
-what        - Event code
-scancode    - Raw scancode of keyboard event to add
-
-REMARKS:
-Adds a new keyboard event to the event queue. We only take KEYUP and
-KEYDOWN event codes, however if a key is already down we convert the KEYDOWN
-to a KEYREPEAT.
-****************************************************************************/
-static void addKeyEvent(
-    uint what,
-    uint scancode)
-{
-    WD_event    evt;
-
-    if (count < EVENTQSIZE) {
-        evt.what = what;
-        evt.when = getTimeStamp();
-        evt.message = getKeyMessage(scancode,key_modifiers) | 0x10000UL;
-        evt.where_x = evt.where_y = 0;
-        evt.modifiers = key_modifiers;
-        if (evt.what == EVT_KEYUP)
-            key_down[scancode] = false;
-        else if (evt.what == EVT_KEYDOWN) {
-            if (key_down[scancode]) {
-                if (oldKey != -1) {
-                    evtq[oldKey].message += 0x10000UL;
-                    }
-                else {
-                    evt.what = EVT_KEYREPEAT;
-                    oldKey = freeHead;
-                    addEvent(&evt);
-                    oldMove = -1;
-                    }
-                return;
-                }
-            key_down[scancode] = true;
-            }
-
-        addEvent(&evt);
-        oldMove = -1;
-        }
-}
-
-/****************************************************************************
-PARAMETERS:
-sig - Signal being sent to this signal handler
-
-REMARKS:
-Signal handler for the timer. This routine takes care of periodically
-posting timer events to the event queue.
-****************************************************************************/
-void timerHandler(
-    int sig)
-{
-    WD_event    evt;
-
-    if (sig == SIGALRM) {
-        if (count < EVENTQSIZE) {
-            evt.when = getTimeStamp();
-            evt.what = EVT_TIMERTICK;
-            evt.message = 0;
-            evt.where_x = evt.where_y = 0;
-            evt.modifiers = 0;
-            addEvent(&evt);
-            oldMove = -1;
-            oldKey = -1;
-            }
-        signal(SIGALRM, timerHandler);
-        }
-}
-
-/****************************************************************************
-REMARKS:
-Restore the terminal to normal operation on exit
-****************************************************************************/
-static void restore_term(void)
-{
-    RMREGS  regs;
-
-    if (installed) {
-        /* Restore text mode and the state of the console */
-        regs.x.ax = 0x3;
-        PM_int86(0x10,&regs,&regs);
-        PM_restoreConsoleState(stateBuf,tty_fd);
-
-        /* Restore console to normal operation */
-        ioctl(tty_fd, VT_SETMODE, &oldvtmode);
-        ioctl(tty_fd, KDSKBMODE, oldkbmode);
-        tcsetattr(tty_fd, TCSAFLUSH, &old_conf);
-        fcntl(tty_fd,F_SETFL,old_flags &= ~O_NONBLOCK);
-        PM_closeConsole(tty_fd);
-
-        /* Close the mouse driver */
-        close(conn);
-
-        /* Flag that we are not no longer installed */
-        installed = false;
-        }
-}
-
-/****************************************************************************
-REMARKS:
-Signal handler to capture forced program termination conditions so that
-we can clean up properly.
-****************************************************************************/
-static void exitHandler(int sig)
-{
-    exit(-1);
-}
-
-/****************************************************************************
-REMARKS:
-Sleep until the virtual terminal is active
-****************************************************************************/
-void wait_vt_active(void)
-{
-    while (ioctl(tty_fd, VT_WAITACTIVE, tty_vc) < 0) {
-        if ((errno != EAGAIN) && (errno != EINTR)) {
-            perror("ioctl(VT_WAITACTIVE)");
-            exit(1);
-            }
-        usleep(150000);
-        }
-}
-
-/****************************************************************************
-REMARKS:
-Signal handler called when our virtual terminal has been released and we are
-losing the active focus.
-****************************************************************************/
-static void release_vt_signal(int n)
-{
-    forbid_vt_acquire = 1;
-    if (forbid_vt_release) {
-        forbid_vt_acquire = 0;
-        ioctl(tty_fd, VT_RELDISP, 0);
-        return;
-        }
-
-    // TODO: Call the user supplied suspendAppCallback and restore text
-    //       mode (saving the existing mode so we can restore it).
-    //
-    //       Also if the suspendAppCallback is NULL then we have to
-    //       ignore the switch request!
-    if(suspendAppCallback){
-      oldmode = VBE_getVideoMode();
-      suspendAppCallback(true);
-      VBE_setVideoMode(initmode);
-    }
-
-    ioctl(tty_fd, VT_RELDISP, 1);
-    forbid_vt_acquire = 0;
-    wait_vt_active();
-}
-
-/****************************************************************************
-REMARKS:
-Signal handler called when our virtual terminal has been re-aquired and we
-are now regaiing the active focus.
-****************************************************************************/
-static void acquire_vt_signal(int n)
-{
-    forbid_vt_release = 1;
-    if (forbid_vt_acquire) {
-        forbid_vt_release = 0;
-        return;
-        }
-
-    // TODO: Restore the old display mode, call the user suspendAppCallback
-    //       and and we will be back in graphics mode.
-
-    if(suspendAppCallback){
-      VBE_setVideoMode(oldmode);
-      suspendAppCallback(false);
-    }
-
-    ioctl(tty_fd, VT_RELDISP, VT_ACKACQ);
-    forbid_vt_release = 0;
-}
-
-/****************************************************************************
-REMARKS:
-Function to set the action for a specific signal to call our signal handler.
-****************************************************************************/
-static void set_sigaction(int sig,void (*handler)(int))
-{
-    struct sigaction    siga;
-
-    siga.sa_handler = handler;
-    siga.sa_flags = SA_RESTART;
-    memset(&(siga.sa_mask), 0, sizeof(sigset_t));
-    sigaction(sig, &siga, NULL);
-}
-
-/****************************************************************************
-REMARKS:
-Function to take over control of VT switching so that we can capture
-virtual terminal release and aquire signals, allowing us to properly
-support VT switching while in graphics modes.
-****************************************************************************/
-static void take_vt_control(void)
-{
-    struct vt_mode      vtmode;
-
-    ioctl(tty_fd, VT_GETMODE, &vtmode);
-    oldvtmode = vtmode;
-    vtmode.mode = VT_PROCESS;
-    vtmode.relsig = SIGUSR1;
-    vtmode.acqsig = SIGUSR2;
-    set_sigaction(SIGUSR1, release_vt_signal);
-    set_sigaction(SIGUSR2, acquire_vt_signal);
-    ioctl(tty_fd, VT_SETMODE, &oldvtmode);
-}
-
-/****************************************************************************
-REMARKS:
-Set the shift keyboard LED's based on the current keyboard modifiers flags.
-****************************************************************************/
-static void updateLEDStatus(void)
-{
-    int state = 0;
-    if (key_modifiers & EVT_CAPSSTATE)
-        state |= LED_CAP;
-    if (key_modifiers & EVT_NUMSTATE)
-        state |= LED_NUM;
-    ioctl(tty_fd,KDSETLED,state);
-}
-
-/****************************************************************************
-PARAMETERS:
-scancode    - Raw scan code to handle
-
-REMARKS:
-Handles the shift key modifiers and keeps track of the shift key states
-so that we can return the correct ASCII codes for the keyboard.
-****************************************************************************/
-static void toggleModifiers(
-    int scancode)
-{
-    static int caps_down = 0,num_down = 0;
-
-    if (scancode & 0x80) {
-        /* Handle key-release function */
-        scancode &= 0x7F;
-        if (scancode == 0x2A || scancode == 0x36)
-            key_modifiers &= ~EVT_SHIFTKEY;
-        else if (scancode == 0x1D || scancode == 0x61)
-            key_modifiers &= ~EVT_CTRLSTATE;
-        else if (scancode == 0x38 || scancode == 0x64)
-            key_modifiers &= ~EVT_ALTSTATE;
-        else if (scancode == 0x3A)
-            caps_down = false;
-        else if (scancode == 0x45)
-            num_down = false;
-        }
-    else {
-        /* Handle key-down function */
-        scancode &= 0x7F;
-        if (scancode == 0x2A || scancode == 0x36)
-            key_modifiers |= EVT_SHIFTKEY;
-        else if (scancode == 0x1D || scancode == 0x61)
-            key_modifiers |= EVT_CTRLSTATE;
-        else if (scancode == 0x38 || scancode == 0x64)
-            key_modifiers |= EVT_ALTSTATE;
-        else if (scancode == 0x3A) {
-            if (!caps_down) {
-                key_modifiers ^= EVT_CAPSSTATE;
-                updateLEDStatus();
-                }
-            caps_down = true;
-            }
-        else if (scancode == 0x45) {
-            if (!num_down) {
-                key_modifiers ^= EVT_NUMSTATE;
-                updateLEDStatus();
-                }
-            num_down = true;
-            }
-        }
-}
-
-/***************************************************************************
-REMARKS:
-Returns the number of bits that have changed from 0 to 1
-(a negative value means the number of bits that have changed from 1 to 0) 
- **************************************************************************/
-static int compareBits(short a, short b)
-{
-    int ret = 0;
-    if( (a&1) != (b&1) ) ret += (b&1) ? 1 : -1;
-    if( (a&2) != (b&2) ) ret += (b&2) ? 1 : -1;
-    if( (a&4) != (b&4) ) ret += (b&4) ? 1 : -1;
-    return ret;
-}
-
-/***************************************************************************
-REMARKS:
-Turns off all keyboard state because we can't rely on them anymore as soon
-as we switch VT's
-***************************************************************************/
-static void keyboard_clearstate(void)
-{
-  key_modifiers = 0;
-  memset(key_down, 0, sizeof(key_down));
-}
-
-/****************************************************************************
-REMARKS:
-Pumps all events from the console event queue into the WinDirect event queue.
-****************************************************************************/
-static void pumpEvents(void)
-{
-    static uchar    buf[KBDREADBUFFERSIZE];
-    static char     data[5];
-    static int      old_buts, old_mx, old_my;
-    static struct timeval t;
-    fd_set fds;
-    int             numkeys,i;
-    int             dx, dy, buts;
-
-    /* Read all pending keypresses from keyboard buffer and process */
-    while ((numkeys = read(tty_fd, buf, KBDREADBUFFERSIZE)) > 0) {
-        for (i = 0; i < numkeys; i++) {
-            toggleModifiers(buf[i]);
-            if (key_modifiers & EVT_ALTSTATE){
-              int fkey = 0;
-
-              // Do VT switching here for Alt+Fx keypresses
-              switch(buf[i] & 0x7F){
-              case 59 ... 68: /* F1 to F10 */
-                fkey = (buf[i] & 0x7F) - 58;
-                break;
-              case 87: /* F11 */
-              case 88: /* F12 */
-                fkey = (buf[i] & 0x7F) - 76;
-                break;
-              }
-              if(fkey){
-                struct vt_stat vts;
-                ioctl(tty_fd, VT_GETSTATE, &vts);
-                
-                if(fkey != vts.v_active){
-                  keyboard_clearstate();
-                  ioctl(tty_fd, VT_ACTIVATE, fkey);
-                }
-              }
-            }
-
-            if (buf[i] & 0x80)
-                addKeyEvent(EVT_KEYUP,buf[i] & 0x7F);
-            else
-                addKeyEvent(EVT_KEYDOWN,buf[i] & 0x7F);
-            }
-
-        // TODO: If we want to handle VC switching we will need to do it
-        //       in here so that we can switch away from the VC and then
-        //       switch back to it later. Right now VC switching is disabled
-        //       and in order to enable it we need to save/restore the state
-        //       of the graphics screen (using the suspendAppCallback and
-        //       saving/restoring the state of the current display mode).
-
-        }
-
-    /* Read all pending mouse events and process them */
-    if(conn > 0){
-        FD_ZERO(&fds);
-        FD_SET(conn, &fds);
-        t.tv_sec = t.tv_usec = 0L;
-        while (select(conn+1, &fds, NULL, NULL, &t) > 0) {
-            if(read(conn, data, 5) == 5){
-                buts = (~data[0]) & 0x07;
-                dx = (char)(data[1]) + (char)(data[3]);
-                dy = -((char)(data[2]) + (char)(data[4]));
-                
-                mx += dx; my += dy;
-                
-                if (dx || dy)
-                    addMouseEvent(EVT_MOUSEMOVE, 0, mx, my, buts);
-                
-                if (buts != old_buts){
-                    int c = compareBits(buts,old_buts);
-                    if(c>0)
-                        addMouseEvent(EVT_MOUSEDOWN, 0, mx, my, buts);
-                    else if(c<0)
-                        addMouseEvent(EVT_MOUSEUP, 0, mx, my, buts);
-                }
-                old_mx = mx; old_my = my;
-                old_buts = buts;
-                FD_SET(conn, &fds);
-                t.tv_sec = t.tv_usec = 0L;
-            }
-        }
-    }
-}
-
-/*------------------------ Public interface routines ----------------------*/
-
-/****************************************************************************
-PARAMETERS:
-which       - Which code for event to post
-what        - Event code for event to post
-message     - Event message
-modifiers   - Shift key/mouse button modifiers
-
-RETURNS:
-True if the event was posted, false if queue is full.
-
-REMARKS:
-Posts an event to the event queue. This routine can be used to post any type
-of event into the queue.
-****************************************************************************/
-ibool _WDAPI WD_postEvent(
-    ulong which,
-    uint what,
-    ulong message,
-    ulong modifiers)
-{
-    WD_event    evt;
-
-    if (count < EVENTQSIZE) {
-        /* Save information in event record */
-        evt.which = which;
-        evt.what = what;
-        evt.when = getTimeStamp();
-        evt.message = message;
-        evt.modifiers = modifiers;
-        addEvent(&evt);             /* Add to tail of event queue   */
-        return true;
-        }
-    else
-        return false;
-}
-
-/****************************************************************************
-PARAMETERS:
-mask    - Event mask to use
-
-REMARKS:
-Flushes all the event specified in 'mask' from the event queue.
-****************************************************************************/
-void _WDAPI WD_flushEvent(
-    uint mask)
-{
-    WD_event    evt;
-
-    do {                            /* Flush all events */
-        WD_getEvent(&evt,mask);
-        } while (evt.what != EVT_NULLEVT);
-}
-
-/****************************************************************************
-PARAMETERS:
-evt     - Place to store event
-mask    - Event mask to use
-
-REMARKS:
-Halts program execution until a specified event occurs. The event is
-returned. All pending events not in the specified mask will be ignored and
-removed from the queue.
-****************************************************************************/
-void _WDAPI WD_haltEvent(
-    WD_event *evt,
-    uint mask)
-{
-    do {                            /* Wait for an event    */
-        WD_getEvent(evt,EVT_EVERYEVT);
-        } while (!(evt->what & mask));
-}
-
-/****************************************************************************
-PARAMETERS:
-evt     - Place to store event
-mask    - Event mask to use
-
-RETURNS:
-True if an event was pending.
-
-REMARKS:
-Retrieves the next pending event defined in 'mask' from the event queue.
-The event queue is adjusted to reflect the new state after the event has
-been removed.
-****************************************************************************/
-ibool _WDAPI WD_getEvent(
-    WD_event *evt,
-    uint mask)
-{
-    int     evtID,next,prev;
-
-    pumpEvents();
-    if (moveCursor)
-        moveCursor(mx,my);                  /* Move the mouse cursor    */
-    evt->what = EVT_NULLEVT;                /* Default to null event    */
-
-    if (count) {
-        for (evtID = head; evtID != -1; evtID = evtq[evtID].next) {
-            if (evtq[evtID].what & mask)
-                break;                      /* Found an event           */
-            }
-        if (evtID == -1)
-            return false;                   /* Event was not found      */
-        next = evtq[evtID].next;
-        prev = evtq[evtID].prev;
-        if (prev != -1)
-            evtq[prev].next = next;
-        else
-            head = next;
-        if (next != -1)
-            evtq[next].prev = prev;
-        else
-            tail = prev;
-        *evt = evtq[evtID];                 /* Return the event         */
-        evtq[evtID].next = freeHead;        /* and return to free list  */
-        freeHead = evtID;
-        count--;
-        if (evt->what == EVT_MOUSEMOVE)
-            oldMove = -1;
-        if (evt->what == EVT_KEYREPEAT)
-            oldKey = -1;
-        }
-    return evt->what != EVT_NULLEVT;
-}
-
-/****************************************************************************
-PARAMETERS:
-evt     - Place to store event
-mask    - Event mask to use
-
-RETURNS:
-True if an event is pending.
-
-REMARKS:
-Peeks at the next pending event defined in 'mask' in the event queue. The
-event is not removed from the event queue.
-****************************************************************************/
-ibool _WDAPI WD_peekEvent(
-    WD_event *evt,
-    uint mask)
-{
-    int     evtID;
-
-    pumpEvents();
-    if (moveCursor)
-        moveCursor(mx,my);                  /* Move the mouse cursor    */
-    evt->what = EVT_NULLEVT;                /* Default to null event    */
-
-    if (count) {
-        for (evtID = head; evtID != -1; evtID = evtq[evtID].next) {
-            if (evtq[evtID].what & mask)
-                break;                      /* Found an event           */
-            }
-        if (evtID == -1)
-            return false;                   /* Event was not found      */
-
-        *evt = evtq[evtID];                 /* Return the event         */
-        }
-    return evt->what != EVT_NULLEVT;
-}
-
-/****************************************************************************
-PARAMETERS:
-hwndMain    - Handle to main window
-_xRes       - X resolution of graphics mode to be used
-_yRes       - Y resolulion of graphics mode to be used
-
-RETURNS:
-Handle to the fullscreen event window if (we return hwndMain on Linux)
-
-REMARKS:
-Initiliase the event handling module. Here we install our mouse handling
-ISR to be called whenever any button's are pressed or released. We also
-build the free list of events in the event queue.
-****************************************************************************/
-WD_HWND _WDAPI WD_startFullScreen(
-    WD_HWND hwndMain,
-    int _xRes,
-    int _yRes)
-{
-    int             i;
-    struct termios  conf;
-    if (!installed) {
-        Gpm_Connect gpm;
-
-        /* Build free list, and initialise global data structures */
-        for (i = 0; i < EVENTQSIZE; i++)
-            evtq[i].next = i+1;
-        evtq[EVENTQSIZE-1].next = -1;       /* Terminate list           */
-        count = freeHead = 0;
-        head = tail = -1;
-        oldMove = -1;
-        oldKey = -1;
-        xRes = _xRes;
-        yRes = _yRes;
-
-        /* Open the console device and initialise it for raw mode */
-        tty_fd = PM_openConsole();
-
-        /* Wait until virtual terminal is active and take over control */
-        wait_vt_active();
-        take_vt_control();
-
-        /* Initialise keyboard handling to raw mode */
-        if (ioctl(tty_fd, KDGKBMODE, &oldkbmode)) {
-            printf("WD_startFullScreen: cannot get keyboard mode.\n");
-            exit(-1);
-            }
-        old_flags = fcntl(tty_fd,F_GETFL);
-        fcntl(tty_fd,F_SETFL,old_flags |= O_NONBLOCK);
-        tcgetattr(tty_fd, &conf);
-        old_conf = conf;
-        conf.c_lflag &= ~(ICANON | ECHO | ECHOE | ECHOK | ECHONL | NOFLSH | ISIG);
-        conf.c_iflag &= ~(ISTRIP | IGNCR | ICRNL | INLCR | BRKINT | PARMRK | INPCK | IUCLC | IXON | IXOFF);
-        conf.c_iflag  |= (IGNBRK | IGNPAR);
-        conf.c_cc[VMIN] = 1;
-        conf.c_cc[VTIME] = 0;
-        conf.c_cc[VSUSP] = 0;
-        tcsetattr(tty_fd, TCSAFLUSH, &conf);
-        ioctl(tty_fd, KDSKBMODE, K_MEDIUMRAW);
-
-        /* Clear the keyboard state information */
-        memset(key_down, 0, sizeof(key_down));
-        ioctl(tty_fd,KDSETLED,key_modifiers = 0);
-
-        /* Initialize the mouse connection 
-           The user *MUST* run gpm with the  option -R for this to work (or have a MouseSystems mouse)
-        */
-        if(Gpm_Open(&gpm,0) > 0){ /* GPM available */
-            if ((conn = open(GPM_NODE_FIFO,O_RDONLY|O_SYNC)) < 0)
-                fprintf(stderr,"WD_startFullScreen: Can't open mouse connection.\n");
-        }else{
-            fprintf(stderr,"Warning: when not using gpm -R, only MouseSystems mice are currently supported.\n");
-            if ((conn = open("/dev/mouse",O_RDONLY|O_SYNC)) < 0)
-                fprintf(stderr,"WD_startFullScreen: Can't open /dev/mouse.\n");
-        }
-        Gpm_Close();
-
-        /* TODO: Scale the mouse coordinates to the specific resolution */
-
-        /* Save the state of the console */
-        if ((stateBuf = malloc(PM_getConsoleStateSize())) == NULL) {
-            printf("Out of memory!\n");
-            exit(-1);
-            }
-        PM_saveConsoleState(stateBuf,tty_fd);
-        initmode = VBE_getVideoMode();
-
-        /* Initialize the signal handler for timer events */
-        signal(SIGALRM, timerHandler);
-
-        /* Capture termination signals so we can clean up properly */
-        signal(SIGTERM, exitHandler);
-        signal(SIGINT, exitHandler);
-        signal(SIGQUIT, exitHandler);
-        atexit(restore_term);
-
-        /* Signal that we are installed */
-        installed = true;
-        }
-    return hwndMain;
-}
-
-/****************************************************************************
-REMARKS:
-Lets the library know when fullscreen graphics mode has been initialized so
-that we can properly scale the mouse driver coordinates.
-****************************************************************************/
-void _WDAPI WD_inFullScreen(void)
-{
-    /* Nothing to do in here */
-}
-
-/****************************************************************************
-REMARKS:
-Suspends all of our event handling operations. This is also used to
-de-install the event handling code.
-****************************************************************************/
-void _WDAPI WD_restoreGDI(void)
-{
-    restore_term();
-}
-
-/****************************************************************************
-PARAMETERS:
-ticks   - Number of ticks between timer tick messages
-
-RETURNS:
-Previous value for the timer tick event spacing.
-
-REMARKS:
-The event module will automatically generate periodic timer tick events for
-you, with 'ticks' between each event posting. If you set the value of
-'ticks' to 0, the timer tick events are turned off.
-****************************************************************************/
-int _WDAPI WD_setTimerTick(
-    int ticks)
-{
-    int                 old;
-    struct itimerval    tim;
-    long                ms = TICKS_TO_USEC(ticks);
-
-    getitimer(ITIMER_REAL, &tim);
-    old = USEC_TO_TICKS(tim.it_value.tv_sec*1000000.0 + tim.it_value.tv_usec);
-    tim.it_interval.tv_sec  = ms / 1000000;
-    tim.it_interval.tv_usec = ms % 1000000;
-    setitimer(ITIMER_REAL, &tim, NULL);
-    return old;
-}
-
-/****************************************************************************
-PARAMETERS:
-saveState   - Address of suspend app callback to register
-
-REMARKS:
-Registers a user application supplied suspend application callback so that
-we can properly handle virtual terminal switching.
-****************************************************************************/
-void _WDAPI WD_setSuspendAppCallback(
-    int (_ASMAPI *saveState)(int flags))
-{
-  suspendAppCallback = saveState;
-}
-
-/****************************************************************************
-PARAMETERS:
-x   - New X coordinate to move the mouse cursor to
-y   - New Y coordinate to move the mouse cursor to
-
-REMARKS:
-Moves to mouse cursor to the specified coordinate.
-****************************************************************************/
-void _WDAPI WD_setMousePos(
-    int x,
-    int y)
-{
-    mx = x;
-    my = y;
-}
-
-/****************************************************************************
-PARAMETERS:
-x   - Place to store X coordinate of mouse cursor
-y   - Place to store Y coordinate of mouse cursor
-
-REMARKS:
-Reads the current mouse cursor location int *screen* coordinates.
-****************************************************************************/
-void _WDAPI WD_getMousePos(
-    int *x,
-    int *y)
-{
-    *x = mx;
-    *y = my;
-}
-
-/****************************************************************************
-PARAMETERS:
-mcb - Address of mouse callback function
-
-REMARKS:
-Registers an application supplied mouse callback function that is called
-whenever the mouse cursor moves.
-****************************************************************************/
-void _WDAPI WD_setMouseCallback(
-    void (_ASMAPI *mcb)(int x,int y))
-{
-    moveCursor = mcb;
-}
-
-/****************************************************************************
-PARAMETERS:
-xRes    - New X resolution of graphics mode
-yRes    - New Y resolution of graphics mode
-
-REMARKS:
-This is called to inform the event handling code that the screen resolution
-has changed so that the mouse coordinates can be scaled appropriately.
-****************************************************************************/
-void _WDAPI WD_changeResolution(
-    int xRes,
-    int yRes)
-{
-    //  Gpm_FitValues(xRes, yRes);  // ??
-}
-
-/****************************************************************************
-PARAMETERS:
-scancode    - Scan code to check if a key is down
-
-REMARKS:
-Determines if a particular key is down based on the scan code for the key.
-****************************************************************************/
-ibool _WDAPI WD_isKeyDown(
-    uchar scancode)
-{   
-    return key_down[scancode];
-}
-
-/****************************************************************************
-REMARKS:
-Determines if the application needs to run in safe mode. Not necessary for
-anything but broken Windows 95 display drivers so we return false for
-Linux.
-****************************************************************************/
-int _WDAPI WD_isSafeMode(void)
-{
-    return false;
-}
-
-
diff --git a/board/MAI/bios_emulator/scitech/src/pm/linux/oshdr.h b/board/MAI/bios_emulator/scitech/src/pm/linux/oshdr.h
deleted file mode 100644 (file)
index eadedfb..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech Multi-platform Graphics Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Linux
-*
-* Description:  Include all the OS specific header files.
-*
-****************************************************************************/
-
-#include <fcntl.h>
-#include <sys/time.h>
-#include <sys/ioctl.h>
-#include <sys/stat.h>
-#include <time.h>
-#include <linux/keyboard.h>
-#include <linux/kd.h>
-#include <linux/vt.h>
-#include <linux/fs.h>
-#ifdef USE_OS_JOYSTICK
-#include <linux/joystick.h>
-#endif
-#include <termios.h>
-#include <signal.h>
-#include <unistd.h>
-#include <ctype.h>
-#include <stdlib.h>
-
-/* Internal global variables */
-
-extern int _PM_console_fd,_PM_leds,_PM_modifiers;
-
-/* Internal function prototypes */
-
-void _PM_restore_kb_mode(void);
-void _PM_keyboard_rawmode(void);
-
-/* Linux needs the generic joystick scaling code */
-
-#define NEED_SCALE_JOY_AXIS
diff --git a/board/MAI/bios_emulator/scitech/src/pm/linux/pm.c b/board/MAI/bios_emulator/scitech/src/pm/linux/pm.c
deleted file mode 100644 (file)
index c12a835..0000000
+++ /dev/null
@@ -1,1809 +0,0 @@
-;/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-*                   Portions copyright (C) Josh Vanderhoof
-*
-* Language:     ANSI C
-* Environment:  Linux
-*
-* Description:  Implementation for the OS Portability Manager Library, which
-*               contains functions to implement OS specific services in a
-*               generic, cross platform API. Porting the OS Portability
-*               Manager library is the first step to porting any SciTech
-*               products to a new platform.
-*
-****************************************************************************/
-
-#include "pmapi.h"
-#include "drvlib/os/os.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/mman.h>
-#include <sys/kd.h>
-#include <sys/ioctl.h>
-#include <sys/stat.h>
-#include <sys/vt.h>
-#include <sys/wait.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <unistd.h>
-#include <termios.h>
-#include <fcntl.h>
-#include <syscall.h>
-#include <signal.h>
-#include <time.h>
-#include <ctype.h>
-#include <errno.h>
-#include <asm/io.h>
-#include <asm/types.h>
-#ifdef ENABLE_MTRR
-#include <asm/mtrr.h>
-#endif
-#include <asm/vm86.h>
-#ifdef __GLIBC__
-#include <sys/perm.h>
-#endif
-
-/*--------------------------- Global variables ----------------------------*/
-
-#define REAL_MEM_BASE       ((void *)0x10000)
-#define REAL_MEM_SIZE       0x10000
-#define REAL_MEM_BLOCKS     0x100
-#define DEFAULT_VM86_FLAGS  (IF_MASK | IOPL_MASK)
-#define DEFAULT_STACK_SIZE  0x1000
-#define RETURN_TO_32_INT    255
-
-/* Quick and dirty fix for vm86() syscall from lrmi 0.6 */
-static int
-vm86(struct vm86_struct *vm)
-    {
-    int r;
-#ifdef __PIC__
-    asm volatile (
-     "pushl %%ebx\n\t"
-     "movl %2, %%ebx\n\t"
-     "int $0x80\n\t"
-     "popl %%ebx"
-     : "=a" (r)
-     : "0" (113), "r" (vm));
-#else
-    asm volatile (
-     "int $0x80"
-     : "=a" (r)
-     : "0" (113), "b" (vm));
-#endif
-    return r;
-    }
-
-
-static struct {
-    int                 ready;
-    unsigned short      ret_seg, ret_off;
-    unsigned short      stack_seg, stack_off;
-    struct vm86_struct  vm;
-    } context = {0};
-
-struct mem_block {
-    unsigned int size : 20;
-    unsigned int free : 1;
-    };
-
-static struct {
-    int ready;
-    int count;
-    struct mem_block blocks[REAL_MEM_BLOCKS];
-    } mem_info = {0};
-
-int                     _PM_console_fd = -1;
-int                     _PM_leds = 0,_PM_modifiers = 0;
-static ibool            inited = false;
-static int              tty_vc = 0;
-static int              console_count = 0;
-static int              startup_vc;
-static int              fd_mem = 0;
-static ibool            in_raw_mode = false;
-#ifdef ENABLE_MTRR
-static int              mtrr_fd;
-#endif
-static uint VESABuf_len = 1024;     /* Length of the VESABuf buffer     */
-static void *VESABuf_ptr = NULL;    /* Near pointer to VESABuf          */
-static uint VESABuf_rseg;           /* Real mode segment of VESABuf     */
-static uint VESABuf_roff;           /* Real mode offset of VESABuf      */
-#ifdef TRACE_IO
-static ulong            traceAddr;
-#endif
-
-static void (PMAPIP fatalErrorCleanup)(void) = NULL;
-
-/*----------------------------- Implementation ----------------------------*/
-
-#ifdef  TRACE_IO
-extern void printk(char *msg,...);
-#endif
-
-static inline void port_out(int value, int port)
-{
-#ifdef TRACE_IO
-    printk("%04X:%04X: outb.%04X <- %02X\n", traceAddr >> 16, traceAddr & 0xFFFF, (ushort)port, (uchar)value);
-#endif
-    asm volatile ("outb %0,%1"
-         ::"a" ((unsigned char) value), "d"((unsigned short) port));
-}
-
-static inline void port_outw(int value, int port)
-{
-#ifdef TRACE_IO
-    printk("%04X:%04X: outw.%04X <- %04X\n", traceAddr >> 16,traceAddr & 0xFFFF, (ushort)port, (ushort)value);
-#endif
-    asm volatile ("outw %0,%1"
-        ::"a" ((unsigned short) value), "d"((unsigned short) port));
-}
-
-static inline void port_outl(int value, int port)
-{
-#ifdef TRACE_IO
-    printk("%04X:%04X: outl.%04X <- %08X\n", traceAddr >> 16,traceAddr & 0xFFFF, (ushort)port, (ulong)value);
-#endif
-    asm volatile ("outl %0,%1"
-        ::"a" ((unsigned long) value), "d"((unsigned short) port));
-}
-
-static inline unsigned int port_in(int port)
-{
-    unsigned char value;
-    asm volatile ("inb %1,%0"
-             :"=a" ((unsigned char)value)
-             :"d"((unsigned short) port));
-#ifdef TRACE_IO
-    printk("%04X:%04X:  inb.%04X -> %02X\n", traceAddr >> 16,traceAddr & 0xFFFF, (ushort)port, (uchar)value);
-#endif
-    return value;
-}
-
-static inline unsigned int port_inw(int port)
-{
-    unsigned short value;
-    asm volatile ("inw %1,%0"
-             :"=a" ((unsigned short)value)
-             :"d"((unsigned short) port));
-#ifdef TRACE_IO
-    printk("%04X:%04X:  inw.%04X -> %04X\n", traceAddr >> 16,traceAddr & 0xFFFF, (ushort)port, (ushort)value);
-#endif
-    return value;
-}
-
-static inline unsigned int port_inl(int port)
-{
-    unsigned long value;
-    asm volatile ("inl %1,%0"
-             :"=a" ((unsigned long)value)
-             :"d"((unsigned short) port));
-#ifdef TRACE_IO
-    printk("%04X:%04X:  inl.%04X -> %08X\n", traceAddr >> 16,traceAddr & 0xFFFF, (ushort)port, (ulong)value);
-#endif
-    return value;
-}
-
-static int real_mem_init(void)
-{
-    void    *m;
-    int     fd_zero;
-
-    if (mem_info.ready)
-       return 1;
-
-    if ((fd_zero = open("/dev/zero", O_RDONLY)) == -1)
-       PM_fatalError("You must have root privledges to run this program!");
-    if ((m = mmap((void *)REAL_MEM_BASE, REAL_MEM_SIZE,
-           PROT_READ | PROT_WRITE | PROT_EXEC,
-           MAP_FIXED | MAP_PRIVATE, fd_zero, 0)) == (void *)-1) {
-       close(fd_zero);
-       PM_fatalError("You must have root privledges to run this program!");
-       }
-    mem_info.ready = 1;
-    mem_info.count = 1;
-    mem_info.blocks[0].size = REAL_MEM_SIZE;
-    mem_info.blocks[0].free = 1;
-    return 1;
-}
-
-static void insert_block(int i)
-{
-    memmove(
-       mem_info.blocks + i + 1,
-       mem_info.blocks + i,
-       (mem_info.count - i) * sizeof(struct mem_block));
-    mem_info.count++;
-}
-
-static void delete_block(int i)
-{
-    mem_info.count--;
-
-    memmove(
-       mem_info.blocks + i,
-       mem_info.blocks + i + 1,
-       (mem_info.count - i) * sizeof(struct mem_block));
-}
-
-static inline void set_bit(unsigned int bit, void *array)
-{
-    unsigned char *a = array;
-    a[bit / 8] |= (1 << (bit % 8));
-}
-
-static inline unsigned int get_int_seg(int i)
-{
-    return *(unsigned short *)(i * 4 + 2);
-}
-
-static inline unsigned int get_int_off(int i)
-{
-    return *(unsigned short *)(i * 4);
-}
-
-static inline void pushw(unsigned short i)
-{
-    struct vm86_regs *r = &context.vm.regs;
-    r->esp -= 2;
-    *(unsigned short *)(((unsigned int)r->ss << 4) + r->esp) = i;
-}
-
-ibool PMAPI PM_haveBIOSAccess(void)
-{ return true; }
-
-void PMAPI PM_init(void)
-{
-    void    *m;
-    uint    r_seg,r_off;
-
-    if (inited)
-       return;
-
-    /* Map the Interrupt Vectors (0x0 - 0x400) + BIOS data (0x400 - 0x502)
-     * and the physical framebuffer and ROM images from (0xa0000 - 0x100000)
-     */
-    real_mem_init();
-    if (!fd_mem && (fd_mem = open("/dev/mem", O_RDWR)) == -1) {
-       PM_fatalError("You must have root privileges to run this program!");
-       }
-    if ((m = mmap((void *)0, 0x502,
-           PROT_READ | PROT_WRITE | PROT_EXEC,
-           MAP_FIXED | MAP_PRIVATE, fd_mem, 0)) == (void *)-1) {
-       PM_fatalError("You must have root privileges to run this program!");
-       }
-    if ((m = mmap((void *)0xA0000, 0xC0000 - 0xA0000,
-           PROT_READ | PROT_WRITE,
-           MAP_FIXED | MAP_SHARED, fd_mem, 0xA0000)) == (void *)-1) {
-       PM_fatalError("You must have root privileges to run this program!");
-       }
-    if ((m = mmap((void *)0xC0000, 0xD0000 - 0xC0000,
-           PROT_READ | PROT_WRITE | PROT_EXEC,
-           MAP_FIXED | MAP_PRIVATE, fd_mem, 0xC0000)) == (void *)-1) {
-       PM_fatalError("You must have root privileges to run this program!");
-       }
-    if ((m = mmap((void *)0xD0000, 0x100000 - 0xD0000,
-           PROT_READ | PROT_WRITE,
-           MAP_FIXED | MAP_SHARED, fd_mem, 0xD0000)) == (void *)-1) {
-       PM_fatalError("You must have root privileges to run this program!");
-       }
-    inited = 1;
-
-    /* Allocate a stack */
-    m = PM_allocRealSeg(DEFAULT_STACK_SIZE,&r_seg,&r_off);
-    context.stack_seg = r_seg;
-    context.stack_off = r_off+DEFAULT_STACK_SIZE;
-
-    /* Allocate the return to 32 bit routine */
-    m = PM_allocRealSeg(2,&r_seg,&r_off);
-    context.ret_seg = r_seg;
-    context.ret_off = r_off;
-    ((uchar*)m)[0] = 0xCD;         /* int opcode */
-    ((uchar*)m)[1] = RETURN_TO_32_INT;
-    memset(&context.vm, 0, sizeof(context.vm));
-
-    /* Enable kernel emulation of all ints except RETURN_TO_32_INT */
-    memset(&context.vm.int_revectored, 0, sizeof(context.vm.int_revectored));
-    set_bit(RETURN_TO_32_INT, &context.vm.int_revectored);
-    context.ready = 1;
-#ifdef ENABLE_MTRR
-    mtrr_fd =  open("/dev/cpu/mtrr", O_RDWR, 0);
-    if (mtrr_fd < 0)
-       mtrr_fd =  open("/proc/mtrr", O_RDWR, 0);
-#endif
-    /* Enable I/O permissions to directly access I/O ports. We break the
-     * allocation into two parts, one for the ports from 0-0x3FF and
-     * another for the remaining ports up to 0xFFFF. Standard Linux kernels
-     * only allow the first 0x400 ports to be enabled, so to enable all
-     * 65536 ports you need a patched kernel that will enable the full
-     * 8Kb I/O permissions bitmap.
-     */
-#ifndef TRACE_IO
-    ioperm(0x0,0x400,1);
-    ioperm(0x400,0x10000-0x400,1);
-#endif
-    iopl(3);
-}
-
-long PMAPI PM_getOSType(void)
-{ return _OS_LINUX; }
-
-int PMAPI PM_getModeType(void)
-{ return PM_386; }
-
-void PMAPI PM_backslash(char *s)
-{
-    uint pos = strlen(s);
-    if (s[pos-1] != '/') {
-       s[pos] = '/';
-       s[pos+1] = '\0';
-       }
-}
-
-void PMAPI PM_setFatalErrorCleanup(
-    void (PMAPIP cleanup)(void))
-{
-    fatalErrorCleanup = cleanup;
-}
-
-void PMAPI PM_fatalError(const char *msg)
-{
-    if (fatalErrorCleanup)
-       fatalErrorCleanup();
-    fprintf(stderr,"%s\n", msg);
-    fflush(stderr);
-    exit(1);
-}
-
-static void ExitVBEBuf(void)
-{
-    if (VESABuf_ptr)
-       PM_freeRealSeg(VESABuf_ptr);
-    VESABuf_ptr = 0;
-}
-
-void * PMAPI PM_getVESABuf(uint *len,uint *rseg,uint *roff)
-{
-    if (!VESABuf_ptr) {
-       /* Allocate a global buffer for communicating with the VESA VBE */
-       if ((VESABuf_ptr = PM_allocRealSeg(VESABuf_len, &VESABuf_rseg, &VESABuf_roff)) == NULL)
-           return NULL;
-       atexit(ExitVBEBuf);
-       }
-    *len = VESABuf_len;
-    *rseg = VESABuf_rseg;
-    *roff = VESABuf_roff;
-    return VESABuf_ptr;
-}
-
-/* New raw console based getch and kbhit functions */
-
-#define KB_CAPS     LED_CAP /* 4 */
-#define KB_NUMLOCK  LED_NUM /* 2 */
-#define KB_SCROLL   LED_SCR /* 1 */
-#define KB_SHIFT    8
-#define KB_CONTROL  16
-#define KB_ALT      32
-
-/* Structure used to save the keyboard mode to disk. We save it to disk
- * so that we can properly restore the mode later if the program crashed.
- */
-
-typedef struct {
-    struct termios  termios;
-    int             kb_mode;
-    int             leds;
-    int             flags;
-    int             startup_vc;
-    } keyboard_mode;
-
-/* Name of the file used to save keyboard mode information */
-
-#define KBMODE_DAT  "kbmode.dat"
-
-/****************************************************************************
-REMARKS:
-Open the keyboard mode file on disk.
-****************************************************************************/
-static FILE *open_kb_mode(
-    char *mode,
-    char *path)
-{
-    if (!PM_findBPD("graphics.bpd",path))
-       return NULL;
-    PM_backslash(path);
-    strcat(path,KBMODE_DAT);
-    return fopen(path,mode);
-}
-
-/****************************************************************************
-REMARKS:
-Restore the keyboard to normal mode
-****************************************************************************/
-void _PM_restore_kb_mode(void)
-{
-    FILE            *kbmode;
-    keyboard_mode   mode;
-    char            path[PM_MAX_PATH];
-
-    if (_PM_console_fd != -1 && (kbmode = open_kb_mode("rb",path)) != NULL) {
-       if (fread(&mode,1,sizeof(mode),kbmode) == sizeof(mode)) {
-           if (mode.startup_vc > 0)
-               ioctl(_PM_console_fd, VT_ACTIVATE, mode.startup_vc);
-           ioctl(_PM_console_fd, KDSKBMODE, mode.kb_mode);
-           ioctl(_PM_console_fd, KDSETLED, mode.leds);
-           tcsetattr(_PM_console_fd, TCSAFLUSH, &mode.termios);
-           fcntl(_PM_console_fd,F_SETFL,mode.flags);
-           }
-       fclose(kbmode);
-       unlink(path);
-       in_raw_mode = false;
-       }
-}
-
-/****************************************************************************
-REMARKS:
-Safely abort the event module upon catching a fatal error.
-****************************************************************************/
-void _PM_abort(
-    int signo)
-{
-    char    buf[80];
-
-    sprintf(buf,"Terminating on signal %d",signo);
-    _PM_restore_kb_mode();
-    PM_fatalError(buf);
-}
-
-/****************************************************************************
-REMARKS:
-Put the keyboard into raw mode
-****************************************************************************/
-void _PM_keyboard_rawmode(void)
-{
-    struct termios conf;
-    FILE            *kbmode;
-    keyboard_mode   mode;
-    char            path[PM_MAX_PATH];
-    int             i;
-    static int sig_list[] = {
-       SIGHUP,
-       SIGINT,
-       SIGQUIT,
-       SIGILL,
-       SIGTRAP,
-       SIGABRT,
-       SIGIOT,
-       SIGBUS,
-       SIGFPE,
-       SIGKILL,
-       SIGSEGV,
-       SIGTERM,
-       };
-
-    if ((kbmode = open_kb_mode("rb",path)) == NULL) {
-       if ((kbmode = open_kb_mode("wb",path)) == NULL)
-           PM_fatalError("Unable to open kbmode.dat file for writing!");
-       if (ioctl(_PM_console_fd, KDGKBMODE, &mode.kb_mode))
-           perror("KDGKBMODE");
-       ioctl(_PM_console_fd, KDGETLED, &mode.leds);
-       _PM_leds = mode.leds & 0xF;
-       _PM_modifiers = 0;
-       tcgetattr(_PM_console_fd, &mode.termios);
-       conf = mode.termios;
-       conf.c_lflag &= ~(ICANON | ECHO | ISIG);
-       conf.c_iflag &= ~(ISTRIP | IGNCR | ICRNL | INLCR | BRKINT | PARMRK | INPCK | IUCLC | IXON | IXOFF);
-       conf.c_iflag  |= (IGNBRK | IGNPAR);
-       conf.c_cc[VMIN] = 1;
-       conf.c_cc[VTIME] = 0;
-       conf.c_cc[VSUSP] = 0;
-       tcsetattr(_PM_console_fd, TCSAFLUSH, &conf);
-       mode.flags = fcntl(_PM_console_fd,F_GETFL);
-       if (ioctl(_PM_console_fd, KDSKBMODE, K_MEDIUMRAW))
-           perror("KDSKBMODE");
-       atexit(_PM_restore_kb_mode);
-       for (i = 0; i < sizeof(sig_list)/sizeof(sig_list[0]); i++)
-           signal(sig_list[i], _PM_abort);
-       mode.startup_vc = startup_vc;
-       if (fwrite(&mode,1,sizeof(mode),kbmode) != sizeof(mode))
-           PM_fatalError("Error writing kbmode.dat!");
-       fclose(kbmode);
-       in_raw_mode = true;
-       }
-}
-
-int PMAPI PM_kbhit(void)
-{
-    fd_set s;
-    struct timeval tv = { 0, 0 };
-
-    if (console_count == 0)
-       PM_fatalError("You *must* open a console before using PM_kbhit!");
-    if (!in_raw_mode)
-       _PM_keyboard_rawmode();
-    FD_ZERO(&s);
-    FD_SET(_PM_console_fd, &s);
-    return select(_PM_console_fd+1, &s, NULL, NULL, &tv) > 0;
-}
-
-int PMAPI PM_getch(void)
-{
-    static uchar    c;
-    int release;
-    static struct kbentry ke;
-
-    if (console_count == 0)
-       PM_fatalError("You *must* open a console before using PM_getch!");
-    if (!in_raw_mode)
-       _PM_keyboard_rawmode();
-    while (read(_PM_console_fd, &c, 1) > 0) {
-       release = c & 0x80;
-       c &= 0x7F;
-       if (release) {
-           switch(c){
-               case 42: case 54: /* Shift */
-                   _PM_modifiers &= ~KB_SHIFT;
-                   break;
-               case 29: case 97: /* Control */
-                   _PM_modifiers &= ~KB_CONTROL;
-                   break;
-               case 56: case 100: /* Alt / AltGr */
-                   _PM_modifiers &= ~KB_ALT;
-                   break;
-               }
-           continue;
-           }
-       switch (c) {
-           case 42: case 54: /* Shift */
-               _PM_modifiers |= KB_SHIFT;
-                break;
-           case 29: case 97: /* Control */
-               _PM_modifiers |= KB_CONTROL;
-               break;
-           case 56: case 100: /* Alt / AltGr */
-               _PM_modifiers |= KB_ALT;
-               break;
-           case 58: /* Caps Lock */
-               _PM_modifiers ^= KB_CAPS;
-               ioctl(_PM_console_fd, KDSETLED, _PM_modifiers & 7);
-               break;
-           case 69: /* Num Lock */
-               _PM_modifiers ^= KB_NUMLOCK;
-               ioctl(_PM_console_fd, KDSETLED, _PM_modifiers & 7);
-               break;
-           case 70: /* Scroll Lock */
-               _PM_modifiers ^= KB_SCROLL;
-               ioctl(_PM_console_fd, KDSETLED, _PM_modifiers & 7);
-               break;
-           case 28:
-               return 0x1C;
-           default:
-               ke.kb_index = c;
-               ke.kb_table = 0;
-               if ((_PM_modifiers & KB_SHIFT) || (_PM_modifiers & KB_CAPS))
-                   ke.kb_table |= K_SHIFTTAB;
-               if (_PM_modifiers & KB_ALT)
-                   ke.kb_table |= K_ALTTAB;
-               ioctl(_PM_console_fd, KDGKBENT, (ulong)&ke);
-               c = ke.kb_value & 0xFF;
-               return c;
-           }
-       }
-    return 0;
-}
-
-/****************************************************************************
-REMARKS:
-Sleep until the virtual terminal is active
-****************************************************************************/
-static void wait_vt_active(
-    int _PM_console_fd)
-{
-    while (ioctl(_PM_console_fd, VT_WAITACTIVE, tty_vc) < 0) {
-       if ((errno != EAGAIN) && (errno != EINTR)) {
-           perror("ioctl(VT_WAITACTIVE)");
-           exit(1);
-           }
-       usleep(150000);
-       }
-}
-
-/****************************************************************************
-REMARKS:
-Checks the owner of the specified virtual console.
-****************************************************************************/
-static int check_owner(
-    int vc)
-{
-    struct stat sbuf;
-    char fname[30];
-
-    sprintf(fname, "/dev/tty%d", vc);
-    if ((stat(fname, &sbuf) >= 0) && (getuid() == sbuf.st_uid))
-       return 1;
-    printf("You must be the owner of the current console to use this program.\n");
-    return 0;
-}
-
-/****************************************************************************
-REMARKS:
-Checks if the console is currently in graphics mode, and if so we forcibly
-restore it back to text mode again. This handles the case when a Nucleus or
-MGL program crashes and leaves the console in graphics mode. Running the
-textmode utility (or any other Nucleus/MGL program) via a telnet session
-into the machine will restore it back to normal.
-****************************************************************************/
-static void restore_text_console(
-    int console_id)
-{
-    if (ioctl(console_id, KDSETMODE, KD_TEXT) < 0)
-       LOGWARN("ioctl(KDSETMODE) failed");
-    _PM_restore_kb_mode();
-}
-
-/****************************************************************************
-REMARKS:
-Opens up the console device for output by finding an appropriate virutal
-console that we can run on.
-****************************************************************************/
-PM_HWND PMAPI PM_openConsole(
-    PM_HWND hwndUser,
-    int device,
-    int xRes,
-    int yRes,
-    int bpp,
-    ibool fullScreen)
-{
-    struct vt_mode  vtm;
-    struct vt_stat  vts;
-    struct stat     sbuf;
-    char            fname[30];
-
-    /* Check if we have already opened the console */
-    if (console_count++)
-       return _PM_console_fd;
-
-    /* Now, it would be great if we could use /dev/tty and see what it is
-     * connected to. Alas, we cannot find out reliably what VC /dev/tty is
-     * bound to. Thus we parse stdin through stderr for a reliable VC.
-     */
-    startup_vc = 0;
-    for (_PM_console_fd = 0; _PM_console_fd < 3; _PM_console_fd++) {
-       if (fstat(_PM_console_fd, &sbuf) < 0)
-           continue;
-       if (ioctl(_PM_console_fd, VT_GETMODE, &vtm) < 0)
-           continue;
-       if ((sbuf.st_rdev & 0xFF00) != 0x400)
-           continue;
-       if (!(sbuf.st_rdev & 0xFF))
-           continue;
-       tty_vc = sbuf.st_rdev & 0xFF;
-       restore_text_console(_PM_console_fd);
-       return _PM_console_fd;
-       }
-    if ((_PM_console_fd = open("/dev/console", O_RDWR)) < 0) {
-       printf("open_dev_console: can't open /dev/console \n");
-       exit(1);
-       }
-    if (ioctl(_PM_console_fd, VT_OPENQRY, &tty_vc) < 0)
-       goto Error;
-    if (tty_vc <= 0)
-       goto Error;
-    sprintf(fname, "/dev/tty%d", tty_vc);
-    close(_PM_console_fd);
-
-    /* Change our control terminal */
-    setsid();
-
-    /* We must use RDWR to allow for output... */
-    if (((_PM_console_fd = open(fname, O_RDWR)) >= 0) &&
-           (ioctl(_PM_console_fd, VT_GETSTATE, &vts) >= 0)) {
-       if (!check_owner(vts.v_active))
-           goto Error;
-       restore_text_console(_PM_console_fd);
-
-       /* Success, redirect all stdios */
-       fflush(stdin);
-       fflush(stdout);
-       fflush(stderr);
-       close(0);
-       close(1);
-       close(2);
-       dup(_PM_console_fd);
-       dup(_PM_console_fd);
-       dup(_PM_console_fd);
-
-       /* clear screen and switch to it */
-       fwrite("\e[H\e[J", 6, 1, stderr);
-       fflush(stderr);
-       if (tty_vc != vts.v_active) {
-           startup_vc = vts.v_active;
-           ioctl(_PM_console_fd, VT_ACTIVATE, tty_vc);
-           wait_vt_active(_PM_console_fd);
-           }
-       }
-    return _PM_console_fd;
-
-Error:
-    if (_PM_console_fd > 2)
-       close(_PM_console_fd);
-    console_count = 0;
-    PM_fatalError(
-       "Not running in a graphics capable console,\n"
-       "and unable to find one.\n");
-    return -1;
-}
-
-#define FONT_C  0x10000     /* 64KB for font data                       */
-
-/****************************************************************************
-REMARKS:
-Returns the size of the console state buffer.
-****************************************************************************/
-int PMAPI PM_getConsoleStateSize(void)
-{
-    if (!inited)
-       PM_init();
-    return PM_getVGAStateSize() + FONT_C*2;
-}
-
-/****************************************************************************
-REMARKS:
-Save the state of the Linux console.
-****************************************************************************/
-void PMAPI PM_saveConsoleState(void *stateBuf,int console_id)
-{
-    uchar   *regs = stateBuf;
-
-    /* Save the current console font */
-    if (ioctl(console_id,GIO_FONT,&regs[PM_getVGAStateSize()]) < 0)
-       perror("ioctl(GIO_FONT)");
-
-    /* Inform the Linux console that we are going into graphics mode */
-    if (ioctl(console_id, KDSETMODE, KD_GRAPHICS) < 0)
-       perror("ioctl(KDSETMODE)");
-
-    /* Save state of VGA registers */
-    PM_saveVGAState(stateBuf);
-}
-
-void PMAPI PM_setSuspendAppCallback(int (_ASMAPIP saveState)(int flags))
-{
-    /* TODO: Implement support for allowing console switching! */
-}
-
-/****************************************************************************
-REMARKS:
-Restore the state of the Linux console.
-****************************************************************************/
-void PMAPI PM_restoreConsoleState(const void *stateBuf,PM_HWND console_id)
-{
-    const uchar *regs = stateBuf;
-
-    /* Restore the state of the VGA compatible registers */
-    PM_restoreVGAState(stateBuf);
-
-    /* Inform the Linux console that we are back from graphics modes */
-    if (ioctl(console_id, KDSETMODE, KD_TEXT) < 0)
-       LOGWARN("ioctl(KDSETMODE) failed");
-
-    /* Restore the old console font */
-    if (ioctl(console_id,PIO_FONT,&regs[PM_getVGAStateSize()]) < 0)
-       LOGWARN("ioctl(KDSETMODE) failed");
-
-    /* Coming back from graphics mode on Linux also restored the previous
-     * text mode console contents, so we need to clear the screen to get
-     * around this since the cursor does not get homed by our code.
-     */
-    fflush(stdout);
-    fflush(stderr);
-    printf("\033[H\033[J");
-    fflush(stdout);
-}
-
-/****************************************************************************
-REMARKS:
-Close the Linux console and put it back to normal.
-****************************************************************************/
-void PMAPI PM_closeConsole(PM_HWND _PM_console_fd)
-{
-    /* Restore console to normal operation */
-    if (--console_count == 0) {
-       /* Re-activate the original virtual console */
-       if (startup_vc > 0)
-           ioctl(_PM_console_fd, VT_ACTIVATE, startup_vc);
-
-       /* Close the console file descriptor */
-       if (_PM_console_fd > 2)
-           close(_PM_console_fd);
-       _PM_console_fd = -1;
-       }
-}
-
-void PM_setOSCursorLocation(int x,int y)
-{
-    /* Nothing to do in here */
-}
-
-/****************************************************************************
-REMARKS:
-Set the screen width and height for the Linux console.
-****************************************************************************/
-void PM_setOSScreenWidth(int width,int height)
-{
-    struct winsize  ws;
-    struct vt_sizes vs;
-
-    /* Resize the software terminal */
-    ws.ws_col = width;
-    ws.ws_row = height;
-    ioctl(_PM_console_fd, TIOCSWINSZ, &ws);
-
-    /* And the hardware */
-    vs.v_rows = height;
-    vs.v_cols = width;
-    vs.v_scrollsize = 0;
-    ioctl(_PM_console_fd, VT_RESIZE, &vs);
-}
-
-ibool PMAPI PM_setRealTimeClockHandler(PM_intHandler ih, int frequency)
-{
-    /* TODO: Implement this for Linux */
-    return false;
-}
-
-void PMAPI PM_setRealTimeClockFrequency(int frequency)
-{
-    /* TODO: Implement this for Linux */
-}
-
-void PMAPI PM_restoreRealTimeClockHandler(void)
-{
-    /* TODO: Implement this for Linux */
-}
-
-char * PMAPI PM_getCurrentPath(
-    char *path,
-    int maxLen)
-{
-    return getcwd(path,maxLen);
-}
-
-char PMAPI PM_getBootDrive(void)
-{ return '/'; }
-
-const char * PMAPI PM_getVBEAFPath(void)
-{ return PM_getNucleusConfigPath(); }
-
-const char * PMAPI PM_getNucleusPath(void)
-{
-    char *env = getenv("NUCLEUS_PATH");
-    return env ? env : "/usr/lib/nucleus";
-}
-
-const char * PMAPI PM_getNucleusConfigPath(void)
-{
-    static char path[256];
-    strcpy(path,PM_getNucleusPath());
-    PM_backslash(path);
-    strcat(path,"config");
-    return path;
-}
-
-const char * PMAPI PM_getUniqueID(void)
-{
-    static char buf[128];
-    gethostname(buf, 128);
-    return buf;
-}
-
-const char * PMAPI PM_getMachineName(void)
-{
-    static char buf[128];
-    gethostname(buf, 128);
-    return buf;
-}
-
-void * PMAPI PM_getBIOSPointer(void)
-{
-    static uchar *zeroPtr = NULL;
-    if (!zeroPtr)
-       zeroPtr = PM_mapPhysicalAddr(0,0xFFFFF,true);
-    return (void*)(zeroPtr + 0x400);
-}
-
-void * PMAPI PM_getA0000Pointer(void)
-{
-    /* PM_init maps in the 0xA0000 framebuffer region 1:1 with our
-     * address mapping, so we can return the address here.
-     */
-    if (!inited)
-       PM_init();
-    return (void*)(0xA0000);
-}
-
-void * PMAPI PM_mapPhysicalAddr(ulong base,ulong limit,ibool isCached)
-{
-    uchar   *p;
-    ulong   baseAddr,baseOfs;
-
-    if (!inited)
-       PM_init();
-    if (base >= 0xA0000 && base < 0x100000)
-       return (void*)base;
-    if (!fd_mem && (fd_mem = open("/dev/mem", O_RDWR)) == -1)
-       return NULL;
-
-    /* Round the physical address to a 4Kb boundary and the limit to a
-     * 4Kb-1 boundary before passing the values to mmap. If we round the
-     * physical address, then we also add an extra offset into the address
-     * that we return.
-     */
-    baseOfs = base & 4095;
-    baseAddr = base & ~4095;
-    limit = ((limit+baseOfs+1+4095) & ~4095)-1;
-    if ((p = mmap(0, limit+1,
-           PROT_READ | PROT_WRITE, MAP_SHARED,
-           fd_mem, baseAddr)) == (void *)-1)
-       return NULL;
-    return (void*)(p+baseOfs);
-}
-
-void PMAPI PM_freePhysicalAddr(void *ptr,ulong limit)
-{
-    if ((ulong)ptr >= 0x100000)
-       munmap(ptr,limit+1);
-}
-
-ulong PMAPI PM_getPhysicalAddr(void *p)
-{
-    /* TODO: This function should find the physical address of a linear */
-    /*       address. */
-    return 0xFFFFFFFFUL;
-}
-
-ibool PMAPI PM_getPhysicalAddrRange(void *p,ulong length,ulong *physAddress)
-{
-    /* TODO: This function should find a range of physical addresses */
-    /*       for a linear address. */
-    return false;
-}
-
-void PMAPI PM_sleep(ulong milliseconds)
-{
-    /* TODO: Put the process to sleep for milliseconds */
-}
-
-int PMAPI PM_getCOMPort(int port)
-{
-    /* TODO: Re-code this to determine real values using the Plug and Play */
-    /*       manager for the OS. */
-    switch (port) {
-       case 0: return 0x3F8;
-       case 1: return 0x2F8;
-       }
-    return 0;
-}
-
-int PMAPI PM_getLPTPort(int port)
-{
-    /* TODO: Re-code this to determine real values using the Plug and Play */
-    /*       manager for the OS. */
-    switch (port) {
-       case 0: return 0x3BC;
-       case 1: return 0x378;
-       case 2: return 0x278;
-       }
-    return 0;
-}
-
-void * PMAPI PM_mallocShared(long size)
-{
-    return PM_malloc(size);
-}
-
-void PMAPI PM_freeShared(void *ptr)
-{
-    PM_free(ptr);
-}
-
-void * PMAPI PM_mapToProcess(void *base,ulong limit)
-{ return (void*)base; }
-
-void * PMAPI PM_mapRealPointer(uint r_seg,uint r_off)
-{
-    /* PM_init maps in the 0xA0000-0x100000 region 1:1 with our
-     * address mapping, as well as all memory blocks in a 1:1 address
-     * mapping so we can simply return the physical address in here.
-     */
-    if (!inited)
-       PM_init();
-    return (void*)MK_PHYS(r_seg,r_off);
-}
-
-void * PMAPI PM_allocRealSeg(uint size,uint *r_seg,uint *r_off)
-{
-    int     i;
-    char    *r = (char *)REAL_MEM_BASE;
-
-    if (!inited)
-       PM_init();
-    if (!mem_info.ready)
-       return NULL;
-    if (mem_info.count == REAL_MEM_BLOCKS)
-       return NULL;
-    size = (size + 15) & ~15;
-    for (i = 0; i < mem_info.count; i++) {
-       if (mem_info.blocks[i].free && size < mem_info.blocks[i].size) {
-           insert_block(i);
-           mem_info.blocks[i].size = size;
-           mem_info.blocks[i].free = 0;
-           mem_info.blocks[i + 1].size -= size;
-           *r_seg = (uint)(r) >> 4;
-           *r_off = (uint)(r) & 0xF;
-           return (void *)r;
-           }
-       r += mem_info.blocks[i].size;
-       }
-    return NULL;
-}
-
-void PMAPI PM_freeRealSeg(void *mem)
-{
-    int     i;
-    char    *r = (char *)REAL_MEM_BASE;
-
-    if (!mem_info.ready)
-       return;
-    i = 0;
-    while (mem != (void *)r) {
-       r += mem_info.blocks[i].size;
-       i++;
-       if (i == mem_info.count)
-           return;
-       }
-    mem_info.blocks[i].free = 1;
-    if (i + 1 < mem_info.count && mem_info.blocks[i + 1].free) {
-       mem_info.blocks[i].size += mem_info.blocks[i + 1].size;
-       delete_block(i + 1);
-       }
-    if (i - 1 >= 0 && mem_info.blocks[i - 1].free) {
-       mem_info.blocks[i - 1].size += mem_info.blocks[i].size;
-       delete_block(i);
-       }
-}
-
-#define DIRECTION_FLAG  (1 << 10)
-
-static void em_ins(int size)
-{
-    unsigned int edx, edi;
-
-    edx = context.vm.regs.edx & 0xffff;
-    edi = context.vm.regs.edi & 0xffff;
-    edi += (unsigned int)context.vm.regs.ds << 4;
-    if (context.vm.regs.eflags & DIRECTION_FLAG) {
-       if (size == 4)
-           asm volatile ("std; insl; cld"
-            : "=D" (edi) : "d" (edx), "0" (edi));
-       else if (size == 2)
-           asm volatile ("std; insw; cld"
-            : "=D" (edi) : "d" (edx), "0" (edi));
-       else
-           asm volatile ("std; insb; cld"
-            : "=D" (edi) : "d" (edx), "0" (edi));
-       }
-    else {
-       if (size == 4)
-           asm volatile ("cld; insl"
-            : "=D" (edi) : "d" (edx), "0" (edi));
-       else if (size == 2)
-           asm volatile ("cld; insw"
-            : "=D" (edi) : "d" (edx), "0" (edi));
-       else
-           asm volatile ("cld; insb"
-            : "=D" (edi) : "d" (edx), "0" (edi));
-       }
-    edi -= (unsigned int)context.vm.regs.ds << 4;
-    context.vm.regs.edi &= 0xffff0000;
-    context.vm.regs.edi |= edi & 0xffff;
-}
-
-static void em_rep_ins(int size)
-{
-    unsigned int ecx, edx, edi;
-
-    ecx = context.vm.regs.ecx & 0xffff;
-    edx = context.vm.regs.edx & 0xffff;
-    edi = context.vm.regs.edi & 0xffff;
-    edi += (unsigned int)context.vm.regs.ds << 4;
-    if (context.vm.regs.eflags & DIRECTION_FLAG) {
-       if (size == 4)
-           asm volatile ("std; rep; insl; cld"
-            : "=D" (edi), "=c" (ecx)
-            : "d" (edx), "0" (edi), "1" (ecx));
-       else if (size == 2)
-           asm volatile ("std; rep; insw; cld"
-            : "=D" (edi), "=c" (ecx)
-            : "d" (edx), "0" (edi), "1" (ecx));
-       else
-           asm volatile ("std; rep; insb; cld"
-            : "=D" (edi), "=c" (ecx)
-            : "d" (edx), "0" (edi), "1" (ecx));
-       }
-    else {
-       if (size == 4)
-           asm volatile ("cld; rep; insl"
-            : "=D" (edi), "=c" (ecx)
-            : "d" (edx), "0" (edi), "1" (ecx));
-       else if (size == 2)
-           asm volatile ("cld; rep; insw"
-            : "=D" (edi), "=c" (ecx)
-            : "d" (edx), "0" (edi), "1" (ecx));
-       else
-           asm volatile ("cld; rep; insb"
-            : "=D" (edi), "=c" (ecx)
-            : "d" (edx), "0" (edi), "1" (ecx));
-       }
-
-    edi -= (unsigned int)context.vm.regs.ds << 4;
-    context.vm.regs.edi &= 0xffff0000;
-    context.vm.regs.edi |= edi & 0xffff;
-    context.vm.regs.ecx &= 0xffff0000;
-    context.vm.regs.ecx |= ecx & 0xffff;
-}
-
-static void em_outs(int size)
-{
-    unsigned int edx, esi;
-
-    edx = context.vm.regs.edx & 0xffff;
-    esi = context.vm.regs.esi & 0xffff;
-    esi += (unsigned int)context.vm.regs.ds << 4;
-    if (context.vm.regs.eflags & DIRECTION_FLAG) {
-       if (size == 4)
-           asm volatile ("std; outsl; cld"
-            : "=S" (esi) : "d" (edx), "0" (esi));
-       else if (size == 2)
-           asm volatile ("std; outsw; cld"
-            : "=S" (esi) : "d" (edx), "0" (esi));
-       else
-           asm volatile ("std; outsb; cld"
-            : "=S" (esi) : "d" (edx), "0" (esi));
-       }
-    else {
-       if (size == 4)
-           asm volatile ("cld; outsl"
-            : "=S" (esi) : "d" (edx), "0" (esi));
-       else if (size == 2)
-           asm volatile ("cld; outsw"
-            : "=S" (esi) : "d" (edx), "0" (esi));
-       else
-           asm volatile ("cld; outsb"
-            : "=S" (esi) : "d" (edx), "0" (esi));
-       }
-
-    esi -= (unsigned int)context.vm.regs.ds << 4;
-    context.vm.regs.esi &= 0xffff0000;
-    context.vm.regs.esi |= esi & 0xffff;
-}
-
-static void em_rep_outs(int size)
-{
-    unsigned int ecx, edx, esi;
-
-    ecx = context.vm.regs.ecx & 0xffff;
-    edx = context.vm.regs.edx & 0xffff;
-    esi = context.vm.regs.esi & 0xffff;
-    esi += (unsigned int)context.vm.regs.ds << 4;
-    if (context.vm.regs.eflags & DIRECTION_FLAG) {
-       if (size == 4)
-           asm volatile ("std; rep; outsl; cld"
-            : "=S" (esi), "=c" (ecx)
-            : "d" (edx), "0" (esi), "1" (ecx));
-       else if (size == 2)
-           asm volatile ("std; rep; outsw; cld"
-            : "=S" (esi), "=c" (ecx)
-            : "d" (edx), "0" (esi), "1" (ecx));
-       else
-           asm volatile ("std; rep; outsb; cld"
-            : "=S" (esi), "=c" (ecx)
-            : "d" (edx), "0" (esi), "1" (ecx));
-       }
-    else {
-       if (size == 4)
-           asm volatile ("cld; rep; outsl"
-            : "=S" (esi), "=c" (ecx)
-            : "d" (edx), "0" (esi), "1" (ecx));
-       else if (size == 2)
-           asm volatile ("cld; rep; outsw"
-            : "=S" (esi), "=c" (ecx)
-            : "d" (edx), "0" (esi), "1" (ecx));
-       else
-           asm volatile ("cld; rep; outsb"
-            : "=S" (esi), "=c" (ecx)
-            : "d" (edx), "0" (esi), "1" (ecx));
-       }
-
-    esi -= (unsigned int)context.vm.regs.ds << 4;
-    context.vm.regs.esi &= 0xffff0000;
-    context.vm.regs.esi |= esi & 0xffff;
-    context.vm.regs.ecx &= 0xffff0000;
-    context.vm.regs.ecx |= ecx & 0xffff;
-}
-
-static int emulate(void)
-{
-    unsigned char *insn;
-    struct {
-       unsigned int size : 1;
-       unsigned int rep : 1;
-       } prefix = { 0, 0 };
-    int i = 0;
-
-    insn = (unsigned char *)((unsigned int)context.vm.regs.cs << 4);
-    insn += context.vm.regs.eip;
-
-    while (1) {
-#ifdef TRACE_IO
-       traceAddr = ((ulong)context.vm.regs.cs << 16) + context.vm.regs.eip + i;
-#endif
-       if (insn[i] == 0x66) {
-           prefix.size = 1 - prefix.size;
-           i++;
-           }
-       else if (insn[i] == 0xf3) {
-           prefix.rep = 1;
-           i++;
-           }
-       else if (insn[i] == 0xf0 || insn[i] == 0xf2
-            || insn[i] == 0x26 || insn[i] == 0x2e
-            || insn[i] == 0x36 || insn[i] == 0x3e
-            || insn[i] == 0x64 || insn[i] == 0x65
-            || insn[i] == 0x67) {
-           /* these prefixes are just ignored */
-           i++;
-           }
-       else if (insn[i] == 0x6c) {
-           if (prefix.rep)
-               em_rep_ins(1);
-           else
-               em_ins(1);
-           i++;
-           break;
-           }
-       else if (insn[i] == 0x6d) {
-           if (prefix.rep) {
-               if (prefix.size)
-                   em_rep_ins(4);
-               else
-                   em_rep_ins(2);
-               }
-           else {
-               if (prefix.size)
-                   em_ins(4);
-               else
-                   em_ins(2);
-               }
-           i++;
-           break;
-           }
-       else if (insn[i] == 0x6e) {
-           if (prefix.rep)
-               em_rep_outs(1);
-           else
-               em_outs(1);
-           i++;
-           break;
-           }
-       else if (insn[i] == 0x6f) {
-           if (prefix.rep) {
-               if (prefix.size)
-                   em_rep_outs(4);
-               else
-                   em_rep_outs(2);
-               }
-           else {
-               if (prefix.size)
-                   em_outs(4);
-               else
-                   em_outs(2);
-               }
-           i++;
-           break;
-           }
-       else if (insn[i] == 0xec) {
-           *((uchar*)&context.vm.regs.eax) = port_in(context.vm.regs.edx);
-           i++;
-           break;
-           }
-       else if (insn[i] == 0xed) {
-           if (prefix.size)
-               *((ulong*)&context.vm.regs.eax) = port_inl(context.vm.regs.edx);
-           else
-               *((ushort*)&context.vm.regs.eax) = port_inw(context.vm.regs.edx);
-           i++;
-           break;
-           }
-       else if (insn[i] == 0xee) {
-           port_out(context.vm.regs.eax,context.vm.regs.edx);
-           i++;
-           break;
-           }
-       else if (insn[i] == 0xef) {
-           if (prefix.size)
-               port_outl(context.vm.regs.eax,context.vm.regs.edx);
-           else
-               port_outw(context.vm.regs.eax,context.vm.regs.edx);
-           i++;
-           break;
-           }
-       else
-           return 0;
-       }
-
-    context.vm.regs.eip += i;
-    return 1;
-}
-
-static void debug_info(int vret)
-{
-    int i;
-    unsigned char *p;
-
-    fputs("vm86() failed\n", stderr);
-    fprintf(stderr, "return = 0x%x\n", vret);
-    fprintf(stderr, "eax = 0x%08lx\n", context.vm.regs.eax);
-    fprintf(stderr, "ebx = 0x%08lx\n", context.vm.regs.ebx);
-    fprintf(stderr, "ecx = 0x%08lx\n", context.vm.regs.ecx);
-    fprintf(stderr, "edx = 0x%08lx\n", context.vm.regs.edx);
-    fprintf(stderr, "esi = 0x%08lx\n", context.vm.regs.esi);
-    fprintf(stderr, "edi = 0x%08lx\n", context.vm.regs.edi);
-    fprintf(stderr, "ebp = 0x%08lx\n", context.vm.regs.ebp);
-    fprintf(stderr, "eip = 0x%08lx\n", context.vm.regs.eip);
-    fprintf(stderr, "cs  = 0x%04x\n", context.vm.regs.cs);
-    fprintf(stderr, "esp = 0x%08lx\n", context.vm.regs.esp);
-    fprintf(stderr, "ss  = 0x%04x\n", context.vm.regs.ss);
-    fprintf(stderr, "ds  = 0x%04x\n", context.vm.regs.ds);
-    fprintf(stderr, "es  = 0x%04x\n", context.vm.regs.es);
-    fprintf(stderr, "fs  = 0x%04x\n", context.vm.regs.fs);
-    fprintf(stderr, "gs  = 0x%04x\n", context.vm.regs.gs);
-    fprintf(stderr, "eflags  = 0x%08lx\n", context.vm.regs.eflags);
-    fputs("cs:ip = [ ", stderr);
-    p = (unsigned char *)((context.vm.regs.cs << 4) + (context.vm.regs.eip & 0xffff));
-    for (i = 0; i < 16; ++i)
-           fprintf(stderr, "%02x ", (unsigned int)p[i]);
-    fputs("]\n", stderr);
-    fflush(stderr);
-}
-
-static int run_vm86(void)
-{
-    unsigned int vret;
-
-    for (;;) {
-       vret = vm86(&context.vm);
-       if (VM86_TYPE(vret) == VM86_INTx) {
-           unsigned int v = VM86_ARG(vret);
-           if (v == RETURN_TO_32_INT)
-               return 1;
-           pushw(context.vm.regs.eflags);
-           pushw(context.vm.regs.cs);
-           pushw(context.vm.regs.eip);
-           context.vm.regs.cs = get_int_seg(v);
-           context.vm.regs.eip = get_int_off(v);
-           context.vm.regs.eflags &= ~(VIF_MASK | TF_MASK);
-           continue;
-           }
-       if (VM86_TYPE(vret) != VM86_UNKNOWN)
-           break;
-       if (!emulate())
-           break;
-       }
-    debug_info(vret);
-    return 0;
-}
-
-#define IND(ereg) context.vm.regs.ereg = regs->ereg
-#define OUTD(ereg) regs->ereg = context.vm.regs.ereg
-
-void PMAPI DPMI_int86(int intno, DPMI_regs *regs)
-{
-    if (!inited)
-       PM_init();
-    memset(&context.vm.regs, 0, sizeof(context.vm.regs));
-    IND(eax); IND(ebx); IND(ecx); IND(edx); IND(esi); IND(edi);
-    context.vm.regs.eflags = DEFAULT_VM86_FLAGS;
-    context.vm.regs.cs = get_int_seg(intno);
-    context.vm.regs.eip = get_int_off(intno);
-    context.vm.regs.ss = context.stack_seg;
-    context.vm.regs.esp = context.stack_off;
-    pushw(DEFAULT_VM86_FLAGS);
-    pushw(context.ret_seg);
-    pushw(context.ret_off);
-    run_vm86();
-    OUTD(eax); OUTD(ebx); OUTD(ecx); OUTD(edx); OUTD(esi); OUTD(edi);
-    regs->flags = context.vm.regs.eflags;
-}
-
-#define IN(ereg) context.vm.regs.ereg = in->e.ereg
-#define OUT(ereg) out->e.ereg = context.vm.regs.ereg
-
-int PMAPI PM_int86(int intno, RMREGS *in, RMREGS *out)
-{
-    if (!inited)
-       PM_init();
-    memset(&context.vm.regs, 0, sizeof(context.vm.regs));
-    IN(eax); IN(ebx); IN(ecx); IN(edx); IN(esi); IN(edi);
-    context.vm.regs.eflags = DEFAULT_VM86_FLAGS;
-    context.vm.regs.cs = get_int_seg(intno);
-    context.vm.regs.eip = get_int_off(intno);
-    context.vm.regs.ss = context.stack_seg;
-    context.vm.regs.esp = context.stack_off;
-    pushw(DEFAULT_VM86_FLAGS);
-    pushw(context.ret_seg);
-    pushw(context.ret_off);
-    run_vm86();
-    OUT(eax); OUT(ebx); OUT(ecx); OUT(edx); OUT(esi); OUT(edi);
-    out->x.cflag = context.vm.regs.eflags & 1;
-    return out->x.ax;
-}
-
-int PMAPI PM_int86x(int intno, RMREGS *in, RMREGS *out,
-    RMSREGS *sregs)
-{
-    if (!inited)
-       PM_init();
-    if (intno == 0x21) {
-       time_t today = time(NULL);
-       struct tm *t;
-       t = localtime(&today);
-       out->x.cx = t->tm_year + 1900;
-       out->h.dh = t->tm_mon + 1;
-       out->h.dl = t->tm_mday;
-       }
-    else {
-       unsigned int seg, off;
-       seg = get_int_seg(intno);
-       off = get_int_off(intno);
-       memset(&context.vm.regs, 0, sizeof(context.vm.regs));
-       IN(eax); IN(ebx); IN(ecx); IN(edx); IN(esi); IN(edi);
-       context.vm.regs.eflags = DEFAULT_VM86_FLAGS;
-       context.vm.regs.cs = seg;
-       context.vm.regs.eip = off;
-       context.vm.regs.es = sregs->es;
-       context.vm.regs.ds = sregs->ds;
-       context.vm.regs.fs = sregs->fs;
-       context.vm.regs.gs = sregs->gs;
-       context.vm.regs.ss = context.stack_seg;
-       context.vm.regs.esp = context.stack_off;
-       pushw(DEFAULT_VM86_FLAGS);
-       pushw(context.ret_seg);
-       pushw(context.ret_off);
-       run_vm86();
-       OUT(eax); OUT(ebx); OUT(ecx); OUT(edx); OUT(esi); OUT(edi);
-       sregs->es = context.vm.regs.es;
-       sregs->ds = context.vm.regs.ds;
-       sregs->fs = context.vm.regs.fs;
-       sregs->gs = context.vm.regs.gs;
-       out->x.cflag = context.vm.regs.eflags & 1;
-       }
-    return out->e.eax;
-}
-
-#define OUTR(ereg) in->e.ereg = context.vm.regs.ereg
-
-void PMAPI PM_callRealMode(uint seg,uint off, RMREGS *in,
-    RMSREGS *sregs)
-{
-    if (!inited)
-       PM_init();
-    memset(&context.vm.regs, 0, sizeof(context.vm.regs));
-    IN(eax); IN(ebx); IN(ecx); IN(edx); IN(esi); IN(edi);
-    context.vm.regs.eflags = DEFAULT_VM86_FLAGS;
-    context.vm.regs.cs = seg;
-    context.vm.regs.eip = off;
-    context.vm.regs.ss = context.stack_seg;
-    context.vm.regs.esp = context.stack_off;
-    context.vm.regs.es = sregs->es;
-    context.vm.regs.ds = sregs->ds;
-    context.vm.regs.fs = sregs->fs;
-    context.vm.regs.gs = sregs->gs;
-    pushw(DEFAULT_VM86_FLAGS);
-    pushw(context.ret_seg);
-    pushw(context.ret_off);
-    run_vm86();
-    OUTR(eax); OUTR(ebx); OUTR(ecx); OUTR(edx); OUTR(esi); OUTR(edi);
-    sregs->es = context.vm.regs.es;
-    sregs->ds = context.vm.regs.ds;
-    sregs->fs = context.vm.regs.fs;
-    sregs->gs = context.vm.regs.gs;
-    in->x.cflag = context.vm.regs.eflags & 1;
-}
-
-void PMAPI PM_availableMemory(ulong *physical,ulong *total)
-{
-    FILE    *mem = fopen("/proc/meminfo","r");
-    char    buf[1024];
-
-    fgets(buf,1024,mem);
-    fgets(buf,1024,mem);
-    sscanf(buf,"Mem: %*d %*d %ld", physical);
-    fgets(buf,1024,mem);
-    sscanf(buf,"Swap: %*d %*d %ld", total);
-    fclose(mem);
-    *total += *physical;
-}
-
-void * PMAPI PM_allocLockedMem(uint size,ulong *physAddr,ibool contiguous,ibool below16M)
-{
-    /* TODO: Implement this for Linux */
-    return NULL;
-}
-
-void PMAPI PM_freeLockedMem(void *p,uint size,ibool contiguous)
-{
-    /* TODO: Implement this for Linux */
-}
-
-void * PMAPI PM_allocPage(
-    ibool locked)
-{
-    /* TODO: Implement this for Linux */
-    return NULL;
-}
-
-void PMAPI PM_freePage(
-    void *p)
-{
-    /* TODO: Implement this for Linux */
-}
-
-void PMAPI PM_setBankA(int bank)
-{
-    if (!inited)
-       PM_init();
-    memset(&context.vm.regs, 0, sizeof(context.vm.regs));
-    context.vm.regs.eax = 0x4F05;
-    context.vm.regs.ebx = 0x0000;
-    context.vm.regs.edx = bank;
-    context.vm.regs.eflags = DEFAULT_VM86_FLAGS;
-    context.vm.regs.cs = get_int_seg(0x10);
-    context.vm.regs.eip = get_int_off(0x10);
-    context.vm.regs.ss = context.stack_seg;
-    context.vm.regs.esp = context.stack_off;
-    pushw(DEFAULT_VM86_FLAGS);
-    pushw(context.ret_seg);
-    pushw(context.ret_off);
-    run_vm86();
-}
-
-void PMAPI PM_setBankAB(int bank)
-{
-    if (!inited)
-       PM_init();
-    memset(&context.vm.regs, 0, sizeof(context.vm.regs));
-    context.vm.regs.eax = 0x4F05;
-    context.vm.regs.ebx = 0x0000;
-    context.vm.regs.edx = bank;
-    context.vm.regs.eflags = DEFAULT_VM86_FLAGS;
-    context.vm.regs.cs = get_int_seg(0x10);
-    context.vm.regs.eip = get_int_off(0x10);
-    context.vm.regs.ss = context.stack_seg;
-    context.vm.regs.esp = context.stack_off;
-    pushw(DEFAULT_VM86_FLAGS);
-    pushw(context.ret_seg);
-    pushw(context.ret_off);
-    run_vm86();
-    context.vm.regs.eax = 0x4F05;
-    context.vm.regs.ebx = 0x0001;
-    context.vm.regs.edx = bank;
-    context.vm.regs.eflags = DEFAULT_VM86_FLAGS;
-    context.vm.regs.cs = get_int_seg(0x10);
-    context.vm.regs.eip = get_int_off(0x10);
-    context.vm.regs.ss = context.stack_seg;
-    context.vm.regs.esp = context.stack_off;
-    pushw(DEFAULT_VM86_FLAGS);
-    pushw(context.ret_seg);
-    pushw(context.ret_off);
-    run_vm86();
-}
-
-void PMAPI PM_setCRTStart(int x,int y,int waitVRT)
-{
-    if (!inited)
-       PM_init();
-    memset(&context.vm.regs, 0, sizeof(context.vm.regs));
-    context.vm.regs.eax = 0x4F07;
-    context.vm.regs.ebx = waitVRT;
-    context.vm.regs.ecx = x;
-    context.vm.regs.edx = y;
-    context.vm.regs.eflags = DEFAULT_VM86_FLAGS;
-    context.vm.regs.cs = get_int_seg(0x10);
-    context.vm.regs.eip = get_int_off(0x10);
-    context.vm.regs.ss = context.stack_seg;
-    context.vm.regs.esp = context.stack_off;
-    pushw(DEFAULT_VM86_FLAGS);
-    pushw(context.ret_seg);
-    pushw(context.ret_off);
-    run_vm86();
-}
-
-int PMAPI PM_enableWriteCombine(ulong base,ulong length,uint type)
-{
-#ifdef ENABLE_MTRR
-    struct mtrr_sentry sentry;
-
-    if (mtrr_fd < 0)
-       return PM_MTRR_ERR_NO_OS_SUPPORT;
-    sentry.base = base;
-    sentry.size = length;
-    sentry.type = type;
-    if (ioctl(mtrr_fd, MTRRIOC_ADD_ENTRY, &sentry) == -1) {
-       /* TODO: Need to decode MTRR error codes!! */
-       return PM_MTRR_NOT_SUPPORTED;
-       }
-    return PM_MTRR_ERR_OK;
-#else
-    return PM_MTRR_ERR_NO_OS_SUPPORT;
-#endif
-}
-
-/****************************************************************************
-PARAMETERS:
-callback    - Function to callback with write combine information
-
-REMARKS:
-Function to enumerate all write combine regions currently enabled for the
-processor.
-****************************************************************************/
-int PMAPI PM_enumWriteCombine(
-    PM_enumWriteCombine_t callback)
-{
-#ifdef ENABLE_MTRR
-    struct mtrr_gentry gentry;
-
-    if (mtrr_fd < 0)
-       return PM_MTRR_ERR_NO_OS_SUPPORT;
-
-    for (gentry.regnum = 0; ioctl (mtrr_fd, MTRRIOC_GET_ENTRY, &gentry) == 0;
-        ++gentry.regnum) {
-       if (gentry.size > 0) {
-           /* WARNING: This code assumes that the types in pmapi.h match the ones */
-           /* in the Linux kernel (mtrr.h) */
-           callback(gentry.base, gentry.size, gentry.type);
-       }
-    }
-
-    return PM_MTRR_ERR_OK;
-#else
-    return PM_MTRR_ERR_NO_OS_SUPPORT;
-#endif
-}
-
-ibool PMAPI PM_doBIOSPOST(
-    ushort axVal,
-    ulong BIOSPhysAddr,
-    void *copyOfBIOS,
-    ulong BIOSLen)
-{
-    char        *bios_ptr = (char*)0xC0000;
-    char        *old_bios;
-    ulong       Current10, Current6D, *rvec = 0;
-    RMREGS      regs;
-    RMSREGS     sregs;
-
-    /* The BIOS is mapped to 0xC0000 with a private memory mapping enabled
-     * which means we have a copy on write scheme. Hence we simply copy
-     * the secondary BIOS image over the top of the old one.
-     */
-    if (!inited)
-       PM_init();
-    if ((old_bios = PM_malloc(BIOSLen)) == NULL)
-       return false;
-    if (BIOSPhysAddr != 0xC0000) {
-       memcpy(old_bios,bios_ptr,BIOSLen);
-       memcpy(bios_ptr,copyOfBIOS,BIOSLen);
-       }
-
-    /* The interrupt vectors should already be mmap()'ed from 0-0x400 in PM_init */
-    Current10 = rvec[0x10];
-    Current6D = rvec[0x6D];
-
-    /* POST the secondary BIOS */
-    rvec[0x10] = rvec[0x42]; /* Restore int 10h to STD-BIOS */
-    regs.x.ax = axVal;
-    PM_callRealMode(0xC000,0x0003,&regs,&sregs);
-
-    /* Restore interrupt vectors */
-    rvec[0x10] = Current10;
-    rvec[0x6D] = Current6D;
-
-    /* Restore original BIOS image */
-    if (BIOSPhysAddr != 0xC0000)
-       memcpy(bios_ptr,old_bios,BIOSLen);
-    PM_free(old_bios);
-    return true;
-}
-
-int PMAPI PM_lockDataPages(void *p,uint len,PM_lockHandle *lh)
-{
-    p = p;  len = len;
-    return 1;
-}
-
-int PMAPI PM_unlockDataPages(void *p,uint len,PM_lockHandle *lh)
-{
-    p = p;  len = len;
-    return 1;
-}
-
-int PMAPI PM_lockCodePages(void (*p)(),uint len,PM_lockHandle *lh)
-{
-    p = p;  len = len;
-    return 1;
-}
-
-int PMAPI PM_unlockCodePages(void (*p)(),uint len,PM_lockHandle *lh)
-{
-    p = p;  len = len;
-    return 1;
-}
-
-PM_MODULE PMAPI PM_loadLibrary(
-    const char *szDLLName)
-{
-    /* TODO: Implement this to load shared libraries! */
-    (void)szDLLName;
-    return NULL;
-}
-
-void * PMAPI PM_getProcAddress(
-    PM_MODULE hModule,
-    const char *szProcName)
-{
-    /* TODO: Implement this! */
-    (void)hModule;
-    (void)szProcName;
-    return NULL;
-}
-
-void PMAPI PM_freeLibrary(
-    PM_MODULE hModule)
-{
-    /* TODO: Implement this! */
-    (void)hModule;
-}
-
-int PMAPI PM_setIOPL(
-    int level)
-{
-    /* TODO: Move the IOPL switching into this function!! */
-    return level;
-}
-
-void PMAPI PM_flushTLB(void)
-{
-    /* Do nothing on Linux. */
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/linux/vflat.c b/board/MAI/bios_emulator/scitech/src/pm/linux/vflat.c
deleted file mode 100644 (file)
index 579ef2c..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Any
-*
-* Description:  Dummy module; no virtual framebuffer for this OS
-*
-****************************************************************************/
-
-#include "pmapi.h"
-
-ibool PMAPI VF_available(void)
-{
-    return false;
-}
-
-void * PMAPI VF_init(ulong baseAddr,int bankSize,int codeLen,void *bankFunc)
-{
-    baseAddr = baseAddr;
-    bankSize = bankSize;
-    codeLen = codeLen;
-    bankFunc = bankFunc;
-    return NULL;
-}
-
-void PMAPI VF_exit(void)
-{
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/linux/ztimer.c b/board/MAI/bios_emulator/scitech/src/pm/linux/ztimer.c
deleted file mode 100644 (file)
index 1b9bae2..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-/****************************************************************************
-*
-*                         Ultra Long Period Timer
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Linux
-*
-* Description:  Linux specific implementation for the Zen Timer functions.
-*
-****************************************************************************/
-
-#include <unistd.h>
-#include <sys/time.h>
-#include "pmapi.h"
-
-/*----------------------------- Implementation ----------------------------*/
-
-/****************************************************************************
-REMARKS:
-Initialise the Zen Timer module internals.
-****************************************************************************/
-void __ZTimerInit(void)
-{
-}
-
-/****************************************************************************
-REMARKS:
-Use the gettimeofday() function to get microsecond precision (probably less
-though)
-****************************************************************************/
-static inline ulong __ULZReadTime(void)
-{
-    struct timeval t;
-    gettimeofday(&t, NULL);
-    return t.tv_sec*1000000 + t.tv_usec;
-}
-
-/****************************************************************************
-REMARKS:
-Start the Zen Timer counting.
-****************************************************************************/
-#define __LZTimerOn(tm)     tm->start.low = __ULZReadTime()
-
-/****************************************************************************
-REMARKS:
-Compute the lap time since the timer was started.
-****************************************************************************/
-#define __LZTimerLap(tm)        (__ULZReadTime() - tm->start.low)
-
-/****************************************************************************
-REMARKS:
-Call the assembler Zen Timer functions to do the timing.
-****************************************************************************/
-#define __LZTimerOff(tm)        tm->end.low = __ULZReadTime()
-
-/****************************************************************************
-REMARKS:
-Call the assembler Zen Timer functions to do the timing.
-****************************************************************************/
-#define __LZTimerCount(tm)  (tm->end.low - tm->start.low)
-
-/****************************************************************************
-REMARKS:
-Define the resolution of the long period timer as microseconds per timer tick.
-****************************************************************************/
-#define ULZTIMER_RESOLUTION 1
-
-/****************************************************************************
-REMARKS:
-Compute the elapsed time from the BIOS timer tick. Note that we check to see
-whether a midnight boundary has passed, and if so adjust the finish time to
-account for this. We cannot detect if more that one midnight boundary has
-passed, so if this happens we will be generating erronous results.
-****************************************************************************/
-ulong __ULZElapsedTime(ulong start,ulong finish)
-{ return finish - start; }
diff --git a/board/MAI/bios_emulator/scitech/src/pm/makefile b/board/MAI/bios_emulator/scitech/src/pm/makefile
deleted file mode 100644 (file)
index 265f0e3..0000000
+++ /dev/null
@@ -1,290 +0,0 @@
-#############################################################################
-#
-#                   Copyright (C) 1996 SciTech Software.
-#                           All rights reserved.
-#
-# Descripton:   Generic makefile for the PM library. Builds the library
-#               file and all test programs.
-#
-#############################################################################
-
-.IMPORT .IGNORE : DEBUG_AGP_DRIVER TEST_HARNESS DEBUG_SDDPMI
-
-#----------------------------------------------------------------------------
-# Add DOS extender dependant flags to command line
-#----------------------------------------------------------------------------
-
-CFLAGS          += $(DX_CFLAGS)
-ASFLAGS         += $(DX_ASFLAGS)
-NO_PMLIB        := 1
-
-#----------------------------------------------------------------------------
-# Include definitions specific for the target system
-#----------------------------------------------------------------------------
-
-.IF $(USE_VXD)
-
-# Building for Win32 VxD (minimal PM library implementation)
-
-LIBNAME         = pm
-OBJECTS         = pm$O vflat$O ztimer$O cpuinfo$O mtrr$O fileio$O pcilib$O \
-                  agp$O malloc$O vgastate$O gavxd$O _pm$O _mtrr$O _cpuinfo$O \
-                  _int64$O _pcihelp$O
-DEPEND_SRC      := vxd;common;codepage;tests
-.SOURCE:           vxd common codepage tests
-
-.ELIF $(USE_NTDRV)
-
-# Building for NT device drivers (minimal PM library implementation)
-
-LIBNAME         = pm
-OBJECTS         = pm$O vflat$O ztimer$O cpuinfo$O mtrr$O mem$O irq$O int86$O \
-                  stdio$O stdlib$O pcilib$O agp$O malloc$O vgastate$O gantdrv$O \
-                  _pm$O _mtrr$O _cpuinfo$O _int64$O _pcihelp$O _irq$O
-DEPEND_SRC      := ntdrv;common;codepage;tests
-.SOURCE:           ntdrv common codepage tests
-
-.ELIF $(USE_WIN32)
-
-# Building for Win32
-
-CFLAGS          += -DUSE_OS_JOYSTICK
-LIBNAME         = pm
-OBJECTS         = pm$O vflat$O event$O ddraw$O ztimer$O cpuinfo$O pcilib$O \
-                  agp$O malloc$O vgastate$O gawin32$O ntservc$O _joy$O _cpuinfo$O \
-                  _int64$O _pcihelp$O
-DEPEND_SRC      := win32;common;codepage;tests
-.SOURCE:           win32 common codepage tests
-
-.ELIF $(USE_OS232)
-
-# Building for OS/2
-
-.IF $(USE_OS2GUI)
-LIBNAME         = pm_pm
-.ELSE
-LIBNAME         = pm
-.ENDIF
-OBJECTS         = pm$O vflat$O event$O ztimer$O cpuinfo$O mtrr$O pcilib$O \
-                  agp$O malloc$O vgastate$O gaos2$O _pmos2$O _joy$O _cpuinfo$O \
-                  _int64$O _pcihelp$O dossctl$O
-DEPEND_SRC      := os2;common;codepage;tests
-.SOURCE:           os2 common codepage tests
-
-.ELIF $(USE_QNX)
-
-# Building for QNX
-
-USE_BIOS        := 1
-.IF $(USE_PHOTON)
-LIBNAME         = pm_ph
-.ELIF $(USE_X11)
-LIBNAME         = pm_x11
-.ELSE
-LIBNAME         = pm
-.ENDIF
-OBJECTS         = pm$O vflat$O event$O ztimer$O cpuinfo$O mtrr$O pcilib$O \
-                  agp$O malloc$O mtrrqnx$O unixio$O vgastate$O gaqnx$O _joy$O \
-                  _mtrrqnx$O _cpuinfo$O _int64$O _pcihelp$O
-DEPEND_SRC      := qnx;common;codepage;tests
-.SOURCE:           qnx common codepage tests
-
-# Indicate that this program uses Nucleus device drivers (so needs I/O access)
-USE_NUCLEUS     := 1
-
-.ELIF $(USE_LINUX)
-
-# Building for Linux
-
-CFLAGS          += -DENABLE_MTRR -DUSE_OS_JOYSTICK
-.IF $(USE_X11)
-LIBNAME         = pm_x11
-.ELSE
-LIBNAME         = pm
-.ENDIF
-OBJECTS         = pm$O vflat$O event$O ztimer$O cpuinfo$O pcilib$O \
-                  agp$O malloc$O unixio$O vgastate$O galinux$O _cpuinfo$O \
-                  _int64$O _pcihelp$O
-DEPEND_SRC      := linux;common;codepage;tests;x11
-.SOURCE:           linux common codepage tests x11
-
-# Building a shared library
-.IF $(SOFILE)
-LIB             := ld
-LIBFLAGS        := -r -o
-CFLAGS          += -fPIC
-.ENDIF
-
-.ELIF $(USE_BEOS)
-
-# Building for BeOS GUI
-
-LIBNAME         = pm
-OBJECTS         = pm$O vflat$O event$O ztimer$O cpuinfo$O pcilib$O \
-                  agp$O malloc$O vgastate$O gabeos$O _joy$O _cpuinfo$O \
-                  _int64$O _pcihelp$O
-DEPEND_SRC      := beos;common;codepage;tests
-.SOURCE:           beos common codepage tests
-
-.ELIF $(USE_SMX32)
-
-# Building for SMX
-
-LIBNAME         = pm
-OBJECTS         = pm$O pmsmx$O vflat$O event$O ztimer$O cpuinfo$O mtrr$O pcilib$O \
-                  agp$O malloc$O vgastate$O gasmx$O _pm$O _pmsmx$O _mtrr$O _event$O \
-                  _joy$O _cpuinfo$O _int64$O _pcihelp$O _lztimer$O
-DEPEND_SRC      := smx;common;codepage;tests
-.SOURCE:           smx common codepage tests
-
-.ELIF $(USE_RTTARGET)
-
-# Building for RTTarget-32
-
-LIBNAME         = pm
-OBJECTS         = pm$O vflat$O event$O ztimer$O cpuinfo$O mtrr$O pcilib$O \
-                  agp$O malloc$O vgastate$O gartt$O _mtrr$O _joy$O _cpuinfo$O \
-                  _int64$O _pcihelp$O
-DEPEND_SRC      := rttarget;common;codepage;tests
-.SOURCE:           rttarget common codepage tests
-
-.ELSE
-
-# Building for MSDOS
-
-LIBNAME         = pm
-OBJECTS         = pm$O pmdos$O vflat$O event$O ztimer$O cpuinfo$O mtrr$O \
-                  agp$O malloc$O pcilib$O vgastate$O gados$O \
-                  _pm$O _pmdos$O _mtrr$O _vflat$O _event$O _joy$O _pcihelp$O \
-                  _cpuinfo$O _int64$O _lztimer$O _dma$O
-DEPEND_SRC      := dos;common;codepage;tests
-.SOURCE:           dos common codepage tests
-
-.ENDIF
-
-# Object modules for keyboard code pages
-
-OBJECTS         += us_eng$O
-
-# Common object modules
-
-OBJECTS         += common$O
-.IF $(CHECKED)
-OBJECTS         += debug$O
-.ENDIF
-
-# Nucleus loader library object modules. Note that when compiling a test harness
-# library we need to exclude the Nucleus loader library.
-
-.IF $(TEST_HARNESS)
-CFLAGS          += -DTEST_HARNESS -DPMLIB
-LIBNAME         = pm_test
-.ELSE
-OBJECTS         += galib$O _ga_imp$O
-.ENDIF
-
-.IF $(DEBUG_SDDPMI)
-CFLAGS          += -DDEBUG_SDDPMI
-.ENDIF
-
-# AGP library object modules
-
-.IF $(DEBUG_AGP_DRIVER)
-CFLAGS          += -DDEBUG_AGP_DRIVER
-OBJECTS         += agplib$O
-.ELSE
-OBJECTS         += agplib$O peloader$O libcimp$O _gatimer$O
-.ENDIF
-
-#----------------------------------------------------------------------------
-# Name of library and generic object files required to build it
-#----------------------------------------------------------------------------
-
-.IF $(STKCALL)
-LIBFILE         = s$(LP)$(LIBNAME)$L
-.ELSE
-LIBFILE         = $(LP)$(LIBNAME)$L
-.ENDIF
-LIBCLEAN        = *.lib *.a
-
-#----------------------------------------------------------------------------
-# Change destination for library file depending the extender being used. This
-# is only necessary for DOS extender since the file go into a subdirectory
-# in the normal library directory, one for each supported extender. Other
-# OS'es put the file into the regular library directory, since there is
-# only one per OS in this case.
-#----------------------------------------------------------------------------
-
-MK_PMODE        = 1
-
-.IF $(TEST_HARNESS)
-LIB_DEST        := $(LIB_BASE)
-.ELIF $(USE_TNT)
-LIB_DEST        := $(LIB_BASE)\tnt
-.ELIF $(USE_DOS4GW)
-LIB_DEST        := $(LIB_BASE)\dos4gw
-.ELIF $(USE_X32)
-LIB_DEST        := $(LIB_BASE)\x32
-.ELIF $(USE_DPMI16)
-LIB_DEST        := $(LIB_BASE)\dpmi16
-.ELIF $(USE_DPMI32)
-LIB_DEST        := $(LIB_BASE)\dpmi32
-.ELIF $(USE_DOSX)
-LIB_DEST        := $(LIB_BASE)\dosx
-.END
-
-#----------------------------------------------------------------------------
-# Names of all executable files built
-#----------------------------------------------------------------------------
-
-.IF $(USE_REALDOS)
-EXEFILES        = memtest$E biosptr$E video$E isvesa$E callreal$E       \
-                  mouse$E tick$E key$E key15$E brk$E altbrk$E           \
-                  critical$E altcrit$E vftest$E rtc$E getch$E           \
-                  cpu$E timerc$E timercpp$E showpci$E uswc$E block$E
-.ELSE
-EXEFILES        = memtest$E video$E isvesa$E callreal$E vftest$E getch$E \
-                  cpu$E timerc$E timercpp$E showpci$E uswc$E block$E \
-                  save$E restore$E
-.ENDIF
-
-all: $(EXEFILES)
-
-$(EXEFILES): $(LIBFILE)
-
-memtest$E:  memtest$O
-biosptr$E:  biosptr$O
-video$E:    video$O
-isvesa$E:   isvesa$O
-mouse$E:    mouse$O
-tick$E:     tick$O
-key$E:      key$O
-key15$E:    key15$O
-brk$E:      brk$O
-altbrk$E:   altbrk$O
-critical$E: critical$O
-altcrit$E:  altcrit$O
-callreal$E: callreal$O
-vftest$E:   vftest$O
-rtc$E:      rtc$O
-getch$E:    getch$O
-cpu$E:      cpu$O
-timerc$E:   timerc$O
-timercpp$E: timercpp$O
-showpci$E:  showpci$O
-uswc$E:     uswc$O
-block$E:    block$O
-save$E:     save$O
-restore$E:  restore$O
-test$E:     test$O _test$O
-
-#----------------------------------------------------------------------------
-# Define the list of object files to create dependency information for
-#----------------------------------------------------------------------------
-
-DEPEND_OBJ      := $(OBJECTS) memtest$O biosptr$O video$O isvesa$O mouse$O  \
-                   tick$O key$O key$O brk$O altbrk$O critical$O altcrit$O   \
-                   callreal$O vftest$O getch$O timercpp$O
-
-.INCLUDE: "$(SCITECH)/makedefs/common.mk"
-
diff --git a/board/MAI/bios_emulator/scitech/src/pm/ntdrv/_irq.asm b/board/MAI/bios_emulator/scitech/src/pm/ntdrv/_irq.asm
deleted file mode 100644 (file)
index 11824a0..0000000
+++ /dev/null
@@ -1,288 +0,0 @@
-;****************************************************************************
-;*
-;*                  SciTech OS Portability Manager Library
-;*
-;*  ========================================================================
-;*
-;*    The contents of this file are subject to the SciTech MGL Public
-;*    License Version 1.0 (the "License"); you may not use this file
-;*    except in compliance with the License. You may obtain a copy of
-;*    the License at http://www.scitechsoft.com/mgl-license.txt
-;*
-;*    Software distributed under the License is distributed on an
-;*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-;*    implied. See the License for the specific language governing
-;*    rights and limitations under the License.
-;*
-;*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-;*
-;*    The Initial Developer of the Original Code is SciTech Software, Inc.
-;*    All Rights Reserved.
-;*
-;*  ========================================================================
-;*
-;* Language:    80386 Assembler, TASM 4.0 or NASM
-;* Environment: 32-bit Windows NT device driver
-;*
-;* Description: Low level assembly support for the PM library specific to
-;*              Windows NT device drivers.
-;*
-;****************************************************************************
-
-        IDEAL
-
-include "scitech.mac"           ; Memory model macros
-
-header      _irq                ; Set up memory model
-
-begdataseg  _irq
-
-    cextern _PM_rtcHandler,CPTR
-    cextern _PM_prevRTC,FCPTR
-
-RtcInside   dw      0           ; Are we still handling current interrupt
-sidtBuf     df      0           ; Buffer for sidt instruction
-
-enddataseg  _irq
-
-begcodeseg  _irq                ; Start of code segment
-
-cpublic _PM_irqCodeStart
-
-; Macro to delay briefly to ensure that enough time has elapsed between
-; successive I/O accesses so that the device being accessed can respond
-; to both accesses even on a very fast PC.
-
-ifdef   USE_NASM
-%macro  DELAY 0
-        jmp     short $+2
-        jmp     short $+2
-        jmp     short $+2
-%endmacro
-%macro  IODELAYN 1
-%rep    %1
-        DELAY
-%endrep
-%endmacro
-else
-macro   DELAY
-        jmp     short $+2
-        jmp     short $+2
-        jmp     short $+2
-endm
-macro   IODELAYN    N
-    rept    N
-        DELAY
-    endm
-endm
-endif
-
-;----------------------------------------------------------------------------
-; PM_rtcISR - Real time clock interrupt subroutine dispatcher
-;----------------------------------------------------------------------------
-; Hardware interrupt handler for the timer interrupt, to dispatch control
-; to high level C based subroutines. We save the state of all registers
-; in this routine, and switch to a local stack. Interrupts are *off*
-; when we call the user code.
-;
-; NOTE: This routine switches to a local stack before calling any C code,
-;       and hence is _not_ re-entrant. Make sure your C code executes as
-;       quickly as possible, since a timer overrun will simply hang the
-;       system.
-;----------------------------------------------------------------------------
-cprocfar    _PM_rtcISR
-
-;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-; If we enable interrupts and call into any C based interrupt handling code,
-; we need to setup a bunch of important information for the NT kernel. The
-; code below takes care of this housekeeping for us (see Undocumented NT for
-; details). If we don't do this housekeeping and interrupts are enabled,
-; the kernel will become very unstable and crash within 10 seconds or so.
-;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
-        pushad
-        pushfd
-        push    fs
-
-        mov     ebx,00000030h
-        mov     fs,bx
-        sub     esp,50h
-        mov     ebp,esp
-
-; Setup the exception frame to NULL
-
-        mov     ebx,[DWORD cs:0FFDFF000h]
-        mov     [DWORD ds:0FFDFF000h], 0FFFFFFFFh
-        mov     [DWORD ebp],ebx
-
-; Save away the existing KSS ebp
-
-        mov     esi,[DWORD cs:0FFDFF124h]
-        mov     ebx,[DWORD esi+00000128h]
-        mov     [DWORD ebp+4h],ebx
-        mov     [DWORD esi+00000128h],ebp
-
-; Save away the kernel time and the thread mode (kernel/user)
-
-        mov     edi,[DWORD esi+00000137h]
-        mov     [DWORD ebp+8h],edi
-
-; Set the thread mode (kernel/user) based on the code selector
-
-        mov     ebx,[DWORD ebp+7Ch]
-        and     ebx,01
-        mov     [BYTE esi+00000137h],bl
-
-;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-; End of special interrupt Prolog code
-;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
-; Clear priority interrupt controller and re-enable interrupts so we
-; dont lock things up for long.
-
-        mov     al,20h
-        out     0A0h,al
-        out     020h,al
-
-; Clear real-time clock timeout
-
-        in      al,70h              ; Read CMOS index register
-        push    eax                 ;  and save for later
-        IODELAYN 3
-        mov     al,0Ch
-        out     70h,al
-        IODELAYN 5
-        in      al,71h
-
-; Call the C interrupt handler function
-
-        cmp     [BYTE RtcInside],1  ; Check for mutual exclusion
-        je      @@Exit
-        mov     [BYTE RtcInside],1
-        sti                         ; Enable interrupts
-        cld                         ; Clear direction flag for C code
-        call    [CPTR _PM_rtcHandler]
-        cli                         ; Disable interrupts on exit!
-        mov     [BYTE RtcInside],0
-
-@@Exit: pop     eax
-        out     70h,al              ; Restore CMOS index register
-
-;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-; Start of special epilog code to restore stuff on exit from handler
-;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
-; Restore the KSS ebp
-
-        mov     esi,[DWORD cs:0FFDFF124h]
-        mov     ebx,[DWORD ebp+4]
-        mov     [DWORD esi+00000128h],ebx
-
-; Restore the exception frame
-
-        mov     ebx,[DWORD ebp]
-        mov     [DWORD fs:00000000],ebx
-
-; Restore the thread mode
-
-        mov     ebx,[DWORD ebp+8h]
-        mov     esi,[DWORD fs:00000124h]
-        mov     [BYTE esi+00000137h],bl
-        add     esp, 50h
-        pop     fs
-        popfd
-        popad
-
-; Return from interrupt
-
-        iret
-
-cprocend
-
-cpublic _PM_irqCodeEnd
-
-;----------------------------------------------------------------------------
-; void _PM_getISR(int irq,PMFARPTR *handler);
-;----------------------------------------------------------------------------
-; Function to return the specific IRQ handler direct from the IDT.
-;----------------------------------------------------------------------------
-cprocstart  _PM_getISR
-
-        ARG     idtEntry:UINT, handler:DPTR
-
-        enter_c 0
-        mov     ecx,[handler]           ; Get address of handler to fill in
-        sidt    [sidtBuf]               ; Get IDTR register into sidtBuf
-        mov     eax,[DWORD sidtBuf+2]   ; Get address of IDT into EAX
-        mov     ebx,[idtEntry]
-        lea     eax,[eax+ebx*8]         ; Get entry in the IDT
-        movzx   edx,[WORD eax+6]        ; Get high order 16-bits
-        shl     edx,16                  ; Move into top 16-bits of address
-        mov     dx,[WORD eax]           ; Get low order 16-bits
-        mov     [DWORD ecx],edx         ; Store linear address of handler
-        mov     dx,[WORD eax+2]         ; Get selector value
-        mov     [WORD ecx+4],dx         ; Store selector value
-        leave_c
-        ret
-
-cprocend    _PM_getISR
-
-;----------------------------------------------------------------------------
-; void _PM_setISR(int irq,void *handler);
-;----------------------------------------------------------------------------
-; Function to set the specific IRQ handler direct in the IDT.
-;----------------------------------------------------------------------------
-cprocstart  _PM_setISR
-
-        ARG     irq:UINT, handler:CPTR
-
-        enter_c 0
-        mov     ecx,[handler]           ; Get address of new handler
-        mov     dx,cs                   ; Get selector for new handler
-        sidt    [sidtBuf]               ; Get IDTR register into sidtBuf
-        mov     eax,[DWORD sidtBuf+2]   ; Get address of IDT into EAX
-        mov     ebx,[idtEntry]
-        lea     eax,[eax+ebx*8]         ; Get entry in the IDT
-        cli
-        mov     [WORD eax+2],dx         ; Store code segment selector
-        mov     [WORD eax],cx           ; Store low order bits of handler
-        shr     ecx,16
-        mov     [WORD eax+6],cx         ; Store high order bits of handler
-        sti
-        leave_c
-        ret
-
-cprocend    _PM_setISR
-
-;----------------------------------------------------------------------------
-; void _PM_restoreISR(int irq,PMFARPTR *handler);
-;----------------------------------------------------------------------------
-; Function to set the specific IRQ handler direct in the IDT.
-;----------------------------------------------------------------------------
-cprocstart  _PM_restoreISR
-
-        ARG     irq:UINT, handler:CPTR
-
-        enter_c 0
-        mov     ecx,[handler]
-        mov     dx,[WORD ecx+4]         ; Get selector for old handler
-        mov     ecx,[DWORD ecx]         ; Get address of old handler
-        sidt    [sidtBuf]               ; Get IDTR register into sidtBuf
-        mov     eax,[DWORD sidtBuf+2]   ; Get address of IDT into EAX
-        mov     ebx,[idtEntry]
-        lea     eax,[eax+ebx*8]         ; Get entry in the IDT
-        cli
-        mov     [WORD eax+2],dx         ; Store code segment selector
-        mov     [WORD eax],cx           ; Store low order bits of handler
-        shr     ecx,16
-        mov     [WORD eax+6],cx         ; Store high order bits of handler
-        sti
-        leave_c
-        ret
-
-cprocend    _PM_restoreISR
-
-endcodeseg  _irq
-
-        END                     ; End of module
-
diff --git a/board/MAI/bios_emulator/scitech/src/pm/ntdrv/_pm.asm b/board/MAI/bios_emulator/scitech/src/pm/ntdrv/_pm.asm
deleted file mode 100644 (file)
index 6cb276d..0000000
+++ /dev/null
@@ -1,281 +0,0 @@
-;****************************************************************************
-;*
-;*                  SciTech OS Portability Manager Library
-;*
-;*  ========================================================================
-;*
-;*    The contents of this file are subject to the SciTech MGL Public
-;*    License Version 1.0 (the "License"); you may not use this file
-;*    except in compliance with the License. You may obtain a copy of
-;*    the License at http://www.scitechsoft.com/mgl-license.txt
-;*
-;*    Software distributed under the License is distributed on an
-;*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-;*    implied. See the License for the specific language governing
-;*    rights and limitations under the License.
-;*
-;*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-;*
-;*    The Initial Developer of the Original Code is SciTech Software, Inc.
-;*    All Rights Reserved.
-;*
-;*  ========================================================================
-;*
-;* Language:    80386 Assembler, TASM 4.0 or NASM
-;* Environment: 32-bit Windows NT device driver
-;*
-;* Description: Low level assembly support for the PM library specific to
-;*              Windows NT device drivers.
-;*
-;****************************************************************************
-
-        IDEAL
-
-include "scitech.mac"               ; Memory model macros
-
-header      _pm                     ; Set up memory model
-
-P586
-
-begdataseg
-
-; Watcom C++ externals required to link when compiling floating point
-; C code. They are not actually used in the code because we compile with
-; inline floating point instructions, however the compiler still generates
-; the references in the object modules.
-
-__8087      dd  0
-            PUBLIC  __8087
-__imthread:
-__fltused:
-_fltused_   dd  0
-            PUBLIC  __imthread
-            PUBLIC  _fltused_
-            PUBLIC  __fltused
-
-enddataseg
-
-begcodeseg  _pm                 ; Start of code segment
-
-;----------------------------------------------------------------------------
-; void PM_segread(PMSREGS *sregs)
-;----------------------------------------------------------------------------
-; Read the current value of all segment registers
-;----------------------------------------------------------------------------
-cprocstart  PM_segread
-
-        ARG     sregs:DPTR
-
-        enter_c
-
-        mov     ax,es
-        _les    _si,[sregs]
-        mov     [_ES _si],ax
-        mov     [_ES _si+2],cs
-        mov     [_ES _si+4],ss
-        mov     [_ES _si+6],ds
-        mov     [_ES _si+8],fs
-        mov     [_ES _si+10],gs
-
-        leave_c
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; int PM_int386x(int intno, PMREGS *in, PMREGS *out,PMSREGS *sregs)
-;----------------------------------------------------------------------------
-; Issues a software interrupt in protected mode. This routine has been
-; written to allow user programs to load CS and DS with different values
-; other than the default.
-;----------------------------------------------------------------------------
-cprocstart  PM_int386x
-
-; Not used for NT device drivers
-
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void PM_setBankA(int bank)
-;----------------------------------------------------------------------------
-cprocstart      PM_setBankA
-
-; Not used for NT device drivers
-
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void PM_setBankAB(int bank)
-;----------------------------------------------------------------------------
-cprocstart      PM_setBankAB
-
-; Not used for NT device drivers
-
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void PM_setCRTStart(int x,int y,int waitVRT)
-;----------------------------------------------------------------------------
-cprocstart      PM_setCRTStart
-
-; Not used for NT device drivers
-
-        ret
-
-cprocend
-
-; Macro to delay briefly to ensure that enough time has elapsed between
-; successive I/O accesses so that the device being accessed can respond
-; to both accesses even on a very fast PC.
-
-ifdef   USE_NASM
-%macro  DELAY 0
-        jmp     short $+2
-        jmp     short $+2
-        jmp     short $+2
-%endmacro
-%macro  IODELAYN 1
-%rep    %1
-        DELAY
-%endrep
-%endmacro
-else
-macro   DELAY
-        jmp     short $+2
-        jmp     short $+2
-        jmp     short $+2
-endm
-macro   IODELAYN    N
-    rept    N
-        DELAY
-    endm
-endm
-endif
-
-;----------------------------------------------------------------------------
-; uchar _PM_readCMOS(int index)
-;----------------------------------------------------------------------------
-; Read the value of a specific CMOS register. We do this with both
-; normal interrupts and NMI disabled.
-;----------------------------------------------------------------------------
-cprocstart  _PM_readCMOS
-
-        ARG     index:UINT
-
-        push    _bp
-        mov     _bp,_sp
-        pushfd
-        mov     al,[BYTE index]
-        or      al,80h              ; Add disable NMI flag
-        cli
-        out     70h,al
-        IODELAYN 5
-        in      al,71h
-        mov     ah,al
-        xor     al,al
-        IODELAYN 5
-        out     70h,al              ; Re-enable NMI
-        mov     al,ah               ; Return value in AL
-        popfd
-        pop     _bp
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void _PM_writeCMOS(int index,uchar value)
-;----------------------------------------------------------------------------
-; Read the value of a specific CMOS register. We do this with both
-; normal interrupts and NMI disabled.
-;----------------------------------------------------------------------------
-cprocstart  _PM_writeCMOS
-
-        ARG     index:UINT, value:UCHAR
-
-        push    _bp
-        mov     _bp,_sp
-        pushfd
-        mov     al,[BYTE index]
-        or      al,80h              ; Add disable NMI flag
-        cli
-        out     70h,al
-        IODELAYN 5
-        mov     al,[value]
-        out     71h,al
-        xor     al,al
-        IODELAYN 5
-        out     70h,al              ; Re-enable NMI
-        popfd
-        pop     _bp
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; double _ftol(double f)
-;----------------------------------------------------------------------------
-; Calls to __ftol are generated by the Borland C++ compiler for code
-; that needs to convert a floating point type to an integral type.
-;
-; Input: floating point number on the top of the '87.
-;
-; Output: a (signed or unsigned) long in EAX
-; All other registers preserved.
-;-----------------------------------------------------------------------
-cprocstart  _ftol
-
-        LOCAL   temp1:WORD, temp2:QWORD = LocalSize
-
-        push    ebp
-        mov     ebp,esp
-        sub     esp,LocalSize
-
-        fstcw   [temp1]                 ; save the control word
-        fwait
-        mov     al,[BYTE temp1+1]
-        or      [BYTE temp1+1],0Ch      ; set rounding control to chop
-        fldcw   [temp1]
-        fistp   [temp2]                 ; convert to 64-bit integer
-        mov     [BYTE temp1+1],al
-        fldcw   [temp1]                 ; restore the control word
-        mov     eax,[DWORD temp2]       ; return LS 32 bits
-        mov     edx,[DWORD temp2+4]     ;        MS 32 bits
-
-        mov     esp,ebp
-        pop     ebp
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; _PM_getPDB - Return the Page Table Directory Base address
-;----------------------------------------------------------------------------
-cprocstart  _PM_getPDB
-
-        mov     eax,cr3
-        and     eax,0FFFFF000h
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; Flush the Translation Lookaside buffer
-;----------------------------------------------------------------------------
-cprocstart  PM_flushTLB
-
-        wbinvd                  ; Flush the CPU cache
-        mov     eax,cr3
-        mov     cr3,eax         ; Flush the TLB
-        ret
-
-cprocend
-
-endcodeseg  _pm
-
-        END                     ; End of module
diff --git a/board/MAI/bios_emulator/scitech/src/pm/ntdrv/cpuinfo.c b/board/MAI/bios_emulator/scitech/src/pm/ntdrv/cpuinfo.c
deleted file mode 100644 (file)
index d15b07c..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/****************************************************************************
-*
-*                         Ultra Long Period Timer
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  32-bit Windows VxD
-*
-* Description:  VxD specific code for the CPU detection module.
-*
-****************************************************************************/
-
-/*----------------------------- Implementation ----------------------------*/
-
-/****************************************************************************
-REMARKS:
-Do nothing for VxD's
-****************************************************************************/
-#define SetMaxThreadPriority()      0
-
-/****************************************************************************
-REMARKS:
-Do nothing for VxD's
-****************************************************************************/
-#define RestoreThreadPriority(i)    (void)(i)
-
-/****************************************************************************
-REMARKS:
-Initialise the counter and return the frequency of the counter.
-****************************************************************************/
-static void GetCounterFrequency(
-    CPU_largeInteger *freq)
-{
-    KeQueryPerformanceCounter((LARGE_INTEGER*)freq);
-}
-
-/****************************************************************************
-REMARKS:
-Read the counter and return the counter value.
-****************************************************************************/
-#define GetCounter(t)                                       \
-{                                                           \
-    LARGE_INTEGER lt = KeQueryPerformanceCounter(NULL);     \
-    (t)->low = lt.LowPart;                                  \
-    (t)->high = lt.HighPart;                                \
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/ntdrv/int86.c b/board/MAI/bios_emulator/scitech/src/pm/ntdrv/int86.c
deleted file mode 100644 (file)
index c82648b..0000000
+++ /dev/null
@@ -1,251 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  32-bit Windows NT device drivers.
-*
-* Description:  Implementation for the real mode software interrupt
-*               handling functions.
-*
-****************************************************************************/
-
-#include "pmapi.h"
-#include "drvlib/os/os.h"
-#include "sdd/sddhelp.h"
-#include "mtrr.h"
-#include "oshdr.h"
-
-/*----------------------------- Implementation ----------------------------*/
-
-/****************************************************************************
-REMARKS:
-We do have limited BIOS access under Windows NT device drivers.
-****************************************************************************/
-ibool PMAPI PM_haveBIOSAccess(void)
-{
-    /* Return false unless we have full buffer passing! */
-    return false;
-}
-
-/****************************************************************************
-PARAMETERS:
-len     - Place to store the length of the buffer
-rseg    - Place to store the real mode segment of the buffer
-roff    - Place to store the real mode offset of the buffer
-
-REMARKS:
-This function returns the address and length of the global VESA transfer
-buffer that is used for communicating with the VESA BIOS functions from
-Win16 and Win32 programs under Windows.
-****************************************************************************/
-void * PMAPI PM_getVESABuf(
-    uint *len,
-    uint *rseg,
-    uint *roff)
-{
-    /* No buffers supported under Windows NT (Windows XP has them however if */
-    /* we ever decide to support this!) */
-    return NULL;
-}
-
-/****************************************************************************
-REMARKS:
-Issue a protected mode software interrupt.
-****************************************************************************/
-int PMAPI PM_int386(
-    int intno,
-    PMREGS *in,
-    PMREGS *out)
-{
-    PMSREGS sregs;
-    PM_segread(&sregs);
-    return PM_int386x(intno,in,out,&sregs);
-}
-
-/****************************************************************************
-REMARKS:
-Map a real mode pointer to a protected mode pointer.
-****************************************************************************/
-void * PMAPI PM_mapRealPointer(
-    uint r_seg,
-    uint r_off)
-{
-    /* Not used for Windows NT drivers! */
-    return NULL;
-}
-
-/****************************************************************************
-REMARKS:
-Allocate a block of real mode memory
-****************************************************************************/
-void * PMAPI PM_allocRealSeg(
-    uint size,
-    uint *r_seg,
-    uint *r_off)
-{
-    /* Not supported in NT drivers */
-    (void)size;
-    (void)r_seg;
-    (void)r_off;
-    return NULL;
-}
-
-/****************************************************************************
-REMARKS:
-Free a block of real mode memory.
-****************************************************************************/
-void PMAPI PM_freeRealSeg(
-    void *mem)
-{
-    /* Not supported in NT drivers */
-    (void)mem;
-}
-
-/****************************************************************************
-REMARKS:
-Issue a real mode interrupt (parameters in DPMI compatible structure)
-****************************************************************************/
-void PMAPI DPMI_int86(
-    int intno,
-    DPMI_regs *regs)
-{
-    /* Not used in NT drivers */
-}
-
-/****************************************************************************
-REMARKS:
-Call a V86 real mode function with the specified register values
-loaded before the call. The call returns with a far ret.
-****************************************************************************/
-void PMAPI PM_callRealMode(
-    uint seg,
-    uint off,
-    RMREGS *regs,
-    RMSREGS *sregs)
-{
-    /* TODO!! */
-#if 0
-    CLIENT_STRUCT saveRegs;
-
-    /* Bail if we do not have BIOS access (ie: the VxD was dynamically
-     * loaded, and not statically loaded.
-     */
-    if (!_PM_haveBIOS)
-       return;
-
-    TRACE("SDDHELP: Entering PM_callRealMode()\n");
-    Begin_Nest_V86_Exec();
-    LoadV86Registers(&saveRegs,regs,sregs);
-    Simulate_Far_Call(seg, off);
-    Resume_Exec();
-    ReadV86Registers(&saveRegs,regs,sregs);
-    End_Nest_Exec();
-    TRACE("SDDHELP: Exiting PM_callRealMode()\n");
-#endif
-}
-
-/****************************************************************************
-REMARKS:
-Issue a V86 real mode interrupt with the specified register values
-loaded before the interrupt.
-****************************************************************************/
-int PMAPI PM_int86(
-    int intno,
-    RMREGS *in,
-    RMREGS *out)
-{
-    /* TODO!! */
-#if 0
-    RMSREGS         sregs = {0};
-    CLIENT_STRUCT   saveRegs;
-    ushort          oldDisable;
-
-    /* Disable pass-up to our VxD handler so we directly call BIOS */
-    TRACE("SDDHELP: Entering PM_int86()\n");
-    if (disableTSRFlag) {
-       oldDisable = *disableTSRFlag;
-       *disableTSRFlag = 0;
-       }
-    Begin_Nest_V86_Exec();
-    LoadV86Registers(&saveRegs,in,&sregs);
-    Exec_Int(intno);
-    ReadV86Registers(&saveRegs,out,&sregs);
-    End_Nest_Exec();
-
-    /* Re-enable pass-up to our VxD handler if previously enabled */
-    if (disableTSRFlag)
-       *disableTSRFlag = oldDisable;
-
-    TRACE("SDDHELP: Exiting PM_int86()\n");
-#else
-    *out = *in;
-#endif
-    return out->x.ax;
-}
-
-/****************************************************************************
-REMARKS:
-Issue a V86 real mode interrupt with the specified register values
-loaded before the interrupt.
-****************************************************************************/
-int PMAPI PM_int86x(
-    int intno,
-    RMREGS *in,
-    RMREGS *out,
-    RMSREGS *sregs)
-{
-    /* TODO!! */
-#if 0
-    CLIENT_STRUCT   saveRegs;
-    ushort          oldDisable;
-
-    /* Bail if we do not have BIOS access (ie: the VxD was dynamically
-     * loaded, and not statically loaded.
-     */
-    if (!_PM_haveBIOS) {
-       *out = *in;
-       return out->x.ax;
-       }
-
-    /* Disable pass-up to our VxD handler so we directly call BIOS */
-    TRACE("SDDHELP: Entering PM_int86x()\n");
-    if (disableTSRFlag) {
-       oldDisable = *disableTSRFlag;
-       *disableTSRFlag = 0;
-       }
-    Begin_Nest_V86_Exec();
-    LoadV86Registers(&saveRegs,in,sregs);
-    Exec_Int(intno);
-    ReadV86Registers(&saveRegs,out,sregs);
-    End_Nest_Exec();
-
-    /* Re-enable pass-up to our VxD handler if previously enabled */
-    if (disableTSRFlag)
-       *disableTSRFlag = oldDisable;
-
-    TRACE("SDDHELP: Exiting PM_int86x()\n");
-#else
-    *out = *in;
-#endif
-    return out->x.ax;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/ntdrv/irq.c b/board/MAI/bios_emulator/scitech/src/pm/ntdrv/irq.c
deleted file mode 100644 (file)
index 9cd5204..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  32-bit Windows NT device drivers.
-*
-* Description:  Implementation for the NT driver IRQ management functions
-*               for the PM library.
-*
-****************************************************************************/
-
-#include "pmapi.h"
-#include "pmint.h"
-#include "drvlib/os/os.h"
-#include "sdd/sddhelp.h"
-#include "mtrr.h"
-#include "oshdr.h"
-
-/*--------------------------- Global variables ----------------------------*/
-
-static int          globalDataStart;
-static uchar        _PM_oldCMOSRegA;
-static uchar        _PM_oldCMOSRegB;
-static uchar        _PM_oldRTCPIC2;
-static ulong        RTC_idtEntry;
-PM_intHandler       _PM_rtcHandler = NULL;
-PMFARPTR    _VARAPI _PM_prevRTC = PMNULL;
-
-/*----------------------------- Implementation ----------------------------*/
-
-/* Functions to read and write CMOS registers */
-
-uchar   _ASMAPI _PM_readCMOS(int index);
-void    _ASMAPI _PM_writeCMOS(int index,uchar value);
-void    _ASMAPI _PM_rtcISR(void);
-void    _ASMAPI _PM_getISR(int irq,PMFARPTR *handler);
-void    _ASMAPI _PM_setISR(int irq,void *handler);
-void    _ASMAPI _PM_restoreISR(int irq,PMFARPTR *handler);
-void    _ASMAPI _PM_irqCodeStart(void);
-void    _ASMAPI _PM_irqCodeEnd(void);
-
-/****************************************************************************
-REMARKS:
-Set the real time clock frequency (for stereo modes).
-****************************************************************************/
-void PMAPI PM_setRealTimeClockFrequency(
-    int frequency)
-{
-    static short convert[] = {
-       8192,
-       4096,
-       2048,
-       1024,
-       512,
-       256,
-       128,
-       64,
-       32,
-       16,
-       8,
-       4,
-       2,
-       -1,
-       };
-    int i;
-
-    /* First clear any pending RTC timeout if not cleared */
-    _PM_readCMOS(0x0C);
-    if (frequency == 0) {
-       /* Disable RTC timout */
-       _PM_writeCMOS(0x0A,(uchar)_PM_oldCMOSRegA);
-       _PM_writeCMOS(0x0B,(uchar)(_PM_oldCMOSRegB & 0x0F));
-       }
-    else {
-       /* Convert frequency value to RTC clock indexes */
-       for (i = 0; convert[i] != -1; i++) {
-           if (convert[i] == frequency)
-               break;
-           }
-
-       /* Set RTC timout value and enable timeout */
-       _PM_writeCMOS(0x0A,(uchar)(0x20 | (i+3)));
-       _PM_writeCMOS(0x0B,(uchar)((_PM_oldCMOSRegB & 0x0F) | 0x40));
-       }
-}
-
-ibool PMAPI PM_setRealTimeClockHandler(PM_intHandler th,int frequency)
-{
-    static ibool    locked = false;
-
-    /* Save the old CMOS real time clock values */
-    _PM_oldCMOSRegA = _PM_readCMOS(0x0A);
-    _PM_oldCMOSRegB = _PM_readCMOS(0x0B);
-
-    /* Install the interrupt handler */
-    RTC_idtEntry = 0x38;
-    _PM_getISR(RTC_idtEntry, &_PM_prevRTC);
-    _PM_rtcHandler = th;
-    _PM_setISR(RTC_idtEntry, _PM_rtcISR);
-
-    /* Program the real time clock default frequency */
-    PM_setRealTimeClockFrequency(frequency);
-
-    /* Unmask IRQ8 in the PIC2 */
-    _PM_oldRTCPIC2 = PM_inpb(0xA1);
-    PM_outpb(0xA1,(uchar)(_PM_oldRTCPIC2 & 0xFE));
-    return true;
-}
-
-void PMAPI PM_restoreRealTimeClockHandler(void)
-{
-    if (_PM_rtcHandler) {
-       /* Restore CMOS registers and mask RTC clock */
-       _PM_writeCMOS(0x0A,_PM_oldCMOSRegA);
-       _PM_writeCMOS(0x0B,_PM_oldCMOSRegB);
-       PM_outpb(0xA1,(uchar)((PM_inpb(0xA1) & 0xFE) | (_PM_oldRTCPIC2 & ~0xFE)));
-
-       /* Restore the interrupt vector */
-       _PM_restoreISR(RTC_idtEntry, &_PM_prevRTC);
-       _PM_rtcHandler = NULL;
-       }
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/ntdrv/mem.c b/board/MAI/bios_emulator/scitech/src/pm/ntdrv/mem.c
deleted file mode 100644 (file)
index 3128c6a..0000000
+++ /dev/null
@@ -1,518 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  32-bit Windows NT device drivers.
-*
-* Description:  Implementation for the NT driver memory management functions
-*               for the PM library.
-*
-****************************************************************************/
-
-#include "pmapi.h"
-#include "drvlib/os/os.h"
-#include "sdd/sddhelp.h"
-#include "mtrr.h"
-#include "oshdr.h"
-
-/*--------------------------- Global variables ----------------------------*/
-
-#define MAX_MEMORY_SHARED           100
-#define MAX_MEMORY_MAPPINGS         100
-#define MAX_MEMORY_LOCKED           100
-
-typedef struct {
-    void    *linear;
-    ulong   length;
-    PMDL    pMdl;
-    } memshared;
-
-typedef struct {
-    void    *linear;
-    void    *mmIoMapped;
-    ulong   length;
-    PMDL    pMdl;
-    } memlocked;
-
-typedef struct {
-    ulong   physical;
-    ulong   linear;
-    ulong   length;
-    ibool   isCached;
-    } mmapping;
-
-static int          numMappings = 0;
-static memshared    shared[MAX_MEMORY_MAPPINGS] = {0};
-static mmapping     maps[MAX_MEMORY_MAPPINGS];
-static memlocked    locked[MAX_MEMORY_LOCKED];
-
-/*----------------------------- Implementation ----------------------------*/
-
-ulong   PMAPI _PM_getPDB(void);
-
-/* Page table entry flags */
-
-#define PAGE_FLAGS_PRESENT                     0x00000001
-#define PAGE_FLAGS_WRITEABLE           0x00000002
-#define PAGE_FLAGS_USER                                0x00000004
-#define PAGE_FLAGS_WRITE_THROUGH       0x00000008
-#define PAGE_FLAGS_CACHE_DISABLE       0x00000010
-#define PAGE_FLAGS_ACCESSED                    0x00000020
-#define PAGE_FLAGS_DIRTY                       0x00000040
-#define PAGE_FLAGS_4MB             0x00000080
-
-/****************************************************************************
-PARAMETERS:
-base        - Physical base address of the memory to maps in
-limit       - Limit of physical memory to region to maps in
-
-RETURNS:
-Linear address of the newly mapped memory.
-
-REMARKS:
-Maps a physical memory range to a linear memory range.
-****************************************************************************/
-static ulong _PM_mapPhysicalToLinear(
-    ulong base,
-    ulong limit,
-    ibool isCached)
-{
-    ulong               length = limit+1;
-    PHYSICAL_ADDRESS    paIoBase = {0};
-
-    /* NT loves large Ints */
-    paIoBase = RtlConvertUlongToLargeInteger( base );
-
-    /* Map IO space into Kernel */
-    if (isCached)
-       return (ULONG)MmMapIoSpace(paIoBase, length, MmCached );
-    else
-       return (ULONG)MmMapIoSpace(paIoBase, length, MmNonCached );
-}
-
-/****************************************************************************
-REMARKS:
-Adjust the page table caching bits directly. Requires ring 0 access and
-only works with DOS4GW and compatible extenders (CauseWay also works since
-it has direct support for the ring 0 instructions we need from ring 3). Will
-not work in a DOS box, but we call into the ring 0 helper VxD so we should
-never get here in a DOS box anyway (assuming the VxD is present). If we
-do get here and we are in windows, this code will be skipped.
-****************************************************************************/
-static void _PM_adjustPageTables(
-    ulong linear,
-    ulong limit,
-       ibool isGlobal,
-    ibool isCached)
-{
-    int     startPDB,endPDB,iPDB,startPage,endPage,start,end,iPage;
-    ulong   pageTable,*pPDB,*pPageTable;
-       ulong   mask = 0xFFFFFFFF;
-       ulong   bits = 0x00000000;
-
-       /* Enable user level access for page table entry */
-       if (isGlobal) {
-               mask &= ~PAGE_FLAGS_USER;
-               bits |= PAGE_FLAGS_USER;
-               }
-
-       /* Disable PCD bit if page table entry should be uncached */
-       if (!isCached) {
-               mask &= ~(PAGE_FLAGS_CACHE_DISABLE | PAGE_FLAGS_WRITE_THROUGH);
-               bits |= (PAGE_FLAGS_CACHE_DISABLE | PAGE_FLAGS_WRITE_THROUGH);
-               }
-
-    pPDB = (ulong*)_PM_mapPhysicalToLinear(_PM_getPDB(),0xFFF,true);
-    if (pPDB) {
-       startPDB = (linear >> 22) & 0x3FF;
-       startPage = (linear >> 12) & 0x3FF;
-       endPDB = ((linear+limit) >> 22) & 0x3FF;
-       endPage = ((linear+limit) >> 12) & 0x3FF;
-       for (iPDB = startPDB; iPDB <= endPDB; iPDB++) {
-           /* Set the bits in the page directory entry - required as per */
-           /* Pentium 4 manual. This also takes care of the 4MB page entries */
-           pPDB[iPDB] = (pPDB[iPDB] & mask) | bits;
-           if (!(pPDB[iPDB] & PAGE_FLAGS_4MB)) {
-               /* If we are dealing with 4KB pages then we need to iterate */
-               /* through each of the page table entries */
-               pageTable = pPDB[iPDB] & ~0xFFF;
-               pPageTable = (ulong*)_PM_mapPhysicalToLinear(pageTable,0xFFF,true);
-               start = (iPDB == startPDB) ? startPage : 0;
-               end = (iPDB == endPDB) ? endPage : 0x3FF;
-               for (iPage = start; iPage <= end; iPage++) {
-                   pPageTable[iPage] = (pPageTable[iPage] & mask) | bits;
-                   }
-               MmUnmapIoSpace(pPageTable,0xFFF);
-               }
-           }
-       MmUnmapIoSpace(pPDB,0xFFF);
-       PM_flushTLB();
-       }
-}
-
-/****************************************************************************
-REMARKS:
-Allocate a block of shared memory. For NT we allocate shared memory
-as locked, global memory that is accessible from any memory context
-(including interrupt time context), which allows us to load our important
-data structure and code such that we can access it directly from a ring
-0 interrupt context.
-****************************************************************************/
-void * PMAPI PM_mallocShared(
-    long size)
-{
-    int         i;
-
-    /* First find a free slot in our shared memory table */
-    for (i = 0; i < MAX_MEMORY_SHARED; i++) {
-       if (shared[i].linear == 0)
-           break;
-       }
-    if (i == MAX_MEMORY_SHARED)
-       return NULL;
-
-    /* Allocate the paged pool */
-    shared[i].linear = ExAllocatePool(PagedPool, size);
-
-    /* Create a list to manage this allocation */
-    shared[i].pMdl = IoAllocateMdl(shared[i].linear,size,FALSE,FALSE,(PIRP) NULL);
-
-    /* Lock this allocation in memory */
-    MmProbeAndLockPages(shared[i].pMdl,KernelMode,IoModifyAccess);
-
-    /* Modify bits to grant user access */
-    _PM_adjustPageTables((ulong)shared[i].linear, size, true, true);
-    return (void*)shared[i].linear;
-}
-
-/****************************************************************************
-REMARKS:
-Free a block of shared memory
-****************************************************************************/
-void PMAPI PM_freeShared(
-    void *p)
-{
-    int i;
-
-    /* Find a shared memory block in our table and free it */
-    for (i = 0; i < MAX_MEMORY_SHARED; i++) {
-       if (shared[i].linear == p) {
-           /* Unlock what we locked */
-           MmUnlockPages(shared[i].pMdl);
-
-           /* Free our MDL */
-           IoFreeMdl(shared[i].pMdl);
-
-           /* Free our mem */
-           ExFreePool(shared[i].linear);
-
-           /* Flag that is entry is available */
-           shared[i].linear = 0;
-           break;
-           }
-       }
-}
-
-/****************************************************************************
-REMARKS:
-Map a physical address to a linear address in the callers process.
-****************************************************************************/
-void * PMAPI PM_mapPhysicalAddr(
-    ulong base,
-    ulong limit,
-    ibool isCached)
-{
-    ulong   linear,length = limit+1;
-    int     i;
-
-    /* Search table of existing mappings to see if we have already mapped */
-    /* a region of memory that will serve this purpose. */
-    for (i = 0; i < numMappings; i++) {
-       if (maps[i].physical == base && maps[i].length == length && maps[i].isCached == isCached) {
-           _PM_adjustPageTables((ulong)maps[i].linear, maps[i].length, true, isCached);
-           return (void*)maps[i].linear;
-           }
-       }
-    if (numMappings == MAX_MEMORY_MAPPINGS)
-       return NULL;
-
-    /* We did not find any previously mapped memory region, so maps it in. */
-    if ((linear = _PM_mapPhysicalToLinear(base,limit,isCached)) == 0xFFFFFFFF)
-       return NULL;
-    maps[numMappings].physical = base;
-    maps[numMappings].length = length;
-    maps[numMappings].linear = linear;
-    maps[numMappings].isCached = isCached;
-    numMappings++;
-
-    /* Grant user access to this I/O space */
-    _PM_adjustPageTables((ulong)linear, length, true, isCached);
-    return (void*)linear;
-}
-
-/****************************************************************************
-REMARKS:
-Free a physical address mapping allocated by PM_mapPhysicalAddr.
-****************************************************************************/
-void PMAPI PM_freePhysicalAddr(
-    void *ptr,
-    ulong limit)
-{
-    /* We don't free the memory mappings in here because we cache all */
-    /* the memory mappings we create in the system for later use. */
-}
-
-/****************************************************************************
-REMARKS:
-Called when the device driver unloads to free all the page table mappings!
-****************************************************************************/
-void PMAPI _PM_freeMemoryMappings(void)
-{
-    int i;
-
-    for (i = 0; i < numMappings; i++)
-       MmUnmapIoSpace((void *)maps[i].linear,maps[i].length);
-}
-
-/****************************************************************************
-REMARKS:
-Find the physical address of a linear memory address in current process.
-****************************************************************************/
-ulong PMAPI PM_getPhysicalAddr(
-    void *p)
-{
-    PHYSICAL_ADDRESS    paOurAddress;
-
-    paOurAddress = MmGetPhysicalAddress(p);
-    return paOurAddress.LowPart;
-}
-
-/****************************************************************************
-REMARKS:
-Find the physical address of a linear memory address in current process.
-****************************************************************************/
-ibool PMAPI PM_getPhysicalAddrRange(
-    void *p,
-    ulong length,
-    ulong *physAddress)
-{
-    int     i;
-    ulong   linear = (ulong)p & ~0xFFF;
-
-    for (i = (length + 0xFFF) >> 12; i > 0; i--) {
-       if ((*physAddress++ = PM_getPhysicalAddr((void*)linear)) == 0xFFFFFFFF)
-           return false;
-       linear += 4096;
-       }
-    return true;
-}
-
-/****************************************************************************
-REMARKS:
-Allocates a block of locked physical memory.
-****************************************************************************/
-void * PMAPI PM_allocLockedMem(
-    uint size,
-    ulong *physAddr,
-    ibool contiguous,
-    ibool below16M)
-{
-    int                 i;
-    PHYSICAL_ADDRESS    paOurAddress;
-
-    /* First find a free slot in our shared memory table */
-    for (i = 0; i < MAX_MEMORY_LOCKED; i++) {
-       if (locked[i].linear == 0)
-           break;
-       }
-    if (i == MAX_MEMORY_LOCKED)
-       return NULL;
-
-    /* HighestAcceptableAddress - Specifies the highest valid physical address */
-    /* the driver can use. For example, if a device can only reference physical */
-    /* memory in the lower 16MB, this value would be set to 0x00000000FFFFFF. */
-    paOurAddress.HighPart = 0;
-    if (below16M)
-       paOurAddress.LowPart = 0x00FFFFFF;
-    else
-       paOurAddress.LowPart = 0xFFFFFFFF;
-
-    if (contiguous) {
-       /* Allocate from the non-paged pool (unfortunately 4MB pages) */
-       locked[i].linear = MmAllocateContiguousMemory(size, paOurAddress);
-       if (!locked[i].linear)
-           return NULL;
-
-       /* Flag no MDL */
-       locked[i].pMdl = NULL;
-
-       /* Map the physical address for the memory so we can manage */
-       /* the page tables in 4KB chunks mapped into user space. */
-
-       /* TODO: Map this with the physical address to the linear addresss */
-       locked[i].mmIoMapped = locked[i].linear;
-
-       /* Modify bits to grant user access, flag not cached */
-       _PM_adjustPageTables((ulong)locked[i].mmIoMapped, size, true, false);
-       return (void*)locked[i].mmIoMapped;
-       }
-    else {
-       /* Allocate from the paged pool */
-       locked[i].linear = ExAllocatePool(PagedPool, size);
-       if (!locked[i].linear)
-           return NULL;
-
-       /* Create a list to manage this allocation */
-       locked[i].pMdl = IoAllocateMdl(locked[i].linear,size,FALSE,FALSE,(PIRP) NULL);
-
-       /* Lock this allocation in memory */
-       MmProbeAndLockPages(locked[i].pMdl,KernelMode,IoModifyAccess);
-
-       /* Modify bits to grant user access, flag not cached */
-       _PM_adjustPageTables((ulong)locked[i].linear, size, true, false);
-       return (void*)locked[i].linear;
-       }
-}
-
-/****************************************************************************
-REMARKS:
-Frees a block of locked physical memory.
-****************************************************************************/
-void PMAPI PM_freeLockedMem(
-    void *p,
-    uint size,
-    ibool contiguous)
-{
-    int i;
-
-    /* Find a locked memory block in our table and free it */
-    for (i = 0; i < MAX_MEMORY_LOCKED; i++) {
-       if (locked[i].linear == p) {
-           /* An Mdl indicates that we used the paged pool, and locked it, */
-           /* so now we have to unlock, free the MDL, and free paged */
-           if (locked[i].pMdl) {
-               /* Unlock what we locked and free the Mdl */
-               MmUnlockPages(locked[i].pMdl);
-               IoFreeMdl(locked[i].pMdl);
-               ExFreePool(locked[i].linear);
-               }
-           else {
-               /* TODO: Free the mmIoMap mapping for the memory! */
-
-               /* Free non-paged pool */
-               MmFreeContiguousMemory(locked[i].linear);
-               }
-
-           /* Flag that is entry is available */
-           locked[i].linear = 0;
-           break;
-           }
-       }
-}
-
-/****************************************************************************
-REMARKS:
-Allocates a page aligned and page sized block of memory
-****************************************************************************/
-void * PMAPI PM_allocPage(
-    ibool locked)
-{
-    /* Allocate the memory from the non-paged pool if we want the memory */
-    /* to be locked. */
-    return ExAllocatePool(
-       locked ? NonPagedPoolCacheAligned : PagedPoolCacheAligned,
-       PAGE_SIZE);
-}
-
-/****************************************************************************
-REMARKS:
-Free a page aligned and page sized block of memory
-****************************************************************************/
-void PMAPI PM_freePage(
-    void *p)
-{
-    if (p) ExFreePool(p);
-}
-
-/****************************************************************************
-REMARKS:
-Lock linear memory so it won't be paged.
-****************************************************************************/
-int PMAPI PM_lockDataPages(
-    void *p,
-    uint len,
-    PM_lockHandle *lh)
-{
-    MDL *pMdl;
-
-    /* Create a list to manage this allocation */
-    if ((pMdl = IoAllocateMdl(p,len,FALSE,FALSE,(PIRP)NULL)) == NULL)
-       return false;
-
-    /* Lock this allocation in memory */
-    MmProbeAndLockPages(pMdl,KernelMode,IoModifyAccess);
-    *((PMDL*)(&lh->h)) = pMdl;
-    return true;
-}
-
-/****************************************************************************
-REMARKS:
-Unlock linear memory so it won't be paged.
-****************************************************************************/
-int PMAPI PM_unlockDataPages(
-    void *p,
-    uint len,
-    PM_lockHandle *lh)
-{
-    if (p && lh) {
-       /* Unlock what we locked */
-       MDL *pMdl = *((PMDL*)(&lh->h));
-       MmUnlockPages(pMdl);
-       IoFreeMdl(pMdl);
-       }
-    return true;
-}
-
-/****************************************************************************
-REMARKS:
-Lock linear memory so it won't be paged.
-****************************************************************************/
-int PMAPI PM_lockCodePages(
-    void (*p)(),
-    uint len,
-    PM_lockHandle *lh)
-{
-    return PM_lockDataPages((void*)p,len,lh);
-}
-
-/****************************************************************************
-REMARKS:
-Unlock linear memory so it won't be paged.
-****************************************************************************/
-int PMAPI PM_unlockCodePages(
-    void (*p)(),
-    uint len,
-    PM_lockHandle *lh)
-{
-    return PM_unlockDataPages((void*)p,len,lh);
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/ntdrv/oshdr.h b/board/MAI/bios_emulator/scitech/src/pm/ntdrv/oshdr.h
deleted file mode 100644 (file)
index 65b7bae..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  32-bit Windows NT drivers
-*
-* Description:  Include file to include all OS specific header files.
-*
-****************************************************************************/
-
-#ifndef __NTDRV_OSHDR_H
-#define __NTDRV_OSHDR_H
-
-/*--------------------------- Macros and Typedefs -------------------------*/
-
-/*---------------------------- Global variables ---------------------------*/
-
-/*--------------------------- Function Prototypes -------------------------*/
-
-/* Internal unicode string handling functions */
-
-UNICODE_STRING *    _PM_CStringToUnicodeString(const char *cstr);
-void                _PM_FreeUnicodeString(UNICODE_STRING *uniStr);
-
-#endif  /* __NTDRV_OSHDR_H */
diff --git a/board/MAI/bios_emulator/scitech/src/pm/ntdrv/pm.c b/board/MAI/bios_emulator/scitech/src/pm/ntdrv/pm.c
deleted file mode 100644 (file)
index c660631..0000000
+++ /dev/null
@@ -1,933 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  32-bit Windows NT device drivers.
-*
-* Description:  Implementation for the OS Portability Manager Library, which
-*               contains functions to implement OS specific services in a
-*               generic, cross platform API. Porting the OS Portability
-*               Manager library is the first step to porting any SciTech
-*               products to a new platform.
-*
-****************************************************************************/
-
-#include "pmapi.h"
-#include "drvlib/os/os.h"
-#include "sdd/sddhelp.h"
-#include "mtrr.h"
-#include "oshdr.h"
-
-/*--------------------------- Global variables ----------------------------*/
-
-char                _PM_cntPath[PM_MAX_PATH] = "";
-char                _PM_nucleusPath[PM_MAX_PATH] = "";
-static void (PMAPIP fatalErrorCleanup)(void) = NULL;
-
-static char *szNTWindowsKey     = "\\REGISTRY\\Machine\\Software\\Microsoft\\Windows NT\\CurrentVersion";
-static char *szNTSystemRoot     = "SystemRoot";
-static char *szMachineNameKey   = "\\REGISTRY\\Machine\\System\\CurrentControlSet\\control\\ComputerName\\ComputerName";
-static char *szMachineNameKeyNT = "\\REGISTRY\\Machine\\System\\CurrentControlSet\\control\\ComputerName\\ActiveComputerName";
-static char *szMachineName      = "ComputerName";
-
-/*----------------------------- Implementation ----------------------------*/
-
-/****************************************************************************
-REMARKS:
-Initialise the PM library.
-****************************************************************************/
-void PMAPI PM_init(void)
-{
-    /* Initialiase the MTRR module */
-    MTRR_init();
-}
-
-/****************************************************************************
-REMARKS:
-Return the operating system type identifier.
-****************************************************************************/
-long PMAPI PM_getOSType(void)
-{
-    return _OS_WINNTDRV;
-}
-
-/****************************************************************************
-REMARKS:
-Return the runtime type identifier.
-****************************************************************************/
-int PMAPI PM_getModeType(void)
-{
-    return PM_386;
-}
-
-/****************************************************************************
-REMARKS:
-Add a file directory separator to the end of the filename.
-****************************************************************************/
-void PMAPI PM_backslash(char *s)
-{
-    uint pos = strlen(s);
-    if (s[pos-1] != '\\') {
-       s[pos] = '\\';
-       s[pos+1] = '\0';
-       }
-}
-
-/****************************************************************************
-REMARKS:
-Add a user defined PM_fatalError cleanup function.
-****************************************************************************/
-void PMAPI PM_setFatalErrorCleanup(
-    void (PMAPIP cleanup)(void))
-{
-    fatalErrorCleanup = cleanup;
-}
-
-/****************************************************************************
-REMARKS:
-Handle fatal errors internally in the driver.
-****************************************************************************/
-void PMAPI PM_fatalError(
-    const char *msg)
-{
-    ULONG   BugCheckCode = 0;
-    ULONG   MoreBugCheckData[4] = {0};
-    char    *p;
-    ULONG   len;
-
-    if (fatalErrorCleanup)
-       fatalErrorCleanup();
-
-#ifdef DBG     /* Send output to debugger, just return so as not to force a reboot */
-#pragma message("INFO: building for debug, PM_fatalError() re-routed")
-       DBGMSG2("SDDHELP> PM_fatalError(): ERROR: %s\n", msg);
-       return ;
-#endif
-    /* KeBugCheckEx brings down the system in a controlled */
-    /* manner when the caller discovers an unrecoverable */
-    /* inconsistency that would corrupt the system if */
-    /* the caller continued to run. */
-    /* */
-    /* hack - dump the first 20 chars in hex using the variables */
-    /*      provided - Each ULONG is equal to four characters... */
-    for(len = 0; len < 20; len++)
-       if (msg[len] == (char)0)
-           break;
-
-    /* This looks bad but it's quick and reliable... */
-    p = (char *)&BugCheckCode;
-    if(len > 0) p[3] = msg[0];
-    if(len > 1) p[2] = msg[1];
-    if(len > 2) p[1] = msg[2];
-    if(len > 3) p[0] = msg[3];
-
-    p = (char *)&MoreBugCheckData[0];
-    if(len > 4) p[3] = msg[4];
-    if(len > 5) p[2] = msg[5];
-    if(len > 6) p[1] = msg[6];
-    if(len > 7) p[0] = msg[7];
-
-    p = (char *)&MoreBugCheckData[1];
-    if(len > 8) p[3] = msg[8];
-    if(len > 9) p[2] = msg[9];
-    if(len > 10) p[1] = msg[10];
-    if(len > 11) p[0] = msg[11];
-
-    p = (char *)&MoreBugCheckData[2];
-    if(len > 12) p[3] = msg[12];
-    if(len > 13) p[2] = msg[13];
-    if(len > 14) p[1] = msg[14];
-    if(len > 15) p[0] = msg[15];
-
-    p = (char *)&MoreBugCheckData[3];
-    if(len > 16) p[3] = msg[16];
-    if(len > 17) p[2] = msg[17];
-    if(len > 18) p[1] = msg[18];
-    if(len > 19) p[0] = msg[19];
-
-    /* Halt the system! */
-    KeBugCheckEx(BugCheckCode, MoreBugCheckData[0], MoreBugCheckData[1], MoreBugCheckData[2], MoreBugCheckData[3]);
-}
-
-/****************************************************************************
-REMARKS:
-Return the current operating system path or working directory.
-****************************************************************************/
-char * PMAPI PM_getCurrentPath(
-    char *path,
-    int maxLen)
-{
-    strncpy(path,_PM_cntPath,maxLen);
-    path[maxLen-1] = 0;
-    return path;
-}
-
-/****************************************************************************
-PARAMETERS:
-szKey       - Key to query (can contain version number formatting)
-szValue     - Value to get information for
-value       - Place to store the registry key data read
-size        - Size of the string buffer to read into
-
-RETURNS:
-true if the key was found, false if not.
-****************************************************************************/
-static ibool REG_queryString(
-    char *szKey,
-    const char *szValue,
-    char *value,
-    DWORD size)
-{
-    ibool                           status;
-    NTSTATUS                        rval;
-    ULONG                           length;
-    HANDLE                          Handle;
-    OBJECT_ATTRIBUTES               keyAttributes;
-    UNICODE_STRING                  *uniKey = NULL;
-    UNICODE_STRING                  *uniValue = NULL;
-    PKEY_VALUE_FULL_INFORMATION                fullInfo = NULL;
-    STRING                          stringdata;
-    UNICODE_STRING                  unidata;
-
-    /* Convert strings to UniCode */
-    status = false;
-    if ((uniKey = _PM_CStringToUnicodeString(szKey)) == NULL)
-       goto Exit;
-    if ((uniValue = _PM_CStringToUnicodeString(szValue)) == NULL)
-       goto Exit;
-
-    /* Open the key */
-    InitializeObjectAttributes( &keyAttributes,
-                               uniKey,
-                               OBJ_CASE_INSENSITIVE,
-                               NULL,
-                               NULL );
-    rval = ZwOpenKey( &Handle,
-                     KEY_ALL_ACCESS,
-                     &keyAttributes );
-    if (!NT_SUCCESS(rval))
-       goto Exit;
-
-    /* Query the value */
-    length = sizeof (KEY_VALUE_FULL_INFORMATION)
-          + size * sizeof(WCHAR);
-    if ((fullInfo = ExAllocatePool (PagedPool, length)) == NULL)
-       goto Exit;
-    RtlZeroMemory(fullInfo, length);
-    rval = ZwQueryValueKey (Handle,
-                           uniValue,
-                           KeyValueFullInformation,
-                           fullInfo,
-                           length,
-                           &length);
-    if (NT_SUCCESS (rval)) {
-       /* Create the UniCode string so we can convert it */
-       unidata.Buffer = (PWCHAR)(((PCHAR)fullInfo) + fullInfo->DataOffset);
-       unidata.Length = (USHORT)fullInfo->DataLength;
-       unidata.MaximumLength = (USHORT)fullInfo->DataLength + sizeof(WCHAR);
-
-       /* Convert unicode univalue to ansi string. */
-       rval = RtlUnicodeStringToAnsiString(&stringdata, &unidata, TRUE);
-       if (NT_SUCCESS(rval)) {
-           strcpy(value,stringdata.Buffer);
-           status = true;
-           }
-       }
-
-Exit:
-    if (fullInfo) ExFreePool(fullInfo);
-    if (uniKey) _PM_FreeUnicodeString(uniKey);
-    if (uniValue) _PM_FreeUnicodeString(uniValue);
-    return status;
-}
-
-/****************************************************************************
-REMARKS:
-Return the drive letter for the boot drive.
-****************************************************************************/
-char PMAPI PM_getBootDrive(void)
-{
-    char path[256];
-    if (REG_queryString(szNTWindowsKey,szNTSystemRoot,path,sizeof(path)))
-       return 'c';
-    return path[0];
-}
-
-/****************************************************************************
-REMARKS:
-Return the path to the VBE/AF driver files.
-****************************************************************************/
-const char * PMAPI PM_getVBEAFPath(void)
-{
-    return "c:\\";
-}
-
-/****************************************************************************
-REMARKS:
-Return the path to the Nucleus driver files.
-****************************************************************************/
-const char * PMAPI PM_getNucleusPath(void)
-{
-    static char path[256];
-
-    if (strlen(_PM_nucleusPath) > 0) {
-       strcpy(path,_PM_nucleusPath);
-       PM_backslash(path);
-       return path;
-       }
-    if (!REG_queryString(szNTWindowsKey,szNTSystemRoot,path,sizeof(path)))
-       strcpy(path,"c:\\winnt");
-    PM_backslash(path);
-    strcat(path,"system32\\nucleus");
-    return path;
-}
-
-/****************************************************************************
-REMARKS:
-Return the path to the Nucleus configuration files.
-****************************************************************************/
-const char * PMAPI PM_getNucleusConfigPath(void)
-{
-    static char path[256];
-    strcpy(path,PM_getNucleusPath());
-    PM_backslash(path);
-    strcat(path,"config");
-    return path;
-}
-
-/****************************************************************************
-REMARKS:
-Return a unique identifier for the machine if possible.
-****************************************************************************/
-const char * PMAPI PM_getUniqueID(void)
-{
-    return PM_getMachineName();
-}
-
-/****************************************************************************
-REMARKS:
-Get the name of the machine on the network.
-****************************************************************************/
-const char * PMAPI PM_getMachineName(void)
-{
-    static char name[256];
-
-    if (REG_queryString(szMachineNameKey,szMachineName,name,sizeof(name)))
-       return name;
-    if (REG_queryString(szMachineNameKeyNT,szMachineName,name,sizeof(name)))
-       return name;
-    return "Unknown";
-}
-
-/****************************************************************************
-REMARKS:
-Check if a key has been pressed.
-****************************************************************************/
-int PMAPI PM_kbhit(void)
-{
-    /* Not used in NT drivers */
-    return true;
-}
-
-/****************************************************************************
-REMARKS:
-Wait for and return the next keypress.
-****************************************************************************/
-int PMAPI PM_getch(void)
-{
-    /* Not used in NT drivers */
-    return 0xD;
-}
-
-/****************************************************************************
-REMARKS:
-Open a console for output to the screen, creating the main event handling
-window if necessary.
-****************************************************************************/
-PM_HWND PMAPI PM_openConsole(
-    PM_HWND hwndUser,
-    int device,
-    int xRes,
-    int yRes,
-    int bpp,
-    ibool fullScreen)
-{
-    /* Not used in NT drivers */
-    (void)hwndUser;
-    (void)device;
-    (void)xRes;
-    (void)yRes;
-    (void)bpp;
-    (void)fullScreen;
-    return NULL;
-}
-
-/****************************************************************************
-REMARKS:
-Find the size of the console state buffer.
-****************************************************************************/
-int PMAPI PM_getConsoleStateSize(void)
-{
-    /* Not used in NT drivers */
-    return 1;
-}
-
-/****************************************************************************
-REMARKS:
-Save the state of the console.
-****************************************************************************/
-void PMAPI PM_saveConsoleState(
-    void *stateBuf,
-    PM_HWND hwndConsole)
-{
-    /* Not used in NT drivers */
-    (void)stateBuf;
-    (void)hwndConsole;
-}
-
-/****************************************************************************
-REMARKS:
-Set the suspend application callback for the fullscreen console.
-****************************************************************************/
-void PMAPI PM_setSuspendAppCallback(
-    PM_saveState_cb saveState)
-{
-    /* Not used in NT drivers */
-    (void)saveState;
-}
-
-/****************************************************************************
-REMARKS:
-Restore the console state.
-****************************************************************************/
-void PMAPI PM_restoreConsoleState(
-    const void *stateBuf,
-    PM_HWND hwndConsole)
-{
-    /* Not used in NT drivers */
-    (void)stateBuf;
-    (void)hwndConsole;
-}
-
-/****************************************************************************
-REMARKS:
-Close the fullscreen console.
-****************************************************************************/
-void PMAPI PM_closeConsole(
-    PM_HWND hwndConsole)
-{
-    /* Not used in NT drivers */
-    (void)hwndConsole;
-}
-
-/****************************************************************************
-REMARKS:
-Set the location of the OS console cursor.
-****************************************************************************/
-void PMAPI PM_setOSCursorLocation(
-    int x,
-    int y)
-{
-    /* Nothing to do for Windows */
-    (void)x;
-    (void)y;
-}
-
-/****************************************************************************
-REMARKS:
-Set the width of the OS console.
-****************************************************************************/
-void PMAPI PM_setOSScreenWidth(
-    int width,
-    int height)
-{
-    /* Nothing to do for Windows */
-    (void)width;
-    (void)height;
-}
-
-/****************************************************************************
-REMARKS:
-Maps a shared memory block into process address space. Does nothing since
-the memory blocks are already globally mapped into all processes.
-****************************************************************************/
-void * PMAPI PM_mapToProcess(
-    void *base,
-    ulong limit)
-{
-    /* Not used anymore */
-    (void)base;
-    (void)limit;
-    return NULL;
-}
-
-/****************************************************************************
-REMARKS:
-Execute the POST on the secondary BIOS for a controller.
-****************************************************************************/
-ibool PMAPI PM_doBIOSPOST(
-    ushort axVal,
-    ulong BIOSPhysAddr,
-    void *mappedBIOS,
-    ulong BIOSLen)
-{
-    /* This may not be possible in NT and should be done by the OS anyway */
-    (void)axVal;
-    (void)BIOSPhysAddr;
-    (void)mappedBIOS;
-    (void)BIOSLen;
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-Return a pointer to the real mode BIOS data area.
-****************************************************************************/
-void * PMAPI PM_getBIOSPointer(void)
-{
-    /* Note that on NT this probably does not do what we expect! */
-    return PM_mapPhysicalAddr(0x400, 0x1000, true);
-}
-
-/****************************************************************************
-REMARKS:
-Return a pointer to 0xA0000 physical VGA graphics framebuffer.
-****************************************************************************/
-void * PMAPI PM_getA0000Pointer(void)
-{
-    return PM_mapPhysicalAddr(0xA0000,0xFFFF,false);
-}
-
-/****************************************************************************
-REMARKS:
-Sleep for the specified number of milliseconds.
-****************************************************************************/
-void PMAPI PM_sleep(
-    ulong milliseconds)
-{
-    /* We never use this in NT drivers */
-    (void)milliseconds;
-}
-
-/****************************************************************************
-REMARKS:
-Return the base I/O port for the specified COM port.
-****************************************************************************/
-int PMAPI PM_getCOMPort(int port)
-{
-    /* TODO: Re-code this to determine real values using the Plug and Play */
-    /*       manager for the OS. */
-    switch (port) {
-       case 0: return 0x3F8;
-       case 1: return 0x2F8;
-       case 2: return 0x3E8;
-       case 3: return 0x2E8;
-       }
-    return 0;
-}
-
-/****************************************************************************
-REMARKS:
-Return the base I/O port for the specified LPT port.
-****************************************************************************/
-int PMAPI PM_getLPTPort(int port)
-{
-    /* TODO: Re-code this to determine real values using the Plug and Play */
-    /*       manager for the OS. */
-    switch (port) {
-       case 0: return 0x3BC;
-       case 1: return 0x378;
-       case 2: return 0x278;
-       }
-    return 0;
-}
-
-/****************************************************************************
-REMARKS:
-Returns available memory. Not possible under Windows.
-****************************************************************************/
-void PMAPI PM_availableMemory(
-    ulong *physical,
-    ulong *total)
-{
-    *physical = *total = 0;
-}
-
-/****************************************************************************
-REMARKS:
-OS specific shared libraries not supported inside a VxD
-****************************************************************************/
-PM_MODULE PMAPI PM_loadLibrary(
-    const char *szDLLName)
-{
-    /* Not used in NT drivers */
-    (void)szDLLName;
-    return NULL;
-}
-
-/****************************************************************************
-REMARKS:
-OS specific shared libraries not supported inside a VxD
-****************************************************************************/
-void * PMAPI PM_getProcAddress(
-    PM_MODULE hModule,
-    const char *szProcName)
-{
-    /* Not used in NT drivers */
-    (void)hModule;
-    (void)szProcName;
-    return NULL;
-}
-
-/****************************************************************************
-REMARKS:
-OS specific shared libraries not supported inside a VxD
-****************************************************************************/
-void PMAPI PM_freeLibrary(
-    PM_MODULE hModule)
-{
-    /* Not used in NT drivers */
-    (void)hModule;
-}
-
-/****************************************************************************
-REMARKS:
-Function to find the first file matching a search criteria in a directory.
-****************************************************************************/
-void *PMAPI PM_findFirstFile(
-    const char *filename,
-    PM_findData *findData)
-{
-    /* TODO: This function should start a directory enumeration search */
-    /*       given the filename (with wildcards). The data should be */
-    /*       converted and returned in the findData standard form. */
-    (void)filename;
-    (void)findData;
-    return PM_FILE_INVALID;
-}
-
-/****************************************************************************
-REMARKS:
-Function to find the next file matching a search criteria in a directory.
-****************************************************************************/
-ibool PMAPI PM_findNextFile(
-    void *handle,
-    PM_findData *findData)
-{
-    /* TODO: This function should find the next file in directory enumeration */
-    /*       search given the search criteria defined in the call to */
-    /*       PM_findFirstFile. The data should be converted and returned */
-    /*       in the findData standard form. */
-    (void)handle;
-    (void)findData;
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-Function to close the find process
-****************************************************************************/
-void PMAPI PM_findClose(
-    void *handle)
-{
-    /* TODO: This function should close the find process. This may do */
-    /*       nothing for some OS'es. */
-    (void)handle;
-}
-
-/****************************************************************************
-REMARKS:
-Function to determine if a drive is a valid drive or not. Under Unix this
-function will return false for anything except a value of 3 (considered
-the root drive, and equivalent to C: for non-Unix systems). The drive
-numbering is:
-
-    1   - Drive A:
-    2   - Drive B:
-    3   - Drive C:
-    etc
-
-****************************************************************************/
-ibool PMAPI PM_driveValid(
-    char drive)
-{
-    /* Not supported in NT drivers */
-    (void)drive;
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-Function to get the current working directory for the specififed drive.
-Under Unix this will always return the current working directory regardless
-of what the value of 'drive' is.
-****************************************************************************/
-void PMAPI PM_getdcwd(
-    int drive,
-    char *dir,
-    int len)
-{
-    /* Not supported in NT drivers */
-    (void)drive;
-    (void)dir;
-    (void)len;
-}
-
-/****************************************************************************
-PARAMETERS:
-base    - The starting physical base address of the region
-size    - The size in bytes of the region
-type    - Type to place into the MTRR register
-
-RETURNS:
-Error code describing the result.
-
-REMARKS:
-Function to enable write combining for the specified region of memory.
-****************************************************************************/
-int PMAPI PM_enableWriteCombine(
-    ulong base,
-    ulong size,
-    uint type)
-{
-    return MTRR_enableWriteCombine(base,size,type);
-}
-
-/****************************************************************************
-REMARKS:
-Function to change the file attributes for a specific file.
-****************************************************************************/
-void PMAPI PM_setFileAttr(
-    const char *filename,
-    uint attrib)
-{
-    NTSTATUS                status;
-    ACCESS_MASK             DesiredAccess = GENERIC_READ | GENERIC_WRITE;
-    OBJECT_ATTRIBUTES       ObjectAttributes;
-    ULONG                   ShareAccess = FILE_SHARE_READ;
-    ULONG                   CreateDisposition = FILE_OPEN;
-    HANDLE                  FileHandle = NULL;
-    UNICODE_STRING          *uniFile = NULL;
-    IO_STATUS_BLOCK         IoStatusBlock;
-    FILE_BASIC_INFORMATION  FileBasic;
-    char                    kernelFilename[PM_MAX_PATH+5];
-    ULONG                   FileAttributes = 0;
-
-    /* Convert file attribute flags */
-    if (attrib & PM_FILE_READONLY)
-       FileAttributes |= FILE_ATTRIBUTE_READONLY;
-    if (attrib & PM_FILE_ARCHIVE)
-       FileAttributes |= FILE_ATTRIBUTE_ARCHIVE;
-    if (attrib & PM_FILE_HIDDEN)
-       FileAttributes |= FILE_ATTRIBUTE_HIDDEN;
-    if (attrib & PM_FILE_SYSTEM)
-       FileAttributes |= FILE_ATTRIBUTE_SYSTEM;
-
-    /* Add prefix for addressing the file system. "\??\" is short for "\DosDevices\" */
-    strcpy(kernelFilename, "\\??\\");
-    strcat(kernelFilename, filename);
-
-    /* Convert filename string to ansi string */
-    if ((uniFile = _PM_CStringToUnicodeString(kernelFilename)) == NULL)
-       goto Exit;
-
-    /* Must open a file to query it's attributes */
-    InitializeObjectAttributes (&ObjectAttributes,
-                               uniFile,
-                               OBJ_CASE_INSENSITIVE,
-                               NULL,
-                               NULL );
-    status = ZwCreateFile( &FileHandle,
-                           DesiredAccess | SYNCHRONIZE,
-                           &ObjectAttributes,
-                           &IoStatusBlock,
-                           NULL,                  /*AllocationSize  OPTIONAL, */
-                           FILE_ATTRIBUTE_NORMAL,
-                           ShareAccess,
-                           CreateDisposition,
-                           FILE_RANDOM_ACCESS,        /*CreateOptions, */
-                           NULL,                  /*EaBuffer  OPTIONAL, */
-                           0                      /*EaLength (required if EaBuffer) */
-                           );
-    if (!NT_SUCCESS (status))
-       goto Exit;
-
-    /* Query timestamps */
-    status = ZwQueryInformationFile(FileHandle,
-                                   &IoStatusBlock,
-                                   &FileBasic,
-                                   sizeof(FILE_BASIC_INFORMATION),
-                                   FileBasicInformation
-                                   );
-    if (!NT_SUCCESS (status))
-       goto Exit;
-
-    /* Change the four bits we change */
-    FileBasic.FileAttributes &= ~(FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_ARCHIVE
-                                 | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM);
-    FileBasic.FileAttributes |= FileAttributes;
-
-    /* Set timestamps */
-    ZwSetInformationFile(   FileHandle,
-                           &IoStatusBlock,
-                           &FileBasic,
-                           sizeof(FILE_BASIC_INFORMATION),
-                           FileBasicInformation
-                           );
-
-Exit:
-    if (FileHandle) ZwClose(FileHandle);
-    if (uniFile) _PM_FreeUnicodeString(uniFile);
-    return;
-}
-
-/****************************************************************************
-REMARKS:
-Function to get the file attributes for a specific file.
-****************************************************************************/
-uint PMAPI PM_getFileAttr(
-    const char *filename)
-{
-    NTSTATUS                status;
-    ACCESS_MASK             DesiredAccess = GENERIC_READ | GENERIC_WRITE;
-    OBJECT_ATTRIBUTES       ObjectAttributes;
-    ULONG                   ShareAccess = FILE_SHARE_READ;
-    ULONG                   CreateDisposition = FILE_OPEN;
-    HANDLE                  FileHandle = NULL;
-    UNICODE_STRING          *uniFile = NULL;
-    IO_STATUS_BLOCK         IoStatusBlock;
-    FILE_BASIC_INFORMATION  FileBasic;
-    char                    kernelFilename[PM_MAX_PATH+5];
-    ULONG                   FileAttributes = 0;
-    uint                    retval = 0;
-
-    /* Add prefix for addressing the file system. "\??\" is short for "\DosDevices\" */
-    strcpy(kernelFilename, "\\??\\");
-    strcat(kernelFilename, filename);
-
-    /* Convert filename string to ansi string */
-    if ((uniFile = _PM_CStringToUnicodeString(kernelFilename)) == NULL)
-       goto Exit;
-
-    /* Must open a file to query it's attributes */
-    InitializeObjectAttributes (&ObjectAttributes,
-                               uniFile,
-                               OBJ_CASE_INSENSITIVE,
-                               NULL,
-                               NULL );
-    status = ZwCreateFile( &FileHandle,
-                          DesiredAccess | SYNCHRONIZE,
-                          &ObjectAttributes,
-                          &IoStatusBlock,
-                          NULL,                  /*AllocationSize  OPTIONAL, */
-                          FILE_ATTRIBUTE_NORMAL,
-                          ShareAccess,
-                          CreateDisposition,
-                          FILE_RANDOM_ACCESS,        /*CreateOptions, */
-                          NULL,                  /*EaBuffer  OPTIONAL, */
-                          0                      /*EaLength (required if EaBuffer) */
-                          );
-    if (!NT_SUCCESS (status))
-       goto Exit;
-
-    /* Query timestamps */
-    status = ZwQueryInformationFile(FileHandle,
-                                   &IoStatusBlock,
-                                   &FileBasic,
-                                   sizeof(FILE_BASIC_INFORMATION),
-                                   FileBasicInformation
-                                   );
-    if (!NT_SUCCESS (status))
-       goto Exit;
-
-    /* Translate the file attributes */
-    if (FileBasic.FileAttributes & FILE_ATTRIBUTE_READONLY)
-       retval |= PM_FILE_READONLY;
-    if (FileBasic.FileAttributes & FILE_ATTRIBUTE_ARCHIVE)
-       retval |= PM_FILE_ARCHIVE;
-    if (FileBasic.FileAttributes & FILE_ATTRIBUTE_HIDDEN)
-       retval |= PM_FILE_HIDDEN;
-    if (FileBasic.FileAttributes & FILE_ATTRIBUTE_SYSTEM)
-       retval |= PM_FILE_SYSTEM;
-
-Exit:
-    if (FileHandle) ZwClose(FileHandle);
-    if (uniFile) _PM_FreeUnicodeString(uniFile);
-    return retval;
-}
-
-/****************************************************************************
-REMARKS:
-Function to create a directory.
-****************************************************************************/
-ibool PMAPI PM_mkdir(
-    const char *filename)
-{
-    /* Not supported in NT drivers */
-    (void)filename;
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-Function to remove a directory.
-****************************************************************************/
-ibool PMAPI PM_rmdir(
-    const char *filename)
-{
-    /* Not supported in NT drivers */
-    (void)filename;
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-Function to get the file time and date for a specific file.
-****************************************************************************/
-ibool PMAPI PM_getFileTime(
-    const char *filename,
-    ibool gmTime,
-    PM_time *time)
-{
-    /* Not supported in NT drivers */
-    (void)filename;
-    (void)gmTime;
-    (void)time;
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-Function to set the file time and date for a specific file.
-****************************************************************************/
-ibool PMAPI PM_setFileTime(
-    const char *filename,
-    ibool gmTime,
-    PM_time *time)
-{
-    /* Not supported in NT drivers */
-    (void)filename;
-    (void)gmTime;
-    (void)time;
-    return false;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/ntdrv/stdio.c b/board/MAI/bios_emulator/scitech/src/pm/ntdrv/stdio.c
deleted file mode 100644 (file)
index 658f1c8..0000000
+++ /dev/null
@@ -1,330 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  32-bit Windows NT driver
-*
-* Description:  C library compatible I/O functions for use within a Windows
-*               NT driver.
-*
-****************************************************************************/
-
-#include "pmapi.h"
-#include "oshdr.h"
-
-/*------------------------ Main Code Implementation -----------------------*/
-
-/****************************************************************************
-REMARKS:
-NT driver implementation of the ANSI C fopen function.
-****************************************************************************/
-FILE * fopen(
-    const char *filename,
-    const char *mode)
-{
-    ACCESS_MASK                 DesiredAccess;      /* for ZwCreateFile... */
-    OBJECT_ATTRIBUTES           ObjectAttributes;
-    ULONG                       ShareAccess;
-    ULONG                       CreateDisposition;
-    NTSTATUS                    status;
-    HANDLE                      FileHandle;
-    UNICODE_STRING              *uniFile = NULL;
-    PWCHAR                      bufFile = NULL;
-    IO_STATUS_BLOCK             IoStatusBlock;
-    FILE_STANDARD_INFORMATION   FileInformation;
-    FILE_POSITION_INFORMATION   FilePosition;
-    char                        kernelFilename[PM_MAX_PATH+5];
-    FILE                        *f;
-
-    /* Add prefix for addressing the file system. "\??\" is short for "\DosDevices\" */
-    strcpy(kernelFilename, "\\??\\");
-    strcat(kernelFilename, filename);
-    if ((f = PM_malloc(sizeof(FILE))) == NULL)
-       goto Error;
-    f->offset = 0;
-    f->text = (mode[1] == 't' || mode[2] == 't');
-    f->writemode = (mode[0] == 'w') || (mode[0] == 'a');
-    if (mode[0] == 'r') {
-       /* omode = OPEN_ACCESS_READONLY | OPEN_SHARE_COMPATIBLE; */
-       /* action = ACTION_IFEXISTS_OPEN | ACTION_IFNOTEXISTS_FAIL; */
-       DesiredAccess = GENERIC_READ;
-       ShareAccess = FILE_SHARE_READ | FILE_SHARE_WRITE;
-       CreateDisposition = FILE_OPEN;
-       }
-    else if (mode[0] == 'w') {
-       /* omode = OPEN_ACCESS_WRITEONLY | OPEN_SHARE_COMPATIBLE; */
-       /* action = ACTION_IFEXISTS_TRUNCATE | ACTION_IFNOTEXISTS_CREATE; */
-       DesiredAccess = GENERIC_WRITE;
-       ShareAccess = FILE_SHARE_READ | FILE_SHARE_WRITE;
-       CreateDisposition = FILE_SUPERSEDE;
-       }
-    else {
-       /* omode = OPEN_ACCESS_READWRITE | OPEN_SHARE_COMPATIBLE; */
-       /* action = ACTION_IFEXISTS_OPEN | ACTION_IFNOTEXISTS_CREATE; */
-       DesiredAccess = GENERIC_READ | GENERIC_WRITE;
-       ShareAccess = FILE_SHARE_READ;
-       CreateDisposition = FILE_OPEN_IF;
-       }
-
-    /* Convert filename string to ansi string and then to UniCode string */
-    if ((uniFile = _PM_CStringToUnicodeString(kernelFilename)) == NULL)
-       return NULL;
-
-    /* Create the file */
-    InitializeObjectAttributes (&ObjectAttributes,
-                               uniFile,
-                               OBJ_CASE_INSENSITIVE,
-                               NULL,
-                               NULL);
-    status = ZwCreateFile( &FileHandle,
-                           DesiredAccess | SYNCHRONIZE,
-                           &ObjectAttributes,
-                           &IoStatusBlock,
-                           NULL,                   /* AllocationSize  OPTIONAL, */
-                           FILE_ATTRIBUTE_NORMAL,
-                           ShareAccess,
-                           CreateDisposition,
-                           FILE_RANDOM_ACCESS,     /* CreateOptions, */
-                           NULL,                   /* EaBuffer  OPTIONAL, */
-                           0                       /* EaLength (required if EaBuffer) */
-                           );
-    if (!NT_SUCCESS (status))
-       goto Error;
-    f->handle = (int)FileHandle;
-
-    /* Determine size of the file */
-    status = ZwQueryInformationFile(  FileHandle,
-                                     &IoStatusBlock,
-                                     &FileInformation,
-                                     sizeof(FILE_STANDARD_INFORMATION),
-                                     FileStandardInformation
-                                     );
-    if (!NT_SUCCESS (status))
-       goto Error;
-    f->filesize = FileInformation.EndOfFile.LowPart;
-
-    /* Move to the end of the file if we are appending */
-    if (mode[0] == 'a') {
-       FilePosition.CurrentByteOffset.HighPart = 0;
-       FilePosition.CurrentByteOffset.LowPart = f->filesize;
-       status = ZwSetInformationFile(  FileHandle,
-                                       &IoStatusBlock,
-                                       &FilePosition,
-                                       sizeof(FILE_POSITION_INFORMATION),
-                                       FilePositionInformation
-                                       );
-       if (!NT_SUCCESS (status))
-           goto Error;
-       }
-    return f;
-
-Error:
-    if (f) PM_free(f);
-    if (uniFile) _PM_FreeUnicodeString(uniFile);
-    return NULL;
-}
-
-/****************************************************************************
-REMARKS:
-NT driver implementation of the ANSI C fread function.
-****************************************************************************/
-size_t fread(
-    void *ptr,
-    size_t size,
-    size_t n,
-    FILE *f)
-{
-    NTSTATUS        status;
-    IO_STATUS_BLOCK IoStatusBlock;
-    LARGE_INTEGER   ByteOffset;
-
-    /* Read any extra bytes from the file */
-    ByteOffset.HighPart = 0;
-    ByteOffset.LowPart = f->offset;
-    status = ZwReadFile( (HANDLE)f->handle,
-                        NULL,              /*IN HANDLE  Event  OPTIONAL, */
-                        NULL,              /*  IN PIO_APC_ROUTINE  ApcRoutine  OPTIONAL, */
-                        NULL,              /*  IN PVOID  ApcContext  OPTIONAL, */
-                        &IoStatusBlock,
-                        ptr,               /*  OUT PVOID  Buffer, */
-                        size * n,          /*IN ULONG  Length, */
-                        &ByteOffset,       /*OPTIONAL, */
-                        NULL               /*IN PULONG  Key  OPTIONAL */
-                        );
-    if (!NT_SUCCESS (status))
-       return 0;
-    f->offset += IoStatusBlock.Information;
-    return IoStatusBlock.Information / size;
-}
-
-/****************************************************************************
-REMARKS:
-NT driver implementation of the ANSI C fwrite function.
-****************************************************************************/
-size_t fwrite(
-    const void *ptr,
-    size_t size,
-    size_t n,
-    FILE *f)
-{
-    NTSTATUS        status;
-    IO_STATUS_BLOCK IoStatusBlock;
-    LARGE_INTEGER   ByteOffset;
-
-    if (!f->writemode)
-       return 0;
-    ByteOffset.HighPart = 0;
-    ByteOffset.LowPart = f->offset;
-    status = ZwWriteFile( (HANDLE)f->handle,
-                         NULL,             /*IN HANDLE  Event  OPTIONAL, */
-                         NULL,             /*  IN PIO_APC_ROUTINE  ApcRoutine  OPTIONAL, */
-                         NULL,             /*  IN PVOID  ApcContext  OPTIONAL, */
-                         &IoStatusBlock,
-                         (void*)ptr,       /*  OUT PVOID  Buffer, */
-                         size * n,         /*IN ULONG  Length, */
-                         &ByteOffset,      /*OPTIONAL, */
-                         NULL              /*IN PULONG  Key  OPTIONAL */
-                         );
-    if (!NT_SUCCESS (status))
-       return 0;
-    f->offset += IoStatusBlock.Information;
-    if (f->offset > f->filesize)
-       f->filesize = f->offset;
-    return IoStatusBlock.Information / size;
-}
-
-/****************************************************************************
-REMARKS:
-NT driver implementation of the ANSI C fflush function.
-****************************************************************************/
-int fflush(
-    FILE *f)
-{
-    /* Nothing to do here as we are not doing buffered I/O */
-    (void)f;
-    return 0;
-}
-
-/****************************************************************************
-REMARKS:
-NT driver implementation of the ANSI C fseek function.
-****************************************************************************/
-int fseek(
-    FILE *f,
-    long int offset,
-    int whence)
-{
-    NTSTATUS                    status;
-    FILE_POSITION_INFORMATION   FilePosition;
-    IO_STATUS_BLOCK             IoStatusBlock;
-
-    if (whence == 0)
-       f->offset = offset;
-    else if (whence == 1)
-       f->offset += offset;
-    else if (whence == 2)
-       f->offset = f->filesize + offset;
-    FilePosition.CurrentByteOffset.HighPart = 0;
-    FilePosition.CurrentByteOffset.LowPart = f->offset;
-    status = ZwSetInformationFile( (HANDLE)f->handle,
-                                  &IoStatusBlock,
-                                  &FilePosition,
-                                  sizeof(FILE_POSITION_INFORMATION),
-                                  FilePositionInformation
-                                  );
-    if (!NT_SUCCESS (status))
-       return -1;
-    return 0;
-}
-
-/****************************************************************************
-REMARKS:
-NT driver implementation of the ANSI C ftell function.
-****************************************************************************/
-long ftell(
-    FILE *f)
-{
-    return f->offset;
-}
-
-/****************************************************************************
-REMARKS:
-NT driver implementation of the ANSI C feof function.
-****************************************************************************/
-int feof(
-    FILE *f)
-{
-    return (f->offset == f->filesize);
-}
-
-/****************************************************************************
-REMARKS:
-NT driver implementation of the ANSI C fgets function.
-****************************************************************************/
-char *fgets(
-    char *s,
-    int n,
-    FILE *f)
-{
-    int     len;
-    char    *cs;
-
-    /* Read the entire buffer into memory (our functions are unbuffered!) */
-    if ((len = fread(s,1,n,f)) == 0)
-       return NULL;
-
-    /* Search for '\n' or end of string */
-    if (n > len)
-       n = len;
-    cs = s;
-    while (--n > 0) {
-       if (*cs == '\n')
-           break;
-       cs++;
-       }
-    *cs = '\0';
-    return s;
-}
-
-/****************************************************************************
-REMARKS:
-NT driver implementation of the ANSI C fputs function.
-****************************************************************************/
-int fputs(
-    const char *s,
-    FILE *f)
-{
-    return fwrite(s,1,strlen(s),f);
-}
-
-/****************************************************************************
-REMARKS:
-NT driver implementation of the ANSI C fclose function.
-****************************************************************************/
-int fclose(
-    FILE *f)
-{
-    ZwClose((HANDLE)f->handle);
-    PM_free(f);
-    return 0;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/ntdrv/stdlib.c b/board/MAI/bios_emulator/scitech/src/pm/ntdrv/stdlib.c
deleted file mode 100644 (file)
index bbf0cbf..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  32-bit Windows NT driver
-*
-* Description:  C library compatible stdlib.h functions for use within a
-*               Windows NT driver.
-*
-****************************************************************************/
-
-#include "pmapi.h"
-#include "oshdr.h"
-
-/*------------------------ Main Code Implementation -----------------------*/
-
-/****************************************************************************
-REMARKS:
-PM_malloc override function for Nucleus drivers loaded in NT drivers's.
-****************************************************************************/
-void * malloc(
-    size_t size)
-{
-    return PM_mallocShared(size);
-}
-
-/****************************************************************************
-REMARKS:
-calloc library function for Nucleus drivers loaded in NT drivers's.
-****************************************************************************/
-void * calloc(
-    size_t nelem,
-    size_t size)
-{
-    void *p = PM_mallocShared(nelem * size);
-    if (p)
-       memset(p,0,nelem * size);
-    return p;
-}
-
-/****************************************************************************
-REMARKS:
-PM_realloc override function for Nucleus drivers loaded in VxD's.
-****************************************************************************/
-void * realloc(
-    void *ptr,
-    size_t size)
-{
-    void *p = PM_mallocShared(size);
-    if (p) {
-       memcpy(p,ptr,size);
-       PM_freeShared(ptr);
-       }
-    return p;
-}
-
-/****************************************************************************
-REMARKS:
-PM_free override function for Nucleus drivers loaded in VxD's.
-****************************************************************************/
-void free(
-    void *p)
-{
-    PM_freeShared(p);
-}
-
-/****************************************************************************
-PARAMETERS:
-cstr    - C style ANSI string to convert
-
-RETURNS:
-Pointer to the UniCode string structure or NULL on failure to allocate memory
-
-REMARKS:
-Converts a C style string to a UniCode string structure that can be passed
-directly to NT kernel functions.
-****************************************************************************/
-UNICODE_STRING *_PM_CStringToUnicodeString(
-    const char *cstr)
-{
-    int             length;
-    ANSI_STRING     ansiStr;
-    UNICODE_STRING  *uniStr;
-
-    /* Allocate memory for the string structure */
-    if ((uniStr = ExAllocatePool(NonPagedPool, sizeof(UNICODE_STRING))) == NULL)
-       return NULL;
-
-    /* Allocate memory for the wide string itself */
-    length = (strlen(cstr) * sizeof(WCHAR)) + sizeof(WCHAR);
-    if ((uniStr->Buffer = ExAllocatePool(NonPagedPool, length)) == NULL) {
-       ExFreePool(uniStr);
-       return NULL;
-       }
-    RtlZeroMemory(uniStr->Buffer, length);
-    uniStr->Length = 0;
-    uniStr->MaximumLength = (USHORT)length;
-
-    /* Convert filename string to ansi string and then to UniCode string */
-    RtlInitAnsiString(&ansiStr, cstr);
-    RtlAnsiStringToUnicodeString(uniStr, &ansiStr, FALSE);
-    return uniStr;
-}
-
-/****************************************************************************
-PARAMETERS:
-uniStr  - UniCode string structure to free
-
-REMARKS:
-Frees a string allocated by the above _PM_CStringToUnicodeString function.
-****************************************************************************/
-void _PM_FreeUnicodeString(
-    UNICODE_STRING *uniStr)
-{
-    if (uniStr) {
-       ExFreePool(uniStr->Buffer);
-       ExFreePool(uniStr);
-       }
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/ntdrv/vflat.c b/board/MAI/bios_emulator/scitech/src/pm/ntdrv/vflat.c
deleted file mode 100644 (file)
index 901ce1c..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Any
-*
-* Description:  Dummy module; no virtual framebuffer for this OS
-*
-****************************************************************************/
-
-#include "pmapi.h"
-
-ibool PMAPI VF_available(void)
-{
-    return false;
-}
-
-void * PMAPI VF_init(ulong baseAddr,int bankSize,int codeLen,void *bankFunc)
-{
-    return NULL;
-}
-
-void PMAPI VF_exit(void)
-{
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/ntdrv/ztimer.c b/board/MAI/bios_emulator/scitech/src/pm/ntdrv/ztimer.c
deleted file mode 100644 (file)
index f4c4bd4..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-/****************************************************************************
-*
-*                         Ultra Long Period Timer
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  32-bit Windows VxD
-*
-* Description:  OS specific implementation for the Zen Timer functions.
-*
-****************************************************************************/
-
-/*---------------------------- Global variables ---------------------------*/
-
-static CPU_largeInteger countFreq;
-static ulong            start,finish;
-
-/*----------------------------- Implementation ----------------------------*/
-
-/****************************************************************************
-REMARKS:
-Initialise the Zen Timer module internals.
-****************************************************************************/
-static void __ZTimerInit(void)
-{
-    KeQueryPerformanceCounter((LARGE_INTEGER*)&countFreq);
-}
-
-/****************************************************************************
-REMARKS:
-Call the assembler Zen Timer functions to do the timing.
-****************************************************************************/
-static void __LZTimerOn(
-    LZTimerObject *tm)
-{
-    LARGE_INTEGER lt = KeQueryPerformanceCounter(NULL);
-    tm->start.low = lt.LowPart;
-    tm->start.high = lt.HighPart;
-}
-
-/****************************************************************************
-REMARKS:
-Call the assembler Zen Timer functions to do the timing.
-****************************************************************************/
-static ulong __LZTimerLap(
-    LZTimerObject *tm)
-{
-    LARGE_INTEGER       tmLap = KeQueryPerformanceCounter(NULL);
-    CPU_largeInteger    tmCount;
-
-    _CPU_diffTime64(&tm->start,(CPU_largeInteger*)&tmLap,&tmCount);
-    return _CPU_calcMicroSec(&tmCount,countFreq.low);
-}
-
-/****************************************************************************
-REMARKS:
-Call the assembler Zen Timer functions to do the timing.
-****************************************************************************/
-static void __LZTimerOff(
-    LZTimerObject *tm)
-{
-    LARGE_INTEGER lt = KeQueryPerformanceCounter(NULL);
-    tm->end.low = lt.LowPart;
-    tm->end.high = lt.HighPart;
-}
-
-/****************************************************************************
-REMARKS:
-Call the assembler Zen Timer functions to do the timing.
-****************************************************************************/
-static ulong __LZTimerCount(
-    LZTimerObject *tm)
-{
-    CPU_largeInteger    tmCount;
-
-    _CPU_diffTime64(&tm->start,&tm->end,&tmCount);
-    return _CPU_calcMicroSec(&tmCount,countFreq.low);
-}
-
-/****************************************************************************
-REMARKS:
-Define the resolution of the long period timer as microseconds per timer tick.
-****************************************************************************/
-#define ULZTIMER_RESOLUTION     1
-
-/****************************************************************************
-REMARKS:
-Read the Long Period timer value from the BIOS timer tick.
-****************************************************************************/
-static ulong __ULZReadTime(void)
-{
-    LARGE_INTEGER count;
-    KeQuerySystemTime(&count);
-    return (ulong)(*((_int64*)&count) / 10);
-}
-
-/****************************************************************************
-REMARKS:
-Compute the elapsed time from the BIOS timer tick. Note that we check to see
-whether a midnight boundary has passed, and if so adjust the finish time to
-account for this. We cannot detect if more that one midnight boundary has
-passed, so if this happens we will be generating erronous results.
-****************************************************************************/
-ulong __ULZElapsedTime(ulong start,ulong finish)
-{ return finish - start; }
diff --git a/board/MAI/bios_emulator/scitech/src/pm/os2/_pmos2.asm b/board/MAI/bios_emulator/scitech/src/pm/os2/_pmos2.asm
deleted file mode 100644 (file)
index 761f0f4..0000000
+++ /dev/null
@@ -1,180 +0,0 @@
-;****************************************************************************
-;*
-;*                  SciTech OS Portability Manager Library
-;*
-;*  ========================================================================
-;*
-;*    The contents of this file are subject to the SciTech MGL Public
-;*    License Version 1.0 (the "License"); you may not use this file
-;*    except in compliance with the License. You may obtain a copy of
-;*    the License at http://www.scitechsoft.com/mgl-license.txt
-;*
-;*    Software distributed under the License is distributed on an
-;*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-;*    implied. See the License for the specific language governing
-;*    rights and limitations under the License.
-;*
-;*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-;*
-;*    The Initial Developer of the Original Code is SciTech Software, Inc.
-;*    All Rights Reserved.
-;*
-;*  ========================================================================
-;*
-;* Language:    80386 Assembler, TASM 4.0 or NASM
-;* Environment: OS/2 32 bit protected mode
-;*
-;* Description: Low level assembly support for the PM library specific
-;*              to OS/2
-;*
-;****************************************************************************
-
-        IDEAL
-
-include "scitech.mac"               ; Memory model macros
-
-header      _pmos2                  ; Set up memory model
-
-begdataseg  _pmos2
-
-        cglobal _PM_ioentry
-        cglobal _PM_gdt
-_PM_ioentry     dd  0               ; Offset to call gate
-_PM_gdt         dw  0               ; Selector to call gate
-
-enddataseg  _pmos2
-
-begcodeseg  _pmos2                  ; Start of code segment
-
-;----------------------------------------------------------------------------
-; int PM_setIOPL(int iopl)
-;----------------------------------------------------------------------------
-; Change the IOPL level for the 32-bit task. Returns the previous level
-; so it can be restored for the task correctly.
-;----------------------------------------------------------------------------
-cprocstart  PM_setIOPL
-
-        ARG     iopl:UINT
-
-        enter_c
-        pushfd                      ; Save the old EFLAGS for later
-        mov     ecx,[iopl]          ; ECX := IOPL level
-        xor     ebx,ebx             ; Change IOPL level function code (0)
-ifdef   USE_NASM
-        call far dword [_PM_ioentry]
-else
-        call    [FWORD _PM_ioentry]
-endif
-        pop     eax
-        and     eax,0011000000000000b
-        shr     eax,12
-        leave_c
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void _PM_setGDTSelLimit(ushort selector, ulong limit);
-;----------------------------------------------------------------------------
-; Change the GDT selector limit to given value. Used to change selector
-; limits to address the entire system address space.
-;----------------------------------------------------------------------------
-cprocstart  _PM_setGDTSelLimit
-
-        ARG     selector:USHORT, limit:UINT
-        
-        enter_c
-        sub     esp,20              ; Make room for selector data on stack
-        mov     ecx,esp             ; ECX := selector data structure
-        mov     bx,[selector]       ; Fill out the data structure
-        and     bx,0FFF8h           ; Kick out the LDT/GDT and DPL bits     
-        mov     [WORD ecx],bx
-        mov     ebx,[limit]
-        mov     [DWORD ecx+4],ebx
-        mov     ebx,5               ; Set GDT selector limit function code      
-ifdef   USE_NASM
-        call far dword [_PM_ioentry]
-else
-        call    [FWORD _PM_ioentry]
-endif
-        add     esp,20
-        leave_c
-        ret
-
-cprocend    
-
-;----------------------------------------------------------------------------
-; uchar _MTRR_getCx86(uchar reg);
-;----------------------------------------------------------------------------
-; Read a Cyrix CPU indexed register
-;----------------------------------------------------------------------------
-cprocstart  _MTRR_getCx86
-
-        ARG     reg:UCHAR
-
-        enter_c
-        mov     al,[reg]
-        out     22h,al
-        in      al,23h
-        leave_c
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; uchar _MTRR_setCx86(uchar reg,uchar val);
-;----------------------------------------------------------------------------
-; Write a Cyrix CPU indexed register
-;----------------------------------------------------------------------------
-cprocstart  _MTRR_setCx86
-
-        ARG     reg:UCHAR, val:UCHAR
-
-        enter_c
-        mov     al,[reg]
-        out     22h,al
-        mov     al,[val]
-        out     23h,al
-        leave_c
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; ulong _MTRR_disableInt(void);
-;----------------------------------------------------------------------------
-; Return processor interrupt status and disable interrupts.
-;----------------------------------------------------------------------------
-cprocstart  _MTRR_disableInt
-
-; Do nothing!
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void _MTRR_restoreInt(ulong ps);
-;----------------------------------------------------------------------------
-; Restore processor interrupt status.
-;----------------------------------------------------------------------------
-cprocstart  _MTRR_restoreInt
-
-; Do nothing!
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void DebugInt(void)
-;----------------------------------------------------------------------------
-cprocstart  DebugInt
-
-        int     3
-        ret
-
-cprocend
-
-endcodeseg  _pmos2
-
-        END                         ; End of module
-        
diff --git a/board/MAI/bios_emulator/scitech/src/pm/os2/cpuinfo.c b/board/MAI/bios_emulator/scitech/src/pm/os2/cpuinfo.c
deleted file mode 100644 (file)
index 7de400d..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/****************************************************************************
-*
-*                         Ultra Long Period Timer
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  OS/2
-*
-* Description:  OS/2 specific code for the CPU detection module.
-*
-****************************************************************************/
-
-/*----------------------------- Implementation ----------------------------*/
-
-/****************************************************************************
-REMARKS:
-TODO: This should be implemented for OS/2!
-****************************************************************************/
-#define SetMaxThreadPriority()  0
-
-/****************************************************************************
-REMARKS:
-TODO: This should be implemented for OS/2!
-****************************************************************************/
-#define RestoreThreadPriority(i)
-
-/****************************************************************************
-REMARKS:
-Initialise the counter and return the frequency of the counter.
-****************************************************************************/
-static void GetCounterFrequency(
-    CPU_largeInteger *freq)
-{
-    freq->low = 100000;
-    freq->high = 0;
-}
-
-/****************************************************************************
-REMARKS:
-Read the counter and return the counter value.
-****************************************************************************/
-#define GetCounter(t)                                                       \
-{                                                                           \
-    ULONG   count;                                                          \
-    DosQuerySysInfo( QSV_MS_COUNT, QSV_MS_COUNT, &count, sizeof(ULONG) );   \
-    (t)->low = count * 100;                                                 \
-    (t)->high = 0;                                                          \
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/os2/event.c b/board/MAI/bios_emulator/scitech/src/pm/os2/event.c
deleted file mode 100644 (file)
index 91cc19b..0000000
+++ /dev/null
@@ -1,565 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  IBM PC (OS/2)
-*
-* Description:  OS/2 implementation for the SciTech cross platform
-*               event library.
-*
-****************************************************************************/
-
-/*---------------------------- Global Variables ---------------------------*/
-
-/* Define generous keyboard monitor circular buffer size to minimize
- * the danger of losing keystrokes
- */
-#define KEYBUFSIZE  (EVENTQSIZE + 10)
-
-static int      oldMouseState;          /* Old mouse state               */
-static ulong    oldKeyMessage;          /* Old keyboard state            */
-static ushort   keyUpMsg[256] = {0};    /* Table of key up messages      */
-static int      rangeX,rangeY;          /* Range of mouse coordinates    */
-HMOU            _EVT_hMouse;            /* Handle to the mouse driver    */
-HMONITOR        _EVT_hKbdMon;           /* Handle to the keyboard driver */
-TID             kbdMonTID = 0;          /* Keyboard monitor thread ID    */
-HEV             hevStart;               /* Start event semaphore handle  */
-BOOL            bMonRunning;            /* Flag set if monitor thread OK */
-HMTX            hmtxKeyBuf;             /* Mutex protecting key buffer   */
-KEYPACKET       keyMonPkts[KEYBUFSIZE]; /* Array of monitor key packets  */
-int             kpHead = 0;             /* Key packet buffer head        */
-int             kpTail = 0;             /* Key packet buffer tail        */
-
-/*---------------------------- Implementation -----------------------------*/
-
-/* These are not used under OS/2 */
-#define _EVT_disableInt()       1
-#define _EVT_restoreInt(flags)
-
-/****************************************************************************
-PARAMETERS:
-scanCode    - Scan code to test
-
-REMARKS:
-This macro determines if a specified key is currently down at the
-time that the call is made.
-****************************************************************************/
-#define _EVT_isKeyDown(scanCode)    (keyUpMsg[scanCode] != 0)
-
-/****************************************************************************
-REMARKS:
-This function is used to return the number of ticks since system
-startup in milliseconds. This should be the same value that is placed into
-the time stamp fields of events, and is used to implement auto mouse down
-events.
-****************************************************************************/
-ulong _EVT_getTicks(void)
-{
-    ULONG   count;
-    DosQuerySysInfo( QSV_MS_COUNT, QSV_MS_COUNT, &count, sizeof(ULONG) );
-    return count;
-}
-
-/****************************************************************************
-REMARKS:
-Converts a mickey movement value to a pixel adjustment value.
-****************************************************************************/
-static int MickeyToPixel(
-    int mickey)
-{
-    /* TODO: We can add some code in here to handle 'acceleration' for */
-    /*       the mouse cursor. For now just use the mickeys. */
-    return mickey;
-}
-
-/* Some useful defines any typedefs used in the keyboard handling */
-#define KEY_RELEASE             0x40
-
-/****************************************************************************
-REMARKS:
-Pumps all messages in the message queue from OS/2 into our event queue.
-****************************************************************************/
-static void _EVT_pumpMessages(void)
-{
-    KBDINFO         keyInfo;        /* Must not cross a 64K boundary */
-    KBDKEYINFO      key;            /* Must not cross a 64K boundary */
-    MOUQUEINFO      mqueue;         /* Must not cross a 64K boundary */
-    MOUEVENTINFO    mouse;          /* Must not cross a 64K boundary */
-    ushort          mWait;          /* Must not cross a 64K boundary */
-    KEYPACKET       kp;             /* Must not cross a 64K boundary */
-    event_t         evt;
-    int             scan;
-    ibool           noInput = TRUE; /* Flag to determine if any input was available */
-
-    /* First of all, check if we should do any session switch work */
-    __PM_checkConsoleSwitch();
-
-    /* Pump all keyboard messages from our circular buffer */
-    for (;;) {
-       /* Check that the monitor thread is still running */
-       if (!bMonRunning)
-           PM_fatalError("Keyboard monitor thread died!");
-
-       /* Protect keypacket buffer with mutex */
-       DosRequestMutexSem(hmtxKeyBuf, SEM_INDEFINITE_WAIT);
-       if (kpHead == kpTail) {
-           DosReleaseMutexSem(hmtxKeyBuf);
-           break;
-           }
-
-       noInput = FALSE;
-
-       /* Read packet from circular buffer and remove it */
-       memcpy(&kp, &keyMonPkts[kpTail], sizeof(KEYPACKET));
-       if (++kpTail == KEYBUFSIZE)
-           kpTail = 0;
-       DosReleaseMutexSem(hmtxKeyBuf);
-
-       /* Compensate for the 0xE0 character */
-       if (kp.XlatedScan && kp.XlatedChar == 0xE0)
-           kp.XlatedChar = 0;
-
-       /* Determine type of keyboard event */
-       memset(&evt,0,sizeof(evt));
-       if (kp.KbdDDFlagWord & KEY_RELEASE)
-           evt.what = EVT_KEYUP;
-       else
-           evt.what = EVT_KEYDOWN;
-
-       /* Convert keyboard codes */
-       scan = kp.MonFlagWord >> 8;
-       if (evt.what == EVT_KEYUP) {
-           /* Get message for keyup code from table of cached down values */
-           evt.message = keyUpMsg[scan];
-           keyUpMsg[scan] = 0;
-           oldKeyMessage = -1;
-           }
-       else {
-           evt.message = ((ulong)scan << 8) | kp.XlatedChar;
-           if (evt.message == keyUpMsg[scan]) {
-               evt.what = EVT_KEYREPEAT;
-               evt.message |= 0x10000;
-               }
-           oldKeyMessage = evt.message & 0x0FFFF;
-           keyUpMsg[scan] = (ushort)evt.message;
-           }
-
-        /* Convert shift state modifiers */
-        if (kp.u.ShiftState & 0x0001)
-            evt.modifiers |= EVT_RIGHTSHIFT;
-        if (kp.u.ShiftState & 0x0002)
-            evt.modifiers |= EVT_LEFTSHIFT;
-        if (kp.u.ShiftState & 0x0100)
-            evt.modifiers |= EVT_LEFTCTRL;
-        if (kp.u.ShiftState & 0x0200)
-            evt.modifiers |= EVT_LEFTALT;
-        if (kp.u.ShiftState & 0x0400)
-            evt.modifiers |= EVT_RIGHTCTRL;
-        if (kp.u.ShiftState & 0x0800)
-            evt.modifiers |= EVT_RIGHTALT;
-        EVT.oldMove = -1;
-
-        /* Add time stamp and add the event to the queue */
-        evt.when = key.time;
-        if (EVT.count < EVENTQSIZE)
-            addEvent(&evt);
-        }
-
-    /* Don't just flush because that terminally confuses the monitor */
-    do {
-       KbdCharIn(&key, IO_NOWAIT, 0);
-       } while (key.fbStatus & KBDTRF_FINAL_CHAR_IN);
-
-    /* Pump all mouse messages */
-    KbdGetStatus(&keyInfo,0);
-    /* Check return code - mouse may not be operational!! */
-    if (MouGetNumQueEl(&mqueue,_EVT_hMouse) == NO_ERROR) {
-       while (mqueue.cEvents) {
-           while (mqueue.cEvents--) {
-               memset(&evt,0,sizeof(evt));
-               mWait = MOU_NOWAIT;
-               MouReadEventQue(&mouse,&mWait,_EVT_hMouse);
-
-               /* Update the mouse position. We get the mouse coordinates
-                * in mickeys so we have to translate these into pixels and
-                * move our mouse position. If we don't do this, OS/2 gives
-                * us the coordinates in character positions since it still
-                * thinks we are in text mode!
-                */
-               EVT.mx += MickeyToPixel(mouse.col);
-               EVT.my += MickeyToPixel(mouse.row);
-               if (EVT.mx < 0) EVT.mx = 0;
-               if (EVT.my < 0) EVT.my = 0;
-               if (EVT.mx > rangeX)    EVT.mx = rangeX;
-               if (EVT.my > rangeY)    EVT.my = rangeY;
-               evt.where_x = EVT.mx;
-               evt.where_y = EVT.my;
-               evt.relative_x = mouse.col;
-               evt.relative_y = mouse.row;
-               evt.when = key.time;
-               if (mouse.fs & (MOUSE_BN1_DOWN | MOUSE_MOTION_WITH_BN1_DOWN))
-                   evt.modifiers |= EVT_LEFTBUT;
-               if (mouse.fs & (MOUSE_BN2_DOWN | MOUSE_MOTION_WITH_BN2_DOWN))
-                   evt.modifiers |= EVT_RIGHTBUT;
-               if (mouse.fs & (MOUSE_BN3_DOWN | MOUSE_MOTION_WITH_BN3_DOWN))
-                   evt.modifiers |= EVT_MIDDLEBUT;
-               if (keyInfo.fsState & 0x0001)
-                   evt.modifiers |= EVT_RIGHTSHIFT;
-               if (keyInfo.fsState & 0x0002)
-                   evt.modifiers |= EVT_LEFTSHIFT;
-               if (keyInfo.fsState & 0x0100)
-                   evt.modifiers |= EVT_LEFTCTRL;
-               if (keyInfo.fsState & 0x0200)
-                   evt.modifiers |= EVT_LEFTALT;
-               if (keyInfo.fsState & 0x0400)
-                   evt.modifiers |= EVT_RIGHTCTRL;
-               if (keyInfo.fsState & 0x0800)
-                   evt.modifiers |= EVT_RIGHTALT;
-
-               /* Check for left mouse click events */
-               /* 0x06 == (MOUSE_BN1_DOWN | MOUSE_MOTION_WITH_BN1_DOWN) */
-               if (((mouse.fs & 0x0006) && !(oldMouseState & 0x0006))
-                       || (!(mouse.fs & 0x0006) && (oldMouseState & 0x0006))) {
-                   if (mouse.fs & 0x0006)
-                       evt.what = EVT_MOUSEDOWN;
-                   else
-                       evt.what = EVT_MOUSEUP;
-                   evt.message = EVT_LEFTBMASK;
-                   EVT.oldMove = -1;
-                   if (EVT.count < EVENTQSIZE)
-                       addEvent(&evt);
-                   }
-
-               /* Check for right mouse click events */
-               /* 0x0018 == (MOUSE_BN2_DOWN | MOUSE_MOTION_WITH_BN2_DOWN) */
-               if (((mouse.fs & 0x0018) && !(oldMouseState & 0x0018))
-                       || (!(mouse.fs & 0x0018) && (oldMouseState & 0x0018))) {
-                   if (mouse.fs & 0x0018)
-                       evt.what = EVT_MOUSEDOWN;
-                   else
-                       evt.what = EVT_MOUSEUP;
-                   evt.message = EVT_RIGHTBMASK;
-                   EVT.oldMove = -1;
-                   if (EVT.count < EVENTQSIZE)
-                       addEvent(&evt);
-                   }
-
-               /* Check for middle mouse click events */
-               /* 0x0060 == (MOUSE_BN3_DOWN | MOUSE_MOTION_WITH_BN3_DOWN) */
-               if (((mouse.fs & 0x0060) && !(oldMouseState & 0x0060))
-                       || (!(mouse.fs & 0x0060) && (oldMouseState & 0x0060))) {
-                   if (mouse.fs & 0x0060)
-                       evt.what = EVT_MOUSEDOWN;
-                   else
-                       evt.what = EVT_MOUSEUP;
-                   evt.message = EVT_MIDDLEBMASK;
-                   EVT.oldMove = -1;
-                   if (EVT.count < EVENTQSIZE)
-                       addEvent(&evt);
-                   }
-
-               /* Check for mouse movement event */
-               if (mouse.fs & 0x002B) {
-                   evt.what = EVT_MOUSEMOVE;
-                   if (EVT.oldMove != -1) {
-                       EVT.evtq[EVT.oldMove].where_x = evt.where_x;/* Modify existing one  */
-                       EVT.evtq[EVT.oldMove].where_y = evt.where_y;
-                       }
-                   else {
-                       EVT.oldMove = EVT.freeHead; /* Save id of this move event   */
-                       if (EVT.count < EVENTQSIZE)
-                           addEvent(&evt);
-                       }
-                   }
-
-               /* Save current mouse state */
-               oldMouseState = mouse.fs;
-               }
-           MouGetNumQueEl(&mqueue,_EVT_hMouse);
-           }
-           noInput = FALSE;
-       }
-
-    /* If there was no input available, give up the current timeslice
-     * Note: DosSleep(0) will effectively do nothing if no other thread is ready. Hence
-     * DosSleep(0) will still use 100% CPU _but_ should not interfere with other programs.
-     */
-    if (noInput)
-       DosSleep(0);
-}
-
-/****************************************************************************
-REMARKS:
-This macro/function is used to converts the scan codes reported by the
-keyboard to our event libraries normalised format. We only have one scan
-code for the 'A' key, and use shift modifiers to determine if it is a
-Ctrl-F1, Alt-F1 etc. The raw scan codes from the keyboard work this way,
-but the OS gives us 'cooked' scan codes, we have to translate them back
-to the raw format.
-****************************************************************************/
-#define _EVT_maskKeyCode(evt)
-
-/****************************************************************************
-REMARKS:
-Keyboard monitor thread. Needed to catch both keyup and keydown events.
-****************************************************************************/
-static void _kbdMonThread(
-    void *params)
-{
-    APIRET       rc;
-    KEYPACKET    kp;
-    USHORT       count = sizeof(KEYPACKET);
-    MONBUF       monInbuf;
-    MONBUF       monOutbuf;
-    int          kpNew;
-
-    /* Raise thread priority for higher responsiveness */
-    DosSetPriority(PRTYS_THREAD, PRTYC_TIMECRITICAL, 0, 0);
-    monInbuf.cb  = sizeof(monInbuf) - sizeof(monInbuf.cb);
-    monOutbuf.cb = sizeof(monOutbuf) - sizeof(monOutbuf.cb);
-    bMonRunning = FALSE;
-
-    /* Register the buffers to be used for monitoring for current session */
-    if (DosMonReg(_EVT_hKbdMon, &monInbuf, (ULONG*)&monOutbuf,MONITOR_END, -1)) {
-       DosPostEventSem(hevStart);  /* unblock the main thread */
-       return;
-       }
-
-    /* Unblock the main thread and tell it we're OK*/
-    bMonRunning = TRUE;
-    DosPostEventSem(hevStart);
-    while (bMonRunning) {  /* Start an endless loop */
-       /* Read data from keyboard driver */
-       rc = DosMonRead((PBYTE)&monInbuf, IO_WAIT, (PBYTE)&kp, (PUSHORT)&count);
-       if (rc) {
-#ifdef CHECKED
-           if (bMonRunning)
-               printf("Error in DosMonRead, rc = %ld\n", rc);
-#endif
-           bMonRunning = FALSE;
-           return;
-           }
-
-       /* Pass FLUSH packets immediately */
-       if (kp.MonFlagWord & 4) {
-#ifdef CHECKED
-           printf("Flush packet!\n");
-#endif
-           DosMonWrite((PBYTE)&monOutbuf, (PBYTE)&kp, count);
-           continue;
-           }
-
-       /*TODO: to be removed */
-       /* Skip extended scancodes & some others */
-       if (((kp.MonFlagWord >> 8) == 0xE0) || ((kp.KbdDDFlagWord & 0x0F) == 0x0F)) {
-           DosMonWrite((PBYTE)&monOutbuf, (PBYTE)&kp, count);
-           continue;
-           }
-
-/*      printf("RawScan = %X, XlatedScan = %X, fbStatus = %X, KbdDDFlags = %X\n", */
-/*          kp.MonFlagWord >> 8, kp.XlatedScan, kp.u.ShiftState, kp.KbdDDFlagWord); */
-
-       /* Protect access to buffer with mutex semaphore */
-       rc = DosRequestMutexSem(hmtxKeyBuf, 1000);
-       if (rc) {
-#ifdef CHECKED
-           printf("Can't get access to mutex, rc = %ld\n", rc);
-#endif
-           bMonRunning = FALSE;
-           return;
-           }
-
-       /* Store packet in circular buffer, drop it if it's full */
-       kpNew = kpHead + 1;
-       if (kpNew == KEYBUFSIZE)
-           kpNew = 0;
-       if (kpNew != kpTail) {
-           memcpy(&keyMonPkts[kpHead], &kp, sizeof(KEYPACKET));
-           /* TODO: fix this! */
-           /* Convert break to make code */
-           keyMonPkts[kpHead].MonFlagWord &= 0x7FFF;
-           kpHead = kpNew;
-           }
-       DosReleaseMutexSem(hmtxKeyBuf);
-
-       /* Finally write the packet */
-       rc = DosMonWrite((PBYTE)&monOutbuf, (PBYTE)&kp, count);
-       if (rc) {
-#ifdef CHECKED
-           if (bMonRunning)
-               printf("Error in DosMonWrite, rc = %ld\n", rc);
-#endif
-           bMonRunning = FALSE;
-           return;
-           }
-       }
-    (void)params;
-}
-
-/****************************************************************************
-REMARKS:
-Safely abort the event module upon catching a fatal error.
-****************************************************************************/
-void _EVT_abort(
-    int signal)
-{
-    EVT_exit();
-    PM_fatalError("Unhandled exception!");
-}
-
-/****************************************************************************
-PARAMETERS:
-mouseMove   - Callback function to call wheneve the mouse needs to be moved
-
-REMARKS:
-Initiliase the event handling module. Here we install our mouse handling ISR
-to be called whenever any button's are pressed or released. We also build
-the free list of events in the event queue.
-
-We use handler number 2 of the mouse libraries interrupt handlers for our
-event handling routines.
-****************************************************************************/
-void EVTAPI EVT_init(
-    _EVT_mouseMoveHandler mouseMove)
-{
-    ushort  stat;
-
-    /* Initialise the event queue */
-    PM_init();
-    EVT.mouseMove = mouseMove;
-    initEventQueue();
-    oldMouseState = 0;
-    oldKeyMessage = 0;
-    memset(keyUpMsg,0,sizeof(keyUpMsg));
-
-    /* Open the mouse driver, and set it up to report events in mickeys */
-    MouOpen(NULL,&_EVT_hMouse);
-    stat = 0x7F;
-    MouSetEventMask(&stat,_EVT_hMouse);
-    stat = (MOU_NODRAW | MOU_MICKEYS) << 8;
-    MouSetDevStatus(&stat,_EVT_hMouse);
-
-    /* Open the keyboard monitor  */
-    if (DosMonOpen((PSZ)"KBD$", &_EVT_hKbdMon))
-       PM_fatalError("Unable to open keyboard monitor!");
-
-    /* Create event semaphore, the monitor will post it when it's initalized */
-    if (DosCreateEventSem(NULL, &hevStart, 0, FALSE))
-       PM_fatalError("Unable to create event semaphore!");
-
-    /* Create mutex semaphore protecting the keypacket buffer */
-    if (DosCreateMutexSem(NULL, &hmtxKeyBuf, 0, FALSE))
-       PM_fatalError("Unable to create mutex semaphore!");
-
-    /* Start keyboard monitor thread, use 32K stack */
-    kbdMonTID = _beginthread(_kbdMonThread, NULL, 0x8000, NULL);
-
-    /* Now block until the monitor thread is up and running */
-    /* Give the thread one second */
-    DosWaitEventSem(hevStart, 1000);
-    if (!bMonRunning) {  /* Check the thread is OK */
-       DosMonClose(_EVT_hKbdMon);
-       PM_fatalError("Keyboard monitor thread didn't initialize!");
-       }
-
-    /* Catch program termination signals so we can clean up properly */
-    signal(SIGABRT, _EVT_abort);
-    signal(SIGFPE, _EVT_abort);
-    signal(SIGINT, _EVT_abort);
-}
-
-/****************************************************************************
-REMARKS
-Changes the range of coordinates returned by the mouse functions to the
-specified range of values. This is used when changing between graphics
-modes set the range of mouse coordinates for the new display mode.
-****************************************************************************/
-void EVTAPI EVT_setMouseRange(
-    int xRes,
-    int yRes)
-{
-    rangeX = xRes;
-    rangeY = yRes;
-}
-
-/****************************************************************************
-REMARKS
-Modifes the mouse coordinates as necessary if scaling to OS coordinates,
-and sets the OS mouse cursor position.
-****************************************************************************/
-#define _EVT_setMousePos(x,y)
-
-/****************************************************************************
-REMARKS:
-Initiailises the internal event handling modules. The EVT_suspend function
-can be called to suspend event handling (such as when shelling out to DOS),
-and this function can be used to resume it again later.
-****************************************************************************/
-void EVT_resume(void)
-{
-    /* Do nothing for OS/2 */
-}
-
-/****************************************************************************
-REMARKS
-Suspends all of our event handling operations. This is also used to
-de-install the event handling code.
-****************************************************************************/
-void EVT_suspend(void)
-{
-    /* Do nothing for OS/2 */
-}
-
-/****************************************************************************
-REMARKS
-Exits the event module for program terminatation.
-****************************************************************************/
-void EVT_exit(void)
-{
-    APIRET   rc;
-
-    /* Restore signal handlers */
-    signal(SIGABRT, SIG_DFL);
-    signal(SIGFPE, SIG_DFL);
-    signal(SIGINT, SIG_DFL);
-
-    /* Close the mouse driver */
-    MouClose(_EVT_hMouse);
-
-    /* Stop the keyboard monitor thread and close the monitor */
-    bMonRunning = FALSE;
-    rc = DosKillThread(kbdMonTID);
-#ifdef CHECKED
-    if (rc)
-       printf("DosKillThread failed, rc = %ld\n", rc);
-#endif
-    rc = DosMonClose(_EVT_hKbdMon);
-#ifdef CHECKED
-    if (rc) {
-       printf("DosMonClose failed, rc = %ld\n", rc);
-       }
-#endif
-    DosCloseEventSem(hevStart);
-    DosCloseMutexSem(hmtxKeyBuf);
-    KbdFlushBuffer(0);
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/os2/mon.h b/board/MAI/bios_emulator/scitech/src/pm/os2/mon.h
deleted file mode 100644 (file)
index 28d39fb..0000000
+++ /dev/null
@@ -1,165 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  32-bit OS/2
-*
-* Description:  Include file to include all OS/2 keyboard monitor stuff.
-*
-****************************************************************************/
-
-/* Monitors stuff */
-
-#define MONITOR_DEFAULT 0x0000
-#define MONITOR_BEGIN        1
-#define MONITOR_END          2
-
-typedef SHANDLE   HMONITOR;
-typedef HMONITOR *PHMONITOR;
-
-typedef struct _KEYPACKET {
-  USHORT  MonFlagWord;
-  UCHAR   XlatedChar;
-  UCHAR   XlatedScan;
-  UCHAR   DBCSStatus;
-  UCHAR   DBCSShift;
-
-  union
-  {
-    USHORT  ShiftState;
-    USHORT  LayerIndex;
-  } u;
-
-  ULONG   Milliseconds;
-  USHORT  KbdDDFlagWord;
-} KEYPACKET;
-
-typedef struct _MLNPACKET {
-  USHORT  MonFlagWord;
-  USHORT  IOCTL;
-  USHORT  CPId;
-  USHORT  CPIndex;
-  ULONG   Reserved;
-  USHORT  KbdDDFlagWord;
-} MLNPACKET;
-
-/* DBCSStatus */
-
-#define SF_SHIFTS              1  /* If set to 1, shift status returned without a character */
-#define SF_NOTCHAR             2  /* 0 - Scan code is a character */
-                                 /* 1 - Scan code is not a character; */
-                                 /*     instead it is an extended key code from the keyboard. */
-#define SF_IMMEDIATE          32  /* If set to 1, immediate conversion requested */
-#define SF_TYPEMASK          192  /* Has the following values: */
-                                 /* 00 - Undefined */
-                                 /* 01 - Final character; interim character flag is turned off */
-                                 /* 10 - Interim character */
-                                 /* 11 - Final character; interim character flag is turned on. */
-/* MonFlagWord */
-
-#define MF_OPEN                1  /* open */
-#define MF_CLOSE               2  /* close */
-#define MF_FLUSH               4  /* is flush packet */
-
-/* KbdDDFlagWord */
-
-#define KF_NOTSQPACKET      1024  /* Don't put this packet in SQ buffer */
-#define KF_ACCENTEDKEY       512  /* Key was translated using previous accent. */
-#define KF_MULTIMAKE         256  /* Key was repeated make of a toggle key. */
-#define KF_SECONDARYKEY      128  /* Previous scan code was the E0 prefix code. */
-#define KF_KEYBREAK           64  /* This is the break of the key. */
-#define KF_KEYTYPEMASK        63  /* Isolates the Key Type field of DDFlags. */
-#define KF_UNDEFKEY           63  /* Key packet is undefined */
-#define KF_SYSREQKEY          23  /* This key packet is the SysReq key (4990) */
-#define KF_PRINTFLUSHKEY      22  /* This packet is Ct-Alt-PrtScr */
-#define KF_PSPRINTECHOKEY     21  /* This packet is Ctl-P */
-#define KF_PRINTECHOKEY       20  /* This packet is Ctl-PrtScr */
-#define KF_PRTSCRKEY          19  /* This packet is PrtScr */
-#define KF_PSBREAKKEY         18  /* This packet is Ctl-C */
-#define KF_BREAKKEY           17  /* This packet is Ctl-Break */
-#define KF_ACCENTKEY          16  /* This packet is an accent key */
-#define KF_XRORPNOT           13  /* This packet is a Read or Peek Notification Pct. */
-#define KF_MLNOTIFICATION     14  /* packet is a Multi-Layer NLS packet */
-#define KF_HOTKEYPACKET       12  /* This packet is the hot key. */
-#define KF_BADKEYCOMBO        11  /* Accent/char combo undefined, beep only. */
-#define KF_WAKEUPKEY          10  /* This packet is one following PAUSEKEY */
-#define KF_PSPAUSEKEY          9  /* This packet is Ctl-S */
-#define KF_PAUSEKEY            8  /* This packet is Ctl-Numlock or PAUSE */
-#define KF_SHIFTMASK           7  /* Key is a shift Key */
-#define KF_DUMPKEY             6  /* This packet is Ctl-Numlock-NumLock */
-#define KF_REBOOTKEY           5  /* This packet is Ctl-Alt-Del */
-#define KF_RESENDCODE          4  /* This packet is resend code from controller */
-#define KF_OVERRUNCODE         3  /* This packet is overrun code from controller */
-#define KF_SECPREFIXCODE       2  /* This packet is E0/E1 scan code */
-#define KF_ACKCODE             1  /* This packet is ack code from keyboard */
-
-
-typedef struct _MONBUF {
-  USHORT    cb;
-  KEYPACKET Buffer;
-  BYTE      Reserved[20];
-} MONBUF;
-
-#define RS_SYSREG      32768  /* Bit 15  SysReq key down */
-#define RS_CAPSLOCK    16384  /* Bit 14  Caps Lock key down */
-#define RS_NUMLOCK      8192  /* Bit 13  NumLock key down */
-#define RS_SCROLLLOCK   4096  /* Bit 12  Scroll Lock key down */
-#define RS_RALT         2048  /* Bit 11  Right Alt key down */
-#define RS_RCONTROL     1024  /* Bit 10  Right Ctrl key down */
-#define RS_LALT          512  /* Bit  9  Left Alt key down */
-#define RS_LCONTROL      256  /* Bit  8  Left Ctrl key down */
-#define RS_INSERT        128  /* Bit  7  Insert on */
-#define RS_CAPS           64  /* Bit  6  Caps Lock on */
-#define RS_NUM            32  /* Bit  5  NumLock on */
-#define RS_SCROLL         16  /* Bit  4  Scroll Lock on */
-#define RS_ALT             8  /* Bit  3  Either Alt key down */
-#define RS_CONTROL         4  /* Bit  2  Either Ctrl key down */
-#define RS_LSHIFT          2  /* Bit  1  Left Shift key down */
-#define RS_RSHIFT          1  /* Bit  0  Right Shift key down */
-
-
-#define CS_RCONTROL     91    /* Right Control */
-#define CS_LSHIFT       42    /* Left Shift */
-#define CS_RSHIFT       54    /* Right Shift */
-#define CS_LALT         56    /* Left Alt */
-#define CS_RALT         94    /* Right Alt */
-
-
-/* DosMon* prototypes */
-#ifdef __EMX__
-    #define  APIRET16        USHORT
-    #define  APIENTRY16
-#else
-    #define  DosMonOpen      DOS16MONOPEN
-    #define  DosMonClose     DOS16MONCLOSE
-    #define  DosMonReg       DOS16MONREG
-    #define  DosMonRead      DOS16MONREAD
-    #define  DosMonWrite     DOS16MONWRITE
-    #define  DosGetInfoSeg   DOS16GETINFOSEG
-#endif
-
-APIRET16 APIENTRY16 DosMonOpen   (PSZ pszDevName, PHMONITOR phmon);
-APIRET16 APIENTRY16 DosMonClose  (HMONITOR hmon);
-APIRET16 APIENTRY16 DosMonReg    (HMONITOR hmon, MONBUF *pbInBuf, /*MONBUF*/ULONG *pbOutBuf, USHORT fPosition, USHORT usIndex);
-APIRET16 APIENTRY16 DosMonRead   (PBYTE pbInBuf, USHORT fWait, PBYTE pbDataBuf, PUSHORT pcbData);
-APIRET16 APIENTRY16 DosMonWrite  (PBYTE pbOutBuf, PBYTE pbDataBuf, USHORT cbData);
diff --git a/board/MAI/bios_emulator/scitech/src/pm/os2/oshdr.h b/board/MAI/bios_emulator/scitech/src/pm/os2/oshdr.h
deleted file mode 100644 (file)
index e7aa1c6..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  32-bit OS/2
-*
-* Description:  Include file to include all OS specific header files.
-*
-****************************************************************************/
-
-#define INCL_DOSPROFILE
-#define INCL_DOSERRORS
-#define INCL_DOS
-#define INCL_SUB
-#define INCL_VIO
-#define INCL_KBD
-#include <os2.h>
-#include <process.h>
-#include "os2/mon.h"
-
-void __PM_checkConsoleSwitch(void);
diff --git a/board/MAI/bios_emulator/scitech/src/pm/os2/pm.c b/board/MAI/bios_emulator/scitech/src/pm/os2/pm.c
deleted file mode 100644 (file)
index 756eead..0000000
+++ /dev/null
@@ -1,2008 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  32-bit OS/2
-*
-* Description:  Implementation for the OS Portability Manager Library, which
-*               contains functions to implement OS specific services in a
-*               generic, cross platform API. Porting the OS Portability
-*               Manager library is the first step to porting any SciTech
-*               products to a new platform.
-*
-****************************************************************************/
-
-#include "pmapi.h"
-#include "drvlib/os/os.h"
-#include "pm_help.h"
-#include "mtrr.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <process.h>
-#ifndef __EMX__
-#include <direct.h>
-#endif
-#define INCL_DOSERRORS
-#define INCL_DOS
-#define INCL_SUB
-#define INCL_VIO
-#define INCL_KBD
-#include <os2.h>
-
-/* Semaphore for communication with our background daemon */
-#define SHAREDSEM   ((PSZ)"\\SEM32\\SDD\\DAEMON")
-#define DAEMON_NAME "SDDDAEMN.EXE"
-
-/*--------------------------- Global variables ----------------------------*/
-
-/* Public structures used to communicate with VIDEOPMI for implementing
- * the ability to call the real mode BIOS functions.
- */
-
-typedef struct _VIDEOMODEINFO {
-    ULONG   miModeId;
-    USHORT  usType;
-    USHORT  usInt10ModeSet;
-    USHORT  usXResolution;
-    USHORT  usYResolution;
-    ULONG   ulBufferAddress;
-    ULONG   ulApertureSize;
-    BYTE    bBitsPerPixel;
-    BYTE    bBitPlanes;
-    BYTE    bXCharSize;
-    BYTE    bYCharSize;
-    USHORT  usBytesPerScanLine;
-    USHORT  usTextRows;
-    ULONG   ulPageLength;
-    ULONG   ulSaveSize;
-    BYTE    bVrtRefresh;
-    BYTE    bHrtRefresh;
-    BYTE    bVrtPolPos;
-    BYTE    bHrtPolPos;
-    CHAR    bRedMaskSize;
-    CHAR    bRedFieldPosition;
-    CHAR    bGreenMaskSize;
-    CHAR    bGreenFieldPosition;
-    CHAR    bBlueMaskSize;
-    CHAR    bBlueFieldPosition;
-    CHAR    bRsvdMaskSize;
-    CHAR    bRsvdFieldPosition;
-    ULONG   ulColors;
-    ULONG   ulReserved[3];
-    } VIDEOMODEINFO, FAR *PVIDEOMODEINFO;
-
-typedef struct _ADAPTERINFO {
-    ULONG       ulAdapterID;
-    CHAR        szOEMString[128];
-    CHAR        szDACString[128];
-    CHAR        szRevision[128];
-    ULONG       ulTotalMemory;
-    ULONG       ulMMIOBaseAddress;
-    ULONG       ulPIOBaseAddress;
-    BYTE        bBusType;
-    BYTE        bEndian;
-    USHORT      usDeviceBusID;
-    USHORT      usVendorBusID;
-    USHORT      SlotID;
-    } ADAPTERINFO, FAR *PADAPTERINFO;
-
-typedef struct _VIDEO_ADAPTER {
-    void            *hvideo;
-    ADAPTERINFO     Adapter;
-    VIDEOMODEINFO   ModeInfo;
-    } VIDEO_ADAPTER, FAR *PVIDEO_ADAPTER;
-
-/* PMIREQUEST_SOFTWAREINT structures from OS/2 DDK */
-
-typedef struct {
-    ULONG ulFlags;                              /* VDM initialization type */
-#define VDM_POSTLOAD                    0x1     /* adapter just loaded, used internally for initialization */
-#define VDM_INITIALIZE                  0x2     /* force initialization of a permanently open VDM, even if previously initialized */
-#define VDM_TERMINATE_POSTINITIALIZE    0x6     /*start VDM with initialization, but close it afterwards (includes VDM_INITIALIZE) */
-#define VDM_QUERY_CAPABILITY            0x10    /* query the current int 10 capability */
-#define VDM_FULL_VDM_CREATED            0x20    /* a full VDM is created */
-#define VDM_MINI_VDM_CREATED            0x40    /* a mini VDM is created */
-#define VDM_MINI_VDM_SUPPORTED          0x80    /* mini VDM support is available */
-    PCHAR szName;                               /* VDM initialization program */
-    PCHAR szArgs;                               /* VDM initialization arguments */
-    }INITVDM;
-
-typedef struct {
-    BYTE bBufferType;
-#define BUFFER_NONE     0
-#define INPUT_BUFFER    1
-#define OUTPUT_BUFFER   2
-    BYTE bReserved;
-    BYTE bSelCRF;
-    BYTE bOffCRF;
-    PVOID pAddress;
-    ULONG ulSize;
-    } BUFFER, *PBUFFER;
-
-typedef struct vcrf_s {
-    ULONG reg_eax;
-    ULONG reg_ebx;
-    ULONG reg_ecx;
-    ULONG reg_edx;
-    ULONG reg_ebp;
-    ULONG reg_esi;
-    ULONG reg_edi;
-    ULONG reg_ds;
-    ULONG reg_es;
-    ULONG reg_fs;
-    ULONG reg_gs;
-    ULONG reg_cs;
-    ULONG reg_eip;
-    ULONG reg_eflag;
-    ULONG reg_ss;
-    ULONG reg_esp;
-    } VCRF;
-
-typedef struct {
-    ULONG   ulBIOSIntNo;
-    VCRF    aCRF;
-    BUFFER  pB[2];
-    } INTCRF;
-
-#define PMIREQUEST_LOADPMIFILE          21
-#define PMIREQUEST_IDENTIFYADAPTER      22
-#define PMIREQUEST_SOFTWAREINT          23
-
-#ifdef  PTR_DECL_IN_FRONT
-#define EXPENTRYP   * EXPENTRY
-#else
-#define EXPENTRYP   EXPENTRY *
-#endif
-
-/* Entry point to VIDEOPMI32Request. This may be overridden by external
- * code that has already loaded VIDEOPMI to avoid loading it twice.
- */
-
-APIRET (EXPENTRYP PM_VIDEOPMI32Request)(PVIDEO_ADAPTER, ULONG, PVOID, PVOID) = NULL;
-static ibool        haveInt10 = -1; /* True if we have Int 10 support   */
-static ibool        useVPMI = true; /* False if VIDEOPMI unavailable    */
-static VIDEO_ADAPTER Adapter;       /* Video adapter for VIDEOPMI       */
-static uchar        RMBuf[1024];    /* Fake real mode transfer buffer   */
-static uint         VESABuf_len = 1024;/* Length of the VESABuf buffer  */
-static void         *VESABuf_ptr = NULL;/* Near pointer to VESABuf      */
-static uint         VESABuf_rseg;   /* Real mode segment of VESABuf     */
-static uint         VESABuf_roff;   /* Real mode offset of VESABuf      */
-static uchar *      lowMem = NULL;
-static ibool        isSessionSwitching = false;
-static ulong        parmsIn[4];     /* Must not cross 64Kb boundary!    */
-static ulong        parmsOut[4];    /* Must not cross 64Kb boundary!    */
-extern ushort       _PM_gdt;
-static void (PMAPIP fatalErrorCleanup)(void) = NULL;
-
-/* DosSysCtl prototype. It is not declared in the headers but it is in the
- * standard import libraries (DOSCALLS.876). Funny.
- */
-APIRET APIENTRY DosSysCtl(ULONG ulFunction, PVOID pvData);
-
-/* This is the stack size for the threads that track the session switch event */
-#define SESSION_SWITCH_STACK_SIZE   32768
-
-typedef struct {
-    VIOMODEINFO     vmi;
-    USHORT          CursorX;
-    USHORT          CursorY;
-    UCHAR           FrameBuffer[1];
-    } CONSOLE_SAVE;
-
-typedef struct _SESWITCHREC {
-    /* The following variable is volatile because of PM_SUSPEND_APP         */
-    volatile int    Flags;          /* -1 or PM_DEACTIVATE or PM_REACTIVATE */
-    PM_saveState_cb Callback;       /* Save/restore context callback        */
-    HMTX            Mutex;          /* Exclusive access mutex               */
-    HEV             Event;          /* Posted after callback is called      */
-    } SESWITCHREC;
-
-/* Page sized block cache */
-
-#define PAGES_PER_BLOCK     32
-#define PAGE_BLOCK_SIZE     (PAGES_PER_BLOCK * PM_PAGE_SIZE + (PM_PAGE_SIZE-1) + sizeof(pageblock))
-#define FREELIST_NEXT(p)    (*(void**)(p))
-typedef struct pageblock {
-    struct pageblock    *next;
-    struct pageblock    *prev;
-    void                *freeListStart;
-    void                *freeList;
-    void                *freeListEnd;
-    int                 freeCount;
-    PM_lockHandle       lockHandle;
-    } pageblock;
-
-static pageblock    *pageBlocks = NULL;
-
-/*----------------------------- Implementation ----------------------------*/
-
-/****************************************************************************
-PARAMETERS:
-func        - Helper device driver function to call
-
-RETURNS:
-First return value from the device driver in parmsOut[0]
-
-REMARKS:
-Function to open our helper device driver, call it and close the file
-handle. Note that we have to open the device driver for every call because
-of two problems:
-
- 1. We cannot open a single file handle in a DLL that is shared amongst
-    programs, since every process must have it's own open file handle.
-
- 2. For some reason there appears to be a limit of about 12 open file
-    handles on a device driver in the system. Hence when we open more
-    than about 12 file handles things start to go very strange.
-
-Hence we simply open the file handle every time that we need to call the
-device driver to work around these problems.
-****************************************************************************/
-static ulong CallSDDHelp(
-    int func)
-{
-    static ulong    inLen;          /* Must not cross 64Kb boundary!    */
-    static ulong    outLen;         /* Must not cross 64Kb boundary!    */
-    HFILE           hSDDHelp;
-    ULONG           rc;
-    ulong           result;
-
-    if ((rc = DosOpen(PMHELP_NAME,&hSDDHelp,&result,0,0,
-           FILE_OPEN, OPEN_SHARE_DENYNONE | OPEN_ACCESS_READWRITE,
-           NULL)) != 0) {
-       if (rc == 4) {  /* Did we run out of file handles? */
-           ULONG   ulNewFHs;
-           LONG    lAddFHs = 5;
-
-           if (DosSetRelMaxFH(&lAddFHs, &ulNewFHs) != 0)
-               PM_fatalError("Failed to raise the file handles limit!");
-           else {
-               if ((rc = DosOpen(PMHELP_NAME,&hSDDHelp,&result,0,0,
-                       FILE_OPEN, OPEN_SHARE_DENYNONE | OPEN_ACCESS_READWRITE,
-                       NULL)) != 0) {
-                   PM_fatalError("Unable to open SDDHELP$ helper device driver! (#2)");
-                   }
-               }
-           }
-       else
-           PM_fatalError("Unable to open SDDHELP$ helper device driver!");
-       }
-    if (DosDevIOCtl(hSDDHelp,PMHELP_IOCTL,func,
-           &parmsIn, inLen = sizeof(parmsIn), &inLen,
-           &parmsOut, outLen = sizeof(parmsOut), &outLen) != 0)
-       PM_fatalError("Failure calling SDDHELP$ helper device driver!");
-    DosClose(hSDDHelp);
-    return parmsOut[0];
-}
-
-/****************************************************************************
-REMARKS:
-Determine if we're running on a DBCS system.
-****************************************************************************/
-ibool __IsDBCSSystem(void)
-{
-    CHAR        achDBCSInfo[12];
-    COUNTRYCODE ccStruct = {0, 0};
-
-    memset(achDBCSInfo, 0, 12);
-
-    /* Get the DBCS vector - if it's not empty, we're on DBCS */
-    DosQueryDBCSEnv(sizeof(achDBCSInfo), &ccStruct, achDBCSInfo);
-    if (achDBCSInfo[0] != 0)
-       return true;
-    else
-       return false;
-}
-
-/****************************************************************************
-REMARKS:
-Determine if PMSHELL is running - if it isn't, we can't use certain calls
-****************************************************************************/
-ibool __isShellLoaded(void)
-{
-    PVOID   ptr;
-
-    if (DosGetNamedSharedMem(&ptr, (PSZ)"\\SHAREMEM\\PMGLOBAL.MEM", PAG_READ) == NO_ERROR) {
-       DosFreeMem(ptr);
-       return true;
-       }
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-Initialise the PM library and connect to our helper device driver. If we
-cannot connect to our helper device driver, we bail out with an error
-message.
-****************************************************************************/
-void PMAPI PM_init(void)
-{
-    if (!lowMem) {
-       /* Obtain the 32->16 callgate from the device driver to enable IOPL */
-       if ((_PM_gdt = CallSDDHelp(PMHELP_GETGDT32)) == 0)
-           PM_fatalError("Unable to obtain call gate selector!");
-
-       PM_setIOPL(3);
-
-       /* Map the first Mb of physical memory into lowMem */
-       if ((lowMem = PM_mapPhysicalAddr(0,0xFFFFF,true)) == NULL)
-           PM_fatalError("Unable to map first Mb physical memory!");
-
-       /* Initialise the MTRR interface functions */
-       MTRR_init();
-       }
-}
-
-/****************************************************************************
-REMARKS:
-Initialise the PM library for BIOS access via VIDEOPMI. This should work
-with any GRADD driver, including SDD/2.
-****************************************************************************/
-static ibool InitInt10(void)
-{
-    HMODULE     hModGENPMI,hModSDDPMI,hModVideoPMI;
-    CHAR        buf[80],path[_MAX_PATH];
-    HEV         hevDaemon = NULLHANDLE;
-    RESULTCODES resCodes;
-
-    if (haveInt10 == -1) {
-       /* Connect to VIDEOPMI and get entry point. Note that we only
-        * do this if GENPMI or SDDPMI are already loaded, since we need
-        * a GRADD based driver for this to work.
-        */
-       PM_init();
-       haveInt10 = false;
-       if (DosQueryModuleHandle((PSZ)"GENPMI.DLL",&hModGENPMI) != 0)
-           hModGENPMI = NULLHANDLE;
-       if (DosQueryModuleHandle((PSZ)"SDDPMI.DLL",&hModSDDPMI) != 0)
-           hModSDDPMI = NULLHANDLE;
-       if (hModGENPMI || hModSDDPMI) {
-           if (DosLoadModule((PSZ)buf,sizeof(buf),(PSZ)"VIDEOPMI.DLL",&hModVideoPMI) == 0) {
-               if (DosQueryProcAddr(hModVideoPMI,0,(PSZ)"VIDEOPMI32Request",(void*)&PM_VIDEOPMI32Request) != 0)
-                   PM_fatalError("Unable to get VIDEOPMI32Request entry point!");
-               strcpy(path,"X:\\OS2\\SVGADATA.PMI");
-               path[0] = PM_getBootDrive();
-               if (PM_VIDEOPMI32Request(&Adapter,PMIREQUEST_LOADPMIFILE,path,NULL) != 0) {
-                   DosFreeModule(hModVideoPMI);
-                   PM_VIDEOPMI32Request = NULL;
-                   haveInt10 = false;
-                   }
-               else {
-                   /* Attempt to initialise the full VDM in the system. This will only
-                    * work if VPRPMI.SYS is loaded, but it provides support for passing
-                    * values in ES/DS/ESI/EDI between the BIOS which does not work with
-                    * kernel VDM's in fixpacks earlier than FP15. FP15 and later and
-                    * the new Warp 4.51 and Warp Server convenience packs should work
-                    * fine with the kernel mini-VDM.
-                    *
-                    * Also the full VDM is the only solution for really old kernels
-                    * (but GRADD won't run on them so this is superfluous ;-).
-                    */
-                   INITVDM InitVDM = {VDM_INITIALIZE,NULL,NULL};
-                   PM_VIDEOPMI32Request(&Adapter,PMIREQUEST_SOFTWAREINT,&InitVDM,NULL);
-                   haveInt10 = true;
-                   }
-               }
-           }
-       else {
-           /* A GRADD driver isn't loaded, hence we can't use VIDEOPMI. But we will try
-            * to access the mini-VDM directly, first verifying that the support is
-            * available in the kernel (it should be for kernels that support GRADD).
-            * This may be needed in a command line boot or if non-GRADD driver is
-            * used (Matrox or classic VGA).
-            * Note: because of problems with mini-VDM support in the kernel, we have to
-            * spawn a daemon process that will do the actual mini-VDM access for us.
-            */
-            /* Try to open shared semaphore to see if our daemon is already up */
-           if (DosOpenEventSem(SHAREDSEM, &hevDaemon) == NO_ERROR) {
-               if (DosWaitEventSem(hevDaemon, 1) == NO_ERROR) {
-                   /* If semaphore is posted, all is well */
-                   useVPMI   = false;
-                   haveInt10 = true;
-                   }
-               }
-           else {
-               /* Create shared event semaphore */
-               if (DosCreateEventSem(SHAREDSEM, &hevDaemon, DC_SEM_SHARED, FALSE) == NO_ERROR) {
-                   PM_findBPD(DAEMON_NAME, path);
-                   strcat(path, DAEMON_NAME);
-                   if (DosExecPgm(buf, sizeof(buf), EXEC_BACKGROUND, (PSZ)DAEMON_NAME,
-                       NULL, &resCodes, (PSZ)path) == NO_ERROR) {
-                       /* The daemon was successfully spawned, now give it a sec to come up */
-                       if (DosWaitEventSem(hevDaemon, 2000) == NO_ERROR) {
-                           /* It's up! */
-                           useVPMI   = false;
-                           haveInt10 = true;
-                           }
-                       }
-                   }
-               }
-           }
-       }
-    return haveInt10;
-}
-
-/****************************************************************************
-REMARKS:
-We "probably" have BIOS access under OS/2 but we have to verify/initialize it
-first.
-****************************************************************************/
-ibool PMAPI PM_haveBIOSAccess(void)
-{
-    return InitInt10();
-}
-
-/****************************************************************************
-REMARKS:
-Return the operating system type identifier.
-****************************************************************************/
-long PMAPI PM_getOSType(void)
-{
-    return _OS_OS2;
-}
-
-/****************************************************************************
-REMARKS:
-Return the runtime type identifier.
-****************************************************************************/
-int PMAPI PM_getModeType(void)
-{
-    return PM_386;
-}
-
-/****************************************************************************
-REMARKS:
-Add a file directory separator to the end of the filename.
-****************************************************************************/
-void PMAPI PM_backslash(
-    char *s)
-{
-    uint pos = strlen(s);
-    if (s[pos-1] != '\\') {
-       s[pos] = '\\';
-       s[pos+1] = '\0';
-       }
-}
-
-/****************************************************************************
-REMARKS:
-Add a user defined PM_fatalError cleanup function.
-****************************************************************************/
-void PMAPI PM_setFatalErrorCleanup(
-    void (PMAPIP cleanup)(void))
-{
-    fatalErrorCleanup = cleanup;
-}
-
-/****************************************************************************
-REMARKS:
-Report a fatal error condition and halt the program.
-****************************************************************************/
-void PMAPI PM_fatalError(
-    const char *msg)
-{
-    /* Be prepare to be called recursively (failed to fail situation :-) */
-    static int fatalErrorCount = 0;
-    if (fatalErrorCount++ == 0) {
-       if (fatalErrorCleanup)
-           fatalErrorCleanup();
-       }
-    fprintf(stderr,"%s\n", msg);
-    exit(1);
-}
-
-/****************************************************************************
-REMARKS:
-Allocate the real mode VESA transfer buffer for communicating with the BIOS.
-****************************************************************************/
-void * PMAPI PM_getVESABuf(
-    uint *len,
-    uint *rseg,
-    uint *roff)
-{
-    if (!VESABuf_ptr) {
-       /* Allocate a global buffer for communicating with the VESA VBE */
-       if ((VESABuf_ptr = PM_allocRealSeg(VESABuf_len, &VESABuf_rseg, &VESABuf_roff)) == NULL)
-           return NULL;
-       }
-    *len = VESABuf_len;
-    *rseg = VESABuf_rseg;
-    *roff = VESABuf_roff;
-    return VESABuf_ptr;
-}
-
-/****************************************************************************
-REMARKS:
-Check if a key has been pressed.
-****************************************************************************/
-int PMAPI PM_kbhit(void)
-{
-    KBDKEYINFO   key;            /* Must not cross a 64K boundary    */
-
-    KbdPeek(&key, 0);
-    return (key.fbStatus & KBDTRF_FINAL_CHAR_IN);
-}
-
-/****************************************************************************
-REMARKS:
-Wait for and return the next keypress.
-****************************************************************************/
-int PMAPI PM_getch(void)
-{
-    KBDKEYINFO   key;            /* Must not cross a 64K boundary    */
-
-    KbdCharIn(&key,IO_WAIT,0);
-    return key.chChar;
-}
-
-/****************************************************************************
-REMARKS:
-Open a fullscreen console for output to the screen. This requires that
-the application be a fullscreen VIO program.
-****************************************************************************/
-PM_HWND PMAPI PM_openConsole(
-    PM_HWND hwndUser,
-    int device,
-    int xRes,
-    int yRes,
-    int bpp,
-    ibool fullScreen)
-{
-    (void)hwndUser;
-    (void)device;
-    (void)xRes;
-    (void)yRes;
-    (void)bpp;
-    (void)fullScreen;
-    return 0;
-}
-
-/****************************************************************************
-REMARKS:
-Find the size of the console state buffer.
-****************************************************************************/
-int PMAPI PM_getConsoleStateSize(void)
-{
-    VIOMODEINFO vmi;
-    vmi.cb = sizeof (VIOMODEINFO);
-    VioGetMode (&vmi, (HVIO)0);
-    return sizeof (CONSOLE_SAVE) - 1 + vmi.col * vmi.row * 2;
-}
-
-/****************************************************************************
-REMARKS:
-Save the state of the console.
-****************************************************************************/
-void PMAPI PM_saveConsoleState(
-    void *stateBuf,
-    PM_HWND hwndConsole)
-{
-    USHORT          fblen;
-    CONSOLE_SAVE    *cs = (CONSOLE_SAVE*)stateBuf;
-    VIOMODEINFO     vmi;
-
-    /* The reason for the VIOMODEINFO juggling is 16-bit code. Because the user
-     * allocates the state buffer, cd->vmi might be crossing the 64K boundary and
-     * the 16-bit API would fail. If we create another copy on stack, the compiler
-     * should ensure that the 64K boundary will not be crossed (it adjusts the stack
-     * if it should cross).
-     */
-    vmi.cb = sizeof(VIOMODEINFO);
-    VioGetMode(&vmi,(HVIO)0);
-    memcpy(&cs->vmi, &vmi, sizeof(VIOMODEINFO));
-    VioGetCurPos(&cs->CursorY, &cs->CursorX, (HVIO)0);
-    fblen = cs->vmi.col * cs->vmi.row * 2;
-    VioReadCellStr((PCH)cs->FrameBuffer, &fblen, 0, 0, (HVIO)0);
-}
-
-/* Global variable to communicate between threads */
-static SESWITCHREC SesSwitchRec = { -1 };
-
-/****************************************************************************
-REMARKS:
-Called by external routines at least once per frame to check whenever a
-session save/restore should be performed. Since we receive such notifications
-asyncronously, we can't perform all required operations at that time.
-****************************************************************************/
-void __PM_checkConsoleSwitch(void)
-{
-    int             Flags, Mode;
-    PM_saveState_cb Callback;
-
-    /* Quick optimized path for most common case */
-    if (SesSwitchRec.Flags == -1)
-       return;
-
-again:
-    if (DosRequestMutexSem(SesSwitchRec.Mutex, 100))
-       return;
-    Flags = SesSwitchRec.Flags;
-    Callback = SesSwitchRec.Callback;
-    SesSwitchRec.Flags = -1;
-    DosReleaseMutexSem(SesSwitchRec.Mutex);
-
-    isSessionSwitching = true;            /* Prevent VIO calls */
-    Mode = Callback(Flags);
-    isSessionSwitching = false;
-    DosPostEventSem(SesSwitchRec.Event);
-    if (Flags == PM_DEACTIVATE && Mode == PM_SUSPEND_APP)
-       /* Suspend application until we switch back to our application */
-       for (;;) {
-           DosSleep (500);
-           /* SesSwitchRec.Flags is volatile so optimizer
-            * won't load it into a register
-            */
-           if (SesSwitchRec.Flags != -1)
-               goto again;
-           }
-}
-
-/****************************************************************************
-REMARKS:
-Waits until main thread processes the session switch event.
-****************************************************************************/
-static void _PM_SessionSwitchEvent(
-    PM_saveState_cb saveState,
-    int flags)
-{
-    ULONG Count;
-
-    if (DosRequestMutexSem(SesSwitchRec.Mutex, 10000))
-       return;
-
-    /* We're going to wait on that semaphore */
-    DosResetEventSem(SesSwitchRec.Event, &Count);
-    SesSwitchRec.Callback = saveState;
-    SesSwitchRec.Flags = flags;
-    DosReleaseMutexSem(SesSwitchRec.Mutex);
-
-    /* Now wait until all required operations are complete */
-    DosWaitEventSem (SesSwitchRec.Event, 10000);
-}
-
-/****************************************************************************
-REMARKS:
-This is the thread responsible for tracking switches back to our
-fullscreen session.
-****************************************************************************/
-static void _PM_ConsoleSwitch(
-    PM_saveState_cb saveState)
-{
-    USHORT NotifyType;
-
-    for (;;) {
-       if (VioModeWait(VMWR_POPUP, &NotifyType, 0) != 0)
-           break;
-       _PM_SessionSwitchEvent(saveState, PM_REACTIVATE);
-       }
-    VioModeUndo(UNDOI_RELEASEOWNER, UNDOK_ERRORCODE, (HVIO)0);
-}
-
-/****************************************************************************
-REMARKS:
-This is the thread responsible for tracking screen popups (usually fatal
-error handler uses them).
-****************************************************************************/
-static void _PM_ConsolePopup(
-    PM_saveState_cb saveState)
-{
-    USHORT NotifyType;
-    for (;;) {
-       if (VioSavRedrawWait(VSRWI_SAVEANDREDRAW, &NotifyType, 0) != 0)
-           break;
-       if (NotifyType == VSRWN_SAVE)
-           _PM_SessionSwitchEvent(saveState, PM_DEACTIVATE);
-       else if (NotifyType == VSRWN_REDRAW)
-           _PM_SessionSwitchEvent(saveState, PM_REACTIVATE);
-       }
-    VioSavRedrawUndo(UNDOI_RELEASEOWNER, UNDOK_ERRORCODE, (HVIO)0);
-}
-
-/****************************************************************************
-REMARKS:
-Set the suspend application callback for the fullscreen console.
-****************************************************************************/
-void PMAPI PM_setSuspendAppCallback(
-    PM_saveState_cb saveState)
-{
-    /* If PM isn't loaded, this stuff will cause crashes! */
-    if (__isShellLoaded()) {
-       if (saveState) {
-           /* Create the threads responsible for tracking console switches */
-           SesSwitchRec.Flags = -1;
-           DosCreateMutexSem(NULL, &SesSwitchRec.Mutex, 0, FALSE);
-           DosCreateEventSem(NULL, &SesSwitchRec.Event, 0, FALSE);
-           _beginthread ((void(*)(void*))_PM_ConsoleSwitch,NULL,SESSION_SWITCH_STACK_SIZE, (void*)saveState);
-           _beginthread ((void(*)(void*))_PM_ConsolePopup,NULL,SESSION_SWITCH_STACK_SIZE, (void*)saveState);
-           }
-       else {
-           /* Kill the threads responsible for tracking console switches */
-           VioModeUndo(UNDOI_RELEASEOWNER, UNDOK_TERMINATE, (HVIO)0);
-           VioSavRedrawUndo(UNDOI_RELEASEOWNER, UNDOK_TERMINATE, (HVIO)0);
-           DosCloseEventSem(SesSwitchRec.Event);
-           DosCloseMutexSem(SesSwitchRec.Mutex);
-           }
-       }
-}
-
-/****************************************************************************
-REMARKS:
-Restore the console state.
-****************************************************************************/
-void PMAPI PM_restoreConsoleState(
-    const void *stateBuf,
-    PM_HWND hwndConsole)
-{
-    CONSOLE_SAVE *cs = (CONSOLE_SAVE *)stateBuf;
-    VIOMODEINFO  vmi;
-
-    if (!cs)
-       return;
-
-    memcpy(&vmi, &cs->vmi, sizeof (VIOMODEINFO));
-    VioSetMode(&vmi, (HVIO)0);
-    VioSetCurPos(cs->CursorY, cs->CursorX, (HVIO)0);
-    VioWrtCellStr((PCH)cs->FrameBuffer, cs->vmi.col * cs->vmi.row * 2,0, 0, (HVIO)0);
-}
-
-/****************************************************************************
-REMARKS:
-Close the fullscreen console.
-****************************************************************************/
-void PMAPI PM_closeConsole(
-    PM_HWND hwndConsole)
-{
-    /* Kill the threads responsible for tracking console switches */
-    PM_setSuspendAppCallback(NULL);
-    (void)hwndConsole;
-}
-
-/****************************************************************************
-REMARKS:
-Set the location of the OS console cursor.
-****************************************************************************/
-void PM_setOSCursorLocation(
-    int x,
-    int y)
-{
-    /* If session switch is in progress, calling into VIO causes deadlocks! */
-    /* Also this call to VIO screws up our console library on DBCS boxes... */
-    if (!isSessionSwitching && !__IsDBCSSystem())
-       VioSetCurPos(y,x,0);
-}
-
-/****************************************************************************
-REMARKS:
-Set the width of the OS console.
-****************************************************************************/
-void PM_setOSScreenWidth(
-    int width,
-    int height)
-{
-    /* Nothing to do in here */
-    (void)width;
-    (void)height;
-}
-
-/****************************************************************************
-REMARKS:
-Set the real time clock handler (used for software stereo modes).
-****************************************************************************/
-ibool PMAPI PM_setRealTimeClockHandler(
-    PM_intHandler ih,
-    int frequency)
-{
-    /* TODO: Implement this! */
-    (void)ih;
-    (void)frequency;
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-Set the real time clock frequency (for stereo modes).
-****************************************************************************/
-void PMAPI PM_setRealTimeClockFrequency(
-    int frequency)
-{
-    /* TODO: Implement this! */
-    (void)frequency;
-}
-
-/****************************************************************************
-REMARKS:
-Restore the original real time clock handler.
-****************************************************************************/
-void PMAPI PM_restoreRealTimeClockHandler(void)
-{
-    /* TODO: Implement this! */
-}
-
-/****************************************************************************
-REMARKS:
-Return the current operating system path or working directory.
-****************************************************************************/
-char * PMAPI PM_getCurrentPath(
-    char *path,
-    int maxLen)
-{
-    return getcwd(path,maxLen);
-}
-
-/****************************************************************************
-REMARKS:
-Return the drive letter for the boot drive.
-****************************************************************************/
-char PMAPI PM_getBootDrive(void)
-{
-    ulong   boot = 3;
-    DosQuerySysInfo(QSV_BOOT_DRIVE,QSV_BOOT_DRIVE,&boot,sizeof(boot));
-    return (char)('a' + boot - 1);
-}
-
-/****************************************************************************
-REMARKS:
-Return the path to the VBE/AF driver files.
-****************************************************************************/
-const char * PMAPI PM_getVBEAFPath(void)
-{
-    static char path[CCHMAXPATH];
-    strcpy(path,"x:\\");
-    path[0] = PM_getBootDrive();
-    return path;
-}
-
-/****************************************************************************
-REMARKS:
-Return the path to the Nucleus driver files.
-****************************************************************************/
-const char * PMAPI PM_getNucleusPath(void)
-{
-    static char path[CCHMAXPATH];
-    if (getenv("NUCLEUS_PATH") != NULL)
-       return getenv("NUCLEUS_PATH");
-    strcpy(path,"x:\\os2\\drivers");
-    path[0] = PM_getBootDrive();
-    PM_backslash(path);
-    strcat(path,"nucleus");
-    return path;
-}
-
-/****************************************************************************
-REMARKS:
-Return the path to the Nucleus configuration files.
-****************************************************************************/
-const char * PMAPI PM_getNucleusConfigPath(void)
-{
-    static char path[CCHMAXPATH];
-    strcpy(path,PM_getNucleusPath());
-    PM_backslash(path);
-    strcat(path,"config");
-    return path;
-}
-
-/****************************************************************************
-REMARKS:
-Return a unique identifier for the machine if possible.
-****************************************************************************/
-const char * PMAPI PM_getUniqueID(void)
-{
-    return PM_getMachineName();
-}
-
-/****************************************************************************
-REMARKS:
-Get the name of the machine on the network.
-****************************************************************************/
-const char * PMAPI PM_getMachineName(void)
-{
-    static char name[40],*env;
-
-    if ((env = getenv("HOSTNAME")) != NULL) {
-       strncpy(name,env,sizeof(name));
-       name[sizeof(name)-1] = 0;
-       return name;
-       }
-    return "OS2";
-}
-
-/****************************************************************************
-REMARKS:
-Return a pointer to the real mode BIOS data area.
-****************************************************************************/
-void * PMAPI PM_getBIOSPointer(void)
-{
-    PM_init();
-    return lowMem + 0x400;
-}
-
-/****************************************************************************
-REMARKS:
-Return a pointer to 0xA0000 physical VGA graphics framebuffer.
-****************************************************************************/
-void * PMAPI PM_getA0000Pointer(void)
-{
-    PM_init();
-    return lowMem + 0xA0000;
-}
-
-/****************************************************************************
-REMARKS:
-Map a physical address to a linear address in the callers process.
-****************************************************************************/
-void * PMAPI PM_mapPhysicalAddr(
-    ulong base,
-    ulong limit,
-    ibool isCached)
-{
-    ulong   baseAddr,baseOfs,linear;
-
-    /* Round the physical address to a 4Kb boundary and the limit to a
-     * 4Kb-1 boundary before passing the values to mmap. If we round the
-     * physical address, then we also add an extra offset into the address
-     * that we return.
-     */
-    baseOfs = base & 4095;
-    baseAddr = base & ~4095;
-    limit = ((limit+baseOfs+1+4095) & ~4095)-1;
-    parmsIn[0] = baseAddr;
-    parmsIn[1] = limit;
-    parmsIn[2] = isCached;
-    if ((linear = CallSDDHelp(PMHELP_MAPPHYS)) == 0)
-       return NULL;
-    return (void*)(linear + baseOfs);
-}
-
-/****************************************************************************
-REMARKS:
-Free a physical address mapping allocated by PM_mapPhysicalAddr.
-****************************************************************************/
-void PMAPI PM_freePhysicalAddr(
-    void *ptr,
-    ulong limit)
-{
-    parmsIn[0] = (ulong)ptr;
-    parmsIn[1] = limit;
-    CallSDDHelp(PMHELP_FREEPHYS);
-}
-
-/****************************************************************************
-REMARKS:
-Find the physical address of a linear memory address in current process.
-****************************************************************************/
-ulong PMAPI PM_getPhysicalAddr(
-    void *p)
-{
-    parmsIn[0] = (ulong)p;
-    return CallSDDHelp(PMHELP_GETPHYSICALADDR);
-}
-
-/****************************************************************************
-REMARKS:
-Find the physical address of a linear memory address in current process.
-****************************************************************************/
-ibool PMAPI PM_getPhysicalAddrRange(
-    void *p,
-    ulong length,
-    ulong *physAddress)
-{
-    parmsIn[0] = (ulong)p;
-    parmsIn[1] = (ulong)length;
-    parmsIn[2] = (ulong)physAddress;
-    return CallSDDHelp(PMHELP_GETPHYSICALADDRRANGE);
-}
-
-/****************************************************************************
-REMARKS:
-Sleep for the specified number of milliseconds.
-****************************************************************************/
-void PMAPI PM_sleep(
-    ulong milliseconds)
-{
-    DosSleep(milliseconds);
-}
-
-/****************************************************************************
-REMARKS:
-Return the base I/O port for the specified COM port.
-****************************************************************************/
-int PMAPI PM_getCOMPort(
-    int port)
-{
-    switch (port) {
-       case 0: return 0x3F8;
-       case 1: return 0x2F8;
-       }
-    return 0;
-}
-
-/****************************************************************************
-REMARKS:
-Return the base I/O port for the specified LPT port.
-****************************************************************************/
-int PMAPI PM_getLPTPort(
-    int port)
-{
-    switch (port) {
-       case 0: return 0x3BC;
-       case 1: return 0x378;
-       case 2: return 0x278;
-       }
-    return 0;
-}
-
-/****************************************************************************
-REMARKS:
-Allocate a block of shared memory. For Win9x we allocate shared memory
-as locked, global memory that is accessible from any memory context
-(including interrupt time context), which allows us to load our important
-data structure and code such that we can access it directly from a ring
-0 interrupt context.
-****************************************************************************/
-void * PMAPI PM_mallocShared(
-    long size)
-{
-    parmsIn[0] = size;
-    return (void*)CallSDDHelp(PMHELP_MALLOCSHARED);
-}
-
-/****************************************************************************
-REMARKS:
-Free a block of shared memory.
-****************************************************************************/
-void PMAPI PM_freeShared(
-    void *ptr)
-{
-    parmsIn[0] = (ulong)ptr;
-    CallSDDHelp(PMHELP_FREESHARED);
-}
-
-/****************************************************************************
-REMARKS:
-Map a linear memory address to the calling process address space. The
-address will have been allocated in another process using the
-PM_mapPhysicalAddr function.
-****************************************************************************/
-void * PMAPI PM_mapToProcess(
-    void *base,
-    ulong limit)
-{
-    ulong   baseAddr,baseOfs;
-
-    /* Round the physical address to a 4Kb boundary and the limit to a
-     * 4Kb-1 boundary before passing the values to mmap. If we round the
-     * physical address, then we also add an extra offset into the address
-     * that we return.
-     */
-    baseOfs = (ulong)base & 4095;
-    baseAddr = (ulong)base & ~4095;
-    limit = ((limit+baseOfs+1+4095) & ~4095)-1;
-    parmsIn[0] = (ulong)baseAddr;
-    parmsIn[1] = limit;
-    return (void*)(CallSDDHelp(PMHELP_MAPTOPROCESS)+baseOfs);
-}
-
-/****************************************************************************
-REMARKS:
-Map a real mode pointer to a protected mode pointer.
-****************************************************************************/
-void * PMAPI PM_mapRealPointer(
-    uint r_seg,
-    uint r_off)
-{
-    if (r_seg == 0xFFFF)
-       return &RMBuf[r_off];
-    return lowMem + MK_PHYS(r_seg,r_off);
-}
-
-/****************************************************************************
-REMARKS:
-Allocate a block of real mode memory
-****************************************************************************/
-void * PMAPI PM_allocRealSeg(
-    uint size,
-    uint *r_seg,
-    uint *r_off)
-{
-    if (size > sizeof(RMBuf))
-       return NULL;
-    *r_seg = 0xFFFF;
-    *r_off = 0x0000;
-    return &RMBuf;
-}
-
-/****************************************************************************
-REMARKS:
-Free a block of real mode memory.
-****************************************************************************/
-void PMAPI PM_freeRealSeg(
-    void *mem)
-{
-    /* Nothing to do in here */
-    (void)mem;
-}
-
-#define INDPMI(reg)     rmregs.aCRF.reg_##reg = regs->reg
-#define OUTDPMI(reg)    regs->reg = rmregs.aCRF.reg_##reg
-
-#define REG_OFFSET(field)  (((ULONG)&(((VCRF*)0)->field))  / sizeof(ULONG))
-
-/****************************************************************************
-REMARKS:
-Issue a real mode interrupt (parameters in DPMI compatible structure)
-****************************************************************************/
-void PMAPI DPMI_int86(
-    int intno,
-    DPMI_regs *regs)
-{
-    INTCRF  rmregs;
-    ulong   eax = 0;
-
-    if (!InitInt10())
-       return;
-    memset(&rmregs, 0, sizeof(rmregs));
-    rmregs.ulBIOSIntNo = intno;
-    INDPMI(eax); INDPMI(ebx); INDPMI(ecx); INDPMI(edx); INDPMI(esi); INDPMI(edi);
-    rmregs.aCRF.reg_ds = regs->ds;
-    rmregs.aCRF.reg_es = regs->es;
-    if (intno == 0x10) {
-       eax = rmregs.aCRF.reg_eax;
-       switch (eax & 0xFFFF) {
-           case 0x4F00:
-               /* We have to hack the way this function works, due to
-                * some bugs in the IBM mini-VDM BIOS support. Specifically
-                * we need to make the input buffer and output buffer the
-                * 'same' buffer, and that ES:SI points to the output
-                * buffer (ignored by the BIOS). The data will end up
-                * being returned in the input buffer, except for the
-                * first four bytes ('VESA') that will not be returned.
-                */
-               rmregs.pB[0].bBufferType = INPUT_BUFFER;
-               rmregs.pB[0].bSelCRF = REG_OFFSET(reg_es);
-               rmregs.pB[0].bOffCRF = REG_OFFSET(reg_edi);
-               rmregs.pB[0].pAddress = RMBuf;
-               rmregs.pB[0].ulSize = 4;
-               rmregs.pB[1].bBufferType = OUTPUT_BUFFER;
-               rmregs.pB[1].bSelCRF = REG_OFFSET(reg_es);
-               rmregs.pB[1].bOffCRF = REG_OFFSET(reg_esi);
-               rmregs.pB[1].pAddress = ((PBYTE)RMBuf)+4;
-               rmregs.pB[1].ulSize = 512-4;
-               break;
-           case 0x4F01:
-               rmregs.pB[0].bBufferType = OUTPUT_BUFFER;
-               rmregs.pB[0].bSelCRF = REG_OFFSET(reg_es);
-               rmregs.pB[0].bOffCRF = REG_OFFSET(reg_edi);
-               rmregs.pB[0].pAddress = RMBuf;
-               rmregs.pB[0].ulSize = 256;
-               break;
-           case 0x4F02:
-               rmregs.pB[0].bBufferType = INPUT_BUFFER;
-               rmregs.pB[0].bSelCRF = REG_OFFSET(reg_es);
-               rmregs.pB[0].bOffCRF = REG_OFFSET(reg_edi);
-               rmregs.pB[0].pAddress = RMBuf;
-               rmregs.pB[0].ulSize = 256;
-               break;
-           case 0x4F09:
-               rmregs.pB[0].bBufferType = INPUT_BUFFER;
-               rmregs.pB[0].bSelCRF = REG_OFFSET(reg_es);
-               rmregs.pB[0].bOffCRF = REG_OFFSET(reg_edi);
-               rmregs.pB[0].pAddress = RMBuf;
-               rmregs.pB[0].ulSize = 1024;
-               break;
-           case 0x4F0A:
-               /* Due to bugs in the mini-VDM in OS/2, the 0x4F0A protected
-                * mode interface functions will not work (we never get any
-                * selectors returned), so we fail this function here. The
-                * rest of the VBE/Core driver will work properly if this
-                * function is failed, because the VBE 2.0 and 3.0 specs
-                * allow for this.
-                */
-               regs->eax = 0x014F;
-               return;
-           }
-       }
-    if (useVPMI)
-       PM_VIDEOPMI32Request(&Adapter,PMIREQUEST_SOFTWAREINT,NULL,&rmregs);
-    else {
-       DosSysCtl(6, &rmregs);
-       }
-
-    OUTDPMI(eax); OUTDPMI(ebx); OUTDPMI(ecx); OUTDPMI(edx); OUTDPMI(esi); OUTDPMI(edi);
-    if (((regs->eax & 0xFFFF) == 0x004F) && ((eax & 0xFFFF) == 0x4F00)) {
-       /* Hack to fix up the missing 'VESA' string for mini-VDM */
-       memcpy(RMBuf,"VESA",4);
-       }
-    regs->ds = rmregs.aCRF.reg_ds;
-    regs->es = rmregs.aCRF.reg_es;
-    regs->flags = rmregs.aCRF.reg_eflag;
-}
-
-#define IN(reg)     rmregs.reg = in->e.reg
-#define OUT(reg)    out->e.reg = rmregs.reg
-
-/****************************************************************************
-REMARKS:
-Issue a real mode interrupt.
-****************************************************************************/
-int PMAPI PM_int86(
-    int intno,
-    RMREGS *in,
-    RMREGS *out)
-{
-    DPMI_regs   rmregs;
-
-    memset(&rmregs, 0, sizeof(rmregs));
-    IN(eax); IN(ebx); IN(ecx); IN(edx); IN(esi); IN(edi);
-    DPMI_int86(intno,&rmregs);
-    OUT(eax); OUT(ebx); OUT(ecx); OUT(edx); OUT(esi); OUT(edi);
-    out->x.cflag = rmregs.flags & 0x1;
-    return out->x.ax;
-}
-
-/****************************************************************************
-REMARKS:
-Issue a real mode interrupt.
-****************************************************************************/
-int PMAPI PM_int86x(
-    int intno,
-    RMREGS *in,
-    RMREGS *out,
-    RMSREGS *sregs)
-{
-    DPMI_regs   rmregs;
-
-    memset(&rmregs, 0, sizeof(rmregs));
-    IN(eax); IN(ebx); IN(ecx); IN(edx); IN(esi); IN(edi);
-    rmregs.es = sregs->es;
-    rmregs.ds = sregs->ds;
-    DPMI_int86(intno,&rmregs);
-    OUT(eax); OUT(ebx); OUT(ecx); OUT(edx); OUT(esi); OUT(edi);
-    sregs->es = rmregs.es;
-    sregs->cs = rmregs.cs;
-    sregs->ss = rmregs.ss;
-    sregs->ds = rmregs.ds;
-    out->x.cflag = rmregs.flags & 0x1;
-    return out->x.ax;
-}
-
-/****************************************************************************
-REMARKS:
-Call a real mode far function.
-****************************************************************************/
-void PMAPI PM_callRealMode(
-    uint seg,
-    uint off,
-    RMREGS *in,
-    RMSREGS *sregs)
-{
-    PM_fatalError("PM_callRealMode not supported on OS/2!");
-}
-
-/****************************************************************************
-REMARKS:
-Return the amount of available memory.
-****************************************************************************/
-void PMAPI PM_availableMemory(
-    ulong *physical,
-    ulong *total)
-{
-    /* Unable to get reliable values from OS/2 for this */
-    *physical = *total = 0;
-}
-
-/****************************************************************************
-REMARKS:
-Allocate a block of locked, physical memory for DMA operations.
-****************************************************************************/
-void * PMAPI PM_allocLockedMem(
-    uint size,
-    ulong *physAddr,
-    ibool contiguous,
-    ibool below16M)
-{
-    parmsIn[0] = size;
-    parmsIn[1] = contiguous;
-    parmsIn[2] = below16M;
-    CallSDDHelp(PMHELP_ALLOCLOCKED);
-    *physAddr = parmsOut[1];
-    return (void*)parmsOut[0];
-}
-
-/****************************************************************************
-REMARKS:
-Free a block of locked physical memory.
-****************************************************************************/
-void PMAPI PM_freeLockedMem(
-    void *p,
-    uint size,
-    ibool contiguous)
-{
-    parmsIn[0] = (ulong)p;
-    CallSDDHelp(PMHELP_FREELOCKED);
-}
-
-/****************************************************************************
-REMARKS:
-Allocates a new block of pages for the page block manager.
-****************************************************************************/
-static pageblock *PM_addNewPageBlock(void)
-{
-    int         i;
-    pageblock   *newBlock;
-    char        *p,*next;
-
-    /* Allocate memory for the new page block, and add to head of list */
-    if (DosAllocSharedMem((void**)&newBlock,NULL,PAGE_BLOCK_SIZE,OBJ_GETTABLE | PAG_READ | PAG_WRITE | PAG_COMMIT))
-       return NULL;
-    if (!PM_lockDataPages(newBlock,PAGE_BLOCK_SIZE,&newBlock->lockHandle))
-       return NULL;
-    newBlock->prev = NULL;
-    newBlock->next = pageBlocks;
-    if (pageBlocks)
-       pageBlocks->prev = newBlock;
-    pageBlocks = newBlock;
-
-    /* Initialise the page aligned free list for the page block */
-    newBlock->freeCount = PAGES_PER_BLOCK;
-    newBlock->freeList = p = (char*)(((ulong)(newBlock + 1) + (PM_PAGE_SIZE-1)) & ~(PM_PAGE_SIZE-1));
-    newBlock->freeListStart = newBlock->freeList;
-    newBlock->freeListEnd = p + (PAGES_PER_BLOCK-1) * PM_PAGE_SIZE;
-    for (i = 0; i < PAGES_PER_BLOCK; i++,p = next)
-       FREELIST_NEXT(p) = next = p + PM_PAGE_SIZE;
-    FREELIST_NEXT(p - PM_PAGE_SIZE) = NULL;
-    return newBlock;
-}
-
-/****************************************************************************
-REMARKS:
-Allocates a page aligned and page sized block of memory
-****************************************************************************/
-void * PMAPI PM_allocPage(
-    ibool locked)
-{
-    pageblock   *block;
-    void        *p;
-
-    /* Scan the block list looking for any free blocks. Allocate a new
-     * page block if no free blocks are found.
-     */
-    for (block = pageBlocks; block != NULL; block = block->next) {
-       if (block->freeCount)
-           break;
-       }
-    if (block == NULL && (block = PM_addNewPageBlock()) == NULL)
-       return NULL;
-    block->freeCount--;
-    p = block->freeList;
-    block->freeList = FREELIST_NEXT(p);
-    (void)locked;
-    return p;
-}
-
-/****************************************************************************
-REMARKS:
-Free a page aligned and page sized block of memory
-****************************************************************************/
-void PMAPI PM_freePage(
-    void *p)
-{
-    pageblock   *block;
-
-    /* First find the page block that this page belongs to */
-    for (block = pageBlocks; block != NULL; block = block->next) {
-       if (p >= block->freeListStart && p <= block->freeListEnd)
-           break;
-       }
-    CHECK(block != NULL);
-
-    /* Now free the block by adding it to the free list */
-    FREELIST_NEXT(p) = block->freeList;
-    block->freeList = p;
-    if (++block->freeCount == PAGES_PER_BLOCK) {
-       /* If all pages in the page block are now free, free the entire
-        * page block itself.
-        */
-       if (block == pageBlocks) {
-           /* Delete from head */
-           pageBlocks = block->next;
-           if (block->next)
-               block->next->prev = NULL;
-           }
-       else {
-           /* Delete from middle of list */
-           CHECK(block->prev != NULL);
-           block->prev->next = block->next;
-           if (block->next)
-               block->next->prev = block->prev;
-           }
-
-       /* Unlock the memory and free it */
-       PM_unlockDataPages(block,PAGE_BLOCK_SIZE,&block->lockHandle);
-       DosFreeMem(block);
-       }
-}
-
-/****************************************************************************
-REMARKS:
-Map in all the shared memory blocks for managing the memory pages above.
-****************************************************************************/
-void PMAPI PM_mapSharedPages(void)
-{
-    pageblock   *block;
-
-    /* Map all the page blocks above into the shared memory for process */
-    for (block = pageBlocks; block != NULL; block = block->next) {
-       DosGetSharedMem(block, PAG_READ | PAG_WRITE);
-       }
-}
-
-/****************************************************************************
-REMARKS:
-Lock linear memory so it won't be paged.
-****************************************************************************/
-int PMAPI PM_lockDataPages(
-    void *p,
-    uint len,
-    PM_lockHandle *lockHandle)
-{
-    parmsIn[0] = (ulong)p;
-    parmsIn[1] = len;
-    CallSDDHelp(PMHELP_LOCKPAGES);
-    lockHandle->h[0] = parmsOut[1];
-    lockHandle->h[1] = parmsOut[2];
-    lockHandle->h[2] = parmsOut[3];
-    return parmsOut[0];
-}
-
-/****************************************************************************
-REMARKS:
-Unlock linear memory so it won't be paged.
-****************************************************************************/
-int PMAPI PM_unlockDataPages(
-    void *p,
-    uint len,
-    PM_lockHandle *lockHandle)
-{
-    parmsIn[0] = lockHandle->h[0];
-    parmsIn[1] = lockHandle->h[1];
-    parmsIn[2] = lockHandle->h[2];
-    return CallSDDHelp(PMHELP_UNLOCKPAGES);
-}
-
-/****************************************************************************
-REMARKS:
-Lock linear memory so it won't be paged.
-****************************************************************************/
-int PMAPI PM_lockCodePages(
-    void (*p)(),
-    uint len,
-    PM_lockHandle *lockHandle)
-{
-    parmsIn[0] = (ulong)p;
-    parmsIn[1] = len;
-    CallSDDHelp(PMHELP_LOCKPAGES);
-    lockHandle->h[0] = parmsOut[1];
-    lockHandle->h[1] = parmsOut[2];
-    lockHandle->h[2] = parmsOut[3];
-    return parmsOut[0];
-}
-
-/****************************************************************************
-REMARKS:
-Unlock linear memory so it won't be paged.
-****************************************************************************/
-int PMAPI PM_unlockCodePages(
-    void (*p)(),
-    uint len,
-    PM_lockHandle *lockHandle)
-{
-    parmsIn[0] = lockHandle->h[0];
-    parmsIn[1] = lockHandle->h[1];
-    parmsIn[2] = lockHandle->h[2];
-    return CallSDDHelp(PMHELP_UNLOCKPAGES);
-}
-
-/****************************************************************************
-REMARKS:
-Call the VBE/Core software interrupt to change display banks.
-****************************************************************************/
-void PMAPI PM_setBankA(
-    int bank)
-{
-    INTCRF  rmregs;
-
-    if (!InitInt10())
-       return;
-    memset(&rmregs, 0, sizeof(rmregs));
-    rmregs.ulBIOSIntNo = 0x10;
-    rmregs.aCRF.reg_eax = 0x4F05;
-    rmregs.aCRF.reg_ebx = 0x0000;
-    rmregs.aCRF.reg_edx = bank;
-    PM_VIDEOPMI32Request(&Adapter,PMIREQUEST_SOFTWAREINT,&rmregs,NULL);
-}
-
-/****************************************************************************
-REMARKS:
-Call the VBE/Core software interrupt to change display banks.
-****************************************************************************/
-void PMAPI PM_setBankAB(
-    int bank)
-{
-    INTCRF  rmregs;
-
-    if (!InitInt10())
-       return;
-    memset(&rmregs, 0, sizeof(rmregs));
-    rmregs.ulBIOSIntNo = 0x10;
-    rmregs.aCRF.reg_eax = 0x4F05;
-    rmregs.aCRF.reg_ebx = 0x0000;
-    rmregs.aCRF.reg_edx = bank;
-    PM_VIDEOPMI32Request(&Adapter,PMIREQUEST_SOFTWAREINT,&rmregs,NULL);
-    rmregs.ulBIOSIntNo = 0x10;
-    rmregs.aCRF.reg_eax = 0x4F05;
-    rmregs.aCRF.reg_ebx = 0x0001;
-    rmregs.aCRF.reg_edx = bank;
-    PM_VIDEOPMI32Request(&Adapter,PMIREQUEST_SOFTWAREINT,&rmregs,NULL);
-}
-
-/****************************************************************************
-REMARKS:
-Call the VBE/Core software interrupt to change display start address.
-****************************************************************************/
-void PMAPI PM_setCRTStart(
-    int x,
-    int y,
-    int waitVRT)
-{
-    INTCRF  rmregs;
-
-    if (!InitInt10())
-       return;
-    memset(&rmregs, 0, sizeof(rmregs));
-    rmregs.ulBIOSIntNo = 0x10;
-    rmregs.aCRF.reg_eax = 0x4F07;
-    rmregs.aCRF.reg_ebx = waitVRT;
-    rmregs.aCRF.reg_ecx = x;
-    rmregs.aCRF.reg_edx = y;
-    PM_VIDEOPMI32Request(&Adapter,PMIREQUEST_SOFTWAREINT,&rmregs,NULL);
-}
-
-/****************************************************************************
-REMARKS:
-Execute the POST on the secondary BIOS for a controller.
-****************************************************************************/
-ibool PMAPI PM_doBIOSPOST(
-    ushort axVal,
-    ulong BIOSPhysAddr,
-    void *mappedBIOS,
-    ulong BIOSLen)
-{
-    (void)axVal;
-    (void)BIOSPhysAddr;
-    (void)mappedBIOS;
-    (void)BIOSLen;
-    return false;
-}
-
-/****************************************************************************
-PARAMETERS:
-base    - The starting physical base address of the region
-size    - The size in bytes of the region
-type    - Type to place into the MTRR register
-
-RETURNS:
-Error code describing the result.
-
-REMARKS:
-Function to enable write combining for the specified region of memory.
-****************************************************************************/
-int PMAPI PM_enableWriteCombine(
-    ulong base,
-    ulong size,
-    uint type)
-{
-    return MTRR_enableWriteCombine(base,size,type);
-}
-
-/* TODO: Move the MTRR helper stuff into the call gate, or better yet */
-/*       entirely into the ring 0 helper driver!! */
-
-/* MTRR helper functions. To make it easier to implement the MTRR support
- * under OS/2, we simply put our ring 0 helper functions into the
- * helper device driver rather than the entire MTRR module. This makes
- * it easier to maintain the MTRR support since we don't need to deal
- * with 16-bit ring 0 code in the MTRR library.
- */
-
-/****************************************************************************
-REMARKS:
-Flush the translation lookaside buffer.
-****************************************************************************/
-void PMAPI PM_flushTLB(void)
-{
-    CallSDDHelp(PMHELP_FLUSHTLB);
-}
-
-/****************************************************************************
-REMARKS:
-Return true if ring 0 (or if we can call the helpers functions at ring 0)
-****************************************************************************/
-ibool _ASMAPI _MTRR_isRing0(void)
-{
-    return true;
-}
-
-/****************************************************************************
-REMARKS:
-Read and return the value of the CR4 register
-****************************************************************************/
-ulong _ASMAPI _MTRR_saveCR4(void)
-{
-    return CallSDDHelp(PMHELP_SAVECR4);
-}
-
-/****************************************************************************
-REMARKS:
-Restore the value of the CR4 register
-****************************************************************************/
-void _ASMAPI _MTRR_restoreCR4(ulong cr4Val)
-{
-    parmsIn[0] = cr4Val;
-    CallSDDHelp(PMHELP_RESTORECR4);
-}
-
-/****************************************************************************
-REMARKS:
-Read a machine status register for the CPU.
-****************************************************************************/
-void _ASMAPI _MTRR_readMSR(
-    ulong reg,
-    ulong *eax,
-    ulong *edx)
-{
-    parmsIn[0] = reg;
-    CallSDDHelp(PMHELP_READMSR);
-    *eax = parmsOut[0];
-    *edx = parmsOut[1];
-}
-
-/****************************************************************************
-REMARKS:
-Write a machine status register for the CPU.
-****************************************************************************/
-void _ASMAPI _MTRR_writeMSR(
-    ulong reg,
-    ulong eax,
-    ulong edx)
-{
-    parmsIn[0] = reg;
-    parmsIn[1] = eax;
-    parmsIn[2] = edx;
-    CallSDDHelp(PMHELP_WRITEMSR);
-}
-
-PM_MODULE PMAPI PM_loadLibrary(
-    const char *szDLLName)
-{
-    /* TODO: Implement this to load shared libraries! */
-    (void)szDLLName;
-    return NULL;
-}
-
-void * PMAPI PM_getProcAddress(
-    PM_MODULE hModule,
-    const char *szProcName)
-{
-    /* TODO: Implement this! */
-    (void)hModule;
-    (void)szProcName;
-    return NULL;
-}
-
-void PMAPI PM_freeLibrary(
-    PM_MODULE hModule)
-{
-    /* TODO: Implement this! */
-    (void)hModule;
-}
-
-/****************************************************************************
-REMARKS:
-Internal function to convert the find data to the generic interface.
-****************************************************************************/
-static void convertFindData(
-    PM_findData *findData,
-    FILEFINDBUF3 *blk)
-{
-    ulong   dwSize = findData->dwSize;
-
-    memset(findData,0,findData->dwSize);
-    findData->dwSize = dwSize;
-    if (blk->attrFile & FILE_READONLY)
-       findData->attrib |= PM_FILE_READONLY;
-    if (blk->attrFile & FILE_DIRECTORY)
-       findData->attrib |= PM_FILE_DIRECTORY;
-    if (blk->attrFile & FILE_ARCHIVED)
-       findData->attrib |= PM_FILE_ARCHIVE;
-    if (blk->attrFile & FILE_HIDDEN)
-       findData->attrib |= PM_FILE_HIDDEN;
-    if (blk->attrFile & FILE_SYSTEM)
-       findData->attrib |= PM_FILE_SYSTEM;
-    findData->sizeLo = blk->cbFile;
-    findData->sizeHi = 0;
-    strncpy(findData->name,blk->achName,PM_MAX_PATH);
-    findData->name[PM_MAX_PATH-1] = 0;
-}
-
-#define FIND_MASK   (FILE_ARCHIVED | FILE_DIRECTORY | FILE_SYSTEM | FILE_HIDDEN | FILE_READONLY)
-
-/****************************************************************************
-REMARKS:
-Function to find the first file matching a search criteria in a directory.
-****************************************************************************/
-void *PMAPI PM_findFirstFile(
-    const char *filename,
-    PM_findData *findData)
-{
-    FILEFINDBUF3    blk;
-    HDIR            hdir = HDIR_CREATE;
-    ulong           count = 1;
-
-    if (DosFindFirst((PSZ)filename,&hdir,FIND_MASK,&blk,sizeof(blk),&count,FIL_STANDARD) == NO_ERROR) {
-       convertFindData(findData,&blk);
-       return (void*)hdir;
-       }
-    return PM_FILE_INVALID;
-}
-
-/****************************************************************************
-REMARKS:
-Function to find the next file matching a search criteria in a directory.
-****************************************************************************/
-ibool PMAPI PM_findNextFile(
-    void *handle,
-    PM_findData *findData)
-{
-    FILEFINDBUF3    blk;
-    ulong           count = 1;
-
-    if (DosFindNext((HDIR)handle,&blk,sizeof(blk),&count) == NO_ERROR) {
-       convertFindData(findData,&blk);
-       return true;
-       }
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-Function to close the find process
-****************************************************************************/
-void PMAPI PM_findClose(
-    void *handle)
-{
-    DosFindClose((HDIR)handle);
-}
-
-/****************************************************************************
-REMARKS:
-Function to determine if a drive is a valid drive or not. Under Unix this
-function will return false for anything except a value of 3 (considered
-the root drive, and equivalent to C: for non-Unix systems). The drive
-numbering is:
-
-    0   - Current drive
-    1   - Drive A:
-    2   - Drive B:
-    3   - Drive C:
-    etc
-
-****************************************************************************/
-ibool PMAPI PM_driveValid(
-    char drive)
-{
-    ulong   cntDisk,cntDriveMap;
-    ibool   valid;
-
-    DosQueryCurrentDisk(&cntDisk,&cntDriveMap);
-    valid = (DosSetDefaultDisk(drive) == NO_ERROR);
-    DosSetDefaultDisk(cntDisk);
-    return valid;
-}
-
-/****************************************************************************
-REMARKS:
-Function to get the current working directory for the specififed drive.
-Under Unix this will always return the current working directory regardless
-of what the value of 'drive' is.
-****************************************************************************/
-void PMAPI PM_getdcwd(
-    int drive,
-    char *dir,
-    int len)
-{
-    ulong length = len;
-
-    DosQueryCurrentDir(drive, (PSZ)dir, &length);
-}
-
-/****************************************************************************
-REMARKS:
-Function to change the file attributes for a specific file.
-****************************************************************************/
-void PMAPI PM_setFileAttr(
-    const char *filename,
-    uint attrib)
-{
-    FILESTATUS3 s;
-
-    if (DosQueryPathInfo((PSZ)filename,FIL_STANDARD,(PVOID)&s,sizeof(s)))
-       return;
-    s.attrFile = 0;
-    if (attrib & PM_FILE_READONLY)
-       s.attrFile |= FILE_READONLY;
-    if (attrib & PM_FILE_ARCHIVE)
-       s.attrFile |= FILE_ARCHIVED;
-    if (attrib & PM_FILE_HIDDEN)
-       s.attrFile |= FILE_HIDDEN;
-    if (attrib & PM_FILE_SYSTEM)
-       s.attrFile |= FILE_SYSTEM;
-    DosSetPathInfo((PSZ)filename,FIL_STANDARD,(PVOID)&s,sizeof(s),0L);
-}
-
-/****************************************************************************
-REMARKS:
-Function to get the file attributes for a specific file.
-****************************************************************************/
-uint PMAPI PM_getFileAttr(
-    const char *filename)
-{
-    FILESTATUS3 fs3;
-    uint        retval = 0;
-
-    if (DosQueryPathInfo((PSZ)filename, FIL_STANDARD, &fs3, sizeof(FILESTATUS3)))
-       return 0;
-    if (fs3.attrFile & FILE_READONLY)
-       retval |= PM_FILE_READONLY;
-    if (fs3.attrFile & FILE_ARCHIVED)
-       retval |= PM_FILE_ARCHIVE;
-    if (fs3.attrFile & FILE_HIDDEN)
-       retval |= PM_FILE_HIDDEN;
-    if (fs3.attrFile & FILE_SYSTEM)
-       retval |= PM_FILE_SYSTEM;
-    return retval;
-}
-
-/****************************************************************************
-REMARKS:
-Function to create a directory.
-****************************************************************************/
-ibool PMAPI PM_mkdir(
-    const char *filename)
-{
-    return DosCreateDir((PSZ)filename,NULL) == NO_ERROR;
-}
-
-/****************************************************************************
-REMARKS:
-Function to remove a directory.
-****************************************************************************/
-ibool PMAPI PM_rmdir(
-    const char *filename)
-{
-    return DosDeleteDir((PSZ)filename) == NO_ERROR;
-}
-
-/****************************************************************************
-REMARKS:
-Function to get the file time and date for a specific file.
-****************************************************************************/
-ibool PMAPI PM_getFileTime(
-    const char *filename,
-    ibool gmTime,
-    PM_time *time)
-{
-    FILESTATUS3 fs3;
-    struct tm   tc;
-    struct tm   *ret;
-    time_t      tt;
-
-    if (DosQueryPathInfo((PSZ)filename, FIL_STANDARD, &fs3, sizeof(FILESTATUS3)))
-       return false;
-    if (gmTime) {
-       tc.tm_year = fs3.fdateLastWrite.year + 80;
-       tc.tm_mon = fs3.fdateLastWrite.month - 1;
-       tc.tm_mday = fs3.fdateLastWrite.day;
-       tc.tm_hour = fs3.ftimeLastWrite.hours;
-       tc.tm_min = fs3.ftimeLastWrite.minutes;
-       tc.tm_sec = fs3.ftimeLastWrite.twosecs * 2;
-       if((tt = mktime(&tc)) == -1)
-           return false;
-       if(!(ret = gmtime(&tt)))
-           return false;
-       time->sec = ret->tm_sec;
-       time->day = ret->tm_mday;
-       time->mon = ret->tm_mon + 1;
-       time->year = ret->tm_year - 80;
-       time->min = ret->tm_min;
-       time->hour = ret->tm_hour;
-       }
-    else {
-       time->sec = fs3.ftimeLastWrite.twosecs * 2;
-       time->day = fs3.fdateLastWrite.day;
-       time->mon = fs3.fdateLastWrite.month;
-       time->year = fs3.fdateLastWrite.year;
-       time->min = fs3.ftimeLastWrite.minutes;
-       time->hour = fs3.ftimeLastWrite.hours;
-       }
-    return true;
-}
-
-/****************************************************************************
-REMARKS:
-Function to set the file time and date for a specific file.
-****************************************************************************/
-ibool PMAPI PM_setFileTime(
-    const char *filename,
-    ibool gmTime,
-    PM_time *time)
-{
-    FILESTATUS3 fs3;
-    struct tm   tc;
-    struct tm   *ret;
-    time_t      tt;
-
-    if (DosQueryPathInfo((PSZ)filename,FIL_STANDARD,(PVOID)&fs3,sizeof(fs3)))
-       return false;
-    if (gmTime) {
-       tc.tm_year = time->year + 80;
-       tc.tm_mon = time->mon - 1;
-       tc.tm_mday = time->day;
-       tc.tm_hour = time->hour;
-       tc.tm_min = time->min;
-       tc.tm_sec = time->sec;
-       if((tt = mktime(&tc)) == -1)
-           return false;
-       ret = localtime(&tt);
-       fs3.ftimeLastWrite.twosecs = ret->tm_sec / 2;
-       fs3.fdateLastWrite.day = ret->tm_mday;
-       fs3.fdateLastWrite.month = ret->tm_mon + 1;
-       fs3.fdateLastWrite.year = ret->tm_year - 80;
-       fs3.ftimeLastWrite.minutes = ret->tm_min;
-       fs3.ftimeLastWrite.hours = ret->tm_hour;
-       }
-    else {
-       fs3.ftimeLastWrite.twosecs = time->sec / 2;
-       fs3.fdateLastWrite.day = time->day;
-       fs3.fdateLastWrite.month = time->mon;
-       fs3.fdateLastWrite.year = time->year;
-       fs3.ftimeLastWrite.minutes = time->min;
-       fs3.ftimeLastWrite.hours = time->hour;
-       }
-    memcpy(&fs3.fdateLastAccess, &fs3.fdateLastWrite, sizeof(FDATE));
-    memcpy(&fs3.fdateCreation, &fs3.fdateLastWrite, sizeof(FDATE));
-    memcpy(&fs3.ftimeLastAccess, &fs3.ftimeLastWrite, sizeof(FTIME));
-    memcpy(&fs3.ftimeCreation, &fs3.ftimeLastWrite, sizeof(FTIME));
-    DosSetPathInfo((PSZ)filename,FIL_STANDARD,(PVOID)&fs3,sizeof(FILESTATUS3),0L);
-    return true;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/os2/vflat.c b/board/MAI/bios_emulator/scitech/src/pm/os2/vflat.c
deleted file mode 100644 (file)
index 579ef2c..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Any
-*
-* Description:  Dummy module; no virtual framebuffer for this OS
-*
-****************************************************************************/
-
-#include "pmapi.h"
-
-ibool PMAPI VF_available(void)
-{
-    return false;
-}
-
-void * PMAPI VF_init(ulong baseAddr,int bankSize,int codeLen,void *bankFunc)
-{
-    baseAddr = baseAddr;
-    bankSize = bankSize;
-    codeLen = codeLen;
-    bankFunc = bankFunc;
-    return NULL;
-}
-
-void PMAPI VF_exit(void)
-{
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/os2/ztimer.c b/board/MAI/bios_emulator/scitech/src/pm/os2/ztimer.c
deleted file mode 100644 (file)
index 30ffe43..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-/****************************************************************************
-*
-*                         Ultra Long Period Timer
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  OS/2
-*
-* Description:  OS specific implementation for the Zen Timer functions.
-*
-****************************************************************************/
-
-/*---------------------------- Global variables ---------------------------*/
-
-static ulong    frequency;
-
-/*----------------------------- Implementation ----------------------------*/
-
-/****************************************************************************
-REMARKS:
-Initialise the Zen Timer module internals.
-****************************************************************************/
-void __ZTimerInit(void)
-{
-    DosTmrQueryFreq(&frequency);
-}
-
-/****************************************************************************
-REMARKS:
-Start the Zen Timer counting.
-****************************************************************************/
-#define __LZTimerOn(tm) DosTmrQueryTime((QWORD*)&tm->start)
-
-/****************************************************************************
-REMARKS:
-Compute the lap time since the timer was started.
-****************************************************************************/
-static ulong __LZTimerLap(
-    LZTimerObject *tm)
-{
-    CPU_largeInteger    tmLap,tmCount;
-
-    DosTmrQueryTime((QWORD*)&tmLap);
-    _CPU_diffTime64(&tm->start,&tmLap,&tmCount);
-    return _CPU_calcMicroSec(&tmCount,frequency);
-}
-
-/****************************************************************************
-REMARKS:
-Call the assembler Zen Timer functions to do the timing.
-****************************************************************************/
-#define __LZTimerOff(tm)    DosTmrQueryTime((QWORD*)&tm->end)
-
-/****************************************************************************
-REMARKS:
-Call the assembler Zen Timer functions to do the timing.
-****************************************************************************/
-static ulong __LZTimerCount(
-    LZTimerObject *tm)
-{
-    CPU_largeInteger tmCount;
-
-    _CPU_diffTime64(&tm->start,&tm->end,&tmCount);
-    return _CPU_calcMicroSec(&tmCount,frequency);
-}
-
-/****************************************************************************
-REMARKS:
-Define the resolution of the long period timer as microseconds per timer tick.
-****************************************************************************/
-#define ULZTIMER_RESOLUTION     1000
-
-/****************************************************************************
-REMARKS:
-Read the Long Period timer value from the BIOS timer tick.
-****************************************************************************/
-static ulong __ULZReadTime(void)
-{
-    ULONG   count;
-    DosQuerySysInfo( QSV_MS_COUNT, QSV_MS_COUNT, &count, sizeof(ULONG) );
-    return count;
-}
-
-/****************************************************************************
-REMARKS:
-Compute the elapsed time from the BIOS timer tick. Note that we check to see
-whether a midnight boundary has passed, and if so adjust the finish time to
-account for this. We cannot detect if more that one midnight boundary has
-passed, so if this happens we will be generating erronous results.
-****************************************************************************/
-ulong __ULZElapsedTime(ulong start,ulong finish)
-{ return finish - start; }
diff --git a/board/MAI/bios_emulator/scitech/src/pm/os2pm/event.c b/board/MAI/bios_emulator/scitech/src/pm/os2pm/event.c
deleted file mode 100644 (file)
index 7af20a9..0000000
+++ /dev/null
@@ -1,170 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  IBM PC (OS/2)
-*
-* Description:  OS/2 implementation for the SciTech cross platform
-*               event library.
-*
-****************************************************************************/
-
-/*---------------------------- Global Variables ---------------------------*/
-
-static int          oldMouseState;      /* Old mouse state              */
-static ulong        oldKeyMessage;      /* Old keyboard state           */
-static ushort       keyUpMsg[256] = {0};/* Table of key up messages     */
-static int          rangeX,rangeY;      /* Range of mouse coordinates   */
-HMOU                _EVT_hMouse;        /* Handle to the mouse driver   */
-
-/*---------------------------- Implementation -----------------------------*/
-
-/* These are not used under OS/2 */
-#define _EVT_disableInt()       1
-#define _EVT_restoreInt(flags)
-
-/****************************************************************************
-PARAMETERS:
-scanCode    - Scan code to test
-
-REMARKS:
-This macro determines if a specified key is currently down at the
-time that the call is made.
-****************************************************************************/
-#define _EVT_isKeyDown(scanCode)    (keyUpMsg[scanCode] != 0)
-
-/****************************************************************************
-REMARKS:
-Pumps all messages in the message queue from OS/2 into our event queue.
-****************************************************************************/
-static void _EVT_pumpMessages(void)
-{
-    /* TODO: Implement this for OS/2 Presentation Manager apps! */
-}
-
-/****************************************************************************
-REMARKS:
-This macro/function is used to converts the scan codes reported by the
-keyboard to our event libraries normalised format. We only have one scan
-code for the 'A' key, and use shift modifiers to determine if it is a
-Ctrl-F1, Alt-F1 etc. The raw scan codes from the keyboard work this way,
-but the OS gives us 'cooked' scan codes, we have to translate them back
-to the raw format.
-****************************************************************************/
-#define _EVT_maskKeyCode(evt)
-
-/****************************************************************************
-REMARKS:
-Safely abort the event module upon catching a fatal error.
-****************************************************************************/
-void _EVT_abort()
-{
-    EVT_exit();
-    PM_fatalError("Unhandled exception!");
-}
-
-/****************************************************************************
-PARAMETERS:
-mouseMove   - Callback function to call wheneve the mouse needs to be moved
-
-REMARKS:
-Initiliase the event handling module. Here we install our mouse handling ISR
-to be called whenever any button's are pressed or released. We also build
-the free list of events in the event queue.
-
-We use handler number 2 of the mouse libraries interrupt handlers for our
-event handling routines.
-****************************************************************************/
-void EVTAPI EVT_init(
-    _EVT_mouseMoveHandler mouseMove)
-{
-    /* Initialise the event queue */
-    EVT.mouseMove = mouseMove;
-    initEventQueue();
-    oldMouseState = 0;
-    oldKeyMessage = 0;
-    memset(keyUpMsg,0,sizeof(keyUpMsg));
-
-    /* TODO: OS/2 PM specific initialisation code! */
-
-    /* Catch program termination signals so we can clean up properly */
-    signal(SIGABRT, _EVT_abort);
-    signal(SIGFPE, _EVT_abort);
-    signal(SIGINT, _EVT_abort);
-}
-
-/****************************************************************************
-REMARKS
-Changes the range of coordinates returned by the mouse functions to the
-specified range of values. This is used when changing between graphics
-modes set the range of mouse coordinates for the new display mode.
-****************************************************************************/
-void EVTAPI EVT_setMouseRange(
-    int xRes,
-    int yRes)
-{
-    rangeX = xRes;
-    rangeY = yRes;
-}
-
-/****************************************************************************
-REMARKS:
-Initiailises the internal event handling modules. The EVT_suspend function
-can be called to suspend event handling (such as when shelling out to DOS),
-and this function can be used to resume it again later.
-****************************************************************************/
-void EVT_resume(void)
-{
-    /* Do nothing for OS/2 */
-}
-
-/****************************************************************************
-REMARKS
-Suspends all of our event handling operations. This is also used to
-de-install the event handling code.
-****************************************************************************/
-void EVT_suspend(void)
-{
-    /* Do nothing for OS/2 */
-}
-
-/****************************************************************************
-REMARKS
-Exits the event module for program terminatation.
-****************************************************************************/
-void EVT_exit(void)
-{
-    /* Restore signal handlers */
-    signal(SIGABRT, SIG_DFL);
-    signal(SIGFPE, SIG_DFL);
-    signal(SIGINT, SIG_DFL);
-
-    /* TODO: OS/2 PM specific exit code */
-}
-
-/****************************************************************************
-REMARKS
-Modifes the mouse coordinates as necessary if scaling to OS coordinates,
-and sets the OS mouse cursor position.
-****************************************************************************/
-#define _EVT_setMousePos(x,y)
diff --git a/board/MAI/bios_emulator/scitech/src/pm/os2pm/oshdr.h b/board/MAI/bios_emulator/scitech/src/pm/os2pm/oshdr.h
deleted file mode 100644 (file)
index 0b69f82..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  32-bit OS/2
-*
-* Description:  Include file to include all OS specific header files.
-*
-****************************************************************************/
-
-#define INCL_DOSERRORS
-#define INCL_DOS
-#define INCL_SUB
-#define INCL_VIO
-#define INCL_KBD
-#include <os2.h>
diff --git a/board/MAI/bios_emulator/scitech/src/pm/oshdr.h b/board/MAI/bios_emulator/scitech/src/pm/oshdr.h
deleted file mode 100644 (file)
index 404e5c9..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Any
-*
-* Description:  Header file to pull in OS specific headers for the target
-*               OS environment.
-*
-****************************************************************************/
-
-#if     defined(__SMX32__)
-#include "smx/oshdr.h"
-#elif   defined(__RTTARGET__)
-#include "rttarget/oshdr.h"
-#elif   defined(__REALDOS__)
-#include "dos/oshdr.h"
-#elif   defined(__WIN32_VXD__)
-#include "vxd/oshdr.h"
-#elif   defined(__NT_DRIVER__)
-#include "ntdrv/oshdr.h"
-#elif   defined(__WINDOWS32__)
-#include "win32/oshdr.h"
-#elif   defined(__OS2_VDD__)
-#include "vxd/oshdr.h"
-#elif   defined(__OS2__)
-#if     defined(__OS2_PM__)
-#include "os2pm/oshdr.h"
-#else
-#include "os2/oshdr.h"
-#endif
-#elif   defined(__LINUX__)
-#if     defined(__USE_X11__)
-#include "x11/oshdr.h"
-#else
-#include "linux/oshdr.h"
-#endif
-#elif   defined(__QNX__)
-#if     defined(__USE_PHOTON__)
-#include "photon/oshdr.h"
-#elif   defined(__USE_X11__)
-#include "x11/oshdr.h"
-#else
-#include "qnx/oshdr.h"
-#endif
-#elif   defined(__BEOS__)
-#include "beos/oshdr.h"
-#else
-#error  PM library not ported to this platform yet!
-#endif
diff --git a/board/MAI/bios_emulator/scitech/src/pm/photon/event.c b/board/MAI/bios_emulator/scitech/src/pm/photon/event.c
deleted file mode 100644 (file)
index 581da16..0000000
+++ /dev/null
@@ -1,268 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech Multi-platform Graphics Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  QNX Photon GUI
-*
-* Description:  QNX fullscreen console implementation for the SciTech
-*               cross platform event library.
-*
-****************************************************************************/
-
-/*--------------------------- Global variables ----------------------------*/
-
-static ushort       keyUpMsg[256] = {0};/* Table of key up messages     */
-
-/*---------------------------- Implementation -----------------------------*/
-
-/* These are not used under Linux */
-#define _EVT_disableInt()       1
-#define _EVT_restoreInt(flags)
-
-/****************************************************************************
-PARAMETERS:
-scanCode    - Scan code to test
-
-REMARKS:
-This macro determines if a specified key is currently down at the
-time that the call is made.
-****************************************************************************/
-static ibool _EVT_isKeyDown(
-    uchar scancode)
-{
-    return (KeyState[(scancode & 0xf8) >> 3] & (1 << (scancode & 0x7)) ?
-       true : false);
-}
-
-/****************************************************************************
-REMARKS:
-Retrieves all events from the mouse/keyboard event queue and stuffs them
-into the MGL event queue for further processing.
-****************************************************************************/
-static void _EVT_pumpMessages(void)
-{
-    int         pid;
-    uint            msg, but_stat, message;
-    uchar           evt[sizeof (PhEvent_t) + 1024];
-    PhEvent_t       *event = (void *)evt;
-    PhKeyEvent_t        *key;
-    PhPointerEvent_t    *mouse;
-    static int      extended;
-    event_t         _evt;
-
-    while (count < EVENTQSIZE) {
-       uint    mods = 0, keyp = 0;
-
-       pid = Creceive(0, &msg, sizeof (msg));
-
-       if (pid == -1)
-           return;
-
-       if (PhEventRead(pid, event, sizeof (evt)) == Ph_EVENT_MSG) {
-           memset(&evt, 0, sizeof (evt));
-           if (event->type == Ph_EV_KEY) {
-               key = PhGetData(event);
-
-               if (key->key_flags & KEY_SCAN_VALID) {
-                   keyp = key->key_scan;
-                   if (key->key_flags & KEY_DOWN)
-                       KeyState[(keyp & 0xf800) >> 11]
-                           |= 1 << ((keyp & 0x700) >> 8);
-                   else
-                       KeyState[(keyp & 0xf800) >> 11]
-                           &= ~(1 << ((keyp & 0x700) >> 8));
-               }
-               if ((key->key_flags & KEY_SYM_VALID) || extended)
-                   keyp |= key->key_sym;
-
-               /* No way to tell left from right... */
-               if (key->key_mods & KEYMOD_SHIFT)
-                   mods = (EVT_LEFTSHIFT | EVT_RIGHTSHIFT);
-               if (key->key_mods & KEYMOD_CTRL)
-                   mods |= (EVT_CTRLSTATE | EVT_LEFTCTRL);
-               if (key->key_mods & KEYMOD_ALT)
-                   mods |= (EVT_ALTSTATE | EVT_LEFTALT);
-
-               _evt.when = evt->timestamp;
-               if (key->key_flags & KEY_REPEAT) {
-                   _evt.what = EVT_KEYREPEAT;
-                   _evt.message = 0x10000;
-                   }
-               else if (key->key_flags & KEY_DOWN)
-                   _evt.what = EVT_KEYDOWN;
-               else
-                   _evt.what = EVT_KEYUP;
-               _evt.modifiers = mods;
-               _evt.message |= keyp;
-
-               addEvent(&_evt);
-
-               switch(key->key_scan & 0xff00) {
-                   case 0xe000:
-                       extended = 1;
-                       break;
-                   case 0xe001:
-                       extended = 2;
-                       break;
-                   default:
-                       if (extended)
-                           extended--;
-                   }
-               }
-           else if (event->type & Ph_EV_PTR_ALL) {
-               but_stat = message = 0;
-               mouse = PhGetData(event);
-
-               if (mouse->button_state & Ph_BUTTON_3)
-                   but_stat = EVT_LEFTBUT;
-               if (mouse->buttons & Ph_BUTTON_3)
-                   message = EVT_LEFTBMASK;
-
-               if (mouse->button_state & Ph_BUTTON_1)
-                   but_stat |= EVT_RIGHTBUT;
-               if (mouse->buttons & Ph_BUTTON_1)
-                   message |= EVT_RIGHTBMASK;
-
-               _evt.when = evt->timestamp;
-               if (event->type & Ph_EV_PTR_MOTION) {
-                   _evt.what = EVT_MOUSEMOVE;
-                   _evt.where_x = mouse->pos.x;
-                   _evt.where_y = mouse->pos.y;
-                   _evt.modifiers = but_stat;
-                   addEvent(&_evt);
-                   }
-               if (event->type & Ph_EV_BUT_PRESS)
-                   _evt.what = EVT_MOUSEDOWN;
-               else
-                   _evt.what = EVT_MOUSEUP;
-               _evt.where_x = mouse->pos.x;
-               _evt.where_y = mouse->pos.y;
-               _evt.modifiers = but_stat;
-               _evt.message = message;
-               addEvent(&_evt);
-               }
-           }
-       else
-           return;
-       }
-}
-
-/****************************************************************************
-REMARKS:
-This macro/function is used to converts the scan codes reported by the
-keyboard to our event libraries normalised format. We only have one scan
-code for the 'A' key, and use shift modifiers to determine if it is a
-Ctrl-F1, Alt-F1 etc. The raw scan codes from the keyboard work this way,
-but the OS gives us 'cooked' scan codes, we have to translate them back
-to the raw format.
-****************************************************************************/
-#define _EVT_maskKeyCode(evt)
-
-/****************************************************************************
-REMARKS:
-Safely abort the event module upon catching a fatal error.
-****************************************************************************/
-void _EVT_abort(
-    int signo)
-{
-    char    buf[80];
-
-    EVT_exit();
-    sprintf(buf,"Terminating on signal %d",signo);
-    PM_fatalError(buf);
-}
-
-/****************************************************************************
-PARAMETERS:
-mouseMove   - Callback function to call wheneve the mouse needs to be moved
-
-REMARKS:
-Initiliase the event handling module. Here we install our mouse handling ISR
-to be called whenever any button's are pressed or released. We also build
-the free list of events in the event queue.
-
-We use handler number 2 of the mouse libraries interrupt handlers for our
-event handling routines.
-****************************************************************************/
-void EVTAPI EVT_init(
-    _EVT_mouseMoveHandler mouseMove)
-{
-    int         i;
-
-    /* Initialise the event queue */
-    _mouseMove = mouseMove;
-    initEventQueue();
-    memset((void *)KeyState, 0, sizeof (KeyState));
-
-    /* Catch program termination signals so we can clean up properly */
-    signal(SIGABRT, _EVT_abort);
-    signal(SIGFPE, _EVT_abort);
-    signal(SIGINT, _EVT_abort);
-}
-
-/****************************************************************************
-REMARKS
-Changes the range of coordinates returned by the mouse functions to the
-specified range of values. This is used when changing between graphics
-modes set the range of mouse coordinates for the new display mode.
-****************************************************************************/
-void EVTAPI EVT_setMouseRange(
-    int xRes,
-    int yRes)
-{
-    /* TODO: Need to call Input to change the coordinates that it returns */
-    /*       for mouse events!! */
-}
-
-/****************************************************************************
-REMARKS:
-Initiailises the internal event handling modules. The EVT_suspend function
-can be called to suspend event handling (such as when shelling out to DOS),
-and this function can be used to resume it again later.
-****************************************************************************/
-void EVT_resume(void)
-{
-    /* Do nothing for Photon */
-}
-
-/****************************************************************************
-REMARKS
-Suspends all of our event handling operations. This is also used to
-de-install the event handling code.
-****************************************************************************/
-void EVT_suspend(void)
-{
-    /* Do nothing for Photon */
-}
-
-/****************************************************************************
-REMARKS
-Exits the event module for program terminatation.
-****************************************************************************/
-void EVT_exit(void)
-{
-    /* Restore signal handlers */
-    signal(SIGABRT, SIG_DFL);
-    signal(SIGFPE, SIG_DFL);
-    signal(SIGINT, SIG_DFL);
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/photon/oshdr.h b/board/MAI/bios_emulator/scitech/src/pm/photon/oshdr.h
deleted file mode 100644 (file)
index 3c72563..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech Multi-platform Graphics Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  QNX Photon GUI
-*
-* Description:  Include file to include all OS specific header files.
-*
-****************************************************************************/
-
-#include <sys/mouse.h>
-#include <sys/keyboard.h>
-#include <sys/fd.h>
-#include <sys/stat.h>
-#include <conio.h>
-#include <process.h>
-#include <sys/kernel.h>
-#include <Ph.h>
diff --git a/board/MAI/bios_emulator/scitech/src/pm/pm.vpw b/board/MAI/bios_emulator/scitech/src/pm/pm.vpw
deleted file mode 100644 (file)
index 26e68a7..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-[Dependencies]\r
-[CurrentProject]\r
-curproj=pmlinux.vpj\r
-[ProjectFiles]\r
-pmcommon.vpj\r
-pmdos.vpj\r
-pmlinux.vpj\r
-pmqnx.vpj\r
-pmvxd.vpj\r
-pmwin32.vpj\r
-z_samples.vpj\r
-..\a-global includes.vpj\r
-[TreeExpansion]\r
-"..\a-global includes.vpj" 0\r
-pmcommon.vpj 0\r
-pmdos.vpj 0\r
-pmlinux.vpj 0\r
-pmqnx.vpj 0\r
-pmvxd.vpj 0\r
-pmwin32.vpj 0\r
-z_samples.vpj 1 1\r
-[State]\r
-SCREEN: 1280 1024 0 0 960 746 0 0 M 0 0 0 0 977 631\r
-CWD: C:\scitech\src\pm\r
-FILEHIST: 9\r
-C:\scitech\makedefs\gcc_win32.mk\r
-C:\scitech\bin\gcc2-w32.bat\r
-C:\scitech\bin\gcc2-c32.bat\r
-C:\scitech\bin\gcc2-linux.bat\r
-C:\scitech\makedefs\gcc_linux.mk\r
-C:\scitech\src\pm\linux\event.c\r
-C:\scitech\src\pm\linux\oshdr.h\r
-C:\scitech\src\pm\event.c\r
-C:\scitech\src\pm\pmlinux.vpj\r
-[ProjectDates]\r
-pmcommon.vpj=20010517164335290\r
-pmdos.vpj=20010517164335290\r
-pmlinux.vpj=20010620175829812\r
-pmqnx.vpj=20010517164335290\r
-pmvxd.vpj=20010517164335306\r
-pmwin32.vpj=20010517164335306\r
-z_samples.vpj=20010517164335306\r
-..\a-global includes.vpj=20010517164334978\r
diff --git a/board/MAI/bios_emulator/scitech/src/pm/pmcommon.vpj b/board/MAI/bios_emulator/scitech/src/pm/pmcommon.vpj
deleted file mode 100644 (file)
index 48b872d..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-[COMPILER]\r
-version=5.0b\r
-MACRO=\n\r
-activeconfig=,wc10-d32\r
-FILTERNAME=Source Files\nInclude Files\nAssembler Files\nOther Files\n\r
-FILTERPATTERN=*.c;*.cpp;*.cxx;*.prg;*.pas;*.dpr;*.bas;*.java;*.sc;*.e;*.cob;*.html;*.rc\n*.h\n*.asm\n*.*\n\r
-FILTERASSOCIATEFILETYPES=0 0 0 0 \r
-FILTERAPPCOMMAND=\n\n\n\n\r
-vcsproject=SCC:Perforce SCM://depot\r
-vcslocalpath=SCC:Perforce SCM:c:\\r
-compile=concur|capture|hide|:Compile:&Compile,\r
-make=concur|capture|hide|clear|saveall|:Build:&Build,\r
-rebuild=concur|capture|hide|clear|saveall|:Rebuild:&Rebuild,\r
-debug=concur|capture|hide|savenone|:Debug:&Debug,\r
-execute=hide|savenone|:Execute:E&xecute,\r
-user1=hide|:User 1:User 1,\r
-user2=hide|:User 2:User 2,\r
-workingdir=.\r
-includedirs=%(SCITECH)\include;%(PRIVATE)\include\r
-reffile=\r
-[FILES]\r
-common.c\r
-cpuinfo.c\r
-debug.c\r
-event.c\r
-makefile\r
-oshdr.h\r
-ztimer.c\r
-..\common\agplib.c\r
-codepage\us_eng.c\r
-common\_cpuinfo.asm\r
-common\_dma.asm\r
-common\_int64.asm\r
-common\_joy.asm\r
-common\_mtrr.asm\r
-common\_pcilib.asm\r
-common\agp.c\r
-common\keyboard.c\r
-common\malloc.c\r
-common\mtrr.c\r
-common\pcilib.c\r
-common\unixio.c\r
-common\vgastate.c\r
-[ASSOCIATION]\r
-[CONFIGURATIONS]\r
diff --git a/board/MAI/bios_emulator/scitech/src/pm/pmdos.vpj b/board/MAI/bios_emulator/scitech/src/pm/pmdos.vpj
deleted file mode 100644 (file)
index 1157513..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-[SciTech]\r
-compiler=wc10- \r
-targetos=d32 \r
-[COMPILER]\r
-version=5.0b\r
-MACRO=enable_current_compiler\n\r
-activeconfig=,TEST_HARNESS=1\r
-FILTERNAME=Source Files\nInclude Files\nAssembler Files\n\r
-FILTERPATTERN=*.c;*.cpp;*.cxx;*.prg;*.pas;*.dpr;*.bas;*.java;*.sc;*.e;*.cob;*.html;*.rc\n*.h\n*.asm\n\r
-FILTERASSOCIATEFILETYPES=0 0 0 \r
-FILTERAPPCOMMAND=\n\n\n\r
-vcsproject=SCC:Perforce SCM://depot\r
-vcslocalpath=SCC:Perforce SCM:c:\\r
-compile=concur|capture|clear|:Compile:&Compile,dmake %n.obj -u %b\r
-make=concur|capture|clear|saveall|:Build:&Build,dmake install %b\r
-rebuild=concur|capture|clear|saveall|:Rebuild:&Rebuild,dmake cleanexe & dmake install -u %b\r
-debug=concur|capture|hide|savenone|:Debug:&Debug,\r
-execute=hide|savenone|nochangedir|:Execute:E&xecute,\r
-user1=hide|:User 1:User 1,\r
-user2=hide|:User 2:User 2,\r
-usertool_clean_directory=concur|capture|hide|savenone|nochangedir|:Clean Directory:C&lean Directory,dmake cleanexe\r
-workingdir=.\r
-includedirs=%(SCITECH)\include;%(PRIVATE)\include\r
-reffile=\r
-[FILES]\r
-dos\_event.asm\r
-dos\_lztimer.asm\r
-dos\_pm.asm\r
-dos\_pmdos.asm\r
-dos\_vflat.asm\r
-dos\cpuinfo.c\r
-dos\event.c\r
-dos\oshdr.h\r
-dos\pm.c\r
-dos\pmdos.c\r
-dos\vflat.c\r
-dos\ztimer.c\r
-[ASSOCIATION]\r
-[CONFIGURATIONS]\r
-config=,NORMAL_BUILD=1\r
-config=,TEST_HARNESS=1\r
diff --git a/board/MAI/bios_emulator/scitech/src/pm/pmlinux.vpj b/board/MAI/bios_emulator/scitech/src/pm/pmlinux.vpj
deleted file mode 100644 (file)
index 0bfbf84..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-[SciTech]\r
-compiler=gcc2-\r
-targetos=linux\r
-[COMPILER]\r
-version=5.0b\r
-MACRO=enable_current_compiler\n\r
-FILTERNAME=Source Files\nInclude Files\nAssembler Files\n\r
-FILTERPATTERN=*.c;*.cpp;*.cxx;*.prg;*.pas;*.dpr;*.bas;*.java;*.sc;*.e;*.cob;*.html;*.rc\n*.h\n*.asm\n\r
-FILTERASSOCIATEFILETYPES=0 0 0\r
-FILTERAPPCOMMAND=\n\n\n\r
-vcsproject=SCC:Perforce SCM://depot\r
-vcslocalpath=SCC:Perforce SCM:c:\\r
-activeconfig=,install BUILD_DLL=1\r
-compile=concur|capture|clear|:Compile:&Compile,dmake %n.o -u\r
-make=concur|capture|clear|saveall|:Build:&Build,dmake %b\r
-rebuild=concur|capture|clear|saveall|:Rebuild:&Rebuild,dmake cleanexe & dmake -u %b\r
-debug=concur|capture|hide|savenone|:Debug:&Debug,\r
-execute=hide|savenone|nochangedir|:Execute:E&xecute,\r
-user1=hide|:User 1:User 1,\r
-user2=hide|:User 2:User 2,\r
-usertool_clean_directory=concur|capture|hide|savenone|nochangedir|:Clean Directory:C&lean Directory,dmake cleanexe\r
-workingdir=.\r
-includedirs=%(SCITECH)\include;%(PRIVATE)\include\r
-reffile=\r
-[FILES]\r
-linux\cpuinfo.c\r
-linux\event.c\r
-linux\oshdr.h\r
-linux\pm.c\r
-linux\vflat.c\r
-linux\ztimer.c\r
-[ASSOCIATION]\r
-[CONFIGURATIONS]\r
-config=,install BUILD_DLL=1\r
-config=,install\r
diff --git a/board/MAI/bios_emulator/scitech/src/pm/pmntdrv.vpj b/board/MAI/bios_emulator/scitech/src/pm/pmntdrv.vpj
deleted file mode 100644 (file)
index 3ec35a7..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-[SciTech]\r
-compiler=vc60- \r
-targetos=drvw2k\r
-[COMPILER]\r
-version=5.0b\r
-MACRO=enable_current_compiler\n\r
-activeconfig=,wc10-d32\r
-FILTERNAME=Source Files\nInclude Files\nAssembler Files\n\r
-FILTERPATTERN=*.c;*.cpp;*.cxx;*.prg;*.pas;*.dpr;*.bas;*.java;*.sc;*.e;*.cob;*.html;*.rc\n*.h\n*.asm\n\r
-FILTERASSOCIATEFILETYPES=0 0 0\r
-FILTERAPPCOMMAND=\n\n\n\r
-vcsproject=SCC:Perforce SCM://depot\r
-vcslocalpath=SCC:Perforce SCM:c:\\r
-compile=concur|capture|:Compile:&Compile,dmake %n.obj\r
-make=concur|capture|clear|saveall|:Build:&Build,dmake install\r
-rebuild=concur|capture|clear|saveall|:Rebuild:&Rebuild,dmake cleanexe & dmake install -u\r
-debug=concur|capture|hide|savenone|:Debug:&Debug,\r
-execute=hide|savenone|nochangedir|:Execute:E&xecute,\r
-user1=hide|:User 1:User 1,\r
-user2=hide|:User 2:User 2,\r
-usertool_clean_directory=concur|capture|hide|savenone|:Clean Directory:&Clean Directory,dmake cleanexe\r
-workingdir=.\r
-includedirs=%(SCITECH)\include;%(PRIVATE)\include\r
-reffile=\r
-[FILES]\r
-..\..\include\ntdriver.h\r
-ntdrv\_pm.asm\r
-ntdrv\cpuinfo.c\r
-ntdrv\int86.c\r
-ntdrv\irq.c\r
-ntdrv\mem.c\r
-ntdrv\oshdr.h\r
-ntdrv\pm.c\r
-ntdrv\stdio.c\r
-ntdrv\stdlib.c\r
-ntdrv\vflat.c\r
-ntdrv\ztimer.c\r
-[ASSOCIATION]\r
-[CONFIGURATIONS]\r
diff --git a/board/MAI/bios_emulator/scitech/src/pm/pmqnx.vpj b/board/MAI/bios_emulator/scitech/src/pm/pmqnx.vpj
deleted file mode 100644 (file)
index d541702..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-[SciTech]\r
-compiler=wc10-\r
-targetos=qnx\r
-[COMPILER]\r
-version=5.0b\r
-MACRO=enable_current_compiler\n\r
-activeconfig=,wc10-d32\r
-FILTERNAME=Source Files\nInclude Files\nAssembler Files\n\r
-FILTERPATTERN=*.c;*.cpp;*.cxx;*.prg;*.pas;*.dpr;*.bas;*.java;*.sc;*.e;*.cob;*.html;*.rc\n*.h\n*.asm\n\r
-FILTERASSOCIATEFILETYPES=0 0 0\r
-FILTERAPPCOMMAND=\n\n\n\r
-vcsproject=SCC:Perforce SCM://depot\r
-vcslocalpath=SCC:Perforce SCM:c:\\r
-compile=concur|capture|clear|:Compile:&Compile,dmake %n.obj\r
-make=concur|capture|clear|saveall|:Build:&Build,dmake install\r
-rebuild=concur|capture|clear|saveall|:Rebuild:&Rebuild,dmake cleanexe & dmake install -u\r
-debug=concur|capture|hide|savenone|:Debug:&Debug,\r
-execute=hide|savenone|nochangedir|:Execute:E&xecute,\r
-user1=hide|:User 1:User 1,\r
-user2=hide|:User 2:User 2,\r
-usertool_clean_directory=concur|capture|hide|savenone|nochangedir|:Clean Directory:C&lean Directory,dmake cleanexe\r
-workingdir=.\r
-includedirs=%(SCITECH)\include;%(PRIVATE)\include\r
-reffile=\r
-[FILES]\r
-qnx\_mtrrqnx.asm\r
-qnx\cpuinfo.c\r
-qnx\event.c\r
-qnx\mtrrqnx.c\r
-qnx\oshdr.h\r
-qnx\pm.c\r
-qnx\vflat.c\r
-qnx\ztimer.c\r
-[ASSOCIATION]\r
-[CONFIGURATIONS]\r
diff --git a/board/MAI/bios_emulator/scitech/src/pm/pmvxd.vpj b/board/MAI/bios_emulator/scitech/src/pm/pmvxd.vpj
deleted file mode 100644 (file)
index 1fcf911..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-[SciTech]\r
-compiler=bc50-\r
-targetos=vxd\r
-[COMPILER]\r
-version=5.0b\r
-MACRO=enable_current_compiler\n\r
-activeconfig=,wc10-d32\r
-FILTERNAME=Source Files\nInclude Files\nAssembler Files\n\r
-FILTERPATTERN=*.c;*.cpp;*.cxx;*.prg;*.pas;*.dpr;*.bas;*.java;*.sc;*.e;*.cob;*.html;*.rc\n*.h\n*.asm\n\r
-FILTERASSOCIATEFILETYPES=0 0 0 \r
-FILTERAPPCOMMAND=\n\n\n\r
-vcsproject=SCC:Perforce SCM://depot\r
-vcslocalpath=SCC:Perforce SCM:c:\\r
-compile=concur|capture|nochangedir|:Compile:&Compile,dmake %n.obj\r
-make=concur|capture|clear|saveall|nochangedir|:Build:&Build,dmake install\r
-rebuild=concur|capture|clear|saveall|nochangedir|:Rebuild:&Rebuild,dmake cleanexe & dmake install -u\r
-debug=concur|capture|hide|savenone|nochangedir|:Debug:&Debug,\r
-execute=hide|savenone|nochangedir|:Execute:E&xecute,\r
-user1=hide|:User 1:User 1,\r
-user2=hide|:User 2:User 2,\r
-usertool_clean_directory=concur|capture|hide|savenone|nochangedir|:Clean Directory:&Clean Directory,dmake cleanexe\r
-workingdir=.\r
-includedirs=%(SCITECH)\include;%(PRIVATE)\include\r
-reffile=\r
-[FILES]\r
-vxd\_pm.asm\r
-vxd\cpuinfo.c\r
-vxd\fileio.c\r
-vxd\oshdr.h\r
-vxd\pm.c\r
-vxd\vflat.c\r
-vxd\ztimer.c\r
-[ASSOCIATION]\r
-[CONFIGURATIONS]\r
diff --git a/board/MAI/bios_emulator/scitech/src/pm/pmwin32.vpj b/board/MAI/bios_emulator/scitech/src/pm/pmwin32.vpj
deleted file mode 100644 (file)
index ace6822..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-[SciTech]\r
-compiler=vc60- \r
-targetos=c32 \r
-[COMPILER]\r
-version=5.0b\r
-MACRO=enable_current_compiler\n\r
-activeconfig=,wc10-d32\r
-FILTERNAME=Source Files\nInclude Files\nAssembler Files\n\r
-FILTERPATTERN=*.c;*.cpp;*.cxx;*.prg;*.pas;*.dpr;*.bas;*.java;*.sc;*.e;*.cob;*.html;*.rc\n*.h\n*.asm\n\r
-FILTERASSOCIATEFILETYPES=0 0 0 \r
-FILTERAPPCOMMAND=\n\n\n\r
-vcsproject=SCC:Perforce SCM://depot\r
-vcslocalpath=SCC:Perforce SCM:c:\\r
-compile=concur|capture|:Compile:&Compile,dmake %n.obj\r
-make=concur|capture|clear|saveall|:Build:&Build,dmake install\r
-rebuild=concur|capture|clear|saveall|:Rebuild:&Rebuild,dmake cleanexe & dmake install -u\r
-debug=concur|capture|hide|savenone|:Debug:&Debug,\r
-execute=hide|savenone|nochangedir|:Execute:E&xecute,\r
-user1=hide|:User 1:User 1,\r
-user2=hide|:User 2:User 2,\r
-usertool_clean_directory=concur|capture|savenone|:Clean Directory:&Clean Directory,dmake cleanexe\r
-workingdir=.\r
-includedirs=%(SCITECH)\include;%(PRIVATE)\include\r
-reffile=\r
-[FILES]\r
-win32\_pmwin32.asm\r
-win32\cpuinfo.c\r
-win32\ddraw.c\r
-win32\event.c\r
-win32\oshdr.h\r
-win32\pm.c\r
-win32\vflat.c\r
-win32\ztimer.c\r
-[ASSOCIATION]\r
-[CONFIGURATIONS]\r
diff --git a/board/MAI/bios_emulator/scitech/src/pm/qnx/_mtrrqnx.asm b/board/MAI/bios_emulator/scitech/src/pm/qnx/_mtrrqnx.asm
deleted file mode 100644 (file)
index 5a3fe10..0000000
+++ /dev/null
@@ -1,226 +0,0 @@
-;****************************************************************************
-;*
-;*                  SciTech OS Portability Manager Library
-;*
-;*  ========================================================================
-;*
-;*    The contents of this file are subject to the SciTech MGL Public
-;*    License Version 1.0 (the "License"); you may not use this file
-;*    except in compliance with the License. You may obtain a copy of
-;*    the License at http://www.scitechsoft.com/mgl-license.txt
-;*
-;*    Software distributed under the License is distributed on an
-;*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-;*    implied. See the License for the specific language governing
-;*    rights and limitations under the License.
-;*
-;*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-;*
-;*    The Initial Developer of the Original Code is SciTech Software, Inc.
-;*    All Rights Reserved.
-;*
-;*  ========================================================================
-;*
-;* Language:    NASM
-;* Environment: QNX
-;*
-;* Description: Assembler support routines for the Memory Type Range Register
-;*              (MTRR) module for QNX.
-;*
-;****************************************************************************
-
-        IDEAL
-
-include "scitech.mac"           ; Memory model macros
-
-header      _mtrrqnx                ; Set up memory model
-
-begdataseg  _mtrrqnx                ; Start of code segment
-
-ifdef   USE_NASM
-%define R0_FLUSH_TLB    0
-%define R0_SAVE_CR4     1
-%define R0_RESTORE_CR4  2
-%define R0_READ_MSR     3
-%define R0_WRITE_MSR    4
-else
-R0_FLUSH_TLB        EQU 0
-R0_SAVE_CR4         EQU 1
-R0_RESTORE_CR4      EQU 2
-R0_READ_MSR         EQU 3
-R0_WRITE_MSR        EQU 4
-endif
-
-cpublic _PM_R0
-_PM_R0_service      dd  0
-_PM_R0_reg          dd  0
-_PM_R0_eax          dd  0
-_PM_R0_edx          dd  0
-
-enddataseg  _mtrrqnx                ; Start of code segment
-
-begcodeseg  _mtrrqnx                ; Start of code segment
-
-P586
-
-;----------------------------------------------------------------------------
-; ulong _MTRR_disableInt(void);
-;----------------------------------------------------------------------------
-; Return processor interrupt status and disable interrupts.
-;----------------------------------------------------------------------------
-cprocstart  _MTRR_disableInt
-
-        pushfd                  ; Put flag word on stack
-;       cli                     ; Disable interrupts!
-        pop     eax             ; deposit flag word in return register
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void _MTRR_restoreInt(ulong ps);
-;----------------------------------------------------------------------------
-; Restore processor interrupt status.
-;----------------------------------------------------------------------------
-cprocstart  _MTRR_restoreInt
-
-        ARG     ps:ULONG
-
-        push    ebp
-        mov     ebp,esp         ; Set up stack frame
-        push    [ULONG ps]
-        popfd                   ; Restore processor status (and interrupts)
-        pop     ebp
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; uchar _MTRR_getCx86(uchar reg);
-;----------------------------------------------------------------------------
-; Read a Cyrix CPU indexed register
-;----------------------------------------------------------------------------
-cprocstart  _MTRR_getCx86
-
-        ARG     reg:UCHAR
-
-        enter_c
-        mov     al,[reg]
-        out     22h,al
-        in      al,23h
-        leave_c
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; uchar _MTRR_setCx86(uchar reg,uchar val);
-;----------------------------------------------------------------------------
-; Write a Cyrix CPU indexed register
-;----------------------------------------------------------------------------
-cprocstart  _MTRR_setCx86
-
-        ARG     reg:UCHAR, val:UCHAR
-
-        enter_c
-        mov     al,[reg]
-        out     22h,al
-        mov     al,[val]
-        out     23h,al
-        leave_c
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; ulong _PM_ring0_isr(void);
-;----------------------------------------------------------------------------
-; Ring 0 clock interrupt handler that we use to execute the MTRR support
-; code.
-;----------------------------------------------------------------------------
-cprocnear   _PM_ring0_isr
-
-;--------------------------------------------------------
-; void PM_flushTLB(void);
-;--------------------------------------------------------
-        pushad
-        cmp     [DWORD _PM_R0_service],R0_FLUSH_TLB
-        jne     @@1
-        wbinvd                  ; Flush the CPU cache
-        mov     eax,cr3         
-        mov     cr3,eax         ; Flush the TLB
-        jmp     @@Exit
-
-;--------------------------------------------------------
-; ulong _MTRR_saveCR4(void);
-;--------------------------------------------------------
-@@1:    cmp     [DWORD _PM_R0_service],R0_SAVE_CR4
-        jne     @@2
-
-; Save value of CR4 and clear Page Global Enable (bit 7)
-
-        mov     ebx,cr4
-        mov     eax,ebx
-        and     al,7Fh
-        mov     cr4,eax
-
-; Disable and flush caches
-
-        mov     eax,cr0
-        or      eax,40000000h
-        wbinvd
-        mov     cr0,eax
-        wbinvd
-
-; Return value from CR4
-
-        mov     [_PM_R0_reg],ebx
-        jmp     @@Exit
-
-;--------------------------------------------------------
-; void _MTRR_restoreCR4(ulong cr4Val)
-;--------------------------------------------------------
-@@2:    cmp     [DWORD _PM_R0_service],R0_RESTORE_CR4
-        jne     @@3
-
-        mov     eax,cr0
-        and     eax,0BFFFFFFFh
-        mov     cr0,eax
-        mov     eax,[_PM_R0_reg]
-        mov     cr4,eax
-        jmp     @@Exit
-
-;--------------------------------------------------------
-; void _MTRR_readMSR(int reg, ulong FAR *eax, ulong FAR *edx);
-;--------------------------------------------------------
-@@3:    cmp     [DWORD _PM_R0_service],R0_READ_MSR
-        jne     @@4
-
-        mov     ecx,[_PM_R0_reg]
-        rdmsr
-        mov     [_PM_R0_eax],eax
-        mov     [_PM_R0_edx],edx
-        jmp     @@Exit
-
-;--------------------------------------------------------
-; void _MTRR_writeMSR(int reg, ulong eax, ulong edx);
-;--------------------------------------------------------
-@@4:    cmp     [DWORD _PM_R0_service],R0_WRITE_MSR
-        jne     @@Exit
-
-        mov     ecx,[_PM_R0_reg]
-        mov     eax,[_PM_R0_eax]
-        mov     edx,[_PM_R0_edx]
-        wrmsr
-        jmp     @@Exit
-
-@@Exit: mov     [DWORD _PM_R0_service],-1
-        popad
-        mov     eax,0
-        retf
-
-cprocend
-
-endcodeseg  _mtrrqnx
-
-        END                     ; End of module
diff --git a/board/MAI/bios_emulator/scitech/src/pm/qnx/cpuinfo.c b/board/MAI/bios_emulator/scitech/src/pm/qnx/cpuinfo.c
deleted file mode 100644 (file)
index a878254..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/****************************************************************************
-*
-*                         Ultra Long Period Timer
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  QNX
-*
-* Description:  QNX specific code for the CPU detection module.
-*
-****************************************************************************/
-
-/*----------------------------- Implementation ----------------------------*/
-
-/****************************************************************************
-REMARKS:
-TODO: We should implement this for QNX!
-****************************************************************************/
-#define SetMaxThreadPriority()  0
-
-/****************************************************************************
-REMARKS:
-TODO: We should implement this for QNX!
-****************************************************************************/
-#define RestoreThreadPriority(i)
-
-/****************************************************************************
-REMARKS:
-Initialise the counter and return the frequency of the counter.
-****************************************************************************/
-static void GetCounterFrequency(
-    CPU_largeInteger *freq)
-{
-    freq->low = CLOCKS_PER_SEC * 1000;
-    freq->high = 0;
-}
-
-/****************************************************************************
-REMARKS:
-Read the counter and return the counter value.
-****************************************************************************/
-#define GetCounter(t)           \
-{                               \
-    (t)->low = clock() * 1000;  \
-    (t)->high = 0;              \
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/qnx/event.c b/board/MAI/bios_emulator/scitech/src/pm/qnx/event.c
deleted file mode 100644 (file)
index 45cd514..0000000
+++ /dev/null
@@ -1,601 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech Multi-platform Graphics Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  QNX
-*
-* Description:  QNX fullscreen console implementation for the SciTech
-*               cross platform event library.
-*
-****************************************************************************/
-
-#include <errno.h>
-#include <unistd.h>
-
-/*--------------------------- Global variables ----------------------------*/
-
-#ifndef __QNXNTO__
-static struct _mouse_ctrl   *_PM_mouse_ctl;
-static int          _PM_keyboard_fd = -1;
-/*static int            _PM_modifiers, _PM_leds; */
-#else
-static int          kbd_fd = -1, mouse_fd = -1;
-#endif
-static int          kill_pid = 0;
-static ushort       keyUpMsg[256] = {0};/* Table of key up messages     */
-static int          rangeX,rangeY;      /* Range of mouse coordinates   */
-
-#define TIME_TO_MSEC(__t)   ((__t).tv_nsec / 1000000 + (__t).tv_sec * 1000)
-
-#define LED_NUM         1
-#define LED_CAP         2
-#define LED_SCR         4
-
-/* Scancode mappings on QNX for special keys */
-
-typedef struct {
-    int scan;
-    int map;
-    } keymap;
-
-/* TODO: Fix this and set it up so we can do a binary search! */
-
-keymap keymaps[] = {
-    {96, KB_padEnter},
-    {74, KB_padMinus},
-    {78, KB_padPlus},
-    {55, KB_padTimes},
-    {98, KB_padDivide},
-    {71, KB_padHome},
-    {72, KB_padUp},
-    {73, KB_padPageUp},
-    {75, KB_padLeft},
-    {76, KB_padCenter},
-    {77, KB_padRight},
-    {79, KB_padEnd},
-    {80, KB_padDown},
-    {81, KB_padPageDown},
-    {82, KB_padInsert},
-    {83, KB_padDelete},
-    {105,KB_left},
-    {108,KB_down},
-    {106,KB_right},
-    {103,KB_up},
-    {110,KB_insert},
-    {102,KB_home},
-    {104,KB_pageUp},
-    {111,KB_delete},
-    {107,KB_end},
-    {109,KB_pageDown},
-    {125,KB_leftWindows},
-    {126,KB_rightWindows},
-    {127,KB_menu},
-    {100,KB_rightAlt},
-    {97,KB_rightCtrl},
-    };
-
-/* And the keypad with num lock turned on (changes the ASCII code only) */
-
-keymap keypad[] = {
-    {71, ASCII_7},
-    {72, ASCII_8},
-    {73, ASCII_9},
-    {75, ASCII_4},
-    {76, ASCII_5},
-    {77, ASCII_6},
-    {79, ASCII_1},
-    {80, ASCII_2},
-    {81, ASCII_3},
-    {82, ASCII_0},
-    {83, ASCII_period},
-    };
-
-#define NB_KEYMAPS (sizeof(keymaps)/sizeof(keymaps[0]))
-#define NB_KEYPAD (sizeof(keypad)/sizeof(keypad[0]))
-
-/*---------------------------- Implementation -----------------------------*/
-
-/****************************************************************************
-REMARKS:
-Include generic raw scancode keyboard module.
-****************************************************************************/
-#include "common/keyboard.c"
-
-/* These are not used under QNX */
-#define _EVT_disableInt()       1
-#define _EVT_restoreInt(flags)
-
-/****************************************************************************
-REMARKS:
-This function is used to return the number of ticks since system
-startup in milliseconds. This should be the same value that is placed into
-the time stamp fields of events, and is used to implement auto mouse down
-events.
-****************************************************************************/
-ulong _EVT_getTicks(void)
-{
-    struct timespec t;
-    clock_gettime(CLOCK_REALTIME,&t);
-    return (t.tv_nsec / 1000000 + t.tv_sec * 1000);
-}
-
-/****************************************************************************
-REMARKS:
-Converts a mickey movement value to a pixel adjustment value.
-****************************************************************************/
-static int MickeyToPixel(
-    int mickey)
-{
-    /* TODO: We can add some code in here to handle 'acceleration' for */
-    /*       the mouse cursor. For now just use the mickeys. */
-    return mickey;
-}
-
-#ifdef __QNXNTO__
-/****************************************************************************
-REMARKS:
-Retrieves all events from the mouse/keyboard event queue and stuffs them
-into the MGL event queue for further processing.
-****************************************************************************/
-static void _EVT_pumpMessages(void)
-{
-    int         rc1, rc2;
-    struct _keyboard_packet key;
-    struct _mouse_packet    ms;
-    static long     old_buttons = 0;
-    uint            message = 0, but_stat = 0, mods = 0;
-    event_t         evt;
-
-    while (EVT.count < EVENTQSIZE) {
-       rc1 = read(kbd_fd, (void *)&key, sizeof(key));
-       if (rc1 == -1) {
-           if (errno == EAGAIN)
-               rc1 = 0;
-           else {
-               perror("getEvents");
-               PM_fatalError("Keyboard error");
-               }
-           }
-       if (rc1 > 0) {
-           memset(&evt, 0, sizeof(evt));
-           if (key.data.modifiers & KEYMOD_SHIFT)
-               mods |= EVT_LEFTSHIFT;
-           if (key.data.modifiers & KEYMOD_CTRL)
-               mods |= EVT_CTRLSTATE;
-           if (key.data.modifiers & KEYMOD_ALT)
-               mods |= EVT_ALTSTATE;
-
-           /* Now store the keyboard event data */
-           evt.when = TIME_TO_MSEC(key.time);
-           if (key.data.flags & KEY_SCAN_VALID)
-               evt.message |= (key.data.key_scan & 0x7F) << 8;
-           if ((key.data.flags & KEY_SYM_VALID) &&
-               (((key.data.key_sym & 0xff00) == 0xf000 &&
-               (key.data.key_sym & 0xff) < 0x20) ||
-               key.data.key_sym < 0x80))
-               evt.message |= (key.data.key_sym & 0xFF);
-           evt.modifiers = mods;
-           if (key.data.flags & KEY_DOWN) {
-               evt.what = EVT_KEYDOWN;
-               keyUpMsg[evt.message >> 8] = (ushort)evt.message;
-               }
-           else if (key.data.flags & KEY_REPEAT) {
-               evt.message |= 0x10000;
-               evt.what = EVT_KEYREPEAT;
-               }
-           else {
-               evt.what = EVT_KEYUP;
-               evt.message = keyUpMsg[evt.message >> 8];
-               if (evt.message == 0)
-                   continue;
-               keyUpMsg[evt.message >> 8] = 0;
-               }
-
-           /* Now add the new event to the event queue */
-           addEvent(&evt);
-           }
-       rc2 = read(mouse_fd, (void *)&ms, sizeof (ms));
-       if (rc2 == -1) {
-           if (errno == EAGAIN)
-               rc2 = 0;
-           else {
-               perror("getEvents");
-               PM_fatalError("Mouse error");
-               }
-           }
-       if (rc2 > 0) {
-           memset(&evt, 0, sizeof(evt));
-           ms.hdr.buttons &=
-               (_POINTER_BUTTON_LEFT | _POINTER_BUTTON_RIGHT);
-           if (ms.hdr.buttons & _POINTER_BUTTON_LEFT)
-               but_stat = EVT_LEFTBUT;
-           if ((ms.hdr.buttons & _POINTER_BUTTON_LEFT) !=
-               (old_buttons & _POINTER_BUTTON_LEFT))
-               message = EVT_LEFTBMASK;
-           if (ms.hdr.buttons & _POINTER_BUTTON_RIGHT)
-               but_stat |= EVT_RIGHTBUT;
-           if ((ms.hdr.buttons & _POINTER_BUTTON_RIGHT) !=
-               (old_buttons & _POINTER_BUTTON_RIGHT))
-               message |= EVT_RIGHTBMASK;
-           if (ms.dx || ms.dy) {
-               ms.dy = -ms.dy;
-               EVT.mx += MickeyToPixel(ms.dx);
-               EVT.my += MickeyToPixel(ms.dy);
-               if (EVT.mx < 0) EVT.mx = 0;
-               if (EVT.my < 0) EVT.my = 0;
-               if (EVT.mx > rangeX)    EVT.mx = rangeX;
-               if (EVT.my > rangeY)    EVT.my = rangeY;
-               evt.what = EVT_MOUSEMOVE;
-               evt.when = TIME_TO_MSEC(ms.hdr.time);
-               evt.where_x = EVT.mx;
-               evt.where_y = EVT.my;
-               evt.relative_x = ms.dx;
-               evt.relative_y = ms.dy;
-               evt.modifiers = but_stat;
-               addEvent(&evt);
-               }
-           evt.what = ms.hdr.buttons < old_buttons ?
-               EVT_MOUSEUP : EVT_MOUSEDOWN;
-           evt.when = TIME_TO_MSEC(ms.hdr.time);
-           evt.where_x = EVT.mx;
-           evt.where_y = EVT.my;
-           evt.relative_x = ms.dx;
-           evt.relative_y = ms.dy;
-           evt.modifiers = but_stat;
-           evt.message = message;
-           if (ms.hdr.buttons != old_buttons) {
-               addEvent(&evt);
-               old_buttons = ms.hdr.buttons;
-               }
-           }
-       if (rc1 + rc2 == 0)
-           break;
-       }
-}
-#else
-/****************************************************************************
-REMARKS:
-Retrieves all events from the mouse/keyboard event queue and stuffs them
-into the MGL event queue for further processing.
-****************************************************************************/
-static void _EVT_pumpMessages(void)
-{
-    struct mouse_event      ev;
-    int             rc;
-    static long         old_buttons = 0;
-    uint                message = 0, but_stat = 0;
-    event_t             evt;
-    char                buf[32];
-    int             numkeys, i;
-
-    /* Poll keyboard events */
-    while ((numkeys = read(_PM_keyboard_fd, buf, sizeof buf)) > 0) {
-       for (i = 0; i < numkeys; i++) {
-           processRawScanCode(buf[i]);
-           }
-       }
-
-    if (_PM_mouse_ctl == NULL)
-       return;
-
-    /* Gobble pending mouse events */
-    while (EVT.count < EVENTQSIZE) {
-       rc = mouse_read(_PM_mouse_ctl, &ev, 1, 0, NULL);
-       if (rc == -1) {
-           perror("getEvents");
-           PM_fatalError("Mouse error (Input terminated?)");
-           }
-       if (rc == 0)
-           break;
-
-       message = 0, but_stat = 0;
-       memset(&evt, 0, sizeof(evt));
-
-       ev.buttons &= (_MOUSE_LEFT | _MOUSE_RIGHT);
-       if (ev.buttons & _MOUSE_LEFT)
-           but_stat = EVT_LEFTBUT;
-       if ((ev.buttons & _MOUSE_LEFT) != (old_buttons & _MOUSE_LEFT))
-           message = EVT_LEFTBMASK;
-       if (ev.buttons & _MOUSE_RIGHT)
-           but_stat |= EVT_RIGHTBUT;
-       if ((ev.buttons & _MOUSE_RIGHT) != (old_buttons & _MOUSE_RIGHT))
-           message |= EVT_RIGHTBMASK;
-       if (ev.dx || ev.dy) {
-           ev.dy = -ev.dy;
-           EVT.mx += MickeyToPixel(ev.dx);
-           EVT.my += MickeyToPixel(ev.dy);
-           if (EVT.mx < 0) EVT.mx = 0;
-           if (EVT.my < 0) EVT.my = 0;
-           if (EVT.mx > rangeX)    EVT.mx = rangeX;
-           if (EVT.my > rangeY)    EVT.my = rangeY;
-           evt.what = EVT_MOUSEMOVE;
-           evt.when = ev.timestamp*100;
-           evt.where_x = EVT.mx;
-           evt.where_y = EVT.my;
-           evt.relative_x = ev.dx;
-           evt.relative_y = ev.dy;
-           evt.modifiers = but_stat;
-           addEvent(&evt);
-           }
-       evt.what = ev.buttons < old_buttons ? EVT_MOUSEUP : EVT_MOUSEDOWN;
-       evt.when = ev.timestamp*100;
-       evt.where_x = EVT.mx;
-       evt.where_y = EVT.my;
-       evt.relative_x = ev.dx;
-       evt.relative_y = ev.dy;
-       evt.modifiers = but_stat;
-       evt.message = message;
-       if (ev.buttons != old_buttons) {
-           addEvent(&evt);
-           old_buttons = ev.buttons;
-           }
-       }
-}
-#endif  /* __QNXNTO__ */
-
-/****************************************************************************
-REMARKS:
-This macro/function is used to converts the scan codes reported by the
-keyboard to our event libraries normalised format. We only have one scan
-code for the 'A' key, and use shift modifiers to determine if it is a
-Ctrl-F1, Alt-F1 etc. The raw scan codes from the keyboard work this way,
-but the OS gives us 'cooked' scan codes, we have to translate them back
-to the raw format.
-****************************************************************************/
-#define _EVT_maskKeyCode(evt)
-
-/****************************************************************************
-REMARKS:
-Safely abort the event module upon catching a fatal error.
-****************************************************************************/
-void _EVT_abort(
-    int signo)
-{
-    char    buf[80];
-
-    EVT_exit();
-    sprintf(buf,"Terminating on signal %d",signo);
-    PM_fatalError(buf);
-}
-
-/****************************************************************************
-PARAMETERS:
-mouseMove   - Callback function to call wheneve the mouse needs to be moved
-
-REMARKS:
-Initiliase the event handling module. Here we install our mouse handling ISR
-to be called whenever any button's are pressed or released. We also build
-the free list of events in the event queue.
-
-We use handler number 2 of the mouse libraries interrupt handlers for our
-event handling routines.
-****************************************************************************/
-void EVTAPI EVT_init(
-    _EVT_mouseMoveHandler mouseMove)
-{
-    int         i;
-    struct stat st;
-    char        *iarg[16];
-#ifdef __QNXNTO__
-    char        buf[128];
-    FILE        *p;
-    int         argno,len;
-#endif
-
-#ifdef __QNXNTO__
-    ThreadCtl(_NTO_TCTL_IO, 0); /* So joystick code won't blow up */
-#endif
-
-    /* Initialise the event queue */
-    EVT.mouseMove = mouseMove;
-    initEventQueue();
-    memset(keyUpMsg,0,sizeof(keyUpMsg));
-
-#ifdef __QNXNTO__
-    /*
-     * User may already have input running with the right parameters.
-     * Thus they could start input at boot time, using the output of
-     * inputtrap, passing the the -r flag to make it run as a resource
-     * manager.
-     */
-    if ((mouse_fd = open("/dev/mouse0", O_RDONLY | O_NONBLOCK)) < 0) {
-       /* Run inputtrap to get the args for input */
-       if ((p = popen("inputtrap", "r")) == NULL)
-           PM_fatalError("Error running 'inputtrap'");
-       fgets(buf, sizeof(buf), p);
-       pclose(p);
-
-       /* Build the argument list */
-       len = strlen(buf);
-       iarg[0] = buf;
-       for (i = 0, argno = 0; i < len && argno < 15;) {
-           if (argno == 1) {
-               /*
-                * Add flags to input's arg list.
-                * '-r' means run as resource
-                * manager, providing the /dev/mouse
-                * and /dev/keyboard interfaces.
-                * '-P' supresses the /dev/photon
-                * mechanism.
-                */
-               iarg[argno++] = "-Pr";
-               continue;
-               }
-           while (buf[i] == ' ')
-               i++;
-           if (buf[i] == '\0' || buf[i] == '\n')
-               break;
-           iarg[argno++] = &buf[i];
-           while (buf[i] != ' '
-               && buf[i] != '\0' && buf[i] != '\n')
-               i++;
-           buf[i++] = '\0';
-           }
-       iarg[argno] = NULL;
-
-       if ((kill_pid = spawnvp(P_NOWAITO, iarg[0], iarg)) == -1) {
-           perror("spawning input resmgr");
-           PM_fatalError("Could not start input resmgr");
-           }
-       for (i = 0; i < 10; i++) {
-           if (stat("/dev/mouse0", &st) == 0)
-               break;
-           sleep(1);
-           }
-       if ((mouse_fd = open("/dev/mouse0", O_RDONLY|O_NONBLOCK)) < 0) {
-           perror("/dev/mouse0");
-           PM_fatalError("Could not open /dev/mouse0");
-           }
-       }
-    if ((kbd_fd = open("/dev/keyboard0", O_RDONLY|O_NONBLOCK)) < 0) {
-       perror("/dev/keyboard0");
-       PM_fatalError("Could not open /dev/keyboard0");
-       }
-#else
-    /* Connect to Input/Mouse for event handling */
-    if (_PM_mouse_ctl == NULL) {
-       _PM_mouse_ctl = mouse_open(0, "/dev/mouse", 0);
-
-       /* "Mouse" is not running; attempt to start it */
-       if (_PM_mouse_ctl == NULL) {
-           iarg[0] = "mousetrap";
-           iarg[1] = "start";
-           iarg[2] = NULL;
-           if ((kill_pid = spawnvp(P_NOWAITO, iarg[0], (void*)iarg)) == -1)
-               perror("spawn (mousetrap)");
-           else {
-               for (i = 0; i < 10; i++) {
-                   if (stat("/dev/mouse", &st) == 0)
-                       break;
-                   sleep(1);
-                   }
-               _PM_mouse_ctl = mouse_open(0, "/dev/mouse", 0);
-               }
-           }
-       }
-    if (_PM_keyboard_fd == -1)
-       _PM_keyboard_fd = open("/dev/kbd", O_RDONLY|O_NONBLOCK);
-#endif
-
-    /* Catch program termination signals so we can clean up properly */
-    signal(SIGABRT, _EVT_abort);
-    signal(SIGFPE, _EVT_abort);
-    signal(SIGINT, _EVT_abort);
-}
-
-/****************************************************************************
-REMARKS
-Changes the range of coordinates returned by the mouse functions to the
-specified range of values. This is used when changing between graphics
-modes set the range of mouse coordinates for the new display mode.
-****************************************************************************/
-void EVTAPI EVT_setMouseRange(
-    int xRes,
-    int yRes)
-{
-    rangeX = xRes;
-    rangeY = yRes;
-}
-
-/****************************************************************************
-REMARKS
-Modifes the mouse coordinates as necessary if scaling to OS coordinates,
-and sets the OS mouse cursor position.
-****************************************************************************/
-#define _EVT_setMousePos(x,y)
-
-/****************************************************************************
-REMARKS:
-Initiailises the internal event handling modules. The EVT_suspend function
-can be called to suspend event handling (such as when shelling out to DOS),
-and this function can be used to resume it again later.
-****************************************************************************/
-void EVT_resume(void)
-{
-    /* Do nothing for QNX */
-}
-
-/****************************************************************************
-REMARKS
-Suspends all of our event handling operations. This is also used to
-de-install the event handling code.
-****************************************************************************/
-void EVT_suspend(void)
-{
-    /* Do nothing for QNX */
-}
-
-/****************************************************************************
-REMARKS
-Exits the event module for program terminatation.
-****************************************************************************/
-void EVT_exit(void)
-{
-#ifdef __QNXNTO__
-    char    c;
-    int flags;
-
-    if (kbd_fd != -1) {
-       close(kbd_fd);
-       kbd_fd = -1;
-       }
-    if (mouse_fd != -1) {
-       close(mouse_fd);
-       mouse_fd = -1;
-       }
-#endif
-
-    /* Restore signal handlers */
-    signal(SIGABRT, SIG_DFL);
-    signal(SIGFPE, SIG_DFL);
-    signal(SIGINT, SIG_DFL);
-
-#ifndef __QNXNTO__
-    /* Kill the Input/Mouse driver if we have spawned it */
-    if (_PM_mouse_ctl != NULL) {
-       struct _fd_entry    fde;
-       uint            pid = 0;
-
-       /* Find out the pid of the mouse driver */
-       if (kill_pid > 0) {
-           if (qnx_fd_query(0,
-               0, _PM_mouse_ctl->fd, &fde) != -1)
-               pid = fde.pid;
-           }
-       mouse_close(_PM_mouse_ctl);
-       _PM_mouse_ctl = NULL;
-
-       if (pid > 0) {
-           /* For some reasons the PID's are different under QNX4,
-            * so we use the old mechanism to kill the mouse server.
-            */
-           kill(pid, SIGTERM);
-           kill_pid = 0;
-           }
-       }
-#endif
-    if (kill_pid > 0) {
-       kill(kill_pid, SIGTERM);
-       kill_pid = 0;
-       }
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/qnx/mtrrqnx.c b/board/MAI/bios_emulator/scitech/src/pm/qnx/mtrrqnx.c
deleted file mode 100644 (file)
index f960c75..0000000
+++ /dev/null
@@ -1,182 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  QNX
-*
-* Description:  MTRR helper functions module. To make it easier to implement
-*               the MTRR support under QNX, we simply put our ring 0 helper
-*               functions into stubs that run them at ring 0 using whatever
-*               mechanism is available.
-*
-****************************************************************************/
-
-#include "pmapi.h"
-#include <stdio.h>
-#include <sys/mman.h>
-#include <time.h>
-#ifdef __QNXNTO__
-#include <sys/neutrino.h>
-#include <sys/syspage.h>
-#else
-#include <i86.h>
-#include <sys/irqinfo.h>
-#endif
-
-/*--------------------------- Global variables ----------------------------*/
-
-#define R0_FLUSH_TLB    0
-#define R0_SAVE_CR4     1
-#define R0_RESTORE_CR4  2
-#define R0_READ_MSR     3
-#define R0_WRITE_MSR    4
-
-typedef struct {
-    int     service;
-    int     reg;
-    ulong   eax;
-    ulong   edx;
-    } R0_data;
-
-extern volatile R0_data _PM_R0;
-
-/*----------------------------- Implementation ----------------------------*/
-
-#ifdef __QNXNTO__
-const struct sigevent * _ASMAPI _PM_ring0_isr(void *arg, int id);
-#else
-pid_t far _ASMAPI _PM_ring0_isr();
-#endif
-
-/****************************************************************************
-REMARKS:
-Return true if ring 0 (or if we can call the helpers functions at ring 0)
-****************************************************************************/
-ibool _ASMAPI _MTRR_isRing0(void)
-{
-#ifdef __QNXNTO__
-    return false;   /* Not implemented yet! */
-#else
-    return true;
-#endif
-}
-
-/****************************************************************************
-REMARKS:
-Function to execute a service at ring 0. This is done using the clock
-interrupt handler since the code we attach to it will always run at ring 0.
-****************************************************************************/
-static void CallRing0(void)
-{
-#ifdef __QNXNTO__
-    uint    clock_intno = SYSPAGE_ENTRY(qtime)->intr;
-#else
-    uint    clock_intno = 0;    /* clock irq */
-#endif
-    int     intrid;
-
-#ifdef __QNXNTO__
-    mlock((void*)&_PM_R0, sizeof(_PM_R0));
-    ThreadCtl(_NTO_TCTL_IO, 0);
-#endif
-#ifdef __QNXNTO__
-    if ((intrid = InterruptAttach(_NTO_INTR_CLASS_EXTERNAL | clock_intno,
-       _PM_ring0_isr, (void*)&_PM_R0, sizeof(_PM_R0), _NTO_INTR_FLAGS_END)) == -1) {
-#else
-    if ((intrid = qnx_hint_attach(clock_intno, _PM_ring0_isr, FP_SEG(&_PM_R0))) == -1) {
-#endif
-       perror("Attach");
-       exit(-1);
-       }
-    while (_PM_R0.service != -1)
-       ;
-#ifdef __QNXNTO__
-    InterruptDetachId(intrid);
-#else
-    qnx_hint_detach(intrid);
-#endif
-}
-
-/****************************************************************************
-REMARKS:
-Flush the translation lookaside buffer.
-****************************************************************************/
-void PMAPI PM_flushTLB(void)
-{
-    _PM_R0.service = R0_FLUSH_TLB;
-    CallRing0();
-}
-
-/****************************************************************************
-REMARKS:
-Read and return the value of the CR4 register
-****************************************************************************/
-ulong _ASMAPI _MTRR_saveCR4(void)
-{
-    _PM_R0.service = R0_SAVE_CR4;
-    CallRing0();
-    return _PM_R0.reg;
-}
-
-/****************************************************************************
-REMARKS:
-Restore the value of the CR4 register
-****************************************************************************/
-void _ASMAPI _MTRR_restoreCR4(ulong cr4Val)
-{
-    _PM_R0.service = R0_RESTORE_CR4;
-    _PM_R0.reg = cr4Val;
-    CallRing0();
-}
-
-/****************************************************************************
-REMARKS:
-Read a machine status register for the CPU.
-****************************************************************************/
-void _ASMAPI _MTRR_readMSR(
-    int reg,
-    ulong *eax,
-    ulong *edx)
-{
-    _PM_R0.service = R0_READ_MSR;
-    _PM_R0.reg = reg;
-    CallRing0();
-    *eax = _PM_R0.eax;
-    *edx = _PM_R0.edx;
-}
-
-/****************************************************************************
-REMARKS:
-Write a machine status register for the CPU.
-****************************************************************************/
-void _ASMAPI _MTRR_writeMSR(
-    int reg,
-    ulong eax,
-    ulong edx)
-{
-    _PM_R0.service = R0_WRITE_MSR;
-    _PM_R0.reg = reg;
-    _PM_R0.eax = eax;
-    _PM_R0.edx = edx;
-    CallRing0();
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/qnx/oshdr.h b/board/MAI/bios_emulator/scitech/src/pm/qnx/oshdr.h
deleted file mode 100644 (file)
index 0961193..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech Multi-platform Graphics Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  QNX
-*
-* Description:  Include file to include all OS specific header files.
-*
-****************************************************************************/
-
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <process.h>
-#include <time.h>
-#ifndef __QNXNTO__
-#include <sys/mouse.h>
-#include <sys/keyboard.h>
-#include <sys/fd.h>
-#include <conio.h>
-#else
-#include <sys/dcmd_input.h>
-
-/* Things 'borrowed' from photon/keycodes.h */
-
-/*
- * Keyboard modifiers
- */
-#define KEYMODBIT_SHIFT                                         0
-#define KEYMODBIT_CTRL                                          1
-#define KEYMODBIT_ALT                                           2
-#define KEYMODBIT_ALTGR                                         3
-#define KEYMODBIT_SHL3                                          4
-#define KEYMODBIT_MOD6                                          5
-#define KEYMODBIT_MOD7                                          6
-#define KEYMODBIT_MOD8                                          7
-
-#define KEYMODBIT_SHIFT_LOCK                                    8
-#define KEYMODBIT_CTRL_LOCK                                     9
-#define KEYMODBIT_ALT_LOCK                                      10
-#define KEYMODBIT_ALTGR_LOCK                                    11
-#define KEYMODBIT_SHL3_LOCK                                     12
-#define KEYMODBIT_MOD6_LOCK                                     13
-#define KEYMODBIT_MOD7_LOCK                                     14
-#define KEYMODBIT_MOD8_LOCK                                     15
-
-#define KEYMODBIT_CAPS_LOCK                                     16
-#define KEYMODBIT_NUM_LOCK                                      17
-#define KEYMODBIT_SCROLL_LOCK                                   18
-
-#define KEYMOD_SHIFT                                            (1 << KEYMODBIT_SHIFT)
-#define KEYMOD_CTRL                                             (1 << KEYMODBIT_CTRL)
-#define KEYMOD_ALT                                              (1 << KEYMODBIT_ALT)
-#define KEYMOD_ALTGR                                            (1 << KEYMODBIT_ALTGR)
-#define KEYMOD_SHL3                                             (1 << KEYMODBIT_SHL3)
-#define KEYMOD_MOD6                                             (1 << KEYMODBIT_MOD6)
-#define KEYMOD_MOD7                                             (1 << KEYMODBIT_MOD7)
-#define KEYMOD_MOD8                                             (1 << KEYMODBIT_MOD8)
-
-#define KEYMOD_SHIFT_LOCK                                       (1 << KEYMODBIT_SHIFT_LOCK)
-#define KEYMOD_CTRL_LOCK                                        (1 << KEYMODBIT_CTRL_LOCK)
-#define KEYMOD_ALT_LOCK                                         (1 << KEYMODBIT_ALT_LOCK)
-#define KEYMOD_ALTGR_LOCK                                       (1 << KEYMODBIT_ALTGR_LOCK)
-#define KEYMOD_SHL3_LOCK                                        (1 << KEYMODBIT_SHL3_LOCK)
-#define KEYMOD_MOD6_LOCK                                        (1 << KEYMODBIT_MOD6_LOCK)
-#define KEYMOD_MOD7_LOCK                                        (1 << KEYMODBIT_MOD7_LOCK)
-#define KEYMOD_MOD8_LOCK                                        (1 << KEYMODBIT_MOD8_LOCK)
-
-#define KEYMOD_CAPS_LOCK                                        (1 << KEYMODBIT_CAPS_LOCK)
-#define KEYMOD_NUM_LOCK                                         (1 << KEYMODBIT_NUM_LOCK)
-#define KEYMOD_SCROLL_LOCK                                      (1 << KEYMODBIT_SCROLL_LOCK)
-
-/*
- * Keyboard flags
- */
-#define KEY_DOWN                                                0x00000001      /* Key was pressed down */
-#define KEY_REPEAT                                              0x00000002      /* Key was repeated */
-#define KEY_SCAN_VALID                                          0x00000020      /* Scancode is valid */
-#define KEY_SYM_VALID                                           0x00000040      /* Key symbol is valid */
-#define KEY_CAP_VALID                                           0x00000080      /* Key cap is valid */
-#define KEY_DEAD                                                0x40000000      /* Key symbol is a DEAD key */
-#define KEY_OEM_CAP                                             0x80000000      /* Key cap is an OEM scan code from keyboard */
-
-#endif  /* __QNXNTO__ */
diff --git a/board/MAI/bios_emulator/scitech/src/pm/qnx/pm.c b/board/MAI/bios_emulator/scitech/src/pm/qnx/pm.c
deleted file mode 100644 (file)
index c993ee0..0000000
+++ /dev/null
@@ -1,891 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  QNX
-*
-* Description:  Implementation for the OS Portability Manager Library, which
-*               contains functions to implement OS specific services in a
-*               generic, cross platform API. Porting the OS Portability
-*               Manager library is the first step to porting any SciTech
-*               products to a new platform.
-*
-****************************************************************************/
-
-#include "pmapi.h"
-#include "drvlib/os/os.h"
-#include "mtrr.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <unistd.h>
-#include <termios.h>
-#include <fcntl.h>
-#include <malloc.h>
-#include <sys/mman.h>
-#include "qnx/vbios.h"
-#ifndef __QNXNTO__
-#include <sys/seginfo.h>
-#include <sys/console.h>
-#include <conio.h>
-#include <i86.h>
-#else
-#include <sys/neutrino.h>
-#include <sys/dcmd_chr.h>
-#endif
-
-/*--------------------------- Global variables ----------------------------*/
-
-static uint VESABuf_len = 1024;     /* Length of the VESABuf buffer     */
-static void *VESABuf_ptr = NULL;    /* Near pointer to VESABuf          */
-static uint VESABuf_rseg;           /* Real mode segment of VESABuf     */
-static uint VESABuf_roff;           /* Real mode offset of VESABuf      */
-static VBIOSregs_t  *VRegs = NULL;  /* Pointer to VBIOS registers       */
-static int raw_count = 0;
-static struct _console_ctrl *cc = NULL;
-static int console_count = 0;
-static int rmbuf_inuse = 0;
-
-static void (PMAPIP fatalErrorCleanup)(void) = NULL;
-
-/*----------------------------- Implementation ----------------------------*/
-
-void PMAPI PM_init(void)
-{
-    char *force;
-
-    if (VRegs == NULL) {
-#ifdef  __QNXNTO__
-       ThreadCtl(_NTO_TCTL_IO, 0); /* Get IO privilidge */
-#endif
-       force = getenv("VBIOS_METHOD");
-       VRegs = VBIOSinit(force ? atoi(force) : 0);
-       }
-#ifndef  __QNXNTO__
-    MTRR_init();
-#endif
-}
-
-ibool PMAPI PM_haveBIOSAccess(void)
-{ return VRegs != NULL; }
-
-long PMAPI PM_getOSType(void)
-{ return _OS_QNX; }
-
-int PMAPI PM_getModeType(void)
-{ return PM_386; }
-
-void PMAPI PM_backslash(char *s)
-{
-    uint pos = strlen(s);
-    if (s[pos-1] != '/') {
-       s[pos] = '/';
-       s[pos+1] = '\0';
-       }
-}
-
-void PMAPI PM_setFatalErrorCleanup(
-    void (PMAPIP cleanup)(void))
-{
-    fatalErrorCleanup = cleanup;
-}
-
-void PMAPI PM_fatalError(const char *msg)
-{
-    if (fatalErrorCleanup)
-       fatalErrorCleanup();
-    fprintf(stderr,"%s\n", msg);
-    exit(1);
-}
-
-static void ExitVBEBuf(void)
-{
-    if (VESABuf_ptr)
-       PM_freeRealSeg(VESABuf_ptr);
-    VESABuf_ptr = 0;
-}
-
-void * PMAPI PM_getVESABuf(uint *len,uint *rseg,uint *roff)
-{
-    if (!VESABuf_ptr) {
-       /* Allocate a global buffer for communicating with the VESA VBE */
-       if ((VESABuf_ptr = PM_allocRealSeg(VESABuf_len, &VESABuf_rseg, &VESABuf_roff)) == NULL)
-           return NULL;
-       atexit(ExitVBEBuf);
-       }
-    *len = VESABuf_len;
-    *rseg = VESABuf_rseg;
-    *roff = VESABuf_roff;
-    return VESABuf_ptr;
-}
-
-static int term_raw(void)
-{
-    struct termios  termios_p;
-
-    if (raw_count++ > 0)
-       return 0;
-
-    /* Go into "raw" input mode */
-    if (tcgetattr(STDIN_FILENO, &termios_p))
-       return -1;
-
-    termios_p.c_cc[VMIN] =  1;
-    termios_p.c_cc[VTIME] =  0;
-    termios_p.c_lflag &= ~( ECHO|ICANON|ISIG|ECHOE|ECHOK|ECHONL);
-    tcsetattr(STDIN_FILENO, TCSADRAIN, &termios_p);
-    return 0;
-}
-
-static void term_restore(void)
-{
-    struct termios  termios_p;
-
-    if (raw_count-- != 1)
-       return;
-
-    tcgetattr(STDIN_FILENO, &termios_p);
-    termios_p.c_lflag |= (ECHO|ICANON|ISIG|ECHOE|ECHOK|ECHONL);
-    termios_p.c_oflag |= (OPOST);
-    tcsetattr(STDIN_FILENO, TCSADRAIN, &termios_p);
-}
-
-int PMAPI PM_kbhit(void)
-{
-    int blocking, c;
-
-    if (term_raw() == -1)
-       return 0;
-
-    /* Go into non blocking mode */
-    blocking = fcntl(STDIN_FILENO, F_GETFL) | O_NONBLOCK;
-    fcntl(STDIN_FILENO, F_SETFL, blocking);
-    c = getc(stdin);
-
-    /* restore blocking mode */
-    fcntl(STDIN_FILENO, F_SETFL, blocking & ~O_NONBLOCK);
-    term_restore();
-    if (c != EOF) {
-       ungetc(c, stdin);
-       return c;
-       }
-    clearerr(stdin);
-    return 0;
-}
-
-int PMAPI PM_getch(void)
-{
-    int c;
-
-    if (term_raw() == -1)
-       return (0);
-    c = getc(stdin);
-#if defined(__QNX__) && !defined(__QNXNTO__)
-    if (c == 0xA)
-       c = 0x0D;
-    else if (c == 0x7F)
-       c = 0x08;
-#endif
-    term_restore();
-    return c;
-}
-
-PM_HWND PMAPI PM_openConsole(
-    PM_HWND hwndUser,
-    int device,
-    int xRes,
-    int yRes,
-    int bpp,
-    ibool fullScreen)
-{
-#ifndef __QNXNTO__
-    int fd;
-
-    if (console_count++)
-       return 0;
-    if ((fd = open("/dev/con1", O_RDWR)) == -1)
-       return -1;
-    cc = console_open(fd, O_RDWR);
-    close(fd);
-    if (cc == NULL)
-       return -1;
-#endif
-    return 1;
-}
-
-int PMAPI PM_getConsoleStateSize(void)
-{
-    return PM_getVGAStateSize() + sizeof(int) * 3;
-}
-
-void PMAPI PM_saveConsoleState(void *stateBuf,int console_id)
-{
-#ifdef __QNXNTO__
-    int     fd;
-    int     flags;
-
-    if ((fd = open("/dev/con1", O_RDWR)) == -1)
-       return;
-    flags = _CONCTL_INVISIBLE_CHG | _CONCTL_INVISIBLE;
-    devctl(fd, DCMD_CHR_SERCTL, &flags, sizeof flags, 0);
-    close(fd);
-#else
-    uchar   *buf = &((uchar*)stateBuf)[PM_getVGAStateSize()];
-
-    /* Save QNX 4 console state */
-    console_read(cc, -1, 0, NULL, 0,
-       (int *)buf+1, (int *)buf+2, NULL);
-    *(int *)buf = console_ctrl(cc, -1,
-       CONSOLE_NORESIZE | CONSOLE_NOSWITCH | CONSOLE_INVISIBLE,
-       CONSOLE_NORESIZE | CONSOLE_NOSWITCH | CONSOLE_INVISIBLE);
-
-    /* Save state of VGA registers */
-    PM_saveVGAState(stateBuf);
-#endif
-}
-
-void PMAPI PM_setSuspendAppCallback(int (_ASMAPIP saveState)(int flags))
-{
-    /* TODO: Implement support for console switching if possible */
-}
-
-void PMAPI PM_restoreConsoleState(const void *stateBuf,PM_HWND hwndConsole)
-{
-#ifdef __QNXNTO__
-    int     fd;
-    int     flags;
-
-    if ((fd = open("/dev/con1", O_RDWR)) == -1)
-       return;
-    flags = _CONCTL_INVISIBLE_CHG;
-    devctl(fd, DCMD_CHR_SERCTL, &flags, sizeof flags, 0);
-    close(fd);
-#else
-    uchar   *buf = &((uchar*)stateBuf)[PM_getVGAStateSize()];
-
-    /* Restore the state of the VGA compatible registers */
-    PM_restoreVGAState(stateBuf);
-
-    /* Restore QNX 4 console state */
-    console_ctrl(cc, -1, *(int *)buf,
-       CONSOLE_NORESIZE | CONSOLE_NOSWITCH | CONSOLE_INVISIBLE);
-    console_write(cc, -1, 0, NULL, 0,
-       (int *)buf+1, (int *)buf+2, NULL);
-#endif
-}
-
-void PMAPI PM_closeConsole(PM_HWND hwndConsole)
-{
-#ifndef __QNXNTO__
-    if (--console_count == 0) {
-       console_close(cc);
-       cc = NULL;
-       }
-#endif
-}
-
-void PM_setOSCursorLocation(int x,int y)
-{
-    if (!cc)
-       return;
-#ifndef __QNXNTO__
-    console_write(cc, -1, 0, NULL, 0, &y, &x, NULL);
-#endif
-}
-
-void PM_setOSScreenWidth(int width,int height)
-{
-}
-
-ibool PMAPI PM_setRealTimeClockHandler(PM_intHandler ih, int frequency)
-{
-    /* TODO: Implement this for QNX */
-    return false;
-}
-
-void PMAPI PM_setRealTimeClockFrequency(int frequency)
-{
-    /* TODO: Implement this for QNX */
-}
-
-void PMAPI PM_restoreRealTimeClockHandler(void)
-{
-    /* TODO: Implement this for QNX */
-}
-
-char * PMAPI PM_getCurrentPath(
-    char *path,
-    int maxLen)
-{
-    return getcwd(path,maxLen);
-}
-
-char PMAPI PM_getBootDrive(void)
-{ return '/'; }
-
-const char * PMAPI PM_getVBEAFPath(void)
-{ return PM_getNucleusConfigPath(); }
-
-const char * PMAPI PM_getNucleusPath(void)
-{
-    char *env = getenv("NUCLEUS_PATH");
-#ifdef __QNXNTO__
-#ifdef __X86__
-    return env ? env : "/nto/scitech/x86/bin";
-#elif defined (__PPC__)
-    return env ? env : "/nto/scitech/ppcbe/bin";
-#elif defined (__MIPS__)
-#ifdef __BIGENDIAN__
-    return env ? env : "/nto/scitech/mipsbe/bin";
-#else
-    return env ? env : "/nto/scitech/mipsle/bin";
-#endif
-#elif defined (__SH__)
-#ifdef __BIGENDIAN__
-    return env ? env : "/nto/scitech/shbe/bin";
-#else
-    return env ? env : "/nto/scitech/shle/bin";
-#endif
-#elif defined (__ARM__)
-    return env ? env : "/nto/scitech/armle/bin";
-#endif
-#else   /* QNX 4 */
-    return env ? env : "/qnx4/scitech/bin";
-#endif
-}
-
-const char * PMAPI PM_getNucleusConfigPath(void)
-{
-    static char path[512];
-    char        *env;
-#ifdef __QNXNTO__
-    char temp[64];
-    gethostname(temp, sizeof (temp));
-    temp[sizeof (temp) - 1] = '\0';     /* Paranoid */
-    sprintf(path,"/etc/config/scitech/%s/config", temp);
-#else
-    sprintf(path,"/etc/config/scitech/%d/config", getnid());
-#endif
-    if ((env = getenv("NUCLEUS_PATH")) != NULL) {
-       strcpy(path,env);
-       PM_backslash(path);
-       strcat(path,"config");
-       }
-    return path;
-}
-
-const char * PMAPI PM_getUniqueID(void)
-{
-    static char buf[128];
-#ifdef __QNXNTO__
-    gethostname(buf, sizeof (buf));
-#else
-    sprintf(buf,"node%d", getnid());
-#endif
-    return buf;
-}
-
-const char * PMAPI PM_getMachineName(void)
-{
-    static char buf[128];
-#ifdef __QNXNTO__
-    gethostname(buf, sizeof (buf));
-#else
-    sprintf(buf,"node%d", getnid());
-#endif
-    return buf;
-}
-
-void * PMAPI PM_getBIOSPointer(void)
-{
-    return PM_mapRealPointer(0, 0x400);
-}
-
-void * PMAPI PM_getA0000Pointer(void)
-{
-    static void *ptr = NULL;
-    void *freeptr;
-    unsigned offset, i, maplen;
-
-    if (ptr != NULL)
-       return ptr;
-
-    /* Some trickery is required to get the linear address 64K aligned */
-    for (i = 0; i < 5; i++) {
-       ptr = PM_mapPhysicalAddr(0xA0000,0xFFFF,true);
-       offset = 0x10000 - ((unsigned)ptr % 0x10000);
-       if (!offset)
-           break;
-       munmap(ptr, 0x10000);
-       maplen = 0x10000 + offset;
-       freeptr = PM_mapPhysicalAddr(0xA0000-offset, maplen-1,true);
-       ptr = (void *)(offset + (unsigned)freeptr);
-       if (0x10000 - ((unsigned)ptr % 0x10000))
-           break;
-       munmap(freeptr, maplen);
-       }
-    if (i == 5) {
-       printf("Could not get a 64K aligned linear address for A0000 region\n");
-       exit(1);
-       }
-    return ptr;
-}
-
-void * PMAPI PM_mapPhysicalAddr(ulong base,ulong limit,ibool isCached)
-{
-    uchar_t *p;
-    unsigned o;
-    unsigned prot = PROT_READ|PROT_WRITE|(isCached?0:PROT_NOCACHE);
-#ifdef __PAGESIZE
-    int pagesize = __PAGESIZE;
-#else
-    int pagesize = 4096;
-#endif
-    int rounddown = base % pagesize;
-#ifndef __QNXNTO__
-    static int __VidFD = -1;
-#endif
-
-    if (rounddown) {
-       if (base < rounddown)
-           return NULL;
-       base -= rounddown;
-       limit += rounddown;
-       }
-
-#ifndef __QNXNTO__
-    if (__VidFD < 0) {
-       if ((__VidFD = shm_open( "Physical", O_RDWR, 0777 )) == -1) {
-           perror( "Cannot open Physical memory" );
-           exit(1);
-           }
-       }
-    o = base & 0xFFF;
-    limit = (limit + o + 0xFFF) & ~0xFFF;
-    if ((int)(p = mmap( 0, limit, prot, MAP_SHARED,
-           __VidFD, base )) == -1 ) {
-       return NULL;
-       }
-    p += o;
-#else
-    if ((p = mmap(0, limit, prot, MAP_PHYS | MAP_SHARED,
-           NOFD, base)) == MAP_FAILED) {
-       return (void *)-1;
-       }
-#endif
-    return (p + rounddown);
-}
-
-void PMAPI PM_freePhysicalAddr(void *ptr,ulong limit)
-{
-    munmap(ptr,limit+1);
-}
-
-ulong PMAPI PM_getPhysicalAddr(void *p)
-{
-    /* TODO: This function should find the physical address of a linear */
-    /*       address. */
-    return 0xFFFFFFFFUL;
-}
-
-ibool PMAPI PM_getPhysicalAddrRange(
-    void *p,
-    ulong length,
-    ulong *physAddress)
-{
-    /* TODO: Implement this! */
-    return false;
-}
-
-void PMAPI PM_sleep(ulong milliseconds)
-{
-    /* TODO: Put the process to sleep for milliseconds */
-}
-
-int PMAPI PM_getCOMPort(int port)
-{
-    /* TODO: Re-code this to determine real values using the Plug and Play */
-    /*       manager for the OS. */
-    switch (port) {
-       case 0: return 0x3F8;
-       case 1: return 0x2F8;
-       }
-    return 0;
-}
-
-int PMAPI PM_getLPTPort(int port)
-{
-    /* TODO: Re-code this to determine real values using the Plug and Play */
-    /*       manager for the OS. */
-    switch (port) {
-       case 0: return 0x3BC;
-       case 1: return 0x378;
-       case 2: return 0x278;
-       }
-    return 0;
-}
-
-void * PMAPI PM_mallocShared(long size)
-{
-    return PM_malloc(size);
-}
-
-void PMAPI PM_freeShared(void *ptr)
-{
-    PM_free(ptr);
-}
-
-void * PMAPI PM_mapToProcess(void *base,ulong limit)
-{ return (void*)base; }
-
-void * PMAPI PM_mapRealPointer(uint r_seg,uint r_off)
-{
-    void *p;
-
-    PM_init();
-
-    if ((p = VBIOSgetmemptr(r_seg, r_off, VRegs)) == (void *)-1)
-       return NULL;
-    return p;
-}
-
-void * PMAPI PM_allocRealSeg(uint size,uint *r_seg,uint *r_off)
-{
-    if (size > 1024) {
-       printf("PM_allocRealSeg: can't handle %d bytes\n", size);
-       return 0;
-       }
-    if (rmbuf_inuse != 0) {
-       printf("PM_allocRealSeg: transfer area already in use\n");
-       return 0;
-       }
-    PM_init();
-    rmbuf_inuse = 1;
-    *r_seg = VBIOS_TransBufVSeg(VRegs);
-    *r_off = VBIOS_TransBufVOff(VRegs);
-    return (void*)VBIOS_TransBufPtr(VRegs);
-}
-
-void PMAPI PM_freeRealSeg(void *mem)
-{
-    if (rmbuf_inuse == 0) {
-       printf("PM_freeRealSeg: nothing was allocated\n");
-       return;
-       }
-    rmbuf_inuse = 0;
-}
-
-void PMAPI DPMI_int86(int intno, DPMI_regs *regs)
-{
-    PM_init();
-    if (VRegs == NULL)
-       return;
-
-    VRegs->l.eax = regs->eax;
-    VRegs->l.ebx = regs->ebx;
-    VRegs->l.ecx = regs->ecx;
-    VRegs->l.edx = regs->edx;
-    VRegs->l.esi = regs->esi;
-    VRegs->l.edi = regs->edi;
-
-    VBIOSint(intno, VRegs, 1024);
-
-    regs->eax = VRegs->l.eax;
-    regs->ebx = VRegs->l.ebx;
-    regs->ecx = VRegs->l.ecx;
-    regs->edx = VRegs->l.edx;
-    regs->esi = VRegs->l.esi;
-    regs->edi = VRegs->l.edi;
-    regs->flags = VRegs->w.flags & 0x1;
-}
-
-int PMAPI PM_int86(int intno, RMREGS *in, RMREGS *out)
-{
-    PM_init();
-    if (VRegs == NULL)
-       return 0;
-
-    VRegs->l.eax = in->e.eax;
-    VRegs->l.ebx = in->e.ebx;
-    VRegs->l.ecx = in->e.ecx;
-    VRegs->l.edx = in->e.edx;
-    VRegs->l.esi = in->e.esi;
-    VRegs->l.edi = in->e.edi;
-
-    VBIOSint(intno, VRegs, 1024);
-
-    out->e.eax = VRegs->l.eax;
-    out->e.ebx = VRegs->l.ebx;
-    out->e.ecx = VRegs->l.ecx;
-    out->e.edx = VRegs->l.edx;
-    out->e.esi = VRegs->l.esi;
-    out->e.edi = VRegs->l.edi;
-    out->x.cflag = VRegs->w.flags & 0x1;
-
-    return out->x.ax;
-}
-
-int PMAPI PM_int86x(int intno, RMREGS *in, RMREGS *out,
-    RMSREGS *sregs)
-{
-    PM_init();
-    if (VRegs == NULL)
-       return 0;
-
-    if (intno == 0x21) {
-       time_t today = time(NULL);
-       struct tm *t;
-       t = localtime(&today);
-       out->x.cx = t->tm_year + 1900;
-       out->h.dh = t->tm_mon + 1;
-       out->h.dl = t->tm_mday;
-       return 0;
-       }
-    else {
-       VRegs->l.eax = in->e.eax;
-       VRegs->l.ebx = in->e.ebx;
-       VRegs->l.ecx = in->e.ecx;
-       VRegs->l.edx = in->e.edx;
-       VRegs->l.esi = in->e.esi;
-       VRegs->l.edi = in->e.edi;
-       VRegs->w.es = sregs->es;
-       VRegs->w.ds = sregs->ds;
-
-       VBIOSint(intno, VRegs, 1024);
-
-       out->e.eax = VRegs->l.eax;
-       out->e.ebx = VRegs->l.ebx;
-       out->e.ecx = VRegs->l.ecx;
-       out->e.edx = VRegs->l.edx;
-       out->e.esi = VRegs->l.esi;
-       out->e.edi = VRegs->l.edi;
-       out->x.cflag = VRegs->w.flags & 0x1;
-       sregs->es = VRegs->w.es;
-       sregs->ds = VRegs->w.ds;
-
-       return out->x.ax;
-       }
-}
-
-void PMAPI PM_callRealMode(uint seg,uint off, RMREGS *in,
-    RMSREGS *sregs)
-{
-    PM_init();
-    if (VRegs == NULL)
-       return;
-
-    VRegs->l.eax = in->e.eax;
-    VRegs->l.ebx = in->e.ebx;
-    VRegs->l.ecx = in->e.ecx;
-    VRegs->l.edx = in->e.edx;
-    VRegs->l.esi = in->e.esi;
-    VRegs->l.edi = in->e.edi;
-    VRegs->w.es = sregs->es;
-    VRegs->w.ds = sregs->ds;
-
-    VBIOScall(seg, off, VRegs, 1024);
-
-    in->e.eax = VRegs->l.eax;
-    in->e.ebx = VRegs->l.ebx;
-    in->e.ecx = VRegs->l.ecx;
-    in->e.edx = VRegs->l.edx;
-    in->e.esi = VRegs->l.esi;
-    in->e.edi = VRegs->l.edi;
-    in->x.cflag = VRegs->w.flags & 0x1;
-    sregs->es = VRegs->w.es;
-    sregs->ds = VRegs->w.ds;
-}
-
-void PMAPI PM_availableMemory(ulong *physical,ulong *total)
-{
-#ifndef __QNXNTO__
-    *physical = *total = _memavl();
-#endif
-}
-
-void * PMAPI PM_allocLockedMem(
-    uint size,
-    ulong *physAddr,
-    ibool contiguous,
-    ibool below16M)
-{
-    /* TODO: Implement this on QNX */
-    return NULL;
-}
-
-void PMAPI PM_freeLockedMem(
-    void *p,
-    uint size,
-    ibool contiguous)
-{
-    /* TODO: Implement this on QNX */
-}
-
-void * PMAPI PM_allocPage(
-    ibool locked)
-{
-    /* TODO: Implement this on QNX */
-    return NULL;
-}
-
-void PMAPI PM_freePage(
-    void *p)
-{
-    /* TODO: Implement this on QNX */
-}
-
-void PMAPI PM_setBankA(int bank)
-{
-    PM_init();
-    if (VRegs == NULL)
-       return;
-
-    VRegs->l.eax = 0x4F05;
-    VRegs->l.ebx = 0x0000;
-    VRegs->l.edx = bank;
-    VBIOSint(0x10, VRegs, 1024);
-}
-
-void PMAPI PM_setBankAB(int bank)
-{
-    PM_init();
-    if (VRegs == NULL)
-       return;
-
-    VRegs->l.eax = 0x4F05;
-    VRegs->l.ebx = 0x0000;
-    VRegs->l.edx = bank;
-    VBIOSint(0x10, VRegs, 1024);
-
-    VRegs->l.eax = 0x4F05;
-    VRegs->l.ebx = 0x0001;
-    VRegs->l.edx = bank;
-    VBIOSint(0x10, VRegs, 1024);
-}
-
-void PMAPI PM_setCRTStart(int x,int y,int waitVRT)
-{
-    PM_init();
-    if (VRegs == NULL)
-       return;
-
-    VRegs->l.eax = 0x4F07;
-    VRegs->l.ebx = waitVRT;
-    VRegs->l.ecx = x;
-    VRegs->l.edx = y;
-    VBIOSint(0x10, VRegs, 1024);
-}
-
-ibool PMAPI PM_doBIOSPOST(
-    ushort axVal,
-    ulong BIOSPhysAddr,
-    void *copyOfBIOS,
-    ulong BIOSLen)
-{
-    (void)axVal;
-    (void)BIOSPhysAddr;
-    (void)copyOfBIOS;
-    (void)BIOSLen;
-    return false;
-}
-
-int PMAPI PM_lockDataPages(void *p,uint len,PM_lockHandle *lh)
-{
-    p = p;  len = len;
-    return 1;
-}
-
-int PMAPI PM_unlockDataPages(void *p,uint len,PM_lockHandle *lh)
-{
-    p = p;  len = len;
-    return 1;
-}
-
-int PMAPI PM_lockCodePages(void (*p)(),uint len,PM_lockHandle *lh)
-{
-    p = p;  len = len;
-    return 1;
-}
-
-int PMAPI PM_unlockCodePages(void (*p)(),uint len,PM_lockHandle *lh)
-{
-    p = p;  len = len;
-    return 1;
-}
-
-PM_MODULE PMAPI PM_loadLibrary(
-    const char *szDLLName)
-{
-    /* TODO: Implement this to load shared libraries! */
-    (void)szDLLName;
-    return NULL;
-}
-
-void * PMAPI PM_getProcAddress(
-    PM_MODULE hModule,
-    const char *szProcName)
-{
-    /* TODO: Implement this! */
-    (void)hModule;
-    (void)szProcName;
-    return NULL;
-}
-
-void PMAPI PM_freeLibrary(
-    PM_MODULE hModule)
-{
-    /* TODO: Implement this! */
-    (void)hModule;
-}
-
-int PMAPI PM_setIOPL(
-    int level)
-{
-    /* QNX handles IOPL selection at the program link level. */
-    return level;
-}
-
-/****************************************************************************
-PARAMETERS:
-base    - The starting physical base address of the region
-size    - The size in bytes of the region
-type    - Type to place into the MTRR register
-
-RETURNS:
-Error code describing the result.
-
-REMARKS:
-Function to enable write combining for the specified region of memory.
-****************************************************************************/
-int PMAPI PM_enableWriteCombine(
-    ulong base,
-    ulong size,
-    uint type)
-{
-#ifndef  __QNXNTO__
-    return MTRR_enableWriteCombine(base,size,type);
-#else
-    return PM_MTRR_NOT_SUPPORTED;
-#endif
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/qnx/vflat.c b/board/MAI/bios_emulator/scitech/src/pm/qnx/vflat.c
deleted file mode 100644 (file)
index 579ef2c..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Any
-*
-* Description:  Dummy module; no virtual framebuffer for this OS
-*
-****************************************************************************/
-
-#include "pmapi.h"
-
-ibool PMAPI VF_available(void)
-{
-    return false;
-}
-
-void * PMAPI VF_init(ulong baseAddr,int bankSize,int codeLen,void *bankFunc)
-{
-    baseAddr = baseAddr;
-    bankSize = bankSize;
-    codeLen = codeLen;
-    bankFunc = bankFunc;
-    return NULL;
-}
-
-void PMAPI VF_exit(void)
-{
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/qnx/ztimer.c b/board/MAI/bios_emulator/scitech/src/pm/qnx/ztimer.c
deleted file mode 100644 (file)
index d274097..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-/****************************************************************************
-*
-*                         Ultra Long Period Timer
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  QNX
-*
-* Description:  QNX specific implementation for the Zen Timer functions.
-*
-****************************************************************************/
-
-/*----------------------------- Implementation ----------------------------*/
-
-/****************************************************************************
-REMARKS:
-Initialise the Zen Timer module internals.
-****************************************************************************/
-void __ZTimerInit(void)
-{
-}
-
-/****************************************************************************
-REMARKS:
-Use the gettimeofday() function to get microsecond precision (probably less
-though)
-****************************************************************************/
-static ulong __ULZReadTime(void)
-{
-    struct timespec ts;
-    clock_gettime(CLOCK_REALTIME, &ts);
-    return (ts.tv_nsec / 1000 + ts.tv_sec * 1000000);
-}
-
-/****************************************************************************
-REMARKS:
-Start the Zen Timer counting.
-****************************************************************************/
-#define __LZTimerOn(tm)     tm->start.low = __ULZReadTime()
-
-/****************************************************************************
-REMARKS:
-Compute the lap time since the timer was started.
-****************************************************************************/
-#define __LZTimerLap(tm)        (__ULZReadTime() - tm->start.low)
-
-/****************************************************************************
-REMARKS:
-Call the assembler Zen Timer functions to do the timing.
-****************************************************************************/
-#define __LZTimerOff(tm)        tm->end.low = __ULZReadTime()
-
-/****************************************************************************
-REMARKS:
-Call the assembler Zen Timer functions to do the timing.
-****************************************************************************/
-#define __LZTimerCount(tm)  (tm->end.low - tm->start.low)
-
-/****************************************************************************
-REMARKS:
-Define the resolution of the long period timer as microseconds per timer tick.
-****************************************************************************/
-#define ULZTIMER_RESOLUTION 1
-
-/****************************************************************************
-REMARKS:
-Compute the elapsed time from the BIOS timer tick. Note that we check to see
-whether a midnight boundary has passed, and if so adjust the finish time to
-account for this. We cannot detect if more that one midnight boundary has
-passed, so if this happens we will be generating erronous results.
-****************************************************************************/
-ulong __ULZElapsedTime(ulong start,ulong finish)
-{ return finish - start; }
diff --git a/board/MAI/bios_emulator/scitech/src/pm/rttarget/cpuinfo.c b/board/MAI/bios_emulator/scitech/src/pm/rttarget/cpuinfo.c
deleted file mode 100644 (file)
index 4f32c3e..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-/****************************************************************************
-*
-*                         Ultra Long Period Timer
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  RTTarget-32
-*
-* Description:  Module to implement OS specific services to measure the
-*               CPU frequency.
-*
-****************************************************************************/
-
-/*---------------------------- Global variables ---------------------------*/
-
-static ibool havePerformanceCounter;
-
-/*----------------------------- Implementation ----------------------------*/
-
-/****************************************************************************
-REMARKS:
-Increase the thread priority to maximum, if possible.
-****************************************************************************/
-static int SetMaxThreadPriority(void)
-{
-    int     oldPriority;
-    HANDLE  hThread = GetCurrentThread();
-
-    oldPriority = GetThreadPriority(hThread);
-    if (oldPriority != THREAD_PRIORITY_ERROR_RETURN)
-       SetThreadPriority(hThread, THREAD_PRIORITY_TIME_CRITICAL);
-    return oldPriority;
-}
-
-/****************************************************************************
-REMARKS:
-Restore the original thread priority.
-****************************************************************************/
-static void RestoreThreadPriority(
-    int oldPriority)
-{
-    HANDLE  hThread = GetCurrentThread();
-
-    if (oldPriority != THREAD_PRIORITY_ERROR_RETURN)
-       SetThreadPriority(hThread, oldPriority);
-}
-
-/****************************************************************************
-REMARKS:
-Initialise the counter and return the frequency of the counter.
-****************************************************************************/
-static void GetCounterFrequency(
-    CPU_largeInteger *freq)
-{
-    if (!QueryPerformanceFrequency((LARGE_INTEGER*)freq)) {
-       havePerformanceCounter = false;
-       freq->low = 100000;
-       freq->high = 0;
-       }
-    else
-       havePerformanceCounter = true;
-}
-
-/****************************************************************************
-REMARKS:
-Read the counter and return the counter value.
-****************************************************************************/
-#define GetCounter(t)                                       \
-{                                                           \
-    if (havePerformanceCounter)                             \
-       QueryPerformanceCounter((LARGE_INTEGER*)t);         \
-    else {                                                  \
-       (t)->low = timeGetTime() * 100;                     \
-       (t)->high = 0;                                      \
-       }                                                   \
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/rttarget/event.c b/board/MAI/bios_emulator/scitech/src/pm/rttarget/event.c
deleted file mode 100644 (file)
index 962a14a..0000000
+++ /dev/null
@@ -1,287 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech Multi-platform Graphics Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  RTTarget-32
-*
-* Description:  Win32 implementation for the SciTech cross platform
-*               event library.
-*
-****************************************************************************/
-
-/*---------------------------- Global Variables ---------------------------*/
-
-static ushort   keyUpMsg[256] = {0};    /* Table of key up messages     */
-static int      rangeX,rangeY;          /* Range of mouse coordinates   */
-
-/*---------------------------- Implementation -----------------------------*/
-
-/* These are not used under Win32 */
-#define _EVT_disableInt()       1
-#define _EVT_restoreInt(flags)
-
-/****************************************************************************
-PARAMETERS:
-scanCode    - Scan code to test
-
-REMARKS:
-This macro determines if a specified key is currently down at the
-time that the call is made.
-****************************************************************************/
-#define _EVT_isKeyDown(scanCode)    (keyUpMsg[scanCode] != 0)
-
-/****************************************************************************
-REMARKS:
-This function is used to return the number of ticks since system
-startup in milliseconds. This should be the same value that is placed into
-the time stamp fields of events, and is used to implement auto mouse down
-events.
-****************************************************************************/
-ulong _EVT_getTicks(void)
-{ return timeGetTime(); }
-
-/****************************************************************************
-REMARKS:
-Pumps all messages in the message queue from Win32 into our event queue.
-****************************************************************************/
-void _EVT_pumpMessages(void)
-{
-    MSG     msg;
-    MSG     charMsg;
-    event_t evt;
-
-    while (PeekMessage(&msg,NULL,0,0,PM_REMOVE)) {
-       memset(&evt,0,sizeof(evt));
-       switch (msg.message) {
-           case WM_MOUSEMOVE:
-               evt.what = EVT_MOUSEMOVE;
-               break;
-           case WM_LBUTTONDBLCLK:
-               evt.what = EVT_MOUSEDOWN;
-               evt.message = EVT_LEFTBMASK | EVT_DBLCLICK;
-               break;
-           case WM_LBUTTONDOWN:
-               evt.what = EVT_MOUSEDOWN;
-               evt.message = EVT_LEFTBMASK;
-               break;
-           case WM_LBUTTONUP:
-               evt.what = EVT_MOUSEUP;
-               evt.message = EVT_LEFTBMASK;
-               break;
-           case WM_RBUTTONDBLCLK:
-               evt.what = EVT_MOUSEDOWN | EVT_DBLCLICK;
-               evt.message = EVT_RIGHTBMASK;
-               break;
-           case WM_RBUTTONDOWN:
-               evt.what = EVT_MOUSEDOWN;
-               evt.message = EVT_RIGHTBMASK;
-               break;
-           case WM_RBUTTONUP:
-               evt.what = EVT_MOUSEUP;
-               evt.message = EVT_RIGHTBMASK;
-               break;
-           case WM_KEYDOWN:
-           case WM_SYSKEYDOWN:
-               if (HIWORD(msg.lParam) & KF_REPEAT) {
-                   evt.what = EVT_KEYREPEAT;
-                   }
-               else {
-                   evt.what = EVT_KEYDOWN;
-                   }
-               break;
-           case WM_KEYUP:
-           case WM_SYSKEYUP:
-               evt.what = EVT_KEYUP;
-               break;
-           }
-
-       /* Convert mouse event modifier flags */
-       if (evt.what & EVT_MOUSEEVT) {
-           evt.where_x = msg.pt.x;
-           evt.where_y = msg.pt.y;
-           if (evt.what == EVT_MOUSEMOVE) {
-               if (oldMove != -1) {
-                   evtq[oldMove].where_x = evt.where_x;/* Modify existing one  */
-                   evtq[oldMove].where_y = evt.where_y;
-                   evt.what = 0;
-                   }
-               else {
-                   oldMove = freeHead; /* Save id of this move event   */
-                   }
-               }
-           else
-               oldMove = -1;
-           if (msg.wParam & MK_LBUTTON)
-               evt.modifiers |= EVT_LEFTBUT;
-           if (msg.wParam & MK_RBUTTON)
-               evt.modifiers |= EVT_RIGHTBUT;
-           if (msg.wParam & MK_SHIFT)
-               evt.modifiers |= EVT_SHIFTKEY;
-           if (msg.wParam & MK_CONTROL)
-               evt.modifiers |= EVT_CTRLSTATE;
-           }
-
-       /* Convert keyboard codes */
-       TranslateMessage(&msg);
-       if (evt.what & EVT_KEYEVT) {
-           int scanCode = (msg.lParam >> 16) & 0xFF;
-           if (evt.what == EVT_KEYUP) {
-               /* Get message for keyup code from table of cached down values */
-               evt.message = keyUpMsg[scanCode];
-               keyUpMsg[scanCode] = 0;
-               }
-           else {
-               if (PeekMessage(&charMsg,NULL,WM_CHAR,WM_CHAR,PM_REMOVE))
-                   evt.message = charMsg.wParam;
-               if (PeekMessage(&charMsg,NULL,WM_SYSCHAR,WM_SYSCHAR,PM_REMOVE))
-                   evt.message = charMsg.wParam;
-               evt.message |= ((msg.lParam >> 8) & 0xFF00);
-               keyUpMsg[scanCode] = (ushort)evt.message;
-               }
-           if (evt.what == EVT_KEYREPEAT)
-               evt.message |= (msg.lParam << 16);
-           if (HIWORD(msg.lParam) & KF_ALTDOWN)
-               evt.modifiers |= EVT_ALTSTATE;
-           if (GetKeyState(VK_SHIFT) & 0x8000U)
-               evt.modifiers |= EVT_SHIFTKEY;
-           if (GetKeyState(VK_CONTROL) & 0x8000U)
-               evt.modifiers |= EVT_CTRLSTATE;
-           oldMove = -1;
-           }
-
-       if (evt.what != 0) {
-           /* Add time stamp and add the event to the queue */
-           evt.when = msg.time;
-           if (count < EVENTQSIZE) {
-               addEvent(&evt);
-               }
-           }
-       DispatchMessage(&msg);
-       }
-}
-
-/****************************************************************************
-REMARKS:
-This macro/function is used to converts the scan codes reported by the
-keyboard to our event libraries normalised format. We only have one scan
-code for the 'A' key, and use shift modifiers to determine if it is a
-Ctrl-F1, Alt-F1 etc. The raw scan codes from the keyboard work this way,
-but the OS gives us 'cooked' scan codes, we have to translate them back
-to the raw format.
-****************************************************************************/
-#define _EVT_maskKeyCode(evt)
-
-/****************************************************************************
-REMARKS:
-Safely abort the event module upon catching a fatal error.
-****************************************************************************/
-void _EVT_abort()
-{
-    EVT_exit();
-    PM_fatalError("Unhandled exception!");
-}
-
-/****************************************************************************
-PARAMETERS:
-mouseMove   - Callback function to call wheneve the mouse needs to be moved
-
-REMARKS:
-Initiliase the event handling module. Here we install our mouse handling ISR
-to be called whenever any button's are pressed or released. We also build
-the free list of events in the event queue.
-
-We use handler number 2 of the mouse libraries interrupt handlers for our
-event handling routines.
-****************************************************************************/
-void EVTAPI EVT_init(
-    _EVT_mouseMoveHandler mouseMove)
-{
-    /* Initialise the event queue */
-    _mouseMove = mouseMove;
-    initEventQueue();
-    memset(keyUpMsg,0,sizeof(keyUpMsg));
-
-    /* Catch program termination signals so we can clean up properly */
-    signal(SIGABRT, _EVT_abort);
-    signal(SIGFPE, _EVT_abort);
-    signal(SIGINT, _EVT_abort);
-}
-
-/****************************************************************************
-REMARKS
-Changes the range of coordinates returned by the mouse functions to the
-specified range of values. This is used when changing between graphics
-modes set the range of mouse coordinates for the new display mode.
-****************************************************************************/
-void EVTAPI EVT_setMouseRange(
-    int xRes,
-    int yRes)
-{
-    rangeX = xRes;
-    rangeY = yRes;
-}
-
-/****************************************************************************
-REMARKS
-Modifes the mouse coordinates as necessary if scaling to OS coordinates,
-and sets the OS mouse cursor position.
-****************************************************************************/
-void _EVT_setMousePos(
-    int *x,
-    int *y)
-{
-    SetCursorPos(*x,*y);
-}
-
-/****************************************************************************
-REMARKS:
-Initiailises the internal event handling modules. The EVT_suspend function
-can be called to suspend event handling (such as when shelling out to DOS),
-and this function can be used to resume it again later.
-****************************************************************************/
-void EVT_resume(void)
-{
-    /* Do nothing for Win32 */
-}
-
-/****************************************************************************
-REMARKS
-Suspends all of our event handling operations. This is also used to
-de-install the event handling code.
-****************************************************************************/
-void EVT_suspend(void)
-{
-    /* Do nothing for Win32 */
-}
-
-/****************************************************************************
-REMARKS
-Exits the event module for program terminatation.
-****************************************************************************/
-void EVT_exit(void)
-{
-    /* Restore signal handlers */
-    signal(SIGABRT, SIG_DFL);
-    signal(SIGFPE, SIG_DFL);
-    signal(SIGINT, SIG_DFL);
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/rttarget/oshdr.h b/board/MAI/bios_emulator/scitech/src/pm/rttarget/oshdr.h
deleted file mode 100644 (file)
index 1352dad..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  RTTarget-32
-*
-* Description:  Include file to include all OS specific header files.
-*
-****************************************************************************/
-
-#define WIN32_LEAN_AND_MEAN
-#define STRICT
-#include <windows.h>
-#include <mmsystem.h>
diff --git a/board/MAI/bios_emulator/scitech/src/pm/rttarget/pm.c b/board/MAI/bios_emulator/scitech/src/pm/rttarget/pm.c
deleted file mode 100644 (file)
index 47d7ed6..0000000
+++ /dev/null
@@ -1,701 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  RTTarget-32
-*
-* Description:  Implementation for the OS Portability Manager Library, which
-*               contains functions to implement OS specific services in a
-*               generic, cross platform API. Porting the OS Portability
-*               Manager library is the first step to porting any SciTech
-*               products to a new platform.
-*
-****************************************************************************/
-
-#include "pmapi.h"
-#include "drvlib/os/os.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#define WIN32_LEAN_AND_MEAN
-#define STRICT
-#include <windows.h>
-#include <mmsystem.h>
-#ifdef  __BORLANDC__
-#pragma warn -par
-#endif
-
-/*--------------------------- Global variables ----------------------------*/
-
-static void     (PMAPIP fatalErrorCleanup)(void) = NULL;
-
-/*----------------------------- Implementation ----------------------------*/
-
-void MTRR_init(void);
-
-/****************************************************************************
-REMARKS:
-Initialise the PM library.
-****************************************************************************/
-void PMAPI PM_init(void)
-{
-    /* TODO: dO any special init code in here. */
-    MTRR_init();
-}
-
-/****************************************************************************
-REMARKS:
-Return the operating system type identifier.
-****************************************************************************/
-long PMAPI PM_getOSType(void)
-{
-    return _OS_RTTARGET;
-}
-
-/****************************************************************************
-REMARKS:
-Return the runtime type identifier.
-****************************************************************************/
-int PMAPI PM_getModeType(void)
-{
-    return PM_386;
-}
-
-/****************************************************************************
-REMARKS:
-Add a file directory separator to the end of the filename.
-****************************************************************************/
-void PMAPI PM_backslash(
-    char *s)
-{
-    uint pos = strlen(s);
-    if (s[pos-1] != '\\') {
-       s[pos] = '\\';
-       s[pos+1] = '\0';
-       }
-}
-
-/****************************************************************************
-REMARKS:
-Add a user defined PM_fatalError cleanup function.
-****************************************************************************/
-void PMAPI PM_setFatalErrorCleanup(
-    void (PMAPIP cleanup)(void))
-{
-    fatalErrorCleanup = cleanup;
-}
-
-/****************************************************************************
-REMARKS:
-Report a fatal error condition and halt the program.
-****************************************************************************/
-void PMAPI PM_fatalError(
-    const char *msg)
-{
-    if (fatalErrorCleanup)
-       fatalErrorCleanup();
-    /* TODO: Display a fatal error message and exit! */
-/*  MessageBox(NULL,msg,"Fatal Error!", MB_ICONEXCLAMATION); */
-    exit(1);
-}
-
-/****************************************************************************
-REMARKS:
-Allocate the real mode VESA transfer buffer for communicating with the BIOS.
-****************************************************************************/
-void * PMAPI PM_getVESABuf(
-    uint *len,
-    uint *rseg,
-    uint *roff)
-{
-    /* No BIOS access for the RTTarget */
-    return NULL;
-}
-
-/****************************************************************************
-REMARKS:
-Check if a key has been pressed.
-****************************************************************************/
-int PMAPI PM_kbhit(void)
-{
-    /* TODO: Need to check if a key is waiting on the keyboard queue */
-    return true;
-}
-
-/****************************************************************************
-REMARKS:
-Wait for and return the next keypress.
-****************************************************************************/
-int PMAPI PM_getch(void)
-{
-    /* TODO: Need to obtain the next keypress, and block until one is hit */
-    return 0xD;
-}
-
-/****************************************************************************
-REMARKS:
-Set the location of the OS console cursor.
-****************************************************************************/
-void PM_setOSCursorLocation(
-    int x,
-    int y)
-{
-    /* Nothing to do for RTTarget-32 */
-}
-
-/****************************************************************************
-REMARKS:
-Set the width of the OS console.
-****************************************************************************/
-void PM_setOSScreenWidth(
-    int width,
-    int height)
-{
-    /* Nothing to do for RTTarget-32 */
-}
-
-/****************************************************************************
-REMARKS:
-Set the real time clock handler (used for software stereo modes).
-****************************************************************************/
-ibool PMAPI PM_setRealTimeClockHandler(
-    PM_intHandler ih,
-    int frequency)
-{
-    /* Not supported for RTTarget-32 */
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-Set the real time clock frequency (for stereo modes).
-****************************************************************************/
-void PMAPI PM_setRealTimeClockFrequency(
-    int frequency)
-{
-    /* Not supported under RTTarget-32 */
-}
-
-/****************************************************************************
-REMARKS:
-Restore the original real time clock handler.
-****************************************************************************/
-void PMAPI PM_restoreRealTimeClockHandler(void)
-{
-    /* Not supported under RTTarget-32 */
-}
-
-/****************************************************************************
-REMARKS:
-Return the current operating system path or working directory.
-****************************************************************************/
-char * PMAPI PM_getCurrentPath(
-    char *path,
-    int maxLen)
-{
-    return getcwd(path,maxLen);
-}
-
-/****************************************************************************
-REMARKS:
-Return the drive letter for the boot drive.
-****************************************************************************/
-char PMAPI PM_getBootDrive(void)
-{
-    return 'c';
-}
-
-/****************************************************************************
-REMARKS:
-Return the path to the VBE/AF driver files.
-****************************************************************************/
-const char * PMAPI PM_getVBEAFPath(void)
-{
-    return "c:\\";
-}
-
-/****************************************************************************
-REMARKS:
-Return the path to the Nucleus driver files.
-****************************************************************************/
-const char * PMAPI PM_getNucleusPath(void)
-{
-    /* TODO: Point this at the path when the Nucleus drivers will be found */
-    return "c:\\nucleus";
-}
-
-/****************************************************************************
-REMARKS:
-Return the path to the Nucleus configuration files.
-****************************************************************************/
-const char * PMAPI PM_getNucleusConfigPath(void)
-{
-    static char path[256];
-    strcpy(path,PM_getNucleusPath());
-    PM_backslash(path);
-    strcat(path,"config");
-    return path;
-}
-
-/****************************************************************************
-REMARKS:
-Return a unique identifier for the machine if possible.
-****************************************************************************/
-const char * PMAPI PM_getUniqueID(void)
-{
-    return PM_getMachineName();
-}
-
-/****************************************************************************
-REMARKS:
-Get the name of the machine on the network.
-****************************************************************************/
-const char * PMAPI PM_getMachineName(void)
-{
-    /* Not necessary for RTTarget-32 */
-    return "Unknown";
-}
-
-/****************************************************************************
-REMARKS:
-Return a pointer to the real mode BIOS data area.
-****************************************************************************/
-void * PMAPI PM_getBIOSPointer(void)
-{
-    /* Not used for RTTarget-32 */
-    return NULL;
-}
-
-/****************************************************************************
-REMARKS:
-Return a pointer to 0xA0000 physical VGA graphics framebuffer.
-****************************************************************************/
-void * PMAPI PM_getA0000Pointer(void)
-{
-    static void *bankPtr;
-    if (!bankPtr)
-       bankPtr = PM_mapPhysicalAddr(0xA0000,0xFFFF,true);
-    return bankPtr;
-}
-
-/****************************************************************************
-REMARKS:
-Map a physical address to a linear address in the callers process.
-****************************************************************************/
-void * PMAPI PM_mapPhysicalAddr(
-    ulong base,
-    ulong limit,
-    ibool isCached)
-{
-    /* TODO: Map a physical memory address to a linear address */
-    return NULL;
-}
-
-/****************************************************************************
-REMARKS:
-Free a physical address mapping allocated by PM_mapPhysicalAddr.
-****************************************************************************/
-void PMAPI PM_freePhysicalAddr(
-    void *ptr,
-    ulong limit)
-{
-    /* TODO: Free the physical address mapping */
-}
-
-ulong PMAPI PM_getPhysicalAddr(void *p)
-{
-    /* TODO: This function should find the physical address of a linear */
-    /*       address. */
-    return 0xFFFFFFFFUL;
-}
-
-void PMAPI PM_sleep(ulong milliseconds)
-{
-    Sleep(milliseconds);
-}
-
-int PMAPI PM_getCOMPort(int port)
-{
-    /* TODO: Re-code this to determine real values using the Plug and Play */
-    /*       manager for the OS. */
-    switch (port) {
-       case 0: return 0x3F8;
-       case 1: return 0x2F8;
-       }
-    return 0;
-}
-
-int PMAPI PM_getLPTPort(int port)
-{
-    /* TODO: Re-code this to determine real values using the Plug and Play */
-    /*       manager for the OS. */
-    switch (port) {
-       case 0: return 0x3BC;
-       case 1: return 0x378;
-       case 2: return 0x278;
-       }
-    return 0;
-}
-
-/****************************************************************************
-REMARKS:
-Allocate a block of (unnamed) shared memory.
-****************************************************************************/
-void * PMAPI PM_mallocShared(
-    long size)
-{
-    return PM_malloc(size);
-}
-
-/****************************************************************************
-REMARKS:
-Free a block of shared memory.
-****************************************************************************/
-void PMAPI PM_freeShared(
-    void *ptr)
-{
-    PM_free(ptr);
-}
-
-/****************************************************************************
-REMARKS:
-Map a linear memory address to the calling process address space. The
-address will have been allocated in another process using the
-PM_mapPhysicalAddr function.
-****************************************************************************/
-void * PMAPI PM_mapToProcess(
-    void *base,
-    ulong limit)
-{
-    return base;
-}
-
-/****************************************************************************
-REMARKS:
-Map a real mode pointer to a protected mode pointer.
-****************************************************************************/
-void * PMAPI PM_mapRealPointer(
-    uint r_seg,
-    uint r_off)
-{
-    /* Not used for RTTarget-32 */
-    return NULL;
-}
-
-/****************************************************************************
-REMARKS:
-Allocate a block of real mode memory
-****************************************************************************/
-void * PMAPI PM_allocRealSeg(
-    uint size,
-    uint *r_seg,
-    uint *r_off)
-{
-    /* Not used for RTTarget-32 */
-    return NULL;
-}
-
-/****************************************************************************
-REMARKS:
-Free a block of real mode memory.
-****************************************************************************/
-void PMAPI PM_freeRealSeg(
-    void *mem)
-{
-    /* Not used for RTTarget-32 */
-}
-
-/****************************************************************************
-REMARKS:
-Issue a real mode interrupt (parameters in DPMI compatible structure)
-****************************************************************************/
-void PMAPI DPMI_int86(
-    int intno,
-    DPMI_regs *regs)
-{
-    /* Not used for RTTarget-32 */
-}
-
-/****************************************************************************
-REMARKS:
-Issue a real mode interrupt.
-****************************************************************************/
-int PMAPI PM_int86(
-    int intno,
-    RMREGS *in,
-    RMREGS *out)
-{
-    /* Not used for RTTarget-32 */
-    return 0;
-}
-
-/****************************************************************************
-REMARKS:
-Issue a real mode interrupt.
-****************************************************************************/
-int PMAPI PM_int86x(
-    int intno,
-    RMREGS *in,
-    RMREGS *out,
-    RMSREGS *sregs)
-{
-    /* Not used for RTTarget-32 */
-    return 0;
-}
-
-/****************************************************************************
-REMARKS:
-Call a real mode far function.
-****************************************************************************/
-void PMAPI PM_callRealMode(
-    uint seg,
-    uint off,
-    RMREGS *in,
-    RMSREGS *sregs)
-{
-    /* Not used for RTTarget-32 */
-}
-
-/****************************************************************************
-REMARKS:
-Return the amount of available memory.
-****************************************************************************/
-void PMAPI PM_availableMemory(
-    ulong *physical,
-    ulong *total)
-{
-    /* TODO: Figure out how to determine the available memory. Not entirely */
-    /*       critical so returning 0 is OK. */
-    *physical = *total = 0;
-}
-
-/****************************************************************************
-REMARKS:
-Allocate a block of locked, physical memory for DMA operations.
-****************************************************************************/
-void * PMAPI PM_allocLockedMem(
-    uint size,
-    ulong *physAddr,
-    ibool contiguous,
-    ibool below16M)
-{
-    /* TODO: Allocate a block of locked, phsyically contigous memory for DMA */
-    return 0;
-}
-
-/****************************************************************************
-REMARKS:
-Free a block of locked physical memory.
-****************************************************************************/
-void PMAPI PM_freeLockedMem(
-    void *p,
-    uint size,
-
-    ibool contiguous)
-{
-    /* TODO: Free a locked memory buffer */
-}
-
-/****************************************************************************
-REMARKS:
-Call the VBE/Core software interrupt to change display banks.
-****************************************************************************/
-void PMAPI PM_setBankA(
-    int bank)
-{
-    /* Not used for RTTarget-32 */
-}
-
-/****************************************************************************
-REMARKS:
-Call the VBE/Core software interrupt to change display banks.
-****************************************************************************/
-void PMAPI PM_setBankAB(
-    int bank)
-{
-    /* Not used for RTTarget-32 */
-}
-
-/****************************************************************************
-REMARKS:
-Call the VBE/Core software interrupt to change display start address.
-****************************************************************************/
-void PMAPI PM_setCRTStart(
-    int x,
-    int y,
-    int waitVRT)
-{
-    /* Not used for RTTarget-32 */
-}
-
-/****************************************************************************
-REMARKS:
-Execute the POST on the secondary BIOS for a controller.
-****************************************************************************/
-ibool PMAPI PM_doBIOSPOST(
-    ushort axVal,
-    ulong BIOSPhysAddr,
-    void *mappedBIOS)
-{
-    /* Not used for RTTarget-32 */
-    return false;
-}
-
-PM_MODULE PMAPI PM_loadLibrary(
-    const char *szDLLName)
-{
-    /* TODO: Implement this to load shared libraries! */
-    (void)szDLLName;
-    return NULL;
-}
-
-void * PMAPI PM_getProcAddress(
-    PM_MODULE hModule,
-    const char *szProcName)
-{
-    /* TODO: Implement this! */
-    (void)hModule;
-    (void)szProcName;
-    return NULL;
-}
-
-void PMAPI PM_freeLibrary(
-    PM_MODULE hModule)
-{
-    /* TODO: Implement this! */
-    (void)hModule;
-}
-
-/****************************************************************************
-REMARKS:
-Function to find the first file matching a search criteria in a directory.
-****************************************************************************/
-ulong PMAPI PM_findFirstFile(
-    const char *filename,
-    PM_findData *findData)
-{
-    /* TODO: This function should start a directory enumeration search */
-    /*       given the filename (with wildcards). The data should be */
-    /*       converted and returned in the findData standard form. */
-    (void)filename;
-    (void)findData;
-    return PM_FILE_INVALID;
-}
-
-/****************************************************************************
-REMARKS:
-Function to find the next file matching a search criteria in a directory.
-****************************************************************************/
-ibool PMAPI PM_findNextFile(
-    ulong handle,
-    PM_findData *findData)
-{
-    /* TODO: This function should find the next file in directory enumeration */
-    /*       search given the search criteria defined in the call to */
-    /*       PM_findFirstFile. The data should be converted and returned */
-    /*       in the findData standard form. */
-    (void)handle;
-    (void)findData;
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-Function to close the find process
-****************************************************************************/
-void PMAPI PM_findClose(
-    ulong handle)
-{
-    /* TODO: This function should close the find process. This may do */
-    /*       nothing for some OS'es. */
-    (void)handle;
-}
-
-/****************************************************************************
-REMARKS:
-Function to determine if a drive is a valid drive or not. Under Unix this
-function will return false for anything except a value of 3 (considered
-the root drive, and equivalent to C: for non-Unix systems). The drive
-numbering is:
-
-    1   - Drive A:
-    2   - Drive B:
-    3   - Drive C:
-    etc
-
-****************************************************************************/
-ibool PMAPI PM_driveValid(
-    char drive)
-{
-    if (drive == 3)
-       return true;
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-Function to get the current working directory for the specififed drive.
-Under Unix this will always return the current working directory regardless
-of what the value of 'drive' is.
-****************************************************************************/
-void PMAPI PM_getdcwd(
-    int drive,
-    char *dir,
-    int len)
-{
-    (void)drive;
-    getcwd(dir,len);
-}
-
-/****************************************************************************
-REMARKS:
-Function to change the file attributes for a specific file.
-****************************************************************************/
-void PMAPI PM_setFileAttr(
-    const char *filename,
-    uint attrib)
-{
-    /* TODO: Set the file attributes for a file */
-    (void)filename;
-    (void)attrib;
-}
-
-/****************************************************************************
-REMARKS:
-Function to create a directory.
-****************************************************************************/
-ibool PMAPI PM_mkdir(
-    const char *filename)
-{
-    return mkdir(filename) == 0;
-}
-
-/****************************************************************************
-REMARKS:
-Function to remove a directory.
-****************************************************************************/
-ibool PMAPI PM_rmdir(
-    const char *filename)
-{
-    return rmdir(filename) == 0;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/rttarget/vflat.c b/board/MAI/bios_emulator/scitech/src/pm/rttarget/vflat.c
deleted file mode 100644 (file)
index dd9dfe6..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  RTTarget-32
-*
-* Description:  Dummy module; no virtual framebuffer for this OS
-*
-****************************************************************************/
-
-#include "pmapi.h"
-#ifdef  __BORLANDC__
-#pragma warn -par
-#endif
-
-ibool PMAPI VF_available(void)
-{
-    return false;
-}
-
-void * PMAPI VF_init(ulong baseAddr,int bankSize,int codeLen,void *bankFunc)
-{
-    return NULL;
-}
-
-void PMAPI VF_exit(void)
-{
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/rttarget/ztimer.c b/board/MAI/bios_emulator/scitech/src/pm/rttarget/ztimer.c
deleted file mode 100644 (file)
index 80c184d..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-/****************************************************************************
-*
-*                         Ultra Long Period Timer
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  RTTarget-32
-*
-* Description:  OS specific implementation for the Zen Timer functions.
-*
-****************************************************************************/
-
-/*---------------------------- Global variables ---------------------------*/
-
-static CPU_largeInteger countFreq;
-static ibool            havePerformanceCounter;
-static ulong            start,finish;
-
-/*----------------------------- Implementation ----------------------------*/
-
-/****************************************************************************
-REMARKS:
-Initialise the Zen Timer module internals.
-****************************************************************************/
-void __ZTimerInit(void)
-{
-#ifdef  NO_ASSEMBLER
-    havePerformanceCounter = false;
-#else
-    havePerformanceCounter = QueryPerformanceFrequency((LARGE_INTEGER*)&countFreq);
-#endif
-}
-
-/****************************************************************************
-REMARKS:
-Start the Zen Timer counting.
-****************************************************************************/
-static void __LZTimerOn(
-    LZTimerObject *tm)
-{
-    if (havePerformanceCounter)
-       QueryPerformanceCounter((LARGE_INTEGER*)&tm->start);
-    else
-       tm->start.low = timeGetTime();
-}
-
-/****************************************************************************
-REMARKS:
-Compute the lap time since the timer was started.
-****************************************************************************/
-static ulong __LZTimerLap(
-    LZTimerObject *tm)
-{
-    CPU_largeInteger    tmLap,tmCount;
-
-    if (havePerformanceCounter) {
-       QueryPerformanceCounter((LARGE_INTEGER*)&tmLap);
-       _CPU_diffTime64(&tm->start,&tmLap,&tmCount);
-       return _CPU_calcMicroSec(&tmCount,countFreq.low);
-       }
-    else {
-       tmLap.low = timeGetTime();
-       return (tmLap.low - tm->start.low) * 1000L;
-       }
-}
-
-/****************************************************************************
-REMARKS:
-Stop the Zen Timer counting.
-****************************************************************************/
-static void __LZTimerOff(
-    LZTimerObject *tm)
-{
-    if (havePerformanceCounter)
-       QueryPerformanceCounter((LARGE_INTEGER*)&tm->end);
-    else
-       tm->end.low = timeGetTime();
-}
-
-/****************************************************************************
-REMARKS:
-Compute the elapsed time in microseconds between start and end timings.
-****************************************************************************/
-static ulong __LZTimerCount(
-    LZTimerObject *tm)
-{
-    CPU_largeInteger    tmCount;
-
-    if (havePerformanceCounter) {
-       _CPU_diffTime64(&tm->start,&tm->end,&tmCount);
-       return _CPU_calcMicroSec(&tmCount,countFreq.low);
-       }
-    else
-       return (tm->end.low - tm->start.low) * 1000L;
-}
-
-/****************************************************************************
-REMARKS:
-Define the resolution of the long period timer as microseconds per timer tick.
-****************************************************************************/
-#define ULZTIMER_RESOLUTION     1000
-
-/****************************************************************************
-REMARKS:
-Read the Long Period timer from the OS
-****************************************************************************/
-static ulong __ULZReadTime(void)
-{ return timeGetTime(); }
-
-/****************************************************************************
-REMARKS:
-Compute the elapsed time from the BIOS timer tick. Note that we check to see
-whether a midnight boundary has passed, and if so adjust the finish time to
-account for this. We cannot detect if more that one midnight boundary has
-passed, so if this happens we will be generating erronous results.
-****************************************************************************/
-ulong __ULZElapsedTime(ulong start,ulong finish)
-{ return finish - start; }
diff --git a/board/MAI/bios_emulator/scitech/src/pm/smx/_event.asm b/board/MAI/bios_emulator/scitech/src/pm/smx/_event.asm
deleted file mode 100644 (file)
index da62b1f..0000000
+++ /dev/null
@@ -1,175 +0,0 @@
-;****************************************************************************
-;*
-;*                  SciTech Multi-platform Graphics Library
-;*
-;*  ========================================================================
-;*
-;*    The contents of this file are subject to the SciTech MGL Public
-;*    License Version 1.0 (the "License"); you may not use this file
-;*    except in compliance with the License. You may obtain a copy of
-;*    the License at http://www.scitechsoft.com/mgl-license.txt
-;*
-;*    Software distributed under the License is distributed on an
-;*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-;*    implied. See the License for the specific language governing
-;*    rights and limitations under the License.
-;*
-;*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-;*
-;*    The Initial Developer of the Original Code is SciTech Software, Inc.
-;*    All Rights Reserved.
-;*
-;*  ========================================================================
-;*
-;* Language:    80386 Assembler
-;* Environment: IBM PC (MS DOS)
-;*
-;* Description: Assembly language support routines for the event module.
-;*
-;****************************************************************************
-
-        ideal
-
-include "scitech.mac"           ; Memory model macros
-
-ifdef flatmodel
-
-header  _event                  ; Set up memory model
-
-begdataseg  _event
-
-    cextern  _EVT_biosPtr,DPTR
-
-    cpublic _EVT_dataStart
-
-ifdef   USE_NASM
-%define KB_HEAD     WORD esi+01Ah   ; Keyboard buffer head in BIOS data area
-%define KB_TAIL     WORD esi+01Ch   ; Keyboard buffer tail in BIOS data area
-%define KB_START    WORD esi+080h   ; Start of keyboard buffer in BIOS data area
-%define KB_END      WORD esi+082h   ; End of keyboard buffer in BIOS data area
-else
-KB_HEAD     EQU WORD esi+01Ah       ; Keyboard buffer head in BIOS data area
-KB_TAIL     EQU WORD esi+01Ch       ; Keyboard buffer tail in BIOS data area
-KB_START    EQU WORD esi+080h       ; Start of keyboard buffer in BIOS data area
-KB_END      EQU WORD esi+082h       ; End of keyboard buffer in BIOS data area
-endif
-
-    cpublic _EVT_dataEnd
-
-enddataseg  _event
-
-begcodeseg  _event              ; Start of code segment
-
-    cpublic _EVT_codeStart
-
-;----------------------------------------------------------------------------
-; int _EVT_getKeyCode(void)
-;----------------------------------------------------------------------------
-; Returns the key code for the next available key by extracting it from
-; the BIOS keyboard buffer.
-;----------------------------------------------------------------------------
-cprocstart  _EVT_getKeyCode
-
-        enter_c
-
-        mov     esi,[_EVT_biosPtr]
-        xor     ebx,ebx
-        xor     eax,eax
-        mov     bx,[KB_HEAD]
-        cmp     bx,[KB_TAIL]
-        jz      @@Done
-        xor     eax,eax
-        mov     ax,[esi+ebx]    ; EAX := character from keyboard buffer
-        inc     _bx
-        inc     _bx
-        cmp     bx,[KB_END]     ; Hit the end of the keyboard buffer?
-        jl      @@1
-        mov     bx,[KB_START]
-@@1:    mov     [KB_HEAD],bx    ; Update keyboard buffer head pointer
-
-@@Done: leave_c
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; int _EVT_disableInt(void);
-;----------------------------------------------------------------------------
-; Return processor interrupt status and disable interrupts.
-;----------------------------------------------------------------------------
-cprocstart  _EVT_disableInt
-
-        pushf                   ; Put flag word on stack
-        cli                     ; Disable interrupts!
-        pop     eax             ; deposit flag word in return register
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void _EVT_restoreInt(int ps);
-;----------------------------------------------------------------------------
-; Restore processor interrupt status.
-;----------------------------------------------------------------------------
-cprocstart  _EVT_restoreInt
-
-        ARG     ps:UINT
-
-        push    ebp
-        mov     ebp,esp         ; Set up stack frame
-        push    [DWORD ps]
-        popf                    ; Restore processor status (and interrupts)
-        pop     ebp
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; int EVT_rdinx(int port,int index)
-;----------------------------------------------------------------------------
-; Reads an indexed register value from an I/O port.
-;----------------------------------------------------------------------------
-cprocstart  EVT_rdinx
-
-        ARG     port:UINT, index:UINT
-
-        push    ebp
-        mov     ebp,esp
-        mov     edx,[port]
-        mov     al,[BYTE index]
-        out     dx,al
-        inc     dx
-        in      al,dx
-        movzx   eax,al
-        pop     ebp
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void EVT_wrinx(int port,int index,int value)
-;----------------------------------------------------------------------------
-; Writes an indexed register value to an I/O port.
-;----------------------------------------------------------------------------
-cprocstart  EVT_wrinx
-
-        ARG     port:UINT, index:UINT, value:UINT
-
-        push    ebp
-        mov     ebp,esp
-        mov     edx,[port]
-        mov     al,[BYTE index]
-        mov     ah,[BYTE value]
-        out     dx,ax
-        pop     ebp
-        ret
-
-cprocend
-
-    cpublic _EVT_codeEnd
-
-endcodeseg  _event
-
-endif
-
-        END                         ; End of module
diff --git a/board/MAI/bios_emulator/scitech/src/pm/smx/_lztimer.asm b/board/MAI/bios_emulator/scitech/src/pm/smx/_lztimer.asm
deleted file mode 100644 (file)
index 068eea6..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-;****************************************************************************
-;*
-;*                  SciTech OS Portability Manager Library
-;*
-;*  ========================================================================
-;*
-;*    The contents of this file are subject to the SciTech MGL Public
-;*    License Version 1.0 (the "License"); you may not use this file
-;*    except in compliance with the License. You may obtain a copy of
-;*    the License at http://www.scitechsoft.com/mgl-license.txt
-;*
-;*    Software distributed under the License is distributed on an
-;*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-;*    implied. See the License for the specific language governing
-;*    rights and limitations under the License.
-;*
-;*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-;*
-;*    The Initial Developer of the Original Code is SciTech Software, Inc.
-;*    All Rights Reserved.
-;*
-;*  ========================================================================
-;*
-;* Language:    NASM or TASM Assembler
-;* Environment: smx 32 bit intel CPU
-;*
-;* Description: SMX does not support 486's, so this module is not necessary.
-;*
-;*  All registers and all flags are preserved by all routines, except
-;*  interrupts which are always turned on
-;*
-;****************************************************************************
-
-        IDEAL
-
-include "scitech.mac"
-
-header      _lztimer
-
-begdataseg  _lztimer
-
-enddataseg  _lztimer
-
-begcodeseg  _lztimer                ; Start of code segment
-
-cprocstart   LZ_disable
-        cli
-        ret
-cprocend
-
-cprocstart   LZ_enable
-        sti
-        ret
-cprocend
-
-endcodeseg  _lztimer
-
-        END
diff --git a/board/MAI/bios_emulator/scitech/src/pm/smx/_pm.asm b/board/MAI/bios_emulator/scitech/src/pm/smx/_pm.asm
deleted file mode 100644 (file)
index 1c7cb21..0000000
+++ /dev/null
@@ -1,448 +0,0 @@
-;****************************************************************************
-;*
-;*                  SciTech OS Portability Manager Library
-;*
-;*  ========================================================================
-;*
-;*    The contents of this file are subject to the SciTech MGL Public
-;*    License Version 1.0 (the "License"); you may not use this file
-;*    except in compliance with the License. You may obtain a copy of
-;*    the License at http://www.scitechsoft.com/mgl-license.txt
-;*
-;*    Software distributed under the License is distributed on an
-;*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-;*    implied. See the License for the specific language governing
-;*    rights and limitations under the License.
-;*
-;*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-;*
-;*    The Initial Developer of the Original Code is SciTech Software, Inc.
-;*    All Rights Reserved.
-;*
-;*  ========================================================================
-;*
-;* Language:    80386 Assembler, TASM 4.0 or NASM
-;* Environment: 32-bit SMX embedded systems development
-;*
-;* Description: Low level assembly support for the PM library specific to
-;*              SMX.
-;*
-;****************************************************************************
-
-        IDEAL
-
-include "scitech.mac"               ; Memory model macros
-
-header      _pm                     ; Set up memory model
-
-begdataseg  _pm
-
-    cextern _PM_savedDS,USHORT
-
-intel_id        db  "GenuineIntel"  ; Intel vendor ID
-
-enddataseg  _pm
-
-begcodeseg  _pm                 ; Start of code segment
-
-;----------------------------------------------------------------------------
-; void PM_segread(PMSREGS *sregs)
-;----------------------------------------------------------------------------
-; Read the current value of all segment registers
-;----------------------------------------------------------------------------
-cprocstartdll16 PM_segread
-
-        ARG     sregs:DPTR
-
-        enter_c
-
-        mov     ax,es
-        _les    _si,[sregs]
-        mov     [_ES _si],ax
-        mov     [_ES _si+2],cs
-        mov     [_ES _si+4],ss
-        mov     [_ES _si+6],ds
-        mov     [_ES _si+8],fs
-        mov     [_ES _si+10],gs
-
-        leave_c
-        ret
-
-cprocend
-
-; Create a table of the 256 different interrupt calls that we can jump
-; into
-
-ifdef   USE_NASM
-
-%assign intno 0
-
-intTable:
-%rep    256
-        db      0CDh
-        db      intno
-%assign intno   intno + 1
-        ret
-        nop
-%endrep
-
-else
-
-intno = 0
-
-intTable:
-        REPT    256
-        db      0CDh
-        db      intno
-intno = intno + 1
-        ret
-        nop
-        ENDM
-
-endif
-
-;----------------------------------------------------------------------------
-; _PM_genInt    - Generate the appropriate interrupt
-;----------------------------------------------------------------------------
-cprocnear   _PM_genInt
-
-        push    _ax                     ; Save _ax
-        push    _bx                     ; Save _bx
-        mov     ebx,[UINT esp+12]       ; EBX := interrupt number
-        mov     _ax,offset intTable     ; Point to interrupt generation table
-        shl     _bx,2                   ; _BX := index into table
-        add     _ax,_bx                 ; _AX := pointer to interrupt code
-        xchg    eax,[esp+4]             ; Restore eax, and set for int
-        pop     _bx                     ; restore _bx
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; int PM_int386x(int intno, PMREGS *in, PMREGS *out,PMSREGS *sregs)
-;----------------------------------------------------------------------------
-; Issues a software interrupt in protected mode. This routine has been
-; written to allow user programs to load CS and DS with different values
-; other than the default.
-;----------------------------------------------------------------------------
-cprocstartdll16 PM_int386x
-
-        ARG     intno:UINT, inptr:DPTR, outptr:DPTR, sregs:DPTR
-
-        LOCAL   flags:UINT, sv_ds:UINT, sv_esi:ULONG = LocalSize
-
-        enter_c
-        push    ds
-        push    es                  ; Save segment registers
-        push    fs
-        push    gs
-
-        _lds    _si,[sregs]         ; DS:_SI -> Load segment registers
-        mov     es,[_si]
-        mov     bx,[_si+6]
-        mov     [sv_ds],_bx         ; Save value of user DS on stack
-        mov     fs,[_si+8]
-        mov     gs,[_si+10]
-
-        _lds    _si,[inptr]         ; Load CPU registers
-        mov     eax,[_si]
-        mov     ebx,[_si+4]
-        mov     ecx,[_si+8]
-        mov     edx,[_si+12]
-        mov     edi,[_si+20]
-        mov     esi,[_si+16]
-
-        push    ds                  ; Save value of DS
-        push    _bp                 ; Some interrupts trash this!
-        clc                         ; Generate the interrupt
-        push    [UINT intno]
-        mov     ds,[WORD sv_ds]     ; Set value of user's DS selector
-        call    _PM_genInt
-        pop     _bp                 ; Pop intno from stack (flags unchanged)
-        pop     _bp                 ; Restore value of stack frame pointer
-        pop     ds                  ; Restore value of DS
-
-        pushf                       ; Save flags for later
-        pop     [UINT flags]
-        push    esi                 ; Save ESI for later
-        pop     [DWORD sv_esi]
-        push    ds                  ; Save DS for later
-        pop     [UINT sv_ds]
-
-        _lds    _si,[outptr]        ; Save CPU registers
-        mov     [_si],eax
-        mov     [_si+4],ebx
-        mov     [_si+8],ecx
-        mov     [_si+12],edx
-        push    [DWORD sv_esi]
-        pop     [DWORD _si+16]
-        mov     [_si+20],edi
-
-        mov     _bx,[flags]         ; Return flags
-        and     ebx,1h              ; Isolate carry flag
-        mov     [_si+24],ebx        ; Save carry flag status
-
-        _lds    _si,[sregs]         ; Save segment registers
-        mov     [_si],es
-        mov     _bx,[sv_ds]
-        mov     [_si+6],bx          ; Get returned DS from stack
-        mov     [_si+8],fs
-        mov     [_si+10],gs
-
-        pop     gs                  ; Restore segment registers
-        pop     fs
-        pop     es
-        pop     ds
-        leave_c
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void PM_saveDS(void)
-;----------------------------------------------------------------------------
-; Save the value of DS into a section of the code segment, so that we can
-; quickly load this value at a later date in the PM_loadDS() routine from
-; inside interrupt handlers etc. The method to do this is different
-; depending on the DOS extender being used.
-;----------------------------------------------------------------------------
-cprocstartdll16 PM_saveDS
-
-        mov     [_PM_savedDS],ds    ; Store away in data segment
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void PM_loadDS(void)
-;----------------------------------------------------------------------------
-; Routine to load the DS register with the default value for the current
-; DOS extender. Only the DS register is loaded, not the ES register, so
-; if you wish to call C code, you will need to also load the ES register
-; in 32 bit protected mode.
-;----------------------------------------------------------------------------
-cprocstartdll16 PM_loadDS
-
-        mov     ds,[cs:_PM_savedDS] ; We can access the proper DS through CS
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void PM_setBankA(int bank)
-;----------------------------------------------------------------------------
-cprocstart      PM_setBankA
-
-        ARG     bank:UINT
-
-        push    ebp
-        mov     ebp,esp
-        push    ebx
-        mov     _bx,0
-        mov     _ax,4F05h
-        mov     _dx,[bank]
-        int     10h
-        pop     ebx
-        pop     ebp
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void PM_setBankAB(int bank)
-;----------------------------------------------------------------------------
-cprocstart      PM_setBankAB
-
-        ARG     bank:UINT
-
-        push    ebp
-        mov     ebp,esp
-        push    ebx
-        mov     _bx,0
-        mov     _ax,4F05h
-        mov     _dx,[bank]
-        int     10h
-        mov     _bx,1
-        mov     _ax,4F05h
-        mov     _dx,[bank]
-        int     10h
-        pop     ebx
-        pop     ebp
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void PM_setCRTStart(int x,int y,int waitVRT)
-;----------------------------------------------------------------------------
-cprocstart      PM_setCRTStart
-
-        ARG     x:UINT, y:UINT, waitVRT:UINT
-
-        push    ebp
-        mov     ebp,esp
-        push    ebx
-        mov     _bx,[waitVRT]
-        mov     _cx,[x]
-        mov     _dx,[y]
-        mov     _ax,4F07h
-        int     10h
-        pop     ebx
-        pop     ebp
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; int _PM_inp(int port)
-;----------------------------------------------------------------------------
-; Reads a byte from the specified port
-;----------------------------------------------------------------------------
-cprocstart  _PM_inp
-
-        ARG     port:UINT
-
-        push    _bp
-        mov     _bp,_sp
-        xor     _ax,_ax
-        mov     _dx,[port]
-        in      al,dx
-        pop     _bp
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void _PM_outp(int port,int value)
-;----------------------------------------------------------------------------
-; Write a byte to the specified port.
-;----------------------------------------------------------------------------
-cprocstart  _PM_outp
-
-        ARG     port:UINT, value:UINT
-
-        push    _bp
-        mov     _bp,_sp
-        mov     _dx,[port]
-        mov     _ax,[value]
-        out     dx,al
-        pop     _bp
-        ret
-
-cprocend
-
-; Macro to delay briefly to ensure that enough time has elapsed between
-; successive I/O accesses so that the device being accessed can respond
-; to both accesses even on a very fast PC.
-
-ifdef   USE_NASM
-%macro  DELAY 0
-        jmp     short $+2
-        jmp     short $+2
-        jmp     short $+2
-%endmacro
-%macro  IODELAYN 1
-%rep    %1
-        DELAY
-%endrep
-%endmacro
-else
-macro   DELAY
-        jmp     short $+2
-        jmp     short $+2
-        jmp     short $+2
-endm
-macro   IODELAYN    N
-    rept    N
-        DELAY
-    endm
-endm
-endif
-
-;----------------------------------------------------------------------------
-; uchar _PM_readCMOS(int index)
-;----------------------------------------------------------------------------
-; Read the value of a specific CMOS register. We do this with both
-; normal interrupts and NMI disabled.
-;----------------------------------------------------------------------------
-cprocstart  _PM_readCMOS
-
-        ARG     index:UINT
-
-        push    _bp
-        mov     _bp,_sp
-        pushfd
-        mov     al,[BYTE index]
-        or      al,80h              ; Add disable NMI flag
-        cli
-        out     70h,al
-        IODELAYN 5
-        in      al,71h
-        mov     ah,al
-        xor     al,al
-        IODELAYN 5
-        out     70h,al              ; Re-enable NMI
-        sti
-        mov     al,ah               ; Return value in AL
-        popfd
-        pop     _bp
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void _PM_writeCMOS(int index,uchar value)
-;----------------------------------------------------------------------------
-; Read the value of a specific CMOS register. We do this with both
-; normal interrupts and NMI disabled.
-;----------------------------------------------------------------------------
-cprocstart  _PM_writeCMOS
-
-        ARG     index:UINT, value:UCHAR
-
-        push    _bp
-        mov     _bp,_sp
-        pushfd
-        mov     al,[BYTE index]
-        or      al,80h              ; Add disable NMI flag
-        cli
-        out     70h,al
-        IODELAYN 5
-        mov     al,[value]
-        out     71h,al
-        xor     al,al
-        IODELAYN 5
-        out     70h,al              ; Re-enable NMI
-        sti
-        popfd
-        pop     _bp
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; _PM_getPDB - Return the Page Table Directory Base address
-;----------------------------------------------------------------------------
-cprocstart  _PM_getPDB
-
-        mov     eax,cr3
-        and     eax,0FFFFF000h
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; _PM_flushTLB - Flush the Translation Lookaside buffer
-;----------------------------------------------------------------------------
-cprocstart  PM_flushTLB
-
-        wbinvd                  ; Flush the CPU cache
-        mov     eax,cr3         
-        mov     cr3,eax         ; Flush the TLB
-        ret
-
-cprocend
-
-endcodeseg  _pm
-
-        END                     ; End of module
diff --git a/board/MAI/bios_emulator/scitech/src/pm/smx/_pmsmx.asm b/board/MAI/bios_emulator/scitech/src/pm/smx/_pmsmx.asm
deleted file mode 100644 (file)
index 8352ce3..0000000
+++ /dev/null
@@ -1,933 +0,0 @@
-;****************************************************************************
-;*
-;*                  SciTech OS Portability Manager Library
-;*
-;*  ========================================================================
-;*
-;*    The contents of this file are subject to the SciTech MGL Public
-;*    License Version 1.0 (the "License"); you may not use this file
-;*    except in compliance with the License. You may obtain a copy of
-;*    the License at http://www.scitechsoft.com/mgl-license.txt
-;*
-;*    Software distributed under the License is distributed on an
-;*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-;*    implied. See the License for the specific language governing
-;*    rights and limitations under the License.
-;*
-;*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-;*
-;*    The Initial Developer of the Original Code is SciTech Software, Inc.
-;*    All Rights Reserved.
-;*
-;*  ========================================================================
-;*
-;* Language:    80386 Assembler, TASM 4.0 or NASM
-;* Environment: 32-bit SMX embedded systems development
-;*
-;* Description: Low level assembly support for the PM library specific to
-;*              SMX interrupt handling.
-;*
-;****************************************************************************
-
-        IDEAL
-
-include "scitech.mac"           ; Memory model macros
-
-header      _pmsmx              ; Set up memory model
-
-; Define the size of our local stacks. For real mode code they cant be
-; that big, but for 32 bit protected mode code we can make them nice and
-; large so that complex C functions can be used.
-
-MOUSE_STACK EQU 4096
-TIMER_STACK EQU 4096
-KEY_STACK   EQU 1024
-INT10_STACK EQU 1024
-
-ifdef   USE_NASM
-
-; Macro to load DS and ES registers with correct value.
-
-%imacro   LOAD_DS 0
-        mov     ds,[cs:_PM_savedDS]
-        mov     es,[cs:_PM_savedDS]
-%endmacro
-
-; Note that interrupts we disable interrupts during the following stack
-; %imacro for correct operation, but we do not enable them again. Normally
-; these %imacros are used within interrupt handlers so interrupts should
-; already be off. We turn them back on explicitly later if the user code
-; needs them to be back on.
-
-; Macro to switch to a new local stack.
-
-%imacro NEWSTK  1
-        cli
-        mov     [seg_%1],ss
-        mov     [ptr_%1],_sp
-        mov     [TempSeg],ds
-        mov     ss,[TempSeg]
-        mov     _sp,offset %1
-%endmacro
-
-; %imacro to switch back to the old stack.
-
-%imacro   RESTSTK   1
-        cli
-        mov     ss,[seg_%1]
-        mov     _sp,[ptr_%1]
-%endmacro
-
-; %imacro to swap the current stack with the one saved away.
-
-%imacro SWAPSTK 1
-        cli
-        mov     ax,ss
-        xchg    ax,[seg_%1]
-        mov     ss,ax
-        xchg    _sp,[ptr_%1]
-%endmacro
-
-else
-
-; Macro to load DS and ES registers with correct value.
-
-MACRO   LOAD_DS
-        mov     ds,[cs:_PM_savedDS]
-        mov     es,[cs:_PM_savedDS]
-ENDM
-
-; Note that interrupts we disable interrupts during the following stack
-; macro for correct operation, but we do not enable them again. Normally
-; these macros are used within interrupt handlers so interrupts should
-; already be off. We turn them back on explicitly later if the user code
-; needs them to be back on.
-
-; Macro to switch to a new local stack.
-
-MACRO   NEWSTK  stkname
-        cli
-        mov     [seg_&stkname&],ss
-        mov     [ptr_&stkname&],_sp
-        mov     [TempSeg],ds
-        mov     ss,[TempSeg]
-        mov     _sp,offset stkname
-ENDM
-
-; Macro to switch back to the old stack.
-
-MACRO   RESTSTK stkname
-        cli
-        mov     ss,[seg_&stkname&]
-        mov     _sp,[ptr_&stkname&]
-ENDM
-
-; Macro to swap the current stack with the one saved away.
-
-MACRO   SWAPSTK stkname
-        cli
-        mov     ax,ss
-        xchg    ax,[seg_&stkname&]
-        mov     ss,ax
-        xchg    _sp,[ptr_&stkname&]
-ENDM
-
-endif
-
-begdataseg  _pmsmx
-
-    cextern _PM_savedDS,USHORT
-    cextern _PM_critHandler,CPTR
-    cextern _PM_breakHandler,CPTR
-    cextern _PM_timerHandler,CPTR
-    cextern _PM_rtcHandler,CPTR
-    cextern _PM_keyHandler,CPTR
-    cextern _PM_key15Handler,CPTR
-    cextern _PM_mouseHandler,CPTR
-    cextern _PM_int10Handler,CPTR
-
-    cextern _PM_ctrlCPtr,DPTR
-    cextern _PM_ctrlBPtr,DPTR
-    cextern _PM_critPtr,DPTR
-
-    cextern _PM_prevTimer,FCPTR
-    cextern _PM_prevRTC,FCPTR
-    cextern _PM_prevKey,FCPTR
-    cextern _PM_prevKey15,FCPTR
-    cextern _PM_prevBreak,FCPTR
-    cextern _PM_prevCtrlC,FCPTR
-    cextern _PM_prevCritical,FCPTR
-    cextern _PM_prevRealTimer,ULONG
-    cextern _PM_prevRealRTC,ULONG
-    cextern _PM_prevRealKey,ULONG
-    cextern _PM_prevRealKey15,ULONG
-    cextern _PM_prevRealInt10,ULONG
-
-cpublic _PM_pmsmxDataStart
-
-; Allocate space for all of the local stacks that we need. These stacks
-; are not very large, but should be large enough for most purposes
-; (generally you want to handle these interrupts quickly, simply storing
-; the information for later and then returning). If you need bigger
-; stacks then change the appropriate value in here.
-
-            ALIGN   4
-            dclb MOUSE_STACK    ; Space for local stack (small)
-MsStack:                        ; Stack starts at end!
-ptr_MsStack DUINT   0           ; Place to store old stack offset
-seg_MsStack dw      0           ; Place to store old stack segment
-
-            ALIGN   4
-            dclb INT10_STACK    ; Space for local stack (small)
-Int10Stack:                     ; Stack starts at end!
-ptr_Int10Stack  DUINT   0       ; Place to store old stack offset
-seg_Int10Stack  dw      0       ; Place to store old stack segment
-
-            ALIGN   4
-            dclb TIMER_STACK    ; Space for local stack (small)
-TmStack:                        ; Stack starts at end!
-ptr_TmStack DUINT   0           ; Place to store old stack offset
-seg_TmStack dw      0           ; Place to store old stack segment
-
-            ALIGN   4
-            dclb TIMER_STACK    ; Space for local stack (small)
-RtcStack:                       ; Stack starts at end!
-ptr_RtcStack DUINT  0           ; Place to store old stack offset
-seg_RtcStack dw     0           ; Place to store old stack segment
-RtcInside   dw      0           ; Are we still handling current interrupt
-
-            ALIGN   4
-            dclb KEY_STACK      ; Space for local stack (small)
-KyStack:                        ; Stack starts at end!
-ptr_KyStack DUINT   0           ; Place to store old stack offset
-seg_KyStack dw      0           ; Place to store old stack segment
-KyInside    dw      0           ; Are we still handling current interrupt
-
-            ALIGN   4
-            dclb KEY_STACK      ; Space for local stack (small)
-Ky15Stack:                      ; Stack starts at end!
-ptr_Ky15Stack   DUINT   0       ; Place to store old stack offset
-seg_Ky15Stack   dw      0       ; Place to store old stack segment
-
-TempSeg     dw      0           ; Place to store stack segment
-
-cpublic _PM_pmsmxDataEnd
-
-enddataseg  _pmsmx
-
-begcodeseg  _pmsmx              ; Start of code segment
-
-cpublic _PM_pmsmxCodeStart
-
-;----------------------------------------------------------------------------
-; PM_mouseISR - Mouse interrupt subroutine dispatcher
-;----------------------------------------------------------------------------
-; Interrupt subroutine called by the mouse driver upon interrupts, to
-; dispatch control to high level C based subroutines. Interrupts are on
-; when we call the user code.
-;
-; It is _extremely_ important to save the state of the extended registers
-; as these may well be trashed by the routines called from here and not
-; restored correctly by the mouse interface module.
-;
-; NOTE: This routine switches to a local stack before calling any C code,
-;       and hence is _not_ re-entrant. For mouse handlers this is not a
-;       problem, as the mouse driver arbitrates calls to the user mouse
-;       handler for us.
-;
-; Entry:    AX  - Condition mask giving reason for call
-;           BX  - Mouse button state
-;           CX  - Horizontal cursor coordinate
-;           DX  - Vertical cursor coordinate
-;           SI  - Horizontal mickey value
-;           DI  - Vertical mickey value
-;
-;----------------------------------------------------------------------------
-cprocfar    _PM_mouseISR
-
-        push    ds              ; Save value of DS
-        push    es
-        pushad                  ; Save _all_ extended registers
-        cld                     ; Clear direction flag
-
-        LOAD_DS                 ; Load DS register
-        NEWSTK  MsStack         ; Switch to local stack
-
-; Call the installed high level C code routine
-
-        clrhi   dx              ; Clear out high order values
-        clrhi   cx
-        clrhi   bx
-        clrhi   ax
-        sgnhi   si
-        sgnhi   di
-
-        push    _di
-        push    _si
-        push    _dx
-        push    _cx
-        push    _bx
-        push    _ax
-        sti                     ; Enable interrupts
-        call    [CPTR _PM_mouseHandler]
-        _add    sp,12,24
-
-        RESTSTK MsStack         ; Restore previous stack
-
-        popad                   ; Restore all extended registers
-        pop     es
-        pop     ds
-        ret                     ; We are done!!
-
-cprocend
-
-;----------------------------------------------------------------------------
-; PM_timerISR - Timer interrupt subroutine dispatcher
-;----------------------------------------------------------------------------
-; Hardware interrupt handler for the timer interrupt, to dispatch control
-; to high level C based subroutines. We save the state of all registers
-; in this routine, and switch to a local stack. Interrupts are *off*
-; when we call the user code.
-;
-; NOTE: This routine switches to a local stack before calling any C code,
-;       and hence is _not_ re-entrant. Make sure your C code executes as
-;       quickly as possible, since a timer overrun will simply hang the
-;       system.
-;----------------------------------------------------------------------------
-cprocfar    _PM_timerISR
-
-        push    ds              ; Save value of DS
-        push    es
-        pushad                  ; Save _all_ extended registers
-        cld                     ; Clear direction flag
-
-        LOAD_DS                 ; Load DS register
-
-        NEWSTK  TmStack         ; Switch to local stack
-        call    [CPTR _PM_timerHandler]
-        RESTSTK TmStack         ; Restore previous stack
-
-        popad                   ; Restore all extended registers
-        pop     es
-        pop     ds
-        iret                    ; Return from interrupt
-
-cprocend
-
-;----------------------------------------------------------------------------
-; PM_chainPrevTimer - Chain to previous timer interrupt and return
-;----------------------------------------------------------------------------
-; Chains to the previous timer interrupt routine and returns control
-; back to the high level interrupt handler.
-;----------------------------------------------------------------------------
-cprocstart  PM_chainPrevTimer
-
-ifdef   TNT
-        push    eax
-        push    ebx
-        push    ecx
-        pushfd                  ; Push flags on stack to simulate interrupt
-        mov     ax,250Eh        ; Call real mode procedure function
-        mov     ebx,[_PM_prevRealTimer]
-        mov     ecx,1           ; Copy real mode flags to real mode stack
-        int     21h             ; Call the real mode code
-        popfd
-        pop     ecx
-        pop     ebx
-        pop     eax
-        ret
-else
-        SWAPSTK TmStack         ; Swap back to previous stack
-        pushf                   ; Save state of interrupt flag
-        pushf                   ; Push flags on stack to simulate interrupt
-ifdef   USE_NASM
-        call far dword [_PM_prevTimer]
-else
-        call    [_PM_prevTimer]
-endif
-        popf                    ; Restore state of interrupt flag
-        SWAPSTK TmStack         ; Swap back to C stack again
-        ret
-endif
-
-cprocend
-
-; Macro to delay briefly to ensure that enough time has elapsed between
-; successive I/O accesses so that the device being accessed can respond
-; to both accesses even on a very fast PC.
-
-ifdef   USE_NASM
-%macro  DELAY 0
-        jmp     short $+2
-        jmp     short $+2
-        jmp     short $+2
-%endmacro
-%macro  IODELAYN 1
-%rep    %1
-        DELAY
-%endrep
-%endmacro
-else
-macro   DELAY
-        jmp     short $+2
-        jmp     short $+2
-        jmp     short $+2
-endm
-macro   IODELAYN    N
-    rept    N
-        DELAY
-    endm
-endm
-endif
-
-;----------------------------------------------------------------------------
-; PM_rtcISR - Real time clock interrupt subroutine dispatcher
-;----------------------------------------------------------------------------
-; Hardware interrupt handler for the timer interrupt, to dispatch control
-; to high level C based subroutines. We save the state of all registers
-; in this routine, and switch to a local stack. Interrupts are *off*
-; when we call the user code.
-;
-; NOTE: This routine switches to a local stack before calling any C code,
-;       and hence is _not_ re-entrant. Make sure your C code executes as
-;       quickly as possible, since a timer overrun will simply hang the
-;       system.
-;----------------------------------------------------------------------------
-cprocfar    _PM_rtcISR
-
-        push    ds                  ; Save value of DS
-        push    es
-        pushad                      ; Save _all_ extended registers
-        cld                         ; Clear direction flag
-
-; Clear priority interrupt controller and re-enable interrupts so we
-; dont lock things up for long.
-
-        mov     al,20h
-        out     0A0h,al
-        out     020h,al
-
-; Clear real-time clock timeout
-
-        in      al,70h              ; Read CMOS index register
-        push    _ax                 ;  and save for later
-        IODELAYN 3
-        mov     al,0Ch
-        out     70h,al
-        IODELAYN 5
-        in      al,71h
-
-; Call the C interrupt handler function
-
-        LOAD_DS                     ; Load DS register
-        cmp     [BYTE RtcInside],1  ; Check for mutual exclusion
-        je      @@Exit
-        mov     [BYTE RtcInside],1
-        sti                         ; Re-enable interrupts
-        NEWSTK  RtcStack            ; Switch to local stack
-        call    [CPTR _PM_rtcHandler]
-        RESTSTK RtcStack            ; Restore previous stack
-        mov     [BYTE RtcInside],0
-
-@@Exit: pop     _ax
-        out     70h,al              ; Restore CMOS index register
-        popad                       ; Restore all extended registers
-        pop     es
-        pop     ds
-        iret                        ; Return from interrupt
-
-cprocend
-
-;----------------------------------------------------------------------------
-; PM_keyISR - keyboard interrupt subroutine dispatcher
-;----------------------------------------------------------------------------
-; Hardware interrupt handler for the keyboard interrupt, to dispatch control
-; to high level C based subroutines. We save the state of all registers
-; in this routine, and switch to a local stack. Interrupts are *off*
-; when we call the user code.
-;
-; NOTE: This routine switches to a local stack before calling any C code,
-;       and hence is _not_ re-entrant. However we ensure within this routine
-;       mutual exclusion to the keyboard handling routine.
-;----------------------------------------------------------------------------
-cprocfar    _PM_keyISR
-
-        push    ds              ; Save value of DS
-        push    es
-        pushad                  ; Save _all_ extended registers
-        cld                     ; Clear direction flag
-
-        LOAD_DS                 ; Load DS register
-
-        cmp     [BYTE KyInside],1   ; Check for mutual exclusion
-        je      @@Reissued
-
-        mov     [BYTE KyInside],1
-        NEWSTK  KyStack         ; Switch to local stack
-        call    [CPTR _PM_keyHandler]   ; Call C code
-        RESTSTK KyStack         ; Restore previous stack
-        mov     [BYTE KyInside],0
-
-@@Exit: popad                   ; Restore all extended registers
-        pop     es
-        pop     ds
-        iret                    ; Return from interrupt
-
-; When the BIOS keyboard handler needs to change the SHIFT status lights
-; on the keyboard, in the process of doing this the keyboard controller
-; re-issues another interrupt, while the current handler is still executing.
-; If we recieve another interrupt while still handling the current one,
-; then simply chain directly to the previous handler.
-;
-; Note that for most DOS extenders, the real mode interrupt handler that we
-; install takes care of this for us.
-
-@@Reissued:
-ifdef   TNT
-        push    eax
-        push    ebx
-        push    ecx
-        pushfd                  ; Push flags on stack to simulate interrupt
-        mov     ax,250Eh        ; Call real mode procedure function
-        mov     ebx,[_PM_prevRealKey]
-        mov     ecx,1           ; Copy real mode flags to real mode stack
-        int     21h             ; Call the real mode code
-        popfd
-        pop     ecx
-        pop     ebx
-        pop     eax
-else
-        pushf
-ifdef   USE_NASM
-        call far dword [_PM_prevKey]
-else
-        call    [_PM_prevKey]
-endif
-endif
-        jmp     @@Exit
-
-cprocend
-
-;----------------------------------------------------------------------------
-; PM_chainPrevkey - Chain to previous key interrupt and return
-;----------------------------------------------------------------------------
-; Chains to the previous key interrupt routine and returns control
-; back to the high level interrupt handler.
-;----------------------------------------------------------------------------
-cprocstart  PM_chainPrevKey
-
-ifdef   TNT
-        push    eax
-        push    ebx
-        push    ecx
-        pushfd                  ; Push flags on stack to simulate interrupt
-        mov     ax,250Eh        ; Call real mode procedure function
-        mov     ebx,[_PM_prevRealKey]
-        mov     ecx,1           ; Copy real mode flags to real mode stack
-        int     21h             ; Call the real mode code
-        popfd
-        pop     ecx
-        pop     ebx
-        pop     eax
-        ret
-else
-
-; YIKES! For some strange reason, when execution returns from the
-; previous keyboard handler, interrupts are re-enabled!! Since we expect
-; interrupts to remain off during the duration of our handler, this can
-; cause havoc. However our stack macros always turn off interrupts, so they
-; will be off when we exit this routine. Obviously there is a tiny weeny
-; window when interrupts will be enabled, but there is nothing we can
-; do about this.
-
-        SWAPSTK KyStack         ; Swap back to previous stack
-        pushf                   ; Push flags on stack to simulate interrupt
-ifdef   USE_NASM
-        call far dword [_PM_prevKey]
-else
-        call    [_PM_prevKey]
-endif
-        SWAPSTK KyStack         ; Swap back to C stack again
-        ret
-endif
-
-cprocend
-
-;----------------------------------------------------------------------------
-; PM_key15ISR - Int 15h keyboard interrupt subroutine dispatcher
-;----------------------------------------------------------------------------
-; This routine gets called if we have been called to handle the Int 15h
-; keyboard interrupt callout from real mode.
-;
-;   Entry:  AX  - Hardware scan code to process
-;   Exit:   AX  - Hardware scan code to process (0 to ignore)
-;----------------------------------------------------------------------------
-cprocfar    _PM_key15ISR
-
-        push    ds
-        push    es
-        LOAD_DS
-        cmp     ah,4Fh
-        jnz     @@NotOurs       ; Quit if not keyboard callout
-
-        pushad
-        cld                     ; Clear direction flag
-        xor     ah,ah           ; AX := scan code
-        NEWSTK  Ky15Stack       ; Switch to local stack
-        push    _ax
-        call    [CPTR _PM_key15Handler] ; Call C code
-        _add    sp,2,4
-        RESTSTK Ky15Stack       ; Restore previous stack
-        test    ax,ax
-        jz      @@1
-        stc                     ; Set carry to process as normal
-        jmp     @@2
-@@1:    clc                     ; Clear carry to ignore scan code
-@@2:    popad
-        jmp     @@Exit          ; We are done
-
-@@NotOurs:
-ifdef   TNT
-        push    eax
-        push    ebx
-        push    ecx
-        pushfd                  ; Push flags on stack to simulate interrupt
-        mov     ax,250Eh        ; Call real mode procedure function
-        mov     ebx,[_PM_prevRealKey15]
-        mov     ecx,1           ; Copy real mode flags to real mode stack
-        int     21h             ; Call the real mode code
-        popfd
-        pop     ecx
-        pop     ebx
-        pop     eax
-else
-        pushf
-ifdef   USE_NASM
-        call far dword [_PM_prevKey15]
-else
-        call    [_PM_prevKey15]
-endif
-endif
-@@Exit: pop     es
-        pop     ds
-        retf    4
-
-cprocend
-
-;----------------------------------------------------------------------------
-; PM_breakISR - Control Break interrupt subroutine dispatcher
-;----------------------------------------------------------------------------
-; Hardware interrupt handler for the Ctrl-Break interrupt. We simply set
-; the Ctrl-Break flag to a 1 and leave (note that this is accessed through
-; a far pointer, as it may well be located in conventional memory).
-;----------------------------------------------------------------------------
-cprocfar    _PM_breakISR
-
-        sti
-        push    ds              ; Save value of DS
-        push    es
-        push    _bx
-
-        LOAD_DS                 ; Load DS register
-        mov     ebx,[_PM_ctrlBPtr]
-        mov     [UINT _ES _bx],1
-
-; Run alternate break handler code if installed
-
-        cmp     [CPTR _PM_breakHandler],0
-        je      @@Exit
-
-        pushad
-        mov     _ax,1
-        push    _ax
-        call    [CPTR _PM_breakHandler] ; Call C code
-        pop     _ax
-        popad
-
-@@Exit: pop     _bx
-        pop     es
-        pop     ds
-        iret                    ; Return from interrupt
-
-cprocend
-
-;----------------------------------------------------------------------------
-; int PM_ctrlBreakHit(int clearFlag)
-;----------------------------------------------------------------------------
-; Returns the current state of the Ctrl-Break flag and possibly clears it.
-;----------------------------------------------------------------------------
-cprocstart  PM_ctrlBreakHit
-
-        ARG     clearFlag:UINT
-
-        enter_c
-        pushf                   ; Save interrupt status
-        push    es
-        mov     ebx,[_PM_ctrlBPtr]
-        cli                     ; No interrupts thanks!
-        mov     _ax,[_ES _bx]
-        test    [BYTE clearFlag],1
-        jz      @@Done
-        mov     [UINT _ES _bx],0
-
-@@Done: pop     es
-        popf                    ; Restore interrupt status
-        leave_c
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; PM_ctrlCISR - Control Break interrupt subroutine dispatcher
-;----------------------------------------------------------------------------
-; Hardware interrupt handler for the Ctrl-C interrupt. We simply set
-; the Ctrl-C flag to a 1 and leave (note that this is accessed through
-; a far pointer, as it may well be located in conventional memory).
-;----------------------------------------------------------------------------
-cprocfar    _PM_ctrlCISR
-
-        sti
-        push    ds              ; Save value of DS
-        push    es
-        push    _bx
-
-        LOAD_DS                 ; Load DS register
-        mov     ebx,[_PM_ctrlCPtr]
-        mov     [UINT _ES _bx],1
-
-; Run alternate break handler code if installed
-
-        cmp     [CPTR _PM_breakHandler],0
-        je      @@Exit
-
-        pushad
-        mov     _ax,0
-        push    _ax
-        call    [CPTR _PM_breakHandler] ; Call C code
-        pop     _ax
-        popad
-
-@@Exit: pop     _bx
-        pop     es
-        pop     ds
-        iret                    ; Return from interrupt
-        iretd
-
-cprocend
-
-;----------------------------------------------------------------------------
-; int PM_ctrlCHit(int clearFlag)
-;----------------------------------------------------------------------------
-; Returns the current state of the Ctrl-C flag and possibly clears it.
-;----------------------------------------------------------------------------
-cprocstart  PM_ctrlCHit
-
-        ARG     clearFlag:UINT
-
-        enter_c
-        pushf                   ; Save interrupt status
-        push    es
-        mov     ebx,[_PM_ctrlCPtr]
-        cli                     ; No interrupts thanks!
-        mov     _ax,[_ES _bx]
-        test    [BYTE clearFlag],1
-        jz      @@Done
-        mov     [UINT _ES _bx],0
-
-@@Done:
-        pop     es
-        popf                    ; Restore interrupt status
-        leave_c
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; PM_criticalISR - Control Error handler interrupt subroutine dispatcher
-;----------------------------------------------------------------------------
-; Interrupt handler for the MSDOS Critical Error interrupt, to dispatch
-; control to high level C based subroutines. We save the state of all
-; registers in this routine, and switch to a local stack. We also pass
-; the values of the AX and DI registers to the as pointers, so that the
-; values can be modified before returning to MSDOS.
-;----------------------------------------------------------------------------
-cprocfar    _PM_criticalISR
-
-        sti
-        push    ds              ; Save value of DS
-        push    es
-        push    _bx             ; Save register values changed
-        cld                     ; Clear direction flag
-
-        LOAD_DS                 ; Load DS register
-        mov     ebx,[_PM_critPtr]
-        mov     [_ES _bx],ax
-        mov     [_ES _bx+2],di
-
-; Run alternate critical handler code if installed
-
-        cmp     [CPTR _PM_critHandler],0
-        je      @@NoAltHandler
-
-        pushad
-        push    _di
-        push    _ax
-        call    [CPTR _PM_critHandler]  ; Call C code
-        _add    sp,4,8
-        popad
-
-        pop     _bx
-        pop     es
-        pop     ds
-        iret                    ; Return from interrupt
-
-@@NoAltHandler:
-        mov     ax,3            ; Tell MSDOS to fail the operation
-        pop     _bx
-        pop     es
-        pop     ds
-        iret                    ; Return from interrupt
-
-cprocend
-
-;----------------------------------------------------------------------------
-; int PM_criticalError(int *axVal,int *diVal,int clearFlag)
-;----------------------------------------------------------------------------
-; Returns the current state of the critical error flags, and the values that
-; MSDOS passed in the AX and DI registers to our handler.
-;----------------------------------------------------------------------------
-cprocstart  PM_criticalError
-
-        ARG     axVal:DPTR, diVal:DPTR, clearFlag:UINT
-
-        enter_c
-        pushf                   ; Save interrupt status
-        push    es
-        mov     ebx,[_PM_critPtr]
-        cli                     ; No interrupts thanks!
-        xor     _ax,_ax
-        xor     _di,_di
-        mov     ax,[_ES _bx]
-        mov     di,[_ES _bx+2]
-        test    [BYTE clearFlag],1
-        jz      @@NoClear
-        mov     [ULONG _ES _bx],0
-@@NoClear:
-        _les    _bx,[axVal]
-        mov     [_ES _bx],_ax
-        _les    _bx,[diVal]
-        mov     [_ES _bx],_di
-        pop     es
-        popf                    ; Restore interrupt status
-        leave_c
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void PM_setMouseHandler(int mask, PM_mouseHandler mh)
-;----------------------------------------------------------------------------
-cprocstart  _PM_setMouseHandler
-
-        ARG     mouseMask:UINT
-
-        enter_c
-        push    es
-
-        mov     ax,0Ch          ; AX := Function 12 - install interrupt sub
-        mov     _cx,[mouseMask] ; CX := mouse mask
-        mov     _dx,offset _PM_mouseISR
-        push    cs
-        pop     es              ; ES:_DX -> mouse handler
-        int     33h             ; Call mouse driver
-
-        pop     es
-        leave_c
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void PM_mousePMCB(void)
-;----------------------------------------------------------------------------
-; Mouse realmode callback routine. Upon entry to this routine, we recieve
-; the following from the DPMI server:
-;
-;   Entry:  DS:_SI  -> Real mode stack at time of call
-;           ES:_DI  -> Real mode register data structure
-;           SS:_SP  -> Locked protected mode stack to use
-;----------------------------------------------------------------------------
-cprocfar    _PM_mousePMCB
-
-        pushad
-        mov     eax,[es:_di+1Ch]    ; Load register values from real mode
-        mov     ebx,[es:_di+10h]
-        mov     ecx,[es:_di+18h]
-        mov     edx,[es:_di+14h]
-        mov     esi,[es:_di+04h]
-        mov     edi,[es:_di]
-        call    _PM_mouseISR        ; Call the mouse handler
-        popad
-
-        mov     ax,[ds:_si]
-        mov     [es:_di+2Ah],ax     ; Plug in return IP address
-        mov     ax,[ds:_si+2]
-        mov     [es:_di+2Ch],ax     ; Plug in return CS value
-        add     [WORD es:_di+2Eh],4 ; Remove return address from stack
-        iret                        ; Go back to real mode!
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void PM_int10PMCB(void)
-;----------------------------------------------------------------------------
-; int10 realmode callback routine. Upon entry to this routine, we recieve
-; the following from the DPMI server:
-;
-;   Entry:  DS:ESI  -> Real mode stack at time of call
-;           ES:EDI  -> Real mode register data structure
-;           SS:ESP  -> Locked protected mode stack to use
-;----------------------------------------------------------------------------
-cprocfar        _PM_int10PMCB
-
-        pushad
-        push    ds
-        push    es
-        push    fs
-
-        pushfd
-        pop     eax
-        mov     [es:edi+20h],ax     ; Save return flag status
-        mov     ax,[ds:esi]
-        mov     [es:edi+2Ah],ax     ; Plug in return IP address
-        mov     ax,[ds:esi+2]
-        mov     [es:edi+2Ch],ax     ; Plug in return CS value
-        add     [WORD es:edi+2Eh],4 ; Remove return address from stack
-
-; Call the install int10 handler in protected mode. This function gets called
-; with DS set to the current data selector, and ES:EDI pointing the the
-; real mode DPMI register structure at the time of the interrupt. The
-; handle must be written in assembler to be able to extract the real mode
-; register values from the structure
-
-        push    es
-        pop     fs                  ; FS:EDI -> real mode registers
-        LOAD_DS
-        NEWSTK  Int10Stack          ; Switch to local stack
-
-        call    [_PM_int10Handler]
-
-        RESTSTK Int10Stack          ; Restore previous stack
-        pop     fs
-        pop     es
-        pop     ds
-        popad
-        iret                        ; Go back to real mode!
-
-cprocend
-
-cpublic _PM_pmsmxCodeEnd
-
-endcodeseg  _pmsmx
-
-        END                     ; End of module
diff --git a/board/MAI/bios_emulator/scitech/src/pm/smx/_vflat.asm b/board/MAI/bios_emulator/scitech/src/pm/smx/_vflat.asm
deleted file mode 100644 (file)
index 34985a9..0000000
+++ /dev/null
@@ -1,652 +0,0 @@
-;****************************************************************************
-;*
-;*                  SciTech OS Portability Manager Library
-;*
-;*  ========================================================================
-;*
-;*    The contents of this file are subject to the SciTech MGL Public
-;*    License Version 1.0 (the "License"); you may not use this file
-;*    except in compliance with the License. You may obtain a copy of
-;*    the License at http://www.scitechsoft.com/mgl-license.txt
-;*
-;*    Software distributed under the License is distributed on an
-;*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-;*    implied. See the License for the specific language governing
-;*    rights and limitations under the License.
-;*
-;*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-;*
-;*    The Initial Developer of the Original Code is SciTech Software, Inc.
-;*    All Rights Reserved.
-;*
-;*  ========================================================================
-;*
-;*            Based on original code Copyright 1994 Otto Chrons
-;*
-;* Language:    80386 Assembler, TASM 4.0 or later
-;* Environment: IBM PC 32 bit protected mode
-;*
-;* Description: Low level page fault handler for virtual linear framebuffers.
-;*
-;****************************************************************************
-
-        IDEAL
-        JUMPS
-
-include "scitech.mac"           ; Memory model macros
-
-header      _vflat              ; Set up memory model
-
-VFLAT_START     EQU 0F0000000h
-VFLAT_END       EQU 0F03FFFFFh
-PAGE_PRESENT    EQU 1
-PAGE_NOTPRESENT EQU 0
-PAGE_READ       EQU 0
-PAGE_WRITE      EQU 2
-
-ifdef   DOS4GW
-
-;----------------------------------------------------------------------------
-; DOS4G/W flat linear framebuffer emulation.
-;----------------------------------------------------------------------------
-
-begdataseg  _vflat
-
-; Near pointers to the page directory base and our page tables. All of
-; this memory is always located in the first Mb of DOS memory.
-
-PDBR            dd  0               ; Page directory base register (CR3)
-accessPageAddr  dd  0
-accessPageTable dd  0
-
-; CauseWay page directory & 1st page table linear addresses.
-
-CauseWayDIRLinear dd 0
-CauseWay1stLinear dd 0
-
-; Place to store a copy of the original Page Table Directory before we
-; intialised our virtual buffer code.
-
-pageDirectory:  resd 1024           ; Saved page table directory
-
-ValidCS         dw  0               ; Valid CS for page faults
-Ring0CS         dw  0               ; Our ring 0 code selector
-LastPage        dd  0               ; Last page we mapped in
-BankFuncBuf:    resb 101            ; Place to store bank switch code
-BankFuncPtr     dd  offset BankFuncBuf
-
-INT14Gate:
-INT14Offset     dd      0           ; eip of original vector
-INT14Selector   dw      0           ; cs of original vector
-
-        cextern _PM_savedDS,USHORT
-        cextern VF_haveCauseWay,BOOL
-
-enddataseg  _vflat
-
-begcodeseg  _vflat              ; Start of code segment
-
-        cextern VF_malloc,FPTR
-
-;----------------------------------------------------------------------------
-; PF_handler64k - Page fault handler for 64k banks
-;----------------------------------------------------------------------------
-; The handler below is a 32 bit ring 0 page fault handler.  It receives
-; control immediately after any page fault or after an IRQ6 (hardware
-; interrupt). This provides the fastest possible handling of page faults
-; since it jump directly here.  If this is a page fault, the number
-; immediately on the stack will be an error code, at offset 4 will be
-; the eip of the faulting instruction, at offset 8 will be the cs of the
-; faulting instruction.  If it is a hardware interrupt, it will not have
-; the error code and the eflags will be at offset 8.
-;----------------------------------------------------------------------------
-cprocfar    PF_handler64k
-
-; Check if this is a processor exeception or a page fault
-
-        push    eax
-        mov     ax,[cs:ValidCS]     ; Use CS override to access data
-        cmp     [ss:esp+12],ax      ; Is this a page fault?
-        jne     @@ToOldHandler      ; Nope, jump to the previous handler
-
-; Get address of page fault and check if within our handlers range
-
-        mov     eax,cr2             ; EBX has page fault linear address
-        cmp     eax,VFLAT_START     ; Is the fault less than ours?
-        jb      @@ToOldHandler      ; Yep, go to previous handler
-        cmp     eax,VFLAT_END       ; Is the fault more than ours?
-        jae     @@ToOldHandler      ; Yep, go to previous handler
-
-; This is our page fault, so we need to handle it
-
-        pushad
-        push    ds
-        push    es
-        mov     ebx,eax             ; EBX := page fault address
-        and     ebx,invert 0FFFFh   ; Mask to 64k bank boundary
-        mov     ds,[cs:_PM_savedDS]; Load segment registers
-        mov     es,[cs:_PM_savedDS]
-
-; Map in the page table for our virtual framebuffer area for modification
-
-        mov     edi,[PDBR]          ; EDI points to page directory
-        mov     edx,ebx             ; EDX = linear address
-        shr     edx,22              ; EDX = offset to page directory
-        mov     edx,[edx*4+edi]     ; EDX = physical page table address
-        mov     eax,edx
-        mov     edx,[accessPageTable]
-        or      eax,7
-        mov     [edx],eax
-        mov     eax,cr3
-        mov     cr3,eax             ; Update page table cache
-
-; Mark all pages valid for the new page fault area
-
-        mov     esi,ebx             ; ESI := linear address for page
-        shr     esi,10
-        and     esi,0FFFh           ; Offset into page table
-        add     esi,[accessPageAddr]
-ifdef   USE_NASM
-%assign off 0
-%rep 16
-        or      [DWORD esi+off],0000000001h ; Enable pages
-%assign off off+4
-%endrep
-else
-off = 0
-REPT    16
-        or      [DWORD esi+off],0000000001h ; Enable pages
-off = off+4
-ENDM
-endif
-
-; Mark all pages invalid for the previously mapped area
-
-        xchg    esi,[LastPage]      ; Save last page for next page fault
-        test    esi,esi
-        jz      @@DoneMapping       ; Dont update if first time round
-ifdef   USE_NASM
-%assign off 0
-%rep 16
-        or      [DWORD esi+off],0FFFFFFFEh  ; Disable pages
-%assign off off+4
-%endrep
-else
-off = 0
-REPT    16
-        and     [DWORD esi+off],0FFFFFFFEh  ; Disable pages
-off = off+4
-ENDM
-endif
-
-@@DoneMapping:
-        mov     eax,cr3
-        mov     cr3,eax             ; Flush the TLB
-
-; Now program the new SuperVGA starting bank address
-
-        mov     eax,ebx             ; EAX := page fault address
-        shr     eax,16
-        and     eax,0FFh            ; Mask to 0-255
-        call    [BankFuncPtr]       ; Call the bank switch function
-
-        pop     es
-        pop     ds
-        popad
-        pop     eax
-        add     esp,4               ; Pop the error code from stack
-        iretd                       ; Return to faulting instruction
-
-@@ToOldHandler:
-        pop     eax
-ifdef   USE_NASM
-        jmp far dword [cs:INT14Gate]; Chain to previous handler
-else
-        jmp     [FWORD cs:INT14Gate]; Chain to previous handler
-endif
-
-cprocend
-
-;----------------------------------------------------------------------------
-; PF_handler4k  - Page fault handler for 4k banks
-;----------------------------------------------------------------------------
-; The handler below is a 32 bit ring 0 page fault handler.  It receives
-; control immediately after any page fault or after an IRQ6 (hardware
-; interrupt). This provides the fastest possible handling of page faults
-; since it jump directly here.  If this is a page fault, the number
-; immediately on the stack will be an error code, at offset 4 will be
-; the eip of the faulting instruction, at offset 8 will be the cs of the
-; faulting instruction.  If it is a hardware interrupt, it will not have
-; the error code and the eflags will be at offset 8.
-;----------------------------------------------------------------------------
-cprocfar    PF_handler4k
-
-; Fill in when we have tested all the 64Kb code
-
-ifdef   USE_NASM
-        jmp far dword [cs:INT14Gate]; Chain to previous handler
-else
-        jmp     [FWORD cs:INT14Gate]; Chain to previous handler
-endif
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void InstallFaultHandler(void *baseAddr,int bankSize)
-;----------------------------------------------------------------------------
-; Installes the page fault handler directly int the interrupt descriptor
-; table for maximum performance. This of course requires ring 0 access,
-; but none of this stuff will run without ring 0!
-;----------------------------------------------------------------------------
-cprocstart  InstallFaultHandler
-
-        ARG     baseAddr:ULONG, bankSize:UINT
-
-        enter_c
-
-        mov     [DWORD LastPage],0  ; No pages have been mapped
-        mov     ax,cs
-        mov     [ValidCS],ax        ; Save CS value for page faults
-
-; Put address of our page fault handler into the IDT directly
-
-        sub     esp,6               ; Allocate space on stack
-ifdef   USE_NASM
-        sidt    [ss:esp]            ; Store pointer to IDT
-else
-        sidt    [FWORD ss:esp]      ; Store pointer to IDT
-endif
-        pop     ax                  ; add esp,2
-        pop     eax                 ; Absolute address of IDT
-        add     eax,14*8            ; Point to Int #14
-
-; Note that Interrupt gates do not have the high and low word of the
-; offset in adjacent words in memory, there are 4 bytes separating them.
-
-        mov     ecx,[eax]           ; Get cs and low 16 bits of offset
-        mov     edx,[eax+6]         ; Get high 16 bits of offset in dx
-        shl     edx,16
-        mov     dx,cx               ; edx has offset
-        mov     [INT14Offset],edx   ; Save offset
-        shr     ecx,16
-        mov     [INT14Selector],cx  ; Save original cs
-        mov     [eax+2],cs          ; Install new cs
-        mov     edx,offset PF_handler64k
-        cmp     [UINT bankSize],4
-        jne     @@1
-        mov     edx,offset PF_handler4k
-@@1:    mov     [eax],dx            ; Install low word of offset
-        shr     edx,16
-        mov     [eax+6],dx          ; Install high word of offset
-
-        leave_c
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void RemoveFaultHandler(void)
-;----------------------------------------------------------------------------
-; Closes down the virtual framebuffer services and restores the previous
-; page fault handler.
-;----------------------------------------------------------------------------
-cprocstart  RemoveFaultHandler
-
-        enter_c
-
-; Remove page fault handler from IDT
-
-        sub     esp,6               ; Allocate space on stack
-ifdef   USE_NASM
-        sidt    [ss:esp]            ; Store pointer to IDT
-else
-        sidt    [FWORD ss:esp]      ; Store pointer to IDT
-endif
-
-        pop     ax                  ; add esp,2
-        pop     eax                 ; Absolute address of IDT
-        add     eax,14*8            ; Point to Int #14
-        mov     cx,[INT14Selector]
-        mov     [eax+2],cx          ; Restore original CS
-        mov     edx,[INT14Offset]
-        mov     [eax],dx            ; Install low word of offset
-        shr     edx,16
-        mov     [eax+6],dx          ; Install high word of offset
-
-        leave_c
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void InstallBankFunc(int codeLen,void *bankFunc)
-;----------------------------------------------------------------------------
-; Installs the bank switch function by relocating it into our data segment
-; and making it into a callable function. We do it this way to make the
-; code identical to the way that the VflatD devices work under Windows.
-;----------------------------------------------------------------------------
-cprocstart  InstallBankFunc
-
-        ARG     codeLen:UINT, bankFunc:DPTR
-
-        enter_c
-
-        mov     esi,[bankFunc]      ; Copy the code into buffer
-        mov     edi,offset BankFuncBuf
-        mov     ecx,[codeLen]
-    rep movsb
-        mov     [BYTE edi],0C3h     ; Terminate the function with a near ret
-
-        leave_c
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; int InitPaging(void)
-;----------------------------------------------------------------------------
-; Initializes paging system. If paging is not enabled, builds a page table
-; directory and page tables for physical memory
-;
-;   Exit:       0   - Successful
-;               -1  - Couldn't initialize paging mechanism
-;----------------------------------------------------------------------------
-cprocstart  InitPaging
-
-        push    ebx
-        push    ecx
-        push    edx
-        push    esi
-        push    edi
-
-; Are we running under CauseWay?
-
-        mov     ax,0FFF9h
-        int     31h
-        jc      @@NotCauseway
-        cmp     ecx,"CAUS"
-        jnz     @@NotCauseway
-        cmp     edx,"EWAY"
-        jnz     @@NotCauseway
-
-        mov     [BOOL VF_haveCauseWay],1
-        mov     [CauseWayDIRLinear],esi
-        mov     [CauseWay1stLinear],edi
-
-; Check for DPMI
-
-        mov     ax,0ff00h
-        push    es
-        int     31h
-        pop     es
-        shr     edi,2
-        and     edi,3
-        cmp     edi,2
-        jz      @@ErrExit               ; Not supported under DPMI
-
-        mov     eax,[CauseWayDIRLinear]
-        jmp     @@CopyCR3
-
-@@NotCauseway:
-        mov     ax,cs
-        test    ax,3                    ; Which ring are we running
-        jnz     @@ErrExit               ; Needs zero ring to access
-                                        ; page tables (CR3)
-        mov     eax,cr0                 ; Load CR0
-        test    eax,80000000h           ; Is paging enabled?
-        jz      @@ErrExit               ; No, we must have paging!
-
-        mov     eax,cr3                 ; Load directory address
-        and     eax,0FFFFF000h
-
-@@CopyCR3:
-        mov     [PDBR],eax              ; Save it
-        mov     esi,eax
-        mov     edi,offset pageDirectory
-        mov     ecx,1024
-        cld
-        rep     movsd                   ; Copy the original page table directory
-        cmp     [DWORD accessPageAddr],0; Check if we have allocated page
-        jne     @@HaveRealMem           ; table already (we cant free it)
-
-        mov     eax,0100h               ; DPMI DOS allocate
-        mov     ebx,8192/16
-        int     31h                     ; Allocate 8192 bytes
-        and     eax,0FFFFh
-        shl     eax,4                   ; EAX points to newly allocated memory
-        add     eax,4095
-        and     eax,0FFFFF000h          ; Page align
-        mov     [accessPageAddr],eax
-
-@@HaveRealMem:
-        mov     eax,[accessPageAddr]    ; EAX -> page table in 1st Mb
-        shr     eax,12
-        and     eax,3FFh                ; Page table offset
-        shl     eax,2
-        cmp     [BOOL VF_haveCauseWay],0
-        jz      @@NotCW0
-        mov     ebx,[CauseWay1stLinear]
-        jmp     @@Put1st
-
-@@NotCW0:
-        mov     ebx,[PDBR]
-        mov     ebx,[ebx]
-        and     ebx,0FFFFF000h          ; Page table for 1st megabyte
-
-@@Put1st:
-        add     eax,ebx
-        mov     [accessPageTable],eax
-        sub     eax,eax                 ; No error
-        jmp     @@Exit
-
-@@ErrExit:
-        mov     eax,-1
-
-@@Exit: pop     edi
-        pop     esi
-        pop     edx
-        pop     ecx
-        pop     ebx
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void ClosePaging(void)
-;----------------------------------------------------------------------------
-; Closes the paging system
-;----------------------------------------------------------------------------
-cprocstart  ClosePaging
-
-        push    eax
-        push    ecx
-        push    edx
-        push    esi
-        push    edi
-
-        mov     eax,[accessPageAddr]
-        call    AccessPage              ; Restore AccessPage mapping
-        mov     edi,[PDBR]
-        mov     esi,offset pageDirectory
-        mov     ecx,1024
-        cld
-        rep     movsd                   ; Restore the original page table directory
-
-@@Exit: pop     edi
-        pop     esi
-        pop     edx
-        pop     ecx
-        pop     eax
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; long AccessPage(long phys)
-;----------------------------------------------------------------------------
-; Maps a known page to given physical memory
-;   Entry:      EAX - Physical memory
-;   Exit:       EAX - Linear memory address of mapped phys mem
-;----------------------------------------------------------------------------
-cprocstatic     AccessPage
-
-        push    edx
-        mov     edx,[accessPageTable]
-        or      eax,7
-        mov     [edx],eax
-        mov     eax,cr3
-        mov     cr3,eax                 ; Update page table cache
-        mov     eax,[accessPageAddr]
-        pop     edx
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; long GetPhysicalAddress(long linear)
-;----------------------------------------------------------------------------
-; Returns the physical address of linear address
-;   Entry:      EAX - Linear address to convert
-;   Exit:       EAX - Physical address
-;----------------------------------------------------------------------------
-cprocstatic     GetPhysicalAddress
-
-        push    ebx
-        push    edx
-        mov     edx,eax
-        shr     edx,22                  ; EDX is the directory offset
-        mov     ebx,[PDBR]
-        mov     edx,[edx*4+ebx]         ; Load page table address
-        push    eax
-        mov     eax,edx
-        call    AccessPage              ; Access the page table
-        mov     edx,eax
-        pop     eax
-        shr     eax,12
-        and     eax,03FFh               ; EAX offset into page table
-        mov     eax,[edx+eax*4]         ; Load physical address
-        and     eax,0FFFFF000h
-        pop     edx
-        pop     ebx
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void CreatePageTable(long pageDEntry)
-;----------------------------------------------------------------------------
-; Creates a page table for specific address (4MB)
-;       Entry:  EAX - Page directory entry (top 10-bits of address)
-;----------------------------------------------------------------------------
-cprocstatic     CreatePageTable
-
-        push    ebx
-        push    ecx
-        push    edx
-        push    edi
-        mov     ebx,eax                 ; Save address
-        mov     eax,8192
-        push    eax
-        call    VF_malloc              ; Allocate page table directory
-        add     esp,4
-        add     eax,0FFFh
-        and     eax,0FFFFF000h          ; Page align (4KB)
-        mov     edi,eax                 ; Save page table linear address
-        sub     eax,eax                 ; Fill with zero
-        mov     ecx,1024
-        cld
-        rep     stosd                   ; Clear page table
-        sub     edi,4096
-        mov     eax,edi
-        call    GetPhysicalAddress
-        mov     edx,[PDBR]
-        or      eax,7                   ; Present/write/user bit
-        mov     [edx+ebx*4],eax         ; Save physical address into page directory
-        mov     eax,cr3
-        mov     cr3,eax                 ; Update page table cache
-        pop     edi
-        pop     edx
-        pop     ecx
-        pop     ebx
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void MapPhysical2Linear(ulong pAddr, ulong lAddr, int pages, int flags);
-;----------------------------------------------------------------------------
-; Maps physical memory into linear memory
-;   Entry:      pAddr   - Physical address
-;               lAddr   - Linear address
-;               pages   - Number of 4K pages to map
-;               flags   - Page flags
-;                           bit 0   =       present
-;                           bit 1   =       Read(0)/Write(1)
-;----------------------------------------------------------------------------
-cprocstart  MapPhysical2Linear
-
-        ARG     pAddr:ULONG, lAddr:ULONG, pages:UINT, pflags:UINT
-
-        enter_c
-
-        and     [ULONG pAddr],0FFFFF000h; Page boundary
-        and     [ULONG lAddr],0FFFFF000h; Page boundary
-        mov     ecx,[pflags]
-        and     ecx,11b                 ; Just two bits
-        or      ecx,100b                ; Supervisor bit
-        mov     [pflags],ecx
-
-        mov     edx,[lAddr]
-        shr     edx,22                  ; EDX = Directory
-        mov     esi,[PDBR]
-        mov     edi,[pages]             ; EDI page count
-        mov     ebx,[lAddr]
-
-@@CreateLoop:
-        mov     ecx,[esi+edx*4]         ; Load page table address
-        test    ecx,1                   ; Is it present?
-        jnz     @@TableOK
-        mov     eax,edx
-        call    CreatePageTable         ; Create a page table
-@@TableOK:
-        mov     eax,ebx
-        shr     eax,12
-        and     eax,3FFh
-        sub     eax,1024
-        neg     eax                     ; EAX = page count in this table
-        inc     edx                     ; Next table
-        mov     ebx,0                   ; Next time we'll map 1K pages
-        sub     edi,eax                 ; Subtract mapped pages from page count
-        jns     @@CreateLoop            ; Create more tables if necessary
-
-        mov     ecx,[pages]             ; ECX = Page count
-        mov     esi,[lAddr]
-        shr     esi,12                  ; Offset part isn't needed
-        mov     edi,[pAddr]
-@@MappingLoop:
-        mov     eax,esi
-        shr     eax,10                  ; EAX = offset to page directory
-        mov     ebx,[PDBR]
-        mov     eax,[eax*4+ebx]         ; EAX = page table address
-        call    AccessPage
-        mov     ebx,esi
-        and     ebx,3FFh                ; EBX = offset to page table
-        mov     edx,edi
-        add     edi,4096                ; Next physical address
-        inc     esi                     ; Next linear page
-        or      edx,[pflags]            ; Update flags...
-        mov     [eax+ebx*4],edx         ; Store page table entry
-        loop    @@MappingLoop
-        mov     eax,cr3
-        mov     cr3,eax                 ; Update page table cache
-
-        leave_c
-        ret
-
-cprocend
-
-endcodeseg  _vflat
-
-endif
-
-        END                     ; End of module
diff --git a/board/MAI/bios_emulator/scitech/src/pm/smx/cpuinfo.c b/board/MAI/bios_emulator/scitech/src/pm/smx/cpuinfo.c
deleted file mode 100644 (file)
index 5447e57..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/****************************************************************************
-*
-*                         Ultra Long Period Timer
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  32-bit SMX embedded systems development.
-*
-* Description:  SMX specific code for the CPU detection module.
-*
-****************************************************************************/
-
-/*----------------------------- Implementation ----------------------------*/
-
-/* External timing function */
-
-void __ZTimerInit(void);
-
-/****************************************************************************
-REMARKS:
-Do nothing for DOS because we don't have thread priorities.
-****************************************************************************/
-#define SetMaxThreadPriority()      0
-
-/****************************************************************************
-REMARKS:
-Do nothing for DOS because we don't have thread priorities.
-****************************************************************************/
-#define RestoreThreadPriority(i)    (void)(i)
-
-/****************************************************************************
-REMARKS:
-Initialise the counter and return the frequency of the counter.
-****************************************************************************/
-static void GetCounterFrequency(
-    CPU_largeInteger *freq)
-{
-    ulong resolution;
-
-    __ZTimerInit();
-    ULZTimerResolution(&resolution);
-    freq->low = (ulong)(10000000000.0 / resolution);
-    freq->high = 0;
-}
-
-/****************************************************************************
-REMARKS:
-Read the counter and return the counter value.
-****************************************************************************/
-#define GetCounter(t)                   \
-{                                       \
-    (t)->low = ULZReadTime() * 10000L;  \
-    (t)->high = 0;                      \
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/smx/event.c b/board/MAI/bios_emulator/scitech/src/pm/smx/event.c
deleted file mode 100644 (file)
index 533c261..0000000
+++ /dev/null
@@ -1,368 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  32-bit SMX embedded systems development
-*
-* Description:  32-bit SMX implementation for the SciTech cross platform
-*               event library.
-*
-****************************************************************************/
-
-#include "smx/ps2mouse.h"
-
-/*--------------------------- Global variables ----------------------------*/
-
-ibool _VARAPI   _EVT_useEvents = true;  /* True to use event handling   */
-ibool _VARAPI   _EVT_installed = 0;     /* Event handers installed?     */
-uchar _VARAPI   *_EVT_biosPtr = NULL;   /* Pointer to the BIOS data area */
-static ibool    haveMouse = false;      /* True if we have a mouse      */
-
-/*---------------------------- Implementation -----------------------------*/
-
-/* External assembler functions */
-
-void    EVTAPI _EVT_pollJoystick(void);
-uint    EVTAPI _EVT_disableInt(void);
-uint    EVTAPI _EVT_restoreInt(uint flags);
-void    EVTAPI _EVT_codeStart(void);
-void    EVTAPI _EVT_codeEnd(void);
-void    EVTAPI _EVT_cCodeStart(void);
-void    EVTAPI _EVT_cCodeEnd(void);
-int     EVTAPI _EVT_getKeyCode(void);
-int     EVTAPI EVT_rdinx(int port,int index);
-void    EVTAPI EVT_wrinx(int port,int index,int value);
-
-/****************************************************************************
-REMARKS:
-Do nothing for DOS, because we are fully interrupt driven.
-****************************************************************************/
-#define _EVT_pumpMessages()
-
-/****************************************************************************
-REMARKS:
-This function is used to return the number of ticks since system
-startup in milliseconds. This should be the same value that is placed into
-the time stamp fields of events, and is used to implement auto mouse down
-events.
-****************************************************************************/
-ulong _EVT_getTicks(void)
-{
-    return (ulong)PM_getLong(_EVT_biosPtr+0x6C) * 55UL;
-}
-
-/****************************************************************************
-REMARKS:
-Include generic raw scancode keyboard module.
-****************************************************************************/
-#include "common/keyboard.c"
-
-/****************************************************************************
-REMARKS:
-Determines if we have a mouse attached and functioning.
-****************************************************************************/
-static ibool detectMouse(void)
-{
-   return(ps2Query());
-}
-
-/****************************************************************************
-PARAMETERS:
-what        - Event code
-message     - Event message
-x,y         - Mouse position at time of event
-but_stat    - Mouse button status at time of event
-
-REMARKS:
-Adds a new mouse event to the event queue. This routine is called from within
-the mouse interrupt subroutine, so it must be efficient.
-
-NOTE:   Interrupts MUST be OFF while this routine is called to ensure we have
-       mutually exclusive access to our internal data structures for
-       interrupt driven systems (like under DOS).
-****************************************************************************/
-static void addMouseEvent(
-    uint what,
-    uint message,
-    int x,
-    int y,
-    int mickeyX,
-    int mickeyY,
-    uint but_stat)
-{
-    event_t evt;
-
-    if (EVT.count < EVENTQSIZE) {
-       /* Save information in event record. */
-       evt.when = _EVT_getTicks();
-       evt.what = what;
-       evt.message = message;
-       evt.modifiers = but_stat;
-       evt.where_x = x;                /* Save mouse event position    */
-       evt.where_y = y;
-       evt.relative_x = mickeyX;
-       evt.relative_y = mickeyY;
-       evt.modifiers |= EVT.keyModifiers;
-       addEvent(&evt);                 /* Add to tail of event queue   */
-       }
-}
-
-/****************************************************************************
-PARAMETERS:
-mask        - Event mask
-butstate    - Button state
-x           - Mouse x coordinate
-y           - Mouse y coordinate
-
-REMARKS:
-Mouse event handling routine. This gets called when a mouse event occurs,
-and we call the addMouseEvent() routine to add the appropriate mouse event
-to the event queue.
-
-Note: Interrupts are ON when this routine is called by the mouse driver code.
-/*AM: NOTE: This function has not actually been ported from DOS yet and should not */
-/*AM: be installed until it is. */
-****************************************************************************/
-static void EVTAPI mouseISR(
-    uint mask,
-    uint butstate,
-    int x,
-    int y,
-    int mickeyX,
-    int mickeyY)
-{
-    RMREGS  regs;
-    uint    ps;
-
-    if (mask & 1) {
-       /* Save the current mouse coordinates */
-       EVT.mx = x; EVT.my = y;
-
-       /* If the last event was a movement event, then modify the last
-        * event rather than post a new one, so that the queue will not
-        * become saturated. Before we modify the data structures, we
-        * MUST ensure that interrupts are off.
-        */
-       ps = _EVT_disableInt();
-       if (EVT.oldMove != -1) {
-           EVT.evtq[EVT.oldMove].where_x = x;          /* Modify existing one  */
-           EVT.evtq[EVT.oldMove].where_y = y;
-           EVT.evtq[EVT.oldMove].relative_x += mickeyX;
-           EVT.evtq[EVT.oldMove].relative_y += mickeyY;
-           }
-       else {
-           EVT.oldMove = EVT.freeHead;         /* Save id of this move event   */
-           addMouseEvent(EVT_MOUSEMOVE,0,x,y,mickeyX,mickeyY,butstate);
-           }
-       _EVT_restoreInt(ps);
-       }
-    if (mask & 0x2A) {
-       ps = _EVT_disableInt();
-       addMouseEvent(EVT_MOUSEDOWN,mask >> 1,x,y,0,0,butstate);
-       EVT.oldMove = -1;
-       _EVT_restoreInt(ps);
-       }
-    if (mask & 0x54) {
-       ps = _EVT_disableInt();
-       addMouseEvent(EVT_MOUSEUP,mask >> 2,x,y,0,0,butstate);
-       EVT.oldMove = -1;
-       _EVT_restoreInt(ps);
-       }
-    EVT.oldKey = -1;
-}
-
-/****************************************************************************
-REMARKS:
-Keyboard interrupt handler function.
-
-NOTE:   Interrupts are OFF when this routine is called by the keyboard ISR,
-       and we leave them OFF the entire time. This has been modified to work
-      in conjunction with smx keyboard handler.
-****************************************************************************/
-static void EVTAPI keyboardISR(void)
-{
-   PM_chainPrevKey();
-    processRawScanCode(PM_inpb(0x60));
-    PM_outpb(0x20,0x20);
-}
-
-/****************************************************************************
-REMARKS:
-Safely abort the event module upon catching a fatal error.
-****************************************************************************/
-void _EVT_abort()
-{
-    EVT_exit();
-    PM_fatalError("Unhandled exception!");
-}
-
-/****************************************************************************
-PARAMETERS:
-mouseMove   - Callback function to call wheneve the mouse needs to be moved
-
-REMARKS:
-Initiliase the event handling module. Here we install our mouse handling ISR
-to be called whenever any button's are pressed or released. We also build
-the free list of events in the event queue.
-
-We use handler number 2 of the mouse libraries interrupt handlers for our
-event handling routines.
-****************************************************************************/
-void EVTAPI EVT_init(
-    _EVT_mouseMoveHandler mouseMove)
-{
-    int     i;
-
-    EVT.mouseMove = mouseMove;
-    _EVT_biosPtr = PM_getBIOSPointer();
-    EVT_resume();
-}
-
-/****************************************************************************
-REMARKS:
-Initiailises the internal event handling modules. The EVT_suspend function
-can be called to suspend event handling (such as when shelling out to DOS),
-and this function can be used to resume it again later.
-****************************************************************************/
-void EVTAPI EVT_resume(void)
-{
-    static int      locked = 0;
-    int             stat;
-    uchar           mods;
-    PM_lockHandle   lh;
-
-    if (_EVT_useEvents) {
-       /* Initialise the event queue and enable our interrupt handlers */
-       initEventQueue();
-       PM_setKeyHandler(keyboardISR);
-       if ((haveMouse = detectMouse()) != 0)
-           PM_setMouseHandler(0xFFFF,mouseISR);
-
-       /* Read the keyboard modifier flags from the BIOS to get the
-        * correct initialisation state. The only state we care about is
-        * the correct toggle state flags such as SCROLLLOCK, NUMLOCK and
-        * CAPSLOCK.
-        */
-       EVT.keyModifiers = 0;
-       mods = PM_getByte(_EVT_biosPtr+0x17);
-       if (mods & 0x10)
-           EVT.keyModifiers |= EVT_SCROLLLOCK;
-       if (mods & 0x20)
-           EVT.keyModifiers |= EVT_NUMLOCK;
-       if (mods & 0x40)
-           EVT.keyModifiers |= EVT_CAPSLOCK;
-
-       /* Lock all of the code and data used by our protected mode interrupt
-        * handling routines, so that it will continue to work correctly
-        * under real mode.
-        */
-       if (!locked) {
-           /* It is difficult to ensure that we lock our global data, so we
-            * do this by taking the address of a variable locking all data
-            * 2Kb on either side. This should properly cover the global data
-            * used by the module (the other alternative is to declare the
-            * variables in assembler, in which case we know it will be
-            * correct).
-            */
-           stat  = !PM_lockDataPages(&EVT,sizeof(EVT),&lh);
-           stat |= !PM_lockDataPages(&_EVT_biosPtr,sizeof(_EVT_biosPtr),&lh);
-           stat |= !PM_lockCodePages((__codePtr)_EVT_cCodeStart,(int)_EVT_cCodeEnd-(int)_EVT_cCodeStart,&lh);
-           stat |= !PM_lockCodePages((__codePtr)_EVT_codeStart,(int)_EVT_codeEnd-(int)_EVT_codeStart,&lh);
-           if (stat) {
-               PM_fatalError("Page locking services failed - interrupt handling not safe!");
-               exit(1);
-               }
-           locked = 1;
-           }
-
-       _EVT_installed = true;
-       }
-}
-
-/****************************************************************************
-REMARKS
-Changes the range of coordinates returned by the mouse functions to the
-specified range of values. This is used when changing between graphics
-modes set the range of mouse coordinates for the new display mode.
-****************************************************************************/
-void EVTAPI EVT_setMouseRange(
-    int xRes,
-    int yRes)
-{
-    if (haveMouse) {
-       ps2MouseStop();
-       ps2MouseStart( 0, xRes, 0, yRes, -1, -1, -1);
-       }
-}
-
-/****************************************************************************
-REMARKS
-Modifes the mouse coordinates as necessary if scaling to OS coordinates,
-and sets the OS mouse cursor position.
-****************************************************************************/
-void _EVT_setMousePos(
-    int *x,
-    int *y)
-{
-    if (haveMouse)
-       ps2MouseMove(*x, *y);
-}
-
-/****************************************************************************
-REMARKS
-Suspends all of our event handling operations. This is also used to
-de-install the event handling code.
-****************************************************************************/
-void EVTAPI EVT_suspend(void)
-{
-    uchar   mods;
-
-    if (_EVT_installed) {
-       PM_restoreKeyHandler();
-    if (haveMouse)
-       PM_restoreMouseHandler();
-
-       /* Set the keyboard modifier flags in the BIOS to our values */
-       EVT_allowLEDS(true);
-       mods = PM_getByte(_EVT_biosPtr+0x17) & ~0x70;
-       if (EVT.keyModifiers & EVT_SCROLLLOCK)
-           mods |= 0x10;
-       if (EVT.keyModifiers & EVT_NUMLOCK)
-           mods |= 0x20;
-       if (EVT.keyModifiers & EVT_CAPSLOCK)
-           mods |= 0x40;
-       PM_setByte(_EVT_biosPtr+0x17,mods);
-
-       /* Flag that we are no longer installed */
-       _EVT_installed = false;
-       }
-}
-
-/****************************************************************************
-REMARKS
-Exits the event module for program terminatation.
-****************************************************************************/
-void EVTAPI EVT_exit(void)
-{
-    EVT_suspend();
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/smx/oshdr.h b/board/MAI/bios_emulator/scitech/src/pm/smx/oshdr.h
deleted file mode 100644 (file)
index 3ff8daa..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  32-bit SMX embedded systems development.
-*
-* Description:  Include file to include all OS specific header files.
-*
-****************************************************************************/
diff --git a/board/MAI/bios_emulator/scitech/src/pm/smx/pm.c b/board/MAI/bios_emulator/scitech/src/pm/smx/pm.c
deleted file mode 100644 (file)
index 99ee3d4..0000000
+++ /dev/null
@@ -1,1187 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  32 bit SMX embedded systems development.
-*
-* Description:  Implementation for the OS Portability Manager Library, which
-*               contains functions to implement OS specific services in a
-*               generic, cross platform API. Porting the OS Portability
-*               Manager library is the first step to porting any SciTech
-*               products to a new platform.
-*
-****************************************************************************/
-
-#include "pmapi.h"
-#include "drvlib/os/os.h"
-#include "ztimerc.h"
-#include "event.h"
-#include "mtrr.h"
-#include "pm_help.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <dos.h>
-#include <conio.h>
-#ifdef  __GNUC__
-#include <unistd.h>
-#include <sys/nearptr.h>
-#include <sys/stat.h>
-#else
-#include <direct.h>
-#endif
-#ifdef  __BORLANDC__
-#pragma warn -par
-#endif
-
-/*--------------------------- Global variables ----------------------------*/
-
-typedef struct {
-    int     oldMode;
-    int     old50Lines;
-    } DOS_stateBuf;
-
-#define MAX_RM_BLOCKS   10
-
-static struct {
-    void    *p;
-    uint    tag;
-    } rmBlocks[MAX_RM_BLOCKS];
-
-static uint     VESABuf_len = 1024;     /* Length of the VESABuf buffer     */
-static void     *VESABuf_ptr = NULL;    /* Near pointer to VESABuf          */
-static uint     VESABuf_rseg;           /* Real mode segment of VESABuf     */
-static uint     VESABuf_roff;           /* Real mode offset of VESABuf      */
-static void     (PMAPIP fatalErrorCleanup)(void) = NULL;
-ushort _VARAPI  _PM_savedDS = 0;
-static ulong    PDB = 0,*pPDB = NULL;
-static uint     VXD_version = -1;
-
-/*----------------------------- Implementation ----------------------------*/
-
-ulong   _ASMAPI _PM_getPDB(void);
-void    _ASMAPI _PM_VxDCall(VXD_regs *regs,uint off,uint sel);
-
-/****************************************************************************
-REMARKS:
-External function to call the PMHELP helper VxD.
-****************************************************************************/
-void PMAPI PM_VxDCall(
-    VXD_regs *regs)
-{
-}
-
-/****************************************************************************
-RETURNS:
-BCD coded version number of the VxD, or 0 if not loaded (ie: 0x202 - 2.2)
-
-REMARKS:
-This function gets the version number for the VxD that we have connected to.
-****************************************************************************/
-uint PMAPI PMHELP_getVersion(void)
-{
-    return VXD_version = 0;
-}
-
-void PMAPI PM_init(void)
-{
-#ifndef REALMODE
-    MTRR_init();
-#endif
-}
-
-/****************************************************************************
-PARAMETERS:
-base    - The starting physical base address of the region
-size    - The size in bytes of the region
-type    - Type to place into the MTRR register
-
-RETURNS:
-Error code describing the result.
-
-REMARKS:
-Function to enable write combining for the specified region of memory.
-****************************************************************************/
-int PMAPI PM_enableWriteCombine(
-    ulong base,
-    ulong size,
-    uint type)
-{
-#ifndef REALMODE
-    return MTRR_enableWriteCombine(base,size,type);
-#else
-    return PM_MTRR_NOT_SUPPORTED;
-#endif
-}
-
-ibool PMAPI PM_haveBIOSAccess(void)
-{ return false; }
-
-long PMAPI PM_getOSType(void)
-{ return _OS_SMX; }
-
-int PMAPI PM_getModeType(void)
-{ return PM_386; }
-
-void PMAPI PM_backslash(char *s)
-{
-    uint pos = strlen(s);
-    if (s[pos-1] != '\\') {
-       s[pos] = '\\';
-       s[pos+1] = '\0';
-       }
-}
-
-void PMAPI PM_setFatalErrorCleanup(
-    void (PMAPIP cleanup)(void))
-{
-    fatalErrorCleanup = cleanup;
-}
-
-void MGLOutput(char *);
-
-void PMAPI PM_fatalError(const char *msg)
-{
-    if (fatalErrorCleanup)
-       fatalErrorCleanup();
-    MGLOutput(msg);
-/* No support for fprintf() under smx currently! */
-/*  fprintf(stderr,"%s\n", msg); */
-    exit(1);
-}
-
-static void ExitVBEBuf(void)
-{
-    if (VESABuf_ptr)
-       PM_freeRealSeg(VESABuf_ptr);
-    VESABuf_ptr = 0;
-}
-
-void * PMAPI PM_getVESABuf(uint *len,uint *rseg,uint *roff)
-{
-    if (!VESABuf_ptr) {
-       /* Allocate a global buffer for communicating with the VESA VBE */
-       if ((VESABuf_ptr = PM_allocRealSeg(VESABuf_len, &VESABuf_rseg, &VESABuf_roff)) == NULL)
-           return NULL;
-       atexit(ExitVBEBuf);
-       }
-    *len = VESABuf_len;
-    *rseg = VESABuf_rseg;
-    *roff = VESABuf_roff;
-    return VESABuf_ptr;
-}
-
-int PMAPI PM_int386(int intno, PMREGS *in, PMREGS *out)
-{
-    PMSREGS sregs;
-    PM_segread(&sregs);
-    return PM_int386x(intno,in,out,&sregs);
-}
-
-/* Routines to set and get the real mode interrupt vectors, by making
- * direct real mode calls to DOS and bypassing the DOS extenders API.
- * This is the safest way to handle this, as some servers try to be
- * smart about changing real mode vectors.
- */
-
-void PMAPI _PM_getRMvect(int intno, long *realisr)
-{
-    RMREGS  regs;
-    RMSREGS sregs;
-
-    PM_saveDS();
-    regs.h.ah = 0x35;
-    regs.h.al = intno;
-    PM_int86x(0x21, &regs, &regs, &sregs);
-    *realisr = ((long)sregs.es << 16) | regs.x.bx;
-}
-
-void PMAPI _PM_setRMvect(int intno, long realisr)
-{
-    RMREGS  regs;
-    RMSREGS sregs;
-
-    PM_saveDS();
-    regs.h.ah = 0x25;
-    regs.h.al = intno;
-    sregs.ds = (int)(realisr >> 16);
-    regs.x.dx = (int)(realisr & 0xFFFF);
-    PM_int86x(0x21, &regs, &regs, &sregs);
-}
-
-void PMAPI _PM_addRealModeBlock(void *mem,uint tag)
-{
-    int i;
-
-    for (i = 0; i < MAX_RM_BLOCKS; i++) {
-       if (rmBlocks[i].p == NULL) {
-           rmBlocks[i].p = mem;
-           rmBlocks[i].tag = tag;
-           return;
-           }
-       }
-    PM_fatalError("To many real mode memory block allocations!");
-}
-
-uint PMAPI _PM_findRealModeBlock(void *mem)
-{
-    int i;
-
-    for (i = 0; i < MAX_RM_BLOCKS; i++) {
-       if (rmBlocks[i].p == mem)
-           return rmBlocks[i].tag;
-       }
-    PM_fatalError("Could not find prior real mode memory block allocation!");
-    return 0;
-}
-
-char * PMAPI PM_getCurrentPath(
-    char *path,
-    int maxLen)
-{
-    return getcwd(path,maxLen);
-}
-
-char PMAPI PM_getBootDrive(void)
-{ return 'C'; }
-
-const char * PMAPI PM_getVBEAFPath(void)
-{ return "c:\\"; }
-
-const char * PMAPI PM_getNucleusPath(void)
-{
-    static char path[256];
-    char        *env;
-
-    if ((env = getenv("NUCLEUS_PATH")) != NULL)
-       return env;
-    return "c:\\nucleus";
-}
-
-const char * PMAPI PM_getNucleusConfigPath(void)
-{
-    static char path[256];
-    strcpy(path,PM_getNucleusPath());
-    PM_backslash(path);
-    strcat(path,"config");
-    return path;
-}
-
-const char * PMAPI PM_getUniqueID(void)
-{ return "SMX"; }
-
-const char * PMAPI PM_getMachineName(void)
-{ return "SMX"; }
-
-int PMAPI PM_kbhit(void)
-{
-    int     hit;
-    event_t evt;
-
-    hit = EVT_peekNext(&evt,EVT_KEYDOWN | EVT_KEYREPEAT);
-    EVT_flush(~(EVT_KEYDOWN | EVT_KEYREPEAT));
-    return hit;
-}
-
-int PMAPI PM_getch(void)
-{
-   event_t evt;
-
-    EVT_halt(&evt,EVT_KEYDOWN);
-   return EVT_asciiCode(evt.message);
-}
-
-PM_HWND PMAPI PM_openConsole(PM_HWND hwndUser,int device,int xRes,int yRes,int bpp,ibool fullScreen)
-{
-    /* Not used for SMX */
-    (void)hwndUser;
-    (void)device;
-    (void)xRes;
-    (void)yRes;
-    (void)bpp;
-    (void)fullScreen;
-    return 0;
-}
-
-int PMAPI PM_getConsoleStateSize(void)
-{
-    return sizeof(DOS_stateBuf);
-}
-
-void PMAPI PM_saveConsoleState(void *stateBuf,PM_HWND hwndConsole)
-{
-    RMREGS          regs;
-    DOS_stateBuf    *sb = stateBuf;
-
-    /* Save the old video mode state */
-    regs.h.ah = 0x0F;
-    PM_int86(0x10,&regs,&regs);
-    sb->oldMode = regs.h.al & 0x7F;
-    sb->old50Lines = false;
-    if (sb->oldMode == 0x3) {
-       regs.x.ax = 0x1130;
-       regs.x.bx = 0;
-       regs.x.dx = 0;
-       PM_int86(0x10,&regs,&regs);
-       sb->old50Lines = (regs.h.dl == 42 || regs.h.dl == 49);
-       }
-    (void)hwndConsole;
-}
-
-void PMAPI PM_setSuspendAppCallback(int (_ASMAPIP saveState)(int flags))
-{
-    /* Not used for SMX */
-    (void)saveState;
-}
-
-void PMAPI PM_restoreConsoleState(const void *stateBuf,PM_HWND hwndConsole)
-{
-    RMREGS              regs;
-    const DOS_stateBuf  *sb = stateBuf;
-
-    /* Retore 50 line mode if set */
-    if (sb->old50Lines) {
-       regs.x.ax = 0x1112;
-       regs.x.bx = 0;
-       PM_int86(0x10,&regs,&regs);
-       }
-    (void)hwndConsole;
-}
-
-void PMAPI PM_closeConsole(PM_HWND hwndConsole)
-{
-    /* Not used for SMX */
-    (void)hwndConsole;
-}
-
-void PMAPI PM_setOSCursorLocation(int x,int y)
-{
-    uchar *_biosPtr = PM_getBIOSPointer();
-    PM_setByte(_biosPtr+0x50,x);
-    PM_setByte(_biosPtr+0x51,y);
-}
-
-void PMAPI PM_setOSScreenWidth(int width,int height)
-{
-    uchar *_biosPtr = PM_getBIOSPointer();
-    PM_setWord(_biosPtr+0x4A,width);
-    PM_setWord(_biosPtr+0x4C,width*2);
-    PM_setByte(_biosPtr+0x84,height-1);
-    if (height > 25) {
-       PM_setWord(_biosPtr+0x60,0x0607);
-       PM_setByte(_biosPtr+0x85,0x08);
-       }
-    else {
-       PM_setWord(_biosPtr+0x60,0x0D0E);
-       PM_setByte(_biosPtr+0x85,0x016);
-       }
-}
-
-void * PMAPI PM_mallocShared(long size)
-{
-    return PM_malloc(size);
-}
-
-void PMAPI PM_freeShared(void *ptr)
-{
-    PM_free(ptr);
-}
-
-#define GetRMVect(intno,isr)    *(isr) = ((ulong*)rmZeroPtr)[intno]
-#define SetRMVect(intno,isr)    ((ulong*)rmZeroPtr)[intno] = (isr)
-
-ibool PMAPI PM_doBIOSPOST(
-    ushort axVal,
-    ulong BIOSPhysAddr,
-    void *mappedBIOS,
-    ulong BIOSLen)
-{
-    static int      firstTime = true;
-    static uchar    *rmZeroPtr;
-    long            Current10,Current6D,Current42;
-    RMREGS          regs;
-    RMSREGS         sregs;
-
-    /* Create a zero memory mapping for us to use */
-    if (firstTime) {
-       rmZeroPtr = PM_mapPhysicalAddr(0,0x7FFF,true);
-       firstTime = false;
-       }
-
-    /* Remap the secondary BIOS to 0xC0000 physical */
-    if (BIOSPhysAddr != 0xC0000L || BIOSLen > 32768) {
-       /* SMX cannot virtually remap the BIOS, so we can only work if all
-        * the secondary controllers are identical, and we then use the
-        * BIOS on the first controller for all the remaining controllers.
-        *
-        * For OS'es that do virtual memory, and remapping of 0xC0000
-        * physical (perhaps a copy on write mapping) should be all that
-        * is needed.
-        */
-       return false;
-       }
-
-    /* Save current handlers of int 10h and 6Dh */
-    GetRMVect(0x10,&Current10);
-    GetRMVect(0x6D,&Current6D);
-
-    /* POST the secondary BIOS */
-    GetRMVect(0x42,&Current42);
-    SetRMVect(0x10,Current42);  /* Restore int 10h to STD-BIOS */
-    regs.x.ax = axVal;
-    PM_callRealMode(0xC000,0x0003,&regs,&sregs);
-
-    /* Restore current handlers */
-    SetRMVect(0x10,Current10);
-    SetRMVect(0x6D,Current6D);
-
-    /* Second the primary BIOS mappin 1:1 for 0xC0000 physical */
-    if (BIOSPhysAddr != 0xC0000L) {
-       /* SMX does not support this */
-       (void)mappedBIOS;
-       }
-    return true;
-}
-
-void PMAPI PM_sleep(ulong milliseconds)
-{
-    ulong           microseconds = milliseconds * 1000L;
-    LZTimerObject   tm;
-
-    LZTimerOnExt(&tm);
-    while (LZTimerLapExt(&tm) < microseconds)
-       ;
-    LZTimerOffExt(&tm);
-}
-
-int PMAPI PM_getCOMPort(int port)
-{
-    switch (port) {
-       case 0: return 0x3F8;
-       case 1: return 0x2F8;
-       }
-    return 0;
-}
-
-int PMAPI PM_getLPTPort(int port)
-{
-    switch (port) {
-       case 0: return 0x3BC;
-       case 1: return 0x378;
-       case 2: return 0x278;
-       }
-    return 0;
-}
-
-PM_MODULE PMAPI PM_loadLibrary(
-    const char *szDLLName)
-{
-    (void)szDLLName;
-    return NULL;
-}
-
-void * PMAPI PM_getProcAddress(
-    PM_MODULE hModule,
-    const char *szProcName)
-{
-    (void)hModule;
-    (void)szProcName;
-    return NULL;
-}
-
-void PMAPI PM_freeLibrary(
-    PM_MODULE hModule)
-{
-    (void)hModule;
-}
-
-int PMAPI PM_setIOPL(
-    int level)
-{
-    return level;
-}
-
-/****************************************************************************
-REMARKS:
-Internal function to convert the find data to the generic interface.
-****************************************************************************/
-static void convertFindData(
-    PM_findData *findData,
-    struct find_t *blk)
-{
-    ulong   dwSize = findData->dwSize;
-
-    memset(findData,0,findData->dwSize);
-    findData->dwSize = dwSize;
-    if (blk->attrib & _A_RDONLY)
-       findData->attrib |= PM_FILE_READONLY;
-    if (blk->attrib & _A_SUBDIR)
-       findData->attrib |= PM_FILE_DIRECTORY;
-    if (blk->attrib & _A_ARCH)
-       findData->attrib |= PM_FILE_ARCHIVE;
-    if (blk->attrib & _A_HIDDEN)
-       findData->attrib |= PM_FILE_HIDDEN;
-    if (blk->attrib & _A_SYSTEM)
-       findData->attrib |= PM_FILE_SYSTEM;
-    findData->sizeLo = blk->size;
-    strncpy(findData->name,blk->name,PM_MAX_PATH);
-    findData->name[PM_MAX_PATH-1] = 0;
-}
-
-#define FIND_MASK   (_A_RDONLY | _A_ARCH | _A_SUBDIR | _A_HIDDEN | _A_SYSTEM)
-
-/****************************************************************************
-REMARKS:
-Function to find the first file matching a search criteria in a directory.
-****************************************************************************/
-void * PMAPI PM_findFirstFile(
-    const char *filename,
-    PM_findData *findData)
-{
-    struct find_t *blk;
-
-    if ((blk = PM_malloc(sizeof(*blk))) == NULL)
-       return PM_FILE_INVALID;
-    if (_dos_findfirst((char*)filename,FIND_MASK,blk) == 0) {
-       convertFindData(findData,blk);
-       return blk;
-       }
-    return PM_FILE_INVALID;
-}
-
-/****************************************************************************
-REMARKS:
-Function to find the next file matching a search criteria in a directory.
-****************************************************************************/
-ibool PMAPI PM_findNextFile(
-    void *handle,
-    PM_findData *findData)
-{
-    struct find_t *blk = handle;
-
-    if (_dos_findnext(blk) == 0) {
-       convertFindData(findData,blk);
-       return true;
-       }
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-Function to close the find process
-****************************************************************************/
-void PMAPI PM_findClose(
-    void *handle)
-{
-    PM_free(handle);
-}
-
-/****************************************************************************
-REMARKS:
-Function to determine if a drive is a valid drive or not. Under Unix this
-function will return false for anything except a value of 3 (considered
-the root drive, and equivalent to C: for non-Unix systems). The drive
-numbering is:
-
-    1   - Drive A:
-    2   - Drive B:
-    3   - Drive C:
-    etc
-
-****************************************************************************/
-ibool PMAPI PM_driveValid(
-    char drive)
-{
-    RMREGS  regs;
-    regs.h.dl = (uchar)(drive - 'A' + 1);
-    regs.h.ah = 0x36;               /* Get disk information service */
-    PM_int86(0x21,&regs,&regs);
-    return regs.x.ax != 0xFFFF;     /* AX = 0xFFFF if disk is invalid */
-}
-
-/****************************************************************************
-REMARKS:
-Function to get the current working directory for the specififed drive.
-Under Unix this will always return the current working directory regardless
-of what the value of 'drive' is.
-****************************************************************************/
-void PMAPI PM_getdcwd(
-    int drive,
-    char *dir,
-    int len)
-{
-    uint oldDrive,maxDrives;
-    _dos_getdrive(&oldDrive);
-    _dos_setdrive(drive,&maxDrives);
-    getcwd(dir,len);
-    _dos_setdrive(oldDrive,&maxDrives);
-}
-
-/****************************************************************************
-REMARKS:
-Function to change the file attributes for a specific file.
-****************************************************************************/
-void PMAPI PM_setFileAttr(
-    const char *filename,
-    uint attrib)
-{
-#if defined(TNT) && defined(_MSC_VER)
-    DWORD attr = 0;
-
-    if (attrib & PM_FILE_READONLY)
-       attr |= FILE_ATTRIBUTE_READONLY;
-    if (attrib & PM_FILE_ARCHIVE)
-       attr |= FILE_ATTRIBUTE_ARCHIVE;
-    if (attrib & PM_FILE_HIDDEN)
-       attr |= FILE_ATTRIBUTE_HIDDEN;
-    if (attrib & PM_FILE_SYSTEM)
-       attr |= FILE_ATTRIBUTE_SYSTEM;
-    SetFileAttributes((LPSTR)filename, attr);
-#else
-    uint attr = 0;
-
-    if (attrib & PM_FILE_READONLY)
-       attr |= _A_RDONLY;
-    if (attrib & PM_FILE_ARCHIVE)
-       attr |= _A_ARCH;
-    if (attrib & PM_FILE_HIDDEN)
-       attr |= _A_HIDDEN;
-    if (attrib & PM_FILE_SYSTEM)
-       attr |= _A_SYSTEM;
-    _dos_setfileattr(filename,attr);
-#endif
-}
-
-/****************************************************************************
-REMARKS:
-Function to create a directory.
-****************************************************************************/
-ibool PMAPI PM_mkdir(
-    const char *filename)
-{
-#ifdef  __GNUC__
-    return mkdir(filename,S_IRUSR) == 0;
-#else
-/*AM:   return mkdir(filename) == 0; */
-    return(false);
-#endif
-}
-
-/****************************************************************************
-REMARKS:
-Function to remove a directory.
-****************************************************************************/
-ibool PMAPI PM_rmdir(
-    const char *filename)
-{
-/*AM:   return rmdir(filename) == 0; */
-    return(false);
-}
-
-/****************************************************************************
-REMARKS:
-Allocates a block of locked, physically contiguous memory. The memory
-may be required to be below the 16Meg boundary.
-****************************************************************************/
-void * PMAPI PM_allocLockedMem(
-    uint size,
-    ulong *physAddr,
-    ibool contiguous,
-    ibool below16M)
-{
-    void            *p;
-    uint            r_seg,r_off;
-    PM_lockHandle   lh;
-
-    /* Under DOS the only way to know the physical memory address is to
-     * allocate the memory below the 1Meg boundary as real mode memory.
-     * We also allocate 4095 bytes more memory than we need, so we can
-     * properly page align the start of the memory block for DMA operations.
-     */
-    if (size > 4096)
-       return NULL;
-    if ((p = PM_allocRealSeg((size + 0xFFF) & ~0xFFF,&r_seg,&r_off)) == NULL)
-       return NULL;
-    *physAddr = ((r_seg << 4) + r_off + 0xFFF) & ~0xFFF;
-    PM_lockDataPages(p,size*2,&lh);
-    return p;
-}
-
-void PMAPI PM_freeLockedMem(void *p,uint size,ibool contiguous)
-{
-    (void)size;
-    PM_freeRealSeg(p);
-}
-
-/*-------------------------------------------------------------------------*/
-/* Generic DPMI routines common to 16/32 bit code                          */
-/*-------------------------------------------------------------------------*/
-
-ulong PMAPI DPMI_mapPhysicalToLinear(ulong physAddr,ulong limit)
-{
-    PMREGS  r;
-    ulong   physOfs;
-
-    if (physAddr < 0x100000L) {
-       /* We can't map memory below 1Mb, but the linear address are already
-        * mapped 1:1 for this memory anyway so we just return the base address.
-        */
-       return physAddr;
-       }
-
-    /* Round the physical address to a 4Kb boundary and the limit to a
-     * 4Kb-1 boundary before passing the values to DPMI as some extenders
-     * will fail the calls unless this is the case. If we round the
-     * physical address, then we also add an extra offset into the address
-     * that we return.
-     */
-    physOfs = physAddr & 4095;
-    physAddr = physAddr & ~4095;
-    limit = ((limit+physOfs+1+4095) & ~4095)-1;
-
-    r.x.ax = 0x800;                 /* DPMI map physical to linear      */
-    r.x.bx = physAddr >> 16;
-    r.x.cx = physAddr & 0xFFFF;
-    r.x.si = limit >> 16;
-    r.x.di = limit & 0xFFFF;
-    PM_int386(0x31, &r, &r);
-    if (r.x.cflag)
-       return 0xFFFFFFFFUL;
-    return ((ulong)r.x.bx << 16) + r.x.cx + physOfs;
-}
-
-int PMAPI DPMI_setSelectorBase(ushort sel,ulong linAddr)
-{
-    PMREGS  r;
-
-    r.x.ax = 7;                     /* DPMI set selector base address   */
-    r.x.bx = sel;
-    r.x.cx = linAddr >> 16;
-    r.x.dx = linAddr & 0xFFFF;
-    PM_int386(0x31, &r, &r);
-    if (r.x.cflag)
-       return 0;
-    return 1;
-}
-
-ulong PMAPI DPMI_getSelectorBase(ushort sel)
-{
-    PMREGS  r;
-
-    r.x.ax = 6;                     /* DPMI get selector base address   */
-    r.x.bx = sel;
-    PM_int386(0x31, &r, &r);
-    return ((ulong)r.x.cx << 16) + r.x.dx;
-}
-
-int PMAPI DPMI_setSelectorLimit(ushort sel,ulong limit)
-{
-    PMREGS  r;
-
-    r.x.ax = 8;                     /* DPMI set selector limit          */
-    r.x.bx = sel;
-    r.x.cx = limit >> 16;
-    r.x.dx = limit & 0xFFFF;
-    PM_int386(0x31, &r, &r);
-    if (r.x.cflag)
-       return 0;
-    return 1;
-}
-
-uint PMAPI DPMI_createSelector(ulong base,ulong limit)
-{
-    uint    sel;
-    PMREGS  r;
-
-    /* Allocate 1 descriptor */
-    r.x.ax = 0;
-    r.x.cx = 1;
-    PM_int386(0x31, &r, &r);
-    if (r.x.cflag) return 0;
-    sel = r.x.ax;
-
-    /* Set the descriptor access rights (for a 32 bit page granular
-     * segment, ring 0).
-     */
-    r.x.ax = 9;
-    r.x.bx = sel;
-    r.x.cx = 0x4093;
-    PM_int386(0x31, &r, &r);
-
-    /* Map physical memory and create selector */
-    if ((base = DPMI_mapPhysicalToLinear(base,limit)) == 0xFFFFFFFFUL)
-       return 0;
-    if (!DPMI_setSelectorBase(sel,base))
-       return 0;
-    if (!DPMI_setSelectorLimit(sel,limit))
-       return 0;
-    return sel;
-}
-
-void PMAPI DPMI_freeSelector(uint sel)
-{
-    PMREGS  r;
-
-    r.x.ax = 1;
-    r.x.bx = sel;
-    PM_int386(0x31, &r, &r);
-}
-
-int PMAPI DPMI_lockLinearPages(ulong linear,ulong len)
-{
-    PMREGS  r;
-
-    r.x.ax = 0x600;                     /* DPMI Lock Linear Region      */
-    r.x.bx = (linear >> 16);            /* Linear address in BX:CX      */
-    r.x.cx = (linear & 0xFFFF);
-    r.x.si = (len >> 16);               /* Length in SI:DI              */
-    r.x.di = (len & 0xFFFF);
-    PM_int386(0x31, &r, &r);
-    return (!r.x.cflag);
-}
-
-int PMAPI DPMI_unlockLinearPages(ulong linear,ulong len)
-{
-    PMREGS  r;
-
-    r.x.ax = 0x601;                     /* DPMI Unlock Linear Region    */
-    r.x.bx = (linear >> 16);            /* Linear address in BX:CX      */
-    r.x.cx = (linear & 0xFFFF);
-    r.x.si = (len >> 16);               /* Length in SI:DI              */
-    r.x.di = (len & 0xFFFF);
-    PM_int386(0x31, &r, &r);
-    return (!r.x.cflag);
-}
-
-void * PMAPI DPMI_mapPhysicalAddr(ulong base,ulong limit,ibool isCached)
-{
-    PMSREGS sregs;
-    ulong   linAddr;
-    ulong   DSBaseAddr;
-
-    /* Get the base address for the default DS selector */
-    PM_segread(&sregs);
-    DSBaseAddr = DPMI_getSelectorBase(sregs.ds);
-    if ((base < 0x100000) && (DSBaseAddr == 0)) {
-       /* DS is zero based, so we can directly access the first 1Mb of
-        * system memory (like under DOS4GW).
-        */
-       return (void*)base;
-       }
-
-    /* Map the memory to a linear address using DPMI function 0x800 */
-    if ((linAddr = DPMI_mapPhysicalToLinear(base,limit)) == 0) {
-       if (base >= 0x100000)
-           return NULL;
-       /* If the linear address mapping fails but we are trying to
-        * map an area in the first 1Mb of system memory, then we must
-        * be running under a Windows or OS/2 DOS box. Under these
-        * environments we can use the segment wrap around as a fallback
-        * measure, as this does work properly.
-        */
-       linAddr = base;
-       }
-
-    /* Now expand the default DS selector to 4Gb so we can access it */
-    if (!DPMI_setSelectorLimit(sregs.ds,0xFFFFFFFFUL))
-       return NULL;
-
-    /* Finally enable caching for the page tables that we just mapped in,
-     * since DOS4GW and PMODE/W create the page table entries without
-     * caching enabled which hurts the performance of the linear framebuffer
-     * as it disables write combining on Pentium Pro and above processors.
-     *
-     * For those processors cache disabling is better handled through the
-     * MTRR registers anyway (we can write combine a region but disable
-     * caching) so that MMIO register regions do not screw up.
-     */
-    if (isCached) {
-       if ((PDB = _PM_getPDB()) != 0 && DSBaseAddr == 0) {
-           int     startPDB,endPDB,iPDB,startPage,endPage,start,end,iPage;
-           ulong   pageTable,*pPageTable;
-           if (!pPDB) {
-               if (PDB >= 0x100000)
-                   pPDB = (ulong*)DPMI_mapPhysicalToLinear(PDB,0xFFF);
-               else
-                   pPDB = (ulong*)PDB;
-               }
-           if (pPDB) {
-               startPDB = (linAddr >> 22) & 0x3FF;
-               startPage = (linAddr >> 12) & 0x3FF;
-               endPDB = ((linAddr+limit) >> 22) & 0x3FF;
-               endPage = ((linAddr+limit) >> 12) & 0x3FF;
-               for (iPDB = startPDB; iPDB <= endPDB; iPDB++) {
-                   pageTable = pPDB[iPDB] & ~0xFFF;
-                   if (pageTable >= 0x100000)
-                       pPageTable = (ulong*)DPMI_mapPhysicalToLinear(pageTable,0xFFF);
-                   else
-                       pPageTable = (ulong*)pageTable;
-                   start = (iPDB == startPDB) ? startPage : 0;
-                   end = (iPDB == endPDB) ? endPage : 0x3FF;
-                   for (iPage = start; iPage <= end; iPage++)
-                       pPageTable[iPage] &= ~0x18;
-                   }
-               }
-           }
-       }
-
-    /* Now return the base address of the memory into the default DS */
-    return (void*)(linAddr - DSBaseAddr);
-}
-
-/* Some DOS extender implementations do not directly support calling a
- * real mode procedure from protected mode. However we can simulate what
- * we need temporarily hooking the INT 6Ah vector with a small real mode
- * stub that will call our real mode code for us.
- */
-
-static uchar int6AHandler[] = {
-    0x00,0x00,0x00,0x00,        /*  __PMODE_callReal variable           */
-    0xFB,                       /*  sti                                 */
-    0x2E,0xFF,0x1E,0x00,0x00,   /*  call    [cs:__PMODE_callReal]       */
-    0xCF,                       /*  iretf                               */
-    };
-static uchar *crPtr = NULL; /* Pointer to of int 6A handler         */
-static uint crRSeg,crROff;  /* Real mode seg:offset of handler      */
-
-void PMAPI PM_callRealMode(uint seg,uint off, RMREGS *in,
-    RMSREGS *sregs)
-{
-    uchar   *p;
-    uint    oldSeg,oldOff;
-
-    if (!crPtr) {
-       /* Allocate and copy the memory block only once */
-       crPtr = PM_allocRealSeg(sizeof(int6AHandler), &crRSeg, &crROff);
-       memcpy(crPtr,int6AHandler,sizeof(int6AHandler));
-       }
-    PM_setWord(crPtr,off);              /* Plug in address to call  */
-    PM_setWord(crPtr+2,seg);
-    p = PM_mapRealPointer(0,0x6A * 4);
-    oldOff = PM_getWord(p);             /* Save old handler address */
-    oldSeg = PM_getWord(p+2);
-    PM_setWord(p,crROff+4);             /* Hook 6A handler          */
-    PM_setWord(p+2,crRSeg);
-    PM_int86x(0x6A, in, in, sregs);     /* Call real mode code      */
-    PM_setWord(p,oldOff);               /* Restore old handler      */
-    PM_setWord(p+2,oldSeg);
-}
-
-void * PMAPI PM_getBIOSPointer(void)
-{ return PM_mapPhysicalAddr(0x400,0xFFFF,true); }
-
-void * PMAPI PM_getA0000Pointer(void)
-{ return PM_mapPhysicalAddr(0xA0000,0xFFFF,true); }
-
-void * PMAPI PM_mapPhysicalAddr(ulong base,ulong limit,ibool isCached)
-{ return DPMI_mapPhysicalAddr(base,limit,isCached); }
-
-void PMAPI PM_freePhysicalAddr(void *ptr,ulong limit)
-{
-    /* Mapping cannot be free */
-}
-
-ulong PMAPI PM_getPhysicalAddr(void *p)
-{
-    /* TODO: This function should find the physical address of a linear */
-    /*       address. */
-    (void)p;
-    return 0xFFFFFFFFUL;
-}
-
-void * PMAPI PM_mapToProcess(void *base,ulong limit)
-{
-    (void)limit;
-    return (void*)base;
-}
-
-void * PMAPI PM_mapRealPointer(uint r_seg,uint r_off)
-{
-    static uchar *zeroPtr = NULL;
-
-    if (!zeroPtr)
-       zeroPtr = PM_mapPhysicalAddr(0,0xFFFFF,true);
-    return (void*)(zeroPtr + MK_PHYS(r_seg,r_off));
-}
-
-void * PMAPI PM_allocRealSeg(uint size,uint *r_seg,uint *r_off)
-{
-    PMREGS      r;
-    void        *p;
-
-    r.x.ax = 0x100;                 /* DPMI allocate DOS memory         */
-    r.x.bx = (size + 0xF) >> 4;     /* number of paragraphs             */
-    PM_int386(0x31, &r, &r);
-    if (r.x.cflag)
-       return NULL;                /* DPMI call failed                 */
-    *r_seg = r.x.ax;                /* Real mode segment                */
-    *r_off = 0;
-    p = PM_mapRealPointer(*r_seg,*r_off);
-    _PM_addRealModeBlock(p,r.x.dx);
-    return p;
-}
-
-void PMAPI PM_freeRealSeg(void *mem)
-{
-    PMREGS  r;
-
-    r.x.ax = 0x101;                     /* DPMI free DOS memory         */
-    r.x.dx = _PM_findRealModeBlock(mem);/* DX := selector from 0x100    */
-    PM_int386(0x31, &r, &r);
-}
-
-static DPMI_handler_t   DPMI_int10 = NULL;
-
-void PMAPI DPMI_setInt10Handler(DPMI_handler_t handler)
-{
-    DPMI_int10 = handler;
-}
-
-void PMAPI DPMI_int86(int intno, DPMI_regs *regs)
-{
-    PMREGS      r;
-    PMSREGS     sr;
-
-    if (intno == 0x10 && DPMI_int10) {
-       if (DPMI_int10(regs))
-           return;
-       }
-    PM_segread(&sr);
-    r.x.ax = 0x300;                 /* DPMI issue real interrupt    */
-    r.h.bl = intno;
-    r.h.bh = 0;
-    r.x.cx = 0;
-    sr.es = sr.ds;
-    r.e.edi = (uint)regs;
-    PM_int386x(0x31, &r, &r, &sr);  /* Issue the interrupt          */
-}
-
-#define IN(reg)     rmregs.reg = in->e.reg
-#define OUT(reg)    out->e.reg = rmregs.reg
-
-int PMAPI PM_int86(int intno, RMREGS *in, RMREGS *out)
-{
-    DPMI_regs   rmregs;
-
-    memset(&rmregs, 0, sizeof(rmregs));
-    IN(eax); IN(ebx); IN(ecx); IN(edx); IN(esi); IN(edi);
-
-/* These real mode ints may cause crashes. */
-/*AM:   DPMI_int86(intno,&rmregs);      /###* DPMI issue real interrupt    */
-
-    OUT(eax); OUT(ebx); OUT(ecx); OUT(edx); OUT(esi); OUT(edi);
-    out->x.cflag = rmregs.flags & 0x1;
-    return out->x.ax;
-}
-
-int PMAPI PM_int86x(int intno, RMREGS *in, RMREGS *out,
-    RMSREGS *sregs)
-{
-    DPMI_regs   rmregs;
-
-    memset(&rmregs, 0, sizeof(rmregs));
-    IN(eax); IN(ebx); IN(ecx); IN(edx); IN(esi); IN(edi);
-    rmregs.es = sregs->es;
-    rmregs.ds = sregs->ds;
-
-/*AM:   DPMI_int86(intno,&rmregs);      /###* DPMI issue real interrupt    */
-
-    OUT(eax); OUT(ebx); OUT(ecx); OUT(edx); OUT(esi); OUT(edi);
-    sregs->es = rmregs.es;
-    sregs->cs = rmregs.cs;
-    sregs->ss = rmregs.ss;
-    sregs->ds = rmregs.ds;
-    out->x.cflag = rmregs.flags & 0x1;
-    return out->x.ax;
-}
-
-#pragma pack(1)
-
-typedef struct {
-       uint    LargestBlockAvail;
-       uint    MaxUnlockedPage;
-       uint    LargestLockablePage;
-       uint    LinAddrSpace;
-       uint    NumFreePagesAvail;
-       uint    NumPhysicalPagesFree;
-       uint    TotalPhysicalPages;
-       uint    FreeLinAddrSpace;
-       uint    SizeOfPageFile;
-       uint    res[3];
-       } MemInfo;
-
-#pragma pack()
-
-void PMAPI PM_availableMemory(ulong *physical,ulong *total)
-{
-    PMREGS  r;
-    PMSREGS sr;
-    MemInfo memInfo;
-
-    PM_segread(&sr);
-    r.x.ax = 0x500;                 /* DPMI get free memory info */
-    sr.es = sr.ds;
-    r.e.edi = (uint)&memInfo;
-    PM_int386x(0x31, &r, &r, &sr);  /* Issue the interrupt */
-    *physical = memInfo.NumPhysicalPagesFree * 4096;
-    *total = memInfo.LargestBlockAvail;
-    if (*total < *physical)
-       *physical = *total;
-}
-
-/****************************************************************************
-REMARKS:
-Function to get the file attributes for a specific file.
-****************************************************************************/
-uint PMAPI PM_getFileAttr(
-    const char *filename)
-{
-    /* TODO: Implement this! */
-    return 0;
-}
-
-/****************************************************************************
-REMARKS:
-Function to get the file time and date for a specific file.
-****************************************************************************/
-ibool PMAPI PM_getFileTime(
-    const char *filename,
-    ibool gmTime,
-    PM_time *time)
-{
-    /* TODO: Implement this! */
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-Function to set the file time and date for a specific file.
-****************************************************************************/
-ibool PMAPI PM_setFileTime(
-    const char *filename,
-    ibool gmTime,
-    PM_time *time)
-{
-    /* TODO: Implement this! */
-    return false;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/smx/pmsmx.c b/board/MAI/bios_emulator/scitech/src/pm/smx/pmsmx.c
deleted file mode 100644 (file)
index 98e31bc..0000000
+++ /dev/null
@@ -1,471 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  32-bit SMX embedded systems development
-*
-* Description:  Implementation for the OS Portability Manager Library, which
-*               contains functions to implement OS specific services in a
-*               generic, cross platform API. Porting the OS Portability
-*               Manager library is the first step to porting any SciTech
-*               products to a new platform.
-*
-****************************************************************************/
-
-#include "pmapi.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <dos.h>
-#include "smx/ps2mouse.h"
-
-/*--------------------------- Global variables ----------------------------*/
-
-static int  globalDataStart;
-
-PM_criticalHandler  _VARAPI _PM_critHandler = NULL;
-PM_breakHandler     _VARAPI _PM_breakHandler = NULL;
-PM_intHandler       _VARAPI _PM_timerHandler = NULL;
-PM_intHandler       _VARAPI _PM_rtcHandler = NULL;
-PM_intHandler       _VARAPI _PM_keyHandler = NULL;
-PM_key15Handler     _VARAPI _PM_key15Handler = NULL;
-PM_mouseHandler     _VARAPI _PM_mouseHandler = NULL;
-PM_intHandler       _VARAPI _PM_int10Handler = NULL;
-int                 _VARAPI _PM_mouseMask;
-
-uchar *     _VARAPI _PM_ctrlCPtr;               /* Location of Ctrl-C flag      */
-uchar *     _VARAPI _PM_ctrlBPtr;               /* Location of Ctrl-Break flag  */
-uchar *     _VARAPI _PM_critPtr;                /* Location of Critical error Bf*/
-PMFARPTR    _VARAPI _PM_prevTimer = PMNULL;     /* Previous timer handler       */
-PMFARPTR    _VARAPI _PM_prevRTC = PMNULL;       /* Previous RTC handler         */
-PMFARPTR    _VARAPI _PM_prevKey = PMNULL;       /* Previous key handler         */
-PMFARPTR    _VARAPI _PM_prevKey15 = PMNULL;     /* Previous key15 handler       */
-PMFARPTR    _VARAPI _PM_prevBreak = PMNULL;     /* Previous break handler       */
-PMFARPTR    _VARAPI _PM_prevCtrlC = PMNULL;     /* Previous CtrlC handler       */
-PMFARPTR    _VARAPI _PM_prevCritical = PMNULL;  /* Previous critical handler    */
-long        _VARAPI _PM_prevRealTimer;          /* Previous real mode timer     */
-long        _VARAPI _PM_prevRealRTC;            /* Previous real mode RTC       */
-long        _VARAPI _PM_prevRealKey;            /* Previous real mode key       */
-long        _VARAPI _PM_prevRealKey15;          /* Previous real mode key15     */
-long        _VARAPI _PM_prevRealInt10;          /* Previous real mode int 10h   */
-static uchar        _PM_oldCMOSRegA;            /* CMOS register A contents     */
-static uchar        _PM_oldCMOSRegB;            /* CMOS register B contents     */
-static uchar        _PM_oldRTCPIC2;             /* Mask value for RTC IRQ8      */
-
-/*----------------------------- Implementation ----------------------------*/
-
-/* Globals for locking interrupt handlers in _pmsmx.asm */
-
-extern int  _ASMAPI _PM_pmsmxDataStart;
-extern int  _ASMAPI _PM_pmsmxDataEnd;
-void _ASMAPI _PM_pmsmxCodeStart(void);
-void _ASMAPI _PM_pmsmxCodeEnd(void);
-
-/* Protected mode interrupt handlers, also called by PM callbacks below */
-
-void _ASMAPI _PM_timerISR(void);
-void _ASMAPI _PM_rtcISR(void);
-void _ASMAPI _PM_keyISR(void);
-void _ASMAPI _PM_key15ISR(void);
-void _ASMAPI _PM_breakISR(void);
-void _ASMAPI _PM_ctrlCISR(void);
-void _ASMAPI _PM_criticalISR(void);
-void _ASMAPI _PM_mouseISR(void);
-void _ASMAPI _PM_int10PMCB(void);
-
-/* Protected mode DPMI callback handlers */
-
-void _ASMAPI _PM_mousePMCB(void);
-
-/* Routine to install a mouse handler function */
-
-void _ASMAPI _PM_setMouseHandler(int mask);
-
-/* Routine to allocate DPMI real mode callback routines */
-
-void _ASMAPI _DPMI_allocateCallback(void (_ASMAPI *pmcode)(),void *rmregs,long *RMCB);
-void _ASMAPI _DPMI_freeCallback(long RMCB);
-
-/* DPMI helper functions in PMLITE.C */
-
-ulong   PMAPI DPMI_mapPhysicalToLinear(ulong physAddr,ulong limit);
-int     PMAPI DPMI_setSelectorBase(ushort sel,ulong linAddr);
-ulong   PMAPI DPMI_getSelectorBase(ushort sel);
-int     PMAPI DPMI_setSelectorLimit(ushort sel,ulong limit);
-uint    PMAPI DPMI_createSelector(ulong base,ulong limit);
-void    PMAPI DPMI_freeSelector(uint sel);
-int     PMAPI DPMI_lockLinearPages(ulong linear,ulong len);
-int     PMAPI DPMI_unlockLinearPages(ulong linear,ulong len);
-
-/* Functions to read and write CMOS registers */
-
-uchar   PMAPI _PM_readCMOS(int index);
-void    PMAPI _PM_writeCMOS(int index,uchar value);
-
-/*-------------------------------------------------------------------------*/
-/* Generic routines common to all environments                             */
-/*-------------------------------------------------------------------------*/
-
-void PMAPI PM_resetMouseDriver(int hardReset)
-{
-    ps2MouseReset();
-}
-
-void PMAPI PM_setRealTimeClockFrequency(int frequency)
-{
-    static short convert[] = {
-       8192,
-       4096,
-       2048,
-       1024,
-       512,
-       256,
-       128,
-       64,
-       32,
-       16,
-       8,
-       4,
-       2,
-       -1,
-       };
-    int i;
-
-    /* First clear any pending RTC timeout if not cleared */
-    _PM_readCMOS(0x0C);
-    if (frequency == 0) {
-       /* Disable RTC timout */
-       _PM_writeCMOS(0x0A,_PM_oldCMOSRegA);
-       _PM_writeCMOS(0x0B,_PM_oldCMOSRegB & 0x0F);
-       }
-    else {
-       /* Convert frequency value to RTC clock indexes */
-       for (i = 0; convert[i] != -1; i++) {
-           if (convert[i] == frequency)
-               break;
-           }
-
-       /* Set RTC timout value and enable timeout */
-       _PM_writeCMOS(0x0A,(_PM_oldCMOSRegA & 0xF0) | (i+3));
-       _PM_writeCMOS(0x0B,(_PM_oldCMOSRegB & 0x0F) | 0x40);
-       }
-}
-
-static void PMAPI lockPMHandlers(void)
-{
-    static int      locked = 0;
-    int             stat = 0;
-    PM_lockHandle   lh;
-
-    /* Lock all of the code and data used by our protected mode interrupt
-     * handling routines, so that it will continue to work correctly
-     * under real mode.
-     */
-    if (!locked) {
-       PM_saveDS();
-       stat  = !PM_lockDataPages(&globalDataStart-2048,4096,&lh);
-       stat |= !PM_lockDataPages(&_PM_pmsmxDataStart,(int)&_PM_pmsmxDataEnd - (int)&_PM_pmsmxDataStart,&lh);
-       stat |= !PM_lockCodePages((__codePtr)_PM_pmsmxCodeStart,(int)_PM_pmsmxCodeEnd-(int)_PM_pmsmxCodeStart,&lh);
-       if (stat) {
-           printf("Page locking services failed - interrupt handling not safe!\n");
-           exit(1);
-           }
-       locked = 1;
-       }
-}
-
-void PMAPI PM_getPMvect(int intno, PMFARPTR *isr)
-{
-    PMREGS  regs;
-
-    regs.x.ax = 0x204;
-    regs.h.bl = intno;
-    PM_int386(0x31,&regs,&regs);
-    isr->sel = regs.x.cx;
-    isr->off = regs.e.edx;
-}
-
-void PMAPI PM_setPMvect(int intno, PM_intHandler isr)
-{
-    PMSREGS sregs;
-    PMREGS  regs;
-
-    PM_saveDS();
-    regs.x.ax = 0x205;          /* Set protected mode vector        */
-    regs.h.bl = intno;
-    PM_segread(&sregs);
-    regs.x.cx = sregs.cs;
-    regs.e.edx = (uint)isr;
-    PM_int386(0x31,&regs,&regs);
-}
-
-void PMAPI PM_restorePMvect(int intno, PMFARPTR isr)
-{
-    PMREGS  regs;
-
-    regs.x.ax = 0x205;
-    regs.h.bl = intno;
-    regs.x.cx = isr.sel;
-    regs.e.edx = isr.off;
-    PM_int386(0x31,&regs,&regs);
-}
-
-static long prevRealBreak;      /* Previous real mode break handler     */
-static long prevRealCtrlC;      /* Previous real mode CtrlC handler     */
-static long prevRealCritical;   /* Prev real mode critical handler      */
-
-int PMAPI PM_setMouseHandler(int mask, PM_mouseHandler mh)
-{
-    lockPMHandlers();           /* Ensure our handlers are locked   */
-
-    _PM_mouseHandler = mh;
-    return 0;
-}
-
-void PMAPI PM_restoreMouseHandler(void)
-{
-    if (_PM_mouseHandler)
-       _PM_mouseHandler = NULL;
-}
-
-static void getISR(int intno, PMFARPTR *pmisr, long *realisr)
-{
-    PM_getPMvect(intno,pmisr);
-}
-
-static void restoreISR(int intno, PMFARPTR pmisr, long realisr)
-{
-    PM_restorePMvect(intno,pmisr);
-}
-
-static void setISR(int intno, void (* PMAPI pmisr)())
-{
-    lockPMHandlers();           /* Ensure our handlers are locked   */
-    PM_setPMvect(intno,pmisr);
-}
-
-void PMAPI PM_setTimerHandler(PM_intHandler th)
-{
-    getISR(PM_IRQ0, &_PM_prevTimer, &_PM_prevRealTimer);
-    _PM_timerHandler = th;
-    setISR(PM_IRQ0, _PM_timerISR);
-}
-
-void PMAPI PM_restoreTimerHandler(void)
-{
-    if (_PM_timerHandler) {
-       restoreISR(PM_IRQ0, _PM_prevTimer, _PM_prevRealTimer);
-       _PM_timerHandler = NULL;
-       }
-}
-
-ibool PMAPI PM_setRealTimeClockHandler(PM_intHandler th,int frequency)
-{
-    /* Save the old CMOS real time clock values */
-    _PM_oldCMOSRegA = _PM_readCMOS(0x0A);
-    _PM_oldCMOSRegB = _PM_readCMOS(0x0B);
-
-    /* Set the real time clock interrupt handler */
-    getISR(0x70, &_PM_prevRTC, &_PM_prevRealRTC);
-    _PM_rtcHandler = th;
-    setISR(0x70, _PM_rtcISR);
-
-    /* Program the real time clock default frequency */
-    PM_setRealTimeClockFrequency(frequency);
-
-    /* Unmask IRQ8 in the PIC2 */
-    _PM_oldRTCPIC2 = PM_inpb(0xA1);
-    PM_outpb(0xA1,_PM_oldRTCPIC2 & 0xFE);
-    return true;
-}
-
-void PMAPI PM_restoreRealTimeClockHandler(void)
-{
-    if (_PM_rtcHandler) {
-       /* Restore CMOS registers and mask RTC clock */
-       _PM_writeCMOS(0x0A,_PM_oldCMOSRegA);
-       _PM_writeCMOS(0x0B,_PM_oldCMOSRegB);
-       PM_outpb(0xA1,(PM_inpb(0xA1) & 0xFE) | (_PM_oldRTCPIC2 & ~0xFE));
-
-       /* Restore the interrupt vector */
-       restoreISR(0x70, _PM_prevRTC, _PM_prevRealRTC);
-       _PM_rtcHandler = NULL;
-       }
-}
-
-void PMAPI PM_setKeyHandler(PM_intHandler kh)
-{
-    getISR(PM_IRQ1, &_PM_prevKey, &_PM_prevRealKey);
-    _PM_keyHandler = kh;
-    setISR(PM_IRQ1, _PM_keyISR);
-}
-
-void PMAPI PM_restoreKeyHandler(void)
-{
-    if (_PM_keyHandler) {
-       restoreISR(PM_IRQ1, _PM_prevKey, _PM_prevRealKey);
-       _PM_keyHandler = NULL;
-       }
-}
-
-void PMAPI PM_setKey15Handler(PM_key15Handler kh)
-{
-    getISR(0x15, &_PM_prevKey15, &_PM_prevRealKey15);
-    _PM_key15Handler = kh;
-    setISR(0x15, _PM_key15ISR);
-}
-
-void PMAPI PM_restoreKey15Handler(void)
-{
-    if (_PM_key15Handler) {
-       restoreISR(0x15, _PM_prevKey15, _PM_prevRealKey15);
-       _PM_key15Handler = NULL;
-       }
-}
-
-/* Real mode Ctrl-C and Ctrl-Break handler. This handler simply sets a
- * flag in the real mode code segment and exit. We save the location
- * of this flag in real mode memory so that both the real mode and
- * protected mode code will be modifying the same flags.
- */
-
-static uchar ctrlHandler[] = {
-    0x00,0x00,0x00,0x00,            /*  ctrlBFlag                       */
-    0x66,0x2E,0xC7,0x06,0x00,0x00,
-    0x01,0x00,0x00,0x00,            /*  mov     [cs:ctrlBFlag],1        */
-    0xCF,                           /*  iretf                           */
-    };
-
-void PMAPI PM_installAltBreakHandler(PM_breakHandler bh)
-{
-    uint    rseg,roff;
-
-    getISR(0x1B, &_PM_prevBreak, &prevRealBreak);
-    getISR(0x23, &_PM_prevCtrlC, &prevRealCtrlC);
-    _PM_breakHandler = bh;
-    setISR(0x1B, _PM_breakISR);
-    setISR(0x23, _PM_ctrlCISR);
-
-    /* Hook the real mode vectors for these handlers, as these are not
-     * normally reflected by the DPMI server up to protected mode
-     */
-    _PM_ctrlBPtr = PM_allocRealSeg(sizeof(ctrlHandler)*2, &rseg, &roff);
-    memcpy(_PM_ctrlBPtr,ctrlHandler,sizeof(ctrlHandler));
-    memcpy(_PM_ctrlBPtr+sizeof(ctrlHandler),ctrlHandler,sizeof(ctrlHandler));
-    _PM_ctrlCPtr = _PM_ctrlBPtr + sizeof(ctrlHandler);
-    _PM_setRMvect(0x1B,((long)rseg << 16) | (roff+4));
-    _PM_setRMvect(0x23,((long)rseg << 16) | (roff+sizeof(ctrlHandler)+4));
-}
-
-void PMAPI PM_installBreakHandler(void)
-{
-    PM_installAltBreakHandler(NULL);
-}
-
-void PMAPI PM_restoreBreakHandler(void)
-{
-    if (_PM_prevBreak.sel) {
-       restoreISR(0x1B, _PM_prevBreak, prevRealBreak);
-       restoreISR(0x23, _PM_prevCtrlC, prevRealCtrlC);
-       _PM_prevBreak.sel = 0;
-       _PM_breakHandler = NULL;
-       PM_freeRealSeg(_PM_ctrlBPtr);
-       }
-}
-
-/* Real mode Critical Error handler. This handler simply saves the AX and
- * DI values in the real mode code segment and exits. We save the location
- * of this flag in real mode memory so that both the real mode and
- * protected mode code will be modifying the same flags.
- */
-
-static uchar criticalHandler[] = {
-    0x00,0x00,                      /*  axCode                          */
-    0x00,0x00,                      /*  diCode                          */
-    0x2E,0xA3,0x00,0x00,            /*  mov     [cs:axCode],ax          */
-    0x2E,0x89,0x3E,0x02,0x00,       /*  mov     [cs:diCode],di          */
-    0xB8,0x03,0x00,                 /*  mov     ax,3                    */
-    0xCF,                           /*  iretf                           */
-    };
-
-void PMAPI PM_installAltCriticalHandler(PM_criticalHandler ch)
-{
-    uint    rseg,roff;
-
-    getISR(0x24, &_PM_prevCritical, &prevRealCritical);
-    _PM_critHandler = ch;
-    setISR(0x24, _PM_criticalISR);
-
-    /* Hook the real mode vector, as this is not normally reflected by the
-     * DPMI server up to protected mode.
-     */
-    _PM_critPtr = PM_allocRealSeg(sizeof(criticalHandler)*2, &rseg, &roff);
-    memcpy(_PM_critPtr,criticalHandler,sizeof(criticalHandler));
-    _PM_setRMvect(0x24,((long)rseg << 16) | (roff+4));
-}
-
-void PMAPI PM_installCriticalHandler(void)
-{
-    PM_installAltCriticalHandler(NULL);
-}
-
-void PMAPI PM_restoreCriticalHandler(void)
-{
-    if (_PM_prevCritical.sel) {
-       restoreISR(0x24, _PM_prevCritical, prevRealCritical);
-       PM_freeRealSeg(_PM_critPtr);
-       _PM_prevCritical.sel = 0;
-       _PM_critHandler = NULL;
-       }
-}
-
-int PMAPI PM_lockDataPages(void *p,uint len,PM_lockHandle *lh)
-{
-    PMSREGS sregs;
-    PM_segread(&sregs);
-    return DPMI_lockLinearPages((uint)p + DPMI_getSelectorBase(sregs.ds),len);
-}
-
-int PMAPI PM_unlockDataPages(void *p,uint len,PM_lockHandle *lh)
-{
-    PMSREGS sregs;
-    PM_segread(&sregs);
-    return DPMI_unlockLinearPages((uint)p + DPMI_getSelectorBase(sregs.ds),len);
-}
-
-int PMAPI PM_lockCodePages(void (*p)(),uint len,PM_lockHandle *lh)
-{
-    PMSREGS sregs;
-    PM_segread(&sregs);
-/*AM: causes minor glitch with */
-/*AM: older versions pmEasy which don't allow DPMI 06 on */
-/*AM: Code selector 0x0C -- assume base is 0 which it should be. */
-    return DPMI_lockLinearPages((uint)p,len);
-}
-
-int PMAPI PM_unlockCodePages(void (*p)(),uint len,PM_lockHandle *lh)
-{
-    PMSREGS sregs;
-    PM_segread(&sregs);
-    return DPMI_unlockLinearPages((uint)p,len);
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/smx/vflat.c b/board/MAI/bios_emulator/scitech/src/pm/smx/vflat.c
deleted file mode 100644 (file)
index 579ef2c..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Any
-*
-* Description:  Dummy module; no virtual framebuffer for this OS
-*
-****************************************************************************/
-
-#include "pmapi.h"
-
-ibool PMAPI VF_available(void)
-{
-    return false;
-}
-
-void * PMAPI VF_init(ulong baseAddr,int bankSize,int codeLen,void *bankFunc)
-{
-    baseAddr = baseAddr;
-    bankSize = bankSize;
-    codeLen = codeLen;
-    bankFunc = bankFunc;
-    return NULL;
-}
-
-void PMAPI VF_exit(void)
-{
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/smx/ztimer.c b/board/MAI/bios_emulator/scitech/src/pm/smx/ztimer.c
deleted file mode 100644 (file)
index 7941192..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-/****************************************************************************
-*
-*                         Ultra Long Period Timer
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  32-bit SMX embedded systems development
-*
-* Description:  OS specific implementation for the Zen Timer functions.
-*     LZTimer not supported for smx (as needed for i486 processors), only
-*     ULZTimer is supported at this time.
-*
-****************************************************************************/
-
-/*---------------------------- Global smx variables -----------------------*/
-
-extern ulong      _cdecl etime;     /* elapsed time */
-extern ulong      _cdecl xticks_per_second(void);
-
-/*----------------------------- Implementation ----------------------------*/
-
-/* External assembler functions */
-
-void    _ASMAPI LZ_disable(void);
-void    _ASMAPI LZ_enable(void);
-
-
-/****************************************************************************
-REMARKS:
-Initialise the Zen Timer module internals.
-****************************************************************************/
-void __ZTimerInit(void)
-{
-}
-
-ulong reterr(void)
-{
-   PM_fatalError("Zen Timer not supported for smx.");
-   return(0);
-}
-
-/****************************************************************************
-REMARKS:
-Call the assembler Zen Timer functions to do the timing.
-****************************************************************************/
-#define __LZTimerOn(tm)     PM_fatalError("Zen Timer not supported for smx.")
-
-/****************************************************************************
-REMARKS:
-Call the assembler Zen Timer functions to do the timing.
-****************************************************************************/
-#define __LZTimerLap(tm)    reterr()
-
-/****************************************************************************
-REMARKS:
-Call the assembler Zen Timer functions to do the timing.
-****************************************************************************/
-#define __LZTimerOff(tm)    PM_fatalError("Zen Timer not supported for smx.")
-
-/****************************************************************************
-REMARKS:
-Call the assembler Zen Timer functions to do the timing.
-****************************************************************************/
-#define __LZTimerCount(tm)  reterr()
-
-/****************************************************************************
-REMARKS:
-Define the resolution of the long period timer as seconds per timer tick.
-****************************************************************************/
-#define ULZTIMER_RESOLUTION     (ulong)(1000000/xticks_per_second())
-
-/****************************************************************************
-REMARKS:
-Read the Long Period timer value from the smx timer tick.
-****************************************************************************/
-static ulong __ULZReadTime(void)
-{
-    ulong   ticks;
-    LZ_disable();            /* Turn of interrupts               */
-    ticks = etime;
-    LZ_enable();             /* Turn on interrupts again         */
-    return ticks;
-}
-
-/****************************************************************************
-REMARKS:
-Compute the elapsed time from the BIOS timer tick. Note that we check to see
-whether a midnight boundary has passed, and if so adjust the finish time to
-account for this. We cannot detect if more that one midnight boundary has
-passed, so if this happens we will be generating erronous results.
-****************************************************************************/
-ulong __ULZElapsedTime(ulong start,ulong finish)
-{
-    if (finish < start)
-       finish += xticks_per_second() * 3600 *24;       /* Number of ticks in 24 hours      */
-    return finish - start;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/stub/cpuinfo.c b/board/MAI/bios_emulator/scitech/src/pm/stub/cpuinfo.c
deleted file mode 100644 (file)
index 0615e90..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/****************************************************************************
-*
-*                         Ultra Long Period Timer
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  *** TODO: ADD YOUR OS ENVIRONMENT NAME HERE ***
-*
-* Description:  Module to implement OS specific services to measure the
-*               CPU frequency.
-*
-****************************************************************************/
-
-/*----------------------------- Implementation ----------------------------*/
-
-/****************************************************************************
-REMARKS:
-Increase the thread priority to maximum, if possible.
-****************************************************************************/
-static int SetMaxThreadPriority(void)
-{
-    /* TODO: If you have thread priorities, increase it to maximum for the */
-    /*       thread for timing the CPU frequency. */
-    return oldPriority;
-}
-
-/****************************************************************************
-REMARKS:
-Restore the original thread priority.
-****************************************************************************/
-static void RestoreThreadPriority(
-    int priority)
-{
-    /* TODO: Restore the original thread priority on exit. */
-}
-
-/****************************************************************************
-REMARKS:
-Initialise the counter and return the frequency of the counter.
-****************************************************************************/
-static void GetCounterFrequency(
-    CPU_largeInteger *freq)
-{
-    /* TODO: Return the frequency of the counter in here. You should try to */
-    /*       normalise this value to be around 100,000 ticks per second. */
-    freq->low = 0;
-    freq->high = 0;
-}
-
-/****************************************************************************
-REMARKS:
-Read the counter and return the counter value.
-
-TODO: Implement this to read the counter. It should be done as a macro
-      for accuracy.
-****************************************************************************/
-#define GetCounter(t)               \
-{                                   \
-    (t)->low = 0;                   \
-    (t)->high = 0;                  \
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/stub/event.c b/board/MAI/bios_emulator/scitech/src/pm/stub/event.c
deleted file mode 100644 (file)
index 204c492..0000000
+++ /dev/null
@@ -1,199 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  *** TODO: ADD YOUR OS ENVIRONMENT NAME HERE ***
-*
-* Description:  **** implementation for the SciTech cross platform
-*               event library.
-*
-****************************************************************************/
-
-/*---------------------------- Global Variables ---------------------------*/
-
-static ushort       keyUpMsg[256] = {0};/* Table of key up messages     */
-static int          rangeX,rangeY;      /* Range of mouse coordinates   */
-
-/*---------------------------- Implementation -----------------------------*/
-
-/* These are not used under non-DOS systems */
-#define _EVT_disableInt()       1
-#define _EVT_restoreInt(flags)
-
-/****************************************************************************
-PARAMETERS:
-scanCode    - Scan code to test
-
-REMARKS:
-This macro determines if a specified key is currently down at the
-time that the call is made.
-****************************************************************************/
-#define _EVT_isKeyDown(scanCode)    (keyUpMsg[scanCode] != 0)
-
-/****************************************************************************
-REMARKS:
-This function is used to return the number of ticks since system
-startup in milliseconds. This should be the same value that is placed into
-the time stamp fields of events, and is used to implement auto mouse down
-events.
-****************************************************************************/
-ulong _EVT_getTicks(void)
-{
-    /* TODO: Implement this for your OS! */
-}
-
-/****************************************************************************
-REMARKS:
-Pumps all messages in the application message queue into our event queue.
-****************************************************************************/
-static void _EVT_pumpMessages(void)
-{
-    /* TODO: The purpose of this function is to read all keyboard and mouse */
-    /*       events from the OS specific event queue, translate them and post */
-    /*       them into the SciTech event queue. */
-    /* */
-    /* NOTE: There are a couple of important things that this function must */
-    /*       take care of: */
-    /* */
-    /*  1. Support for KEYDOWN, KEYREPEAT and KEYUP is required. */
-    /* */
-    /*  2. Support for reading hardware scan code as well as ASCII */
-    /*     translated values is required. Games use the scan codes rather */
-    /*     than ASCII values. Scan codes go into the high order byte of the */
-    /*     keyboard message field. */
-    /* */
-    /*  3. Support for at least reading mouse motion data (mickeys) from the */
-    /*     mouse is required. Using the mickey values, we can then translate */
-    /*     to mouse cursor coordinates scaled to the range of the current */
-    /*     graphics display mode. Mouse values are scaled based on the */
-    /*     global 'rangeX' and 'rangeY'. */
-    /* */
-    /*  4. Support for a timestamp for the events is required, which is */
-    /*     defined as the number of milliseconds since some event (usually */
-    /*     system startup). This is the timestamp when the event occurred */
-    /*     (ie: at interrupt time) not when it was stuff into the SciTech */
-    /*     event queue. */
-    /* */
-    /*  5. Support for mouse double click events. If the OS has a native */
-    /*     mechanism to determine this, it should be used. Otherwise the */
-    /*     time stamp information will be used by the generic event code */
-    /*     to generate double click events. */
-}
-
-/****************************************************************************
-REMARKS:
-This macro/function is used to converts the scan codes reported by the
-keyboard to our event libraries normalised format. We only have one scan
-code for the 'A' key, and use shift modifiers to determine if it is a
-Ctrl-F1, Alt-F1 etc. The raw scan codes from the keyboard work this way,
-but the OS gives us 'cooked' scan codes, we have to translate them back
-to the raw format.
-****************************************************************************/
-#define _EVT_maskKeyCode(evt)
-
-/****************************************************************************
-REMARKS:
-Safely abort the event module upon catching a fatal error.
-****************************************************************************/
-void _EVT_abort()
-{
-    EVT_exit();
-    PM_fatalError("Unhandled exception!");
-}
-
-/****************************************************************************
-PARAMETERS:
-mouseMove   - Callback function to call wheneve the mouse needs to be moved
-
-REMARKS:
-Initiliase the event handling module. Here we install our mouse handling ISR
-to be called whenever any button's are pressed or released. We also build
-the free list of events in the event queue.
-
-We use handler number 2 of the mouse libraries interrupt handlers for our
-event handling routines.
-****************************************************************************/
-void EVTAPI EVT_init(
-    _EVT_mouseMoveHandler mouseMove)
-{
-    /* Initialise the event queue */
-    _mouseMove = mouseMove;
-    initEventQueue();
-    memset(keyUpMsg,0,sizeof(keyUpMsg));
-
-    /* TODO: Do any OS specific initialisation here */
-
-    /* Catch program termination signals so we can clean up properly */
-    signal(SIGABRT, _EVT_abort);
-    signal(SIGFPE, _EVT_abort);
-    signal(SIGINT, _EVT_abort);
-}
-
-/****************************************************************************
-REMARKS
-Changes the range of coordinates returned by the mouse functions to the
-specified range of values. This is used when changing between graphics
-modes set the range of mouse coordinates for the new display mode.
-****************************************************************************/
-void EVTAPI EVT_setMouseRange(
-    int xRes,
-    int yRes)
-{
-    rangeX = xRes;
-    rangeY = yRes;
-}
-
-/****************************************************************************
-REMARKS:
-Initiailises the internal event handling modules. The EVT_suspend function
-can be called to suspend event handling (such as when shelling out to DOS),
-and this function can be used to resume it again later.
-****************************************************************************/
-void EVT_resume(void)
-{
-    /* Do nothing for non DOS systems */
-}
-
-/****************************************************************************
-REMARKS
-Suspends all of our event handling operations. This is also used to
-de-install the event handling code.
-****************************************************************************/
-void EVT_suspend(void)
-{
-    /* Do nothing for non DOS systems */
-}
-
-/****************************************************************************
-REMARKS
-Exits the event module for program terminatation.
-****************************************************************************/
-void EVT_exit(void)
-{
-    /* Restore signal handlers */
-    signal(SIGABRT, SIG_DFL);
-    signal(SIGFPE, SIG_DFL);
-    signal(SIGINT, SIG_DFL);
-
-    /* TODO: Do any OS specific cleanup in here */
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/stub/oshdr.h b/board/MAI/bios_emulator/scitech/src/pm/stub/oshdr.h
deleted file mode 100644 (file)
index 1395cbc..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  BeOS
-*
-* Description:  Include file to include all OS specific header files.
-*
-****************************************************************************/
-
-/* TODO: This is where you include OS specific headers for the event handling */
-/*       library. You may leave this empty if you have no OS specific headers */
-/*       to include. */
diff --git a/board/MAI/bios_emulator/scitech/src/pm/stub/pm.c b/board/MAI/bios_emulator/scitech/src/pm/stub/pm.c
deleted file mode 100644 (file)
index 5f278c3..0000000
+++ /dev/null
@@ -1,980 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  *** TODO: ADD YOUR OS ENVIRONMENT NAME HERE ***
-*
-* Description:  Implementation for the OS Portability Manager Library, which
-*               contains functions to implement OS specific services in a
-*               generic, cross platform API. Porting the OS Portability
-*               Manager library is the first step to porting any SciTech
-*               products to a new platform.
-*
-****************************************************************************/
-
-#include "pmapi.h"
-#include "drvlib/os/os.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-/* TODO: Include any OS specific headers here! */
-
-/*--------------------------- Global variables ----------------------------*/
-
-/* TODO: If you support access to the BIOS, the following VESABuf globals */
-/*       keep track of a single VESA transfer buffer. If you don't support */
-/*       access to the BIOS, remove these variables. */
-
-static uint VESABuf_len = 1024;     /* Length of the VESABuf buffer     */
-static void *VESABuf_ptr = NULL;    /* Near pointer to VESABuf          */
-static uint VESABuf_rseg;           /* Real mode segment of VESABuf     */
-static uint VESABuf_roff;           /* Real mode offset of VESABuf      */
-
-static void (PMAPIP fatalErrorCleanup)(void) = NULL;
-
-/*----------------------------- Implementation ----------------------------*/
-
-/****************************************************************************
-REMARKS:
-Initialise the PM library.
-****************************************************************************/
-void PMAPI PM_init(void)
-{
-    /* TODO: Do any initialisation in here. This includes getting IOPL */
-    /*       access for the process calling PM_init. This will get called */
-    /*       more than once. */
-
-    /* TODO: If you support the supplied MTRR register stuff (you need to */
-    /*       be at ring 0 for this!), you should initialise it in here. */
-
-/* MTRR_init(); */
-}
-
-/****************************************************************************
-REMARKS:
-Return the operating system type identifier.
-****************************************************************************/
-long PMAPI PM_getOSType(void)
-{
-    /* TODO: Change this to return the define for your OS from drvlib/os.h */
-    return _OS_MYOS;
-}
-
-/****************************************************************************
-REMARKS:
-Return the runtime type identifier (always PM_386 for protected mode)
-****************************************************************************/
-int PMAPI PM_getModeType(void)
-{ return PM_386; }
-
-/****************************************************************************
-REMARKS:
-Add a file directory separator to the end of the filename.
-****************************************************************************/
-void PMAPI PM_backslash(
-    char *s)
-{
-    uint pos = strlen(s);
-    if (s[pos-1] != '/') {
-       s[pos] = '/';
-       s[pos+1] = '\0';
-       }
-}
-
-/****************************************************************************
-REMARKS:
-Add a user defined PM_fatalError cleanup function.
-****************************************************************************/
-void PMAPI PM_setFatalErrorCleanup(
-    void (PMAPIP cleanup)(void))
-{
-    fatalErrorCleanup = cleanup;
-}
-
-/****************************************************************************
-REMARKS:
-Report a fatal error condition and halt the program.
-****************************************************************************/
-void PMAPI PM_fatalError(
-    const char *msg)
-{
-    /* TODO: If you are running in a GUI environment without a console, */
-    /*       this needs to be changed to bring up a fatal error message */
-    /*       box and terminate the program. */
-    if (fatalErrorCleanup)
-       fatalErrorCleanup();
-    fprintf(stderr,"%s\n", msg);
-    exit(1);
-}
-
-/****************************************************************************
-REMARKS:
-Exit handler to kill the VESA transfer buffer.
-****************************************************************************/
-static void ExitVBEBuf(void)
-{
-    /* TODO: If you do not have BIOS access, remove this function. */
-    if (VESABuf_ptr)
-       PM_freeRealSeg(VESABuf_ptr);
-    VESABuf_ptr = 0;
-}
-
-/****************************************************************************
-REMARKS:
-Allocate the real mode VESA transfer buffer for communicating with the BIOS.
-****************************************************************************/
-void * PMAPI PM_getVESABuf(
-    uint *len,
-    uint *rseg,
-    uint *roff)
-{
-    /* TODO: If you do not have BIOS access, simply delete the guts of */
-    /*       this function and return NULL. */
-    if (!VESABuf_ptr) {
-       /* Allocate a global buffer for communicating with the VESA VBE */
-       if ((VESABuf_ptr = PM_allocRealSeg(VESABuf_len, &VESABuf_rseg, &VESABuf_roff)) == NULL)
-           return NULL;
-       atexit(ExitVBEBuf);
-       }
-    *len = VESABuf_len;
-    *rseg = VESABuf_rseg;
-    *roff = VESABuf_roff;
-    return VESABuf_ptr;
-}
-
-/****************************************************************************
-REMARKS:
-Check if a key has been pressed.
-****************************************************************************/
-int PMAPI PM_kbhit(void)
-{
-    /* TODO: This function checks if a key is available to be read. This */
-    /*       should be implemented, but is mostly used by the test programs */
-    /*       these days. */
-    return true;
-}
-
-/****************************************************************************
-REMARKS:
-Wait for and return the next keypress.
-****************************************************************************/
-int PMAPI PM_getch(void)
-{
-    /* TODO: This returns the ASCII code of the key pressed. This */
-    /*       should be implemented, but is mostly used by the test programs */
-    /*       these days. */
-    return 0xD;
-}
-
-/****************************************************************************
-REMARKS:
-Open a fullscreen console mode for output.
-****************************************************************************/
-int PMAPI PM_openConsole(void)
-{
-    /* TODO: Opens up a fullscreen console for graphics output. If your */
-    /*       console does not have graphics/text modes, this can be left */
-    /*       empty. The main purpose of this is to disable console switching */
-    /*       when in graphics modes if you can switch away from fullscreen */
-    /*       consoles (if you want to allow switching, this can be done */
-    /*       elsewhere with a full save/restore state of the graphics mode). */
-    return 0;
-}
-
-/****************************************************************************
-REMARKS:
-Return the size of the state buffer used to save the console state.
-****************************************************************************/
-int PMAPI PM_getConsoleStateSize(void)
-{
-    /* TODO: Returns the size of the console state buffer used to save the */
-    /*       state of the console before going into graphics mode. This is */
-    /*       used to restore the console back to normal when we are done. */
-    return 1;
-}
-
-/****************************************************************************
-REMARKS:
-Save the state of the console into the state buffer.
-****************************************************************************/
-void PMAPI PM_saveConsoleState(
-    void *stateBuf,
-    int console_id)
-{
-    /* TODO: Saves the state of the console into the state buffer. This is */
-    /*       used to restore the console back to normal when we are done. */
-    /*       We will always restore 80x25 text mode after being in graphics */
-    /*       mode, so if restoring text mode is all you need to do this can */
-    /*       be left empty. */
-}
-
-/****************************************************************************
-REMARKS:
-Restore the state of the console from the state buffer.
-****************************************************************************/
-void PMAPI PM_restoreConsoleState(
-    const void *stateBuf,
-    int console_id)
-{
-    /* TODO: Restore the state of the console from the state buffer. This is */
-    /*       used to restore the console back to normal when we are done. */
-    /*       We will always restore 80x25 text mode after being in graphics */
-    /*       mode, so if restoring text mode is all you need to do this can */
-    /*       be left empty. */
-}
-
-/****************************************************************************
-REMARKS:
-Close the console and return to non-fullscreen console mode.
-****************************************************************************/
-void PMAPI PM_closeConsole(
-    int console_id)
-{
-    /* TODO: Close the console when we are done, going back to text mode. */
-}
-
-/****************************************************************************
-REMARKS:
-Set the location of the OS console cursor.
-****************************************************************************/
-void PM_setOSCursorLocation(
-    int x,
-    int y)
-{
-    /* TODO: Set the OS console cursor location to the new value. This is */
-    /*       generally used for new OS ports (used mostly for DOS). */
-}
-
-/****************************************************************************
-REMARKS:
-Set the width of the OS console.
-****************************************************************************/
-void PM_setOSScreenWidth(
-    int width,
-    int height)
-{
-    /* TODO: Set the OS console screen width. This is generally unused for */
-    /*       new OS ports. */
-}
-
-/****************************************************************************
-REMARKS:
-Set the real time clock handler (used for software stereo modes).
-****************************************************************************/
-ibool PMAPI PM_setRealTimeClockHandler(
-    PM_intHandler ih,
-    int frequency)
-{
-    /* TODO: Install a real time clock interrupt handler. Normally this */
-    /*       will not be supported from most OS'es in user land, so an */
-    /*       alternative mechanism is needed to enable software stereo. */
-    /*       Hence leave this unimplemented unless you have a high priority */
-    /*       mechanism to call the 32-bit callback when the real time clock */
-    /*       interrupt fires. */
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-Set the real time clock frequency (for stereo modes).
-****************************************************************************/
-void PMAPI PM_setRealTimeClockFrequency(
-    int frequency)
-{
-    /* TODO: Set the real time clock interrupt frequency. Used for stereo */
-    /*       LC shutter glasses when doing software stereo. Usually sets */
-    /*       the frequency to around 2048 Hz. */
-}
-
-/****************************************************************************
-REMARKS:
-Restore the original real time clock handler.
-****************************************************************************/
-void PMAPI PM_restoreRealTimeClockHandler(void)
-{
-    /* TODO: Restores the real time clock handler. */
-}
-
-/****************************************************************************
-REMARKS:
-Return the current operating system path or working directory.
-****************************************************************************/
-char * PMAPI PM_getCurrentPath(
-    char *path,
-    int maxLen)
-{
-    return getcwd(path,maxLen);
-}
-
-/****************************************************************************
-REMARKS:
-Return the drive letter for the boot drive.
-****************************************************************************/
-char PMAPI PM_getBootDrive(void)
-{
-    /* TODO: Return the boot drive letter for the OS. Normally this is 'c' */
-    /*       for DOS based OS'es and '/' for Unices. */
-    return '/';
-}
-
-/****************************************************************************
-REMARKS:
-Return the path to the VBE/AF driver files (legacy and not used).
-****************************************************************************/
-const char * PMAPI PM_getVBEAFPath(void)
-{
-    return PM_getNucleusConfigPath();
-}
-
-/****************************************************************************
-REMARKS:
-Return the path to the Nucleus driver files.
-****************************************************************************/
-const char * PMAPI PM_getNucleusPath(void)
-{
-    /* TODO: Change this to the default path to Nucleus driver files. The */
-    /*       following is the default for Unices. */
-    char *env = getenv("NUCLEUS_PATH");
-    return env ? env : "/usr/lib/nucleus";
-}
-
-/****************************************************************************
-REMARKS:
-Return the path to the Nucleus configuration files.
-****************************************************************************/
-const char * PMAPI PM_getNucleusConfigPath(void)
-{
-    static char path[256];
-    strcpy(path,PM_getNucleusPath());
-    PM_backslash(path);
-    strcat(path,"config");
-    return path;
-}
-
-/****************************************************************************
-REMARKS:
-Return a unique identifier for the machine if possible.
-****************************************************************************/
-const char * PMAPI PM_getUniqueID(void)
-{
-    /* TODO: Return a unique ID for the machine. If a unique ID is not */
-    /*       available, return the machine name. */
-    static char buf[128];
-    gethostname(buf, 128);
-    return buf;
-}
-
-/****************************************************************************
-REMARKS:
-Get the name of the machine on the network.
-****************************************************************************/
-const char * PMAPI PM_getMachineName(void)
-{
-    /* TODO: Return the network machine name for the machine. */
-    static char buf[128];
-    gethostname(buf, 128);
-    return buf;
-}
-
-/****************************************************************************
-REMARKS:
-Return a pointer to the real mode BIOS data area.
-****************************************************************************/
-void * PMAPI PM_getBIOSPointer(void)
-{
-    /* TODO: This returns a pointer to the real mode BIOS data area. If you */
-    /*       do not support BIOS access, you can simply return NULL here. */
-    if (!zeroPtr)
-       zeroPtr = PM_mapPhysicalAddr(0,0xFFFFF,true);
-    return (void*)(zeroPtr + 0x400);
-}
-
-/****************************************************************************
-REMARKS:
-Return a pointer to 0xA0000 physical VGA graphics framebuffer.
-****************************************************************************/
-void * PMAPI PM_getA0000Pointer(void)
-{
-    static void *bankPtr;
-    if (!bankPtr)
-       bankPtr = PM_mapPhysicalAddr(0xA0000,0xFFFF,true);
-    return bankPtr;
-}
-
-/****************************************************************************
-REMARKS:
-Map a physical address to a linear address in the callers process.
-****************************************************************************/
-void * PMAPI PM_mapPhysicalAddr(
-    ulong base,
-    ulong limit,
-    ibool isCached)
-{
-    /* TODO: This function maps a physical memory address to a linear */
-    /*       address in the address space of the calling process. */
-
-    /* NOTE: This function *must* be able to handle any phsyical base */
-    /*       address, and hence you will have to handle rounding of */
-    /*       the physical base address to a page boundary (ie: 4Kb on */
-    /*       x86 CPU's) to be able to properly map in the memory */
-    /*       region. */
-
-    /* NOTE: If possible the isCached bit should be used to ensure that */
-    /*       the PCD (Page Cache Disable) and PWT (Page Write Through) */
-    /*       bits are set to disable caching for a memory mapping used */
-    /*       for MMIO register access. We also disable caching using */
-    /*       the MTRR registers for Pentium Pro and later chipsets so if */
-    /*       MTRR support is enabled for your OS then you can safely ignore */
-    /*       the isCached flag and always enable caching in the page */
-    /*       tables. */
-    return NULL;
-}
-
-/****************************************************************************
-REMARKS:
-Free a physical address mapping allocated by PM_mapPhysicalAddr.
-****************************************************************************/
-void PMAPI PM_freePhysicalAddr(
-    void *ptr,
-    ulong limit)
-{
-    /* TODO: This function will free a physical memory mapping previously */
-    /*       allocated with PM_mapPhysicalAddr() if at all possible. If */
-    /*       you can't free physical memory mappings, simply do nothing. */
-}
-
-/****************************************************************************
-REMARKS:
-Find the physical address of a linear memory address in current process.
-****************************************************************************/
-ulong PMAPI PM_getPhysicalAddr(void *p)
-{
-    /* TODO: This function should find the physical address of a linear */
-    /*       address. */
-    return 0xFFFFFFFFUL;
-}
-
-void PMAPI PM_sleep(ulong milliseconds)
-{
-    /* TODO: Put the process to sleep for milliseconds */
-}
-
-int PMAPI PM_getCOMPort(int port)
-{
-    /* TODO: Re-code this to determine real values using the Plug and Play */
-    /*       manager for the OS. */
-    switch (port) {
-       case 0: return 0x3F8;
-       case 1: return 0x2F8;
-       }
-    return 0;
-}
-
-int PMAPI PM_getLPTPort(int port)
-{
-    /* TODO: Re-code this to determine real values using the Plug and Play */
-    /*       manager for the OS. */
-    switch (port) {
-       case 0: return 0x3BC;
-       case 1: return 0x378;
-       case 2: return 0x278;
-       }
-    return 0;
-}
-
-/****************************************************************************
-REMARKS:
-Allocate a block of (unnamed) shared memory.
-****************************************************************************/
-void * PMAPI PM_mallocShared(
-    long size)
-{
-    /* TODO: This is used to allocate memory that is shared between process */
-    /*       that all access the common Nucleus drivers via a common display */
-    /*       driver DLL. If your OS does not support shared memory (or if */
-    /*       the display driver does not need to allocate shared memory */
-    /*       for each process address space), this should just call PM_malloc. */
-    return PM_malloc(size);
-}
-
-/****************************************************************************
-REMARKS:
-Free a block of shared memory.
-****************************************************************************/
-void PMAPI PM_freeShared(
-    void *ptr)
-{
-    /* TODO: Free the shared memory block. This will be called in the context */
-    /*       of the original calling process that allocated the shared */
-    /*       memory with PM_mallocShared. Simply call PM_free if you do not */
-    /*       need this. */
-    PM_free(ptr);
-}
-
-/****************************************************************************
-REMARKS:
-Map a linear memory address to the calling process address space. The
-address will have been allocated in another process using the
-PM_mapPhysicalAddr function.
-****************************************************************************/
-void * PMAPI PM_mapToProcess(
-    void *base,
-    ulong limit)
-{
-    /* TODO: This function is used to map a physical memory mapping */
-    /*       previously allocated with PM_mapPhysicalAddr into the */
-    /*       address space of the calling process. If the memory mapping */
-    /*       allocated by PM_mapPhysicalAddr is global to all processes, */
-    /*       simply return the pointer. */
-
-    /* NOTE: This function must also handle rounding to page boundaries, */
-    /*       since this function is used to map in shared memory buffers */
-    /*       allocated with PM_mapPhysicalAddr(). Hence if you aligned */
-    /*       the physical address above, then you also need to do it here. */
-    return base;
-}
-
-/****************************************************************************
-REMARKS:
-Map a real mode pointer to a protected mode pointer.
-****************************************************************************/
-void * PMAPI PM_mapRealPointer(
-    uint r_seg,
-    uint r_off)
-{
-    /* TODO: This function maps a real mode memory pointer into the */
-    /*       calling processes address space as a 32-bit near pointer. If */
-    /*       you do not support BIOS access, simply return NULL here. */
-    if (!zeroPtr)
-       zeroPtr = PM_mapPhysicalAddr(0,0xFFFFF);
-    return (void*)(zeroPtr + MK_PHYS(r_seg,r_off));
-}
-
-/****************************************************************************
-REMARKS:
-Allocate a block of real mode memory
-****************************************************************************/
-void * PMAPI PM_allocRealSeg(
-    uint size,
-    uint *r_seg,
-    uint *r_off)
-{
-    /* TODO: This function allocates a block of real mode memory for the */
-    /*       calling process used to communicate with real mode BIOS */
-    /*       functions. If you do not support BIOS access, simply return */
-    /*       NULL here. */
-    return NULL;
-}
-
-/****************************************************************************
-REMARKS:
-Free a block of real mode memory.
-****************************************************************************/
-void PMAPI PM_freeRealSeg(
-    void *mem)
-{
-    /* TODO: Frees a previously allocated real mode memory block. If you */
-    /*       do not support BIOS access, this function should be empty. */
-}
-
-/****************************************************************************
-REMARKS:
-Issue a real mode interrupt (parameters in DPMI compatible structure)
-****************************************************************************/
-void PMAPI DPMI_int86(
-    int intno,
-    DPMI_regs *regs)
-{
-    /* TODO: This function calls the real mode BIOS using the passed in */
-    /*       register structure. If you do not support real mode BIOS */
-    /*       access, this function should be empty. */
-}
-
-/****************************************************************************
-REMARKS:
-Issue a real mode interrupt.
-****************************************************************************/
-int PMAPI PM_int86(
-    int intno,
-    RMREGS *in,
-    RMREGS *out)
-{
-    /* TODO: This function calls the real mode BIOS using the passed in */
-    /*       register structure. If you do not support real mode BIOS */
-    /*       access, this function should return 0. */
-    return 0;
-}
-
-/****************************************************************************
-REMARKS:
-Issue a real mode interrupt.
-****************************************************************************/
-int PMAPI PM_int86x(
-    int intno,
-    RMREGS *in,
-    RMREGS *out,
-    RMSREGS *sregs)
-{
-    /* TODO: This function calls the real mode BIOS using the passed in */
-    /*       register structure. If you do not support real mode BIOS */
-    /*       access, this function should return 0. */
-    return 0;
-}
-
-/****************************************************************************
-REMARKS:
-Call a real mode far function.
-****************************************************************************/
-void PMAPI PM_callRealMode(
-    uint seg,
-    uint off,
-    RMREGS *in,
-    RMSREGS *sregs)
-{
-    /* TODO: This function calls a real mode far function with a far call. */
-    /*       If you do not support BIOS access, this function should be */
-    /*       empty. */
-}
-
-/****************************************************************************
-REMARKS:
-Return the amount of available memory.
-****************************************************************************/
-void PMAPI PM_availableMemory(
-    ulong *physical,
-    ulong *total)
-{
-    /* TODO: Report the amount of available memory, both the amount of */
-    /*       physical memory left and the amount of virtual memory left. */
-    /*       If the OS does not provide these services, report 0's. */
-    *physical = *total = 0;
-}
-
-/****************************************************************************
-REMARKS:
-Allocate a block of locked, physical memory for DMA operations.
-****************************************************************************/
-void * PMAPI PM_allocLockedMem(
-    uint size,
-    ulong *physAddr,
-    ibool contiguous,
-    ibool below16M)
-{
-    /* TODO: Allocate a block of locked, physical memory of the specified */
-    /*       size. This is used for bus master operations. If this is not */
-    /*       supported by the OS, return NULL and bus mastering will not */
-    /*       be used. */
-    return NULL;
-}
-
-/****************************************************************************
-REMARKS:
-Free a block of locked physical memory.
-****************************************************************************/
-void PMAPI PM_freeLockedMem(
-    void *p,
-    uint size,
-    ibool contiguous)
-{
-    /* TODO: Free a memory block allocated with PM_allocLockedMem. */
-}
-
-/****************************************************************************
-REMARKS:
-Call the VBE/Core software interrupt to change display banks.
-****************************************************************************/
-void PMAPI PM_setBankA(
-    int bank)
-{
-    RMREGS  regs;
-
-    /* TODO: This does a bank switch function by calling the real mode */
-    /*       VESA BIOS. If you do not support BIOS access, this function should */
-    /*       be empty. */
-    regs.x.ax = 0x4F05;
-    regs.x.bx = 0x0000;
-    regs.x.dx = bank;
-    PM_int86(0x10,&regs,&regs);
-}
-
-/****************************************************************************
-REMARKS:
-Call the VBE/Core software interrupt to change display banks.
-****************************************************************************/
-void PMAPI PM_setBankAB(
-    int bank)
-{
-    RMREGS  regs;
-
-    /* TODO: This does a bank switch function by calling the real mode */
-    /*       VESA BIOS. If you do not support BIOS access, this function should */
-    /*       be empty. */
-    regs.x.ax = 0x4F05;
-    regs.x.bx = 0x0000;
-    regs.x.dx = bank;
-    PM_int86(0x10,&regs,&regs);
-    regs.x.ax = 0x4F05;
-    regs.x.bx = 0x0001;
-    regs.x.dx = bank;
-    PM_int86(0x10,&regs,&regs);
-}
-
-/****************************************************************************
-REMARKS:
-Call the VBE/Core software interrupt to change display start address.
-****************************************************************************/
-void PMAPI PM_setCRTStart(
-    int x,
-    int y,
-    int waitVRT)
-{
-    RMREGS  regs;
-
-    /* TODO: This changes the display start address by calling the real mode */
-    /*       VESA BIOS. If you do not support BIOS access, this function */
-    /*       should be empty. */
-    regs.x.ax = 0x4F07;
-    regs.x.bx = waitVRT;
-    regs.x.cx = x;
-    regs.x.dx = y;
-    PM_int86(0x10,&regs,&regs);
-}
-
-/****************************************************************************
-REMARKS:
-Enable write combining for the memory region.
-****************************************************************************/
-ibool PMAPI PM_enableWriteCombine(
-    ulong base,
-    ulong length,
-    uint type)
-{
-    /* TODO: This function should enable Pentium Pro and Pentium II MTRR */
-    /*       write combining for the passed in physical memory base address */
-    /*       and length. Normally this is done via calls to an OS specific */
-    /*       device driver as this can only be done at ring 0. */
-    /* */
-    /* NOTE: This is a *very* important function to implement! If you do */
-    /*       not implement, graphics performance on the latest Intel chips */
-    /*       will be severly impaired. For sample code that can be used */
-    /*       directly in a ring 0 device driver, see the MSDOS implementation */
-    /*       which includes assembler code to do this directly (if the */
-    /*       program is running at ring 0). */
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-Execute the POST on the secondary BIOS for a controller.
-****************************************************************************/
-ibool PMAPI PM_doBIOSPOST(
-    ushort axVal,
-    ulong BIOSPhysAddr,
-    void *mappedBIOS)
-{
-    /* TODO: This function is used to run the BIOS POST code on a secondary */
-    /*       controller to initialise it for use. This is not necessary */
-    /*       for multi-controller operation, but it will make it a lot */
-    /*       more convenicent for end users (otherwise they have to boot */
-    /*       the system once with the secondary controller as primary, and */
-    /*       then boot with both controllers installed). */
-    /* */
-    /*       Even if you don't support full BIOS access, it would be */
-    /*       adviseable to be able to POST the secondary controllers in the */
-    /*       system using this function as a minimum requirement. Some */
-    /*       graphics hardware has registers that contain values that only */
-    /*       the BIOS knows about, which makes bring up a card from cold */
-    /*       reset difficult if the BIOS has not POST'ed it. */
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-Load an OS specific shared library or DLL. If the OS does not support
-shared libraries, simply return NULL.
-****************************************************************************/
-PM_MODULE PMAPI PM_loadLibrary(
-    const char *szDLLName)
-{
-    /* TODO: This function should load a native shared library from disk */
-    /*       given the path to the library. */
-    (void)szDLLName;
-    return NULL;
-}
-
-/****************************************************************************
-REMARKS:
-Get the address of a named procedure from a shared library.
-****************************************************************************/
-void * PMAPI PM_getProcAddress(
-    PM_MODULE hModule,
-    const char *szProcName)
-{
-    /* TODO: This function should return the address of a named procedure */
-    /*       from a native shared library. */
-    (void)hModule;
-    (void)szProcName;
-    return NULL;
-}
-
-/****************************************************************************
-REMARKS:
-Unload a shared library.
-****************************************************************************/
-void PMAPI PM_freeLibrary(
-    PM_MODULE hModule)
-{
-    /* TODO: This function free a previously loaded native shared library. */
-    (void)hModule;
-}
-
-/****************************************************************************
-REMARKS:
-Enable requested I/O privledge level (usually only to set to a value of
-3, and then restore it back again). If the OS is protected this function
-must be implemented in order to enable I/O port access for ring 3
-applications. The function should return the IOPL level active before
-the switch occurred so it can be properly restored.
-****************************************************************************/
-int PMAPI PM_setIOPL(
-    int level)
-{
-    /* TODO: This function should enable IOPL for the task (if IOPL is */
-    /*       not always enabled for the app through some other means). */
-    return level;
-}
-
-/****************************************************************************
-REMARKS:
-Function to find the first file matching a search criteria in a directory.
-****************************************************************************/
-void *PMAPI PM_findFirstFile(
-    const char *filename,
-    PM_findData *findData)
-{
-    /* TODO: This function should start a directory enumeration search */
-    /*       given the filename (with wildcards). The data should be */
-    /*       converted and returned in the findData standard form. */
-    (void)filename;
-    (void)findData;
-    return PM_FILE_INVALID;
-}
-
-/****************************************************************************
-REMARKS:
-Function to find the next file matching a search criteria in a directory.
-****************************************************************************/
-ibool PMAPI PM_findNextFile(
-    void *handle,
-    PM_findData *findData)
-{
-    /* TODO: This function should find the next file in directory enumeration */
-    /*       search given the search criteria defined in the call to */
-    /*       PM_findFirstFile. The data should be converted and returned */
-    /*       in the findData standard form. */
-    (void)handle;
-    (void)findData;
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-Function to close the find process
-****************************************************************************/
-void PMAPI PM_findClose(
-    void *handle)
-{
-    /* TODO: This function should close the find process. This may do */
-    /*       nothing for some OS'es. */
-    (void)handle;
-}
-
-/****************************************************************************
-REMARKS:
-Function to determine if a drive is a valid drive or not. Under Unix this
-function will return false for anything except a value of 3 (considered
-the root drive, and equivalent to C: for non-Unix systems). The drive
-numbering is:
-
-    1   - Drive A:
-    2   - Drive B:
-    3   - Drive C:
-    etc
-
-****************************************************************************/
-ibool PMAPI PM_driveValid(
-    char drive)
-{
-    if (drive == 3)
-       return true;
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-Function to get the current working directory for the specififed drive.
-Under Unix this will always return the current working directory regardless
-of what the value of 'drive' is.
-****************************************************************************/
-void PMAPI PM_getdcwd(
-    int drive,
-    char *dir,
-    int len)
-{
-    (void)drive;
-    getcwd(dir,len);
-}
-
-/****************************************************************************
-REMARKS:
-Function to change the file attributes for a specific file.
-****************************************************************************/
-void PMAPI PM_setFileAttr(
-    const char *filename,
-    uint attrib)
-{
-    /* TODO: Set the file attributes for a file */
-    (void)filename;
-    (void)attrib;
-}
-
-/****************************************************************************
-REMARKS:
-Function to create a directory.
-****************************************************************************/
-ibool PMAPI PM_mkdir(
-    const char *filename)
-{
-    return mkdir(filename) == 0;
-}
-
-/****************************************************************************
-REMARKS:
-Function to remove a directory.
-****************************************************************************/
-ibool PMAPI PM_rmdir(
-    const char *filename)
-{
-    return rmdir(filename) == 0;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/stub/vflat.c b/board/MAI/bios_emulator/scitech/src/pm/stub/vflat.c
deleted file mode 100644 (file)
index 579ef2c..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Any
-*
-* Description:  Dummy module; no virtual framebuffer for this OS
-*
-****************************************************************************/
-
-#include "pmapi.h"
-
-ibool PMAPI VF_available(void)
-{
-    return false;
-}
-
-void * PMAPI VF_init(ulong baseAddr,int bankSize,int codeLen,void *bankFunc)
-{
-    baseAddr = baseAddr;
-    bankSize = bankSize;
-    codeLen = codeLen;
-    bankFunc = bankFunc;
-    return NULL;
-}
-
-void PMAPI VF_exit(void)
-{
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/stub/ztimer.c b/board/MAI/bios_emulator/scitech/src/pm/stub/ztimer.c
deleted file mode 100644 (file)
index 820e292..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-/****************************************************************************
-*
-*                         Ultra Long Period Timer
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  *** TODO: ADD YOUR OS ENVIRONMENT NAME HERE ***
-*
-* Description:  OS specific implementation for the Zen Timer functions.
-*
-****************************************************************************/
-
-/*----------------------------- Implementation ----------------------------*/
-
-/****************************************************************************
-REMARKS:
-Initialise the Zen Timer module internals.
-****************************************************************************/
-void __ZTimerInit(void)
-{
-    /* TODO: Do any specific internal initialisation in here */
-}
-
-/****************************************************************************
-REMARKS:
-Start the Zen Timer counting.
-****************************************************************************/
-static void __LZTimerOn(
-    LZTimerObject *tm)
-{
-    /* TODO: Start the Zen Timer counting. This should be a macro if */
-    /*       possible. */
-}
-
-/****************************************************************************
-REMARKS:
-Compute the lap time since the timer was started.
-****************************************************************************/
-static ulong __LZTimerLap(
-    LZTimerObject *tm)
-{
-    /* TODO: Compute the lap time between the current time and when the */
-    /*       timer was started. */
-    return 0;
-}
-
-/****************************************************************************
-REMARKS:
-Stop the Zen Timer counting.
-****************************************************************************/
-static void __LZTimerOff(
-    LZTimerObject *tm)
-{
-    /* TODO: Stop the timer counting. Should be a macro if possible. */
-}
-
-/****************************************************************************
-REMARKS:
-Compute the elapsed time in microseconds between start and end timings.
-****************************************************************************/
-static ulong __LZTimerCount(
-    LZTimerObject *tm)
-{
-    /* TODO: Compute the elapsed time and return it. Always microseconds. */
-    return 0;
-}
-
-/****************************************************************************
-REMARKS:
-Define the resolution of the long period timer as microseconds per timer tick.
-****************************************************************************/
-#define ULZTIMER_RESOLUTION     1
-
-/****************************************************************************
-REMARKS:
-Read the Long Period timer from the OS
-****************************************************************************/
-static ulong __ULZReadTime(void)
-{
-    /* TODO: Read the long period timer from the OS. The resolution of this */
-    /*       timer should be around 1/20 of a second for timing long */
-    /*       periods if possible. */
-}
-
-/****************************************************************************
-REMARKS:
-Compute the elapsed time from the BIOS timer tick. Note that we check to see
-whether a midnight boundary has passed, and if so adjust the finish time to
-account for this. We cannot detect if more that one midnight boundary has
-passed, so if this happens we will be generating erronous results.
-****************************************************************************/
-ulong __ULZElapsedTime(ulong start,ulong finish)
-{ return finish - start; }
diff --git a/board/MAI/bios_emulator/scitech/src/pm/tests/altbrk.c b/board/MAI/bios_emulator/scitech/src/pm/tests/altbrk.c
deleted file mode 100644 (file)
index ba90262..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-*
-* Language:     ANSI C
-* Environment:  any
-*
-* Description:  Test program to check the ability to install a C based
-*               control C/break interrupt handler. Note that this
-*               alternate version does not work with all extenders.
-*
-*               Functions tested:   PM_installAltBreakHandler()
-*                                   PM_restoreBreakHandler()
-*
-*
-****************************************************************************/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include "pmapi.h"
-
-volatile int breakHit = false;
-volatile int ctrlCHit = false;
-
-#pragma off (check_stack)           /* No stack checking under Watcom   */
-
-void PMAPI breakHandler(uint bHit)
-{
-    if (bHit)
-       breakHit = true;
-    else
-       ctrlCHit = true;
-}
-
-int main(void)
-{
-    printf("Program running in ");
-    switch (PM_getModeType()) {
-       case PM_realMode:
-           printf("real mode.\n\n");
-           break;
-       case PM_286:
-           printf("16 bit protected mode.\n\n");
-           break;
-       case PM_386:
-           printf("32 bit protected mode.\n\n");
-           break;
-       }
-
-    PM_installAltBreakHandler(breakHandler);
-    printf("Control C/Break interrupt handler installed\n");
-    while (1) {
-       if (ctrlCHit) {
-           printf("Code termimated with Ctrl-C.\n");
-           break;
-           }
-       if (breakHit) {
-           printf("Code termimated with Ctrl-Break.\n");
-           break;
-           }
-       if (PM_kbhit() && PM_getch() == 0x1B) {
-           printf("No break code detected!\n");
-           break;
-           }
-       printf("Hit Ctrl-C or Ctrl-Break to exit!\n");
-       }
-
-    PM_restoreBreakHandler();
-    return 0;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/tests/altcrit.c b/board/MAI/bios_emulator/scitech/src/pm/tests/altcrit.c
deleted file mode 100644 (file)
index e137307..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-*
-* Language:     ANSI C
-* Environment:  any
-*
-* Description:  Test program to check the ability to install a C based
-*               critical error handler.
-*
-*               Functions tested:   PM_installCriticalHandler()
-*                                   PM_criticalError()
-*                                   PM_restoreCriticalHandler()
-*
-*
-****************************************************************************/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include "pmapi.h"
-
-volatile uint criticalError = false;
-volatile uint axValue;
-volatile uint diValue;
-
-#pragma off (check_stack)           /* No stack checking under Watcom   */
-
-uint PMAPI criticalHandler(uint axVal,uint diVal)
-{
-    criticalError = true;
-    axValue = axVal;
-    diValue = diVal;
-    return 3;       /* Tell MS-DOS to fail the operation */
-}
-
-int main(void)
-{
-    FILE    *f;
-
-    printf("Program running in ");
-    switch (PM_getModeType()) {
-       case PM_realMode:
-           printf("real mode.\n\n");
-           break;
-       case PM_286:
-           printf("16 bit protected mode.\n\n");
-           break;
-       case PM_386:
-           printf("32 bit protected mode.\n\n");
-           break;
-       }
-
-    PM_installAltCriticalHandler(criticalHandler);
-    printf("Critical Error handler installed - trying to read from A: drive...\n");
-    f = fopen("a:\bog.bog","rb");
-    if (f) fclose(f);
-    if (criticalError) {
-       printf("Critical error occured on INT 21h function %02X!\n",
-           axValue >> 8);
-       }
-    else
-       printf("Critical error was not caught!\n");
-    PM_restoreCriticalHandler();
-    return 0;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/tests/biosptr.c b/board/MAI/bios_emulator/scitech/src/pm/tests/biosptr.c
deleted file mode 100644 (file)
index 5fa3382..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  any
-*
-* Description:  Test program to check the ability to manipulate the
-*               BIOS data area from protected mode using the PM
-*               library. Compile and link with the appropriate command
-*               line for your DOS extender.
-*
-*               Functions tested:   PM_getBIOSSelector()
-*                                   PM_getLong()
-*                                   PM_getByte()
-*                                   PM_getWord()
-*
-****************************************************************************/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include "pmapi.h"
-
-/* Macros to obtain values from the BIOS data area */
-
-#define TICKS()     PM_getLong(bios+0x6C)
-#define KB_STAT     PM_getByte(bios+0x17)
-#define KB_HEAD     PM_getWord(bios+0x1A)
-#define KB_TAIL     PM_getWord(bios+0x1C)
-
-/* Macros for working with the keyboard buffer */
-
-#define KB_HIT()    (KB_HEAD != KB_TAIL)
-#define CTRL()      (KB_STAT & 4)
-#define SHIFT()     (KB_STAT & 2)
-#define ESC         0x1B
-
-/* Selector for BIOS data area */
-
-uchar *bios;
-
-int main(void)
-{
-    int c,done = 0;
-
-    printf("Program running in ");
-    switch (PM_getModeType()) {
-       case PM_realMode:
-           printf("real mode.\n\n");
-           break;
-       case PM_286:
-           printf("16 bit protected mode.\n\n");
-           break;
-       case PM_386:
-           printf("32 bit protected mode.\n\n");
-           break;
-       }
-
-    bios = PM_getBIOSPointer();
-    printf("Hit any key to test, Ctrl-Shift-Esc to quit\n");
-    while (!done) {
-       if (KB_HIT()) {
-           c = PM_getch();
-           if (c == 0) PM_getch();
-           printf("TIME=%-8lX ST=%02X CHAR=%02X ", TICKS(), KB_STAT, c);
-           printf("\n");
-           if ((c == ESC) && SHIFT() && CTRL())/* Ctrl-Shift-Esc */
-               break;
-           }
-       }
-
-    return 0;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/tests/block.c b/board/MAI/bios_emulator/scitech/src/pm/tests/block.c
deleted file mode 100644 (file)
index 15d503c..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Any
-*
-* Description:  Test program for the PM_blockUntilTimeout function.
-*
-****************************************************************************/
-
-#include <stdio.h>
-#include "pmapi.h"
-
-#define DELAY_MSECS 1100
-#define LOOPS       5
-
-/*-------------------------- Implementation -------------------------------*/
-
-/* The following routine takes a long count in microseconds and outputs
- * a string representing the count in seconds. It could be modified to
- * return a pointer to a static string representing the count rather
- * than printing it out.
- */
-
-void ReportTime(ulong count)
-{
-    ulong   secs;
-
-    secs = count / 1000000L;
-    count = count - secs * 1000000L;
-    printf("Time taken: %lu.%06lu seconds\n",secs,count);
-}
-
-int main(void)
-{
-    int i;
-
-    printf("Detecting processor information ...");
-    fflush(stdout);
-    printf("\n\n%s\n", CPU_getProcessorName());
-    ZTimerInit();
-    LZTimerOn();
-    for (i = 0; i < LOOPS; i++) {
-       PM_blockUntilTimeout(DELAY_MSECS);
-       ReportTime(LZTimerLap());
-       }
-    LZTimerOff();
-    return 0;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/tests/brk.c b/board/MAI/bios_emulator/scitech/src/pm/tests/brk.c
deleted file mode 100644 (file)
index 10b6446..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-*
-* Language:     ANSI C
-* Environment:  any
-*
-* Description:  Test program to check the ability to install a C based
-*               control C/break interrupt handler.
-*
-*               Functions tested:   PM_installBreakHandler()
-*                                   PM_ctrlCHit()
-*                                   PM_ctrlBreakHit()
-*                                   PM_restoreBreakHandler()
-*
-*
-****************************************************************************/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include "pmapi.h"
-
-int main(void)
-{
-    printf("Program running in ");
-    switch (PM_getModeType()) {
-       case PM_realMode:
-           printf("real mode.\n\n");
-           break;
-       case PM_286:
-           printf("16 bit protected mode.\n\n");
-           break;
-       case PM_386:
-           printf("32 bit protected mode.\n\n");
-           break;
-       }
-
-    PM_installBreakHandler();
-    printf("Control C/Break interrupt handler installed\n");
-    while (1) {
-       if (PM_ctrlCHit(1)) {
-           printf("Code termimated with Ctrl-C.\n");
-           break;
-           }
-       if (PM_ctrlBreakHit(1)) {
-           printf("Code termimated with Ctrl-Break.\n");
-           break;
-           }
-       if (PM_kbhit() && PM_getch() == 0x1B) {
-           printf("No break code detected!\n");
-           break;
-           }
-       printf("Hit Ctrl-C or Ctrl-Break to exit!\n");
-       }
-
-    PM_restoreBreakHandler();
-    return 0;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/tests/callreal.c b/board/MAI/bios_emulator/scitech/src/pm/tests/callreal.c
deleted file mode 100644 (file)
index 4d37cab..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  any
-*
-* Description:  Test program to check the ability to call a real mode
-*               procedure. We simply copy a terribly simple assembly
-*               language routine into a real mode block that we allocate,
-*               and then attempt to call the routine and verify that it
-*               was successful.
-*
-*               Functions tested:   PM_allocRealSeg()
-*                                   PM_freeRealSeg()
-*                                   PM_callRealMode()
-*
-****************************************************************************/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include "pmapi.h"
-
-/* Block of real mode code we will eventually call */
-
-static unsigned char realModeCode[] = {
-    0x93,           /*  xchg    ax,bx   */
-    0x87, 0xCA,     /*  xchg    cx,dx   */
-    0xCB            /*  retf            */
-    };
-
-int main(void)
-{
-    RMREGS          regs;
-    RMSREGS         sregs;
-    uchar           *p;
-    unsigned        r_seg,r_off;
-
-    printf("Program running in ");
-    switch (PM_getModeType()) {
-       case PM_realMode:
-           printf("real mode.\n\n");
-           break;
-       case PM_286:
-           printf("16 bit protected mode.\n\n");
-           break;
-       case PM_386:
-           printf("32 bit protected mode.\n\n");
-           break;
-       }
-
-    /* Allocate a the block of real mode memory */
-    if ((p = PM_allocRealSeg(sizeof(realModeCode), &r_seg, &r_off)) == NULL) {
-       printf("Unable to allocate real mode memory!\n");
-       exit(1);
-       }
-
-    /* Copy the real mode code */
-    memcpy(p,realModeCode,sizeof(realModeCode));
-
-    /* Now call the real mode code */
-    regs.x.ax = 1;
-    regs.x.bx = 2;
-    regs.x.cx = 3;
-    regs.x.dx = 4;
-    regs.x.si = 5;
-    regs.x.di = 6;
-    sregs.es = 7;
-    sregs.ds = 8;
-    PM_callRealMode(r_seg,r_off,&regs,&sregs);
-    if (regs.x.ax != 2 || regs.x.bx != 1 || regs.x.cx != 4 || regs.x.dx != 3
-           || regs.x.si != 5 || regs.x.di != 6 || sregs.es != 7
-           || sregs.ds != 8) {
-       printf("Real mode call failed!\n");
-       printf("\n");
-       printf("ax = %04X, bx = %04X, cx = %04X, dx = %04X\n",
-           regs.x.ax,regs.x.bx,regs.x.cx,regs.x.dx);
-       printf("si = %04X, di = %04X, es = %04X, ds = %04X\n",
-           regs.x.si,regs.x.di,sregs.es,sregs.ds);
-       }
-    else
-       printf("Real mode call succeeded!\n");
-
-    /* Free the memory we allocated */
-    PM_freeRealSeg(p);
-    return 0;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/tests/checks.c b/board/MAI/bios_emulator/scitech/src/pm/tests/checks.c
deleted file mode 100644 (file)
index 5933ac9..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Any
-*
-* Description:  Main module for building checked builds of products with
-*               assertions and trace code.
-*
-****************************************************************************/
-
-#include "scitech.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#ifdef  __WINDOWS__
-#define WIN32_LEAN_AND_MEAN
-#define STRICT
-#include <windows.h>
-#endif
-
-#ifdef  CHECKED
-
-/*---------------------------- Global variables ---------------------------*/
-
-#define LOGFILE "\\scitech.log"
-
-void (*_CHK_fail)(int fatal,const char *msg,const char *cond,const char *file,int line) = _CHK_defaultFail;
-
-/*---------------------------- Implementation -----------------------------*/
-
-/****************************************************************************
-DESCRIPTION:
-Handles fatal error and warning conditions for checked builds.
-
-HEADER:
-scitech.h
-
-REMARKS:
-This function is called whenever an inline check or warning fails in any
-of the SciTech runtime libraries. Warning conditions simply cause the
-condition to be logged to the log file and send to the system debugger
-under Window. Fatal error conditions do all of the above, and then
-terminate the program with a fatal error conditions.
-
-This handler may be overriden by the user code if necessary to replace it
-with a different handler (the MGL for instance overrides this and replaces
-it with a handler that does an MGL_exit() before terminating the application
-so that it will clean up correctly.
-****************************************************************************/
-void _CHK_defaultFail(
-    int fatal,
-    const char *msg,
-    const char *cond,
-    const char *file,
-    int line)
-{
-    char    buf[256];
-    FILE    *log = fopen(LOGFILE, "at+");
-
-    sprintf(buf,msg,cond,file,line);
-    if (log) {
-       fputs(buf,log);
-       fflush(log);
-       fclose(log);
-#ifdef  __WINDOWS__
-       OutputDebugStr(buf);
-#endif
-       }
-    if (fatal) {
-#ifdef  __WINDOWS__
-       MessageBox(NULL, buf,"Fatal Error!",MB_ICONEXCLAMATION);
-#else
-       fputs(buf,stderr);
-#endif
-       exit(-1);
-       }
-}
-
-#endif  /* CHECKED */
diff --git a/board/MAI/bios_emulator/scitech/src/pm/tests/cpu.c b/board/MAI/bios_emulator/scitech/src/pm/tests/cpu.c
deleted file mode 100644 (file)
index 30e5dd3..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Any
-*
-* Description:  Test program for the CPU detection code.
-*
-****************************************************************************/
-
-#include "ztimer.h"
-#include "pmapi.h"
-#include <stdio.h>
-#include <stdlib.h>
-
-/*----------------------------- Implementation ----------------------------*/
-
-int main(void)
-{
-    printf("Detecting processor information ...");
-    fflush(stdout);
-    printf("\n\n%s\n", CPU_getProcessorName());
-    if (CPU_haveRDTSC())
-       printf("\nProcessor supports Read Time Stamp Counter performance timer.\n");
-    return 0;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/tests/critical.c b/board/MAI/bios_emulator/scitech/src/pm/tests/critical.c
deleted file mode 100644 (file)
index 60f1251..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-*
-* Language:     ANSI C
-* Environment:  any
-*
-* Description:  Test program to check the ability to install a C based
-*               critical error handler.
-*
-*               Functions tested:   PM_installAltCriticalHandler()
-*                                   PM_restoreCriticalHandler()
-*
-*
-****************************************************************************/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include "pmapi.h"
-
-int main(void)
-{
-    FILE    *f;
-    int     axcode,dicode;
-
-    printf("Program running in ");
-    switch (PM_getModeType()) {
-       case PM_realMode:
-           printf("real mode.\n\n");
-           break;
-       case PM_286:
-           printf("16 bit protected mode.\n\n");
-           break;
-       case PM_386:
-           printf("32 bit protected mode.\n\n");
-           break;
-       }
-
-    PM_installCriticalHandler();
-    printf("Critical Error handler installed - trying to read from A: drive...\n");
-    f = fopen("a:\bog.bog","rb");
-    if (f) fclose(f);
-    if (PM_criticalError(&axcode,&dicode,1)) {
-       printf("Critical error occured on INT 21h function %02X!\n",
-           axcode >> 8);
-       }
-    else printf("Critical error was not caught!\n");
-    PM_restoreCriticalHandler();
-    return 0;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/tests/getch.c b/board/MAI/bios_emulator/scitech/src/pm/tests/getch.c
deleted file mode 100644 (file)
index 06c2180..0000000
+++ /dev/null
@@ -1,501 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Any
-*
-* Description:  Test program to test out the cross platform event handling
-*               library.
-*
-****************************************************************************/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include "pmapi.h"
-#include "event.h"
-
-/* Translation table for key codes */
-
-typedef struct {
-    int     code;
-    char    *name;
-    } KeyEntry;
-
-KeyEntry ASCIICodes[] = {
-    {ASCII_ctrlA            ,"ASCII_ctrlA"},
-    {ASCII_ctrlB            ,"ASCII_ctrlB"},
-    {ASCII_ctrlC            ,"ASCII_ctrlC"},
-    {ASCII_ctrlD            ,"ASCII_ctrlD"},
-    {ASCII_ctrlE            ,"ASCII_ctrlE"},
-    {ASCII_ctrlF            ,"ASCII_ctrlF"},
-    {ASCII_ctrlG            ,"ASCII_ctrlG"},
-    {ASCII_backspace        ,"ASCII_backspace"},
-    {ASCII_ctrlH            ,"ASCII_ctrlH"},
-    {ASCII_tab              ,"ASCII_tab"},
-    {ASCII_ctrlI            ,"ASCII_ctrlI"},
-    {ASCII_ctrlJ            ,"ASCII_ctrlJ"},
-    {ASCII_ctrlK            ,"ASCII_ctrlK"},
-    {ASCII_ctrlL            ,"ASCII_ctrlL"},
-    {ASCII_enter            ,"ASCII_enter"},
-    {ASCII_ctrlM            ,"ASCII_ctrlM"},
-    {ASCII_ctrlN            ,"ASCII_ctrlN"},
-    {ASCII_ctrlO            ,"ASCII_ctrlO"},
-    {ASCII_ctrlP            ,"ASCII_ctrlP"},
-    {ASCII_ctrlQ            ,"ASCII_ctrlQ"},
-    {ASCII_ctrlR            ,"ASCII_ctrlR"},
-    {ASCII_ctrlS            ,"ASCII_ctrlS"},
-    {ASCII_ctrlT            ,"ASCII_ctrlT"},
-    {ASCII_ctrlU            ,"ASCII_ctrlU"},
-    {ASCII_ctrlV            ,"ASCII_ctrlV"},
-    {ASCII_ctrlW            ,"ASCII_ctrlW"},
-    {ASCII_ctrlX            ,"ASCII_ctrlX"},
-    {ASCII_ctrlY            ,"ASCII_ctrlY"},
-    {ASCII_ctrlZ            ,"ASCII_ctrlZ"},
-    {ASCII_esc              ,"ASCII_esc"},
-    {ASCII_space            ,"ASCII_space"},
-    {ASCII_exclamation      ,"ASCII_exclamation"},
-    {ASCII_quote            ,"ASCII_quote"},
-    {ASCII_pound            ,"ASCII_pound"},
-    {ASCII_dollar           ,"ASCII_dollar"},
-    {ASCII_percent          ,"ASCII_percent"},
-    {ASCII_ampersand        ,"ASCII_ampersand"},
-    {ASCII_apostrophe       ,"ASCII_apostrophe"},
-    {ASCII_leftBrace        ,"ASCII_leftBrace"},
-    {ASCII_rightBrace       ,"ASCII_rightBrace"},
-    {ASCII_times            ,"ASCII_times"},
-    {ASCII_plus             ,"ASCII_plus"},
-    {ASCII_comma            ,"ASCII_comma"},
-    {ASCII_minus            ,"ASCII_minus"},
-    {ASCII_period           ,"ASCII_period"},
-    {ASCII_divide           ,"ASCII_divide"},
-    {ASCII_0                ,"ASCII_0"},
-    {ASCII_1                ,"ASCII_1"},
-    {ASCII_2                ,"ASCII_2"},
-    {ASCII_3                ,"ASCII_3"},
-    {ASCII_4                ,"ASCII_4"},
-    {ASCII_5                ,"ASCII_5"},
-    {ASCII_6                ,"ASCII_6"},
-    {ASCII_7                ,"ASCII_7"},
-    {ASCII_8                ,"ASCII_8"},
-    {ASCII_9                ,"ASCII_9"},
-    {ASCII_colon            ,"ASCII_colon"},
-    {ASCII_semicolon        ,"ASCII_semicolon"},
-    {ASCII_lessThan         ,"ASCII_lessThan"},
-    {ASCII_equals           ,"ASCII_equals"},
-    {ASCII_greaterThan      ,"ASCII_greaterThan"},
-    {ASCII_question         ,"ASCII_question"},
-    {ASCII_at               ,"ASCII_at"},
-    {ASCII_A                ,"ASCII_A"},
-    {ASCII_B                ,"ASCII_B"},
-    {ASCII_C                ,"ASCII_C"},
-    {ASCII_D                ,"ASCII_D"},
-    {ASCII_E                ,"ASCII_E"},
-    {ASCII_F                ,"ASCII_F"},
-    {ASCII_G                ,"ASCII_G"},
-    {ASCII_H                ,"ASCII_H"},
-    {ASCII_I                ,"ASCII_I"},
-    {ASCII_J                ,"ASCII_J"},
-    {ASCII_K                ,"ASCII_K"},
-    {ASCII_L                ,"ASCII_L"},
-    {ASCII_M                ,"ASCII_M"},
-    {ASCII_N                ,"ASCII_N"},
-    {ASCII_O                ,"ASCII_O"},
-    {ASCII_P                ,"ASCII_P"},
-    {ASCII_Q                ,"ASCII_Q"},
-    {ASCII_R                ,"ASCII_R"},
-    {ASCII_S                ,"ASCII_S"},
-    {ASCII_T                ,"ASCII_T"},
-    {ASCII_U                ,"ASCII_U"},
-    {ASCII_V                ,"ASCII_V"},
-    {ASCII_W                ,"ASCII_W"},
-    {ASCII_X                ,"ASCII_X"},
-    {ASCII_Y                ,"ASCII_Y"},
-    {ASCII_Z                ,"ASCII_Z"},
-    {ASCII_leftSquareBrace  ,"ASCII_leftSquareBrace"},
-    {ASCII_backSlash        ,"ASCII_backSlash"},
-    {ASCII_rightSquareBrace ,"ASCII_rightSquareBrace"},
-    {ASCII_caret            ,"ASCII_caret"},
-    {ASCII_underscore       ,"ASCII_underscore"},
-    {ASCII_leftApostrophe   ,"ASCII_leftApostrophe"},
-    {ASCII_a                ,"ASCII_a"},
-    {ASCII_b                ,"ASCII_b"},
-    {ASCII_c                ,"ASCII_c"},
-    {ASCII_d                ,"ASCII_d"},
-    {ASCII_e                ,"ASCII_e"},
-    {ASCII_f                ,"ASCII_f"},
-    {ASCII_g                ,"ASCII_g"},
-    {ASCII_h                ,"ASCII_h"},
-    {ASCII_i                ,"ASCII_i"},
-    {ASCII_j                ,"ASCII_j"},
-    {ASCII_k                ,"ASCII_k"},
-    {ASCII_l                ,"ASCII_l"},
-    {ASCII_m                ,"ASCII_m"},
-    {ASCII_n                ,"ASCII_n"},
-    {ASCII_o                ,"ASCII_o"},
-    {ASCII_p                ,"ASCII_p"},
-    {ASCII_q                ,"ASCII_q"},
-    {ASCII_r                ,"ASCII_r"},
-    {ASCII_s                ,"ASCII_s"},
-    {ASCII_t                ,"ASCII_t"},
-    {ASCII_u                ,"ASCII_u"},
-    {ASCII_v                ,"ASCII_v"},
-    {ASCII_w                ,"ASCII_w"},
-    {ASCII_x                ,"ASCII_x"},
-    {ASCII_y                ,"ASCII_y"},
-    {ASCII_z                ,"ASCII_z"},
-    {ASCII_leftCurlyBrace   ,"ASCII_leftCurlyBrace"},
-    {ASCII_verticalBar      ,"ASCII_verticalBar"},
-    {ASCII_rightCurlyBrace  ,"ASCII_rightCurlyBrace"},
-    {ASCII_tilde            ,"ASCII_tilde"},
-    {0                      ,"ASCII_unknown"},
-    };
-
-KeyEntry ScanCodes[] = {
-    {KB_padEnter            ,"KB_padEnter"},
-    {KB_padMinus            ,"KB_padMinus"},
-    {KB_padPlus             ,"KB_padPlus"},
-    {KB_padTimes            ,"KB_padTimes"},
-    {KB_padDivide           ,"KB_padDivide"},
-    {KB_padLeft             ,"KB_padLeft"},
-    {KB_padRight            ,"KB_padRight"},
-    {KB_padUp               ,"KB_padUp"},
-    {KB_padDown             ,"KB_padDown"},
-    {KB_padInsert           ,"KB_padInsert"},
-    {KB_padDelete           ,"KB_padDelete"},
-    {KB_padHome             ,"KB_padHome"},
-    {KB_padEnd              ,"KB_padEnd"},
-    {KB_padPageUp           ,"KB_padPageUp"},
-    {KB_padPageDown         ,"KB_padPageDown"},
-    {KB_padCenter           ,"KB_padCenter"},
-    {KB_F1                  ,"KB_F1"},
-    {KB_F2                  ,"KB_F2"},
-    {KB_F3                  ,"KB_F3"},
-    {KB_F4                  ,"KB_F4"},
-    {KB_F5                  ,"KB_F5"},
-    {KB_F6                  ,"KB_F6"},
-    {KB_F7                  ,"KB_F7"},
-    {KB_F8                  ,"KB_F8"},
-    {KB_F9                  ,"KB_F9"},
-    {KB_F10                 ,"KB_F10"},
-    {KB_F11                 ,"KB_F11"},
-    {KB_F12                 ,"KB_F12"},
-    {KB_left                ,"KB_left"},
-    {KB_right               ,"KB_right"},
-    {KB_up                  ,"KB_up"},
-    {KB_down                ,"KB_down"},
-    {KB_insert              ,"KB_insert"},
-    {KB_delete              ,"KB_delete"},
-    {KB_home                ,"KB_home"},
-    {KB_end                 ,"KB_end"},
-    {KB_pageUp              ,"KB_pageUp"},
-    {KB_pageDown            ,"KB_pageDown"},
-    {KB_capsLock            ,"KB_capsLock"},
-    {KB_numLock             ,"KB_numLock"},
-    {KB_scrollLock          ,"KB_scrollLock"},
-    {KB_leftShift           ,"KB_leftShift"},
-    {KB_rightShift          ,"KB_rightShift"},
-    {KB_leftCtrl            ,"KB_leftCtrl"},
-    {KB_rightCtrl           ,"KB_rightCtrl"},
-    {KB_leftAlt             ,"KB_leftAlt"},
-    {KB_rightAlt            ,"KB_rightAlt"},
-    {KB_leftWindows         ,"KB_leftWindows"},
-    {KB_rightWindows        ,"KB_rightWindows"},
-    {KB_menu                ,"KB_menu"},
-    {KB_sysReq              ,"KB_sysReq"},
-    {KB_esc                 ,"KB_esc"},
-    {KB_1                   ,"KB_1"},
-    {KB_2                   ,"KB_2"},
-    {KB_3                   ,"KB_3"},
-    {KB_4                   ,"KB_4"},
-    {KB_5                   ,"KB_5"},
-    {KB_6                   ,"KB_6"},
-    {KB_7                   ,"KB_7"},
-    {KB_8                   ,"KB_8"},
-    {KB_9                   ,"KB_9"},
-    {KB_0                   ,"KB_0"},
-    {KB_minus               ,"KB_minus"},
-    {KB_equals              ,"KB_equals"},
-    {KB_backSlash           ,"KB_backSlash"},
-    {KB_backspace           ,"KB_backspace"},
-    {KB_tab                 ,"KB_tab"},
-    {KB_Q                   ,"KB_Q"},
-    {KB_W                   ,"KB_W"},
-    {KB_E                   ,"KB_E"},
-    {KB_R                   ,"KB_R"},
-    {KB_T                   ,"KB_T"},
-    {KB_Y                   ,"KB_Y"},
-    {KB_U                   ,"KB_U"},
-    {KB_I                   ,"KB_I"},
-    {KB_O                   ,"KB_O"},
-    {KB_P                   ,"KB_P"},
-    {KB_leftSquareBrace     ,"KB_leftSquareBrace"},
-    {KB_rightSquareBrace    ,"KB_rightSquareBrace"},
-    {KB_enter               ,"KB_enter"},
-    {KB_A                   ,"KB_A"},
-    {KB_S                   ,"KB_S"},
-    {KB_D                   ,"KB_D"},
-    {KB_F                   ,"KB_F"},
-    {KB_G                   ,"KB_G"},
-    {KB_H                   ,"KB_H"},
-    {KB_J                   ,"KB_J"},
-    {KB_K                   ,"KB_K"},
-    {KB_L                   ,"KB_L"},
-    {KB_semicolon           ,"KB_semicolon"},
-    {KB_apostrophe          ,"KB_apostrophe"},
-    {KB_Z                   ,"KB_Z"},
-    {KB_X                   ,"KB_X"},
-    {KB_C                   ,"KB_C"},
-    {KB_V                   ,"KB_V"},
-    {KB_B                   ,"KB_B"},
-    {KB_N                   ,"KB_N"},
-    {KB_M                   ,"KB_M"},
-    {KB_comma               ,"KB_comma"},
-    {KB_period              ,"KB_period"},
-    {KB_divide              ,"KB_divide"},
-    {KB_space               ,"KB_space"},
-    {KB_tilde               ,"KB_tilde"},
-    {0                      ,"KB_unknown"},
-    };
-
-/****************************************************************************
-PARAMETERS:
-x   - X coordinate of the mouse cursor position (screen coordinates)
-y   - Y coordinate of the mouse cursor position (screen coordinates)
-
-REMARKS:
-This gets called periodically to move the mouse. It will get called when
-the mouse may not have actually moved, so check if it has before redrawing
-it.
-****************************************************************************/
-void EVTAPI moveMouse(
-    int x,
-    int y)
-{
-}
-
-/****************************************************************************
-PARAMETERS:
-code    - Code to translate
-keys    - Table of translation key values to look up
-
-REMARKS:
-Simple function to look up the printable name for the keyboard code.
-****************************************************************************/
-KeyEntry *FindKey(
-    int code,
-    KeyEntry *keys)
-{
-    KeyEntry    *key;
-
-    for (key = keys; key->code != 0; key++) {
-       if (key->code == code)
-           break;
-       }
-    return key;
-}
-
-/****************************************************************************
-PARAMETERS:
-evt - Event to display modifiers for
-
-REMARKS:
-Function to display shift modifiers flags
-****************************************************************************/
-void DisplayModifiers(
-    event_t *evt)
-{
-    if (evt->modifiers & EVT_LEFTBUT)
-       printf(", LBUT");
-    if (evt->modifiers & EVT_RIGHTBUT)
-       printf(", RBUT");
-    if (evt->modifiers & EVT_MIDDLEBUT)
-       printf(", MBUT");
-    if (evt->modifiers & EVT_SHIFTKEY) {
-       if (evt->modifiers & EVT_LEFTSHIFT)
-           printf(", LSHIFT");
-       if (evt->modifiers & EVT_RIGHTSHIFT)
-           printf(", RSHIFT");
-       }
-    if (evt->modifiers & EVT_CTRLSTATE) {
-       if (evt->modifiers & EVT_LEFTCTRL)
-           printf(", LCTRL");
-       if (evt->modifiers & EVT_RIGHTCTRL)
-           printf(", RCTRL");
-       }
-    if (evt->modifiers & EVT_ALTSTATE) {
-       if (evt->modifiers & EVT_LEFTALT)
-           printf(", LALT");
-       if (evt->modifiers & EVT_RIGHTALT)
-           printf(", RALT");
-       }
-}
-
-/****************************************************************************
-PARAMETERS:
-msg - Message to display for type of event
-evt - Event to display
-
-REMARKS:
-Function to display the status of the keyboard event to the screen.
-****************************************************************************/
-void DisplayKey(
-    char *msg,
-    event_t *evt)
-{
-    KeyEntry    *ascii,*scan;
-    char        ch = EVT_asciiCode(evt->message);
-
-    ascii = FindKey(ch,ASCIICodes);
-    scan = FindKey(EVT_scanCode(evt->message),ScanCodes);
-    printf("%s: 0x%04X -> %s, %s, '%c'",
-       msg, (int)evt->message & 0xFFFF, scan->name, ascii->name, isprint(ch) ? ch : ' ');
-    DisplayModifiers(evt);
-    printf("\n");
-}
-
-/****************************************************************************
-PARAMETERS:
-msg - Message to display for type of event
-evt - Event to display
-
-REMARKS:
-Function to display the status of the mouse event to the screen.
-****************************************************************************/
-void DisplayMouse(
-    char *msg,
-    event_t *evt)
-{
-    printf("%s: ", msg);
-    if (evt->message & EVT_LEFTBMASK)
-       printf("LEFT ");
-    if (evt->message & EVT_RIGHTBMASK)
-       printf("RIGHT ");
-    if (evt->message & EVT_MIDDLEBMASK)
-       printf("MIDDLE ");
-    printf("abs(%d,%d), rel(%d,%d)", evt->where_x, evt->where_y, evt->relative_x, evt->relative_y);
-    DisplayModifiers(evt);
-    if (evt->message & EVT_DBLCLICK)
-       printf(", DBLCLICK");
-    printf("\n");
-}
-
-/****************************************************************************
-PARAMETERS:
-msg - Message to display for type of event
-evt - Event to display
-
-REMARKS:
-Function to display the status of the joystick event to the screen.
-****************************************************************************/
-void DisplayJoy(
-    char *msg,
-    event_t *evt)
-{
-    printf("%s: Joy1(%4d,%4d,%c%c), Joy2(%4d,%4d,%c%c)\n", msg,
-       evt->where_x,evt->where_y,
-       (evt->message & EVT_JOY1_BUTTONA) ? 'A' : 'a',
-       (evt->message & EVT_JOY1_BUTTONB) ? 'B' : 'b',
-       evt->relative_x,evt->relative_y,
-       (evt->message & EVT_JOY2_BUTTONA) ? 'A' : 'a',
-       (evt->message & EVT_JOY2_BUTTONB) ? 'B' : 'b');
-}
-
-/****************************************************************************
-REMARKS:
-Joystick calibration routine
-****************************************************************************/
-void CalibrateJoy(void)
-{
-  event_t evt;
-  if(EVT_joyIsPresent()){
-    printf("Joystick Calibration\nMove the joystick to the upper left corner and press any button.\n");
-    EVT_halt(&evt, EVT_JOYCLICK);
-    EVT_halt(&evt, EVT_JOYCLICK);
-    EVT_joySetUpperLeft();
-    printf("Move the joystick to the lower right corner and press any button.\n");
-    EVT_halt(&evt, EVT_JOYCLICK);
-    EVT_halt(&evt, EVT_JOYCLICK);
-    EVT_joySetLowerRight();
-    printf("Move the joystick to center position and press any button.\n");
-    EVT_halt(&evt, EVT_JOYCLICK);
-    EVT_halt(&evt, EVT_JOYCLICK);
-    EVT_joySetCenter();
-    printf("Joystick calibrated\n");
-  }
-}
-
-/****************************************************************************
-REMARKS:
-Main program entry point
-****************************************************************************/
-int main(void)
-{
-    event_t     evt;
-    ibool       done = false;
-    PM_HWND     hwndConsole;
-
-    hwndConsole = PM_openConsole(0,0,0,0,0,true);
-    EVT_init(&moveMouse);
-    EVT_setMouseRange(1024,768);
-    CalibrateJoy();
-    do {
-       EVT_pollJoystick();
-       if (EVT_getNext(&evt,EVT_EVERYEVT)) {
-           switch (evt.what) {
-               case EVT_KEYDOWN:
-                   DisplayKey("EVT_KEYDOWN  ", &evt);
-                   if (EVT_scanCode(evt.message) == KB_esc)
-                       done = true;
-                   break;
-               case EVT_KEYREPEAT:
-                   DisplayKey("EVT_KEYREPEAT", &evt);
-                   break;
-               case EVT_KEYUP:
-                   DisplayKey("EVT_KEYUP    ", &evt);
-                   break;
-               case EVT_MOUSEDOWN:
-                   DisplayMouse("EVT_MOUSEDOWN", &evt);
-                   break;
-               case EVT_MOUSEAUTO:
-                   DisplayMouse("EVT_MOUSEAUTO", &evt);
-                   break;
-               case EVT_MOUSEUP:
-                   DisplayMouse("EVT_MOUSEUP  ", &evt);
-                   break;
-               case EVT_MOUSEMOVE:
-                   DisplayMouse("EVT_MOUSEMOVE", &evt);
-                   break;
-               case EVT_JOYCLICK:
-                   DisplayJoy("EVT_JOYCLICK ", &evt);
-                   break;
-               case EVT_JOYMOVE:
-                   DisplayJoy("EVT_JOYMOVE  ", &evt);
-                   break;
-               }
-           }
-       } while (!done);
-    EVT_exit();
-    PM_closeConsole(hwndConsole);
-    return 0;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/tests/isvesa.c b/board/MAI/bios_emulator/scitech/src/pm/tests/isvesa.c
deleted file mode 100644 (file)
index 67ad245..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  any
-*
-* Description:  Test program to check the ability to allocate real mode
-*               memory and to call real mode interrupt handlers such as
-*               the VESA VBE BIOS from protected mode. Compile and link
-*               with the appropriate command line for your DOS extender.
-*
-*               Functions tested:   PM_getVESABuf()
-*                                   PM_mapRealPointer()
-*                                   PM_int86x()
-*
-****************************************************************************/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include "pmapi.h"
-
-/* SuperVGA information block */
-
-#pragma pack(1)
-
-typedef struct {
-    char    VESASignature[4];       /* 'VESA' 4 byte signature          */
-    short   VESAVersion;            /* VBE version number               */
-    ulong   OEMStringPtr;           /* Far pointer to OEM string        */
-    ulong   Capabilities;           /* Capabilities of video card       */
-    ulong   VideoModePtr;           /* Far pointer to supported modes   */
-    short   TotalMemory;            /* Number of 64kb memory blocks     */
-    char    reserved[236];          /* Pad to 256 byte block size       */
-    } VgaInfoBlock;
-
-#pragma pack()
-
-int main(void)
-{
-    RMREGS          regs;
-    RMSREGS         sregs;
-    VgaInfoBlock    vgaInfo;
-    ushort          *mode;
-    uint            vgLen;
-    uchar           *vgPtr;
-    unsigned        r_vgseg,r_vgoff;
-
-    printf("Program running in ");
-    switch (PM_getModeType()) {
-       case PM_realMode:
-           printf("real mode.\n\n");
-           break;
-       case PM_286:
-           printf("16 bit protected mode.\n\n");
-           break;
-       case PM_386:
-           printf("32 bit protected mode.\n\n");
-           break;
-       }
-
-    /* Allocate a 256 byte block of real memory for communicating with
-     * the VESA BIOS.
-     */
-    if ((vgPtr = PM_getVESABuf(&vgLen,&r_vgseg,&r_vgoff)) == NULL) {
-       printf("Unable to allocate VESA memory buffer!\n");
-       exit(1);
-       }
-
-    /* Call the VESA VBE to see if it is out there */
-    regs.x.ax = 0x4F00;
-    regs.x.di = r_vgoff;
-    sregs.es = r_vgseg;
-    memcpy(vgPtr,"VBE2",4);
-    PM_int86x(0x10, &regs, &regs, &sregs);
-    memcpy(&vgaInfo,vgPtr,sizeof(VgaInfoBlock));
-    if (regs.x.ax == 0x4F && strncmp(vgaInfo.VESASignature,"VESA",4) == 0) {
-       printf("VESA VBE version %d.%d BIOS detected\n\n",
-           vgaInfo.VESAVersion >> 8, vgaInfo.VESAVersion & 0xF);
-       printf("Available video modes:\n");
-       mode = PM_mapRealPointer(vgaInfo.VideoModePtr >> 16, vgaInfo.VideoModePtr & 0xFFFF);
-       while (*mode != 0xFFFF) {
-           printf("    %04hXh (%08X)\n", *mode, (int)mode);
-           mode++;
-           }
-       }
-    else
-       printf("VESA VBE not found\n");
-    return 0;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/tests/key.c b/board/MAI/bios_emulator/scitech/src/pm/tests/key.c
deleted file mode 100644 (file)
index dba8885..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-*
-* Language:     ANSI C
-* Environment:  any
-*
-* Description:  Test program to check the ability to install a C based
-*               keyboard interrupt handler.
-*
-*               Functions tested:   PM_setKeyHandler()
-*                                   PM_chainPrevKey()
-*                                   PM_restoreKeyHandler()
-*
-*
-****************************************************************************/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include "pmapi.h"
-
-volatile long count = 0;
-
-#pragma off (check_stack)           /* No stack checking under Watcom   */
-
-void PMAPI keyHandler(void)
-{
-    count++;
-    PM_chainPrevKey();  /* Chain to previous handler    */
-}
-
-int main(void)
-{
-    int             ch;
-    PM_lockHandle   lh;
-
-    printf("Program running in ");
-    switch (PM_getModeType()) {
-       case PM_realMode:
-           printf("real mode.\n\n");
-           break;
-       case PM_286:
-           printf("16 bit protected mode.\n\n");
-           break;
-       case PM_386:
-           printf("32 bit protected mode.\n\n");
-           break;
-       }
-
-    /* Install our timer handler and lock handler pages in memory. It is
-     * difficult to get the size of a function in C, but we know our
-     * function is well less than 100 bytes (and an entire 4k page will
-     * need to be locked by the server anyway).
-     */
-    PM_lockCodePages((__codePtr)keyHandler,100,&lh);
-    PM_lockDataPages((void*)&count,sizeof(count),&lh);
-    PM_installBreakHandler();           /* We *DONT* want Ctrl-Breaks! */
-    PM_setKeyHandler(keyHandler);
-    printf("Keyboard interrupt handler installed - Type some characters and\n");
-    printf("hit ESC to exit\n");
-    while ((ch = PM_getch()) != 0x1B) {
-       printf("%c", ch);
-       fflush(stdout);
-       }
-
-    PM_restoreKeyHandler();
-    PM_restoreBreakHandler();
-    PM_unlockDataPages((void*)&count,sizeof(count),&lh);
-    PM_unlockCodePages((__codePtr)keyHandler,100,&lh);
-    printf("\n\nKeyboard handler was called %ld times\n", count);
-    return 0;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/tests/key15.c b/board/MAI/bios_emulator/scitech/src/pm/tests/key15.c
deleted file mode 100644 (file)
index b0b94be..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-*
-* Language:     ANSI C
-* Environment:  any
-*
-* Description:  Test program to check the ability to install a C based
-*               keyboard Int 15h interrupt handler. This is an alternate
-*               way to intercept scancodes from the keyboard by hooking
-*               the Int 15h keyboard intercept callout.
-*
-*               Functions tested:   PM_setKey15Handler()
-*                                   PM_restoreKey15Handler()
-*
-*
-****************************************************************************/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include "pmapi.h"
-
-volatile long count = 0;
-volatile short lastScanCode = 0;
-
-#pragma off (check_stack)           /* No stack checking under Watcom   */
-
-short PMAPI keyHandler(short scanCode)
-{
-    count++;
-    lastScanCode = scanCode;
-    return scanCode;            /* Let BIOS process as normal */
-}
-
-int main(void)
-{
-    int             ch;
-    PM_lockHandle   lh;
-
-    printf("Program running in ");
-    switch (PM_getModeType()) {
-       case PM_realMode:
-           printf("real mode.\n\n");
-           break;
-       case PM_286:
-           printf("16 bit protected mode.\n\n");
-           break;
-       case PM_386:
-           printf("32 bit protected mode.\n\n");
-           break;
-       }
-
-    /* Install our timer handler and lock handler pages in memory. It is
-     * difficult to get the size of a function in C, but we know our
-     * function is well less than 100 bytes (and an entire 4k page will
-     * need to be locked by the server anyway).
-     */
-    PM_lockCodePages((__codePtr)keyHandler,100,&lh);
-    PM_lockDataPages((void*)&count,sizeof(count),&lh);
-    PM_installBreakHandler();       /* We *DONT* want Ctrl-Break's! */
-    PM_setKey15Handler(keyHandler);
-    printf("Keyboard interrupt handler installed - Type some characters and\n");
-    printf("hit ESC to exit\n");
-    while ((ch = PM_getch()) != 0x1B) {
-       printf("%c", ch);
-       fflush(stdout);
-       }
-
-    PM_restoreKey15Handler();
-    PM_restoreBreakHandler();
-    PM_unlockDataPages((void*)&count,sizeof(count),&lh);
-    PM_unlockCodePages((__codePtr)keyHandler,100,&lh);
-    printf("\n\nKeyboard handler was called %ld times\n", count);
-    printf("Last scan code %04X\n", lastScanCode);
-    return 0;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/tests/memtest.c b/board/MAI/bios_emulator/scitech/src/pm/tests/memtest.c
deleted file mode 100644 (file)
index a2c655b..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-*
-* Language:     ANSI C
-* Environment:  any
-*
-* Description:  Test program to determine just how much memory can be
-*               allocated with the compiler in use. Compile and link
-*               with the appropriate command line for your DOS extender.
-*
-*               Functions tested:   PM_malloc()
-*                                   PM_availableMemory()
-*
-*
-****************************************************************************/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <math.h>
-#include "pmapi.h"
-
-#ifdef  __16BIT__
-#define MAXALLOC    64
-#else
-#define MAXALLOC    2000
-#endif
-
-int main(void)
-{
-    int     i;
-    ulong   allocs;
-    ulong   physical,total;
-    char    *p,*pa[MAXALLOC];
-
-    printf("Program running in ");
-    switch (PM_getModeType()) {
-       case PM_realMode:
-           printf("real mode.\n\n");
-           break;
-       case PM_286:
-           printf("16 bit protected mode.\n\n");
-           break;
-       case PM_386:
-           printf("32 bit protected mode.\n\n");
-           break;
-       }
-
-    printf("Memory available at start:\n");
-    PM_availableMemory(&physical,&total);
-    printf("   Physical memory:           %ld Kb\n", physical / 1024);
-    printf("   Total (including virtual): %ld Kb\n", total / 1024);
-    printf("\n");
-    for (allocs = i = 0; i < MAXALLOC; i++) {
-       if ((pa[i] = PM_malloc(10*1024)) != 0) {    /* in 10k blocks    */
-           p = pa[allocs];
-           memset(p, 0, 10*1024); /* touch every byte              */
-           *p = 'x';           /* do something, anything with      */
-           p[1023] = 'y';      /* the allocated memory             */
-           allocs++;
-           printf("Allocated %lu bytes\r", 10*(allocs << 10));
-           }
-       else break;
-       if (PM_kbhit() && (PM_getch() == 0x1B))
-           break;
-       }
-
-    printf("\n\nAllocated total of %lu bytes\n", 10 * (allocs << 10));
-
-    printf("\nMemory available at end:\n");
-    PM_availableMemory(&physical,&total);
-    printf("   Physical memory:           %ld Kb\n", physical / 1024);
-    printf("   Total (including virtual): %ld Kb\n", total / 1024);
-
-    for (i = allocs-1; i >= 0; i--)
-       PM_free(pa[i]);
-
-    printf("\nMemory available after freeing all blocks (note that under protected mode\n");
-    printf("this will most likely not be correct after freeing blocks):\n\n");
-    PM_availableMemory(&physical,&total);
-    printf("   Physical memory:           %ld Kb\n", physical / 1024);
-    printf("   Total (including virtual): %ld Kb\n", total / 1024);
-
-    return 0;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/tests/mouse.c b/board/MAI/bios_emulator/scitech/src/pm/tests/mouse.c
deleted file mode 100644 (file)
index 2765a0d..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-*
-* Language:     ANSI C
-* Environment:  any
-*
-* Description:  Test program to check the ability to install an assembly
-*               language mouse interrupt handler. We use assembly language
-*               as it must be a far function and should swap to a local
-*               32 bit stack if it is going to call any C based code (which
-*               we do in this example).
-*
-*               Functions tested:   PM_installMouseHandler()
-*                                   PM_int86()
-*
-*
-****************************************************************************/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include "pmapi.h"
-
-volatile long count = 0;
-
-#pragma off (check_stack)           /* No stack checking under Watcom   */
-
-void PMAPI mouseHandler(
-    uint mask,
-    uint butstate,
-    int x,
-    int y,
-    int mickeyX,
-    int mickeyY)
-{
-    mask = mask;                /* We dont use any of the parameters    */
-    butstate = butstate;
-    x = x;
-    y = y;
-    mickeyX = mickeyX;
-    mickeyY = mickeyY;
-    count++;
-}
-
-int main(void)
-{
-    RMREGS          regs;
-    PM_lockHandle   lh;
-
-    printf("Program running in ");
-    switch (PM_getModeType()) {
-       case PM_realMode:
-           printf("real mode.\n\n");
-           break;
-       case PM_286:
-           printf("16 bit protected mode.\n\n");
-           break;
-       case PM_386:
-           printf("32 bit protected mode.\n\n");
-           break;
-       }
-
-    regs.x.ax = 33;     /* Mouse function 33 - Software reset       */
-    PM_int86(0x33,&regs,&regs);
-    if (regs.x.bx == 0) {
-       printf("No mouse installed.\n");
-       exit(1);
-       }
-
-    /* Install our mouse handler and lock handler pages in memory. It is
-     * difficult to get the size of a function in C, but we know our
-     * function is well less than 100 bytes (and an entire 4k page will
-     * need to be locked by the server anyway).
-     */
-    PM_lockCodePages((__codePtr)mouseHandler,100,&lh);
-    PM_lockDataPages((void*)&count,sizeof(count),&lh);
-    if (!PM_setMouseHandler(0xFFFF, mouseHandler)) {
-       printf("Unable to install mouse handler!\n");
-       exit(1);
-       }
-    printf("Mouse handler installed - Hit any key to exit\n");
-    PM_getch();
-
-    PM_restoreMouseHandler();
-    PM_unlockDataPages((void*)&count,sizeof(count),&lh);
-    PM_unlockCodePages((__codePtr)mouseHandler,100,&lh);
-    printf("Mouse handler was called %ld times\n", count);
-    return 0;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/tests/restore.c b/board/MAI/bios_emulator/scitech/src/pm/tests/restore.c
deleted file mode 100644 (file)
index e00be75..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Linux/QNX
-*
-* Description:  Program to restore the console state state from a previously
-*               saved state if the program crashed while the console
-*               was in graphics mode.
-*
-****************************************************************************/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include "pmapi.h"
-
-void setVideoMode(int mode)
-{
-    RMREGS r;
-
-    r.x.ax = mode;
-    PM_int86(0x10, &r, &r);
-}
-
-int main(void)
-{
-    PM_HWND hwndConsole;
-    ulong   stateSize;
-    void    *stateBuf;
-    FILE    *f;
-
-    /* Write the saved console state buffer to disk */
-    if ((f = fopen("/etc/pmsave.dat","rb")) == NULL) {
-       printf("Unable to open /etc/pmsave.dat for reading!\n");
-       return -1;
-       }
-    fread(&stateSize,1,sizeof(stateSize),f);
-    if (stateSize != PM_getConsoleStateSize()) {
-       printf("Size mismatch in /etc/pmsave.dat!\n");
-       return -1;
-       }
-    if ((stateBuf = PM_malloc(stateSize)) == NULL) {
-       printf("Unable to allocate console state buffer!\n");
-       return -1;
-       }
-    fread(stateBuf,1,stateSize,f);
-    fclose(f);
-
-    /* Open the console */
-    hwndConsole = PM_openConsole(0,0,0,0,0,true);
-
-    /* Forcibly set 80x25 text mode using the BIOS */
-    setVideoMode(0x3);
-
-    /* Restore the previous console state */
-    PM_restoreConsoleState(stateBuf,0);
-    PM_closeConsole(hwndConsole);
-    PM_free(stateBuf);
-    printf("Console state successfully restored from /etc/pmsave.dat\n");
-    return 0;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/tests/rtc.c b/board/MAI/bios_emulator/scitech/src/pm/tests/rtc.c
deleted file mode 100644 (file)
index acef922..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  any
-*
-* Description:  Test program to check the ability to install a C based
-*               Real Time Clock interrupt handler.
-*
-*               Functions tested:   PM_setRealTimeClockHandler()
-*                                   PM_restoreRealTimeClockHandler()
-*
-****************************************************************************/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include "pmapi.h"
-
-volatile long count = 0;
-
-#pragma off (check_stack)           /* No stack checking under Watcom   */
-
-void PMAPI RTCHandler(void)
-{
-    count++;
-}
-
-int main(void)
-{
-    long            oldCount;
-    PM_lockHandle   lh;
-
-    printf("Program running in ");
-    switch (PM_getModeType()) {
-       case PM_realMode:
-           printf("real mode.\n\n");
-           break;
-       case PM_286:
-           printf("16 bit protected mode.\n\n");
-           break;
-       case PM_386:
-           printf("32 bit protected mode.\n\n");
-           break;
-       }
-
-    /* Install our timer handler and lock handler pages in memory. It is
-     * difficult to get the size of a function in C, but we know our
-     * function is well less than 100 bytes (and an entire 4k page will
-     * need to be locked by the server anyway).
-     */
-    PM_lockCodePages((__codePtr)RTCHandler,100,&lh);
-    PM_lockDataPages((void*)&count,sizeof(count),&lh);
-    PM_installBreakHandler();           /* We *DONT* want Ctrl-Breaks! */
-    PM_setRealTimeClockHandler(RTCHandler,128);
-    printf("RealTimeClock interrupt handler installed - Hit ESC to exit\n");
-    oldCount = count;
-    while (1) {
-       if (PM_kbhit() && (PM_getch() == 0x1B))
-           break;
-       if (count != oldCount) {
-           printf("Tick, Tock: %ld\n", count);
-           oldCount = count;
-           }
-       }
-
-    PM_restoreRealTimeClockHandler();
-    PM_restoreBreakHandler();
-    PM_unlockDataPages((void*)&count,sizeof(count),&lh);
-    PM_unlockCodePages((__codePtr)RTCHandler,100,&lh);
-    printf("RealTimeClock handler was called %ld times\n", count);
-    return 0;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/tests/save.c b/board/MAI/bios_emulator/scitech/src/pm/tests/save.c
deleted file mode 100644 (file)
index f732456..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Linux/QNX
-*
-* Description:  Program to save the console state state so that it can
-*               be later restored if the program crashed while the console
-*               was in graphics mode.
-*
-****************************************************************************/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include "pmapi.h"
-
-int main(void)
-{
-    PM_HWND hwndConsole;
-    ulong   stateSize;
-    void    *stateBuf;
-    FILE    *f;
-
-    /* Allocate a buffer to save console state and save the state */
-    hwndConsole = PM_openConsole(0,0,0,0,0,true);
-    stateSize = PM_getConsoleStateSize();
-    if ((stateBuf = PM_malloc(stateSize)) == NULL) {
-       PM_closeConsole(hwndConsole);
-       printf("Unable to allocate console state buffer!\n");
-       return -1;
-       }
-    PM_saveConsoleState(stateBuf,0);
-
-    /* Restore the console state on exit */
-    PM_restoreConsoleState(stateBuf,0);
-    PM_closeConsole(hwndConsole);
-
-    /* Write the saved console state buffer to disk */
-    if ((f = fopen("/etc/pmsave.dat","wb")) == NULL)
-       printf("Unable to open /etc/pmsave/dat for writing!\n");
-    else {
-       fwrite(&stateSize,1,sizeof(stateSize),f);
-       fwrite(stateBuf,1,stateSize,f);
-       fclose(f);
-       printf("Console state successfully saved to /etc/pmsave.dat\n");
-       }
-    PM_free(stateBuf);
-    return 0;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/tests/showpci.c b/board/MAI/bios_emulator/scitech/src/pm/tests/showpci.c
deleted file mode 100644 (file)
index be275e1..0000000
+++ /dev/null
@@ -1,253 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  any
-*
-* Description:  Test program to test the PCI library functions.
-*
-****************************************************************************/
-
-#include "pmapi.h"
-#include "pcilib.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdarg.h>
-
-/*------------------------- Global Variables ------------------------------*/
-
-static int              NumPCI = -1;
-static PCIDeviceInfo    *PCI;
-static int              *BridgeIndex;
-static int              *DeviceIndex;
-static int              NumBridges;
-static PCIDeviceInfo    *AGPBridge = NULL;
-static int              NumDevices;
-
-/*-------------------------- Implementation -------------------------------*/
-
-/****************************************************************************
-REMARKS:
-Enumerates the PCI bus and dumps the PCI configuration information to the
-log file.
-****************************************************************************/
-static void EnumeratePCI(void)
-{
-    int             i,index;
-    PCIDeviceInfo   *info;
-
-    printf("Displaying enumeration of PCI bus (%d devices, %d display devices)\n",
-       NumPCI, NumDevices);
-    for (index = 0; index < NumDevices; index++)
-       printf("  Display device %d is PCI device %d\n",index,DeviceIndex[index]);
-    printf("\n");
-    printf("Bus Slot Fnc DeviceID  SubSystem Rev Class IRQ Int Cmd\n");
-    for (i = 0; i < NumPCI; i++) {
-       printf("%2d   %2d  %2d  %04X:%04X %04X:%04X %02X  %02X:%02X %02X  %02X  %04X   ",
-           PCI[i].slot.p.Bus,
-           PCI[i].slot.p.Device,
-           PCI[i].slot.p.Function,
-           PCI[i].VendorID,
-           PCI[i].DeviceID,
-           PCI[i].u.type0.SubSystemVendorID,
-           PCI[i].u.type0.SubSystemID,
-           PCI[i].RevID,
-           PCI[i].BaseClass,
-           PCI[i].SubClass,
-           PCI[i].u.type0.InterruptLine,
-           PCI[i].u.type0.InterruptPin,
-           PCI[i].Command);
-       for (index = 0; index < NumDevices; index++) {
-           if (DeviceIndex[index] == i)
-               break;
-           }
-       if (index < NumDevices)
-           printf("<- %d\n", index);
-       else
-           printf("\n");
-       }
-    printf("\n");
-    printf("DeviceID  Stat Ifc Cch Lat Hdr BIST\n");
-    for (i = 0; i < NumPCI; i++) {
-       printf("%04X:%04X %04X  %02X  %02X  %02X  %02X  %02X   ",
-           PCI[i].VendorID,
-           PCI[i].DeviceID,
-           PCI[i].Status,
-           PCI[i].Interface,
-           PCI[i].CacheLineSize,
-           PCI[i].LatencyTimer,
-           PCI[i].HeaderType,
-           PCI[i].BIST);
-       for (index = 0; index < NumDevices; index++) {
-           if (DeviceIndex[index] == i)
-               break;
-           }
-       if (index < NumDevices)
-           printf("<- %d\n", index);
-       else
-           printf("\n");
-       }
-    printf("\n");
-    printf("DeviceID  Base10h  Base14h  Base18h  Base1Ch  Base20h  Base24h  ROMBase\n");
-    for (i = 0; i < NumPCI; i++) {
-       printf("%04X:%04X %08lX %08lX %08lX %08lX %08lX %08lX %08lX ",
-           PCI[i].VendorID,
-           PCI[i].DeviceID,
-           PCI[i].u.type0.BaseAddress10,
-           PCI[i].u.type0.BaseAddress14,
-           PCI[i].u.type0.BaseAddress18,
-           PCI[i].u.type0.BaseAddress1C,
-           PCI[i].u.type0.BaseAddress20,
-           PCI[i].u.type0.BaseAddress24,
-           PCI[i].u.type0.ROMBaseAddress);
-       for (index = 0; index < NumDevices; index++) {
-           if (DeviceIndex[index] == i)
-               break;
-           }
-       if (index < NumDevices)
-           printf("<- %d\n", index);
-       else
-           printf("\n");
-       }
-    printf("\n");
-    printf("DeviceID  BAR10Len BAR14Len BAR18Len BAR1CLen BAR20Len BAR24Len ROMLen\n");
-    for (i = 0; i < NumPCI; i++) {
-       printf("%04X:%04X %08lX %08lX %08lX %08lX %08lX %08lX %08lX ",
-           PCI[i].VendorID,
-           PCI[i].DeviceID,
-           PCI[i].u.type0.BaseAddress10Len,
-           PCI[i].u.type0.BaseAddress14Len,
-           PCI[i].u.type0.BaseAddress18Len,
-           PCI[i].u.type0.BaseAddress1CLen,
-           PCI[i].u.type0.BaseAddress20Len,
-           PCI[i].u.type0.BaseAddress24Len,
-           PCI[i].u.type0.ROMBaseAddressLen);
-       for (index = 0; index < NumDevices; index++) {
-           if (DeviceIndex[index] == i)
-               break;
-           }
-       if (index < NumDevices)
-           printf("<- %d\n", index);
-       else
-           printf("\n");
-       }
-    printf("\n");
-    printf("Displaying enumeration of %d bridge devices\n",NumBridges);
-    printf("\n");
-    printf("DeviceID  P# S# B# IOB  IOL  MemBase  MemLimit PreBase  PreLimit Ctrl\n");
-    for (i = 0; i < NumBridges; i++) {
-       info = (PCIDeviceInfo*)&PCI[BridgeIndex[i]];
-       printf("%04X:%04X %02X %02X %02X %04X %04X %08X %08X %08X %08X %04X\n",
-           info->VendorID,
-           info->DeviceID,
-           info->u.type1.PrimaryBusNumber,
-           info->u.type1.SecondayBusNumber,
-           info->u.type1.SubordinateBusNumber,
-           ((u16)info->u.type1.IOBase << 8) & 0xF000,
-           info->u.type1.IOLimit ?
-               ((u16)info->u.type1.IOLimit << 8) | 0xFFF : 0,
-           ((u32)info->u.type1.MemoryBase << 16) & 0xFFF00000,
-           info->u.type1.MemoryLimit ?
-               ((u32)info->u.type1.MemoryLimit << 16) | 0xFFFFF : 0,
-           ((u32)info->u.type1.PrefetchableMemoryBase << 16) & 0xFFF00000,
-           info->u.type1.PrefetchableMemoryLimit ?
-               ((u32)info->u.type1.PrefetchableMemoryLimit << 16) | 0xFFFFF : 0,
-           info->u.type1.BridgeControl);
-       }
-    printf("\n");
-}
-
-/****************************************************************************
-RETURNS:
-Number of display devices found.
-
-REMARKS:
-This function enumerates the number of available display devices on the
-PCI bus, and returns the number found.
-****************************************************************************/
-static int PCI_enumerateDevices(void)
-{
-    int             i,j;
-    PCIDeviceInfo   *info;
-
-    /* If this is the first time we have been called, enumerate all */
-    /* devices on the PCI bus. */
-    if (NumPCI == -1) {
-       if ((NumPCI = PCI_getNumDevices()) == 0)
-           return -1;
-       PCI = malloc(NumPCI * sizeof(PCI[0]));
-       BridgeIndex = malloc(NumPCI * sizeof(BridgeIndex[0]));
-       DeviceIndex = malloc(NumPCI * sizeof(DeviceIndex[0]));
-       if (!PCI || !BridgeIndex || !DeviceIndex)
-           return -1;
-       for (i = 0; i < NumPCI; i++)
-           PCI[i].dwSize = sizeof(PCI[i]);
-       if (PCI_enumerate(PCI) == 0)
-           return -1;
-
-       /* Build a list of all PCI bridge devices */
-       for (i = 0,NumBridges = 0,BridgeIndex[0] = -1; i < NumPCI; i++) {
-           if (PCI[i].BaseClass == PCI_BRIDGE_CLASS)
-               BridgeIndex[NumBridges++] = i;
-           }
-
-       /* Now build a list of all display class devices */
-       for (i = 0,NumDevices = 1,DeviceIndex[0] = -1; i < NumPCI; i++) {
-           if (PCI_IS_DISPLAY_CLASS(&PCI[i])) {
-               if ((PCI[i].Command & 0x3) == 0x3)
-                   DeviceIndex[0] = i;
-               else
-                   DeviceIndex[NumDevices++] = i;
-               if (PCI[i].slot.p.Bus != 0) {
-                   /* This device is on a different bus than the primary */
-                   /* PCI bus, so it is probably an AGP device. Find the */
-                   /* AGP bus device that controls that bus so we can */
-                   /* control it. */
-                   for (j = 0; j < NumBridges; j++) {
-                       info = (PCIDeviceInfo*)&PCI[BridgeIndex[j]];
-                       if (info->u.type1.SecondayBusNumber == PCI[i].slot.p.Bus) {
-                           AGPBridge = info;
-                           break;
-                           }
-                       }
-                   }
-               }
-           }
-
-       /* Enumerate all PCI and bridge devices to standard output */
-       EnumeratePCI();
-       }
-    return NumDevices;
-}
-
-int main(void)
-{
-    /* Enumerate all PCI devices */
-    PM_init();
-    if (PCI_enumerateDevices() < 1) {
-       printf("No PCI display devices found!\n");
-       return -1;
-       }
-    return 0;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/tests/tick.c b/board/MAI/bios_emulator/scitech/src/pm/tests/tick.c
deleted file mode 100644 (file)
index 378725e..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  any
-*
-* Description:  Test program to check the ability to install a C based
-*               timer interrupt handler.
-*
-*               Functions tested:   PM_setTimerHandler()
-*                                   PM_chainPrevTimer();
-*                                   PM_restoreTimerHandler()
-*
-****************************************************************************/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include "pmapi.h"
-
-volatile long count = 0;
-
-#pragma off (check_stack)           /* No stack checking under Watcom   */
-
-void PMAPI timerHandler(void)
-{
-    PM_chainPrevTimer();        /* Chain to previous handler */
-    count++;
-}
-
-int main(void)
-{
-    long            oldCount;
-    PM_lockHandle   lh;
-
-    printf("Program running in ");
-    switch (PM_getModeType()) {
-       case PM_realMode:
-           printf("real mode.\n\n");
-           break;
-       case PM_286:
-           printf("16 bit protected mode.\n\n");
-           break;
-       case PM_386:
-           printf("32 bit protected mode.\n\n");
-           break;
-       }
-
-    /* Install our timer handler and lock handler pages in memory. It is
-     * difficult to get the size of a function in C, but we know our
-     * function is well less than 100 bytes (and an entire 4k page will
-     * need to be locked by the server anyway).
-     */
-    PM_lockCodePages((__codePtr)timerHandler,100,&lh);
-    PM_lockDataPages((void*)&count,sizeof(count),&lh);
-    PM_installBreakHandler();           /* We *DONT* want Ctrl-Breaks! */
-    PM_setTimerHandler(timerHandler);
-    printf("Timer interrupt handler installed - Hit ESC to exit\n");
-    oldCount = count;
-    while (1) {
-       if (PM_kbhit() && (PM_getch() == 0x1B))
-           break;
-       if (count != oldCount) {
-           printf("Tick, Tock: %ld\n", count);
-           oldCount = count;
-           }
-       }
-
-    PM_restoreTimerHandler();
-    PM_restoreBreakHandler();
-    PM_unlockDataPages((void*)&count,sizeof(count),&lh);
-    PM_unlockCodePages((__codePtr)timerHandler,100,&lh);
-    printf("Timer handler was called %ld times\n", count);
-    return 0;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/tests/timerc.c b/board/MAI/bios_emulator/scitech/src/pm/tests/timerc.c
deleted file mode 100644 (file)
index 7fa77b7..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Any
-*
-* Description:  Test program for the Zen Timer Library.
-*
-****************************************************************************/
-
-#include <stdio.h>
-#include "pmapi.h"
-#include "ztimer.h"
-
-#define DELAY_SECS  10
-
-/*-------------------------- Implementation -------------------------------*/
-
-/* The following routine takes a long count in microseconds and outputs
- * a string representing the count in seconds. It could be modified to
- * return a pointer to a static string representing the count rather
- * than printing it out.
- */
-
-void ReportTime(ulong count)
-{
-    ulong   secs;
-
-    secs = count / 1000000L;
-    count = count - secs * 1000000L;
-    printf("Time taken: %lu.%06lu seconds\n",secs,count);
-}
-
-int     i,j;                                /* NON register variables! */
-
-int main(void)
-{
-#ifdef  LONG_TEST
-    ulong   start,finish;
-#endif
-
-    printf("Processor type: %d %ld MHz\n", CPU_getProcessorType(), CPU_getProcessorSpeed(true));
-
-    ZTimerInit();
-
-    /* Test the long period Zen Timer (we don't check for overflow coz
-     * it would take tooooo long!)
-     */
-
-    LZTimerOn();
-    for (j = 0; j < 10; j++)
-       for (i = 0; i < 20000; i++)
-           i = i;
-    LZTimerOff();
-    ReportTime(LZTimerCount());
-
-    /* Test the ultra long period Zen Timer */
-#ifdef LONG_TEST
-    start = ULZReadTime();
-    delay(DELAY_SECS * 1000);
-    finish = ULZReadTime();
-    printf("Delay of %d secs took %d 1/10ths of a second\n",
-       DELAY_SECS,ULZElapsedTime(start,finish));
-#endif
-
-    return 0;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/tests/timercpp.cpp b/board/MAI/bios_emulator/scitech/src/pm/tests/timercpp.cpp
deleted file mode 100644 (file)
index 1258a4b..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     C++ 3.0
-* Environment:  Any
-*
-* Description:  Test program for the Zen Timer Library C++ interface.
-*
-****************************************************************************/
-
-#include <iostream.h>
-#include "pmapi.h"
-#include "ztimer.h"
-
-/*-------------------------- Implementation -------------------------------*/
-
-int     i,j,k;                              /* NON register variables! */
-
-void dummy() {}
-
-int main(void)
-{
-    LZTimer     ltimer;
-    ULZTimer    ultimer;
-
-    ZTimerInit();
-
-    /* Test the long period Zen Timer (we don't check for overflow coz
-     * it would take tooooo long!)
-     */
-
-    cout << endl;
-    ultimer.restart();
-    ltimer.start();
-    for (j = 0; j < 10; j++)
-        for (i = 0; i < 20000; i++)
-            dummy();
-    ltimer.stop();
-    ultimer.stop();
-    cout << "LCount:  " << ltimer.count() << endl;
-    cout << "Time:    " << ltimer << " secs\n";
-    cout << "ULCount: " << ultimer.count() << endl;
-    cout << "ULTime:  " << ultimer << " secs\n";
-
-    cout << endl << "Timing ... \n";
-    ultimer.restart();
-    ltimer.restart();
-    for (j = 0; j < 200; j++)
-        for (i = 0; i < 20000; i++)
-            dummy();
-    ltimer.stop();
-    ultimer.stop();
-    cout << "LCount:  " << ltimer.count() << endl;
-    cout << "Time:    " << ltimer << " secs\n";
-    cout << "ULCount: " << ultimer.count() << endl;
-    cout << "ULTime:  " << ultimer << " secs\n";
-
-    /* Test the lap function of the long period Zen Timer */
-
-    cout << endl << "Timing ... \n";
-    ultimer.restart();
-    ltimer.restart();
-    for (j = 0; j < 20; j++) {
-        for (k = 0; k < 10; k++)
-            for (i = 0; i < 20000; i++)
-                dummy();
-        cout << "lap: " << ltimer.lap() << endl;
-        }
-    ltimer.stop();
-    ultimer.stop();
-    cout << "LCount:  " << ltimer.count() << endl;
-    cout << "Time:    " << ltimer << " secs\n";
-    cout << "ULCount: " << ultimer.count() << endl;
-    cout << "ULTime:  " << ultimer << " secs\n";
-
-#ifdef  LONG_TEST
-    /* Test the ultra long period Zen Timer */
-
-    ultimer.start();
-    delay(DELAY_SECS * 1000);
-    ultimer.stop();
-    cout << "Delay of " << DELAY_SECS << " secs took " << ultimer.count()
-         << " 1/10ths of a second\n";
-    cout << "Time: " << ultimer << " secs\n";
-#endif
-    return 0;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/tests/uswc.c b/board/MAI/bios_emulator/scitech/src/pm/tests/uswc.c
deleted file mode 100644 (file)
index f0c7bd6..0000000
+++ /dev/null
@@ -1,311 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  any
-*
-* Description:  Simple test program to test the write combine functions.
-*
-*               Note that this program should never be used in a production
-*               environment, because write combining needs to be handled
-*               with more intimate knowledge of the display hardware than
-*               you can obtain by simply examining the PCI configuration
-*               space.
-*
-****************************************************************************/
-
-#include "pmapi.h"
-#include "pcilib.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdarg.h>
-
-/*------------------------- Global Variables ------------------------------*/
-
-static int              NumPCI = -1;
-static PCIDeviceInfo    *PCI;
-static int              *BridgeIndex;
-static int              *DeviceIndex;
-static int              NumBridges;
-static PCIDeviceInfo    *AGPBridge = NULL;
-static int              NumDevices;
-
-/*-------------------------- Implementation -------------------------------*/
-
-/****************************************************************************
-RETURNS:
-Number of display devices found.
-
-REMARKS:
-This function enumerates the number of available display devices on the
-PCI bus, and returns the number found.
-****************************************************************************/
-static int PCI_enumerateDevices(void)
-{
-    int             i,j;
-    PCIDeviceInfo   *info;
-
-    /* If this is the first time we have been called, enumerate all */
-    /* devices on the PCI bus. */
-    if (NumPCI == -1) {
-       if ((NumPCI = PCI_getNumDevices()) == 0)
-           return -1;
-       PCI = malloc(NumPCI * sizeof(PCI[0]));
-       BridgeIndex = malloc(NumPCI * sizeof(BridgeIndex[0]));
-       DeviceIndex = malloc(NumPCI * sizeof(DeviceIndex[0]));
-       if (!PCI || !BridgeIndex || !DeviceIndex)
-           return -1;
-       for (i = 0; i < NumPCI; i++)
-           PCI[i].dwSize = sizeof(PCI[i]);
-       if (PCI_enumerate(PCI) == 0)
-           return -1;
-
-       /* Build a list of all PCI bridge devices */
-       for (i = 0,NumBridges = 0,BridgeIndex[0] = -1; i < NumPCI; i++) {
-           if (PCI[i].BaseClass == PCI_BRIDGE_CLASS)
-               BridgeIndex[NumBridges++] = i;
-           }
-
-       /* Now build a list of all display class devices */
-       for (i = 0,NumDevices = 1,DeviceIndex[0] = -1; i < NumPCI; i++) {
-           if (PCI_IS_DISPLAY_CLASS(&PCI[i])) {
-               if ((PCI[i].Command & 0x3) == 0x3)
-                   DeviceIndex[0] = i;
-               else
-                   DeviceIndex[NumDevices++] = i;
-               if (PCI[i].slot.p.Bus != 0) {
-                   /* This device is on a different bus than the primary */
-                   /* PCI bus, so it is probably an AGP device. Find the */
-                   /* AGP bus device that controls that bus so we can */
-                   /* control it. */
-                   for (j = 0; j < NumBridges; j++) {
-                       info = (PCIDeviceInfo*)&PCI[BridgeIndex[j]];
-                       if (info->u.type1.SecondayBusNumber == PCI[i].slot.p.Bus) {
-                           AGPBridge = info;
-                           break;
-                           }
-                       }
-                   }
-               }
-           }
-       }
-    return NumDevices;
-}
-
-/****************************************************************************
-REMARKS:
-Enumerates useful information about attached display devices.
-****************************************************************************/
-static void ShowDisplayDevices(void)
-{
-    int i,index;
-
-    printf("Displaying enumeration of %d PCI display devices\n", NumDevices);
-    printf("\n");
-    printf("DeviceID  SubSystem  Base10h  (length  )  Base14h  (length  )\n");
-    for (index = 0; index < NumDevices; index++) {
-       i = DeviceIndex[index];
-       printf("%04X:%04X %04X:%04X  %08lX (%6ld KB) %08lX (%6ld KB)\n",
-           PCI[i].VendorID,
-           PCI[i].DeviceID,
-           PCI[i].u.type0.SubSystemVendorID,
-           PCI[i].u.type0.SubSystemID,
-           PCI[i].u.type0.BaseAddress10,
-           PCI[i].u.type0.BaseAddress10Len / 1024,
-           PCI[i].u.type0.BaseAddress14,
-           PCI[i].u.type0.BaseAddress14Len / 1024);
-       }
-    printf("\n");
-}
-
-/****************************************************************************
-REMARKS:
-Dumps the value for a write combine region to the display.
-****************************************************************************/
-static char *DecodeWCType(
-    uint type)
-{
-    static char *names[] = {
-       "UNCACHABLE",
-       "WRCOMB",
-       "UNKNOWN",
-       "UNKNOWN",
-       "WRTHROUGH",
-       "WRPROT",
-       "WRBACK",
-       };
-    if (type <= PM_MTRR_MAX)
-       return names[type];
-    return "UNKNOWN";
-}
-
-/****************************************************************************
-REMARKS:
-Dumps the value for a write combine region to the display.
-****************************************************************************/
-static void PMAPI EnumWriteCombine(
-    ulong base,
-    ulong length,
-    uint type)
-{
-    printf("%08lX %-10ld %s\n", base, length / 1024, DecodeWCType(type));
-}
-
-/****************************************************************************
-PARAMETERS:
-err - Error to log
-
-REMARKS:
-Function to log an error message if the MTRR write combining attempt failed.
-****************************************************************************/
-static void LogMTRRError(
-    int err)
-{
-    if (err == PM_MTRR_ERR_OK)
-       return;
-    switch (err) {
-       case PM_MTRR_NOT_SUPPORTED:
-           printf("Failed: MTRR is not supported by host CPU\n");
-           break;
-       case PM_MTRR_ERR_PARAMS:
-           printf("Failed: Invalid parameters passed to PM_enableWriteCombined!\n");
-           break;
-       case PM_MTRR_ERR_NOT_4KB_ALIGNED:
-           printf("Failed: Address is not 4Kb aligned!\n");
-           break;
-       case PM_MTRR_ERR_BELOW_1MB:
-           printf("Failed: Addresses below 1Mb cannot be write combined!\n");
-           break;
-       case PM_MTRR_ERR_NOT_ALIGNED:
-           printf("Failed: Address is not correctly aligned for processor!\n");
-           break;
-       case PM_MTRR_ERR_OVERLAP:
-           printf("Failed: Address overlaps an existing region!\n");
-           break;
-       case PM_MTRR_ERR_TYPE_MISMATCH:
-           printf("Failed: Adress is contained with existing region, but type is different!\n");
-           break;
-       case PM_MTRR_ERR_NONE_FREE:
-           printf("Failed: Out of MTRR registers!\n");
-           break;
-       case PM_MTRR_ERR_NOWRCOMB:
-           printf("Failed: This processor does not support write combining!\n");
-           break;
-       case PM_MTRR_ERR_NO_OS_SUPPORT:
-           printf("Failed: MTRR is not supported by host OS\n");
-           break;
-       default:
-           printf("Failed: UNKNOWN ERROR!\n");
-           break;
-       }
-    exit(-1);
-}
-
-/****************************************************************************
-REMARKS:
-Shows all write combine regions.
-****************************************************************************/
-static void ShowWriteCombine(void)
-{
-    printf("Base     Length(KB) Type\n");
-    LogMTRRError(PM_enumWriteCombine(EnumWriteCombine));
-    printf("\n");
-}
-
-/****************************************************************************
-REMARKS:
-Dumps the value for a write combine region to the display.
-****************************************************************************/
-static void EnableWriteCombine(void)
-{
-    int i,index;
-
-    for (index = 0; index < NumDevices; index++) {
-       i = DeviceIndex[index];
-       if (PCI[i].u.type0.BaseAddress10 & 0x8) {
-           LogMTRRError(PM_enableWriteCombine(
-               PCI[i].u.type0.BaseAddress10 & 0xFFFFFFF0,
-               PCI[i].u.type0.BaseAddress10Len,
-               PM_MTRR_WRCOMB));
-           }
-       if (PCI[i].u.type0.BaseAddress14 & 0x8) {
-           LogMTRRError(PM_enableWriteCombine(
-               PCI[i].u.type0.BaseAddress14 & 0xFFFFFFF0,
-               PCI[i].u.type0.BaseAddress14Len,
-               PM_MTRR_WRCOMB));
-           }
-       }
-    printf("\n");
-    ShowDisplayDevices();
-    ShowWriteCombine();
-}
-
-/****************************************************************************
-REMARKS:
-Dumps the value for a write combine region to the display.
-****************************************************************************/
-static void DisableWriteCombine(void)
-{
-    int i,index;
-
-    for (index = 0; index < NumDevices; index++) {
-       i = DeviceIndex[index];
-       if (PCI[i].u.type0.BaseAddress10 & 0x8) {
-           LogMTRRError(PM_enableWriteCombine(
-               PCI[i].u.type0.BaseAddress10 & 0xFFFFFFF0,
-               PCI[i].u.type0.BaseAddress10Len,
-               PM_MTRR_UNCACHABLE));
-           }
-       if (PCI[i].u.type0.BaseAddress14 & 0x8) {
-           LogMTRRError(PM_enableWriteCombine(
-               PCI[i].u.type0.BaseAddress14 & 0xFFFFFFF0,
-               PCI[i].u.type0.BaseAddress14Len,
-               PM_MTRR_UNCACHABLE));
-           }
-       }
-    printf("\n");
-    ShowDisplayDevices();
-    ShowWriteCombine();
-}
-
-int main(int argc,char *argv[])
-{
-    PM_init();
-    if (PCI_enumerateDevices() < 1) {
-       printf("No PCI display devices found!\n");
-       return -1;
-       }
-    if (argc < 2) {
-       printf("usage: uswc [-show -on -off]\n\n");
-       ShowDisplayDevices();
-       return -1;
-       }
-    if (stricmp(argv[1],"-show") == 0)
-       ShowWriteCombine();
-    else if (stricmp(argv[1],"-on") == 0)
-       EnableWriteCombine();
-    else if (stricmp(argv[1],"-off") == 0)
-       DisableWriteCombine();
-    return 0;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/tests/vftest.c b/board/MAI/bios_emulator/scitech/src/pm/tests/vftest.c
deleted file mode 100644 (file)
index b7e3bb7..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Filename:     $Workfile$
-* Version:      $Revision: 1.1 $
-*
-* Language:     ANSI C
-* Environment:  any
-*
-* Description:  Test program to test the VFlat virtual framebuffer functions.
-*
-*               Functions tested:   VF_available()
-*                                   VF_init()
-*                                   VF_exit()
-*
-* $Date: 2002/10/02 15:35:21 $ $Author: hfrieden $
-*
-****************************************************************************/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include "pmapi.h"
-
-uchar code[] = {
-    0xC3,                   /* ret          */
-    };
-
-int main(void)
-{
-    void    *vfBuffer;
-
-    printf("Program running in ");
-    switch (PM_getModeType()) {
-       case PM_realMode:
-           printf("real mode.\n\n");
-           break;
-       case PM_286:
-           printf("16 bit protected mode.\n\n");
-           break;
-       case PM_386:
-           printf("32 bit protected mode.\n\n");
-           break;
-       }
-
-    if (!VF_available()) {
-       printf("Virtual Linear Framebuffer not available.\n");
-       exit(1);
-       }
-
-    vfBuffer = VF_init(0xA0000,64,sizeof(code),code);
-    if (!vfBuffer) {
-       printf("Failure to initialise Virtual Linear Framebuffer!\n");
-       exit(1);
-       }
-    VF_exit();
-    printf("Virtual Linear Framebuffer set up successfully!\n");
-    return 0;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/tests/video.c b/board/MAI/bios_emulator/scitech/src/pm/tests/video.c
deleted file mode 100644 (file)
index 92adcdd..0000000
+++ /dev/null
@@ -1,199 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  any
-*
-* Description:  Test program to check the ability to generate real mode
-*               interrupts and to be able to obtain direct access to the
-*               video memory from protected mode. Compile and link with
-*               the appropriate command line for your DOS extender.
-*
-*               Functions tested:   PM_getBIOSSelector()
-*                                   PM_mapPhysicalAddr()
-*                                   PM_int86()
-*
-****************************************************************************/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include "pmapi.h"
-
-uchar   *bios;          /* Pointer to BIOS data area        */
-uchar   *videoPtr;      /* Pointer to VGA framebuffer       */
-void    *stateBuf;      /* Console state save buffer        */
-
-/* Routine to return the current video mode number */
-
-int getVideoMode(void)
-{
-    return PM_getByte(bios+0x49);
-}
-
-/* Routine to set a specified video mode */
-
-void setVideoMode(int mode)
-{
-    RMREGS r;
-
-    r.x.ax = mode;
-    PM_int86(0x10, &r, &r);
-}
-
-/* Routine to clear a rectangular region on the display by calling the
- * video BIOS.
- */
-
-void clearScreen(int startx, int starty, int endx, int endy, unsigned char attr)
-{
-    RMREGS r;
-
-    r.x.ax = 0x0600;
-    r.h.bh = attr;
-    r.h.cl = startx;
-    r.h.ch = starty;
-    r.h.dl = endx;
-    r.h.dh = endy;
-    PM_int86(0x10, &r, &r);
-}
-
-/* Routine to fill a rectangular region on the display using direct
- * video writes.
- */
-
-#define SCREEN(x,y) (videoPtr + ((y) * 160) + ((x) << 1))
-
-void fill(int startx, int starty, int endx, int endy, unsigned char c,
-    unsigned char attr)
-{
-    unsigned char   *v;
-    int             x,y;
-
-    for (y = starty; y <= endy; y++) {
-       v = SCREEN(startx,y);
-       for (x = startx; x <= endx; x++) {
-           *v++ = c;
-           *v++ = attr;
-           }
-       }
-}
-
-/* Routine to display a single character using direct video writes */
-
-void writeChar(int x, int y, unsigned char c, unsigned char attr)
-{
-    unsigned char *v = SCREEN(x,y);
-    *v++ = c;
-    *v = attr;
-}
-
-/* Routine to draw a border around a rectangular area using direct video
- * writes.
- */
-
-static unsigned char border_chars[] = {
-    186, 205, 201, 187, 200, 188        /* double box chars */
-    };
-
-void border(int startx, int starty, int endx, int endy, unsigned char attr)
-{
-    unsigned char   *v;
-    unsigned char   *b;
-    int             i;
-
-    b = border_chars;
-
-    for (i = starty+1; i < endy; i++) {
-       writeChar(startx, i, *b, attr);
-       writeChar(endx, i, *b, attr);
-       }
-    b++;
-    for (i = startx+1, v = SCREEN(startx+1, starty); i < endx; i++) {
-       *v++ = *b;
-       *v++ = attr;
-       }
-    for (i = startx+1, v = SCREEN(startx+1, endy); i < endx; i++) {
-       *v++ = *b;
-       *v++ = attr;
-       }
-    b++;
-    writeChar(startx, starty, *b++, attr);
-    writeChar(endx, starty, *b++, attr);
-    writeChar(startx, endy, *b++, attr);
-    writeChar(endx, endy, *b++, attr);
-}
-
-int main(void)
-{
-    int     orgMode;
-    PM_HWND hwndConsole;
-
-    printf("Program running in ");
-    switch (PM_getModeType()) {
-       case PM_realMode:
-           printf("real mode.\n\n");
-           break;
-       case PM_286:
-           printf("16 bit protected mode.\n\n");
-           break;
-       case PM_386:
-           printf("32 bit protected mode.\n\n");
-           break;
-       }
-
-    hwndConsole = PM_openConsole(0,0,0,0,0,true);
-    printf("Hit any key to start 80x25 text mode and perform some direct video output.\n");
-    PM_getch();
-
-    /* Allocate a buffer to save console state and save the state */
-    if ((stateBuf = PM_malloc(PM_getConsoleStateSize())) == NULL) {
-       printf("Unable to allocate console state buffer!\n");
-       exit(1);
-       }
-    PM_saveConsoleState(stateBuf,0);
-    bios = PM_getBIOSPointer();
-    orgMode = getVideoMode();
-    setVideoMode(0x3);
-    if ((videoPtr = PM_mapPhysicalAddr(0xB8000,0xFFFF,true)) == NULL) {
-       printf("Unable to obtain pointer to framebuffer!\n");
-       exit(1);
-       }
-
-    /* Draw some text on the screen */
-    fill(0, 0, 79, 24, 176, 0x1E);
-    border(0, 0, 79, 24, 0x1F);
-    PM_getch();
-    clearScreen(0, 0, 79, 24, 0x7);
-
-    /* Restore the console state on exit */
-    PM_restoreConsoleState(stateBuf,0);
-    PM_free(stateBuf);
-    PM_closeConsole(hwndConsole);
-
-    /* Display useful status information */
-    printf("\n");
-    printf("Original Video Mode = %02X\n", orgMode);
-    printf("BIOS Pointer = %08X\n", (int)bios);
-    printf("Video Memory = %08X\n", (int)videoPtr);
-    return 0;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/vdd/cpuinfo.c b/board/MAI/bios_emulator/scitech/src/pm/vdd/cpuinfo.c
deleted file mode 100644 (file)
index 3460b72..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/****************************************************************************
-*
-*                         Ultra Long Period Timer
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  32-bit OS/2 VDD
-*
-* Description:  VDD specific code for the CPU detection module.
-*
-****************************************************************************/
-
-/*----------------------------- Implementation ----------------------------*/
-
-/****************************************************************************
-REMARKS:
-Do nothing for VDD's
-****************************************************************************/
-#define SetMaxThreadPriority()      0
-
-/****************************************************************************
-REMARKS:
-Do nothing for VDD's
-****************************************************************************/
-#define RestoreThreadPriority(i)    (void)(i)
-
-/****************************************************************************
-REMARKS:
-Initialise the counter and return the frequency of the counter.
-****************************************************************************/
-static void GetCounterFrequency(
-    CPU_largeInteger *freq)
-{
-    freq->low  = 100000;
-    freq->high = 0;
-}
-
-/****************************************************************************
-REMARKS:
-Read the counter and return the counter value.
-****************************************************************************/
-#define GetCounter(t)                              \
-{                                                  \
-    ULONG   count;                                 \
-    count = VDHQuerySysValue(0, VDHGSV_MSECSBOOT); \
-    (t)->low  = count * 100;                       \
-    (t)->high = 0;                                 \
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/vdd/fileio.c b/board/MAI/bios_emulator/scitech/src/pm/vdd/fileio.c
deleted file mode 100644 (file)
index 93742de..0000000
+++ /dev/null
@@ -1,359 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  32-bit OS/2 VDD
-*
-* Description:  C library compatible I/O functions for use within a VDD.
-*
-****************************************************************************/
-
-#include "pmapi.h"
-#include "vddfile.h"
-
-/*------------------------ Main Code Implementation -----------------------*/
-
-#define EOF -1
-
-/* NB: none of the file VDHs are available during the DOS session          */
-/* initialzation context!                                                  */
-
-/* Macros for Open/Close APIs to allow using this module in both VDDs and  */
-/* normal OS/2 applications. Unfortunately VDHRead/Write/Seek don't map to */
-/* their Dos* counterparts so cleanly.                                     */
-#ifdef __OS2_VDD__
-#define _OS2Open    VDHOpen
-#define _OS2Close   VDHClose
-#else
-#define _OS2Open    DosOpen
-#define _OS2Close   DosClose
-#endif
-
-/****************************************************************************
-REMARKS:
-VDD implementation of the ANSI C fopen function.
-****************************************************************************/
-FILE * fopen(
-    const char *filename,
-    const char *mode)
-{
-    FILE    *f = PM_malloc(sizeof(FILE));
-    long    oldpos;
-    ULONG   rc, ulAction;
-    ULONG   omode, oflags;
-
-    if (f != NULL) {
-       f->offset = 0;
-       f->text = (mode[1] == 't' || mode[2] == 't');
-       f->writemode = (mode[0] == 'w') || (mode[0] == 'a');
-       f->unputc = EOF;
-       f->endp = f->buf + sizeof(f->buf);
-       f->curp = f->startp = f->buf;
-
-       if (mode[0] == 'r') {
-           #ifdef __OS2_VDD__
-           omode  = VDHOPEN_ACCESS_READONLY | VDHOPEN_SHARE_DENYNONE;
-           oflags = VDHOPEN_ACTION_OPEN_IF_EXISTS | VDHOPEN_ACTION_FAIL_IF_NEW;
-           #else
-           omode  = OPEN_ACCESS_READONLY | OPEN_SHARE_DENYNONE;
-           oflags = OPEN_ACTION_OPEN_IF_EXISTS | OPEN_ACTION_FAIL_IF_NEW;
-           #endif
-           }
-       else if (mode[0] == 'w') {
-           #ifdef __OS2_VDD__
-           omode  = VDHOPEN_ACCESS_WRITEONLY | VDHOPEN_SHARE_DENYWRITE;
-           oflags = VDHOPEN_ACTION_REPLACE_IF_EXISTS | VDHOPEN_ACTION_CREATE_IF_NEW;
-           #else
-           omode  = OPEN_ACCESS_WRITEONLY | OPEN_SHARE_DENYWRITE;
-           oflags = OPEN_ACTION_REPLACE_IF_EXISTS | OPEN_ACTION_CREATE_IF_NEW;
-           #endif
-           }
-       else {
-           #ifdef __OS2_VDD__
-           omode  = VDHOPEN_ACCESS_READWRITE | VDHOPEN_SHARE_DENYWRITE;
-           oflags = VDHOPEN_ACTION_OPEN_IF_EXISTS | VDHOPEN_ACTION_CREATE_IF_NEW;
-           #else
-           omode  = OPEN_ACCESS_READWRITE | OPEN_SHARE_DENYWRITE;
-           oflags = OPEN_ACTION_OPEN_IF_EXISTS | OPEN_ACTION_CREATE_IF_NEW;
-           #endif
-           }
-       rc = _OS2Open((PSZ)filename, (PHFILE)&f->handle, &ulAction, 0, VDHOPEN_FILE_NORMAL, oflags, omode, NULL);
-       if (rc != 0) {
-           PM_free(f);
-           return NULL;
-           }
-
-       #ifdef __OS2_VDD__
-       f->filesize = VDHSeek((HFILE)f->handle, 0, VDHSK_END_OF_FILE);
-       #else
-       rc = DosSetFilePtr((HFILE)f->handle, 0, FILE_END, &f->filesize);
-       #endif
-
-       if (mode[0] == 'a')
-           fseek(f,0,2);
-    }
-    return f;
-}
-
-/****************************************************************************
-REMARKS:
-VDD implementation of the ANSI C fread function. Note that unlike Windows VxDs,
-OS/2 VDDs are not limited to 64K reads or writes.
-****************************************************************************/
-size_t fread(
-    void *ptr,
-    size_t size,
-    size_t n,
-    FILE *f)
-{
-    char    *buf = ptr;
-    int     bytes,readbytes,totalbytes = 0;
-
-    /* First copy any data already read into our buffer */
-    if ((bytes = (f->curp - f->startp)) > 0) {
-       memcpy(buf,f->curp,bytes);
-       f->startp = f->curp = f->buf;
-       buf += bytes;
-       totalbytes += bytes;
-       bytes = (size * n) - bytes;
-       }
-    else
-       bytes = size * n;
-    if (bytes) {
-       #ifdef __OS2_VDD__
-       readbytes = VDHRead((HFILE)f->handle, buf, bytes);
-       #else
-       DosRead((HFILE)f->handle, buf, bytes, &readbytes);
-       #endif
-       totalbytes += readbytes;
-       f->offset += readbytes;
-       }
-    return totalbytes / size;
-}
-
-/****************************************************************************
-REMARKS:
-VDD implementation of the ANSI C fwrite function.
-****************************************************************************/
-size_t fwrite(
-    void *ptr,
-    size_t size,
-    size_t n,
-    FILE *f)
-{
-    char        *buf = ptr;
-    int         bytes,writtenbytes,totalbytes = 0;
-
-    /* Flush anything already in the buffer */
-    if (!f->writemode)
-       return 0;
-    fflush(f);
-    bytes = size * n;
-    #ifdef __OS2_VDD__
-    writtenbytes = VDHWrite((HFILE)f->handle, buf, bytes);
-    #else
-    DosWrite((HFILE)f->handle, buf, bytes, &writtenbytes);
-    #endif
-    totalbytes += writtenbytes;
-    f->offset += writtenbytes;
-    if (f->offset > f->filesize)
-       f->filesize = f->offset;
-    return totalbytes / size;
-}
-
-/****************************************************************************
-REMARKS:
-VxD implementation of the ANSI C fflush function.
-****************************************************************************/
-int fflush(
-    FILE *f)
-{
-    ULONG     bytes;
-
-    /* First copy any data already written into our buffer */
-    if (f->writemode && (bytes = (f->curp - f->startp)) > 0) {
-       #ifdef __OS2_VDD__
-       bytes = VDHWrite((HFILE)f->handle, f->startp, bytes);
-       #else
-       DosWrite((HFILE)f->handle, f->startp, bytes, &bytes);
-       #endif
-       f->offset += bytes;
-       if (f->offset > f->filesize)
-           f->filesize = f->offset;
-       f->startp = f->curp = f->buf;
-       }
-    return 0;
-}
-
-/****************************************************************************
-REMARKS:
-VDD implementation of the ANSI C fseek function.
-****************************************************************************/
-int fseek(
-    FILE *f,
-    long int offset,
-    int whence)
-{
-    fflush(f);
-
-    if (whence == 0)
-       f->offset = offset;
-    else if (whence == 1)
-       f->offset += offset;
-    else if (whence == 2)
-       f->offset = f->filesize + offset;
-
-    #ifdef __OS2_VDD__
-    VDHSeek((HFILE)f->handle, f->offset, VDHSK_ABSOLUTE);
-    #else
-    DosSetFilePtr((HFILE)f->handle, f->offset, FILE_BEGIN, NULL);
-    #endif
-
-    return 0;
-}
-
-/****************************************************************************
-REMARKS:
-VDD implementation of the ANSI C ftell function.
-****************************************************************************/
-long ftell(
-    FILE *f)
-{
-    long    offset;
-
-    offset = (f->curp - f->startp);
-    offset += f->offset;
-    return offset;
-}
-
-/****************************************************************************
-REMARKS:
-VDD implementation of the ANSI C feof function.
-****************************************************************************/
-int feof(
-    FILE *f)
-{
-    return (f->offset == f->filesize);
-}
-
-/****************************************************************************
-REMARKS:
-Read a single character from the input file buffer, including translation
-of the character in text transation modes.
-****************************************************************************/
-static int __getc(
-    FILE *f)
-{
-    int c;
-
-    if (f->unputc != EOF) {
-       c = f->unputc;
-       f->unputc = EOF;
-       }
-    else {
-       if (f->startp == f->curp) {
-           int bytes = fread(f->buf,1,sizeof(f->buf),f);
-           if (bytes == 0)
-               return EOF;
-           f->curp = f->startp + bytes;
-           }
-       c = *f->startp++;
-       if (f->text && c == '\r') {
-           int nc = __getc(f);
-           if (nc != '\n')
-               f->unputc = nc;
-           }
-       }
-    return c;
-}
-
-/****************************************************************************
-REMARKS:
-Write a single character from to input buffer, including translation of the
-character in text transation modes.
-****************************************************************************/
-static int __putc(int c,FILE *f)
-{
-    int count = 1;
-    if (f->text && c == '\n') {
-       __putc('\r',f);
-       count = 2;
-       }
-    if (f->curp == f->endp)
-       fflush(f);
-    *f->curp++ = c;
-    return count;
-}
-
-/****************************************************************************
-REMARKS:
-VxD implementation of the ANSI C fgets function.
-****************************************************************************/
-char *fgets(
-    char *s,
-    int n,
-    FILE *f)
-{
-    int c = 0;
-    char *cs;
-
-    cs = s;
-    while (--n > 0 && (c = __getc(f)) != EOF) {
-       *cs++ = c;
-       if (c == '\n')
-           break;
-       }
-    if (c == EOF && cs == s)
-       return NULL;
-    *cs = '\0';
-    return s;
-}
-
-/****************************************************************************
-REMARKS:
-VxD implementation of the ANSI C fputs function.
-****************************************************************************/
-int fputs(
-    const char *s,
-    FILE *f)
-{
-    int r = 0;
-    int c;
-
-    while ((c = *s++) != 0)
-       r = __putc(c, f);
-    return r;
-}
-
-/****************************************************************************
-REMARKS:
-VxD implementation of the ANSI C fclose function.
-****************************************************************************/
-int fclose(
-    FILE *f)
-{
-    fflush(f);
-    _OS2Close((HFILE)f->handle);
-    PM_free(f);
-    return 0;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/vdd/oshdr.h b/board/MAI/bios_emulator/scitech/src/pm/vdd/oshdr.h
deleted file mode 100644 (file)
index 03286bd..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  32-bit OS/2 VDD
-*
-* Description:  Include file to include all OS specific header files.
-*
-****************************************************************************/
diff --git a/board/MAI/bios_emulator/scitech/src/pm/vdd/pm.c b/board/MAI/bios_emulator/scitech/src/pm/vdd/pm.c
deleted file mode 100644 (file)
index 6688bab..0000000
+++ /dev/null
@@ -1,1050 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  32-bit OS/2 VDD
-*
-* Description:  Implementation for the OS Portability Manager Library, which
-*               contains functions to implement OS specific services in a
-*               generic, cross platform API. Porting the OS Portability
-*               Manager library is the first step to porting any SciTech
-*               products to a new platform.
-*
-****************************************************************************/
-
-#include "pmapi.h"
-#include "drvlib/os/os.h"
-#include "sdd/sddhelp.h"
-#include "mtrr.h"
-
-#define TRACE(a)
-
-/*--------------------------- Global variables ----------------------------*/
-
-#define MAX_MEMORY_SHARED           100
-#define MAX_MEMORY_MAPPINGS         100
-
-/* TODO: I think the global and linear members will be the same, but not sure yet. */
-typedef struct {
-    void    *linear;
-    ulong   global;
-    ulong   length;
-    int     npages;
-    } memshared;
-
-typedef struct {
-    ulong   physical;
-    ulong   linear;
-    ulong   length;
-    int     npages;
-    ibool   isCached;
-    } mmapping;
-
-static int          numMappings = 0;
-static memshared    shared[MAX_MEMORY_MAPPINGS] = {0};
-static mmapping     maps[MAX_MEMORY_MAPPINGS];
-ibool               _PM_haveBIOS = TRUE;
-char                _PM_cntPath[PM_MAX_PATH] = "";     /* there just isn't any */
-uchar               *_PM_rmBufAddr = NULL;
-ushort _VARAPI      PM_savedDS = 0;   /* why can't I use the underscore prefix? */
-
-HVDHSEM             hevFarCallRet = NULL;
-HVDHSEM             hevIRet       = NULL;
-HHOOK               hhookUserReturnHook = NULL;
-HHOOK               hhookUserIRetHook   = NULL;
-
-static void (PMAPIP fatalErrorCleanup)(void) = NULL;
-
-/*----------------------------- Implementation ----------------------------*/
-
-/* Functions to read and write CMOS registers */
-
-ulong   PMAPI _PM_getPDB(void);
-uchar   PMAPI _PM_readCMOS(int index);
-void    PMAPI _PM_writeCMOS(int index,uchar value);
-
-VOID HOOKENTRY UserReturnHook(PVOID pRefData, PCRF pcrf);
-VOID HOOKENTRY UserIRetHook(PVOID pRefData, PCRF pcrf);
-
-void PMAPI PM_init(void)
-{
-    MTRR_init();
-
-    /* Initialize VDD-specific data */
-    /* Note: PM_init must be (obviously) called in VDM task context! */
-    VDHCreateSem(&hevFarCallRet, VDH_EVENTSEM);
-    VDHCreateSem(&hevIRet, VDH_EVENTSEM);
-    hhookUserReturnHook = VDHAllocHook(VDH_RETURN_HOOK, (PFNARM)UserReturnHook, 0);
-    hhookUserIRetHook   = VDHAllocHook(VDH_RETURN_HOOK, (PFNARM)UserIRetHook, 0);
-
-    if ((hevIRet == NULL) || (hevFarCallRet == NULL) ||
-       (hhookUserReturnHook == NULL) || (hhookUserIRetHook == NULL)) {
-       /* something failed, we can't go on */
-       /* TODO: take some action here! */
-       }
-}
-
-/* Do some cleaning up */
-void PMAPI PM_exit(void)
-{
-    /* Note: Hooks allocated during or after VDM creation are deallocated automatically */
-    if (hevIRet != NULL)
-       VDHDestroySem(hevIRet);
-
-    if (hevFarCallRet != NULL)
-       VDHDestroySem(hevFarCallRet);
-}
-
-ibool PMAPI PM_haveBIOSAccess(void)
-{ return _PM_haveBIOS; }
-
-long PMAPI PM_getOSType(void)
-{ return /*_OS_OS2VDD*/ _OS_OS2; }  /*FIX!! */
-
-int PMAPI PM_getModeType(void)
-{ return PM_386; }
-
-void PMAPI PM_backslash(char *s)
-{
-    uint pos = strlen(s);
-    if (s[pos-1] != '\\') {
-       s[pos] = '\\';
-       s[pos+1] = '\0';
-       }
-}
-
-void PMAPI PM_setFatalErrorCleanup(
-    void (PMAPIP cleanup)(void))
-{
-    fatalErrorCleanup = cleanup;
-}
-
-void PMAPI PM_fatalError(const char *msg)
-{
-    if (fatalErrorCleanup)
-       fatalErrorCleanup();
-/*    Fatal_Error_Handler(msg,0);  TODO: implement somehow! */
-}
-
-/****************************************************************************
-PARAMETERS:
-len     - Place to store the length of the buffer
-rseg    - Place to store the real mode segment of the buffer
-roff    - Place to store the real mode offset of the buffer
-
-REMARKS:
-This function returns the address and length of the global VESA transfer
-buffer.
-****************************************************************************/
-void * PMAPI PM_getVESABuf(
-    uint *len,
-    uint *rseg,
-    uint *roff)
-{
-    if (_PM_rmBufAddr) {
-       *len = 0; /*VESA_BUF_SIZE; */
-       *rseg = (ulong)(_PM_rmBufAddr) >> 4;
-       *roff = (ulong)(_PM_rmBufAddr) & 0xF;
-       return _PM_rmBufAddr;
-       }
-    return NULL;
-}
-
-int PMAPI PM_int386(int intno, PMREGS *in, PMREGS *out)
-{
-    /* Unused in VDDs */
-    return 0;
-}
-
-char * PMAPI PM_getCurrentPath(char *path,int maxLen)
-{
-    strncpy(path, _PM_cntPath, maxLen);
-    path[maxLen - 1] = 0;
-    return path;
-}
-
-char PMAPI PM_getBootDrive(void)
-{
-    ulong   boot = 3;
-    boot = VDHQuerySysValue(0, VDHGSV_BOOTDRV);
-    return (char)('a' + boot - 1);
-}
-
-const char * PMAPI PM_getVBEAFPath(void)
-{
-    static char path[CCHMAXPATH];
-    strcpy(path,"x:\\");
-    path[0] = PM_getBootDrive();
-    return path;
-}
-
-const char * PMAPI PM_getNucleusPath(void)
-{
-       static char path[CCHMAXPATH];
-       strcpy(path,"x:\\os2\\drivers");
-       path[0] = PM_getBootDrive();
-       PM_backslash(path);
-       strcat(path,"nucleus");
-       return path;
-}
-
-const char * PMAPI PM_getNucleusConfigPath(void)
-{
-    static char path[256];
-    strcpy(path,PM_getNucleusPath());
-    PM_backslash(path);
-    strcat(path,"config");
-    return path;
-}
-
-const char * PMAPI PM_getUniqueID(void)
-{ return PM_getMachineName(); }
-
-const char * PMAPI PM_getMachineName(void)
-{
-    return "Unknown";
-}
-
-int PMAPI PM_kbhit(void)
-{ return 1; }
-
-int PMAPI PM_getch(void)
-{ return 0; }
-
-PM_HWND PMAPI PM_openConsole(PM_HWND hwndUser,int device,int xRes,int yRes,int bpp,ibool fullScreen)
-{
-    /* Unused in VDDs */
-    return NULL;
-}
-
-int PMAPI PM_getConsoleStateSize(void)
-{
-    /* Unused in VDDs */
-    return 1;
-}
-
-void PMAPI PM_saveConsoleState(void *stateBuf,PM_HWND hwndConsole)
-{
-    /* Unused in VDDs */
-}
-
-void PMAPI PM_setSuspendAppCallback(int (_ASMAPIP saveState)(int flags))
-{
-    /* Unused in VDDs */
-}
-
-void PMAPI PM_restoreConsoleState(const void *stateBuf,PM_HWND hwndConsole)
-{
-    /* Unused in VDDs */
-}
-
-void PMAPI PM_closeConsole(PM_HWND hwndConsole)
-{
-    /* Unused in VDDs */
-}
-
-void PMAPI PM_setOSCursorLocation(int x,int y)
-{
-    uchar *_biosPtr = PM_getBIOSPointer();
-    PM_setByte(_biosPtr+0x50,x);
-    PM_setByte(_biosPtr+0x51,y);
-}
-
-void PMAPI PM_setOSScreenWidth(int width,int height)
-{
-    uchar *_biosPtr = PM_getBIOSPointer();
-    PM_setByte(_biosPtr+0x4A,width);
-    PM_setByte(_biosPtr+0x84,height-1);
-}
-
-/****************************************************************************
-REMARKS:
-Allocate a block of shared memory. For OS/2 VDD we allocate shared memory
-as locked, global memory that is accessible from any memory context
-(including interrupt time context), which allows us to load our important
-data structure and code such that we can access it directly from a ring
-0 interrupt context.
-****************************************************************************/
-void * PMAPI PM_mallocShared(long size)
-{
-    ULONG       nPages = (size + 0xFFF) >> 12;
-    int         i;
-
-    /* First find a free slot in our shared memory table */
-    for (i = 0; i < MAX_MEMORY_SHARED; i++) {
-       if (shared[i].linear == 0)
-           break;
-       }
-    if (i < MAX_MEMORY_SHARED) {
-       shared[i].linear = VDHAllocPages(NULL, nPages, VDHAP_SYSTEM | VDHAP_FIXED);
-       shared[i].npages = nPages;
-       shared[i].global = (ULONG)shared[i].linear;
-       return (void*)shared[i].global;
-       }
-    return NULL;
-}
-
-/****************************************************************************
-REMARKS:
-Free a block of shared memory
-****************************************************************************/
-void PMAPI PM_freeShared(void *p)
-{
-    int i;
-
-    /* Find a shared memory block in our table and free it */
-    for (i = 0; i < MAX_MEMORY_SHARED; i++) {
-       if (shared[i].global == (ulong)p) {
-           VDHFreePages(shared[i].linear);
-           shared[i].linear = 0;
-           break;
-           }
-       }
-}
-
-void * PMAPI PM_mapToProcess(void *base,ulong limit)
-{ return (void*)base; }
-
-ibool PMAPI PM_doBIOSPOST(
-    ushort axVal,
-    ulong BIOSPhysAddr,
-    void *mappedBIOS,
-    ulong BIOSLen)
-{
-    /* TODO: Figure out how to do this */
-    return false;
-}
-
-void * PMAPI PM_getBIOSPointer(void)
-{ return (void*)0x400; }
-
-void * PMAPI PM_getA0000Pointer(void)
-{ return PM_mapPhysicalAddr(0xA0000,0xFFFF,true); }
-
-/****************************************************************************
-PARAMETERS:
-base        - Physical base address of the memory to maps in
-limit       - Limit of physical memory to region to maps in
-
-RETURNS:
-Linear address of the newly mapped memory.
-
-REMARKS:
-Maps a physical memory range to a linear memory range.
-****************************************************************************/
-ulong MapPhysicalToLinear(
-    ulong base,
-    ulong limit,
-    int *npages)
-{
-    ulong   linear,length = limit+1;
-    int     i,ppage,flags;
-#if 0
-    ppage = base >> 12;
-    *npages = (length + (base & 0xFFF) + 4095) >> 12;
-    flags = PR_FIXED | PR_STATIC;
-    if (base == 0xA0000) {
-       /* We require the linear address to be aligned to a 64Kb boundary
-        * for mapping the banked framebuffer (so we can do efficient
-        * carry checking for bank changes in the assembler code). The only
-        * way to ensure this is to force the linear address to be aligned
-        * to a 4Mb boundary.
-        */
-       flags |= PR_4MEG;
-       }
-    if ((linear = (ulong)PageReserve(PR_SYSTEM,*npages,flags)) == (ulong)-1)
-       return 0;
-    if (!PageCommitPhys(linear >> 12,*npages,ppage,PC_INCR | PC_USER | PC_WRITEABLE))
-       return 0;
-#endif
-    return linear + (base & 0xFFF);
-}
-
-/****************************************************************************
-PARAMETERS:
-base        - Physical base address of the memory to map in
-limit       - Limit of physical memory to region to map in
-isCached    - True if the memory should be cached, false if not
-
-RETURNS:
-Linear address of the newly mapped memory.
-
-REMARKS:
-This function maps physical memory to linear memory, which can then be used
-to create a selector or used directly from 32-bit protected mode programs.
-This is better than DPMI 0x800, since it allows you to maps physical
-memory below 1Mb, which gets this memory out of the way of the Windows VxD's
-sticky paws.
-
-NOTE:   If the memory is not expected to be cached, this function will
-       directly re-program the PCD (Page Cache Disable) bit in the
-       page tables. There does not appear to be a mechanism in the VMM
-       to control this bit via the regular interface.
-****************************************************************************/
-void * PMAPI PM_mapPhysicalAddr(
-    ulong base,
-    ulong limit,
-    ibool isCached)
-{
-    ulong   linear,length = limit+1;
-    int     i,npages;
-    ulong   PDB,*pPDB;
-
-    /* Search table of existing mappings to see if we have already mapped
-     * a region of memory that will serve this purpose.
-     */
-    for (i = 0; i < numMappings; i++) {
-       if (maps[i].physical == base && maps[i].length == length && maps[i].isCached == isCached)
-           return (void*)maps[i].linear;
-       }
-    if (numMappings == MAX_MEMORY_MAPPINGS)
-       return NULL;
-
-    /* We did not find any previously mapped memory region, so map it in.
-     * Note that we do not use MapPhysToLinear, since this function appears
-     * to have problems mapping memory in the 1Mb physical address space.
-     * Hence we use PageReserve and PageCommitPhys.
-     */
-    if ((linear = MapPhysicalToLinear(base,limit,&npages)) == 0)
-       return NULL;
-    maps[numMappings].physical = base;
-    maps[numMappings].length = length;
-    maps[numMappings].linear = linear;
-    maps[numMappings].npages = npages;
-    maps[numMappings].isCached = isCached;
-    numMappings++;
-
-#if 0
-    /* Finally disable caching where necessary */
-    if (!isCached && (PDB = _PM_getPDB()) != 0) {
-       int     startPDB,endPDB,iPDB,startPage,endPage,start,end,iPage;
-       ulong   pageTable,*pPageTable;
-
-       if (PDB >= 0x100000)
-           pPDB = (ulong*)MapPhysicalToLinear(PDB,0xFFF,&npages);
-       else
-           pPDB = (ulong*)PDB;
-       if (pPDB) {
-           startPDB = (linear >> 22) & 0x3FF;
-           startPage = (linear >> 12) & 0x3FF;
-           endPDB = ((linear+limit) >> 22) & 0x3FF;
-           endPage = ((linear+limit) >> 12) & 0x3FF;
-           for (iPDB = startPDB; iPDB <= endPDB; iPDB++) {
-               pageTable = pPDB[iPDB] & ~0xFFF;
-               if (pageTable >= 0x100000)
-                   pPageTable = (ulong*)MapPhysicalToLinear(pageTable,0xFFF,&npages);
-               else
-                   pPageTable = (ulong*)pageTable;
-               start = (iPDB == startPDB) ? startPage : 0;
-               end = (iPDB == endPDB) ? endPage : 0x3FF;
-               for (iPage = start; iPage <= end; iPage++)
-                   pPageTable[iPage] |= 0x10;
-               PageFree((ulong)pPageTable,PR_STATIC);
-               }
-           PageFree((ulong)pPDB,PR_STATIC);
-           }
-       }
-#endif
-    return (void*)linear;
-}
-
-void PMAPI PM_freePhysicalAddr(void *ptr,ulong limit)
-{
-    /* We never free the mappings */
-}
-
-void PMAPI PM_sleep(ulong milliseconds)
-{
-    /* We never sleep in a VDD */
-}
-
-int PMAPI PM_getCOMPort(int port)
-{
-    /* TODO: Re-code this to determine real values using the Plug and Play */
-    /*       manager for the OS. */
-    switch (port) {
-       case 0: return 0x3F8;
-       case 1: return 0x2F8;
-       }
-    return 0;
-}
-
-int PMAPI PM_getLPTPort(int port)
-{
-    /* TODO: Re-code this to determine real values using the Plug and Play */
-    /*       manager for the OS. */
-    switch (port) {
-       case 0: return 0x3BC;
-       case 1: return 0x378;
-       case 2: return 0x278;
-       }
-    return 0;
-}
-
-ulong PMAPI PM_getPhysicalAddr(void *p)
-{
-       /* TODO: This function should find the physical address of a linear */
-       /*               address. */
-       return 0xFFFFFFFFUL;
-}
-
-void PMAPI _PM_freeMemoryMappings(void)
-{
-    int i;
-/*    for (i = 0; i < numMappings; i++) */
-/*        PageFree(maps[i].linear,PR_STATIC); */
-}
-
-void * PMAPI PM_mapRealPointer(uint r_seg,uint r_off)
-{ return (void*)MK_PHYS(r_seg,r_off); }
-
-void * PMAPI PM_allocRealSeg(uint size,uint *r_seg,uint *r_off)
-{ return NULL; }
-
-void PMAPI PM_freeRealSeg(void *mem)
-{ }
-
-void PMAPI DPMI_int86(int intno, DPMI_regs *regs)
-{
-    /* Unsed in VDDs */
-}
-
-/****************************************************************************
-REMARKS:
-Load the V86 registers in the client state, and save the original state
-before loading the registers.
-****************************************************************************/
-static void LoadV86Registers(
-    PCRF saveRegs,
-    RMREGS *in,
-    RMSREGS *sregs)
-{
-    PCRF            pcrf;     /* current client register frame */
-
-    /* get pointer to registers */
-    pcrf = (PCRF)VDHQuerySysValue(CURRENT_VDM, VDHLSV_PCRF);
-
-    /* Note: We could do VDHPushRegs instead but this should be safer as it */
-    /* doesn't rely on the VDM session having enough free stack space. */
-    *saveRegs = *pcrf;        /* save all registers */
-
-    pcrf->crf_eax = in->e.eax;    /* load new values */
-    pcrf->crf_ebx = in->e.ebx;
-    pcrf->crf_ecx = in->e.ecx;
-    pcrf->crf_edx = in->e.edx;
-    pcrf->crf_esi = in->e.esi;
-    pcrf->crf_edi = in->e.edi;
-    pcrf->crf_es  = sregs->es;
-    pcrf->crf_ds  = sregs->ds;
-
-}
-
-/****************************************************************************
-REMARKS:
-Read the V86 registers from the client state and restore the original state.
-****************************************************************************/
-static void ReadV86Registers(
-    PCRF saveRegs,
-    RMREGS *out,
-    RMSREGS *sregs)
-{
-    PCRF            pcrf;     /* current client register frame */
-
-    /* get pointer to registers */
-    pcrf = (PCRF)VDHQuerySysValue(CURRENT_VDM, VDHLSV_PCRF);
-
-    /* read new register values */
-    out->e.eax = pcrf->crf_eax;
-    out->e.ebx = pcrf->crf_ebx;
-    out->e.ecx = pcrf->crf_ecx;
-    out->e.edx = pcrf->crf_edx;
-    out->e.esi = pcrf->crf_esi;
-    out->e.edi = pcrf->crf_edi;
-    sregs->es  = pcrf->crf_es;
-    sregs->ds  = pcrf->crf_ds;
-
-    /* restore original client registers */
-    *pcrf = *saveRegs;
-}
-
-/****************************************************************************
-REMARKS: Used for far calls into V86 code
-****************************************************************************/
-VOID HOOKENTRY UserReturnHook(
-  PVOID pRefData,
-  PCRF pcrf )
-{
-    VDHPostEventSem(hevFarCallRet);
-}
-
-/****************************************************************************
-REMARKS: Used for calling BIOS interrupts
-****************************************************************************/
-VOID HOOKENTRY UserIRetHook(
-  PVOID pRefData,
-  PCRF pcrf )
-{
-    VDHPostEventSem(hevIRet);
-}
-
-/****************************************************************************
-REMARKS:
-Call a V86 real mode function with the specified register values
-loaded before the call. The call returns with a far ret.
-Must be called from within a DOS session context!
-****************************************************************************/
-void PMAPI PM_callRealMode(
-    uint seg,
-    uint off,
-    RMREGS *regs,
-    RMSREGS *sregs)
-{
-    CRF   saveRegs;
-    FPFN  fnAddress;
-    ULONG rc;
-
-    TRACE("SDDHELP: Entering PM_callRealMode()\n");
-    LoadV86Registers(SSToDS(&saveRegs),regs,sregs);
-
-    /* set up return hook for call */
-    rc = VDHArmReturnHook(hhookUserReturnHook, VDHARH_CSEIP_HOOK);
-
-    VDHResetEventSem(hevFarCallRet);
-
-    /* the address is a 16:32 pointer */
-    OFFSETOF32(fnAddress)  = off;
-    SEGMENTOF32(fnAddress) = seg;
-    rc = VDHPushFarCall(fnAddress);
-    VDHYield(0);
-
-    /* wait until the V86 call returns - our return hook posts the semaphore */
-    rc = VDHWaitEventSem(hevFarCallRet, SEM_INDEFINITE_WAIT);
-
-    ReadV86Registers(SSToDS(&saveRegs),regs,sregs);
-    TRACE("SDDHELP: Exiting PM_callRealMode()\n");
-}
-
-/****************************************************************************
-REMARKS:
-Issue a V86 real mode interrupt with the specified register values
-loaded before the interrupt.
-Must be called from within a DOS session context!
-****************************************************************************/
-int PMAPI PM_int86(
-    int intno,
-    RMREGS *in,
-    RMREGS *out)
-{
-    RMSREGS    sregs = {0};
-    CRF        saveRegs;
-    ushort     oldDisable;
-    ULONG      rc;
-
-    memset(SSToDS(&sregs), 0, sizeof(sregs));
-
-#if 0   /* do we need this?? */
-    /* Disable pass-up to our VDD handler so we directly call BIOS */
-    TRACE("SDDHELP: Entering PM_int86()\n");
-    if (disableTSRFlag) {
-       oldDisable = *disableTSRFlag;
-       *disableTSRFlag = 0;
-       }
-#endif
-
-    LoadV86Registers(SSToDS(&saveRegs), in, SSToDS(&sregs));
-
-    VDHResetEventSem(hevIRet);
-    rc = VDHPushInt(intno);
-
-    /* set up return hook for interrupt */
-    rc = VDHArmReturnHook(hhookUserIRetHook, VDHARH_NORMAL_IRET);
-
-    VDHYield(0);
-
-    /* wait until the V86 IRETs - our return hook posts the semaphore */
-    rc = VDHWaitEventSem(hevIRet, 5000); /*SEM_INDEFINITE_WAIT); */
-
-    ReadV86Registers(SSToDS(&saveRegs), out, SSToDS(&sregs));
-
-#if 0
-    /* Re-enable pass-up to our VDD handler if previously enabled */
-    if (disableTSRFlag)
-       *disableTSRFlag = oldDisable;
-#endif
-
-    TRACE("SDDHELP: Exiting PM_int86()\n");
-    return out->x.ax;
-
-}
-
-/****************************************************************************
-REMARKS:
-Issue a V86 real mode interrupt with the specified register values
-loaded before the interrupt.
-****************************************************************************/
-int PMAPI PM_int86x(
-    int intno,
-    RMREGS *in,
-    RMREGS *out,
-    RMSREGS *sregs)
-{
-    CRF             saveRegs;
-    ushort          oldDisable;
-    ULONG       rc;
-
-#if 0
-    /* Disable pass-up to our VxD handler so we directly call BIOS */
-    TRACE("SDDHELP: Entering PM_int86x()\n");
-    if (disableTSRFlag) {
-       oldDisable = *disableTSRFlag;
-       *disableTSRFlag = 0;
-       }
-#endif
-    LoadV86Registers(SSToDS(&saveRegs), in, sregs);
-
-    VDHResetEventSem(hevIRet);
-    rc = VDHPushInt(intno);
-
-    /* set up return hook for interrupt */
-    rc = VDHArmReturnHook(hhookUserIRetHook, VDHARH_NORMAL_IRET);
-
-    VDHYield(0);
-
-    /* wait until the V86 IRETs - our return hook posts the semaphore */
-    rc = VDHWaitEventSem(hevIRet, 5000); /*SEM_INDEFINITE_WAIT); */
-
-    ReadV86Registers(SSToDS(&saveRegs), out, sregs);
-
-#if 0
-    /* Re-enable pass-up to our VxD handler if previously enabled */
-    if (disableTSRFlag)
-       *disableTSRFlag = oldDisable;
-#endif
-
-    TRACE("SDDHELP: Exiting PM_int86x()\n");
-    return out->x.ax;
-}
-
-void PMAPI PM_availableMemory(ulong *physical,ulong *total)
-{ *physical = *total = 0; }
-
-/****************************************************************************
-REMARKS:
-Allocates a block of locked physical memory.
-****************************************************************************/
-void * PMAPI PM_allocLockedMem(
-    uint size,
-    ulong *physAddr,
-    ibool contiguous,
-    ibool below16M)
-{
-    ULONG       flags = VDHAP_SYSTEM;
-    ULONG       nPages = (size + 0xFFF) >> 12;
-
-    flags |= (physAddr != NULL) ? VDHAP_PHYSICAL : VDHAP_FIXED;
-
-    return VDHAllocPages(physAddr, nPages, VDHAP_SYSTEM | VDHAP_PHYSICAL);
-}
-
-/****************************************************************************
-REMARKS:
-Frees a block of locked physical memory.
-****************************************************************************/
-void PMAPI PM_freeLockedMem(
-    void *p,
-    uint size,
-    ibool contiguous)
-{
-    if (p)
-       VDHFreePages((PVOID)p);
-}
-
-/****************************************************************************
-REMARKS:
-Lock linear memory so it won't be paged.
-****************************************************************************/
-int PMAPI PM_lockDataPages(void *p,uint len,PM_lockHandle *lh)
-{
-    ULONG  lockHandle;
-
-    /* TODO: the lock handle is essential for the unlock operation!! */
-    lockHandle = VDHLockMem(p, len, 0, (PVOID)VDHLM_NO_ADDR, NULL);
-
-    if (lockHandle != NULL)
-       return 0;
-    else
-       return 1;
-}
-
-/****************************************************************************
-REMARKS:
-Unlock linear memory so it won't be paged.
-****************************************************************************/
-int PMAPI PM_unlockDataPages(void *p,uint len,PM_lockHandle *lh)
-{
-    /* TODO: implement - use a table of lock handles? */
-    /* VDHUnlockPages(lockHandle); */
-    return 0;
-}
-
-/****************************************************************************
-REMARKS:
-Lock linear memory so it won't be paged.
-****************************************************************************/
-int PMAPI PM_lockCodePages(void (*p)(),uint len,PM_lockHandle *lh)
-{
-    return PM_lockDataPages((void*)p,len,lh);
-}
-
-/****************************************************************************
-REMARKS:
-Unlock linear memory so it won't be paged.
-****************************************************************************/
-int PMAPI PM_unlockCodePages(void (*p)(),uint len,PM_lockHandle *lh)
-{
-    return PM_unlockDataPages((void*)p,len,lh);
-}
-
-/****************************************************************************
-REMARKS:
-OS specific shared libraries not supported inside a VDD
-****************************************************************************/
-PM_MODULE PMAPI PM_loadLibrary(
-    const char *szDLLName)
-{
-    (void)szDLLName;
-    return NULL;
-}
-
-/****************************************************************************
-REMARKS:
-OS specific shared libraries not supported inside a VDD
-****************************************************************************/
-void * PMAPI PM_getProcAddress(
-    PM_MODULE hModule,
-    const char *szProcName)
-{
-    (void)hModule;
-    (void)szProcName;
-    return NULL;
-}
-
-/****************************************************************************
-REMARKS:
-OS specific shared libraries not supported inside a VDD
-****************************************************************************/
-void PMAPI PM_freeLibrary(
-    PM_MODULE hModule)
-{
-    (void)hModule;
-}
-
-/****************************************************************************
-REMARKS:
-Function to find the first file matching a search criteria in a directory.
-****************************************************************************/
-void *PMAPI PM_findFirstFile(
-    const char *filename,
-    PM_findData *findData)
-{
-    /* TODO: This function should start a directory enumeration search */
-    /*       given the filename (with wildcards). The data should be */
-    /*       converted and returned in the findData standard form. */
-    (void)filename;
-    (void)findData;
-    return PM_FILE_INVALID;
-}
-
-/****************************************************************************
-REMARKS:
-Function to find the next file matching a search criteria in a directory.
-****************************************************************************/
-ibool PMAPI PM_findNextFile(
-    void *handle,
-    PM_findData *findData)
-{
-    /* TODO: This function should find the next file in directory enumeration */
-    /*       search given the search criteria defined in the call to */
-    /*       PM_findFirstFile. The data should be converted and returned */
-    /*       in the findData standard form. */
-    (void)handle;
-    (void)findData;
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-Function to close the find process
-****************************************************************************/
-void PMAPI PM_findClose(
-    void *handle)
-{
-    /* TODO: This function should close the find process. This may do */
-    /*       nothing for some OS'es. */
-    (void)handle;
-}
-
-/****************************************************************************
-REMARKS:
-Function to determine if a drive is a valid drive or not. Under Unix this
-function will return false for anything except a value of 3 (considered
-the root drive, and equivalent to C: for non-Unix systems). The drive
-numbering is:
-
-    1   - Drive A:
-    2   - Drive B:
-    3   - Drive C:
-    etc
-
-****************************************************************************/
-ibool PMAPI PM_driveValid(
-    char drive)
-{
-    /* Not applicable in a VDD */
-    (void)drive;
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-Function to get the current working directory for the specififed drive.
-Under Unix this will always return the current working directory regardless
-of what the value of 'drive' is.
-****************************************************************************/
-void PMAPI PM_getdcwd(
-    int drive,
-    char *dir,
-    int len)
-{
-    /* Not applicable in a VDD */
-    (void)drive;
-    (void)dir;
-    (void)len;
-}
-
-/****************************************************************************
-PARAMETERS:
-base    - The starting physical base address of the region
-size    - The size in bytes of the region
-type    - Type to place into the MTRR register
-
-RETURNS:
-Error code describing the result.
-
-REMARKS:
-Function to enable write combining for the specified region of memory.
-****************************************************************************/
-int PMAPI PM_enableWriteCombine(
-    ulong base,
-    ulong size,
-    uint type)
-{
-    return MTRR_enableWriteCombine(base,size,type);
-}
-
-/****************************************************************************
-REMARKS:
-Function to change the file attributes for a specific file.
-****************************************************************************/
-void PMAPI PM_setFileAttr(
-    const char *filename,
-    uint attrib)
-{
-    /* TODO: Implement this ? */
-    (void)filename;
-    (void)attrib;
-    PM_fatalError("PM_setFileAttr not implemented!");
-}
-
-/****************************************************************************
-REMARKS:
-Function to get the file attributes for a specific file.
-****************************************************************************/
-uint PMAPI PM_getFileAttr(
-    const char *filename)
-{
-    /* TODO: Implement this ? */
-    (void)filename;
-    PM_fatalError("PM_getFileAttr not implemented!");
-    return 0;
-}
-
-/****************************************************************************
-REMARKS:
-Function to create a directory.
-****************************************************************************/
-ibool PMAPI PM_mkdir(
-    const char *filename)
-{
-    /* TODO: Implement this ? */
-    (void)filename;
-    PM_fatalError("PM_mkdir not implemented!");
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-Function to remove a directory.
-****************************************************************************/
-ibool PMAPI PM_rmdir(
-    const char *filename)
-{
-    /* TODO: Implement this ? */
-    (void)filename;
-    PM_fatalError("PM_rmdir not implemented!");
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-Function to get the file time and date for a specific file.
-****************************************************************************/
-ibool PMAPI PM_getFileTime(
-    const char *filename,
-    ibool gmTime,
-    PM_time *time)
-{
-    /* TODO: Implement this ? */
-    (void)filename;
-    (void)gmTime;
-    (void)time;
-    PM_fatalError("PM_getFileTime not implemented!");
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-Function to set the file time and date for a specific file.
-****************************************************************************/
-ibool PMAPI PM_setFileTime(
-    const char *filename,
-    ibool gmTime,
-    PM_time *time)
-{
-    /* TODO: Implement this ? */
-    (void)filename;
-    (void)gmTime;
-    (void)time;
-    PM_fatalError("PM_setFileTime not implemented!");
-    return false;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/vdd/vflat.c b/board/MAI/bios_emulator/scitech/src/pm/vdd/vflat.c
deleted file mode 100644 (file)
index 2163928..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/****************************************************************************
-*
-*                                       SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:             ANSI C
-* Environment:  Any
-*
-* Description:  Dummy module; no virtual framebuffer for this OS
-*
-****************************************************************************/
-
-#include "pmapi.h"
-
-ibool PMAPI VF_available(void)
-{
-       return false;
-}
-
-void * PMAPI VF_init(ulong baseAddr,int bankSize,int codeLen,void *bankFunc)
-{
-       return NULL;
-}
-
-void PMAPI VF_exit(void)
-{
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/vdd/ztimer.c b/board/MAI/bios_emulator/scitech/src/pm/vdd/ztimer.c
deleted file mode 100644 (file)
index 631f655..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-/****************************************************************************
-*
-*                         Ultra Long Period Timer
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  32-bit OS/2 VDD
-*
-* Description:  OS specific implementation for the Zen Timer functions.
-*
-****************************************************************************/
-
-/*---------------------------- Global variables ---------------------------*/
-
-static ulong    frequency = 1193180;
-
-/*----------------------------- Implementation ----------------------------*/
-
-/****************************************************************************
-REMARKS:
-Initialise the Zen Timer module internals.
-****************************************************************************/
-#define __ZTimerInit()
-
-/****************************************************************************
-REMARKS:
-Call the assembler Zen Timer functions to do the timing.
-****************************************************************************/
-#define __LZTimerOn(tm)     VTD_Get_Real_Time(&tm->start.high,&tm->start.low)
-
-/****************************************************************************
-REMARKS:
-Call the assembler Zen Timer functions to do the timing.
-****************************************************************************/
-static ulong __LZTimerLap(
-    LZTimerObject *tm)
-{
-    CPU_largeInteger    lap,count;
-    VTD_Get_Real_Time(&lap.high,&lap.low);
-    _CPU_diffTime64(&tm->start,&lap,&count);
-    return _CPU_calcMicroSec(&count,frequency);
-}
-
-/****************************************************************************
-REMARKS:
-Call the assembler Zen Timer functions to do the timing.
-****************************************************************************/
-#define __LZTimerOff(tm)    VTD_Get_Real_Time(&tm->end.high,&tm->end.low)
-
-/****************************************************************************
-REMARKS:
-Call the assembler Zen Timer functions to do the timing.
-****************************************************************************/
-static ulong __LZTimerCount(
-    LZTimerObject *tm)
-{
-    CPU_largeInteger tmCount;
-    _CPU_diffTime64(&tm->start,&tm->end,&tmCount);
-    return _CPU_calcMicroSec(&tmCount,frequency);
-}
-
-/****************************************************************************
-REMARKS:
-Define the resolution of the long period timer as microseconds per timer tick.
-****************************************************************************/
-#define ULZTIMER_RESOLUTION     1000
-
-/****************************************************************************
-REMARKS:
-Read the Long Period timer value from the BIOS timer tick.
-****************************************************************************/
-static ulong __ULZReadTime(void)
-{
-    return VDHQuerySysValue(0, VDHGSV_MSECSBOOT);
-}
-
-/****************************************************************************
-REMARKS:
-Compute the elapsed time from the BIOS timer tick. Note that we check to see
-whether a midnight boundary has passed, and if so adjust the finish time to
-account for this. We cannot detect if more that one midnight boundary has
-passed, so if this happens we will be generating erronous results.
-****************************************************************************/
-ulong __ULZElapsedTime(ulong start,ulong finish)
-{ return finish - start; }
diff --git a/board/MAI/bios_emulator/scitech/src/pm/vxd/_pm.asm b/board/MAI/bios_emulator/scitech/src/pm/vxd/_pm.asm
deleted file mode 100644 (file)
index 64a7cec..0000000
+++ /dev/null
@@ -1,299 +0,0 @@
-;****************************************************************************
-;*
-;*                  SciTech OS Portability Manager Library
-;*
-;*  ========================================================================
-;*
-;*    The contents of this file are subject to the SciTech MGL Public
-;*    License Version 1.0 (the "License"); you may not use this file
-;*    except in compliance with the License. You may obtain a copy of
-;*    the License at http://www.scitechsoft.com/mgl-license.txt
-;*
-;*    Software distributed under the License is distributed on an
-;*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-;*    implied. See the License for the specific language governing
-;*    rights and limitations under the License.
-;*
-;*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-;*
-;*    The Initial Developer of the Original Code is SciTech Software, Inc.
-;*    All Rights Reserved.
-;*
-;*  ========================================================================
-;*
-;* Language:    80386 Assembler, TASM 4.0 or NASM
-;* Environment: 32-bit Windows VxD
-;*
-;* Description: Low level assembly support for the PM library specific to
-;*              Windows VxDs.
-;*
-;****************************************************************************
-
-        IDEAL
-
-include "scitech.mac"               ; Memory model macros
-
-header      _pm                     ; Set up memory model
-
-begdataseg  _pm
-
-    cextern _PM_savedDS,USHORT
-
-enddataseg  _pm
-
-P586
-
-begcodeseg  _pm                 ; Start of code segment
-
-;----------------------------------------------------------------------------
-; void PM_segread(PMSREGS *sregs)
-;----------------------------------------------------------------------------
-; Read the current value of all segment registers
-;----------------------------------------------------------------------------
-cprocstart  PM_segread
-
-        ARG     sregs:DPTR
-
-        enter_c
-
-        mov     ax,es
-        _les    _si,[sregs]
-        mov     [_ES _si],ax
-        mov     [_ES _si+2],cs
-        mov     [_ES _si+4],ss
-        mov     [_ES _si+6],ds
-        mov     [_ES _si+8],fs
-        mov     [_ES _si+10],gs
-
-        leave_c
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; int PM_int386x(int intno, PMREGS *in, PMREGS *out,PMSREGS *sregs)
-;----------------------------------------------------------------------------
-; Issues a software interrupt in protected mode. This routine has been
-; written to allow user programs to load CS and DS with different values
-; other than the default.
-;----------------------------------------------------------------------------
-cprocstart  PM_int386x
-
-; Not used for VxDs
-
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void PM_saveDS(void)
-;----------------------------------------------------------------------------
-; Save the value of DS into a section of the code segment, so that we can
-; quickly load this value at a later date in the PM_loadDS() routine from
-; inside interrupt handlers etc. The method to do this is different
-; depending on the DOS extender being used.
-;----------------------------------------------------------------------------
-cprocstart  PM_saveDS
-
-        mov     [_PM_savedDS],ds    ; Store away in data segment
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void PM_loadDS(void)
-;----------------------------------------------------------------------------
-; Routine to load the DS register with the default value for the current
-; DOS extender. Only the DS register is loaded, not the ES register, so
-; if you wish to call C code, you will need to also load the ES register
-; in 32 bit protected mode.
-;----------------------------------------------------------------------------
-cprocstart  PM_loadDS
-
-        mov     ds,[cs:_PM_savedDS] ; We can access the proper DS through CS
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void PM_setBankA(int bank)
-;----------------------------------------------------------------------------
-cprocstart      PM_setBankA
-
-; Not used for VxDs
-
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void PM_setBankAB(int bank)
-;----------------------------------------------------------------------------
-cprocstart      PM_setBankAB
-
-; Not used for VxDs
-
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void PM_setCRTStart(int x,int y,int waitVRT)
-;----------------------------------------------------------------------------
-cprocstart      PM_setCRTStart
-
-; Not used for VxDs
-
-        ret
-
-cprocend
-
-; Macro to delay briefly to ensure that enough time has elapsed between
-; successive I/O accesses so that the device being accessed can respond
-; to both accesses even on a very fast PC.
-
-ifdef   USE_NASM
-%macro  DELAY 0
-        jmp     short $+2
-        jmp     short $+2
-        jmp     short $+2
-%endmacro
-%macro  IODELAYN 1
-%rep    %1
-        DELAY
-%endrep
-%endmacro
-else
-macro   DELAY
-        jmp     short $+2
-        jmp     short $+2
-        jmp     short $+2
-endm
-macro   IODELAYN    N
-    rept    N
-        DELAY
-    endm
-endm
-endif
-
-;----------------------------------------------------------------------------
-; uchar _PM_readCMOS(int index)
-;----------------------------------------------------------------------------
-; Read the value of a specific CMOS register. We do this with both
-; normal interrupts and NMI disabled.
-;----------------------------------------------------------------------------
-cprocstart  _PM_readCMOS
-
-        ARG     index:UINT
-
-        push    _bp
-        mov     _bp,_sp
-        pushfd
-        mov     al,[BYTE index]
-        or      al,80h              ; Add disable NMI flag
-        cli
-        out     70h,al
-        IODELAYN 5
-        in      al,71h
-        mov     ah,al
-        xor     al,al
-        IODELAYN 5
-        out     70h,al              ; Re-enable NMI
-        mov     al,ah               ; Return value in AL
-        popfd
-        pop     _bp
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; void _PM_writeCMOS(int index,uchar value)
-;----------------------------------------------------------------------------
-; Read the value of a specific CMOS register. We do this with both
-; normal interrupts and NMI disabled.
-;----------------------------------------------------------------------------
-cprocstart  _PM_writeCMOS
-
-        ARG     index:UINT, value:UCHAR
-
-        push    _bp
-        mov     _bp,_sp
-        pushfd
-        mov     al,[BYTE index]
-        or      al,80h              ; Add disable NMI flag
-        cli
-        out     70h,al
-        IODELAYN 5
-        mov     al,[value]
-        out     71h,al
-        xor     al,al
-        IODELAYN 5
-        out     70h,al              ; Re-enable NMI
-        popfd
-        pop     _bp
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; double _ftol(double f)
-;----------------------------------------------------------------------------
-; Calls to __ftol are generated by the Borland C++ compiler for code
-; that needs to convert a floating point type to an integral type.
-;
-; Input: floating point number on the top of the '87.
-;
-; Output: a (signed or unsigned) long in EAX
-; All other registers preserved.
-;-----------------------------------------------------------------------
-cprocstart  _ftol
-
-        LOCAL   temp1:WORD, temp2:QWORD = LocalSize
-
-        push    ebp
-        mov     ebp,esp
-        sub     esp,LocalSize
-
-        fstcw   [temp1]                 ; save the control word
-        fwait
-        mov     al,[BYTE temp1+1]
-        or      [BYTE temp1+1],0Ch      ; set rounding control to chop
-        fldcw   [temp1]
-        fistp   [temp2]                 ; convert to 64-bit integer
-        mov     [BYTE temp1+1],al
-        fldcw   [temp1]                 ; restore the control word
-        mov     eax,[DWORD temp2]       ; return LS 32 bits
-        mov     edx,[DWORD temp2+4]     ;        MS 32 bits
-
-        mov     esp,ebp
-        pop     ebp
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; _PM_getPDB - Return the Page Table Directory Base address
-;----------------------------------------------------------------------------
-cprocstart  _PM_getPDB
-
-        mov     eax,cr3
-        and     eax,0FFFFF000h
-        ret
-
-cprocend
-
-;----------------------------------------------------------------------------
-; Flush the Translation Lookaside buffer
-;----------------------------------------------------------------------------
-cprocstart  PM_flushTLB
-
-        wbinvd                  ; Flush the CPU cache
-        mov     eax,cr3
-        mov     cr3,eax         ; Flush the TLB
-        ret
-
-cprocend
-
-endcodeseg  _pm
-
-        END                     ; End of module
diff --git a/board/MAI/bios_emulator/scitech/src/pm/vxd/cpuinfo.c b/board/MAI/bios_emulator/scitech/src/pm/vxd/cpuinfo.c
deleted file mode 100644 (file)
index 3c7eaae..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/****************************************************************************
-*
-*                         Ultra Long Period Timer
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  32-bit Windows VxD
-*
-* Description:  VxD specific code for the CPU detection module.
-*
-****************************************************************************/
-
-/*----------------------------- Implementation ----------------------------*/
-
-/****************************************************************************
-REMARKS:
-Do nothing for VxD's
-****************************************************************************/
-#define SetMaxThreadPriority()      0
-
-/****************************************************************************
-REMARKS:
-Do nothing for VxD's
-****************************************************************************/
-#define RestoreThreadPriority(i)    (void)(i)
-
-/****************************************************************************
-REMARKS:
-Initialise the counter and return the frequency of the counter.
-****************************************************************************/
-static void GetCounterFrequency(
-    CPU_largeInteger *freq)
-{
-    freq->low = 1193180;
-    freq->high = 0;
-}
-
-/****************************************************************************
-REMARKS:
-Read the counter and return the counter value.
-****************************************************************************/
-#define GetCounter(t)                           \
-{                                               \
-    CPU_largeInteger count;                     \
-    VTD_Get_Real_Time(&count.high,&count.low);  \
-    (t)->low = count.low;                       \
-    (t)->high = count.high;                     \
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/vxd/fileio.c b/board/MAI/bios_emulator/scitech/src/pm/vxd/fileio.c
deleted file mode 100644 (file)
index 3c6ce99..0000000
+++ /dev/null
@@ -1,304 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  32-bit Windows VxD
-*
-* Description:  C library compatible I/O functions for use within a VxD.
-*
-****************************************************************************/
-
-#include "pmapi.h"
-#include "vxdfile.h"
-
-/*------------------------ Main Code Implementation -----------------------*/
-
-#define EOF -1
-
-/****************************************************************************
-REMARKS:
-VxD implementation of the ANSI C fopen function.
-****************************************************************************/
-FILE * fopen(
-    const char *filename,
-    const char *mode)
-{
-    FILE    *f = PM_malloc(sizeof(FILE));
-    long    oldpos;
-
-    if (f) {
-       f->offset = 0;
-       f->text = (mode[1] == 't' || mode[2] == 't');
-       f->writemode = (mode[0] == 'w') || (mode[0] == 'a');
-       if (initComplete) {
-           WORD    omode,error;
-           BYTE    action;
-
-           if (mode[0] == 'r') {
-               omode = OPEN_ACCESS_READONLY | OPEN_SHARE_COMPATIBLE;
-               action = ACTION_IFEXISTS_OPEN | ACTION_IFNOTEXISTS_FAIL;
-               }
-           else if (mode[0] == 'w') {
-               omode = OPEN_ACCESS_WRITEONLY | OPEN_SHARE_COMPATIBLE;
-               action = ACTION_IFEXISTS_TRUNCATE | ACTION_IFNOTEXISTS_CREATE;
-               }
-           else {
-               omode = OPEN_ACCESS_READWRITE | OPEN_SHARE_COMPATIBLE;
-               action = ACTION_IFEXISTS_OPEN | ACTION_IFNOTEXISTS_CREATE;
-               }
-           f->handle = (int)R0_OpenCreateFile(false,(char*)filename,omode,ATTR_NORMAL,action,0,&error,&action);
-           if (f->handle == 0) {
-               PM_free(f);
-               return NULL;
-               }
-           f->filesize = R0_GetFileSize((HANDLE)f->handle,&error);
-           if (mode[0] == 'a')
-               fseek(f,0,2);
-           }
-       else {
-           int oflag,pmode;
-
-           if (mode[0] == 'r') {
-               pmode = _S_IREAD;
-               oflag = _O_RDONLY;
-               }
-           else if (mode[0] == 'w') {
-               pmode = _S_IWRITE;
-               oflag = _O_WRONLY | _O_CREAT | _O_TRUNC;
-               }
-           else {
-               pmode = _S_IWRITE;
-               oflag = _O_RDWR | _O_CREAT | _O_APPEND;
-               }
-           if (f->text)
-               oflag |= _O_TEXT;
-           else
-               oflag |= _O_BINARY;
-           if ((f->handle = i_open(filename,oflag,pmode)) == -1) {
-               PM_free(f);
-               return NULL;
-               }
-           oldpos = i_lseek(f->handle,0,1);
-           f->filesize = i_lseek(f->handle,0,2);
-           i_lseek(f->handle,oldpos,0);
-           }
-       }
-    return f;
-}
-
-/****************************************************************************
-REMARKS:
-VxD implementation of the ANSI C fread function. Note that the VxD file I/O
-functions are layered on DOS, so can only read up to 64K at a time. Since
-we are expected to handle much larger chunks than this, we handle larger
-blocks automatically in here.
-****************************************************************************/
-size_t fread(
-    void *ptr,
-    size_t size,
-    size_t n,
-    FILE *f)
-{
-    char    *buf = ptr;
-    WORD    error;
-    int     bytes = size * n;
-    int     readbytes,totalbytes = 0;
-
-    while (bytes > 0x10000) {
-       if (initComplete) {
-           readbytes  = R0_ReadFile(false,(HANDLE)f->handle,buf,0x8000,f->offset,&error);
-           readbytes += R0_ReadFile(false,(HANDLE)f->handle,buf+0x8000,0x8000,f->offset+0x8000,&error);
-           }
-       else {
-           readbytes  = i_read(f->handle,buf,0x8000);
-           readbytes += i_read(f->handle,buf+0x8000,0x8000);
-           }
-       totalbytes += readbytes;
-       f->offset += readbytes;
-       buf += 0x10000;
-       bytes -= 0x10000;
-       }
-    if (bytes) {
-       if (initComplete)
-           readbytes = R0_ReadFile(false,(HANDLE)f->handle,buf,bytes,f->offset,&error);
-       else
-           readbytes = i_read(f->handle,buf,bytes);
-       totalbytes += readbytes;
-       f->offset += readbytes;
-       }
-    return totalbytes / size;
-}
-
-/****************************************************************************
-REMARKS:
-VxD implementation of the ANSI C fwrite function. Note that the VxD file I/O
-functions are layered on DOS, so can only read up to 64K at a time. Since
-we are expected to handle much larger chunks than this, we handle larger
-blocks automatically in here.
-****************************************************************************/
-size_t fwrite(
-    const void *ptr,
-    size_t size,
-    size_t n,
-    FILE *f)
-{
-    const char  *buf = ptr;
-    WORD        error;
-    int         bytes = size * n;
-    int         writtenbytes,totalbytes = 0;
-
-    if (!f->writemode)
-       return 0;
-    while (bytes > 0x10000) {
-       if (initComplete) {
-           writtenbytes  = R0_WriteFile(false,(HANDLE)f->handle,buf,0x8000,f->offset,&error);
-           writtenbytes += R0_WriteFile(false,(HANDLE)f->handle,buf+0x8000,0x8000,f->offset+0x8000,&error);
-           }
-       else {
-           writtenbytes  = i_write(f->handle,buf,0x8000);
-           writtenbytes += i_write(f->handle,buf+0x8000,0x8000);
-           }
-       totalbytes += writtenbytes;
-       f->offset += writtenbytes;
-       buf += 0x10000;
-       bytes -= 0x10000;
-       }
-    if (initComplete)
-       writtenbytes = R0_WriteFile(false,(HANDLE)f->handle,buf,bytes,f->offset,&error);
-    else
-       writtenbytes = i_write(f->handle,buf,bytes);
-    totalbytes += writtenbytes;
-    f->offset += writtenbytes;
-    if (f->offset > f->filesize)
-       f->filesize = f->offset;
-    return totalbytes / size;
-}
-
-/****************************************************************************
-REMARKS:
-VxD implementation of the ANSI C fflush function.
-****************************************************************************/
-int fflush(
-    FILE *f)
-{
-    /* Nothing to do since we are not doing buffered file I/O */
-    (void)f;
-    return 0;
-}
-
-/****************************************************************************
-REMARKS:
-VxD implementation of the ANSI C fseek function.
-****************************************************************************/
-int fseek(
-    FILE *f,
-    long int offset,
-    int whence)
-{
-    if (whence == 0)
-       f->offset = offset;
-    else if (whence == 1)
-       f->offset += offset;
-    else if (whence == 2)
-       f->offset = f->filesize + offset;
-    if (!initComplete)
-       i_lseek(f->handle,f->offset,0);
-    return 0;
-}
-
-/****************************************************************************
-REMARKS:
-VxD implementation of the ANSI C ftell function.
-****************************************************************************/
-long ftell(
-    FILE *f)
-{
-    return f->offset;
-}
-
-/****************************************************************************
-REMARKS:
-VxD implementation of the ANSI C feof function.
-****************************************************************************/
-int feof(
-    FILE *f)
-{
-    return (f->offset == f->filesize);
-}
-
-/****************************************************************************
-REMARKS:
-NT driver implementation of the ANSI C fgets function.
-****************************************************************************/
-char *fgets(
-    char *s,
-    int n,
-    FILE *f)
-{
-    int     len;
-    char    *cs;
-
-    /* Read the entire buffer into memory (our functions are unbuffered!) */
-    if ((len = fread(s,1,n,f)) == 0)
-       return NULL;
-
-    /* Search for '\n' or end of string */
-    if (n > len)
-       n = len;
-    cs = s;
-    while (--n > 0) {
-       if (*cs == '\n')
-           break;
-       cs++;
-       }
-    *cs = '\0';
-    return s;
-}
-
-/****************************************************************************
-REMARKS:
-NT driver implementation of the ANSI C fputs function.
-****************************************************************************/
-int fputs(
-    const char *s,
-    FILE *f)
-{
-    return fwrite(s,1,strlen(s),f);
-}
-
-/****************************************************************************
-REMARKS:
-VxD implementation of the ANSI C fclose function.
-****************************************************************************/
-int fclose(
-    FILE *f)
-{
-    WORD error;
-
-    if (initComplete)
-       R0_CloseFile((HANDLE)f->handle,&error);
-    else
-       i_close(f->handle);
-    PM_free(f);
-    return 0;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/vxd/oshdr.h b/board/MAI/bios_emulator/scitech/src/pm/vxd/oshdr.h
deleted file mode 100644 (file)
index 7efc0f9..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  32-bit Windows VxD
-*
-* Description:  Include file to include all OS specific header files.
-*
-****************************************************************************/
diff --git a/board/MAI/bios_emulator/scitech/src/pm/vxd/pm.c b/board/MAI/bios_emulator/scitech/src/pm/vxd/pm.c
deleted file mode 100644 (file)
index 4cb7f19..0000000
+++ /dev/null
@@ -1,1359 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  32-bit Windows VxD
-*
-* Description:  Implementation for the OS Portability Manager Library, which
-*               contains functions to implement OS specific services in a
-*               generic, cross platform API. Porting the OS Portability
-*               Manager library is the first step to porting any SciTech
-*               products to a new platform.
-*
-****************************************************************************/
-
-#include "pmapi.h"
-#include "drvlib/os/os.h"
-#include "sdd/sddhelp.h"
-#include "mtrr.h"
-
-/*--------------------------- Global variables ----------------------------*/
-
-#define MAX_MEMORY_SHARED           100
-#define MAX_MEMORY_MAPPINGS         100
-
-typedef struct {
-    void    *linear;
-    ulong   global;
-    ulong   length;
-    int     npages;
-    } memshared;
-
-typedef struct {
-    ulong   physical;
-    ulong   linear;
-    ulong   length;
-    int     npages;
-    ibool   isCached;
-    } mmapping;
-
-static int          numMappings = 0;
-static memshared    shared[MAX_MEMORY_MAPPINGS] = {0};
-static mmapping     maps[MAX_MEMORY_MAPPINGS];
-extern ibool        _PM_haveBIOS;
-char                _PM_cntPath[PM_MAX_PATH] = "";
-char                _PM_nucleusPath[PM_MAX_PATH] = "";
-uchar               *_PM_rmBufAddr = NULL;
-ushort _VARAPI      _PM_savedDS = 0;
-static uchar        _PM_oldCMOSRegA;
-static uchar        _PM_oldCMOSRegB;
-PM_intHandler       _PM_rtcHandler = NULL;
-IRQHANDLE           RTCIRQHandle = 0;
-VPICD_HWInt_THUNK   RTCInt_Thunk;
-
-static char *szWindowsKey       = "Software\\Microsoft\\Windows\\CurrentVersion";
-static char *szSystemRoot       = "SystemRoot";
-static char *szMachineNameKey   = "System\\CurrentControlSet\\control\\ComputerName\\ComputerName";
-static char *szMachineName      = "ComputerName";
-static void (PMAPIP fatalErrorCleanup)(void) = NULL;
-
-/*----------------------------- Implementation ----------------------------*/
-
-/* Functions to read and write CMOS registers */
-
-ulong   PMAPI _PM_getPDB(void);
-uchar   PMAPI _PM_readCMOS(int index);
-void    PMAPI _PM_writeCMOS(int index,uchar value);
-
-/****************************************************************************
-REMARKS:
-PM_malloc override function for Nucleus drivers loaded in VxD's.
-****************************************************************************/
-void * VXD_malloc(
-    size_t size)
-{
-    return PM_mallocShared(size);
-}
-
-/****************************************************************************
-REMARKS:
-PM_calloc override function for Nucleus drivers loaded in VxD's.
-****************************************************************************/
-void * VXD_calloc(
-    size_t nelem,
-    size_t size)
-{
-    void *p = PM_mallocShared(nelem * size);
-    if (p)
-       memset(p,0,nelem * size);
-    return p;
-}
-
-/****************************************************************************
-REMARKS:
-PM_realloc override function for Nucleus drivers loaded in VxD's.
-****************************************************************************/
-void * VXD_realloc(
-    void *ptr,
-    size_t size)
-{
-    void *p = PM_mallocShared(size);
-    if (p) {
-       memcpy(p,ptr,size);
-       PM_freeShared(ptr);
-       }
-    return p;
-}
-
-/****************************************************************************
-REMARKS:
-PM_free override function for Nucleus drivers loaded in VxD's.
-****************************************************************************/
-void VXD_free(
-    void *p)
-{
-    PM_freeShared(p);
-}
-
-/****************************************************************************
-REMARKS:
-Initialise the PM library.
-****************************************************************************/
-void PMAPI PM_init(void)
-{
-    /* Override the default memory allocators for all Nucleus drivers
-     * loaded in SDDHELP/PMHELP. We do this so that we can ensure all memory
-     * dynamically allocated by Nucleus drivers and internal C runtime
-     * library functions are shared memory blocks that all processes
-     * connecting to SDDHELP can see.
-     */
-    PM_useLocalMalloc(VXD_malloc,VXD_calloc,VXD_realloc,VXD_free);
-
-    /* Initialiase the MTRR module */
-    MTRR_init();
-}
-
-ibool PMAPI PM_haveBIOSAccess(void)
-{ return _PM_haveBIOS; }
-
-long PMAPI PM_getOSType(void)
-{ return _OS_WIN32VXD; }
-
-int PMAPI PM_getModeType(void)
-{ return PM_386; }
-
-void PMAPI PM_backslash(char *s)
-{
-    uint pos = strlen(s);
-    if (s[pos-1] != '\\') {
-       s[pos] = '\\';
-       s[pos+1] = '\0';
-       }
-}
-
-void PMAPI PM_setFatalErrorCleanup(
-    void (PMAPIP cleanup)(void))
-{
-    fatalErrorCleanup = cleanup;
-}
-
-void PMAPI PM_fatalError(const char *msg)
-{
-    if (fatalErrorCleanup)
-       fatalErrorCleanup();
-    Fatal_Error_Handler(msg,0);
-}
-
-/****************************************************************************
-PARAMETERS:
-len     - Place to store the length of the buffer
-rseg    - Place to store the real mode segment of the buffer
-roff    - Place to store the real mode offset of the buffer
-
-REMARKS:
-This function returns the address and length of the global VESA transfer
-buffer that is used for communicating with the VESA BIOS functions from
-Win16 and Win32 programs under Windows.
-****************************************************************************/
-void * PMAPI PM_getVESABuf(
-    uint *len,
-    uint *rseg,
-    uint *roff)
-{
-    /* If the VxD is dynamically loaded we will not have a real mode
-     * transfer buffer to return, so we fail the call.
-     */
-    if (_PM_rmBufAddr) {
-       *len = VESA_BUF_SIZE;
-       *rseg = (ulong)(_PM_rmBufAddr) >> 4;
-       *roff = (ulong)(_PM_rmBufAddr) & 0xF;
-       return _PM_rmBufAddr;
-       }
-    return NULL;
-}
-
-int PMAPI PM_int386(
-    int intno,
-    PMREGS *in,
-    PMREGS *out)
-{
-    /* Unused in VxDs */
-    return 0;
-}
-
-void PMAPI _PM_getRMvect(
-    int intno,
-    long *realisr)
-{
-    WORD    seg;
-    DWORD   off;
-
-    Get_V86_Int_Vector(intno,&seg,&off);
-    *realisr = ((long)seg << 16) | (off & 0xFFFF);
-}
-
-void PMAPI _PM_setRMvect(
-    int intno,
-    long realisr)
-{
-    Set_V86_Int_Vector(intno,realisr >> 16,realisr & 0xFFFF);
-}
-
-char * PMAPI PM_getCurrentPath(
-    char *path,
-    int maxLen)
-{
-    strncpy(path,_PM_cntPath,maxLen);
-    path[maxLen-1] = 0;
-    return path;
-}
-
-char PMAPI PM_getBootDrive(void)
-{ return 'c'; }
-
-const char * PMAPI PM_getVBEAFPath(void)
-{ return "c:\\"; }
-
-/****************************************************************************
-PARAMETERS:
-szKey       - Key to query (can contain version number formatting)
-szValue     - Value to get information for
-value       - Place to store the registry key data read
-size        - Size of the string buffer to read into
-
-RETURNS:
-true if the key was found, false if not.
-****************************************************************************/
-static ibool REG_queryString(
-    char *szKey,
-    char *szValue,
-    char *value,
-    ulong size)
-{
-    HKEY    hKey;
-    ulong   type;
-    ibool   status = false;
-
-    memset(value,0,sizeof(value));
-    if (RegOpenKey(HKEY_LOCAL_MACHINE,szKey,&hKey) == ERROR_SUCCESS) {
-       if (RegQueryValueEx(hKey,(PCHAR)szValue,(ulong*)NULL,(ulong*)&type,value,(ulong*)&size) == ERROR_SUCCESS)
-           status = true;
-       RegCloseKey(hKey);
-       }
-    return status;
-}
-
-const char * PMAPI PM_getNucleusPath(void)
-{
-    static char path[256];
-
-    if (strlen(_PM_nucleusPath) > 0) {
-       strcpy(path,_PM_nucleusPath);
-       PM_backslash(path);
-       return path;
-       }
-    if (!REG_queryString(szWindowsKey,szSystemRoot,path,sizeof(path)))
-       strcpy(path,"c:\\windows");
-    PM_backslash(path);
-    strcat(path,"system\\nucleus");
-    return path;
-}
-
-const char * PMAPI PM_getNucleusConfigPath(void)
-{
-    static char path[256];
-    strcpy(path,PM_getNucleusPath());
-    PM_backslash(path);
-    strcat(path,"config");
-    return path;
-}
-
-const char * PMAPI PM_getUniqueID(void)
-{ return PM_getMachineName(); }
-
-const char * PMAPI PM_getMachineName(void)
-{
-    static char name[256];
-    if (REG_queryString(szMachineNameKey,szMachineName,name,sizeof(name)))
-       return name;
-    return "Unknown";
-}
-
-int PMAPI PM_kbhit(void)
-{ return 1; }
-
-int PMAPI PM_getch(void)
-{ return 0; }
-
-PM_HWND PMAPI PM_openConsole(
-    PM_HWND hwndUser,
-    int device,
-    int xRes,
-    int yRes,
-    int bpp,
-    ibool fullScreen)
-{
-    /* Unused in VxDs */
-    return NULL;
-}
-
-int PMAPI PM_getConsoleStateSize(void)
-{
-    /* Unused in VxDs */
-    return 1;
-}
-
-void PMAPI PM_saveConsoleState(
-    void *stateBuf,
-    PM_HWND hwndConsole)
-{
-    /* Unused in VxDs */
-}
-
-void PMAPI PM_setSuspendAppCallback(
-    int (_ASMAPIP saveState)(
-       int flags))
-{
-    /* Unused in VxDs */
-}
-
-void PMAPI PM_restoreConsoleState(
-    const void *stateBuf,
-    PM_HWND hwndConsole)
-{
-    /* Unused in VxDs */
-}
-
-void PMAPI PM_closeConsole(
-    PM_HWND hwndConsole)
-{
-    /* Unused in VxDs */
-}
-
-void PM_setOSCursorLocation(
-    int x,
-    int y)
-{
-    uchar *_biosPtr = PM_getBIOSPointer();
-    PM_setByte(_biosPtr+0x50,x);
-    PM_setByte(_biosPtr+0x51,y);
-}
-
-void PM_setOSScreenWidth(
-    int width,
-    int height)
-{
-    uchar *_biosPtr = PM_getBIOSPointer();
-    PM_setByte(_biosPtr+0x4A,width);
-    PM_setByte(_biosPtr+0x84,height-1);
-}
-
-/****************************************************************************
-REMARKS:
-Allocate a block of shared memory. For Win9x we allocate shared memory
-as locked, global memory that is accessible from any memory context
-(including interrupt time context), which allows us to load our important
-data structure and code such that we can access it directly from a ring
-0 interrupt context.
-****************************************************************************/
-void * PMAPI PM_mallocShared(
-    long size)
-{
-    MEMHANDLE   hMem;
-    DWORD       pgNum,nPages = (size + 0xFFF) >> 12;
-    int         i;
-
-    /* First find a free slot in our shared memory table */
-    for (i = 0; i < MAX_MEMORY_SHARED; i++) {
-       if (shared[i].linear == 0)
-           break;
-       }
-    if (i < MAX_MEMORY_SHARED) {
-       PageAllocate(nPages,PG_SYS,0,0,0,0,NULL,0,&hMem,&shared[i].linear);
-       shared[i].npages = nPages;
-       pgNum = (ulong)shared[i].linear >> 12;
-       shared[i].global = LinPageLock(pgNum,nPages,PAGEMAPGLOBAL);
-       return (void*)shared[i].global;
-       }
-    return NULL;
-}
-
-/****************************************************************************
-REMARKS:
-Free a block of shared memory
-****************************************************************************/
-void PMAPI PM_freeShared(void *p)
-{
-    int i;
-
-    /* Find a shared memory block in our table and free it */
-    for (i = 0; i < MAX_MEMORY_SHARED; i++) {
-       if (shared[i].global == (ulong)p) {
-           LinPageUnLock(shared[i].global >> 12,shared[i].npages,PAGEMAPGLOBAL);
-           PageFree((ulong)shared[i].linear,0);
-           shared[i].linear = 0;
-           break;
-           }
-       }
-}
-
-/****************************************************************************
-REMARKS:
-Maps a shared memory block into process address space. Does nothing since
-the memory blocks are already globally7 mapped into all processes.
-****************************************************************************/
-void * PMAPI PM_mapToProcess(
-    void *base,
-    ulong limit)
-{
-    return (void*)base;
-}
-
-ibool PMAPI PM_doBIOSPOST(
-    ushort axVal,
-    ulong BIOSPhysAddr,
-    void *mappedBIOS,
-    ulong BIOSLen)
-{
-    /* TODO: Figure out how to do this */
-    return false;
-}
-
-void * PMAPI PM_getBIOSPointer(void)
-{ return (void*)0x400; }
-
-void * PMAPI PM_getA0000Pointer(void)
-{ return PM_mapPhysicalAddr(0xA0000,0xFFFF,true); }
-
-/****************************************************************************
-PARAMETERS:
-base        - Physical base address of the memory to maps in
-limit       - Limit of physical memory to region to maps in
-
-RETURNS:
-Linear address of the newly mapped memory.
-
-REMARKS:
-Maps a physical memory range to a linear memory range.
-****************************************************************************/
-ulong _PM_mapPhysicalToLinear(
-    ulong base,
-    ulong limit,
-    int *npages)
-{
-    ulong   linear,length = limit+1;
-    int     i,ppage,flags;
-
-    if (base < 0x100000) {
-       /* Windows 9x is zero based for the first meg of memory */
-       return base;
-       }
-    ppage = base >> 12;
-    *npages = (length + (base & 0xFFF) + 4095) >> 12;
-    flags = PR_FIXED | PR_STATIC;
-    if (base == 0xA0000) {
-       /* We require the linear address to be aligned to a 64Kb boundary
-        * for mapping the banked framebuffer (so we can do efficient
-        * carry checking for bank changes in the assembler code). The only
-        * way to ensure this is to force the linear address to be aligned
-        * to a 4Mb boundary.
-        */
-       flags |= PR_4MEG;
-       }
-    if ((linear = (ulong)PageReserve(PR_SYSTEM,*npages,flags)) == (ulong)-1)
-       return 0xFFFFFFFF;
-    if (!PageCommitPhys(linear >> 12,*npages,ppage,PC_INCR | PC_USER | PC_WRITEABLE))
-       return 0xFFFFFFFF;
-    return linear + (base & 0xFFF);
-}
-
-/* Page table flags */
-
-#define PAGE_FLAGS_PRESENT                     0x00000001
-#define PAGE_FLAGS_WRITEABLE           0x00000002
-#define PAGE_FLAGS_USER                                0x00000004
-#define PAGE_FLAGS_WRITE_THROUGH       0x00000008
-#define PAGE_FLAGS_CACHE_DISABLE       0x00000010
-#define PAGE_FLAGS_ACCESSED                    0x00000020
-#define PAGE_FLAGS_DIRTY                       0x00000040
-#define PAGE_FLAGS_4MB             0x00000080
-
-/****************************************************************************
-PARAMETERS:
-base        - Physical base address of the memory to maps in
-limit       - Limit of physical memory to region to maps in
-isCached    - True if the memory should be cached, false if not
-
-RETURNS:
-Linear address of the newly mapped memory.
-
-REMARKS:
-This function maps physical memory to linear memory, which can then be used
-to create a selector or used directly from 32-bit protected mode programs.
-This is better than DPMI 0x800, since it allows you to maps physical
-memory below 1Mb, which gets this memory out of the way of the Windows VDD's
-sticky paws.
-
-NOTE:   If the memory is not expected to be cached, this function will
-       directly re-program the PCD (Page Cache Disable) bit in the
-       page tables. There does not appear to be a mechanism in the VMM
-       to control this bit via the regular interface.
-****************************************************************************/
-void * PMAPI PM_mapPhysicalAddr(
-    ulong base,
-    ulong limit,
-    ibool isCached)
-{
-    ulong   linear,length = limit+1;
-    int     i,npages;
-    ulong   PDB,*pPDB;
-
-    /* Search table of existing mappings to see if we have already mapped
-     * a region of memory that will serve this purpose.
-     */
-    for (i = 0; i < numMappings; i++) {
-       if (maps[i].physical == base && maps[i].length == length && maps[i].isCached == isCached)
-           return (void*)maps[i].linear;
-       }
-    if (numMappings == MAX_MEMORY_MAPPINGS)
-       return NULL;
-
-    /* We did not find any previously mapped memory region, so maps it in.
-     * Note that we do not use MapPhysToLinear, since this function appears
-     * to have problems mapping memory in the 1Mb physical address space.
-     * Hence we use PageReserve and PageCommitPhys.
-     */
-    if ((linear = _PM_mapPhysicalToLinear(base,limit,&npages)) == 0xFFFFFFFF)
-       return NULL;
-    maps[numMappings].physical = base;
-    maps[numMappings].length = length;
-    maps[numMappings].linear = linear;
-    maps[numMappings].npages = npages;
-    maps[numMappings].isCached = isCached;
-    numMappings++;
-
-    /* Finally disable caching where necessary */
-    if (!isCached && (PDB = _PM_getPDB()) != 0) {
-       int     startPDB,endPDB,iPDB,startPage,endPage,start,end,iPage;
-       ulong   pageTable,*pPageTable;
-       pPDB = (ulong*)_PM_mapPhysicalToLinear(PDB,0xFFF,&npages);
-       if (pPDB) {
-           startPDB = (linear >> 22) & 0x3FF;
-           startPage = (linear >> 12) & 0x3FF;
-           endPDB = ((linear+limit) >> 22) & 0x3FF;
-           endPage = ((linear+limit) >> 12) & 0x3FF;
-           for (iPDB = startPDB; iPDB <= endPDB; iPDB++) {
-               /* Set the bits in the page directory entry - required as per */
-               /* Pentium 4 manual. This also takes care of the 4MB page entries */
-               pPDB[iPDB] = pPDB[iPDB] |= (PAGE_FLAGS_WRITE_THROUGH | PAGE_FLAGS_CACHE_DISABLE);
-               if (!(pPDB[iPDB] & PAGE_FLAGS_4MB)) {
-                   /* If we are dealing with 4KB pages then we need to iterate */
-                   /* through each of the page table entries */
-                   pageTable = pPDB[iPDB] & ~0xFFF;
-                   pPageTable = (ulong*)_PM_mapPhysicalToLinear(pageTable,0xFFF,&npages);
-                   start = (iPDB == startPDB) ? startPage : 0;
-                   end = (iPDB == endPDB) ? endPage : 0x3FF;
-                   for (iPage = start; iPage <= end; iPage++)
-                       pPageTable[iPage] |= (PAGE_FLAGS_WRITE_THROUGH | PAGE_FLAGS_CACHE_DISABLE);
-                   PageFree((ulong)pPageTable,PR_STATIC);
-                   }
-               }
-           PageFree((ulong)pPDB,PR_STATIC);
-           PM_flushTLB();
-           }
-       }
-    return (void*)linear;
-}
-
-void PMAPI PM_freePhysicalAddr(
-    void *ptr,
-    ulong limit)
-{
-    /* We never free the mappings */
-}
-
-void PMAPI PM_sleep(ulong milliseconds)
-{
-    /* We never sleep in a VxD */
-}
-
-int PMAPI PM_getCOMPort(int port)
-{
-    /* TODO: Re-code this to determine real values using the Plug and Play */
-    /*       manager for the OS. */
-    switch (port) {
-       case 0: return 0x3F8;
-       case 1: return 0x2F8;
-       case 2: return 0x3E8;
-       case 3: return 0x2E8;
-       }
-    return 0;
-}
-
-int PMAPI PM_getLPTPort(int port)
-{
-    /* TODO: Re-code this to determine real values using the Plug and Play */
-    /*       manager for the OS. */
-    switch (port) {
-       case 0: return 0x3BC;
-       case 1: return 0x378;
-       case 2: return 0x278;
-       }
-    return 0;
-}
-
-ulong PMAPI PM_getPhysicalAddr(
-    void *p)
-{
-    DWORD   pte;
-
-    /* Touch the memory before calling CopyPageTable. For some reason */
-    /* we need to do this on Windows 9x, otherwise the memory may not */
-    /* be paged in correctly. Of course if the passed in pointer is */
-    /* invalid, this function will fault, but we shouldn't be passed bogus */
-    /* pointers anyway ;-) */
-    pte = *((ulong*)p);
-
-    /* Return assembled address value only if VMM service succeeds */
-    if (CopyPageTable(((DWORD)p) >> 12, 1, (PVOID*)&pte, 0))
-       return (pte & ~0xFFF) | (((DWORD)p) & 0xFFF);
-
-    /* Return failure to the caller! */
-    return 0xFFFFFFFFUL;
-}
-
-ibool PMAPI PM_getPhysicalAddrRange(
-    void *p,
-    ulong length,
-    ulong *physAddress)
-{
-    int     i;
-    ulong   linear = (ulong)p & ~0xFFF;
-
-    for (i = (length + 0xFFF) >> 12; i > 0; i--) {
-       if ((*physAddress++ = PM_getPhysicalAddr((void*)linear)) == 0xFFFFFFFF)
-           return false;
-       linear += 4096;
-       }
-    return true;
-}
-
-void PMAPI _PM_freeMemoryMappings(void)
-{
-    int i;
-    for (i = 0; i < numMappings; i++)
-       PageFree(maps[i].linear,PR_STATIC);
-}
-
-void * PMAPI PM_mapRealPointer(
-    uint r_seg,
-    uint r_off)
-{
-    return (void*)MK_PHYS(r_seg,r_off);
-}
-
-void * PMAPI PM_allocRealSeg(
-    uint size,
-    uint *r_seg,
-    uint *r_off)
-{
-    return NULL;
-}
-
-void PMAPI PM_freeRealSeg(
-    void *mem)
-{
-}
-
-void PMAPI DPMI_int86(
-    int intno,
-    DPMI_regs *regs)
-{
-    /* Unsed in VxD's */
-}
-
-/****************************************************************************
-REMARKS:
-Load the V86 registers in the client state, and save the original state
-before loading the registers.
-****************************************************************************/
-static void LoadV86Registers(
-    CLIENT_STRUCT *saveRegs,
-    RMREGS *in,
-    RMSREGS *sregs)
-{
-    CLIENT_STRUCT   newRegs;
-
-    Save_Client_State(saveRegs);
-    newRegs = *saveRegs;
-    newRegs.CRS.Client_EAX = in->e.eax;
-    newRegs.CRS.Client_EBX = in->e.ebx;
-    newRegs.CRS.Client_ECX = in->e.ecx;
-    newRegs.CRS.Client_EDX = in->e.edx;
-    newRegs.CRS.Client_ESI = in->e.esi;
-    newRegs.CRS.Client_EDI = in->e.edi;
-    newRegs.CRS.Client_ES = sregs->es;
-    newRegs.CRS.Client_DS = sregs->ds;
-    Restore_Client_State(&newRegs);
-}
-
-/****************************************************************************
-REMARKS:
-Read the V86 registers from the client state and restore the original state.
-****************************************************************************/
-static void ReadV86Registers(
-    CLIENT_STRUCT *saveRegs,
-    RMREGS *out,
-    RMSREGS *sregs)
-{
-    CLIENT_STRUCT   newRegs;
-
-    Save_Client_State(&newRegs);
-    out->e.eax = newRegs.CRS.Client_EAX;
-    out->e.ebx = newRegs.CRS.Client_EBX;
-    out->e.ecx = newRegs.CRS.Client_ECX;
-    out->e.edx = newRegs.CRS.Client_EDX;
-    out->e.esi = newRegs.CRS.Client_ESI;
-    out->e.edi = newRegs.CRS.Client_EDI;
-    sregs->es = newRegs.CRS.Client_ES;
-    sregs->ds = newRegs.CRS.Client_DS;
-    Restore_Client_State(saveRegs);
-}
-
-/****************************************************************************
-REMARKS:
-Call a V86 real mode function with the specified register values
-loaded before the call. The call returns with a far ret.
-****************************************************************************/
-void PMAPI PM_callRealMode(
-    uint seg,
-    uint off,
-    RMREGS *regs,
-    RMSREGS *sregs)
-{
-    CLIENT_STRUCT saveRegs;
-
-    /* Bail if we do not have BIOS access (ie: the VxD was dynamically
-     * loaded, and not statically loaded.
-     */
-    if (!_PM_haveBIOS)
-       return;
-
-    _TRACE("SDDHELP: Entering PM_callRealMode()\n");
-    Begin_Nest_V86_Exec();
-    LoadV86Registers(&saveRegs,regs,sregs);
-    Simulate_Far_Call(seg, off);
-    Resume_Exec();
-    ReadV86Registers(&saveRegs,regs,sregs);
-    End_Nest_Exec();
-    _TRACE("SDDHELP: Exiting PM_callRealMode()\n");
-}
-
-/****************************************************************************
-REMARKS:
-Issue a V86 real mode interrupt with the specified register values
-loaded before the interrupt.
-****************************************************************************/
-int PMAPI PM_int86(
-    int intno,
-    RMREGS *in,
-    RMREGS *out)
-{
-    RMSREGS         sregs = {0};
-    CLIENT_STRUCT   saveRegs;
-    ushort          oldDisable;
-
-    /* Bail if we do not have BIOS access (ie: the VxD was dynamically
-     * loaded, and not statically loaded.
-     */
-    if (!_PM_haveBIOS) {
-       *out = *in;
-       return out->x.ax;
-       }
-
-    /* Disable pass-up to our VxD handler so we directly call BIOS */
-    _TRACE("SDDHELP: Entering PM_int86()\n");
-    if (disableTSRFlag) {
-       oldDisable = *disableTSRFlag;
-       *disableTSRFlag = 0;
-       }
-    Begin_Nest_V86_Exec();
-    LoadV86Registers(&saveRegs,in,&sregs);
-    Exec_Int(intno);
-    ReadV86Registers(&saveRegs,out,&sregs);
-    End_Nest_Exec();
-
-    /* Re-enable pass-up to our VxD handler if previously enabled */
-    if (disableTSRFlag)
-       *disableTSRFlag = oldDisable;
-
-    _TRACE("SDDHELP: Exiting PM_int86()\n");
-    return out->x.ax;
-}
-
-/****************************************************************************
-REMARKS:
-Issue a V86 real mode interrupt with the specified register values
-loaded before the interrupt.
-****************************************************************************/
-int PMAPI PM_int86x(
-    int intno,
-    RMREGS *in,
-    RMREGS *out,
-    RMSREGS *sregs)
-{
-    CLIENT_STRUCT   saveRegs;
-    ushort          oldDisable;
-
-    /* Bail if we do not have BIOS access (ie: the VxD was dynamically
-     * loaded, and not statically loaded.
-     */
-    if (!_PM_haveBIOS) {
-       *out = *in;
-       return out->x.ax;
-       }
-
-    /* Disable pass-up to our VxD handler so we directly call BIOS */
-    _TRACE("SDDHELP: Entering PM_int86x()\n");
-    if (disableTSRFlag) {
-       oldDisable = *disableTSRFlag;
-       *disableTSRFlag = 0;
-       }
-    Begin_Nest_V86_Exec();
-    LoadV86Registers(&saveRegs,in,sregs);
-    Exec_Int(intno);
-    ReadV86Registers(&saveRegs,out,sregs);
-    End_Nest_Exec();
-
-    /* Re-enable pass-up to our VxD handler if previously enabled */
-    if (disableTSRFlag)
-       *disableTSRFlag = oldDisable;
-
-    _TRACE("SDDHELP: Exiting PM_int86x()\n");
-    return out->x.ax;
-}
-
-/****************************************************************************
-REMARKS:
-Returns available memory. Not possible under Windows.
-****************************************************************************/
-void PMAPI PM_availableMemory(
-    ulong *physical,
-    ulong *total)
-{
-    *physical = *total = 0;
-}
-
-/****************************************************************************
-REMARKS:
-Allocates a block of locked physical memory.
-****************************************************************************/
-void * PMAPI PM_allocLockedMem(
-    uint size,
-    ulong *physAddr,
-    ibool contiguous,
-    ibool below16M)
-{
-    MEMHANDLE   hMem;
-    DWORD       nPages = (size + 0xFFF) >> 12;
-    DWORD       flags = PAGEFIXED | PAGEUSEALIGN | (contiguous ? PAGECONTIG : 0);
-    DWORD       maxPhys = below16M ? 0x00FFFFFF : 0xFFFFFFFF;
-    void        *p;
-
-    /* TODO: This may need to be modified if the memory needs to be globally */
-    /*       accessible. Check how we implemented PM_mallocShared() as we */
-    /*       may need to do something similar in here. */
-    PageAllocate(nPages,PG_SYS,0,0,0,maxPhys,physAddr,flags,&hMem,&p);
-
-    /* TODO: We may need to modify the memory blocks to disable caching via */
-    /*       the page tables (PCD|PWT) since DMA memory blocks *cannot* be */
-    /*       cached! */
-    return p;
-}
-
-/****************************************************************************
-REMARKS:
-Frees a block of locked physical memory.
-****************************************************************************/
-void PMAPI PM_freeLockedMem(
-    void *p,
-    uint size,
-    ibool contiguous)
-{
-    if (p)
-       PageFree((ulong)p,0);
-}
-
-/****************************************************************************
-REMARKS:
-Allocates a page aligned and page sized block of memory
-****************************************************************************/
-void * PMAPI PM_allocPage(
-    ibool locked)
-{
-    MEMHANDLE   hMem;
-    void        *p;
-
-    /* TODO: This will need to be modified if the memory needs to be globally */
-    /*       accessible. Check how we implemented PM_mallocShared() as we */
-    /*       may need to do something similar in here. */
-    PageAllocate(1,PG_SYS,0,0,0,0,0,PAGEFIXED,&hMem,&p);
-    return p;
-}
-
-/****************************************************************************
-REMARKS:
-Free a page aligned and page sized block of memory
-****************************************************************************/
-void PMAPI PM_freePage(
-    void *p)
-{
-    if (p)
-       PageFree((ulong)p,0);
-}
-
-/****************************************************************************
-REMARKS:
-Lock linear memory so it won't be paged.
-****************************************************************************/
-int PMAPI PM_lockDataPages(
-    void *p,
-    uint len,
-    PM_lockHandle *lh)
-{
-    DWORD pgNum = (ulong)p >> 12;
-    DWORD nPages = (len + (ulong)p - (pgNum << 12) + 0xFFF) >> 12;
-    return LinPageLock(pgNum,nPages,0);
-}
-
-/****************************************************************************
-REMARKS:
-Unlock linear memory so it won't be paged.
-****************************************************************************/
-int PMAPI PM_unlockDataPages(
-    void *p,
-    uint len,
-    PM_lockHandle *lh)
-{
-    DWORD pgNum = (ulong)p >> 12;
-    DWORD nPages = (len + (ulong)p - (pgNum << 12) + 0xFFF) >> 12;
-    return LinPageUnLock(pgNum,nPages,0);
-}
-
-/****************************************************************************
-REMARKS:
-Lock linear memory so it won't be paged.
-****************************************************************************/
-int PMAPI PM_lockCodePages(
-    void (*p)(),
-    uint len,
-    PM_lockHandle *lh)
-{
-    return PM_lockDataPages((void*)p,len,lh);
-}
-
-/****************************************************************************
-REMARKS:
-Unlock linear memory so it won't be paged.
-****************************************************************************/
-int PMAPI PM_unlockCodePages(
-    void (*p)(),
-    uint len,
-    PM_lockHandle *lh)
-{
-    return PM_unlockDataPages((void*)p,len,lh);
-}
-
-/****************************************************************************
-REMARKS:
-Set the real time clock frequency (for stereo modes).
-****************************************************************************/
-void PMAPI PM_setRealTimeClockFrequency(
-    int frequency)
-{
-    static short convert[] = {
-       8192,
-       4096,
-       2048,
-       1024,
-       512,
-       256,
-       128,
-       64,
-       32,
-       16,
-       8,
-       4,
-       2,
-       -1,
-       };
-    int i;
-
-    /* First clear any pending RTC timeout if not cleared */
-    _PM_readCMOS(0x0C);
-    if (frequency == 0) {
-       /* Disable RTC timout */
-       _PM_writeCMOS(0x0A,_PM_oldCMOSRegA);
-       _PM_writeCMOS(0x0B,_PM_oldCMOSRegB & 0x0F);
-       }
-    else {
-       /* Convert frequency value to RTC clock indexes */
-       for (i = 0; convert[i] != -1; i++) {
-           if (convert[i] == frequency)
-               break;
-           }
-
-       /* Set RTC timout value and enable timeout */
-       _PM_writeCMOS(0x0A,0x20 | (i+3));
-       _PM_writeCMOS(0x0B,(_PM_oldCMOSRegB & 0x0F) | 0x40);
-       }
-}
-
-/****************************************************************************
-REMARKS:
-Real time clock interrupt handler, which calls the user registered C code.
-****************************************************************************/
-static BOOL __stdcall RTCInt_Handler(
-    VMHANDLE hVM,
-    IRQHANDLE hIRQ)
-{
-    static char inside = 0;
-
-    /* Clear priority interrupt controller and re-enable interrupts so we
-     * dont lock things up for long.
-     */
-    VPICD_Phys_EOI(hIRQ);
-
-    /* Clear real-time clock timeout */
-    _PM_readCMOS(0x0C);
-
-    /* Now call the C based interrupt handler (but check for mutual
-     * exclusion since we may still be servicing an old interrupt when a
-     * new one comes along; if that happens we ignore the old one).
-     */
-    if (!inside) {
-       inside = 1;
-       enable();
-       _PM_rtcHandler();
-       inside = 0;
-       }
-    return TRUE;
-}
-
-/****************************************************************************
-REMARKS:
-Set the real time clock handler (used for software stereo modes).
-****************************************************************************/
-ibool PMAPI PM_setRealTimeClockHandler(
-    PM_intHandler ih,
-    int frequency)
-{
-    struct VPICD_IRQ_Descriptor IRQdesc;
-
-    /* Save the old CMOS real time clock values */
-    _PM_oldCMOSRegA = _PM_readCMOS(0x0A);
-    _PM_oldCMOSRegB = _PM_readCMOS(0x0B);
-
-    /* Set the real time clock interrupt handler */
-    CHECK(ih != NULL);
-    _PM_rtcHandler = ih;
-    IRQdesc.VID_IRQ_Number      = 0x8;
-    IRQdesc.VID_Options         = 0;
-    IRQdesc.VID_Hw_Int_Proc     = (DWORD)VPICD_Thunk_HWInt(RTCInt_Handler, &RTCInt_Thunk);
-    IRQdesc.VID_EOI_Proc        = 0;
-    IRQdesc.VID_Virt_Int_Proc   = 0;
-    IRQdesc.VID_Mask_Change_Proc= 0;
-    IRQdesc.VID_IRET_Proc       = 0;
-    IRQdesc.VID_IRET_Time_Out   = 500;
-    if ((RTCIRQHandle = VPICD_Virtualize_IRQ(&IRQdesc)) == 0)
-       return false;
-
-    /* Program the real time clock default frequency */
-    PM_setRealTimeClockFrequency(frequency);
-
-    /* Unmask IRQ8 in the PIC */
-    VPICD_Physically_Unmask(RTCIRQHandle);
-    return true;
-}
-
-/****************************************************************************
-REMARKS:
-Restore the original real time clock handler.
-****************************************************************************/
-void PMAPI PM_restoreRealTimeClockHandler(void)
-{
-    if (RTCIRQHandle) {
-       /* Restore CMOS registers and mask RTC clock */
-       _PM_writeCMOS(0x0A,_PM_oldCMOSRegA);
-       _PM_writeCMOS(0x0B,_PM_oldCMOSRegB);
-
-       /* Restore the interrupt vector */
-       VPICD_Set_Auto_Masking(RTCIRQHandle);
-       VPICD_Force_Default_Behavior(RTCIRQHandle);
-       RTCIRQHandle = 0;
-       }
-}
-
-/****************************************************************************
-REMARKS:
-OS specific shared libraries not supported inside a VxD
-****************************************************************************/
-PM_MODULE PMAPI PM_loadLibrary(
-    const char *szDLLName)
-{
-    (void)szDLLName;
-    return NULL;
-}
-
-/****************************************************************************
-REMARKS:
-OS specific shared libraries not supported inside a VxD
-****************************************************************************/
-void * PMAPI PM_getProcAddress(
-    PM_MODULE hModule,
-    const char *szProcName)
-{
-    (void)hModule;
-    (void)szProcName;
-    return NULL;
-}
-
-/****************************************************************************
-REMARKS:
-OS specific shared libraries not supported inside a VxD
-****************************************************************************/
-void PMAPI PM_freeLibrary(
-    PM_MODULE hModule)
-{
-    (void)hModule;
-}
-
-/****************************************************************************
-REMARKS:
-Function to find the first file matching a search criteria in a directory.
-****************************************************************************/
-void *PMAPI PM_findFirstFile(
-    const char *filename,
-    PM_findData *findData)
-{
-    /* TODO: This function should start a directory enumeration search */
-    /*       given the filename (with wildcards). The data should be */
-    /*       converted and returned in the findData standard form. */
-    (void)filename;
-    (void)findData;
-    return PM_FILE_INVALID;
-}
-
-/****************************************************************************
-REMARKS:
-Function to find the next file matching a search criteria in a directory.
-****************************************************************************/
-ibool PMAPI PM_findNextFile(
-    void *handle,
-    PM_findData *findData)
-{
-    /* TODO: This function should find the next file in directory enumeration */
-    /*       search given the search criteria defined in the call to */
-    /*       PM_findFirstFile. The data should be converted and returned */
-    /*       in the findData standard form. */
-    (void)handle;
-    (void)findData;
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-Function to close the find process
-****************************************************************************/
-void PMAPI PM_findClose(
-    void *handle)
-{
-    /* TODO: This function should close the find process. This may do */
-    /*       nothing for some OS'es. */
-    (void)handle;
-}
-
-/****************************************************************************
-REMARKS:
-Function to determine if a drive is a valid drive or not. Under Unix this
-function will return false for anything except a value of 3 (considered
-the root drive, and equivalent to C: for non-Unix systems). The drive
-numbering is:
-
-    1   - Drive A:
-    2   - Drive B:
-    3   - Drive C:
-    etc
-
-****************************************************************************/
-ibool PMAPI PM_driveValid(
-    char drive)
-{
-    /* Not supported in a VxD */
-    (void)drive;
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-Function to get the current working directory for the specififed drive.
-Under Unix this will always return the current working directory regardless
-of what the value of 'drive' is.
-****************************************************************************/
-void PMAPI PM_getdcwd(
-    int drive,
-    char *dir,
-    int len)
-{
-    /* Not supported in a VxD */
-    (void)drive;
-    (void)dir;
-    (void)len;
-}
-
-/****************************************************************************
-PARAMETERS:
-base    - The starting physical base address of the region
-size    - The size in bytes of the region
-type    - Type to place into the MTRR register
-
-RETURNS:
-Error code describing the result.
-
-REMARKS:
-Function to enable write combining for the specified region of memory.
-****************************************************************************/
-int PMAPI PM_enableWriteCombine(
-    ulong base,
-    ulong size,
-    uint type)
-{
-    return MTRR_enableWriteCombine(base,size,type);
-}
-
-/****************************************************************************
-REMARKS:
-Function to change the file attributes for a specific file.
-****************************************************************************/
-void PMAPI PM_setFileAttr(
-    const char *filename,
-    uint attrib)
-{
-    /* TODO: Implement this */
-    (void)filename;
-    (void)attrib;
-    PM_fatalError("PM_setFileAttr not implemented yet!");
-}
-
-/****************************************************************************
-REMARKS:
-Function to get the file attributes for a specific file.
-****************************************************************************/
-uint PMAPI PM_getFileAttr(
-    const char *filename)
-{
-    /* TODO: Implement this */
-    (void)filename;
-    PM_fatalError("PM_getFileAttr not implemented yet!");
-    return 0;
-}
-
-/****************************************************************************
-REMARKS:
-Function to create a directory.
-****************************************************************************/
-ibool PMAPI PM_mkdir(
-    const char *filename)
-{
-    /* TODO: Implement this */
-    (void)filename;
-    PM_fatalError("PM_mkdir not implemented yet!");
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-Function to remove a directory.
-****************************************************************************/
-ibool PMAPI PM_rmdir(
-    const char *filename)
-{
-    /* TODO: Implement this */
-    (void)filename;
-    PM_fatalError("PM_rmdir not implemented yet!");
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-Function to get the file time and date for a specific file.
-****************************************************************************/
-ibool PMAPI PM_getFileTime(
-    const char *filename,
-    ibool gmTime,
-    PM_time *time)
-{
-    /* TODO: Implement this! */
-    (void)filename;
-    (void)gmTime;
-    (void)time;
-    PM_fatalError("PM_getFileTime not implemented yet!");
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-Function to set the file time and date for a specific file.
-****************************************************************************/
-ibool PMAPI PM_setFileTime(
-    const char *filename,
-    ibool gmTime,
-    PM_time *time)
-{
-    /* TODO: Implement this! */
-    (void)filename;
-    (void)gmTime;
-    (void)time;
-    PM_fatalError("PM_setFileTime not implemented yet!");
-    return false;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/vxd/vflat.c b/board/MAI/bios_emulator/scitech/src/pm/vxd/vflat.c
deleted file mode 100644 (file)
index 901ce1c..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Any
-*
-* Description:  Dummy module; no virtual framebuffer for this OS
-*
-****************************************************************************/
-
-#include "pmapi.h"
-
-ibool PMAPI VF_available(void)
-{
-    return false;
-}
-
-void * PMAPI VF_init(ulong baseAddr,int bankSize,int codeLen,void *bankFunc)
-{
-    return NULL;
-}
-
-void PMAPI VF_exit(void)
-{
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/vxd/ztimer.c b/board/MAI/bios_emulator/scitech/src/pm/vxd/ztimer.c
deleted file mode 100644 (file)
index 76df48c..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-/****************************************************************************
-*
-*                         Ultra Long Period Timer
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  32-bit Windows VxD
-*
-* Description:  OS specific implementation for the Zen Timer functions.
-*
-****************************************************************************/
-
-/*---------------------------- Global variables ---------------------------*/
-
-static ulong    frequency = 1193180;
-
-/*----------------------------- Implementation ----------------------------*/
-
-/****************************************************************************
-REMARKS:
-Initialise the Zen Timer module internals.
-****************************************************************************/
-#define __ZTimerInit()
-
-/****************************************************************************
-REMARKS:
-Call the assembler Zen Timer functions to do the timing.
-****************************************************************************/
-#define __LZTimerOn(tm)     VTD_Get_Real_Time(&tm->start.high,&tm->start.low)
-
-/****************************************************************************
-REMARKS:
-Call the assembler Zen Timer functions to do the timing.
-****************************************************************************/
-static ulong __LZTimerLap(
-    LZTimerObject *tm)
-{
-    CPU_largeInteger    lap,count;
-    VTD_Get_Real_Time(&lap.high,&lap.low);
-    _CPU_diffTime64(&tm->start,&lap,&count);
-    return _CPU_calcMicroSec(&count,frequency);
-}
-
-/****************************************************************************
-REMARKS:
-Call the assembler Zen Timer functions to do the timing.
-****************************************************************************/
-#define __LZTimerOff(tm)    VTD_Get_Real_Time(&tm->end.high,&tm->end.low)
-
-/****************************************************************************
-REMARKS:
-Call the assembler Zen Timer functions to do the timing.
-****************************************************************************/
-static ulong __LZTimerCount(
-    LZTimerObject *tm)
-{
-    CPU_largeInteger tmCount;
-    _CPU_diffTime64(&tm->start,&tm->end,&tmCount);
-    return _CPU_calcMicroSec(&tmCount,frequency);
-}
-
-/****************************************************************************
-REMARKS:
-Define the resolution of the long period timer as microseconds per timer tick.
-****************************************************************************/
-#define ULZTIMER_RESOLUTION     1000
-
-/****************************************************************************
-REMARKS:
-Read the Long Period timer value from the BIOS timer tick.
-****************************************************************************/
-static ulong __ULZReadTime(void)
-{
-    CPU_largeInteger count;
-    VTD_Get_Real_Time(&count.high,&count.low);
-    return (count.low * 1000.0 / frequency);
-}
-
-/****************************************************************************
-REMARKS:
-Compute the elapsed time from the BIOS timer tick. Note that we check to see
-whether a midnight boundary has passed, and if so adjust the finish time to
-account for this. We cannot detect if more that one midnight boundary has
-passed, so if this happens we will be generating erronous results.
-****************************************************************************/
-ulong __ULZElapsedTime(ulong start,ulong finish)
-{ return finish - start; }
diff --git a/board/MAI/bios_emulator/scitech/src/pm/win32/_pmwin32.asm b/board/MAI/bios_emulator/scitech/src/pm/win32/_pmwin32.asm
deleted file mode 100644 (file)
index 7c242b5..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-;****************************************************************************
-;*
-;*                  SciTech OS Portability Manager Library
-;*
-;*  ========================================================================
-;*
-;*    The contents of this file are subject to the SciTech MGL Public
-;*    License Version 1.0 (the "License"); you may not use this file
-;*    except in compliance with the License. You may obtain a copy of
-;*    the License at http://www.scitechsoft.com/mgl-license.txt
-;*
-;*    Software distributed under the License is distributed on an
-;*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-;*    implied. See the License for the specific language governing
-;*    rights and limitations under the License.
-;*
-;*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-;*
-;*    The Initial Developer of the Original Code is SciTech Software, Inc.
-;*    All Rights Reserved.
-;*
-;*  ========================================================================
-;*
-;* Language:    80386 Assembler, TASM 4.0 or NASM
-;* Environment: Win32
-;*
-;* Description: Low level assembly support for the PM library specific
-;*              to Windows.
-;*
-;****************************************************************************
-
-        IDEAL
-
-include "scitech.mac"               ; Memory model macros
-
-header      _pmwin32                    ; Set up memory model
-
-begdataseg  _pmwin32
-
-        cglobal _PM_ioentry
-        cglobal _PM_gdt
-_PM_ioentry     dd  0               ; Offset to call gate
-_PM_gdt         dw  0               ; Selector to call gate
-
-enddataseg  _pmwin32
-
-begcodeseg  _pmwin32                    ; Start of code segment
-
-;----------------------------------------------------------------------------
-; int PM_setIOPL(int iopl)
-;----------------------------------------------------------------------------
-; Change the IOPL level for the 32-bit task. Returns the previous level
-; so it can be restored for the task correctly.
-;----------------------------------------------------------------------------
-cprocstart  _PM_setIOPLViaCallGate
-
-        ARG     iopl:UINT
-
-        enter_c
-        pushfd                      ; Save the old EFLAGS for later
-        mov     ecx,[iopl]          ; ECX := IOPL level
-        xor     ebx,ebx             ; Change IOPL level function code
-ifdef   USE_NASM
-        call far dword [_PM_ioentry]
-else
-        call    [FWORD _PM_ioentry]
-endif
-        pop     eax
-        and     eax,0011000000000000b
-        shr     eax,12
-        leave_c
-        ret
-
-cprocend
-
-endcodeseg  _pmwin32
-
-        END                         ; End of module
diff --git a/board/MAI/bios_emulator/scitech/src/pm/win32/cpuinfo.c b/board/MAI/bios_emulator/scitech/src/pm/win32/cpuinfo.c
deleted file mode 100644 (file)
index 7da9752..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-/****************************************************************************
-*
-*                         Ultra Long Period Timer
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Win32
-*
-* Description:  Module to implement OS specific services to measure the
-*               CPU frequency.
-*
-****************************************************************************/
-
-/*---------------------------- Global variables ---------------------------*/
-
-static ibool havePerformanceCounter;
-
-/*----------------------------- Implementation ----------------------------*/
-
-/****************************************************************************
-REMARKS:
-Increase the thread priority to maximum, if possible.
-****************************************************************************/
-static int SetMaxThreadPriority(void)
-{
-    int     oldPriority;
-    HANDLE  hThread = GetCurrentThread();
-
-    oldPriority = GetThreadPriority(hThread);
-    if (oldPriority != THREAD_PRIORITY_ERROR_RETURN)
-       SetThreadPriority(hThread, THREAD_PRIORITY_TIME_CRITICAL);
-    return oldPriority;
-}
-
-/****************************************************************************
-REMARKS:
-Restore the original thread priority.
-****************************************************************************/
-static void RestoreThreadPriority(
-    int oldPriority)
-{
-    HANDLE  hThread = GetCurrentThread();
-
-    if (oldPriority != THREAD_PRIORITY_ERROR_RETURN)
-       SetThreadPriority(hThread, oldPriority);
-}
-
-/****************************************************************************
-REMARKS:
-Initialise the counter and return the frequency of the counter.
-****************************************************************************/
-static void GetCounterFrequency(
-    CPU_largeInteger *freq)
-{
-    if (!QueryPerformanceFrequency((LARGE_INTEGER*)freq)) {
-       havePerformanceCounter = false;
-       freq->low = 100000;
-       freq->high = 0;
-       }
-    else
-       havePerformanceCounter = true;
-}
-
-/****************************************************************************
-REMARKS:
-Read the counter and return the counter value.
-****************************************************************************/
-#define GetCounter(t)                                       \
-{                                                           \
-    if (havePerformanceCounter)                             \
-       QueryPerformanceCounter((LARGE_INTEGER*)t);         \
-    else {                                                  \
-       (t)->low = timeGetTime() * 100;                     \
-       (t)->high = 0;                                      \
-       }                                                   \
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/win32/ddraw.c b/board/MAI/bios_emulator/scitech/src/pm/win32/ddraw.c
deleted file mode 100644 (file)
index d6c3f60..0000000
+++ /dev/null
@@ -1,582 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech Multi-platform Graphics Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Win32
-*
-* Description:  Win32 implementation for the SciTech cross platform
-*               event library.
-*
-****************************************************************************/
-
-#include "event.h"
-#include "pmapi.h"
-#include "win32/oshdr.h"
-#include "nucleus/graphics.h"
-
-/*---------------------------- Global Variables ---------------------------*/
-
-/* Publicly accessible variables */
-
-int                 _PM_deskX,_PM_deskY;/* Desktop dimentions           */
-HWND                _PM_hwndConsole;    /* Window handle for console    */
-#ifdef  __INTEL__
-uint                _PM_cw_default;     /* Default FPU control word     */
-#endif
-
-/* Private internal variables */
-
-static HINSTANCE    hInstApp = NULL;/* Application instance handle      */
-static HWND         hwndUser = NULL;/* User window handle               */
-static HINSTANCE    hInstDD = NULL; /* Handle to DirectDraw DLL         */
-static LPDIRECTDRAW lpDD = NULL;    /* DirectDraw object                */
-static LONG         oldWndStyle;    /* Info about old user window       */
-static LONG         oldExWndStyle;  /* Info about old user window       */
-static int          oldWinPosX;     /* Old window position X coordinate */
-static int          oldWinPosY;     /* Old window pisition Y coordinate */
-static int          oldWinSizeX;    /* Old window size X                */
-static int          oldWinSizeY;    /* Old window size Y                */
-static WNDPROC      oldWinProc = NULL;
-static PM_saveState_cb suspendApp = NULL;
-static ibool        waitActive = false;
-static ibool        isFullScreen = false;
-static ibool        backInGDI = false;
-
-/* Internal strings */
-
-static char *szWinClassName     = "SciTechDirectDrawWindow";
-static char *szAutoPlayKey      = "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer";
-static char *szAutoPlayValue    = "NoDriveTypeAutoRun";
-
-/* Dynalinks to DirectDraw functions */
-
-static HRESULT (WINAPI *pDirectDrawCreate)(GUID FAR *lpGUID, LPDIRECTDRAW FAR *lplpDD, IUnknown FAR *pUnkOuter);
-
-/*---------------------------- Implementation -----------------------------*/
-
-/****************************************************************************
-REMARKS:
-Temporarily disables AutoPlay operation while we are running in fullscreen
-graphics modes.
-****************************************************************************/
-static void DisableAutoPlay(void)
-{
-    DWORD   dwAutoPlay,dwSize = sizeof(dwAutoPlay);
-    HKEY    hKey;
-
-    if (RegOpenKeyEx(HKEY_CURRENT_USER,szAutoPlayKey,0,KEY_EXECUTE | KEY_WRITE,&hKey) == ERROR_SUCCESS) {
-       RegQueryValueEx(hKey,szAutoPlayValue,NULL,NULL,(void*)&dwAutoPlay,&dwSize);
-       dwAutoPlay |= AUTOPLAY_DRIVE_CDROM;
-       RegSetValueEx(hKey,szAutoPlayValue,0,REG_DWORD,(void*)&dwAutoPlay,dwSize);
-       RegCloseKey(hKey);
-       }
-}
-
-/****************************************************************************
-REMARKS:
-Re-enables AutoPlay operation when we return to regular GDI mode.
-****************************************************************************/
-static void RestoreAutoPlay(void)
-{
-    DWORD   dwAutoPlay,dwSize = sizeof(dwAutoPlay);
-    HKEY    hKey;
-
-    if (RegOpenKeyEx(HKEY_CURRENT_USER,szAutoPlayKey,0,KEY_EXECUTE | KEY_WRITE,&hKey) == ERROR_SUCCESS) {
-       RegQueryValueEx(hKey,szAutoPlayValue,NULL,NULL,(void*)&dwAutoPlay,&dwSize);
-       dwAutoPlay &= ~AUTOPLAY_DRIVE_CDROM;
-       RegSetValueEx(hKey,szAutoPlayValue,0,REG_DWORD,(void*)&dwAutoPlay,dwSize);
-       RegCloseKey(hKey);
-       }
-}
-
-/****************************************************************************
-REMARKS:
-Suspends the application by switching back to the GDI desktop, allowing
-normal application code to be processed, and then waiting for the
-application activate command to bring us back to fullscreen mode with our
-window minimised.
-****************************************************************************/
-static void LeaveFullScreen(void)
-{
-    int retCode = PM_SUSPEND_APP;
-
-    if (backInGDI)
-       return;
-    if (suspendApp)
-       retCode = suspendApp(PM_DEACTIVATE);
-    RestoreAutoPlay();
-    backInGDI = true;
-
-    /* Now process messages normally until we are re-activated */
-    waitActive = true;
-    if (retCode != PM_NO_SUSPEND_APP) {
-       while (waitActive) {
-           _EVT_pumpMessages();
-           Sleep(200);
-           }
-       }
-}
-
-/****************************************************************************
-REMARKS:
-Reactivate all the surfaces for DirectDraw and set the system back up for
-fullscreen rendering.
-****************************************************************************/
-static void RestoreFullScreen(void)
-{
-    static ibool    firstTime = true;
-
-    if (firstTime) {
-       /* Clear the message queue while waiting for the surfaces to be
-        * restored.
-        */
-       firstTime = false;
-       while (1) {
-           /* Continue looping until out application has been restored
-            * and we have reset the display mode.
-            */
-           _EVT_pumpMessages();
-           if (GetActiveWindow() == _PM_hwndConsole) {
-               if (suspendApp)
-                   suspendApp(PM_REACTIVATE);
-               DisableAutoPlay();
-               backInGDI = false;
-               waitActive = false;
-               firstTime = true;
-               return;
-               }
-           Sleep(200);
-           }
-       }
-}
-
-/****************************************************************************
-REMARKS:
-This function suspends the application by switching back to the GDI desktop,
-allowing normal application code to be processed and then waiting for the
-application activate command to bring us back to fullscreen mode with our
-window minimised.
-
-This version only gets called if we have not captured the screen switch in
-our activate message loops and will occur if the DirectDraw drivers lose a
-surface for some reason while rendering. This should not normally happen,
-but it is included just to be sure (it can happen on WinNT/2000 if the user
-hits the Ctrl-Alt-Del key combination). Note that this code will always
-spin loop, and we cannot disable the spin looping from this version (ie:
-if the user hits Ctrl-Alt-Del under WinNT/2000 the application main loop
-will cease to be executed until the user switches back to the application).
-****************************************************************************/
-void PMAPI PM_doSuspendApp(void)
-{
-    static  ibool firstTime = true;
-
-    /* Call system DLL version if found */
-    if (_PM_imports.PM_doSuspendApp != PM_doSuspendApp) {
-       _PM_imports.PM_doSuspendApp();
-       return;
-       }
-
-    if (firstTime) {
-       if (suspendApp)
-           suspendApp(PM_DEACTIVATE);
-       RestoreAutoPlay();
-       firstTime = false;
-       backInGDI = true;
-       }
-    RestoreFullScreen();
-    firstTime = true;
-}
-
-/****************************************************************************
-REMARKS:
-Main Window proc for the full screen DirectDraw Window that we create while
-running in full screen mode. Here we capture all mouse and keyboard events
-for the window and plug them into our event queue.
-****************************************************************************/
-static LONG CALLBACK PM_winProc(
-    HWND hwnd,
-    UINT msg,
-    WPARAM wParam,
-    LONG lParam)
-{
-    switch (msg) {
-       case WM_SYSCHAR:
-           /* Stop Alt-Space from pausing our application */
-           return 0;
-       case WM_KEYDOWN:
-       case WM_SYSKEYDOWN:
-           if (HIWORD(lParam) & KF_REPEAT) {
-               if (msg == WM_SYSKEYDOWN)
-                   return 0;
-               break;
-               }
-           /* Fall through for keydown events */
-       case WM_KEYUP:
-       case WM_SYSKEYUP:
-           if (msg == WM_SYSKEYDOWN || msg == WM_SYSKEYUP) {
-               if ((HIWORD(lParam) & KF_ALTDOWN) && wParam == VK_RETURN)
-                   break;
-               /* We ignore the remainder of the system keys to stop the
-                * system menu from being activated from the keyboard and pausing
-                * our app while fullscreen (ie: pressing the Alt key).
-                */
-               return 0;
-               }
-           break;
-       case WM_SYSCOMMAND:
-           switch (wParam & ~0x0F) {
-               case SC_SCREENSAVE:
-               case SC_MONITORPOWER:
-                   /* Ignore screensaver requests in fullscreen modes */
-                   return 0;
-               }
-           break;
-       case WM_SIZE:
-           if (waitActive && backInGDI && (wParam != SIZE_MINIMIZED)) {
-               /* Start the re-activation process */
-               PostMessage(hwnd,WM_DO_SUSPEND_APP,WM_PM_RESTORE_FULLSCREEN,0);
-               }
-           else if (!waitActive && isFullScreen && !backInGDI && (wParam == SIZE_MINIMIZED)) {
-               /* Start the de-activation process */
-               PostMessage(hwnd,WM_DO_SUSPEND_APP,WM_PM_LEAVE_FULLSCREEN,0);
-               }
-           break;
-       case WM_DO_SUSPEND_APP:
-           switch (wParam) {
-                               case WM_PM_RESTORE_FULLSCREEN:
-                                       RestoreFullScreen();
-                                       break;
-                               case WM_PM_LEAVE_FULLSCREEN:
-                                       LeaveFullScreen();
-                                       break;
-               }
-           return 0;
-       }
-    if (oldWinProc)
-       return oldWinProc(hwnd,msg,wParam,lParam);
-    return DefWindowProc(hwnd,msg,wParam,lParam);
-}
-
-/****************************************************************************
-PARAMETERS:
-hwnd    - User window to convert
-width   - Window of the fullscreen window
-height  - Height of the fullscreen window
-
-RETURNS:
-Handle to converted fullscreen Window.
-
-REMARKS:
-This function takes the original user window handle and modifies the size,
-position and attributes for the window to convert it into a fullscreen
-window that we can use.
-****************************************************************************/
-static PM_HWND _PM_convertUserWindow(
-    HWND hwnd,
-    int width,
-    int height)
-{
-    RECT    window;
-
-    GetWindowRect(hwnd,&window);
-    oldWinPosX = window.left;
-    oldWinPosY = window.top;
-    oldWinSizeX = window.right - window.left;
-    oldWinSizeY = window.bottom - window.top;
-    oldWndStyle = SetWindowLong(hwnd,GWL_STYLE,WS_POPUP | WS_SYSMENU);
-    oldExWndStyle = SetWindowLong(hwnd,GWL_EXSTYLE,WS_EX_APPWINDOW);
-    ShowWindow(hwnd,SW_SHOW);
-    MoveWindow(hwnd,0,0,width,height,TRUE);
-    SetWindowPos(hwnd,HWND_TOPMOST,0,0,0,0,SWP_NOMOVE | SWP_NOSIZE);
-    oldWinProc = (WNDPROC)SetWindowLong(hwnd,GWL_WNDPROC, (LPARAM)PM_winProc);
-    return hwnd;
-}
-
-/****************************************************************************
-PARAMETERS:
-hwnd    - User window to restore
-
-REMARKS:
-This function restores the original attributes of the user window and put's
-it back into it's original state before it was converted to a fullscreen
-window.
-****************************************************************************/
-static void _PM_restoreUserWindow(
-    HWND hwnd)
-{
-    SetWindowLong(hwnd,GWL_WNDPROC, (LPARAM)oldWinProc);
-    SetWindowLong(hwnd,GWL_EXSTYLE,oldExWndStyle);
-    SetWindowLong(hwnd,GWL_STYLE,oldWndStyle);
-    SetWindowPos(hwnd,HWND_NOTOPMOST,0,0,0,0,SWP_NOMOVE | SWP_NOSIZE);
-    ShowWindow(hwnd,SW_SHOW);
-    MoveWindow(hwnd,oldWinPosX,oldWinPosY,oldWinSizeX,oldWinSizeY,TRUE);
-    oldWinProc = NULL;
-}
-
-/****************************************************************************
-PARAMETERS:
-device  - Index of the device to load DirectDraw for (0 for primary)
-
-REMARKS:
-Attempts to dynamically load the DirectDraw DLL's and create the DirectDraw
-objects that we need.
-****************************************************************************/
-void * PMAPI PM_loadDirectDraw(
-    int device)
-{
-    HDC         hdc;
-    int         bits;
-
-    /* Call system DLL version if found */
-    if (_PM_imports.PM_loadDirectDraw != PM_loadDirectDraw)
-       return _PM_imports.PM_loadDirectDraw(device);
-
-    /* TODO: Handle multi-monitor!! */
-    if (device != 0)
-       return NULL;
-
-    /* Load the DirectDraw DLL if not presently loaded */
-    GET_DEFAULT_CW();
-    if (!hInstDD) {
-       hdc = GetDC(NULL);
-       bits = GetDeviceCaps(hdc,BITSPIXEL);
-       ReleaseDC(NULL,hdc);
-       if (bits < 8)
-           return NULL;
-       if ((hInstDD = LoadLibrary("ddraw.dll")) == NULL)
-           return NULL;
-       pDirectDrawCreate = (void*)GetProcAddress(hInstDD,"DirectDrawCreate");
-       if (!pDirectDrawCreate)
-           return NULL;
-       }
-
-    /* Create the DirectDraw object */
-    if (!lpDD && pDirectDrawCreate(NULL, &lpDD, NULL) != DD_OK) {
-       lpDD = NULL;
-       return NULL;
-       }
-    RESET_DEFAULT_CW();
-    return lpDD;
-}
-
-/****************************************************************************
-PARAMETERS:
-device  - Index of the device to unload DirectDraw for (0 for primary)
-
-REMARKS:
-Frees any DirectDraw objects for the device. We never actually explicitly
-unload the ddraw.dll library, since unloading and reloading it is
-unnecessary since we only want to unload it when the application exits and
-that happens automatically.
-****************************************************************************/
-void PMAPI PM_unloadDirectDraw(
-    int device)
-{
-    /* Call system DLL version if found */
-    if (_PM_imports.PM_unloadDirectDraw != PM_unloadDirectDraw) {
-       _PM_imports.PM_unloadDirectDraw(device);
-       return;
-       }
-    if (lpDD) {
-       IDirectDraw_Release(lpDD);
-       lpDD = NULL;
-       }
-    (void)device;
-}
-
-/****************************************************************************
-REMARKS:
-Open a console for output to the screen, creating the main event handling
-window if necessary.
-****************************************************************************/
-PM_HWND PMAPI PM_openConsole(
-    PM_HWND hWndUser,
-    int device,
-    int xRes,
-    int yRes,
-    int bpp,
-    ibool fullScreen)
-{
-    WNDCLASS        cls;
-    static ibool    classRegistered = false;
-
-    /* Call system DLL version if found */
-    GA_getSystemPMImports();
-    if (_PM_imports.PM_openConsole != PM_openConsole) {
-       if (fullScreen) {
-           _PM_deskX = xRes;
-           _PM_deskY = yRes;
-           }
-       return _PM_imports.PM_openConsole(hWndUser,device,xRes,yRes,bpp,fullScreen);
-       }
-
-    /* Create the fullscreen window if necessary */
-    hwndUser = hWndUser;
-    if (fullScreen) {
-       if (!classRegistered) {
-           /* Create a Window class for the fullscreen window in here, since
-            * we need to register one that will do all our event handling for
-            * us.
-            */
-           hInstApp            = GetModuleHandle(NULL);
-           cls.hCursor         = LoadCursor(NULL,IDC_ARROW);
-           cls.hIcon           = LoadIcon(hInstApp,MAKEINTRESOURCE(1));
-           cls.lpszMenuName    = NULL;
-           cls.lpszClassName   = szWinClassName;
-           cls.hbrBackground   = GetStockObject(BLACK_BRUSH);
-           cls.hInstance       = hInstApp;
-           cls.style           = CS_DBLCLKS;
-           cls.lpfnWndProc     = PM_winProc;
-           cls.cbWndExtra      = 0;
-           cls.cbClsExtra      = 0;
-           if (!RegisterClass(&cls))
-               return NULL;
-           classRegistered = true;
-           }
-       _PM_deskX = xRes;
-       _PM_deskY = yRes;
-       if (!hwndUser) {
-           char windowTitle[80];
-           if (LoadString(hInstApp,1,windowTitle,sizeof(windowTitle)) == 0)
-               strcpy(windowTitle,"MGL Fullscreen Application");
-           _PM_hwndConsole = CreateWindowEx(WS_EX_APPWINDOW,szWinClassName,
-               windowTitle,WS_POPUP | WS_SYSMENU,0,0,xRes,yRes,
-               NULL,NULL,hInstApp,NULL);
-           }
-       else {
-           _PM_hwndConsole = _PM_convertUserWindow(hwndUser,xRes,yRes);
-           }
-       ShowCursor(false);
-       isFullScreen = true;
-       }
-    else {
-       _PM_hwndConsole = hwndUser;
-       isFullScreen = false;
-       }
-    SetFocus(_PM_hwndConsole);
-    SetForegroundWindow(_PM_hwndConsole);
-    DisableAutoPlay();
-    (void)bpp;
-    return _PM_hwndConsole;
-}
-
-/****************************************************************************
-REMARKS:
-Find the size of the console state buffer.
-****************************************************************************/
-int PMAPI PM_getConsoleStateSize(void)
-{
-    /* Call system DLL version if found */
-    if (_PM_imports.PM_getConsoleStateSize != PM_getConsoleStateSize)
-       return _PM_imports.PM_getConsoleStateSize();
-
-    /* Not used in Windows */
-    return 1;
-}
-
-/****************************************************************************
-REMARKS:
-Save the state of the console.
-****************************************************************************/
-void PMAPI PM_saveConsoleState(
-    void *stateBuf,
-    PM_HWND hwndConsole)
-{
-    /* Call system DLL version if found */
-    if (_PM_imports.PM_saveConsoleState != PM_saveConsoleState) {
-       _PM_imports.PM_saveConsoleState(stateBuf,hwndConsole);
-       return;
-       }
-
-    /* Not used in Windows */
-    (void)stateBuf;
-    (void)hwndConsole;
-}
-
-/****************************************************************************
-REMARKS:
-Set the suspend application callback for the fullscreen console.
-****************************************************************************/
-void PMAPI PM_setSuspendAppCallback(
-    PM_saveState_cb saveState)
-{
-    /* Call system DLL version if found */
-    if (_PM_imports.PM_setSuspendAppCallback != PM_setSuspendAppCallback) {
-       _PM_imports.PM_setSuspendAppCallback(saveState);
-       return;
-       }
-    suspendApp = saveState;
-}
-
-/****************************************************************************
-REMARKS:
-Restore the console state.
-****************************************************************************/
-void PMAPI PM_restoreConsoleState(
-    const void *stateBuf,
-    PM_HWND hwndConsole)
-{
-    /* Call system DLL version if found */
-    if (_PM_imports.PM_restoreConsoleState != PM_restoreConsoleState) {
-       _PM_imports.PM_restoreConsoleState(stateBuf,hwndConsole);
-       return;
-       }
-
-    /* Not used in Windows */
-    (void)stateBuf;
-    (void)hwndConsole;
-}
-
-/****************************************************************************
-REMARKS:
-Close the fullscreen console.
-****************************************************************************/
-void PMAPI PM_closeConsole(
-    PM_HWND hwndConsole)
-{
-    /* Call system DLL version if found */
-    if (_PM_imports.PM_closeConsole != PM_closeConsole) {
-       _PM_imports.PM_closeConsole(hwndConsole);
-       return;
-       }
-    ShowCursor(true);
-    RestoreAutoPlay();
-    if (hwndUser)
-       _PM_restoreUserWindow(hwndConsole);
-    else
-       DestroyWindow(hwndConsole);
-    hwndUser = NULL;
-    _PM_hwndConsole = NULL;
-}
-
-/****************************************************************************
-REMARKS:
-Return the DirectDraw window handle used by the application.
-****************************************************************************/
-PM_HWND PMAPI PM_getDirectDrawWindow(void)
-{
-    /* Call system DLL version if found */
-    if (_PM_imports.PM_getDirectDrawWindow != PM_getDirectDrawWindow)
-       return _PM_imports.PM_getDirectDrawWindow();
-    return _PM_hwndConsole;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/win32/event.c b/board/MAI/bios_emulator/scitech/src/pm/win32/event.c
deleted file mode 100644 (file)
index 6388052..0000000
+++ /dev/null
@@ -1,459 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech Multi-platform Graphics Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Win32
-*
-* Description:  Win32 implementation for the SciTech cross platform
-*               event library.
-*
-****************************************************************************/
-
-/*---------------------------- Global Variables ---------------------------*/
-
-static ushort   keyUpMsg[256] = {0};    /* Table of key up messages     */
-static int      rangeX,rangeY;          /* Range of mouse coordinates   */
-
-/*---------------------------- Implementation -----------------------------*/
-
-/* These are not used under Win32 */
-#define _EVT_disableInt()       1
-#define _EVT_restoreInt(flags)  (void)(flags)
-
-/****************************************************************************
-PARAMETERS:
-scanCode    - Scan code to test
-
-REMARKS:
-This macro determines if a specified key is currently down at the
-time that the call is made.
-****************************************************************************/
-#define _EVT_isKeyDown(scanCode)    (keyUpMsg[scanCode] != 0)
-
-/****************************************************************************
-REMARKS:
-This function is used to return the number of ticks since system
-startup in milliseconds. This should be the same value that is placed into
-the time stamp fields of events, and is used to implement auto mouse down
-events.
-****************************************************************************/
-ulong _EVT_getTicks(void)
-{ return timeGetTime(); }
-
-/****************************************************************************
-REMARKS:
-Pumps all messages in the message queue from Win32 into our event queue.
-****************************************************************************/
-void _EVT_pumpMessages(void)
-{
-    MSG     msg;
-    MSG     charMsg;
-    event_t evt;
-
-    /* TODO: Add support for DirectInput! We can't support relative mouse */
-    /*       movement motion counters without DirectInput ;-(. */
-    while (PeekMessage(&msg,NULL,0,0,PM_REMOVE)) {
-       memset(&evt,0,sizeof(evt));
-       switch (msg.message) {
-           case WM_MOUSEMOVE:
-               evt.what = EVT_MOUSEMOVE;
-               break;
-           case WM_LBUTTONDBLCLK:
-               evt.what = EVT_MOUSEDOWN;
-               evt.message = EVT_LEFTBMASK | EVT_DBLCLICK;
-               break;
-           case WM_LBUTTONDOWN:
-               evt.what = EVT_MOUSEDOWN;
-               evt.message = EVT_LEFTBMASK;
-               break;
-           case WM_LBUTTONUP:
-               evt.what = EVT_MOUSEUP;
-               evt.message = EVT_LEFTBMASK;
-               break;
-           case WM_RBUTTONDBLCLK:
-               evt.what = EVT_MOUSEDOWN | EVT_DBLCLICK;
-               evt.message = EVT_RIGHTBMASK;
-               break;
-           case WM_RBUTTONDOWN:
-               evt.what = EVT_MOUSEDOWN;
-               evt.message = EVT_RIGHTBMASK;
-               break;
-           case WM_RBUTTONUP:
-               evt.what = EVT_MOUSEUP;
-               evt.message = EVT_RIGHTBMASK;
-               break;
-           case WM_MBUTTONDBLCLK:
-               evt.what = EVT_MOUSEDOWN | EVT_DBLCLICK;
-               evt.message = EVT_MIDDLEBMASK;
-               break;
-           case WM_MBUTTONDOWN:
-               evt.what = EVT_MOUSEDOWN;
-               evt.message = EVT_MIDDLEBMASK;
-               break;
-           case WM_MBUTTONUP:
-               evt.what = EVT_MOUSEUP;
-               evt.message = EVT_MIDDLEBMASK;
-               break;
-           case WM_KEYDOWN:
-           case WM_SYSKEYDOWN:
-               if (HIWORD(msg.lParam) & KF_REPEAT) {
-                   evt.what = EVT_KEYREPEAT;
-                   }
-               else {
-                   evt.what = EVT_KEYDOWN;
-                   }
-               break;
-           case WM_KEYUP:
-           case WM_SYSKEYUP:
-               evt.what = EVT_KEYUP;
-               break;
-           }
-
-       /* Convert mouse event modifier flags */
-       if (evt.what & EVT_MOUSEEVT) {
-           if (_PM_deskX) {
-               evt.where_x = ((long)msg.pt.x * rangeX) / _PM_deskX;
-               evt.where_y = ((long)msg.pt.y * rangeY) / _PM_deskY;
-               }
-           else {
-               ScreenToClient(_PM_hwndConsole, &msg.pt);
-               evt.where_x = msg.pt.x;
-               evt.where_y = msg.pt.y;
-               }
-           if (evt.what == EVT_MOUSEMOVE) {
-               /* Save the current mouse position */
-               EVT.mx = evt.where_x;
-               EVT.my = evt.where_y;
-               if (EVT.oldMove != -1) {
-                   EVT.evtq[EVT.oldMove].where_x = evt.where_x;/* Modify existing one  */
-                   EVT.evtq[EVT.oldMove].where_y = evt.where_y;
-/*                  EVT.evtq[EVT.oldMove].relative_x += mickeyX;    / / TODO! */
-/*                  EVT.evtq[EVT.oldMove].relative_y += mickeyY;    / / TODO! */
-                   evt.what = 0;
-                   }
-               else {
-                   EVT.oldMove = EVT.freeHead; /* Save id of this move event   */
-/*                  evt.relative_x = mickeyX;    / / TODO! */
-/*                  evt.relative_y = mickeyY;    / / TODO! */
-                   }
-               }
-           else
-               EVT.oldMove = -1;
-           if (msg.wParam & MK_LBUTTON)
-               evt.modifiers |= EVT_LEFTBUT;
-           if (msg.wParam & MK_RBUTTON)
-               evt.modifiers |= EVT_RIGHTBUT;
-           if (msg.wParam & MK_MBUTTON)
-               evt.modifiers |= EVT_MIDDLEBUT;
-           if (msg.wParam & MK_SHIFT)
-               evt.modifiers |= EVT_SHIFTKEY;
-           if (msg.wParam & MK_CONTROL)
-               evt.modifiers |= EVT_CTRLSTATE;
-           }
-
-       /* Convert keyboard codes */
-       TranslateMessage(&msg);
-       if (evt.what & EVT_KEYEVT) {
-           int scanCode = (msg.lParam >> 16) & 0xFF;
-           if (evt.what == EVT_KEYUP) {
-               /* Get message for keyup code from table of cached down values */
-               evt.message = keyUpMsg[scanCode];
-               keyUpMsg[scanCode] = 0;
-               }
-           else {
-               if (PeekMessage(&charMsg,NULL,WM_CHAR,WM_CHAR,PM_REMOVE))
-                   evt.message = charMsg.wParam;
-               if (PeekMessage(&charMsg,NULL,WM_SYSCHAR,WM_SYSCHAR,PM_REMOVE))
-                   evt.message = charMsg.wParam;
-               evt.message |= ((msg.lParam >> 8) & 0xFF00);
-               keyUpMsg[scanCode] = (ushort)evt.message;
-               }
-           if (evt.what == EVT_KEYREPEAT)
-               evt.message |= (msg.lParam << 16);
-           if (HIWORD(msg.lParam) & KF_ALTDOWN)
-               evt.modifiers |= EVT_ALTSTATE;
-           if (GetKeyState(VK_SHIFT) & 0x8000U)
-               evt.modifiers |= EVT_SHIFTKEY;
-           if (GetKeyState(VK_CONTROL) & 0x8000U)
-               evt.modifiers |= EVT_CTRLSTATE;
-           EVT.oldMove = -1;
-           }
-
-       if (evt.what != 0) {
-           /* Add time stamp and add the event to the queue */
-           evt.when = msg.time;
-           if (EVT.count < EVENTQSIZE)
-               addEvent(&evt);
-           }
-       DispatchMessage(&msg);
-       }
-}
-
-/****************************************************************************
-REMARKS:
-This macro/function is used to converts the scan codes reported by the
-keyboard to our event libraries normalised format. We only have one scan
-code for the 'A' key, and use shift modifiers to determine if it is a
-Ctrl-F1, Alt-F1 etc. The raw scan codes from the keyboard work this way,
-but the OS gives us 'cooked' scan codes, we have to translate them back
-to the raw format.
-****************************************************************************/
-#define _EVT_maskKeyCode(evt)
-
-/****************************************************************************
-REMARKS:
-Safely abort the event module upon catching a fatal error.
-****************************************************************************/
-void _EVT_abort(
-    int signal)
-{
-    (void)signal;
-    EVT_exit();
-    PM_fatalError("Unhandled exception!");
-}
-
-/****************************************************************************
-PARAMETERS:
-mouseMove   - Callback function to call wheneve the mouse needs to be moved
-
-REMARKS:
-Initiliase the event handling module. Here we install our mouse handling ISR
-to be called whenever any button's are pressed or released. We also build
-the free list of events in the event queue.
-
-We use handler number 2 of the mouse libraries interrupt handlers for our
-event handling routines.
-****************************************************************************/
-void EVTAPI EVT_init(
-    _EVT_mouseMoveHandler mouseMove)
-{
-    /* Initialise the event queue */
-    EVT.mouseMove = mouseMove;
-    initEventQueue();
-    memset(keyUpMsg,0,sizeof(keyUpMsg));
-
-    /* Catch program termination signals so we can clean up properly */
-    signal(SIGABRT, _EVT_abort);
-    signal(SIGFPE, _EVT_abort);
-    signal(SIGINT, _EVT_abort);
-}
-
-/****************************************************************************
-REMARKS
-Changes the range of coordinates returned by the mouse functions to the
-specified range of values. This is used when changing between graphics
-modes set the range of mouse coordinates for the new display mode.
-****************************************************************************/
-void EVTAPI EVT_setMouseRange(
-    int xRes,
-    int yRes)
-{
-    rangeX = xRes;
-    rangeY = yRes;
-}
-
-/****************************************************************************
-REMARKS
-Modifes the mouse coordinates as necessary if scaling to OS coordinates,
-and sets the OS mouse cursor position.
-****************************************************************************/
-void _EVT_setMousePos(
-    int *x,
-    int *y)
-{
-    /* Scale coordinates up to desktop coordinates first */
-    int scaledX = (*x * _PM_deskX) / rangeX;
-    int scaledY = (*y * _PM_deskY) / rangeY;
-
-    /* Scale coordinates back to screen coordinates again */
-    *x = (scaledX * rangeX) / _PM_deskX;
-    *y = (scaledY * rangeY) / _PM_deskY;
-    SetCursorPos(scaledX,scaledY);
-}
-
-/****************************************************************************
-REMARKS:
-Initiailises the internal event handling modules. The EVT_suspend function
-can be called to suspend event handling (such as when shelling out to DOS),
-and this function can be used to resume it again later.
-****************************************************************************/
-void EVT_resume(void)
-{
-    /* Do nothing for Win32 */
-}
-
-/****************************************************************************
-REMARKS
-Suspends all of our event handling operations. This is also used to
-de-install the event handling code.
-****************************************************************************/
-void EVT_suspend(void)
-{
-    /* Do nothing for Win32 */
-}
-
-/****************************************************************************
-REMARKS
-Exits the event module for program terminatation.
-****************************************************************************/
-void EVT_exit(void)
-{
-    /* Restore signal handlers */
-    signal(SIGABRT, SIG_DFL);
-    signal(SIGFPE, SIG_DFL);
-    signal(SIGINT, SIG_DFL);
-}
-
-/****************************************************************************
-DESCRIPTION:
-Returns the mask indicating what joystick axes are attached.
-
-HEADER:
-event.h
-
-REMARKS:
-This function is used to detect the attached joysticks, and determine
-what axes are present and functioning. This function will re-detect any
-attached joysticks when it is called, so if the user forgot to attach
-the joystick when the application started, you can call this function to
-re-detect any newly attached joysticks.
-
-SEE ALSO:
-EVT_joySetLowerRight, EVT_joySetCenter, EVT_joyIsPresent
-****************************************************************************/
-int EVTAPI EVT_joyIsPresent(void)
-{
-    /* TODO: Implement joystick code based on DirectX! */
-    return 0;
-}
-
-/****************************************************************************
-DESCRIPTION:
-Polls the joystick for position and button information.
-
-HEADER:
-event.h
-
-REMARKS:
-This routine is used to poll analogue joysticks for button and position
-information. It should be called once for each main loop of the user
-application, just before processing all pending events via EVT_getNext.
-All information polled from the joystick will be posted to the event
-queue for later retrieval.
-
-Note:   Most analogue joysticks will provide readings that change even
-       though the joystick has not moved. Hence if you call this routine
-       you will likely get an EVT_JOYMOVE event every time through your
-       event loop.
-
-SEE ALSO:
-EVT_getNext, EVT_peekNext, EVT_joySetUpperLeft, EVT_joySetLowerRight,
-EVT_joySetCenter, EVT_joyIsPresent
-****************************************************************************/
-void EVTAPI EVT_pollJoystick(void)
-{
-}
-
-/****************************************************************************
-DESCRIPTION:
-Calibrates the joystick upper left position
-
-HEADER:
-event.h
-
-REMARKS:
-This function can be used to zero in on better joystick calibration factors,
-which may work better than the default simplistic calibration (which assumes
-the joystick is centered when the event library is initialised).
-To use this function, ask the user to hold the stick in the upper left
-position and then have them press a key or button. and then call this
-function. This function will then read the joystick and update the
-calibration factors.
-
-Usually, assuming that the stick was centered when the event library was
-initialized, you really only need to call EVT_joySetLowerRight since the
-upper left position is usually always 0,0 on most joysticks. However, the
-safest procedure is to call all three calibration functions.
-
-SEE ALSO:
-EVT_joySetUpperLeft, EVT_joySetLowerRight, EVT_joyIsPresent
-****************************************************************************/
-void EVTAPI EVT_joySetUpperLeft(void)
-{
-}
-
-/****************************************************************************
-DESCRIPTION:
-Calibrates the joystick lower right position
-
-HEADER:
-event.h
-
-REMARKS:
-This function can be used to zero in on better joystick calibration factors,
-which may work better than the default simplistic calibration (which assumes
-the joystick is centered when the event library is initialised).
-To use this function, ask the user to hold the stick in the lower right
-position and then have them press a key or button. and then call this
-function. This function will then read the joystick and update the
-calibration factors.
-
-Usually, assuming that the stick was centered when the event library was
-initialized, you really only need to call EVT_joySetLowerRight since the
-upper left position is usually always 0,0 on most joysticks. However, the
-safest procedure is to call all three calibration functions.
-
-SEE ALSO:
-EVT_joySetUpperLeft, EVT_joySetCenter, EVT_joyIsPresent
-****************************************************************************/
-void EVTAPI EVT_joySetLowerRight(void)
-{
-}
-
-/****************************************************************************
-DESCRIPTION:
-Calibrates the joystick center position
-
-HEADER:
-event.h
-
-REMARKS:
-This function can be used to zero in on better joystick calibration factors,
-which may work better than the default simplistic calibration (which assumes
-the joystick is centered when the event library is initialised).
-To use this function, ask the user to hold the stick in the center
-position and then have them press a key or button. and then call this
-function. This function will then read the joystick and update the
-calibration factors.
-
-Usually, assuming that the stick was centered when the event library was
-initialized, you really only need to call EVT_joySetLowerRight since the
-upper left position is usually always 0,0 on most joysticks. However, the
-safest procedure is to call all three calibration functions.
-
-SEE ALSO:
-EVT_joySetUpperLeft, EVT_joySetLowerRight, EVT_joySetCenter
-****************************************************************************/
-void EVTAPI EVT_joySetCenter(void)
-{
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/win32/ntservc.c b/board/MAI/bios_emulator/scitech/src/pm/win32/ntservc.c
deleted file mode 100644 (file)
index 59d9aa0..0000000
+++ /dev/null
@@ -1,258 +0,0 @@
-/****************************************************************************
-*
-*                         SciTech Display Doctor
-*
-*               Copyright (C) 1991-2001 SciTech Software, Inc.
-*                            All rights reserved.
-*
-*  ======================================================================
-*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-*  |                                                                    |
-*  |This copyrighted computer code is a proprietary trade secret of     |
-*  |SciTech Software, Inc., located at 505 Wall Street, Chico, CA 95928 |
-*  |USA (www.scitechsoft.com).  ANY UNAUTHORIZED POSSESSION, USE,       |
-*  |VIEWING, COPYING, MODIFICATION OR DISSEMINATION OF THIS CODE IS     |
-*  |STRICTLY PROHIBITED BY LAW.  Unless you have current, express       |
-*  |written authorization from SciTech to possess or use this code, you |
-*  |may be subject to civil and/or criminal penalties.                  |
-*  |                                                                    |
-*  |If you received this code in error or you would like to report      |
-*  |improper use, please immediately contact SciTech Software, Inc. at  |
-*  |530-894-8400.                                                       |
-*  |                                                                    |
-*  |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
-*  ======================================================================
-*
-* Language:     ANSI C
-* Environment:  Windows NT, Windows 2K or Windows XP.
-*
-* Description:  Main module to do the installation of the SDD and GLDirect
-*               device driver components under Windows NT/2K/XP.
-*
-****************************************************************************/
-
-#include "pmapi.h"
-#include "win32/oshdr.h"
-
-/*----------------------------- Implementation ----------------------------*/
-
-/****************************************************************************
-PARAMETERS:
-szDriverName    - Actual name of the driver to install in the system
-szServiceName   - Name of the service to create
-szLoadGroup     - Load group for the driver (NULL for normal drivers)
-dwServiceType   - Service type to create
-
-RETURNS:
-True on success, false on failure.
-
-REMARKS:
-This function does all the work to install the driver into the system.
-The driver is not however activated; for that you must use the Start_SddFilt
-function.
-****************************************************************************/
-ulong PMAPI PM_installService(
-    const char *szDriverName,
-    const char *szServiceName,
-    const char *szLoadGroup,
-    ulong dwServiceType)
-{
-    SC_HANDLE   scmHandle;
-    SC_HANDLE   driverHandle;
-    char        szDriverPath[MAX_PATH];
-    HKEY        key;
-    char        keyPath[MAX_PATH];
-    ulong       status;
-
-    /* Obtain a handle to the service control manager requesting all access */
-    if ((scmHandle = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS)) == NULL)
-       return GetLastError();
-
-    /* Find the path to the driver in system directory */
-    GetSystemDirectory(szDriverPath, sizeof(szDriverPath));
-    strcat(szDriverPath, "\\drivers\\");
-    strcat(szDriverPath, szDriverName);
-
-    /* Create the service with the Service Control Manager. */
-    driverHandle = CreateService(scmHandle,
-                                szServiceName,
-                                szServiceName,
-                                SERVICE_ALL_ACCESS,
-                                dwServiceType,
-                                SERVICE_BOOT_START,
-                                SERVICE_ERROR_NORMAL,
-                                szDriverPath,
-                                szLoadGroup,
-                                NULL,
-                                NULL,
-                                NULL,
-                                NULL);
-
-    /* Check to see if the driver could actually be installed. */
-    if (!driverHandle) {
-       status = GetLastError();
-       CloseServiceHandle(scmHandle);
-       return status;
-       }
-
-    /* Get a handle to the key for driver so that it can be altered in the */
-    /* next step. */
-    strcpy(keyPath, "SYSTEM\\CurrentControlSet\\Services\\");
-    strcat(keyPath, szServiceName);
-    if ((status = RegOpenKeyEx(HKEY_LOCAL_MACHINE,keyPath,0,KEY_ALL_ACCESS,&key)) != ERROR_SUCCESS) {
-       /* A problem has occured. Delete the service so that it is not installed. */
-       status = GetLastError();
-       DeleteService(driverHandle);
-       CloseServiceHandle(driverHandle);
-       CloseServiceHandle(scmHandle);
-       return status;
-       }
-
-    /* Delete the ImagePath value in the newly created key so that the */
-    /* system looks for the driver in the normal location. */
-    if ((status = RegDeleteValue(key, "ImagePath")) != ERROR_SUCCESS) {
-       /* A problem has occurred. Delete the service so that it is not */
-       /* installed and will not try to start. */
-       RegCloseKey(key);
-       DeleteService(driverHandle);
-       CloseServiceHandle(driverHandle);
-       CloseServiceHandle(scmHandle);
-       return status;
-       }
-
-    /* Clean up and exit */
-    RegCloseKey(key);
-    CloseServiceHandle(driverHandle);
-    CloseServiceHandle(scmHandle);
-    return ERROR_SUCCESS;
-}
-
-/****************************************************************************
-PARAMETERS:
-szServiceName   - Name of the service to start
-
-RETURNS:
-True on success, false on failure.
-
-REMARKS:
-This function is used to start the specified service and make it active.
-****************************************************************************/
-ulong PMAPI PM_startService(
-    const char *szServiceName)
-{
-    SC_HANDLE       scmHandle;
-    SC_HANDLE       driverHandle;
-    SERVICE_STATUS     serviceStatus;
-    ulong           status;
-
-    /* Obtain a handle to the service control manager requesting all access */
-    if ((scmHandle = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS)) == NULL)
-       return GetLastError();
-
-    /* Open the service with the Service Control Manager. */
-    if ((driverHandle = OpenService(scmHandle,szServiceName,SERVICE_ALL_ACCESS)) == NULL) {
-       status = GetLastError();
-       CloseServiceHandle(scmHandle);
-       return status;
-       }
-
-    /* Start the service */
-    if (!StartService(driverHandle,0,NULL)) {
-       status = GetLastError();
-       CloseServiceHandle(driverHandle);
-       CloseServiceHandle(scmHandle);
-       return status;
-       }
-
-    /* Query the service to make sure it is there */
-    if (!QueryServiceStatus(driverHandle,&serviceStatus)) {
-       status = GetLastError();
-       CloseServiceHandle(driverHandle);
-       CloseServiceHandle(scmHandle);
-       return status;
-       }
-    CloseServiceHandle(driverHandle);
-    CloseServiceHandle(scmHandle);
-    return ERROR_SUCCESS;
-}
-
-/****************************************************************************
-PARAMETERS:
-szServiceName   - Name of the service to stop
-
-RETURNS:
-True on success, false on failure.
-
-REMARKS:
-This function is used to stop the specified service and disable it.
-****************************************************************************/
-ulong PMAPI PM_stopService(
-    const char *szServiceName)
-{
-    SC_HANDLE       scmHandle;
-    SC_HANDLE       driverHandle;
-    SERVICE_STATUS     serviceStatus;
-    ulong           status;
-
-    /* Obtain a handle to the service control manager requesting all access */
-    if ((scmHandle = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS)) == NULL)
-       return GetLastError();
-
-    /* Open the service with the Service Control Manager. */
-    if ((driverHandle = OpenService(scmHandle,szServiceName,SERVICE_ALL_ACCESS)) == NULL) {
-       status = GetLastError();
-       CloseServiceHandle(scmHandle);
-       return status;
-       }
-
-    /* Stop the service from running */
-    if (!ControlService(driverHandle, SERVICE_CONTROL_STOP, &serviceStatus)) {
-       status = GetLastError();
-       CloseServiceHandle(driverHandle);
-       CloseServiceHandle(scmHandle);
-       return status;
-       }
-    CloseServiceHandle(driverHandle);
-    CloseServiceHandle(scmHandle);
-    return ERROR_SUCCESS;
-}
-
-/****************************************************************************
-PARAMETERS:
-szServiceName   - Name of the service to remove
-
-RETURNS:
-True on success, false on failure.
-
-REMARKS:
-This function is used to remove a service completely from the system.
-****************************************************************************/
-ulong PMAPI PM_removeService(
-    const char *szServiceName)
-{
-    SC_HANDLE   scmHandle;
-    SC_HANDLE   driverHandle;
-    ulong       status;
-
-    /* Obtain a handle to the service control manager requesting all access */
-    if ((scmHandle = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS)) == NULL)
-       return GetLastError();
-
-    /* Open the service with the Service Control Manager. */
-    if ((driverHandle = OpenService(scmHandle,szServiceName,SERVICE_ALL_ACCESS)) == NULL) {
-       status = GetLastError();
-       CloseServiceHandle(scmHandle);
-       return status;
-       }
-
-    /* Remove the service */
-    if (!DeleteService(driverHandle)) {
-       status = GetLastError();
-       CloseServiceHandle(driverHandle);
-       CloseServiceHandle(scmHandle);
-       return status;
-       }
-    CloseServiceHandle(driverHandle);
-    CloseServiceHandle(scmHandle);
-    return ERROR_SUCCESS;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/win32/oshdr.h b/board/MAI/bios_emulator/scitech/src/pm/win32/oshdr.h
deleted file mode 100644 (file)
index 0c59e90..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Win32
-*
-* Description:  Include file to include all OS specific header files.
-*
-****************************************************************************/
-
-#define WIN32_LEAN_AND_MEAN
-#define STRICT
-#include <windows.h>
-#include <mmsystem.h>
-#include <float.h>
-#define NONAMELESSUNION
-#include "pm/ddraw.h"
-
-/* Macros to save and restore the default control word. Windows 9x has
- * some bugs in it such that calls to load any DLL's which load 16-bit
- * DLL's cause the floating point control word to get trashed. We fix
- * this by saving and restoring the control word across problematic
- * calls.
- */
-
-#if defined(__INTEL__)
-#define GET_DEFAULT_CW()                    \
-{                                           \
-    if (_PM_cw_default == 0)                \
-       _PM_cw_default = _control87(0,0);   \
-}
-#define RESET_DEFAULT_CW()                  \
-    _control87(_PM_cw_default,0xFFFFFFFF)
-#else
-#define GET_DEFAULT_CW()
-#define RESET_DEFAULT_CW()
-#endif
-
-/* Custom window messages */
-
-#define        WM_DO_SUSPEND_APP                       WM_USER
-#define        WM_PM_LEAVE_FULLSCREEN      0
-#define        WM_PM_RESTORE_FULLSCREEN        1
-
-/* Macro for disabling AutoPlay on a use system */
-
-#define AUTOPLAY_DRIVE_CDROM    0x20
-
-/*--------------------------- Global Variables ----------------------------*/
-
-#ifdef  __INTEL__
-extern uint     _PM_cw_default;         /* Default FPU control word     */
-#endif
-extern int      _PM_deskX,_PM_deskY;    /* Desktop dimensions           */
-extern HWND     _PM_hwndConsole;        /* Window handle for console    */
-
-/*-------------------------- Internal Functions ---------------------------*/
-
-void _EVT_pumpMessages(void);
diff --git a/board/MAI/bios_emulator/scitech/src/pm/win32/pm.c b/board/MAI/bios_emulator/scitech/src/pm/win32/pm.c
deleted file mode 100644 (file)
index 1ffdbcc..0000000
+++ /dev/null
@@ -1,1459 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Win32
-*
-* Description:  Implementation for the OS Portability Manager Library, which
-*               contains functions to implement OS specific services in a
-*               generic, cross platform API. Porting the OS Portability
-*               Manager library is the first step to porting any SciTech
-*               products to a new platform.
-*
-****************************************************************************/
-
-#define WIN32_LEAN_AND_MEAN
-#define STRICT
-#include <windows.h>
-#include <mmsystem.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <direct.h>
-#include "pmapi.h"
-#include "drvlib/os/os.h"
-#include "pm_help.h"
-
-/*--------------------------- Global variables ----------------------------*/
-
-ibool           _PM_haveWinNT;      /* True if we are running on NT     */
-static uint     VESABuf_len = 1024; /* Length of the VESABuf buffer     */
-static void     *VESABuf_ptr = NULL;/* Near pointer to VESABuf          */
-static uint     VESABuf_rseg;       /* Real mode segment of VESABuf     */
-static uint     VESABuf_roff;       /* Real mode offset of VESABuf      */
-HANDLE          _PM_hDevice = NULL; /* Handle to Win32 VxD              */
-static ibool    inited = false;     /* Flags if we are initialised      */
-static void     (PMAPIP fatalErrorCleanup)(void) = NULL;
-
-static char *szMachineNameKey   = "System\\CurrentControlSet\\control\\ComputerName\\ComputerName";
-static char *szMachineNameKeyNT = "System\\CurrentControlSet\\control\\ComputerName\\ActiveComputerName";
-static char *szMachineName      = "ComputerName";
-
-/*----------------------------- Implementation ----------------------------*/
-
-/* Macro to check for a valid, loaded version of PMHELP. We check this
- * on demand when we need these services rather than when PM_init() is
- * called because if we are running on DirectDraw we don't need PMHELP.VXD.
- */
-
-#define CHECK_FOR_PMHELP()                                                  \
-{                                                                           \
-    if (_PM_hDevice == INVALID_HANDLE_VALUE)                                \
-       if (_PM_haveWinNT)                                                  \
-           PM_fatalError("Unable to connect to PMHELP.SYS or SDDHELP.SYS!"); \
-       else                                                                  \
-           PM_fatalError("Unable to connect to PMHELP.VXD or SDDHELP.VXD!"); \
-}
-
-/****************************************************************************
-REMARKS:
-Initialise the PM library and connect to our helper device driver. If we
-cannot connect to our helper device driver, we bail out with an error
-message. Our Windows 9x VxD is dynamically loadable, so it can be loaded
-after the system has started.
-****************************************************************************/
-void PMAPI PM_init(void)
-{
-    DWORD   inBuf[1];   /* Buffer to receive data from VxD  */
-    DWORD   outBuf[1];  /* Buffer to receive data from VxD  */
-    DWORD   count;      /* Count of bytes returned from VxD */
-    char    cntPath[PM_MAX_PATH];
-    char    *env;
-
-    /* Create a file handle for the static VxD if possible, otherwise
-     * dynamically load the PMHELP helper VxD. Note that if an old version
-     * of SDD is loaded, we use the PMHELP VxD instead.
-     */
-    if (!inited) {
-       /* Determine if we are running under Windows NT or not and
-        * set the global OS type variable.
-        */
-       _PM_haveWinNT = false;
-       if ((GetVersion() & 0x80000000UL) == 0)
-           _PM_haveWinNT = true;
-       ___drv_os_type = (_PM_haveWinNT) ? _OS_WINNT : _OS_WIN95;
-
-       /* Now try to connect to SDDHELP.VXD or SDDHELP.SYS */
-       _PM_hDevice = CreateFile(SDDHELP_MODULE_PATH, 0,0,0, CREATE_NEW, FILE_FLAG_DELETE_ON_CLOSE, 0);
-       if (_PM_hDevice != INVALID_HANDLE_VALUE) {
-           if (!DeviceIoControl(_PM_hDevice, PMHELP_GETVER32, NULL, 0,
-                   outBuf, sizeof(outBuf), &count, NULL) || outBuf[0] < PMHELP_VERSION) {
-               /* Old version of SDDHELP loaded, so use PMHELP instead */
-               CloseHandle(_PM_hDevice);
-               _PM_hDevice = INVALID_HANDLE_VALUE;
-               }
-           }
-       if (_PM_hDevice == INVALID_HANDLE_VALUE) {
-           /* First try to see if there is a currently loaded PMHELP driver.
-            * This is usually the case when we are running under Windows NT/2K.
-            */
-           _PM_hDevice = CreateFile(PMHELP_MODULE_PATH, 0,0,0, CREATE_NEW, FILE_FLAG_DELETE_ON_CLOSE, 0);
-           if (_PM_hDevice == INVALID_HANDLE_VALUE) {
-               /* The driver was not staticly loaded, so try creating a file handle
-                * to a dynamic version of the VxD if possible. Note that on WinNT/2K we
-                * cannot support dynamically loading the drivers.
-                */
-               _PM_hDevice = CreateFile(PMHELP_VXD_PATH, 0,0,0, CREATE_NEW, FILE_FLAG_DELETE_ON_CLOSE, 0);
-               }
-           }
-       if (_PM_hDevice != INVALID_HANDLE_VALUE) {
-           /* Call the driver to determine the version number */
-           if (!DeviceIoControl(_PM_hDevice, PMHELP_GETVER32, inBuf, sizeof(inBuf),
-                   outBuf, sizeof(outBuf), &count, NULL) || outBuf[0] < PMHELP_VERSION) {
-               if (_PM_haveWinNT)
-                   PM_fatalError("Older version of PMHELP.SYS found!");
-               else
-                   PM_fatalError("Older version of PMHELP.VXD found!");
-               }
-
-           /* Now set the current path inside the VxD so it knows what the
-            * current directory is for loading Nucleus drivers.
-            */
-           inBuf[0] = (ulong)PM_getCurrentPath(cntPath,sizeof(cntPath));
-           if (!DeviceIoControl(_PM_hDevice, PMHELP_SETCNTPATH32, inBuf, sizeof(inBuf), outBuf, sizeof(outBuf), &count, NULL))
-               PM_fatalError("Unable to set VxD current path!");
-
-           /* Now pass down the NUCLEUS_PATH environment variable to the device
-            * driver so it can use this value if it is found.
-            */
-           if ((env = getenv("NUCLEUS_PATH")) != NULL) {
-               inBuf[0] = (ulong)env;
-               if (!DeviceIoControl(_PM_hDevice, PMHELP_SETNUCLEUSPATH32, inBuf, sizeof(inBuf), outBuf, sizeof(outBuf), &count, NULL))
-                   PM_fatalError("Unable to set VxD Nucleus path!");
-               }
-
-           /* Enable IOPL for ring-3 code by default if driver is present */
-           if (_PM_haveWinNT)
-               PM_setIOPL(3);
-           }
-
-       /* Indicate that we have been initialised */
-       inited = true;
-       }
-}
-
-/****************************************************************************
-REMARKS:
-We do have BIOS access under Windows 9x, but not under Windows NT.
-****************************************************************************/
-int PMAPI PM_setIOPL(
-    int iopl)
-{
-    DWORD       inBuf[1];   /* Buffer to receive data from VxD  */
-    DWORD       outBuf[1];  /* Buffer to receive data from VxD  */
-    DWORD       count;      /* Count of bytes returned from VxD */
-    static int  cntIOPL = 0;
-    int         oldIOPL = cntIOPL;
-
-    /* Enable I/O by adjusting the I/O permissions map on Windows NT */
-    if (_PM_haveWinNT) {
-       CHECK_FOR_PMHELP();
-       if (iopl == 3)
-           DeviceIoControl(_PM_hDevice, PMHELP_ENABLERING3IOPL, inBuf, sizeof(inBuf),outBuf, sizeof(outBuf), &count, NULL);
-       else
-           DeviceIoControl(_PM_hDevice, PMHELP_DISABLERING3IOPL, inBuf, sizeof(inBuf),outBuf, sizeof(outBuf), &count, NULL);
-       cntIOPL = iopl;
-       return oldIOPL;
-       }
-
-    /* We always have IOPL on Windows 9x */
-    return 3;
-}
-
-/****************************************************************************
-REMARKS:
-We do have BIOS access under Windows 9x, but not under Windows NT.
-****************************************************************************/
-ibool PMAPI PM_haveBIOSAccess(void)
-{
-    if (PM_getOSType() == _OS_WINNT)
-       return false;
-    else
-       return _PM_hDevice != INVALID_HANDLE_VALUE;
-}
-
-/****************************************************************************
-REMARKS:
-Return the operating system type identifier.
-****************************************************************************/
-long PMAPI PM_getOSType(void)
-{
-    if ((GetVersion() & 0x80000000UL) == 0)
-       return ___drv_os_type = _OS_WINNT;
-    else
-       return ___drv_os_type = _OS_WIN95;
-}
-
-/****************************************************************************
-REMARKS:
-Return the runtime type identifier.
-****************************************************************************/
-int PMAPI PM_getModeType(void)
-{
-    return PM_386;
-}
-
-/****************************************************************************
-REMARKS:
-Add a file directory separator to the end of the filename.
-****************************************************************************/
-void PMAPI PM_backslash(
-    char *s)
-{
-    uint pos = strlen(s);
-    if (s[pos-1] != '\\') {
-       s[pos] = '\\';
-       s[pos+1] = '\0';
-       }
-}
-
-/****************************************************************************
-REMARKS:
-Add a user defined PM_fatalError cleanup function.
-****************************************************************************/
-void PMAPI PM_setFatalErrorCleanup(
-    void (PMAPIP cleanup)(void))
-{
-    fatalErrorCleanup = cleanup;
-}
-
-/****************************************************************************
-REMARKS:
-Report a fatal error condition and halt the program.
-****************************************************************************/
-void PMAPI PM_fatalError(
-    const char *msg)
-{
-    if (fatalErrorCleanup)
-       fatalErrorCleanup();
-    MessageBox(NULL,msg,"Fatal Error!", MB_ICONEXCLAMATION);
-    exit(1);
-}
-
-/****************************************************************************
-REMARKS:
-Allocate the real mode VESA transfer buffer for communicating with the BIOS.
-****************************************************************************/
-void * PMAPI PM_getVESABuf(
-    uint *len,
-    uint *rseg,
-    uint *roff)
-{
-    DWORD   outBuf[4];  /* Buffer to receive data from VxD  */
-    DWORD   count;      /* Count of bytes returned from VxD */
-
-    /* We require the helper VxD to be loaded staticly in order to support
-     * the VESA transfer buffer. We do not support dynamically allocating
-     * real mode memory buffers from Win32 programs (we need a 16-bit DLL
-     * for this, and Windows 9x becomes very unstable if you free the
-     * memory blocks out of order).
-     */
-    if (!inited)
-       PM_init();
-    if (!VESABuf_ptr) {
-       CHECK_FOR_PMHELP();
-       if (DeviceIoControl(_PM_hDevice, PMHELP_GETVESABUF32, NULL, 0,
-               outBuf, sizeof(outBuf), &count, NULL)) {
-           if (!outBuf[0])
-               return NULL;
-           VESABuf_ptr = (void*)outBuf[0];
-           VESABuf_len = outBuf[1];
-           VESABuf_rseg = outBuf[2];
-           VESABuf_roff = outBuf[3];
-           }
-       }
-    *len = VESABuf_len;
-    *rseg = VESABuf_rseg;
-    *roff = VESABuf_roff;
-    return VESABuf_ptr;
-}
-
-/****************************************************************************
-REMARKS:
-Check if a key has been pressed.
-****************************************************************************/
-int PMAPI PM_kbhit(void)
-{
-    /* Not used in Windows */
-    return true;
-}
-
-/****************************************************************************
-REMARKS:
-Wait for and return the next keypress.
-****************************************************************************/
-int PMAPI PM_getch(void)
-{
-    /* Not used in Windows */
-    return 0xD;
-}
-
-/****************************************************************************
-REMARKS:
-Set the location of the OS console cursor.
-****************************************************************************/
-void PM_setOSCursorLocation(
-    int x,
-    int y)
-{
-    /* Nothing to do for Windows */
-    (void)x;
-    (void)y;
-}
-
-/****************************************************************************
-REMARKS:
-Set the width of the OS console.
-****************************************************************************/
-void PM_setOSScreenWidth(
-    int width,
-    int height)
-{
-    /* Nothing to do for Windows */
-    (void)width;
-    (void)height;
-}
-
-/****************************************************************************
-REMARKS:
-Set the real time clock handler (used for software stereo modes).
-****************************************************************************/
-ibool PMAPI PM_setRealTimeClockHandler(
-    PM_intHandler ih,
-    int frequency)
-{
-    /* We do not support this from Win32 programs. Rather the VxD handles
-     * this stuff it will take care of hooking the stereo flip functions at
-     * the VxD level.
-     */
-    (void)ih;
-    (void)frequency;
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-Set the real time clock frequency (for stereo modes).
-****************************************************************************/
-void PMAPI PM_setRealTimeClockFrequency(
-    int frequency)
-{
-    /* Not supported under Win32 */
-    (void)frequency;
-}
-
-/****************************************************************************
-REMARKS:
-Restore the original real time clock handler.
-****************************************************************************/
-void PMAPI PM_restoreRealTimeClockHandler(void)
-{
-    /* Not supported under Win32 */
-}
-
-/****************************************************************************
-REMARKS:
-Return the current operating system path or working directory.
-****************************************************************************/
-char * PMAPI PM_getCurrentPath(
-    char *path,
-    int maxLen)
-{
-    return getcwd(path,maxLen);
-}
-
-/****************************************************************************
-REMARKS:
-Query a string from the registry (extended version).
-****************************************************************************/
-static ibool REG_queryStringEx(
-    HKEY hKey,
-    const char *szValue,
-    char *value,
-    ulong size)
-{
-    DWORD   type;
-
-    if (RegQueryValueEx(hKey,(PCHAR)szValue,(PDWORD)NULL,(PDWORD)&type,(LPBYTE)value,(PDWORD)&size) == ERROR_SUCCESS)
-       return true;
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-Query a string from the registry.
-****************************************************************************/
-static ibool REG_queryString(
-    const char *szKey,
-    const char *szValue,
-    char *value,
-    DWORD size)
-{
-    HKEY    hKey;
-    ibool   status = false;
-
-    memset(value,0,sizeof(value));
-    if (RegOpenKey(HKEY_LOCAL_MACHINE,szKey,&hKey) == ERROR_SUCCESS) {
-       status = REG_queryStringEx(hKey,szValue,value,size);
-       RegCloseKey(hKey);
-       }
-    return status;
-}
-
-/****************************************************************************
-REMARKS:
-Return the drive letter for the boot drive.
-****************************************************************************/
-char PMAPI PM_getBootDrive(void)
-{
-    static char path[256];
-    GetSystemDirectory(path,sizeof(path));
-    return path[0];
-}
-
-/****************************************************************************
-REMARKS:
-Return the path to the VBE/AF driver files.
-****************************************************************************/
-const char * PMAPI PM_getVBEAFPath(void)
-{
-    return "c:\\";
-}
-
-/****************************************************************************
-REMARKS:
-Return the path to the Nucleus driver files.
-****************************************************************************/
-const char * PMAPI PM_getNucleusPath(void)
-{
-    static char path[256];
-    char        *env;
-
-    if ((env = getenv("NUCLEUS_PATH")) != NULL)
-       return env;
-    GetSystemDirectory(path,sizeof(path));
-    strcat(path,"\\nucleus");
-    return path;
-}
-
-/****************************************************************************
-REMARKS:
-Return the path to the Nucleus configuration files.
-****************************************************************************/
-const char * PMAPI PM_getNucleusConfigPath(void)
-{
-    static char path[256];
-    strcpy(path,PM_getNucleusPath());
-    PM_backslash(path);
-    strcat(path,"config");
-    return path;
-}
-
-/****************************************************************************
-REMARKS:
-Return a unique identifier for the machine if possible.
-****************************************************************************/
-const char * PMAPI PM_getUniqueID(void)
-{
-    return PM_getMachineName();
-}
-
-/****************************************************************************
-REMARKS:
-Get the name of the machine on the network.
-****************************************************************************/
-const char * PMAPI PM_getMachineName(void)
-{
-    static char name[256];
-
-    if (REG_queryString(szMachineNameKey,szMachineName,name,sizeof(name)))
-       return name;
-    if (REG_queryString(szMachineNameKeyNT,szMachineName,name,sizeof(name)))
-       return name;
-    return "Unknown";
-}
-
-/****************************************************************************
-REMARKS:
-Return a pointer to the real mode BIOS data area.
-****************************************************************************/
-void * PMAPI PM_getBIOSPointer(void)
-{
-    if (_PM_haveWinNT) {
-       /* On Windows NT we have to map it physically directly */
-           return PM_mapPhysicalAddr(0x400, 0x1000, true);
-       }
-    else {
-       /* For Windows 9x we can access this memory directly */
-       return (void*)0x400;
-       }
-}
-
-/****************************************************************************
-REMARKS:
-Return a pointer to 0xA0000 physical VGA graphics framebuffer.
-****************************************************************************/
-void * PMAPI PM_getA0000Pointer(void)
-{
-    if (_PM_haveWinNT) {
-       /* On Windows NT we have to map it physically directly */
-           return PM_mapPhysicalAddr(0xA0000, 0x0FFFF, false);
-       }
-    else {
-       /* Always use the 0xA0000 linear address so that we will use
-        * whatever page table mappings are set up for us (ie: for virtual
-        * bank switching.
-        */
-       return (void*)0xA0000;
-       }
-}
-
-/****************************************************************************
-REMARKS:
-Map a physical address to a linear address in the callers process.
-****************************************************************************/
-void * PMAPI PM_mapPhysicalAddr(
-    ulong base,
-    ulong limit,
-    ibool isCached)
-{
-    DWORD   inBuf[3];   /* Buffer to send data to VxD       */
-    DWORD   outBuf[1];  /* Buffer to receive data from VxD  */
-    DWORD   count;      /* Count of bytes returned from VxD */
-
-    if (!inited)
-       PM_init();
-    inBuf[0] = base;
-    inBuf[1] = limit;
-    inBuf[2] = isCached;
-    CHECK_FOR_PMHELP();
-    if (DeviceIoControl(_PM_hDevice, PMHELP_MAPPHYS32, inBuf, sizeof(inBuf),
-           outBuf, sizeof(outBuf), &count, NULL))
-       return (void*)outBuf[0];
-    return NULL;
-}
-
-/****************************************************************************
-REMARKS:
-Free a physical address mapping allocated by PM_mapPhysicalAddr.
-****************************************************************************/
-void PMAPI PM_freePhysicalAddr(
-    void *ptr,
-    ulong limit)
-{
-    /* We never free the mappings under Win32 (the VxD tracks them and
-     * reissues the same mappings until the system is rebooted).
-     */
-    (void)ptr;
-    (void)limit;
-}
-
-/****************************************************************************
-REMARKS:
-Find the physical address of a linear memory address in current process.
-****************************************************************************/
-ulong PMAPI PM_getPhysicalAddr(
-    void *p)
-{
-    DWORD   inBuf[1];   /* Buffer to send data to VxD       */
-    DWORD   outBuf[1];  /* Buffer to receive data from VxD  */
-    DWORD   count;      /* Count of bytes returned from VxD */
-
-    if (!inited)
-       PM_init();
-    inBuf[0] = (ulong)p;
-    CHECK_FOR_PMHELP();
-    if (DeviceIoControl(_PM_hDevice, PMHELP_GETPHYSICALADDR32, inBuf, sizeof(inBuf),
-           outBuf, sizeof(outBuf), &count, NULL))
-       return outBuf[0];
-    return 0xFFFFFFFFUL;
-}
-
-/****************************************************************************
-REMARKS:
-Find the physical address of a linear memory address in current process.
-****************************************************************************/
-ibool PMAPI PM_getPhysicalAddrRange(
-    void *p,
-    ulong length,
-    ulong *physAddress)
-{
-    DWORD   inBuf[3];   /* Buffer to send data to VxD       */
-    DWORD   outBuf[1];  /* Buffer to receive data from VxD  */
-    DWORD   count;      /* Count of bytes returned from VxD */
-
-    if (!inited)
-       PM_init();
-    inBuf[0] = (ulong)p;
-    inBuf[1] = (ulong)length;
-    inBuf[2] = (ulong)physAddress;
-    CHECK_FOR_PMHELP();
-    if (DeviceIoControl(_PM_hDevice, PMHELP_GETPHYSICALADDRRANGE32, inBuf, sizeof(inBuf),
-           outBuf, sizeof(outBuf), &count, NULL))
-       return outBuf[0];
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-Sleep for the specified number of milliseconds.
-****************************************************************************/
-void PMAPI PM_sleep(
-    ulong milliseconds)
-{
-    Sleep(milliseconds);
-}
-
-/****************************************************************************
-REMARKS:
-Return the base I/O port for the specified COM port.
-****************************************************************************/
-int PMAPI PM_getCOMPort(int port)
-{
-    /* TODO: Re-code this to determine real values using the Plug and Play */
-    /*       manager for the OS. */
-    switch (port) {
-       case 0: return 0x3F8;
-       case 1: return 0x2F8;
-       case 2: return 0x3E8;
-       case 3: return 0x2E8;
-       }
-    return 0;
-}
-
-/****************************************************************************
-REMARKS:
-Return the base I/O port for the specified LPT port.
-****************************************************************************/
-int PMAPI PM_getLPTPort(int port)
-{
-    /* TODO: Re-code this to determine real values using the Plug and Play */
-    /*       manager for the OS. */
-    switch (port) {
-       case 0: return 0x3BC;
-       case 1: return 0x378;
-       case 2: return 0x278;
-       }
-    return 0;
-}
-
-/****************************************************************************
-REMARKS:
-Allocate a block of shared memory. For Win9x we allocate shared memory
-as locked, global memory that is accessible from any memory context
-(including interrupt time context), which allows us to load our important
-data structure and code such that we can access it directly from a ring
-0 interrupt context.
-****************************************************************************/
-void * PMAPI PM_mallocShared(
-    long size)
-{
-    DWORD   inBuf[1];   /* Buffer to send data to VxD       */
-    DWORD   outBuf[1];  /* Buffer to receive data from VxD  */
-    DWORD   count;      /* Count of bytes returned from VxD */
-
-    inBuf[0] = size;
-    CHECK_FOR_PMHELP();
-    if (DeviceIoControl(_PM_hDevice, PMHELP_MALLOCSHARED32, inBuf, sizeof(inBuf),
-           outBuf, sizeof(outBuf), &count, NULL))
-       return (void*)outBuf[0];
-    return NULL;
-}
-
-/****************************************************************************
-REMARKS:
-Free a block of shared memory.
-****************************************************************************/
-void PMAPI PM_freeShared(
-    void *ptr)
-{
-    DWORD   inBuf[1];   /* Buffer to send data to VxD       */
-
-    inBuf[0] = (ulong)ptr;
-    CHECK_FOR_PMHELP();
-    DeviceIoControl(_PM_hDevice, PMHELP_FREESHARED32, inBuf, sizeof(inBuf), NULL, 0, NULL, NULL);
-}
-
-/****************************************************************************
-REMARKS:
-Map a linear memory address to the calling process address space. The
-address will have been allocated in another process using the
-PM_mapPhysicalAddr function.
-****************************************************************************/
-void * PMAPI PM_mapToProcess(
-    void *base,
-    ulong limit)
-{
-    (void)base;
-    (void)limit;
-    return base;
-}
-
-/****************************************************************************
-REMARKS:
-Map a real mode pointer to a protected mode pointer.
-****************************************************************************/
-void * PMAPI PM_mapRealPointer(
-    uint r_seg,
-    uint r_off)
-{
-    return (void*)(MK_PHYS(r_seg,r_off));
-}
-
-/****************************************************************************
-REMARKS:
-Allocate a block of real mode memory
-****************************************************************************/
-void * PMAPI PM_allocRealSeg(
-    uint size,
-    uint *r_seg,
-    uint *r_off)
-{
-    /* We do not support dynamically allocating real mode memory buffers
-     * from Win32 programs (we need a 16-bit DLL for this, and Windows
-     * 9x becomes very unstable if you free the memory blocks out of order).
-     */
-    (void)size;
-    (void)r_seg;
-    (void)r_off;
-    return NULL;
-}
-
-/****************************************************************************
-REMARKS:
-Free a block of real mode memory.
-****************************************************************************/
-void PMAPI PM_freeRealSeg(
-    void *mem)
-{
-    /* Not supported in Windows */
-    (void)mem;
-}
-
-/****************************************************************************
-REMARKS:
-Issue a real mode interrupt (parameters in DPMI compatible structure)
-****************************************************************************/
-void PMAPI DPMI_int86(
-    int intno,
-    DPMI_regs *regs)
-{
-    DWORD   inBuf[2];   /* Buffer to send data to VxD       */
-    DWORD   count;      /* Count of bytes returned from VxD */
-
-    if (!inited)
-       PM_init();
-    inBuf[0] = intno;
-    inBuf[1] = (ulong)regs;
-    CHECK_FOR_PMHELP();
-    DeviceIoControl(_PM_hDevice, PMHELP_DPMIINT8632, inBuf, sizeof(inBuf),
-       NULL, 0, &count, NULL);
-}
-
-/****************************************************************************
-REMARKS:
-Issue a real mode interrupt.
-****************************************************************************/
-int PMAPI PM_int86(
-    int intno,
-    RMREGS *in,
-    RMREGS *out)
-{
-    DWORD   inBuf[3];   /* Buffer to send data to VxD       */
-    DWORD   outBuf[1];  /* Buffer to receive data from VxD  */
-    DWORD   count;      /* Count of bytes returned from VxD */
-
-    if (!inited)
-       PM_init();
-    inBuf[0] = intno;
-    inBuf[1] = (ulong)in;
-    inBuf[2] = (ulong)out;
-    CHECK_FOR_PMHELP();
-    if (DeviceIoControl(_PM_hDevice, PMHELP_INT8632, inBuf, sizeof(inBuf),
-           outBuf, sizeof(outBuf), &count, NULL))
-       return outBuf[0];
-    return 0;
-}
-
-/****************************************************************************
-REMARKS:
-Issue a real mode interrupt.
-****************************************************************************/
-int PMAPI PM_int86x(
-    int intno,
-    RMREGS *in,
-    RMREGS *out,
-    RMSREGS *sregs)
-{
-    DWORD   inBuf[4];   /* Buffer to send data to VxD       */
-    DWORD   outBuf[1];  /* Buffer to receive data from VxD  */
-    DWORD   count;      /* Count of bytes returned from VxD */
-
-    if (!inited)
-       PM_init();
-    inBuf[0] = intno;
-    inBuf[1] = (ulong)in;
-    inBuf[2] = (ulong)out;
-    inBuf[3] = (ulong)sregs;
-    CHECK_FOR_PMHELP();
-    if (DeviceIoControl(_PM_hDevice, PMHELP_INT86X32, inBuf, sizeof(inBuf),
-           outBuf, sizeof(outBuf), &count, NULL))
-       return outBuf[0];
-    return 0;
-}
-
-/****************************************************************************
-REMARKS:
-Call a real mode far function.
-****************************************************************************/
-void PMAPI PM_callRealMode(
-    uint seg,
-    uint off,
-    RMREGS *in,
-    RMSREGS *sregs)
-{
-    DWORD   inBuf[4];   /* Buffer to send data to VxD       */
-    DWORD   count;      /* Count of bytes returned from VxD */
-
-    if (!inited)
-       PM_init();
-    inBuf[0] = seg;
-    inBuf[1] = off;
-    inBuf[2] = (ulong)in;
-    inBuf[3] = (ulong)sregs;
-    CHECK_FOR_PMHELP();
-    DeviceIoControl(_PM_hDevice, PMHELP_CALLREALMODE32, inBuf, sizeof(inBuf),
-       NULL, 0, &count, NULL);
-}
-
-/****************************************************************************
-REMARKS:
-Return the amount of available memory.
-****************************************************************************/
-void PMAPI PM_availableMemory(
-    ulong *physical,
-    ulong *total)
-{
-    /* We don't support this under Win32 at the moment */
-    *physical = *total = 0;
-}
-
-/****************************************************************************
-REMARKS:
-Allocate a block of locked, physical memory for DMA operations.
-****************************************************************************/
-void * PMAPI PM_allocLockedMem(
-    uint size,
-    ulong *physAddr,
-    ibool contiguous,
-    ibool below16M)
-{
-    DWORD   inBuf[4];   /* Buffer to send data to VxD       */
-    DWORD   outBuf[1];  /* Buffer to receive data from VxD  */
-    DWORD   count;      /* Count of bytes returned from VxD */
-
-    if (!inited)
-       PM_init();
-    inBuf[0] = size;
-    inBuf[1] = (ulong)physAddr;
-    inBuf[2] = (ulong)contiguous;
-    inBuf[3] = (ulong)below16M;
-    CHECK_FOR_PMHELP();
-    if (DeviceIoControl(_PM_hDevice, PMHELP_ALLOCLOCKED32, inBuf, sizeof(inBuf),
-           outBuf, sizeof(outBuf), &count, NULL))
-       return (void*)outBuf[0];
-    return NULL;
-}
-
-/****************************************************************************
-REMARKS:
-Free a block of locked physical memory.
-****************************************************************************/
-void PMAPI PM_freeLockedMem(
-    void *p,
-    uint size,
-    ibool contiguous)
-{
-    DWORD   inBuf[3];   /* Buffer to send data to VxD       */
-    DWORD   count;      /* Count of bytes returned from VxD */
-
-    if (!inited)
-       PM_init();
-    inBuf[0] = (ulong)p;
-    inBuf[1] = size;
-    inBuf[2] = contiguous;
-    CHECK_FOR_PMHELP();
-    DeviceIoControl(_PM_hDevice, PMHELP_FREELOCKED32, inBuf, sizeof(inBuf),
-       NULL, 0, &count, NULL);
-}
-
-/****************************************************************************
-REMARKS:
-Allocates a page aligned and page sized block of memory
-****************************************************************************/
-void * PMAPI PM_allocPage(
-    ibool locked)
-{
-    DWORD   inBuf[2];   /* Buffer to send data to VxD       */
-    DWORD   outBuf[1];  /* Buffer to receive data from VxD  */
-    DWORD   count;      /* Count of bytes returned from VxD */
-
-    if (!inited)
-       PM_init();
-    inBuf[0] = locked;
-    CHECK_FOR_PMHELP();
-    if (DeviceIoControl(_PM_hDevice, PMHELP_ALLOCPAGE32, inBuf, sizeof(inBuf),
-           outBuf, sizeof(outBuf), &count, NULL))
-       return (void*)outBuf[0];
-    return NULL;
-}
-
-/****************************************************************************
-REMARKS:
-Free a page aligned and page sized block of memory
-****************************************************************************/
-void PMAPI PM_freePage(
-    void *p)
-{
-    DWORD   inBuf[1];   /* Buffer to send data to VxD       */
-    DWORD   count;      /* Count of bytes returned from VxD */
-
-    if (!inited)
-       PM_init();
-    inBuf[0] = (ulong)p;
-    CHECK_FOR_PMHELP();
-    DeviceIoControl(_PM_hDevice, PMHELP_FREEPAGE32, inBuf, sizeof(inBuf),
-       NULL, 0, &count, NULL);
-}
-
-/****************************************************************************
-REMARKS:
-Lock linear memory so it won't be paged.
-****************************************************************************/
-int PMAPI PM_lockDataPages(void *p,uint len,PM_lockHandle *lh)
-{
-    DWORD   inBuf[2];   /* Buffer to send data to VxD       */
-    DWORD   outBuf[1];  /* Buffer to receive data from VxD  */
-    DWORD   count;      /* Count of bytes returned from VxD */
-
-    inBuf[0] = (ulong)p;
-    inBuf[1] = len;
-    inBuf[2] = (ulong)lh;
-    CHECK_FOR_PMHELP();
-    if (DeviceIoControl(_PM_hDevice, PMHELP_LOCKDATAPAGES32, inBuf, sizeof(inBuf),
-           outBuf, sizeof(outBuf), &count, NULL))
-       return outBuf[0];
-    return 0;
-}
-
-/****************************************************************************
-REMARKS:
-Unlock linear memory so it won't be paged.
-****************************************************************************/
-int PMAPI PM_unlockDataPages(void *p,uint len,PM_lockHandle *lh)
-{
-    DWORD   inBuf[2];   /* Buffer to send data to VxD       */
-    DWORD   outBuf[1];  /* Buffer to receive data from VxD  */
-    DWORD   count;      /* Count of bytes returned from VxD */
-
-    inBuf[0] = (ulong)p;
-    inBuf[1] = len;
-    inBuf[2] = (ulong)lh;
-    CHECK_FOR_PMHELP();
-    if (DeviceIoControl(_PM_hDevice, PMHELP_UNLOCKDATAPAGES32, inBuf, sizeof(inBuf),
-           outBuf, sizeof(outBuf), &count, NULL))
-       return outBuf[0];
-    return 0;
-}
-
-/****************************************************************************
-REMARKS:
-Lock linear memory so it won't be paged.
-****************************************************************************/
-int PMAPI PM_lockCodePages(void (*p)(),uint len,PM_lockHandle *lh)
-{
-    DWORD   inBuf[2];   /* Buffer to send data to VxD       */
-    DWORD   outBuf[1];  /* Buffer to receive data from VxD  */
-    DWORD   count;      /* Count of bytes returned from VxD */
-
-    inBuf[0] = (ulong)p;
-    inBuf[1] = len;
-    inBuf[2] = (ulong)lh;
-    CHECK_FOR_PMHELP();
-    if (DeviceIoControl(_PM_hDevice, PMHELP_LOCKCODEPAGES32, inBuf, sizeof(inBuf),
-           outBuf, sizeof(outBuf), &count, NULL))
-       return outBuf[0];
-    return 0;
-}
-
-/****************************************************************************
-REMARKS:
-Unlock linear memory so it won't be paged.
-****************************************************************************/
-int PMAPI PM_unlockCodePages(void (*p)(),uint len,PM_lockHandle *lh)
-{
-    DWORD   inBuf[2];   /* Buffer to send data to VxD       */
-    DWORD   outBuf[1];  /* Buffer to receive data from VxD  */
-    DWORD   count;      /* Count of bytes returned from VxD */
-
-    inBuf[0] = (ulong)p;
-    inBuf[1] = len;
-    inBuf[2] = (ulong)lh;
-    CHECK_FOR_PMHELP();
-    if (DeviceIoControl(_PM_hDevice, PMHELP_UNLOCKCODEPAGES32, inBuf, sizeof(inBuf),
-           outBuf, sizeof(outBuf), &count, NULL))
-       return outBuf[0];
-    return 0;
-}
-
-/****************************************************************************
-REMARKS:
-Call the VBE/Core software interrupt to change display banks.
-****************************************************************************/
-void PMAPI PM_setBankA(
-    int bank)
-{
-    RMREGS  regs;
-    regs.x.ax = 0x4F05;
-    regs.x.bx = 0x0000;
-    regs.x.dx = bank;
-    PM_int86(0x10,&regs,&regs);
-}
-
-/****************************************************************************
-REMARKS:
-Call the VBE/Core software interrupt to change display banks.
-****************************************************************************/
-void PMAPI PM_setBankAB(
-    int bank)
-{
-    RMREGS  regs;
-    regs.x.ax = 0x4F05;
-    regs.x.bx = 0x0000;
-    regs.x.dx = bank;
-    PM_int86(0x10,&regs,&regs);
-    regs.x.ax = 0x4F05;
-    regs.x.bx = 0x0001;
-    regs.x.dx = bank;
-    PM_int86(0x10,&regs,&regs);
-}
-
-/****************************************************************************
-REMARKS:
-Call the VBE/Core software interrupt to change display start address.
-****************************************************************************/
-void PMAPI PM_setCRTStart(
-    int x,
-    int y,
-    int waitVRT)
-{
-    RMREGS  regs;
-    regs.x.ax = 0x4F07;
-    regs.x.bx = waitVRT;
-    regs.x.cx = x;
-    regs.x.dx = y;
-    PM_int86(0x10,&regs,&regs);
-}
-
-/****************************************************************************
-REMARKS:
-Enable write combining for the memory region.
-****************************************************************************/
-ibool PMAPI PM_enableWriteCombine(
-    ulong base,
-    ulong length,
-    uint type)
-{
-    DWORD   inBuf[3];   /* Buffer to send data to VxD       */
-    DWORD   outBuf[1];  /* Buffer to receive data from VxD  */
-    DWORD   count;      /* Count of bytes returned from VxD */
-
-    if (!inited)
-       PM_init();
-    inBuf[0] = base;
-    inBuf[1] = length;
-    inBuf[2] = type;
-    CHECK_FOR_PMHELP();
-    if (DeviceIoControl(_PM_hDevice, PMHELP_ENABLELFBCOMB32, inBuf, sizeof(inBuf),
-           outBuf, sizeof(outBuf), &count, NULL))
-       return outBuf[0];
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-Get the page directory base register value
-****************************************************************************/
-ulong PMAPI _PM_getPDB(void)
-{
-    DWORD   outBuf[1];  /* Buffer to receive data from VxD  */
-    DWORD   count;      /* Count of bytes returned from VxD */
-
-    CHECK_FOR_PMHELP();
-    if (DeviceIoControl(_PM_hDevice, PMHELP_GETPDB32, NULL, 0,
-           outBuf, sizeof(outBuf), &count, NULL))
-       return outBuf[0];
-    return 0;
-}
-
-/****************************************************************************
-REMARKS:
-Flush the translation lookaside buffer.
-****************************************************************************/
-void PMAPI PM_flushTLB(void)
-{
-    CHECK_FOR_PMHELP();
-    DeviceIoControl(_PM_hDevice, PMHELP_FLUSHTLB32, NULL, 0, NULL, 0, NULL, NULL);
-}
-
-/****************************************************************************
-REMARKS:
-Execute the POST on the secondary BIOS for a controller.
-****************************************************************************/
-ibool PMAPI PM_doBIOSPOST(
-    ushort axVal,
-    ulong BIOSPhysAddr,
-    void *mappedBIOS,
-    ulong BIOSLen)
-{
-    /* This is never done by Win32 programs, but rather done by the VxD
-     * when the system boots.
-     */
-    (void)axVal;
-    (void)BIOSPhysAddr;
-    (void)mappedBIOS;
-    (void)BIOSLen;
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-Load an OS specific shared library or DLL. If the OS does not support
-shared libraries, simply return NULL.
-****************************************************************************/
-PM_MODULE PMAPI PM_loadLibrary(
-    const char *szDLLName)
-{
-    return (PM_MODULE)LoadLibrary(szDLLName);
-}
-
-/****************************************************************************
-REMARKS:
-Get the address of a named procedure from a shared library.
-****************************************************************************/
-void * PMAPI PM_getProcAddress(
-    PM_MODULE hModule,
-    const char *szProcName)
-{
-    return (void*)GetProcAddress((HINSTANCE)hModule,szProcName);
-}
-
-/****************************************************************************
-REMARKS:
-Unload a shared library.
-****************************************************************************/
-void PMAPI PM_freeLibrary(
-    PM_MODULE hModule)
-{
-    FreeLibrary((HINSTANCE)hModule);
-}
-
-/****************************************************************************
-REMARKS:
-Internal function to convert the find data to the generic interface.
-****************************************************************************/
-static void convertFindData(
-    PM_findData *findData,
-    WIN32_FIND_DATA *blk)
-{
-    ulong   dwSize = findData->dwSize;
-
-    memset(findData,0,findData->dwSize);
-    findData->dwSize = dwSize;
-    if (blk->dwFileAttributes & FILE_ATTRIBUTE_READONLY)
-       findData->attrib |= PM_FILE_READONLY;
-    if (blk->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
-       findData->attrib |= PM_FILE_DIRECTORY;
-    if (blk->dwFileAttributes & FILE_ATTRIBUTE_ARCHIVE)
-       findData->attrib |= PM_FILE_ARCHIVE;
-    if (blk->dwFileAttributes & FILE_ATTRIBUTE_HIDDEN)
-       findData->attrib |= PM_FILE_HIDDEN;
-    if (blk->dwFileAttributes & FILE_ATTRIBUTE_SYSTEM)
-       findData->attrib |= PM_FILE_SYSTEM;
-    findData->sizeLo = blk->nFileSizeLow;
-    findData->sizeHi = blk->nFileSizeHigh;
-    strncpy(findData->name,blk->cFileName,PM_MAX_PATH);
-    findData->name[PM_MAX_PATH-1] = 0;
-}
-
-/****************************************************************************
-REMARKS:
-Function to find the first file matching a search criteria in a directory.
-****************************************************************************/
-void *PMAPI PM_findFirstFile(
-    const char *filename,
-    PM_findData *findData)
-{
-    WIN32_FIND_DATA blk;
-    HANDLE          hfile;
-
-    if ((hfile = FindFirstFile(filename,&blk)) != INVALID_HANDLE_VALUE) {
-       convertFindData(findData,&blk);
-       return (void*)hfile;
-       }
-    return PM_FILE_INVALID;
-}
-
-/****************************************************************************
-REMARKS:
-Function to find the next file matching a search criteria in a directory.
-****************************************************************************/
-ibool PMAPI PM_findNextFile(
-    void *handle,
-    PM_findData *findData)
-{
-    WIN32_FIND_DATA blk;
-
-    if (FindNextFile((HANDLE)handle,&blk)) {
-       convertFindData(findData,&blk);
-       return true;
-       }
-    return false;
-}
-
-/****************************************************************************
-REMARKS:
-Function to close the find process
-****************************************************************************/
-void PMAPI PM_findClose(
-    void *handle)
-{
-    FindClose((HANDLE)handle);
-}
-
-/****************************************************************************
-REMARKS:
-Function to determine if a drive is a valid drive or not. Under Unix this
-function will return false for anything except a value of 3 (considered
-the root drive, and equivalent to C: for non-Unix systems). The drive
-numbering is:
-
-    1   - Drive A:
-    2   - Drive B:
-    3   - Drive C:
-    etc
-
-****************************************************************************/
-ibool PMAPI PM_driveValid(
-    char drive)
-{
-    char    buf[5];
-    int     type;
-
-    sprintf(buf,"%c:\\", drive);
-    return ((type = GetDriveType(buf)) != 0 && type != 1);
-}
-
-/****************************************************************************
-REMARKS:
-Function to get the current working directory for the specififed drive.
-Under Unix this will always return the current working directory regardless
-of what the value of 'drive' is.
-****************************************************************************/
-void PMAPI PM_getdcwd(
-    int drive,
-    char *dir,
-    int len)
-{
-    /* NT stores the current directory for drive N in the magic environment */
-    /* variable =N: so we simply look for that environment variable. */
-    char envname[4];
-
-    envname[0] = '=';
-    envname[1] = drive - 1 + 'A';
-    envname[2] = ':';
-    envname[3] = '\0';
-    if (GetEnvironmentVariable(envname,dir,len) == 0) {
-       /* The current directory or the drive has not been set yet, so */
-       /* simply set it to the root. */
-       dir[0] = envname[1];
-       dir[1] = ':';
-       dir[2] = '\\';
-       dir[3] = '\0';
-       SetEnvironmentVariable(envname,dir);
-       }
-}
-
-/****************************************************************************
-REMARKS:
-Function to change the file attributes for a specific file.
-****************************************************************************/
-void PMAPI PM_setFileAttr(
-    const char *filename,
-    uint attrib)
-{
-    DWORD attr = 0;
-
-    if (attrib & PM_FILE_READONLY)
-       attr |= FILE_ATTRIBUTE_READONLY;
-    if (attrib & PM_FILE_ARCHIVE)
-       attr |= FILE_ATTRIBUTE_ARCHIVE;
-    if (attrib & PM_FILE_HIDDEN)
-       attr |= FILE_ATTRIBUTE_HIDDEN;
-    if (attrib & PM_FILE_SYSTEM)
-       attr |= FILE_ATTRIBUTE_SYSTEM;
-    SetFileAttributes((LPSTR)filename, attr);
-}
-
-/****************************************************************************
-REMARKS:
-Function to get the file attributes for a specific file.
-****************************************************************************/
-uint PMAPI PM_getFileAttr(
-    const char *filename)
-{
-    DWORD   attr = GetFileAttributes(filename);
-    uint    attrib = 0;
-
-    if (attr & FILE_ATTRIBUTE_READONLY)
-       attrib |= PM_FILE_READONLY;
-    if (attr & FILE_ATTRIBUTE_ARCHIVE)
-       attrib |= PM_FILE_ARCHIVE;
-    if (attr & FILE_ATTRIBUTE_HIDDEN)
-       attrib |= PM_FILE_HIDDEN;
-    if (attr & FILE_ATTRIBUTE_SYSTEM)
-       attrib |= PM_FILE_SYSTEM;
-    return attrib;
-}
-
-/****************************************************************************
-REMARKS:
-Function to create a directory.
-****************************************************************************/
-ibool PMAPI PM_mkdir(
-    const char *filename)
-{
-    return CreateDirectory(filename,NULL);
-}
-
-/****************************************************************************
-REMARKS:
-Function to remove a directory.
-****************************************************************************/
-ibool PMAPI PM_rmdir(
-    const char *filename)
-{
-    return RemoveDirectory(filename);
-}
-
-/****************************************************************************
-REMARKS:
-Function to get the file time and date for a specific file.
-****************************************************************************/
-ibool PMAPI PM_getFileTime(
-    const char *filename,
-    ibool gmTime,
-    PM_time *time)
-{
-    HFILE       f;
-    OFSTRUCT    of;
-    FILETIME    utcTime,localTime;
-    SYSTEMTIME  sysTime;
-    ibool       status = false;
-
-    of.cBytes = sizeof(of);
-    if ((f = OpenFile(filename,&of,OF_READ)) == HFILE_ERROR)
-       return false;
-    if (!GetFileTime((HANDLE)f,NULL,NULL,&utcTime))
-       goto Exit;
-    if (!gmTime) {
-       if (!FileTimeToLocalFileTime(&utcTime,&localTime))
-           goto Exit;
-       }
-    else
-       localTime = utcTime;
-    if (!FileTimeToSystemTime(&localTime,&sysTime))
-       goto Exit;
-    time->year = sysTime.wYear;
-    time->mon = sysTime.wMonth-1;
-    time->day = sysTime.wYear;
-    time->hour = sysTime.wHour;
-    time->min = sysTime.wMinute;
-    time->sec = sysTime.wSecond;
-    status = true;
-
-Exit:
-    CloseHandle((HANDLE)f);
-    return status;
-}
-
-/****************************************************************************
-REMARKS:
-Function to set the file time and date for a specific file.
-****************************************************************************/
-ibool PMAPI PM_setFileTime(
-    const char *filename,
-    ibool gmTime,
-    PM_time *time)
-{
-    HFILE       f;
-    OFSTRUCT    of;
-    FILETIME    utcTime,localTime;
-    SYSTEMTIME  sysTime;
-    ibool       status = false;
-
-    of.cBytes = sizeof(of);
-    if ((f = OpenFile(filename,&of,OF_WRITE)) == HFILE_ERROR)
-       return false;
-    sysTime.wYear = time->year;
-    sysTime.wMonth = time->mon+1;
-    sysTime.wYear = time->day;
-    sysTime.wHour = time->hour;
-    sysTime.wMinute = time->min;
-    sysTime.wSecond = time->sec;
-    if (!SystemTimeToFileTime(&sysTime,&localTime))
-       goto Exit;
-    if (!gmTime) {
-       if (!LocalFileTimeToFileTime(&localTime,&utcTime))
-           goto Exit;
-       }
-    else
-       utcTime = localTime;
-    if (!SetFileTime((HANDLE)f,NULL,NULL,&utcTime))
-       goto Exit;
-    status = true;
-
-Exit:
-    CloseHandle((HANDLE)f);
-    return status;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/win32/vflat.c b/board/MAI/bios_emulator/scitech/src/pm/win32/vflat.c
deleted file mode 100644 (file)
index 70491cd..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Any
-*
-* Description:  Dummy module; no virtual framebuffer for this OS
-*
-****************************************************************************/
-
-#include "pmapi.h"
-
-ibool PMAPI VF_available(void)
-{
-    return false;
-}
-
-void * PMAPI VF_init(
-    ulong baseAddr,
-    int bankSize,
-    int codeLen,
-    void *bankFunc)
-{
-    (void)baseAddr;
-    (void)bankSize;
-    (void)codeLen;
-    (void)bankFunc;
-    return NULL;
-}
-
-void PMAPI VF_exit(void)
-{
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/win32/ztimer.c b/board/MAI/bios_emulator/scitech/src/pm/win32/ztimer.c
deleted file mode 100644 (file)
index 5a901a4..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-/****************************************************************************
-*
-*                         Ultra Long Period Timer
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Win32
-*
-* Description:  OS specific implementation for the Zen Timer functions.
-*
-****************************************************************************/
-
-/*---------------------------- Global variables ---------------------------*/
-
-static CPU_largeInteger countFreq;
-static ibool            havePerformanceCounter;
-static ulong            start,finish;
-
-/*----------------------------- Implementation ----------------------------*/
-
-/****************************************************************************
-REMARKS:
-Initialise the Zen Timer module internals.
-****************************************************************************/
-void __ZTimerInit(void)
-{
-#ifdef  NO_ASSEMBLER
-    havePerformanceCounter = false;
-#else
-    havePerformanceCounter = QueryPerformanceFrequency((LARGE_INTEGER*)&countFreq);
-#endif
-}
-
-/****************************************************************************
-REMARKS:
-Start the Zen Timer counting.
-****************************************************************************/
-static void __LZTimerOn(
-    LZTimerObject *tm)
-{
-    if (havePerformanceCounter)
-       QueryPerformanceCounter((LARGE_INTEGER*)&tm->start);
-    else
-       tm->start.low = timeGetTime();
-}
-
-/****************************************************************************
-REMARKS:
-Compute the lap time since the timer was started.
-****************************************************************************/
-static ulong __LZTimerLap(
-    LZTimerObject *tm)
-{
-    CPU_largeInteger    tmLap,tmCount;
-
-    if (havePerformanceCounter) {
-       QueryPerformanceCounter((LARGE_INTEGER*)&tmLap);
-       _CPU_diffTime64(&tm->start,&tmLap,&tmCount);
-       return _CPU_calcMicroSec(&tmCount,countFreq.low);
-       }
-    else {
-       tmLap.low = timeGetTime();
-       return (tmLap.low - tm->start.low) * 1000L;
-       }
-}
-
-/****************************************************************************
-REMARKS:
-Stop the Zen Timer counting.
-****************************************************************************/
-static void __LZTimerOff(
-    LZTimerObject *tm)
-{
-    if (havePerformanceCounter)
-       QueryPerformanceCounter((LARGE_INTEGER*)&tm->end);
-    else
-       tm->end.low = timeGetTime();
-}
-
-/****************************************************************************
-REMARKS:
-Compute the elapsed time in microseconds between start and end timings.
-****************************************************************************/
-static ulong __LZTimerCount(
-    LZTimerObject *tm)
-{
-    CPU_largeInteger    tmCount;
-
-    if (havePerformanceCounter) {
-       _CPU_diffTime64(&tm->start,&tm->end,&tmCount);
-       return _CPU_calcMicroSec(&tmCount,countFreq.low);
-       }
-    else
-       return (tm->end.low - tm->start.low) * 1000L;
-}
-
-/****************************************************************************
-REMARKS:
-Define the resolution of the long period timer as microseconds per timer tick.
-****************************************************************************/
-#define ULZTIMER_RESOLUTION     1000
-
-/****************************************************************************
-REMARKS:
-Read the Long Period timer from the OS
-****************************************************************************/
-static ulong __ULZReadTime(void)
-{ return timeGetTime(); }
-
-/****************************************************************************
-REMARKS:
-Compute the elapsed time from the BIOS timer tick. Note that we check to see
-whether a midnight boundary has passed, and if so adjust the finish time to
-account for this. We cannot detect if more that one midnight boundary has
-passed, so if this happens we will be generating erronous results.
-****************************************************************************/
-ulong __ULZElapsedTime(ulong start,ulong finish)
-{ return finish - start; }
diff --git a/board/MAI/bios_emulator/scitech/src/pm/x11/event.c b/board/MAI/bios_emulator/scitech/src/pm/x11/event.c
deleted file mode 100644 (file)
index b34bfac..0000000
+++ /dev/null
@@ -1,307 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Unix / X11
-*
-* Description:  X11 event queue implementation for the MGL.
-*               This can be used both for windowed and fullscreen (DGA) modes.
-*
-****************************************************************************/
-
-/*---------------------------- Global Variables ---------------------------*/
-
-static ushort       keyUpMsg[256] = {0};/* Table of key up messages     */
-static int          rangeX,rangeY;      /* Range of mouse coordinates   */
-
-static Display  *_EVT_dpy;
-static Window    _EVT_win;
-
-typedef struct {
-  int keycode;
-  int scancode;
-} xkeymap;
-
-xkeymap xkeymaps[] = {
-  { 9, KB_esc},
-  {24, KB_Q},
-  {25, KB_W},
-  {26, KB_E},
-  {27, KB_R},
-  {28, KB_T},
-  {29, KB_Y},
-  {30, KB_U},
-  {31, KB_I},
-  {32, KB_O},
-  {33, KB_P},
-};
-
-/*---------------------------- Implementation -----------------------------*/
-
-/* These are not used under non-DOS systems */
-#define _EVT_disableInt()       1
-#define _EVT_restoreInt(flags)
-
-/****************************************************************************
-PARAMETERS:
-scanCode    - Scan code to test
-
-REMARKS:
-This macro determines if a specified key is currently down at the
-time that the call is made.
-****************************************************************************/
-#define _EVT_isKeyDown(scanCode)    (keyUpMsg[scanCode] != 0)
-
-/****************************************************************************
-REMARKS:
-This function is used to return the number of ticks since system
-startup in milliseconds. This should be the same value that is placed into
-the time stamp fields of events, and is used to implement auto mouse down
-events.
-****************************************************************************/
-ulong _EVT_getTicks(void)
-{
-  static unsigned starttime = 0;
-  struct timeval t;
-
-  gettimeofday(&t, NULL);
-  if (starttime == 0)
-    starttime = t.tv_sec * 1000 + (t.tv_usec/1000);
-  return ((t.tv_sec * 1000 + (t.tv_usec/1000)) - starttime);
-}
-
-static int getScancode(int keycode)
-{
-  return keycode-8;
-}
-
-/****************************************************************************
-REMARKS:
-Pumps all messages in the application message queue into our event queue.
-****************************************************************************/
-#ifdef X11_CORE
-static void _EVT_pumpX11Messages(void)
-#else
-static void _EVT_pumpMessages(void)
-#endif
-{
-  /* TODO: The purpose of this function is to read all keyboard and mouse */
-  /*         events from the OS specific event queue, translate them and post */
-  /*         them into the SciTech event queue. */
-  event_t evt;
-  XEvent  ev;
-  static int old_mx = 0, old_my = 0, buts = 0, c;
-  char buf[2];
-
-  while (XPending(_EVT_dpy) && XNextEvent(_EVT_dpy,&ev)) {
-    evt.when = _MGL_getTicks();
-
-    switch(ev.type){
-    case KeyPress:
-      c = getScancode(ev.xkey.keycode);
-      evt.what = EVT_KEYDOWN;
-      evt.message = c << 8;
-      XLookupString(&ev.xkey, buf, 2, NULL, NULL);
-      evt.message |= buf[0];
-      break;
-    case KeyRelease:
-      c = getScancode(ev.xkey.keycode);
-      evt.what = EVT_KEYUP;
-      evt.message = keyUpMsg[c];
-      if(count < EVENTQSIZE)
-       addEvent(&evt);
-      keyUpMsg[c] = 0;
-      repeatKey[c] = 0;
-      break;
-    case ButtonPress:
-      evt.what = EVT_MOUSEDOWN;
-      if(ev.xbutton.button == 1){
-       buts |= EVT_LEFTBUT;
-       evt.message = EVT_LEFTBMASK;
-      }else if(ev.xbutton.button == 2){
-       buts |= EVT_MIDDLEBUT;
-       evt.message = EVT_MIDDLEBMASK;
-      }else if(ev.xbutton.button == 3){
-       buts |= EVT_RIGHTBUT;
-       evt.message = EVT_RIGHTBMASK;
-      }
-      evt.modifiers = modifiers | buts;
-
-      break;
-    case ButtonRelease:
-      evt.what = EVT_MOUSEUP;
-      if(ev.xbutton.button == 1){
-       buts &= ~EVT_LEFTBUT;
-       evt.message = EVT_LEFTBMASK;
-      }else if(ev.xbutton.button == 2){
-       buts &= ~EVT_MIDDLEBUT;
-       evt.message = EVT_MIDDLEBMASK;
-      }else if(ev.xbutton.button == 3){
-       buts &= ~EVT_RIGHTBUT;
-       evt.message = EVT_RIGHTBMASK;
-      }
-      evt.modifiers = modifiers | buts;
-
-      break;
-    case MotionNotify:
-      evt.what = EVT_MOUSEMOVE;
-      evt.where_x = ev.xmotion.x;
-      evt.where_y = ev.xmotion.y;
-      evt.relative_x = evt.where_x - old_mx;
-      evt.relative_y = evt.where_y - old_my;
-      old_mx = evt.where_x;
-      old_my = evt.where_y;
-      break;
-    }
-    if (count < EVENTQSIZE)
-      addEvent(&evt);
-  }
-
-}
-
-/****************************************************************************
-REMARKS:
-This macro/function is used to converts the scan codes reported by the
-keyboard to our event libraries normalised format. We only have one scan
-code for the 'A' key, and use shift modifiers to determine if it is a
-Ctrl-F1, Alt-F1 etc. The raw scan codes from the keyboard work this way,
-but the OS gives us 'cooked' scan codes, we have to translate them back
-to the raw format.
-****************************************************************************/
-#define _EVT_maskKeyCode(evt)
-
-/****************************************************************************
-REMARKS:
-Safely abort the event module upon catching a fatal error.
-****************************************************************************/
-void _EVT_abort()
-{
-    EVT_exit();
-    PM_fatalError("Unhandled exception!");
-}
-
-/****************************************************************************
-PARAMETERS:
-mouseMove   - Callback function to call wheneve the mouse needs to be moved
-
-REMARKS:
-Initiliase the event handling module. Here we install our mouse handling ISR
-to be called whenever any button's are pressed or released. We also build
-the free list of events in the event queue.
-
-We use handler number 2 of the mouse libraries interrupt handlers for our
-event handling routines.
-****************************************************************************/
-#ifdef X11_CORE
-void EVTAPI EVT_initX11(
-#else
-void EVTAPI EVT_init(
-#endif
-    _EVT_mouseMoveHandler mouseMove)
-{
-  int result, i,j,k;
-  XDeviceInfoPtr    list,slist;
-
-  /* Initialise the event queue */
-  _mouseMove = mouseMove;
-  initEventQueue();
-  memset(keyUpMsg,0,sizeof(keyUpMsg));
-
-
-  /* query server for input extensions */
-  result =XQueryExtension(_EVT_dpy,"XInputExtension",&i,&j,&k);
-  if(!result) {
-    fprintf(stderr,"Your server doesn't support XInput Extensions\n");
-    fprintf(stderr,"X11 Joystick disabled\n");
-  }
-  list = XListInputDevices(_EVT_dpy,&result);
-  if (!list) {
-    fprintf(stderr,"No extended input devices found !!\n");
-    fprintf(stderr,"X11 Joystick disabled\n");
-  }
-
-
-  /* Catch program termination signals so we can clean up properly */
-  signal(SIGABRT, _EVT_abort);
-  signal(SIGFPE, _EVT_abort);
-  signal(SIGINT, _EVT_abort);
-}
-
-/****************************************************************************
-REMARKS
-Changes the range of coordinates returned by the mouse functions to the
-specified range of values. This is used when changing between graphics
-modes set the range of mouse coordinates for the new display mode.
-****************************************************************************/
-void EVTAPI EVT_setMouseRange(
-    int xRes,
-    int yRes)
-{
-    rangeX = xRes;
-    rangeY = yRes;
-}
-
-/****************************************************************************
-REMARKS:
-Initiailises the internal event handling modules. The EVT_suspend function
-can be called to suspend event handling (such as when shelling out to DOS),
-and this function can be used to resume it again later.
-****************************************************************************/
-void EVT_resume(void)
-{
-    /* Do nothing for non DOS systems */
-}
-
-/****************************************************************************
-REMARKS
-Suspends all of our event handling operations. This is also used to
-de-install the event handling code.
-****************************************************************************/
-void EVT_suspend(void)
-{
-    /* Do nothing for non DOS systems */
-}
-
-/****************************************************************************
-REMARKS
-Exits the event module for program terminatation.
-****************************************************************************/
-void EVT_exit(void)
-{
-    /* Restore signal handlers */
-    signal(SIGABRT, SIG_DFL);
-    signal(SIGFPE, SIG_DFL);
-    signal(SIGINT, SIG_DFL);
-
-    /* TODO: Do any OS specific cleanup in here */
-}
-
-/****************************************************************************
-REMARKS
-Sets the current X11 display
-****************************************************************************/
-void EVT_setX11Display(Display *dpy, Window win)
-{
-  _EVT_dpy = dpy;
-  _EVT_win = win;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/pm/x11/oshdr.h b/board/MAI/bios_emulator/scitech/src/pm/x11/oshdr.h
deleted file mode 100644 (file)
index 45d7451..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  BeOS
-*
-* Description:  Include file to include all OS specific header files.
-*
-****************************************************************************/
-
-#include <X11/Xlib.h>
-#include <X11/keysym.h>
-#include <time.h>
-#include <signal.h>
-#ifdef USE_OS_JOYSTICK
-#include <X11/extensions/XI.h>
-#include <X11/extensions/XInput.h>
-#endif
diff --git a/board/MAI/bios_emulator/scitech/src/pm/z_samples.vpj b/board/MAI/bios_emulator/scitech/src/pm/z_samples.vpj
deleted file mode 100644 (file)
index 0c6c80f..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-[SciTech]\r
-compiler=wc10- \r
-targetos=d32 \r
-[COMPILER]\r
-version=5.0b\r
-MACRO=enable_current_compiler\n\r
-activeconfig=,getch.exe\r
-FILTERNAME=Source Files\n\r
-FILTERPATTERN=*.c;*.cpp;*.cxx;*.prg;*.pas;*.dpr;*.bas;*.java;*.sc;*.e;*.cob;*.html;*.rc\n\r
-FILTERASSOCIATEFILETYPES=0 \r
-FILTERAPPCOMMAND=\n\r
-vcsproject=SCC:Perforce SCM://depot\r
-vcslocalpath=SCC:Perforce SCM:c:\\r
-compile=concur|capture|:Compile:&Compile,dmake %n.obj\r
-make=concur|capture|clear|saveall|:Build:&Build,dmake %b\r
-rebuild=concur|capture|clear|saveall|:Rebuild:&Rebuild,dmake -u %b\r
-debug=concur|capture|savenone|nochangedir|:Debug:&Debug,wdn %b\r
-execute=hide|savenone|nochangedir|:Execute:E&xecute,\r
-user1=hide|nochangedir|:User 1:User 1,\r
-user2=hide|nochangedir|:User 2:User 2,\r
-usertool_build_all=concur|capture|clear|savenone|:Build All:Build All,dmake all\r
-usertool_rebuild_all=concur|capture|clear|savenone|:Rebuild All:Rebuild All,dmake -u all\r
-usertool_clean_directory=concur|capture|savenone|:Clean Directory:&Clean Directory,dmake cleanexe\r
-workingdir=.\r
-includedirs=%(SCITECH)\include;%(PRIVATE)\include\r
-reffile=\r
-[FILES]\r
-tests\altbrk.c\r
-tests\altcrit.c\r
-tests\biosptr.c\r
-tests\block.c\r
-tests\brk.c\r
-tests\callreal.c\r
-tests\checks.c\r
-tests\cpu.c\r
-tests\critical.c\r
-tests\getch.c\r
-tests\isvesa.c\r
-tests\key.c\r
-tests\key15.c\r
-tests\memtest.c\r
-tests\mouse.c\r
-tests\rtc.c\r
-tests\showpci.c\r
-tests\tick.c\r
-tests\timerc.c\r
-tests\timercpp.cpp\r
-tests\uswc.c\r
-tests\vftest.c\r
-tests\video.c\r
-[ASSOCIATION]\r
-[CONFIGURATIONS]\r
-config=,altbrk.exe\r
-config=,altcrit.exe\r
-config=,biosptr.exe\r
-config=,block.exe\r
-config=,brk.exe\r
-config=,callreal.exe\r
-config=,cpu.exe\r
-config=,critical.exe\r
-config=,getch.exe\r
-config=,isvesa.exe\r
-config=,key.exe\r
-config=,key15.exe\r
-config=,memtest.exe\r
-config=,mouse.exe\r
-config=,rtc.exe\r
-config=,showpci.exe\r
-config=,tick.exe\r
-config=,timerc.exe\r
-config=,timercpp.exe\r
-config=,uswc.exe\r
-config=,vftest.exe\r
-config=,video.exe\r
diff --git a/board/MAI/bios_emulator/scitech/src/pm/ztimer.c b/board/MAI/bios_emulator/scitech/src/pm/ztimer.c
deleted file mode 100644 (file)
index 5acf7b1..0000000
+++ /dev/null
@@ -1,516 +0,0 @@
-/****************************************************************************
-*
-*                   SciTech OS Portability Manager Library
-*
-*  ========================================================================
-*
-*    The contents of this file are subject to the SciTech MGL Public
-*    License Version 1.0 (the "License"); you may not use this file
-*    except in compliance with the License. You may obtain a copy of
-*    the License at http://www.scitechsoft.com/mgl-license.txt
-*
-*    Software distributed under the License is distributed on an
-*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*    implied. See the License for the specific language governing
-*    rights and limitations under the License.
-*
-*    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
-*
-*    The Initial Developer of the Original Code is SciTech Software, Inc.
-*    All Rights Reserved.
-*
-*  ========================================================================
-*
-* Language:     ANSI C
-* Environment:  Any
-*
-* Description:  Module to implement high precision timing on each OS.
-*
-****************************************************************************/
-
-#include "ztimer.h"
-#include "pmapi.h"
-#include "oshdr.h"
-
-/*---------------------------- Global variables ---------------------------*/
-
-static LZTimerObject    LZTimer;
-static ulong            start,finish;
-#ifdef  __INTEL__
-static long             cpuSpeed = -1;
-static ibool            haveRDTSC = false;
-#endif
-
-/*----------------------------- Implementation ----------------------------*/
-
-/* External Intel assembler functions */
-#ifdef  __INTEL__
-/* {secret} */
-void  _ASMAPI _CPU_readTimeStamp(CPU_largeInteger *time);
-/* {secret} */
-ulong _ASMAPI _CPU_diffTime64(CPU_largeInteger *t1,CPU_largeInteger *t2,CPU_largeInteger *t);
-/* {secret} */
-ulong _ASMAPI _CPU_calcMicroSec(CPU_largeInteger *count,ulong freq);
-#endif
-
-#if     defined(__SMX32__)
-#include "smx/ztimer.c"
-#elif   defined(__RTTARGET__)
-#include "rttarget/ztimer.c"
-#elif   defined(__REALDOS__)
-#include "dos/ztimer.c"
-#elif   defined(__NT_DRIVER__)
-#include "ntdrv/ztimer.c"
-#elif   defined(__WIN32_VXD__)
-#include "vxd/ztimer.c"
-#elif   defined(__WINDOWS32__)
-#include "win32/ztimer.c"
-#elif   defined(__OS2_VDD__)
-#include "vdd/ztimer.c"
-#elif   defined(__OS2__)
-#include "os2/ztimer.c"
-#elif   defined(__LINUX__)
-#include "linux/ztimer.c"
-#elif   defined(__QNX__)
-#include "qnx/ztimer.c"
-#elif   defined(__BEOS__)
-#include "beos/ztimer.c"
-#else
-#error  Timer library not ported to this platform yet!
-#endif
-
-/*------------------------ Public interface routines ----------------------*/
-
-/****************************************************************************
-DESCRIPTION:
-Initializes the Zen Timer library (extended)
-
-PARAMETERS:
-accurate    - True of the speed should be measured accurately
-
-HEADER:
-ztimer.h
-
-REMARKS:
-This function initializes the Zen Timer library, and /must/ be called before
-any of the remaining Zen Timer library functions are called. The accurate
-parameter is used to determine whether highly accurate timing should be
-used or not. If high accuracy is needed, more time is spent profiling the
-actual speed of the CPU so that we can obtain highly accurate timing
-results, but the time spent in the initialisation routine will be
-significantly longer (on the order of 5 seconds).
-****************************************************************************/
-void ZAPI ZTimerInitExt(
-    ibool accurate)
-{
-    if (cpuSpeed == -1) {
-       __ZTimerInit();
-#ifdef  __INTEL__
-       cpuSpeed = CPU_getProcessorSpeedInHZ(accurate);
-       haveRDTSC = CPU_haveRDTSC() && (cpuSpeed > 0);
-#endif
-       }
-}
-
-/****************************************************************************
-DESCRIPTION:
-Initializes the Zen Timer library.
-
-HEADER:
-ztimer.h
-
-REMARKS:
-This function initializes the Zen Timer library, and /must/ be called before
-any of the remaining Zen Timer library functions are called.
-****************************************************************************/
-void ZAPI ZTimerInit(void)
-{
-    ZTimerInitExt(false);
-}
-
-/****************************************************************************
-DESCRIPTION:
-Starts the Long Period Zen Timer counting.
-
-HEADER:
-ztimer.h
-
-PARAMETERS:
-tm  - Timer object to start timing with
-
-REMARKS:
-Starts the Long Period Zen Timer counting. Once you have started the timer,
-you can stop it with LZTimerOff or you can latch the current count with
-LZTimerLap.
-
-The Long Period Zen Timer uses a number of different high precision timing
-mechanisms to obtain microsecond accurate timings results whenever possible.
-The following different techniques are used depending on the operating
-system, runtime environment and CPU on the target machine. If the target
-system has a Pentium CPU installed which supports the Read Time Stamp
-Counter instruction (RDTSC), the Zen Timer library will use this to
-obtain the maximum timing precision available.
-
-Under 32-bit Windows, if the Pentium RDTSC instruction is not available, we
-first try to use the Win32 QueryPerformanceCounter API, and if that is not
-available we fall back on the timeGetTime API which is always supported.
-
-Under 32-bit DOS, if the Pentium RDTSC instruction is not available, we
-then do all timing using the old style 8253 timer chip. The 8253 timer
-routines provide highly accurate timings results in pure DOS mode, however
-in a DOS box under Windows or other Operating Systems the virtualization
-of the timer can produce inaccurate results.
-
-Note: Because the Long Period Zen Timer stores the results in a 32-bit
-      unsigned integer, you can only time periods of up to 2^32 microseconds,
-      or about 1hr 20mins. For timing longer periods use the Ultra Long
-      Period Zen Timer.
-
-SEE ALSO:
-LZTimerOff, LZTimerLap, LZTimerCount
-****************************************************************************/
-void ZAPI LZTimerOnExt(
-    LZTimerObject *tm)
-{
-#ifdef  __INTEL__
-    if (haveRDTSC) {
-       _CPU_readTimeStamp(&tm->start);
-       }
-    else
-#endif
-       __LZTimerOn(tm);
-}
-
-/****************************************************************************
-DESCRIPTION:
-Returns the current count for the Long Period Zen Timer and keeps it
-running.
-
-HEADER:
-ztimer.h
-
-PARAMETERS:
-tm  - Timer object to do lap timing with
-
-RETURNS:
-Count that has elapsed in microseconds.
-
-REMARKS:
-Returns the current count that has elapsed since the last call to
-LZTimerOn in microseconds. The time continues to run after this function is
-called so you can call this function repeatedly.
-
-SEE ALSO:
-LZTimerOn, LZTimerOff, LZTimerCount
-****************************************************************************/
-ulong ZAPI LZTimerLapExt(
-    LZTimerObject *tm)
-{
-#ifdef  __INTEL__
-    CPU_largeInteger    tmLap,tmCount;
-
-    if (haveRDTSC) {
-       _CPU_readTimeStamp(&tmLap);
-       _CPU_diffTime64(&tm->start,&tmLap,&tmCount);
-       return _CPU_calcMicroSec(&tmCount,cpuSpeed);
-       }
-    else
-#endif
-       return __LZTimerLap(tm);
-}
-
-/****************************************************************************
-DESCRIPTION:
-Stops the Long Period Zen Timer counting.
-
-HEADER:
-ztimer.h
-
-PARAMETERS:
-tm  - Timer object to stop timing with
-
-REMARKS:
-Stops the Long Period Zen Timer counting and latches the count. Once you
-have stopped the timer you can read the count with LZTimerCount. If you need
-highly accurate timing, you should use the on and off functions rather than
-the lap function since the lap function does not subtract the overhead of
-the function calls from the timed count.
-
-SEE ALSO:
-LZTimerOn, LZTimerLap, LZTimerCount
-****************************************************************************/
-void ZAPI LZTimerOffExt(
-    LZTimerObject *tm)
-{
-#ifdef  __INTEL__
-    if (haveRDTSC) {
-       _CPU_readTimeStamp(&tm->end);
-       }
-    else
-#endif
-       __LZTimerOff(tm);
-}
-
-/****************************************************************************
-DESCRIPTION:
-Returns the current count for the Long Period Zen Timer.
-
-HEADER:
-ztimer.h
-
-PARAMETERS:
-tm  - Timer object to compute the elapsed time with.
-
-RETURNS:
-Count that has elapsed in microseconds.
-
-REMARKS:
-Returns the current count that has elapsed between calls to
-LZTimerOn and LZTimerOff in microseconds.
-
-SEE ALSO:
-LZTimerOn, LZTimerOff, LZTimerLap
-****************************************************************************/
-ulong ZAPI LZTimerCountExt(
-    LZTimerObject *tm)
-{
-#ifdef  __INTEL__
-    CPU_largeInteger    tmCount;
-
-    if (haveRDTSC) {
-       _CPU_diffTime64(&tm->start,&tm->end,&tmCount);
-       return _CPU_calcMicroSec(&tmCount,cpuSpeed);
-       }
-    else
-#endif
-       return __LZTimerCount(tm);
-}
-
-/****************************************************************************
-DESCRIPTION:
-Starts the Long Period Zen Timer counting.
-
-HEADER:
-ztimer.h
-
-REMARKS:
-Obsolete function. You should use the LZTimerOnExt function instead
-which allows for multiple timers running at the same time.
-****************************************************************************/
-void ZAPI LZTimerOn(void)
-{ LZTimerOnExt(&LZTimer); }
-
-/****************************************************************************
-DESCRIPTION:
-Returns the current count for the Long Period Zen Timer and keeps it
-running.
-
-HEADER:
-ztimer.h
-
-RETURNS:
-Count that has elapsed in microseconds.
-
-REMARKS:
-Obsolete function. You should use the LZTimerLapExt function instead
-which allows for multiple timers running at the same time.
-****************************************************************************/
-ulong ZAPI LZTimerLap(void)
-{ return LZTimerLapExt(&LZTimer); }
-
-/****************************************************************************
-DESCRIPTION:
-Stops the Long Period Zen Timer counting.
-
-HEADER:
-ztimer.h
-
-REMARKS:
-Obsolete function. You should use the LZTimerOffExt function instead
-which allows for multiple timers running at the same time.
-****************************************************************************/
-void ZAPI LZTimerOff(void)
-{ LZTimerOffExt(&LZTimer); }
-
-/****************************************************************************
-DESCRIPTION:
-Returns the current count for the Long Period Zen Timer.
-
-HEADER:
-ztimer.h
-
-RETURNS:
-Count that has elapsed in microseconds.
-
-REMARKS:
-Obsolete function. You should use the LZTimerCountExt function instead
-which allows for multiple timers running at the same time.
-****************************************************************************/
-ulong ZAPI LZTimerCount(void)
-{ return LZTimerCountExt(&LZTimer); }
-
-/****************************************************************************
-DESCRIPTION:
-Starts the Ultra Long Period Zen Timer counting.
-
-HEADER:
-ztimer.h
-
-REMARKS:
-Starts the Ultra Long Period Zen Timer counting. Once you have started the
-timer, you can stop it with ULZTimerOff or you can latch the current count
-with ULZTimerLap.
-
-The Ultra Long Period Zen Timer uses the available operating system services
-to obtain accurate timings results with as much precision as the operating
-system provides, but with enough granularity to time longer periods of
-time than the Long Period Zen Timer. Note that the resolution of the timer
-ticks is not constant between different platforms, and you should use the
-ULZTimerResolution function to determine the number of seconds in a single
-tick of the timer, and use this to convert the timer counts to seconds.
-
-Under 32-bit Windows, we use the timeGetTime function which provides a
-resolution of 1 millisecond (0.001 of a second). Given that the timer
-count is returned as an unsigned 32-bit integer, this we can time intervals
-that are a maximum of 2^32 milliseconds in length (or about 1,200 hours or
-50 days!).
-
-Under 32-bit DOS, we use the system timer tick which runs at 18.2 times per
-second. Given that the timer count is returned as an unsigned 32-bit integer,
-this we can time intervals that are a maximum of 2^32 * (1/18.2) in length
-(or about 65,550 hours or 2731 days!).
-
-SEE ALSO:
-ULZTimerOff, ULZTimerLap, ULZTimerCount, ULZElapsedTime, ULZReadTime
-****************************************************************************/
-void ZAPI ULZTimerOn(void)
-{ start = __ULZReadTime(); }
-
-/****************************************************************************
-DESCRIPTION:
-Returns the current count for the Ultra Long Period Zen Timer and keeps it
-running.
-
-HEADER:
-ztimer.h
-
-RETURNS:
-Count that has elapsed in resolution counts.
-
-REMARKS:
-Returns the current count that has elapsed since the last call to
-ULZTimerOn in microseconds. The time continues to run after this function is
-called so you can call this function repeatedly.
-
-SEE ALSO:
-ULZTimerOn, ULZTimerOff, ULZTimerCount
-****************************************************************************/
-ulong ZAPI ULZTimerLap(void)
-{ return (__ULZReadTime() - start); }
-
-/****************************************************************************
-DESCRIPTION:
-Stops the Long Period Zen Timer counting.
-
-HEADER:
-ztimer.h
-
-REMARKS:
-Stops the Ultra Long Period Zen Timer counting and latches the count. Once
-you have stopped the timer you can read the count with ULZTimerCount.
-
-SEE ALSO:
-ULZTimerOn, ULZTimerLap, ULZTimerCount
-****************************************************************************/
-void ZAPI ULZTimerOff(void)
-{ finish = __ULZReadTime(); }
-
-/****************************************************************************
-DESCRIPTION:
-Returns the current count for the Ultra Long Period Zen Timer.
-
-HEADER:
-ztimer.h
-
-RETURNS:
-Count that has elapsed in resolution counts.
-
-REMARKS:
-Returns the current count that has elapsed between calls to
-ULZTimerOn and ULZTimerOff in resolution counts.
-
-SEE ALSO:
-ULZTimerOn, ULZTimerOff, ULZTimerLap, ULZTimerResolution
-****************************************************************************/
-ulong ZAPI ULZTimerCount(void)
-{ return (finish - start); }
-
-/****************************************************************************
-DESCRIPTION:
-Reads the current time from the Ultra Long Period Zen Timer.
-
-HEADER:
-ztimer.h
-
-RETURNS:
-Current timer value in resolution counts.
-
-REMARKS:
-Reads the current Ultra Long Period Zen Timer and returns it\92s current
-count. You can use the ULZElapsedTime function to find the elapsed time
-between two timer count readings.
-
-SEE ALSO:
-ULZElapsedTime, ULZTimerResolution
-****************************************************************************/
-ulong ZAPI ULZReadTime(void)
-{ return __ULZReadTime(); }
-
-/****************************************************************************
-DESCRIPTION:
-Compute the elapsed time between two timer counts.
-
-HEADER:
-ztimer.h
-
-PARAMETERS:
-start   - Starting time for elapsed count
-finish  - Ending time for elapsed count
-
-RETURNS:
-Elapsed timer in resolution counts.
-
-REMARKS:
-Returns the elapsed time for the Ultra Long Period Zen Timer in units of the
-timers resolution (1/18th of a second under DOS). This function correctly
-computes the difference even if a midnight boundary has been crossed
-during the timing period.
-
-SEE ALSO:
-ULZReadTime, ULZTimerResolution
-****************************************************************************/
-ulong ZAPI ULZElapsedTime(
-    ulong start,
-    ulong finish)
-{ return __ULZElapsedTime(start,finish); }
-
-/****************************************************************************
-DESCRIPTION:
-Returns the resolution of the Ultra Long Period Zen Timer.
-
-HEADER:
-ztimer.h
-
-PARAMETERS:
-resolution   - Place to store the timer in microseconds per timer count.
-
-REMARKS:
-Returns the resolution of the Ultra Long Period Zen Timer as a 32-bit
-integer value measured in microseconds per timer count.
-
-SEE ALSO:
-ULZReadTime, ULZElapsedTime, ULZTimerCount
-****************************************************************************/
-void ZAPI ULZTimerResolution(
-       ulong *resolution)
-{ *resolution = ULZTIMER_RESOLUTION; }
diff --git a/board/MAI/bios_emulator/scitech/src/v86bios/AsmMacros.h b/board/MAI/bios_emulator/scitech/src/v86bios/AsmMacros.h
deleted file mode 100644 (file)
index 77c545a..0000000
+++ /dev/null
@@ -1,450 +0,0 @@
-/* $XConsortium: AsmMacros.h /main/13 1996/10/25 11:33:12 kaleb $ */
-/*
- * (c) Copyright 1993,1994 by David Wexelblat <dwex@xfree86.org>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * DAVID WEXELBLAT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of David Wexelblat shall not be
- * used in advertising or otherwise to promote the sale, use or other dealings
- * in this Software without prior written authorization from David Wexelblat.
- *
- */
-/*
- * Copyright 1997
- * Digital Equipment Corporation. All rights reserved.
- * This software is furnished under license and may be used and copied only in
- * accordance with the following terms and conditions.  Subject to these
- * conditions, you may download, copy, install, use, modify and distribute
- * this software in source and/or binary form. No title or ownership is
- * transferred hereby.
- *
- * 1) Any source code used, modified or distributed must reproduce and retain
- *    this copyright notice and list of conditions as they appear in the source
- *    file.
- *
- * 2) No right is granted to use any trade name, trademark, or logo of Digital
- *    Equipment Corporation. Neither the "Digital Equipment Corporation" name
- *    nor any trademark or logo of Digital Equipment Corporation may be used
- *    to endorse or promote products derived from this software without the
- *    prior written permission of Digital Equipment Corporation.
- *
- * 3) This software is provided "AS-IS" and any express or implied warranties,
- *    including but not limited to, any implied warranties of merchantability,
- *    fitness for a particular purpose, or non-infringement are disclaimed. In
- *    no event shall DIGITAL be liable for any damages whatsoever, and in
- *    particular, DIGITAL shall not be liable for special, indirect,
- *    consequential, or incidental damages or damages for
- *    lost profits, loss of revenue or loss of use, whether such damages arise
- *    in contract,
- *    negligence, tort, under statute, in equity, at law or otherwise, even if
- *    advised of the possibility of such damage.
- *
- */
-
-/* $XFree86: xc/programs/Xserver/hw/xfree86/SuperProbe/AsmMacros.h,v 3.14 1999/09/25 14:36:58 dawes Exp $ */
-
-#if defined(__GNUC__)
-#if defined(linux) && (defined(__alpha__) || defined(__ia64__))
-#undef inb
-#define inb _inb
-#undef inw
-#define inw _inw
-#undef inl
-#define inl _inl
-#undef outb
-#define outb(p,v) _outb((v),(p))
-#undef outw
-#define outw(p,v) _outw((v),(p))
-#undef outl
-#define outl(p,v) _outl((v),(p))
-#else
-#if defined(__sparc__)
-#ifndef ASI_PL
-#define ASI_PL 0x88
-#endif
-
-static __inline__ void
-outb(port, val)
-unsigned long port;
-char val;
-{
-  __asm__ __volatile__("stba %0, [%1] %2" : : "r" (val), "r" (port), "i" (ASI_PL));
-}
-
-static __inline__ void
-outw(port, val)
-unsigned long port;
-char val;
-{
-  __asm__ __volatile__("stha %0, [%1] %2" : : "r" (val), "r" (port), "i" (ASI_PL));
-}
-
-static __inline__ void
-outl(port, val)
-unsigned long port;
-char val;
-{
-  __asm__ __volatile__("sta %0, [%1] %2" : : "r" (val), "r" (port), "i" (ASI_PL));
-}
-
-static __inline__ unsigned int
-inb(port)
-unsigned long port;
-{
-   unsigned char ret;
-   __asm__ __volatile__("lduba [%1] %2, %0" : "=r" (ret) : "r" (port), "i" (ASI_PL));
-   return ret;
-}
-
-static __inline__ unsigned int
-inw(port)
-unsigned long port;
-{
-   unsigned char ret;
-   __asm__ __volatile__("lduha [%1] %2, %0" : "=r" (ret) : "r" (port), "i" (ASI_PL));
-   return ret;
-}
-
-static __inline__ unsigned int
-inl(port)
-unsigned long port;
-{
-   unsigned char ret;
-   __asm__ __volatile__("lda [%1] %2, %0" : "=r" (ret) : "r" (port), "i" (ASI_PL));
-   return ret;
-}
-#else
-#ifdef __arm32__
-unsigned int IOPortBase;  /* Memory mapped I/O port area */
-
-static __inline__ void
-outb(port, val)
-     short port;
-     char val;
-{
-     if ((unsigned short)port >= 0x400) return;
-
-    *(volatile unsigned char*)(((unsigned short)(port))+IOPortBase) = val;
-}
-
-static __inline__ void
-outw(port, val)
-     short port;
-     short val;
-{
-     if ((unsigned short)port >= 0x400) return;
-
-    *(volatile unsigned short*)(((unsigned short)(port))+IOPortBase) = val;
-}
-
-static __inline__ void
-outl(port, val)
-     short port;
-     int val;
-{
-     if ((unsigned short)port >= 0x400) return;
-
-    *(volatile unsigned long*)(((unsigned short)(port))+IOPortBase) = val;
-}
-
-static __inline__ unsigned int
-inb(port)
-     short port;
-{
-     if ((unsigned short)port >= 0x400) return((unsigned int)-1);
-
-    return(*(volatile unsigned char*)(((unsigned short)(port))+IOPortBase));
-}
-
-static __inline__ unsigned int
-inw(port)
-     short port;
-{
-     if ((unsigned short)port >= 0x400) return((unsigned int)-1);
-
-    return(*(volatile unsigned short*)(((unsigned short)(port))+IOPortBase));
-}
-
-static __inline__ unsigned int
-inl(port)
-     short port;
-{
-     if ((unsigned short)port >= 0x400) return((unsigned int)-1);
-
-    return(*(volatile unsigned long*)(((unsigned short)(port))+IOPortBase));
-}
-#else /* __arm32__ */
-#if defined(Lynx) && defined(__powerpc__)
-extern unsigned char *ioBase;
-
-static volatile void
-eieio()
-{
-    __asm__ __volatile__ ("eieio");
-}
-
-static void
-outb(port, value)
-short port;
-unsigned char value;
-{
-    *(uchar *)(ioBase + port) = value; eieio();
-}
-
-static void
-outw(port, value)
-short port;
-unsigned short value;
-{
-    *(unsigned short *)(ioBase + port) = value; eieio();
-}
-
-static void
-outl(port, value)
-short port;
-unsigned long value;
-{
-    *(unsigned long *)(ioBase + port) = value; eieio();
-}
-
-static unsigned char
-inb(port)
-short port;
-{
-    unsigned char val;
-
-    val = *((unsigned char *)(ioBase + port)); eieio();
-    return(val);
-}
-
-static unsigned short
-inw(port)
-short port;
-{
-    unsigned short val;
-
-    val = *((unsigned short *)(ioBase + port)); eieio();
-    return(val);
-}
-
-static unsigned long
-inl(port)
-short port;
-{
-    unsigned long val;
-
-    val = *((unsigned long *)(ioBase + port)); eieio();
-    return(val);
-}
-
-#else
-#if defined(__FreeBSD__) && defined(__alpha__)
-
-#include <sys/types.h>
-
-extern void outb(u_int32_t port, u_int8_t val);
-extern void outw(u_int32_t port, u_int16_t val);
-extern void outl(u_int32_t port, u_int32_t val);
-extern u_int8_t inb(u_int32_t port);
-extern u_int16_t inw(u_int32_t port);
-extern u_int32_t inl(u_int32_t port);
-
-#else
-#ifdef GCCUSESGAS
-static __inline__ void
-outb(port, val)
-short port;
-char val;
-{
-   __asm__ __volatile__("outb %0,%1" : :"a" (val), "d" (port));
-}
-
-static __inline__ void
-outw(port, val)
-short port;
-short val;
-{
-   __asm__ __volatile__("outw %0,%1" : :"a" (val), "d" (port));
-}
-
-static __inline__ void
-outl(port, val)
-short port;
-unsigned int val;
-{
-   __asm__ __volatile__("outl %0,%1" : :"a" (val), "d" (port));
-}
-
-static __inline__ unsigned int
-inb(port)
-short port;
-{
-   unsigned char ret;
-   __asm__ __volatile__("inb %1,%0" :
-       "=a" (ret) :
-       "d" (port));
-   return ret;
-}
-
-static __inline__ unsigned int
-inw(port)
-short port;
-{
-   unsigned short ret;
-   __asm__ __volatile__("inw %1,%0" :
-       "=a" (ret) :
-       "d" (port));
-   return ret;
-}
-
-static __inline__ unsigned int
-inl(port)
-short port;
-{
-   unsigned int ret;
-   __asm__ __volatile__("inl %1,%0" :
-       "=a" (ret) :
-       "d" (port));
-   return ret;
-}
-
-#else /* GCCUSESGAS */
-
-static __inline__ void
-outb(port, val)
-     short port;
-     char val;
-{
-  __asm__ __volatile__("out%B0 (%1)" : :"a" (val), "d" (port));
-}
-
-static __inline__ void
-outw(port, val)
-     short port;
-     short val;
-{
-  __asm__ __volatile__("out%W0 (%1)" : :"a" (val), "d" (port));
-}
-
-static __inline__ void
-outl(port, val)
-     short port;
-     unsigned int val;
-{
-  __asm__ __volatile__("out%L0 (%1)" : :"a" (val), "d" (port));
-}
-
-static __inline__ unsigned int
-inb(port)
-     short port;
-{
-  unsigned int ret;
-  __asm__ __volatile__("in%B0 (%1)" :
-                  "=a" (ret) :
-                  "d" (port));
-  return ret;
-}
-
-static __inline__ unsigned int
-inw(port)
-     short port;
-{
-  unsigned int ret;
-  __asm__ __volatile__("in%W0 (%1)" :
-                  "=a" (ret) :
-                  "d" (port));
-  return ret;
-}
-
-static __inline__ unsigned int
-inl(port)
-     short port;
-{
-  unsigned int ret;
-  __asm__ __volatile__("in%L0 (%1)" :
-                  "=a" (ret) :
-                  "d" (port));
-  return ret;
-}
-
-#endif /* GCCUSESGAS */
-#endif /* Lynx && __powerpc__ */
-#endif /* arm32 */
-#endif /* linux && __sparc__ */
-#endif /* linux && __alpha__ */
-#endif /* __FreeBSD__ && __alpha__ */
-
-#if defined(linux) || defined(__arm32__) || (defined(Lynx) && defined(__powerpc__))
-
-#define intr_disable()
-#define intr_enable()
-
-#else
-
-static __inline__ void
-intr_disable()
-{
-  __asm__ __volatile__("cli");
-}
-
-static __inline__ void
-intr_enable()
-{
-  __asm__ __volatile__("sti");
-}
-
-#endif /* else !linux && !__arm32__ */
-
-#else /* __GNUC__ */
-
-#if defined(_MINIX) && defined(_ACK)
-
-/* inb, outb, inw and outw are defined in the library */
-/* ... but I've no idea if the same is true for inl & outl */
-
-u8_t inb(U16_t);
-void outb(U16_t, U8_t);
-u16_t inw(U16_t);
-void outw(U16_t, U16_t);
-u32_t inl(U16_t);
-void outl(U16_t, U32_t);
-
-#else /* not _MINIX and _ACK */
-
-# if defined(__STDC__) && (__STDC__ == 1)
-#  ifndef NCR
-#  define asm __asm
-#  endif
-# endif
-# ifdef SVR4
-#  include <sys/types.h>
-#  ifndef __USLC__
-#   define __USLC__
-#  endif
-# endif
-#ifndef SCO325
-# include <sys/inline.h>
-#else
-# include "../common/scoasm.h"
-#endif
-#define intr_disable() asm("cli")
-#define intr_enable()  asm("sti")
-
-#endif /* _MINIX and _ACK */
-#endif /* __GNUC__ */
diff --git a/board/MAI/bios_emulator/scitech/src/v86bios/README b/board/MAI/bios_emulator/scitech/src/v86bios/README
deleted file mode 100644 (file)
index cb65674..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-
-This is a preliminary version of a VGA softbooter for LINUX.
-
-It makes use of the of the vm86() call and is therefore only
-usable on ix86 systems.
-There are plans to port this program to use a x86 emulator
-like x86emu. Also it may be ported to other operating systems.
-
-So far it has been tested on a small number of cards. It might
-well be that it will fail on your card.
-
-If you need to make modifications to the programs to be able
-to boot your card please let the author know.
-
-So far there is no command line interface. All options need
-to be hardcoded. You can do this by editing debug.h. You can
-turn on a bunch of debug output. Other options allow you to
-boot the primary card (CONFIG_ACTIVE_DEVICE), save the bios
-to a file (SAVE_BIOS), and map the original system bios
-(MAP_SYS_BIOS).
-
-The author wants to thank
- Hans Lermen   (dosemu)
- and
- Kendall Bennett (x86emu)
-for their support.
-
-Parts of the code - especially in v86.c and io.c - are based on code
-taken from dosemu. Parts of the code in int.c are based on code taken
-from x86emu
-
-Egbert Eich.  <Egbert.Eich@Physik.TU-Darmstadt.DE>
diff --git a/board/MAI/bios_emulator/scitech/src/v86bios/awk.scr b/board/MAI/bios_emulator/scitech/src/v86bios/awk.scr
deleted file mode 100644 (file)
index 9d2a80d..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-/.*\(0x3da.*/||/.*\(0x3ba.*/ { 
-        if (v_3da != 1) print "_v_retrace_";
-        v_3da = 1;
-        next;        
-        }
-/.*\(0x42.*/||/.*\(0x43.*/ {
-        if (v_4x != 1) print "_timer_";
-        v_4x = 1;
-        next;
-}
-{
-    print;
-    v_3da = 0;
-    v_4x = 0;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/v86bios/cbios.c b/board/MAI/bios_emulator/scitech/src/v86bios/cbios.c
deleted file mode 100644 (file)
index 6b12dff..0000000
+++ /dev/null
@@ -1,415 +0,0 @@
-#include <unistd.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <sys/mman.h>
-#include <sys/types.h>
-#include <string.h>
-#include <stdlib.h>
-#include <signal.h>
-#include <sys/stat.h>
-#include <getopt.h>
-#if defined(__alpha__) || defined (__ia64__)
-#include <sys/io.h>
-#elif defined(HAVE_SYS_PERM)
-#include <sys/perm.h>
-#endif
-#include "debug.h"
-#include "v86bios.h"
-#include "pci.h"
-#include "AsmMacros.h"
-
-#define SIZE 0x100000
-#define VRAM_START 0xA0000
-#define VRAM_SIZE 0x1FFFF
-#define V_BIOS_SIZE 0x1FFFF
-#define BIOS_START 0x7C00            /* default BIOS entry */
-#define BIOS_MEM 0x600
-
-CARD8 code[] = { 0xcd, 0x10, 0xf4 };
-struct config Config;
-
-static int map(void);
-static void unmap(void);
-static void runBIOS(int argc, char **argv);
-static int map_vram(void);
-static void unmap_vram(void);
-static int copy_vbios(memType base);
-static int copy_sys_bios(void);
-static CARD32 setup_int_vect(void);
-static void update_bios_vars(void);
-static int chksum(CARD8 *start);
-static void setup_bios_regs(i86biosRegsPtr regs, int argc, char **argv);
-static void print_regs(i86biosRegsPtr regs);
-void dprint(unsigned long start, unsigned long size);
-
-void loadCodeToMem(unsigned char *ptr, CARD8 *code);
-
-static int vram_mapped = 0;
-static char* bios_var;
-
-
-int
-main(int argc,char **argv)
-{
-    CARD32 vbios_base;
-
-    Config.PrintPort = PRINT_PORT;
-    Config.IoStatistics = IO_STATISTICS;
-    Config.PrintIrq = PRINT_IRQ;
-    Config.PrintPci = PRINT_PCI;
-    Config.ShowAllDev = SHOW_ALL_DEV;
-    Config.PrintIp = PRINT_IP;
-    Config.SaveBios = SAVE_BIOS;
-    Config.Trace = TRACE;
-    Config.ConfigActiveOnly = CONFIG_ACTIVE_ONLY;
-    Config.ConfigActiveDevice = CONFIG_ACTIVE_DEVICE;
-    Config.MapSysBios = MAP_SYS_BIOS;
-    Config.Resort = RESORT;
-    Config.FixRom = FIX_ROM;
-    Config.NoConsole = NO_CONSOLE;
-    Config.Verbose = VERBOSE;
-
-    if (!map())
-    exit(1);
-    if (!copy_sys_bios())
-    exit(1);
-    if (!(vbios_base = setup_int_vect()))
-    exit(1);
-    if (!map_vram())
-    exit(1);
-    if (!copy_vbios(vbios_base))
-    exit(1);
-
-    iopl(3);
-    setup_io();
-    runBIOS(argc,argv);
-    update_bios_vars();
-    unmap_vram();
-    iopl(0);
-    unmap();
-    printf("done !\n");
-    exit (1);
-}
-
-int
-map(void)
-{
-    void* mem;
-
-    mem = mmap(0, (size_t)SIZE,
-              PROT_EXEC | PROT_READ | PROT_WRITE,
-              MAP_FIXED | MAP_PRIVATE | MAP_ANON,
-              -1, 0 );
-    if (mem != 0) {
-       perror("anonymous map");
-       return (0);
-    }
-    memset(mem,0,SIZE);
-
-    loadCodeToMem((unsigned char *) BIOS_START, code);
-    return (1);
-}
-
-static int
-copy_sys_bios(void)
-{
-#define SYS_BIOS 0xF0000
-    int mem_fd;
-
-    if ((mem_fd = open(MEM_FILE,O_RDONLY))<0) {
-       perror("opening memory");
-       return (0);
-    }
-
-    if (lseek(mem_fd,(off_t) SYS_BIOS,SEEK_SET) != (off_t) SYS_BIOS)
-       goto Error;
-    if (read(mem_fd, (char *)SYS_BIOS, (size_t) 0xFFFF) != (size_t) 0xFFFF)
-       goto Error;
-
-    close(mem_fd);
-    return (1);
-
-Error:
-    perror("sys_bios");
-    close(mem_fd);
-    return (0);
-}
-
-static int
-map_vram(void)
-{
-    int mem_fd;
-
-#ifdef __ia64__
-    if ((mem_fd = open(MEM_FILE,O_RDWR | O_SYNC))<0)
-#else
-    if ((mem_fd = open(MEM_FILE,O_RDWR))<0)
-#endif
-      {
-       perror("opening memory");
-       return 0;
-    }
-
-#ifndef __alpha__
-    if (mmap((void *) VRAM_START, (size_t) VRAM_SIZE,
-                    PROT_EXEC | PROT_READ | PROT_WRITE, MAP_SHARED | MAP_FIXED,
-                    mem_fd, VRAM_START) == (void *) -1)
-#else
-        if (!_bus_base()) sparse_shift = 7; /* Uh, oh, JENSEN... */
-        if (!_bus_base_sparse()) sparse_shift = 0;
-        if ((vram_map = mmap(0,(size_t) (VRAM_SIZE << sparse_shift),
-                                                PROT_READ | PROT_WRITE,
-                                                MAP_SHARED,
-                                                mem_fd, (VRAM_START << sparse_shift)
-                                                | _bus_base_sparse())) == (void *) -1)
-#endif
-      {
-       perror("mmap error in map_hardware_ram");
-           close(mem_fd);
-           return (0);
-       }
-    vram_mapped = 1;
-    close(mem_fd);
-    return (1);
-}
-
-static int
-copy_vbios(memType v_base)
-{
-    int mem_fd;
-    unsigned char *tmp;
-    int size;
-
-    if ((mem_fd = open(MEM_FILE,O_RDONLY))<0) {
-       perror("opening memory");
-       return (0);
-    }
-
-    if (lseek(mem_fd,(off_t) v_base, SEEK_SET) != (off_t) v_base) {
-         fprintf(stderr,"Cannot lseek\n");
-         goto Error;
-      }
-    tmp = (unsigned char *)malloc(3);
-    if (read(mem_fd, (char *)tmp, (size_t) 3) != (size_t) 3) {
-           fprintf(stderr,"Cannot read\n");
-       goto Error;
-    }
-    if (lseek(mem_fd,(off_t) v_base,SEEK_SET) != (off_t) v_base)
-       goto Error;
-
-    if (*tmp != 0x55 || *(tmp+1) != 0xAA ) {
-       fprintf(stderr,"No bios found at: 0x%lx\n",v_base);
-       goto Error;
-    }
-#ifdef DEBUG
-       dprint((unsigned long)tmp,0x100);
-#endif
-    size = *(tmp+2) * 512;
-
-    if (read(mem_fd, (char *)v_base, (size_t) size) != (size_t) size) {
-           fprintf(stderr,"Cannot read\n");
-       goto Error;
-    }
-    free(tmp);
-    close(mem_fd);
-    if (!chksum((CARD8*)v_base))
-       return (0);
-
-    return (1);
-
-Error:
-    perror("v_bios");
-    close(mem_fd);
-    return (0);
-}
-
-static void
-unmap(void)
-{
-    munmap(0,SIZE);
-}
-
-static void
-unmap_vram(void)
-{
-    if (!vram_mapped) return;
-
-    munmap((void*)VRAM_START,VRAM_SIZE);
-    vram_mapped = 0;
-}
-
-static void
-runBIOS(int argc, char ** argv)
-{
-    i86biosRegs bRegs;
-#ifdef V86BIOS_DEBUG
-    printf("starting BIOS\n");
-#endif
-    setup_bios_regs(&bRegs, argc, argv);
-    do_x86(BIOS_START,&bRegs);
-    print_regs(&bRegs);
-#ifdef V86BIOS_DEBUG
-    printf("done\n");
-#endif
-}
-
-static CARD32
-setup_int_vect(void)
-{
-    int mem_fd;
-    CARD32 vbase;
-    void *map;
-
-    if ((mem_fd = open(MEM_FILE,O_RDONLY))<0) {
-    perror("opening memory");
-    return (0);
-    }
-
-    if ((map = mmap((void *) 0, (size_t) 0x2000,
-        PROT_EXEC | PROT_READ | PROT_WRITE, MAP_SHARED,
-        mem_fd, 0)) == (void *)-1)   {
-    perror("mmap error in map_hardware_ram");
-    close(mem_fd);
-    return (0);
-    }
-
-    close(mem_fd);
-    memcpy(0,map,BIOS_MEM);
-    munmap(map,0x2000);
-    /*
-     * create a backup copy of the bios variables to write back the
-     * modified values
-     */
-    bios_var = (char *)malloc(BIOS_MEM);
-    memcpy(bios_var,0,BIOS_MEM);
-
-    vbase = (*((CARD16*)(0x10 << 2) + 1)) << 4;
-    fprintf(stderr,"vbase: 0x%x\n",vbase);
-    return vbase;
-}
-
-static void
-update_bios_vars(void)
-{
-    int mem_fd;
-    void *map;
-    memType i;
-
-#ifdef __ia64__
-    if ((mem_fd = open(MEM_FILE,O_RDWR | O_SYNC))<0)
-#else
-    if ((mem_fd = open(MEM_FILE,O_RDWR))<0)
-#endif
-      {
-       perror("opening memory");
-       return;
-      }
-
-    if ((map = mmap((void *) 0, (size_t) 0x2000,
-        PROT_EXEC | PROT_READ | PROT_WRITE, MAP_SHARED,
-        mem_fd, 0)) == (void *)-1)   {
-    perror("mmap error in map_hardware_ram");
-    close(mem_fd);
-    return;
-    }
-
-    for (i = 0; i < BIOS_MEM; i++) {
-    if (bios_var[i] != *(CARD8*)i)
-       *((CARD8*)map + i) = *(CARD8*)i;
-    }
-
-    munmap(map,0x2000);
-    close(mem_fd);
-}
-
-
-static void
-setup_bios_regs(i86biosRegsPtr regs, int argc, char **argv)
-{
-    int c;
-
-    regs->ax = 0;
-    regs->bx = 0;
-    regs->cx = 0;
-    regs->dx = 0;
-    regs->es = 0;
-    regs->di = 0;
-    opterr = 0;
-    while ((c = getopt(argc,argv,"a:b:c:d:e:i:")) != EOF) {
-    switch (c) {
-    case 'a':
-       regs->ax = strtol(optarg,NULL,0);
-       break;
-    case 'b':
-       regs->bx = strtol(optarg,NULL,0);
-       break;
-    case 'c':
-       regs->cx = strtol(optarg,NULL,0);
-       break;
-    case 'd':
-       regs->dx = strtol(optarg,NULL,0);
-       break;
-    case 'e':
-       regs->es = strtol(optarg,NULL,0);
-       break;
-    case 'i':
-       regs->di = strtol(optarg,NULL,0);
-       break;
-    }
-    }
-}
-
-
-static int
-chksum(CARD8 *start)
-{
-  CARD16 size;
-  CARD8 val = 0;
-  int i;
-
-  size = *(start+2) * 512;
-  for (i = 0; i<size; i++)
-    val += *(start + i);
-
-  if (!val)
-    return 1;
-
-    fprintf(stderr,"BIOS cksum wrong!\n");
-  return 0;
-}
-
-static void
-print_regs(i86biosRegsPtr regs)
-{
-    printf("ax=%x bx=%x cx=%x dx=%x es=%x di=%x\n",(CARD16)regs->ax,
-       (CARD16)regs->bx,(CARD16)regs->cx,(CARD16)regs->dx,
-       (CARD16)regs->es,(CARD16)regs->di);
-}
-
-void
-loadCodeToMem(unsigned char *ptr, CARD8 code[])
-{
-    int i;
-    CARD8 val;
-
-    for ( i=0;;i++) {
-       val = code[i];
-       *ptr++ = val;
-       if (val == 0xf4) break;
-    }
-    return;
-}
-
-void
-dprint(unsigned long start, unsigned long size)
-{
-    int i,j;
-    char *c = (char *)start;
-
-    for (j = 0; j < (size >> 4); j++) {
-       printf ("\n0x%lx:  ",(unsigned long)c);
-       for (i = 0; i<16; i++)
-           printf("%x ",(unsigned char) (*(c++)));
-    }
-    printf("\n");
-}
diff --git a/board/MAI/bios_emulator/scitech/src/v86bios/command.c b/board/MAI/bios_emulator/scitech/src/v86bios/command.c
deleted file mode 100644 (file)
index e2bce6d..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-#include <stdio.h>
-#include <readline/readline.h>
-#include <readline/history.h>
-#include <malloc.h>
-
-#define PROMPT ">"
-
-
-void
-getline(char *buf,int *num,int max_num)
-{
-    static int line_len = 0;
-    static char *line = NULL;
-    static char *line_pointer = NULL;
-    static int len = 0;
-    int tmp_len;
-    char *buff;
-
-    if (len <= 0) {
-    buff = readline(PROMPT);
-    add_history(buff);
-
-    if ((tmp_len = strlen(buff)) > line_len) {
-       free(line);
-       line = malloc(tmp_len);
-       line_len = tmp_len;
-    }
-    sprintf(line,"%s\n",buff);
-    free(buff);
-    line_pointer = line;
-    len = strlen(line);
-    }
-
-    *num = max_num > len? len : max_num;
-    strncpy(buf,line_pointer,*num);
-    line_pointer = line_pointer + *num;
-    len = len - *num;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/v86bios/console.c b/board/MAI/bios_emulator/scitech/src/v86bios/console.c
deleted file mode 100644 (file)
index 5e9c924..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright 1999 Egbert Eich
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of the authors not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission.  The authors makes no representations
- * about the suitability of this software for any purpose.  It is provided
- * "as is" without express or implied warranty.
- *
- * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-#include <sys/ioctl.h>
-#include <sys/vt.h>
-#include <sys/kd.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include "debug.h"
-#include "v86bios.h"
-
-console
-open_console(void)
-{
-    int fd;
-    int VTno;
-    char VTname[11];
-    console Con = {-1,-1};
-    struct vt_stat vts;
-
-    if (NO_CONSOLE)
-           return Con;
-
-    if ((fd = open("/dev/tty0",O_WRONLY,0)) < 0)
-       return Con;
-
-    if ((ioctl(fd, VT_OPENQRY, &VTno) < 0) || (VTno == -1)) {
-       fprintf(stderr,"cannot get a vt\n");
-       return Con;
-    }
-
-    close(fd);
-    sprintf(VTname,"/dev/tty%i",VTno);
-
-    if ((fd = open(VTname, O_RDWR|O_NDELAY, 0)) < 0) {
-       fprintf(stderr,"cannot open console\n");
-       return Con;
-    }
-
-    if (ioctl(fd, VT_GETSTATE, &vts) == 0)
-       Con.vt = vts.v_active;
-
-    if (ioctl(fd, VT_ACTIVATE, VTno) != 0) {
-       fprintf(stderr,"cannot activate console\n");
-       close(fd);
-       return Con;
-    }
-    if (ioctl(fd, VT_WAITACTIVE, VTno) != 0) {
-       fprintf(stderr,"wait for active console failed\n");
-       close(fd);
-       return Con;
-    }
-#if 0
-    if (ioctl(fd, KDSETMODE, KD_GRAPHICS) < 0) {
-       close(fd);
-       return Con;
-    }
-#endif
-    Con.fd = fd;
-    return Con;
-}
-
-void
-close_console(console Con)
-{
-    if (Con.fd == -1)
-       return;
-
-#if 0
-    ioctl(Con.fd, KDSETMODE, KD_TEXT);
-#endif
-    if (Con.vt >=0)
-       ioctl(Con.fd, VT_ACTIVATE, Con.vt);
-
-    close(Con.fd);
-}
diff --git a/board/MAI/bios_emulator/scitech/src/v86bios/debug.h b/board/MAI/bios_emulator/scitech/src/v86bios/debug.h
deleted file mode 100644 (file)
index c5c906b..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright 1999 Egbert Eich
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of the authors not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission.  The authors makes no representations
- * about the suitability of this software for any purpose.  It is provided
- * "as is" without express or implied warranty.
- *
- * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-/*#define V86BIOS_DEBUG */
-
-/*
- * uncomment the following if needed
- * should be command line options
- */
-
-#define PRINT_PORT 0
-#define IO_STATISTICS 0
-#define PRINT_IRQ 0
-#define PRINT_PCI 1
-#define PRINT_IP 0    /* print IP address with PIO information */
-#define TRACE 0       /* turn on debugger in x86emu            */
-                     /* requires x86emu compiled with -DDEBUG */
-
-/*
- * these should not be here.
- * Should be converted to command line options.
- */
-#define CONFIG_ACTIVE_ONLY 0
-#define CONFIG_ACTIVE_DEVICE 1
-#define SAVE_BIOS 0
-#define MAP_SYS_BIOS 1
-#define RESORT 1
-#define FIX_ROM 0
-#define NO_CONSOLE 0
-#define SHOW_ALL_DEV 0
-#define VERBOSE 0
-
-/*#define V_BIOS 0xe0000 */
-/*#define V_BIOS 0xe4000 */
-
-
-#if (PRINT_IO == 1) && (PRINT_PORT == 0)
-# define PRINT_IO 0
-#endif
-#if (IO_STATISTICS == 1) && (PRINT_PORT == 0)
-# define IO_STATISTICS 0
-#endif
diff --git a/board/MAI/bios_emulator/scitech/src/v86bios/happy_cards b/board/MAI/bios_emulator/scitech/src/v86bios/happy_cards
deleted file mode 100644 (file)
index 943d44e..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-What I had to do to make cards happy:
-
-1. Tseng ET4000 W32P
-This card wants to call the original system BIOS video routines.
-It sets the int 0x42 vector to F000:F065, the entry point to the
-system bios video routines. 
-CAVE: don't catch int 0x42 and use the vbios int 0x10 routines. 
-At early stage during initialization they call int 0x42. This 
-causes an infinite loop.
-
-2. ATi Mach64 Rage IIc AGP
-This card does similar things like the Tseng ET4000 W32P.
-However it doesn't have the problem with the ininite loop.
-
-3. Elsa Victory II-A16 AGP Banshee
-This card is very clever: It knows it is an AGP card. Therefore
-it knows it is behind a PCI-PCI bridge. It also knows that noone
-else is behind this bridge. Therefore it start reprogramming the
-bridge! For this it assumes the AGP bridge is on bus 1.
-
-4. Elsa Gloria Synergy 8 ViVo AGP PM2
-This card likes to see a complete interrupt vector table. If
-we fill this table with 0 the VBIOS detects this and quits 
-initialization.
-
-5. Dimond Viper 330 AGP NVIDIA Riva 128.
-This card has a similar problem like the Elsa Gloria. It wants
-to read the system BIOS date at 0xffffd.
-
-6. Matrox Mystique PCI 
-This card reads the IO port 0x62. If it doesn't like what it sees
-it loops forever. To keep the card happy put 0xfc into 0xffffe.
-This location holds the system model id. 0xfc means IBM-AT.
- One can make an interesting observation: this card likes to know 
-with whom it has to share the system. Therefore it accesses PCI 
-config space of all the other cards. It does this bypassing the 
-PCI BIOS by reading the PCI access ports directly.
-
-7. Matrox G100 AGP
-This card has the same problem as the Mystique. 
-
-Apperantly this works now. However not all combinations of cards are
-checked, yet.
-
-Further notes:
-the IO register 0x42-0x43 as well as 0x61-0x63 are of special interest
-for many graphic cards. They should be emulated.
-The so called "Industry Standard BIOS Entry Points" to int 0x42 (0xFF065)
-and to int 0x1a (0xFFE6E) should be filled with useful code. This code
-needs to return as if it was called as int.
-The subvendor ID PCI registers might cause problems. On some chipsets
-they are programmed in a non-obivous non-PCI conformant way.
-V_Bioses are seen to modify the following int:
-0x10 (default video), 0x1f(font table), 0x42(copy of default video), 
-0x43 (??), 0x6d (copy of default video - same as 0x10?)
-
-TODO:
-Int 0x6d needs to be done.
-All interrupts where there is no default industry standard entry point
-should point to an unused location in the 0xF000 segmant (possibly 
-0xF0000). This way they could be trapped. A trap handler for
-a. int 0x42 and int 0x1a needs to be implemented.
-The default "industry entry point" for video and PCI (0xFFE6E) should
-also be implemented. (any others?) They should either be routed to
-int 0x42(0x6d?) (video) and 0x1A (PCI) or some other interrupts to
-trap them. Mapping of system bios might not be a good idea. Maybe
-the system bios area should just be filled with "hlt" to trap any
-access there.
-Handling of timer IO registers 0x42, 0x43 and IO registers 0x61, 0x62.
-
-Find documentation:
-- on interrupt vector table
-- on industry standard entry points to the system bios
-- on IO registers 0x61 and 0x62
-
-
diff --git a/board/MAI/bios_emulator/scitech/src/v86bios/hexdump b/board/MAI/bios_emulator/scitech/src/v86bios/hexdump
deleted file mode 100644 (file)
index 4f359e5..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-"%06.6_ax  "  16/1 "%02x " 
-"  " 16/1 "%_p" 
-"\n"
diff --git a/board/MAI/bios_emulator/scitech/src/v86bios/int.c b/board/MAI/bios_emulator/scitech/src/v86bios/int.c
deleted file mode 100644 (file)
index 3504c6c..0000000
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * Copyright 1999 Egbert Eich
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of the authors not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission.  The authors makes no representations
- * about the suitability of this software for any purpose.  It is provided
- * "as is" without express or implied warranty.
- *
- * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-#include "debug.h"
-#if defined(__alpha__) || defined (__ia64__)
-#include <sys/io.h>
-#endif
-
-#include "v86bios.h"
-#include "AsmMacros.h"
-#include "pci.h"
-
-static int int1A_handler(struct regs86 *regs);
-static int int42_handler(int num, struct regs86 *regs);
-
-int
-int_handler(int num, struct regs86 *regs)
-{
-    switch (num) {
-    case 0x10:
-    case 0x42:
-       return (int42_handler(num,regs));
-    case 0x1A:
-       return (int1A_handler(regs));
-    default:
-       return 0;
-    }
-    return 0;
-}
-
-static int
-int42_handler(int num,struct regs86 *regs)
-{
-    unsigned char c;
-    CARD32 val;
-
-    i_printf("int 0x%x: ax:0x%lx bx:0x%lx cx:0x%lx dx:0x%lx\n",num,
-          regs->eax,regs->ebx, regs->ecx, regs->edx);
-
-    /*
-     * video bios has modified these -
-     * leave it to the video bios to do this
-     */
-
-    val = getIntVect(num);
-    if (val != 0xF000F065)
-      return 0;
-
-    if ((regs->ebx & 0xff) == 0x32) {
-       switch (regs->eax & 0xFFFF) {
-       case 0x1200:
-           i_printf("enabling video\n");
-           c = inb(0x3cc);
-           c |= 0x02;
-           outb(0x3c2,c);
-           return 1;
-       case 0x1201:
-           i_printf("disabling video\n");
-           c = inb(0x3cc);
-           c &= ~0x02;
-           outb(0x3c2,c);
-           return 1;
-       default:
-       }
-    }
-    if (num == 0x42)
-       return 1;
-    else
-       return 0;
-}
-
-#define SUCCESSFUL              0x00
-#define DEVICE_NOT_FOUND        0x86
-#define BAD_REGISTER_NUMBER     0x87
-
-static int
-int1A_handler(struct regs86 *regs)
-{
-    CARD32 Slot;
-    PciStructPtr pPci;
-
-    if (! CurrentPci) return 0; /* oops */
-
-    i_printf("int 0x1a: ax=0x%lx bx=0x%lx cx=0x%lx dx=0x%lx di=0x%lx"
-        " si=0x%lx\n", regs->eax,regs->ebx,regs->ecx,regs->edx,
-        regs->edi,regs->esi);
-    switch (regs->eax & 0xFFFF) {
-    case 0xb101:
-       regs->eax  &= 0xFF00;   /* no config space/special cycle support */
-       regs->edx = 0x20494350; /* " ICP" */
-       regs->ebx  = 0x0210;    /* Version 2.10 */
-       regs->ecx  &= 0xFF00;
-       regs->ecx |= (pciMaxBus & 0xFF);   /* Max bus number in system */
-       regs->eflags &= ~((unsigned long)0x01); /* clear carry flag */
-       i_printf("ax=0x%lx dx=0x%lx bx=0x%lx cx=0x%lx flags=0x%lx\n",
-                regs->eax,regs->edx,regs->ebx,regs->ecx,regs->eflags);
-       return 1;
-    case 0xb102:
-       if (((regs->edx & 0xFFFF) == CurrentPci->VendorID) &&
-           ((regs->ecx & 0xFFFF) == CurrentPci->DeviceID) &&
-           (regs->esi == 0)) {
-           regs->eax = (regs->eax & 0x00FF) | (SUCCESSFUL << 8);
-           regs->eflags &= ~((unsigned long)0x01); /* clear carry flag */
-           regs->ebx = pciSlotBX(CurrentPci);
-       }
-       else if (Config.ShowAllDev &&
-            (pPci = findPciDevice(regs->edx,regs->ecx,regs->esi)) != NULL) {
-           regs->eax = (regs->eax & 0x00FF) | (SUCCESSFUL << 8);
-           regs->eflags &= ~((unsigned long)0x01); /* clear carry flag */
-           regs->ebx = pciSlotBX(pPci);
-       } else  {
-           regs->eax = (regs->eax & 0x00FF) | (DEVICE_NOT_FOUND << 8);
-           regs->eflags |= ((unsigned long)0x01); /* set carry flag */
-       }
-       i_printf("ax=0x%lx bx=0x%lx flags=0x%lx\n",
-                regs->eax,regs->ebx,regs->eflags);
-       return 1;
-    case 0xb103:
-       if (((regs->ecx & 0xFF) == CurrentPci->Interface) &&
-           (((regs->ecx & 0xFF00) >> 8) == CurrentPci->SubClass) &&
-           (((regs->ecx & 0xFFFF0000) >> 16) == CurrentPci->BaseClass) &&
-           ((regs->esi & 0xff) == 0)) {
-           regs->eax = (regs->eax & 0x00FF) | (SUCCESSFUL << 8);
-           regs->ebx = pciSlotBX(CurrentPci);
-           regs->eflags &= ~((unsigned long)0x01); /* clear carry flag */
-       }
-       else if (Config.ShowAllDev
-            && (pPci = findPciClass(regs->ecx & 0xFF, (regs->ecx & 0xff00) >> 8,
-                        (regs->ecx & 0xffff0000) >> 16, regs->esi)) != NULL) {
-           regs->eax = (regs->eax & 0x00FF) | (SUCCESSFUL << 8);
-           regs->ebx = pciSlotBX(pPci);
-           regs->eflags &= ~((unsigned long)0x01); /* clear carry flag */
-       } else {
-           regs->eax = (regs->eax & 0x00FF) | (DEVICE_NOT_FOUND << 8);
-           regs->eflags |= ((unsigned long)0x01); /* set carry flag */
-       }
-       i_printf("ax=0x%lx flags=0x%lx\n",regs->eax,regs->eflags);
-       return 1;
-    case 0xb108:
-       i_printf("Slot=0x%x\n",CurrentPci->Slot.l);
-       if ((Slot = findPci(regs->ebx))) {
-           regs->ecx &= 0xFFFFFF00;
-           regs->ecx |= PciRead8(regs->edi,Slot);
-           regs->eax = (regs->eax & 0x00FF) | (SUCCESSFUL << 8);
-           regs->eflags &= ~((unsigned long)0x01); /* clear carry flag */
-       } else {
-           regs->eax = (regs->eax & 0x00FF) | (BAD_REGISTER_NUMBER << 8);
-           regs->eflags |= ((unsigned long)0x01); /* set carry flag */
-       }
-       i_printf("ax=0x%lx cx=0x%lx flags=0x%lx\n",
-                regs->eax,regs->ecx,regs->eflags);
-       return 1;
-    case 0xb109:
-       i_printf("Slot=0x%x\n",CurrentPci->Slot.l);
-       if ((Slot = findPci(regs->ebx))) {
-           regs->ecx &= 0xFFFF0000;
-           regs->ecx |= PciRead16(regs->edi,Slot);
-           regs->eax = (regs->eax & 0x00FF) | (SUCCESSFUL << 8);
-           regs->eflags &= ~((unsigned long)0x01); /* clear carry flag */
-       } else {
-           regs->eax = (regs->eax & 0x00FF) | (BAD_REGISTER_NUMBER << 8);
-           regs->eflags |= ((unsigned long)0x01); /* set carry flag */
-       }
-       i_printf("ax=0x%lx cx=0x%lx flags=0x%lx\n",
-                regs->eax,regs->ecx,regs->eflags);
-       return 1;
-    case 0xb10a:
-       i_printf("Slot=0x%x\n",CurrentPci->Slot.l);
-       if ((Slot = findPci(regs->ebx))) {
-           regs->ecx &= 0;
-           regs->ecx |= PciRead32(regs->edi,Slot);
-           regs->eax = (regs->eax & 0x00FF) | (SUCCESSFUL << 8);
-           regs->eflags &= ~((unsigned long)0x01); /* clear carry flag */
-       } else {
-           regs->eax = (regs->eax & 0x00FF) | (BAD_REGISTER_NUMBER << 8);
-           regs->eflags |= ((unsigned long)0x01); /* set carry flag */
-       }
-       i_printf("ax=0x%lx cx=0x%lx flags=0x%lx\n",
-                regs->eax,regs->ecx,regs->eflags);
-       return 1;
-    case 0xb10b:
-       i_printf("Slot=0x%x\n",CurrentPci->Slot.l);
-       if ((Slot = findPci(regs->ebx))) {
-           PciWrite8(regs->edi,(CARD8)regs->ecx,Slot);
-           regs->eax = (regs->eax & 0x00FF) | (SUCCESSFUL << 8);
-           regs->eflags &= ~((unsigned long)0x01); /* clear carry flag */
-       } else {
-           regs->eax = (regs->eax & 0x00FF) | (BAD_REGISTER_NUMBER << 8);
-           regs->eflags |= ((unsigned long)0x01); /* set carry flag */
-       }
-       i_printf("ax=0x%lx flags=0x%lx\n", regs->eax,regs->eflags);
-       return 1;
-    case 0xb10c:
-       i_printf("Slot=0x%x\n",CurrentPci->Slot.l);
-       if ((Slot = findPci(regs->ebx))) {
-           PciWrite16(regs->edi,(CARD16)regs->ecx,Slot);
-           regs->eax = (regs->eax & 0x00FF) | (SUCCESSFUL << 8);
-           regs->eflags &= ~((unsigned long)0x01); /* clear carry flag */
-       } else {
-           regs->eax = (regs->eax & 0x00FF) | (BAD_REGISTER_NUMBER << 8);
-           regs->eflags |= ((unsigned long)0x01); /* set carry flag */
-       }
-       i_printf("ax=0x%lx flags=0x%lx\n", regs->eax,regs->eflags);
-       return 1;
-    case 0xb10d:
-       i_printf("Slot=0x%x\n",CurrentPci->Slot.l);
-       if ((Slot = findPci(regs->ebx))) {
-           PciWrite32(regs->edi,(CARD32)regs->ecx,Slot);
-           regs->eax = (regs->eax & 0x00FF) | (SUCCESSFUL << 8);
-           regs->eflags &= ~((unsigned long)0x01); /* clear carry flag */
-       } else {
-           regs->eax = (regs->eax & 0x00FF) | (BAD_REGISTER_NUMBER << 8);
-           regs->eflags |= ((unsigned long)0x01); /* set carry flag */
-       }
-       i_printf("ax=0x%lx flags=0x%lx\n", regs->eax,regs->eflags);
-       return 1;
-    default:
-       return 0;
-    }
-}
diff --git a/board/MAI/bios_emulator/scitech/src/v86bios/io.c b/board/MAI/bios_emulator/scitech/src/v86bios/io.c
deleted file mode 100644 (file)
index f35b43e..0000000
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
- * Copyright 1999 Egbert Eich
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of the authors not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission.  The authors makes no representations
- * about the suitability of this software for any purpose.  It is provided
- * "as is" without express or implied warranty.
- *
- * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-#include "debug.h"
-
-#include <stdio.h>
-#if defined(__alpha__) || defined (__ia64__)
-#include <sys/io.h>
-#endif
-#include "AsmMacros.h"
-#include "v86bios.h"
-#include "pci.h"
-
-int r_inb = 0, r_inw = 0, r_inl = 0, r_outb = 0, r_outw = 0, r_outl = 0;
-int in_b = 0, in_w = 0, in_l = 0, out_b = 0, out_w = 0, out_l = 0;
-
-
-int
-port_rep_inb(CARD16 port, CARD8 *base, int d_f, CARD32 count)
-{
-    register int inc = d_f ? -1 : 1;
-    CARD8 *dst = base;
-
-    p_printf(" rep_insb(%#x) %d bytes at %p %s",
-            port, count, base, d_f?"up":"down");
-    if (Config.PrintIp)
-       p_printf(" %x\n",getIP());
-    else p_printf("\n");
-
-    r_inb++;
-    while (count--) {
-       *dst = inb(port);
-       dst += inc;
-    }
-    return (dst-base);
-}
-
-int
-port_rep_inw(CARD16 port, CARD16 *base, int d_f, CARD32 count)
-{
-    register int inc = d_f ? -1 : 1;
-    CARD16 *dst = base;
-
-    p_printf(" rep_insw(%#x) %d bytes at %p %s",
-            port, count, base, d_f?"up":"down");
-    if (Config.PrintIp)
-       p_printf(" %x\n",getIP());
-    else p_printf("\n");
-
-    r_inw++;
-    while (count--) {
-       *dst = inw(port);
-       dst += inc;
-    }
-    return (dst-base);
-}
-
-int
-port_rep_inl(CARD16 port, CARD32 *base, int d_f, CARD32 count)
-{
-    register int inc = d_f ? -1 : 1;
-    CARD32 *dst = base;
-
-    p_printf(" rep_insl(%#x) %d bytes at %p %s",
-            port, count, base, d_f?"up":"down");
-    if (Config.PrintIp)
-       p_printf(" %x\n",getIP());
-    else p_printf("\n");
-
-    r_inl++;
-    while (count--) {
-       *dst = inl(port);
-       dst += inc;
-    }
-    return (dst-base);
-}
-
-int
-port_rep_outb(CARD16 port, CARD8 *base, int d_f, CARD32 count)
-{
-    register int inc = d_f ? -1 : 1;
-    CARD8 *dst = base;
-
-    p_printf(" rep_outb(%#x) %d bytes at %p %s",
-            port, count, base, d_f?"up":"down");
-    if (Config.PrintIp)
-       p_printf(" %x\n",getIP());
-    else p_printf("\n");
-
-    r_outb++;
-    while (count--) {
-       outb(port,*dst);
-       dst += inc;
-    }
-    return (dst-base);
-}
-
-int
-port_rep_outw(CARD16 port, CARD16 *base, int d_f, CARD32 count)
-{
-    register int inc = d_f ? -1 : 1;
-    CARD16 *dst = base;
-
-    p_printf(" rep_outw(%#x) %d bytes at %p %s",
-            port, count, base, d_f?"up":"down");
-    if (Config.PrintIp)
-       p_printf(" %x\n",getIP());
-    else p_printf("\n");
-
-    r_outw++;
-    while (count--) {
-       outw(port,*dst);
-       dst += inc;
-    }
-    return (dst-base);
-}
-
-int
-port_rep_outl(CARD16 port, CARD32 *base, int d_f, CARD32 count)
-{
-    register int inc = d_f ? -1 : 1;
-    CARD32 *dst = base;
-
-    p_printf(" rep_outl(%#x) %d bytes at %p %s",
-            port, count, base, d_f?"up":"down");
-    if (Config.PrintIp)
-       p_printf(" %x\n",getIP());
-    else p_printf("\n");
-
-    r_outl++;
-    while (count--) {
-       outl(port,*dst);
-       dst += inc;
-    }
-    return (dst-base);
-}
-
-CARD8
-p_inb(CARD16 port)
-{
-    CARD8 val = 0;
-    in_b++;
-    val = inb(port);
-    p_printf(" inb(%#x) = %2.2x",port,val);
-    if (Config.PrintIp)
-       p_printf(" %x\n",getIP());
-    else p_printf("\n");
-
-    return val;
-}
-
-CARD16
-p_inw(CARD16 port)
-{
-    CARD16 val = 0;
-    in_w++;
-    val = inw(port);
-    p_printf(" inw(%#x) = %4.4x",port,val);
-    if (Config.PrintIp)
-       p_printf(" %x\n",getIP());
-    else p_printf("\n");
-
-    return val;
-}
-
-CARD32
-p_inl(CARD16 port)
-{
-    CARD32 val = 0;
-    in_l++;
-#ifdef NEED_PCI_IO
-    if (cfg1in(port,&val))
-       return val;
-    else
-#endif
-    val = inl(port);
-    p_printf(" inl(%#x) = %8.8x",port,val);
-    if (Config.PrintIp)
-       p_printf(" %x\n",getIP());
-    else p_printf("\n");
-
-    return val;
-}
-
-void
-p_outb(CARD16 port, CARD8 val)
-{
-    out_b++;
-    p_printf(" outb(%#x, %2.2x)",port,val);
-    if (Config.PrintIp)
-       p_printf(" %x\n",getIP());
-    else p_printf("\n");
-
-    outb(port,val);
-}
-
-void
-p_outw(CARD16 port, CARD16 val)
-{
-    out_w++;
-    p_printf(" outw(%#x, %4.4x)",port,val);
-    if (Config.PrintIp)
-       p_printf(" %x\n",getIP());
-    else p_printf("\n");
-
-    outw(port,val);
-}
-
-void
-p_outl(CARD16 port, CARD32 val)
-{
-    out_l++;
-    p_printf(" outl(%#x, %8.8x)",port,val);
-    if (Config.PrintIp)
-       p_printf(" %x\n",getIP());
-    else p_printf("\n");
-
-#ifdef NEED_PCI_IO
-    if (cfg1out(port,val))
-       return;
-#endif
-    outl(port,val);
-}
-
-void
-io_statistics(void)
-{
-    p_printf("rep: inb: %i, inw: %i, inl: %i, outb: %i, outw: %i, outl: %i\n",
-        r_inb,r_inw,r_inl,r_outb,r_outw,r_outl);
-    p_printf("inb: %i, inw: %i, inl: %i, outb: %i, outw: %i, outl: %i\n",
-        in_b,in_w,in_l,out_b,out_w,out_l);
-}
-
-void
-clear_stat(void)
-{
-    r_inb = r_inw = r_inl = r_outb = r_outw = r_outl = 0;
-    in_b = in_w = in_l = out_b = out_w = out_l = 0;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/v86bios/lex.l b/board/MAI/bios_emulator/scitech/src/v86bios/lex.l
deleted file mode 100644 (file)
index 3a3391c..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-%{
-#include "parser.h"
-
-#include <string.h>
-#include <stdio.h>
-
- void getline(char *buf,int *num,int max_num);
-    
-#define YY_INPUT(buf,result,max_size) {\
-      getline(buf,&result,max_size);\
-      }
-
- void
- yyerror (char *s)  
- {
-     printf ("%s\n", s);
- }
-
-%}
-
-DIGIT [0-9a-fA-F]
-
-%%
-
-"0x"?{DIGIT}+ { yylval = strtol(yytext,NULL,0); return TOK_NUM; }
-"ax"          { return TOK_REG_AX; }
-"bx"          { return TOK_REG_BX; }
-"cx"          { return TOK_REG_CX; }
-"dx"          { return TOK_REG_DX; }
-"di"          { return TOK_REG_SI; }
-"si"          { return TOK_REG_DI; }
-"ds"          { return TOK_SEG_DS; }
-"es"          { return TOK_SEG_ES; }
-":"           { return TOK_SEP;}
-"$"{DIGIT}{1,2} { yylval = strtol(yytext+1,NULL,0); return TOK_VAR; }
-"$mem"        { return TOK_VAR_MEM; }
-[ \t]+
-"#".*[\n]   { return TOK_END; }
-"boot"        { return TOK_COMMAND_BOOT; }
-"do"          { return TOK_COMMAND_EXEC; }
-"\"".*"\""    { yylval = (unsigned long) yytext; return TOK_STRING; }
-"byte"        { return TOK_BYTE; }
-"word"        { return TOK_WORD; }
-"long"        { return TOK_LONG; }
-"setmem"      { return TOK_COMMAND_MEMSET; }
-"dumpmem"     { return TOK_COMMAND_MEMDUMP; }
-"quit"        { return TOK_COMMAND_QUIT; }
-"\n"          { return TOK_END; }
-"select"      { return TOK_SELECT; }
-"isa"         { return TOK_ISA; }
-"pci"         { return TOK_PCI; }
-"pport"       { return TOK_PRINT_PORT; }
-"iostat"      { return TOK_IOSTAT; }
-"pirq"        { return TOK_PRINT_IRQ; }
-"ppci"        { return TOK_PPCI; }
-"pip"         { return TOK_PIP; }
-"trace"       { return TOK_TRACE; }
-"on"          { return TOK_ON; }
-"off"         { return TOK_OFF; }
-"verbose"     { return TOK_VERBOSE; }
-"log"         { return TOK_LOG; }
-"print"       { return TOK_STDOUT; }
-"clstat"      { return TOK_CLSTAT; }
-"hlt"         { return TOK_HLT; }
-"del"         { return TOK_DEL; }
-"ioperm"      { return TOK_IOPERM; }
-"lpci"        { return TOK_DUMP_PCI; }
-"bootbios"    { return TOK_BOOT_BIOS; }
-"?"           { return '?'; }
-.             { return TOK_ERROR; }
-    
-%%
-
-
-
-
-
-
-
diff --git a/board/MAI/bios_emulator/scitech/src/v86bios/main.c b/board/MAI/bios_emulator/scitech/src/v86bios/main.c
deleted file mode 100644 (file)
index 15f9115..0000000
+++ /dev/null
@@ -1,616 +0,0 @@
-/*
- * Copyright 1999 Egbert Eich
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of the authors not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission.  The authors makes no representations
- * about the suitability of this software for any purpose.  It is provided
- * "as is" without express or implied warranty.
- *
- * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-#define DELETE
-#include <unistd.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <sys/mman.h>
-#include <sys/types.h>
-#include <string.h>
-#include <stdlib.h>
-#include <signal.h>
-#include <sys/stat.h>
-#if defined(__alpha__) || defined (__ia64__)
-#include <sys/io.h>
-#elif defined(HAVE_SYS_PERM)
-#include <sys/perm.h>
-#endif
-#include "debug.h"
-#include "v86bios.h"
-#include "pci.h"
-#include "AsmMacros.h"
-
-#define SIZE 0x100000
-#define VRAM_START 0xA0000
-#define VRAM_SIZE 0x1FFFF
-#define V_BIOS_SIZE 0x1FFFF
-#define BIOS_START 0x7C00            /* default BIOS entry */
-
-/*CARD8 code[] = { 0xb8 , 0xf0 , 0xf0, 0xf4 }; */
-#define VB_X(x) (V_BIOS >> x) & 0xFF
-CARD8 code[] = { 0x9a, 0x03, 0x00, 0x00, VB_X(12), 0xf4 };
-/*CARD8 code[] = { 0x9a, 0x03, 0x00, 0x00, VB_X(12), 0xb8, 0x03, 0x00, */
-/*0xcd, 0x10, 0xf4 }; */
-/*CARD8 code[] = {  0xb8 , 0xf0 , 0xf0 ,0xf4 }; */
-
-static void sig_handler(int);
-static int map(void);
-static void unmap(void);
-static void bootBIOS(CARD16 ax);
-static int map_vram(void);
-static void unmap_vram(void);
-static int copy_vbios(void);
-static int copy_sys_bios(void);
-static void save_bios_to_file(void);
-static int setup_system_bios(void);
-static void setup_int_vect(void);
-static int chksum(CARD8 *start);
-static void setup_bios_regs(i86biosRegsPtr regs, CARD32 ax);
-
-void loadCodeToMem(unsigned char *ptr, CARD8 *code);
-void dprint(unsigned long start, unsigned long size);
-
-static int vram_mapped = 0;
-static CARD8 save_msr;
-static CARD8 save_pos102;
-static CARD8 save_vse;
-static CARD8 save_46e8;
-console Console;
-struct config Config;
-
-
-int
-main(void)
-{
-    int Active_is_Pci = 0;
-#ifdef DELETE
-    Config.PrintPort = PRINT_PORT;
-    Config.IoStatistics = IO_STATISTICS;
-    Config.PrintIrq = PRINT_IRQ;
-    Config.PrintPci = PRINT_PCI;
-    Config.ShowAllDev = SHOW_ALL_DEV;
-    Config.PrintIp = PRINT_IP;
-    Config.SaveBios = SAVE_BIOS;
-    Config.Trace = TRACE;
-    Config.ConfigActiveOnly = CONFIG_ACTIVE_ONLY;
-    Config.ConfigActiveDevice = CONFIG_ACTIVE_DEVICE;
-    Config.MapSysBios = MAP_SYS_BIOS;
-    Config.Resort = RESORT;
-    Config.FixRom = FIX_ROM;
-    Config.NoConsole = NO_CONSOLE;
-    Config.Verbose = VERBOSE;
-
-    if (!map())
-       exit(1);
-
-    if (!setup_system_bios())
-       exit(1);
-
-    iopl(3);
-    setup_io();
-
-    scan_pci();
-    if (!CurrentPci && !Config.ConfigActiveDevice && !Config.ConfigActiveOnly)
-       exit (1);
-#endif
-    Console = open_console();
-
-    if (Config.ConfigActiveOnly) {
-       CARD16 ax;
-       int activePci = 0;
-       int error = 0;
-
-       while (CurrentPci) {
-           if (CurrentPci->active) {
-               activePci = 1;
-                           if (!(mapPciRom(NULL) && chksum((CARD8*)V_BIOS)))
-                               error = 1;
-                           break;
-           }
-           CurrentPci = CurrentPci->next;
-       }
-       ax = ((CARD16)(CurrentPci->bus) << 8)
-           | (CurrentPci->dev << 3) | (CurrentPci->func & 0x7);
-       P_printf("ax: 0x%x\n",ax);
-       setup_int_vect();
-       if (!error && (activePci || copy_vbios())) {
-
-           if (Config.SaveBios) save_bios_to_file();
-           if  (map_vram()) {
-               printf("initializing ISA\n");
-                           bootBIOS(0);
-           }
-       }
-       unmap_vram();
-       sleep(1);
-    } else {
-       /* disable primary card */
-       save_msr = inb(0x3CC);
-       save_vse = inb(0x3C3);
-       save_46e8 = inb(0x46e8);
-       save_pos102 = inb(0x102);
-
-       signal(2,sig_handler);
-       signal(11,sig_handler);
-
-       outb(0x3C2,~(CARD8)0x03 & save_msr);
-       outb(0x3C3,~(CARD8)0x01 & save_vse);
-       outb(0x46e8, ~(CARD8)0x08 & save_46e8);
-       outb(0x102, ~(CARD8)0x01 & save_pos102);
-
-       pciVideoDisable();
-
-       while (CurrentPci) {
-           CARD16 ax;
-
-           if (CurrentPci->active) {
-               Active_is_Pci = 1;
-               if (!Config.ConfigActiveDevice) {
-                   CurrentPci = CurrentPci->next;
-                   continue;
-               }
-           }
-
-           EnableCurrent();
-
-           if (CurrentPci->active) {
-               outb(0x102, save_pos102);
-               outb(0x46e8, save_46e8);
-               outb(0x3C3, save_vse);
-               outb(0x3C2, save_msr);
-           }
-
-           /* clear interrupt vectors */
-           setup_int_vect();
-
-           ax = ((CARD16)(CurrentPci->bus) << 8)
-               | (CurrentPci->dev << 3) | (CurrentPci->func & 0x7);
-           P_printf("ax: 0x%x\n",ax);
-
-           if (!((mapPciRom(NULL) && chksum((CARD8*)V_BIOS))
-                 || (CurrentPci->active && copy_vbios()))) {
-               CurrentPci = CurrentPci->next;
-               continue;
-           }
-           if (!map_vram()) {
-               CurrentPci = CurrentPci->next;
-               continue;
-           }
-           if (Config.SaveBios) save_bios_to_file();
-           printf("initializing PCI bus: %i dev: %i func: %i\n",CurrentPci->bus,
-                  CurrentPci->dev,CurrentPci->func);
-           bootBIOS(ax);
-           unmap_vram();
-
-           CurrentPci = CurrentPci->next;
-       }
-
-       /* We have an ISA device - configure if requested */
-       if (!Active_is_Pci && Config.ConfigActiveDevice) {
-           pciVideoDisable();
-
-           outb(0x102, save_pos102);
-           outb(0x46e8, save_46e8);
-           outb(0x3C3, save_vse);
-           outb(0x3C2, save_msr);
-
-           setup_int_vect();
-           if (copy_vbios()) {
-
-               if (Config.SaveBios) save_bios_to_file();
-               if  (map_vram()) {
-                   printf("initializing ISA\n");
-                   bootBIOS(0);
-               }
-           }
-
-           unmap_vram();
-           sleep(1);
-       }
-
-       pciVideoRestore();
-
-       outb(0x102, save_pos102);
-       outb(0x46e8, save_46e8);
-       outb(0x3C3, save_vse);
-       outb(0x3C2, save_msr);
-    }
-
-    close_console(Console);
-#ifdef DELETE
-    iopl(0);
-    unmap();
-
-    printf("done !\n");
-#endif
-    if (Config.IoStatistics)
-       io_statistics();
-#ifdef DELETE
-    exit(0);
-#endif
-}
-
-int
-map(void)
-{
-    void* mem;
-
-    mem = mmap(0, (size_t)SIZE,
-              PROT_EXEC | PROT_READ | PROT_WRITE,
-              MAP_FIXED | MAP_PRIVATE | MAP_ANON,
-              -1, 0 );
-    if (mem != 0) {
-       perror("anonymous map");
-       return (0);
-    }
-    memset(mem,0,SIZE);
-
-    loadCodeToMem((unsigned char *) BIOS_START, code);
-    return (1);
-}
-
-static void
-unmap(void)
-{
-    munmap(0,SIZE);
-}
-
-static void
-bootBIOS(CARD16 ax)
-{
-    i86biosRegs bRegs;
-#ifdef V86BIOS_DEBUG
-    printf("starting BIOS\n");
-#endif
-    setup_bios_regs(&bRegs, ax);
-    do_x86(BIOS_START,&bRegs);
-#ifdef V86BIOS_DEBUG
-    printf("done\n");
-#endif
-}
-
-static int
-map_vram(void)
-{
-    int mem_fd;
-
-#ifdef __ia64__
-    if ((mem_fd = open(MEM_FILE,O_RDWR | O_SYNC))<0)
-#else
-    if ((mem_fd = open(MEM_FILE,O_RDWR))<0)
-#endif
-      {
-       perror("opening memory");
-       return 0;
-    }
-
-#ifndef __alpha__
-    if (mmap((void *) VRAM_START, (size_t) VRAM_SIZE,
-                    PROT_EXEC | PROT_READ | PROT_WRITE, MAP_SHARED | MAP_FIXED,
-                    mem_fd, VRAM_START) == (void *) -1)
-#else
-        if (!_bus_base()) sparse_shift = 7; /* Uh, oh, JENSEN... */
-        if (!_bus_base_sparse()) sparse_shift = 0;
-        if ((vram_map = mmap(0,(size_t) (VRAM_SIZE << sparse_shift),
-                                                PROT_READ | PROT_WRITE,
-                                                MAP_SHARED,
-                                                mem_fd, (VRAM_START << sparse_shift)
-                                                | _bus_base_sparse())) == (void *) -1)
-#endif
-      {
-       perror("mmap error in map_hardware_ram");
-           close(mem_fd);
-           return (0);
-       }
-    vram_mapped = 1;
-    close(mem_fd);
-    return (1);
-}
-
-static void
-unmap_vram(void)
-{
-    if (!vram_mapped) return;
-
-    munmap((void*)VRAM_START,VRAM_SIZE);
-    vram_mapped = 0;
-}
-
-static int
-copy_vbios(void)
-{
-    int mem_fd;
-    unsigned char *tmp;
-    int size;
-
-    if ((mem_fd = open(MEM_FILE,O_RDONLY))<0) {
-       perror("opening memory");
-       return (0);
-    }
-
-    if (lseek(mem_fd,(off_t) V_BIOS, SEEK_SET) != (off_t) V_BIOS) {
-         fprintf(stderr,"Cannot lseek\n");
-         goto Error;
-      }
-    tmp = (unsigned char *)malloc(3);
-    if (read(mem_fd, (char *)tmp, (size_t) 3) != (size_t) 3) {
-           fprintf(stderr,"Cannot read\n");
-       goto Error;
-    }
-    if (lseek(mem_fd,(off_t) V_BIOS,SEEK_SET) != (off_t) V_BIOS)
-       goto Error;
-
-    if (*tmp != 0x55 || *(tmp+1) != 0xAA ) {
-#ifdef DEBUG
-       dprint((unsigned long)tmp,0x100);
-#endif
-       fprintf(stderr,"No bios found at: 0x%x\n",V_BIOS);
-       goto Error;
-    }
-    size = *(tmp+2) * 512;
-
-    if (read(mem_fd, (char *)V_BIOS, (size_t) size) != (size_t) size) {
-           fprintf(stderr,"Cannot read\n");
-       goto Error;
-    }
-    free(tmp);
-    close(mem_fd);
-    if (!chksum((CARD8)V_BIOS))
-       return (0);
-
-    return (1);
-
-Error:
-    perror("v_bios");
-    close(mem_fd);
-    return (0);
-}
-
-static int
-copy_sys_bios(void)
-{
-#define SYS_BIOS 0xF0000
-    int mem_fd;
-
-    if ((mem_fd = open(MEM_FILE,O_RDONLY))<0) {
-       perror("opening memory");
-       return (0);
-    }
-
-    if (lseek(mem_fd,(off_t) SYS_BIOS,SEEK_SET) != (off_t) SYS_BIOS)
-       goto Error;
-    if (read(mem_fd, (char *)SYS_BIOS, (size_t) 0xFFFF) != (size_t) 0xFFFF)
-       goto Error;
-
-    close(mem_fd);
-    return (1);
-
-Error:
-    perror("sys_bios");
-    close(mem_fd);
-    return (0);
-}
-
-void
-loadCodeToMem(unsigned char *ptr, CARD8 code[])
-{
-    int i;
-    CARD8 val;
-
-    for ( i=0;;i++) {
-       val = code[i];
-       *ptr++ = val;
-       if (val == 0xf4) break;
-    }
-    return;
-}
-
-void
-dprint(unsigned long start, unsigned long size)
-{
-    int i,j;
-    char *c = (char *)start;
-
-    for (j = 0; j < (size >> 4); j++) {
-    char *d = c;
-    printf("\n0x%lx:  ",(unsigned long)c);
-    for (i = 0; i<16; i++)
-       printf("%2.2x ",(unsigned char) (*(c++)));
-    c = d;
-    for (i = 0; i<16; i++) {
-       printf("%c",((((CARD8)(*c)) > 32) && (((CARD8)(*c)) < 128)) ?
-          (unsigned char) (*(c)): '.');
-       c++;
-    }
-    }
-    printf("\n");
-}
-
-static void
-save_bios_to_file(void)
-{
-    static int num = 0;
-    int size, count;
-    char file_name[256];
-    int fd;
-
-    sprintf(file_name,"bios_%i.fil",num);
-    if ((fd =  open(file_name,O_WRONLY | O_CREAT | O_TRUNC,00644)) == -1)
-       return;
-    size = (*(unsigned char*)(V_BIOS + 2)) * 512;
-#ifdef V86BIOS_DEBUG
-    dprint(V_BIOS,20);
-#endif
-    if ((count = write(fd,(void *)(V_BIOS),size)) != size)
-       fprintf(stderr,"only saved %i of %i bytes\n",size,count);
-    num++;
-}
-
-static void
-sig_handler(int unused)
-{
-    fflush(stdout);
-    fflush(stderr);
-
-    /* put system back in a save state */
-    unmap_vram();
-    pciVideoRestore();
-    outb(0x102, save_pos102);
-    outb(0x46e8, save_46e8);
-    outb(0x3C3, save_vse);
-    outb(0x3C2, save_msr);
-
-    close_console(Console);
-    iopl(0);
-    unmap();
-
-    exit(1);
-}
-
-/*
- * For initialization we just pass ax to the BIOS.
- * PCI BIOSes need this. All other register are set 0.
- */
-static void setup_bios_regs(i86biosRegsPtr regs, CARD32 ax)
-{
-    regs->ax = ax;
-    regs->bx = 0;
-    regs->cx = 0;
-    regs->dx = 0;
-    regs->es = 0;
-    regs->di = 0;
-}
-
-/*
- * here we are really paranoid about faking a "real"
- * BIOS. Most of this information was pulled from
- * dosem.
- */
-static void
-setup_int_vect(void)
-{
-    const CARD16 cs = 0x0000;
-    const CARD16 ip = 0x0;
-    int i;
-
-    /* let the int vects point to the SYS_BIOS seg */
-    for (i=0; i<0x80; i++) {
-       ((CARD16*)0)[i<<1] = ip;
-       ((CARD16*)0)[(i<<1)+1] = cs;
-    }
-    /* video interrupts default location */
-    ((CARD16*)0)[(0x42<<1)+1] = 0xf000;
-    ((CARD16*)0)[0x42<<1] = 0xf065;
-    ((CARD16*)0)[(0x10<<1)+1] = 0xf000;
-    ((CARD16*)0)[0x10<<1] = 0xf065;
-    /* video param table default location (int 1d) */
-    ((CARD16*)0)[(0x1d<<1)+1] = 0xf000;
-    ((CARD16*)0)[0x1d<<1] = 0xf0A4;
-    /* font tables default location (int 1F) */
-    ((CARD16*)0)[(0x1f<<1)+1] = 0xf000;
-    ((CARD16*)0)[0x1f<<1] = 0xfa6e;
-
-    /* int 11 default location */
-    ((CARD16*)0)[(0x11<1)+1] = 0xf000;
-    ((CARD16*)0)[0x11<<1] = 0xf84d;
-    /* int 12 default location */
-    ((CARD16*)0)[(0x12<<1)+1] = 0xf000;
-    ((CARD16*)0)[0x12<<1] = 0xf841;
-    /* int 15 default location */
-    ((CARD16*)0)[(0x15<<1)+1] = 0xf000;
-    ((CARD16*)0)[0x15<<1] = 0xf859;
-    /* int 1A default location */
-    ((CARD16*)0)[(0x1a<<1)+1] = 0xf000;
-    ((CARD16*)0)[0x1a<<1] = 0xff6e;
-    /* int 05 default location */
-    ((CARD16*)0)[(0x05<<1)+1] = 0xf000;
-    ((CARD16*)0)[0x05<<1] = 0xff54;
-    /* int 08 default location */
-    ((CARD16*)0)[(0x8<<1)+1] = 0xf000;
-    ((CARD16*)0)[0x8<<1] = 0xfea5;
-    /* int 13 default location (fdd) */
-    ((CARD16*)0)[(0x13<<1)+1] = 0xf000;
-    ((CARD16*)0)[0x13<<1] = 0xec59;
-    /* int 0E default location */
-    ((CARD16*)0)[(0xe<<1)+1] = 0xf000;
-    ((CARD16*)0)[0xe<<1] = 0xef57;
-    /* int 17 default location */
-    ((CARD16*)0)[(0x17<<1)+1] = 0xf000;
-    ((CARD16*)0)[0x17<<1] = 0xefd2;
-    /* fdd table default location (int 1e) */
-    ((CARD16*)0)[(0x1e<<1)+1] = 0xf000;
-    ((CARD16*)0)[0x1e<<1] = 0xefc7;
-}
-
-static int
-setup_system_bios(void)
-{
-    char *date = "06/01/99";
-    char *eisa_ident = "PCI/ISA";
-
-#if MAP_SYS_BIOS
-    if (!copy_sys_bios()) return 0;
-    return 1;
-#endif
-/*    memset((void *)0xF0000,0xf4,0xfff7); */
-
-    /*
-     * we trap the "industry standard entry points" to the BIOS
-     * and all other locations by filling them with "hlt"
-     * TODO: implement hlt-handler for these
-     */
-    memset((void *)0xF0000,0xf4,0x10000);
-
-    /*
-     * TODO: we should copy the fdd table (0xfec59-0xfec5b)
-     * the video parameter table (0xf0ac-0xf0fb)
-     * and the font tables (0xfa6e-0xfe6d)
-     * from the original bios here
-     */
-
-    /* set bios date */
-    strcpy((char *)0xFFFF5,date);
-    /* set up eisa ident string */
-    strcpy((char *)0xFFFD9,eisa_ident);
-    /* write system model id for IBM-AT */
-    ((char *)0)[0xFFFFE] = 0xfc;
-
-    return 1;
-}
-
-static int
-chksum(CARD8 *start)
-{
-  CARD16 size;
-  CARD8 val = 0;
-  int i;
-
-  size = *(start+2) * 512;
-  for (i = 0; i<size; i++)
-    val += *(start + i);
-
-  if (!val)
-    return 1;
-
-    fprintf(stderr,"BIOS cksum wrong!\n");
-  return 0;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/v86bios/makefile.linux b/board/MAI/bios_emulator/scitech/src/v86bios/makefile.linux
deleted file mode 100644 (file)
index 5dfe306..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-CFLAGS=-g -I/usr/include -I../../include/ -O0 -Wall
-CC=gcc
-
-.y.c:
-    bison -d -o $@ $<
-.l.c:
-    flex -o$@ $< 
-
-SRCS = main.c io.c x86emu.c int.c pci.c
-OBJS = main.o io.o x86emu.o int.o pci.o
-
-all : vbios.vm86 v86bios.vm86 cbios.vm86 cbios.x86emu vbios.x86emu v86bios.x86emu 
-#all :  cbios.x86emu vbios.x86emu v86bios.x86emu 
-
-parser.c : parser.y
-lex.c : lex.l
-cbios.o : cbios.c v86bios.h debug.h
-main.o : main.c v86bios.h pci.h debug.h
-io.o : v86bios.h AsmMacros.h debug.h
-mem.o : mem.c debug.h v86bios.h
-int.o : int.c v86bios.h debug.h
-pci.o : pci.c pci.h debug.h
-console.o : console.c v86bios.h debug.h
-v86.o : v86.c debug.h
-parser.o : parser.c
-lex.o : lex.c
-v86bios.o: v86bios.c v86bios.h pci.h debug.h
-logging.o: logging.c v86bios.h
-x86emu.o : x86emu.c v86bios.h debug.h
-    $(CC) -c -DX86EMU $(CFLAGS) $*.c
-
-vbios.x86emu : main.o x86emu.o io.o int.o pci.o console.o mem.o logging.o
-    gcc -Wl,-defsym -Wl,printk=lprintf -o vbios.x86emu main.o \
-    x86emu.o io.o int.o pci.o console.o mem.o logging.o \
-    -L../x86emu -lx86emud -lc 
-vbios.vm86 : main.o v86.o io.o int.o pci.o console.o logging.o
-    gcc -o vbios.vm86 main.o v86.o io.o int.o pci.o console.o \
-    logging.o -lc 
-cbios.x86emu : cbios.o x86emu.o io.o int.o pci.o console.o mem.o logging.o
-    gcc -Wl,-defsym -Wl,printk=lprintf -o cbios.x86emu cbios.o \
-    x86emu.o io.o int.o pci.o console.o mem.o logging.o \
-    -L../x86emu -lx86emud -lc 
-cbios.vm86 : cbios.o v86.o io.o int.o pci.o console.o logging.o
-    gcc -o cbios.vm86 cbios.o v86.o io.o int.o pci.o console.o \
-    logging.o -lc 
-v86bios.vm86: command.o parser.o lex.o v86bios.o v86.o io.o int.o pci.o console.o logging.o
-     gcc -o v86bios.vm86 command.o parser.o lex.o v86bios.o v86.o io.o \
-     int.o pci.o console.o logging.o -L/usr/lib/curses -lfl \
-     -lreadline -lc -lncurses /usr/lib/libc.a
-v86bios.x86emu: command.o parser.o lex.o v86bios.o x86emu.o io.o int.o pci.o console.o logging.o
-    gcc -Wl,-defsym -Wl,printk=lprintf -o v86bios.x86emu \
-    command.o parser.o lex.o v86bios.o x86emu.o io.o \
-    int.o pci.o console.o logging.o -L/usr/lib/curses -lfl \
-    -lreadline -lc -lncurses  /usr/lib/libc.a -L../x86emu -lx86emud
-
-clean:
-    rm -f *.o vbios.x86emu vbios.vm86 cbios.x86emu cbios.vm86 parser.c \
-    lex.c parser.h v86bios.x86emu v86bios.vm86
-
diff --git a/board/MAI/bios_emulator/scitech/src/v86bios/mem.c b/board/MAI/bios_emulator/scitech/src/v86bios/mem.c
deleted file mode 100644 (file)
index 24c1aef..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Copyright 1999 Egbert Eich
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of the authors not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission.  The authors makes no representations
- * about the suitability of this software for any purpose.  It is provided
- * "as is" without express or implied warranty.
- *
- * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-#include "debug.h"
-#include "v86bios.h"
-#include "x86emu.h"
-
-#ifdef __alpha__
-
-void* vram_map = 0;
-int sparse_shift = 5;
-
-#define mem_barrier()        __asm__ __volatile__("mb"  : : : "memory")
-
-#define vuip    volatile unsigned int *
-
-CARD8
-mem_rb(CARD32 addr)
-{
-  unsigned long result, shift;
-#if 1
-  if (addr >= 0xA0000 && addr <= 0xBFFFF) {
-    addr -= 0xA0000;
-    shift = (addr & 0x3) * 8;
-    result = *(vuip) ((unsigned long)vram_map + (addr << sparse_shift));
-    result >>= shift;
-    return 0xffUL & result;
-  } else
-#endif
-    return rdb(addr);
-}
-
-CARD16
-mem_rw(CARD32 addr)
-{
-  unsigned long result, shift;
-#if 1
-  if (addr >= 0xA0000 && addr <= 0xBFFFF) {
-    addr -= 0xA0000;
-    shift = (addr & 0x2) * 8;
-    result = *(vuip)((unsigned long)vram_map+(addr<<sparse_shift)
-            +(1<<(sparse_shift-2)));
-    result >>= shift;
-    return 0xffffUL & result;
-  } else
-#endif
-    return rdw(addr);
-}
-
-CARD32
-mem_rl(CARD32 addr)
-{
-  unsigned long result;
-#if 1
-  if (addr >= 0xA0000 && addr <= 0xBFFFF) {
-    addr -= 0xA0000;
-    result = *(vuip)((unsigned long)vram_map+(addr<<sparse_shift)+(3<<(sparse_shift-2)));
-    return result;
-  } else
-#endif
-    return rdl(addr);
-}
-
-void
-mem_wb(CARD32 addr, CARD8 val)
-{
-    unsigned int b = val & 0xffU;
-#if 1
-  if (addr >= 0xA0000 && addr <= 0xBFFFF) {
-    addr -= 0xA0000;
-    *(vuip) ((unsigned long)vram_map + (addr << sparse_shift)) = b * 0x01010101;
-    mem_barrier();
-  } else
-#endif
-    wrb(addr,val);
-}
-
-void
-mem_ww(CARD32 addr, CARD16 val)
-{
-  unsigned int w = val & 0xffffU;
-#if 1
-  if (addr >= 0xA0000 && addr <= 0xBFFFF) {
-    addr -= 0xA0000;
-    *(vuip)((unsigned long)vram_map+(addr<<sparse_shift)
-       +(1<<(sparse_shift-2))) = w * 0x00010001;
-    mem_barrier();
-  } else
-#endif
-    wrw(addr,val);
-}
-
-void
-mem_wl(CARD32 addr, CARD32 val)
-{
-#if 1
-  if (addr >= 0xA0000 && addr <= 0xBFFFF) {
-    addr -= 0xA0000;
-    *(vuip)((unsigned long)vram_map+(addr<<sparse_shift)
-       +(3<<(sparse_shift-2))) = val;
-    mem_barrier();
-  } else
-#endif
-    wrl(addr,val);
-}
-#endif
diff --git a/board/MAI/bios_emulator/scitech/src/v86bios/parser.y b/board/MAI/bios_emulator/scitech/src/v86bios/parser.y
deleted file mode 100644 (file)
index 21c4023..0000000
+++ /dev/null
@@ -1,498 +0,0 @@
-%{
-#include <malloc.h>
-#include <string.h>
-#include "v86bios.h"
-#include "pci.h"
-    
-#define YYSTYPE unsigned long
-    
-#define MAX_VAR 0x20
-
-    CARD32 var[MAX_VAR];
-    CARD32 var_mem;
-
-
-i86biosRegs regs = { 00 };
-
-enum mem_type { BYTE, WORD, LONG, STRING };
-union mem_val {
-   CARD32 integer;
-   char *ptr;
-} rec;
-
-struct mem {
-    enum mem_type type;
-        union mem_val val;
-    struct mem *next;
-}; 
-
-struct device Device = {FALSE,NONE,{0}};
-
-extern void yyerror(char *s);
-extern int yylex( void  );
-static void boot(void);
-static void dump_mem(CARD32 addr, int len);
-static void exec_int(int num);
-static void *add_to_list(enum mem_type type, union mem_val *rec, void *next);
-static void do_list(struct mem *list, memType addr);
-static char * normalize_string(char *ptr);
-%}
-
-%token TOK_NUM
-%token TOK_REG_AX
-%token TOK_REG_BX
-%token TOK_REG_CX
-%token TOK_REG_DX
-%token TOK_REG_DI
-%token TOK_REG_SI
-%token TOK_SEG_DS
-%token TOK_SEG_ES
-%token TOK_SEP
-%token TOK_VAR
-%token TOK_VAR_MEM
-%token TOK_COMMAND_BOOT
-%token TOK_COMMAND_EXEC
-%token TOK_SELECT
-%token TOK_STRING
-%token TOK_MODIFIER_BYTE
-%token TOK_MODIFIER_WORD
-%token TOK_MODIFIER_LONG
-%token TOK_MODIFIER_MEMSET
-%token TOK_COMMAND_MEMSET
-%token TOK_COMMAND_MEMDUMP
-%token TOK_COMMAND_QUIT
-%token TOK_ERROR
-%token TOK_END
-%token TOK_ISA
-%token TOK_PCI
-%token TOK_BYTE
-%token TOK_WORD
-%token TOK_LONG
-%token TOK_PRINT_PORT
-%token TOK_IOSTAT
-%token TOK_PRINT_IRQ
-%token TOK_PPCI
-%token TOK_PIP
-%token TOK_TRACE
-%token TOK_ON
-%token TOK_OFF
-%token TOK_VERBOSE
-%token TOK_LOG
-%token TOK_LOGOFF
-%token TOK_CLSTAT
-%token TOK_STDOUT
-%token TOK_HLT
-%token TOK_DEL
-%token TOK_IOPERM
-%token TOK_DUMP_PCI
-%token TOK_BOOT_BIOS
-%%
-input:        | input line  
-line:          end |  com_reg | com_var | com_select
-              | com_boot | com_memset | com_memdump  | com_quit 
-              | com_exec | hlp | config | verbose | logging | print | clstat 
-              | com_hlt | ioperm | list_pci | boot_bios 
-              | error end  { printf("unknown command\n"); }
-;
-end:           TOK_END
-;
-com_reg:        reg_off val end { *(CARD16*)$1 = $2 & 0xffff; }
-              | reg_seg TOK_SEP reg_off val end {
-                               *(CARD16*)$1 = ($4 & 0xf0000) >> 4;
-                                       *(CARD16*)$3 = ($4 & 0x0ffff);
-                                        }
-              |  reg_off '?' end { printf("0x%x\n",*(CARD16*)$1);}
-              |  reg_seg TOK_SEP reg_off '?' end
-                                     { printf("0x%x:0x%x\n",*(CARD16*)$1,
-                          *(CARD16*)$3); }
-;
-register_read:  reg_seg TOK_SEP reg_off { $$ = (((*(CARD16*)$1) << 4) 
-                                                | ((*(CARD16*)$3) & 0xffff));
-                                        }
-              | reg_off          { $$ = ((*(CARD16*)$1) & 0xffff); }
-;
-reg_off:        TOK_REG_AX  { $$ = (unsigned long)&(regs.ax); }
-              | TOK_REG_BX  { $$ = (unsigned long)&(regs.bx); }
-              | TOK_REG_CX  { $$ = (unsigned long)&(regs.cx); }
-              | TOK_REG_DX  { $$ = (unsigned long)&(regs.dx); }
-              | TOK_REG_DI  { $$ = (unsigned long)&(regs.di); }
-              | TOK_REG_SI  { $$ = (unsigned long)&(regs.si); }
-;
-reg_seg:        TOK_SEG_DS  { $$ = (unsigned long)&(regs.ds); }
-              | TOK_SEG_ES  { $$ = (unsigned long)&(regs.es); }
-;
-com_var:        TOK_VAR_MEM '?' end { printf("var mem: 0x%x\n",var_mem); }
-          | TOK_VAR '?' end { if ($1 < MAX_VAR)
-          printf("var[%i]: 0x%x\n",(int)$1,var[$1]);
-          else
-          printf("var index %i out of range\n",(int)$1); }
-          | TOK_VAR_MEM val end { var_mem = $2; }    
-              | TOK_VAR val end    { if ($1 <= MAX_VAR)
-                                 var[$1] = $2;
-                              else 
-                                     printf("var index %i out of range\n",(int)$1); }
-              | TOK_VAR error  end { printf("$i val\n"); }
-              | TOK_VAR_MEM error  end { printf("$i val\n"); }
-;
-com_boot:       TOK_COMMAND_BOOT  end { boot(); }
-                TOK_COMMAND_BOOT error end { boot(); }
-;
-com_select:     TOK_SELECT TOK_ISA end { Device.booted = FALSE;
-                                         Device.type = ISA;
-                     CurrentPci = NULL; }   
-              | TOK_SELECT TOK_PCI val TOK_SEP val TOK_SEP val end
-                                    { Device.booted = FALSE;
-                      Device.type = PCI; 
-                                      Device.loc.pci.bus = $3;
-                                      Device.loc.pci.dev = $5; 
-                                      Device.loc.pci.func = $7; }
-              | TOK_SELECT '?' end
-                                   { switch (Device.type) {
-                                     case ISA:
-                                       printf("isa\n");
-                                       break;
-                                     case PCI:
-                                      printf("pci: %x:%x:%x\n",Device.loc.pci.bus,
-                                              Device.loc.pci.dev,
-                          Device.loc.pci.func);
-                                      break;
-                                 default:
-                                      printf("no device selected\n");
-                                      break;
-                                     }
-                                    }
-              | TOK_SELECT error end { printf("select ? | isa "
-                                         "| pci:bus:dev:func\n"); }
-;
-com_quit:       TOK_COMMAND_QUIT end { return 0; }
-              | TOK_COMMAND_QUIT error end { logoff(); return 0; }
-;
-com_exec:       TOK_COMMAND_EXEC end { exec_int(0x10); }
-          | TOK_COMMAND_EXEC val end { exec_int($2); }
-          | TOK_COMMAND_EXEC error end { exec_int(0x10); }
-;
-com_memdump:    TOK_COMMAND_MEMDUMP val val end { dump_mem($2,$3); }
-              | TOK_COMMAND_MEMDUMP  error  end { printf("memdump start len\n"); }
-
-    
-;
-com_memset:     TOK_COMMAND_MEMSET val list end { do_list((struct mem*)$3,$2);}
-              | TOK_COMMAND_MEMSET error end { printf("setmem addr [byte val] "
-                                                   "[word val] [long val] "
-                                                   "[\"string\"]\n"); }
-;
-list:                              { $$ = 0; } 
-              | TOK_BYTE val list { rec.integer = $2;
-          $$ = (unsigned long)add_to_list(BYTE,&rec,(void*)$3); }
-              | TOK_WORD val list { rec.integer = $2; 
-          $$ = (unsigned long) add_to_list(WORD,&rec,(void*)$3); }
-              | TOK_LONG val list { rec.integer = $2; 
-          $$ = (unsigned long) add_to_list(LONG,&rec,(void*)$3); }
-              | TOK_STRING list { rec.ptr = (void*)$1; 
-          $$ = (unsigned long) add_to_list(STRING,&rec,(void*)$2); }
-;
-val:            TOK_VAR  {  if ($1 > MAX_VAR) {
-                             printf("variable index out of range\n");
-                             $$=0;
-                             } else 
-                            $$ = var[$1]; } 
-              | TOK_NUM  {  $$ = $1; }
-              | register_read
-; 
-bool:           TOK_ON   {  $$ = 1; }
-              | TOK_OFF  {  $$ = 0; }
-;
-config:         TOK_PRINT_PORT bool end { Config.PrintPort = $2; } 
-              | TOK_PRINT_PORT '?' end  { printf("print port %s\n",
-                                      Config.PrintPort?"on":"off"); }
-          | TOK_PRINT_PORT error end { printf("pport on | off | ?\n") } 
-              | TOK_PRINT_IRQ bool end  { Config.PrintIrq = $2; } 
-              | TOK_PRINT_IRQ '?' end   { printf("print irq %s\n",  
-                                          Config.PrintIrq?"on":"off"); } 
-          | TOK_PRINT_IRQ error end { printf("pirq on | off | ?\n") } 
-              | TOK_PPCI bool end       { Config.PrintPci = $2; } 
-              | TOK_PPCI '?' end        { printf("print PCI %s\n",
-                                          Config.PrintPci?"on":"off"); } 
-          | TOK_PPCI error end      { printf("ppci on | off | ?\n") } 
-              | TOK_PIP bool end        { Config.PrintIp = $2; } 
-              | TOK_PIP '?' end         { printf("printip %s\n",
-                                      Config.PrintIp?"on":"off"); } 
-          | TOK_PIP error end       { printf("pip on | off | ?\n") } 
-              | TOK_IOSTAT bool end     { Config.IoStatistics = $2; } 
-              | TOK_IOSTAT '?' end      { printf("io statistics %s\n",
-                                      Config.IoStatistics?"on":"off"); } 
-          | TOK_IOSTAT error end    { printf("iostat on | off | ?\n") } 
-              | TOK_TRACE bool end      { Config.Trace = $2; } 
-              | TOK_TRACE '?' end       { printf("trace %s\n",
-                                      Config.Trace ?"on":"off"); } 
-          | TOK_TRACE error end { printf("trace on | off | ?\n") } 
-;
-verbose:        TOK_VERBOSE val end     { Config.Verbose = $2; }
-          | TOK_VERBOSE '?' end     { printf("verbose: %i\n",
-                            Config.Verbose); }
-          | TOK_VERBOSE error end   { printf("verbose val | ?\n"); }
-;
-logging:        TOK_LOG TOK_STRING end  { logon(normalize_string((char*)$2)); }
-          | TOK_LOG '?' end         { if (logging) printf("logfile: %s\n",
-                            logfile);
-                      else printf("no logging\n?"); }
-          | TOK_LOG TOK_OFF end          { logoff(); }
-          | TOK_LOG error end       { printf("log \"<filename>\" | ? |"
-                         " off\n"); }
-;
-clstat:         TOK_CLSTAT end          { clear_stat(); }
-          | TOK_CLSTAT error end    { printf("clstat\n"); } 
-;
-print:          TOK_STDOUT bool end     { nostdout = !$2; }
-                  | TOK_STDOUT '?' end      { printf("print %s\n",nostdout ?
-                        "no":"yes"); }
-          | TOK_STDOUT error end    { printf("print on | off\n"); }
-;
-com_hlt:            TOK_HLT val end         { add_hlt($2); }    
-          | TOK_HLT TOK_DEL val end { del_hlt($3); }
-          | TOK_HLT TOK_DEL end     { del_hlt(21); }
-              | TOK_HLT '?' end         { list_hlt(); }
-          | TOK_HLT error end       { printf(
-                                               "hlt val | del [val] | ?\n"); }
-;
-ioperm:         TOK_IOPERM val val val end { int i,max;
-                                             if ($2 >= 0) {
-                                 max = $2 + $3 - 1;
-                             if (max > IOPERM_BITS) 
-                             max = IOPERM_BITS;
-                                 for (i = $2;i <= max; i++)
-                                ioperm_list[i] 
-                                                                = $4>0 ? 1 : 0;
-                          }
-                                           }
-          | TOK_IOPERM '?' end { int i,start;
-                     for (i=0; i <= IOPERM_BITS; i++) {
-                    if (ioperm_list[i]) {
-                       start = i;
-                       for (; i <= IOPERM_BITS; i++) 
-                        if (!ioperm_list[i]) {
-                         printf("ioperm on in "
-                         "0x%x+0x%x\n", start,i-start);
-                         break;
-                        }
-                         }
-                     }
-                                  }
-          | TOK_IOPERM error end { printf("ioperm start len val\n"); }
-;
-list_pci:      TOK_DUMP_PCI end       { list_pci(); }
-             | TOK_DUMP_PCI error end { list_pci(); }
-;
-boot_bios:     TOK_BOOT_BIOS '?' end { if (!BootBios) printf("No Boot BIOS\n");
-                                   else printf("BootBIOS from: %i:%i:%i\n",
-                           BootBios->bus, BootBios->dev,
-                           BootBios->func); }
-             | TOK_BOOT_BIOS error end { printf ("bootbios bus:dev:num\n"); }
-;
-hlp:         '?'  { printf("Command list:\n");
-                    printf(" select isa | pci bus:dev:func\n");
-            printf(" boot\n");
-            printf(" seg:reg val | reg val \n");
-            printf(" $x val | $mem val\n");
-            printf(" setmem addr list; addr := val\n");
-            printf(" dumpmem addr len; addr,len := val\n");
-            printf(" do [val]\n");
-            printf(" quit\n");
-            printf(" ?\n");
-            printf(" seg := ds | es;"
-               " reg := ax | bx | cx | dx | si \n");
-            printf(" val := var | <hex-number> | seg:reg | seg\n");
-            printf(" var := $x | $mem; x := 0..20\n");
-            printf(" list := byte val | word val | long val "
-               "| \"string\"\n");
-                printf(" pport on | off | ?\n");
-                printf(" ppci on | off | ?\n");
-                printf(" pirq on | off | ?\n");
-                printf(" pip on | off | ?\n");
-                printf(" trace on | off | ?\n");
-                printf(" iostat on | off | ?\n");
-            printf(" verbose val\n");
-            printf(" log \"<filename>\" | off | ?\n");
-            printf(" print on | off\n");
-            printf(" hlt val | del [val] | ?\n");
-            printf(" clstat\n");
-            printf(" lpci\n");
-            printf ("bootbios ?\n");
-}
-;
-
-%%
-
-static void
-dump_mem(CARD32 addr, int len)
-{
-    dprint(addr,len);
-}
-
-static void
-exec_int(int num)
-{
-    if (num == 0x10) {  /* video interrupt */
-    if (Device.type == NONE) {
-        CurrentPci = PciList;
-        while (CurrentPci) {
-        if (CurrentPci->active)
-            break;
-        CurrentPci = CurrentPci->next;
-        }
-        if (!CurrentPci)
-        Device.type = ISA;
-        else {
-        Device.type = PCI;
-        Device.loc.pci.dev = CurrentPci->dev;
-        Device.loc.pci.bus = CurrentPci->bus;
-        Device.loc.pci.func = CurrentPci->func;
-        }
-    }
-        if (Device.type != ISA) {
-       if (!Device.booted) {
-              if (!CurrentPci || (Device.type == PCI
-               && (!CurrentPci->active
-                   && (Device.loc.pci.dev != CurrentPci->dev
-                 || Device.loc.pci.bus != CurrentPci->bus
-                 || Device.loc.pci.func != CurrentPci->func)))) {
-                printf("boot the device fist\n");
-            return;
-          }
-           }
-    } else
-       CurrentPci = NULL;
-    } else {
-    Device.booted = FALSE; /* we need this for sanity! */
-    }
-    
-    runINT(num,&regs);
-}
-
-static void
-boot(void)
-{
-    if (Device.type == NONE) {
-    printf("select a device fist\n");
-    return;
-    }
-    
-    call_boot(&Device);
-}
-
-static void *
-add_to_list(enum mem_type type, union mem_val *rec, void *next)
-{
-    struct mem *mem_rec = (struct mem *) malloc(sizeof(mem_rec));
-
-    mem_rec->type = type;
-    mem_rec->next = next;
-    
-    switch (type) {
-    case BYTE:
-    case WORD:
-    case LONG:
-    mem_rec->val.integer = rec->integer;
-       break;
-    case STRING:
-    mem_rec->val.ptr = normalize_string(rec->ptr);
-    break;
-    }
-    return mem_rec;
-}
-
-static int
-validRange(int addr,int len)
-{
-    int end = addr + len;
-
-    if (addr < 0x1000 || end > 0xc0000)
-    return 0;
-    return 1;
-}
-
-static void
-do_list(struct mem *list, memType addr)
-{
-   struct mem *prev;
-   int len;
-   
-   while (list) {
-    switch (list->type) {
-         case BYTE:
-         if (!validRange(addr,1)) goto error;
-         *(CARD8*)addr = list->val.integer;
-         addr =+ 1;
-             break;     
-         case WORD:
-         if (!validRange(addr,2)) goto error;
-         *(CARD16*)addr = list->val.integer;
-         addr =+ 2;
-             break;     
-         case LONG:
-         if (!validRange(addr,4)) goto error;
-         *(CARD32*)addr = list->val.integer;
-         addr =+ 4;
-             break;
-         case STRING:
-         len = strlen((char*)list->val.ptr);
-         if (!validRange(addr,len)) goto error;
-         memcpy((CARD8*)addr,(void*)list->val.ptr,len);
-         addr =+ len;
-             free(list->val.ptr);
-             break;
-       }     
-       prev = list;
-       list = list->next;
-       free(prev);
-       continue;
-   error:
-       printf("address out of range\n");
-       while (list) {
-       prev = list;
-       list = list->next;
-       free(prev);
-       }
-       break;
-   }
-}
-
-static char *
-normalize_string(char *ptr)
-{
-    int i = 0, j = 0, c = 0, esc= 0;
-    int size;
-    char *mem_ptr;
-    
-    size = strlen(ptr);
-    mem_ptr = malloc(size);
-    while (1) {
-        switch (*(ptr + i)) {
-        case '\\':
-            if (esc) {
-                *(mem_ptr + j++) = *(ptr + i);
-                esc = 0;
-            } else 
-                esc = 1;
-            break;
-        case '\"':
-            if (esc) {
-                *(mem_ptr + j++) = *(ptr + i);
-                esc = 0;
-            } else 
-                c++;
-            break;
-        default:
-            *(mem_ptr + j++) = *(ptr + i);
-            break;
-        }
-        if (c > 1) {
-            *(mem_ptr + j) = '\0';     
-            break;
-        }
-        i++;
-    }
-    return mem_ptr;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/v86bios/pci.c b/board/MAI/bios_emulator/scitech/src/v86bios/pci.c
deleted file mode 100644 (file)
index b58a571..0000000
+++ /dev/null
@@ -1,902 +0,0 @@
-/*
- * Copyright 1999 Egbert Eich
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of the authors not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission.  The authors makes no representations
- * about the suitability of this software for any purpose.  It is provided
- * "as is" without express or implied warranty.
- *
- * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-#include "debug.h"
-#include <fcntl.h>
-#include <unistd.h>
-#include <malloc.h>
-#include <stdio.h>
-#include <sys/mman.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <string.h>
-#if defined (__alpha__) || defined (__ia64__)
-#include <sys/io.h>
-#endif
-#include "AsmMacros.h"
-
-#include "pci.h"
-
-/*
- * I'm rather simple mindend - therefore I do a poor man's
- * pci scan without all the fancy stuff that is done in
- * scanpci. However that's all we need.
- */
-
-PciStructPtr PciStruct = NULL;
-PciBusPtr PciBuses = NULL;
-PciStructPtr CurrentPci = NULL;
-PciStructPtr PciList = NULL;
-PciStructPtr BootBios = NULL;
-int pciMaxBus = 0;
-
-static CARD32 PciCfg1Addr;
-
-static void readConfigSpaceCfg1(CARD32 bus, CARD32 dev, CARD32 func,
-               CARD32 *reg);
-static int checkSlotCfg1(CARD32 bus, CARD32 dev, CARD32 func);
-static int checkSlotCfg2(CARD32 bus, int dev);
-static void readConfigSpaceCfg2(CARD32 bus, int dev, CARD32 *reg);
-static CARD8 interpretConfigSpace(CARD32 *reg, int busidx,
-                 CARD8 dev, CARD8 func);
-static CARD32 findBIOSMap(PciStructPtr pciP, CARD32 *biosSize);
-static void restoreMem(PciStructPtr pciP);
-
-
-#ifdef __alpha__
-#define PCI_BUS_FROM_TAG(tag)  (((tag) & 0x00ff0000) >> 16)
-#define PCI_DFN_FROM_TAG(tag) (((tag) & 0x0000ff00) >> 8)
-
-#include <asm/unistd.h>
-
-CARD32
-axpPciCfgRead(CARD32 tag)
-{
-    int bus, dfn;
-    CARD32 val = 0xffffffff;
-
-    bus = PCI_BUS_FROM_TAG(tag);
-    dfn = PCI_DFN_FROM_TAG(tag);
-
-    syscall(__NR_pciconfig_read, bus, dfn, tag & 0xff, 4, &val);
-    return(val);
-}
-
-void
-axpPciCfgWrite(CARD32 tag, CARD32 val)
-{
-    int bus, dfn;
-
-    bus = PCI_BUS_FROM_TAG(tag);
-    dfn = PCI_DFN_FROM_TAG(tag);
-
-    syscall(__NR_pciconfig_write, bus, dfn, tag & 0xff, 4, &val);
-}
-
-static CARD32 (*readPci)(CARD32 reg) = axpPciCfgRead;
-static void (*writePci)(CARD32 reg, CARD32 val) = axpPciCfgWrite;
-#else
-static CARD32 readPciCfg1(CARD32 reg);
-static void writePciCfg1(CARD32 reg, CARD32 val);
-static CARD32 readPciCfg2(CARD32 reg);
-static void writePciCfg2(CARD32 reg, CARD32 val);
-
-static CARD32 (*readPci)(CARD32 reg) = readPciCfg1;
-static void (*writePci)(CARD32 reg, CARD32 val) = writePciCfg1;
-#endif
-
-#if defined(__alpha__) || defined(__sparc__)
-#define PCI_EN 0x00000000
-#else
-#define PCI_EN 0x80000000
-#endif
-
-
-static int numbus;
-static int hostbridges = 1;
-static unsigned long pciMinMemReg = ~0;
-
-
-void
-scan_pci(void)
-{
-    unsigned short configtype;
-
-    CARD32 reg[64];
-    int busidx;
-    CARD8 cardnum;
-    CARD8 func;
-    int idx;
-
-    int i;
-    PciStructPtr pci1;
-    PciBusPtr pci_b1,pci_b2;
-
-#if defined(__alpha__) || defined(__powerpc__) || defined(__sparc__) || defined(__ia64__)
-    configtype = 1;
-#else
-    CARD8 tmp1, tmp2;
-    CARD32 tmp32_1, tmp32_2;
-    outb(PCI_MODE2_ENABLE_REG, 0x00);
-    outb(PCI_MODE2_FORWARD_REG, 0x00);
-    tmp1 = inb(PCI_MODE2_ENABLE_REG);
-    tmp2 = inb(PCI_MODE2_FORWARD_REG);
-    if ((tmp1 == 0x00) && (tmp2 == 0x00)) {
-       configtype = 2;
-       readPci = readPciCfg2;
-       writePci = writePciCfg2;
-       P_printf("PCI says configuration type 2\n");
-    } else {
-       tmp32_1 = inl(PCI_MODE1_ADDRESS_REG);
-       outl(PCI_MODE1_ADDRESS_REG, PCI_EN);
-       tmp32_2 = inl(PCI_MODE1_ADDRESS_REG);
-       outl(PCI_MODE1_ADDRESS_REG, tmp32_1);
-       if (tmp32_2 == PCI_EN) {
-           configtype = 1;
-           P_printf("PCI says configuration type 1\n");
-       } else {
-           P_printf("No PCI !\n");
-           return;
-       }
-    }
-#endif
-
-    if (configtype == 1) {
-       P_printf("PCI probing configuration type 1\n");
-       busidx = 0;
-       numbus = 1;
-       idx = 0;
-       do {
-           P_printf("\nProbing for devices on PCI bus %d:\n", busidx);
-           for (cardnum = 0; cardnum < MAX_DEV_PER_VENDOR_CFG1; cardnum++) {
-               func = 0;
-               do {
-                   /* loop over the different functions, if present */
-                   if (!checkSlotCfg1(busidx,cardnum,func))
-                       break;
-                   readConfigSpaceCfg1(busidx,cardnum,func,reg);
-
-                   func = interpretConfigSpace(reg,busidx,
-                                               cardnum,func);
-
-                   if (idx++ > MAX_PCI_DEVICES)
-                       continue;
-               } while (func < 8);
-           }
-       } while (++busidx < PCI_MAXBUS);
-#if defined(__alpha__) || defined(__powerpc__) || defined(__sparc__) || defined(__ia64__)
-       /* don't use outl()  ;-) */
-#else
-       outl(PCI_MODE1_ADDRESS_REG, 0);
-#endif
-    } else {
-       int slot;
-
-       P_printf("PCI probing configuration type 2\n");
-       busidx = 0;
-       numbus = 1;
-       idx = 0;
-       do {
-           for (slot=0xc0; slot<0xd0; i++) {
-               if (!checkSlotCfg2(busidx,slot))
-                   break;
-               readConfigSpaceCfg2(busidx,slot,reg);
-
-               interpretConfigSpace(reg,busidx,
-                                    slot,0);
-               if (idx++ > MAX_PCI_DEVICES)
-                   continue;
-           }
-       }  while (++busidx < PCI_MAXBUS);
-    }
-
-
-    pciMaxBus = numbus - 1;
-    P_printf("Number of buses in system: %i\n",pciMaxBus + 1);
-    P_printf("Min PCI mem address: 0x%lx\n",pciMinMemReg);
-
-    /* link buses */
-    pci_b1 = PciBuses;
-    while (pci_b1) {
-       pci_b2 = PciBuses;
-       pci_b1->pBus = NULL;
-       while (pci_b2) {
-           if (pci_b1->primary == pci_b2->secondary)
-               pci_b1->pBus = pci_b2;
-           pci_b2 = pci_b2->next;
-       }
-       pci_b1 = pci_b1->next;
-    }
-    pci1 = PciStruct;
-    while (pci1) {
-       pci_b2 = PciBuses;
-       pci1->pBus = NULL;
-       while (pci_b2) {
-           if (pci1->bus == pci_b2->secondary)
-               pci1->pBus = pci_b2;
-           pci_b2 = pci_b2->next;
-       }
-       pci1 = pci1->next;
-    }
-    if (RESORT) {
-       PciStructPtr tmp = PciStruct, tmp1;
-       PciStruct = NULL;
-       while (tmp) {
-           tmp1 = tmp->next;
-           tmp->next = PciStruct;
-           PciStruct = tmp;
-           tmp = tmp1;
-       }
-    }
-    PciList = CurrentPci = PciStruct;
-}
-
-#ifndef __alpha__
-static CARD32
-readPciCfg1(CARD32 reg)
-{
-    CARD32 val;
-
-    outl(PCI_MODE1_ADDRESS_REG, reg);
-    val = inl(PCI_MODE1_DATA_REG);
-    outl(PCI_MODE1_ADDRESS_REG, 0);
-    P_printf("reading: 0x%x from 0x%x\n",val,reg);
-    return val;
-}
-
-static void
-writePciCfg1(CARD32 reg, CARD32 val)
-{
-    P_printf("writing: 0x%x to 0x%x\n",val,reg);
-    outl(PCI_MODE1_ADDRESS_REG, reg);
-    outl(PCI_MODE1_DATA_REG,val);
-    outl(PCI_MODE1_ADDRESS_REG, 0);
-}
-
-static CARD32
-readPciCfg2(CARD32 reg)
-{
-    CARD32 val;
-    CARD8 bus = (reg >> 16) & 0xff;
-    CARD8 dev = (reg >> 11) & 0x1f;
-    CARD8 num = reg & 0xff;
-
-    outb(PCI_MODE2_ENABLE_REG, 0xF1);
-    outb(PCI_MODE2_FORWARD_REG, bus);
-    val = inl((dev << 8) + num);
-    outb(PCI_MODE2_ENABLE_REG, 0x00);
-    P_printf("reading: 0x%x from 0x%x\n",val,reg);
-    return val;
-}
-
-static void
-writePciCfg2(CARD32 reg, CARD32 val)
-{
-    CARD8 bus = (reg >> 16) & 0xff;
-    CARD8 dev = (reg >> 11) & 0x1f;
-    CARD8 num = reg & 0xff;
-
-    P_printf("writing: 0x%x to 0x%x\n",val,reg);
-    outb(PCI_MODE2_ENABLE_REG, 0xF1);
-    outb(PCI_MODE2_FORWARD_REG, bus);
-    outl((dev << 8) + num,val);
-    outb(PCI_MODE2_ENABLE_REG, 0x00);
-}
-#endif
-
-void
-pciVideoDisable(void)
-{
-    /* disable VGA routing on bridges */
-    PciBusPtr pbp = PciBuses;
-    PciStructPtr pcp = PciStruct;
-
-    while (pbp) {
-       writePci(pbp->Slot.l | 0x3c, pbp->bctl & ~(CARD32)(8<<16));
-       pbp = pbp->next;
-    }
-    /* disable display devices */
-    while (pcp) {
-       writePci(pcp->Slot.l | 0x04, pcp->cmd_st & ~(CARD32)3);
-       writePci(pcp->Slot.l | 0x30, pcp->RomBase & ~(CARD32)1);
-       pcp = pcp->next;
-    }
-}
-
-void
-pciVideoRestore(void)
-{
-    /* disable VGA routing on bridges */
-    PciBusPtr pbp = PciBuses;
-    PciStructPtr pcp = PciStruct;
-
-    while (pbp) {
-       writePci(pbp->Slot.l | 0x3c, pbp->bctl);
-       pbp = pbp->next;
-    }
-    /* disable display devices */
-    while (pcp) {
-       writePci(pcp->Slot.l | 0x04, pcp->cmd_st);
-       writePci(pcp->Slot.l | 0x30, pcp->RomBase);
-       pcp = pcp->next;
-    }
-}
-
-void
-EnableCurrent()
-{
-    PciBusPtr pbp;
-    PciStructPtr pcp = CurrentPci;
-
-    pciVideoDisable();
-
-    pbp = pcp->pBus;
-    while (pbp) { /* enable bridges */
-       writePci(pbp->Slot.l | 0x3c, pbp->bctl | (CARD32)(8<<16));
-       pbp = pbp->pBus;
-    }
-    writePci(pcp->Slot.l | 0x04, pcp->cmd_st | (CARD32)3);
-    writePci(pcp->Slot.l | 0x30, pcp->RomBase | (CARD32)1);
-}
-
-CARD8
-PciRead8(int offset, CARD32 Slot)
-{
-    int shift = offset & 0x3;
-    offset = offset & 0xFC;
-    return ((readPci(Slot | offset) >> (shift << 3)) & 0xff);
-}
-
-CARD16
-PciRead16(int offset, CARD32 Slot)
-{
-    int shift = offset & 0x2;
-    offset = offset & 0xFC;
-    return ((readPci(Slot | offset) >> (shift << 3)) & 0xffff);
-}
-
-CARD32
-PciRead32(int offset, CARD32 Slot)
-{
-    offset = offset & 0xFC;
-    return (readPci(Slot | offset));
-}
-
-void
-PciWrite8(int offset, CARD8 byte, CARD32 Slot)
-{
-    CARD32 val;
-    int shift = offset & 0x3;
-    offset = offset & 0xFC;
-    val = readPci(Slot | offset);
-    val &= ~(CARD32)(0xff << (shift << 3));
-    val |= byte << (shift << 3);
-    writePci(Slot | offset, val);
-}
-
-void
-PciWrite16(int offset, CARD16 word, CARD32 Slot)
-{
-    CARD32 val;
-    int shift = offset & 0x2;
-    offset = offset & 0xFC;
-    val = readPci(Slot | offset);
-    val &= ~(CARD32)(0xffff << (shift << 3));
-    val |= word << (shift << 3);
-    writePci(Slot | offset, val);
-}
-
-void
-PciWrite32(int offset, CARD32 lg, CARD32 Slot)
-{
-    offset = offset & 0xFC;
-    writePci(Slot | offset, lg);
-}
-
-int
-mapPciRom(PciStructPtr pciP)
-{
-    unsigned long RomBase = 0;
-    int mem_fd;
-    unsigned char *mem, *ptr;
-    unsigned char *scratch = NULL;
-    int length = 0;
-    CARD32 biosSize = 0x1000000;
-    CARD32 enablePci;
-
-    if (!pciP)
-      pciP = CurrentPci;
-
-    if (FIX_ROM) {
-       RomBase = findBIOSMap(pciP, &biosSize);
-       if (!RomBase) {
-           fprintf(stderr,"Cannot remap BIOS of %i:%i:%i "
-                   "- trying preset address\n",pciP->bus,pciP->dev,
-                   pciP->func);
-           RomBase = pciP->RomBase & ~(CARD32)0xFF;
-       }
-    }  else {
-       RomBase = pciP->RomBase & ~(CARD32)0xFF;
-       if (~RomBase + 1 < biosSize || !RomBase)
-           RomBase = findBIOSMap(pciP, &biosSize);
-    }
-
-    P_printf("RomBase: 0x%lx\n",RomBase);
-
-    if ((mem_fd = open(MEM_FILE,O_RDONLY))<0) {
-       perror("opening memory");
-       restoreMem(pciP);
-       return (0);
-    }
-
-    PciWrite32(0x30,RomBase | 1,pciP->Slot.l);
-
-#ifdef __alpha__
-    mem = ptr = (unsigned char *)mmap(0, biosSize, PROT_READ,
-                                     MAP_SHARED, mem_fd, RomBase | _bus_base());
-#else
-    mem = ptr = (unsigned char *)mmap(0, biosSize, PROT_READ,
-                                     MAP_SHARED, mem_fd, RomBase);
-#endif
-    if (pciP != CurrentPci) {
-      enablePci = PciRead32(0x4,pciP->Slot.l);
-      PciWrite32(0x4,enablePci | 0x2,pciP->Slot.l);
-    }
-
-#ifdef PRINT_PCI
-    dprint((unsigned long)ptr,0x30);
-#endif
-    while ( *ptr == 0x55 && *(ptr+1) == 0xAA) {
-       unsigned short data_off = *(ptr+0x18) | (*(ptr+0x19)<< 8);
-       unsigned char *data = ptr + data_off;
-       unsigned char type;
-       int i;
-
-       if (*data!='P' || *(data+1)!='C' || *(data+2)!='I' || *(data+3)!='R') {
-           break;
-       }
-       type = *(data + 0x14);
-       P_printf("data segment in BIOS: 0x%x, type: 0x%x ",data_off,type);
-
-       if (type != 0)  { /* not PC-AT image: find next one */
-           unsigned int image_length;
-           unsigned char indicator = *(data + 0x15);
-           if (indicator & 0x80) /* last image */
-               break;
-           image_length = (*(data + 0x10)
-                           | (*(data + 0x11) << 8)) << 9;
-           P_printf("data image length: 0x%x, ind: 0x%x\n",
-                    image_length,indicator);
-           ptr = ptr + image_length;
-           continue;
-       }
-       /* OK, we have a PC Image */
-       length = (*(ptr + 2) << 9);
-       P_printf("BIOS length: 0x%x\n",length);
-       scratch = (unsigned char *)malloc(length);
-       /* don't use memcpy() here: Reading from bus! */
-       for (i=0;i<length;i++)
-           *(scratch + i)=*(ptr + i);
-       break;
-    }
-
-    if (pciP != CurrentPci)
-      PciWrite32(0x4,enablePci,pciP->Slot.l);
-
-    /* unmap/close/disable PCI bios mem */
-    munmap(mem, biosSize);
-    close(mem_fd);
-    /* disable and restore mapping */
-    writePci(pciP->Slot.l | 0x30, pciP->RomBase & ~(CARD32)1);
-
-    if (scratch && length) {
-       memcpy((unsigned char *)V_BIOS, scratch, length);
-       free(scratch);
-    }
-
-    restoreMem(pciP);
-    return length;
-}
-
-CARD32
-findPci(CARD16 slotBX)
-{
-    CARD32 slot = slotBX << 8;
-
-    if (slot == (CurrentPci->Slot.l & ~PCI_EN))
-       return (CurrentPci->Slot.l | PCI_EN);
-    else {
-#if !SHOW_ALL_DEV
-       PciBusPtr pBus = CurrentPci->pBus;
-       while (pBus) {
-         /*      fprintf(stderr,"slot: 0x%x  bridge: 0x%x\n",slot, pBus->Slot.l); */
-           if (slot == (pBus->Slot.l & ~PCI_EN))
-               return pBus->Slot.l | PCI_EN;
-           pBus = pBus->next;
-       }
-#else
-       PciStructPtr pPci = PciStruct;
-       while (pPci) {
-         /*fprintf(stderr,"slot: 0x%x  bridge: 0x%x\n",slot, pPci->Slot.l); */
-           if (slot == (pPci->Slot.l & ~PCI_EN))
-               return pPci->Slot.l | PCI_EN;
-           pPci = pPci->next;
-       }
-#endif
-    }
-    return 0;
-}
-
-CARD16
-pciSlotBX(PciStructPtr pPci)
-{
-    return (CARD16)((pPci->Slot.l >> 8) & 0xFFFF);
-}
-
-PciStructPtr
-findPciDevice(CARD16 vendorID, CARD16 deviceID, char n)
-{
-    PciStructPtr pPci = CurrentPci;
-    n++;
-
-    while (pPci)  {
-       if ((pPci->VendorID == vendorID) && (pPci->DeviceID == deviceID)) {
-       if (!(--n)) break;
-       }
-    pPci = pPci->next;
-    }
-    return pPci;
-}
-
-PciStructPtr
-findPciClass(CARD8 intf, CARD8 subClass, CARD16 class, char n)
-{
-    PciStructPtr pPci = CurrentPci;
-    n++;
-
-    while (pPci)  {
-       if ((pPci->Interface == intf) && (pPci->SubClass == subClass)
-        && (pPci->BaseClass == class)) {
-       if (!(--n)) break;
-       }
-    pPci = pPci->next;
-    }
-    return pPci;
-}
-
-static void
-readConfigSpaceCfg1(CARD32 bus, CARD32 dev, CARD32 func, CARD32 *reg)
-{
-    CARD32   config_cmd = PCI_EN | (bus<<16) |
-      (dev<<11) | (func<<8);
-    int i;
-
-    for (i = 0; i<64;i+=4) {
-#ifdef __alpha__
-       reg[i] = axpPciCfgRead(config_cmd | i);
-#else
-       outl(PCI_MODE1_ADDRESS_REG, config_cmd | i);
-       reg[i] = inl(PCI_MODE1_DATA_REG);
-#endif
-
-#ifdef V86BIOS_DEBUG
-       P_printf("0x%lx\n",reg[i]);
-#endif
-    }
-}
-
-static int
-checkSlotCfg1(CARD32 bus, CARD32 dev, CARD32 func)
-{
-    CARD32    config_cmd = PCI_EN | (bus<<16) |
-      (dev<<11) | (func<<8);
-    CARD32 reg;
-#ifdef __alpha__
-       reg = axpPciCfgRead(config_cmd);
-#else
-       outl(PCI_MODE1_ADDRESS_REG, config_cmd);
-       reg = inl(PCI_MODE1_DATA_REG);
-#endif
-    if (reg != 0xFFFFFFFF)
-       return 1;
-    else
-       return 0;
-}
-
-static int
-checkSlotCfg2(CARD32 bus, int dev)
-{
-    CARD32 val;
-
-    outb(PCI_MODE2_ENABLE_REG, 0xF1);
-    outb(PCI_MODE2_FORWARD_REG, bus);
-    val = inl(dev << 8);
-    outb(PCI_MODE2_FORWARD_REG, 0x00);
-    outb(PCI_MODE2_ENABLE_REG, 0x00);
-    if (val == 0xFFFFFFFF)
-       return 0;
-    if (val == 0xF0F0F0F0)
-       return 0;
-    return 1;
-}
-
-static void
-readConfigSpaceCfg2(CARD32 bus, int dev, CARD32 *reg)
-{
-    int i;
-
-    outb(PCI_MODE2_ENABLE_REG, 0xF1);
-    outb(PCI_MODE2_FORWARD_REG, bus);
-    for (i = 0; i<64;i+=4) {
-       reg[i] = inl((dev << 8) + i);
-#ifdef V86BIOS_DEBUG
-       P_printf("0x%lx\n",reg[i]);
-#endif
-    }
-    outb(PCI_MODE2_ENABLE_REG, 0x00);
-}
-
-static CARD8
-interpretConfigSpace(CARD32 *reg, int busidx, CARD8 dev, CARD8 func)
-{
-    CARD32 config_cmd;
-    CARD16 vendor, device;
-    CARD8 baseclass, subclass;
-    CARD8 primary, secondary;
-    CARD8 header, interface;
-    int i;
-
-    config_cmd = PCI_EN | busidx<<16 |
-       (dev<<11) | (func<<8);
-
-    for (i = 0x10; i < 0x28; i+=4) {
-       if (IS_MEM32(reg[i]))
-           if ((reg[i] & 0xFFFFFFF0) < pciMinMemReg)
-               pciMinMemReg = (reg[i] & 0xFFFFFFF0);
-#ifdef __alpha__
-       if (IS_MEM64(reg[i])) {
-               unsigned long addr = reg[i] |
-             (unsigned long)(reg[i+4]) << 32;
-           if ((addr & ~0xfL) < pciMinMemReg)
-               pciMinMemReg = (addr & ~0xfL);
-           i+=4;
-       }
-#endif
-    }
-    vendor = reg[0] & 0xFFFF;
-    device = reg[0] >> 16;
-    P_printf("bus: %i card: %i func %i reg0: 0x%x ", busidx,dev,func,reg[0]);
-    baseclass = reg[8] >> 24;
-    subclass = (reg[8] >> 16) & 0xFF;
-    interface = (reg[8] >> 8) & 0xFF;
-
-    header = (reg[0x0c] >> 16) & 0xff;
-    P_printf("bc 0x%x, sub 0x%x, if 0x%x, hdr 0x%x\n",
-            baseclass,subclass,interface,header);
-    if (BRIDGE_CLASS(baseclass)) {
-       if (BRIDGE_PCI_CLASS(subclass)) {
-           PciBusPtr pbp = malloc(sizeof(PciBusRec));
-           P_printf("Pci-Pci Bridge found; ");
-           primary = reg[0x18] & 0xFF;
-           secondary = (reg[0x18] >> 8) & 0xFF;
-           P_printf("primary: 0x%x secondary: 0x%x\n",
-                    primary,secondary);
-           pbp->bctl = reg[0x3c];
-           pbp->primary = primary;
-           pbp->secondary = secondary;
-           pbp->Slot.l = config_cmd;
-           pbp->next = PciBuses;
-           PciBuses = pbp;
-           numbus++;
-       } else if (BRIDGE_HOST_CLASS(subclass)
-                  && (hostbridges++ > 1)) {
-           numbus++;
-       }
-    } else if (VIDEO_CLASS(baseclass,subclass)) {
-       PciStructPtr pcp = malloc(sizeof(PciStructRec));
-       P_printf("Display adapter found\n");
-       pcp->RomBase = reg[0x30];
-       pcp->cmd_st = reg[4];
-       pcp->active = (reg[4] & 0x03) == 3 ? 1 : 0;
-       pcp->VendorID = vendor;
-       pcp->DeviceID = device;
-       pcp->Interface = interface;
-       pcp->BaseClass = baseclass;
-       pcp->SubClass = subclass;
-       pcp->Slot.l = config_cmd;
-       pcp->bus = busidx;
-       pcp->dev = dev;
-       pcp->func = func;
-       pcp->next = PciStruct;
-       PciStruct = pcp;
-    }
-    if ((func == 0)
-       && ((header & PCI_MULTIFUNC_DEV) == 0))
-       func = 8;
-    else
-       func++;
-    return func;
-}
-
-static CARD32 remapMEM_val;
-static int remapMEM_num;
-
-static int /* map it on some other video device */
-remapMem(PciStructPtr pciP, int num, CARD32 size)
-{
-    PciStructPtr pciPtr = PciStruct;
-    int i;
-    CARD32 org;
-    CARD32 val;
-    CARD32 size_n;
-
-    org = PciRead32(num + 0x10,pciP->Slot.l);
-
-    while (pciPtr) {
-       for (i = 0; i < 20; i=i+4) {
-
-           val = PciRead32(i + 0x10,pciPtr->Slot.l);
-           /* don't map it on itself */
-           if ((org & 0xfffffff0) == (val & 0xfffffff0))
-               continue;
-           if (val && !(val & 1))
-               PciWrite32(i + 0x10,0xffffffff,pciPtr->Slot.l);
-           else
-               continue;
-           size_n = PciRead32(i + 0x10,pciPtr->Slot.l);
-           PciWrite32(i + 0x10,val,pciPtr->Slot.l);
-           size_n = ~(CARD32)(size_n  & 0xfffffff0) + 1;
-
-           if (size_n >= size) {
-               PciWrite32(num + 0x10,val,pciP->Slot.l);
-               return 1;
-           }
-       }
-       pciPtr = pciPtr->next;
-    }
-    /* last resort: try to go below lowest PCI mem address */
-    val = ((pciMinMemReg & ~(CARD32)(size - 1)) - size);
-    if (val > 0x7fffffff) {
-       PciWrite32(num + 0x10,val, pciP->Slot.l);
-       return 1;
-    }
-
-    return 0;
-}
-
-static void
-restoreMem(PciStructPtr pciP)
-{
-    if (remapMEM_val == 0) return;
-    PciWrite32(remapMEM_num + 0x10,remapMEM_val,pciP->Slot.l);
-    return;
-}
-
-static CARD32
-findBIOSMap(PciStructPtr pciP, CARD32 *biosSize)
-{
-    PciStructPtr pciPtr = PciStruct;
-    int i;
-    CARD32 val;
-    CARD32 size;
-
-    PciWrite32(0x30,0xffffffff,pciP->Slot.l);
-    *biosSize = PciRead32(0x30,pciP->Slot.l);
-    P_printf("bios size: 0x%x\n",*biosSize);
-    PciWrite32(0x30,pciP->RomBase,pciP->Slot.l);
-    *biosSize = ~(*biosSize & 0xFFFFFF00) + 1;
-    P_printf("bios size masked: 0x%x\n",*biosSize);
-    if (*biosSize > (1024 * 1024 * 16)) {
-      *biosSize = 1024 * 1024 * 16;
-      P_printf("fixing broken BIOS size: 0x%x\n",*biosSize);
-    }
-    while (pciPtr) {
-       if (pciPtr->bus != pciP->bus) {
-           pciPtr = pciPtr->next;
-           continue;
-       }
-       for (i = 0; i < 20; i=i+4) {
-
-           val = PciRead32(i + 0x10,pciPtr->Slot.l);
-           if (!(val & 1))
-
-           PciWrite32(i + 0x10,0xffffffff,pciPtr->Slot.l);
-           else
-               continue;
-           size = PciRead32(i + 0x10,pciPtr->Slot.l);
-           PciWrite32(i + 0x10,val,pciPtr->Slot.l);
-           size = ~(CARD32)(size & 0xFFFFFFF0) + 1;
-#ifdef V86_BIOS_DEBUG
-           P_printf("size: 0x%x\n",size);
-#endif
-           if (size >= *biosSize) {
-               if (pciP == pciPtr) { /* if same device remap ram*/
-                   if (!(remapMem(pciP,i,size)))
-                       continue;
-                   remapMEM_val = val;
-                   remapMEM_num = i;
-               } else {
-                   remapMEM_val = 0;
-               }
-               return val & 0xFFFFFF00;
-           }
-       }
-       pciPtr = pciPtr->next;
-    }
-    remapMEM_val = 0;
-    /* very last resort */
-    if (pciP->bus == 0 && (pciMinMemReg > *biosSize))
-      return (pciMinMemReg - size) & ~(size - 1);
-
-    return 0;
-}
-
-int
-cfg1out(CARD16 addr, CARD32 val)
-{
-  if (addr == 0xCF8) {
-    PciCfg1Addr = val;
-    return 1;
-  } else if (addr == 0xCFC) {
-    writePci(PciCfg1Addr, val);
-    return 1;
-  }
-  return 0;
-}
-
-int
-cfg1in(CARD16 addr, CARD32 *val)
-{
-  if (addr == 0xCF8) {
-    *val = PciCfg1Addr;
-    return 1;
-  } else if (addr == 0xCFC) {
-    *val = readPci(PciCfg1Addr);
-    return 1;
-  }
-  return 0;
-}
-
-void
-list_pci(void)
-{
-    PciStructPtr pci = PciList;
-
-    while (pci) {
-    printf("[0x%x:0x%x:0x%x] vendor: 0x%4.4x dev: 0x%4.4x class: 0x%4.4x"
-          " subclass: 0x%4.4x\n",pci->bus,pci->dev,pci->func,
-          pci->VendorID,pci->DeviceID,pci->BaseClass,pci->SubClass);
-    pci = pci->next;
-    }
-}
-
-PciStructPtr
-findPciByIDs(int bus, int dev, int func)
-{
-  PciStructPtr pciP = PciList;
-
-  while (pciP) {
-    if (pciP->bus == bus && pciP->dev == dev && pciP->func == func)
-      return pciP;
-    pciP = pciP->next;
-  }
-  return NULL;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/v86bios/pci.h b/board/MAI/bios_emulator/scitech/src/v86bios/pci.h
deleted file mode 100644 (file)
index 58ad522..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Copyright 1999 Egbert Eich
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of the authors not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission.  The authors makes no representations
- * about the suitability of this software for any purpose.  It is provided
- * "as is" without express or implied warranty.
- *
- * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-#include "v86bios.h"
-
-#ifndef V86_PCI_H
-#define V86_PCI_H
-
-typedef union {
-    struct {
-       unsigned int    zero:2;
-       unsigned int    reg:6;
-       unsigned int    func:3;
-       unsigned int    dev:5;
-       unsigned int    bus:8;
-       unsigned int    reserved:7;
-       unsigned int    enable:1;
-    } pci;
-    CARD32 l;
-} PciSlot;
-
-typedef struct pciBusRec {
-    CARD8 primary;
-    CARD8 secondary;
-    CARD32 bctl;
-    PciSlot Slot;
-    struct pciBusRec *next;
-    struct pciBusRec *pBus;
-} PciBusRec, *PciBusPtr;
-
-typedef struct pciStructRec {
-    CARD16 VendorID;
-    CARD16 DeviceID;
-    CARD8 Interface;
-    CARD8 BaseClass;
-    CARD8 SubClass;
-    CARD32 RomBase;
-    CARD32 bus;
-    CARD8 dev;
-    CARD8 func;
-    CARD32 cmd_st;
-    int active;
-    PciSlot Slot;
-    struct pciStructRec *next;
-    PciBusPtr pBus;
-} PciStructRec , *PciStructPtr;
-
-
-extern PciStructPtr CurrentPci;
-extern PciStructPtr PciList;
-extern PciStructPtr BootBios;
-extern int pciMaxBus;
-
-extern CARD32 findPci(CARD16 slotBX);
-extern CARD16 pciSlotBX(PciStructPtr);
-PciStructPtr findPciDevice(CARD16 vendorID, CARD16 deviceID, char n);
-PciStructPtr findPciClass(CARD8 intf, CARD8 subClass, CARD16 class, char n);
-
-extern CARD8 PciRead8(int offset, CARD32 slot);
-extern CARD16 PciRead16(int offset, CARD32 slot);
-extern CARD32 PciRead32(int offset, CARD32 slot);
-
-extern void PciWrite8(int offset,CARD8 byte, CARD32 slot);
-extern void PciWrite16(int offset,CARD16 word, CARD32 slot);
-extern void PciWrite32(int offset,CARD32 lg, CARD32 slot);
-
-extern void scan_pci(void);
-extern void pciVideoDisable(void);
-extern void pciVideoRestore(void);
-extern void EnableCurrent(void);
-extern int mapPciRom(PciStructPtr pciP);
-extern int cfg1out(CARD16 addr, CARD32 val);
-extern int cfg1in(CARD16 addr, CARD32 *val);
-extern void list_pci(void);
-extern PciStructPtr findPciByIDs(int bus, int dev, int func);
-
-#define PCI_MODE2_ENABLE_REG  0xCF8
-#define PCI_MODE2_FORWARD_REG  0xCFA
-#define PCI_MODE1_ADDRESS_REG  0xCF8
-#define PCI_MODE1_DATA_REG  0xCFC
-#if defined(__alpha__) || defined(__sparc__)
-#define PCI_EN 0x00000000
-#else
-#define PCI_EN 0x80000000
-#endif
-#define MAX_DEV_PER_VENDOR_CFG1  32
-#define BRIDGE_CLASS(x) (x == 0x06)
-#define BRIDGE_PCI_CLASS(x) (x == 0x04)
-#define BRIDGE_HOST_CLASS(x) (x == 0x00)
-#define PCI_CLASS_PREHISTORIC 0x00
-#define PCI_SUBCLASS_PREHISTORIC_VGA 0x01
-#define PCI_CLASS_DISPLAY 0x03
-#define PCI_SUBCLASS_DISPLAY_VGA 0x00
-#define PCI_SUBCLASS_DISPLAY_XGA 0x01
-#define PCI_SUBCLASS_DISPLAY_MISC 0x80
-#define VIDEO_CLASS(b,s) \
-    (((b) == PCI_CLASS_PREHISTORIC && (s) == PCI_SUBCLASS_PREHISTORIC_VGA) || \
-     ((b) == PCI_CLASS_DISPLAY && (s) == PCI_SUBCLASS_DISPLAY_VGA) ||\
-     ((b) == PCI_CLASS_DISPLAY && (s) == PCI_SUBCLASS_DISPLAY_XGA) ||\
-     ((b) == PCI_CLASS_DISPLAY && (s) == PCI_SUBCLASS_DISPLAY_MISC))
-#define PCI_MULTIFUNC_DEV  0x80
-#define MAX_PCI_DEVICES   64
-#define PCI_MAXBUS 16
-#define PCI_IS_MEM 0x00000001
-#define MAX_PCI_ROM_SIZE (1024 * 1024 * 16)
-
-#define IS_MEM32(x) ((x & 0x7) == 0 && x != 0)
-#define IS_MEM64(x) ((x & 0x7) == 0x4)
-#endif
diff --git a/board/MAI/bios_emulator/scitech/src/v86bios/v86.c b/board/MAI/bios_emulator/scitech/src/v86bios/v86.c
deleted file mode 100644 (file)
index 4deed04..0000000
+++ /dev/null
@@ -1,562 +0,0 @@
-/*
- * Copyright 1999 Egbert Eich
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of the authors not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission.  The authors makes no representations
- * about the suitability of this software for any purpose.  It is provided
- * "as is" without express or implied warranty.
- *
- * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include "debug.h"
-#include <sys/vm86.h>
-#include <unistd.h>
-#include <errno.h>
-#include <asm/unistd.h>
-#include <stdio.h>
-#include <string.h>
-#include <signal.h>
-#include <setjmp.h>
-#include "v86bios.h"
-#include "AsmMacros.h"
-
-struct vm86_struct vm86s;
-
-static int vm86_GP_fault(void);
-static int vm86_do_int(int num);
-static void dump_code(void);
-static void dump_registers(void);
-static void stack_trace(void);
-static int vm86_rep(struct vm86_struct *ptr);
-
-#define CPU_REG(x) (vm86s.regs.##x)
-#define CPU_REG_LW(reg)      (*((CARD16 *)&CPU_REG(reg)))
-#define CPU_REG_HW(reg)      (*((CARD16 *)&CPU_REG(reg) + 1))
-#define CPU_REG_LB(reg)      (*(CARD8 *)&CPU_REG(e##reg))
-#define SEG_ADR(type, seg, reg)  type((CPU_REG_LW(seg) << 4) \
-                                     + CPU_REG_LW(e##reg))
-#define DF (1 << 10)
-
-struct pio P;
-
-
-void
-setup_io(void)
-{
-    if (!Config.PrintPort && !Config.IoStatistics) {
-    P.inb = (CARD8(*)(CARD16))inb;
-    P.inw = (CARD16(*)(CARD16))inw;
-    P.inl = (CARD32(*)(CARD16))inl;
-    P.outb = (void(*)(CARD16,CARD8))outb;
-    P.outw = (void(*)(CARD16,CARD16))outw;
-    P.outl = (void(*)(CARD16,CARD32))outl;
-    } else {
-    P.inb = p_inb;
-    P.inw = p_inw;
-    P.inl = p_inl;
-    P.outb = p_outb;
-    P.outw = p_outw;
-    P.outl = p_outl;
-    }
-}
-
-
-static void
-setup_vm86(unsigned long bios_start, i86biosRegsPtr regs)
-{
-    CARD32 eip;
-    CARD16 cs;
-
-    vm86s.flags = VM86_SCREEN_BITMAP;
-    vm86s.flags = 0;
-    vm86s.screen_bitmap = 0;
-    vm86s.cpu_type = CPU_586;
-    memset(&vm86s.int_revectored, 0xff,sizeof(vm86s.int_revectored)) ;
-    memset(&vm86s.int21_revectored, 0xff,sizeof(vm86s.int21_revectored)) ;
-
-    eip = bios_start & 0xFFFF;
-    cs = (bios_start & 0xFF0000) >> 4;
-
-    CPU_REG(eax) = regs->ax;
-    CPU_REG(ebx) = regs->bx;
-    CPU_REG(ecx) = regs->cx;
-    CPU_REG(edx) = regs->dx;
-    CPU_REG(esi) = 0;
-    CPU_REG(edi) = regs->di;
-    CPU_REG(ebp) = 0;
-    CPU_REG(eip) = eip;
-    CPU_REG(cs) = cs;
-    CPU_REG(esp) = 0x100;
-    CPU_REG(ss) = 0x30;               /* This is the standard pc bios stack */
-    CPU_REG(es) = regs->es;
-    CPU_REG(ds) = 0x40;               /* standard pc ds */
-    CPU_REG(fs) = 0;
-    CPU_REG(gs) = 0;
-    CPU_REG(eflags) |= (VIF_MASK | VIP_MASK);
-}
-
-void
-collect_bios_regs(i86biosRegsPtr regs)
-{
-    regs->ax = CPU_REG(eax);
-    regs->bx = CPU_REG(ebx);
-    regs->cx = CPU_REG(ecx);
-    regs->dx = CPU_REG(edx);
-    regs->es = CPU_REG(es);
-    regs->ds = CPU_REG(ds);
-    regs->di = CPU_REG(edi);
-    regs->si = CPU_REG(esi);
-}
-
-static int
-do_vm86(void)
-{
-    int retval;
-
-#ifdef V86BIOS_DEBUG
-    dump_registers();
-#endif
-/*    retval = SYS_vm86old(&vm86s); */
-/*    retval = syscall(SYS_vm86old,&vm86s); */
-
-    retval = vm86_rep(&vm86s);
-
-    switch (VM86_TYPE(retval)) {
-    case VM86_UNKNOWN:
-       if (!vm86_GP_fault()) return 0;
-       break;
-    case VM86_STI:
-       fprintf(stderr,"vm86_sti :-((\n");
-       stack_trace();
-       dump_code();
-       return 0;
-    case VM86_INTx:
-       if (!vm86_do_int(VM86_ARG(retval))) {
-           fprintf(stderr,"\nUnknown vm86_int: %X\n\n",VM86_ARG(retval));
-           dump_registers();
-           return 0;
-       }
-       /* I'm not sure yet what to do if we can handle ints */
-       break;
-    case VM86_SIGNAL:
-       fprintf(stderr,"received signal\n");
-       return 0;
-    default:
-       fprintf(stderr,"unknown type(0x%x)=0x%x\n",
-               VM86_ARG(retval),VM86_TYPE(retval));
-       dump_registers();
-       dump_code();
-       stack_trace();
-       return 0;
-    }
-
-    return 1;
-}
-
-static jmp_buf x86_esc;
-static void
-vmexit(int unused)
-{
-    longjmp(x86_esc,1);
-}
-
-void
-do_x86(unsigned long bios_start, i86biosRegsPtr regs)
-{
-    static void (*org_handler)(int);
-
-    setup_vm86(bios_start, regs);
-    if (setjmp(x86_esc) == 0) {
-       org_handler = signal(2,vmexit);
-       while(do_vm86()) {};
-       signal(2,org_handler);
-       collect_bios_regs(regs);
-    } else {
-       signal(2,org_handler);
-       printf("interrupted at 0x%x\n",((CARD16)CPU_REG(cs)) << 4
-          | (CARD16)CPU_REG(eip));
-    }
-}
-
-/* get the linear address */
-#define LIN_PREF_SI  ((pref_seg << 4) + CPU_REG_LW(esi))
-
-#define LWECX       (prefix66 ^ prefix67 ? CPU_REG(ecx) : CPU_REG_LW(ecx))
-
-static int
-vm86_GP_fault(void)
-{
-    unsigned char *csp, *lina;
-    CARD32 org_eip;
-    int pref_seg;
-    int done,is_rep,prefix66,prefix67;
-
-
-    csp = lina = SEG_ADR((unsigned char *), cs, ip);
-#ifdef V86BIOS_DEBUG
-    printf("exception: \n");
-    dump_code();
-#endif
-
-    is_rep = 0;
-    prefix66 = prefix67 = 0;
-    pref_seg = -1;
-
-    /* eat up prefixes */
-    done = 0;
-    do {
-       switch (*(csp++)) {
-       case 0x66:      /* operand prefix */  prefix66=1; break;
-       case 0x67:      /* address prefix */  prefix67=1; break;
-       case 0x2e:      /* CS */              pref_seg=CPU_REG(cs); break;
-       case 0x3e:      /* DS */              pref_seg=CPU_REG(ds); break;
-       case 0x26:      /* ES */              pref_seg=CPU_REG(es); break;
-       case 0x36:      /* SS */              pref_seg=CPU_REG(ss); break;
-       case 0x65:      /* GS */              pref_seg=CPU_REG(gs); break;
-       case 0x64:      /* FS */              pref_seg=CPU_REG(fs); break;
-       case 0xf2:      /* repnz */
-       case 0xf3:      /* rep */             is_rep=1; break;
-       default: done=1;
-       }
-    } while (!done);
-    csp--;   /* oops one too many */
-    org_eip = CPU_REG(eip);
-    CPU_REG_LW(eip) += (csp - lina);
-
-    switch (*csp) {
-
-    case 0x6c:                    /* insb */
-       /* NOTE: ES can't be overwritten; prefixes 66,67 should use esi,edi,ecx
-        * but is anyone using extended regs in real mode? */
-       /* WARNING: no test for DI wrapping! */
-       CPU_REG_LW(edi) += port_rep_inb(CPU_REG_LW(edx),
-                                       SEG_ADR((CARD8 *),es,di),
-                                       CPU_REG_LW(eflags)&DF,
-                                       (is_rep? LWECX:1));
-       if (is_rep) LWECX = 0;
-       CPU_REG_LW(eip)++;
-       break;
-
-    case 0x6d:                  /* (rep) insw / insd */
-       /* NOTE: ES can't be overwritten */
-       /* WARNING: no test for _DI wrapping! */
-       if (prefix66) {
-           CPU_REG_LW(edi) += port_rep_inl(CPU_REG_LW(edx),
-                                           SEG_ADR((CARD32 *),es,di),
-                                           CPU_REG_LW(eflags)&DF,
-                                           (is_rep? LWECX:1));
-       }
-       else {
-           CPU_REG_LW(edi) += port_rep_inw(CPU_REG_LW(edx),
-                                           SEG_ADR((CARD16 *),es,di),
-                                           CPU_REG_LW(eflags)&DF,
-                                           (is_rep? LWECX:1));
-       }
-       if (is_rep) LWECX = 0;
-       CPU_REG_LW(eip)++;
-       break;
-
-    case 0x6e:                  /* (rep) outsb */
-       if (pref_seg < 0) pref_seg = CPU_REG_LW(ds);
-       /* WARNING: no test for _SI wrapping! */
-       CPU_REG_LW(esi) += port_rep_outb(CPU_REG_LW(edx),(CARD8*)LIN_PREF_SI,
-                                        CPU_REG_LW(eflags)&DF,
-                                        (is_rep? LWECX:1));
-       if (is_rep) LWECX = 0;
-       CPU_REG_LW(eip)++;
-       break;
-
-    case 0x6f:                  /* (rep) outsw / outsd */
-       if (pref_seg < 0) pref_seg = CPU_REG_LW(ds);
-       /* WARNING: no test for _SI wrapping! */
-       if (prefix66) {
-           CPU_REG_LW(esi) += port_rep_outl(CPU_REG_LW(edx),
-                                            (CARD32 *)LIN_PREF_SI,
-                                            CPU_REG_LW(eflags)&DF,
-                                            (is_rep? LWECX:1));
-       }
-       else {
-           CPU_REG_LW(esi) += port_rep_outw(CPU_REG_LW(edx),
-                                            (CARD16 *)LIN_PREF_SI,
-                                            CPU_REG_LW(eflags)&DF,
-                                            (is_rep? LWECX:1));
-       }
-       if (is_rep) LWECX = 0;
-       CPU_REG_LW(eip)++;
-       break;
-
-    case 0xe5:                  /* inw xx, inl xx */
-       if (prefix66) CPU_REG(eax) = P.inl((int) csp[1]);
-       else CPU_REG_LW(eax) = P.inw((int) csp[1]);
-       CPU_REG_LW(eip) += 2;
-       break;
-    case 0xe4:                  /* inb xx */
-       CPU_REG_LW(eax) &= ~(CARD32)0xff;
-       CPU_REG_LB(ax) |= P.inb((int) csp[1]);
-       CPU_REG_LW(eip) += 2;
-       break;
-    case 0xed:                  /* inw dx, inl dx */
-       if (prefix66) CPU_REG(eax) = P.inl(CPU_REG_LW(edx));
-       else CPU_REG_LW(eax) = P.inw(CPU_REG_LW(edx));
-       CPU_REG_LW(eip) += 1;
-       break;
-    case 0xec:                  /* inb dx */
-       CPU_REG_LW(eax) &= ~(CARD32)0xff;
-       CPU_REG_LB(ax) |= P.inb(CPU_REG_LW(edx));
-       CPU_REG_LW(eip) += 1;
-       break;
-
-    case 0xe7:                  /* outw xx */
-       if (prefix66) P.outl((int)csp[1], CPU_REG(eax));
-       else P.outw((int)csp[1], CPU_REG_LW(eax));
-       CPU_REG_LW(eip) += 2;
-       break;
-    case 0xe6:                  /* outb xx */
-       P.outb((int) csp[1], CPU_REG_LB(ax));
-       CPU_REG_LW(eip) += 2;
-       break;
-    case 0xef:                  /* outw dx */
-       if (prefix66) P.outl(CPU_REG_LW(edx), CPU_REG(eax));
-       else P.outw(CPU_REG_LW(edx), CPU_REG_LW(eax));
-       CPU_REG_LW(eip) += 1;
-       break;
-    case 0xee:                  /* outb dx */
-       P.outb(CPU_REG_LW(edx), CPU_REG_LB(ax));
-       CPU_REG_LW(eip) += 1;
-       break;
-
-    case 0xf4:
-#ifdef V86BIOS_DEBUG
-       printf("hlt at %p\n", lina);
-#endif
-       return 0;
-
-    case 0x0f:
-       fprintf(stderr,"CPU 0x0f Trap at eip=0x%lx\n",CPU_REG(eip));
-       goto op0ferr;
-       break;
-
-    case 0xf0:                  /* lock */
-    default:
-       fprintf(stderr,"unknown reason for exception\n");
-       dump_registers();
-       stack_trace();
-    op0ferr:
-       dump_code();
-       fprintf(stderr,"cannot continue\n");
-       return 0;
-    }                           /* end of switch() */
-    return 1;
-}
-
-static int
-vm86_do_int(int num)
-{
-    int val;
-    struct regs86 regs;
-
-    i_printf("int 0x%x received: ax:0x%lx",num,CPU_REG(eax));
-    if (Config.PrintIp)
-       i_printf(" at: 0x%x\n",getIP());
-    else
-       i_printf("\n");
-
-    /* try to run bios interrupt */
-
-    /* if not installed fall back */
-#define COPY(x) regs.##x = CPU_REG(x)
-#define COPY_R(x) CPU_REG(x) = regs.##x
-
-    COPY(eax);
-    COPY(ebx);
-    COPY(ecx);
-    COPY(edx);
-    COPY(esi);
-    COPY(edi);
-    COPY(ebp);
-    COPY(eip);
-    COPY(esp);
-    COPY(cs);
-    COPY(ss);
-    COPY(ds);
-    COPY(es);
-    COPY(fs);
-    COPY(gs);
-    COPY(eflags);
-
-    if (!(val = int_handler(num,&regs)))
-       if (!(val = run_bios_int(num,&regs)))
-           return val;
-
-    COPY_R(eax);
-    COPY_R(ebx);
-    COPY_R(ecx);
-    COPY_R(edx);
-    COPY_R(esi);
-    COPY_R(edi);
-    COPY_R(ebp);
-    COPY_R(eip);
-    COPY_R(esp);
-    COPY_R(cs);
-    COPY_R(ss);
-    COPY_R(ds);
-    COPY_R(es);
-    COPY_R(fs);
-    COPY_R(gs);
-    COPY_R(eflags);
-
-    return val;
-#undef COPY
-#undef COPY_R
-}
-
-static void
-dump_code(void)
-{
-    int i;
-    unsigned char *lina = SEG_ADR((unsigned char *), cs, ip);
-
-    fprintf(stderr,"code at 0x%8.8x: ",(CARD32)lina);
-    for (i=0; i<0x10; i++)
-       fprintf(stderr,"%2.2x ",*(lina + i));
-    fprintf(stderr,"\n                    ");
-    for (; i<0x20; i++)
-       fprintf(stderr,"%2.2x ",*(lina + i));
-    fprintf(stderr,"\n");
-}
-
-#define PRINT(x) fprintf(stderr,#x":%4.4x ",CPU_REG_LW(x))
-#define PRINT_FLAGS(x) fprintf(stderr,#x":%8.8x ",CPU_REG_LW(x))
-static void
-dump_registers(void)
-{
-    PRINT(eip);
-    PRINT(eax);
-    PRINT(ebx);
-    PRINT(ecx);
-    PRINT(edx);
-    PRINT(esi);
-    PRINT(edi);
-    PRINT(ebp);
-    fprintf(stderr,"\n");
-    PRINT(esp);
-    PRINT(cs);
-    PRINT(ss);
-    PRINT(es);
-    PRINT(ds);
-    PRINT(fs);
-    PRINT(gs);
-    PRINT_FLAGS(eflags);
-    fprintf(stderr,"\n");
-}
-
-static void
-stack_trace(void)
-{
-    int i;
-    unsigned char *stack = SEG_ADR((unsigned char *), ss, sp);
-
-    fprintf(stderr,"stack at 0x%8.8lx:\n",(unsigned long)stack);
-    for (i=0; i < 0x10; i++)
-       fprintf(stderr,"%2.2x ",*(stack + i));
-    fprintf(stderr,"\n");
-
-}
-
-static int
-vm86_rep(struct vm86_struct *ptr)
-{
-
-    int __res;
-
-    __asm__ __volatile__("int $0x80\n"
-                        :"=a" (__res):"a" ((int)113),
-                        "b" ((struct vm86_struct *)ptr));
-
-           if ((__res) < 0) {
-               errno = -__res;
-               __res=-1;
-           }
-           else errno = 0;
-           return __res;
-}
-
-#define pushw(base, ptr, val) \
-__asm__ __volatile__( \
-       "decw %w0\n\t" \
-       "movb %h2,(%1,%0)\n\t" \
-       "decw %w0\n\t" \
-       "movb %b2,(%1,%0)" \
-       : "=r" (ptr) \
-       : "r" (base), "q" (val), "0" (ptr))
-
-int
-run_bios_int(int num, struct regs86 *regs)
-{
-    CARD16 *ssp;
-    CARD32 sp;
-    CARD32 eflags;
-
-#ifdef V86BIOS_DEBUG
-    static int firsttime = 1;
-#endif
-    /* check if bios vector is initialized */
-    if (((CARD16*)0)[(num<<1)+1] == 0x0000) { /* SYS_BIOS_SEG ?*/
-#ifdef V86BIOS_DEBUG
-       i_printf("card BIOS not loaded\n");
-#endif
-       return 0;
-    }
-
-#ifdef V86BIOS_DEBUG
-    if (firsttime) {
-       dprint(0,0x3D0);
-       firsttime = 0;
-    }
-#endif
-
-    i_printf("calling card BIOS at: ");
-    ssp = (CARD16*)(CPU_REG(ss)<<4);
-    sp = (CARD32) CPU_REG_LW(esp);
-
-    eflags = regs->eflags;
-    eflags = ((eflags & VIF_MASK) != 0)
-       ? (eflags | IF_MASK) : (eflags & ~(CARD32) IF_MASK);
-    pushw(ssp, sp, eflags);
-    pushw(ssp, sp, regs->cs);
-    pushw(ssp, sp, (CARD16)regs->eip);
-    regs->esp -= 6;
-    regs->cs = ((CARD16 *) 0)[(num << 1) + 1];
-    regs->eip = (regs->eip & 0xFFFF0000) | ((CARD16 *) 0)[num << 1];
-    i_printf("0x%x:%lx\n",regs->cs,regs->eip);
-#ifdef V86BIOS_DEBUG
-    dump_code();
-#endif
-    regs->eflags = regs->eflags
-                      & ~(VIF_MASK | TF_MASK | IF_MASK | NT_MASK);
-    return 1;
-}
-
-CARD32
-getIntVect(int num)
-{
-    return ((CARD32*)0)[num];
-}
-
-CARD32
-getIP(void)
-{
-    return (CPU_REG(cs) << 4) + CPU_REG(eip);
-}
diff --git a/board/MAI/bios_emulator/scitech/src/v86bios/v86bios.c b/board/MAI/bios_emulator/scitech/src/v86bios/v86bios.c
deleted file mode 100644 (file)
index 101c1f2..0000000
+++ /dev/null
@@ -1,933 +0,0 @@
-/*
- * Copyright 1999 Egbert Eich
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of the authors not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission.  The authors makes no representations
- * about the suitability of this software for any purpose.  It is provided
- * "as is" without express or implied warranty.
- *
- * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-#define DELETE
-#include <unistd.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <sys/mman.h>
-#include <sys/types.h>
-#include <string.h>
-#include <stdlib.h>
-#include <signal.h>
-#include <sys/stat.h>
-#include <readline/readline.h>
-#include <readline/history.h>
-#if defined(__alpha__) || defined (__ia64__)
-#include <sys/io.h>
-#elif defined(HAVE_SYS_PERM)
-#include <sys/perm.h>
-#endif
-#include "debug.h"
-#include "v86bios.h"
-#include "pci.h"
-#include "AsmMacros.h"
-
-#define SIZE 0x100000
-#define VRAM_START 0xA0000
-#define VRAM_SIZE 0x1FFFF
-#define V_BIOS_SIZE 0x1FFFF
-#define BIOS_START 0x7C00            /* default BIOS entry */
-#define BIOS_MEM 0x600
-
-/*CARD8 code[] = { 0xb8 , 0xf0 , 0xf0, 0xf4 }; */
-#define VB_X(x) (V_BIOS >> x) & 0xFF
-CARD8 code[] = { 6, 0x9a, 0x03, 0x00, 0x00, VB_X(12), 0xf4 };
-/*CARD8 code[] = { 0x9a, 0x03, 0x00, 0x00, VB_X(12), 0xb8, 0x03, 0x00, */
-/*0xcd, 0x10, 0xf4 }; */
-/*CARD8 code[] = {  0xb8 , 0xf0 , 0xf0 ,0xf4 }; */
-
-int ioperm_list[IOPERM_BITS] = {0,};
-
-static void sig_handler(int);
-static int map(void);
-static void unmap(void);
-static void bootBIOS(CARD16 ax);
-static int map_vram(void);
-static void unmap_vram(void);
-static int copy_vbios(memType v_base);
-static int copy_sys_bios(void);
-static void save_bios_to_file(void);
-static int setup_system_bios(void);
-static CARD32 setup_int_vect(void);
-#ifdef __ia32__
-static CARD32 setup_primary_int_vect(void);
-#endif
-static int chksum(CARD8 *start);
-static void setup_bios_regs(i86biosRegsPtr regs, CARD32 ax);
-static void print_regs(i86biosRegsPtr regs);
-static void print_usage(void);
-static void set_hlt(Bool set);
-static void set_ioperm(void);
-
-extern void yyparse();
-
-void loadCodeToMem(unsigned char *ptr, CARD8 *code);
-void dprint(unsigned long start, unsigned long size);
-
-static int vram_mapped = 0;
-static char* bios_var = NULL;
-static CARD8 save_msr;
-static CARD8 save_pos102;
-static CARD8 save_vse;
-static CARD8 save_46e8;
-static haltpoints hltp[20] = { {0, 0}, };
-
-console Console = {-1,-1};
-struct config Config;
-
-int main(int argc,char **argv)
-{
-    int c;
-
-    Config.PrintPort = PRINT_PORT;
-    Config.IoStatistics = IO_STATISTICS;
-    Config.PrintIrq = PRINT_IRQ;
-    Config.PrintPci = PRINT_PCI;
-    Config.ShowAllDev = SHOW_ALL_DEV;
-    Config.PrintIp = PRINT_IP;
-    Config.SaveBios = SAVE_BIOS;
-    Config.Trace = TRACE;
-    Config.ConfigActiveOnly = CONFIG_ACTIVE_ONLY;  /* boot */
-    Config.ConfigActiveDevice = CONFIG_ACTIVE_DEVICE; /* boot */
-    Config.MapSysBios = MAP_SYS_BIOS;
-    Config.Resort = RESORT;  /* boot */
-    Config.FixRom = FIX_ROM;
-    Config.NoConsole = NO_CONSOLE;
-    Config.BootOnly = FALSE;
-    Config.Verbose = VERBOSE;
-
-    opterr = 0;
-    while ((c = getopt(argc,argv,"psicaPStAdbrfnv:?")) != EOF) {
-    switch(c) {
-    case 'p':
-       Config.PrintPort = TRUE;
-       break;
-    case 's':
-       Config.IoStatistics = TRUE;
-       break;
-    case 'i':
-       Config.PrintIrq = TRUE;
-       break;
-    case 'c':
-       Config.PrintPci = TRUE;
-       break;
-    case 'a':
-       Config.ShowAllDev = TRUE;
-       break;
-    case 'P':
-       Config.PrintIp = TRUE;
-       break;
-    case 'S':
-       Config.SaveBios = TRUE;
-       break;
-    case 't':
-       Config.Trace = TRUE;
-       break;
-    case 'A':
-       Config.ConfigActiveOnly = TRUE;
-       break;
-    case 'd':
-       Config.ConfigActiveDevice = TRUE;
-       break;
-    case 'b':
-       Config.MapSysBios = TRUE;
-       break;
-    case 'r':
-       Config.Resort = TRUE;
-       break;
-    case 'f':
-       Config.FixRom = TRUE;
-       break;
-    case 'n':
-       Config.NoConsole = TRUE;
-       break;
-    case 'v':
-       Config.Verbose = strtol(optarg,NULL,0);
-       break;
-    case '?':
-       print_usage();
-       break;
-    default:
-       break;
-    }
-    }
-
-
-    if (!map())
-    exit(1);
-
-    if (!setup_system_bios())
-    exit(1);
-
-    iopl(3);
-
-    scan_pci();
-
-    save_msr = inb(0x3CC);
-    save_vse = inb(0x3C3);
-    save_46e8 = inb(0x46e8);
-    save_pos102 = inb(0x102);
-
-    if (Config.BootOnly) {
-
-    if (!CurrentPci && !Config.ConfigActiveDevice
-       && !Config.ConfigActiveOnly) {
-       iopl(0);
-       unmap();
-       exit (1);
-    }
-    call_boot(NULL);
-    } else {
-    using_history();
-    yyparse();
-    }
-
-    unmap();
-
-    pciVideoRestore();
-
-    outb(0x102, save_pos102);
-    outb(0x46e8, save_46e8);
-    outb(0x3C3, save_vse);
-    outb(0x3C2, save_msr);
-
-    iopl(0);
-
-    close_console(Console);
-
-    exit(0);
-}
-
-
-void
-call_boot(struct device *dev)
-{
-    int Active_is_Pci = 0;
-    CARD32 vbios_base;
-
-    CurrentPci = PciList;
-    Console = open_console();
-
-    set_ioperm();
-
-
-    signal(2,sig_handler);
-    signal(11,sig_handler);
-
-    /* disable primary card */
-    pciVideoRestore(); /* reset PCI state to see primary card */
-    outb(0x3C2,~(CARD8)0x03 & save_msr);
-    outb(0x3C3,~(CARD8)0x01 & save_vse);
-    outb(0x46e8, ~(CARD8)0x08 & save_46e8);
-    outb(0x102, ~(CARD8)0x01 & save_pos102);
-
-    pciVideoDisable();
-
-    while (CurrentPci) {
-    CARD16 ax;
-
-    if (CurrentPci->active) {
-       Active_is_Pci = 1;
-       if (!Config.ConfigActiveDevice && !dev) {
-       CurrentPci = CurrentPci->next;
-       continue;
-       }
-    } else if (Config.ConfigActiveOnly && !dev) {
-       CurrentPci = CurrentPci->next;
-       continue;
-    }
-    if (dev && ((dev->type != PCI)
-           || (dev->type == PCI
-           && (dev->loc.pci.dev != CurrentPci->dev
-               || dev->loc.pci.bus != CurrentPci->bus
-               || dev->loc.pci.func != CurrentPci->func)))) {
-       CurrentPci = CurrentPci->next;
-       continue;
-    }
-
-    EnableCurrent();
-
-    if (CurrentPci->active) {
-       outb(0x102, save_pos102);
-       outb(0x46e8, save_46e8);
-       outb(0x3C3, save_vse);
-       outb(0x3C2, save_msr);
-    }
-
-    /* clear interrupt vectors */
-#ifdef __ia32__
-    vbios_base = CurrentPci->active ? setup_primary_int_vect()
-       : setup_int_vect();
-#else
-    vbios_base = setup_int_vect();
-#endif
-    ax = ((CARD16)(CurrentPci->bus) << 8)
-       | (CurrentPci->dev << 3) | (CurrentPci->func & 0x7);
-    if (Config.Verbose > 1) P_printf("ax: 0x%x\n",ax);
-
-    BootBios = findPciByIDs(CurrentPci->bus,CurrentPci->dev,
-                  CurrentPci->func);
-    if (!((mapPciRom(BootBios) && chksum((CARD8*)V_BIOS))
-         || (CurrentPci->active && copy_vbios(vbios_base)))) {
-       CurrentPci = CurrentPci->next;
-       continue;
-    }
-    if (!map_vram()) {
-       CurrentPci = CurrentPci->next;
-       continue;
-    }
-    if (Config.SaveBios) save_bios_to_file();
-    printf("initializing PCI bus: %i dev: %i func: %i\n",CurrentPci->bus,
-          CurrentPci->dev,CurrentPci->func);
-    bootBIOS(ax);
-    unmap_vram();
-
-    if (CurrentPci->active)
-       close_console(Console);
-
-    if (dev) return;
-
-    CurrentPci = CurrentPci->next;
-    }
-
-    /* We have an ISA device - configure if requested */
-    if (!Active_is_Pci /* no isa card in system! */
-    && ((!dev && (Config.ConfigActiveDevice || Config.ConfigActiveOnly))
-       || (dev && dev->type == ISA))) {
-
-    pciVideoDisable();
-
-    if (!dev || dev->type == ISA) {
-       outb(0x102, save_pos102);
-       outb(0x46e8, save_46e8);
-       outb(0x3C3, save_vse);
-       outb(0x3C2, save_msr);
-
-#ifdef __ia32__
-       vbios_base = setup_primary_int_vect();
-#else
-       vbios_base = setup_int_vect();
-#endif
-       if (copy_vbios(vbios_base)) {
-
-       if (Config.SaveBios) save_bios_to_file();
-       if  (map_vram()) {
-           printf("initializing ISA bus\n");
-           bootBIOS(0);
-       }
-       }
-
-       unmap_vram();
-       sleep(1);
-       close_console(Console);
-    }
-    }
-
-
-}
-
-int
-map(void)
-{
-    void* mem;
-    mem = mmap(0, (size_t)SIZE,
-              PROT_EXEC | PROT_READ | PROT_WRITE,
-              MAP_FIXED | MAP_PRIVATE | MAP_ANON,
-              -1, 0 );
-    if (mem != 0) {
-       perror("anonymous map");
-       return (0);
-    }
-    memset(mem,0,SIZE);
-
-    return (1);
-}
-
-static void
-unmap(void)
-{
-    munmap(0,SIZE);
-}
-
-static void
-bootBIOS(CARD16 ax)
-{
-    i86biosRegs bRegs;
-#ifdef V86BIOS_DEBUG
-    printf("starting BIOS\n");
-#endif
-    setup_io();
-    setup_bios_regs(&bRegs, ax);
-    loadCodeToMem((unsigned char *) BIOS_START, code);
-    do_x86(BIOS_START,&bRegs);
-#ifdef V86BIOS_DEBUG
-    printf("done\n");
-#endif
-}
-
-static int
-map_vram(void)
-{
-    int mem_fd;
-
-#ifdef __ia64__
-    if ((mem_fd = open(MEM_FILE,O_RDWR | O_SYNC))<0)
-#else
-    if ((mem_fd = open(MEM_FILE,O_RDWR))<0)
-#endif
-       {
-       perror("opening memory");
-       return 0;
-    }
-
-#ifdef __alpha__
-       if (!_bus_base()) sparse_shift = 7; /* Uh, oh, JENSEN... */
-        if (!_bus_base_sparse()) sparse_shift = 0;
-        if ((vram_map = mmap(0,(size_t) (VRAM_SIZE << sparse_shift),
-                                                PROT_READ | PROT_WRITE,
-                                                MAP_SHARED,
-                                                mem_fd, (VRAM_START << sparse_shift)
-                                                | _bus_base_sparse())) == (void *) -1)
-#else
-      if (mmap((void *) VRAM_START, (size_t) VRAM_SIZE,
-                        PROT_EXEC | PROT_READ | PROT_WRITE, MAP_SHARED | MAP_FIXED,
-                        mem_fd, VRAM_START) == (void *) -1)
-#endif
-      {
-       perror("mmap error in map_hardware_ram (1)");
-           close(mem_fd);
-           return (0);
-       }
-    vram_mapped = 1;
-    close(mem_fd);
-    return (1);
-}
-
-static void
-unmap_vram(void)
-{
-    if (!vram_mapped) return;
-
-    munmap((void*)VRAM_START,VRAM_SIZE);
-    vram_mapped = 0;
-}
-
-static int
-copy_vbios(memType v_base)
-{
-    int mem_fd;
-    unsigned char *tmp;
-    int size;
-
-    if ((mem_fd = open(MEM_FILE,O_RDONLY))<0) {
-       perror("opening memory");
-       return (0);
-    }
-
-    if (lseek(mem_fd,(off_t) v_base, SEEK_SET) != (off_t) v_base) {
-         fprintf(stderr,"Cannot lseek\n");
-         goto Error;
-      }
-    tmp = (unsigned char *)malloc(3);
-    if (read(mem_fd, (char *)tmp, (size_t) 3) != (size_t) 3) {
-           fprintf(stderr,"Cannot read\n");
-       goto Error;
-    }
-    if (lseek(mem_fd,(off_t) v_base,SEEK_SET) != (off_t) v_base)
-       goto Error;
-
-    if (*tmp != 0x55 || *(tmp+1) != 0xAA ) {
-       fprintf(stderr,"No bios found at: 0x%lx\n",v_base);
-       goto Error;
-    }
-#ifdef DEBUG
-       dprint((unsigned long)tmp,0x100);
-#endif
-    size = *(tmp+2) * 512;
-
-    if (read(mem_fd, (char *)v_base, (size_t) size) != (size_t) size) {
-           fprintf(stderr,"Cannot read\n");
-       goto Error;
-    }
-    free(tmp);
-    close(mem_fd);
-    if (!chksum((CARD8*)v_base))
-       return (0);
-
-    return (1);
-
-Error:
-    perror("v_bios");
-    close(mem_fd);
-    return (0);
-}
-
-static int
-copy_sys_bios(void)
-{
-#define SYS_BIOS 0xF0000
-    int mem_fd;
-
-    if ((mem_fd = open(MEM_FILE,O_RDONLY))<0) {
-       perror("opening memory");
-       return (0);
-    }
-
-    if (lseek(mem_fd,(off_t) SYS_BIOS,SEEK_SET) != (off_t) SYS_BIOS)
-       goto Error;
-    if (read(mem_fd, (char *)SYS_BIOS, (size_t) 0xFFFF) != (size_t) 0xFFFF)
-       goto Error;
-
-    close(mem_fd);
-    return (1);
-
-Error:
-    perror("sys_bios");
-    close(mem_fd);
-    return (0);
-}
-
-void
-loadCodeToMem(unsigned char *ptr, CARD8 code[])
-{
-    int i;
-    CARD8 val;
-    int size = code[0];
-
-    for ( i=1;i<=size;i++) {
-       val = code[i];
-       *ptr++ = val;
-    }
-    return;
-}
-
-void
-dprint(unsigned long start, unsigned long size)
-{
-    int i,j;
-    char *c = (char *)start;
-
-    for (j = 0; j < (size >> 4); j++) {
-    char *d = c;
-    printf("\n0x%lx:  ",(unsigned long)c);
-    for (i = 0; i<16; i++)
-       printf("%2.2x ",(unsigned char) (*(c++)));
-    c = d;
-    for (i = 0; i<16; i++) {
-       printf("%c",((((CARD8)(*c)) > 32) && (((CARD8)(*c)) < 128)) ?
-          (unsigned char) (*(c)): '.');
-       c++;
-    }
-    }
-    printf("\n");
-}
-
-static void
-save_bios_to_file(void)
-{
-    static int num = 0;
-    int size, count;
-    char file_name[256];
-    int fd;
-
-    sprintf(file_name,"bios_%i.fil",num);
-    if ((fd =  open(file_name,O_WRONLY | O_CREAT | O_TRUNC,00644)) == -1)
-       return;
-    size = (*(unsigned char*)(V_BIOS + 2)) * 512;
-#ifdef V86BIOS_DEBUG
-    dprint(V_BIOS,20);
-#endif
-    if ((count = write(fd,(void *)(V_BIOS),size)) != size)
-       fprintf(stderr,"only saved %i of %i bytes\n",size,count);
-    num++;
-}
-
-static void
-sig_handler(int unused)
-{
-    fflush(stdout);
-    fflush(stderr);
-
-    /* put system back in a save state */
-    unmap_vram();
-    pciVideoRestore();
-    outb(0x102, save_pos102);
-    outb(0x46e8, save_46e8);
-    outb(0x3C3, save_vse);
-    outb(0x3C2, save_msr);
-
-    close_console(Console);
-    iopl(0);
-    unmap();
-
-    exit(1);
-}
-
-/*
- * For initialization we just pass ax to the BIOS.
- * PCI BIOSes need this. All other register are set 0.
- */
-static void setup_bios_regs(i86biosRegsPtr regs, CARD32 ax)
-{
-    regs->ax = ax;
-    regs->bx = 0;
-    regs->cx = 0;
-    regs->dx = 0;
-    regs->es = 0;
-    regs->ds = 0x40;               /* standard pc ds */
-    regs->si = 0;
-    regs->di = 0;
-}
-
-/*
- * here we are really paranoid about faking a "real"
- * BIOS. Most of this information was pulled from
- * dosem.
- */
-
-#ifdef __ia32__
-static CARD32
-setup_primary_int_vect(void)
-{
-    int mem_fd;
-    CARD32 vbase;
-    void *map;
-
-    if ((mem_fd = open(MEM_FILE,O_RDWR))<0)
-           {
-    perror("opening memory");
-    return (0);
-    }
-
-    if ((map = mmap((void *) 0, (size_t) 0x2000,
-        PROT_EXEC | PROT_READ | PROT_WRITE, MAP_SHARED,
-        mem_fd, 0)) == (void *)-1)   {
-    perror("mmap error in map_hardware_ram (2)");
-    close(mem_fd);
-    return (0);
-    }
-
-    close(mem_fd);
-    memcpy(0,map,BIOS_MEM);
-    munmap(map,0x2000);
-    /*
-     * create a backup copy of the bios variables to write back the
-     * modified values
-     */
-    if (!bios_var)
-    bios_var = (char *)malloc(BIOS_MEM);
-    memcpy(bios_var,0,BIOS_MEM);
-
-    vbase = (*((CARD16*)(0x10 << 2) + 1)) << 4;
-    if (Config.Verbose > 0) printf("vbase: 0x%x\n",vbase);
-    return vbase;
-}
-#endif
-
-static CARD32
-setup_int_vect(void)
-{
-    const CARD16 cs = 0x0;
-    const CARD16 ip = 0x0;
-    int i;
-
-    /* let the int vects point to the SYS_BIOS seg */
-    for (i=0; i<0x80; i++) {
-       ((CARD16*)0)[i<<1] = ip;
-       ((CARD16*)0)[(i<<1)+1] = cs;
-    }
-    /* video interrupts default location */
-    ((CARD16*)0)[(0x42<<1)+1] = 0xf000;
-    ((CARD16*)0)[0x42<<1] = 0xf065;
-    ((CARD16*)0)[(0x10<<1)+1] = 0xf000;
-    ((CARD16*)0)[0x10<<1] = 0xf065;
-    /* video param table default location (int 1d) */
-    ((CARD16*)0)[(0x1d<<1)+1] = 0xf000;
-    ((CARD16*)0)[0x1d<<1] = 0xf0A4;
-    /* font tables default location (int 1F) */
-    ((CARD16*)0)[(0x1f<<1)+1] = 0xf000;
-    ((CARD16*)0)[0x1f<<1] = 0xfa6e;
-
-    /* int 11 default location */
-    ((CARD16*)0)[(0x11<<1)+1] = 0xf000;
-    ((CARD16*)0)[0x11<<1] = 0xf84d;
-    /* int 12 default location */
-    ((CARD16*)0)[(0x12<<1)+1] = 0xf000;
-    ((CARD16*)0)[0x12<<1] = 0xf841;
-    /* int 15 default location */
-    ((CARD16*)0)[(0x15<<1)+1] = 0xf000;
-    ((CARD16*)0)[0x15<<1] = 0xf859;
-    /* int 1A default location */
-    ((CARD16*)0)[(0x1a<<1)+1] = 0xf000;
-    ((CARD16*)0)[0x1a<<1] = 0xff6e;
-    /* int 05 default location */
-    ((CARD16*)0)[(0x05<<1)+1] = 0xf000;
-    ((CARD16*)0)[0x05<<1] = 0xff54;
-    /* int 08 default location */
-    ((CARD16*)0)[(0x8<<1)+1] = 0xf000;
-    ((CARD16*)0)[0x8<<1] = 0xfea5;
-    /* int 13 default location (fdd) */
-    ((CARD16*)0)[(0x13<<1)+1] = 0xf000;
-    ((CARD16*)0)[0x13<<1] = 0xec59;
-    /* int 0E default location */
-    ((CARD16*)0)[(0xe<<1)+1] = 0xf000;
-    ((CARD16*)0)[0xe<<1] = 0xef57;
-    /* int 17 default location */
-    ((CARD16*)0)[(0x17<<1)+1] = 0xf000;
-    ((CARD16*)0)[0x17<<1] = 0xefd2;
-    /* fdd table default location (int 1e) */
-    ((CARD16*)0)[(0x1e<<1)+1] = 0xf000;
-    ((CARD16*)0)[0x1e<<1] = 0xefc7;
-    return V_BIOS;
-}
-
-static int
-setup_system_bios(void)
-{
-    char *date = "06/01/99";
-    char *eisa_ident = "PCI/ISA";
-
-    if (Config.MapSysBios) {
-
-       if (!copy_sys_bios()) return 0;
-       return 1;
-
-    } else {
-
-/*    memset((void *)0xF0000,0xf4,0xfff7); */
-
-       /*
-        * we trap the "industry standard entry points" to the BIOS
-        * and all other locations by filling them with "hlt"
-        * TODO: implement hlt-handler for these
-        */
-       memset((void *)0xF0000,0xf4,0x10000);
-
-       /*
-        * TODO: we should copy the fdd table (0xfec59-0xfec5b)
-        * the video parameter table (0xf0ac-0xf0fb)
-        * and the font tables (0xfa6e-0xfe6d)
-        * from the original bios here
-        */
-
-       /* set bios date */
-       strcpy((char *)0xFFFF5,date);
-       /* set up eisa ident string */
-       strcpy((char *)0xFFFD9,eisa_ident);
-       /* write system model id for IBM-AT */
-       ((char *)0)[0xFFFFE] = 0xfc;
-
-       return 1;
-    }
-
-}
-
-static void
-update_bios_vars(void)
-{
-    int mem_fd;
-    void *map;
-    memType i;
-
-#ifdef __ia64__
-    if ((mem_fd = open(MEM_FILE,O_RDWR | O_SYNC))<0)
-#else
-    if ((mem_fd = open(MEM_FILE,O_RDWR))<0)
-#endif
-           {
-    perror("opening memory");
-    return;
-    }
-
-    if ((map = mmap((void *) 0, (size_t) 0x2000,
-        PROT_EXEC | PROT_READ | PROT_WRITE, MAP_SHARED,
-        mem_fd, 0)) == (void *)-1)   {
-    perror("mmap error in map_hardware_ram (3)");
-    close(mem_fd);
-    return;
-    }
-
-    for (i = 0; i < BIOS_MEM; i++) {
-    if (bios_var[i] != *(CARD8*)i)
-       *((CARD8*)map + i) = *(CARD8*)i;
-    }
-
-    munmap(map,0x2000);
-    close(mem_fd);
-}
-
-static int
-chksum(CARD8 *start)
-{
-  CARD16 size;
-  CARD8 val = 0;
-  int i;
-
-  size = *(start+2) * 512;
-  for (i = 0; i<size; i++)
-    val += *(start + i);
-
-  if (!val)
-    return 1;
-
-    fprintf(stderr,"BIOS cksum wrong!\n");
-  return 0;
-}
-
-void
-runINT(int num, i86biosRegsPtr Regs)
-{
-    Bool isVideo = FALSE;
-    CARD8 code_int[] = { 3, 0xcd, 0x00, 0xf4 };
-
-    code_int[2] = (CARD8) num;
-
-    if (num == 0x10)
-    isVideo = TRUE;
-
-    if (!setup_system_bios())
-    return;
-
-    if ((isVideo && (!CurrentPci || CurrentPci->active)) || !isVideo) {
-    CARD32 vbios_base;
-
-#ifdef __ia32__
-    if (!(vbios_base = setup_primary_int_vect()))
-#else
-    if (!(vbios_base = setup_int_vect()))
-#endif
-       return;
-    if (!copy_vbios(vbios_base))
-       return;
-    }
-
-    if (!map_vram())
-    return;
-
-#ifdef V86BIOS_DEBUG
-       printf("starting BIOS\n");
-#endif
-    loadCodeToMem((unsigned char *) BIOS_START, code_int);
-    setup_io();
-    print_regs(Regs);
-    set_ioperm();
-    set_hlt(TRUE);
-    do_x86(BIOS_START,Regs);
-    set_hlt(FALSE);
-    print_regs(Regs);
-
-#ifdef V86BIOS_DEBUG
-    printf("done\n");
-#endif
-
-    if ((isVideo && (!CurrentPci || CurrentPci->active)) || !isVideo)
-    update_bios_vars();
-}
-
-static void
-print_regs(i86biosRegsPtr regs)
-{
-    printf("ax=%x bx=%x cx=%x dx=%x ds=%x es=%x di=%x si=%x\n",
-       (CARD16)regs->ax,(CARD16)regs->bx,(CARD16)regs->cx,(CARD16)regs->dx,
-       (CARD16)regs->ds,(CARD16)regs->es,(CARD16)regs->di,
-       (CARD16)regs->si);
-}
-
-static void
-print_usage(void)
-{
-}
-
-void
-add_hlt(unsigned long val)
-{
-    int i;
-
-    if (val < BIOS_MEM || (val > VRAM_START && val < (VRAM_START + VRAM_SIZE))
-    || val >= SIZE) {
-    printf("address out of range\n");
-    return;
-    }
-
-    for (i=0; i<20; i++) {
-    if (hltp[i].address == 0) {
-       hltp[i].address = (void*)val;
-       break;
-    }
-    }
-    if (i == 20) printf("no more hltpoints available\n");
-}
-
-void
-del_hlt(int val)
-{
-    if (val == 21) { /* delete all */
-    int i;
-    printf("clearing all hltpoints\n");
-    for (i=0; i <20; i++)
-       hltp[i].address = NULL;
-    } else if (val >= 0 &&  val <20)
-    hltp[val].address = NULL;
-    else printf("hltpoint %i out of range: valid range 0-19\n",val);
-}
-
-void
-list_hlt()
-{
-    int i;
-    for (i=0; i<20; i++)
-    if (hltp[i].address)
-       printf("hltpoint[%i]: 0x%lx\n",i,(unsigned long)hltp[i].address);
-}
-
-static void
-set_hlt(Bool set)
-{
-    int i;
-    for (i=0; i<20; i++)
-    if (hltp[i].address) {
-       if (set) {
-       hltp[i].orgval = *(CARD8*)hltp[i].address;
-       *(CARD8*)hltp[i].address = 0xf4;
-       } else
-       *(CARD8*)hltp[i].address = hltp[i].orgval;
-    }
-}
-
-static void
-set_ioperm(void)
-{
-    int i, start;
-
-    ioperm(0,IOPERM_BITS,0);
-
-    for (i = 0; i < IOPERM_BITS;i++)
-    if (ioperm_list[i]) {
-       start = i;
-       for (;i < IOPERM_BITS; i++) {
-       if (!ioperm_list[i]) {
-           ioperm(start,i - start, 1);
-           break;
-       }
-       }
-    }
-}
diff --git a/board/MAI/bios_emulator/scitech/src/v86bios/v86bios.h b/board/MAI/bios_emulator/scitech/src/v86bios/v86bios.h
deleted file mode 100644 (file)
index a8f3f8e..0000000
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
- * Copyright 1999 Egbert Eich
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of the authors not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission.  The authors makes no representations
- * about the suitability of this software for any purpose.  It is provided
- * "as is" without express or implied warranty.
- *
- * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-#ifndef V86_BIOS_H
-#define V86_BIOS_H
-
-#if defined (__i386__) || defined (__i486__) || defined (__i586__) || defined (__i686__) || defined (__k6__)
-# ifndef __ia32__
-#  define __ia32__
-# endif
-#endif
-
-#include <stdio.h>
-
-#define p_printf(f,a...) do {if (Config.PrintPort) lprintf(f,##a);} \
-                        while(0)
-#define i_printf(f,a...) do  {if (Config.PrintIrq) lprintf(f,##a);} \
-                         while(0)
-#define P_printf(f,a...) do {if (Config.PrintPci) lprintf(f,##a);} \
-                         while(0)
-
-typedef unsigned char CARD8;
-typedef unsigned short CARD16;
-typedef unsigned int CARD32;
-#if defined (__alpha__) || defined (__ia64__)
-typedef unsigned long memType;
-#else
-typedef unsigned int memType;
-#endif
-
-typedef int Bool;
-
-#define FALSE 0
-#define TRUE 1
-
-struct config {
-    Bool PrintPort;
-    Bool IoStatistics;
-    Bool PrintIrq;
-    Bool PrintPci;
-    Bool ShowAllDev;
-    Bool PrintIp;
-    Bool SaveBios;
-    Bool Trace;
-    Bool ConfigActiveOnly;
-    Bool ConfigActiveDevice;
-    Bool MapSysBios;
-    Bool Resort;
-    Bool FixRom;
-    Bool NoConsole;
-    Bool BootOnly;
-    int  Verbose;
-};
-
-struct pio {
-    CARD8 (*inb)(CARD16);
-    CARD16 (*inw)(CARD16);
-    CARD32 (*inl)(CARD16);
-    void (*outb)(CARD16,CARD8);
-    void (*outw)(CARD16,CARD16);
-    void (*outl)(CARD16,CARD32);
-};
-
-struct regs86 {
-       long ebx;
-       long ecx;
-       long edx;
-       long esi;
-       long edi;
-       long ebp;
-       long eax;
-       long eip;
-       long esp;
-       unsigned short cs;
-       unsigned short ss;
-       unsigned short es;
-       unsigned short ds;
-       unsigned short fs;
-       unsigned short gs;
-    long eflags;
-};
-
-typedef struct {
-    CARD32 ax;
-    CARD32 bx;
-    CARD32 cx;
-    CARD32 dx;
-    CARD32 cs;
-    CARD32 es;
-    CARD32 ds;
-    CARD32 si;
-    CARD32 di;
-} i86biosRegs, *i86biosRegsPtr;
-
-typedef struct {
-    int fd;
-    int vt;
-} console;
-
-typedef struct {
-    void* address;
-    CARD8 orgval;
-} haltpoints;
-
-enum dev_type {  NONE, ISA, PCI };
-struct device {
-    Bool booted;
-    enum dev_type type;
-    union {
-      int none;
-      struct pci {
-       int bus;
-       int dev;
-       int func;
-      } pci;
-    } loc;
-};
-
-extern struct device Device;
-
-#ifdef __alpha__
-unsigned long _bus_base(void);
-extern void* vram_map;
-extern int sparse_shift;
-#endif
-
-extern struct pio P;
-extern struct config Config;
-#define IOPERM_BITS 1024
-extern int ioperm_list[IOPERM_BITS];
-
-extern void setup_io(void);
-extern void do_x86(unsigned long bios_start,i86biosRegsPtr regs);
-extern int run_bios_int(int num, struct regs86 *regs);
-extern CARD32 getIntVect(int num);
-CARD32 getIP(void);
-
-extern void call_boot(struct device *dev);
-extern void runINT(int num,i86biosRegsPtr Regs);
-extern void add_hlt(unsigned long addr);
-extern void del_hlt(int addr);
-extern void list_hlt();
-
-extern int port_rep_inb(CARD16 port, CARD8 *base, int d_f, CARD32 count);
-extern int port_rep_inw(CARD16 port, CARD16 *base, int d_f, CARD32 count);
-extern int port_rep_inl(CARD16 port, CARD32 *base, int d_f, CARD32 count);
-extern int port_rep_outb(CARD16 port, CARD8 *base, int d_f, CARD32 count);
-extern int port_rep_outw(CARD16 port, CARD16 *base, int d_f, CARD32 count);
-extern int port_rep_outl(CARD16 port, CARD32 *base, int d_f, CARD32 count);
-extern CARD8 p_inb(CARD16 port);
-extern CARD16 p_inw(CARD16 port);
-extern CARD32 p_inl(CARD16 port);
-extern void p_outb(CARD16 port, CARD8 val);
-extern void p_outw(CARD16 port, CARD16 val);
-extern void p_outl(CARD16 port, CARD32 val);
-#ifdef __alpha__
-extern CARD8 a_inb(CARD16 port);
-extern CARD16 a_inw(CARD16 port);
-extern void a_outb(CARD16 port, CARD8 val);
-extern void a_outw(CARD16 port, CARD16 val);
-#endif
-#ifdef __alpha__
-CARD8 mem_rb(CARD32 addr);
-CARD16 mem_rw(CARD32 addr);
-CARD32 mem_rl(CARD32 addr);
-void mem_wb(CARD32 addr, CARD8 val);
-void mem_ww(CARD32 addr, CARD16 val);
-void mem_wl(CARD32 addr, CARD32 val);
-#endif
-extern void io_statistics(void);
-extern void clear_stat(void);
-extern int int_handler(int num, struct regs86 *regs);
-
-extern console open_console(void);
-extern void close_console(console);
-
-extern void dprint(unsigned long start, unsigned long size);
-
-extern Bool logging;
-extern Bool nostdout;
-extern char* logfile;
-extern void logon(void* ptr);
-extern void logoff();
-extern void lprintf(const char *f, ...);
-
-#define MEM_FILE "/dev/mem"
-#define DEFAULT_V_BIOS 0xc0000
-#ifndef V_BIOS
-#define V_BIOS DEFAULT_V_BIOS
-#endif
-
-#ifdef __alpha__
-#define NEED_PCI_IO
-#endif
-
-#endif
diff --git a/board/MAI/bios_emulator/scitech/src/v86bios/working_cards b/board/MAI/bios_emulator/scitech/src/v86bios/working_cards
deleted file mode 100644 (file)
index 7753f24..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-David Monro:                    Trident TGUI 9440
-                                Virge/VX (Diamond Stealth 3D 3400)   
-                                Riva TNT (Diamond Viper V550)   no vbios?
-Jarno Paananen <jpaana@s2.org>: Guillemot Maxigamer Xentor 32 
-                                (NVIDIA TNT2 Ultra)
-                                Creative Graphics Blaster Exxtreme 
-                                (Permedia 2) 
diff --git a/board/MAI/bios_emulator/scitech/src/v86bios/x86emu.c b/board/MAI/bios_emulator/scitech/src/v86bios/x86emu.c
deleted file mode 100644 (file)
index b5c99d7..0000000
+++ /dev/null
@@ -1,316 +0,0 @@
-/*
- * Copyright 1999 Egbert Eich
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of the authors not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission.  The authors makes no representations
- * about the suitability of this software for any purpose.  It is provided
- * "as is" without express or implied warranty.
- *
- * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-#include "debug.h"
-
-#define IF_MASK     0x00000200
-#define VIF_MASK    0x00080000  /* virtual interrupt flag */
-#define VIP_MASK    0x00100000  /* virtual interrupt pending */
-
-#include </usr/include/unistd.h>
-#include <errno.h>
-#include <asm/unistd.h>
-/*#include <syscall-list.h> */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdarg.h>
-#ifdef __alpha__
-#include <sys/io.h>
-#endif
-#include <signal.h>
-#include <setjmp.h>
-#include "AsmMacros.h"
-#include "v86bios.h"
-# define DEBUG
-#include "x86emu.h"
-#undef DEBUG
-
-#define M            _X86EMU_env
-#define CPU_REG(reg) M.x86.R_##reg
-
-struct pio P;
-
-void
-setup_io(void)
-{
-    if (!Config.PrintPort && !Config.IoStatistics) {
-
-#if defined (__i386__)
-    P.inb = (u8(*)(u16))inb;
-    P.inw = (u16(*)(u16))inw;
-    P.outb = (void(*)(u16,u8))outb;
-    P.outw = (void(*)(u16,u16))outw;
-#else
-    P.inb = p_inb;
-    P.inw = p_inw;
-    P.outb = p_outb;
-    P.outw = p_outw;
-#endif
-#if defined (__i386__) && ! defined(NEED_PCI_IO)
-    P.inl = (u32(*)(u16))inl;
-    P.outl = (void(*)(u16,u32))outl;
-#else
-    P.inl = p_inl;
-    P.outl = p_outl;
-#endif
-    } else {
-    P.inb = p_inb;
-    P.inw = p_inw;
-    P.inl = p_inl;
-    P.outb = p_outb;
-    P.outw = p_outw;
-    P.outl = p_outl;
-    }
-}
-
-void
-x86emu_do_int(int num)
-{
-    struct regs86 regs;
-
-    i_printf("int 0x%x received: ax:0x%x",num,CPU_REG(AX));
-    if (Config.PrintIp)
-       i_printf(" at: 0x%x\n",getIP());
-    else
-       i_printf("\n");
-
-    /* try to run bios interrupt */
-
-    /* if not installed fall back */
-#define COPY(x,y) regs.y = M.x86.x
-#define COPY_R(x,y) M.x86.x = regs.y
-
-    COPY(R_EAX,eax);
-    COPY(R_EBX,ebx);
-    COPY(R_ECX,ecx);
-    COPY(R_EDX,edx);
-    COPY(R_ESI,esi);
-    COPY(R_EDI,edi);
-    COPY(R_EBP,ebp);
-    COPY(R_EIP,eip);
-    COPY(R_ESP,esp);
-    COPY(R_CS,cs);
-    COPY(R_SS,ss);
-    COPY(R_DS,ds);
-    COPY(R_ES,es);
-    COPY(R_FS,fs);
-    COPY(R_GS,gs);
-    COPY(R_EFLG,eflags);
-
-    if (!(int_handler(num,&regs))) {
-       if (!run_bios_int(num,&regs))
-           goto unknown_int;
-       else
-           return;
-    }
-
-    COPY_R(R_EAX,eax);
-    COPY_R(R_EBX,ebx);
-    COPY_R(R_ECX,ecx);
-    COPY_R(R_EDX,edx);
-    COPY_R(R_ESI,esi);
-    COPY_R(R_EDI,edi);
-    COPY_R(R_EBP,ebp);
-    COPY_R(R_EIP,eip);
-    COPY_R(R_ESP,esp);
-    COPY_R(R_CS,cs);
-    COPY_R(R_SS,ss);
-    COPY_R(R_DS,ds);
-    COPY_R(R_ES,es);
-    COPY_R(R_FS,fs);
-    COPY_R(R_GS,gs);
-    COPY_R(R_EFLG,eflags);
-    return;
-
- unknown_int:
-    fprintf(stderr,"\nUnknown vm86_int: %X\n\n",num);
-    X86EMU_halt_sys();
-    return;
-
-#undef COPY
-#undef COPY_R
-}
-
-void
-setup_x86emu(unsigned long bios_start, i86biosRegsPtr regs)
-{
-    int i;
-    CARD32 eip;
-    CARD16 cs;
-    X86EMU_intrFuncs intFuncs[256];
-
-    X86EMU_pioFuncs pioFuncs = {
-       (u8(*)(u16))P.inb,
-       (u16(*)(u16))P.inw,
-       (u32(*)(u16))P.inl,
-       (void(*)(u16,u8))P.outb,
-       (void(*)(u16,u16))P.outw,
-       (void(*)(u16,u32))P.outl
-    };
-#ifdef __alpha__
-    X86EMU_memFuncs memFuncs = {
-      (u8(*)(u32))mem_rb,
-      (u16(*)(u32))mem_rw,
-      (u32(*)(u32))mem_rl,
-      (void(*)(u32,u8))mem_wb,
-      (void(*)(u32,u16))mem_ww,
-      (void(*)(u32,u32))mem_wl
-    };
-#endif
-    M.mem_base = 0;
-    M.mem_size = 1024*1024 + 1024;
-    /*  M.x86.debug = DEBUG_DISASSEMBLE_F | DEBUG_TRACE_F | DEBUG_DECODE_F; */
-    /*  M.x86.debug |= DEBUG_DECODE_F |  DEBUG_TRACE_F; */
-/*
- * For single step tracing compile x86emu with option -DDEBUG
- */
-    M.x86.debug = 0;
-    if (Config.PrintIp)
-       M.x86.debug = DEBUG_SAVE_CS_IP;
-
-    if (Config.Trace)
-       X86EMU_trace_on();
-
-    X86EMU_setupPioFuncs(&pioFuncs);
-#ifdef __alpha__
-    X86EMU_setupMemFuncs(&memFuncs);
-#endif
-    for (i=0;i<256;i++)
-       intFuncs[i] = x86emu_do_int;
-    X86EMU_setupIntrFuncs(intFuncs);
-
-    eip = bios_start & 0xFFFF;
-    cs = (bios_start & 0xFF0000) >> 4;
-
-    CPU_REG(EAX) = regs->ax;
-    CPU_REG(EBX) = regs->bx;
-    CPU_REG(ECX) = regs->cx;
-    CPU_REG(EDX) = regs->dx;
-    CPU_REG(ESI) = regs->si;
-    CPU_REG(EDI) = regs->di;
-    CPU_REG(EBP) = 0;
-    CPU_REG(EIP) = eip;
-    CPU_REG(CS) = cs;
-    CPU_REG(SP) = 0x100;
-    CPU_REG(SS) = 0x30;               /* This is the standard pc bios stack */
-    CPU_REG(ES) = regs->es;
-    CPU_REG(DS) = regs->ds;
-    CPU_REG(FS) = 0;
-    CPU_REG(GS) = 0;
-    CPU_REG(EFLG) |= (VIF_MASK | VIP_MASK | IF_MASK | 0x2);
-}
-
-void
-collect_bios_regs(i86biosRegsPtr regs)
-{
-    regs->ax = CPU_REG(EAX);
-    regs->bx = CPU_REG(EBX);
-    regs->cx = CPU_REG(ECX);
-    regs->dx = CPU_REG(EDX);
-    regs->es = CPU_REG(ES);
-    regs->ds = CPU_REG(DS);
-    regs->di = CPU_REG(EDI);
-    regs->si = CPU_REG(ESI);
-}
-
-static void
-do_x86emu(void)
-{
-    X86EMU_exec();
-}
-
-static jmp_buf x86_esc;
-static void
-vmexit(int unused)
-{
-    longjmp(x86_esc,1);
-}
-
-void
-do_x86(unsigned long bios_start, i86biosRegsPtr regs)
-{
-    static void (*org_handler)(int);
-
-    setup_x86emu(bios_start,regs);
-    if (setjmp(x86_esc) == 0) {
-       org_handler = signal(2,vmexit);
-       do_x86emu();
-       signal(2,org_handler);
-       collect_bios_regs(regs);
-    } else {
-       signal(2,org_handler);
-       printf("interrupted at 0x%x\n",((CARD16)CPU_REG(CS)) << 4
-              | (CARD16)CPU_REG(EIP));
-    }
-}
-
-int
-run_bios_int(int num, struct regs86 *regs)
-{
-#ifdef V86BIOS_DEBUG
-    static int firsttime = 1;
-#endif
-    /* check if bios vector is initialized */
-    if (((CARD16*)0)[(num<<1)+1] == 0x0000) { /* SYS_BIOS_SEG ?*/
-#ifdef V86BIOS_DEBUG
-       i_printf("card BIOS not loaded\n");
-#endif
-       return 0;
-    }
-
-#ifdef V86BIOS_DEBUG
-    if (firsttime) {
-       dprint(0,0x3D0);
-       firsttime = 0;
-    }
-#endif
-
-    i_printf("calling card BIOS at: ");
-    i_printf("0x%x:%x\n",((CARD16 *) 0)[(num << 1) + 1],
-            (CARD32)((CARD16 *) 0)[num << 1]);
-    X86EMU_prepareForInt(num);
-
-    return 1;
-}
-
-CARD32
-getIntVect(int num)
-{
-  return ((CARD32*)0)[num];
-}
-#if 0
-void
-printk(const char *fmt, ...)
-{
-    va_list argptr;
-    va_start(argptr, fmt);
-    vfprintf(stdout, fmt, argptr);
-    fflush(stdout);
-    va_end(argptr);
-}
-#endif
-
-CARD32
-getIP(void)
-{
-    return (M.x86.saved_cs << 4) + M.x86.saved_ip;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/x86emu/LICENSE b/board/MAI/bios_emulator/scitech/src/x86emu/LICENSE
deleted file mode 100644 (file)
index a3ede4a..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-                         License information
-                         -------------------
-
-The x86emu library is under a BSD style license, comaptible
-with the XFree86 and X licenses used by XFree86. The
-original x86emu libraries were under the GNU General Public
-License. Due to license incompatibilities between the GPL
-and the XFree86 license, the original authors of the code
-decided to allow a license change. If you have submitted
-code to the original x86emu project, and you don't agree
-with the license change, please contact us and let you
-know. Your code will be removed to comply with your wishes.
-
-If you have any questions about this, please send email to
-x86emu@linuxlabs.com or KendallB@scitechsoft.com for
-clarification.
-
diff --git a/board/MAI/bios_emulator/scitech/src/x86emu/debug.c b/board/MAI/bios_emulator/scitech/src/x86emu/debug.c
deleted file mode 100644 (file)
index 235e6ac..0000000
+++ /dev/null
@@ -1,443 +0,0 @@
-/****************************************************************************
-*
-*                                              Realmode X86 Emulator Library
-*
-*              Copyright (C) 1996-1999 SciTech Software, Inc.
-*                                   Copyright (C) David Mosberger-Tang
-*                                         Copyright (C) 1999 Egbert Eich
-*
-*  ========================================================================
-*
-*  Permission to use, copy, modify, distribute, and sell this software and
-*  its documentation for any purpose is hereby granted without fee,
-*  provided that the above copyright notice appear in all copies and that
-*  both that copyright notice and this permission notice appear in
-*  supporting documentation, and that the name of the authors not be used
-*  in advertising or publicity pertaining to distribution of the software
-*  without specific, written prior permission.  The authors makes no
-*  representations about the suitability of this software for any purpose.
-*  It is provided "as is" without express or implied warranty.
-*
-*  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-*  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-*  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-*  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-*  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-*  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-*  PERFORMANCE OF THIS SOFTWARE.
-*
-*  ========================================================================
-*
-* Language:            ANSI C
-* Environment: Any
-* Developer:    Kendall Bennett
-*
-* Description:  This file contains the code to handle debugging of the
-*                              emulator.
-*
-****************************************************************************/
-
-#include "x86emu/x86emui.h"
-#include <stdarg.h>
-#include <stdlib.h>
-
-/*----------------------------- Implementation ----------------------------*/
-
-#ifdef DEBUG
-
-static void     print_encoded_bytes (u16 s, u16 o);
-static void     print_decoded_instruction (void);
-static int      parse_line (char *s, int *ps, int *n);
-
-/* should look something like debug's output. */
-void X86EMU_trace_regs (void)
-{
-       if (DEBUG_TRACE()) {
-               x86emu_dump_regs();
-    }
-       if (DEBUG_DECODE() && ! DEBUG_DECODE_NOPRINT()) {
-               printk("%04x:%04x ",M.x86.saved_cs, M.x86.saved_ip);
-               print_encoded_bytes( M.x86.saved_cs, M.x86.saved_ip);
-               print_decoded_instruction();
-    }
-}
-
-void X86EMU_trace_xregs (void)
-{
-       if (DEBUG_TRACE()) {
-               x86emu_dump_xregs();
-    }
-}
-
-void x86emu_just_disassemble (void)
-{
-    /*
-     * This routine called if the flag DEBUG_DISASSEMBLE is set kind
-     * of a hack!
-     */
-       printk("%04x:%04x ",M.x86.saved_cs, M.x86.saved_ip);
-       print_encoded_bytes( M.x86.saved_cs, M.x86.saved_ip);
-       print_decoded_instruction();
-}
-
-static void disassemble_forward (u16 seg, u16 off, int n)
-{
-       X86EMU_sysEnv tregs;
-       int i;
-       u8 op1;
-    /*
-     * hack, hack, hack.  What we do is use the exact machinery set up
-     * for execution, except that now there is an additional state
-     * flag associated with the "execution", and we are using a copy
-     * of the register struct.  All the major opcodes, once fully
-     * decoded, have the following two steps: TRACE_REGS(r,m);
-     * SINGLE_STEP(r,m); which disappear if DEBUG is not defined to
-     * the preprocessor.  The TRACE_REGS macro expands to:
-     *
-     * if (debug&DEBUG_DISASSEMBLE)
-     *     {just_disassemble(); goto EndOfInstruction;}
-     *     if (debug&DEBUG_TRACE) trace_regs(r,m);
-     *
-     * ......  and at the last line of the routine.
-     *
-     * EndOfInstruction: end_instr();
-     *
-     * Up to the point where TRACE_REG is expanded, NO modifications
-     * are done to any register EXCEPT the IP register, for fetch and
-     * decoding purposes.
-     *
-     * This was done for an entirely different reason, but makes a
-     * nice way to get the system to help debug codes.
-     */
-       tregs = M;
-    tregs.x86.R_IP = off;
-    tregs.x86.R_CS = seg;
-
-    /* reset the decoding buffers */
-    tregs.x86.enc_str_pos = 0;
-    tregs.x86.enc_pos = 0;
-
-    /* turn on the "disassemble only, no execute" flag */
-    tregs.x86.debug |= DEBUG_DISASSEMBLE_F;
-
-    /* DUMP NEXT n instructions to screen in straight_line fashion */
-    /*
-     * This looks like the regular instruction fetch stream, except
-     * that when this occurs, each fetched opcode, upon seeing the
-     * DEBUG_DISASSEMBLE flag set, exits immediately after decoding
-     * the instruction.  XXX --- CHECK THAT MEM IS NOT AFFECTED!!!
-     * Note the use of a copy of the register structure...
-     */
-    for (i=0; i<n; i++) {
-               op1 = (*sys_rdb)(((u32)M.x86.R_CS<<4) + (M.x86.R_IP++));
-               (x86emu_optab[op1])(op1);
-    }
-    /* end major hack mode. */
-}
-
-void x86emu_check_ip_access (void)
-{
-    /* NULL as of now */
-}
-
-void x86emu_check_sp_access (void)
-{
-}
-
-void x86emu_check_mem_access (u32 dummy)
-{
-       /*  check bounds, etc */
-}
-
-void x86emu_check_data_access (uint dummy1, uint dummy2)
-{
-       /*  check bounds, etc */
-}
-
-void x86emu_inc_decoded_inst_len (int x)
-{
-       M.x86.enc_pos += x;
-}
-
-void x86emu_decode_printf (char *x)
-{
-       sprintf(M.x86.decoded_buf+M.x86.enc_str_pos,"%s",x);
-       M.x86.enc_str_pos += strlen(x);
-}
-
-void x86emu_decode_printf2 (char *x, int y)
-{
-       char temp[100];
-       sprintf(temp,x,y);
-       sprintf(M.x86.decoded_buf+M.x86.enc_str_pos,"%s",temp);
-       M.x86.enc_str_pos += strlen(temp);
-}
-
-void x86emu_end_instr (void)
-{
-       M.x86.enc_str_pos = 0;
-       M.x86.enc_pos = 0;
-}
-
-static void print_encoded_bytes (u16 s, u16 o)
-{
-    int i;
-    char buf1[64];
-       for (i=0; i< M.x86.enc_pos; i++) {
-               sprintf(buf1+2*i,"%02x", fetch_data_byte_abs(s,o+i));
-    }
-       printk("%-20s",buf1);
-}
-
-static void print_decoded_instruction (void)
-{
-       printk("%s", M.x86.decoded_buf);
-}
-
-void x86emu_print_int_vect (u16 iv)
-{
-       u16 seg,off;
-
-       if (iv > 256) return;
-       seg   = fetch_data_word_abs(0,iv*4);
-       off   = fetch_data_word_abs(0,iv*4+2);
-       printk("%04x:%04x ", seg, off);
-}
-
-void X86EMU_dump_memory (u16 seg, u16 off, u32 amt)
-{
-    u32 start = off & 0xfffffff0;
-    u32 end  = (off+16) & 0xfffffff0;
-    u32 i;
-    u32 current;
-
-    current = start;
-    while (end <= off + amt) {
-       printk("%04x:%04x ", seg, start);
-       for (i=start; i< off; i++)
-           printk("   ");
-       for (       ; i< end; i++)
-           printk("%02x ", fetch_data_byte_abs(seg,i));
-       printk("\n");
-       start = end;
-       end = start + 16;
-    }
-}
-
-void x86emu_single_step (void)
-{
-    char s[1024];
-    int ps[10];
-    int ntok;
-    int cmd;
-    int done;
-               int segment;
-    int offset;
-    static int breakpoint;
-    static int noDecode = 1;
-
-    char *p;
-
-    if (DEBUG_BREAK()) {
-       if (M.x86.saved_ip != breakpoint) {
-           return;
-       } else {
-           M.x86.debug &= ~DEBUG_DECODE_NOPRINT_F;
-           M.x86.debug |= DEBUG_TRACE_F;
-           M.x86.debug &= ~DEBUG_BREAK_F;
-           print_decoded_instruction ();
-           X86EMU_trace_regs();
-       }
-    }
-
-    done=0;
-    offset = M.x86.saved_ip;
-    while (!done) {
-       printk("-");
-       /*p = fgets(s, 1023, stdin); */
-       cons_gets(s);
-       cmd = parse_line(s, ps, &ntok);
-       switch(cmd) {
-       case 'u':
-           disassemble_forward(M.x86.saved_cs,(u16)offset,10);
-           break;
-       case 'd':
-           if (ntok == 2) {
-               segment = M.x86.saved_cs;
-               offset = ps[1];
-               X86EMU_dump_memory(segment,(u16)offset,16);
-               offset += 16;
-           } else if (ntok == 3) {
-               segment = ps[1];
-               offset = ps[2];
-               X86EMU_dump_memory(segment,(u16)offset,16);
-               offset += 16;
-           } else {
-               segment = M.x86.saved_cs;
-               X86EMU_dump_memory(segment,(u16)offset,16);
-               offset += 16;
-           }
-           break;
-       case 'c':
-           M.x86.debug ^= DEBUG_TRACECALL_F;
-           break;
-       case 's':
-           M.x86.debug ^= DEBUG_SVC_F | DEBUG_SYS_F | DEBUG_SYSINT_F;
-           break;
-       case 'r':
-           X86EMU_trace_regs();
-           break;
-       case 'x':
-           X86EMU_trace_xregs();
-           break;
-       case 'g':
-           if (ntok == 2) {
-               breakpoint = ps[1];
-               printk("breakpoint set to 0x%X\n", breakpoint);
-               if (noDecode) {
-                   M.x86.debug |= DEBUG_DECODE_NOPRINT_F;
-               } else {
-                   M.x86.debug &= ~DEBUG_DECODE_NOPRINT_F;
-               }
-               M.x86.debug &= ~DEBUG_TRACE_F;
-               M.x86.debug |= DEBUG_BREAK_F;
-               done = 1;
-           }
-           break;
-       case 'q':
-           M.x86.debug |= DEBUG_EXIT;
-           return;
-       case 'P':
-           noDecode = (noDecode)?0:1;
-           printk("Toggled decoding to %s\n",(noDecode)?"FALSE":"TRUE");
-           break;
-       case 't':
-       case 0:
-           done = 1;
-           break;
-       }
-    }
-}
-
-int X86EMU_trace_on(void)
-{
-       return M.x86.debug |= DEBUG_STEP_F | DEBUG_DECODE_F | DEBUG_TRACE_F;
-}
-
-int X86EMU_trace_off(void)
-{
-       return M.x86.debug &= ~(DEBUG_STEP_F | DEBUG_DECODE_F | DEBUG_TRACE_F);
-}
-
-static int parse_line (char *s, int *ps, int *n)
-{
-    int cmd;
-
-    *n = 0;
-    while(*s == ' ' || *s == '\t') s++;
-    ps[*n] = *s;
-    switch (*s) {
-      case '\n':
-       *n += 1;
-       return 0;
-      default:
-       cmd = *s;
-       *n += 1;
-    }
-
-       while (1) {
-               while (*s != ' ' && *s != '\t' && *s != '\n')  s++;
-
-               if (*s == '\n')
-                       return cmd;
-
-               while(*s == ' ' || *s == '\t') s++;
-
-               ps[*n]=atoi(s);
-               /*sscanf(s,"%x",&ps[*n]); */
-               *n += 1;
-       }
-}
-
-#endif /* DEBUG */
-
-void x86emu_dump_stack(void)
-{
-    int i;
-    printk("Stack: ");
-    for (i = 0; i<16; i++)
-    {
-       u8 x = fetch_data_byte_abs(M.x86.R_SS, M.x86.R_SP + i);
-       printk("%02x ", (int)x);
-    }
-    printk("\n");
-}
-
-void x86emu_dump_regs (void)
-{
-       printk("\tAX=%04x  ", M.x86.R_AX );
-       printk("BX=%04x  ", M.x86.R_BX );
-       printk("CX=%04x  ", M.x86.R_CX );
-       printk("DX=%04x  ", M.x86.R_DX );
-       printk("SP=%04x  ", M.x86.R_SP );
-       printk("BP=%04x  ", M.x86.R_BP );
-       printk("SI=%04x  ", M.x86.R_SI );
-       printk("DI=%04x\n", M.x86.R_DI );
-       printk("\tDS=%04x  ", M.x86.R_DS );
-       printk("ES=%04x  ", M.x86.R_ES );
-       printk("SS=%04x  ", M.x86.R_SS );
-       printk("CS=%04x  ", M.x86.R_CS );
-       printk("IP=%04x   ", M.x86.R_IP );
-       if (ACCESS_FLAG(F_OF))    printk("OV ");     /* CHECKED... */
-       else                        printk("NV ");
-       if (ACCESS_FLAG(F_DF))    printk("DN ");
-       else                        printk("UP ");
-       if (ACCESS_FLAG(F_IF))    printk("EI ");
-       else                        printk("DI ");
-       if (ACCESS_FLAG(F_SF))    printk("NG ");
-       else                        printk("PL ");
-       if (ACCESS_FLAG(F_ZF))    printk("ZR ");
-       else                        printk("NZ ");
-       if (ACCESS_FLAG(F_AF))    printk("AC ");
-       else                        printk("NA ");
-       if (ACCESS_FLAG(F_PF))    printk("PE ");
-       else                        printk("PO ");
-       if (ACCESS_FLAG(F_CF))    printk("CY ");
-       else                        printk("NC ");
-       printk("\n");
-       /*x86emu_dump_stack(); */
-}
-
-void x86emu_dump_xregs (void)
-{
-       printk("\tEAX=%08x  ", M.x86.R_EAX );
-       printk("EBX=%08x  ", M.x86.R_EBX );
-       printk("ECX=%08x  ", M.x86.R_ECX );
-       printk("EDX=%08x  \n", M.x86.R_EDX );
-       printk("\tESP=%08x  ", M.x86.R_ESP );
-       printk("EBP=%08x  ", M.x86.R_EBP );
-       printk("ESI=%08x  ", M.x86.R_ESI );
-       printk("EDI=%08x\n", M.x86.R_EDI );
-       printk("\tDS=%04x  ", M.x86.R_DS );
-       printk("ES=%04x  ", M.x86.R_ES );
-       printk("SS=%04x  ", M.x86.R_SS );
-       printk("CS=%04x  ", M.x86.R_CS );
-       printk("EIP=%08x\n\t", M.x86.R_EIP );
-       if (ACCESS_FLAG(F_OF))    printk("OV ");     /* CHECKED... */
-       else                        printk("NV ");
-       if (ACCESS_FLAG(F_DF))    printk("DN ");
-       else                        printk("UP ");
-       if (ACCESS_FLAG(F_IF))    printk("EI ");
-       else                        printk("DI ");
-       if (ACCESS_FLAG(F_SF))    printk("NG ");
-       else                        printk("PL ");
-       if (ACCESS_FLAG(F_ZF))    printk("ZR ");
-       else                        printk("NZ ");
-       if (ACCESS_FLAG(F_AF))    printk("AC ");
-       else                        printk("NA ");
-       if (ACCESS_FLAG(F_PF))    printk("PE ");
-       else                        printk("PO ");
-       if (ACCESS_FLAG(F_CF))    printk("CY ");
-       else                        printk("NC ");
-       printk("\n");
-}
diff --git a/board/MAI/bios_emulator/scitech/src/x86emu/decode.c b/board/MAI/bios_emulator/scitech/src/x86emu/decode.c
deleted file mode 100644 (file)
index 832b1f5..0000000
+++ /dev/null
@@ -1,970 +0,0 @@
-/****************************************************************************
-*
-*                                              Realmode X86 Emulator Library
-*
-*              Copyright (C) 1996-1999 SciTech Software, Inc.
-*                                   Copyright (C) David Mosberger-Tang
-*                                         Copyright (C) 1999 Egbert Eich
-*
-*  ========================================================================
-*
-*  Permission to use, copy, modify, distribute, and sell this software and
-*  its documentation for any purpose is hereby granted without fee,
-*  provided that the above copyright notice appear in all copies and that
-*  both that copyright notice and this permission notice appear in
-*  supporting documentation, and that the name of the authors not be used
-*  in advertising or publicity pertaining to distribution of the software
-*  without specific, written prior permission.  The authors makes no
-*  representations about the suitability of this software for any purpose.
-*  It is provided "as is" without express or implied warranty.
-*
-*  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-*  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-*  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-*  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-*  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-*  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-*  PERFORMANCE OF THIS SOFTWARE.
-*
-*  ========================================================================
-*
-* Language:            ANSI C
-* Environment: Any
-* Developer:    Kendall Bennett
-*
-* Description:  This file includes subroutines which are related to
-*                              instruction decoding and accessess of immediate data via IP.  etc.
-*
-****************************************************************************/
-
-#include "x86emu/x86emui.h"
-
-/*----------------------------- Implementation ----------------------------*/
-
-/****************************************************************************
-REMARKS:
-Handles any pending asychronous interrupts.
-****************************************************************************/
-static void x86emu_intr_handle(void)
-{
-       u8      intno;
-
-       if (M.x86.intr & INTR_SYNCH) {
-               intno = M.x86.intno;
-               if (_X86EMU_intrTab[intno]) {
-                       (*_X86EMU_intrTab[intno])(intno);
-               } else {
-                       push_word((u16)M.x86.R_FLG);
-                       CLEAR_FLAG(F_IF);
-                       CLEAR_FLAG(F_TF);
-                       push_word(M.x86.R_CS);
-                       M.x86.R_CS = mem_access_word(intno * 4 + 2);
-                       push_word(M.x86.R_IP);
-                       M.x86.R_IP = mem_access_word(intno * 4);
-                       M.x86.intr = 0;
-               }
-       }
-}
-
-/****************************************************************************
-PARAMETERS:
-intrnum - Interrupt number to raise
-
-REMARKS:
-Raise the specified interrupt to be handled before the execution of the
-next instruction.
-****************************************************************************/
-void x86emu_intr_raise(
-       u8 intrnum)
-{
-       M.x86.intno = intrnum;
-       M.x86.intr |= INTR_SYNCH;
-}
-
-/****************************************************************************
-REMARKS:
-Main execution loop for the emulator. We return from here when the system
-halts, which is normally caused by a stack fault when we return from the
-original real mode call.
-****************************************************************************/
-void X86EMU_exec(void)
-{
-    u8 op1;
-
-    M.x86.intr = 0;
-    DB(x86emu_end_instr();)
-
-    for (;;) {
-       DB(if (CHECK_IP_FETCH()) x86emu_check_ip_access();)
-       /* If debugging, save the IP and CS values. */
-       SAVE_IP_CS(M.x86.R_CS, M.x86.R_IP);
-       INC_DECODED_INST_LEN(1);
-       if (M.x86.intr) {
-           if (M.x86.intr & INTR_HALTED) {
-               DB(     printk("halted\n"); X86EMU_trace_regs();)
-                   return;
-           }
-           if (((M.x86.intr & INTR_SYNCH) && (M.x86.intno == 0 || M.x86.intno == 2)) ||
-               !ACCESS_FLAG(F_IF)) {
-               x86emu_intr_handle();
-           }
-       }
-       op1 = (*sys_rdb)(((u32)M.x86.R_CS << 4) + (M.x86.R_IP++));
-       (*x86emu_optab[op1])(op1);
-       if (M.x86.debug & DEBUG_EXIT) {
-           M.x86.debug &= ~DEBUG_EXIT;
-           return;
-       }
-    }
-}
-
-/****************************************************************************
-REMARKS:
-Halts the system by setting the halted system flag.
-****************************************************************************/
-void X86EMU_halt_sys(void)
-{
-       M.x86.intr |= INTR_HALTED;
-}
-
-/****************************************************************************
-PARAMETERS:
-mod            - Mod value from decoded byte
-regh   - Reg h value from decoded byte
-regl   - Reg l value from decoded byte
-
-REMARKS:
-Raise the specified interrupt to be handled before the execution of the
-next instruction.
-
-NOTE: Do not inline this function, as (*sys_rdb) is already inline!
-****************************************************************************/
-void fetch_decode_modrm(
-       int *mod,
-       int *regh,
-       int *regl)
-{
-       int fetched;
-
-DB(    if (CHECK_IP_FETCH())
-         x86emu_check_ip_access();)
-       fetched = (*sys_rdb)(((u32)M.x86.R_CS << 4) + (M.x86.R_IP++));
-       INC_DECODED_INST_LEN(1);
-       *mod  = (fetched >> 6) & 0x03;
-       *regh = (fetched >> 3) & 0x07;
-    *regl = (fetched >> 0) & 0x07;
-}
-
-/****************************************************************************
-RETURNS:
-Immediate byte value read from instruction queue
-
-REMARKS:
-This function returns the immediate byte from the instruction queue, and
-moves the instruction pointer to the next value.
-
-NOTE: Do not inline this function, as (*sys_rdb) is already inline!
-****************************************************************************/
-u8 fetch_byte_imm(void)
-{
-       u8 fetched;
-
-DB(    if (CHECK_IP_FETCH())
-               x86emu_check_ip_access();)
-       fetched = (*sys_rdb)(((u32)M.x86.R_CS << 4) + (M.x86.R_IP++));
-       INC_DECODED_INST_LEN(1);
-       return fetched;
-}
-
-/****************************************************************************
-RETURNS:
-Immediate word value read from instruction queue
-
-REMARKS:
-This function returns the immediate byte from the instruction queue, and
-moves the instruction pointer to the next value.
-
-NOTE: Do not inline this function, as (*sys_rdw) is already inline!
-****************************************************************************/
-u16 fetch_word_imm(void)
-{
-       u16     fetched;
-
-DB(    if (CHECK_IP_FETCH())
-               x86emu_check_ip_access();)
-       fetched = (*sys_rdw)(((u32)M.x86.R_CS << 4) + (M.x86.R_IP));
-       M.x86.R_IP += 2;
-       INC_DECODED_INST_LEN(2);
-       return fetched;
-}
-
-/****************************************************************************
-RETURNS:
-Immediate lone value read from instruction queue
-
-REMARKS:
-This function returns the immediate byte from the instruction queue, and
-moves the instruction pointer to the next value.
-
-NOTE: Do not inline this function, as (*sys_rdw) is already inline!
-****************************************************************************/
-u32 fetch_long_imm(void)
-{
-       u32 fetched;
-
-DB(    if (CHECK_IP_FETCH())
-         x86emu_check_ip_access();)
-       fetched = (*sys_rdl)(((u32)M.x86.R_CS << 4) + (M.x86.R_IP));
-       M.x86.R_IP += 4;
-       INC_DECODED_INST_LEN(4);
-       return fetched;
-}
-
-/****************************************************************************
-RETURNS:
-Value of the default data segment
-
-REMARKS:
-Inline function that returns the default data segment for the current
-instruction.
-
-On the x86 processor, the default segment is not always DS if there is
-no segment override. Address modes such as -3[BP] or 10[BP+SI] all refer to
-addresses relative to SS (ie: on the stack). So, at the minimum, all
-decodings of addressing modes would have to set/clear a bit describing
-whether the access is relative to DS or SS.  That is the function of the
-cpu-state-varible M.x86.mode. There are several potential states:
-
-       repe prefix seen  (handled elsewhere)
-       repne prefix seen  (ditto)
-
-       cs segment override
-       ds segment override
-       es segment override
-       fs segment override
-       gs segment override
-       ss segment override
-
-       ds/ss select (in absense of override)
-
-Each of the above 7 items are handled with a bit in the mode field.
-****************************************************************************/
-_INLINE u32 get_data_segment(void)
-{
-#define        GET_SEGMENT(segment)
-       switch (M.x86.mode & SYSMODE_SEGMASK) {
-         case 0:                                       /* default case: use ds register */
-         case SYSMODE_SEGOVR_DS:
-         case SYSMODE_SEGOVR_DS | SYSMODE_SEG_DS_SS:
-               return  M.x86.R_DS;
-         case SYSMODE_SEG_DS_SS:       /* non-overridden, use ss register */
-               return  M.x86.R_SS;
-         case SYSMODE_SEGOVR_CS:
-         case SYSMODE_SEGOVR_CS | SYSMODE_SEG_DS_SS:
-               return  M.x86.R_CS;
-         case SYSMODE_SEGOVR_ES:
-         case SYSMODE_SEGOVR_ES | SYSMODE_SEG_DS_SS:
-               return  M.x86.R_ES;
-         case SYSMODE_SEGOVR_FS:
-         case SYSMODE_SEGOVR_FS | SYSMODE_SEG_DS_SS:
-               return  M.x86.R_FS;
-         case SYSMODE_SEGOVR_GS:
-         case SYSMODE_SEGOVR_GS | SYSMODE_SEG_DS_SS:
-               return  M.x86.R_GS;
-         case SYSMODE_SEGOVR_SS:
-         case SYSMODE_SEGOVR_SS | SYSMODE_SEG_DS_SS:
-               return  M.x86.R_SS;
-         default:
-#ifdef DEBUG
-               printk("error: should not happen:  multiple overrides.\n");
-#endif
-               HALT_SYS();
-               return 0;
-       }
-}
-
-/****************************************************************************
-PARAMETERS:
-offset - Offset to load data from
-
-RETURNS:
-Byte value read from the absolute memory location.
-
-NOTE: Do not inline this function as (*sys_rdX) is already inline!
-****************************************************************************/
-u8 fetch_data_byte(
-       uint offset)
-{
-#ifdef DEBUG
-       if (CHECK_DATA_ACCESS())
-               x86emu_check_data_access((u16)get_data_segment(), offset);
-#endif
-       return (*sys_rdb)((get_data_segment() << 4) + offset);
-}
-
-/****************************************************************************
-PARAMETERS:
-offset - Offset to load data from
-
-RETURNS:
-Word value read from the absolute memory location.
-
-NOTE: Do not inline this function as (*sys_rdX) is already inline!
-****************************************************************************/
-u16 fetch_data_word(
-       uint offset)
-{
-#ifdef DEBUG
-       if (CHECK_DATA_ACCESS())
-               x86emu_check_data_access((u16)get_data_segment(), offset);
-#endif
-       return (*sys_rdw)((get_data_segment() << 4) + offset);
-}
-
-/****************************************************************************
-PARAMETERS:
-offset - Offset to load data from
-
-RETURNS:
-Long value read from the absolute memory location.
-
-NOTE: Do not inline this function as (*sys_rdX) is already inline!
-****************************************************************************/
-u32 fetch_data_long(
-       uint offset)
-{
-#ifdef DEBUG
-       if (CHECK_DATA_ACCESS())
-               x86emu_check_data_access((u16)get_data_segment(), offset);
-#endif
-       return (*sys_rdl)((get_data_segment() << 4) + offset);
-}
-
-/****************************************************************************
-PARAMETERS:
-segment        - Segment to load data from
-offset - Offset to load data from
-
-RETURNS:
-Byte value read from the absolute memory location.
-
-NOTE: Do not inline this function as (*sys_rdX) is already inline!
-****************************************************************************/
-u8 fetch_data_byte_abs(
-       uint segment,
-       uint offset)
-{
-#ifdef DEBUG
-       if (CHECK_DATA_ACCESS())
-               x86emu_check_data_access(segment, offset);
-#endif
-       return (*sys_rdb)(((u32)segment << 4) + offset);
-}
-
-/****************************************************************************
-PARAMETERS:
-segment        - Segment to load data from
-offset - Offset to load data from
-
-RETURNS:
-Word value read from the absolute memory location.
-
-NOTE: Do not inline this function as (*sys_rdX) is already inline!
-****************************************************************************/
-u16 fetch_data_word_abs(
-       uint segment,
-       uint offset)
-{
-#ifdef DEBUG
-       if (CHECK_DATA_ACCESS())
-               x86emu_check_data_access(segment, offset);
-#endif
-       return (*sys_rdw)(((u32)segment << 4) + offset);
-}
-
-/****************************************************************************
-PARAMETERS:
-segment        - Segment to load data from
-offset - Offset to load data from
-
-RETURNS:
-Long value read from the absolute memory location.
-
-NOTE: Do not inline this function as (*sys_rdX) is already inline!
-****************************************************************************/
-u32 fetch_data_long_abs(
-       uint segment,
-       uint offset)
-{
-#ifdef DEBUG
-       if (CHECK_DATA_ACCESS())
-               x86emu_check_data_access(segment, offset);
-#endif
-       return (*sys_rdl)(((u32)segment << 4) + offset);
-}
-
-/****************************************************************************
-PARAMETERS:
-offset - Offset to store data at
-val            - Value to store
-
-REMARKS:
-Writes a word value to an segmented memory location. The segment used is
-the current 'default' segment, which may have been overridden.
-
-NOTE: Do not inline this function as (*sys_wrX) is already inline!
-****************************************************************************/
-void store_data_byte(
-       uint offset,
-       u8 val)
-{
-#ifdef DEBUG
-       if (CHECK_DATA_ACCESS())
-               x86emu_check_data_access((u16)get_data_segment(), offset);
-#endif
-       (*sys_wrb)((get_data_segment() << 4) + offset, val);
-}
-
-/****************************************************************************
-PARAMETERS:
-offset - Offset to store data at
-val            - Value to store
-
-REMARKS:
-Writes a word value to an segmented memory location. The segment used is
-the current 'default' segment, which may have been overridden.
-
-NOTE: Do not inline this function as (*sys_wrX) is already inline!
-****************************************************************************/
-void store_data_word(
-       uint offset,
-       u16 val)
-{
-#ifdef DEBUG
-       if (CHECK_DATA_ACCESS())
-               x86emu_check_data_access((u16)get_data_segment(), offset);
-#endif
-       (*sys_wrw)((get_data_segment() << 4) + offset, val);
-}
-
-/****************************************************************************
-PARAMETERS:
-offset - Offset to store data at
-val            - Value to store
-
-REMARKS:
-Writes a long value to an segmented memory location. The segment used is
-the current 'default' segment, which may have been overridden.
-
-NOTE: Do not inline this function as (*sys_wrX) is already inline!
-****************************************************************************/
-void store_data_long(
-       uint offset,
-       u32 val)
-{
-#ifdef DEBUG
-       if (CHECK_DATA_ACCESS())
-               x86emu_check_data_access((u16)get_data_segment(), offset);
-#endif
-       (*sys_wrl)((get_data_segment() << 4) + offset, val);
-}
-
-/****************************************************************************
-PARAMETERS:
-segment        - Segment to store data at
-offset - Offset to store data at
-val            - Value to store
-
-REMARKS:
-Writes a byte value to an absolute memory location.
-
-NOTE: Do not inline this function as (*sys_wrX) is already inline!
-****************************************************************************/
-void store_data_byte_abs(
-       uint segment,
-       uint offset,
-       u8 val)
-{
-#ifdef DEBUG
-       if (CHECK_DATA_ACCESS())
-               x86emu_check_data_access(segment, offset);
-#endif
-       (*sys_wrb)(((u32)segment << 4) + offset, val);
-}
-
-/****************************************************************************
-PARAMETERS:
-segment        - Segment to store data at
-offset - Offset to store data at
-val            - Value to store
-
-REMARKS:
-Writes a word value to an absolute memory location.
-
-NOTE: Do not inline this function as (*sys_wrX) is already inline!
-****************************************************************************/
-void store_data_word_abs(
-       uint segment,
-       uint offset,
-       u16 val)
-{
-#ifdef DEBUG
-       if (CHECK_DATA_ACCESS())
-               x86emu_check_data_access(segment, offset);
-#endif
-       (*sys_wrw)(((u32)segment << 4) + offset, val);
-}
-
-/****************************************************************************
-PARAMETERS:
-segment        - Segment to store data at
-offset - Offset to store data at
-val            - Value to store
-
-REMARKS:
-Writes a long value to an absolute memory location.
-
-NOTE: Do not inline this function as (*sys_wrX) is already inline!
-****************************************************************************/
-void store_data_long_abs(
-       uint segment,
-       uint offset,
-       u32 val)
-{
-#ifdef DEBUG
-       if (CHECK_DATA_ACCESS())
-               x86emu_check_data_access(segment, offset);
-#endif
-       (*sys_wrl)(((u32)segment << 4) + offset, val);
-}
-
-/****************************************************************************
-PARAMETERS:
-reg    - Register to decode
-
-RETURNS:
-Pointer to the appropriate register
-
-REMARKS:
-Return a pointer to the register given by the R/RM field of the
-modrm byte, for byte operands. Also enables the decoding of instructions.
-****************************************************************************/
-u8* decode_rm_byte_register(
-       int reg)
-{
-       switch (reg) {
-      case 0:
-               DECODE_PRINTF("AL");
-               return &M.x86.R_AL;
-         case 1:
-               DECODE_PRINTF("CL");
-               return &M.x86.R_CL;
-         case 2:
-               DECODE_PRINTF("DL");
-               return &M.x86.R_DL;
-         case 3:
-               DECODE_PRINTF("BL");
-               return &M.x86.R_BL;
-         case 4:
-               DECODE_PRINTF("AH");
-               return &M.x86.R_AH;
-         case 5:
-               DECODE_PRINTF("CH");
-               return &M.x86.R_CH;
-         case 6:
-               DECODE_PRINTF("DH");
-               return &M.x86.R_DH;
-         case 7:
-               DECODE_PRINTF("BH");
-               return &M.x86.R_BH;
-       }
-       HALT_SYS();
-       return NULL;                /* NOT REACHED OR REACHED ON ERROR */
-}
-
-/****************************************************************************
-PARAMETERS:
-reg    - Register to decode
-
-RETURNS:
-Pointer to the appropriate register
-
-REMARKS:
-Return a pointer to the register given by the R/RM field of the
-modrm byte, for word operands.  Also enables the decoding of instructions.
-****************************************************************************/
-u16* decode_rm_word_register(
-       int reg)
-{
-       switch (reg) {
-         case 0:
-               DECODE_PRINTF("AX");
-               return &M.x86.R_AX;
-         case 1:
-               DECODE_PRINTF("CX");
-               return &M.x86.R_CX;
-         case 2:
-               DECODE_PRINTF("DX");
-               return &M.x86.R_DX;
-         case 3:
-               DECODE_PRINTF("BX");
-               return &M.x86.R_BX;
-         case 4:
-               DECODE_PRINTF("SP");
-               return &M.x86.R_SP;
-         case 5:
-               DECODE_PRINTF("BP");
-               return &M.x86.R_BP;
-         case 6:
-               DECODE_PRINTF("SI");
-               return &M.x86.R_SI;
-         case 7:
-               DECODE_PRINTF("DI");
-               return &M.x86.R_DI;
-       }
-       HALT_SYS();
-    return NULL;                /* NOTREACHED OR REACHED ON ERROR */
-}
-
-/****************************************************************************
-PARAMETERS:
-reg    - Register to decode
-
-RETURNS:
-Pointer to the appropriate register
-
-REMARKS:
-Return a pointer to the register given by the R/RM field of the
-modrm byte, for dword operands.  Also enables the decoding of instructions.
-****************************************************************************/
-u32* decode_rm_long_register(
-       int reg)
-{
-    switch (reg) {
-      case 0:
-               DECODE_PRINTF("EAX");
-               return &M.x86.R_EAX;
-         case 1:
-               DECODE_PRINTF("ECX");
-               return &M.x86.R_ECX;
-         case 2:
-               DECODE_PRINTF("EDX");
-               return &M.x86.R_EDX;
-         case 3:
-               DECODE_PRINTF("EBX");
-               return &M.x86.R_EBX;
-         case 4:
-               DECODE_PRINTF("ESP");
-               return &M.x86.R_ESP;
-         case 5:
-               DECODE_PRINTF("EBP");
-               return &M.x86.R_EBP;
-         case 6:
-               DECODE_PRINTF("ESI");
-               return &M.x86.R_ESI;
-         case 7:
-               DECODE_PRINTF("EDI");
-               return &M.x86.R_EDI;
-       }
-       HALT_SYS();
-    return NULL;                /* NOTREACHED OR REACHED ON ERROR */
-}
-
-/****************************************************************************
-PARAMETERS:
-reg    - Register to decode
-
-RETURNS:
-Pointer to the appropriate register
-
-REMARKS:
-Return a pointer to the register given by the R/RM field of the
-modrm byte, for word operands, modified from above for the weirdo
-special case of segreg operands.  Also enables the decoding of instructions.
-****************************************************************************/
-u16* decode_rm_seg_register(
-       int reg)
-{
-       switch (reg) {
-         case 0:
-               DECODE_PRINTF("ES");
-               return &M.x86.R_ES;
-         case 1:
-               DECODE_PRINTF("CS");
-               return &M.x86.R_CS;
-         case 2:
-               DECODE_PRINTF("SS");
-               return &M.x86.R_SS;
-         case 3:
-               DECODE_PRINTF("DS");
-               return &M.x86.R_DS;
-         case 4:
-         case 5:
-         case 6:
-         case 7:
-               DECODE_PRINTF("ILLEGAL SEGREG");
-               break;
-       }
-       HALT_SYS();
-       return NULL;                /* NOT REACHED OR REACHED ON ERROR */
-}
-
-/****************************************************************************
-PARAMETERS:
-rm     - RM value to decode
-
-RETURNS:
-Offset in memory for the address decoding
-
-REMARKS:
-Return the offset given by mod=00 addressing.  Also enables the
-decoding of instructions.
-
-NOTE:  The code which specifies the corresponding segment (ds vs ss)
-               below in the case of [BP+..].  The assumption here is that at the
-               point that this subroutine is called, the bit corresponding to
-               SYSMODE_SEG_DS_SS will be zero.  After every instruction
-               except the segment override instructions, this bit (as well
-               as any bits indicating segment overrides) will be clear.  So
-               if a SS access is needed, set this bit.  Otherwise, DS access
-               occurs (unless any of the segment override bits are set).
-****************************************************************************/
-unsigned decode_rm00_address(
-       int rm)
-{
-       unsigned offset;
-
-       if (M.x86.mode & SYSMODE_PREFIX_ADDR)
-       {
-           switch (rm) {
-           case 0:
-               DECODE_PRINTF("[EAX]");
-               return M.x86.R_EAX;
-           case 1:
-               DECODE_PRINTF("[ECX]");
-               return M.x86.R_ECX;
-           case 2:
-               DECODE_PRINTF("[EDX]");
-/*             M.x86.mode |= SYSMODE_SEG_DS_SS; */
-               return M.x86.R_EDX;
-           case 3:
-               DECODE_PRINTF("[EBX]");
-/*             M.x86.mode |= SYSMODE_SEG_DS_SS; */
-               return M.x86.R_EBX;
-           case 4:
-               printk("Unsupported SIB encoding\n");
-               HALT_SYS();
-               return 0;
-           case 5:
-               offset = fetch_long_imm();
-               DECODE_PRINTF2("[%08x]", offset);
-               return offset;
-           case 6:
-               DECODE_PRINTF("[ESI]");
-               return M.x86.R_ESI;
-           case 7:
-               DECODE_PRINTF("[EDI]");
-               return M.x86.R_EDI;
-           }
-       }
-       else
-       {
-           switch (rm) {
-           case 0:
-               DECODE_PRINTF("[BX+SI]");
-               return M.x86.R_BX + M.x86.R_SI;
-           case 1:
-               DECODE_PRINTF("[BX+DI]");
-               return M.x86.R_BX + M.x86.R_DI;
-           case 2:
-               DECODE_PRINTF("[BP+SI]");
-               M.x86.mode |= SYSMODE_SEG_DS_SS;
-               return M.x86.R_BP + M.x86.R_SI;
-           case 3:
-               DECODE_PRINTF("[BP+DI]");
-               M.x86.mode |= SYSMODE_SEG_DS_SS;
-               return M.x86.R_BP + M.x86.R_DI;
-           case 4:
-               DECODE_PRINTF("[SI]");
-               return M.x86.R_SI;
-           case 5:
-               DECODE_PRINTF("[DI]");
-               return M.x86.R_DI;
-           case 6:
-               offset = fetch_word_imm();
-               DECODE_PRINTF2("[%04x]", offset);
-               return offset;
-           case 7:
-               DECODE_PRINTF("[BX]");
-               return M.x86.R_BX;
-           }
-       }
-       HALT_SYS();
-    return 0;
-}
-
-/****************************************************************************
-PARAMETERS:
-rm     - RM value to decode
-
-RETURNS:
-Offset in memory for the address decoding
-
-REMARKS:
-Return the offset given by mod=01 addressing.  Also enables the
-decoding of instructions.
-****************************************************************************/
-unsigned decode_rm01_address(
-       int rm)
-{
-    int displacement = (s8)fetch_byte_imm();
-    if (M.x86.mode & SYSMODE_PREFIX_ADDR)
-    {
-       switch (rm)
-       {
-       case 0:
-           DECODE_PRINTF2("%d[EAX}", displacement);
-           return M.x86.R_EAX + displacement;
-       case 1:
-           DECODE_PRINTF2("%d[ECX]", displacement);
-           return M.x86.R_ECX + displacement;
-       case 2:
-           DECODE_PRINTF2("%d[EDX]", displacement);
-           return M.x86.R_EDX + displacement;
-       case 3:
-           DECODE_PRINTF2("%d[EBX]", displacement);
-           return M.x86.R_EBX + displacement;
-       case 4:
-           printk("Unsupported SIB addressing mode\n");
-           HALT_SYS();
-           return 0;
-       case 5:
-           DECODE_PRINTF2("%d[EBP]", displacement);
-           return M.x86.R_EBP + displacement;
-       case 6:
-           DECODE_PRINTF2("%d[ESI]", displacement);
-           return M.x86.R_ESI + displacement;
-       case 7:
-           DECODE_PRINTF2("%d[EDI]", displacement);
-           return M.x86.R_EDI + displacement;
-       }
-    }
-    else
-    {
-       switch (rm) {
-       case 0:
-           DECODE_PRINTF2("%d[BX+SI]", displacement);
-           return M.x86.R_BX + M.x86.R_SI + displacement;
-       case 1:
-           DECODE_PRINTF2("%d[BX+DI]", displacement);
-           return M.x86.R_BX + M.x86.R_DI + displacement;
-       case 2:
-           DECODE_PRINTF2("%d[BP+SI]", displacement);
-           M.x86.mode |= SYSMODE_SEG_DS_SS;
-           return M.x86.R_BP + M.x86.R_SI + displacement;
-       case 3:
-           DECODE_PRINTF2("%d[BP+DI]", displacement);
-           M.x86.mode |= SYSMODE_SEG_DS_SS;
-           return M.x86.R_BP + M.x86.R_DI + displacement;
-       case 4:
-           DECODE_PRINTF2("%d[SI]", displacement);
-           return M.x86.R_SI + displacement;
-       case 5:
-           DECODE_PRINTF2("%d[DI]", displacement);
-           return M.x86.R_DI + displacement;
-       case 6:
-           DECODE_PRINTF2("%d[BP]", displacement);
-           M.x86.mode |= SYSMODE_SEG_DS_SS;
-           return M.x86.R_BP + displacement;
-       case 7:
-           DECODE_PRINTF2("%d[BX]", displacement);
-           return M.x86.R_BX + displacement;
-       }
-       HALT_SYS();
-    }
-    return 0;                   /* SHOULD NOT HAPPEN */
-}
-
-/****************************************************************************
-PARAMETERS:
-rm     - RM value to decode
-
-RETURNS:
-Offset in memory for the address decoding
-
-REMARKS:
-Return the offset given by mod=10 addressing.  Also enables the
-decoding of instructions.
-****************************************************************************/
-unsigned decode_rm10_address(
-       int rm)
-{
-    if (M.x86.mode & SYSMODE_PREFIX_ADDR)
-    {
-       int displacement = (s32)fetch_long_imm();
-       switch (rm)
-       {
-       case 0:
-           DECODE_PRINTF2("%d[EAX}", displacement);
-           return M.x86.R_EAX + displacement;
-       case 1:
-           DECODE_PRINTF2("%d[ECX]", displacement);
-           return M.x86.R_ECX + displacement;
-       case 2:
-           DECODE_PRINTF2("%d[EDX]", displacement);
-           return M.x86.R_EDX + displacement;
-       case 3:
-           DECODE_PRINTF2("%d[EBX]", displacement);
-           return M.x86.R_EBX + displacement;
-       case 4:
-           printk("Unsupported SIB addressing mode\n");
-           HALT_SYS();
-           return 0;
-       case 5:
-           DECODE_PRINTF2("%d[EBP]", displacement);
-           return M.x86.R_EBP + displacement;
-       case 6:
-           DECODE_PRINTF2("%d[ESI]", displacement);
-           return M.x86.R_ESI + displacement;
-       case 7:
-           DECODE_PRINTF2("%d[EDI]", displacement);
-           return M.x86.R_EDI + displacement;
-       }
-    }
-    else
-    {
-       int displacement = (s16)fetch_word_imm();
-       switch (rm) {
-       case 0:
-           DECODE_PRINTF2("%d[BX+SI]", displacement);
-           return (M.x86.R_BX + M.x86.R_SI + displacement) & 0xffff;
-       case 1:
-           DECODE_PRINTF2("%d[BX+DI]", displacement);
-           return (M.x86.R_BX + M.x86.R_DI + displacement) & 0xffff;
-       case 2:
-           DECODE_PRINTF2("%d[BP+SI]", displacement);
-           M.x86.mode |= SYSMODE_SEG_DS_SS;
-           return (M.x86.R_BP + M.x86.R_SI + displacement) & 0xffff;
-       case 3:
-           DECODE_PRINTF2("%d[BP+DI]", displacement);
-           M.x86.mode |= SYSMODE_SEG_DS_SS;
-           return (M.x86.R_BP + M.x86.R_DI + displacement) & 0xffff;
-       case 4:
-           DECODE_PRINTF2("%d[SI]", displacement);
-           return (M.x86.R_SI + displacement) & 0xffff;
-       case 5:
-           DECODE_PRINTF2("%d[DI]", displacement);
-           return (M.x86.R_DI + displacement) & 0xffff;
-       case 6:
-           DECODE_PRINTF2("%d[BP]", displacement);
-           M.x86.mode |= SYSMODE_SEG_DS_SS;
-           return (M.x86.R_BP + displacement) & 0xffff;
-       case 7:
-           DECODE_PRINTF2("%d[BX]", displacement);
-           return (M.x86.R_BX + displacement) & 0xffff;
-       }
-    }
-    HALT_SYS();
-    return 0;
-    /*NOTREACHED */
-}
diff --git a/board/MAI/bios_emulator/scitech/src/x86emu/fpu.c b/board/MAI/bios_emulator/scitech/src/x86emu/fpu.c
deleted file mode 100644 (file)
index 7f7c345..0000000
+++ /dev/null
@@ -1,945 +0,0 @@
-/****************************************************************************
-*
-*                                              Realmode X86 Emulator Library
-*
-*              Copyright (C) 1996-1999 SciTech Software, Inc.
-*                                   Copyright (C) David Mosberger-Tang
-*                                         Copyright (C) 1999 Egbert Eich
-*
-*  ========================================================================
-*
-*  Permission to use, copy, modify, distribute, and sell this software and
-*  its documentation for any purpose is hereby granted without fee,
-*  provided that the above copyright notice appear in all copies and that
-*  both that copyright notice and this permission notice appear in
-*  supporting documentation, and that the name of the authors not be used
-*  in advertising or publicity pertaining to distribution of the software
-*  without specific, written prior permission.  The authors makes no
-*  representations about the suitability of this software for any purpose.
-*  It is provided "as is" without express or implied warranty.
-*
-*  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-*  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-*  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-*  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-*  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-*  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-*  PERFORMANCE OF THIS SOFTWARE.
-*
-*  ========================================================================
-*
-* Language:            ANSI C
-* Environment: Any
-* Developer:    Kendall Bennett
-*
-* Description:  This file contains the code to implement the decoding and
-*               emulation of the FPU instructions.
-*
-****************************************************************************/
-
-#include "x86emu/x86emui.h"
-
-/*----------------------------- Implementation ----------------------------*/
-
-/* opcode=0xd8 */
-void x86emuOp_esc_coprocess_d8(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    DECODE_PRINTF("ESC D8\n");
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR_NO_TRACE();
-}
-
-#ifdef DEBUG
-
-static char *x86emu_fpu_op_d9_tab[] = {
-    "FLD\tDWORD PTR ", "ESC_D9\t", "FST\tDWORD PTR ", "FSTP\tDWORD PTR ",
-    "FLDENV\t", "FLDCW\t", "FSTENV\t", "FSTCW\t",
-
-    "FLD\tDWORD PTR ", "ESC_D9\t", "FST\tDWORD PTR ", "FSTP\tDWORD PTR ",
-    "FLDENV\t", "FLDCW\t", "FSTENV\t", "FSTCW\t",
-
-    "FLD\tDWORD PTR ", "ESC_D9\t", "FST\tDWORD PTR ", "FSTP\tDWORD PTR ",
-    "FLDENV\t", "FLDCW\t", "FSTENV\t", "FSTCW\t",
-};
-
-static char *x86emu_fpu_op_d9_tab1[] = {
-    "FLD\t", "FLD\t", "FLD\t", "FLD\t",
-    "FLD\t", "FLD\t", "FLD\t", "FLD\t",
-
-    "FXCH\t", "FXCH\t", "FXCH\t", "FXCH\t",
-    "FXCH\t", "FXCH\t", "FXCH\t", "FXCH\t",
-
-    "FNOP", "ESC_D9", "ESC_D9", "ESC_D9",
-    "ESC_D9", "ESC_D9", "ESC_D9", "ESC_D9",
-
-    "FSTP\t", "FSTP\t", "FSTP\t", "FSTP\t",
-    "FSTP\t", "FSTP\t", "FSTP\t", "FSTP\t",
-
-    "FCHS", "FABS", "ESC_D9", "ESC_D9",
-    "FTST", "FXAM", "ESC_D9", "ESC_D9",
-
-    "FLD1", "FLDL2T", "FLDL2E", "FLDPI",
-    "FLDLG2", "FLDLN2", "FLDZ", "ESC_D9",
-
-    "F2XM1", "FYL2X", "FPTAN", "FPATAN",
-    "FXTRACT", "ESC_D9", "FDECSTP", "FINCSTP",
-
-    "FPREM", "FYL2XP1", "FSQRT", "ESC_D9",
-    "FRNDINT", "FSCALE", "ESC_D9", "ESC_D9",
-};
-
-#endif /* DEBUG */
-
-/* opcode=0xd9 */
-void x86emuOp_esc_coprocess_d9(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-       uint destoffset;
-    u8 stkelem;
-
-    START_OF_INSTR();
-    FETCH_DECODE_MODRM(mod, rh, rl);
-#ifdef DEBUG
-    if (mod != 3) {
-       DECODE_PRINTINSTR32(x86emu_fpu_op_d9_tab, mod, rh, rl);
-    } else {
-       DECODE_PRINTF(x86emu_fpu_op_d9_tab1[(rh << 3) + rl]);
-    }
-#endif
-    switch (mod) {
-      case 0:
-       destoffset = decode_rm00_address(rl);
-       DECODE_PRINTF("\n");
-       break;
-      case 1:
-       destoffset = decode_rm01_address(rl);
-       DECODE_PRINTF("\n");
-       break;
-      case 2:
-       destoffset = decode_rm10_address(rl);
-       DECODE_PRINTF("\n");
-       break;
-      case 3:                   /* register to register */
-               stkelem = (u8)rl;
-               if (rh < 4) {
-                               DECODE_PRINTF2("ST(%d)\n", stkelem);
-               } else {
-                               DECODE_PRINTF("\n");
-               }
-       break;
-    }
-#ifdef X86EMU_FPU_PRESENT
-    /* execute */
-    switch (mod) {
-      case 3:
-       switch (rh) {
-         case 0:
-           x86emu_fpu_R_fld(X86EMU_FPU_STKTOP, stkelem);
-           break;
-         case 1:
-           x86emu_fpu_R_fxch(X86EMU_FPU_STKTOP, stkelem);
-           break;
-         case 2:
-           switch (rl) {
-             case 0:
-               x86emu_fpu_R_nop();
-               break;
-             default:
-               x86emu_fpu_illegal();
-               break;
-           }
-         case 3:
-           x86emu_fpu_R_fstp(X86EMU_FPU_STKTOP, stkelem);
-           break;
-         case 4:
-           switch (rl) {
-           case 0:
-               x86emu_fpu_R_fchs(X86EMU_FPU_STKTOP);
-               break;
-           case 1:
-               x86emu_fpu_R_fabs(X86EMU_FPU_STKTOP);
-               break;
-           case 4:
-               x86emu_fpu_R_ftst(X86EMU_FPU_STKTOP);
-               break;
-           case 5:
-               x86emu_fpu_R_fxam(X86EMU_FPU_STKTOP);
-               break;
-           default:
-               /* 2,3,6,7 */
-               x86emu_fpu_illegal();
-               break;
-           }
-           break;
-
-         case 5:
-           switch (rl) {
-             case 0:
-               x86emu_fpu_R_fld1(X86EMU_FPU_STKTOP);
-               break;
-             case 1:
-               x86emu_fpu_R_fldl2t(X86EMU_FPU_STKTOP);
-               break;
-             case 2:
-               x86emu_fpu_R_fldl2e(X86EMU_FPU_STKTOP);
-               break;
-             case 3:
-               x86emu_fpu_R_fldpi(X86EMU_FPU_STKTOP);
-               break;
-             case 4:
-               x86emu_fpu_R_fldlg2(X86EMU_FPU_STKTOP);
-               break;
-             case 5:
-               x86emu_fpu_R_fldln2(X86EMU_FPU_STKTOP);
-               break;
-             case 6:
-               x86emu_fpu_R_fldz(X86EMU_FPU_STKTOP);
-               break;
-             default:
-               /* 7 */
-               x86emu_fpu_illegal();
-               break;
-           }
-           break;
-
-         case 6:
-           switch (rl) {
-             case 0:
-               x86emu_fpu_R_f2xm1(X86EMU_FPU_STKTOP);
-               break;
-             case 1:
-               x86emu_fpu_R_fyl2x(X86EMU_FPU_STKTOP);
-               break;
-             case 2:
-               x86emu_fpu_R_fptan(X86EMU_FPU_STKTOP);
-               break;
-             case 3:
-               x86emu_fpu_R_fpatan(X86EMU_FPU_STKTOP);
-               break;
-             case 4:
-               x86emu_fpu_R_fxtract(X86EMU_FPU_STKTOP);
-               break;
-             case 5:
-               x86emu_fpu_illegal();
-               break;
-             case 6:
-               x86emu_fpu_R_decstp();
-               break;
-             case 7:
-               x86emu_fpu_R_incstp();
-               break;
-           }
-           break;
-
-         case 7:
-           switch (rl) {
-             case 0:
-               x86emu_fpu_R_fprem(X86EMU_FPU_STKTOP);
-               break;
-             case 1:
-               x86emu_fpu_R_fyl2xp1(X86EMU_FPU_STKTOP);
-               break;
-             case 2:
-               x86emu_fpu_R_fsqrt(X86EMU_FPU_STKTOP);
-               break;
-             case 3:
-               x86emu_fpu_illegal();
-               break;
-             case 4:
-               x86emu_fpu_R_frndint(X86EMU_FPU_STKTOP);
-               break;
-             case 5:
-               x86emu_fpu_R_fscale(X86EMU_FPU_STKTOP);
-               break;
-             case 6:
-             case 7:
-             default:
-               x86emu_fpu_illegal();
-               break;
-           }
-           break;
-
-         default:
-           switch (rh) {
-             case 0:
-               x86emu_fpu_M_fld(X86EMU_FPU_FLOAT, destoffset);
-               break;
-             case 1:
-               x86emu_fpu_illegal();
-               break;
-             case 2:
-               x86emu_fpu_M_fst(X86EMU_FPU_FLOAT, destoffset);
-               break;
-             case 3:
-               x86emu_fpu_M_fstp(X86EMU_FPU_FLOAT, destoffset);
-               break;
-             case 4:
-               x86emu_fpu_M_fldenv(X86EMU_FPU_WORD, destoffset);
-               break;
-             case 5:
-               x86emu_fpu_M_fldcw(X86EMU_FPU_WORD, destoffset);
-               break;
-             case 6:
-               x86emu_fpu_M_fstenv(X86EMU_FPU_WORD, destoffset);
-               break;
-             case 7:
-               x86emu_fpu_M_fstcw(X86EMU_FPU_WORD, destoffset);
-               break;
-           }
-       }
-    }
-#endif /* X86EMU_FPU_PRESENT */
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR_NO_TRACE();
-}
-
-#ifdef DEBUG
-
-char *x86emu_fpu_op_da_tab[] = {
-    "FIADD\tDWORD PTR ", "FIMUL\tDWORD PTR ", "FICOM\tDWORD PTR ",
-    "FICOMP\tDWORD PTR ",
-    "FISUB\tDWORD PTR ", "FISUBR\tDWORD PTR ", "FIDIV\tDWORD PTR ",
-    "FIDIVR\tDWORD PTR ",
-
-    "FIADD\tDWORD PTR ", "FIMUL\tDWORD PTR ", "FICOM\tDWORD PTR ",
-    "FICOMP\tDWORD PTR ",
-    "FISUB\tDWORD PTR ", "FISUBR\tDWORD PTR ", "FIDIV\tDWORD PTR ",
-    "FIDIVR\tDWORD PTR ",
-
-    "FIADD\tDWORD PTR ", "FIMUL\tDWORD PTR ", "FICOM\tDWORD PTR ",
-    "FICOMP\tDWORD PTR ",
-    "FISUB\tDWORD PTR ", "FISUBR\tDWORD PTR ", "FIDIV\tDWORD PTR ",
-    "FIDIVR\tDWORD PTR ",
-
-    "ESC_DA ", "ESC_DA ", "ESC_DA ", "ESC_DA ",
-    "ESC_DA     ", "ESC_DA ", "ESC_DA   ", "ESC_DA ",
-};
-
-#endif /* DEBUG */
-
-/* opcode=0xda */
-void x86emuOp_esc_coprocess_da(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-       uint destoffset;
-    u8 stkelem;
-
-    START_OF_INSTR();
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    DECODE_PRINTINSTR32(x86emu_fpu_op_da_tab, mod, rh, rl);
-    switch (mod) {
-      case 0:
-       destoffset = decode_rm00_address(rl);
-       DECODE_PRINTF("\n");
-       break;
-      case 1:
-       destoffset = decode_rm01_address(rl);
-       DECODE_PRINTF("\n");
-       break;
-      case 2:
-       destoffset = decode_rm10_address(rl);
-       DECODE_PRINTF("\n");
-       break;
-      case 3:           /* register to register */
-               stkelem = (u8)rl;
-       DECODE_PRINTF2("\tST(%d),ST\n", stkelem);
-       break;
-    }
-#ifdef X86EMU_FPU_PRESENT
-    switch (mod) {
-      case 3:
-       x86emu_fpu_illegal();
-       break;
-      default:
-       switch (rh) {
-         case 0:
-           x86emu_fpu_M_iadd(X86EMU_FPU_SHORT, destoffset);
-           break;
-         case 1:
-           x86emu_fpu_M_imul(X86EMU_FPU_SHORT, destoffset);
-           break;
-         case 2:
-           x86emu_fpu_M_icom(X86EMU_FPU_SHORT, destoffset);
-           break;
-         case 3:
-           x86emu_fpu_M_icomp(X86EMU_FPU_SHORT, destoffset);
-           break;
-         case 4:
-           x86emu_fpu_M_isub(X86EMU_FPU_SHORT, destoffset);
-           break;
-         case 5:
-           x86emu_fpu_M_isubr(X86EMU_FPU_SHORT, destoffset);
-           break;
-         case 6:
-           x86emu_fpu_M_idiv(X86EMU_FPU_SHORT, destoffset);
-           break;
-         case 7:
-           x86emu_fpu_M_idivr(X86EMU_FPU_SHORT, destoffset);
-           break;
-       }
-    }
-#endif
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR_NO_TRACE();
-}
-
-#ifdef DEBUG
-
-char *x86emu_fpu_op_db_tab[] = {
-    "FILD\tDWORD PTR ", "ESC_DB\t19", "FIST\tDWORD PTR ", "FISTP\tDWORD PTR ",
-    "ESC_DB\t1C", "FLD\tTBYTE PTR ", "ESC_DB\t1E", "FSTP\tTBYTE PTR ",
-
-    "FILD\tDWORD PTR ", "ESC_DB\t19", "FIST\tDWORD PTR ", "FISTP\tDWORD PTR ",
-    "ESC_DB\t1C", "FLD\tTBYTE PTR ", "ESC_DB\t1E", "FSTP\tTBYTE PTR ",
-
-    "FILD\tDWORD PTR ", "ESC_DB\t19", "FIST\tDWORD PTR ", "FISTP\tDWORD PTR ",
-    "ESC_DB\t1C", "FLD\tTBYTE PTR ", "ESC_DB\t1E", "FSTP\tTBYTE PTR ",
-};
-
-#endif /* DEBUG */
-
-/* opcode=0xdb */
-void x86emuOp_esc_coprocess_db(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-       uint destoffset;
-
-    START_OF_INSTR();
-    FETCH_DECODE_MODRM(mod, rh, rl);
-#ifdef DEBUG
-    if (mod != 3) {
-       DECODE_PRINTINSTR32(x86emu_fpu_op_db_tab, mod, rh, rl);
-    } else if (rh == 4) {       /* === 11 10 0 nnn */
-       switch (rl) {
-         case 0:
-           DECODE_PRINTF("FENI\n");
-           break;
-         case 1:
-           DECODE_PRINTF("FDISI\n");
-           break;
-         case 2:
-           DECODE_PRINTF("FCLEX\n");
-           break;
-         case 3:
-           DECODE_PRINTF("FINIT\n");
-           break;
-       }
-    } else {
-       DECODE_PRINTF2("ESC_DB %0x\n", (mod << 6) + (rh << 3) + (rl));
-    }
-#endif /* DEBUG */
-    switch (mod) {
-      case 0:
-       destoffset = decode_rm00_address(rl);
-       break;
-      case 1:
-       destoffset = decode_rm01_address(rl);
-       break;
-      case 2:
-       destoffset = decode_rm10_address(rl);
-       break;
-      case 3:                   /* register to register */
-       break;
-    }
-#ifdef X86EMU_FPU_PRESENT
-    /* execute */
-    switch (mod) {
-      case 3:
-       switch (rh) {
-         case 4:
-           switch (rl) {
-             case 0:
-               x86emu_fpu_R_feni();
-               break;
-             case 1:
-               x86emu_fpu_R_fdisi();
-               break;
-             case 2:
-               x86emu_fpu_R_fclex();
-               break;
-             case 3:
-               x86emu_fpu_R_finit();
-               break;
-             default:
-               x86emu_fpu_illegal();
-               break;
-           }
-           break;
-         default:
-           x86emu_fpu_illegal();
-           break;
-       }
-       break;
-      default:
-       switch (rh) {
-         case 0:
-           x86emu_fpu_M_fild(X86EMU_FPU_SHORT, destoffset);
-           break;
-         case 1:
-           x86emu_fpu_illegal();
-           break;
-         case 2:
-           x86emu_fpu_M_fist(X86EMU_FPU_SHORT, destoffset);
-           break;
-         case 3:
-           x86emu_fpu_M_fistp(X86EMU_FPU_SHORT, destoffset);
-           break;
-         case 4:
-           x86emu_fpu_illegal();
-           break;
-         case 5:
-           x86emu_fpu_M_fld(X86EMU_FPU_LDBL, destoffset);
-           break;
-                     case 6:
-           x86emu_fpu_illegal();
-           break;
-         case 7:
-           x86emu_fpu_M_fstp(X86EMU_FPU_LDBL, destoffset);
-           break;
-       }
-    }
-#endif
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR_NO_TRACE();
-}
-
-#ifdef DEBUG
-char *x86emu_fpu_op_dc_tab[] = {
-    "FADD\tQWORD PTR ", "FMUL\tQWORD PTR ", "FCOM\tQWORD PTR ",
-    "FCOMP\tQWORD PTR ",
-    "FSUB\tQWORD PTR ", "FSUBR\tQWORD PTR ", "FDIV\tQWORD PTR ",
-    "FDIVR\tQWORD PTR ",
-
-    "FADD\tQWORD PTR ", "FMUL\tQWORD PTR ", "FCOM\tQWORD PTR ",
-    "FCOMP\tQWORD PTR ",
-    "FSUB\tQWORD PTR ", "FSUBR\tQWORD PTR ", "FDIV\tQWORD PTR ",
-    "FDIVR\tQWORD PTR ",
-
-    "FADD\tQWORD PTR ", "FMUL\tQWORD PTR ", "FCOM\tQWORD PTR ",
-    "FCOMP\tQWORD PTR ",
-    "FSUB\tQWORD PTR ", "FSUBR\tQWORD PTR ", "FDIV\tQWORD PTR ",
-    "FDIVR\tQWORD PTR ",
-
-    "FADD\t", "FMUL\t", "FCOM\t", "FCOMP\t",
-    "FSUBR\t", "FSUB\t", "FDIVR\t", "FDIV\t",
-};
-#endif /* DEBUG */
-
-/* opcode=0xdc */
-void x86emuOp_esc_coprocess_dc(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-       uint destoffset;
-    u8 stkelem;
-
-    START_OF_INSTR();
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    DECODE_PRINTINSTR32(x86emu_fpu_op_dc_tab, mod, rh, rl);
-    switch (mod) {
-      case 0:
-       destoffset = decode_rm00_address(rl);
-       DECODE_PRINTF("\n");
-       break;
-      case 1:
-       destoffset = decode_rm01_address(rl);
-       DECODE_PRINTF("\n");
-       break;
-      case 2:
-       destoffset = decode_rm10_address(rl);
-       DECODE_PRINTF("\n");
-       break;
-      case 3:                   /* register to register */
-               stkelem = (u8)rl;
-       DECODE_PRINTF2("\tST(%d),ST\n", stkelem);
-       break;
-    }
-#ifdef X86EMU_FPU_PRESENT
-    /* execute */
-    switch (mod) {
-      case 3:
-       switch (rh) {
-         case 0:
-           x86emu_fpu_R_fadd(stkelem, X86EMU_FPU_STKTOP);
-           break;
-         case 1:
-           x86emu_fpu_R_fmul(stkelem, X86EMU_FPU_STKTOP);
-           break;
-         case 2:
-           x86emu_fpu_R_fcom(stkelem, X86EMU_FPU_STKTOP);
-           break;
-         case 3:
-           x86emu_fpu_R_fcomp(stkelem, X86EMU_FPU_STKTOP);
-           break;
-         case 4:
-           x86emu_fpu_R_fsubr(stkelem, X86EMU_FPU_STKTOP);
-           break;
-         case 5:
-           x86emu_fpu_R_fsub(stkelem, X86EMU_FPU_STKTOP);
-           break;
-         case 6:
-           x86emu_fpu_R_fdivr(stkelem, X86EMU_FPU_STKTOP);
-           break;
-         case 7:
-           x86emu_fpu_R_fdiv(stkelem, X86EMU_FPU_STKTOP);
-           break;
-       }
-       break;
-      default:
-       switch (rh) {
-         case 0:
-           x86emu_fpu_M_fadd(X86EMU_FPU_DOUBLE, destoffset);
-           break;
-         case 1:
-           x86emu_fpu_M_fmul(X86EMU_FPU_DOUBLE, destoffset);
-           break;
-         case 2:
-           x86emu_fpu_M_fcom(X86EMU_FPU_DOUBLE, destoffset);
-           break;
-         case 3:
-           x86emu_fpu_M_fcomp(X86EMU_FPU_DOUBLE, destoffset);
-           break;
-         case 4:
-           x86emu_fpu_M_fsub(X86EMU_FPU_DOUBLE, destoffset);
-           break;
-         case 5:
-           x86emu_fpu_M_fsubr(X86EMU_FPU_DOUBLE, destoffset);
-           break;
-         case 6:
-           x86emu_fpu_M_fdiv(X86EMU_FPU_DOUBLE, destoffset);
-           break;
-         case 7:
-           x86emu_fpu_M_fdivr(X86EMU_FPU_DOUBLE, destoffset);
-           break;
-       }
-    }
-#endif
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR_NO_TRACE();
-}
-
-#ifdef DEBUG
-
-static char *x86emu_fpu_op_dd_tab[] = {
-    "FLD\tQWORD PTR ", "ESC_DD\t29,", "FST\tQWORD PTR ", "FSTP\tQWORD PTR ",
-    "FRSTOR\t", "ESC_DD\t2D,", "FSAVE\t", "FSTSW\t",
-
-    "FLD\tQWORD PTR ", "ESC_DD\t29,", "FST\tQWORD PTR ", "FSTP\tQWORD PTR ",
-    "FRSTOR\t", "ESC_DD\t2D,", "FSAVE\t", "FSTSW\t",
-
-    "FLD\tQWORD PTR ", "ESC_DD\t29,", "FST\tQWORD PTR ", "FSTP\tQWORD PTR ",
-    "FRSTOR\t", "ESC_DD\t2D,", "FSAVE\t", "FSTSW\t",
-
-    "FFREE\t", "FXCH\t", "FST\t", "FSTP\t",
-    "ESC_DD\t2C,", "ESC_DD\t2D,", "ESC_DD\t2E,", "ESC_DD\t2F,",
-};
-
-#endif /* DEBUG */
-
-/* opcode=0xdd */
-void x86emuOp_esc_coprocess_dd(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-       uint destoffset;
-    u8 stkelem;
-
-    START_OF_INSTR();
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    DECODE_PRINTINSTR32(x86emu_fpu_op_dd_tab, mod, rh, rl);
-    switch (mod) {
-      case 0:
-       destoffset = decode_rm00_address(rl);
-       DECODE_PRINTF("\n");
-       break;
-      case 1:
-       destoffset = decode_rm01_address(rl);
-       DECODE_PRINTF("\n");
-       break;
-      case 2:
-       destoffset = decode_rm10_address(rl);
-       DECODE_PRINTF("\n");
-       break;
-      case 3:                   /* register to register */
-               stkelem = (u8)rl;
-       DECODE_PRINTF2("\tST(%d),ST\n", stkelem);
-       break;
-    }
-#ifdef X86EMU_FPU_PRESENT
-    switch (mod) {
-      case 3:
-       switch (rh) {
-         case 0:
-           x86emu_fpu_R_ffree(stkelem);
-           break;
-         case 1:
-           x86emu_fpu_R_fxch(stkelem);
-           break;
-         case 2:
-           x86emu_fpu_R_fst(stkelem);  /* register version */
-           break;
-         case 3:
-           x86emu_fpu_R_fstp(stkelem); /* register version */
-           break;
-         default:
-           x86emu_fpu_illegal();
-           break;
-       }
-       break;
-      default:
-       switch (rh) {
-         case 0:
-           x86emu_fpu_M_fld(X86EMU_FPU_DOUBLE, destoffset);
-           break;
-         case 1:
-           x86emu_fpu_illegal();
-           break;
-         case 2:
-           x86emu_fpu_M_fst(X86EMU_FPU_DOUBLE, destoffset);
-           break;
-         case 3:
-           x86emu_fpu_M_fstp(X86EMU_FPU_DOUBLE, destoffset);
-           break;
-         case 4:
-           x86emu_fpu_M_frstor(X86EMU_FPU_WORD, destoffset);
-           break;
-         case 5:
-           x86emu_fpu_illegal();
-           break;
-         case 6:
-           x86emu_fpu_M_fsave(X86EMU_FPU_WORD, destoffset);
-           break;
-         case 7:
-           x86emu_fpu_M_fstsw(X86EMU_FPU_WORD, destoffset);
-           break;
-       }
-    }
-#endif
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR_NO_TRACE();
-}
-
-#ifdef DEBUG
-
-static char *x86emu_fpu_op_de_tab[] =
-{
-    "FIADD\tWORD PTR ", "FIMUL\tWORD PTR ", "FICOM\tWORD PTR ",
-    "FICOMP\tWORD PTR ",
-    "FISUB\tWORD PTR ", "FISUBR\tWORD PTR ", "FIDIV\tWORD PTR ",
-    "FIDIVR\tWORD PTR ",
-
-    "FIADD\tWORD PTR ", "FIMUL\tWORD PTR ", "FICOM\tWORD PTR ",
-    "FICOMP\tWORD PTR ",
-    "FISUB\tWORD PTR ", "FISUBR\tWORD PTR ", "FIDIV\tWORD PTR ",
-    "FIDIVR\tWORD PTR ",
-
-    "FIADD\tWORD PTR ", "FIMUL\tWORD PTR ", "FICOM\tWORD PTR ",
-    "FICOMP\tWORD PTR ",
-    "FISUB\tWORD PTR ", "FISUBR\tWORD PTR ", "FIDIV\tWORD PTR ",
-    "FIDIVR\tWORD PTR ",
-
-    "FADDP\t", "FMULP\t", "FCOMP\t", "FCOMPP\t",
-    "FSUBRP\t", "FSUBP\t", "FDIVRP\t", "FDIVP\t",
-};
-
-#endif /* DEBUG */
-
-/* opcode=0xde */
-void x86emuOp_esc_coprocess_de(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-       uint destoffset;
-    u8 stkelem;
-
-    START_OF_INSTR();
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    DECODE_PRINTINSTR32(x86emu_fpu_op_de_tab, mod, rh, rl);
-    switch (mod) {
-      case 0:
-       destoffset = decode_rm00_address(rl);
-       DECODE_PRINTF("\n");
-       break;
-      case 1:
-       destoffset = decode_rm01_address(rl);
-       DECODE_PRINTF("\n");
-       break;
-      case 2:
-       destoffset = decode_rm10_address(rl);
-       DECODE_PRINTF("\n");
-       break;
-      case 3:                   /* register to register */
-               stkelem = (u8)rl;
-       DECODE_PRINTF2("\tST(%d),ST\n", stkelem);
-       break;
-    }
-#ifdef X86EMU_FPU_PRESENT
-    switch (mod) {
-      case 3:
-       switch (rh) {
-         case 0:
-           x86emu_fpu_R_faddp(stkelem, X86EMU_FPU_STKTOP);
-           break;
-         case 1:
-           x86emu_fpu_R_fmulp(stkelem, X86EMU_FPU_STKTOP);
-           break;
-         case 2:
-           x86emu_fpu_R_fcomp(stkelem, X86EMU_FPU_STKTOP);
-           break;
-         case 3:
-           if (stkelem == 1)
-             x86emu_fpu_R_fcompp(stkelem, X86EMU_FPU_STKTOP);
-           else
-             x86emu_fpu_illegal();
-           break;
-         case 4:
-           x86emu_fpu_R_fsubrp(stkelem, X86EMU_FPU_STKTOP);
-           break;
-         case 5:
-           x86emu_fpu_R_fsubp(stkelem, X86EMU_FPU_STKTOP);
-           break;
-         case 6:
-           x86emu_fpu_R_fdivrp(stkelem, X86EMU_FPU_STKTOP);
-           break;
-         case 7:
-           x86emu_fpu_R_fdivp(stkelem, X86EMU_FPU_STKTOP);
-           break;
-       }
-       break;
-      default:
-       switch (rh) {
-         case 0:
-           x86emu_fpu_M_fiadd(X86EMU_FPU_WORD, destoffset);
-           break;
-         case 1:
-           x86emu_fpu_M_fimul(X86EMU_FPU_WORD, destoffset);
-           break;
-         case 2:
-           x86emu_fpu_M_ficom(X86EMU_FPU_WORD, destoffset);
-           break;
-         case 3:
-           x86emu_fpu_M_ficomp(X86EMU_FPU_WORD, destoffset);
-           break;
-         case 4:
-           x86emu_fpu_M_fisub(X86EMU_FPU_WORD, destoffset);
-           break;
-         case 5:
-           x86emu_fpu_M_fisubr(X86EMU_FPU_WORD, destoffset);
-           break;
-         case 6:
-           x86emu_fpu_M_fidiv(X86EMU_FPU_WORD, destoffset);
-           break;
-         case 7:
-           x86emu_fpu_M_fidivr(X86EMU_FPU_WORD, destoffset);
-           break;
-       }
-    }
-#endif
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR_NO_TRACE();
-}
-
-#ifdef DEBUG
-
-static char *x86emu_fpu_op_df_tab[] = {
-    /* mod == 00 */
-    "FILD\tWORD PTR ", "ESC_DF\t39\n", "FIST\tWORD PTR ", "FISTP\tWORD PTR ",
-    "FBLD\tTBYTE PTR ", "FILD\tQWORD PTR ", "FBSTP\tTBYTE PTR ",
-    "FISTP\tQWORD PTR ",
-
-    /* mod == 01 */
-    "FILD\tWORD PTR ", "ESC_DF\t39 ", "FIST\tWORD PTR ", "FISTP\tWORD PTR ",
-    "FBLD\tTBYTE PTR ", "FILD\tQWORD PTR ", "FBSTP\tTBYTE PTR ",
-    "FISTP\tQWORD PTR ",
-
-    /* mod == 10 */
-    "FILD\tWORD PTR ", "ESC_DF\t39 ", "FIST\tWORD PTR ", "FISTP\tWORD PTR ",
-    "FBLD\tTBYTE PTR ", "FILD\tQWORD PTR ", "FBSTP\tTBYTE PTR ",
-    "FISTP\tQWORD PTR ",
-
-    /* mod == 11 */
-    "FFREE\t", "FXCH\t", "FST\t", "FSTP\t",
-    "ESC_DF\t3C,", "ESC_DF\t3D,", "ESC_DF\t3E,", "ESC_DF\t3F,"
-};
-
-#endif /* DEBUG */
-
-/* opcode=0xdf */
-void x86emuOp_esc_coprocess_df(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-       uint destoffset;
-    u8 stkelem;
-
-    START_OF_INSTR();
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    DECODE_PRINTINSTR32(x86emu_fpu_op_df_tab, mod, rh, rl);
-    switch (mod) {
-      case 0:
-       destoffset = decode_rm00_address(rl);
-       DECODE_PRINTF("\n");
-       break;
-      case 1:
-       destoffset = decode_rm01_address(rl);
-       DECODE_PRINTF("\n");
-       break;
-      case 2:
-       destoffset = decode_rm10_address(rl);
-       DECODE_PRINTF("\n");
-       break;
-      case 3:                   /* register to register */
-               stkelem = (u8)rl;
-       DECODE_PRINTF2("\tST(%d)\n", stkelem);
-       break;
-    }
-#ifdef X86EMU_FPU_PRESENT
-    switch (mod) {
-      case 3:
-       switch (rh) {
-         case 0:
-           x86emu_fpu_R_ffree(stkelem);
-           break;
-         case 1:
-           x86emu_fpu_R_fxch(stkelem);
-           break;
-         case 2:
-           x86emu_fpu_R_fst(stkelem);  /* register version */
-           break;
-         case 3:
-           x86emu_fpu_R_fstp(stkelem); /* register version */
-           break;
-         default:
-           x86emu_fpu_illegal();
-           break;
-       }
-       break;
-      default:
-       switch (rh) {
-         case 0:
-           x86emu_fpu_M_fild(X86EMU_FPU_WORD, destoffset);
-           break;
-         case 1:
-           x86emu_fpu_illegal();
-           break;
-         case 2:
-           x86emu_fpu_M_fist(X86EMU_FPU_WORD, destoffset);
-           break;
-         case 3:
-           x86emu_fpu_M_fistp(X86EMU_FPU_WORD, destoffset);
-           break;
-         case 4:
-           x86emu_fpu_M_fbld(X86EMU_FPU_BSD, destoffset);
-           break;
-         case 5:
-           x86emu_fpu_M_fild(X86EMU_FPU_LONG, destoffset);
-           break;
-         case 6:
-           x86emu_fpu_M_fbstp(X86EMU_FPU_BSD, destoffset);
-           break;
-         case 7:
-           x86emu_fpu_M_fistp(X86EMU_FPU_LONG, destoffset);
-           break;
-       }
-    }
-#endif
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR_NO_TRACE();
-}
diff --git a/board/MAI/bios_emulator/scitech/src/x86emu/makefile b/board/MAI/bios_emulator/scitech/src/x86emu/makefile
deleted file mode 100644 (file)
index 8ce2e9e..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-#############################################################################
-#
-#                                              Realmode X86 Emulator Library
-#
-#              Copyright (C) 1996-1999 SciTech Software, Inc.
-#
-#  ========================================================================
-#
-#  Permission to use, copy, modify, distribute, and sell this software and
-#  its documentation for any purpose is hereby granted without fee,
-#  provided that the above copyright notice appear in all copies and that
-#  both that copyright notice and this permission notice appear in
-#  supporting documentation, and that the name of the authors not be used
-#  in advertising or publicity pertaining to distribution of the software
-#  without specific, written prior permission.  The authors makes no
-#  representations about the suitability of this software for any purpose.
-#  It is provided "as is" without express or implied warranty.
-#
-#  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-#  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-#  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-#  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-#  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-#  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-#  PERFORMANCE OF THIS SOFTWARE.
-#
-#  ========================================================================
-#
-# Descripton:   Generic makefile for the x86emu library. Requires
-#               the SciTech Software makefile definitions package to be
-#               installed, which uses the DMAKE make program.
-#
-#############################################################################
-
-.IMPORT .IGNORE: DEBUG
-
-#----------------------------------------------------------------------------
-# Define the lists of object files
-#----------------------------------------------------------------------------
-
-OBJECTS                        = sys$O decode$O ops$O ops2$O prim_ops$O fpu$O debug$O
-CFLAGS         += -DSCITECH
-.IF $(DEBUG)
-CFLAGS                 += -DDEBUG
-.ENDIF
-LIBCLEAN               = *.dll *.lib *.a
-LIBFILE                = $(LP)x86emu$L
-
-#----------------------------------------------------------------------------
-# Sample test programs
-#----------------------------------------------------------------------------
-
-all: $(LIBFILE)
-
-validate$E: validate$O $(LIBFILE)
-
-#----------------------------------------------------------------------------
-# Define the list of object files to create dependency information for
-#----------------------------------------------------------------------------
-
-DEPEND_OBJ      =  validate$O $(OBJECTS)
-
-.INCLUDE: "$(SCITECH)/makedefs/common.mk"
diff --git a/board/MAI/bios_emulator/scitech/src/x86emu/makefile.cross b/board/MAI/bios_emulator/scitech/src/x86emu/makefile.cross
deleted file mode 100644 (file)
index 0bce9a9..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-#############################################################################
-#
-#                                              Realmode X86 Emulator Library
-#
-#              Copyright (C) 1996-1999 SciTech Software, Inc.
-#
-#  ========================================================================
-#
-#  Permission to use, copy, modify, distribute, and sell this software and
-#  its documentation for any purpose is hereby granted without fee,
-#  provided that the above copyright notice appear in all copies and that
-#  both that copyright notice and this permission notice appear in
-#  supporting documentation, and that the name of the authors not be used
-#  in advertising or publicity pertaining to distribution of the software
-#  without specific, written prior permission.  The authors makes no
-#  representations about the suitability of this software for any purpose.
-#  It is provided "as is" without express or implied warranty.
-#
-#  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-#  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-#  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-#  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-#  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-#  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-#  PERFORMANCE OF THIS SOFTWARE.
-#
-#  ========================================================================
-#
-# Descripton:   Linux specific makefile for the x86emu library.
-#
-#############################################################################
-
-CC = $(CROSS_COMPILE)gcc
-AR = $(CROSS_COMPILE)ar
-
-TARGETLIB = libx86emu.a
-TARGETDEBUGLIB =libx86emud.a
-
-OBJS=\
-decode.o \
-fpu.o \
-ops.o \
-ops2.o \
-prim_ops.o \
-sys.o
-
-DEBUGOBJS=debug.d \
-          decode.d \
-         fpu.d \
-         ops.d \
-         ops2.d \
-         prim_ops.d \
-         sys.d
-
-.SUFFIXES: .d
-
-all: $(TARGETLIB) $(TARGETDEBUGLIB)
-
-$(TARGETLIB): $(OBJS)
-       $(AR) rv $(TARGETLIB) $(OBJS)
-
-$(TARGETDEBUGLIB): $(DEBUGOBJS)
-       $(AR) rv $(TARGETDEBUGLIB) $(DEBUGOBJS)
-
-INCS   = -I. -Ix86emu -I../../include
-CFLAGS = -D__DRIVER__ -DFORCE_POST -D_CEXPORT= -DNO_LONG_LONG -Dprintk=printf -fsigned-char  -fomit-frame-pointer -fPIC -ffixed-r14 -meabi
-CDEBUGFLAGS = -DDEBUG
-
-.c.o:
-       $(CC) -g -O2 -Wall -c $(CFLAGS) $(INCS) $*.c
-
-.c.d:
-       $(CC) -g -O2 -Wall -c -o$*.d $(CFLAGS) $(CDEBUGFLAGS) $(INCS) $*.c
-
-.cpp.o:
-       $(CC) -c $(CFLAGS) $(INCS) $*.cpp
-
-clean:
-       rm -f *.a *.o *.d
-
-validate:      validate.o libx86emu.a
-       $(CC) -o validate validate.o -lx86emu -L.
diff --git a/board/MAI/bios_emulator/scitech/src/x86emu/makefile.linux b/board/MAI/bios_emulator/scitech/src/x86emu/makefile.linux
deleted file mode 100644 (file)
index f74b88d..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-#############################################################################
-#
-#                                              Realmode X86 Emulator Library
-#
-#              Copyright (C) 1996-1999 SciTech Software, Inc.
-#
-#  ========================================================================
-#
-#  Permission to use, copy, modify, distribute, and sell this software and
-#  its documentation for any purpose is hereby granted without fee,
-#  provided that the above copyright notice appear in all copies and that
-#  both that copyright notice and this permission notice appear in
-#  supporting documentation, and that the name of the authors not be used
-#  in advertising or publicity pertaining to distribution of the software
-#  without specific, written prior permission.  The authors makes no
-#  representations about the suitability of this software for any purpose.
-#  It is provided "as is" without express or implied warranty.
-#
-#  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-#  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-#  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-#  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-#  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-#  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-#  PERFORMANCE OF THIS SOFTWARE.
-#
-#  ========================================================================
-#
-# Descripton:   Linux specific makefile for the x86emu library.
-#
-#############################################################################
-
-TARGETLIB = libx86emu.a
-TARGETDEBUGLIB =libx86emud.a
-
-OBJS=\
-decode.o \
-fpu.o \
-ops.o \
-ops2.o \
-prim_ops.o \
-pregs.o \
-sys.o
-
-DEBUGOBJS=debug.d \
-          decode.d \
-         fpu.d \
-         ops.d \
-         ops2.d \
-         prim_ops.d \
-         pregs.d \
-         sys.d
-
-.SUFFIXES: .d
-
-all: $(TARGETLIB) $(TARGETDEBUGLIB)
-
-$(TARGETLIB): $(OBJS)
-       ar rv $(TARGETLIB) $(OBJS)
-
-$(TARGETDEBUGLIB): $(DEBUGOBJS)
-       ar rv $(TARGETDEBUGLIB) $(DEBUGOBJS)
-
-INCS   = -I. -Ix86emu -I../../include
-CFLAGS = -D__DRIVER__ -DFORCE_POST -D_CEXPORT= -DNO_LONG_LONG
-CDEBUGFLAGS = -DDEBUG
-
-.c.o:
-       gcc -g -O -Wall -c $(CFLAGS) $(INCS) $*.c
-
-.c.d:
-       gcc -g -O -Wall -c -o$*.d $(CFLAGS) $(CDEBUGFLAGS) $(INCS) $*.c
-
-.cpp.o:
-       gcc -c $(CFLAGS) $(INCS) $*.cpp
-
-clean:
-       rm -f *.a *.o *.d
-
-validate:      validate.o libx86emu.a
-       gcc -o validate validate.o -lx86emu -L.
diff --git a/board/MAI/bios_emulator/scitech/src/x86emu/makefile.uboot b/board/MAI/bios_emulator/scitech/src/x86emu/makefile.uboot
deleted file mode 100644 (file)
index af9ae1f..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-#############################################################################
-#
-#                                              Realmode X86 Emulator Library
-#
-#              Copyright (C) 1996-1999 SciTech Software, Inc.
-#
-#  ========================================================================
-#
-#  Permission to use, copy, modify, distribute, and sell this software and
-#  its documentation for any purpose is hereby granted without fee,
-#  provided that the above copyright notice appear in all copies and that
-#  both that copyright notice and this permission notice appear in
-#  supporting documentation, and that the name of the authors not be used
-#  in advertising or publicity pertaining to distribution of the software
-#  without specific, written prior permission.  The authors makes no
-#  representations about the suitability of this software for any purpose.
-#  It is provided "as is" without express or implied warranty.
-#
-#  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-#  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-#  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-#  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-#  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-#  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-#  PERFORMANCE OF THIS SOFTWARE.
-#
-#  ========================================================================
-#
-# Descripton:   Linux specific makefile for the x86emu library.
-#
-#############################################################################
-CC = $(CROSS_COMPILE)gcc
-AR = $(CROSS_COMPILE)ar
-TARGETLIB = libx86emu.a
-TARGETDEBUGLIB =libx86emud.a
-
-OBJS=\
-decode.o \
-fpu.o \
-ops.o \
-ops2.o \
-prim_ops.o \
-sys.o
-
-DEBUGOBJS=debug.d \
-          decode.d \
-         fpu.d \
-         ops.d \
-         ops2.d \
-         prim_ops.d \
-         sys.d
-
-.SUFFIXES: .d
-
-all: $(TARGETLIB) $(TARGETDEBUGLIB)
-
-$(TARGETLIB): $(OBJS)
-       $(AR) rv $(TARGETLIB) $(OBJS)
-
-$(TARGETDEBUGLIB): $(DEBUGOBJS)
-       $(AR) rv $(TARGETDEBUGLIB) $(DEBUGOBJS)
-
-INCS   = -I. -Ix86emu -I../../include
-CFLAGS = -D__DRIVER__ -DFORCE_POST -D_CEXPORT= -DNO_LONG_LONG -Dprintk=printf -fsigned-char  -fomit-frame-pointer -fPIC -ffixed-r14 -meabi
-CDEBUGFLAGS = -DDEBUG
-
-.c.o:
-       $(CC) -g -O2 -Wall -c $(CFLAGS) $(INCS) $*.c
-
-.c.d:
-       $(CC) -g -O2 -Wall -c -o$*.d $(CFLAGS) $(CDEBUGFLAGS) $(INCS) $*.c
-
-.cpp.o:
-       $(CC) -c $(CFLAGS) $(INCS) $*.cpp
-
-clean:
-       rm -f *.a *.o *.d
-
-validate:      validate.o libx86emu.a
-       $(CC) -o validate validate.o -lx86emu -L.
diff --git a/board/MAI/bios_emulator/scitech/src/x86emu/ops.c b/board/MAI/bios_emulator/scitech/src/x86emu/ops.c
deleted file mode 100644 (file)
index 2d4f93e..0000000
+++ /dev/null
@@ -1,11701 +0,0 @@
-/****************************************************************************
-*
-*                                              Realmode X86 Emulator Library
-*
-*              Copyright (C) 1996-1999 SciTech Software, Inc.
-*                                   Copyright (C) David Mosberger-Tang
-*                                         Copyright (C) 1999 Egbert Eich
-*
-*  ========================================================================
-*
-*  Permission to use, copy, modify, distribute, and sell this software and
-*  its documentation for any purpose is hereby granted without fee,
-*  provided that the above copyright notice appear in all copies and that
-*  both that copyright notice and this permission notice appear in
-*  supporting documentation, and that the name of the authors not be used
-*  in advertising or publicity pertaining to distribution of the software
-*  without specific, written prior permission.  The authors makes no
-*  representations about the suitability of this software for any purpose.
-*  It is provided "as is" without express or implied warranty.
-*
-*  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-*  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-*  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-*  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-*  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-*  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-*  PERFORMANCE OF THIS SOFTWARE.
-*
-*  ========================================================================
-*
-* Language:            ANSI C
-* Environment: Any
-* Developer:    Kendall Bennett
-*
-* Description:  This file includes subroutines to implement the decoding
-*               and emulation of all the x86 processor instructions.
-*
-* There are approximately 250 subroutines in here, which correspond
-* to the 256 byte-"opcodes" found on the 8086.  The table which
-* dispatches this is found in the files optab.[ch].
-*
-* Each opcode proc has a comment preceeding it which gives it's table
-* address.  Several opcodes are missing (undefined) in the table.
-*
-* Each proc includes information for decoding (DECODE_PRINTF and
-* DECODE_PRINTF2), debugging (TRACE_REGS, SINGLE_STEP), and misc
-* functions (START_OF_INSTR, END_OF_INSTR).
-*
-* Many of the procedures are *VERY* similar in coding.  This has
-* allowed for a very large amount of code to be generated in a fairly
-* short amount of time (i.e. cut, paste, and modify).  The result is
-* that much of the code below could have been folded into subroutines
-* for a large reduction in size of this file.  The downside would be
-* that there would be a penalty in execution speed.  The file could
-* also have been *MUCH* larger by inlining certain functions which
-* were called.  This could have resulted even faster execution.  The
-* prime directive I used to decide whether to inline the code or to
-* modularize it, was basically: 1) no unnecessary subroutine calls,
-* 2) no routines more than about 200 lines in size, and 3) modularize
-* any code that I might not get right the first time.  The fetch_*
-* subroutines fall into the latter category.  The The decode_* fall
-* into the second category.  The coding of the "switch(mod){ .... }"
-* in many of the subroutines below falls into the first category.
-* Especially, the coding of {add,and,or,sub,...}_{byte,word}
-* subroutines are an especially glaring case of the third guideline.
-* Since so much of the code is cloned from other modules (compare
-* opcode #00 to opcode #01), making the basic operations subroutine
-* calls is especially important; otherwise mistakes in coding an
-* "add" would represent a nightmare in maintenance.
-*
-****************************************************************************/
-
-#include "x86emu/x86emui.h"
-
-/*----------------------------- Implementation ----------------------------*/
-
-/****************************************************************************
-PARAMETERS:
-op1 - Instruction op code
-
-REMARKS:
-Handles illegal opcodes.
-****************************************************************************/
-void x86emuOp_illegal_op(
-    u8 op1)
-{
-    START_OF_INSTR();
-    DECODE_PRINTF("ILLEGAL X86 OPCODE\n");
-    TRACE_REGS();
-    printk("%04x:%04x: %02X ILLEGAL X86 OPCODE!\n",
-       M.x86.R_CS, M.x86.R_IP-1,op1);
-    HALT_SYS();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x00
-****************************************************************************/
-void x86emuOp_add_byte_RM_R(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    uint destoffset;
-    u8 *destreg, *srcreg;
-    u8 destval;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("ADD\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       destoffset = decode_rm00_address(rl);
-       DECODE_PRINTF(",");
-       destval = fetch_data_byte(destoffset);
-       srcreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       destval = add_byte(destval, *srcreg);
-       store_data_byte(destoffset, destval);
-       break;
-    case 1:
-       destoffset = decode_rm01_address(rl);
-       DECODE_PRINTF(",");
-       destval = fetch_data_byte(destoffset);
-       srcreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       destval = add_byte(destval, *srcreg);
-       store_data_byte(destoffset, destval);
-       break;
-    case 2:
-       destoffset = decode_rm10_address(rl);
-       DECODE_PRINTF(",");
-       destval = fetch_data_byte(destoffset);
-       srcreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       destval = add_byte(destval, *srcreg);
-       store_data_byte(destoffset, destval);
-       break;
-    case 3:                     /* register to register */
-       destreg = DECODE_RM_BYTE_REGISTER(rl);
-       DECODE_PRINTF(",");
-       srcreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = add_byte(*destreg, *srcreg);
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x01
-****************************************************************************/
-void x86emuOp_add_word_RM_R(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    uint destoffset;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("ADD\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-           u32 *srcreg;
-
-           destoffset = decode_rm00_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_long(destoffset);
-           srcreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           destval = add_long(destval, *srcreg);
-           store_data_long(destoffset, destval);
-       } else {
-           u16 destval;
-           u16 *srcreg;
-
-           destoffset = decode_rm00_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_word(destoffset);
-           srcreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           destval = add_word(destval, *srcreg);
-           store_data_word(destoffset, destval);
-       }
-       break;
-    case 1:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-           u32 *srcreg;
-
-           destoffset = decode_rm01_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_long(destoffset);
-           srcreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           destval = add_long(destval, *srcreg);
-           store_data_long(destoffset, destval);
-       } else {
-           u16 destval;
-           u16 *srcreg;
-
-           destoffset = decode_rm01_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_word(destoffset);
-           srcreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           destval = add_word(destval, *srcreg);
-           store_data_word(destoffset, destval);
-       }
-       break;
-    case 2:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-           u32 *srcreg;
-
-           destoffset = decode_rm10_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_long(destoffset);
-           srcreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           destval = add_long(destval, *srcreg);
-           store_data_long(destoffset, destval);
-       } else {
-           u16 destval;
-           u16 *srcreg;
-
-           destoffset = decode_rm10_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_word(destoffset);
-           srcreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           destval = add_word(destval, *srcreg);
-           store_data_word(destoffset, destval);
-       }
-       break;
-    case 3:                     /* register to register */
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg,*srcreg;
-
-           destreg = DECODE_RM_LONG_REGISTER(rl);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = add_long(*destreg, *srcreg);
-       } else {
-           u16 *destreg,*srcreg;
-
-           destreg = DECODE_RM_WORD_REGISTER(rl);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = add_word(*destreg, *srcreg);
-       }
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x02
-****************************************************************************/
-void x86emuOp_add_byte_R_RM(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    u8 *destreg, *srcreg;
-    uint srcoffset;
-    u8 srcval;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("ADD\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       destreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm00_address(rl);
-       srcval = fetch_data_byte(srcoffset);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = add_byte(*destreg, srcval);
-       break;
-    case 1:
-       destreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm01_address(rl);
-       srcval = fetch_data_byte(srcoffset);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = add_byte(*destreg, srcval);
-       break;
-    case 2:
-       destreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm10_address(rl);
-       srcval = fetch_data_byte(srcoffset);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = add_byte(*destreg, srcval);
-       break;
-    case 3:                     /* register to register */
-       destreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcreg = DECODE_RM_BYTE_REGISTER(rl);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = add_byte(*destreg, *srcreg);
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x03
-****************************************************************************/
-void x86emuOp_add_word_R_RM(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    uint srcoffset;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("ADD\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg;
-           u32 srcval;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm00_address(rl);
-           srcval = fetch_data_long(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = add_long(*destreg, srcval);
-       } else {
-           u16 *destreg;
-           u16 srcval;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm00_address(rl);
-           srcval = fetch_data_word(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = add_word(*destreg, srcval);
-       }
-       break;
-    case 1:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg;
-           u32 srcval;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm01_address(rl);
-           srcval = fetch_data_long(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = add_long(*destreg, srcval);
-       } else {
-           u16 *destreg;
-           u16 srcval;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm01_address(rl);
-           srcval = fetch_data_word(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = add_word(*destreg, srcval);
-       }
-       break;
-    case 2:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg;
-           u32 srcval;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm10_address(rl);
-           srcval = fetch_data_long(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = add_long(*destreg, srcval);
-       } else {
-           u16 *destreg;
-           u16 srcval;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm10_address(rl);
-           srcval = fetch_data_word(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = add_word(*destreg, srcval);
-       }
-       break;
-    case 3:                     /* register to register */
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg,*srcreg;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_LONG_REGISTER(rl);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = add_long(*destreg, *srcreg);
-       } else {
-           u16 *destreg,*srcreg;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_WORD_REGISTER(rl);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = add_word(*destreg, *srcreg);
-       }
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x04
-****************************************************************************/
-void x86emuOp_add_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
-{
-    u8 srcval;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("ADD\tAL,");
-    srcval = fetch_byte_imm();
-    DECODE_PRINTF2("%x\n", srcval);
-    TRACE_AND_STEP();
-    M.x86.R_AL = add_byte(M.x86.R_AL, srcval);
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x05
-****************************************************************************/
-void x86emuOp_add_word_AX_IMM(u8 X86EMU_UNUSED(op1))
-{
-    u32 srcval;
-
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("ADD\tEAX,");
-       srcval = fetch_long_imm();
-    } else {
-       DECODE_PRINTF("ADD\tAX,");
-       srcval = fetch_word_imm();
-    }
-    DECODE_PRINTF2("%x\n", srcval);
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       M.x86.R_EAX = add_long(M.x86.R_EAX, srcval);
-    } else {
-       M.x86.R_AX = add_word(M.x86.R_AX, (u16)srcval);
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x06
-****************************************************************************/
-void x86emuOp_push_ES(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    DECODE_PRINTF("PUSH\tES\n");
-    TRACE_AND_STEP();
-    push_word(M.x86.R_ES);
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x07
-****************************************************************************/
-void x86emuOp_pop_ES(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    DECODE_PRINTF("POP\tES\n");
-    TRACE_AND_STEP();
-    M.x86.R_ES = pop_word();
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x08
-****************************************************************************/
-void x86emuOp_or_byte_RM_R(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    u8 *destreg, *srcreg;
-    uint destoffset;
-    u8 destval;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("OR\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       destoffset = decode_rm00_address(rl);
-       DECODE_PRINTF(",");
-       destval = fetch_data_byte(destoffset);
-       srcreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       destval = or_byte(destval, *srcreg);
-       store_data_byte(destoffset, destval);
-       break;
-    case 1:
-       destoffset = decode_rm01_address(rl);
-       DECODE_PRINTF(",");
-       destval = fetch_data_byte(destoffset);
-       srcreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       destval = or_byte(destval, *srcreg);
-       store_data_byte(destoffset, destval);
-       break;
-    case 2:
-       destoffset = decode_rm10_address(rl);
-       DECODE_PRINTF(",");
-       destval = fetch_data_byte(destoffset);
-       srcreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       destval = or_byte(destval, *srcreg);
-       store_data_byte(destoffset, destval);
-       break;
-    case 3:                     /* register to register */
-       destreg = DECODE_RM_BYTE_REGISTER(rl);
-       DECODE_PRINTF(",");
-       srcreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = or_byte(*destreg, *srcreg);
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x09
-****************************************************************************/
-void x86emuOp_or_word_RM_R(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    uint destoffset;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("OR\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-           u32 *srcreg;
-
-           destoffset = decode_rm00_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_long(destoffset);
-           srcreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           destval = or_long(destval, *srcreg);
-           store_data_long(destoffset, destval);
-       } else {
-           u16 destval;
-           u16 *srcreg;
-
-           destoffset = decode_rm00_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_word(destoffset);
-           srcreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           destval = or_word(destval, *srcreg);
-           store_data_word(destoffset, destval);
-       }
-       break;
-    case 1:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-           u32 *srcreg;
-
-           destoffset = decode_rm01_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_long(destoffset);
-           srcreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           destval = or_long(destval, *srcreg);
-           store_data_long(destoffset, destval);
-       } else {
-           u16 destval;
-           u16 *srcreg;
-
-           destoffset = decode_rm01_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_word(destoffset);
-           srcreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           destval = or_word(destval, *srcreg);
-           store_data_word(destoffset, destval);
-       }
-       break;
-    case 2:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-           u32 *srcreg;
-
-           destoffset = decode_rm10_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_long(destoffset);
-           srcreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           destval = or_long(destval, *srcreg);
-           store_data_long(destoffset, destval);
-       } else {
-           u16 destval;
-           u16 *srcreg;
-
-           destoffset = decode_rm10_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_word(destoffset);
-           srcreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           destval = or_word(destval, *srcreg);
-           store_data_word(destoffset, destval);
-       }
-       break;
-    case 3:                     /* register to register */
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg,*srcreg;
-
-           destreg = DECODE_RM_LONG_REGISTER(rl);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = or_long(*destreg, *srcreg);
-       } else {
-           u16 *destreg,*srcreg;
-
-           destreg = DECODE_RM_WORD_REGISTER(rl);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = or_word(*destreg, *srcreg);
-       }
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0a
-****************************************************************************/
-void x86emuOp_or_byte_R_RM(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    u8 *destreg, *srcreg;
-    uint srcoffset;
-    u8 srcval;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("OR\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       destreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm00_address(rl);
-       srcval = fetch_data_byte(srcoffset);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = or_byte(*destreg, srcval);
-       break;
-    case 1:
-       destreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm01_address(rl);
-       srcval = fetch_data_byte(srcoffset);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = or_byte(*destreg, srcval);
-       break;
-    case 2:
-       destreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm10_address(rl);
-       srcval = fetch_data_byte(srcoffset);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = or_byte(*destreg, srcval);
-       break;
-    case 3:                     /* register to register */
-       destreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcreg = DECODE_RM_BYTE_REGISTER(rl);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = or_byte(*destreg, *srcreg);
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0b
-****************************************************************************/
-void x86emuOp_or_word_R_RM(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    uint srcoffset;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("OR\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg;
-           u32 srcval;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm00_address(rl);
-           srcval = fetch_data_long(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = or_long(*destreg, srcval);
-       } else {
-           u16 *destreg;
-           u16 srcval;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm00_address(rl);
-           srcval = fetch_data_word(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = or_word(*destreg, srcval);
-       }
-       break;
-    case 1:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg;
-           u32 srcval;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm01_address(rl);
-           srcval = fetch_data_long(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = or_long(*destreg, srcval);
-       } else {
-           u16 *destreg;
-           u16 srcval;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm01_address(rl);
-           srcval = fetch_data_word(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = or_word(*destreg, srcval);
-       }
-       break;
-    case 2:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg;
-           u32 srcval;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm10_address(rl);
-           srcval = fetch_data_long(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = or_long(*destreg, srcval);
-       } else {
-           u16 *destreg;
-           u16 srcval;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm10_address(rl);
-           srcval = fetch_data_word(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = or_word(*destreg, srcval);
-       }
-       break;
-    case 3:                     /* register to register */
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg,*srcreg;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_LONG_REGISTER(rl);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = or_long(*destreg, *srcreg);
-       } else {
-           u16 *destreg,*srcreg;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_WORD_REGISTER(rl);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = or_word(*destreg, *srcreg);
-       }
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0c
-****************************************************************************/
-void x86emuOp_or_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
-{
-    u8 srcval;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("OR\tAL,");
-    srcval = fetch_byte_imm();
-    DECODE_PRINTF2("%x\n", srcval);
-    TRACE_AND_STEP();
-    M.x86.R_AL = or_byte(M.x86.R_AL, srcval);
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0d
-****************************************************************************/
-void x86emuOp_or_word_AX_IMM(u8 X86EMU_UNUSED(op1))
-{
-    u32 srcval;
-
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("OR\tEAX,");
-       srcval = fetch_long_imm();
-    } else {
-       DECODE_PRINTF("OR\tAX,");
-       srcval = fetch_word_imm();
-    }
-    DECODE_PRINTF2("%x\n", srcval);
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       M.x86.R_EAX = or_long(M.x86.R_EAX, srcval);
-    } else {
-       M.x86.R_AX = or_word(M.x86.R_AX, (u16)srcval);
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0e
-****************************************************************************/
-void x86emuOp_push_CS(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    DECODE_PRINTF("PUSH\tCS\n");
-    TRACE_AND_STEP();
-    push_word(M.x86.R_CS);
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f. Escape for two-byte opcode (286 or better)
-****************************************************************************/
-void x86emuOp_two_byte(u8 X86EMU_UNUSED(op1))
-{
-    u8 op2 = (*sys_rdb)(((u32)M.x86.R_CS << 4) + (M.x86.R_IP++));
-    INC_DECODED_INST_LEN(1);
-    (*x86emu_optab2[op2])(op2);
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x10
-****************************************************************************/
-void x86emuOp_adc_byte_RM_R(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    u8 *destreg, *srcreg;
-    uint destoffset;
-    u8 destval;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("ADC\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       destoffset = decode_rm00_address(rl);
-       DECODE_PRINTF(",");
-       destval = fetch_data_byte(destoffset);
-       srcreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       destval = adc_byte(destval, *srcreg);
-       store_data_byte(destoffset, destval);
-       break;
-    case 1:
-       destoffset = decode_rm01_address(rl);
-       DECODE_PRINTF(",");
-       destval = fetch_data_byte(destoffset);
-       srcreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       destval = adc_byte(destval, *srcreg);
-       store_data_byte(destoffset, destval);
-       break;
-    case 2:
-       destoffset = decode_rm10_address(rl);
-       DECODE_PRINTF(",");
-       destval = fetch_data_byte(destoffset);
-       srcreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       destval = adc_byte(destval, *srcreg);
-       store_data_byte(destoffset, destval);
-       break;
-    case 3:                     /* register to register */
-       destreg = DECODE_RM_BYTE_REGISTER(rl);
-       DECODE_PRINTF(",");
-       srcreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = adc_byte(*destreg, *srcreg);
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x11
-****************************************************************************/
-void x86emuOp_adc_word_RM_R(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    uint destoffset;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("ADC\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-           u32 *srcreg;
-
-           destoffset = decode_rm00_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_long(destoffset);
-           srcreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           destval = adc_long(destval, *srcreg);
-           store_data_long(destoffset, destval);
-       } else {
-           u16 destval;
-           u16 *srcreg;
-
-           destoffset = decode_rm00_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_word(destoffset);
-           srcreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           destval = adc_word(destval, *srcreg);
-           store_data_word(destoffset, destval);
-       }
-       break;
-    case 1:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-           u32 *srcreg;
-
-           destoffset = decode_rm01_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_long(destoffset);
-           srcreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           destval = adc_long(destval, *srcreg);
-           store_data_long(destoffset, destval);
-       } else {
-           u16 destval;
-           u16 *srcreg;
-
-           destoffset = decode_rm01_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_word(destoffset);
-           srcreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           destval = adc_word(destval, *srcreg);
-           store_data_word(destoffset, destval);
-       }
-       break;
-    case 2:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-           u32 *srcreg;
-
-           destoffset = decode_rm10_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_long(destoffset);
-           srcreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           destval = adc_long(destval, *srcreg);
-           store_data_long(destoffset, destval);
-       } else {
-           u16 destval;
-           u16 *srcreg;
-
-           destoffset = decode_rm10_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_word(destoffset);
-           srcreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           destval = adc_word(destval, *srcreg);
-           store_data_word(destoffset, destval);
-       }
-       break;
-    case 3:                     /* register to register */
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg,*srcreg;
-
-           destreg = DECODE_RM_LONG_REGISTER(rl);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = adc_long(*destreg, *srcreg);
-       } else {
-           u16 *destreg,*srcreg;
-
-           destreg = DECODE_RM_WORD_REGISTER(rl);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = adc_word(*destreg, *srcreg);
-       }
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x12
-****************************************************************************/
-void x86emuOp_adc_byte_R_RM(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    u8 *destreg, *srcreg;
-    uint srcoffset;
-    u8 srcval;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("ADC\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       destreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm00_address(rl);
-       srcval = fetch_data_byte(srcoffset);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = adc_byte(*destreg, srcval);
-       break;
-    case 1:
-       destreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm01_address(rl);
-       srcval = fetch_data_byte(srcoffset);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = adc_byte(*destreg, srcval);
-       break;
-    case 2:
-       destreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm10_address(rl);
-       srcval = fetch_data_byte(srcoffset);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = adc_byte(*destreg, srcval);
-       break;
-    case 3:                     /* register to register */
-       destreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcreg = DECODE_RM_BYTE_REGISTER(rl);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = adc_byte(*destreg, *srcreg);
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x13
-****************************************************************************/
-void x86emuOp_adc_word_R_RM(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    uint srcoffset;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("ADC\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg;
-           u32 srcval;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm00_address(rl);
-           srcval = fetch_data_long(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = adc_long(*destreg, srcval);
-       } else {
-           u16 *destreg;
-           u16 srcval;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm00_address(rl);
-           srcval = fetch_data_word(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = adc_word(*destreg, srcval);
-       }
-       break;
-    case 1:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg;
-           u32 srcval;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm01_address(rl);
-           srcval = fetch_data_long(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = adc_long(*destreg, srcval);
-       } else {
-           u16 *destreg;
-           u16 srcval;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm01_address(rl);
-           srcval = fetch_data_word(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = adc_word(*destreg, srcval);
-       }
-       break;
-    case 2:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg;
-           u32 srcval;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm10_address(rl);
-           srcval = fetch_data_long(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = adc_long(*destreg, srcval);
-       } else {
-           u16 *destreg;
-           u16 srcval;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm10_address(rl);
-           srcval = fetch_data_word(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = adc_word(*destreg, srcval);
-       }
-       break;
-    case 3:                     /* register to register */
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg,*srcreg;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_LONG_REGISTER(rl);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = adc_long(*destreg, *srcreg);
-       } else {
-           u16 *destreg,*srcreg;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_WORD_REGISTER(rl);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = adc_word(*destreg, *srcreg);
-       }
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x14
-****************************************************************************/
-void x86emuOp_adc_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
-{
-    u8 srcval;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("ADC\tAL,");
-    srcval = fetch_byte_imm();
-    DECODE_PRINTF2("%x\n", srcval);
-    TRACE_AND_STEP();
-    M.x86.R_AL = adc_byte(M.x86.R_AL, srcval);
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x15
-****************************************************************************/
-void x86emuOp_adc_word_AX_IMM(u8 X86EMU_UNUSED(op1))
-{
-    u32 srcval;
-
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("ADC\tEAX,");
-       srcval = fetch_long_imm();
-    } else {
-       DECODE_PRINTF("ADC\tAX,");
-       srcval = fetch_word_imm();
-    }
-    DECODE_PRINTF2("%x\n", srcval);
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       M.x86.R_EAX = adc_long(M.x86.R_EAX, srcval);
-    } else {
-       M.x86.R_AX = adc_word(M.x86.R_AX, (u16)srcval);
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x16
-****************************************************************************/
-void x86emuOp_push_SS(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    DECODE_PRINTF("PUSH\tSS\n");
-    TRACE_AND_STEP();
-    push_word(M.x86.R_SS);
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x17
-****************************************************************************/
-void x86emuOp_pop_SS(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    DECODE_PRINTF("POP\tSS\n");
-    TRACE_AND_STEP();
-    M.x86.R_SS = pop_word();
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x18
-****************************************************************************/
-void x86emuOp_sbb_byte_RM_R(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    u8 *destreg, *srcreg;
-    uint destoffset;
-    u8 destval;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("SBB\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       destoffset = decode_rm00_address(rl);
-       DECODE_PRINTF(",");
-       destval = fetch_data_byte(destoffset);
-       srcreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       destval = sbb_byte(destval, *srcreg);
-       store_data_byte(destoffset, destval);
-       break;
-    case 1:
-       destoffset = decode_rm01_address(rl);
-       DECODE_PRINTF(",");
-       destval = fetch_data_byte(destoffset);
-       srcreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       destval = sbb_byte(destval, *srcreg);
-       store_data_byte(destoffset, destval);
-       break;
-    case 2:
-       destoffset = decode_rm10_address(rl);
-       DECODE_PRINTF(",");
-       destval = fetch_data_byte(destoffset);
-       srcreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       destval = sbb_byte(destval, *srcreg);
-       store_data_byte(destoffset, destval);
-       break;
-    case 3:                     /* register to register */
-       destreg = DECODE_RM_BYTE_REGISTER(rl);
-       DECODE_PRINTF(",");
-       srcreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = sbb_byte(*destreg, *srcreg);
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x19
-****************************************************************************/
-void x86emuOp_sbb_word_RM_R(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    uint destoffset;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("SBB\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-           u32 *srcreg;
-
-           destoffset = decode_rm00_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_long(destoffset);
-           srcreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           destval = sbb_long(destval, *srcreg);
-           store_data_long(destoffset, destval);
-       } else {
-           u16 destval;
-           u16 *srcreg;
-
-           destoffset = decode_rm00_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_word(destoffset);
-           srcreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           destval = sbb_word(destval, *srcreg);
-           store_data_word(destoffset, destval);
-       }
-       break;
-    case 1:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-           u32 *srcreg;
-
-           destoffset = decode_rm01_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_long(destoffset);
-           srcreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           destval = sbb_long(destval, *srcreg);
-           store_data_long(destoffset, destval);
-       } else {
-           u16 destval;
-           u16 *srcreg;
-
-           destoffset = decode_rm01_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_word(destoffset);
-           srcreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           destval = sbb_word(destval, *srcreg);
-           store_data_word(destoffset, destval);
-       }
-       break;
-    case 2:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-           u32 *srcreg;
-
-           destoffset = decode_rm10_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_long(destoffset);
-           srcreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           destval = sbb_long(destval, *srcreg);
-           store_data_long(destoffset, destval);
-       } else {
-           u16 destval;
-           u16 *srcreg;
-
-           destoffset = decode_rm10_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_word(destoffset);
-           srcreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           destval = sbb_word(destval, *srcreg);
-           store_data_word(destoffset, destval);
-       }
-       break;
-    case 3:                     /* register to register */
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg,*srcreg;
-
-           destreg = DECODE_RM_LONG_REGISTER(rl);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = sbb_long(*destreg, *srcreg);
-       } else {
-           u16 *destreg,*srcreg;
-
-           destreg = DECODE_RM_WORD_REGISTER(rl);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = sbb_word(*destreg, *srcreg);
-       }
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x1a
-****************************************************************************/
-void x86emuOp_sbb_byte_R_RM(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    u8 *destreg, *srcreg;
-    uint srcoffset;
-    u8 srcval;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("SBB\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       destreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm00_address(rl);
-       srcval = fetch_data_byte(srcoffset);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = sbb_byte(*destreg, srcval);
-       break;
-    case 1:
-       destreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm01_address(rl);
-       srcval = fetch_data_byte(srcoffset);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = sbb_byte(*destreg, srcval);
-       break;
-    case 2:
-       destreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm10_address(rl);
-       srcval = fetch_data_byte(srcoffset);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = sbb_byte(*destreg, srcval);
-       break;
-    case 3:                     /* register to register */
-       destreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcreg = DECODE_RM_BYTE_REGISTER(rl);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = sbb_byte(*destreg, *srcreg);
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x1b
-****************************************************************************/
-void x86emuOp_sbb_word_R_RM(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    uint srcoffset;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("SBB\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg;
-           u32 srcval;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm00_address(rl);
-           srcval = fetch_data_long(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = sbb_long(*destreg, srcval);
-       } else {
-           u16 *destreg;
-           u16 srcval;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm00_address(rl);
-           srcval = fetch_data_word(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = sbb_word(*destreg, srcval);
-       }
-       break;
-    case 1:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg;
-           u32 srcval;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm01_address(rl);
-           srcval = fetch_data_long(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = sbb_long(*destreg, srcval);
-       } else {
-           u16 *destreg;
-           u16 srcval;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm01_address(rl);
-           srcval = fetch_data_word(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = sbb_word(*destreg, srcval);
-       }
-       break;
-    case 2:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg;
-           u32 srcval;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm10_address(rl);
-           srcval = fetch_data_long(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = sbb_long(*destreg, srcval);
-       } else {
-           u16 *destreg;
-           u16 srcval;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm10_address(rl);
-           srcval = fetch_data_word(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = sbb_word(*destreg, srcval);
-       }
-       break;
-    case 3:                     /* register to register */
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg,*srcreg;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_LONG_REGISTER(rl);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = sbb_long(*destreg, *srcreg);
-       } else {
-           u16 *destreg,*srcreg;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_WORD_REGISTER(rl);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = sbb_word(*destreg, *srcreg);
-       }
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x1c
-****************************************************************************/
-void x86emuOp_sbb_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
-{
-    u8 srcval;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("SBB\tAL,");
-    srcval = fetch_byte_imm();
-    DECODE_PRINTF2("%x\n", srcval);
-    TRACE_AND_STEP();
-    M.x86.R_AL = sbb_byte(M.x86.R_AL, srcval);
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x1d
-****************************************************************************/
-void x86emuOp_sbb_word_AX_IMM(u8 X86EMU_UNUSED(op1))
-{
-    u32 srcval;
-
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("SBB\tEAX,");
-       srcval = fetch_long_imm();
-    } else {
-       DECODE_PRINTF("SBB\tAX,");
-       srcval = fetch_word_imm();
-    }
-    DECODE_PRINTF2("%x\n", srcval);
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       M.x86.R_EAX = sbb_long(M.x86.R_EAX, srcval);
-    } else {
-       M.x86.R_AX = sbb_word(M.x86.R_AX, (u16)srcval);
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x1e
-****************************************************************************/
-void x86emuOp_push_DS(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    DECODE_PRINTF("PUSH\tDS\n");
-    TRACE_AND_STEP();
-    push_word(M.x86.R_DS);
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x1f
-****************************************************************************/
-void x86emuOp_pop_DS(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    DECODE_PRINTF("POP\tDS\n");
-    TRACE_AND_STEP();
-    M.x86.R_DS = pop_word();
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x20
-****************************************************************************/
-void x86emuOp_and_byte_RM_R(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    u8 *destreg, *srcreg;
-    uint destoffset;
-    u8 destval;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("AND\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-
-    switch (mod) {
-    case 0:
-       destoffset = decode_rm00_address(rl);
-       DECODE_PRINTF(",");
-       destval = fetch_data_byte(destoffset);
-       srcreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       destval = and_byte(destval, *srcreg);
-       store_data_byte(destoffset, destval);
-       break;
-
-    case 1:
-       destoffset = decode_rm01_address(rl);
-       DECODE_PRINTF(",");
-       destval = fetch_data_byte(destoffset);
-       srcreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       destval = and_byte(destval, *srcreg);
-       store_data_byte(destoffset, destval);
-       break;
-
-    case 2:
-       destoffset = decode_rm10_address(rl);
-       DECODE_PRINTF(",");
-       destval = fetch_data_byte(destoffset);
-       srcreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       destval = and_byte(destval, *srcreg);
-       store_data_byte(destoffset, destval);
-       break;
-
-    case 3:                     /* register to register */
-       destreg = DECODE_RM_BYTE_REGISTER(rl);
-       DECODE_PRINTF(",");
-       srcreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = and_byte(*destreg, *srcreg);
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x21
-****************************************************************************/
-void x86emuOp_and_word_RM_R(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    uint destoffset;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("AND\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-           u32 *srcreg;
-
-           destoffset = decode_rm00_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_long(destoffset);
-           srcreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           destval = and_long(destval, *srcreg);
-           store_data_long(destoffset, destval);
-       } else {
-           u16 destval;
-           u16 *srcreg;
-
-           destoffset = decode_rm00_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_word(destoffset);
-           srcreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           destval = and_word(destval, *srcreg);
-           store_data_word(destoffset, destval);
-       }
-       break;
-    case 1:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-           u32 *srcreg;
-
-           destoffset = decode_rm01_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_long(destoffset);
-           srcreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           destval = and_long(destval, *srcreg);
-           store_data_long(destoffset, destval);
-       } else {
-           u16 destval;
-           u16 *srcreg;
-
-           destoffset = decode_rm01_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_word(destoffset);
-           srcreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           destval = and_word(destval, *srcreg);
-           store_data_word(destoffset, destval);
-       }
-       break;
-    case 2:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-           u32 *srcreg;
-
-           destoffset = decode_rm10_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_long(destoffset);
-           srcreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           destval = and_long(destval, *srcreg);
-           store_data_long(destoffset, destval);
-       } else {
-           u16 destval;
-           u16 *srcreg;
-
-           destoffset = decode_rm10_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_word(destoffset);
-           srcreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           destval = and_word(destval, *srcreg);
-           store_data_word(destoffset, destval);
-       }
-       break;
-    case 3:                     /* register to register */
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg,*srcreg;
-
-           destreg = DECODE_RM_LONG_REGISTER(rl);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = and_long(*destreg, *srcreg);
-       } else {
-           u16 *destreg,*srcreg;
-
-           destreg = DECODE_RM_WORD_REGISTER(rl);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = and_word(*destreg, *srcreg);
-       }
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x22
-****************************************************************************/
-void x86emuOp_and_byte_R_RM(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    u8 *destreg, *srcreg;
-    uint srcoffset;
-    u8 srcval;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("AND\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       destreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm00_address(rl);
-       srcval = fetch_data_byte(srcoffset);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = and_byte(*destreg, srcval);
-       break;
-    case 1:
-       destreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm01_address(rl);
-       srcval = fetch_data_byte(srcoffset);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = and_byte(*destreg, srcval);
-       break;
-    case 2:
-       destreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm10_address(rl);
-       srcval = fetch_data_byte(srcoffset);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = and_byte(*destreg, srcval);
-       break;
-    case 3:                     /* register to register */
-       destreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcreg = DECODE_RM_BYTE_REGISTER(rl);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = and_byte(*destreg, *srcreg);
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x23
-****************************************************************************/
-void x86emuOp_and_word_R_RM(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    uint srcoffset;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("AND\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg;
-           u32 srcval;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm00_address(rl);
-           srcval = fetch_data_long(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = and_long(*destreg, srcval);
-       } else {
-           u16 *destreg;
-           u16 srcval;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm00_address(rl);
-           srcval = fetch_data_word(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = and_word(*destreg, srcval);
-       }
-       break;
-    case 1:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg;
-           u32 srcval;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm01_address(rl);
-           srcval = fetch_data_long(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = and_long(*destreg, srcval);
-           break;
-       } else {
-           u16 *destreg;
-           u16 srcval;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm01_address(rl);
-           srcval = fetch_data_word(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = and_word(*destreg, srcval);
-           break;
-       }
-    case 2:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg;
-           u32 srcval;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm10_address(rl);
-           srcval = fetch_data_long(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = and_long(*destreg, srcval);
-       } else {
-           u16 *destreg;
-           u16 srcval;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm10_address(rl);
-           srcval = fetch_data_word(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = and_word(*destreg, srcval);
-       }
-       break;
-    case 3:                     /* register to register */
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg,*srcreg;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_LONG_REGISTER(rl);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = and_long(*destreg, *srcreg);
-       } else {
-           u16 *destreg,*srcreg;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_WORD_REGISTER(rl);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = and_word(*destreg, *srcreg);
-       }
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x24
-****************************************************************************/
-void x86emuOp_and_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
-{
-    u8 srcval;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("AND\tAL,");
-    srcval = fetch_byte_imm();
-    DECODE_PRINTF2("%x\n", srcval);
-    TRACE_AND_STEP();
-    M.x86.R_AL = and_byte(M.x86.R_AL, srcval);
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x25
-****************************************************************************/
-void x86emuOp_and_word_AX_IMM(u8 X86EMU_UNUSED(op1))
-{
-    u32 srcval;
-
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("AND\tEAX,");
-       srcval = fetch_long_imm();
-    } else {
-       DECODE_PRINTF("AND\tAX,");
-       srcval = fetch_word_imm();
-    }
-    DECODE_PRINTF2("%x\n", srcval);
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       M.x86.R_EAX = and_long(M.x86.R_EAX, srcval);
-    } else {
-       M.x86.R_AX = and_word(M.x86.R_AX, (u16)srcval);
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x26
-****************************************************************************/
-void x86emuOp_segovr_ES(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    DECODE_PRINTF("ES:\n");
-    TRACE_AND_STEP();
-    M.x86.mode |= SYSMODE_SEGOVR_ES;
-    /*
-     * note the lack of DECODE_CLEAR_SEGOVR(r) since, here is one of 4
-     * opcode subroutines we do not want to do this.
-     */
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x27
-****************************************************************************/
-void x86emuOp_daa(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    DECODE_PRINTF("DAA\n");
-    TRACE_AND_STEP();
-    M.x86.R_AL = daa_byte(M.x86.R_AL);
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x28
-****************************************************************************/
-void x86emuOp_sub_byte_RM_R(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    u8 *destreg, *srcreg;
-    uint destoffset;
-    u8 destval;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("SUB\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       destoffset = decode_rm00_address(rl);
-       DECODE_PRINTF(",");
-       destval = fetch_data_byte(destoffset);
-       srcreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       destval = sub_byte(destval, *srcreg);
-       store_data_byte(destoffset, destval);
-       break;
-    case 1:
-       destoffset = decode_rm01_address(rl);
-       DECODE_PRINTF(",");
-       destval = fetch_data_byte(destoffset);
-       srcreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       destval = sub_byte(destval, *srcreg);
-       store_data_byte(destoffset, destval);
-       break;
-    case 2:
-       destoffset = decode_rm10_address(rl);
-       DECODE_PRINTF(",");
-       destval = fetch_data_byte(destoffset);
-       srcreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       destval = sub_byte(destval, *srcreg);
-       store_data_byte(destoffset, destval);
-       break;
-    case 3:                     /* register to register */
-       destreg = DECODE_RM_BYTE_REGISTER(rl);
-       DECODE_PRINTF(",");
-       srcreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = sub_byte(*destreg, *srcreg);
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x29
-****************************************************************************/
-void x86emuOp_sub_word_RM_R(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    uint destoffset;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("SUB\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-           u32 *srcreg;
-
-           destoffset = decode_rm00_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_long(destoffset);
-           srcreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           destval = sub_long(destval, *srcreg);
-           store_data_long(destoffset, destval);
-       } else {
-           u16 destval;
-           u16 *srcreg;
-
-           destoffset = decode_rm00_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_word(destoffset);
-           srcreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           destval = sub_word(destval, *srcreg);
-           store_data_word(destoffset, destval);
-       }
-       break;
-    case 1:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-           u32 *srcreg;
-
-           destoffset = decode_rm01_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_long(destoffset);
-           srcreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           destval = sub_long(destval, *srcreg);
-           store_data_long(destoffset, destval);
-       } else {
-           u16 destval;
-           u16 *srcreg;
-
-           destoffset = decode_rm01_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_word(destoffset);
-           srcreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           destval = sub_word(destval, *srcreg);
-           store_data_word(destoffset, destval);
-       }
-       break;
-    case 2:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-           u32 *srcreg;
-
-           destoffset = decode_rm10_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_long(destoffset);
-           srcreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           destval = sub_long(destval, *srcreg);
-           store_data_long(destoffset, destval);
-       } else {
-           u16 destval;
-           u16 *srcreg;
-
-           destoffset = decode_rm10_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_word(destoffset);
-           srcreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           destval = sub_word(destval, *srcreg);
-           store_data_word(destoffset, destval);
-       }
-       break;
-    case 3:                     /* register to register */
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg,*srcreg;
-
-           destreg = DECODE_RM_LONG_REGISTER(rl);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = sub_long(*destreg, *srcreg);
-       } else {
-           u16 *destreg,*srcreg;
-
-           destreg = DECODE_RM_WORD_REGISTER(rl);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = sub_word(*destreg, *srcreg);
-       }
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x2a
-****************************************************************************/
-void x86emuOp_sub_byte_R_RM(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    u8 *destreg, *srcreg;
-    uint srcoffset;
-    u8 srcval;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("SUB\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       destreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm00_address(rl);
-       srcval = fetch_data_byte(srcoffset);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = sub_byte(*destreg, srcval);
-       break;
-    case 1:
-       destreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm01_address(rl);
-       srcval = fetch_data_byte(srcoffset);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = sub_byte(*destreg, srcval);
-       break;
-    case 2:
-       destreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm10_address(rl);
-       srcval = fetch_data_byte(srcoffset);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = sub_byte(*destreg, srcval);
-       break;
-    case 3:                     /* register to register */
-       destreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcreg = DECODE_RM_BYTE_REGISTER(rl);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = sub_byte(*destreg, *srcreg);
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x2b
-****************************************************************************/
-void x86emuOp_sub_word_R_RM(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    uint srcoffset;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("SUB\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg;
-           u32 srcval;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm00_address(rl);
-           srcval = fetch_data_long(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = sub_long(*destreg, srcval);
-       } else {
-           u16 *destreg;
-           u16 srcval;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm00_address(rl);
-           srcval = fetch_data_word(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = sub_word(*destreg, srcval);
-       }
-       break;
-    case 1:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg;
-           u32 srcval;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm01_address(rl);
-           srcval = fetch_data_long(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = sub_long(*destreg, srcval);
-       } else {
-           u16 *destreg;
-           u16 srcval;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm01_address(rl);
-           srcval = fetch_data_word(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = sub_word(*destreg, srcval);
-       }
-       break;
-    case 2:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg;
-           u32 srcval;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm10_address(rl);
-           srcval = fetch_data_long(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = sub_long(*destreg, srcval);
-       } else {
-           u16 *destreg;
-           u16 srcval;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm10_address(rl);
-           srcval = fetch_data_word(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = sub_word(*destreg, srcval);
-       }
-       break;
-    case 3:                     /* register to register */
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg,*srcreg;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_LONG_REGISTER(rl);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = sub_long(*destreg, *srcreg);
-       } else {
-           u16 *destreg,*srcreg;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_WORD_REGISTER(rl);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = sub_word(*destreg, *srcreg);
-       }
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x2c
-****************************************************************************/
-void x86emuOp_sub_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
-{
-    u8 srcval;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("SUB\tAL,");
-    srcval = fetch_byte_imm();
-    DECODE_PRINTF2("%x\n", srcval);
-    TRACE_AND_STEP();
-    M.x86.R_AL = sub_byte(M.x86.R_AL, srcval);
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x2d
-****************************************************************************/
-void x86emuOp_sub_word_AX_IMM(u8 X86EMU_UNUSED(op1))
-{
-    u32 srcval;
-
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("SUB\tEAX,");
-       srcval = fetch_long_imm();
-    } else {
-       DECODE_PRINTF("SUB\tAX,");
-       srcval = fetch_word_imm();
-    }
-    DECODE_PRINTF2("%x\n", srcval);
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       M.x86.R_EAX = sub_long(M.x86.R_EAX, srcval);
-    } else {
-       M.x86.R_AX = sub_word(M.x86.R_AX, (u16)srcval);
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x2e
-****************************************************************************/
-void x86emuOp_segovr_CS(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    DECODE_PRINTF("CS:\n");
-    TRACE_AND_STEP();
-    M.x86.mode |= SYSMODE_SEGOVR_CS;
-    /* note no DECODE_CLEAR_SEGOVR here. */
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x2f
-****************************************************************************/
-void x86emuOp_das(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    DECODE_PRINTF("DAS\n");
-    TRACE_AND_STEP();
-    M.x86.R_AL = das_byte(M.x86.R_AL);
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x30
-****************************************************************************/
-void x86emuOp_xor_byte_RM_R(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    u8 *destreg, *srcreg;
-    uint destoffset;
-    u8 destval;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("XOR\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       destoffset = decode_rm00_address(rl);
-       DECODE_PRINTF(",");
-       destval = fetch_data_byte(destoffset);
-       srcreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       destval = xor_byte(destval, *srcreg);
-       store_data_byte(destoffset, destval);
-       break;
-    case 1:
-       destoffset = decode_rm01_address(rl);
-       DECODE_PRINTF(",");
-       destval = fetch_data_byte(destoffset);
-       srcreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       destval = xor_byte(destval, *srcreg);
-       store_data_byte(destoffset, destval);
-       break;
-    case 2:
-       destoffset = decode_rm10_address(rl);
-       DECODE_PRINTF(",");
-       destval = fetch_data_byte(destoffset);
-       srcreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       destval = xor_byte(destval, *srcreg);
-       store_data_byte(destoffset, destval);
-       break;
-    case 3:                     /* register to register */
-       destreg = DECODE_RM_BYTE_REGISTER(rl);
-       DECODE_PRINTF(",");
-       srcreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = xor_byte(*destreg, *srcreg);
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x31
-****************************************************************************/
-void x86emuOp_xor_word_RM_R(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    uint destoffset;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("XOR\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-           u32 *srcreg;
-
-           destoffset = decode_rm00_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_long(destoffset);
-           srcreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           destval = xor_long(destval, *srcreg);
-           store_data_long(destoffset, destval);
-       } else {
-           u16 destval;
-           u16 *srcreg;
-
-           destoffset = decode_rm00_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_word(destoffset);
-           srcreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           destval = xor_word(destval, *srcreg);
-           store_data_word(destoffset, destval);
-       }
-       break;
-    case 1:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-           u32 *srcreg;
-
-           destoffset = decode_rm01_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_long(destoffset);
-           srcreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           destval = xor_long(destval, *srcreg);
-           store_data_long(destoffset, destval);
-       } else {
-           u16 destval;
-           u16 *srcreg;
-
-           destoffset = decode_rm01_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_word(destoffset);
-           srcreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           destval = xor_word(destval, *srcreg);
-           store_data_word(destoffset, destval);
-       }
-       break;
-    case 2:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-           u32 *srcreg;
-
-           destoffset = decode_rm10_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_long(destoffset);
-           srcreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           destval = xor_long(destval, *srcreg);
-           store_data_long(destoffset, destval);
-       } else {
-           u16 destval;
-           u16 *srcreg;
-
-           destoffset = decode_rm10_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_word(destoffset);
-           srcreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           destval = xor_word(destval, *srcreg);
-           store_data_word(destoffset, destval);
-       }
-       break;
-    case 3:                     /* register to register */
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg,*srcreg;
-
-           destreg = DECODE_RM_LONG_REGISTER(rl);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = xor_long(*destreg, *srcreg);
-       } else {
-           u16 *destreg,*srcreg;
-
-           destreg = DECODE_RM_WORD_REGISTER(rl);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = xor_word(*destreg, *srcreg);
-       }
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x32
-****************************************************************************/
-void x86emuOp_xor_byte_R_RM(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    u8 *destreg, *srcreg;
-    uint srcoffset;
-    u8 srcval;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("XOR\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       destreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm00_address(rl);
-       srcval = fetch_data_byte(srcoffset);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = xor_byte(*destreg, srcval);
-       break;
-    case 1:
-       destreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm01_address(rl);
-       srcval = fetch_data_byte(srcoffset);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = xor_byte(*destreg, srcval);
-       break;
-    case 2:
-       destreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm10_address(rl);
-       srcval = fetch_data_byte(srcoffset);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = xor_byte(*destreg, srcval);
-       break;
-    case 3:                     /* register to register */
-       destreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcreg = DECODE_RM_BYTE_REGISTER(rl);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = xor_byte(*destreg, *srcreg);
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x33
-****************************************************************************/
-void x86emuOp_xor_word_R_RM(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    uint srcoffset;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("XOR\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg;
-           u32 srcval;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm00_address(rl);
-           srcval = fetch_data_long(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = xor_long(*destreg, srcval);
-       } else {
-           u16 *destreg;
-           u16 srcval;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm00_address(rl);
-           srcval = fetch_data_word(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = xor_word(*destreg, srcval);
-       }
-       break;
-    case 1:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg;
-           u32 srcval;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm01_address(rl);
-           srcval = fetch_data_long(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = xor_long(*destreg, srcval);
-       } else {
-           u16 *destreg;
-           u16 srcval;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm01_address(rl);
-           srcval = fetch_data_word(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = xor_word(*destreg, srcval);
-       }
-       break;
-    case 2:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg;
-           u32 srcval;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm10_address(rl);
-           srcval = fetch_data_long(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = xor_long(*destreg, srcval);
-       } else {
-           u16 *destreg;
-           u16 srcval;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm10_address(rl);
-           srcval = fetch_data_word(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = xor_word(*destreg, srcval);
-       }
-       break;
-    case 3:                     /* register to register */
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg,*srcreg;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_LONG_REGISTER(rl);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = xor_long(*destreg, *srcreg);
-       } else {
-           u16 *destreg,*srcreg;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_WORD_REGISTER(rl);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = xor_word(*destreg, *srcreg);
-       }
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x34
-****************************************************************************/
-void x86emuOp_xor_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
-{
-    u8 srcval;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("XOR\tAL,");
-    srcval = fetch_byte_imm();
-    DECODE_PRINTF2("%x\n", srcval);
-    TRACE_AND_STEP();
-    M.x86.R_AL = xor_byte(M.x86.R_AL, srcval);
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x35
-****************************************************************************/
-void x86emuOp_xor_word_AX_IMM(u8 X86EMU_UNUSED(op1))
-{
-    u32 srcval;
-
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("XOR\tEAX,");
-       srcval = fetch_long_imm();
-    } else {
-       DECODE_PRINTF("XOR\tAX,");
-       srcval = fetch_word_imm();
-    }
-    DECODE_PRINTF2("%x\n", srcval);
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       M.x86.R_EAX = xor_long(M.x86.R_EAX, srcval);
-    } else {
-       M.x86.R_AX = xor_word(M.x86.R_AX, (u16)srcval);
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x36
-****************************************************************************/
-void x86emuOp_segovr_SS(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    DECODE_PRINTF("SS:\n");
-    TRACE_AND_STEP();
-    M.x86.mode |= SYSMODE_SEGOVR_SS;
-    /* no DECODE_CLEAR_SEGOVR ! */
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x37
-****************************************************************************/
-void x86emuOp_aaa(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    DECODE_PRINTF("AAA\n");
-    TRACE_AND_STEP();
-    M.x86.R_AX = aaa_word(M.x86.R_AX);
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x38
-****************************************************************************/
-void x86emuOp_cmp_byte_RM_R(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    uint destoffset;
-    u8 *destreg, *srcreg;
-    u8 destval;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("CMP\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       destoffset = decode_rm00_address(rl);
-       DECODE_PRINTF(",");
-       destval = fetch_data_byte(destoffset);
-       srcreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       cmp_byte(destval, *srcreg);
-       break;
-    case 1:
-       destoffset = decode_rm01_address(rl);
-       DECODE_PRINTF(",");
-       destval = fetch_data_byte(destoffset);
-       srcreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       cmp_byte(destval, *srcreg);
-       break;
-    case 2:
-       destoffset = decode_rm10_address(rl);
-       DECODE_PRINTF(",");
-       destval = fetch_data_byte(destoffset);
-       srcreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       cmp_byte(destval, *srcreg);
-       break;
-    case 3:                     /* register to register */
-       destreg = DECODE_RM_BYTE_REGISTER(rl);
-       DECODE_PRINTF(",");
-       srcreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       cmp_byte(*destreg, *srcreg);
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x39
-****************************************************************************/
-void x86emuOp_cmp_word_RM_R(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    uint destoffset;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("CMP\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-           u32 *srcreg;
-
-           destoffset = decode_rm00_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_long(destoffset);
-           srcreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           cmp_long(destval, *srcreg);
-       } else {
-           u16 destval;
-           u16 *srcreg;
-
-           destoffset = decode_rm00_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_word(destoffset);
-           srcreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           cmp_word(destval, *srcreg);
-       }
-       break;
-    case 1:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-           u32 *srcreg;
-
-           destoffset = decode_rm01_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_long(destoffset);
-           srcreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           cmp_long(destval, *srcreg);
-       } else {
-           u16 destval;
-           u16 *srcreg;
-
-           destoffset = decode_rm01_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_word(destoffset);
-           srcreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           cmp_word(destval, *srcreg);
-       }
-       break;
-    case 2:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-           u32 *srcreg;
-
-           destoffset = decode_rm10_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_long(destoffset);
-           srcreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           cmp_long(destval, *srcreg);
-       } else {
-           u16 destval;
-           u16 *srcreg;
-
-           destoffset = decode_rm10_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_word(destoffset);
-           srcreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           cmp_word(destval, *srcreg);
-       }
-       break;
-    case 3:                     /* register to register */
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg,*srcreg;
-
-           destreg = DECODE_RM_LONG_REGISTER(rl);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           cmp_long(*destreg, *srcreg);
-       } else {
-           u16 *destreg,*srcreg;
-
-           destreg = DECODE_RM_WORD_REGISTER(rl);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           cmp_word(*destreg, *srcreg);
-       }
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x3a
-****************************************************************************/
-void x86emuOp_cmp_byte_R_RM(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    u8 *destreg, *srcreg;
-    uint srcoffset;
-    u8 srcval;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("CMP\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       destreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm00_address(rl);
-       srcval = fetch_data_byte(srcoffset);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       cmp_byte(*destreg, srcval);
-       break;
-    case 1:
-       destreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm01_address(rl);
-       srcval = fetch_data_byte(srcoffset);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       cmp_byte(*destreg, srcval);
-       break;
-    case 2:
-       destreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm10_address(rl);
-       srcval = fetch_data_byte(srcoffset);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       cmp_byte(*destreg, srcval);
-       break;
-    case 3:                     /* register to register */
-       destreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcreg = DECODE_RM_BYTE_REGISTER(rl);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       cmp_byte(*destreg, *srcreg);
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x3b
-****************************************************************************/
-void x86emuOp_cmp_word_R_RM(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    uint srcoffset;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("CMP\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg;
-           u32 srcval;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm00_address(rl);
-           srcval = fetch_data_long(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           cmp_long(*destreg, srcval);
-       } else {
-           u16 *destreg;
-           u16 srcval;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm00_address(rl);
-           srcval = fetch_data_word(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           cmp_word(*destreg, srcval);
-       }
-       break;
-    case 1:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg;
-           u32 srcval;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm01_address(rl);
-           srcval = fetch_data_long(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           cmp_long(*destreg, srcval);
-       } else {
-           u16 *destreg;
-           u16 srcval;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm01_address(rl);
-           srcval = fetch_data_word(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           cmp_word(*destreg, srcval);
-       }
-       break;
-    case 2:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg;
-           u32 srcval;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm10_address(rl);
-           srcval = fetch_data_long(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           cmp_long(*destreg, srcval);
-       } else {
-           u16 *destreg;
-           u16 srcval;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm10_address(rl);
-           srcval = fetch_data_word(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           cmp_word(*destreg, srcval);
-       }
-       break;
-    case 3:                     /* register to register */
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg,*srcreg;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_LONG_REGISTER(rl);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           cmp_long(*destreg, *srcreg);
-       } else {
-           u16 *destreg,*srcreg;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_WORD_REGISTER(rl);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           cmp_word(*destreg, *srcreg);
-       }
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x3c
-****************************************************************************/
-void x86emuOp_cmp_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
-{
-    u8 srcval;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("CMP\tAL,");
-    srcval = fetch_byte_imm();
-    DECODE_PRINTF2("%x\n", srcval);
-    TRACE_AND_STEP();
-    cmp_byte(M.x86.R_AL, srcval);
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x3d
-****************************************************************************/
-void x86emuOp_cmp_word_AX_IMM(u8 X86EMU_UNUSED(op1))
-{
-    u32 srcval;
-
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("CMP\tEAX,");
-       srcval = fetch_long_imm();
-    } else {
-       DECODE_PRINTF("CMP\tAX,");
-       srcval = fetch_word_imm();
-    }
-    DECODE_PRINTF2("%x\n", srcval);
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       cmp_long(M.x86.R_EAX, srcval);
-    } else {
-       cmp_word(M.x86.R_AX, (u16)srcval);
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x3e
-****************************************************************************/
-void x86emuOp_segovr_DS(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    DECODE_PRINTF("DS:\n");
-    TRACE_AND_STEP();
-    M.x86.mode |= SYSMODE_SEGOVR_DS;
-    /* NO DECODE_CLEAR_SEGOVR! */
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x3f
-****************************************************************************/
-void x86emuOp_aas(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    DECODE_PRINTF("AAS\n");
-    TRACE_AND_STEP();
-    M.x86.R_AX = aas_word(M.x86.R_AX);
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x40
-****************************************************************************/
-void x86emuOp_inc_AX(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("INC\tEAX\n");
-    } else {
-       DECODE_PRINTF("INC\tAX\n");
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       M.x86.R_EAX = inc_long(M.x86.R_EAX);
-    } else {
-       M.x86.R_AX = inc_word(M.x86.R_AX);
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x41
-****************************************************************************/
-void x86emuOp_inc_CX(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("INC\tECX\n");
-    } else {
-       DECODE_PRINTF("INC\tCX\n");
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       M.x86.R_ECX = inc_long(M.x86.R_ECX);
-    } else {
-       M.x86.R_CX = inc_word(M.x86.R_CX);
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x42
-****************************************************************************/
-void x86emuOp_inc_DX(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("INC\tEDX\n");
-    } else {
-       DECODE_PRINTF("INC\tDX\n");
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       M.x86.R_EDX = inc_long(M.x86.R_EDX);
-    } else {
-       M.x86.R_DX = inc_word(M.x86.R_DX);
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x43
-****************************************************************************/
-void x86emuOp_inc_BX(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("INC\tEBX\n");
-    } else {
-       DECODE_PRINTF("INC\tBX\n");
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       M.x86.R_EBX = inc_long(M.x86.R_EBX);
-    } else {
-       M.x86.R_BX = inc_word(M.x86.R_BX);
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x44
-****************************************************************************/
-void x86emuOp_inc_SP(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("INC\tESP\n");
-    } else {
-       DECODE_PRINTF("INC\tSP\n");
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       M.x86.R_ESP = inc_long(M.x86.R_ESP);
-    } else {
-       M.x86.R_SP = inc_word(M.x86.R_SP);
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x45
-****************************************************************************/
-void x86emuOp_inc_BP(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("INC\tEBP\n");
-    } else {
-       DECODE_PRINTF("INC\tBP\n");
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       M.x86.R_EBP = inc_long(M.x86.R_EBP);
-    } else {
-       M.x86.R_BP = inc_word(M.x86.R_BP);
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x46
-****************************************************************************/
-void x86emuOp_inc_SI(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("INC\tESI\n");
-    } else {
-       DECODE_PRINTF("INC\tSI\n");
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       M.x86.R_ESI = inc_long(M.x86.R_ESI);
-    } else {
-       M.x86.R_SI = inc_word(M.x86.R_SI);
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x47
-****************************************************************************/
-void x86emuOp_inc_DI(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("INC\tEDI\n");
-    } else {
-       DECODE_PRINTF("INC\tDI\n");
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       M.x86.R_EDI = inc_long(M.x86.R_EDI);
-    } else {
-       M.x86.R_DI = inc_word(M.x86.R_DI);
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x48
-****************************************************************************/
-void x86emuOp_dec_AX(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("DEC\tEAX\n");
-    } else {
-       DECODE_PRINTF("DEC\tAX\n");
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       M.x86.R_EAX = dec_long(M.x86.R_EAX);
-    } else {
-       M.x86.R_AX = dec_word(M.x86.R_AX);
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x49
-****************************************************************************/
-void x86emuOp_dec_CX(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("DEC\tECX\n");
-    } else {
-       DECODE_PRINTF("DEC\tCX\n");
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       M.x86.R_ECX = dec_long(M.x86.R_ECX);
-    } else {
-       M.x86.R_CX = dec_word(M.x86.R_CX);
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x4a
-****************************************************************************/
-void x86emuOp_dec_DX(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("DEC\tEDX\n");
-    } else {
-       DECODE_PRINTF("DEC\tDX\n");
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       M.x86.R_EDX = dec_long(M.x86.R_EDX);
-    } else {
-       M.x86.R_DX = dec_word(M.x86.R_DX);
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x4b
-****************************************************************************/
-void x86emuOp_dec_BX(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("DEC\tEBX\n");
-    } else {
-       DECODE_PRINTF("DEC\tBX\n");
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       M.x86.R_EBX = dec_long(M.x86.R_EBX);
-    } else {
-       M.x86.R_BX = dec_word(M.x86.R_BX);
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x4c
-****************************************************************************/
-void x86emuOp_dec_SP(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("DEC\tESP\n");
-    } else {
-       DECODE_PRINTF("DEC\tSP\n");
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       M.x86.R_ESP = dec_long(M.x86.R_ESP);
-    } else {
-       M.x86.R_SP = dec_word(M.x86.R_SP);
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x4d
-****************************************************************************/
-void x86emuOp_dec_BP(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("DEC\tEBP\n");
-    } else {
-       DECODE_PRINTF("DEC\tBP\n");
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       M.x86.R_EBP = dec_long(M.x86.R_EBP);
-    } else {
-       M.x86.R_BP = dec_word(M.x86.R_BP);
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x4e
-****************************************************************************/
-void x86emuOp_dec_SI(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("DEC\tESI\n");
-    } else {
-       DECODE_PRINTF("DEC\tSI\n");
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       M.x86.R_ESI = dec_long(M.x86.R_ESI);
-    } else {
-       M.x86.R_SI = dec_word(M.x86.R_SI);
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x4f
-****************************************************************************/
-void x86emuOp_dec_DI(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("DEC\tEDI\n");
-    } else {
-       DECODE_PRINTF("DEC\tDI\n");
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       M.x86.R_EDI = dec_long(M.x86.R_EDI);
-    } else {
-       M.x86.R_DI = dec_word(M.x86.R_DI);
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x50
-****************************************************************************/
-void x86emuOp_push_AX(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("PUSH\tEAX\n");
-    } else {
-       DECODE_PRINTF("PUSH\tAX\n");
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       push_long(M.x86.R_EAX);
-    } else {
-       push_word(M.x86.R_AX);
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x51
-****************************************************************************/
-void x86emuOp_push_CX(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("PUSH\tECX\n");
-    } else {
-       DECODE_PRINTF("PUSH\tCX\n");
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       push_long(M.x86.R_ECX);
-    } else {
-       push_word(M.x86.R_CX);
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x52
-****************************************************************************/
-void x86emuOp_push_DX(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("PUSH\tEDX\n");
-    } else {
-       DECODE_PRINTF("PUSH\tDX\n");
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       push_long(M.x86.R_EDX);
-    } else {
-       push_word(M.x86.R_DX);
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x53
-****************************************************************************/
-void x86emuOp_push_BX(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("PUSH\tEBX\n");
-    } else {
-       DECODE_PRINTF("PUSH\tBX\n");
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       push_long(M.x86.R_EBX);
-    } else {
-       push_word(M.x86.R_BX);
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x54
-****************************************************************************/
-void x86emuOp_push_SP(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("PUSH\tESP\n");
-    } else {
-       DECODE_PRINTF("PUSH\tSP\n");
-    }
-    TRACE_AND_STEP();
-       /* Always push (E)SP, since we are emulating an i386 and above
-        * processor. This is necessary as some BIOS'es use this to check
-        * what type of processor is in the system.
-        */
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-               push_long(M.x86.R_ESP);
-       } else {
-               push_word((u16)(M.x86.R_SP));
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x55
-****************************************************************************/
-void x86emuOp_push_BP(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("PUSH\tEBP\n");
-    } else {
-       DECODE_PRINTF("PUSH\tBP\n");
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       push_long(M.x86.R_EBP);
-    } else {
-       push_word(M.x86.R_BP);
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x56
-****************************************************************************/
-void x86emuOp_push_SI(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("PUSH\tESI\n");
-    } else {
-       DECODE_PRINTF("PUSH\tSI\n");
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       push_long(M.x86.R_ESI);
-    } else {
-       push_word(M.x86.R_SI);
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x57
-****************************************************************************/
-void x86emuOp_push_DI(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("PUSH\tEDI\n");
-    } else {
-       DECODE_PRINTF("PUSH\tDI\n");
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       push_long(M.x86.R_EDI);
-    } else {
-       push_word(M.x86.R_DI);
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x58
-****************************************************************************/
-void x86emuOp_pop_AX(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("POP\tEAX\n");
-    } else {
-       DECODE_PRINTF("POP\tAX\n");
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       M.x86.R_EAX = pop_long();
-    } else {
-       M.x86.R_AX = pop_word();
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x59
-****************************************************************************/
-void x86emuOp_pop_CX(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("POP\tECX\n");
-    } else {
-       DECODE_PRINTF("POP\tCX\n");
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       M.x86.R_ECX = pop_long();
-    } else {
-       M.x86.R_CX = pop_word();
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x5a
-****************************************************************************/
-void x86emuOp_pop_DX(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("POP\tEDX\n");
-    } else {
-       DECODE_PRINTF("POP\tDX\n");
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       M.x86.R_EDX = pop_long();
-    } else {
-       M.x86.R_DX = pop_word();
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x5b
-****************************************************************************/
-void x86emuOp_pop_BX(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("POP\tEBX\n");
-    } else {
-       DECODE_PRINTF("POP\tBX\n");
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       M.x86.R_EBX = pop_long();
-    } else {
-       M.x86.R_BX = pop_word();
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x5c
-****************************************************************************/
-void x86emuOp_pop_SP(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("POP\tESP\n");
-    } else {
-       DECODE_PRINTF("POP\tSP\n");
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       M.x86.R_ESP = pop_long();
-    } else {
-       M.x86.R_SP = pop_word();
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x5d
-****************************************************************************/
-void x86emuOp_pop_BP(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("POP\tEBP\n");
-    } else {
-       DECODE_PRINTF("POP\tBP\n");
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       M.x86.R_EBP = pop_long();
-    } else {
-       M.x86.R_BP = pop_word();
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x5e
-****************************************************************************/
-void x86emuOp_pop_SI(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("POP\tESI\n");
-    } else {
-       DECODE_PRINTF("POP\tSI\n");
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       M.x86.R_ESI = pop_long();
-    } else {
-       M.x86.R_SI = pop_word();
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x5f
-****************************************************************************/
-void x86emuOp_pop_DI(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("POP\tEDI\n");
-    } else {
-       DECODE_PRINTF("POP\tDI\n");
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       M.x86.R_EDI = pop_long();
-    } else {
-       M.x86.R_DI = pop_word();
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x60
-****************************************************************************/
-void x86emuOp_push_all(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("PUSHAD\n");
-    } else {
-       DECODE_PRINTF("PUSHA\n");
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       u32 old_sp = M.x86.R_ESP;
-
-       push_long(M.x86.R_EAX);
-       push_long(M.x86.R_ECX);
-       push_long(M.x86.R_EDX);
-       push_long(M.x86.R_EBX);
-       push_long(old_sp);
-       push_long(M.x86.R_EBP);
-       push_long(M.x86.R_ESI);
-       push_long(M.x86.R_EDI);
-    } else {
-       u16 old_sp = M.x86.R_SP;
-
-       push_word(M.x86.R_AX);
-       push_word(M.x86.R_CX);
-       push_word(M.x86.R_DX);
-       push_word(M.x86.R_BX);
-       push_word(old_sp);
-       push_word(M.x86.R_BP);
-       push_word(M.x86.R_SI);
-       push_word(M.x86.R_DI);
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x61
-****************************************************************************/
-void x86emuOp_pop_all(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("POPAD\n");
-    } else {
-       DECODE_PRINTF("POPA\n");
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       M.x86.R_EDI = pop_long();
-       M.x86.R_ESI = pop_long();
-       M.x86.R_EBP = pop_long();
-       M.x86.R_ESP += 4;              /* skip ESP */
-       M.x86.R_EBX = pop_long();
-       M.x86.R_EDX = pop_long();
-       M.x86.R_ECX = pop_long();
-       M.x86.R_EAX = pop_long();
-    } else {
-       M.x86.R_DI = pop_word();
-       M.x86.R_SI = pop_word();
-       M.x86.R_BP = pop_word();
-       M.x86.R_SP += 2;               /* skip SP */
-       M.x86.R_BX = pop_word();
-       M.x86.R_DX = pop_word();
-       M.x86.R_CX = pop_word();
-       M.x86.R_AX = pop_word();
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/*opcode 0x62   ILLEGAL OP, calls x86emuOp_illegal_op() */
-/*opcode 0x63   ILLEGAL OP, calls x86emuOp_illegal_op() */
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x64
-****************************************************************************/
-void x86emuOp_segovr_FS(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    DECODE_PRINTF("FS:\n");
-    TRACE_AND_STEP();
-    M.x86.mode |= SYSMODE_SEGOVR_FS;
-    /*
-     * note the lack of DECODE_CLEAR_SEGOVR(r) since, here is one of 4
-     * opcode subroutines we do not want to do this.
-     */
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x65
-****************************************************************************/
-void x86emuOp_segovr_GS(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    DECODE_PRINTF("GS:\n");
-    TRACE_AND_STEP();
-    M.x86.mode |= SYSMODE_SEGOVR_GS;
-    /*
-     * note the lack of DECODE_CLEAR_SEGOVR(r) since, here is one of 4
-     * opcode subroutines we do not want to do this.
-     */
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x66 - prefix for 32-bit register
-****************************************************************************/
-void x86emuOp_prefix_data(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    DECODE_PRINTF("DATA:\n");
-    TRACE_AND_STEP();
-    M.x86.mode |= SYSMODE_PREFIX_DATA;
-    /* note no DECODE_CLEAR_SEGOVR here. */
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x67 - prefix for 32-bit address
-****************************************************************************/
-void x86emuOp_prefix_addr(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    DECODE_PRINTF("ADDR:\n");
-    TRACE_AND_STEP();
-    M.x86.mode |= SYSMODE_PREFIX_ADDR;
-    /* note no DECODE_CLEAR_SEGOVR here. */
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x68
-****************************************************************************/
-void x86emuOp_push_word_IMM(u8 X86EMU_UNUSED(op1))
-{
-    u32 imm;
-
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       imm = fetch_long_imm();
-    } else {
-       imm = fetch_word_imm();
-    }
-    DECODE_PRINTF2("PUSH\t%x\n", imm);
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       push_long(imm);
-    } else {
-       push_word((u16)imm);
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x69
-****************************************************************************/
-void x86emuOp_imul_word_IMM(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    uint srcoffset;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("IMUL\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg;
-           u32 srcval;
-           u32 res_lo,res_hi;
-           s32 imm;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm00_address(rl);
-           srcval = fetch_data_long(srcoffset);
-           imm = fetch_long_imm();
-           DECODE_PRINTF2(",%d\n", (s32)imm);
-           TRACE_AND_STEP();
-           imul_long_direct(&res_lo,&res_hi,(s32)srcval,(s32)imm);
-           if (res_hi != 0) {
-               SET_FLAG(F_CF);
-               SET_FLAG(F_OF);
-           } else {
-               CLEAR_FLAG(F_CF);
-               CLEAR_FLAG(F_OF);
-           }
-           *destreg = (u32)res_lo;
-       } else {
-           u16 *destreg;
-           u16 srcval;
-           u32 res;
-           s16 imm;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm00_address(rl);
-           srcval = fetch_data_word(srcoffset);
-           imm = fetch_word_imm();
-           DECODE_PRINTF2(",%d\n", (s32)imm);
-           TRACE_AND_STEP();
-           res = (s16)srcval * (s16)imm;
-           if (res > 0xFFFF) {
-               SET_FLAG(F_CF);
-               SET_FLAG(F_OF);
-           } else {
-               CLEAR_FLAG(F_CF);
-               CLEAR_FLAG(F_OF);
-           }
-           *destreg = (u16)res;
-       }
-       break;
-    case 1:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg;
-           u32 srcval;
-           u32 res_lo,res_hi;
-           s32 imm;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm01_address(rl);
-           srcval = fetch_data_long(srcoffset);
-           imm = fetch_long_imm();
-           DECODE_PRINTF2(",%d\n", (s32)imm);
-           TRACE_AND_STEP();
-           imul_long_direct(&res_lo,&res_hi,(s32)srcval,(s32)imm);
-           if (res_hi != 0) {
-               SET_FLAG(F_CF);
-               SET_FLAG(F_OF);
-           } else {
-               CLEAR_FLAG(F_CF);
-               CLEAR_FLAG(F_OF);
-           }
-           *destreg = (u32)res_lo;
-       } else {
-           u16 *destreg;
-           u16 srcval;
-           u32 res;
-           s16 imm;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm01_address(rl);
-           srcval = fetch_data_word(srcoffset);
-           imm = fetch_word_imm();
-           DECODE_PRINTF2(",%d\n", (s32)imm);
-           TRACE_AND_STEP();
-           res = (s16)srcval * (s16)imm;
-           if (res > 0xFFFF) {
-               SET_FLAG(F_CF);
-               SET_FLAG(F_OF);
-           } else {
-               CLEAR_FLAG(F_CF);
-               CLEAR_FLAG(F_OF);
-           }
-           *destreg = (u16)res;
-       }
-       break;
-    case 2:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg;
-           u32 srcval;
-           u32 res_lo,res_hi;
-           s32 imm;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm10_address(rl);
-           srcval = fetch_data_long(srcoffset);
-           imm = fetch_long_imm();
-           DECODE_PRINTF2(",%d\n", (s32)imm);
-           TRACE_AND_STEP();
-           imul_long_direct(&res_lo,&res_hi,(s32)srcval,(s32)imm);
-           if (res_hi != 0) {
-               SET_FLAG(F_CF);
-               SET_FLAG(F_OF);
-           } else {
-               CLEAR_FLAG(F_CF);
-               CLEAR_FLAG(F_OF);
-           }
-           *destreg = (u32)res_lo;
-       } else {
-           u16 *destreg;
-           u16 srcval;
-           u32 res;
-           s16 imm;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm10_address(rl);
-           srcval = fetch_data_word(srcoffset);
-           imm = fetch_word_imm();
-           DECODE_PRINTF2(",%d\n", (s32)imm);
-           TRACE_AND_STEP();
-           res = (s16)srcval * (s16)imm;
-           if (res > 0xFFFF) {
-               SET_FLAG(F_CF);
-               SET_FLAG(F_OF);
-           } else {
-               CLEAR_FLAG(F_CF);
-               CLEAR_FLAG(F_OF);
-           }
-           *destreg = (u16)res;
-       }
-       break;
-    case 3:                     /* register to register */
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg,*srcreg;
-           u32 res_lo,res_hi;
-           s32 imm;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_LONG_REGISTER(rl);
-           imm = fetch_long_imm();
-           DECODE_PRINTF2(",%d\n", (s32)imm);
-           TRACE_AND_STEP();
-           imul_long_direct(&res_lo,&res_hi,(s32)*srcreg,(s32)imm);
-           if (res_hi != 0) {
-               SET_FLAG(F_CF);
-               SET_FLAG(F_OF);
-           } else {
-               CLEAR_FLAG(F_CF);
-               CLEAR_FLAG(F_OF);
-           }
-           *destreg = (u32)res_lo;
-       } else {
-           u16 *destreg,*srcreg;
-           u32 res;
-           s16 imm;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_WORD_REGISTER(rl);
-           imm = fetch_word_imm();
-           DECODE_PRINTF2(",%d\n", (s32)imm);
-           res = (s16)*srcreg * (s16)imm;
-           if (res > 0xFFFF) {
-               SET_FLAG(F_CF);
-               SET_FLAG(F_OF);
-           } else {
-               CLEAR_FLAG(F_CF);
-               CLEAR_FLAG(F_OF);
-           }
-           *destreg = (u16)res;
-       }
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x6a
-****************************************************************************/
-void x86emuOp_push_byte_IMM(u8 X86EMU_UNUSED(op1))
-{
-    s16 imm;
-
-    START_OF_INSTR();
-    imm = (s8)fetch_byte_imm();
-    DECODE_PRINTF2("PUSH\t%d\n", imm);
-    TRACE_AND_STEP();
-    push_word(imm);
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x6b
-****************************************************************************/
-void x86emuOp_imul_byte_IMM(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    uint srcoffset;
-    s8  imm;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("IMUL\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg;
-           u32 srcval;
-           u32 res_lo,res_hi;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm00_address(rl);
-           srcval = fetch_data_long(srcoffset);
-           imm = fetch_byte_imm();
-           DECODE_PRINTF2(",%d\n", (s32)imm);
-           TRACE_AND_STEP();
-           imul_long_direct(&res_lo,&res_hi,(s32)srcval,(s32)imm);
-           if (res_hi != 0) {
-               SET_FLAG(F_CF);
-               SET_FLAG(F_OF);
-           } else {
-               CLEAR_FLAG(F_CF);
-               CLEAR_FLAG(F_OF);
-           }
-           *destreg = (u32)res_lo;
-       } else {
-           u16 *destreg;
-           u16 srcval;
-           u32 res;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm00_address(rl);
-           srcval = fetch_data_word(srcoffset);
-           imm = fetch_byte_imm();
-           DECODE_PRINTF2(",%d\n", (s32)imm);
-           TRACE_AND_STEP();
-           res = (s16)srcval * (s16)imm;
-           if (res > 0xFFFF) {
-               SET_FLAG(F_CF);
-               SET_FLAG(F_OF);
-           } else {
-               CLEAR_FLAG(F_CF);
-               CLEAR_FLAG(F_OF);
-           }
-           *destreg = (u16)res;
-       }
-       break;
-    case 1:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg;
-           u32 srcval;
-           u32 res_lo,res_hi;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm01_address(rl);
-           srcval = fetch_data_long(srcoffset);
-           imm = fetch_byte_imm();
-           DECODE_PRINTF2(",%d\n", (s32)imm);
-           TRACE_AND_STEP();
-           imul_long_direct(&res_lo,&res_hi,(s32)srcval,(s32)imm);
-           if (res_hi != 0) {
-               SET_FLAG(F_CF);
-               SET_FLAG(F_OF);
-           } else {
-               CLEAR_FLAG(F_CF);
-               CLEAR_FLAG(F_OF);
-           }
-           *destreg = (u32)res_lo;
-       } else {
-           u16 *destreg;
-           u16 srcval;
-           u32 res;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm01_address(rl);
-           srcval = fetch_data_word(srcoffset);
-           imm = fetch_byte_imm();
-           DECODE_PRINTF2(",%d\n", (s32)imm);
-           TRACE_AND_STEP();
-           res = (s16)srcval * (s16)imm;
-           if (res > 0xFFFF) {
-               SET_FLAG(F_CF);
-               SET_FLAG(F_OF);
-           } else {
-               CLEAR_FLAG(F_CF);
-               CLEAR_FLAG(F_OF);
-           }
-           *destreg = (u16)res;
-       }
-       break;
-    case 2:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg;
-           u32 srcval;
-           u32 res_lo,res_hi;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm10_address(rl);
-           srcval = fetch_data_long(srcoffset);
-           imm = fetch_byte_imm();
-           DECODE_PRINTF2(",%d\n", (s32)imm);
-           TRACE_AND_STEP();
-           imul_long_direct(&res_lo,&res_hi,(s32)srcval,(s32)imm);
-           if (res_hi != 0) {
-               SET_FLAG(F_CF);
-               SET_FLAG(F_OF);
-           } else {
-               CLEAR_FLAG(F_CF);
-               CLEAR_FLAG(F_OF);
-           }
-           *destreg = (u32)res_lo;
-       } else {
-           u16 *destreg;
-           u16 srcval;
-           u32 res;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm10_address(rl);
-           srcval = fetch_data_word(srcoffset);
-           imm = fetch_byte_imm();
-           DECODE_PRINTF2(",%d\n", (s32)imm);
-           TRACE_AND_STEP();
-           res = (s16)srcval * (s16)imm;
-           if (res > 0xFFFF) {
-               SET_FLAG(F_CF);
-               SET_FLAG(F_OF);
-           } else {
-               CLEAR_FLAG(F_CF);
-               CLEAR_FLAG(F_OF);
-           }
-           *destreg = (u16)res;
-       }
-       break;
-    case 3:                     /* register to register */
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg,*srcreg;
-           u32 res_lo,res_hi;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_LONG_REGISTER(rl);
-           imm = fetch_byte_imm();
-           DECODE_PRINTF2(",%d\n", (s32)imm);
-           TRACE_AND_STEP();
-           imul_long_direct(&res_lo,&res_hi,(s32)*srcreg,(s32)imm);
-           if (res_hi != 0) {
-               SET_FLAG(F_CF);
-               SET_FLAG(F_OF);
-           } else {
-               CLEAR_FLAG(F_CF);
-               CLEAR_FLAG(F_OF);
-           }
-           *destreg = (u32)res_lo;
-       } else {
-           u16 *destreg,*srcreg;
-           u32 res;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_WORD_REGISTER(rl);
-           imm = fetch_byte_imm();
-           DECODE_PRINTF2(",%d\n", (s32)imm);
-           res = (s16)*srcreg * (s16)imm;
-           if (res > 0xFFFF) {
-               SET_FLAG(F_CF);
-               SET_FLAG(F_OF);
-           } else {
-               CLEAR_FLAG(F_CF);
-               CLEAR_FLAG(F_OF);
-           }
-           *destreg = (u16)res;
-       }
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x6c
-****************************************************************************/
-void x86emuOp_ins_byte(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    DECODE_PRINTF("INSB\n");
-    ins(1);
-    TRACE_AND_STEP();
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x6d
-****************************************************************************/
-void x86emuOp_ins_word(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("INSD\n");
-       ins(4);
-    } else {
-       DECODE_PRINTF("INSW\n");
-       ins(2);
-    }
-    TRACE_AND_STEP();
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x6e
-****************************************************************************/
-void x86emuOp_outs_byte(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    DECODE_PRINTF("OUTSB\n");
-    outs(1);
-    TRACE_AND_STEP();
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x6f
-****************************************************************************/
-void x86emuOp_outs_word(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("OUTSD\n");
-       outs(4);
-    } else {
-       DECODE_PRINTF("OUTSW\n");
-       outs(2);
-    }
-    TRACE_AND_STEP();
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x70
-****************************************************************************/
-void x86emuOp_jump_near_O(u8 X86EMU_UNUSED(op1))
-{
-    s8 offset;
-    u16 target;
-
-    /* jump to byte offset if overflow flag is set */
-    START_OF_INSTR();
-    DECODE_PRINTF("JO\t");
-    offset = (s8)fetch_byte_imm();
-    target = (u16)(M.x86.R_IP + (s16)offset);
-    DECODE_PRINTF2("%x\n", target);
-    TRACE_AND_STEP();
-    if (ACCESS_FLAG(F_OF))
-       M.x86.R_IP = target;
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x71
-****************************************************************************/
-void x86emuOp_jump_near_NO(u8 X86EMU_UNUSED(op1))
-{
-    s8 offset;
-    u16 target;
-
-    /* jump to byte offset if overflow is not set */
-    START_OF_INSTR();
-    DECODE_PRINTF("JNO\t");
-    offset = (s8)fetch_byte_imm();
-    target = (u16)(M.x86.R_IP + (s16)offset);
-    DECODE_PRINTF2("%x\n", target);
-    TRACE_AND_STEP();
-    if (!ACCESS_FLAG(F_OF))
-       M.x86.R_IP = target;
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x72
-****************************************************************************/
-void x86emuOp_jump_near_B(u8 X86EMU_UNUSED(op1))
-{
-    s8 offset;
-    u16 target;
-
-    /* jump to byte offset if carry flag is set. */
-    START_OF_INSTR();
-    DECODE_PRINTF("JB\t");
-    offset = (s8)fetch_byte_imm();
-    target = (u16)(M.x86.R_IP + (s16)offset);
-    DECODE_PRINTF2("%x\n", target);
-    TRACE_AND_STEP();
-    if (ACCESS_FLAG(F_CF))
-       M.x86.R_IP = target;
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x73
-****************************************************************************/
-void x86emuOp_jump_near_NB(u8 X86EMU_UNUSED(op1))
-{
-    s8 offset;
-    u16 target;
-
-    /* jump to byte offset if carry flag is clear. */
-    START_OF_INSTR();
-    DECODE_PRINTF("JNB\t");
-    offset = (s8)fetch_byte_imm();
-    target = (u16)(M.x86.R_IP + (s16)offset);
-    DECODE_PRINTF2("%x\n", target);
-    TRACE_AND_STEP();
-    if (!ACCESS_FLAG(F_CF))
-       M.x86.R_IP = target;
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x74
-****************************************************************************/
-void x86emuOp_jump_near_Z(u8 X86EMU_UNUSED(op1))
-{
-    s8 offset;
-    u16 target;
-
-    /* jump to byte offset if zero flag is set. */
-    START_OF_INSTR();
-    DECODE_PRINTF("JZ\t");
-    offset = (s8)fetch_byte_imm();
-    target = (u16)(M.x86.R_IP + (s16)offset);
-    DECODE_PRINTF2("%x\n", target);
-    TRACE_AND_STEP();
-    if (ACCESS_FLAG(F_ZF))
-       M.x86.R_IP = target;
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x75
-****************************************************************************/
-void x86emuOp_jump_near_NZ(u8 X86EMU_UNUSED(op1))
-{
-    s8 offset;
-    u16 target;
-
-    /* jump to byte offset if zero flag is clear. */
-    START_OF_INSTR();
-    DECODE_PRINTF("JNZ\t");
-    offset = (s8)fetch_byte_imm();
-    target = (u16)(M.x86.R_IP + (s16)offset);
-    DECODE_PRINTF2("%x\n", target);
-    TRACE_AND_STEP();
-    if (!ACCESS_FLAG(F_ZF))
-       M.x86.R_IP = target;
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x76
-****************************************************************************/
-void x86emuOp_jump_near_BE(u8 X86EMU_UNUSED(op1))
-{
-    s8 offset;
-    u16 target;
-
-    /* jump to byte offset if carry flag is set or if the zero
-       flag is set. */
-    START_OF_INSTR();
-    DECODE_PRINTF("JBE\t");
-    offset = (s8)fetch_byte_imm();
-    target = (u16)(M.x86.R_IP + (s16)offset);
-    DECODE_PRINTF2("%x\n", target);
-    TRACE_AND_STEP();
-    if (ACCESS_FLAG(F_CF) || ACCESS_FLAG(F_ZF))
-       M.x86.R_IP = target;
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x77
-****************************************************************************/
-void x86emuOp_jump_near_NBE(u8 X86EMU_UNUSED(op1))
-{
-    s8 offset;
-    u16 target;
-
-    /* jump to byte offset if carry flag is clear and if the zero
-       flag is clear */
-    START_OF_INSTR();
-    DECODE_PRINTF("JNBE\t");
-    offset = (s8)fetch_byte_imm();
-    target = (u16)(M.x86.R_IP + (s16)offset);
-    DECODE_PRINTF2("%x\n", target);
-    TRACE_AND_STEP();
-    if (!(ACCESS_FLAG(F_CF) || ACCESS_FLAG(F_ZF)))
-       M.x86.R_IP = target;
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x78
-****************************************************************************/
-void x86emuOp_jump_near_S(u8 X86EMU_UNUSED(op1))
-{
-    s8 offset;
-    u16 target;
-
-    /* jump to byte offset if sign flag is set */
-    START_OF_INSTR();
-    DECODE_PRINTF("JS\t");
-    offset = (s8)fetch_byte_imm();
-    target = (u16)(M.x86.R_IP + (s16)offset);
-    DECODE_PRINTF2("%x\n", target);
-    TRACE_AND_STEP();
-    if (ACCESS_FLAG(F_SF))
-       M.x86.R_IP = target;
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x79
-****************************************************************************/
-void x86emuOp_jump_near_NS(u8 X86EMU_UNUSED(op1))
-{
-    s8 offset;
-    u16 target;
-
-    /* jump to byte offset if sign flag is clear */
-    START_OF_INSTR();
-    DECODE_PRINTF("JNS\t");
-    offset = (s8)fetch_byte_imm();
-    target = (u16)(M.x86.R_IP + (s16)offset);
-    DECODE_PRINTF2("%x\n", target);
-    TRACE_AND_STEP();
-    if (!ACCESS_FLAG(F_SF))
-       M.x86.R_IP = target;
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x7a
-****************************************************************************/
-void x86emuOp_jump_near_P(u8 X86EMU_UNUSED(op1))
-{
-    s8 offset;
-    u16 target;
-
-    /* jump to byte offset if parity flag is set (even parity) */
-    START_OF_INSTR();
-    DECODE_PRINTF("JP\t");
-    offset = (s8)fetch_byte_imm();
-    target = (u16)(M.x86.R_IP + (s16)offset);
-    DECODE_PRINTF2("%x\n", target);
-    TRACE_AND_STEP();
-    if (ACCESS_FLAG(F_PF))
-       M.x86.R_IP = target;
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x7b
-****************************************************************************/
-void x86emuOp_jump_near_NP(u8 X86EMU_UNUSED(op1))
-{
-    s8 offset;
-    u16 target;
-
-    /* jump to byte offset if parity flag is clear (odd parity) */
-    START_OF_INSTR();
-    DECODE_PRINTF("JNP\t");
-    offset = (s8)fetch_byte_imm();
-    target = (u16)(M.x86.R_IP + (s16)offset);
-    DECODE_PRINTF2("%x\n", target);
-    TRACE_AND_STEP();
-    if (!ACCESS_FLAG(F_PF))
-       M.x86.R_IP = target;
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x7c
-****************************************************************************/
-void x86emuOp_jump_near_L(u8 X86EMU_UNUSED(op1))
-{
-    s8 offset;
-    u16 target;
-    int sf, of;
-
-    /* jump to byte offset if sign flag not equal to overflow flag. */
-    START_OF_INSTR();
-    DECODE_PRINTF("JL\t");
-    offset = (s8)fetch_byte_imm();
-    target = (u16)(M.x86.R_IP + (s16)offset);
-    DECODE_PRINTF2("%x\n", target);
-    TRACE_AND_STEP();
-    sf = ACCESS_FLAG(F_SF) != 0;
-    of = ACCESS_FLAG(F_OF) != 0;
-    if (sf ^ of)
-       M.x86.R_IP = target;
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x7d
-****************************************************************************/
-void x86emuOp_jump_near_NL(u8 X86EMU_UNUSED(op1))
-{
-    s8 offset;
-    u16 target;
-    int sf, of;
-
-    /* jump to byte offset if sign flag not equal to overflow flag. */
-    START_OF_INSTR();
-    DECODE_PRINTF("JNL\t");
-    offset = (s8)fetch_byte_imm();
-    target = (u16)(M.x86.R_IP + (s16)offset);
-    DECODE_PRINTF2("%x\n", target);
-    TRACE_AND_STEP();
-    sf = ACCESS_FLAG(F_SF) != 0;
-    of = ACCESS_FLAG(F_OF) != 0;
-    /* note: inverse of above, but using == instead of xor. */
-    if (sf == of)
-       M.x86.R_IP = target;
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x7e
-****************************************************************************/
-void x86emuOp_jump_near_LE(u8 X86EMU_UNUSED(op1))
-{
-    s8 offset;
-    u16 target;
-    int sf, of;
-
-    /* jump to byte offset if sign flag not equal to overflow flag
-       or the zero flag is set */
-    START_OF_INSTR();
-    DECODE_PRINTF("JLE\t");
-    offset = (s8)fetch_byte_imm();
-    target = (u16)(M.x86.R_IP + (s16)offset);
-    DECODE_PRINTF2("%x\n", target);
-    TRACE_AND_STEP();
-    sf = ACCESS_FLAG(F_SF) != 0;
-    of = ACCESS_FLAG(F_OF) != 0;
-    if ((sf ^ of) || ACCESS_FLAG(F_ZF))
-       M.x86.R_IP = target;
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x7f
-****************************************************************************/
-void x86emuOp_jump_near_NLE(u8 X86EMU_UNUSED(op1))
-{
-    s8 offset;
-    u16 target;
-    int sf, of;
-
-    /* jump to byte offset if sign flag equal to overflow flag.
-       and the zero flag is clear */
-    START_OF_INSTR();
-    DECODE_PRINTF("JNLE\t");
-    offset = (s8)fetch_byte_imm();
-    target = (u16)(M.x86.R_IP + (s16)offset);
-    DECODE_PRINTF2("%x\n", target);
-    TRACE_AND_STEP();
-    sf = ACCESS_FLAG(F_SF) != 0;
-    of = ACCESS_FLAG(F_OF) != 0;
-    if ((sf == of) && !ACCESS_FLAG(F_ZF))
-       M.x86.R_IP = target;
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-static u8 (*opc80_byte_operation[])(u8 d, u8 s) =
-{
-    add_byte,           /* 00 */
-    or_byte,            /* 01 */
-    adc_byte,           /* 02 */
-    sbb_byte,           /* 03 */
-    and_byte,           /* 04 */
-    sub_byte,           /* 05 */
-    xor_byte,           /* 06 */
-    cmp_byte,           /* 07 */
-};
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x80
-****************************************************************************/
-void x86emuOp_opc80_byte_RM_IMM(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    u8 *destreg;
-    uint destoffset;
-    u8 imm;
-    u8 destval;
-
-    /*
-     * Weirdo special case instruction format.  Part of the opcode
-     * held below in "RH".  Doubly nested case would result, except
-     * that the decoded instruction
-     */
-    START_OF_INSTR();
-    FETCH_DECODE_MODRM(mod, rh, rl);
-#ifdef DEBUG
-    if (DEBUG_DECODE()) {
-       /* XXX DECODE_PRINTF may be changed to something more
-          general, so that it is important to leave the strings
-          in the same format, even though the result is that the
-          above test is done twice. */
-
-       switch (rh) {
-       case 0:
-           DECODE_PRINTF("ADD\t");
-           break;
-       case 1:
-           DECODE_PRINTF("OR\t");
-           break;
-       case 2:
-           DECODE_PRINTF("ADC\t");
-           break;
-       case 3:
-           DECODE_PRINTF("SBB\t");
-           break;
-       case 4:
-           DECODE_PRINTF("AND\t");
-           break;
-       case 5:
-           DECODE_PRINTF("SUB\t");
-           break;
-       case 6:
-           DECODE_PRINTF("XOR\t");
-           break;
-       case 7:
-           DECODE_PRINTF("CMP\t");
-           break;
-       }
-    }
-#endif
-    /* know operation, decode the mod byte to find the addressing
-       mode. */
-    switch (mod) {
-    case 0:
-       DECODE_PRINTF("BYTE PTR ");
-       destoffset = decode_rm00_address(rl);
-       DECODE_PRINTF(",");
-       destval = fetch_data_byte(destoffset);
-       imm = fetch_byte_imm();
-       DECODE_PRINTF2("%x\n", imm);
-       TRACE_AND_STEP();
-       destval = (*opc80_byte_operation[rh]) (destval, imm);
-       if (rh != 7)
-           store_data_byte(destoffset, destval);
-       break;
-    case 1:
-       DECODE_PRINTF("BYTE PTR ");
-       destoffset = decode_rm01_address(rl);
-       DECODE_PRINTF(",");
-       destval = fetch_data_byte(destoffset);
-       imm = fetch_byte_imm();
-       DECODE_PRINTF2("%x\n", imm);
-       TRACE_AND_STEP();
-       destval = (*opc80_byte_operation[rh]) (destval, imm);
-       if (rh != 7)
-           store_data_byte(destoffset, destval);
-       break;
-    case 2:
-       DECODE_PRINTF("BYTE PTR ");
-       destoffset = decode_rm10_address(rl);
-       DECODE_PRINTF(",");
-       destval = fetch_data_byte(destoffset);
-       imm = fetch_byte_imm();
-       DECODE_PRINTF2("%x\n", imm);
-       TRACE_AND_STEP();
-       destval = (*opc80_byte_operation[rh]) (destval, imm);
-       if (rh != 7)
-           store_data_byte(destoffset, destval);
-       break;
-    case 3:                     /* register to register */
-       destreg = DECODE_RM_BYTE_REGISTER(rl);
-       DECODE_PRINTF(",");
-       imm = fetch_byte_imm();
-       DECODE_PRINTF2("%x\n", imm);
-       TRACE_AND_STEP();
-       destval = (*opc80_byte_operation[rh]) (*destreg, imm);
-       if (rh != 7)
-           *destreg = destval;
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-static u16 (*opc81_word_operation[])(u16 d, u16 s) =
-{
-    add_word,           /*00 */
-    or_word,            /*01 */
-    adc_word,           /*02 */
-    sbb_word,           /*03 */
-    and_word,           /*04 */
-    sub_word,           /*05 */
-    xor_word,           /*06 */
-    cmp_word,           /*07 */
-};
-
-static u32 (*opc81_long_operation[])(u32 d, u32 s) =
-{
-    add_long,           /*00 */
-    or_long,            /*01 */
-    adc_long,           /*02 */
-    sbb_long,           /*03 */
-    and_long,           /*04 */
-    sub_long,           /*05 */
-    xor_long,           /*06 */
-    cmp_long,           /*07 */
-};
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x81
-****************************************************************************/
-void x86emuOp_opc81_word_RM_IMM(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    uint destoffset;
-
-    /*
-     * Weirdo special case instruction format.  Part of the opcode
-     * held below in "RH".  Doubly nested case would result, except
-     * that the decoded instruction
-     */
-    START_OF_INSTR();
-    FETCH_DECODE_MODRM(mod, rh, rl);
-#ifdef DEBUG
-    if (DEBUG_DECODE()) {
-       /* XXX DECODE_PRINTF may be changed to something more
-          general, so that it is important to leave the strings
-          in the same format, even though the result is that the
-          above test is done twice. */
-
-       switch (rh) {
-       case 0:
-           DECODE_PRINTF("ADD\t");
-           break;
-       case 1:
-           DECODE_PRINTF("OR\t");
-           break;
-       case 2:
-           DECODE_PRINTF("ADC\t");
-           break;
-       case 3:
-           DECODE_PRINTF("SBB\t");
-           break;
-       case 4:
-           DECODE_PRINTF("AND\t");
-           break;
-       case 5:
-           DECODE_PRINTF("SUB\t");
-           break;
-       case 6:
-           DECODE_PRINTF("XOR\t");
-           break;
-       case 7:
-           DECODE_PRINTF("CMP\t");
-           break;
-       }
-    }
-#endif
-    /*
-     * Know operation, decode the mod byte to find the addressing
-     * mode.
-     */
-    switch (mod) {
-    case 0:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval,imm;
-
-           DECODE_PRINTF("DWORD PTR ");
-           destoffset = decode_rm00_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_long(destoffset);
-           imm = fetch_long_imm();
-           DECODE_PRINTF2("%x\n", imm);
-           TRACE_AND_STEP();
-           destval = (*opc81_long_operation[rh]) (destval, imm);
-           if (rh != 7)
-               store_data_long(destoffset, destval);
-       } else {
-           u16 destval,imm;
-
-           DECODE_PRINTF("WORD PTR ");
-           destoffset = decode_rm00_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_word(destoffset);
-           imm = fetch_word_imm();
-           DECODE_PRINTF2("%x\n", imm);
-           TRACE_AND_STEP();
-           destval = (*opc81_word_operation[rh]) (destval, imm);
-           if (rh != 7)
-               store_data_word(destoffset, destval);
-       }
-       break;
-    case 1:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval,imm;
-
-           DECODE_PRINTF("DWORD PTR ");
-           destoffset = decode_rm01_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_long(destoffset);
-           imm = fetch_long_imm();
-           DECODE_PRINTF2("%x\n", imm);
-           TRACE_AND_STEP();
-           destval = (*opc81_long_operation[rh]) (destval, imm);
-           if (rh != 7)
-               store_data_long(destoffset, destval);
-       } else {
-           u16 destval,imm;
-
-           DECODE_PRINTF("WORD PTR ");
-           destoffset = decode_rm01_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_word(destoffset);
-           imm = fetch_word_imm();
-           DECODE_PRINTF2("%x\n", imm);
-           TRACE_AND_STEP();
-           destval = (*opc81_word_operation[rh]) (destval, imm);
-           if (rh != 7)
-               store_data_word(destoffset, destval);
-       }
-       break;
-    case 2:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval,imm;
-
-           DECODE_PRINTF("DWORD PTR ");
-           destoffset = decode_rm10_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_long(destoffset);
-           imm = fetch_long_imm();
-           DECODE_PRINTF2("%x\n", imm);
-           TRACE_AND_STEP();
-           destval = (*opc81_long_operation[rh]) (destval, imm);
-           if (rh != 7)
-               store_data_long(destoffset, destval);
-       } else {
-           u16 destval,imm;
-
-           DECODE_PRINTF("WORD PTR ");
-           destoffset = decode_rm10_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_word(destoffset);
-           imm = fetch_word_imm();
-           DECODE_PRINTF2("%x\n", imm);
-           TRACE_AND_STEP();
-           destval = (*opc81_word_operation[rh]) (destval, imm);
-           if (rh != 7)
-               store_data_word(destoffset, destval);
-       }
-       break;
-    case 3:                     /* register to register */
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg;
-           u32 destval,imm;
-
-           destreg = DECODE_RM_LONG_REGISTER(rl);
-           DECODE_PRINTF(",");
-           imm = fetch_long_imm();
-           DECODE_PRINTF2("%x\n", imm);
-           TRACE_AND_STEP();
-           destval = (*opc81_long_operation[rh]) (*destreg, imm);
-           if (rh != 7)
-               *destreg = destval;
-       } else {
-           u16 *destreg;
-           u16 destval,imm;
-
-           destreg = DECODE_RM_WORD_REGISTER(rl);
-           DECODE_PRINTF(",");
-           imm = fetch_word_imm();
-           DECODE_PRINTF2("%x\n", imm);
-           TRACE_AND_STEP();
-           destval = (*opc81_word_operation[rh]) (*destreg, imm);
-           if (rh != 7)
-               *destreg = destval;
-       }
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-static u8 (*opc82_byte_operation[])(u8 s, u8 d) =
-{
-    add_byte,           /*00 */
-    or_byte,            /*01 */ /*YYY UNUSED ???? */
-    adc_byte,           /*02 */
-    sbb_byte,           /*03 */
-    and_byte,           /*04 */ /*YYY UNUSED ???? */
-    sub_byte,           /*05 */
-    xor_byte,           /*06 */ /*YYY UNUSED ???? */
-    cmp_byte,           /*07 */
-};
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x82
-****************************************************************************/
-void x86emuOp_opc82_byte_RM_IMM(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    u8 *destreg;
-    uint destoffset;
-    u8 imm;
-    u8 destval;
-
-    /*
-     * Weirdo special case instruction format.  Part of the opcode
-     * held below in "RH".  Doubly nested case would result, except
-     * that the decoded instruction Similar to opcode 81, except that
-     * the immediate byte is sign extended to a word length.
-     */
-    START_OF_INSTR();
-    FETCH_DECODE_MODRM(mod, rh, rl);
-#ifdef DEBUG
-    if (DEBUG_DECODE()) {
-       /* XXX DECODE_PRINTF may be changed to something more
-          general, so that it is important to leave the strings
-          in the same format, even though the result is that the
-          above test is done twice. */
-       switch (rh) {
-       case 0:
-           DECODE_PRINTF("ADD\t");
-           break;
-       case 1:
-           DECODE_PRINTF("OR\t");
-           break;
-       case 2:
-           DECODE_PRINTF("ADC\t");
-           break;
-       case 3:
-           DECODE_PRINTF("SBB\t");
-           break;
-       case 4:
-           DECODE_PRINTF("AND\t");
-           break;
-       case 5:
-           DECODE_PRINTF("SUB\t");
-           break;
-       case 6:
-           DECODE_PRINTF("XOR\t");
-           break;
-       case 7:
-           DECODE_PRINTF("CMP\t");
-           break;
-       }
-    }
-#endif
-    /* know operation, decode the mod byte to find the addressing
-       mode. */
-    switch (mod) {
-    case 0:
-       DECODE_PRINTF("BYTE PTR ");
-       destoffset = decode_rm00_address(rl);
-       destval = fetch_data_byte(destoffset);
-       imm = fetch_byte_imm();
-       DECODE_PRINTF2(",%x\n", imm);
-       TRACE_AND_STEP();
-       destval = (*opc82_byte_operation[rh]) (destval, imm);
-       if (rh != 7)
-           store_data_byte(destoffset, destval);
-       break;
-    case 1:
-       DECODE_PRINTF("BYTE PTR ");
-       destoffset = decode_rm01_address(rl);
-       destval = fetch_data_byte(destoffset);
-       imm = fetch_byte_imm();
-       DECODE_PRINTF2(",%x\n", imm);
-       TRACE_AND_STEP();
-       destval = (*opc82_byte_operation[rh]) (destval, imm);
-       if (rh != 7)
-           store_data_byte(destoffset, destval);
-       break;
-    case 2:
-       DECODE_PRINTF("BYTE PTR ");
-       destoffset = decode_rm10_address(rl);
-       destval = fetch_data_byte(destoffset);
-       imm = fetch_byte_imm();
-       DECODE_PRINTF2(",%x\n", imm);
-       TRACE_AND_STEP();
-       destval = (*opc82_byte_operation[rh]) (destval, imm);
-       if (rh != 7)
-           store_data_byte(destoffset, destval);
-       break;
-    case 3:                     /* register to register */
-       destreg = DECODE_RM_BYTE_REGISTER(rl);
-       imm = fetch_byte_imm();
-       DECODE_PRINTF2(",%x\n", imm);
-       TRACE_AND_STEP();
-       destval = (*opc82_byte_operation[rh]) (*destreg, imm);
-       if (rh != 7)
-           *destreg = destval;
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-static u16 (*opc83_word_operation[])(u16 s, u16 d) =
-{
-    add_word,           /*00 */
-    or_word,            /*01 */ /*YYY UNUSED ???? */
-    adc_word,           /*02 */
-    sbb_word,           /*03 */
-    and_word,           /*04 */ /*YYY UNUSED ???? */
-    sub_word,           /*05 */
-    xor_word,           /*06 */ /*YYY UNUSED ???? */
-    cmp_word,           /*07 */
-};
-
-static u32 (*opc83_long_operation[])(u32 s, u32 d) =
-{
-    add_long,           /*00 */
-    or_long,            /*01 */ /*YYY UNUSED ???? */
-    adc_long,           /*02 */
-    sbb_long,           /*03 */
-    and_long,           /*04 */ /*YYY UNUSED ???? */
-    sub_long,           /*05 */
-    xor_long,           /*06 */ /*YYY UNUSED ???? */
-    cmp_long,           /*07 */
-};
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x83
-****************************************************************************/
-void x86emuOp_opc83_word_RM_IMM(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    uint destoffset;
-
-    /*
-     * Weirdo special case instruction format.  Part of the opcode
-     * held below in "RH".  Doubly nested case would result, except
-     * that the decoded instruction Similar to opcode 81, except that
-     * the immediate byte is sign extended to a word length.
-     */
-    START_OF_INSTR();
-    FETCH_DECODE_MODRM(mod, rh, rl);
-#ifdef DEBUG
-    if (DEBUG_DECODE()) {
-       /* XXX DECODE_PRINTF may be changed to something more
-          general, so that it is important to leave the strings
-          in the same format, even though the result is that the
-          above test is done twice. */
-       switch (rh) {
-       case 0:
-           DECODE_PRINTF("ADD\t");
-           break;
-       case 1:
-           DECODE_PRINTF("OR\t");
-           break;
-       case 2:
-           DECODE_PRINTF("ADC\t");
-           break;
-       case 3:
-           DECODE_PRINTF("SBB\t");
-           break;
-       case 4:
-           DECODE_PRINTF("AND\t");
-           break;
-       case 5:
-           DECODE_PRINTF("SUB\t");
-           break;
-       case 6:
-           DECODE_PRINTF("XOR\t");
-           break;
-       case 7:
-           DECODE_PRINTF("CMP\t");
-           break;
-       }
-    }
-#endif
-    /* know operation, decode the mod byte to find the addressing
-       mode. */
-    switch (mod) {
-    case 0:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval,imm;
-
-           DECODE_PRINTF("DWORD PTR ");
-           destoffset = decode_rm00_address(rl);
-           destval = fetch_data_long(destoffset);
-           imm = (s8) fetch_byte_imm();
-           DECODE_PRINTF2(",%x\n", imm);
-           TRACE_AND_STEP();
-           destval = (*opc83_long_operation[rh]) (destval, imm);
-           if (rh != 7)
-               store_data_long(destoffset, destval);
-       } else {
-           u16 destval,imm;
-
-           DECODE_PRINTF("WORD PTR ");
-           destoffset = decode_rm00_address(rl);
-           destval = fetch_data_word(destoffset);
-           imm = (s8) fetch_byte_imm();
-           DECODE_PRINTF2(",%x\n", imm);
-           TRACE_AND_STEP();
-           destval = (*opc83_word_operation[rh]) (destval, imm);
-           if (rh != 7)
-               store_data_word(destoffset, destval);
-       }
-       break;
-    case 1:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval,imm;
-
-           DECODE_PRINTF("DWORD PTR ");
-           destoffset = decode_rm01_address(rl);
-           destval = fetch_data_long(destoffset);
-           imm = (s8) fetch_byte_imm();
-           DECODE_PRINTF2(",%x\n", imm);
-           TRACE_AND_STEP();
-           destval = (*opc83_long_operation[rh]) (destval, imm);
-           if (rh != 7)
-               store_data_long(destoffset, destval);
-       } else {
-           u16 destval,imm;
-
-           DECODE_PRINTF("WORD PTR ");
-           destoffset = decode_rm01_address(rl);
-           destval = fetch_data_word(destoffset);
-           imm = (s8) fetch_byte_imm();
-           DECODE_PRINTF2(",%x\n", imm);
-           TRACE_AND_STEP();
-           destval = (*opc83_word_operation[rh]) (destval, imm);
-           if (rh != 7)
-               store_data_word(destoffset, destval);
-       }
-       break;
-    case 2:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval,imm;
-
-           DECODE_PRINTF("DWORD PTR ");
-           destoffset = decode_rm10_address(rl);
-           destval = fetch_data_long(destoffset);
-           imm = (s8) fetch_byte_imm();
-           DECODE_PRINTF2(",%x\n", imm);
-           TRACE_AND_STEP();
-           destval = (*opc83_long_operation[rh]) (destval, imm);
-           if (rh != 7)
-               store_data_long(destoffset, destval);
-       } else {
-           u16 destval,imm;
-
-           DECODE_PRINTF("WORD PTR ");
-           destoffset = decode_rm10_address(rl);
-           destval = fetch_data_word(destoffset);
-           imm = (s8) fetch_byte_imm();
-           DECODE_PRINTF2(",%x\n", imm);
-           TRACE_AND_STEP();
-           destval = (*opc83_word_operation[rh]) (destval, imm);
-           if (rh != 7)
-               store_data_word(destoffset, destval);
-       }
-       break;
-    case 3:                     /* register to register */
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg;
-           u32 destval,imm;
-
-           destreg = DECODE_RM_LONG_REGISTER(rl);
-           imm = (s8) fetch_byte_imm();
-           DECODE_PRINTF2(",%x\n", imm);
-           TRACE_AND_STEP();
-           destval = (*opc83_long_operation[rh]) (*destreg, imm);
-           if (rh != 7)
-               *destreg = destval;
-       } else {
-           u16 *destreg;
-           u16 destval,imm;
-
-           destreg = DECODE_RM_WORD_REGISTER(rl);
-           imm = (s8) fetch_byte_imm();
-           DECODE_PRINTF2(",%x\n", imm);
-           TRACE_AND_STEP();
-           destval = (*opc83_word_operation[rh]) (*destreg, imm);
-           if (rh != 7)
-               *destreg = destval;
-       }
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x84
-****************************************************************************/
-void x86emuOp_test_byte_RM_R(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    u8 *destreg, *srcreg;
-    uint destoffset;
-    u8 destval;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("TEST\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       destoffset = decode_rm00_address(rl);
-       DECODE_PRINTF(",");
-       destval = fetch_data_byte(destoffset);
-       srcreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       test_byte(destval, *srcreg);
-       break;
-    case 1:
-       destoffset = decode_rm01_address(rl);
-       DECODE_PRINTF(",");
-       destval = fetch_data_byte(destoffset);
-       srcreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       test_byte(destval, *srcreg);
-       break;
-    case 2:
-       destoffset = decode_rm10_address(rl);
-       DECODE_PRINTF(",");
-       destval = fetch_data_byte(destoffset);
-       srcreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       test_byte(destval, *srcreg);
-       break;
-    case 3:                     /* register to register */
-       destreg = DECODE_RM_BYTE_REGISTER(rl);
-       DECODE_PRINTF(",");
-       srcreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       test_byte(*destreg, *srcreg);
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x85
-****************************************************************************/
-void x86emuOp_test_word_RM_R(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    uint destoffset;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("TEST\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-           u32 *srcreg;
-
-           destoffset = decode_rm00_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_long(destoffset);
-           srcreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           test_long(destval, *srcreg);
-       } else {
-           u16 destval;
-           u16 *srcreg;
-
-           destoffset = decode_rm00_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_word(destoffset);
-           srcreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           test_word(destval, *srcreg);
-       }
-       break;
-    case 1:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-           u32 *srcreg;
-
-           destoffset = decode_rm01_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_long(destoffset);
-           srcreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           test_long(destval, *srcreg);
-       } else {
-           u16 destval;
-           u16 *srcreg;
-
-           destoffset = decode_rm01_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_word(destoffset);
-           srcreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           test_word(destval, *srcreg);
-       }
-       break;
-    case 2:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-           u32 *srcreg;
-
-           destoffset = decode_rm10_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_long(destoffset);
-           srcreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           test_long(destval, *srcreg);
-       } else {
-           u16 destval;
-           u16 *srcreg;
-
-           destoffset = decode_rm10_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_word(destoffset);
-           srcreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           test_word(destval, *srcreg);
-       }
-       break;
-    case 3:                     /* register to register */
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg,*srcreg;
-
-           destreg = DECODE_RM_LONG_REGISTER(rl);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           test_long(*destreg, *srcreg);
-       } else {
-           u16 *destreg,*srcreg;
-
-           destreg = DECODE_RM_WORD_REGISTER(rl);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           test_word(*destreg, *srcreg);
-       }
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x86
-****************************************************************************/
-void x86emuOp_xchg_byte_RM_R(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    u8 *destreg, *srcreg;
-    uint destoffset;
-    u8 destval;
-    u8 tmp;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("XCHG\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       destoffset = decode_rm00_address(rl);
-       DECODE_PRINTF(",");
-       destval = fetch_data_byte(destoffset);
-       srcreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       tmp = *srcreg;
-       *srcreg = destval;
-       destval = tmp;
-       store_data_byte(destoffset, destval);
-       break;
-    case 1:
-       destoffset = decode_rm01_address(rl);
-       DECODE_PRINTF(",");
-       destval = fetch_data_byte(destoffset);
-       srcreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       tmp = *srcreg;
-       *srcreg = destval;
-       destval = tmp;
-       store_data_byte(destoffset, destval);
-       break;
-    case 2:
-       destoffset = decode_rm10_address(rl);
-       DECODE_PRINTF(",");
-       destval = fetch_data_byte(destoffset);
-       srcreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       tmp = *srcreg;
-       *srcreg = destval;
-       destval = tmp;
-       store_data_byte(destoffset, destval);
-       break;
-    case 3:                     /* register to register */
-       destreg = DECODE_RM_BYTE_REGISTER(rl);
-       DECODE_PRINTF(",");
-       srcreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       tmp = *srcreg;
-       *srcreg = *destreg;
-       *destreg = tmp;
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x87
-****************************************************************************/
-void x86emuOp_xchg_word_RM_R(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    uint destoffset;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("XCHG\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *srcreg;
-           u32 destval,tmp;
-
-           destoffset = decode_rm00_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_long(destoffset);
-           srcreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           tmp = *srcreg;
-           *srcreg = destval;
-           destval = tmp;
-           store_data_long(destoffset, destval);
-       } else {
-           u16 *srcreg;
-           u16 destval,tmp;
-
-           destoffset = decode_rm00_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_word(destoffset);
-           srcreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           tmp = *srcreg;
-           *srcreg = destval;
-           destval = tmp;
-           store_data_word(destoffset, destval);
-       }
-       break;
-    case 1:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *srcreg;
-           u32 destval,tmp;
-
-           destoffset = decode_rm01_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_long(destoffset);
-           srcreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           tmp = *srcreg;
-           *srcreg = destval;
-           destval = tmp;
-           store_data_long(destoffset, destval);
-       } else {
-           u16 *srcreg;
-           u16 destval,tmp;
-
-           destoffset = decode_rm01_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_word(destoffset);
-           srcreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           tmp = *srcreg;
-           *srcreg = destval;
-           destval = tmp;
-           store_data_word(destoffset, destval);
-       }
-       break;
-    case 2:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *srcreg;
-           u32 destval,tmp;
-
-           destoffset = decode_rm10_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_long(destoffset);
-           srcreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           tmp = *srcreg;
-           *srcreg = destval;
-           destval = tmp;
-           store_data_long(destoffset, destval);
-       } else {
-           u16 *srcreg;
-           u16 destval,tmp;
-
-           destoffset = decode_rm10_address(rl);
-           DECODE_PRINTF(",");
-           destval = fetch_data_word(destoffset);
-           srcreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           tmp = *srcreg;
-           *srcreg = destval;
-           destval = tmp;
-           store_data_word(destoffset, destval);
-       }
-       break;
-    case 3:                     /* register to register */
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg,*srcreg;
-           u32 tmp;
-
-           destreg = DECODE_RM_LONG_REGISTER(rl);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           tmp = *srcreg;
-           *srcreg = *destreg;
-           *destreg = tmp;
-       } else {
-           u16 *destreg,*srcreg;
-           u16 tmp;
-
-           destreg = DECODE_RM_WORD_REGISTER(rl);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           tmp = *srcreg;
-           *srcreg = *destreg;
-           *destreg = tmp;
-       }
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x88
-****************************************************************************/
-void x86emuOp_mov_byte_RM_R(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    u8 *destreg, *srcreg;
-    uint destoffset;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("MOV\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       destoffset = decode_rm00_address(rl);
-       DECODE_PRINTF(",");
-       srcreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       store_data_byte(destoffset, *srcreg);
-       break;
-    case 1:
-       destoffset = decode_rm01_address(rl);
-       DECODE_PRINTF(",");
-       srcreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       store_data_byte(destoffset, *srcreg);
-       break;
-    case 2:
-       destoffset = decode_rm10_address(rl);
-       DECODE_PRINTF(",");
-       srcreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       store_data_byte(destoffset, *srcreg);
-       break;
-    case 3:                     /* register to register */
-       destreg = DECODE_RM_BYTE_REGISTER(rl);
-       DECODE_PRINTF(",");
-       srcreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = *srcreg;
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x89
-****************************************************************************/
-void x86emuOp_mov_word_RM_R(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    uint destoffset;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("MOV\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *srcreg;
-
-           destoffset = decode_rm00_address(rl);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           store_data_long(destoffset, *srcreg);
-       } else {
-           u16 *srcreg;
-
-           destoffset = decode_rm00_address(rl);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           store_data_word(destoffset, *srcreg);
-       }
-       break;
-    case 1:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *srcreg;
-
-           destoffset = decode_rm01_address(rl);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           store_data_long(destoffset, *srcreg);
-       } else {
-           u16 *srcreg;
-
-           destoffset = decode_rm01_address(rl);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           store_data_word(destoffset, *srcreg);
-       }
-       break;
-    case 2:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *srcreg;
-
-           destoffset = decode_rm10_address(rl);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           store_data_long(destoffset, *srcreg);
-       } else {
-           u16 *srcreg;
-
-           destoffset = decode_rm10_address(rl);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           store_data_word(destoffset, *srcreg);
-       }
-       break;
-    case 3:                     /* register to register */
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg,*srcreg;
-
-           destreg = DECODE_RM_LONG_REGISTER(rl);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = *srcreg;
-       } else {
-           u16 *destreg,*srcreg;
-
-           destreg = DECODE_RM_WORD_REGISTER(rl);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = *srcreg;
-       }
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x8a
-****************************************************************************/
-void x86emuOp_mov_byte_R_RM(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    u8 *destreg, *srcreg;
-    uint srcoffset;
-    u8 srcval;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("MOV\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       destreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm00_address(rl);
-       srcval = fetch_data_byte(srcoffset);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = srcval;
-       break;
-    case 1:
-       destreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm01_address(rl);
-       srcval = fetch_data_byte(srcoffset);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = srcval;
-       break;
-    case 2:
-       destreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm10_address(rl);
-       srcval = fetch_data_byte(srcoffset);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = srcval;
-       break;
-    case 3:                     /* register to register */
-       destreg = DECODE_RM_BYTE_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcreg = DECODE_RM_BYTE_REGISTER(rl);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = *srcreg;
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x8b
-****************************************************************************/
-void x86emuOp_mov_word_R_RM(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    uint srcoffset;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("MOV\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg;
-           u32 srcval;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm00_address(rl);
-           srcval = fetch_data_long(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = srcval;
-       } else {
-           u16 *destreg;
-           u16 srcval;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm00_address(rl);
-           srcval = fetch_data_word(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = srcval;
-       }
-       break;
-    case 1:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg;
-           u32 srcval;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm01_address(rl);
-           srcval = fetch_data_long(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = srcval;
-       } else {
-           u16 *destreg;
-           u16 srcval;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm01_address(rl);
-           srcval = fetch_data_word(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = srcval;
-       }
-       break;
-    case 2:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg;
-           u32 srcval;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm10_address(rl);
-           srcval = fetch_data_long(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = srcval;
-       } else {
-           u16 *destreg;
-           u16 srcval;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm10_address(rl);
-           srcval = fetch_data_word(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = srcval;
-       }
-       break;
-    case 3:                     /* register to register */
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg, *srcreg;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_LONG_REGISTER(rl);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = *srcreg;
-       } else {
-           u16 *destreg, *srcreg;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_WORD_REGISTER(rl);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = *srcreg;
-       }
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x8c
-****************************************************************************/
-void x86emuOp_mov_word_RM_SR(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    u16 *destreg, *srcreg;
-    uint destoffset;
-    u16 destval;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("MOV\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       destoffset = decode_rm00_address(rl);
-       DECODE_PRINTF(",");
-       srcreg = decode_rm_seg_register(rh);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       destval = *srcreg;
-       store_data_word(destoffset, destval);
-       break;
-    case 1:
-       destoffset = decode_rm01_address(rl);
-       DECODE_PRINTF(",");
-       srcreg = decode_rm_seg_register(rh);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       destval = *srcreg;
-       store_data_word(destoffset, destval);
-       break;
-    case 2:
-       destoffset = decode_rm10_address(rl);
-       DECODE_PRINTF(",");
-       srcreg = decode_rm_seg_register(rh);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       destval = *srcreg;
-       store_data_word(destoffset, destval);
-       break;
-    case 3:                     /* register to register */
-       destreg = DECODE_RM_WORD_REGISTER(rl);
-       DECODE_PRINTF(",");
-       srcreg = decode_rm_seg_register(rh);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = *srcreg;
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x8d
-****************************************************************************/
-void x86emuOp_lea_word_R_M(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    u16 *srcreg;
-    uint destoffset;
-
-/*
- * TODO: Need to handle address size prefix!
- *
- * lea  eax,[eax+ebx*2] ??
- */
-
-    START_OF_INSTR();
-    DECODE_PRINTF("LEA\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       srcreg = DECODE_RM_WORD_REGISTER(rh);
-       DECODE_PRINTF(",");
-       destoffset = decode_rm00_address(rl);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *srcreg = (u16)destoffset;
-       break;
-    case 1:
-       srcreg = DECODE_RM_WORD_REGISTER(rh);
-       DECODE_PRINTF(",");
-       destoffset = decode_rm01_address(rl);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *srcreg = (u16)destoffset;
-       break;
-    case 2:
-       srcreg = DECODE_RM_WORD_REGISTER(rh);
-       DECODE_PRINTF(",");
-       destoffset = decode_rm10_address(rl);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *srcreg = (u16)destoffset;
-       break;
-    case 3:                     /* register to register */
-       /* undefined.  Do nothing. */
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x8e
-****************************************************************************/
-void x86emuOp_mov_word_SR_RM(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    u16 *destreg, *srcreg;
-    uint srcoffset;
-    u16 srcval;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("MOV\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       destreg = decode_rm_seg_register(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm00_address(rl);
-       srcval = fetch_data_word(srcoffset);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = srcval;
-       break;
-    case 1:
-       destreg = decode_rm_seg_register(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm01_address(rl);
-       srcval = fetch_data_word(srcoffset);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = srcval;
-       break;
-    case 2:
-       destreg = decode_rm_seg_register(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm10_address(rl);
-       srcval = fetch_data_word(srcoffset);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = srcval;
-       break;
-    case 3:                     /* register to register */
-       destreg = decode_rm_seg_register(rh);
-       DECODE_PRINTF(",");
-       srcreg = DECODE_RM_WORD_REGISTER(rl);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = *srcreg;
-       break;
-    }
-    /*
-     * Clean up, and reset all the R_xSP pointers to the correct
-     * locations.  This is about 3x too much overhead (doing all the
-     * segreg ptrs when only one is needed, but this instruction
-     * *cannot* be that common, and this isn't too much work anyway.
-     */
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x8f
-****************************************************************************/
-void x86emuOp_pop_RM(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    uint destoffset;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("POP\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    if (rh != 0) {
-       DECODE_PRINTF("ILLEGAL DECODE OF OPCODE 8F\n");
-       HALT_SYS();
-    }
-    switch (mod) {
-    case 0:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-
-           destoffset = decode_rm00_address(rl);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           destval = pop_long();
-           store_data_long(destoffset, destval);
-       } else {
-           u16 destval;
-
-           destoffset = decode_rm00_address(rl);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           destval = pop_word();
-           store_data_word(destoffset, destval);
-       }
-       break;
-    case 1:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-
-           destoffset = decode_rm01_address(rl);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           destval = pop_long();
-           store_data_long(destoffset, destval);
-       } else {
-           u16 destval;
-
-           destoffset = decode_rm01_address(rl);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           destval = pop_word();
-           store_data_word(destoffset, destval);
-       }
-       break;
-    case 2:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-
-           destoffset = decode_rm10_address(rl);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           destval = pop_long();
-           store_data_long(destoffset, destval);
-       } else {
-           u16 destval;
-
-           destoffset = decode_rm10_address(rl);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           destval = pop_word();
-           store_data_word(destoffset, destval);
-       }
-       break;
-    case 3:                     /* register to register */
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg;
-
-           destreg = DECODE_RM_LONG_REGISTER(rl);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = pop_long();
-       } else {
-           u16 *destreg;
-
-           destreg = DECODE_RM_WORD_REGISTER(rl);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = pop_word();
-       }
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x90
-****************************************************************************/
-void x86emuOp_nop(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    DECODE_PRINTF("NOP\n");
-    TRACE_AND_STEP();
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x91
-****************************************************************************/
-void x86emuOp_xchg_word_AX_CX(u8 X86EMU_UNUSED(op1))
-{
-    u32 tmp;
-
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("XCHG\tEAX,ECX\n");
-    } else {
-       DECODE_PRINTF("XCHG\tAX,CX\n");
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       tmp = M.x86.R_EAX;
-       M.x86.R_EAX = M.x86.R_ECX;
-       M.x86.R_ECX = tmp;
-    } else {
-       tmp = M.x86.R_AX;
-       M.x86.R_AX = M.x86.R_CX;
-       M.x86.R_CX = (u16)tmp;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x92
-****************************************************************************/
-void x86emuOp_xchg_word_AX_DX(u8 X86EMU_UNUSED(op1))
-{
-    u32 tmp;
-
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("XCHG\tEAX,EDX\n");
-    } else {
-       DECODE_PRINTF("XCHG\tAX,DX\n");
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       tmp = M.x86.R_EAX;
-       M.x86.R_EAX = M.x86.R_EDX;
-       M.x86.R_EDX = tmp;
-    } else {
-       tmp = M.x86.R_AX;
-       M.x86.R_AX = M.x86.R_DX;
-       M.x86.R_DX = (u16)tmp;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x93
-****************************************************************************/
-void x86emuOp_xchg_word_AX_BX(u8 X86EMU_UNUSED(op1))
-{
-    u32 tmp;
-
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("XCHG\tEAX,EBX\n");
-    } else {
-       DECODE_PRINTF("XCHG\tAX,BX\n");
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       tmp = M.x86.R_EAX;
-       M.x86.R_EAX = M.x86.R_EBX;
-       M.x86.R_EBX = tmp;
-    } else {
-       tmp = M.x86.R_AX;
-       M.x86.R_AX = M.x86.R_BX;
-       M.x86.R_BX = (u16)tmp;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x94
-****************************************************************************/
-void x86emuOp_xchg_word_AX_SP(u8 X86EMU_UNUSED(op1))
-{
-    u32 tmp;
-
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("XCHG\tEAX,ESP\n");
-    } else {
-       DECODE_PRINTF("XCHG\tAX,SP\n");
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       tmp = M.x86.R_EAX;
-       M.x86.R_EAX = M.x86.R_ESP;
-       M.x86.R_ESP = tmp;
-    } else {
-       tmp = M.x86.R_AX;
-       M.x86.R_AX = M.x86.R_SP;
-       M.x86.R_SP = (u16)tmp;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x95
-****************************************************************************/
-void x86emuOp_xchg_word_AX_BP(u8 X86EMU_UNUSED(op1))
-{
-    u32 tmp;
-
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("XCHG\tEAX,EBP\n");
-    } else {
-       DECODE_PRINTF("XCHG\tAX,BP\n");
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       tmp = M.x86.R_EAX;
-       M.x86.R_EAX = M.x86.R_EBP;
-       M.x86.R_EBP = tmp;
-    } else {
-       tmp = M.x86.R_AX;
-       M.x86.R_AX = M.x86.R_BP;
-       M.x86.R_BP = (u16)tmp;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x96
-****************************************************************************/
-void x86emuOp_xchg_word_AX_SI(u8 X86EMU_UNUSED(op1))
-{
-    u32 tmp;
-
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("XCHG\tEAX,ESI\n");
-    } else {
-       DECODE_PRINTF("XCHG\tAX,SI\n");
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       tmp = M.x86.R_EAX;
-       M.x86.R_EAX = M.x86.R_ESI;
-       M.x86.R_ESI = tmp;
-    } else {
-       tmp = M.x86.R_AX;
-       M.x86.R_AX = M.x86.R_SI;
-       M.x86.R_SI = (u16)tmp;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x97
-****************************************************************************/
-void x86emuOp_xchg_word_AX_DI(u8 X86EMU_UNUSED(op1))
-{
-    u32 tmp;
-
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("XCHG\tEAX,EDI\n");
-    } else {
-       DECODE_PRINTF("XCHG\tAX,DI\n");
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       tmp = M.x86.R_EAX;
-       M.x86.R_EAX = M.x86.R_EDI;
-       M.x86.R_EDI = tmp;
-    } else {
-       tmp = M.x86.R_AX;
-       M.x86.R_AX = M.x86.R_DI;
-       M.x86.R_DI = (u16)tmp;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x98
-****************************************************************************/
-void x86emuOp_cbw(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("CWDE\n");
-    } else {
-       DECODE_PRINTF("CBW\n");
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       if (M.x86.R_AX & 0x8000) {
-           M.x86.R_EAX |= 0xffff0000;
-       } else {
-           M.x86.R_EAX &= 0x0000ffff;
-       }
-    } else {
-       if (M.x86.R_AL & 0x80) {
-           M.x86.R_AH = 0xff;
-       } else {
-           M.x86.R_AH = 0x0;
-       }
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x99
-****************************************************************************/
-void x86emuOp_cwd(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("CDQ\n");
-    } else {
-       DECODE_PRINTF("CWD\n");
-    }
-    DECODE_PRINTF("CWD\n");
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       if (M.x86.R_EAX & 0x80000000) {
-           M.x86.R_EDX = 0xffffffff;
-       } else {
-           M.x86.R_EDX = 0x0;
-       }
-    } else {
-       if (M.x86.R_AX & 0x8000) {
-           M.x86.R_DX = 0xffff;
-       } else {
-           M.x86.R_DX = 0x0;
-       }
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x9a
-****************************************************************************/
-void x86emuOp_call_far_IMM(u8 X86EMU_UNUSED(op1))
-{
-    u16 farseg, faroff;
-
-    START_OF_INSTR();
-       DECODE_PRINTF("CALL\t");
-       faroff = fetch_word_imm();
-       farseg = fetch_word_imm();
-       DECODE_PRINTF2("%04x:", farseg);
-       DECODE_PRINTF2("%04x\n", faroff);
-       CALL_TRACE(M.x86.saved_cs, M.x86.saved_ip, farseg, faroff, "FAR ");
-
-    /* XXX
-     *
-     * Hooked interrupt vectors calling into our "BIOS" will cause
-     * problems unless all intersegment stuff is checked for BIOS
-     * access.  Check needed here.  For moment, let it alone.
-     */
-    TRACE_AND_STEP();
-    push_word(M.x86.R_CS);
-    M.x86.R_CS = farseg;
-    push_word(M.x86.R_IP);
-    M.x86.R_IP = faroff;
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x9b
-****************************************************************************/
-void x86emuOp_wait(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    DECODE_PRINTF("WAIT");
-    TRACE_AND_STEP();
-    /* NADA.  */
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x9c
-****************************************************************************/
-void x86emuOp_pushf_word(u8 X86EMU_UNUSED(op1))
-{
-    u32 flags;
-
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("PUSHFD\n");
-    } else {
-       DECODE_PRINTF("PUSHF\n");
-    }
-    TRACE_AND_STEP();
-
-    /* clear out *all* bits not representing flags, and turn on real bits */
-    flags = (M.x86.R_EFLG & F_MSK) | F_ALWAYS_ON;
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       push_long(flags);
-    } else {
-       push_word((u16)flags);
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x9d
-****************************************************************************/
-void x86emuOp_popf_word(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("POPFD\n");
-    } else {
-       DECODE_PRINTF("POPF\n");
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       M.x86.R_EFLG = pop_long();
-    } else {
-       M.x86.R_FLG = pop_word();
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x9e
-****************************************************************************/
-void x86emuOp_sahf(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    DECODE_PRINTF("SAHF\n");
-    TRACE_AND_STEP();
-    /* clear the lower bits of the flag register */
-    M.x86.R_FLG &= 0xffffff00;
-    /* or in the AH register into the flags register */
-    M.x86.R_FLG |= M.x86.R_AH;
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x9f
-****************************************************************************/
-void x86emuOp_lahf(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    DECODE_PRINTF("LAHF\n");
-    TRACE_AND_STEP();
-       M.x86.R_AH = (u8)(M.x86.R_FLG & 0xff);
-    /*undocumented TC++ behavior??? Nope.  It's documented, but
-       you have too look real hard to notice it. */
-    M.x86.R_AH |= 0x2;
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xa0
-****************************************************************************/
-void x86emuOp_mov_AL_M_IMM(u8 X86EMU_UNUSED(op1))
-{
-    u16 offset;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("MOV\tAL,");
-    offset = fetch_word_imm();
-    DECODE_PRINTF2("[%04x]\n", offset);
-    TRACE_AND_STEP();
-    M.x86.R_AL = fetch_data_byte(offset);
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xa1
-****************************************************************************/
-void x86emuOp_mov_AX_M_IMM(u8 X86EMU_UNUSED(op1))
-{
-    u16 offset;
-
-    START_OF_INSTR();
-    offset = fetch_word_imm();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF2("MOV\tEAX,[%04x]\n", offset);
-    } else {
-       DECODE_PRINTF2("MOV\tAX,[%04x]\n", offset);
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       M.x86.R_EAX = fetch_data_long(offset);
-    } else {
-       M.x86.R_AX = fetch_data_word(offset);
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xa2
-****************************************************************************/
-void x86emuOp_mov_M_AL_IMM(u8 X86EMU_UNUSED(op1))
-{
-    u16 offset;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("MOV\t");
-    offset = fetch_word_imm();
-    DECODE_PRINTF2("[%04x],AL\n", offset);
-    TRACE_AND_STEP();
-    store_data_byte(offset, M.x86.R_AL);
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xa3
-****************************************************************************/
-void x86emuOp_mov_M_AX_IMM(u8 X86EMU_UNUSED(op1))
-{
-    u16 offset;
-
-    START_OF_INSTR();
-    offset = fetch_word_imm();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF2("MOV\t[%04x],EAX\n", offset);
-    } else {
-       DECODE_PRINTF2("MOV\t[%04x],AX\n", offset);
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       store_data_long(offset, M.x86.R_EAX);
-    } else {
-       store_data_word(offset, M.x86.R_AX);
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xa4
-****************************************************************************/
-void x86emuOp_movs_byte(u8 X86EMU_UNUSED(op1))
-{
-    u8  val;
-    u32 count;
-    int inc;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("MOVS\tBYTE\n");
-    if (ACCESS_FLAG(F_DF))   /* down */
-       inc = -1;
-    else
-       inc = 1;
-    TRACE_AND_STEP();
-    count = 1;
-    if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) {
-       /* dont care whether REPE or REPNE */
-       /* move them until CX is ZERO. */
-       count = M.x86.R_CX;
-       M.x86.R_CX = 0;
-       M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
-    }
-    while (count--) {
-       val = fetch_data_byte(M.x86.R_SI);
-       store_data_byte_abs(M.x86.R_ES, M.x86.R_DI, val);
-       M.x86.R_SI += inc;
-       M.x86.R_DI += inc;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xa5
-****************************************************************************/
-void x86emuOp_movs_word(u8 X86EMU_UNUSED(op1))
-{
-    u32 val;
-    int inc;
-    u32 count;
-
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("MOVS\tDWORD\n");
-       if (ACCESS_FLAG(F_DF))      /* down */
-           inc = -4;
-       else
-           inc = 4;
-    } else {
-       DECODE_PRINTF("MOVS\tWORD\n");
-       if (ACCESS_FLAG(F_DF))      /* down */
-           inc = -2;
-       else
-           inc = 2;
-    }
-    TRACE_AND_STEP();
-    count = 1;
-    if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) {
-       /* dont care whether REPE or REPNE */
-       /* move them until CX is ZERO. */
-       count = M.x86.R_CX;
-       M.x86.R_CX = 0;
-       M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
-    }
-    while (count--) {
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           val = fetch_data_long(M.x86.R_SI);
-           store_data_long_abs(M.x86.R_ES, M.x86.R_DI, val);
-       } else {
-           val = fetch_data_word(M.x86.R_SI);
-           store_data_word_abs(M.x86.R_ES, M.x86.R_DI, (u16)val);
-       }
-       M.x86.R_SI += inc;
-       M.x86.R_DI += inc;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xa6
-****************************************************************************/
-void x86emuOp_cmps_byte(u8 X86EMU_UNUSED(op1))
-{
-    s8 val1, val2;
-    int inc;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("CMPS\tBYTE\n");
-    TRACE_AND_STEP();
-    if (ACCESS_FLAG(F_DF))   /* down */
-       inc = -1;
-    else
-       inc = 1;
-
-    if (M.x86.mode & SYSMODE_PREFIX_REPE) {
-       /* REPE  */
-       /* move them until CX is ZERO. */
-       while (M.x86.R_CX != 0) {
-           val1 = fetch_data_byte(M.x86.R_SI);
-           val2 = fetch_data_byte_abs(M.x86.R_ES, M.x86.R_DI);
-                    cmp_byte(val1, val2);
-           M.x86.R_CX -= 1;
-           M.x86.R_SI += inc;
-           M.x86.R_DI += inc;
-           if (ACCESS_FLAG(F_ZF) == 0)
-               break;
-       }
-       M.x86.mode &= ~SYSMODE_PREFIX_REPE;
-    } else if (M.x86.mode & SYSMODE_PREFIX_REPNE) {
-       /* REPNE  */
-       /* move them until CX is ZERO. */
-       while (M.x86.R_CX != 0) {
-           val1 = fetch_data_byte(M.x86.R_SI);
-           val2 = fetch_data_byte_abs(M.x86.R_ES, M.x86.R_DI);
-           cmp_byte(val1, val2);
-           M.x86.R_CX -= 1;
-           M.x86.R_SI += inc;
-           M.x86.R_DI += inc;
-           if (ACCESS_FLAG(F_ZF))
-               break;          /* zero flag set means equal */
-       }
-       M.x86.mode &= ~SYSMODE_PREFIX_REPNE;
-    } else {
-       val1 = fetch_data_byte(M.x86.R_SI);
-       val2 = fetch_data_byte_abs(M.x86.R_ES, M.x86.R_DI);
-       cmp_byte(val1, val2);
-       M.x86.R_SI += inc;
-       M.x86.R_DI += inc;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xa7
-****************************************************************************/
-void x86emuOp_cmps_word(u8 X86EMU_UNUSED(op1))
-{
-    u32 val1,val2;
-    int inc;
-
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("CMPS\tDWORD\n");
-       if (ACCESS_FLAG(F_DF))   /* down */
-           inc = -4;
-       else
-           inc = 4;
-    } else {
-       DECODE_PRINTF("CMPS\tWORD\n");
-       if (ACCESS_FLAG(F_DF))   /* down */
-           inc = -2;
-       else
-           inc = 2;
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_REPE) {
-       /* REPE  */
-       /* move them until CX is ZERO. */
-       while (M.x86.R_CX != 0) {
-           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-               val1 = fetch_data_long(M.x86.R_SI);
-               val2 = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI);
-               cmp_long(val1, val2);
-           } else {
-               val1 = fetch_data_word(M.x86.R_SI);
-               val2 = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI);
-               cmp_word((u16)val1, (u16)val2);
-           }
-           M.x86.R_CX -= 1;
-           M.x86.R_SI += inc;
-           M.x86.R_DI += inc;
-           if (ACCESS_FLAG(F_ZF) == 0)
-               break;
-       }
-       M.x86.mode &= ~SYSMODE_PREFIX_REPE;
-    } else if (M.x86.mode & SYSMODE_PREFIX_REPNE) {
-       /* REPNE  */
-       /* move them until CX is ZERO. */
-       while (M.x86.R_CX != 0) {
-           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-               val1 = fetch_data_long(M.x86.R_SI);
-               val2 = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI);
-               cmp_long(val1, val2);
-           } else {
-               val1 = fetch_data_word(M.x86.R_SI);
-               val2 = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI);
-               cmp_word((u16)val1, (u16)val2);
-           }
-           M.x86.R_CX -= 1;
-           M.x86.R_SI += inc;
-           M.x86.R_DI += inc;
-           if (ACCESS_FLAG(F_ZF))
-               break;          /* zero flag set means equal */
-       }
-       M.x86.mode &= ~SYSMODE_PREFIX_REPNE;
-    } else {
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           val1 = fetch_data_long(M.x86.R_SI);
-           val2 = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI);
-           cmp_long(val1, val2);
-       } else {
-           val1 = fetch_data_word(M.x86.R_SI);
-           val2 = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI);
-           cmp_word((u16)val1, (u16)val2);
-       }
-       M.x86.R_SI += inc;
-       M.x86.R_DI += inc;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xa8
-****************************************************************************/
-void x86emuOp_test_AL_IMM(u8 X86EMU_UNUSED(op1))
-{
-    int imm;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("TEST\tAL,");
-    imm = fetch_byte_imm();
-    DECODE_PRINTF2("%04x\n", imm);
-    TRACE_AND_STEP();
-       test_byte(M.x86.R_AL, (u8)imm);
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xa9
-****************************************************************************/
-void x86emuOp_test_AX_IMM(u8 X86EMU_UNUSED(op1))
-{
-    u32 srcval;
-
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("TEST\tEAX,");
-       srcval = fetch_long_imm();
-    } else {
-       DECODE_PRINTF("TEST\tAX,");
-       srcval = fetch_word_imm();
-    }
-    DECODE_PRINTF2("%x\n", srcval);
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       test_long(M.x86.R_EAX, srcval);
-    } else {
-       test_word(M.x86.R_AX, (u16)srcval);
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xaa
-****************************************************************************/
-void x86emuOp_stos_byte(u8 X86EMU_UNUSED(op1))
-{
-    int inc;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("STOS\tBYTE\n");
-    if (ACCESS_FLAG(F_DF))   /* down */
-       inc = -1;
-    else
-       inc = 1;
-    TRACE_AND_STEP();
-    if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) {
-       /* dont care whether REPE or REPNE */
-       /* move them until CX is ZERO. */
-       while (M.x86.R_CX != 0) {
-           store_data_byte_abs(M.x86.R_ES, M.x86.R_DI, M.x86.R_AL);
-           M.x86.R_CX -= 1;
-           M.x86.R_DI += inc;
-       }
-       M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
-    } else {
-       store_data_byte_abs(M.x86.R_ES, M.x86.R_DI, M.x86.R_AL);
-       M.x86.R_DI += inc;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xab
-****************************************************************************/
-void x86emuOp_stos_word(u8 X86EMU_UNUSED(op1))
-{
-    int inc;
-    u32 count;
-
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("STOS\tDWORD\n");
-       if (ACCESS_FLAG(F_DF))   /* down */
-           inc = -4;
-       else
-           inc = 4;
-    } else {
-       DECODE_PRINTF("STOS\tWORD\n");
-       if (ACCESS_FLAG(F_DF))   /* down */
-           inc = -2;
-       else
-           inc = 2;
-    }
-    TRACE_AND_STEP();
-    count = 1;
-    if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) {
-       /* dont care whether REPE or REPNE */
-       /* move them until CX is ZERO. */
-       count = M.x86.R_CX;
-       M.x86.R_CX = 0;
-       M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
-    }
-    while (count--) {
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           store_data_long_abs(M.x86.R_ES, M.x86.R_DI, M.x86.R_EAX);
-       } else {
-           store_data_word_abs(M.x86.R_ES, M.x86.R_DI, M.x86.R_AX);
-       }
-       M.x86.R_DI += inc;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xac
-****************************************************************************/
-void x86emuOp_lods_byte(u8 X86EMU_UNUSED(op1))
-{
-    int inc;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("LODS\tBYTE\n");
-    TRACE_AND_STEP();
-    if (ACCESS_FLAG(F_DF))   /* down */
-       inc = -1;
-    else
-       inc = 1;
-    if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) {
-       /* dont care whether REPE or REPNE */
-       /* move them until CX is ZERO. */
-       while (M.x86.R_CX != 0) {
-           M.x86.R_AL = fetch_data_byte(M.x86.R_SI);
-           M.x86.R_CX -= 1;
-           M.x86.R_SI += inc;
-       }
-       M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
-    } else {
-       M.x86.R_AL = fetch_data_byte(M.x86.R_SI);
-       M.x86.R_SI += inc;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xad
-****************************************************************************/
-void x86emuOp_lods_word(u8 X86EMU_UNUSED(op1))
-{
-    int inc;
-    u32 count;
-
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("LODS\tDWORD\n");
-       if (ACCESS_FLAG(F_DF))   /* down */
-           inc = -4;
-       else
-           inc = 4;
-    } else {
-       DECODE_PRINTF("LODS\tWORD\n");
-       if (ACCESS_FLAG(F_DF))   /* down */
-           inc = -2;
-       else
-           inc = 2;
-    }
-    TRACE_AND_STEP();
-    count = 1;
-    if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) {
-       /* dont care whether REPE or REPNE */
-       /* move them until CX is ZERO. */
-       count = M.x86.R_CX;
-       M.x86.R_CX = 0;
-       M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
-    }
-    while (count--) {
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           M.x86.R_EAX = fetch_data_long(M.x86.R_SI);
-       } else {
-           M.x86.R_AX = fetch_data_word(M.x86.R_SI);
-       }
-       M.x86.R_SI += inc;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xae
-****************************************************************************/
-void x86emuOp_scas_byte(u8 X86EMU_UNUSED(op1))
-{
-    s8 val2;
-    int inc;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("SCAS\tBYTE\n");
-    TRACE_AND_STEP();
-    if (ACCESS_FLAG(F_DF))   /* down */
-       inc = -1;
-    else
-       inc = 1;
-    if (M.x86.mode & SYSMODE_PREFIX_REPE) {
-       /* REPE  */
-       /* move them until CX is ZERO. */
-       while (M.x86.R_CX != 0) {
-           val2 = fetch_data_byte_abs(M.x86.R_ES, M.x86.R_DI);
-           cmp_byte(M.x86.R_AL, val2);
-           M.x86.R_CX -= 1;
-           M.x86.R_DI += inc;
-           if (ACCESS_FLAG(F_ZF) == 0)
-               break;
-       }
-       M.x86.mode &= ~SYSMODE_PREFIX_REPE;
-    } else if (M.x86.mode & SYSMODE_PREFIX_REPNE) {
-       /* REPNE  */
-       /* move them until CX is ZERO. */
-       while (M.x86.R_CX != 0) {
-           val2 = fetch_data_byte_abs(M.x86.R_ES, M.x86.R_DI);
-           cmp_byte(M.x86.R_AL, val2);
-           M.x86.R_CX -= 1;
-           M.x86.R_DI += inc;
-           if (ACCESS_FLAG(F_ZF))
-               break;          /* zero flag set means equal */
-       }
-       M.x86.mode &= ~SYSMODE_PREFIX_REPNE;
-    } else {
-       val2 = fetch_data_byte_abs(M.x86.R_ES, M.x86.R_DI);
-       cmp_byte(M.x86.R_AL, val2);
-       M.x86.R_DI += inc;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xaf
-****************************************************************************/
-void x86emuOp_scas_word(u8 X86EMU_UNUSED(op1))
-{
-    int inc;
-    u32 val;
-
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("SCAS\tDWORD\n");
-       if (ACCESS_FLAG(F_DF))   /* down */
-           inc = -4;
-       else
-           inc = 4;
-    } else {
-       DECODE_PRINTF("SCAS\tWORD\n");
-       if (ACCESS_FLAG(F_DF))   /* down */
-           inc = -2;
-       else
-           inc = 2;
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_REPE) {
-       /* REPE  */
-       /* move them until CX is ZERO. */
-       while (M.x86.R_CX != 0) {
-           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-               val = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI);
-               cmp_long(M.x86.R_EAX, val);
-           } else {
-               val = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI);
-               cmp_word(M.x86.R_AX, (u16)val);
-           }
-           M.x86.R_CX -= 1;
-           M.x86.R_DI += inc;
-           if (ACCESS_FLAG(F_ZF) == 0)
-               break;
-       }
-       M.x86.mode &= ~SYSMODE_PREFIX_REPE;
-    } else if (M.x86.mode & SYSMODE_PREFIX_REPNE) {
-       /* REPNE  */
-       /* move them until CX is ZERO. */
-       while (M.x86.R_CX != 0) {
-           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-               val = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI);
-               cmp_long(M.x86.R_EAX, val);
-           } else {
-               val = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI);
-               cmp_word(M.x86.R_AX, (u16)val);
-           }
-           M.x86.R_CX -= 1;
-           M.x86.R_DI += inc;
-           if (ACCESS_FLAG(F_ZF))
-               break;          /* zero flag set means equal */
-       }
-       M.x86.mode &= ~SYSMODE_PREFIX_REPNE;
-    } else {
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           val = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI);
-           cmp_long(M.x86.R_EAX, val);
-       } else {
-           val = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI);
-           cmp_word(M.x86.R_AX, (u16)val);
-       }
-       M.x86.R_DI += inc;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xb0
-****************************************************************************/
-void x86emuOp_mov_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
-{
-    u8 imm;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("MOV\tAL,");
-    imm = fetch_byte_imm();
-    DECODE_PRINTF2("%x\n", imm);
-    TRACE_AND_STEP();
-    M.x86.R_AL = imm;
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xb1
-****************************************************************************/
-void x86emuOp_mov_byte_CL_IMM(u8 X86EMU_UNUSED(op1))
-{
-    u8 imm;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("MOV\tCL,");
-    imm = fetch_byte_imm();
-    DECODE_PRINTF2("%x\n", imm);
-    TRACE_AND_STEP();
-    M.x86.R_CL = imm;
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xb2
-****************************************************************************/
-void x86emuOp_mov_byte_DL_IMM(u8 X86EMU_UNUSED(op1))
-{
-    u8 imm;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("MOV\tDL,");
-    imm = fetch_byte_imm();
-    DECODE_PRINTF2("%x\n", imm);
-    TRACE_AND_STEP();
-    M.x86.R_DL = imm;
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xb3
-****************************************************************************/
-void x86emuOp_mov_byte_BL_IMM(u8 X86EMU_UNUSED(op1))
-{
-    u8 imm;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("MOV\tBL,");
-    imm = fetch_byte_imm();
-    DECODE_PRINTF2("%x\n", imm);
-    TRACE_AND_STEP();
-    M.x86.R_BL = imm;
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xb4
-****************************************************************************/
-void x86emuOp_mov_byte_AH_IMM(u8 X86EMU_UNUSED(op1))
-{
-    u8 imm;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("MOV\tAH,");
-    imm = fetch_byte_imm();
-    DECODE_PRINTF2("%x\n", imm);
-    TRACE_AND_STEP();
-    M.x86.R_AH = imm;
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xb5
-****************************************************************************/
-void x86emuOp_mov_byte_CH_IMM(u8 X86EMU_UNUSED(op1))
-{
-    u8 imm;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("MOV\tCH,");
-    imm = fetch_byte_imm();
-    DECODE_PRINTF2("%x\n", imm);
-    TRACE_AND_STEP();
-    M.x86.R_CH = imm;
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xb6
-****************************************************************************/
-void x86emuOp_mov_byte_DH_IMM(u8 X86EMU_UNUSED(op1))
-{
-    u8 imm;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("MOV\tDH,");
-    imm = fetch_byte_imm();
-    DECODE_PRINTF2("%x\n", imm);
-    TRACE_AND_STEP();
-    M.x86.R_DH = imm;
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xb7
-****************************************************************************/
-void x86emuOp_mov_byte_BH_IMM(u8 X86EMU_UNUSED(op1))
-{
-    u8 imm;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("MOV\tBH,");
-    imm = fetch_byte_imm();
-    DECODE_PRINTF2("%x\n", imm);
-    TRACE_AND_STEP();
-    M.x86.R_BH = imm;
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xb8
-****************************************************************************/
-void x86emuOp_mov_word_AX_IMM(u8 X86EMU_UNUSED(op1))
-{
-    u32 srcval;
-
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("MOV\tEAX,");
-       srcval = fetch_long_imm();
-    } else {
-       DECODE_PRINTF("MOV\tAX,");
-       srcval = fetch_word_imm();
-    }
-    DECODE_PRINTF2("%x\n", srcval);
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       M.x86.R_EAX = srcval;
-    } else {
-       M.x86.R_AX = (u16)srcval;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xb9
-****************************************************************************/
-void x86emuOp_mov_word_CX_IMM(u8 X86EMU_UNUSED(op1))
-{
-    u32 srcval;
-
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("MOV\tECX,");
-       srcval = fetch_long_imm();
-    } else {
-       DECODE_PRINTF("MOV\tCX,");
-       srcval = fetch_word_imm();
-    }
-    DECODE_PRINTF2("%x\n", srcval);
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       M.x86.R_ECX = srcval;
-    } else {
-       M.x86.R_CX = (u16)srcval;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xba
-****************************************************************************/
-void x86emuOp_mov_word_DX_IMM(u8 X86EMU_UNUSED(op1))
-{
-    u32 srcval;
-
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("MOV\tEDX,");
-       srcval = fetch_long_imm();
-    } else {
-       DECODE_PRINTF("MOV\tDX,");
-       srcval = fetch_word_imm();
-    }
-    DECODE_PRINTF2("%x\n", srcval);
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       M.x86.R_EDX = srcval;
-    } else {
-       M.x86.R_DX = (u16)srcval;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xbb
-****************************************************************************/
-void x86emuOp_mov_word_BX_IMM(u8 X86EMU_UNUSED(op1))
-{
-    u32 srcval;
-
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("MOV\tEBX,");
-       srcval = fetch_long_imm();
-    } else {
-       DECODE_PRINTF("MOV\tBX,");
-       srcval = fetch_word_imm();
-    }
-    DECODE_PRINTF2("%x\n", srcval);
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       M.x86.R_EBX = srcval;
-    } else {
-       M.x86.R_BX = (u16)srcval;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xbc
-****************************************************************************/
-void x86emuOp_mov_word_SP_IMM(u8 X86EMU_UNUSED(op1))
-{
-    u32 srcval;
-
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("MOV\tESP,");
-       srcval = fetch_long_imm();
-    } else {
-       DECODE_PRINTF("MOV\tSP,");
-       srcval = fetch_word_imm();
-    }
-    DECODE_PRINTF2("%x\n", srcval);
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       M.x86.R_ESP = srcval;
-    } else {
-       M.x86.R_SP = (u16)srcval;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xbd
-****************************************************************************/
-void x86emuOp_mov_word_BP_IMM(u8 X86EMU_UNUSED(op1))
-{
-    u32 srcval;
-
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("MOV\tEBP,");
-       srcval = fetch_long_imm();
-    } else {
-       DECODE_PRINTF("MOV\tBP,");
-       srcval = fetch_word_imm();
-    }
-    DECODE_PRINTF2("%x\n", srcval);
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       M.x86.R_EBP = srcval;
-    } else {
-       M.x86.R_BP = (u16)srcval;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xbe
-****************************************************************************/
-void x86emuOp_mov_word_SI_IMM(u8 X86EMU_UNUSED(op1))
-{
-    u32 srcval;
-
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("MOV\tESI,");
-       srcval = fetch_long_imm();
-    } else {
-       DECODE_PRINTF("MOV\tSI,");
-       srcval = fetch_word_imm();
-    }
-    DECODE_PRINTF2("%x\n", srcval);
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       M.x86.R_ESI = srcval;
-    } else {
-       M.x86.R_SI = (u16)srcval;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xbf
-****************************************************************************/
-void x86emuOp_mov_word_DI_IMM(u8 X86EMU_UNUSED(op1))
-{
-    u32 srcval;
-
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("MOV\tEDI,");
-       srcval = fetch_long_imm();
-    } else {
-       DECODE_PRINTF("MOV\tDI,");
-       srcval = fetch_word_imm();
-    }
-    DECODE_PRINTF2("%x\n", srcval);
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       M.x86.R_EDI = srcval;
-    } else {
-       M.x86.R_DI = (u16)srcval;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/* used by opcodes c0, d0, and d2. */
-static u8(*opcD0_byte_operation[])(u8 d, u8 s) =
-{
-    rol_byte,
-    ror_byte,
-    rcl_byte,
-    rcr_byte,
-    shl_byte,
-    shr_byte,
-    shl_byte,           /* sal_byte === shl_byte  by definition */
-    sar_byte,
-};
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xc0
-****************************************************************************/
-void x86emuOp_opcC0_byte_RM_MEM(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    u8 *destreg;
-    uint destoffset;
-    u8 destval;
-    u8 amt;
-
-    /*
-     * Yet another weirdo special case instruction format.  Part of
-     * the opcode held below in "RH".  Doubly nested case would
-     * result, except that the decoded instruction
-     */
-    START_OF_INSTR();
-    FETCH_DECODE_MODRM(mod, rh, rl);
-#ifdef DEBUG
-    if (DEBUG_DECODE()) {
-       /* XXX DECODE_PRINTF may be changed to something more
-          general, so that it is important to leave the strings
-          in the same format, even though the result is that the
-          above test is done twice. */
-
-       switch (rh) {
-       case 0:
-           DECODE_PRINTF("ROL\t");
-           break;
-       case 1:
-           DECODE_PRINTF("ROR\t");
-           break;
-       case 2:
-           DECODE_PRINTF("RCL\t");
-           break;
-       case 3:
-           DECODE_PRINTF("RCR\t");
-           break;
-       case 4:
-           DECODE_PRINTF("SHL\t");
-           break;
-       case 5:
-           DECODE_PRINTF("SHR\t");
-           break;
-       case 6:
-           DECODE_PRINTF("SAL\t");
-           break;
-       case 7:
-           DECODE_PRINTF("SAR\t");
-           break;
-       }
-    }
-#endif
-    /* know operation, decode the mod byte to find the addressing
-       mode. */
-    switch (mod) {
-    case 0:
-       DECODE_PRINTF("BYTE PTR ");
-       destoffset = decode_rm00_address(rl);
-       amt = fetch_byte_imm();
-       DECODE_PRINTF2(",%x\n", amt);
-       destval = fetch_data_byte(destoffset);
-       TRACE_AND_STEP();
-       destval = (*opcD0_byte_operation[rh]) (destval, amt);
-       store_data_byte(destoffset, destval);
-       break;
-    case 1:
-       DECODE_PRINTF("BYTE PTR ");
-       destoffset = decode_rm01_address(rl);
-       amt = fetch_byte_imm();
-       DECODE_PRINTF2(",%x\n", amt);
-       destval = fetch_data_byte(destoffset);
-       TRACE_AND_STEP();
-       destval = (*opcD0_byte_operation[rh]) (destval, amt);
-       store_data_byte(destoffset, destval);
-       break;
-    case 2:
-       DECODE_PRINTF("BYTE PTR ");
-       destoffset = decode_rm10_address(rl);
-       amt = fetch_byte_imm();
-       DECODE_PRINTF2(",%x\n", amt);
-       destval = fetch_data_byte(destoffset);
-       TRACE_AND_STEP();
-       destval = (*opcD0_byte_operation[rh]) (destval, amt);
-       store_data_byte(destoffset, destval);
-       break;
-    case 3:                     /* register to register */
-       destreg = DECODE_RM_BYTE_REGISTER(rl);
-       amt = fetch_byte_imm();
-       DECODE_PRINTF2(",%x\n", amt);
-       TRACE_AND_STEP();
-       destval = (*opcD0_byte_operation[rh]) (*destreg, amt);
-       *destreg = destval;
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/* used by opcodes c1, d1, and d3. */
-static u16(*opcD1_word_operation[])(u16 s, u8 d) =
-{
-    rol_word,
-    ror_word,
-    rcl_word,
-    rcr_word,
-    shl_word,
-    shr_word,
-    shl_word,           /* sal_byte === shl_byte  by definition */
-    sar_word,
-};
-
-/* used by opcodes c1, d1, and d3. */
-static u32 (*opcD1_long_operation[])(u32 s, u8 d) =
-{
-    rol_long,
-    ror_long,
-    rcl_long,
-    rcr_long,
-    shl_long,
-    shr_long,
-    shl_long,           /* sal_byte === shl_byte  by definition */
-    sar_long,
-};
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xc1
-****************************************************************************/
-void x86emuOp_opcC1_word_RM_MEM(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    uint destoffset;
-    u8 amt;
-
-    /*
-     * Yet another weirdo special case instruction format.  Part of
-     * the opcode held below in "RH".  Doubly nested case would
-     * result, except that the decoded instruction
-     */
-    START_OF_INSTR();
-    FETCH_DECODE_MODRM(mod, rh, rl);
-#ifdef DEBUG
-    if (DEBUG_DECODE()) {
-       /* XXX DECODE_PRINTF may be changed to something more
-          general, so that it is important to leave the strings
-          in the same format, even though the result is that the
-          above test is done twice. */
-
-       switch (rh) {
-       case 0:
-           DECODE_PRINTF("ROL\t");
-           break;
-       case 1:
-           DECODE_PRINTF("ROR\t");
-           break;
-       case 2:
-           DECODE_PRINTF("RCL\t");
-           break;
-       case 3:
-           DECODE_PRINTF("RCR\t");
-           break;
-       case 4:
-           DECODE_PRINTF("SHL\t");
-           break;
-       case 5:
-           DECODE_PRINTF("SHR\t");
-           break;
-       case 6:
-           DECODE_PRINTF("SAL\t");
-           break;
-       case 7:
-           DECODE_PRINTF("SAR\t");
-           break;
-       }
-    }
-#endif
-    /* know operation, decode the mod byte to find the addressing
-       mode. */
-    switch (mod) {
-    case 0:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-
-           DECODE_PRINTF("DWORD PTR ");
-           destoffset = decode_rm00_address(rl);
-           amt = fetch_byte_imm();
-           DECODE_PRINTF2(",%x\n", amt);
-           destval = fetch_data_long(destoffset);
-           TRACE_AND_STEP();
-           destval = (*opcD1_long_operation[rh]) (destval, amt);
-           store_data_long(destoffset, destval);
-       } else {
-           u16 destval;
-
-           DECODE_PRINTF("WORD PTR ");
-           destoffset = decode_rm00_address(rl);
-           amt = fetch_byte_imm();
-           DECODE_PRINTF2(",%x\n", amt);
-           destval = fetch_data_word(destoffset);
-           TRACE_AND_STEP();
-           destval = (*opcD1_word_operation[rh]) (destval, amt);
-           store_data_word(destoffset, destval);
-       }
-       break;
-    case 1:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-
-           DECODE_PRINTF("DWORD PTR ");
-           destoffset = decode_rm01_address(rl);
-           amt = fetch_byte_imm();
-           DECODE_PRINTF2(",%x\n", amt);
-           destval = fetch_data_long(destoffset);
-           TRACE_AND_STEP();
-           destval = (*opcD1_long_operation[rh]) (destval, amt);
-           store_data_long(destoffset, destval);
-       } else {
-           u16 destval;
-
-           DECODE_PRINTF("WORD PTR ");
-           destoffset = decode_rm01_address(rl);
-           amt = fetch_byte_imm();
-           DECODE_PRINTF2(",%x\n", amt);
-           destval = fetch_data_word(destoffset);
-           TRACE_AND_STEP();
-           destval = (*opcD1_word_operation[rh]) (destval, amt);
-           store_data_word(destoffset, destval);
-       }
-       break;
-    case 2:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-
-           DECODE_PRINTF("DWORD PTR ");
-           destoffset = decode_rm10_address(rl);
-           amt = fetch_byte_imm();
-           DECODE_PRINTF2(",%x\n", amt);
-           destval = fetch_data_long(destoffset);
-           TRACE_AND_STEP();
-           destval = (*opcD1_long_operation[rh]) (destval, amt);
-           store_data_long(destoffset, destval);
-       } else {
-           u16 destval;
-
-           DECODE_PRINTF("WORD PTR ");
-           destoffset = decode_rm10_address(rl);
-           amt = fetch_byte_imm();
-           DECODE_PRINTF2(",%x\n", amt);
-           destval = fetch_data_word(destoffset);
-           TRACE_AND_STEP();
-           destval = (*opcD1_word_operation[rh]) (destval, amt);
-           store_data_word(destoffset, destval);
-       }
-       break;
-    case 3:                     /* register to register */
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg;
-
-           destreg = DECODE_RM_LONG_REGISTER(rl);
-           amt = fetch_byte_imm();
-           DECODE_PRINTF2(",%x\n", amt);
-           TRACE_AND_STEP();
-           *destreg = (*opcD1_long_operation[rh]) (*destreg, amt);
-       } else {
-           u16 *destreg;
-
-           destreg = DECODE_RM_WORD_REGISTER(rl);
-           amt = fetch_byte_imm();
-           DECODE_PRINTF2(",%x\n", amt);
-           TRACE_AND_STEP();
-           *destreg = (*opcD1_word_operation[rh]) (*destreg, amt);
-       }
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xc2
-****************************************************************************/
-void x86emuOp_ret_near_IMM(u8 X86EMU_UNUSED(op1))
-{
-    u16 imm;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("RET\t");
-    imm = fetch_word_imm();
-    DECODE_PRINTF2("%x\n", imm);
-       RETURN_TRACE("RET",M.x86.saved_cs,M.x86.saved_ip);
-       TRACE_AND_STEP();
-    M.x86.R_IP = pop_word();
-    M.x86.R_SP += imm;
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xc3
-****************************************************************************/
-void x86emuOp_ret_near(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    DECODE_PRINTF("RET\n");
-       RETURN_TRACE("RET",M.x86.saved_cs,M.x86.saved_ip);
-       TRACE_AND_STEP();
-    M.x86.R_IP = pop_word();
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xc4
-****************************************************************************/
-void x86emuOp_les_R_IMM(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rh, rl;
-    u16 *dstreg;
-    uint srcoffset;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("LES\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       dstreg = DECODE_RM_WORD_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm00_address(rl);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *dstreg = fetch_data_word(srcoffset);
-       M.x86.R_ES = fetch_data_word(srcoffset + 2);
-       break;
-    case 1:
-       dstreg = DECODE_RM_WORD_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm01_address(rl);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *dstreg = fetch_data_word(srcoffset);
-       M.x86.R_ES = fetch_data_word(srcoffset + 2);
-       break;
-    case 2:
-       dstreg = DECODE_RM_WORD_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm10_address(rl);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *dstreg = fetch_data_word(srcoffset);
-       M.x86.R_ES = fetch_data_word(srcoffset + 2);
-       break;
-    case 3:                     /* register to register */
-       /* UNDEFINED! */
-       TRACE_AND_STEP();
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xc5
-****************************************************************************/
-void x86emuOp_lds_R_IMM(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rh, rl;
-    u16 *dstreg;
-    uint srcoffset;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("LDS\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       dstreg = DECODE_RM_WORD_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm00_address(rl);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *dstreg = fetch_data_word(srcoffset);
-       M.x86.R_DS = fetch_data_word(srcoffset + 2);
-       break;
-    case 1:
-       dstreg = DECODE_RM_WORD_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm01_address(rl);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *dstreg = fetch_data_word(srcoffset);
-       M.x86.R_DS = fetch_data_word(srcoffset + 2);
-       break;
-    case 2:
-       dstreg = DECODE_RM_WORD_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm10_address(rl);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *dstreg = fetch_data_word(srcoffset);
-       M.x86.R_DS = fetch_data_word(srcoffset + 2);
-       break;
-    case 3:                     /* register to register */
-       /* UNDEFINED! */
-       TRACE_AND_STEP();
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xc6
-****************************************************************************/
-void x86emuOp_mov_byte_RM_IMM(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    u8 *destreg;
-    uint destoffset;
-    u8 imm;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("MOV\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    if (rh != 0) {
-       DECODE_PRINTF("ILLEGAL DECODE OF OPCODE c6\n");
-       HALT_SYS();
-    }
-    switch (mod) {
-    case 0:
-       DECODE_PRINTF("BYTE PTR ");
-       destoffset = decode_rm00_address(rl);
-       imm = fetch_byte_imm();
-       DECODE_PRINTF2(",%2x\n", imm);
-       TRACE_AND_STEP();
-       store_data_byte(destoffset, imm);
-       break;
-    case 1:
-       DECODE_PRINTF("BYTE PTR ");
-       destoffset = decode_rm01_address(rl);
-       imm = fetch_byte_imm();
-       DECODE_PRINTF2(",%2x\n", imm);
-       TRACE_AND_STEP();
-       store_data_byte(destoffset, imm);
-       break;
-    case 2:
-       DECODE_PRINTF("BYTE PTR ");
-       destoffset = decode_rm10_address(rl);
-       imm = fetch_byte_imm();
-       DECODE_PRINTF2(",%2x\n", imm);
-       TRACE_AND_STEP();
-       store_data_byte(destoffset, imm);
-       break;
-    case 3:                     /* register to register */
-       destreg = DECODE_RM_BYTE_REGISTER(rl);
-       imm = fetch_byte_imm();
-       DECODE_PRINTF2(",%2x\n", imm);
-       TRACE_AND_STEP();
-       *destreg = imm;
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xc7
-****************************************************************************/
-void x86emuOp_mov_word_RM_IMM(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    uint destoffset;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("MOV\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    if (rh != 0) {
-       DECODE_PRINTF("ILLEGAL DECODE OF OPCODE 8F\n");
-       HALT_SYS();
-    }
-    switch (mod) {
-    case 0:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 imm;
-
-           DECODE_PRINTF("DWORD PTR ");
-           destoffset = decode_rm00_address(rl);
-           imm = fetch_long_imm();
-           DECODE_PRINTF2(",%x\n", imm);
-           TRACE_AND_STEP();
-           store_data_long(destoffset, imm);
-       } else {
-           u16 imm;
-
-           DECODE_PRINTF("WORD PTR ");
-           destoffset = decode_rm00_address(rl);
-           imm = fetch_word_imm();
-           DECODE_PRINTF2(",%x\n", imm);
-           TRACE_AND_STEP();
-           store_data_word(destoffset, imm);
-       }
-       break;
-    case 1:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 imm;
-
-           DECODE_PRINTF("DWORD PTR ");
-           destoffset = decode_rm01_address(rl);
-           imm = fetch_long_imm();
-           DECODE_PRINTF2(",%x\n", imm);
-           TRACE_AND_STEP();
-           store_data_long(destoffset, imm);
-       } else {
-           u16 imm;
-
-           DECODE_PRINTF("WORD PTR ");
-           destoffset = decode_rm01_address(rl);
-           imm = fetch_word_imm();
-           DECODE_PRINTF2(",%x\n", imm);
-           TRACE_AND_STEP();
-           store_data_word(destoffset, imm);
-       }
-       break;
-    case 2:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 imm;
-
-           DECODE_PRINTF("DWORD PTR ");
-           destoffset = decode_rm10_address(rl);
-           imm = fetch_long_imm();
-           DECODE_PRINTF2(",%x\n", imm);
-           TRACE_AND_STEP();
-           store_data_long(destoffset, imm);
-       } else {
-           u16 imm;
-
-           DECODE_PRINTF("WORD PTR ");
-           destoffset = decode_rm10_address(rl);
-           imm = fetch_word_imm();
-           DECODE_PRINTF2(",%x\n", imm);
-           TRACE_AND_STEP();
-           store_data_word(destoffset, imm);
-       }
-       break;
-    case 3:                     /* register to register */
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-                       u32 *destreg;
-                       u32 imm;
-
-           destreg = DECODE_RM_LONG_REGISTER(rl);
-           imm = fetch_long_imm();
-           DECODE_PRINTF2(",%x\n", imm);
-           TRACE_AND_STEP();
-           *destreg = imm;
-       } else {
-                       u16 *destreg;
-                       u16 imm;
-
-           destreg = DECODE_RM_WORD_REGISTER(rl);
-           imm = fetch_word_imm();
-           DECODE_PRINTF2(",%x\n", imm);
-           TRACE_AND_STEP();
-           *destreg = imm;
-       }
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xc8
-****************************************************************************/
-void x86emuOp_enter(u8 X86EMU_UNUSED(op1))
-{
-    u16 local,frame_pointer;
-    u8  nesting;
-    int i;
-
-    START_OF_INSTR();
-    local = fetch_word_imm();
-    nesting = fetch_byte_imm();
-    DECODE_PRINTF2("ENTER %x\n", local);
-    DECODE_PRINTF2(",%x\n", nesting);
-    TRACE_AND_STEP();
-    push_word(M.x86.R_BP);
-    frame_pointer = M.x86.R_SP;
-    if (nesting > 0) {
-       for (i = 1; i < nesting; i++) {
-           M.x86.R_BP -= 2;
-           push_word(fetch_data_word_abs(M.x86.R_SS, M.x86.R_BP));
-           }
-       push_word(frame_pointer);
-       }
-    M.x86.R_BP = frame_pointer;
-    M.x86.R_SP = (u16)(M.x86.R_SP - local);
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xc9
-****************************************************************************/
-void x86emuOp_leave(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    DECODE_PRINTF("LEAVE\n");
-    TRACE_AND_STEP();
-    M.x86.R_SP = M.x86.R_BP;
-    M.x86.R_BP = pop_word();
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xca
-****************************************************************************/
-void x86emuOp_ret_far_IMM(u8 X86EMU_UNUSED(op1))
-{
-    u16 imm;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("RETF\t");
-    imm = fetch_word_imm();
-    DECODE_PRINTF2("%x\n", imm);
-       RETURN_TRACE("RETF",M.x86.saved_cs,M.x86.saved_ip);
-       TRACE_AND_STEP();
-    M.x86.R_IP = pop_word();
-    M.x86.R_CS = pop_word();
-    M.x86.R_SP += imm;
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xcb
-****************************************************************************/
-void x86emuOp_ret_far(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    DECODE_PRINTF("RETF\n");
-       RETURN_TRACE("RETF",M.x86.saved_cs,M.x86.saved_ip);
-       TRACE_AND_STEP();
-    M.x86.R_IP = pop_word();
-    M.x86.R_CS = pop_word();
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xcc
-****************************************************************************/
-void x86emuOp_int3(u8 X86EMU_UNUSED(op1))
-{
-    u16 tmp;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("INT 3\n");
-    tmp = (u16) mem_access_word(3 * 4 + 2);
-    /* access the segment register */
-    TRACE_AND_STEP();
-       if (_X86EMU_intrTab[3]) {
-               (*_X86EMU_intrTab[3])(3);
-    } else {
-       push_word((u16)M.x86.R_FLG);
-       CLEAR_FLAG(F_IF);
-       CLEAR_FLAG(F_TF);
-       push_word(M.x86.R_CS);
-       M.x86.R_CS = mem_access_word(3 * 4 + 2);
-       push_word(M.x86.R_IP);
-       M.x86.R_IP = mem_access_word(3 * 4);
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xcd
-****************************************************************************/
-void x86emuOp_int_IMM(u8 X86EMU_UNUSED(op1))
-{
-    u16 tmp;
-    u8 intnum;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("INT\t");
-    intnum = fetch_byte_imm();
-    DECODE_PRINTF2("%x\n", intnum);
-    tmp = mem_access_word(intnum * 4 + 2);
-    TRACE_AND_STEP();
-       if (_X86EMU_intrTab[intnum]) {
-               (*_X86EMU_intrTab[intnum])(intnum);
-    } else {
-       push_word((u16)M.x86.R_FLG);
-       CLEAR_FLAG(F_IF);
-       CLEAR_FLAG(F_TF);
-       push_word(M.x86.R_CS);
-       M.x86.R_CS = mem_access_word(intnum * 4 + 2);
-       push_word(M.x86.R_IP);
-       M.x86.R_IP = mem_access_word(intnum * 4);
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xce
-****************************************************************************/
-void x86emuOp_into(u8 X86EMU_UNUSED(op1))
-{
-    u16 tmp;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("INTO\n");
-    TRACE_AND_STEP();
-    if (ACCESS_FLAG(F_OF)) {
-       tmp = mem_access_word(4 * 4 + 2);
-               if (_X86EMU_intrTab[4]) {
-                       (*_X86EMU_intrTab[4])(4);
-       } else {
-           push_word((u16)M.x86.R_FLG);
-           CLEAR_FLAG(F_IF);
-           CLEAR_FLAG(F_TF);
-           push_word(M.x86.R_CS);
-           M.x86.R_CS = mem_access_word(4 * 4 + 2);
-           push_word(M.x86.R_IP);
-           M.x86.R_IP = mem_access_word(4 * 4);
-       }
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xcf
-****************************************************************************/
-void x86emuOp_iret(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    DECODE_PRINTF("IRET\n");
-
-    TRACE_AND_STEP();
-
-    M.x86.R_IP = pop_word();
-    M.x86.R_CS = pop_word();
-    M.x86.R_FLG = pop_word();
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xd0
-****************************************************************************/
-void x86emuOp_opcD0_byte_RM_1(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    u8 *destreg;
-    uint destoffset;
-    u8 destval;
-
-    /*
-     * Yet another weirdo special case instruction format.  Part of
-     * the opcode held below in "RH".  Doubly nested case would
-     * result, except that the decoded instruction
-     */
-    START_OF_INSTR();
-    FETCH_DECODE_MODRM(mod, rh, rl);
-#ifdef DEBUG
-    if (DEBUG_DECODE()) {
-       /* XXX DECODE_PRINTF may be changed to something more
-          general, so that it is important to leave the strings
-          in the same format, even though the result is that the
-          above test is done twice. */
-       switch (rh) {
-       case 0:
-           DECODE_PRINTF("ROL\t");
-           break;
-       case 1:
-           DECODE_PRINTF("ROR\t");
-           break;
-       case 2:
-           DECODE_PRINTF("RCL\t");
-           break;
-       case 3:
-           DECODE_PRINTF("RCR\t");
-           break;
-       case 4:
-           DECODE_PRINTF("SHL\t");
-           break;
-       case 5:
-           DECODE_PRINTF("SHR\t");
-           break;
-       case 6:
-           DECODE_PRINTF("SAL\t");
-           break;
-       case 7:
-           DECODE_PRINTF("SAR\t");
-           break;
-       }
-    }
-#endif
-    /* know operation, decode the mod byte to find the addressing
-       mode. */
-    switch (mod) {
-    case 0:
-       DECODE_PRINTF("BYTE PTR ");
-       destoffset = decode_rm00_address(rl);
-       DECODE_PRINTF(",1\n");
-       destval = fetch_data_byte(destoffset);
-       TRACE_AND_STEP();
-       destval = (*opcD0_byte_operation[rh]) (destval, 1);
-       store_data_byte(destoffset, destval);
-       break;
-    case 1:
-       DECODE_PRINTF("BYTE PTR ");
-       destoffset = decode_rm01_address(rl);
-       DECODE_PRINTF(",1\n");
-       destval = fetch_data_byte(destoffset);
-       TRACE_AND_STEP();
-       destval = (*opcD0_byte_operation[rh]) (destval, 1);
-       store_data_byte(destoffset, destval);
-       break;
-    case 2:
-       DECODE_PRINTF("BYTE PTR ");
-       destoffset = decode_rm10_address(rl);
-       DECODE_PRINTF(",1\n");
-       destval = fetch_data_byte(destoffset);
-       TRACE_AND_STEP();
-       destval = (*opcD0_byte_operation[rh]) (destval, 1);
-       store_data_byte(destoffset, destval);
-       break;
-    case 3:                     /* register to register */
-       destreg = DECODE_RM_BYTE_REGISTER(rl);
-       DECODE_PRINTF(",1\n");
-       TRACE_AND_STEP();
-       destval = (*opcD0_byte_operation[rh]) (*destreg, 1);
-       *destreg = destval;
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xd1
-****************************************************************************/
-void x86emuOp_opcD1_word_RM_1(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    uint destoffset;
-
-    /*
-     * Yet another weirdo special case instruction format.  Part of
-     * the opcode held below in "RH".  Doubly nested case would
-     * result, except that the decoded instruction
-     */
-    START_OF_INSTR();
-    FETCH_DECODE_MODRM(mod, rh, rl);
-#ifdef DEBUG
-    if (DEBUG_DECODE()) {
-       /* XXX DECODE_PRINTF may be changed to something more
-          general, so that it is important to leave the strings
-          in the same format, even though the result is that the
-          above test is done twice. */
-       switch (rh) {
-       case 0:
-           DECODE_PRINTF("ROL\t");
-           break;
-       case 1:
-           DECODE_PRINTF("ROR\t");
-           break;
-       case 2:
-           DECODE_PRINTF("RCL\t");
-           break;
-       case 3:
-           DECODE_PRINTF("RCR\t");
-           break;
-       case 4:
-           DECODE_PRINTF("SHL\t");
-           break;
-       case 5:
-           DECODE_PRINTF("SHR\t");
-           break;
-       case 6:
-           DECODE_PRINTF("SAL\t");
-           break;
-       case 7:
-           DECODE_PRINTF("SAR\t");
-           break;
-       }
-    }
-#endif
-    /* know operation, decode the mod byte to find the addressing
-       mode. */
-    switch (mod) {
-    case 0:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-
-           DECODE_PRINTF("DWORD PTR ");
-           destoffset = decode_rm00_address(rl);
-           DECODE_PRINTF(",1\n");
-           destval = fetch_data_long(destoffset);
-           TRACE_AND_STEP();
-           destval = (*opcD1_long_operation[rh]) (destval, 1);
-           store_data_long(destoffset, destval);
-       } else {
-           u16 destval;
-
-           DECODE_PRINTF("WORD PTR ");
-           destoffset = decode_rm00_address(rl);
-           DECODE_PRINTF(",1\n");
-           destval = fetch_data_word(destoffset);
-           TRACE_AND_STEP();
-           destval = (*opcD1_word_operation[rh]) (destval, 1);
-           store_data_word(destoffset, destval);
-       }
-       break;
-    case 1:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-
-           DECODE_PRINTF("DWORD PTR ");
-           destoffset = decode_rm01_address(rl);
-           DECODE_PRINTF(",1\n");
-           destval = fetch_data_long(destoffset);
-           TRACE_AND_STEP();
-           destval = (*opcD1_long_operation[rh]) (destval, 1);
-           store_data_long(destoffset, destval);
-       } else {
-           u16 destval;
-
-           DECODE_PRINTF("WORD PTR ");
-           destoffset = decode_rm01_address(rl);
-           DECODE_PRINTF(",1\n");
-           destval = fetch_data_word(destoffset);
-           TRACE_AND_STEP();
-           destval = (*opcD1_word_operation[rh]) (destval, 1);
-           store_data_word(destoffset, destval);
-       }
-       break;
-    case 2:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-
-           DECODE_PRINTF("DWORD PTR ");
-           destoffset = decode_rm10_address(rl);
-           DECODE_PRINTF(",1\n");
-           destval = fetch_data_long(destoffset);
-           TRACE_AND_STEP();
-           destval = (*opcD1_long_operation[rh]) (destval, 1);
-           store_data_long(destoffset, destval);
-       } else {
-           u16 destval;
-
-           DECODE_PRINTF("BYTE PTR ");
-           destoffset = decode_rm10_address(rl);
-           DECODE_PRINTF(",1\n");
-           destval = fetch_data_word(destoffset);
-           TRACE_AND_STEP();
-           destval = (*opcD1_word_operation[rh]) (destval, 1);
-           store_data_word(destoffset, destval);
-       }
-       break;
-    case 3:                     /* register to register */
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-                       u32 destval;
-                       u32 *destreg;
-
-           destreg = DECODE_RM_LONG_REGISTER(rl);
-           DECODE_PRINTF(",1\n");
-           TRACE_AND_STEP();
-           destval = (*opcD1_long_operation[rh]) (*destreg, 1);
-           *destreg = destval;
-       } else {
-                       u16 destval;
-                       u16 *destreg;
-
-           destreg = DECODE_RM_WORD_REGISTER(rl);
-           DECODE_PRINTF(",1\n");
-           TRACE_AND_STEP();
-           destval = (*opcD1_word_operation[rh]) (*destreg, 1);
-           *destreg = destval;
-       }
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xd2
-****************************************************************************/
-void x86emuOp_opcD2_byte_RM_CL(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    u8 *destreg;
-    uint destoffset;
-    u8 destval;
-    u8 amt;
-
-    /*
-     * Yet another weirdo special case instruction format.  Part of
-     * the opcode held below in "RH".  Doubly nested case would
-     * result, except that the decoded instruction
-     */
-    START_OF_INSTR();
-    FETCH_DECODE_MODRM(mod, rh, rl);
-#ifdef DEBUG
-    if (DEBUG_DECODE()) {
-       /* XXX DECODE_PRINTF may be changed to something more
-          general, so that it is important to leave the strings
-          in the same format, even though the result is that the
-          above test is done twice. */
-       switch (rh) {
-       case 0:
-           DECODE_PRINTF("ROL\t");
-           break;
-       case 1:
-           DECODE_PRINTF("ROR\t");
-           break;
-       case 2:
-           DECODE_PRINTF("RCL\t");
-           break;
-       case 3:
-           DECODE_PRINTF("RCR\t");
-           break;
-       case 4:
-           DECODE_PRINTF("SHL\t");
-           break;
-       case 5:
-           DECODE_PRINTF("SHR\t");
-           break;
-       case 6:
-           DECODE_PRINTF("SAL\t");
-           break;
-       case 7:
-           DECODE_PRINTF("SAR\t");
-           break;
-       }
-    }
-#endif
-    /* know operation, decode the mod byte to find the addressing
-       mode. */
-    amt = M.x86.R_CL;
-    switch (mod) {
-    case 0:
-       DECODE_PRINTF("BYTE PTR ");
-       destoffset = decode_rm00_address(rl);
-       DECODE_PRINTF(",CL\n");
-       destval = fetch_data_byte(destoffset);
-       TRACE_AND_STEP();
-       destval = (*opcD0_byte_operation[rh]) (destval, amt);
-       store_data_byte(destoffset, destval);
-       break;
-    case 1:
-       DECODE_PRINTF("BYTE PTR ");
-       destoffset = decode_rm01_address(rl);
-       DECODE_PRINTF(",CL\n");
-       destval = fetch_data_byte(destoffset);
-       TRACE_AND_STEP();
-       destval = (*opcD0_byte_operation[rh]) (destval, amt);
-       store_data_byte(destoffset, destval);
-       break;
-    case 2:
-       DECODE_PRINTF("BYTE PTR ");
-       destoffset = decode_rm10_address(rl);
-       DECODE_PRINTF(",CL\n");
-       destval = fetch_data_byte(destoffset);
-       TRACE_AND_STEP();
-       destval = (*opcD0_byte_operation[rh]) (destval, amt);
-       store_data_byte(destoffset, destval);
-       break;
-    case 3:                     /* register to register */
-       destreg = DECODE_RM_BYTE_REGISTER(rl);
-       DECODE_PRINTF(",CL\n");
-       TRACE_AND_STEP();
-       destval = (*opcD0_byte_operation[rh]) (*destreg, amt);
-       *destreg = destval;
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xd3
-****************************************************************************/
-void x86emuOp_opcD3_word_RM_CL(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    uint destoffset;
-    u8 amt;
-
-    /*
-     * Yet another weirdo special case instruction format.  Part of
-     * the opcode held below in "RH".  Doubly nested case would
-     * result, except that the decoded instruction
-     */
-    START_OF_INSTR();
-    FETCH_DECODE_MODRM(mod, rh, rl);
-#ifdef DEBUG
-    if (DEBUG_DECODE()) {
-       /* XXX DECODE_PRINTF may be changed to something more
-          general, so that it is important to leave the strings
-          in the same format, even though the result is that the
-          above test is done twice. */
-       switch (rh) {
-       case 0:
-           DECODE_PRINTF("ROL\t");
-           break;
-       case 1:
-           DECODE_PRINTF("ROR\t");
-           break;
-       case 2:
-           DECODE_PRINTF("RCL\t");
-           break;
-       case 3:
-           DECODE_PRINTF("RCR\t");
-           break;
-       case 4:
-           DECODE_PRINTF("SHL\t");
-           break;
-       case 5:
-           DECODE_PRINTF("SHR\t");
-           break;
-       case 6:
-           DECODE_PRINTF("SAL\t");
-           break;
-       case 7:
-           DECODE_PRINTF("SAR\t");
-           break;
-       }
-    }
-#endif
-    /* know operation, decode the mod byte to find the addressing
-       mode. */
-    amt = M.x86.R_CL;
-    switch (mod) {
-    case 0:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-
-           DECODE_PRINTF("DWORD PTR ");
-           destoffset = decode_rm00_address(rl);
-           DECODE_PRINTF(",CL\n");
-           destval = fetch_data_long(destoffset);
-           TRACE_AND_STEP();
-           destval = (*opcD1_long_operation[rh]) (destval, amt);
-           store_data_long(destoffset, destval);
-       } else {
-           u16 destval;
-
-           DECODE_PRINTF("WORD PTR ");
-           destoffset = decode_rm00_address(rl);
-           DECODE_PRINTF(",CL\n");
-           destval = fetch_data_word(destoffset);
-           TRACE_AND_STEP();
-           destval = (*opcD1_word_operation[rh]) (destval, amt);
-           store_data_word(destoffset, destval);
-       }
-       break;
-    case 1:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-
-           DECODE_PRINTF("DWORD PTR ");
-           destoffset = decode_rm01_address(rl);
-           DECODE_PRINTF(",CL\n");
-           destval = fetch_data_long(destoffset);
-           TRACE_AND_STEP();
-           destval = (*opcD1_long_operation[rh]) (destval, amt);
-           store_data_long(destoffset, destval);
-       } else {
-           u16 destval;
-
-           DECODE_PRINTF("WORD PTR ");
-           destoffset = decode_rm01_address(rl);
-           DECODE_PRINTF(",CL\n");
-           destval = fetch_data_word(destoffset);
-           TRACE_AND_STEP();
-           destval = (*opcD1_word_operation[rh]) (destval, amt);
-           store_data_word(destoffset, destval);
-       }
-       break;
-    case 2:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-
-           DECODE_PRINTF("DWORD PTR ");
-           destoffset = decode_rm10_address(rl);
-           DECODE_PRINTF(",CL\n");
-           destval = fetch_data_long(destoffset);
-           TRACE_AND_STEP();
-           destval = (*opcD1_long_operation[rh]) (destval, amt);
-           store_data_long(destoffset, destval);
-       } else {
-           u16 destval;
-
-           DECODE_PRINTF("WORD PTR ");
-           destoffset = decode_rm10_address(rl);
-           DECODE_PRINTF(",CL\n");
-           destval = fetch_data_word(destoffset);
-           TRACE_AND_STEP();
-           destval = (*opcD1_word_operation[rh]) (destval, amt);
-           store_data_word(destoffset, destval);
-       }
-       break;
-    case 3:                     /* register to register */
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg;
-
-           destreg = DECODE_RM_LONG_REGISTER(rl);
-           DECODE_PRINTF(",CL\n");
-           TRACE_AND_STEP();
-           *destreg = (*opcD1_long_operation[rh]) (*destreg, amt);
-       } else {
-           u16 *destreg;
-
-           destreg = DECODE_RM_WORD_REGISTER(rl);
-           DECODE_PRINTF(",CL\n");
-           TRACE_AND_STEP();
-           *destreg = (*opcD1_word_operation[rh]) (*destreg, amt);
-       }
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xd4
-****************************************************************************/
-void x86emuOp_aam(u8 X86EMU_UNUSED(op1))
-{
-    u8 a;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("AAM\n");
-    a = fetch_byte_imm();      /* this is a stupid encoding. */
-    if (a != 10) {
-       DECODE_PRINTF("ERROR DECODING AAM\n");
-       TRACE_REGS();
-       HALT_SYS();
-    }
-    TRACE_AND_STEP();
-    /* note the type change here --- returning AL and AH in AX. */
-    M.x86.R_AX = aam_word(M.x86.R_AL);
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xd5
-****************************************************************************/
-void x86emuOp_aad(u8 X86EMU_UNUSED(op1))
-{
-    u8 a;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("AAD\n");
-    a = fetch_byte_imm();
-    TRACE_AND_STEP();
-    M.x86.R_AX = aad_word(M.x86.R_AX);
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/* opcode 0xd6 ILLEGAL OPCODE */
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xd7
-****************************************************************************/
-void x86emuOp_xlat(u8 X86EMU_UNUSED(op1))
-{
-    u16 addr;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("XLAT\n");
-    TRACE_AND_STEP();
-       addr = (u16)(M.x86.R_BX + (u8)M.x86.R_AL);
-    M.x86.R_AL = fetch_data_byte(addr);
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/* instuctions  D8 .. DF are in i87_ops.c */
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xe0
-****************************************************************************/
-void x86emuOp_loopne(u8 X86EMU_UNUSED(op1))
-{
-    s16 ip;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("LOOPNE\t");
-    ip = (s8) fetch_byte_imm();
-    ip += (s16) M.x86.R_IP;
-    DECODE_PRINTF2("%04x\n", ip);
-    TRACE_AND_STEP();
-    M.x86.R_CX -= 1;
-    if (M.x86.R_CX != 0 && !ACCESS_FLAG(F_ZF))      /* CX != 0 and !ZF */
-       M.x86.R_IP = ip;
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xe1
-****************************************************************************/
-void x86emuOp_loope(u8 X86EMU_UNUSED(op1))
-{
-    s16 ip;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("LOOPE\t");
-    ip = (s8) fetch_byte_imm();
-    ip += (s16) M.x86.R_IP;
-    DECODE_PRINTF2("%04x\n", ip);
-    TRACE_AND_STEP();
-    M.x86.R_CX -= 1;
-    if (M.x86.R_CX != 0 && ACCESS_FLAG(F_ZF))       /* CX != 0 and ZF */
-       M.x86.R_IP = ip;
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xe2
-****************************************************************************/
-void x86emuOp_loop(u8 X86EMU_UNUSED(op1))
-{
-    s16 ip;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("LOOP\t");
-    ip = (s8) fetch_byte_imm();
-    ip += (s16) M.x86.R_IP;
-    DECODE_PRINTF2("%04x\n", ip);
-    TRACE_AND_STEP();
-    M.x86.R_CX -= 1;
-    if (M.x86.R_CX != 0)
-       M.x86.R_IP = ip;
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xe3
-****************************************************************************/
-void x86emuOp_jcxz(u8 X86EMU_UNUSED(op1))
-{
-    u16 target;
-    s8  offset;
-
-    /* jump to byte offset if overflow flag is set */
-    START_OF_INSTR();
-    DECODE_PRINTF("JCXZ\t");
-    offset = (s8)fetch_byte_imm();
-    target = (u16)(M.x86.R_IP + offset);
-    DECODE_PRINTF2("%x\n", target);
-    TRACE_AND_STEP();
-    if (M.x86.R_CX == 0)
-       M.x86.R_IP = target;
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xe4
-****************************************************************************/
-void x86emuOp_in_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
-{
-    u8 port;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("IN\t");
-       port = (u8) fetch_byte_imm();
-    DECODE_PRINTF2("%x,AL\n", port);
-    TRACE_AND_STEP();
-    M.x86.R_AL = (*sys_inb)(port);
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xe5
-****************************************************************************/
-void x86emuOp_in_word_AX_IMM(u8 X86EMU_UNUSED(op1))
-{
-    u8 port;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("IN\t");
-       port = (u8) fetch_byte_imm();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF2("EAX,%x\n", port);
-    } else {
-       DECODE_PRINTF2("AX,%x\n", port);
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       M.x86.R_EAX = (*sys_inl)(port);
-    } else {
-       M.x86.R_AX = (*sys_inw)(port);
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xe6
-****************************************************************************/
-void x86emuOp_out_byte_IMM_AL(u8 X86EMU_UNUSED(op1))
-{
-    u8 port;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("OUT\t");
-       port = (u8) fetch_byte_imm();
-    DECODE_PRINTF2("%x,AL\n", port);
-    TRACE_AND_STEP();
-    (*sys_outb)(port, M.x86.R_AL);
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xe7
-****************************************************************************/
-void x86emuOp_out_word_IMM_AX(u8 X86EMU_UNUSED(op1))
-{
-    u8 port;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("OUT\t");
-       port = (u8) fetch_byte_imm();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF2("%x,EAX\n", port);
-    } else {
-       DECODE_PRINTF2("%x,AX\n", port);
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       (*sys_outl)(port, M.x86.R_EAX);
-    } else {
-       (*sys_outw)(port, M.x86.R_AX);
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xe8
-****************************************************************************/
-void x86emuOp_call_near_IMM(u8 X86EMU_UNUSED(op1))
-{
-    s16 ip;
-
-    START_OF_INSTR();
-       DECODE_PRINTF("CALL\t");
-       ip = (s16) fetch_word_imm();
-       ip += (s16) M.x86.R_IP;    /* CHECK SIGN */
-       DECODE_PRINTF2("%04x\n", ip);
-       CALL_TRACE(M.x86.saved_cs, M.x86.saved_ip, M.x86.R_CS, ip, "");
-    TRACE_AND_STEP();
-    push_word(M.x86.R_IP);
-    M.x86.R_IP = ip;
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xe9
-****************************************************************************/
-void x86emuOp_jump_near_IMM(u8 X86EMU_UNUSED(op1))
-{
-    int ip;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("JMP\t");
-    ip = (s16)fetch_word_imm();
-    ip += (s16)M.x86.R_IP;
-    DECODE_PRINTF2("%04x\n", ip);
-    TRACE_AND_STEP();
-    M.x86.R_IP = (u16)ip;
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xea
-****************************************************************************/
-void x86emuOp_jump_far_IMM(u8 X86EMU_UNUSED(op1))
-{
-    u16 cs, ip;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("JMP\tFAR ");
-    ip = fetch_word_imm();
-    cs = fetch_word_imm();
-    DECODE_PRINTF2("%04x:", cs);
-    DECODE_PRINTF2("%04x\n", ip);
-    TRACE_AND_STEP();
-    M.x86.R_IP = ip;
-    M.x86.R_CS = cs;
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xeb
-****************************************************************************/
-void x86emuOp_jump_byte_IMM(u8 X86EMU_UNUSED(op1))
-{
-    u16 target;
-    s8 offset;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("JMP\t");
-    offset = (s8)fetch_byte_imm();
-    target = (u16)(M.x86.R_IP + offset);
-    DECODE_PRINTF2("%x\n", target);
-    TRACE_AND_STEP();
-    M.x86.R_IP = target;
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xec
-****************************************************************************/
-void x86emuOp_in_byte_AL_DX(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    DECODE_PRINTF("IN\tAL,DX\n");
-    TRACE_AND_STEP();
-    M.x86.R_AL = (*sys_inb)(M.x86.R_DX);
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xed
-****************************************************************************/
-void x86emuOp_in_word_AX_DX(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("IN\tEAX,DX\n");
-    } else {
-       DECODE_PRINTF("IN\tAX,DX\n");
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       M.x86.R_EAX = (*sys_inl)(M.x86.R_DX);
-    } else {
-       M.x86.R_AX = (*sys_inw)(M.x86.R_DX);
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xee
-****************************************************************************/
-void x86emuOp_out_byte_DX_AL(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    DECODE_PRINTF("OUT\tDX,AL\n");
-    TRACE_AND_STEP();
-    (*sys_outb)(M.x86.R_DX, M.x86.R_AL);
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xef
-****************************************************************************/
-void x86emuOp_out_word_DX_AX(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       DECODE_PRINTF("OUT\tDX,EAX\n");
-    } else {
-       DECODE_PRINTF("OUT\tDX,AX\n");
-    }
-    TRACE_AND_STEP();
-    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-       (*sys_outl)(M.x86.R_DX, M.x86.R_EAX);
-    } else {
-       (*sys_outw)(M.x86.R_DX, M.x86.R_AX);
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xf0
-****************************************************************************/
-void x86emuOp_lock(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    DECODE_PRINTF("LOCK:\n");
-    TRACE_AND_STEP();
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/*opcode 0xf1 ILLEGAL OPERATION */
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xf2
-****************************************************************************/
-void x86emuOp_repne(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    DECODE_PRINTF("REPNE\n");
-    TRACE_AND_STEP();
-    M.x86.mode |= SYSMODE_PREFIX_REPNE;
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xf3
-****************************************************************************/
-void x86emuOp_repe(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    DECODE_PRINTF("REPE\n");
-    TRACE_AND_STEP();
-    M.x86.mode |= SYSMODE_PREFIX_REPE;
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xf4
-****************************************************************************/
-void x86emuOp_halt(u8 X86EMU_UNUSED(op1))
-{
-    START_OF_INSTR();
-    DECODE_PRINTF("HALT\n");
-    TRACE_AND_STEP();
-    HALT_SYS();
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xf5
-****************************************************************************/
-void x86emuOp_cmc(u8 X86EMU_UNUSED(op1))
-{
-    /* complement the carry flag. */
-    START_OF_INSTR();
-    DECODE_PRINTF("CMC\n");
-    TRACE_AND_STEP();
-    TOGGLE_FLAG(F_CF);
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xf6
-****************************************************************************/
-void x86emuOp_opcF6_byte_RM(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    u8 *destreg;
-    uint destoffset;
-    u8 destval, srcval;
-
-    /* long, drawn out code follows.  Double switch for a total
-       of 32 cases.  */
-    START_OF_INSTR();
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:                     /* mod=00 */
-       switch (rh) {
-       case 0:         /* test byte imm */
-           DECODE_PRINTF("TEST\tBYTE PTR ");
-           destoffset = decode_rm00_address(rl);
-           DECODE_PRINTF(",");
-           srcval = fetch_byte_imm();
-           DECODE_PRINTF2("%02x\n", srcval);
-           destval = fetch_data_byte(destoffset);
-           TRACE_AND_STEP();
-           test_byte(destval, srcval);
-           break;
-       case 1:
-           DECODE_PRINTF("ILLEGAL OP MOD=00 RH=01 OP=F6\n");
-           HALT_SYS();
-           break;
-       case 2:
-           DECODE_PRINTF("NOT\tBYTE PTR ");
-           destoffset = decode_rm00_address(rl);
-           DECODE_PRINTF("\n");
-           destval = fetch_data_byte(destoffset);
-           TRACE_AND_STEP();
-           destval = not_byte(destval);
-           store_data_byte(destoffset, destval);
-           break;
-       case 3:
-           DECODE_PRINTF("NEG\tBYTE PTR ");
-           destoffset = decode_rm00_address(rl);
-           DECODE_PRINTF("\n");
-           destval = fetch_data_byte(destoffset);
-           TRACE_AND_STEP();
-           destval = neg_byte(destval);
-           store_data_byte(destoffset, destval);
-           break;
-       case 4:
-           DECODE_PRINTF("MUL\tBYTE PTR ");
-           destoffset = decode_rm00_address(rl);
-           DECODE_PRINTF("\n");
-           destval = fetch_data_byte(destoffset);
-           TRACE_AND_STEP();
-           mul_byte(destval);
-           break;
-       case 5:
-           DECODE_PRINTF("IMUL\tBYTE PTR ");
-           destoffset = decode_rm00_address(rl);
-           DECODE_PRINTF("\n");
-           destval = fetch_data_byte(destoffset);
-           TRACE_AND_STEP();
-           imul_byte(destval);
-           break;
-       case 6:
-           DECODE_PRINTF("DIV\tBYTE PTR ");
-           destoffset = decode_rm00_address(rl);
-           DECODE_PRINTF("\n");
-           destval = fetch_data_byte(destoffset);
-           TRACE_AND_STEP();
-           div_byte(destval);
-           break;
-       case 7:
-           DECODE_PRINTF("IDIV\tBYTE PTR ");
-           destoffset = decode_rm00_address(rl);
-           DECODE_PRINTF("\n");
-           destval = fetch_data_byte(destoffset);
-           TRACE_AND_STEP();
-           idiv_byte(destval);
-           break;
-       }
-       break;                  /* end mod==00 */
-    case 1:                     /* mod=01 */
-       switch (rh) {
-       case 0:         /* test byte imm */
-           DECODE_PRINTF("TEST\tBYTE PTR ");
-           destoffset = decode_rm01_address(rl);
-           DECODE_PRINTF(",");
-           srcval = fetch_byte_imm();
-           DECODE_PRINTF2("%02x\n", srcval);
-           destval = fetch_data_byte(destoffset);
-           TRACE_AND_STEP();
-           test_byte(destval, srcval);
-           break;
-       case 1:
-           DECODE_PRINTF("ILLEGAL OP MOD=01 RH=01 OP=F6\n");
-           HALT_SYS();
-           break;
-       case 2:
-           DECODE_PRINTF("NOT\tBYTE PTR ");
-           destoffset = decode_rm01_address(rl);
-           DECODE_PRINTF("\n");
-           destval = fetch_data_byte(destoffset);
-           TRACE_AND_STEP();
-           destval = not_byte(destval);
-           store_data_byte(destoffset, destval);
-           break;
-       case 3:
-           DECODE_PRINTF("NEG\tBYTE PTR ");
-           destoffset = decode_rm01_address(rl);
-           DECODE_PRINTF("\n");
-           destval = fetch_data_byte(destoffset);
-           TRACE_AND_STEP();
-           destval = neg_byte(destval);
-           store_data_byte(destoffset, destval);
-           break;
-       case 4:
-           DECODE_PRINTF("MUL\tBYTE PTR ");
-           destoffset = decode_rm01_address(rl);
-           DECODE_PRINTF("\n");
-           destval = fetch_data_byte(destoffset);
-           TRACE_AND_STEP();
-           mul_byte(destval);
-           break;
-       case 5:
-           DECODE_PRINTF("IMUL\tBYTE PTR ");
-           destoffset = decode_rm01_address(rl);
-           DECODE_PRINTF("\n");
-           destval = fetch_data_byte(destoffset);
-           TRACE_AND_STEP();
-           imul_byte(destval);
-           break;
-       case 6:
-           DECODE_PRINTF("DIV\tBYTE PTR ");
-           destoffset = decode_rm01_address(rl);
-           DECODE_PRINTF("\n");
-           destval = fetch_data_byte(destoffset);
-           TRACE_AND_STEP();
-           div_byte(destval);
-           break;
-       case 7:
-           DECODE_PRINTF("IDIV\tBYTE PTR ");
-           destoffset = decode_rm01_address(rl);
-           DECODE_PRINTF("\n");
-           destval = fetch_data_byte(destoffset);
-           TRACE_AND_STEP();
-           idiv_byte(destval);
-           break;
-       }
-       break;                  /* end mod==01 */
-    case 2:                     /* mod=10 */
-       switch (rh) {
-       case 0:         /* test byte imm */
-           DECODE_PRINTF("TEST\tBYTE PTR ");
-           destoffset = decode_rm10_address(rl);
-           DECODE_PRINTF(",");
-           srcval = fetch_byte_imm();
-           DECODE_PRINTF2("%02x\n", srcval);
-           destval = fetch_data_byte(destoffset);
-           TRACE_AND_STEP();
-           test_byte(destval, srcval);
-           break;
-       case 1:
-           DECODE_PRINTF("ILLEGAL OP MOD=10 RH=01 OP=F6\n");
-           HALT_SYS();
-           break;
-       case 2:
-           DECODE_PRINTF("NOT\tBYTE PTR ");
-           destoffset = decode_rm10_address(rl);
-           DECODE_PRINTF("\n");
-           destval = fetch_data_byte(destoffset);
-           TRACE_AND_STEP();
-           destval = not_byte(destval);
-           store_data_byte(destoffset, destval);
-           break;
-       case 3:
-           DECODE_PRINTF("NEG\tBYTE PTR ");
-           destoffset = decode_rm10_address(rl);
-           DECODE_PRINTF("\n");
-           destval = fetch_data_byte(destoffset);
-           TRACE_AND_STEP();
-           destval = neg_byte(destval);
-           store_data_byte(destoffset, destval);
-           break;
-       case 4:
-           DECODE_PRINTF("MUL\tBYTE PTR ");
-           destoffset = decode_rm10_address(rl);
-           DECODE_PRINTF("\n");
-           destval = fetch_data_byte(destoffset);
-           TRACE_AND_STEP();
-           mul_byte(destval);
-           break;
-       case 5:
-           DECODE_PRINTF("IMUL\tBYTE PTR ");
-           destoffset = decode_rm10_address(rl);
-           DECODE_PRINTF("\n");
-           destval = fetch_data_byte(destoffset);
-           TRACE_AND_STEP();
-           imul_byte(destval);
-           break;
-       case 6:
-           DECODE_PRINTF("DIV\tBYTE PTR ");
-           destoffset = decode_rm10_address(rl);
-           DECODE_PRINTF("\n");
-           destval = fetch_data_byte(destoffset);
-           TRACE_AND_STEP();
-           div_byte(destval);
-           break;
-       case 7:
-           DECODE_PRINTF("IDIV\tBYTE PTR ");
-           destoffset = decode_rm10_address(rl);
-           DECODE_PRINTF("\n");
-           destval = fetch_data_byte(destoffset);
-           TRACE_AND_STEP();
-           idiv_byte(destval);
-           break;
-       }
-       break;                  /* end mod==10 */
-    case 3:                     /* mod=11 */
-       switch (rh) {
-       case 0:         /* test byte imm */
-           DECODE_PRINTF("TEST\t");
-           destreg = DECODE_RM_BYTE_REGISTER(rl);
-           DECODE_PRINTF(",");
-           srcval = fetch_byte_imm();
-           DECODE_PRINTF2("%02x\n", srcval);
-           TRACE_AND_STEP();
-           test_byte(*destreg, srcval);
-           break;
-       case 1:
-           DECODE_PRINTF("ILLEGAL OP MOD=00 RH=01 OP=F6\n");
-           HALT_SYS();
-           break;
-       case 2:
-           DECODE_PRINTF("NOT\t");
-           destreg = DECODE_RM_BYTE_REGISTER(rl);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = not_byte(*destreg);
-           break;
-       case 3:
-           DECODE_PRINTF("NEG\t");
-           destreg = DECODE_RM_BYTE_REGISTER(rl);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = neg_byte(*destreg);
-           break;
-       case 4:
-           DECODE_PRINTF("MUL\t");
-           destreg = DECODE_RM_BYTE_REGISTER(rl);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           mul_byte(*destreg);      /*!!!  */
-           break;
-       case 5:
-           DECODE_PRINTF("IMUL\t");
-           destreg = DECODE_RM_BYTE_REGISTER(rl);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           imul_byte(*destreg);
-           break;
-       case 6:
-           DECODE_PRINTF("DIV\t");
-           destreg = DECODE_RM_BYTE_REGISTER(rl);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           div_byte(*destreg);
-           break;
-       case 7:
-           DECODE_PRINTF("IDIV\t");
-           destreg = DECODE_RM_BYTE_REGISTER(rl);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           idiv_byte(*destreg);
-           break;
-       }
-       break;                  /* end mod==11 */
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xf7
-****************************************************************************/
-void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rl, rh;
-    uint destoffset;
-
-    /* long, drawn out code follows.  Double switch for a total
-       of 32 cases.  */
-    START_OF_INSTR();
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:                     /* mod=00 */
-       switch (rh) {
-       case 0:         /* test word imm */
-           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-               u32 destval,srcval;
-
-               DECODE_PRINTF("TEST\tDWORD PTR ");
-               destoffset = decode_rm00_address(rl);
-               DECODE_PRINTF(",");
-               srcval = fetch_long_imm();
-               DECODE_PRINTF2("%x\n", srcval);
-               destval = fetch_data_long(destoffset);
-               TRACE_AND_STEP();
-               test_long(destval, srcval);
-           } else {
-               u16 destval,srcval;
-
-               DECODE_PRINTF("TEST\tWORD PTR ");
-               destoffset = decode_rm00_address(rl);
-               DECODE_PRINTF(",");
-               srcval = fetch_word_imm();
-               DECODE_PRINTF2("%x\n", srcval);
-               destval = fetch_data_word(destoffset);
-               TRACE_AND_STEP();
-               test_word(destval, srcval);
-           }
-           break;
-       case 1:
-           DECODE_PRINTF("ILLEGAL OP MOD=00 RH=01 OP=F7\n");
-           HALT_SYS();
-           break;
-       case 2:
-           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-               u32 destval;
-
-               DECODE_PRINTF("NOT\tDWORD PTR ");
-               destoffset = decode_rm00_address(rl);
-               DECODE_PRINTF("\n");
-               destval = fetch_data_long(destoffset);
-               TRACE_AND_STEP();
-               destval = not_long(destval);
-               store_data_long(destoffset, destval);
-           } else {
-               u16 destval;
-
-               DECODE_PRINTF("NOT\tWORD PTR ");
-               destoffset = decode_rm00_address(rl);
-               DECODE_PRINTF("\n");
-               destval = fetch_data_word(destoffset);
-               TRACE_AND_STEP();
-               destval = not_word(destval);
-               store_data_word(destoffset, destval);
-           }
-           break;
-       case 3:
-           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-               u32 destval;
-
-               DECODE_PRINTF("NEG\tDWORD PTR ");
-               destoffset = decode_rm00_address(rl);
-               DECODE_PRINTF("\n");
-               destval = fetch_data_long(destoffset);
-               TRACE_AND_STEP();
-               destval = neg_long(destval);
-               store_data_long(destoffset, destval);
-           } else {
-               u16 destval;
-
-               DECODE_PRINTF("NEG\tWORD PTR ");
-               destoffset = decode_rm00_address(rl);
-               DECODE_PRINTF("\n");
-               destval = fetch_data_word(destoffset);
-               TRACE_AND_STEP();
-               destval = neg_word(destval);
-               store_data_word(destoffset, destval);
-           }
-           break;
-       case 4:
-           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-               u32 destval;
-
-               DECODE_PRINTF("MUL\tDWORD PTR ");
-               destoffset = decode_rm00_address(rl);
-               DECODE_PRINTF("\n");
-               destval = fetch_data_long(destoffset);
-               TRACE_AND_STEP();
-               mul_long(destval);
-           } else {
-               u16 destval;
-
-               DECODE_PRINTF("MUL\tWORD PTR ");
-               destoffset = decode_rm00_address(rl);
-               DECODE_PRINTF("\n");
-               destval = fetch_data_word(destoffset);
-               TRACE_AND_STEP();
-               mul_word(destval);
-           }
-           break;
-       case 5:
-           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-               u32 destval;
-
-               DECODE_PRINTF("IMUL\tDWORD PTR ");
-               destoffset = decode_rm00_address(rl);
-               DECODE_PRINTF("\n");
-               destval = fetch_data_long(destoffset);
-               TRACE_AND_STEP();
-               imul_long(destval);
-           } else {
-               u16 destval;
-
-               DECODE_PRINTF("IMUL\tWORD PTR ");
-               destoffset = decode_rm00_address(rl);
-               DECODE_PRINTF("\n");
-               destval = fetch_data_word(destoffset);
-               TRACE_AND_STEP();
-               imul_word(destval);
-           }
-           break;
-       case 6:
-           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-               u32 destval;
-
-               DECODE_PRINTF("DIV\tDWORD PTR ");
-               destoffset = decode_rm00_address(rl);
-               DECODE_PRINTF("\n");
-               destval = fetch_data_long(destoffset);
-               TRACE_AND_STEP();
-               div_long(destval);
-           } else {
-               u16 destval;
-
-               DECODE_PRINTF("DIV\tWORD PTR ");
-               destoffset = decode_rm00_address(rl);
-               DECODE_PRINTF("\n");
-               destval = fetch_data_word(destoffset);
-               TRACE_AND_STEP();
-               div_word(destval);
-           }
-           break;
-       case 7:
-           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-               u32 destval;
-
-               DECODE_PRINTF("IDIV\tDWORD PTR ");
-               destoffset = decode_rm00_address(rl);
-               DECODE_PRINTF("\n");
-               destval = fetch_data_long(destoffset);
-               TRACE_AND_STEP();
-               idiv_long(destval);
-           } else {
-               u16 destval;
-
-               DECODE_PRINTF("IDIV\tWORD PTR ");
-               destoffset = decode_rm00_address(rl);
-               DECODE_PRINTF("\n");
-               destval = fetch_data_word(destoffset);
-               TRACE_AND_STEP();
-               idiv_word(destval);
-           }
-           break;
-       }
-       break;                  /* end mod==00 */
-    case 1:                     /* mod=01 */
-       switch (rh) {
-       case 0:         /* test word imm */
-           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-               u32 destval,srcval;
-
-               DECODE_PRINTF("TEST\tDWORD PTR ");
-               destoffset = decode_rm01_address(rl);
-               DECODE_PRINTF(",");
-               srcval = fetch_long_imm();
-               DECODE_PRINTF2("%x\n", srcval);
-               destval = fetch_data_long(destoffset);
-               TRACE_AND_STEP();
-               test_long(destval, srcval);
-           } else {
-               u16 destval,srcval;
-
-               DECODE_PRINTF("TEST\tWORD PTR ");
-               destoffset = decode_rm01_address(rl);
-               DECODE_PRINTF(",");
-               srcval = fetch_word_imm();
-               DECODE_PRINTF2("%x\n", srcval);
-               destval = fetch_data_word(destoffset);
-               TRACE_AND_STEP();
-               test_word(destval, srcval);
-           }
-           break;
-       case 1:
-           DECODE_PRINTF("ILLEGAL OP MOD=01 RH=01 OP=F6\n");
-           HALT_SYS();
-           break;
-       case 2:
-           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-               u32 destval;
-
-               DECODE_PRINTF("NOT\tDWORD PTR ");
-               destoffset = decode_rm01_address(rl);
-               DECODE_PRINTF("\n");
-               destval = fetch_data_long(destoffset);
-               TRACE_AND_STEP();
-               destval = not_long(destval);
-               store_data_long(destoffset, destval);
-           } else {
-               u16 destval;
-
-               DECODE_PRINTF("NOT\tWORD PTR ");
-               destoffset = decode_rm01_address(rl);
-               DECODE_PRINTF("\n");
-               destval = fetch_data_word(destoffset);
-               TRACE_AND_STEP();
-               destval = not_word(destval);
-               store_data_word(destoffset, destval);
-           }
-           break;
-       case 3:
-           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-               u32 destval;
-
-               DECODE_PRINTF("NEG\tDWORD PTR ");
-               destoffset = decode_rm01_address(rl);
-               DECODE_PRINTF("\n");
-               destval = fetch_data_long(destoffset);
-               TRACE_AND_STEP();
-               destval = neg_long(destval);
-               store_data_long(destoffset, destval);
-           } else {
-               u16 destval;
-
-               DECODE_PRINTF("NEG\tWORD PTR ");
-               destoffset = decode_rm01_address(rl);
-               DECODE_PRINTF("\n");
-               destval = fetch_data_word(destoffset);
-               TRACE_AND_STEP();
-               destval = neg_word(destval);
-               store_data_word(destoffset, destval);
-           }
-           break;
-       case 4:
-           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-               u32 destval;
-
-               DECODE_PRINTF("MUL\tDWORD PTR ");
-               destoffset = decode_rm01_address(rl);
-               DECODE_PRINTF("\n");
-               destval = fetch_data_long(destoffset);
-               TRACE_AND_STEP();
-               mul_long(destval);
-           } else {
-               u16 destval;
-
-               DECODE_PRINTF("MUL\tWORD PTR ");
-               destoffset = decode_rm01_address(rl);
-               DECODE_PRINTF("\n");
-               destval = fetch_data_word(destoffset);
-               TRACE_AND_STEP();
-               mul_word(destval);
-           }
-           break;
-       case 5:
-           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-               u32 destval;
-
-               DECODE_PRINTF("IMUL\tDWORD PTR ");
-               destoffset = decode_rm01_address(rl);
-               DECODE_PRINTF("\n");
-               destval = fetch_data_long(destoffset);
-               TRACE_AND_STEP();
-               imul_long(destval);
-           } else {
-               u16 destval;
-
-               DECODE_PRINTF("IMUL\tWORD PTR ");
-               destoffset = decode_rm01_address(rl);
-               DECODE_PRINTF("\n");
-               destval = fetch_data_word(destoffset);
-               TRACE_AND_STEP();
-               imul_word(destval);
-           }
-           break;
-       case 6:
-           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-               u32 destval;
-
-               DECODE_PRINTF("DIV\tDWORD PTR ");
-               destoffset = decode_rm01_address(rl);
-               DECODE_PRINTF("\n");
-               destval = fetch_data_long(destoffset);
-               TRACE_AND_STEP();
-               div_long(destval);
-           } else {
-               u16 destval;
-
-               DECODE_PRINTF("DIV\tWORD PTR ");
-               destoffset = decode_rm01_address(rl);
-               DECODE_PRINTF("\n");
-               destval = fetch_data_word(destoffset);
-               TRACE_AND_STEP();
-               div_word(destval);
-           }
-           break;
-       case 7:
-           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-               u32 destval;
-
-               DECODE_PRINTF("IDIV\tDWORD PTR ");
-               destoffset = decode_rm01_address(rl);
-               DECODE_PRINTF("\n");
-               destval = fetch_data_long(destoffset);
-               TRACE_AND_STEP();
-               idiv_long(destval);
-           } else {
-               u16 destval;
-
-               DECODE_PRINTF("IDIV\tWORD PTR ");
-               destoffset = decode_rm01_address(rl);
-               DECODE_PRINTF("\n");
-               destval = fetch_data_word(destoffset);
-               TRACE_AND_STEP();
-               idiv_word(destval);
-           }
-           break;
-       }
-       break;                  /* end mod==01 */
-    case 2:                     /* mod=10 */
-       switch (rh) {
-       case 0:         /* test word imm */
-           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-               u32 destval,srcval;
-
-               DECODE_PRINTF("TEST\tDWORD PTR ");
-               destoffset = decode_rm10_address(rl);
-               DECODE_PRINTF(",");
-               srcval = fetch_long_imm();
-               DECODE_PRINTF2("%x\n", srcval);
-               destval = fetch_data_long(destoffset);
-               TRACE_AND_STEP();
-               test_long(destval, srcval);
-           } else {
-               u16 destval,srcval;
-
-               DECODE_PRINTF("TEST\tWORD PTR ");
-               destoffset = decode_rm10_address(rl);
-               DECODE_PRINTF(",");
-               srcval = fetch_word_imm();
-               DECODE_PRINTF2("%x\n", srcval);
-               destval = fetch_data_word(destoffset);
-               TRACE_AND_STEP();
-               test_word(destval, srcval);
-           }
-           break;
-       case 1:
-           DECODE_PRINTF("ILLEGAL OP MOD=10 RH=01 OP=F6\n");
-           HALT_SYS();
-           break;
-       case 2:
-           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-               u32 destval;
-
-               DECODE_PRINTF("NOT\tDWORD PTR ");
-               destoffset = decode_rm10_address(rl);
-               DECODE_PRINTF("\n");
-               destval = fetch_data_long(destoffset);
-               TRACE_AND_STEP();
-               destval = not_long(destval);
-               store_data_long(destoffset, destval);
-           } else {
-               u16 destval;
-
-               DECODE_PRINTF("NOT\tWORD PTR ");
-               destoffset = decode_rm10_address(rl);
-               DECODE_PRINTF("\n");
-               destval = fetch_data_word(destoffset);
-               TRACE_AND_STEP();
-               destval = not_word(destval);
-               store_data_word(destoffset, destval);
-           }
-           break;
-       case 3:
-           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-               u32 destval;
-
-               DECODE_PRINTF("NEG\tDWORD PTR ");
-               destoffset = decode_rm10_address(rl);
-               DECODE_PRINTF("\n");
-               destval = fetch_data_long(destoffset);
-               TRACE_AND_STEP();
-               destval = neg_long(destval);
-               store_data_long(destoffset, destval);
-           } else {
-               u16 destval;
-
-               DECODE_PRINTF("NEG\tWORD PTR ");
-               destoffset = decode_rm10_address(rl);
-               DECODE_PRINTF("\n");
-               destval = fetch_data_word(destoffset);
-               TRACE_AND_STEP();
-               destval = neg_word(destval);
-               store_data_word(destoffset, destval);
-           }
-           break;
-       case 4:
-           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-               u32 destval;
-
-               DECODE_PRINTF("MUL\tDWORD PTR ");
-               destoffset = decode_rm10_address(rl);
-               DECODE_PRINTF("\n");
-               destval = fetch_data_long(destoffset);
-               TRACE_AND_STEP();
-               mul_long(destval);
-           } else {
-               u16 destval;
-
-               DECODE_PRINTF("MUL\tWORD PTR ");
-               destoffset = decode_rm10_address(rl);
-               DECODE_PRINTF("\n");
-               destval = fetch_data_word(destoffset);
-               TRACE_AND_STEP();
-               mul_word(destval);
-           }
-           break;
-       case 5:
-           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-               u32 destval;
-
-               DECODE_PRINTF("IMUL\tDWORD PTR ");
-               destoffset = decode_rm10_address(rl);
-               DECODE_PRINTF("\n");
-               destval = fetch_data_long(destoffset);
-               TRACE_AND_STEP();
-               imul_long(destval);
-           } else {
-               u16 destval;
-
-               DECODE_PRINTF("IMUL\tWORD PTR ");
-               destoffset = decode_rm10_address(rl);
-               DECODE_PRINTF("\n");
-               destval = fetch_data_word(destoffset);
-               TRACE_AND_STEP();
-               imul_word(destval);
-           }
-           break;
-       case 6:
-           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-               u32 destval;
-
-               DECODE_PRINTF("DIV\tDWORD PTR ");
-               destoffset = decode_rm10_address(rl);
-               DECODE_PRINTF("\n");
-               destval = fetch_data_long(destoffset);
-               TRACE_AND_STEP();
-               div_long(destval);
-           } else {
-               u16 destval;
-
-               DECODE_PRINTF("DIV\tWORD PTR ");
-               destoffset = decode_rm10_address(rl);
-               DECODE_PRINTF("\n");
-               destval = fetch_data_word(destoffset);
-               TRACE_AND_STEP();
-               div_word(destval);
-           }
-           break;
-       case 7:
-           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-               u32 destval;
-
-               DECODE_PRINTF("IDIV\tDWORD PTR ");
-               destoffset = decode_rm10_address(rl);
-               DECODE_PRINTF("\n");
-               destval = fetch_data_long(destoffset);
-               TRACE_AND_STEP();
-               idiv_long(destval);
-           } else {
-               u16 destval;
-
-               DECODE_PRINTF("IDIV\tWORD PTR ");
-               destoffset = decode_rm10_address(rl);
-               DECODE_PRINTF("\n");
-               destval = fetch_data_word(destoffset);
-               TRACE_AND_STEP();
-               idiv_word(destval);
-           }
-           break;
-       }
-       break;                  /* end mod==10 */
-    case 3:                     /* mod=11 */
-       switch (rh) {
-       case 0:         /* test word imm */
-           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-               u32 *destreg;
-               u32 srcval;
-
-               DECODE_PRINTF("TEST\t");
-               destreg = DECODE_RM_LONG_REGISTER(rl);
-               DECODE_PRINTF(",");
-               srcval = fetch_long_imm();
-               DECODE_PRINTF2("%x\n", srcval);
-               TRACE_AND_STEP();
-               test_long(*destreg, srcval);
-           } else {
-               u16 *destreg;
-               u16 srcval;
-
-               DECODE_PRINTF("TEST\t");
-               destreg = DECODE_RM_WORD_REGISTER(rl);
-               DECODE_PRINTF(",");
-               srcval = fetch_word_imm();
-               DECODE_PRINTF2("%x\n", srcval);
-               TRACE_AND_STEP();
-               test_word(*destreg, srcval);
-           }
-           break;
-       case 1:
-           DECODE_PRINTF("ILLEGAL OP MOD=00 RH=01 OP=F6\n");
-           HALT_SYS();
-           break;
-       case 2:
-           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-               u32 *destreg;
-
-               DECODE_PRINTF("NOT\t");
-               destreg = DECODE_RM_LONG_REGISTER(rl);
-               DECODE_PRINTF("\n");
-               TRACE_AND_STEP();
-               *destreg = not_long(*destreg);
-           } else {
-               u16 *destreg;
-
-               DECODE_PRINTF("NOT\t");
-               destreg = DECODE_RM_WORD_REGISTER(rl);
-               DECODE_PRINTF("\n");
-               TRACE_AND_STEP();
-               *destreg = not_word(*destreg);
-           }
-           break;
-       case 3:
-           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-               u32 *destreg;
-
-               DECODE_PRINTF("NEG\t");
-               destreg = DECODE_RM_LONG_REGISTER(rl);
-               DECODE_PRINTF("\n");
-               TRACE_AND_STEP();
-               *destreg = neg_long(*destreg);
-           } else {
-               u16 *destreg;
-
-               DECODE_PRINTF("NEG\t");
-               destreg = DECODE_RM_WORD_REGISTER(rl);
-               DECODE_PRINTF("\n");
-               TRACE_AND_STEP();
-               *destreg = neg_word(*destreg);
-           }
-           break;
-       case 4:
-           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-               u32 *destreg;
-
-               DECODE_PRINTF("MUL\t");
-               destreg = DECODE_RM_LONG_REGISTER(rl);
-               DECODE_PRINTF("\n");
-               TRACE_AND_STEP();
-               mul_long(*destreg);      /*!!!  */
-           } else {
-               u16 *destreg;
-
-               DECODE_PRINTF("MUL\t");
-               destreg = DECODE_RM_WORD_REGISTER(rl);
-               DECODE_PRINTF("\n");
-               TRACE_AND_STEP();
-               mul_word(*destreg);      /*!!!  */
-           }
-           break;
-       case 5:
-           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-               u32 *destreg;
-
-               DECODE_PRINTF("IMUL\t");
-               destreg = DECODE_RM_LONG_REGISTER(rl);
-               DECODE_PRINTF("\n");
-               TRACE_AND_STEP();
-               imul_long(*destreg);
-           } else {
-               u16 *destreg;
-
-               DECODE_PRINTF("IMUL\t");
-               destreg = DECODE_RM_WORD_REGISTER(rl);
-               DECODE_PRINTF("\n");
-               TRACE_AND_STEP();
-               imul_word(*destreg);
-           }
-           break;
-       case 6:
-           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-               u32 *destreg;
-
-               DECODE_PRINTF("DIV\t");
-               destreg = DECODE_RM_LONG_REGISTER(rl);
-               DECODE_PRINTF("\n");
-               TRACE_AND_STEP();
-               div_long(*destreg);
-           } else {
-               u16 *destreg;
-
-               DECODE_PRINTF("DIV\t");
-               destreg = DECODE_RM_WORD_REGISTER(rl);
-               DECODE_PRINTF("\n");
-               TRACE_AND_STEP();
-               div_word(*destreg);
-           }
-           break;
-       case 7:
-           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-               u32 *destreg;
-
-               DECODE_PRINTF("IDIV\t");
-               destreg = DECODE_RM_LONG_REGISTER(rl);
-               DECODE_PRINTF("\n");
-               TRACE_AND_STEP();
-               idiv_long(*destreg);
-           } else {
-               u16 *destreg;
-
-               DECODE_PRINTF("IDIV\t");
-               destreg = DECODE_RM_WORD_REGISTER(rl);
-               DECODE_PRINTF("\n");
-               TRACE_AND_STEP();
-               idiv_word(*destreg);
-           }
-           break;
-       }
-       break;                  /* end mod==11 */
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xf8
-****************************************************************************/
-void x86emuOp_clc(u8 X86EMU_UNUSED(op1))
-{
-    /* clear the carry flag. */
-    START_OF_INSTR();
-    DECODE_PRINTF("CLC\n");
-    TRACE_AND_STEP();
-    CLEAR_FLAG(F_CF);
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xf9
-****************************************************************************/
-void x86emuOp_stc(u8 X86EMU_UNUSED(op1))
-{
-    /* set the carry flag. */
-    START_OF_INSTR();
-    DECODE_PRINTF("STC\n");
-    TRACE_AND_STEP();
-    SET_FLAG(F_CF);
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xfa
-****************************************************************************/
-void x86emuOp_cli(u8 X86EMU_UNUSED(op1))
-{
-    /* clear interrupts. */
-    START_OF_INSTR();
-    DECODE_PRINTF("CLI\n");
-    TRACE_AND_STEP();
-    CLEAR_FLAG(F_IF);
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xfb
-****************************************************************************/
-void x86emuOp_sti(u8 X86EMU_UNUSED(op1))
-{
-    /* enable  interrupts. */
-    START_OF_INSTR();
-    DECODE_PRINTF("STI\n");
-    TRACE_AND_STEP();
-    SET_FLAG(F_IF);
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xfc
-****************************************************************************/
-void x86emuOp_cld(u8 X86EMU_UNUSED(op1))
-{
-    /* clear interrupts. */
-    START_OF_INSTR();
-    DECODE_PRINTF("CLD\n");
-    TRACE_AND_STEP();
-    CLEAR_FLAG(F_DF);
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xfd
-****************************************************************************/
-void x86emuOp_std(u8 X86EMU_UNUSED(op1))
-{
-    /* clear interrupts. */
-    START_OF_INSTR();
-    DECODE_PRINTF("STD\n");
-    TRACE_AND_STEP();
-    SET_FLAG(F_DF);
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xfe
-****************************************************************************/
-void x86emuOp_opcFE_byte_RM(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rh, rl;
-    u8 destval;
-    uint destoffset;
-    u8 *destreg;
-
-    /* Yet another special case instruction. */
-    START_OF_INSTR();
-    FETCH_DECODE_MODRM(mod, rh, rl);
-#ifdef DEBUG
-    if (DEBUG_DECODE()) {
-       /* XXX DECODE_PRINTF may be changed to something more
-          general, so that it is important to leave the strings
-          in the same format, even though the result is that the
-          above test is done twice. */
-
-       switch (rh) {
-       case 0:
-           DECODE_PRINTF("INC\t");
-           break;
-       case 1:
-           DECODE_PRINTF("DEC\t");
-           break;
-       case 2:
-       case 3:
-       case 4:
-       case 5:
-       case 6:
-       case 7:
-           DECODE_PRINTF2("ILLEGAL OP MAJOR OP 0xFE MINOR OP %x \n", mod);
-           HALT_SYS();
-           break;
-       }
-    }
-#endif
-    switch (mod) {
-    case 0:
-       DECODE_PRINTF("BYTE PTR ");
-       destoffset = decode_rm00_address(rl);
-       DECODE_PRINTF("\n");
-       switch (rh) {
-       case 0:         /* inc word ptr ... */
-           destval = fetch_data_byte(destoffset);
-           TRACE_AND_STEP();
-           destval = inc_byte(destval);
-           store_data_byte(destoffset, destval);
-           break;
-       case 1:         /* dec word ptr ... */
-           destval = fetch_data_byte(destoffset);
-           TRACE_AND_STEP();
-           destval = dec_byte(destval);
-           store_data_byte(destoffset, destval);
-           break;
-       }
-       break;
-    case 1:
-       DECODE_PRINTF("BYTE PTR ");
-       destoffset = decode_rm01_address(rl);
-       DECODE_PRINTF("\n");
-       switch (rh) {
-       case 0:
-           destval = fetch_data_byte(destoffset);
-           TRACE_AND_STEP();
-           destval = inc_byte(destval);
-           store_data_byte(destoffset, destval);
-           break;
-       case 1:
-           destval = fetch_data_byte(destoffset);
-           TRACE_AND_STEP();
-           destval = dec_byte(destval);
-           store_data_byte(destoffset, destval);
-           break;
-       }
-       break;
-    case 2:
-       DECODE_PRINTF("BYTE PTR ");
-       destoffset = decode_rm10_address(rl);
-       DECODE_PRINTF("\n");
-       switch (rh) {
-       case 0:
-           destval = fetch_data_byte(destoffset);
-           TRACE_AND_STEP();
-           destval = inc_byte(destval);
-           store_data_byte(destoffset, destval);
-           break;
-       case 1:
-           destval = fetch_data_byte(destoffset);
-           TRACE_AND_STEP();
-           destval = dec_byte(destval);
-           store_data_byte(destoffset, destval);
-           break;
-       }
-       break;
-    case 3:
-       destreg = DECODE_RM_BYTE_REGISTER(rl);
-       DECODE_PRINTF("\n");
-       switch (rh) {
-       case 0:
-           TRACE_AND_STEP();
-           *destreg = inc_byte(*destreg);
-           break;
-       case 1:
-           TRACE_AND_STEP();
-           *destreg = dec_byte(*destreg);
-           break;
-       }
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0xff
-****************************************************************************/
-void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
-{
-    int mod, rh, rl;
-    uint destoffset = 0;
-       u16 *destreg;
-       u16 destval,destval2;
-
-    /* Yet another special case instruction. */
-    START_OF_INSTR();
-    FETCH_DECODE_MODRM(mod, rh, rl);
-#ifdef DEBUG
-    if (DEBUG_DECODE()) {
-       /* XXX DECODE_PRINTF may be changed to something more
-          general, so that it is important to leave the strings
-          in the same format, even though the result is that the
-          above test is done twice. */
-
-       switch (rh) {
-       case 0:
-           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-               DECODE_PRINTF("INC\tDWORD PTR ");
-           } else {
-               DECODE_PRINTF("INC\tWORD PTR ");
-           }
-           break;
-       case 1:
-           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-               DECODE_PRINTF("DEC\tDWORD PTR ");
-           } else {
-               DECODE_PRINTF("DEC\tWORD PTR ");
-           }
-           break;
-       case 2:
-           DECODE_PRINTF("CALL\t ");
-           break;
-       case 3:
-           DECODE_PRINTF("CALL\tFAR ");
-           break;
-       case 4:
-           DECODE_PRINTF("JMP\t");
-           break;
-       case 5:
-           DECODE_PRINTF("JMP\tFAR ");
-           break;
-       case 6:
-           DECODE_PRINTF("PUSH\t");
-           break;
-       case 7:
-           DECODE_PRINTF("ILLEGAL DECODING OF OPCODE FF\t");
-           HALT_SYS();
-           break;
-       }
-    }
-#endif
-    switch (mod) {
-    case 0:
-       destoffset = decode_rm00_address(rl);
-       DECODE_PRINTF("\n");
-       switch (rh) {
-       case 0:         /* inc word ptr ... */
-           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-               u32 destval;
-
-               destval = fetch_data_long(destoffset);
-               TRACE_AND_STEP();
-               destval = inc_long(destval);
-               store_data_long(destoffset, destval);
-           } else {
-               u16 destval;
-
-               destval = fetch_data_word(destoffset);
-               TRACE_AND_STEP();
-               destval = inc_word(destval);
-               store_data_word(destoffset, destval);
-           }
-           break;
-       case 1:         /* dec word ptr ... */
-           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-               u32 destval;
-
-               destval = fetch_data_long(destoffset);
-               TRACE_AND_STEP();
-               destval = dec_long(destval);
-               store_data_long(destoffset, destval);
-           } else {
-               u16 destval;
-
-               destval = fetch_data_word(destoffset);
-               TRACE_AND_STEP();
-               destval = dec_word(destval);
-               store_data_word(destoffset, destval);
-           }
-           break;
-       case 2:         /* call word ptr ... */
-           destval = fetch_data_word(destoffset);
-           TRACE_AND_STEP();
-           push_word(M.x86.R_IP);
-           M.x86.R_IP = destval;
-           break;
-       case 3:         /* call far ptr ... */
-           destval = fetch_data_word(destoffset);
-           destval2 = fetch_data_word(destoffset + 2);
-           TRACE_AND_STEP();
-           push_word(M.x86.R_CS);
-           M.x86.R_CS = destval2;
-           push_word(M.x86.R_IP);
-           M.x86.R_IP = destval;
-           break;
-       case 4:         /* jmp word ptr ... */
-           destval = fetch_data_word(destoffset);
-           TRACE_AND_STEP();
-           M.x86.R_IP = destval;
-           break;
-       case 5:         /* jmp far ptr ... */
-           destval = fetch_data_word(destoffset);
-           destval2 = fetch_data_word(destoffset + 2);
-           TRACE_AND_STEP();
-           M.x86.R_IP = destval;
-           M.x86.R_CS = destval2;
-           break;
-       case 6:         /*  push word ptr ... */
-           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-               u32 destval;
-
-               destval = fetch_data_long(destoffset);
-               TRACE_AND_STEP();
-               push_long(destval);
-           } else {
-               u16 destval;
-
-               destval = fetch_data_word(destoffset);
-               TRACE_AND_STEP();
-               push_word(destval);
-           }
-           break;
-       }
-       break;
-    case 1:
-       destoffset = decode_rm01_address(rl);
-       DECODE_PRINTF("\n");
-       switch (rh) {
-       case 0:
-           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-               u32 destval;
-
-               destval = fetch_data_long(destoffset);
-               TRACE_AND_STEP();
-               destval = inc_long(destval);
-               store_data_long(destoffset, destval);
-           } else {
-               u16 destval;
-
-               destval = fetch_data_word(destoffset);
-               TRACE_AND_STEP();
-               destval = inc_word(destval);
-               store_data_word(destoffset, destval);
-           }
-           break;
-       case 1:
-           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-               u32 destval;
-
-               destval = fetch_data_long(destoffset);
-               TRACE_AND_STEP();
-               destval = dec_long(destval);
-               store_data_long(destoffset, destval);
-           } else {
-               u16 destval;
-
-               destval = fetch_data_word(destoffset);
-               TRACE_AND_STEP();
-               destval = dec_word(destval);
-               store_data_word(destoffset, destval);
-           }
-           break;
-       case 2:         /* call word ptr ... */
-           destval = fetch_data_word(destoffset);
-           TRACE_AND_STEP();
-           push_word(M.x86.R_IP);
-           M.x86.R_IP = destval;
-           break;
-       case 3:         /* call far ptr ... */
-           destval = fetch_data_word(destoffset);
-           destval2 = fetch_data_word(destoffset + 2);
-           TRACE_AND_STEP();
-           push_word(M.x86.R_CS);
-           M.x86.R_CS = destval2;
-           push_word(M.x86.R_IP);
-           M.x86.R_IP = destval;
-           break;
-       case 4:         /* jmp word ptr ... */
-           destval = fetch_data_word(destoffset);
-           TRACE_AND_STEP();
-           M.x86.R_IP = destval;
-           break;
-       case 5:         /* jmp far ptr ... */
-           destval = fetch_data_word(destoffset);
-           destval2 = fetch_data_word(destoffset + 2);
-           TRACE_AND_STEP();
-           M.x86.R_IP = destval;
-           M.x86.R_CS = destval2;
-           break;
-       case 6:         /*  push word ptr ... */
-           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-               u32 destval;
-
-               destval = fetch_data_long(destoffset);
-               TRACE_AND_STEP();
-               push_long(destval);
-           } else {
-               u16 destval;
-
-               destval = fetch_data_word(destoffset);
-               TRACE_AND_STEP();
-               push_word(destval);
-           }
-           break;
-       }
-       break;
-    case 2:
-       destoffset = decode_rm10_address(rl);
-       DECODE_PRINTF("\n");
-       switch (rh) {
-       case 0:
-           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-               u32 destval;
-
-               destval = fetch_data_long(destoffset);
-               TRACE_AND_STEP();
-               destval = inc_long(destval);
-               store_data_long(destoffset, destval);
-           } else {
-               u16 destval;
-
-               destval = fetch_data_word(destoffset);
-               TRACE_AND_STEP();
-               destval = inc_word(destval);
-               store_data_word(destoffset, destval);
-           }
-           break;
-       case 1:
-           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-               u32 destval;
-
-               destval = fetch_data_long(destoffset);
-               TRACE_AND_STEP();
-               destval = dec_long(destval);
-               store_data_long(destoffset, destval);
-           } else {
-               u16 destval;
-
-               destval = fetch_data_word(destoffset);
-               TRACE_AND_STEP();
-               destval = dec_word(destval);
-               store_data_word(destoffset, destval);
-           }
-           break;
-       case 2:         /* call word ptr ... */
-           destval = fetch_data_word(destoffset);
-           TRACE_AND_STEP();
-           push_word(M.x86.R_IP);
-           M.x86.R_IP = destval;
-           break;
-       case 3:         /* call far ptr ... */
-           destval = fetch_data_word(destoffset);
-           destval2 = fetch_data_word(destoffset + 2);
-           TRACE_AND_STEP();
-           push_word(M.x86.R_CS);
-           M.x86.R_CS = destval2;
-           push_word(M.x86.R_IP);
-           M.x86.R_IP = destval;
-           break;
-       case 4:         /* jmp word ptr ... */
-           destval = fetch_data_word(destoffset);
-           TRACE_AND_STEP();
-           M.x86.R_IP = destval;
-           break;
-       case 5:         /* jmp far ptr ... */
-           destval = fetch_data_word(destoffset);
-           destval2 = fetch_data_word(destoffset + 2);
-           TRACE_AND_STEP();
-           M.x86.R_IP = destval;
-           M.x86.R_CS = destval2;
-           break;
-       case 6:         /*  push word ptr ... */
-           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-               u32 destval;
-
-               destval = fetch_data_long(destoffset);
-               TRACE_AND_STEP();
-               push_long(destval);
-           } else {
-               u16 destval;
-
-               destval = fetch_data_word(destoffset);
-               TRACE_AND_STEP();
-               push_word(destval);
-           }
-           break;
-       }
-       break;
-    case 3:
-       switch (rh) {
-       case 0:
-           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-               u32 *destreg;
-
-               destreg = DECODE_RM_LONG_REGISTER(rl);
-               DECODE_PRINTF("\n");
-               TRACE_AND_STEP();
-               *destreg = inc_long(*destreg);
-           } else {
-               u16 *destreg;
-
-               destreg = DECODE_RM_WORD_REGISTER(rl);
-               DECODE_PRINTF("\n");
-               TRACE_AND_STEP();
-               *destreg = inc_word(*destreg);
-           }
-           break;
-       case 1:
-           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-               u32 *destreg;
-
-               destreg = DECODE_RM_LONG_REGISTER(rl);
-               DECODE_PRINTF("\n");
-               TRACE_AND_STEP();
-               *destreg = dec_long(*destreg);
-           } else {
-               u16 *destreg;
-
-               destreg = DECODE_RM_WORD_REGISTER(rl);
-               DECODE_PRINTF("\n");
-               TRACE_AND_STEP();
-               *destreg = dec_word(*destreg);
-           }
-           break;
-       case 2:         /* call word ptr ... */
-           destreg = DECODE_RM_WORD_REGISTER(rl);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           push_word(M.x86.R_IP);
-           M.x86.R_IP = *destreg;
-           break;
-       case 3:         /* jmp far ptr ... */
-           DECODE_PRINTF("OPERATION UNDEFINED 0XFF \n");
-           TRACE_AND_STEP();
-           HALT_SYS();
-           break;
-
-       case 4:         /* jmp  ... */
-           destreg = DECODE_RM_WORD_REGISTER(rl);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           M.x86.R_IP = (u16) (*destreg);
-           break;
-       case 5:         /* jmp far ptr ... */
-           DECODE_PRINTF("OPERATION UNDEFINED 0XFF \n");
-           TRACE_AND_STEP();
-           HALT_SYS();
-           break;
-       case 6:
-           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-               u32 *destreg;
-
-               destreg = DECODE_RM_LONG_REGISTER(rl);
-               DECODE_PRINTF("\n");
-               TRACE_AND_STEP();
-               push_long(*destreg);
-           } else {
-               u16 *destreg;
-
-               destreg = DECODE_RM_WORD_REGISTER(rl);
-               DECODE_PRINTF("\n");
-               TRACE_AND_STEP();
-               push_word(*destreg);
-           }
-           break;
-       }
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/***************************************************************************
- * Single byte operation code table:
- **************************************************************************/
-void (*x86emu_optab[256])(u8) =
-{
-/*  0x00 */ x86emuOp_add_byte_RM_R,
-/*  0x01 */ x86emuOp_add_word_RM_R,
-/*  0x02 */ x86emuOp_add_byte_R_RM,
-/*  0x03 */ x86emuOp_add_word_R_RM,
-/*  0x04 */ x86emuOp_add_byte_AL_IMM,
-/*  0x05 */ x86emuOp_add_word_AX_IMM,
-/*  0x06 */ x86emuOp_push_ES,
-/*  0x07 */ x86emuOp_pop_ES,
-
-/*  0x08 */ x86emuOp_or_byte_RM_R,
-/*  0x09 */ x86emuOp_or_word_RM_R,
-/*  0x0a */ x86emuOp_or_byte_R_RM,
-/*  0x0b */ x86emuOp_or_word_R_RM,
-/*  0x0c */ x86emuOp_or_byte_AL_IMM,
-/*  0x0d */ x86emuOp_or_word_AX_IMM,
-/*  0x0e */ x86emuOp_push_CS,
-/*  0x0f */ x86emuOp_two_byte,
-
-/*  0x10 */ x86emuOp_adc_byte_RM_R,
-/*  0x11 */ x86emuOp_adc_word_RM_R,
-/*  0x12 */ x86emuOp_adc_byte_R_RM,
-/*  0x13 */ x86emuOp_adc_word_R_RM,
-/*  0x14 */ x86emuOp_adc_byte_AL_IMM,
-/*  0x15 */ x86emuOp_adc_word_AX_IMM,
-/*  0x16 */ x86emuOp_push_SS,
-/*  0x17 */ x86emuOp_pop_SS,
-
-/*  0x18 */ x86emuOp_sbb_byte_RM_R,
-/*  0x19 */ x86emuOp_sbb_word_RM_R,
-/*  0x1a */ x86emuOp_sbb_byte_R_RM,
-/*  0x1b */ x86emuOp_sbb_word_R_RM,
-/*  0x1c */ x86emuOp_sbb_byte_AL_IMM,
-/*  0x1d */ x86emuOp_sbb_word_AX_IMM,
-/*  0x1e */ x86emuOp_push_DS,
-/*  0x1f */ x86emuOp_pop_DS,
-
-/*  0x20 */ x86emuOp_and_byte_RM_R,
-/*  0x21 */ x86emuOp_and_word_RM_R,
-/*  0x22 */ x86emuOp_and_byte_R_RM,
-/*  0x23 */ x86emuOp_and_word_R_RM,
-/*  0x24 */ x86emuOp_and_byte_AL_IMM,
-/*  0x25 */ x86emuOp_and_word_AX_IMM,
-/*  0x26 */ x86emuOp_segovr_ES,
-/*  0x27 */ x86emuOp_daa,
-
-/*  0x28 */ x86emuOp_sub_byte_RM_R,
-/*  0x29 */ x86emuOp_sub_word_RM_R,
-/*  0x2a */ x86emuOp_sub_byte_R_RM,
-/*  0x2b */ x86emuOp_sub_word_R_RM,
-/*  0x2c */ x86emuOp_sub_byte_AL_IMM,
-/*  0x2d */ x86emuOp_sub_word_AX_IMM,
-/*  0x2e */ x86emuOp_segovr_CS,
-/*  0x2f */ x86emuOp_das,
-
-/*  0x30 */ x86emuOp_xor_byte_RM_R,
-/*  0x31 */ x86emuOp_xor_word_RM_R,
-/*  0x32 */ x86emuOp_xor_byte_R_RM,
-/*  0x33 */ x86emuOp_xor_word_R_RM,
-/*  0x34 */ x86emuOp_xor_byte_AL_IMM,
-/*  0x35 */ x86emuOp_xor_word_AX_IMM,
-/*  0x36 */ x86emuOp_segovr_SS,
-/*  0x37 */ x86emuOp_aaa,
-
-/*  0x38 */ x86emuOp_cmp_byte_RM_R,
-/*  0x39 */ x86emuOp_cmp_word_RM_R,
-/*  0x3a */ x86emuOp_cmp_byte_R_RM,
-/*  0x3b */ x86emuOp_cmp_word_R_RM,
-/*  0x3c */ x86emuOp_cmp_byte_AL_IMM,
-/*  0x3d */ x86emuOp_cmp_word_AX_IMM,
-/*  0x3e */ x86emuOp_segovr_DS,
-/*  0x3f */ x86emuOp_aas,
-
-/*  0x40 */ x86emuOp_inc_AX,
-/*  0x41 */ x86emuOp_inc_CX,
-/*  0x42 */ x86emuOp_inc_DX,
-/*  0x43 */ x86emuOp_inc_BX,
-/*  0x44 */ x86emuOp_inc_SP,
-/*  0x45 */ x86emuOp_inc_BP,
-/*  0x46 */ x86emuOp_inc_SI,
-/*  0x47 */ x86emuOp_inc_DI,
-
-/*  0x48 */ x86emuOp_dec_AX,
-/*  0x49 */ x86emuOp_dec_CX,
-/*  0x4a */ x86emuOp_dec_DX,
-/*  0x4b */ x86emuOp_dec_BX,
-/*  0x4c */ x86emuOp_dec_SP,
-/*  0x4d */ x86emuOp_dec_BP,
-/*  0x4e */ x86emuOp_dec_SI,
-/*  0x4f */ x86emuOp_dec_DI,
-
-/*  0x50 */ x86emuOp_push_AX,
-/*  0x51 */ x86emuOp_push_CX,
-/*  0x52 */ x86emuOp_push_DX,
-/*  0x53 */ x86emuOp_push_BX,
-/*  0x54 */ x86emuOp_push_SP,
-/*  0x55 */ x86emuOp_push_BP,
-/*  0x56 */ x86emuOp_push_SI,
-/*  0x57 */ x86emuOp_push_DI,
-
-/*  0x58 */ x86emuOp_pop_AX,
-/*  0x59 */ x86emuOp_pop_CX,
-/*  0x5a */ x86emuOp_pop_DX,
-/*  0x5b */ x86emuOp_pop_BX,
-/*  0x5c */ x86emuOp_pop_SP,
-/*  0x5d */ x86emuOp_pop_BP,
-/*  0x5e */ x86emuOp_pop_SI,
-/*  0x5f */ x86emuOp_pop_DI,
-
-/*  0x60 */ x86emuOp_push_all,
-/*  0x61 */ x86emuOp_pop_all,
-/*  0x62 */ x86emuOp_illegal_op,   /* bound */
-/*  0x63 */ x86emuOp_illegal_op,   /* arpl */
-/*  0x64 */ x86emuOp_segovr_FS,
-/*  0x65 */ x86emuOp_segovr_GS,
-/*  0x66 */ x86emuOp_prefix_data,
-/*  0x67 */ x86emuOp_prefix_addr,
-
-/*  0x68 */ x86emuOp_push_word_IMM,
-/*  0x69 */ x86emuOp_imul_word_IMM,
-/*  0x6a */ x86emuOp_push_byte_IMM,
-/*  0x6b */ x86emuOp_imul_byte_IMM,
-/*  0x6c */ x86emuOp_ins_byte,
-/*  0x6d */ x86emuOp_ins_word,
-/*  0x6e */ x86emuOp_outs_byte,
-/*  0x6f */ x86emuOp_outs_word,
-
-/*  0x70 */ x86emuOp_jump_near_O,
-/*  0x71 */ x86emuOp_jump_near_NO,
-/*  0x72 */ x86emuOp_jump_near_B,
-/*  0x73 */ x86emuOp_jump_near_NB,
-/*  0x74 */ x86emuOp_jump_near_Z,
-/*  0x75 */ x86emuOp_jump_near_NZ,
-/*  0x76 */ x86emuOp_jump_near_BE,
-/*  0x77 */ x86emuOp_jump_near_NBE,
-
-/*  0x78 */ x86emuOp_jump_near_S,
-/*  0x79 */ x86emuOp_jump_near_NS,
-/*  0x7a */ x86emuOp_jump_near_P,
-/*  0x7b */ x86emuOp_jump_near_NP,
-/*  0x7c */ x86emuOp_jump_near_L,
-/*  0x7d */ x86emuOp_jump_near_NL,
-/*  0x7e */ x86emuOp_jump_near_LE,
-/*  0x7f */ x86emuOp_jump_near_NLE,
-
-/*  0x80 */ x86emuOp_opc80_byte_RM_IMM,
-/*  0x81 */ x86emuOp_opc81_word_RM_IMM,
-/*  0x82 */ x86emuOp_opc82_byte_RM_IMM,
-/*  0x83 */ x86emuOp_opc83_word_RM_IMM,
-/*  0x84 */ x86emuOp_test_byte_RM_R,
-/*  0x85 */ x86emuOp_test_word_RM_R,
-/*  0x86 */ x86emuOp_xchg_byte_RM_R,
-/*  0x87 */ x86emuOp_xchg_word_RM_R,
-
-/*  0x88 */ x86emuOp_mov_byte_RM_R,
-/*  0x89 */ x86emuOp_mov_word_RM_R,
-/*  0x8a */ x86emuOp_mov_byte_R_RM,
-/*  0x8b */ x86emuOp_mov_word_R_RM,
-/*  0x8c */ x86emuOp_mov_word_RM_SR,
-/*  0x8d */ x86emuOp_lea_word_R_M,
-/*  0x8e */ x86emuOp_mov_word_SR_RM,
-/*  0x8f */ x86emuOp_pop_RM,
-
-/*  0x90 */ x86emuOp_nop,
-/*  0x91 */ x86emuOp_xchg_word_AX_CX,
-/*  0x92 */ x86emuOp_xchg_word_AX_DX,
-/*  0x93 */ x86emuOp_xchg_word_AX_BX,
-/*  0x94 */ x86emuOp_xchg_word_AX_SP,
-/*  0x95 */ x86emuOp_xchg_word_AX_BP,
-/*  0x96 */ x86emuOp_xchg_word_AX_SI,
-/*  0x97 */ x86emuOp_xchg_word_AX_DI,
-
-/*  0x98 */ x86emuOp_cbw,
-/*  0x99 */ x86emuOp_cwd,
-/*  0x9a */ x86emuOp_call_far_IMM,
-/*  0x9b */ x86emuOp_wait,
-/*  0x9c */ x86emuOp_pushf_word,
-/*  0x9d */ x86emuOp_popf_word,
-/*  0x9e */ x86emuOp_sahf,
-/*  0x9f */ x86emuOp_lahf,
-
-/*  0xa0 */ x86emuOp_mov_AL_M_IMM,
-/*  0xa1 */ x86emuOp_mov_AX_M_IMM,
-/*  0xa2 */ x86emuOp_mov_M_AL_IMM,
-/*  0xa3 */ x86emuOp_mov_M_AX_IMM,
-/*  0xa4 */ x86emuOp_movs_byte,
-/*  0xa5 */ x86emuOp_movs_word,
-/*  0xa6 */ x86emuOp_cmps_byte,
-/*  0xa7 */ x86emuOp_cmps_word,
-/*  0xa8 */ x86emuOp_test_AL_IMM,
-/*  0xa9 */ x86emuOp_test_AX_IMM,
-/*  0xaa */ x86emuOp_stos_byte,
-/*  0xab */ x86emuOp_stos_word,
-/*  0xac */ x86emuOp_lods_byte,
-/*  0xad */ x86emuOp_lods_word,
-/*  0xac */ x86emuOp_scas_byte,
-/*  0xad */ x86emuOp_scas_word,
-
-
-/*  0xb0 */ x86emuOp_mov_byte_AL_IMM,
-/*  0xb1 */ x86emuOp_mov_byte_CL_IMM,
-/*  0xb2 */ x86emuOp_mov_byte_DL_IMM,
-/*  0xb3 */ x86emuOp_mov_byte_BL_IMM,
-/*  0xb4 */ x86emuOp_mov_byte_AH_IMM,
-/*  0xb5 */ x86emuOp_mov_byte_CH_IMM,
-/*  0xb6 */ x86emuOp_mov_byte_DH_IMM,
-/*  0xb7 */ x86emuOp_mov_byte_BH_IMM,
-
-/*  0xb8 */ x86emuOp_mov_word_AX_IMM,
-/*  0xb9 */ x86emuOp_mov_word_CX_IMM,
-/*  0xba */ x86emuOp_mov_word_DX_IMM,
-/*  0xbb */ x86emuOp_mov_word_BX_IMM,
-/*  0xbc */ x86emuOp_mov_word_SP_IMM,
-/*  0xbd */ x86emuOp_mov_word_BP_IMM,
-/*  0xbe */ x86emuOp_mov_word_SI_IMM,
-/*  0xbf */ x86emuOp_mov_word_DI_IMM,
-
-/*  0xc0 */ x86emuOp_opcC0_byte_RM_MEM,
-/*  0xc1 */ x86emuOp_opcC1_word_RM_MEM,
-/*  0xc2 */ x86emuOp_ret_near_IMM,
-/*  0xc3 */ x86emuOp_ret_near,
-/*  0xc4 */ x86emuOp_les_R_IMM,
-/*  0xc5 */ x86emuOp_lds_R_IMM,
-/*  0xc6 */ x86emuOp_mov_byte_RM_IMM,
-/*  0xc7 */ x86emuOp_mov_word_RM_IMM,
-/*  0xc8 */ x86emuOp_enter,
-/*  0xc9 */ x86emuOp_leave,
-/*  0xca */ x86emuOp_ret_far_IMM,
-/*  0xcb */ x86emuOp_ret_far,
-/*  0xcc */ x86emuOp_int3,
-/*  0xcd */ x86emuOp_int_IMM,
-/*  0xce */ x86emuOp_into,
-/*  0xcf */ x86emuOp_iret,
-
-/*  0xd0 */ x86emuOp_opcD0_byte_RM_1,
-/*  0xd1 */ x86emuOp_opcD1_word_RM_1,
-/*  0xd2 */ x86emuOp_opcD2_byte_RM_CL,
-/*  0xd3 */ x86emuOp_opcD3_word_RM_CL,
-/*  0xd4 */ x86emuOp_aam,
-/*  0xd5 */ x86emuOp_aad,
-/*  0xd6 */ x86emuOp_illegal_op,   /* Undocumented SETALC instruction */
-/*  0xd7 */ x86emuOp_xlat,
-/*  0xd8 */ x86emuOp_esc_coprocess_d8,
-/*  0xd9 */ x86emuOp_esc_coprocess_d9,
-/*  0xda */ x86emuOp_esc_coprocess_da,
-/*  0xdb */ x86emuOp_esc_coprocess_db,
-/*  0xdc */ x86emuOp_esc_coprocess_dc,
-/*  0xdd */ x86emuOp_esc_coprocess_dd,
-/*  0xde */ x86emuOp_esc_coprocess_de,
-/*  0xdf */ x86emuOp_esc_coprocess_df,
-
-/*  0xe0 */ x86emuOp_loopne,
-/*  0xe1 */ x86emuOp_loope,
-/*  0xe2 */ x86emuOp_loop,
-/*  0xe3 */ x86emuOp_jcxz,
-/*  0xe4 */ x86emuOp_in_byte_AL_IMM,
-/*  0xe5 */ x86emuOp_in_word_AX_IMM,
-/*  0xe6 */ x86emuOp_out_byte_IMM_AL,
-/*  0xe7 */ x86emuOp_out_word_IMM_AX,
-
-/*  0xe8 */ x86emuOp_call_near_IMM,
-/*  0xe9 */ x86emuOp_jump_near_IMM,
-/*  0xea */ x86emuOp_jump_far_IMM,
-/*  0xeb */ x86emuOp_jump_byte_IMM,
-/*  0xec */ x86emuOp_in_byte_AL_DX,
-/*  0xed */ x86emuOp_in_word_AX_DX,
-/*  0xee */ x86emuOp_out_byte_DX_AL,
-/*  0xef */ x86emuOp_out_word_DX_AX,
-
-/*  0xf0 */ x86emuOp_lock,
-/*  0xf1 */ x86emuOp_illegal_op,
-/*  0xf2 */ x86emuOp_repne,
-/*  0xf3 */ x86emuOp_repe,
-/*  0xf4 */ x86emuOp_halt,
-/*  0xf5 */ x86emuOp_cmc,
-/*  0xf6 */ x86emuOp_opcF6_byte_RM,
-/*  0xf7 */ x86emuOp_opcF7_word_RM,
-
-/*  0xf8 */ x86emuOp_clc,
-/*  0xf9 */ x86emuOp_stc,
-/*  0xfa */ x86emuOp_cli,
-/*  0xfb */ x86emuOp_sti,
-/*  0xfc */ x86emuOp_cld,
-/*  0xfd */ x86emuOp_std,
-/*  0xfe */ x86emuOp_opcFE_byte_RM,
-/*  0xff */ x86emuOp_opcFF_word_RM,
-};
-
-void tables_relocate(unsigned int offset)
-{
-    int i;
-    for (i=0; i<8; i++)
-    {
-       opc80_byte_operation[i] -= offset;
-       opc81_word_operation[i] -= offset;
-       opc81_long_operation[i] -= offset;
-
-       opc82_byte_operation[i] -= offset;
-       opc83_word_operation[i] -= offset;
-       opc83_long_operation[i] -= offset;
-
-       opcD0_byte_operation[i] -= offset;
-       opcD1_word_operation[i] -= offset;
-       opcD1_long_operation[i] -= offset;
-    }
-}
diff --git a/board/MAI/bios_emulator/scitech/src/x86emu/ops2.c b/board/MAI/bios_emulator/scitech/src/x86emu/ops2.c
deleted file mode 100644 (file)
index d381307..0000000
+++ /dev/null
@@ -1,2800 +0,0 @@
-/****************************************************************************
-*
-*                                              Realmode X86 Emulator Library
-*
-*              Copyright (C) 1996-1999 SciTech Software, Inc.
-*                                   Copyright (C) David Mosberger-Tang
-*                                         Copyright (C) 1999 Egbert Eich
-*
-*  ========================================================================
-*
-*  Permission to use, copy, modify, distribute, and sell this software and
-*  its documentation for any purpose is hereby granted without fee,
-*  provided that the above copyright notice appear in all copies and that
-*  both that copyright notice and this permission notice appear in
-*  supporting documentation, and that the name of the authors not be used
-*  in advertising or publicity pertaining to distribution of the software
-*  without specific, written prior permission.  The authors makes no
-*  representations about the suitability of this software for any purpose.
-*  It is provided "as is" without express or implied warranty.
-*
-*  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-*  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-*  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-*  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-*  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-*  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-*  PERFORMANCE OF THIS SOFTWARE.
-*
-*  ========================================================================
-*
-* Language:            ANSI C
-* Environment: Any
-* Developer:    Kendall Bennett
-*
-* Description:  This file includes subroutines to implement the decoding
-*               and emulation of all the x86 extended two-byte processor
-*               instructions.
-*
-****************************************************************************/
-
-#include "x86emu/x86emui.h"
-
-/*----------------------------- Implementation ----------------------------*/
-
-/****************************************************************************
-PARAMETERS:
-op1 - Instruction op code
-
-REMARKS:
-Handles illegal opcodes.
-****************************************************************************/
-void x86emuOp2_illegal_op(
-       u8 op2)
-{
-       START_OF_INSTR();
-       DECODE_PRINTF("ILLEGAL EXTENDED X86 OPCODE\n");
-       TRACE_REGS();
-       printk("%04x:%04x: %02X ILLEGAL EXTENDED X86 OPCODE!\n",
-               M.x86.R_CS, M.x86.R_IP-2,op2);
-    HALT_SYS();
-    END_OF_INSTR();
-}
-
-#define xorl(a,b)   ((a) && !(b)) || (!(a) && (b))
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0x80-0x8F
-****************************************************************************/
-void x86emuOp2_long_jump(u8 op2)
-{
-    s32 target;
-    char *name = 0;
-    int cond = 0;
-
-    /* conditional jump to word offset. */
-    START_OF_INSTR();
-    switch (op2) {
-      case 0x80:
-       name = "JO\t";
-       cond =  ACCESS_FLAG(F_OF);
-       break;
-      case 0x81:
-       name = "JNO\t";
-       cond = !ACCESS_FLAG(F_OF);
-       break;
-      case 0x82:
-       name = "JB\t";
-       cond = ACCESS_FLAG(F_CF);
-       break;
-      case 0x83:
-       name = "JNB\t";
-       cond = !ACCESS_FLAG(F_CF);
-       break;
-      case 0x84:
-       name = "JZ\t";
-       cond = ACCESS_FLAG(F_ZF);
-       break;
-      case 0x85:
-       name = "JNZ\t";
-       cond = !ACCESS_FLAG(F_ZF);
-       break;
-      case 0x86:
-       name = "JBE\t";
-       cond = ACCESS_FLAG(F_CF) || ACCESS_FLAG(F_ZF);
-       break;
-      case 0x87:
-       name = "JNBE\t";
-       cond = !(ACCESS_FLAG(F_CF) || ACCESS_FLAG(F_ZF));
-       break;
-      case 0x88:
-       name = "JS\t";
-       cond = ACCESS_FLAG(F_SF);
-       break;
-      case 0x89:
-       name = "JNS\t";
-       cond = !ACCESS_FLAG(F_SF);
-       break;
-      case 0x8a:
-       name = "JP\t";
-       cond = ACCESS_FLAG(F_PF);
-       break;
-      case 0x8b:
-       name = "JNP\t";
-       cond = !ACCESS_FLAG(F_PF);
-       break;
-      case 0x8c:
-       name = "JL\t";
-       cond = xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF));
-       break;
-      case 0x8d:
-       name = "JNL\t";
-       cond = xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF));
-       break;
-      case 0x8e:
-       name = "JLE\t";
-       cond = (xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF)) ||
-               ACCESS_FLAG(F_ZF));
-       break;
-      case 0x8f:
-       name = "JNLE\t";
-       cond = !(xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF)) ||
-                ACCESS_FLAG(F_ZF));
-       break;
-    }
-    DECODE_PRINTF(name);
-    target = (s16) fetch_word_imm();
-    target += (s16) M.x86.R_IP;
-    DECODE_PRINTF2("%04x\n", target);
-    TRACE_AND_STEP();
-    if (cond)
-       M.x86.R_IP = (u16)target;
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0x90-0x9F
-****************************************************************************/
-void x86emuOp2_set_byte(u8 op2)
-{
-    int mod, rl, rh;
-    uint destoffset;
-    u8  *destreg;
-    char *name = 0;
-    int cond = 0;
-
-    START_OF_INSTR();
-    switch (op2) {
-      case 0x90:
-       name = "SETO\t";
-       cond =  ACCESS_FLAG(F_OF);
-       break;
-      case 0x91:
-       name = "SETNO\t";
-       cond = !ACCESS_FLAG(F_OF);
-       break;
-      case 0x92:
-       name = "SETB\t";
-       cond = ACCESS_FLAG(F_CF);
-       break;
-      case 0x93:
-       name = "SETNB\t";
-       cond = !ACCESS_FLAG(F_CF);
-       break;
-      case 0x94:
-       name = "SETZ\t";
-       cond = ACCESS_FLAG(F_ZF);
-       break;
-      case 0x95:
-       name = "SETNZ\t";
-       cond = !ACCESS_FLAG(F_ZF);
-       break;
-      case 0x96:
-       name = "SETBE\t";
-       cond = ACCESS_FLAG(F_CF) || ACCESS_FLAG(F_ZF);
-       break;
-      case 0x97:
-       name = "SETNBE\t";
-       cond = !(ACCESS_FLAG(F_CF) || ACCESS_FLAG(F_ZF));
-       break;
-      case 0x98:
-       name = "SETS\t";
-       cond = ACCESS_FLAG(F_SF);
-       break;
-      case 0x99:
-       name = "SETNS\t";
-       cond = !ACCESS_FLAG(F_SF);
-       break;
-      case 0x9a:
-       name = "SETP\t";
-       cond = ACCESS_FLAG(F_PF);
-       break;
-      case 0x9b:
-       name = "SETNP\t";
-       cond = !ACCESS_FLAG(F_PF);
-       break;
-      case 0x9c:
-       name = "SETL\t";
-       cond = xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF));
-       break;
-      case 0x9d:
-       name = "SETNL\t";
-       cond = xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF));
-       break;
-      case 0x9e:
-       name = "SETLE\t";
-       cond = (xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF)) ||
-               ACCESS_FLAG(F_ZF));
-       break;
-      case 0x9f:
-       name = "SETNLE\t";
-       cond = !(xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF)) ||
-                ACCESS_FLAG(F_ZF));
-       break;
-    }
-    DECODE_PRINTF(name);
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       destoffset = decode_rm00_address(rl);
-       TRACE_AND_STEP();
-       store_data_byte(destoffset, cond ? 0x01 : 0x00);
-       break;
-    case 1:
-       destoffset = decode_rm01_address(rl);
-       TRACE_AND_STEP();
-       store_data_byte(destoffset, cond ? 0x01 : 0x00);
-       break;
-    case 2:
-       destoffset = decode_rm10_address(rl);
-       TRACE_AND_STEP();
-       store_data_byte(destoffset, cond ? 0x01 : 0x00);
-       break;
-    case 3:                     /* register to register */
-       destreg = DECODE_RM_BYTE_REGISTER(rl);
-       TRACE_AND_STEP();
-       *destreg = cond ? 0x01 : 0x00;
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0xa0
-****************************************************************************/
-void x86emuOp2_push_FS(u8 X86EMU_UNUSED(op2))
-{
-    START_OF_INSTR();
-    DECODE_PRINTF("PUSH\tFS\n");
-    TRACE_AND_STEP();
-    push_word(M.x86.R_FS);
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0xa1
-****************************************************************************/
-void x86emuOp2_pop_FS(u8 X86EMU_UNUSED(op2))
-{
-    START_OF_INSTR();
-    DECODE_PRINTF("POP\tFS\n");
-    TRACE_AND_STEP();
-    M.x86.R_FS = pop_word();
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0xa3
-****************************************************************************/
-void x86emuOp2_bt_R(u8 X86EMU_UNUSED(op2))
-{
-    int mod, rl, rh;
-    uint srcoffset;
-    int bit,disp;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("BT\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 srcval;
-           u32 *shiftreg;
-
-           srcoffset = decode_rm00_address(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_LONG_REGISTER(rh);
-           TRACE_AND_STEP();
-           bit = *shiftreg & 0x1F;
-           disp = (s16)*shiftreg >> 5;
-           srcval = fetch_data_long(srcoffset+disp);
-           CONDITIONAL_SET_FLAG(srcval & (0x1 << bit),F_CF);
-       } else {
-           u16 srcval;
-           u16 *shiftreg;
-
-           srcoffset = decode_rm00_address(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_WORD_REGISTER(rh);
-           TRACE_AND_STEP();
-           bit = *shiftreg & 0xF;
-           disp = (s16)*shiftreg >> 4;
-           srcval = fetch_data_word(srcoffset+disp);
-           CONDITIONAL_SET_FLAG(srcval & (0x1 << bit),F_CF);
-       }
-       break;
-    case 1:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 srcval;
-           u32 *shiftreg;
-
-           srcoffset = decode_rm01_address(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_LONG_REGISTER(rh);
-           TRACE_AND_STEP();
-           bit = *shiftreg & 0x1F;
-           disp = (s16)*shiftreg >> 5;
-           srcval = fetch_data_long(srcoffset+disp);
-           CONDITIONAL_SET_FLAG(srcval & (0x1 << bit),F_CF);
-       } else {
-           u16 srcval;
-           u16 *shiftreg;
-
-           srcoffset = decode_rm01_address(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_WORD_REGISTER(rh);
-           TRACE_AND_STEP();
-           bit = *shiftreg & 0xF;
-           disp = (s16)*shiftreg >> 4;
-           srcval = fetch_data_word(srcoffset+disp);
-           CONDITIONAL_SET_FLAG(srcval & (0x1 << bit),F_CF);
-       }
-       break;
-    case 2:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 srcval;
-           u32 *shiftreg;
-
-           srcoffset = decode_rm10_address(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_LONG_REGISTER(rh);
-           TRACE_AND_STEP();
-           bit = *shiftreg & 0x1F;
-           disp = (s16)*shiftreg >> 5;
-           srcval = fetch_data_long(srcoffset+disp);
-           CONDITIONAL_SET_FLAG(srcval & (0x1 << bit),F_CF);
-       } else {
-           u16 srcval;
-           u16 *shiftreg;
-
-           srcoffset = decode_rm10_address(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_WORD_REGISTER(rh);
-           TRACE_AND_STEP();
-           bit = *shiftreg & 0xF;
-           disp = (s16)*shiftreg >> 4;
-           srcval = fetch_data_word(srcoffset+disp);
-           CONDITIONAL_SET_FLAG(srcval & (0x1 << bit),F_CF);
-       }
-       break;
-    case 3:                     /* register to register */
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *srcreg,*shiftreg;
-
-           srcreg = DECODE_RM_LONG_REGISTER(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_LONG_REGISTER(rh);
-           TRACE_AND_STEP();
-           bit = *shiftreg & 0x1F;
-           CONDITIONAL_SET_FLAG(*srcreg & (0x1 << bit),F_CF);
-       } else {
-           u16 *srcreg,*shiftreg;
-
-           srcreg = DECODE_RM_WORD_REGISTER(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_WORD_REGISTER(rh);
-           TRACE_AND_STEP();
-           bit = *shiftreg & 0xF;
-           CONDITIONAL_SET_FLAG(*srcreg & (0x1 << bit),F_CF);
-       }
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0xa4
-****************************************************************************/
-void x86emuOp2_shld_IMM(u8 X86EMU_UNUSED(op2))
-{
-    int mod, rl, rh;
-    uint destoffset;
-       u8 shift;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("SHLD\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-           u32 *shiftreg;
-
-           destoffset = decode_rm00_address(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           shift = fetch_byte_imm();
-           DECODE_PRINTF2("%d\n", shift);
-           TRACE_AND_STEP();
-           destval = fetch_data_long(destoffset);
-           destval = shld_long(destval,*shiftreg,shift);
-           store_data_long(destoffset, destval);
-       } else {
-           u16 destval;
-           u16 *shiftreg;
-
-           destoffset = decode_rm00_address(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           shift = fetch_byte_imm();
-           DECODE_PRINTF2("%d\n", shift);
-           TRACE_AND_STEP();
-           destval = fetch_data_word(destoffset);
-           destval = shld_word(destval,*shiftreg,shift);
-           store_data_word(destoffset, destval);
-       }
-       break;
-    case 1:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-           u32 *shiftreg;
-
-           destoffset = decode_rm01_address(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           shift = fetch_byte_imm();
-           DECODE_PRINTF2("%d\n", shift);
-           TRACE_AND_STEP();
-           destval = fetch_data_long(destoffset);
-           destval = shld_long(destval,*shiftreg,shift);
-           store_data_long(destoffset, destval);
-       } else {
-           u16 destval;
-           u16 *shiftreg;
-
-           destoffset = decode_rm01_address(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           shift = fetch_byte_imm();
-           DECODE_PRINTF2("%d\n", shift);
-           TRACE_AND_STEP();
-           destval = fetch_data_word(destoffset);
-           destval = shld_word(destval,*shiftreg,shift);
-           store_data_word(destoffset, destval);
-       }
-       break;
-    case 2:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-           u32 *shiftreg;
-
-           destoffset = decode_rm10_address(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           shift = fetch_byte_imm();
-           DECODE_PRINTF2("%d\n", shift);
-           TRACE_AND_STEP();
-           destval = fetch_data_long(destoffset);
-           destval = shld_long(destval,*shiftreg,shift);
-           store_data_long(destoffset, destval);
-       } else {
-           u16 destval;
-           u16 *shiftreg;
-
-           destoffset = decode_rm10_address(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           shift = fetch_byte_imm();
-           DECODE_PRINTF2("%d\n", shift);
-           TRACE_AND_STEP();
-           destval = fetch_data_word(destoffset);
-           destval = shld_word(destval,*shiftreg,shift);
-           store_data_word(destoffset, destval);
-       }
-       break;
-    case 3:                     /* register to register */
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg,*shiftreg;
-
-           destreg = DECODE_RM_LONG_REGISTER(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           shift = fetch_byte_imm();
-           DECODE_PRINTF2("%d\n", shift);
-           TRACE_AND_STEP();
-           *destreg = shld_long(*destreg,*shiftreg,shift);
-       } else {
-           u16 *destreg,*shiftreg;
-
-           destreg = DECODE_RM_WORD_REGISTER(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           shift = fetch_byte_imm();
-           DECODE_PRINTF2("%d\n", shift);
-           TRACE_AND_STEP();
-           *destreg = shld_word(*destreg,*shiftreg,shift);
-       }
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0xa5
-****************************************************************************/
-void x86emuOp2_shld_CL(u8 X86EMU_UNUSED(op2))
-{
-    int mod, rl, rh;
-    uint destoffset;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("SHLD\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-           u32 *shiftreg;
-
-           destoffset = decode_rm00_address(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",CL\n");
-           TRACE_AND_STEP();
-           destval = fetch_data_long(destoffset);
-           destval = shld_long(destval,*shiftreg,M.x86.R_CL);
-           store_data_long(destoffset, destval);
-       } else {
-           u16 destval;
-           u16 *shiftreg;
-
-           destoffset = decode_rm00_address(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",CL\n");
-           TRACE_AND_STEP();
-           destval = fetch_data_word(destoffset);
-           destval = shld_word(destval,*shiftreg,M.x86.R_CL);
-           store_data_word(destoffset, destval);
-       }
-       break;
-    case 1:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-           u32 *shiftreg;
-
-           destoffset = decode_rm01_address(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",CL\n");
-           TRACE_AND_STEP();
-           destval = fetch_data_long(destoffset);
-           destval = shld_long(destval,*shiftreg,M.x86.R_CL);
-           store_data_long(destoffset, destval);
-       } else {
-           u16 destval;
-           u16 *shiftreg;
-
-           destoffset = decode_rm01_address(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",CL\n");
-           TRACE_AND_STEP();
-           destval = fetch_data_word(destoffset);
-           destval = shld_word(destval,*shiftreg,M.x86.R_CL);
-           store_data_word(destoffset, destval);
-       }
-       break;
-    case 2:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-           u32 *shiftreg;
-
-           destoffset = decode_rm10_address(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",CL\n");
-           TRACE_AND_STEP();
-           destval = fetch_data_long(destoffset);
-           destval = shld_long(destval,*shiftreg,M.x86.R_CL);
-           store_data_long(destoffset, destval);
-       } else {
-           u16 destval;
-           u16 *shiftreg;
-
-           destoffset = decode_rm10_address(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",CL\n");
-           TRACE_AND_STEP();
-           destval = fetch_data_word(destoffset);
-           destval = shld_word(destval,*shiftreg,M.x86.R_CL);
-           store_data_word(destoffset, destval);
-       }
-       break;
-    case 3:                     /* register to register */
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg,*shiftreg;
-
-           destreg = DECODE_RM_LONG_REGISTER(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",CL\n");
-           TRACE_AND_STEP();
-           *destreg = shld_long(*destreg,*shiftreg,M.x86.R_CL);
-       } else {
-           u16 *destreg,*shiftreg;
-
-           destreg = DECODE_RM_WORD_REGISTER(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",CL\n");
-           TRACE_AND_STEP();
-           *destreg = shld_word(*destreg,*shiftreg,M.x86.R_CL);
-       }
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0xa8
-****************************************************************************/
-void x86emuOp2_push_GS(u8 X86EMU_UNUSED(op2))
-{
-    START_OF_INSTR();
-    DECODE_PRINTF("PUSH\tGS\n");
-    TRACE_AND_STEP();
-    push_word(M.x86.R_GS);
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0xa9
-****************************************************************************/
-void x86emuOp2_pop_GS(u8 X86EMU_UNUSED(op2))
-{
-    START_OF_INSTR();
-    DECODE_PRINTF("POP\tGS\n");
-    TRACE_AND_STEP();
-    M.x86.R_GS = pop_word();
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0xaa
-****************************************************************************/
-void x86emuOp2_bts_R(u8 X86EMU_UNUSED(op2))
-{
-    int mod, rl, rh;
-    uint srcoffset;
-    int bit,disp;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("BTS\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 srcval,mask;
-           u32 *shiftreg;
-
-           srcoffset = decode_rm00_address(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_LONG_REGISTER(rh);
-           TRACE_AND_STEP();
-           bit = *shiftreg & 0x1F;
-           disp = (s16)*shiftreg >> 5;
-           srcval = fetch_data_long(srcoffset+disp);
-           mask = (0x1 << bit);
-           CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
-           store_data_long(srcoffset+disp, srcval | mask);
-       } else {
-           u16 srcval,mask;
-           u16 *shiftreg;
-
-           srcoffset = decode_rm00_address(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_WORD_REGISTER(rh);
-           TRACE_AND_STEP();
-           bit = *shiftreg & 0xF;
-           disp = (s16)*shiftreg >> 4;
-           srcval = fetch_data_word(srcoffset+disp);
-                       mask = (u16)(0x1 << bit);
-           CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
-           store_data_word(srcoffset+disp, srcval | mask);
-       }
-       break;
-    case 1:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 srcval,mask;
-           u32 *shiftreg;
-
-           srcoffset = decode_rm01_address(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_LONG_REGISTER(rh);
-           TRACE_AND_STEP();
-           bit = *shiftreg & 0x1F;
-           disp = (s16)*shiftreg >> 5;
-           srcval = fetch_data_long(srcoffset+disp);
-           mask = (0x1 << bit);
-           CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
-           store_data_long(srcoffset+disp, srcval | mask);
-       } else {
-           u16 srcval,mask;
-           u16 *shiftreg;
-
-           srcoffset = decode_rm01_address(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_WORD_REGISTER(rh);
-           TRACE_AND_STEP();
-           bit = *shiftreg & 0xF;
-           disp = (s16)*shiftreg >> 4;
-           srcval = fetch_data_word(srcoffset+disp);
-                       mask = (u16)(0x1 << bit);
-           CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
-           store_data_word(srcoffset+disp, srcval | mask);
-       }
-       break;
-    case 2:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 srcval,mask;
-           u32 *shiftreg;
-
-           srcoffset = decode_rm10_address(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_LONG_REGISTER(rh);
-           TRACE_AND_STEP();
-           bit = *shiftreg & 0x1F;
-           disp = (s16)*shiftreg >> 5;
-           srcval = fetch_data_long(srcoffset+disp);
-           mask = (0x1 << bit);
-           CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
-           store_data_long(srcoffset+disp, srcval | mask);
-       } else {
-           u16 srcval,mask;
-           u16 *shiftreg;
-
-                       srcoffset = decode_rm10_address(rl);
-                       DECODE_PRINTF(",");
-                       shiftreg = DECODE_RM_WORD_REGISTER(rh);
-                       TRACE_AND_STEP();
-                       bit = *shiftreg & 0xF;
-                       disp = (s16)*shiftreg >> 4;
-                       srcval = fetch_data_word(srcoffset+disp);
-                       mask = (u16)(0x1 << bit);
-                       CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
-                       store_data_word(srcoffset+disp, srcval | mask);
-               }
-               break;
-       case 3:                     /* register to register */
-               if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-                       u32 *srcreg,*shiftreg;
-                       u32 mask;
-
-                       srcreg = DECODE_RM_LONG_REGISTER(rl);
-                       DECODE_PRINTF(",");
-                       shiftreg = DECODE_RM_LONG_REGISTER(rh);
-                       TRACE_AND_STEP();
-                       bit = *shiftreg & 0x1F;
-                       mask = (0x1 << bit);
-                       CONDITIONAL_SET_FLAG(*srcreg & mask,F_CF);
-                       *srcreg |= mask;
-               } else {
-                       u16 *srcreg,*shiftreg;
-                       u16 mask;
-
-                       srcreg = DECODE_RM_WORD_REGISTER(rl);
-                       DECODE_PRINTF(",");
-                       shiftreg = DECODE_RM_WORD_REGISTER(rh);
-                       TRACE_AND_STEP();
-                       bit = *shiftreg & 0xF;
-                       mask = (u16)(0x1 << bit);
-           CONDITIONAL_SET_FLAG(*srcreg & mask,F_CF);
-           *srcreg |= mask;
-       }
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0xac
-****************************************************************************/
-void x86emuOp2_shrd_IMM(u8 X86EMU_UNUSED(op2))
-{
-    int mod, rl, rh;
-    uint destoffset;
-       u8 shift;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("SHLD\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-           u32 *shiftreg;
-
-           destoffset = decode_rm00_address(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           shift = fetch_byte_imm();
-           DECODE_PRINTF2("%d\n", shift);
-           TRACE_AND_STEP();
-           destval = fetch_data_long(destoffset);
-           destval = shrd_long(destval,*shiftreg,shift);
-           store_data_long(destoffset, destval);
-       } else {
-           u16 destval;
-           u16 *shiftreg;
-
-           destoffset = decode_rm00_address(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           shift = fetch_byte_imm();
-           DECODE_PRINTF2("%d\n", shift);
-           TRACE_AND_STEP();
-           destval = fetch_data_word(destoffset);
-           destval = shrd_word(destval,*shiftreg,shift);
-           store_data_word(destoffset, destval);
-       }
-       break;
-    case 1:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-           u32 *shiftreg;
-
-           destoffset = decode_rm01_address(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           shift = fetch_byte_imm();
-           DECODE_PRINTF2("%d\n", shift);
-           TRACE_AND_STEP();
-           destval = fetch_data_long(destoffset);
-           destval = shrd_long(destval,*shiftreg,shift);
-           store_data_long(destoffset, destval);
-       } else {
-           u16 destval;
-           u16 *shiftreg;
-
-           destoffset = decode_rm01_address(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           shift = fetch_byte_imm();
-           DECODE_PRINTF2("%d\n", shift);
-           TRACE_AND_STEP();
-           destval = fetch_data_word(destoffset);
-           destval = shrd_word(destval,*shiftreg,shift);
-           store_data_word(destoffset, destval);
-       }
-       break;
-    case 2:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-           u32 *shiftreg;
-
-           destoffset = decode_rm10_address(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           shift = fetch_byte_imm();
-           DECODE_PRINTF2("%d\n", shift);
-           TRACE_AND_STEP();
-           destval = fetch_data_long(destoffset);
-           destval = shrd_long(destval,*shiftreg,shift);
-           store_data_long(destoffset, destval);
-       } else {
-           u16 destval;
-           u16 *shiftreg;
-
-           destoffset = decode_rm10_address(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           shift = fetch_byte_imm();
-           DECODE_PRINTF2("%d\n", shift);
-           TRACE_AND_STEP();
-           destval = fetch_data_word(destoffset);
-           destval = shrd_word(destval,*shiftreg,shift);
-           store_data_word(destoffset, destval);
-       }
-       break;
-    case 3:                     /* register to register */
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg,*shiftreg;
-
-           destreg = DECODE_RM_LONG_REGISTER(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           shift = fetch_byte_imm();
-           DECODE_PRINTF2("%d\n", shift);
-           TRACE_AND_STEP();
-           *destreg = shrd_long(*destreg,*shiftreg,shift);
-       } else {
-           u16 *destreg,*shiftreg;
-
-           destreg = DECODE_RM_WORD_REGISTER(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           shift = fetch_byte_imm();
-           DECODE_PRINTF2("%d\n", shift);
-           TRACE_AND_STEP();
-           *destreg = shrd_word(*destreg,*shiftreg,shift);
-       }
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0xad
-****************************************************************************/
-void x86emuOp2_shrd_CL(u8 X86EMU_UNUSED(op2))
-{
-    int mod, rl, rh;
-    uint destoffset;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("SHLD\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-           u32 *shiftreg;
-
-           destoffset = decode_rm00_address(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",CL\n");
-           TRACE_AND_STEP();
-           destval = fetch_data_long(destoffset);
-           destval = shrd_long(destval,*shiftreg,M.x86.R_CL);
-           store_data_long(destoffset, destval);
-       } else {
-           u16 destval;
-           u16 *shiftreg;
-
-           destoffset = decode_rm00_address(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",CL\n");
-           TRACE_AND_STEP();
-           destval = fetch_data_word(destoffset);
-           destval = shrd_word(destval,*shiftreg,M.x86.R_CL);
-           store_data_word(destoffset, destval);
-       }
-       break;
-    case 1:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-           u32 *shiftreg;
-
-           destoffset = decode_rm01_address(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",CL\n");
-           TRACE_AND_STEP();
-           destval = fetch_data_long(destoffset);
-           destval = shrd_long(destval,*shiftreg,M.x86.R_CL);
-           store_data_long(destoffset, destval);
-       } else {
-           u16 destval;
-           u16 *shiftreg;
-
-           destoffset = decode_rm01_address(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",CL\n");
-           TRACE_AND_STEP();
-           destval = fetch_data_word(destoffset);
-           destval = shrd_word(destval,*shiftreg,M.x86.R_CL);
-           store_data_word(destoffset, destval);
-       }
-       break;
-    case 2:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 destval;
-           u32 *shiftreg;
-
-           destoffset = decode_rm10_address(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",CL\n");
-           TRACE_AND_STEP();
-           destval = fetch_data_long(destoffset);
-           destval = shrd_long(destval,*shiftreg,M.x86.R_CL);
-           store_data_long(destoffset, destval);
-       } else {
-           u16 destval;
-           u16 *shiftreg;
-
-           destoffset = decode_rm10_address(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",CL\n");
-           TRACE_AND_STEP();
-           destval = fetch_data_word(destoffset);
-           destval = shrd_word(destval,*shiftreg,M.x86.R_CL);
-           store_data_word(destoffset, destval);
-       }
-       break;
-    case 3:                     /* register to register */
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg,*shiftreg;
-
-           destreg = DECODE_RM_LONG_REGISTER(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",CL\n");
-           TRACE_AND_STEP();
-           *destreg = shrd_long(*destreg,*shiftreg,M.x86.R_CL);
-       } else {
-           u16 *destreg,*shiftreg;
-
-           destreg = DECODE_RM_WORD_REGISTER(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",CL\n");
-           TRACE_AND_STEP();
-           *destreg = shrd_word(*destreg,*shiftreg,M.x86.R_CL);
-       }
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0xaf
-****************************************************************************/
-void x86emuOp2_imul_R_RM(u8 X86EMU_UNUSED(op2))
-{
-    int mod, rl, rh;
-    uint srcoffset;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("IMUL\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg;
-           u32 srcval;
-           u32 res_lo,res_hi;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm00_address(rl);
-           srcval = fetch_data_long(srcoffset);
-           TRACE_AND_STEP();
-           imul_long_direct(&res_lo,&res_hi,(s32)*destreg,(s32)srcval);
-           if (res_hi != 0) {
-               SET_FLAG(F_CF);
-               SET_FLAG(F_OF);
-           } else {
-               CLEAR_FLAG(F_CF);
-               CLEAR_FLAG(F_OF);
-           }
-           *destreg = (u32)res_lo;
-       } else {
-           u16 *destreg;
-           u16 srcval;
-           u32 res;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm00_address(rl);
-           srcval = fetch_data_word(srcoffset);
-           TRACE_AND_STEP();
-           res = (s16)*destreg * (s16)srcval;
-           if (res > 0xFFFF) {
-               SET_FLAG(F_CF);
-               SET_FLAG(F_OF);
-           } else {
-               CLEAR_FLAG(F_CF);
-               CLEAR_FLAG(F_OF);
-           }
-           *destreg = (u16)res;
-       }
-       break;
-    case 1:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg;
-           u32 srcval;
-           u32 res_lo,res_hi;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm01_address(rl);
-           srcval = fetch_data_long(srcoffset);
-           TRACE_AND_STEP();
-           imul_long_direct(&res_lo,&res_hi,(s32)*destreg,(s32)srcval);
-           if (res_hi != 0) {
-               SET_FLAG(F_CF);
-               SET_FLAG(F_OF);
-           } else {
-               CLEAR_FLAG(F_CF);
-               CLEAR_FLAG(F_OF);
-           }
-           *destreg = (u32)res_lo;
-       } else {
-           u16 *destreg;
-           u16 srcval;
-           u32 res;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm01_address(rl);
-           srcval = fetch_data_word(srcoffset);
-           TRACE_AND_STEP();
-           res = (s16)*destreg * (s16)srcval;
-           if (res > 0xFFFF) {
-               SET_FLAG(F_CF);
-               SET_FLAG(F_OF);
-           } else {
-               CLEAR_FLAG(F_CF);
-               CLEAR_FLAG(F_OF);
-           }
-           *destreg = (u16)res;
-       }
-       break;
-    case 2:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg;
-           u32 srcval;
-           u32 res_lo,res_hi;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm10_address(rl);
-           srcval = fetch_data_long(srcoffset);
-           TRACE_AND_STEP();
-           imul_long_direct(&res_lo,&res_hi,(s32)*destreg,(s32)srcval);
-           if (res_hi != 0) {
-               SET_FLAG(F_CF);
-               SET_FLAG(F_OF);
-           } else {
-               CLEAR_FLAG(F_CF);
-               CLEAR_FLAG(F_OF);
-           }
-           *destreg = (u32)res_lo;
-       } else {
-           u16 *destreg;
-           u16 srcval;
-           u32 res;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm10_address(rl);
-           srcval = fetch_data_word(srcoffset);
-           TRACE_AND_STEP();
-           res = (s16)*destreg * (s16)srcval;
-           if (res > 0xFFFF) {
-               SET_FLAG(F_CF);
-               SET_FLAG(F_OF);
-           } else {
-               CLEAR_FLAG(F_CF);
-               CLEAR_FLAG(F_OF);
-           }
-           *destreg = (u16)res;
-       }
-       break;
-    case 3:                     /* register to register */
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg,*srcreg;
-           u32 res_lo,res_hi;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_LONG_REGISTER(rl);
-           TRACE_AND_STEP();
-           imul_long_direct(&res_lo,&res_hi,(s32)*destreg,(s32)*srcreg);
-           if (res_hi != 0) {
-               SET_FLAG(F_CF);
-               SET_FLAG(F_OF);
-           } else {
-               CLEAR_FLAG(F_CF);
-               CLEAR_FLAG(F_OF);
-           }
-           *destreg = (u32)res_lo;
-       } else {
-           u16 *destreg,*srcreg;
-           u32 res;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_WORD_REGISTER(rl);
-           res = (s16)*destreg * (s16)*srcreg;
-           if (res > 0xFFFF) {
-               SET_FLAG(F_CF);
-               SET_FLAG(F_OF);
-           } else {
-               CLEAR_FLAG(F_CF);
-               CLEAR_FLAG(F_OF);
-           }
-           *destreg = (u16)res;
-       }
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0xb2
-****************************************************************************/
-void x86emuOp2_lss_R_IMM(u8 X86EMU_UNUSED(op2))
-{
-       int mod, rh, rl;
-    u16 *dstreg;
-    uint srcoffset;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("LSS\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       dstreg = DECODE_RM_WORD_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm00_address(rl);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *dstreg = fetch_data_word(srcoffset);
-       M.x86.R_SS = fetch_data_word(srcoffset + 2);
-       break;
-    case 1:
-       dstreg = DECODE_RM_WORD_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm01_address(rl);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *dstreg = fetch_data_word(srcoffset);
-       M.x86.R_SS = fetch_data_word(srcoffset + 2);
-       break;
-    case 2:
-       dstreg = DECODE_RM_WORD_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm10_address(rl);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *dstreg = fetch_data_word(srcoffset);
-       M.x86.R_SS = fetch_data_word(srcoffset + 2);
-       break;
-    case 3:                     /* register to register */
-       /* UNDEFINED! */
-       TRACE_AND_STEP();
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0xb3
-****************************************************************************/
-void x86emuOp2_btr_R(u8 X86EMU_UNUSED(op2))
-{
-       int mod, rl, rh;
-       uint srcoffset;
-       int bit,disp;
-
-       START_OF_INSTR();
-       DECODE_PRINTF("BTR\t");
-       FETCH_DECODE_MODRM(mod, rh, rl);
-       switch (mod) {
-       case 0:
-               if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-                       u32 srcval,mask;
-                       u32 *shiftreg;
-
-                       srcoffset = decode_rm00_address(rl);
-                       DECODE_PRINTF(",");
-                       shiftreg = DECODE_RM_LONG_REGISTER(rh);
-                       TRACE_AND_STEP();
-                       bit = *shiftreg & 0x1F;
-                       disp = (s16)*shiftreg >> 5;
-                       srcval = fetch_data_long(srcoffset+disp);
-                       mask = (0x1 << bit);
-                       CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
-                       store_data_long(srcoffset+disp, srcval & ~mask);
-               } else {
-                       u16 srcval,mask;
-                       u16 *shiftreg;
-
-                       srcoffset = decode_rm00_address(rl);
-                       DECODE_PRINTF(",");
-                       shiftreg = DECODE_RM_WORD_REGISTER(rh);
-                       TRACE_AND_STEP();
-                       bit = *shiftreg & 0xF;
-                       disp = (s16)*shiftreg >> 4;
-                       srcval = fetch_data_word(srcoffset+disp);
-                       mask = (u16)(0x1 << bit);
-                       CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
-                       store_data_word(srcoffset+disp, (u16)(srcval & ~mask));
-               }
-               break;
-       case 1:
-               if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-                       u32 srcval,mask;
-                       u32 *shiftreg;
-
-                       srcoffset = decode_rm01_address(rl);
-                       DECODE_PRINTF(",");
-                       shiftreg = DECODE_RM_LONG_REGISTER(rh);
-                       TRACE_AND_STEP();
-                       bit = *shiftreg & 0x1F;
-                       disp = (s16)*shiftreg >> 5;
-                       srcval = fetch_data_long(srcoffset+disp);
-                       mask = (0x1 << bit);
-                       CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
-                       store_data_long(srcoffset+disp, srcval & ~mask);
-               } else {
-                       u16 srcval,mask;
-                       u16 *shiftreg;
-
-                       srcoffset = decode_rm01_address(rl);
-                       DECODE_PRINTF(",");
-                       shiftreg = DECODE_RM_WORD_REGISTER(rh);
-                       TRACE_AND_STEP();
-                       bit = *shiftreg & 0xF;
-                       disp = (s16)*shiftreg >> 4;
-                       srcval = fetch_data_word(srcoffset+disp);
-                       mask = (u16)(0x1 << bit);
-                       CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
-                       store_data_word(srcoffset+disp, (u16)(srcval & ~mask));
-               }
-               break;
-       case 2:
-               if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-                       u32 srcval,mask;
-                       u32 *shiftreg;
-
-                       srcoffset = decode_rm10_address(rl);
-                       DECODE_PRINTF(",");
-                       shiftreg = DECODE_RM_LONG_REGISTER(rh);
-                       TRACE_AND_STEP();
-                       bit = *shiftreg & 0x1F;
-                       disp = (s16)*shiftreg >> 5;
-                       srcval = fetch_data_long(srcoffset+disp);
-                       mask = (0x1 << bit);
-                       CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
-                       store_data_long(srcoffset+disp, srcval & ~mask);
-               } else {
-                       u16 srcval,mask;
-                       u16 *shiftreg;
-
-                       srcoffset = decode_rm10_address(rl);
-                       DECODE_PRINTF(",");
-                       shiftreg = DECODE_RM_WORD_REGISTER(rh);
-                       TRACE_AND_STEP();
-                       bit = *shiftreg & 0xF;
-                       disp = (s16)*shiftreg >> 4;
-                       srcval = fetch_data_word(srcoffset+disp);
-                       mask = (u16)(0x1 << bit);
-                       CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
-                       store_data_word(srcoffset+disp, (u16)(srcval & ~mask));
-               }
-               break;
-       case 3:                     /* register to register */
-               if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-                       u32 *srcreg,*shiftreg;
-                       u32 mask;
-
-                       srcreg = DECODE_RM_LONG_REGISTER(rl);
-                       DECODE_PRINTF(",");
-                       shiftreg = DECODE_RM_LONG_REGISTER(rh);
-                       TRACE_AND_STEP();
-                       bit = *shiftreg & 0x1F;
-                       mask = (0x1 << bit);
-                       CONDITIONAL_SET_FLAG(*srcreg & mask,F_CF);
-                       *srcreg &= ~mask;
-               } else {
-                       u16 *srcreg,*shiftreg;
-                       u16 mask;
-
-                       srcreg = DECODE_RM_WORD_REGISTER(rl);
-                       DECODE_PRINTF(",");
-                       shiftreg = DECODE_RM_WORD_REGISTER(rh);
-                       TRACE_AND_STEP();
-                       bit = *shiftreg & 0xF;
-                       mask = (u16)(0x1 << bit);
-                       CONDITIONAL_SET_FLAG(*srcreg & mask,F_CF);
-                       *srcreg &= ~mask;
-               }
-               break;
-       }
-       DECODE_CLEAR_SEGOVR();
-       END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0xb4
-****************************************************************************/
-void x86emuOp2_lfs_R_IMM(u8 X86EMU_UNUSED(op2))
-{
-       int mod, rh, rl;
-    u16 *dstreg;
-    uint srcoffset;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("LFS\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       dstreg = DECODE_RM_WORD_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm00_address(rl);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *dstreg = fetch_data_word(srcoffset);
-       M.x86.R_FS = fetch_data_word(srcoffset + 2);
-       break;
-    case 1:
-       dstreg = DECODE_RM_WORD_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm01_address(rl);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *dstreg = fetch_data_word(srcoffset);
-       M.x86.R_FS = fetch_data_word(srcoffset + 2);
-       break;
-    case 2:
-       dstreg = DECODE_RM_WORD_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm10_address(rl);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *dstreg = fetch_data_word(srcoffset);
-       M.x86.R_FS = fetch_data_word(srcoffset + 2);
-       break;
-    case 3:                     /* register to register */
-       /* UNDEFINED! */
-       TRACE_AND_STEP();
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0xb5
-****************************************************************************/
-void x86emuOp2_lgs_R_IMM(u8 X86EMU_UNUSED(op2))
-{
-       int mod, rh, rl;
-    u16 *dstreg;
-    uint srcoffset;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("LGS\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       dstreg = DECODE_RM_WORD_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm00_address(rl);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *dstreg = fetch_data_word(srcoffset);
-       M.x86.R_GS = fetch_data_word(srcoffset + 2);
-       break;
-    case 1:
-       dstreg = DECODE_RM_WORD_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm01_address(rl);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *dstreg = fetch_data_word(srcoffset);
-       M.x86.R_GS = fetch_data_word(srcoffset + 2);
-       break;
-    case 2:
-       dstreg = DECODE_RM_WORD_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm10_address(rl);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *dstreg = fetch_data_word(srcoffset);
-       M.x86.R_GS = fetch_data_word(srcoffset + 2);
-       break;
-    case 3:                     /* register to register */
-       /* UNDEFINED! */
-       TRACE_AND_STEP();
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0xb6
-****************************************************************************/
-void x86emuOp2_movzx_byte_R_RM(u8 X86EMU_UNUSED(op2))
-{
-    int mod, rl, rh;
-    uint srcoffset;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("MOVZX\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg;
-           u32 srcval;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm00_address(rl);
-           srcval = fetch_data_byte(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = srcval;
-       } else {
-           u16 *destreg;
-           u16 srcval;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm00_address(rl);
-           srcval = fetch_data_byte(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = srcval;
-       }
-       break;
-    case 1:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg;
-           u32 srcval;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm01_address(rl);
-           srcval = fetch_data_byte(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = srcval;
-       } else {
-           u16 *destreg;
-           u16 srcval;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm01_address(rl);
-           srcval = fetch_data_byte(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = srcval;
-       }
-       break;
-    case 2:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg;
-           u32 srcval;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm10_address(rl);
-           srcval = fetch_data_byte(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = srcval;
-       } else {
-           u16 *destreg;
-           u16 srcval;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm10_address(rl);
-           srcval = fetch_data_byte(srcoffset);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = srcval;
-       }
-       break;
-    case 3:                     /* register to register */
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg;
-           u8  *srcreg;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_BYTE_REGISTER(rl);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = *srcreg;
-       } else {
-           u16 *destreg;
-           u8  *srcreg;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_BYTE_REGISTER(rl);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = *srcreg;
-       }
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0xb7
-****************************************************************************/
-void x86emuOp2_movzx_word_R_RM(u8 X86EMU_UNUSED(op2))
-{
-    int mod, rl, rh;
-    uint srcoffset;
-    u32 *destreg;
-    u32 srcval;
-    u16 *srcreg;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("MOVZX\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       destreg = DECODE_RM_LONG_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm00_address(rl);
-       srcval = fetch_data_word(srcoffset);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = srcval;
-       break;
-    case 1:
-       destreg = DECODE_RM_LONG_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm01_address(rl);
-       srcval = fetch_data_word(srcoffset);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = srcval;
-       break;
-    case 2:
-       destreg = DECODE_RM_LONG_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm10_address(rl);
-       srcval = fetch_data_word(srcoffset);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = srcval;
-       break;
-    case 3:                     /* register to register */
-       destreg = DECODE_RM_LONG_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcreg = DECODE_RM_WORD_REGISTER(rl);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = *srcreg;
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0xba
-****************************************************************************/
-void x86emuOp2_btX_I(u8 X86EMU_UNUSED(op2))
-{
-    int mod, rl, rh;
-    uint srcoffset;
-    int bit;
-
-    START_OF_INSTR();
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (rh) {
-    case 3:
-       DECODE_PRINTF("BT\t");
-       break;
-    case 4:
-       DECODE_PRINTF("BTS\t");
-       break;
-    case 5:
-       DECODE_PRINTF("BTR\t");
-       break;
-    case 6:
-       DECODE_PRINTF("BTC\t");
-       break;
-    default:
-       DECODE_PRINTF("ILLEGAL EXTENDED X86 OPCODE\n");
-       TRACE_REGS();
-       printk("%04x:%04x: %02X%02X ILLEGAL EXTENDED X86 OPCODE EXTENSION!\n",
-               M.x86.R_CS, M.x86.R_IP-3,op2, (mod<<6)|(rh<<3)|rl);
-       HALT_SYS();
-    }
-    switch (mod) {
-    case 0:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 srcval, mask;
-           u8 shift;
-
-           srcoffset = decode_rm00_address(rl);
-           DECODE_PRINTF(",");
-           shift = fetch_byte_imm();
-           TRACE_AND_STEP();
-           bit = shift & 0x1F;
-           srcval = fetch_data_long(srcoffset);
-           mask = (0x1 << bit);
-           CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
-           switch (rh) {
-           case 4:
-               store_data_long(srcoffset, srcval | mask);
-               break;
-           case 5:
-               store_data_long(srcoffset, srcval & ~mask);
-               break;
-           case 6:
-               store_data_long(srcoffset, srcval ^ mask);
-               break;
-           default:
-               break;
-           }
-       } else {
-           u16 srcval, mask;
-           u8 shift;
-
-           srcoffset = decode_rm00_address(rl);
-           DECODE_PRINTF(",");
-           shift = fetch_byte_imm();
-           TRACE_AND_STEP();
-           bit = shift & 0xF;
-           srcval = fetch_data_word(srcoffset);
-           mask = (0x1 << bit);
-           CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
-           switch (rh) {
-           case 4:
-               store_data_word(srcoffset, srcval | mask);
-               break;
-           case 5:
-               store_data_word(srcoffset, srcval & ~mask);
-               break;
-           case 6:
-               store_data_word(srcoffset, srcval ^ mask);
-               break;
-           default:
-               break;
-           }
-       }
-       break;
-    case 1:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 srcval, mask;
-           u8 shift;
-
-           srcoffset = decode_rm01_address(rl);
-           DECODE_PRINTF(",");
-           shift = fetch_byte_imm();
-           TRACE_AND_STEP();
-           bit = shift & 0x1F;
-           srcval = fetch_data_long(srcoffset);
-           mask = (0x1 << bit);
-           CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
-           switch (rh) {
-           case 4:
-               store_data_long(srcoffset, srcval | mask);
-               break;
-           case 5:
-               store_data_long(srcoffset, srcval & ~mask);
-               break;
-           case 6:
-               store_data_long(srcoffset, srcval ^ mask);
-               break;
-           default:
-               break;
-           }
-       } else {
-           u16 srcval, mask;
-           u8 shift;
-
-           srcoffset = decode_rm01_address(rl);
-           DECODE_PRINTF(",");
-           shift = fetch_byte_imm();
-           TRACE_AND_STEP();
-           bit = shift & 0xF;
-           srcval = fetch_data_word(srcoffset);
-           mask = (0x1 << bit);
-           CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
-           switch (rh) {
-           case 4:
-               store_data_word(srcoffset, srcval | mask);
-               break;
-           case 5:
-               store_data_word(srcoffset, srcval & ~mask);
-               break;
-           case 6:
-               store_data_word(srcoffset, srcval ^ mask);
-               break;
-           default:
-               break;
-           }
-       }
-       break;
-    case 2:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 srcval, mask;
-           u8 shift;
-
-           srcoffset = decode_rm10_address(rl);
-           DECODE_PRINTF(",");
-           shift = fetch_byte_imm();
-           TRACE_AND_STEP();
-           bit = shift & 0x1F;
-           srcval = fetch_data_long(srcoffset);
-           mask = (0x1 << bit);
-           CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
-           switch (rh) {
-           case 4:
-               store_data_long(srcoffset, srcval | mask);
-               break;
-           case 5:
-               store_data_long(srcoffset, srcval & ~mask);
-               break;
-           case 6:
-               store_data_long(srcoffset, srcval ^ mask);
-               break;
-           default:
-               break;
-           }
-       } else {
-           u16 srcval, mask;
-           u8 shift;
-
-           srcoffset = decode_rm10_address(rl);
-           DECODE_PRINTF(",");
-           shift = fetch_byte_imm();
-           TRACE_AND_STEP();
-           bit = shift & 0xF;
-           srcval = fetch_data_word(srcoffset);
-           mask = (0x1 << bit);
-           CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
-           switch (rh) {
-           case 4:
-               store_data_word(srcoffset, srcval | mask);
-               break;
-           case 5:
-               store_data_word(srcoffset, srcval & ~mask);
-               break;
-           case 6:
-               store_data_word(srcoffset, srcval ^ mask);
-               break;
-           default:
-               break;
-           }
-       }
-       break;
-    case 3:                     /* register to register */
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *srcreg;
-           u32 mask;
-           u8 shift;
-
-           srcreg = DECODE_RM_LONG_REGISTER(rl);
-           DECODE_PRINTF(",");
-           shift = fetch_byte_imm();
-           TRACE_AND_STEP();
-           bit = shift & 0x1F;
-           mask = (0x1 << bit);
-           CONDITIONAL_SET_FLAG(*srcreg & mask,F_CF);
-           switch (rh) {
-           case 4:
-               *srcreg |= mask;
-               break;
-           case 5:
-               *srcreg &= ~mask;
-               break;
-           case 6:
-               *srcreg ^= mask;
-               break;
-           default:
-               break;
-           }
-       } else {
-           u16 *srcreg;
-           u16 mask;
-           u8 shift;
-
-           srcreg = DECODE_RM_WORD_REGISTER(rl);
-           DECODE_PRINTF(",");
-           shift = fetch_byte_imm();
-           TRACE_AND_STEP();
-           bit = shift & 0xF;
-           mask = (0x1 << bit);
-           CONDITIONAL_SET_FLAG(*srcreg & mask,F_CF);
-           switch (rh) {
-           case 4:
-               *srcreg |= mask;
-               break;
-           case 5:
-               *srcreg &= ~mask;
-               break;
-           case 6:
-               *srcreg ^= mask;
-               break;
-           default:
-               break;
-           }
-       }
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0xbb
-****************************************************************************/
-void x86emuOp2_btc_R(u8 X86EMU_UNUSED(op2))
-{
-    int mod, rl, rh;
-    uint srcoffset;
-    int bit,disp;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("BTC\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 srcval,mask;
-           u32 *shiftreg;
-
-           srcoffset = decode_rm00_address(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_LONG_REGISTER(rh);
-           TRACE_AND_STEP();
-           bit = *shiftreg & 0x1F;
-           disp = (s16)*shiftreg >> 5;
-           srcval = fetch_data_long(srcoffset+disp);
-           mask = (0x1 << bit);
-           CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
-           store_data_long(srcoffset+disp, srcval ^ mask);
-       } else {
-           u16 srcval,mask;
-           u16 *shiftreg;
-
-           srcoffset = decode_rm00_address(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_WORD_REGISTER(rh);
-           TRACE_AND_STEP();
-           bit = *shiftreg & 0xF;
-           disp = (s16)*shiftreg >> 4;
-           srcval = fetch_data_word(srcoffset+disp);
-                       mask = (u16)(0x1 << bit);
-           CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
-                       store_data_word(srcoffset+disp, (u16)(srcval ^ mask));
-       }
-       break;
-    case 1:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 srcval,mask;
-           u32 *shiftreg;
-
-           srcoffset = decode_rm01_address(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_LONG_REGISTER(rh);
-           TRACE_AND_STEP();
-           bit = *shiftreg & 0x1F;
-           disp = (s16)*shiftreg >> 5;
-           srcval = fetch_data_long(srcoffset+disp);
-           mask = (0x1 << bit);
-           CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
-           store_data_long(srcoffset+disp, srcval ^ mask);
-       } else {
-           u16 srcval,mask;
-           u16 *shiftreg;
-
-           srcoffset = decode_rm01_address(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_WORD_REGISTER(rh);
-           TRACE_AND_STEP();
-           bit = *shiftreg & 0xF;
-           disp = (s16)*shiftreg >> 4;
-           srcval = fetch_data_word(srcoffset+disp);
-                       mask = (u16)(0x1 << bit);
-                       CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
-                       store_data_word(srcoffset+disp, (u16)(srcval ^ mask));
-       }
-       break;
-    case 2:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 srcval,mask;
-           u32 *shiftreg;
-
-           srcoffset = decode_rm10_address(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_LONG_REGISTER(rh);
-           TRACE_AND_STEP();
-           bit = *shiftreg & 0x1F;
-           disp = (s16)*shiftreg >> 5;
-           srcval = fetch_data_long(srcoffset+disp);
-           mask = (0x1 << bit);
-           CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
-           store_data_long(srcoffset+disp, srcval ^ mask);
-       } else {
-           u16 srcval,mask;
-           u16 *shiftreg;
-
-           srcoffset = decode_rm10_address(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_WORD_REGISTER(rh);
-           TRACE_AND_STEP();
-           bit = *shiftreg & 0xF;
-           disp = (s16)*shiftreg >> 4;
-           srcval = fetch_data_word(srcoffset+disp);
-                       mask = (u16)(0x1 << bit);
-                       CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
-                       store_data_word(srcoffset+disp, (u16)(srcval ^ mask));
-       }
-       break;
-    case 3:                     /* register to register */
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-                       u32 *srcreg,*shiftreg;
-           u32 mask;
-
-           srcreg = DECODE_RM_LONG_REGISTER(rl);
-           DECODE_PRINTF(",");
-           shiftreg = DECODE_RM_LONG_REGISTER(rh);
-           TRACE_AND_STEP();
-           bit = *shiftreg & 0x1F;
-           mask = (0x1 << bit);
-                       CONDITIONAL_SET_FLAG(*srcreg & mask,F_CF);
-                       *srcreg ^= mask;
-               } else {
-                       u16 *srcreg,*shiftreg;
-                       u16 mask;
-
-                       srcreg = DECODE_RM_WORD_REGISTER(rl);
-                       DECODE_PRINTF(",");
-                       shiftreg = DECODE_RM_WORD_REGISTER(rh);
-                       TRACE_AND_STEP();
-                       bit = *shiftreg & 0xF;
-                       mask = (u16)(0x1 << bit);
-           CONDITIONAL_SET_FLAG(*srcreg & mask,F_CF);
-           *srcreg ^= mask;
-       }
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0xbc
-****************************************************************************/
-void x86emuOp2_bsf(u8 X86EMU_UNUSED(op2))
-{
-    int mod, rl, rh;
-    uint srcoffset;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("BSF\n");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch(mod) {
-    case 0:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 srcval, *dstreg;
-
-           srcoffset = decode_rm00_address(rl);
-           DECODE_PRINTF(",");
-           dstreg = DECODE_RM_LONG_REGISTER(rh);
-           TRACE_AND_STEP();
-           srcval = fetch_data_long(srcoffset);
-           CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
-           for(*dstreg = 0; *dstreg < 32; (*dstreg)++)
-               if ((srcval >> *dstreg) & 1) break;
-       } else {
-           u16 srcval, *dstreg;
-
-           srcoffset = decode_rm00_address(rl);
-           DECODE_PRINTF(",");
-           dstreg = DECODE_RM_WORD_REGISTER(rh);
-           TRACE_AND_STEP();
-           srcval = fetch_data_word(srcoffset);
-           CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
-           for(*dstreg = 0; *dstreg < 16; (*dstreg)++)
-               if ((srcval >> *dstreg) & 1) break;
-       }
-       break;
-    case 1:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 srcval, *dstreg;
-
-           srcoffset = decode_rm01_address(rl);
-           DECODE_PRINTF(",");
-           dstreg = DECODE_RM_LONG_REGISTER(rh);
-           TRACE_AND_STEP();
-           srcval = fetch_data_long(srcoffset);
-           CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
-           for(*dstreg = 0; *dstreg < 32; (*dstreg)++)
-               if ((srcval >> *dstreg) & 1) break;
-       } else {
-           u16 srcval, *dstreg;
-
-           srcoffset = decode_rm01_address(rl);
-           DECODE_PRINTF(",");
-           dstreg = DECODE_RM_WORD_REGISTER(rh);
-           TRACE_AND_STEP();
-           srcval = fetch_data_word(srcoffset);
-           CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
-           for(*dstreg = 0; *dstreg < 16; (*dstreg)++)
-               if ((srcval >> *dstreg) & 1) break;
-       }
-       break;
-    case 2:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 srcval, *dstreg;
-
-           srcoffset = decode_rm10_address(rl);
-           DECODE_PRINTF(",");
-           dstreg = DECODE_RM_LONG_REGISTER(rh);
-           TRACE_AND_STEP();
-           srcval = fetch_data_long(srcoffset);
-           CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
-           for(*dstreg = 0; *dstreg < 32; (*dstreg)++)
-               if ((srcval >> *dstreg) & 1) break;
-       } else {
-           u16 srcval, *dstreg;
-
-           srcoffset = decode_rm10_address(rl);
-           DECODE_PRINTF(",");
-           dstreg = DECODE_RM_WORD_REGISTER(rh);
-           TRACE_AND_STEP();
-           srcval = fetch_data_word(srcoffset);
-           CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
-           for(*dstreg = 0; *dstreg < 16; (*dstreg)++)
-               if ((srcval >> *dstreg) & 1) break;
-       }
-       break;
-    case 3:                            /* register to register */
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *srcreg, *dstreg;
-
-           srcreg = DECODE_RM_LONG_REGISTER(rl);
-           DECODE_PRINTF(",");
-           dstreg = DECODE_RM_LONG_REGISTER(rh);
-           TRACE_AND_STEP();
-           CONDITIONAL_SET_FLAG(*srcreg == 0, F_ZF);
-           for(*dstreg = 0; *dstreg < 32; (*dstreg)++)
-               if ((*srcreg >> *dstreg) & 1) break;
-       } else {
-           u16 *srcreg, *dstreg;
-
-           srcreg = DECODE_RM_WORD_REGISTER(rl);
-           DECODE_PRINTF(",");
-           dstreg = DECODE_RM_WORD_REGISTER(rh);
-           TRACE_AND_STEP();
-           CONDITIONAL_SET_FLAG(*srcreg == 0, F_ZF);
-           for(*dstreg = 0; *dstreg < 16; (*dstreg)++)
-               if ((*srcreg >> *dstreg) & 1) break;
-       }
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0xbd
-****************************************************************************/
-void x86emuOp2_bsr(u8 X86EMU_UNUSED(op2))
-{
-    int mod, rl, rh;
-    uint srcoffset;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("BSF\n");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch(mod) {
-    case 0:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 srcval, *dstreg;
-
-           srcoffset = decode_rm00_address(rl);
-           DECODE_PRINTF(",");
-           dstreg = DECODE_RM_LONG_REGISTER(rh);
-           TRACE_AND_STEP();
-           srcval = fetch_data_long(srcoffset);
-           CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
-           for(*dstreg = 31; *dstreg > 0; (*dstreg)--)
-               if ((srcval >> *dstreg) & 1) break;
-       } else {
-           u16 srcval, *dstreg;
-
-           srcoffset = decode_rm00_address(rl);
-           DECODE_PRINTF(",");
-           dstreg = DECODE_RM_WORD_REGISTER(rh);
-           TRACE_AND_STEP();
-           srcval = fetch_data_word(srcoffset);
-           CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
-           for(*dstreg = 15; *dstreg > 0; (*dstreg)--)
-               if ((srcval >> *dstreg) & 1) break;
-       }
-       break;
-    case 1:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 srcval, *dstreg;
-
-           srcoffset = decode_rm01_address(rl);
-           DECODE_PRINTF(",");
-           dstreg = DECODE_RM_LONG_REGISTER(rh);
-           TRACE_AND_STEP();
-           srcval = fetch_data_long(srcoffset);
-           CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
-           for(*dstreg = 31; *dstreg > 0; (*dstreg)--)
-               if ((srcval >> *dstreg) & 1) break;
-       } else {
-           u16 srcval, *dstreg;
-
-           srcoffset = decode_rm01_address(rl);
-           DECODE_PRINTF(",");
-           dstreg = DECODE_RM_WORD_REGISTER(rh);
-           TRACE_AND_STEP();
-           srcval = fetch_data_word(srcoffset);
-           CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
-           for(*dstreg = 15; *dstreg > 0; (*dstreg)--)
-               if ((srcval >> *dstreg) & 1) break;
-       }
-       break;
-    case 2:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 srcval, *dstreg;
-
-           srcoffset = decode_rm10_address(rl);
-           DECODE_PRINTF(",");
-           dstreg = DECODE_RM_LONG_REGISTER(rh);
-           TRACE_AND_STEP();
-           srcval = fetch_data_long(srcoffset);
-           CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
-           for(*dstreg = 31; *dstreg > 0; (*dstreg)--)
-               if ((srcval >> *dstreg) & 1) break;
-       } else {
-           u16 srcval, *dstreg;
-
-           srcoffset = decode_rm10_address(rl);
-           DECODE_PRINTF(",");
-           dstreg = DECODE_RM_WORD_REGISTER(rh);
-           TRACE_AND_STEP();
-           srcval = fetch_data_word(srcoffset);
-           CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
-           for(*dstreg = 15; *dstreg > 0; (*dstreg)--)
-               if ((srcval >> *dstreg) & 1) break;
-       }
-       break;
-    case 3:                            /* register to register */
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *srcreg, *dstreg;
-
-           srcreg = DECODE_RM_LONG_REGISTER(rl);
-           DECODE_PRINTF(",");
-           dstreg = DECODE_RM_LONG_REGISTER(rh);
-           TRACE_AND_STEP();
-           CONDITIONAL_SET_FLAG(*srcreg == 0, F_ZF);
-           for(*dstreg = 31; *dstreg > 0; (*dstreg)--)
-               if ((*srcreg >> *dstreg) & 1) break;
-       } else {
-           u16 *srcreg, *dstreg;
-
-           srcreg = DECODE_RM_WORD_REGISTER(rl);
-           DECODE_PRINTF(",");
-           dstreg = DECODE_RM_WORD_REGISTER(rh);
-           TRACE_AND_STEP();
-           CONDITIONAL_SET_FLAG(*srcreg == 0, F_ZF);
-           for(*dstreg = 15; *dstreg > 0; (*dstreg)--)
-               if ((*srcreg >> *dstreg) & 1) break;
-       }
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0xbe
-****************************************************************************/
-void x86emuOp2_movsx_byte_R_RM(u8 X86EMU_UNUSED(op2))
-{
-    int mod, rl, rh;
-    uint srcoffset;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("MOVSX\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg;
-           u32 srcval;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm00_address(rl);
-           srcval = (s32)((s8)fetch_data_byte(srcoffset));
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = srcval;
-       } else {
-           u16 *destreg;
-           u16 srcval;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm00_address(rl);
-           srcval = (s16)((s8)fetch_data_byte(srcoffset));
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = srcval;
-       }
-       break;
-    case 1:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg;
-           u32 srcval;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm01_address(rl);
-           srcval = (s32)((s8)fetch_data_byte(srcoffset));
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = srcval;
-       } else {
-           u16 *destreg;
-           u16 srcval;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm01_address(rl);
-           srcval = (s16)((s8)fetch_data_byte(srcoffset));
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = srcval;
-       }
-       break;
-    case 2:
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg;
-           u32 srcval;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm10_address(rl);
-           srcval = (s32)((s8)fetch_data_byte(srcoffset));
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = srcval;
-       } else {
-           u16 *destreg;
-           u16 srcval;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcoffset = decode_rm10_address(rl);
-           srcval = (s16)((s8)fetch_data_byte(srcoffset));
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = srcval;
-       }
-       break;
-    case 3:                     /* register to register */
-       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-           u32 *destreg;
-           u8  *srcreg;
-
-           destreg = DECODE_RM_LONG_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_BYTE_REGISTER(rl);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = (s32)((s8)*srcreg);
-       } else {
-           u16 *destreg;
-           u8  *srcreg;
-
-           destreg = DECODE_RM_WORD_REGISTER(rh);
-           DECODE_PRINTF(",");
-           srcreg = DECODE_RM_BYTE_REGISTER(rl);
-           DECODE_PRINTF("\n");
-           TRACE_AND_STEP();
-           *destreg = (s16)((s8)*srcreg);
-       }
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/****************************************************************************
-REMARKS:
-Handles opcode 0x0f,0xbf
-****************************************************************************/
-void x86emuOp2_movsx_word_R_RM(u8 X86EMU_UNUSED(op2))
-{
-    int mod, rl, rh;
-    uint srcoffset;
-    u32 *destreg;
-    u32 srcval;
-    u16 *srcreg;
-
-    START_OF_INSTR();
-    DECODE_PRINTF("MOVSX\t");
-    FETCH_DECODE_MODRM(mod, rh, rl);
-    switch (mod) {
-    case 0:
-       destreg = DECODE_RM_LONG_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm00_address(rl);
-       srcval = (s32)((s16)fetch_data_word(srcoffset));
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = srcval;
-       break;
-    case 1:
-       destreg = DECODE_RM_LONG_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm01_address(rl);
-       srcval = (s32)((s16)fetch_data_word(srcoffset));
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = srcval;
-       break;
-    case 2:
-       destreg = DECODE_RM_LONG_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcoffset = decode_rm10_address(rl);
-       srcval = (s32)((s16)fetch_data_word(srcoffset));
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = srcval;
-       break;
-    case 3:                     /* register to register */
-       destreg = DECODE_RM_LONG_REGISTER(rh);
-       DECODE_PRINTF(",");
-       srcreg = DECODE_RM_WORD_REGISTER(rl);
-       DECODE_PRINTF("\n");
-       TRACE_AND_STEP();
-       *destreg = (s32)((s16)*srcreg);
-       break;
-    }
-    DECODE_CLEAR_SEGOVR();
-    END_OF_INSTR();
-}
-
-/***************************************************************************
- * Double byte operation code table:
- **************************************************************************/
-void (*x86emu_optab2[256])(u8) =
-{
-/*  0x00 */ x86emuOp2_illegal_op,  /* Group F (ring 0 PM)      */
-/*  0x01 */ x86emuOp2_illegal_op,  /* Group G (ring 0 PM)      */
-/*  0x02 */ x86emuOp2_illegal_op,  /* lar (ring 0 PM)          */
-/*  0x03 */ x86emuOp2_illegal_op,  /* lsl (ring 0 PM)          */
-/*  0x04 */ x86emuOp2_illegal_op,
-/*  0x05 */ x86emuOp2_illegal_op,  /* loadall (undocumented)   */
-/*  0x06 */ x86emuOp2_illegal_op,  /* clts (ring 0 PM)         */
-/*  0x07 */ x86emuOp2_illegal_op,  /* loadall (undocumented)   */
-/*  0x08 */ x86emuOp2_illegal_op,  /* invd (ring 0 PM)         */
-/*  0x09 */ x86emuOp2_illegal_op,  /* wbinvd (ring 0 PM)       */
-/*  0x0a */ x86emuOp2_illegal_op,
-/*  0x0b */ x86emuOp2_illegal_op,
-/*  0x0c */ x86emuOp2_illegal_op,
-/*  0x0d */ x86emuOp2_illegal_op,
-/*  0x0e */ x86emuOp2_illegal_op,
-/*  0x0f */ x86emuOp2_illegal_op,
-
-/*  0x10 */ x86emuOp2_illegal_op,
-/*  0x11 */ x86emuOp2_illegal_op,
-/*  0x12 */ x86emuOp2_illegal_op,
-/*  0x13 */ x86emuOp2_illegal_op,
-/*  0x14 */ x86emuOp2_illegal_op,
-/*  0x15 */ x86emuOp2_illegal_op,
-/*  0x16 */ x86emuOp2_illegal_op,
-/*  0x17 */ x86emuOp2_illegal_op,
-/*  0x18 */ x86emuOp2_illegal_op,
-/*  0x19 */ x86emuOp2_illegal_op,
-/*  0x1a */ x86emuOp2_illegal_op,
-/*  0x1b */ x86emuOp2_illegal_op,
-/*  0x1c */ x86emuOp2_illegal_op,
-/*  0x1d */ x86emuOp2_illegal_op,
-/*  0x1e */ x86emuOp2_illegal_op,
-/*  0x1f */ x86emuOp2_illegal_op,
-
-/*  0x20 */ x86emuOp2_illegal_op,  /* mov reg32,creg (ring 0 PM) */
-/*  0x21 */ x86emuOp2_illegal_op,  /* mov reg32,dreg (ring 0 PM) */
-/*  0x22 */ x86emuOp2_illegal_op,  /* mov creg,reg32 (ring 0 PM) */
-/*  0x23 */ x86emuOp2_illegal_op,  /* mov dreg,reg32 (ring 0 PM) */
-/*  0x24 */ x86emuOp2_illegal_op,  /* mov reg32,treg (ring 0 PM) */
-/*  0x25 */ x86emuOp2_illegal_op,
-/*  0x26 */ x86emuOp2_illegal_op,  /* mov treg,reg32 (ring 0 PM) */
-/*  0x27 */ x86emuOp2_illegal_op,
-/*  0x28 */ x86emuOp2_illegal_op,
-/*  0x29 */ x86emuOp2_illegal_op,
-/*  0x2a */ x86emuOp2_illegal_op,
-/*  0x2b */ x86emuOp2_illegal_op,
-/*  0x2c */ x86emuOp2_illegal_op,
-/*  0x2d */ x86emuOp2_illegal_op,
-/*  0x2e */ x86emuOp2_illegal_op,
-/*  0x2f */ x86emuOp2_illegal_op,
-
-/*  0x30 */ x86emuOp2_illegal_op,
-/*  0x31 */ x86emuOp2_illegal_op,
-/*  0x32 */ x86emuOp2_illegal_op,
-/*  0x33 */ x86emuOp2_illegal_op,
-/*  0x34 */ x86emuOp2_illegal_op,
-/*  0x35 */ x86emuOp2_illegal_op,
-/*  0x36 */ x86emuOp2_illegal_op,
-/*  0x37 */ x86emuOp2_illegal_op,
-/*  0x38 */ x86emuOp2_illegal_op,
-/*  0x39 */ x86emuOp2_illegal_op,
-/*  0x3a */ x86emuOp2_illegal_op,
-/*  0x3b */ x86emuOp2_illegal_op,
-/*  0x3c */ x86emuOp2_illegal_op,
-/*  0x3d */ x86emuOp2_illegal_op,
-/*  0x3e */ x86emuOp2_illegal_op,
-/*  0x3f */ x86emuOp2_illegal_op,
-
-/*  0x40 */ x86emuOp2_illegal_op,
-/*  0x41 */ x86emuOp2_illegal_op,
-/*  0x42 */ x86emuOp2_illegal_op,
-/*  0x43 */ x86emuOp2_illegal_op,
-/*  0x44 */ x86emuOp2_illegal_op,
-/*  0x45 */ x86emuOp2_illegal_op,
-/*  0x46 */ x86emuOp2_illegal_op,
-/*  0x47 */ x86emuOp2_illegal_op,
-/*  0x48 */ x86emuOp2_illegal_op,
-/*  0x49 */ x86emuOp2_illegal_op,
-/*  0x4a */ x86emuOp2_illegal_op,
-/*  0x4b */ x86emuOp2_illegal_op,
-/*  0x4c */ x86emuOp2_illegal_op,
-/*  0x4d */ x86emuOp2_illegal_op,
-/*  0x4e */ x86emuOp2_illegal_op,
-/*  0x4f */ x86emuOp2_illegal_op,
-
-/*  0x50 */ x86emuOp2_illegal_op,
-/*  0x51 */ x86emuOp2_illegal_op,
-/*  0x52 */ x86emuOp2_illegal_op,
-/*  0x53 */ x86emuOp2_illegal_op,
-/*  0x54 */ x86emuOp2_illegal_op,
-/*  0x55 */ x86emuOp2_illegal_op,
-/*  0x56 */ x86emuOp2_illegal_op,
-/*  0x57 */ x86emuOp2_illegal_op,
-/*  0x58 */ x86emuOp2_illegal_op,
-/*  0x59 */ x86emuOp2_illegal_op,
-/*  0x5a */ x86emuOp2_illegal_op,
-/*  0x5b */ x86emuOp2_illegal_op,
-/*  0x5c */ x86emuOp2_illegal_op,
-/*  0x5d */ x86emuOp2_illegal_op,
-/*  0x5e */ x86emuOp2_illegal_op,
-/*  0x5f */ x86emuOp2_illegal_op,
-
-/*  0x60 */ x86emuOp2_illegal_op,
-/*  0x61 */ x86emuOp2_illegal_op,
-/*  0x62 */ x86emuOp2_illegal_op,
-/*  0x63 */ x86emuOp2_illegal_op,
-/*  0x64 */ x86emuOp2_illegal_op,
-/*  0x65 */ x86emuOp2_illegal_op,
-/*  0x66 */ x86emuOp2_illegal_op,
-/*  0x67 */ x86emuOp2_illegal_op,
-/*  0x68 */ x86emuOp2_illegal_op,
-/*  0x69 */ x86emuOp2_illegal_op,
-/*  0x6a */ x86emuOp2_illegal_op,
-/*  0x6b */ x86emuOp2_illegal_op,
-/*  0x6c */ x86emuOp2_illegal_op,
-/*  0x6d */ x86emuOp2_illegal_op,
-/*  0x6e */ x86emuOp2_illegal_op,
-/*  0x6f */ x86emuOp2_illegal_op,
-
-/*  0x70 */ x86emuOp2_illegal_op,
-/*  0x71 */ x86emuOp2_illegal_op,
-/*  0x72 */ x86emuOp2_illegal_op,
-/*  0x73 */ x86emuOp2_illegal_op,
-/*  0x74 */ x86emuOp2_illegal_op,
-/*  0x75 */ x86emuOp2_illegal_op,
-/*  0x76 */ x86emuOp2_illegal_op,
-/*  0x77 */ x86emuOp2_illegal_op,
-/*  0x78 */ x86emuOp2_illegal_op,
-/*  0x79 */ x86emuOp2_illegal_op,
-/*  0x7a */ x86emuOp2_illegal_op,
-/*  0x7b */ x86emuOp2_illegal_op,
-/*  0x7c */ x86emuOp2_illegal_op,
-/*  0x7d */ x86emuOp2_illegal_op,
-/*  0x7e */ x86emuOp2_illegal_op,
-/*  0x7f */ x86emuOp2_illegal_op,
-
-/*  0x80 */ x86emuOp2_long_jump,
-/*  0x81 */ x86emuOp2_long_jump,
-/*  0x82 */ x86emuOp2_long_jump,
-/*  0x83 */ x86emuOp2_long_jump,
-/*  0x84 */ x86emuOp2_long_jump,
-/*  0x85 */ x86emuOp2_long_jump,
-/*  0x86 */ x86emuOp2_long_jump,
-/*  0x87 */ x86emuOp2_long_jump,
-/*  0x88 */ x86emuOp2_long_jump,
-/*  0x89 */ x86emuOp2_long_jump,
-/*  0x8a */ x86emuOp2_long_jump,
-/*  0x8b */ x86emuOp2_long_jump,
-/*  0x8c */ x86emuOp2_long_jump,
-/*  0x8d */ x86emuOp2_long_jump,
-/*  0x8e */ x86emuOp2_long_jump,
-/*  0x8f */ x86emuOp2_long_jump,
-
-/*  0x90 */ x86emuOp2_set_byte,
-/*  0x91 */ x86emuOp2_set_byte,
-/*  0x92 */ x86emuOp2_set_byte,
-/*  0x93 */ x86emuOp2_set_byte,
-/*  0x94 */ x86emuOp2_set_byte,
-/*  0x95 */ x86emuOp2_set_byte,
-/*  0x96 */ x86emuOp2_set_byte,
-/*  0x97 */ x86emuOp2_set_byte,
-/*  0x98 */ x86emuOp2_set_byte,
-/*  0x99 */ x86emuOp2_set_byte,
-/*  0x9a */ x86emuOp2_set_byte,
-/*  0x9b */ x86emuOp2_set_byte,
-/*  0x9c */ x86emuOp2_set_byte,
-/*  0x9d */ x86emuOp2_set_byte,
-/*  0x9e */ x86emuOp2_set_byte,
-/*  0x9f */ x86emuOp2_set_byte,
-
-/*  0xa0 */ x86emuOp2_push_FS,
-/*  0xa1 */ x86emuOp2_pop_FS,
-/*  0xa2 */ x86emuOp2_illegal_op,
-/*  0xa3 */ x86emuOp2_bt_R,
-/*  0xa4 */ x86emuOp2_shld_IMM,
-/*  0xa5 */ x86emuOp2_shld_CL,
-/*  0xa6 */ x86emuOp2_illegal_op,
-/*  0xa7 */ x86emuOp2_illegal_op,
-/*  0xa8 */ x86emuOp2_push_GS,
-/*  0xa9 */ x86emuOp2_pop_GS,
-/*  0xaa */ x86emuOp2_illegal_op,
-/*  0xab */ x86emuOp2_bt_R,
-/*  0xac */ x86emuOp2_shrd_IMM,
-/*  0xad */ x86emuOp2_shrd_CL,
-/*  0xae */ x86emuOp2_illegal_op,
-/*  0xaf */ x86emuOp2_imul_R_RM,
-
-/*  0xb0 */ x86emuOp2_illegal_op,  /* TODO: cmpxchg */
-/*  0xb1 */ x86emuOp2_illegal_op,  /* TODO: cmpxchg */
-/*  0xb2 */ x86emuOp2_lss_R_IMM,
-/*  0xb3 */ x86emuOp2_btr_R,
-/*  0xb4 */ x86emuOp2_lfs_R_IMM,
-/*  0xb5 */ x86emuOp2_lgs_R_IMM,
-/*  0xb6 */ x86emuOp2_movzx_byte_R_RM,
-/*  0xb7 */ x86emuOp2_movzx_word_R_RM,
-/*  0xb8 */ x86emuOp2_illegal_op,
-/*  0xb9 */ x86emuOp2_illegal_op,
-/*  0xba */ x86emuOp2_btX_I,
-/*  0xbb */ x86emuOp2_btc_R,
-/*  0xbc */ x86emuOp2_bsf,
-/*  0xbd */ x86emuOp2_bsr,
-/*  0xbe */ x86emuOp2_movsx_byte_R_RM,
-/*  0xbf */ x86emuOp2_movsx_word_R_RM,
-
-/*  0xc0 */ x86emuOp2_illegal_op,  /* TODO: xadd */
-/*  0xc1 */ x86emuOp2_illegal_op,  /* TODO: xadd */
-/*  0xc2 */ x86emuOp2_illegal_op,
-/*  0xc3 */ x86emuOp2_illegal_op,
-/*  0xc4 */ x86emuOp2_illegal_op,
-/*  0xc5 */ x86emuOp2_illegal_op,
-/*  0xc6 */ x86emuOp2_illegal_op,
-/*  0xc7 */ x86emuOp2_illegal_op,
-/*  0xc8 */ x86emuOp2_illegal_op,  /* TODO: bswap */
-/*  0xc9 */ x86emuOp2_illegal_op,  /* TODO: bswap */
-/*  0xca */ x86emuOp2_illegal_op,  /* TODO: bswap */
-/*  0xcb */ x86emuOp2_illegal_op,  /* TODO: bswap */
-/*  0xcc */ x86emuOp2_illegal_op,  /* TODO: bswap */
-/*  0xcd */ x86emuOp2_illegal_op,  /* TODO: bswap */
-/*  0xce */ x86emuOp2_illegal_op,  /* TODO: bswap */
-/*  0xcf */ x86emuOp2_illegal_op,  /* TODO: bswap */
-
-/*  0xd0 */ x86emuOp2_illegal_op,
-/*  0xd1 */ x86emuOp2_illegal_op,
-/*  0xd2 */ x86emuOp2_illegal_op,
-/*  0xd3 */ x86emuOp2_illegal_op,
-/*  0xd4 */ x86emuOp2_illegal_op,
-/*  0xd5 */ x86emuOp2_illegal_op,
-/*  0xd6 */ x86emuOp2_illegal_op,
-/*  0xd7 */ x86emuOp2_illegal_op,
-/*  0xd8 */ x86emuOp2_illegal_op,
-/*  0xd9 */ x86emuOp2_illegal_op,
-/*  0xda */ x86emuOp2_illegal_op,
-/*  0xdb */ x86emuOp2_illegal_op,
-/*  0xdc */ x86emuOp2_illegal_op,
-/*  0xdd */ x86emuOp2_illegal_op,
-/*  0xde */ x86emuOp2_illegal_op,
-/*  0xdf */ x86emuOp2_illegal_op,
-
-/*  0xe0 */ x86emuOp2_illegal_op,
-/*  0xe1 */ x86emuOp2_illegal_op,
-/*  0xe2 */ x86emuOp2_illegal_op,
-/*  0xe3 */ x86emuOp2_illegal_op,
-/*  0xe4 */ x86emuOp2_illegal_op,
-/*  0xe5 */ x86emuOp2_illegal_op,
-/*  0xe6 */ x86emuOp2_illegal_op,
-/*  0xe7 */ x86emuOp2_illegal_op,
-/*  0xe8 */ x86emuOp2_illegal_op,
-/*  0xe9 */ x86emuOp2_illegal_op,
-/*  0xea */ x86emuOp2_illegal_op,
-/*  0xeb */ x86emuOp2_illegal_op,
-/*  0xec */ x86emuOp2_illegal_op,
-/*  0xed */ x86emuOp2_illegal_op,
-/*  0xee */ x86emuOp2_illegal_op,
-/*  0xef */ x86emuOp2_illegal_op,
-
-/*  0xf0 */ x86emuOp2_illegal_op,
-/*  0xf1 */ x86emuOp2_illegal_op,
-/*  0xf2 */ x86emuOp2_illegal_op,
-/*  0xf3 */ x86emuOp2_illegal_op,
-/*  0xf4 */ x86emuOp2_illegal_op,
-/*  0xf5 */ x86emuOp2_illegal_op,
-/*  0xf6 */ x86emuOp2_illegal_op,
-/*  0xf7 */ x86emuOp2_illegal_op,
-/*  0xf8 */ x86emuOp2_illegal_op,
-/*  0xf9 */ x86emuOp2_illegal_op,
-/*  0xfa */ x86emuOp2_illegal_op,
-/*  0xfb */ x86emuOp2_illegal_op,
-/*  0xfc */ x86emuOp2_illegal_op,
-/*  0xfd */ x86emuOp2_illegal_op,
-/*  0xfe */ x86emuOp2_illegal_op,
-/*  0xff */ x86emuOp2_illegal_op,
-};
diff --git a/board/MAI/bios_emulator/scitech/src/x86emu/prim_ops.c b/board/MAI/bios_emulator/scitech/src/x86emu/prim_ops.c
deleted file mode 100644 (file)
index 72b1bf2..0000000
+++ /dev/null
@@ -1,2914 +0,0 @@
-/****************************************************************************
-*
-*                                              Realmode X86 Emulator Library
-*
-*              Copyright (C) 1996-1999 SciTech Software, Inc.
-*                                   Copyright (C) David Mosberger-Tang
-*                                         Copyright (C) 1999 Egbert Eich
-*
-*  ========================================================================
-*
-*  Permission to use, copy, modify, distribute, and sell this software and
-*  its documentation for any purpose is hereby granted without fee,
-*  provided that the above copyright notice appear in all copies and that
-*  both that copyright notice and this permission notice appear in
-*  supporting documentation, and that the name of the authors not be used
-*  in advertising or publicity pertaining to distribution of the software
-*  without specific, written prior permission.  The authors makes no
-*  representations about the suitability of this software for any purpose.
-*  It is provided "as is" without express or implied warranty.
-*
-*  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-*  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-*  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-*  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-*  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-*  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-*  PERFORMANCE OF THIS SOFTWARE.
-*
-*  ========================================================================
-*
-* Language:            ANSI C
-* Environment: Any
-* Developer:    Kendall Bennett
-*
-* Description:  This file contains the code to implement the primitive
-*                              machine operations used by the emulation code in ops.c
-*
-* Carry Chain Calculation
-*
-* This represents a somewhat expensive calculation which is
-* apparently required to emulate the setting of the OF and AF flag.
-* The latter is not so important, but the former is.  The overflow
-* flag is the XOR of the top two bits of the carry chain for an
-* addition (similar for subtraction).  Since we do not want to
-* simulate the addition in a bitwise manner, we try to calculate the
-* carry chain given the two operands and the result.
-*
-* So, given the following table, which represents the addition of two
-* bits, we can derive a formula for the carry chain.
-*
-* a   b   cin   r     cout
-* 0   0   0     0     0
-* 0   0   1     1     0
-* 0   1   0     1     0
-* 0   1   1     0     1
-* 1   0   0     1     0
-* 1   0   1     0     1
-* 1   1   0     0     1
-* 1   1   1     1     1
-*
-* Construction of table for cout:
-*
-* ab
-* r  \  00   01   11  10
-* |------------------
-* 0  |   0    1    1   1
-* 1  |   0    0    1   0
-*
-* By inspection, one gets:  cc = ab +  r'(a + b)
-*
-* That represents alot of operations, but NO CHOICE....
-*
-* Borrow Chain Calculation.
-*
-* The following table represents the subtraction of two bits, from
-* which we can derive a formula for the borrow chain.
-*
-* a   b   bin   r     bout
-* 0   0   0     0     0
-* 0   0   1     1     1
-* 0   1   0     1     1
-* 0   1   1     0     1
-* 1   0   0     1     0
-* 1   0   1     0     0
-* 1   1   0     0     0
-* 1   1   1     1     1
-*
-* Construction of table for cout:
-*
-* ab
-* r  \  00   01   11  10
-* |------------------
-* 0  |   0    1    0   0
-* 1  |   1    1    1   0
-*
-* By inspection, one gets:  bc = a'b +  r(a' + b)
-*
-****************************************************************************/
-
-#define        PRIM_OPS_NO_REDEFINE_ASM
-#include "x86emu/x86emui.h"
-
-/*------------------------- Global Variables ------------------------------*/
-
-#ifndef        __HAVE_INLINE_ASSEMBLER__
-
-static u32 x86emu_parity_tab[8] =
-{
-       0x96696996,
-       0x69969669,
-       0x69969669,
-       0x96696996,
-       0x69969669,
-       0x96696996,
-       0x96696996,
-       0x69969669,
-};
-
-#endif
-
-#define PARITY(x)   (((x86emu_parity_tab[(x) / 32] >> ((x) % 32)) & 1) == 0)
-#define XOR2(x)        (((x) ^ ((x)>>1)) & 0x1)
-
-/*----------------------------- Implementation ----------------------------*/
-
-#ifndef        __HAVE_INLINE_ASSEMBLER__
-
-/****************************************************************************
-REMARKS:
-Implements the AAA instruction and side effects.
-****************************************************************************/
-u16 aaa_word(u16 d)
-{
-       u16     res;
-       if ((d & 0xf) > 0x9 || ACCESS_FLAG(F_AF)) {
-               d += 0x6;
-               d += 0x100;
-               SET_FLAG(F_AF);
-               SET_FLAG(F_CF);
-       } else {
-               CLEAR_FLAG(F_CF);
-               CLEAR_FLAG(F_AF);
-       }
-       res = (u16)(d & 0xFF0F);
-       CLEAR_FLAG(F_SF);
-       CONDITIONAL_SET_FLAG(res == 0, F_ZF);
-       CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-       return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the AAA instruction and side effects.
-****************************************************************************/
-u16 aas_word(u16 d)
-{
-       u16     res;
-       if ((d & 0xf) > 0x9 || ACCESS_FLAG(F_AF)) {
-               d -= 0x6;
-               d -= 0x100;
-               SET_FLAG(F_AF);
-               SET_FLAG(F_CF);
-       } else {
-               CLEAR_FLAG(F_CF);
-               CLEAR_FLAG(F_AF);
-       }
-       res = (u16)(d & 0xFF0F);
-       CLEAR_FLAG(F_SF);
-       CONDITIONAL_SET_FLAG(res == 0, F_ZF);
-       CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-       return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the AAD instruction and side effects.
-****************************************************************************/
-u16 aad_word(u16 d)
-{
-       u16 l;
-       u8 hb, lb;
-
-       hb = (u8)((d >> 8) & 0xff);
-       lb = (u8)((d & 0xff));
-       l = (u16)((lb + 10 * hb) & 0xFF);
-
-       CLEAR_FLAG(F_CF);
-       CLEAR_FLAG(F_AF);
-       CLEAR_FLAG(F_OF);
-       CONDITIONAL_SET_FLAG(l & 0x80, F_SF);
-       CONDITIONAL_SET_FLAG(l == 0, F_ZF);
-       CONDITIONAL_SET_FLAG(PARITY(l & 0xff), F_PF);
-       return l;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the AAM instruction and side effects.
-****************************************************************************/
-u16 aam_word(u8 d)
-{
-    u16 h, l;
-
-       h = (u16)(d / 10);
-       l = (u16)(d % 10);
-       l |= (u16)(h << 8);
-
-       CLEAR_FLAG(F_CF);
-       CLEAR_FLAG(F_AF);
-       CLEAR_FLAG(F_OF);
-       CONDITIONAL_SET_FLAG(l & 0x80, F_SF);
-       CONDITIONAL_SET_FLAG(l == 0, F_ZF);
-       CONDITIONAL_SET_FLAG(PARITY(l & 0xff), F_PF);
-    return l;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the ADC instruction and side effects.
-****************************************************************************/
-u8 adc_byte(u8 d, u8 s)
-{
-       register u32 res;   /* all operands in native machine order */
-       register u32 cc;
-
-       if (ACCESS_FLAG(F_CF))
-               res = 1 + d + s;
-       else
-               res = d + s;
-
-       CONDITIONAL_SET_FLAG(res & 0x100, F_CF);
-       CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
-       CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
-       CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-
-       /* calculate the carry chain  SEE NOTE AT TOP. */
-       cc = (s & d) | ((~res) & (s | d));
-       CONDITIONAL_SET_FLAG(XOR2(cc >> 6), F_OF);
-       CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
-       return (u8)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the ADC instruction and side effects.
-****************************************************************************/
-u16 adc_word(u16 d, u16 s)
-{
-       register u32 res;   /* all operands in native machine order */
-       register u32 cc;
-
-       if (ACCESS_FLAG(F_CF))
-               res = 1 + d + s;
-       else
-               res = d + s;
-
-       CONDITIONAL_SET_FLAG(res & 0x10000, F_CF);
-       CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
-       CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
-       CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-
-       /* calculate the carry chain  SEE NOTE AT TOP. */
-       cc = (s & d) | ((~res) & (s | d));
-       CONDITIONAL_SET_FLAG(XOR2(cc >> 14), F_OF);
-       CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
-       return (u16)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the ADC instruction and side effects.
-****************************************************************************/
-u32 adc_long(u32 d, u32 s)
-{
-       register u32 lo;        /* all operands in native machine order */
-       register u32 hi;
-       register u32 res;
-       register u32 cc;
-
-       if (ACCESS_FLAG(F_CF)) {
-               lo = 1 + (d & 0xFFFF) + (s & 0xFFFF);
-               res = 1 + d + s;
-               }
-       else {
-               lo = (d & 0xFFFF) + (s & 0xFFFF);
-               res = d + s;
-               }
-       hi = (lo >> 16) + (d >> 16) + (s >> 16);
-
-       CONDITIONAL_SET_FLAG(hi & 0x10000, F_CF);
-       CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
-       CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
-       CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-
-       /* calculate the carry chain  SEE NOTE AT TOP. */
-       cc = (s & d) | ((~res) & (s | d));
-       CONDITIONAL_SET_FLAG(XOR2(cc >> 30), F_OF);
-       CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
-       return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the ADD instruction and side effects.
-****************************************************************************/
-u8 add_byte(u8 d, u8 s)
-{
-       register u32 res;   /* all operands in native machine order */
-       register u32 cc;
-
-       res = d + s;
-       CONDITIONAL_SET_FLAG(res & 0x100, F_CF);
-       CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
-       CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
-       CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-
-       /* calculate the carry chain  SEE NOTE AT TOP. */
-       cc = (s & d) | ((~res) & (s | d));
-       CONDITIONAL_SET_FLAG(XOR2(cc >> 6), F_OF);
-       CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
-       return (u8)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the ADD instruction and side effects.
-****************************************************************************/
-u16 add_word(u16 d, u16 s)
-{
-       register u32 res;   /* all operands in native machine order */
-       register u32 cc;
-
-       res = d + s;
-       CONDITIONAL_SET_FLAG(res & 0x10000, F_CF);
-       CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
-       CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
-       CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-
-       /* calculate the carry chain  SEE NOTE AT TOP. */
-       cc = (s & d) | ((~res) & (s | d));
-       CONDITIONAL_SET_FLAG(XOR2(cc >> 14), F_OF);
-       CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
-       return (u16)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the ADD instruction and side effects.
-****************************************************************************/
-u32 add_long(u32 d, u32 s)
-{
-       register u32 lo;        /* all operands in native machine order */
-       register u32 hi;
-       register u32 res;
-       register u32 cc;
-
-       lo = (d & 0xFFFF) + (s & 0xFFFF);
-       res = d + s;
-       hi = (lo >> 16) + (d >> 16) + (s >> 16);
-
-       CONDITIONAL_SET_FLAG(hi & 0x10000, F_CF);
-       CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
-       CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
-       CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-
-    /* calculate the carry chain  SEE NOTE AT TOP. */
-    cc = (s & d) | ((~res) & (s | d));
-       CONDITIONAL_SET_FLAG(XOR2(cc >> 30), F_OF);
-       CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
-
-    return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the AND instruction and side effects.
-****************************************************************************/
-u8 and_byte(u8 d, u8 s)
-{
-       register u8 res;    /* all operands in native machine order */
-
-       res = d & s;
-
-       /* set the flags  */
-       CLEAR_FLAG(F_OF);
-       CLEAR_FLAG(F_CF);
-       CLEAR_FLAG(F_AF);
-       CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
-       CONDITIONAL_SET_FLAG(res == 0, F_ZF);
-       CONDITIONAL_SET_FLAG(PARITY(res), F_PF);
-       return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the AND instruction and side effects.
-****************************************************************************/
-u16 and_word(u16 d, u16 s)
-{
-    register u16 res;   /* all operands in native machine order */
-
-    res = d & s;
-
-    /* set the flags  */
-       CLEAR_FLAG(F_OF);
-       CLEAR_FLAG(F_CF);
-       CLEAR_FLAG(F_AF);
-       CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
-       CONDITIONAL_SET_FLAG(res == 0, F_ZF);
-       CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-    return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the AND instruction and side effects.
-****************************************************************************/
-u32 and_long(u32 d, u32 s)
-{
-       register u32 res;   /* all operands in native machine order */
-
-       res = d & s;
-
-       /* set the flags  */
-       CLEAR_FLAG(F_OF);
-       CLEAR_FLAG(F_CF);
-       CLEAR_FLAG(F_AF);
-       CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
-       CONDITIONAL_SET_FLAG(res == 0, F_ZF);
-       CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-       return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the CMP instruction and side effects.
-****************************************************************************/
-u8 cmp_byte(u8 d, u8 s)
-{
-       register u32 res;   /* all operands in native machine order */
-       register u32 bc;
-
-       res = d - s;
-       CLEAR_FLAG(F_CF);
-       CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
-       CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
-       CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-
-       /* calculate the borrow chain.  See note at top */
-       bc = (res & (~d | s)) | (~d & s);
-       CONDITIONAL_SET_FLAG(bc & 0x80, F_CF);
-       CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF);
-       CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
-       return d;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the CMP instruction and side effects.
-****************************************************************************/
-u16 cmp_word(u16 d, u16 s)
-{
-       register u32 res;   /* all operands in native machine order */
-       register u32 bc;
-
-       res = d - s;
-       CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
-       CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
-       CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-
-       /* calculate the borrow chain.  See note at top */
-    bc = (res & (~d | s)) | (~d & s);
-       CONDITIONAL_SET_FLAG(bc & 0x8000, F_CF);
-       CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF);
-       CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
-       return d;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the CMP instruction and side effects.
-****************************************************************************/
-u32 cmp_long(u32 d, u32 s)
-{
-       register u32 res;   /* all operands in native machine order */
-       register u32 bc;
-
-       res = d - s;
-       CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
-       CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
-       CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-
-       /* calculate the borrow chain.  See note at top */
-       bc = (res & (~d | s)) | (~d & s);
-       CONDITIONAL_SET_FLAG(bc & 0x80000000, F_CF);
-       CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF);
-       CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
-       return d;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the DAA instruction and side effects.
-****************************************************************************/
-u8 daa_byte(u8 d)
-{
-       u32 res = d;
-       if ((d & 0xf) > 9 || ACCESS_FLAG(F_AF)) {
-               res += 6;
-               SET_FLAG(F_AF);
-       }
-       if (res > 0x9F || ACCESS_FLAG(F_CF)) {
-               res += 0x60;
-               SET_FLAG(F_CF);
-       }
-       CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
-       CONDITIONAL_SET_FLAG((res & 0xFF) == 0, F_ZF);
-       CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-       return (u8)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the DAS instruction and side effects.
-****************************************************************************/
-u8 das_byte(u8 d)
-{
-       if ((d & 0xf) > 9 || ACCESS_FLAG(F_AF)) {
-               d -= 6;
-               SET_FLAG(F_AF);
-       }
-       if (d > 0x9F || ACCESS_FLAG(F_CF)) {
-               d -= 0x60;
-               SET_FLAG(F_CF);
-       }
-       CONDITIONAL_SET_FLAG(d & 0x80, F_SF);
-       CONDITIONAL_SET_FLAG(d == 0, F_ZF);
-       CONDITIONAL_SET_FLAG(PARITY(d & 0xff), F_PF);
-       return d;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the DEC instruction and side effects.
-****************************************************************************/
-u8 dec_byte(u8 d)
-{
-    register u32 res;   /* all operands in native machine order */
-    register u32 bc;
-
-    res = d - 1;
-       CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
-       CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
-       CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-
-       /* calculate the borrow chain.  See note at top */
-       /* based on sub_byte, uses s==1.  */
-       bc = (res & (~d | 1)) | (~d & 1);
-       /* carry flag unchanged */
-       CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF);
-       CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
-       return (u8)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the DEC instruction and side effects.
-****************************************************************************/
-u16 dec_word(u16 d)
-{
-    register u32 res;   /* all operands in native machine order */
-    register u32 bc;
-
-    res = d - 1;
-       CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
-       CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
-       CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-
-    /* calculate the borrow chain.  See note at top */
-    /* based on the sub_byte routine, with s==1 */
-    bc = (res & (~d | 1)) | (~d & 1);
-    /* carry flag unchanged */
-       CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF);
-       CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
-       return (u16)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the DEC instruction and side effects.
-****************************************************************************/
-u32 dec_long(u32 d)
-{
-    register u32 res;   /* all operands in native machine order */
-    register u32 bc;
-
-    res = d - 1;
-
-       CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
-       CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
-       CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-
-    /* calculate the borrow chain.  See note at top */
-       bc = (res & (~d | 1)) | (~d & 1);
-       /* carry flag unchanged */
-       CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF);
-       CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
-       return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the INC instruction and side effects.
-****************************************************************************/
-u8 inc_byte(u8 d)
-{
-       register u32 res;   /* all operands in native machine order */
-       register u32 cc;
-
-       res = d + 1;
-       CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
-       CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
-       CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-
-       /* calculate the carry chain  SEE NOTE AT TOP. */
-       cc = ((1 & d) | (~res)) & (1 | d);
-       CONDITIONAL_SET_FLAG(XOR2(cc >> 6), F_OF);
-       CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
-       return (u8)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the INC instruction and side effects.
-****************************************************************************/
-u16 inc_word(u16 d)
-{
-       register u32 res;   /* all operands in native machine order */
-       register u32 cc;
-
-       res = d + 1;
-       CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
-       CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
-       CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-
-       /* calculate the carry chain  SEE NOTE AT TOP. */
-       cc = (1 & d) | ((~res) & (1 | d));
-       CONDITIONAL_SET_FLAG(XOR2(cc >> 14), F_OF);
-       CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
-       return (u16)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the INC instruction and side effects.
-****************************************************************************/
-u32 inc_long(u32 d)
-{
-       register u32 res;   /* all operands in native machine order */
-       register u32 cc;
-
-       res = d + 1;
-       CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
-       CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
-       CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-
-       /* calculate the carry chain  SEE NOTE AT TOP. */
-       cc = (1 & d) | ((~res) & (1 | d));
-       CONDITIONAL_SET_FLAG(XOR2(cc >> 30), F_OF);
-       CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
-       return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the OR instruction and side effects.
-****************************************************************************/
-u8 or_byte(u8 d, u8 s)
-{
-       register u8 res;    /* all operands in native machine order */
-
-       res = d | s;
-       CLEAR_FLAG(F_OF);
-       CLEAR_FLAG(F_CF);
-       CLEAR_FLAG(F_AF);
-       CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
-       CONDITIONAL_SET_FLAG(res == 0, F_ZF);
-       CONDITIONAL_SET_FLAG(PARITY(res), F_PF);
-       return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the OR instruction and side effects.
-****************************************************************************/
-u16 or_word(u16 d, u16 s)
-{
-       register u16 res;   /* all operands in native machine order */
-
-       res = d | s;
-       /* set the carry flag to be bit 8 */
-       CLEAR_FLAG(F_OF);
-       CLEAR_FLAG(F_CF);
-       CLEAR_FLAG(F_AF);
-       CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
-       CONDITIONAL_SET_FLAG(res == 0, F_ZF);
-       CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-       return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the OR instruction and side effects.
-****************************************************************************/
-u32 or_long(u32 d, u32 s)
-{
-       register u32 res;   /* all operands in native machine order */
-
-       res = d | s;
-
-       /* set the carry flag to be bit 8 */
-       CLEAR_FLAG(F_OF);
-       CLEAR_FLAG(F_CF);
-       CLEAR_FLAG(F_AF);
-       CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
-       CONDITIONAL_SET_FLAG(res == 0, F_ZF);
-       CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-       return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the OR instruction and side effects.
-****************************************************************************/
-u8 neg_byte(u8 s)
-{
-    register u8 res;
-    register u8 bc;
-
-       CONDITIONAL_SET_FLAG(s != 0, F_CF);
-       res = (u8)-s;
-       CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
-       CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
-       CONDITIONAL_SET_FLAG(PARITY(res), F_PF);
-       /* calculate the borrow chain --- modified such that d=0.
-          substitutiing d=0 into     bc= res&(~d|s)|(~d&s);
-          (the one used for sub) and simplifying, since ~d=0xff...,
-          ~d|s == 0xffff..., and res&0xfff... == res.  Similarly
-          ~d&s == s.  So the simplified result is: */
-       bc = res | s;
-       CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF);
-       CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
-       return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the OR instruction and side effects.
-****************************************************************************/
-u16 neg_word(u16 s)
-{
-       register u16 res;
-       register u16 bc;
-
-       CONDITIONAL_SET_FLAG(s != 0, F_CF);
-       res = (u16)-s;
-       CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
-       CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
-       CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-
-       /* calculate the borrow chain --- modified such that d=0.
-          substitutiing d=0 into     bc= res&(~d|s)|(~d&s);
-          (the one used for sub) and simplifying, since ~d=0xff...,
-          ~d|s == 0xffff..., and res&0xfff... == res.  Similarly
-          ~d&s == s.  So the simplified result is: */
-       bc = res | s;
-       CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF);
-       CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
-       return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the OR instruction and side effects.
-****************************************************************************/
-u32 neg_long(u32 s)
-{
-       register u32 res;
-       register u32 bc;
-
-       CONDITIONAL_SET_FLAG(s != 0, F_CF);
-       res = (u32)-s;
-       CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
-       CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
-       CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-
-       /* calculate the borrow chain --- modified such that d=0.
-          substitutiing d=0 into     bc= res&(~d|s)|(~d&s);
-          (the one used for sub) and simplifying, since ~d=0xff...,
-          ~d|s == 0xffff..., and res&0xfff... == res.  Similarly
-          ~d&s == s.  So the simplified result is: */
-       bc = res | s;
-       CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF);
-       CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
-       return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the NOT instruction and side effects.
-****************************************************************************/
-u8 not_byte(u8 s)
-{
-       return ~s;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the NOT instruction and side effects.
-****************************************************************************/
-u16 not_word(u16 s)
-{
-       return ~s;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the NOT instruction and side effects.
-****************************************************************************/
-u32 not_long(u32 s)
-{
-       return ~s;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the RCL instruction and side effects.
-****************************************************************************/
-u8 rcl_byte(u8 d, u8 s)
-{
-    register unsigned int res, cnt, mask, cf;
-
-    /* s is the rotate distance.  It varies from 0 - 8. */
-       /* have
-
-       CF  B_7 B_6 B_5 B_4 B_3 B_2 B_1 B_0
-
-       want to rotate through the carry by "s" bits.  We could
-       loop, but that's inefficient.  So the width is 9,
-       and we split into three parts:
-
-       The new carry flag   (was B_n)
-       the stuff in B_n-1 .. B_0
-       the stuff in B_7 .. B_n+1
-
-       The new rotate is done mod 9, and given this,
-       for a rotation of n bits (mod 9) the new carry flag is
-       then located n bits from the MSB.  The low part is
-       then shifted up cnt bits, and the high part is or'd
-       in.  Using CAPS for new values, and lowercase for the
-       original values, this can be expressed as:
-
-       IF n > 0
-       1) CF <-  b_(8-n)
-       2) B_(7) .. B_(n)  <-  b_(8-(n+1)) .. b_0
-       3) B_(n-1) <- cf
-       4) B_(n-2) .. B_0 <-  b_7 .. b_(8-(n-1))
-        */
-       res = d;
-       if ((cnt = s % 9) != 0) {
-       /* extract the new CARRY FLAG. */
-       /* CF <-  b_(8-n)             */
-       cf = (d >> (8 - cnt)) & 0x1;
-
-       /* get the low stuff which rotated
-          into the range B_7 .. B_cnt */
-       /* B_(7) .. B_(n)  <-  b_(8-(n+1)) .. b_0  */
-       /* note that the right hand side done by the mask */
-               res = (d << cnt) & 0xff;
-
-       /* now the high stuff which rotated around
-          into the positions B_cnt-2 .. B_0 */
-       /* B_(n-2) .. B_0 <-  b_7 .. b_(8-(n-1)) */
-       /* shift it downward, 7-(n-2) = 9-n positions.
-          and mask off the result before or'ing in.
-        */
-       mask = (1 << (cnt - 1)) - 1;
-       res |= (d >> (9 - cnt)) & mask;
-
-       /* if the carry flag was set, or it in.  */
-               if (ACCESS_FLAG(F_CF)) {     /* carry flag is set */
-           /*  B_(n-1) <- cf */
-           res |= 1 << (cnt - 1);
-       }
-       /* set the new carry flag, based on the variable "cf" */
-               CONDITIONAL_SET_FLAG(cf, F_CF);
-       /* OVERFLOW is set *IFF* cnt==1, then it is the
-          xor of CF and the most significant bit.  Blecck. */
-       /* parenthesized this expression since it appears to
-          be causing OF to be misset */
-       CONDITIONAL_SET_FLAG(cnt == 1 && XOR2(cf + ((res >> 6) & 0x2)),
-                                                        F_OF);
-
-    }
-       return (u8)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the RCL instruction and side effects.
-****************************************************************************/
-u16 rcl_word(u16 d, u8 s)
-{
-       register unsigned int res, cnt, mask, cf;
-
-       res = d;
-       if ((cnt = s % 17) != 0) {
-               cf = (d >> (16 - cnt)) & 0x1;
-               res = (d << cnt) & 0xffff;
-               mask = (1 << (cnt - 1)) - 1;
-               res |= (d >> (17 - cnt)) & mask;
-               if (ACCESS_FLAG(F_CF)) {
-                       res |= 1 << (cnt - 1);
-               }
-               CONDITIONAL_SET_FLAG(cf, F_CF);
-               CONDITIONAL_SET_FLAG(cnt == 1 && XOR2(cf + ((res >> 14) & 0x2)),
-                                                        F_OF);
-       }
-       return (u16)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the RCL instruction and side effects.
-****************************************************************************/
-u32 rcl_long(u32 d, u8 s)
-{
-       register u32 res, cnt, mask, cf;
-
-       res = d;
-       if ((cnt = s % 33) != 0) {
-               cf = (d >> (32 - cnt)) & 0x1;
-               res = (d << cnt) & 0xffffffff;
-               mask = (1 << (cnt - 1)) - 1;
-               res |= (d >> (33 - cnt)) & mask;
-               if (ACCESS_FLAG(F_CF)) {     /* carry flag is set */
-                       res |= 1 << (cnt - 1);
-               }
-               CONDITIONAL_SET_FLAG(cf, F_CF);
-               CONDITIONAL_SET_FLAG(cnt == 1 && XOR2(cf + ((res >> 30) & 0x2)),
-                                                        F_OF);
-       }
-       return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the RCR instruction and side effects.
-****************************************************************************/
-u8 rcr_byte(u8 d, u8 s)
-{
-       u32     res, cnt;
-       u32     mask, cf, ocf = 0;
-
-       /* rotate right through carry */
-    /*
-       s is the rotate distance.  It varies from 0 - 8.
-       d is the byte object rotated.
-
-       have
-
-       CF  B_7 B_6 B_5 B_4 B_3 B_2 B_1 B_0
-
-       The new rotate is done mod 9, and given this,
-       for a rotation of n bits (mod 9) the new carry flag is
-       then located n bits from the LSB.  The low part is
-       then shifted up cnt bits, and the high part is or'd
-       in.  Using CAPS for new values, and lowercase for the
-       original values, this can be expressed as:
-
-       IF n > 0
-       1) CF <-  b_(n-1)
-       2) B_(8-(n+1)) .. B_(0)  <-  b_(7) .. b_(n)
-       3) B_(8-n) <- cf
-       4) B_(7) .. B_(8-(n-1)) <-  b_(n-2) .. b_(0)
-        */
-       res = d;
-       if ((cnt = s % 9) != 0) {
-       /* extract the new CARRY FLAG. */
-       /* CF <-  b_(n-1)              */
-       if (cnt == 1) {
-           cf = d & 0x1;
-           /* note hackery here.  Access_flag(..) evaluates to either
-              0 if flag not set
-              non-zero if flag is set.
-              doing access_flag(..) != 0 casts that into either
-                          0..1 in any representation of the flags register
-              (i.e. packed bit array or unpacked.)
-            */
-                       ocf = ACCESS_FLAG(F_CF) != 0;
-       } else
-           cf = (d >> (cnt - 1)) & 0x1;
-
-       /* B_(8-(n+1)) .. B_(0)  <-  b_(7) .. b_n  */
-       /* note that the right hand side done by the mask
-          This is effectively done by shifting the
-          object to the right.  The result must be masked,
-          in case the object came in and was treated
-          as a negative number.  Needed??? */
-
-       mask = (1 << (8 - cnt)) - 1;
-       res = (d >> cnt) & mask;
-
-       /* now the high stuff which rotated around
-          into the positions B_cnt-2 .. B_0 */
-       /* B_(7) .. B_(8-(n-1)) <-  b_(n-2) .. b_(0) */
-       /* shift it downward, 7-(n-2) = 9-n positions.
-          and mask off the result before or'ing in.
-        */
-       res |= (d << (9 - cnt));
-
-       /* if the carry flag was set, or it in.  */
-               if (ACCESS_FLAG(F_CF)) {     /* carry flag is set */
-           /*  B_(8-n) <- cf */
-           res |= 1 << (8 - cnt);
-       }
-       /* set the new carry flag, based on the variable "cf" */
-               CONDITIONAL_SET_FLAG(cf, F_CF);
-       /* OVERFLOW is set *IFF* cnt==1, then it is the
-          xor of CF and the most significant bit.  Blecck. */
-       /* parenthesized... */
-               if (cnt == 1) {
-                       CONDITIONAL_SET_FLAG(XOR2(ocf + ((d >> 6) & 0x2)),
-                                                                F_OF);
-               }
-       }
-       return (u8)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the RCR instruction and side effects.
-****************************************************************************/
-u16 rcr_word(u16 d, u8 s)
-{
-       u32 res, cnt;
-       u32     mask, cf, ocf = 0;
-
-       /* rotate right through carry */
-       res = d;
-       if ((cnt = s % 17) != 0) {
-               if (cnt == 1) {
-                       cf = d & 0x1;
-                       ocf = ACCESS_FLAG(F_CF) != 0;
-               } else
-                       cf = (d >> (cnt - 1)) & 0x1;
-               mask = (1 << (16 - cnt)) - 1;
-               res = (d >> cnt) & mask;
-               res |= (d << (17 - cnt));
-               if (ACCESS_FLAG(F_CF)) {
-                       res |= 1 << (16 - cnt);
-               }
-               CONDITIONAL_SET_FLAG(cf, F_CF);
-               if (cnt == 1) {
-                       CONDITIONAL_SET_FLAG(XOR2(ocf + ((d >> 14) & 0x2)),
-                                                                F_OF);
-               }
-       }
-       return (u16)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the RCR instruction and side effects.
-****************************************************************************/
-u32 rcr_long(u32 d, u8 s)
-{
-       u32 res, cnt;
-       u32 mask, cf, ocf = 0;
-
-       /* rotate right through carry */
-       res = d;
-       if ((cnt = s % 33) != 0) {
-               if (cnt == 1) {
-                       cf = d & 0x1;
-                       ocf = ACCESS_FLAG(F_CF) != 0;
-               } else
-                       cf = (d >> (cnt - 1)) & 0x1;
-               mask = (1 << (32 - cnt)) - 1;
-               res = (d >> cnt) & mask;
-               if (cnt != 1)
-                       res |= (d << (33 - cnt));
-               if (ACCESS_FLAG(F_CF)) {     /* carry flag is set */
-                       res |= 1 << (32 - cnt);
-               }
-               CONDITIONAL_SET_FLAG(cf, F_CF);
-               if (cnt == 1) {
-                       CONDITIONAL_SET_FLAG(XOR2(ocf + ((d >> 30) & 0x2)),
-                                                                F_OF);
-               }
-       }
-       return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the ROL instruction and side effects.
-****************************************************************************/
-u8 rol_byte(u8 d, u8 s)
-{
-    register unsigned int res, cnt, mask;
-
-    /* rotate left */
-    /*
-       s is the rotate distance.  It varies from 0 - 8.
-       d is the byte object rotated.
-
-       have
-
-       CF  B_7 ... B_0
-
-       The new rotate is done mod 8.
-       Much simpler than the "rcl" or "rcr" operations.
-
-       IF n > 0
-       1) B_(7) .. B_(n)  <-  b_(8-(n+1)) .. b_(0)
-       2) B_(n-1) .. B_(0) <-  b_(7) .. b_(8-n)
-        */
-    res = d;
-       if ((cnt = s % 8) != 0) {
-               /* B_(7) .. B_(n)  <-  b_(8-(n+1)) .. b_(0) */
-               res = (d << cnt);
-
-               /* B_(n-1) .. B_(0) <-  b_(7) .. b_(8-n) */
-               mask = (1 << cnt) - 1;
-               res |= (d >> (8 - cnt)) & mask;
-
-               /* set the new carry flag, Note that it is the low order
-                  bit of the result!!!                               */
-               CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
-               /* OVERFLOW is set *IFF* s==1, then it is the
-                  xor of CF and the most significant bit.  Blecck. */
-               CONDITIONAL_SET_FLAG(s == 1 &&
-                                                        XOR2((res & 0x1) + ((res >> 6) & 0x2)),
-                                                        F_OF);
-       } if (s != 0) {
-               /* set the new carry flag, Note that it is the low order
-                  bit of the result!!!                               */
-               CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
-       }
-       return (u8)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the ROL instruction and side effects.
-****************************************************************************/
-u16 rol_word(u16 d, u8 s)
-{
-    register unsigned int res, cnt, mask;
-
-       res = d;
-       if ((cnt = s % 16) != 0) {
-               res = (d << cnt);
-               mask = (1 << cnt) - 1;
-               res |= (d >> (16 - cnt)) & mask;
-               CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
-               CONDITIONAL_SET_FLAG(s == 1 &&
-                                                        XOR2((res & 0x1) + ((res >> 14) & 0x2)),
-                                                        F_OF);
-       } if (s != 0) {
-               /* set the new carry flag, Note that it is the low order
-                  bit of the result!!!                               */
-               CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
-       }
-       return (u16)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the ROL instruction and side effects.
-****************************************************************************/
-u32 rol_long(u32 d, u8 s)
-{
-    register u32 res, cnt, mask;
-
-       res = d;
-       if ((cnt = s % 32) != 0) {
-               res = (d << cnt);
-               mask = (1 << cnt) - 1;
-               res |= (d >> (32 - cnt)) & mask;
-               CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
-               CONDITIONAL_SET_FLAG(s == 1 &&
-                                                        XOR2((res & 0x1) + ((res >> 30) & 0x2)),
-                                                        F_OF);
-       } if (s != 0) {
-               /* set the new carry flag, Note that it is the low order
-                  bit of the result!!!                               */
-               CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
-       }
-       return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the ROR instruction and side effects.
-****************************************************************************/
-u8 ror_byte(u8 d, u8 s)
-{
-    register unsigned int res, cnt, mask;
-
-    /* rotate right */
-    /*
-       s is the rotate distance.  It varies from 0 - 8.
-       d is the byte object rotated.
-
-       have
-
-       B_7 ... B_0
-
-       The rotate is done mod 8.
-
-       IF n > 0
-       1) B_(8-(n+1)) .. B_(0)  <-  b_(7) .. b_(n)
-       2) B_(7) .. B_(8-n) <-  b_(n-1) .. b_(0)
-        */
-       res = d;
-       if ((cnt = s % 8) != 0) {           /* not a typo, do nada if cnt==0 */
-       /* B_(7) .. B_(8-n) <-  b_(n-1) .. b_(0) */
-       res = (d << (8 - cnt));
-
-       /* B_(8-(n+1)) .. B_(0)  <-  b_(7) .. b_(n) */
-       mask = (1 << (8 - cnt)) - 1;
-       res |= (d >> (cnt)) & mask;
-
-       /* set the new carry flag, Note that it is the low order
-          bit of the result!!!                               */
-               CONDITIONAL_SET_FLAG(res & 0x80, F_CF);
-               /* OVERFLOW is set *IFF* s==1, then it is the
-          xor of the two most significant bits.  Blecck. */
-               CONDITIONAL_SET_FLAG(s == 1 && XOR2(res >> 6), F_OF);
-       } else if (s != 0) {
-               /* set the new carry flag, Note that it is the low order
-                  bit of the result!!!                               */
-               CONDITIONAL_SET_FLAG(res & 0x80, F_CF);
-       }
-       return (u8)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the ROR instruction and side effects.
-****************************************************************************/
-u16 ror_word(u16 d, u8 s)
-{
-    register unsigned int res, cnt, mask;
-
-       res = d;
-       if ((cnt = s % 16) != 0) {
-               res = (d << (16 - cnt));
-               mask = (1 << (16 - cnt)) - 1;
-               res |= (d >> (cnt)) & mask;
-               CONDITIONAL_SET_FLAG(res & 0x8000, F_CF);
-               CONDITIONAL_SET_FLAG(s == 1 && XOR2(res >> 14), F_OF);
-       } else if (s != 0) {
-               /* set the new carry flag, Note that it is the low order
-                  bit of the result!!!                               */
-               CONDITIONAL_SET_FLAG(res & 0x8000, F_CF);
-       }
-       return (u16)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the ROR instruction and side effects.
-****************************************************************************/
-u32 ror_long(u32 d, u8 s)
-{
-       register u32 res, cnt, mask;
-
-       res = d;
-       if ((cnt = s % 32) != 0) {
-               res = (d << (32 - cnt));
-               mask = (1 << (32 - cnt)) - 1;
-               res |= (d >> (cnt)) & mask;
-               CONDITIONAL_SET_FLAG(res & 0x80000000, F_CF);
-               CONDITIONAL_SET_FLAG(s == 1 && XOR2(res >> 30), F_OF);
-       } else if (s != 0) {
-               /* set the new carry flag, Note that it is the low order
-                  bit of the result!!!                               */
-               CONDITIONAL_SET_FLAG(res & 0x80000000, F_CF);
-       }
-       return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the SHL instruction and side effects.
-****************************************************************************/
-u8 shl_byte(u8 d, u8 s)
-{
-       unsigned int cnt, res, cf;
-
-       if (s < 8) {
-               cnt = s % 8;
-
-               /* last bit shifted out goes into carry flag */
-               if (cnt > 0) {
-                       res = d << cnt;
-                       cf = d & (1 << (8 - cnt));
-                       CONDITIONAL_SET_FLAG(cf, F_CF);
-                       CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
-                       CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
-                       CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-               } else {
-                       res = (u8) d;
-               }
-
-               if (cnt == 1) {
-                       /* Needs simplification. */
-                       CONDITIONAL_SET_FLAG(
-                                                                       (((res & 0x80) == 0x80) ^
-                                                                        (ACCESS_FLAG(F_CF) != 0)),
-                       /* was (M.x86.R_FLG&F_CF)==F_CF)), */
-                                                                       F_OF);
-               } else {
-                       CLEAR_FLAG(F_OF);
-               }
-       } else {
-               res = 0;
-               CONDITIONAL_SET_FLAG((d << (s-1)) & 0x80, F_CF);
-               CLEAR_FLAG(F_OF);
-               CLEAR_FLAG(F_SF);
-               SET_FLAG(F_PF);
-               SET_FLAG(F_ZF);
-    }
-       return (u8)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the SHL instruction and side effects.
-****************************************************************************/
-u16 shl_word(u16 d, u8 s)
-{
-    unsigned int cnt, res, cf;
-
-       if (s < 16) {
-               cnt = s % 16;
-               if (cnt > 0) {
-                       res = d << cnt;
-                       cf = d & (1 << (16 - cnt));
-                       CONDITIONAL_SET_FLAG(cf, F_CF);
-                       CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
-                       CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
-                       CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-               } else {
-                       res = (u16) d;
-               }
-
-               if (cnt == 1) {
-                       CONDITIONAL_SET_FLAG(
-                                                                       (((res & 0x8000) == 0x8000) ^
-                                                                        (ACCESS_FLAG(F_CF) != 0)),
-                                                                       F_OF);
-       } else {
-                       CLEAR_FLAG(F_OF);
-       }
-    } else {
-               res = 0;
-               CONDITIONAL_SET_FLAG((d << (s-1)) & 0x8000, F_CF);
-               CLEAR_FLAG(F_OF);
-               CLEAR_FLAG(F_SF);
-               SET_FLAG(F_PF);
-               SET_FLAG(F_ZF);
-       }
-       return (u16)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the SHL instruction and side effects.
-****************************************************************************/
-u32 shl_long(u32 d, u8 s)
-{
-       unsigned int cnt, res, cf;
-
-       if (s < 32) {
-               cnt = s % 32;
-               if (cnt > 0) {
-                       res = d << cnt;
-                       cf = d & (1 << (32 - cnt));
-                       CONDITIONAL_SET_FLAG(cf, F_CF);
-                       CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
-                       CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
-                       CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-               } else {
-                       res = d;
-               }
-               if (cnt == 1) {
-                       CONDITIONAL_SET_FLAG((((res & 0x80000000) == 0x80000000) ^
-                                                                 (ACCESS_FLAG(F_CF) != 0)), F_OF);
-               } else {
-                       CLEAR_FLAG(F_OF);
-               }
-       } else {
-               res = 0;
-               CONDITIONAL_SET_FLAG((d << (s-1)) & 0x80000000, F_CF);
-               CLEAR_FLAG(F_OF);
-               CLEAR_FLAG(F_SF);
-               SET_FLAG(F_PF);
-               SET_FLAG(F_ZF);
-       }
-       return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the SHR instruction and side effects.
-****************************************************************************/
-u8 shr_byte(u8 d, u8 s)
-{
-       unsigned int cnt, res, cf;
-
-       if (s < 8) {
-               cnt = s % 8;
-               if (cnt > 0) {
-                       cf = d & (1 << (cnt - 1));
-                       res = d >> cnt;
-                       CONDITIONAL_SET_FLAG(cf, F_CF);
-                       CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
-                       CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
-                       CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-               } else {
-                       res = (u8) d;
-               }
-
-               if (cnt == 1) {
-                       CONDITIONAL_SET_FLAG(XOR2(res >> 6), F_OF);
-               } else {
-                       CLEAR_FLAG(F_OF);
-               }
-       } else {
-               res = 0;
-               CONDITIONAL_SET_FLAG((d >> (s-1)) & 0x1, F_CF);
-               CLEAR_FLAG(F_OF);
-               CLEAR_FLAG(F_SF);
-               SET_FLAG(F_PF);
-               SET_FLAG(F_ZF);
-       }
-       return (u8)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the SHR instruction and side effects.
-****************************************************************************/
-u16 shr_word(u16 d, u8 s)
-{
-       unsigned int cnt, res, cf;
-
-       if (s < 16) {
-               cnt = s % 16;
-               if (cnt > 0) {
-                       cf = d & (1 << (cnt - 1));
-                       res = d >> cnt;
-                       CONDITIONAL_SET_FLAG(cf, F_CF);
-                       CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
-                       CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
-                       CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-               } else {
-                       res = d;
-               }
-
-               if (cnt == 1) {
-                       CONDITIONAL_SET_FLAG(XOR2(res >> 14), F_OF);
-       } else {
-                       CLEAR_FLAG(F_OF);
-       }
-       } else {
-               res = 0;
-               CLEAR_FLAG(F_CF);
-               CLEAR_FLAG(F_OF);
-               SET_FLAG(F_ZF);
-               CLEAR_FLAG(F_SF);
-               CLEAR_FLAG(F_PF);
-    }
-       return (u16)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the SHR instruction and side effects.
-****************************************************************************/
-u32 shr_long(u32 d, u8 s)
-{
-       unsigned int cnt, res, cf;
-
-       if (s < 32) {
-               cnt = s % 32;
-               if (cnt > 0) {
-                       cf = d & (1 << (cnt - 1));
-                       res = d >> cnt;
-                       CONDITIONAL_SET_FLAG(cf, F_CF);
-                       CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
-                       CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
-                       CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-       } else {
-           res = d;
-       }
-       if (cnt == 1) {
-                       CONDITIONAL_SET_FLAG(XOR2(res >> 30), F_OF);
-       } else {
-                       CLEAR_FLAG(F_OF);
-       }
-    } else {
-       res = 0;
-               CLEAR_FLAG(F_CF);
-               CLEAR_FLAG(F_OF);
-               SET_FLAG(F_ZF);
-               CLEAR_FLAG(F_SF);
-               CLEAR_FLAG(F_PF);
-    }
-    return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the SAR instruction and side effects.
-****************************************************************************/
-u8 sar_byte(u8 d, u8 s)
-{
-       unsigned int cnt, res, cf, mask, sf;
-
-       res = d;
-       sf = d & 0x80;
-    cnt = s % 8;
-       if (cnt > 0 && cnt < 8) {
-               mask = (1 << (8 - cnt)) - 1;
-               cf = d & (1 << (cnt - 1));
-               res = (d >> cnt) & mask;
-               CONDITIONAL_SET_FLAG(cf, F_CF);
-               if (sf) {
-                       res |= ~mask;
-               }
-               CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
-               CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-               CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
-    } else if (cnt >= 8) {
-       if (sf) {
-           res = 0xff;
-                       SET_FLAG(F_CF);
-                       CLEAR_FLAG(F_ZF);
-                       SET_FLAG(F_SF);
-                       SET_FLAG(F_PF);
-               } else {
-                       res = 0;
-                       CLEAR_FLAG(F_CF);
-                       SET_FLAG(F_ZF);
-                       CLEAR_FLAG(F_SF);
-                       CLEAR_FLAG(F_PF);
-               }
-       }
-       return (u8)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the SAR instruction and side effects.
-****************************************************************************/
-u16 sar_word(u16 d, u8 s)
-{
-    unsigned int cnt, res, cf, mask, sf;
-
-    sf = d & 0x8000;
-    cnt = s % 16;
-       res = d;
-       if (cnt > 0 && cnt < 16) {
-       mask = (1 << (16 - cnt)) - 1;
-       cf = d & (1 << (cnt - 1));
-       res = (d >> cnt) & mask;
-               CONDITIONAL_SET_FLAG(cf, F_CF);
-       if (sf) {
-           res |= ~mask;
-       }
-               CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
-               CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
-               CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-    } else if (cnt >= 16) {
-       if (sf) {
-           res = 0xffff;
-                       SET_FLAG(F_CF);
-                       CLEAR_FLAG(F_ZF);
-                       SET_FLAG(F_SF);
-                       SET_FLAG(F_PF);
-       } else {
-           res = 0;
-                       CLEAR_FLAG(F_CF);
-                       SET_FLAG(F_ZF);
-                       CLEAR_FLAG(F_SF);
-                       CLEAR_FLAG(F_PF);
-       }
-    }
-       return (u16)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the SAR instruction and side effects.
-****************************************************************************/
-u32 sar_long(u32 d, u8 s)
-{
-    u32 cnt, res, cf, mask, sf;
-
-    sf = d & 0x80000000;
-    cnt = s % 32;
-       res = d;
-       if (cnt > 0 && cnt < 32) {
-       mask = (1 << (32 - cnt)) - 1;
-               cf = d & (1 << (cnt - 1));
-       res = (d >> cnt) & mask;
-               CONDITIONAL_SET_FLAG(cf, F_CF);
-       if (sf) {
-           res |= ~mask;
-       }
-               CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
-               CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
-               CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-    } else if (cnt >= 32) {
-       if (sf) {
-           res = 0xffffffff;
-                       SET_FLAG(F_CF);
-                       CLEAR_FLAG(F_ZF);
-                       SET_FLAG(F_SF);
-                       SET_FLAG(F_PF);
-               } else {
-                       res = 0;
-                       CLEAR_FLAG(F_CF);
-                       SET_FLAG(F_ZF);
-                       CLEAR_FLAG(F_SF);
-                       CLEAR_FLAG(F_PF);
-               }
-       }
-       return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the SHLD instruction and side effects.
-****************************************************************************/
-u16 shld_word (u16 d, u16 fill, u8 s)
-{
-       unsigned int cnt, res, cf;
-
-       if (s < 16) {
-               cnt = s % 16;
-               if (cnt > 0) {
-                       res = (d << cnt) | (fill >> (16-cnt));
-                       cf = d & (1 << (16 - cnt));
-                       CONDITIONAL_SET_FLAG(cf, F_CF);
-                       CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
-                       CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
-                       CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-               } else {
-                       res = d;
-               }
-               if (cnt == 1) {
-                       CONDITIONAL_SET_FLAG((((res & 0x8000) == 0x8000) ^
-                                                                 (ACCESS_FLAG(F_CF) != 0)), F_OF);
-               } else {
-                       CLEAR_FLAG(F_OF);
-               }
-       } else {
-               res = 0;
-               CONDITIONAL_SET_FLAG((d << (s-1)) & 0x8000, F_CF);
-               CLEAR_FLAG(F_OF);
-               CLEAR_FLAG(F_SF);
-               SET_FLAG(F_PF);
-               SET_FLAG(F_ZF);
-       }
-       return (u16)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the SHLD instruction and side effects.
-****************************************************************************/
-u32 shld_long (u32 d, u32 fill, u8 s)
-{
-       unsigned int cnt, res, cf;
-
-       if (s < 32) {
-               cnt = s % 32;
-               if (cnt > 0) {
-                       res = (d << cnt) | (fill >> (32-cnt));
-                       cf = d & (1 << (32 - cnt));
-                       CONDITIONAL_SET_FLAG(cf, F_CF);
-                       CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
-                       CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
-                       CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-               } else {
-                       res = d;
-               }
-               if (cnt == 1) {
-                       CONDITIONAL_SET_FLAG((((res & 0x80000000) == 0x80000000) ^
-                                                                 (ACCESS_FLAG(F_CF) != 0)), F_OF);
-               } else {
-                       CLEAR_FLAG(F_OF);
-               }
-       } else {
-               res = 0;
-               CONDITIONAL_SET_FLAG((d << (s-1)) & 0x80000000, F_CF);
-               CLEAR_FLAG(F_OF);
-               CLEAR_FLAG(F_SF);
-               SET_FLAG(F_PF);
-               SET_FLAG(F_ZF);
-       }
-       return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the SHRD instruction and side effects.
-****************************************************************************/
-u16 shrd_word (u16 d, u16 fill, u8 s)
-{
-       unsigned int cnt, res, cf;
-
-       if (s < 16) {
-               cnt = s % 16;
-               if (cnt > 0) {
-                       cf = d & (1 << (cnt - 1));
-                       res = (d >> cnt) | (fill << (16 - cnt));
-                       CONDITIONAL_SET_FLAG(cf, F_CF);
-                       CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
-                       CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
-                       CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-               } else {
-                       res = d;
-               }
-
-               if (cnt == 1) {
-                       CONDITIONAL_SET_FLAG(XOR2(res >> 14), F_OF);
-       } else {
-                       CLEAR_FLAG(F_OF);
-       }
-       } else {
-               res = 0;
-               CLEAR_FLAG(F_CF);
-               CLEAR_FLAG(F_OF);
-               SET_FLAG(F_ZF);
-               CLEAR_FLAG(F_SF);
-               CLEAR_FLAG(F_PF);
-    }
-       return (u16)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the SHRD instruction and side effects.
-****************************************************************************/
-u32 shrd_long (u32 d, u32 fill, u8 s)
-{
-       unsigned int cnt, res, cf;
-
-       if (s < 32) {
-               cnt = s % 32;
-               if (cnt > 0) {
-                       cf = d & (1 << (cnt - 1));
-                       res = (d >> cnt) | (fill << (32 - cnt));
-                       CONDITIONAL_SET_FLAG(cf, F_CF);
-                       CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
-                       CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
-                       CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-               } else {
-                       res = d;
-               }
-               if (cnt == 1) {
-                       CONDITIONAL_SET_FLAG(XOR2(res >> 30), F_OF);
-       } else {
-                       CLEAR_FLAG(F_OF);
-       }
-       } else {
-               res = 0;
-               CLEAR_FLAG(F_CF);
-               CLEAR_FLAG(F_OF);
-               SET_FLAG(F_ZF);
-               CLEAR_FLAG(F_SF);
-               CLEAR_FLAG(F_PF);
-    }
-       return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the SBB instruction and side effects.
-****************************************************************************/
-u8 sbb_byte(u8 d, u8 s)
-{
-    register u32 res;   /* all operands in native machine order */
-    register u32 bc;
-
-       if (ACCESS_FLAG(F_CF))
-               res = d - s - 1;
-       else
-               res = d - s;
-       CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
-       CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
-       CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-
-       /* calculate the borrow chain.  See note at top */
-       bc = (res & (~d | s)) | (~d & s);
-       CONDITIONAL_SET_FLAG(bc & 0x80, F_CF);
-       CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF);
-       CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
-       return (u8)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the SBB instruction and side effects.
-****************************************************************************/
-u16 sbb_word(u16 d, u16 s)
-{
-    register u32 res;   /* all operands in native machine order */
-    register u32 bc;
-
-       if (ACCESS_FLAG(F_CF))
-       res = d - s - 1;
-    else
-       res = d - s;
-       CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
-       CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
-       CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-
-       /* calculate the borrow chain.  See note at top */
-       bc = (res & (~d | s)) | (~d & s);
-       CONDITIONAL_SET_FLAG(bc & 0x8000, F_CF);
-       CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF);
-       CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
-       return (u16)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the SBB instruction and side effects.
-****************************************************************************/
-u32 sbb_long(u32 d, u32 s)
-{
-       register u32 res;   /* all operands in native machine order */
-       register u32 bc;
-
-       if (ACCESS_FLAG(F_CF))
-       res = d - s - 1;
-    else
-       res = d - s;
-       CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
-       CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
-       CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-
-       /* calculate the borrow chain.  See note at top */
-       bc = (res & (~d | s)) | (~d & s);
-       CONDITIONAL_SET_FLAG(bc & 0x80000000, F_CF);
-       CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF);
-       CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
-       return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the SUB instruction and side effects.
-****************************************************************************/
-u8 sub_byte(u8 d, u8 s)
-{
-       register u32 res;   /* all operands in native machine order */
-       register u32 bc;
-
-       res = d - s;
-       CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
-       CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
-       CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-
-       /* calculate the borrow chain.  See note at top */
-       bc = (res & (~d | s)) | (~d & s);
-       CONDITIONAL_SET_FLAG(bc & 0x80, F_CF);
-       CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF);
-       CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
-       return (u8)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the SUB instruction and side effects.
-****************************************************************************/
-u16 sub_word(u16 d, u16 s)
-{
-    register u32 res;   /* all operands in native machine order */
-    register u32 bc;
-
-    res = d - s;
-       CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
-       CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
-       CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-
-       /* calculate the borrow chain.  See note at top */
-       bc = (res & (~d | s)) | (~d & s);
-       CONDITIONAL_SET_FLAG(bc & 0x8000, F_CF);
-       CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF);
-       CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
-       return (u16)res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the SUB instruction and side effects.
-****************************************************************************/
-u32 sub_long(u32 d, u32 s)
-{
-       register u32 res;   /* all operands in native machine order */
-       register u32 bc;
-
-       res = d - s;
-       CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
-       CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
-       CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-
-       /* calculate the borrow chain.  See note at top */
-       bc = (res & (~d | s)) | (~d & s);
-       CONDITIONAL_SET_FLAG(bc & 0x80000000, F_CF);
-       CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF);
-       CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
-       return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the TEST instruction and side effects.
-****************************************************************************/
-void test_byte(u8 d, u8 s)
-{
-    register u32 res;   /* all operands in native machine order */
-
-    res = d & s;
-
-       CLEAR_FLAG(F_OF);
-       CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
-       CONDITIONAL_SET_FLAG(res == 0, F_ZF);
-       CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-    /* AF == dont care */
-       CLEAR_FLAG(F_CF);
-}
-
-/****************************************************************************
-REMARKS:
-Implements the TEST instruction and side effects.
-****************************************************************************/
-void test_word(u16 d, u16 s)
-{
-       register u32 res;   /* all operands in native machine order */
-
-       res = d & s;
-
-       CLEAR_FLAG(F_OF);
-       CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
-       CONDITIONAL_SET_FLAG(res == 0, F_ZF);
-       CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-       /* AF == dont care */
-       CLEAR_FLAG(F_CF);
-}
-
-/****************************************************************************
-REMARKS:
-Implements the TEST instruction and side effects.
-****************************************************************************/
-void test_long(u32 d, u32 s)
-{
-       register u32 res;   /* all operands in native machine order */
-
-       res = d & s;
-
-       CLEAR_FLAG(F_OF);
-       CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
-       CONDITIONAL_SET_FLAG(res == 0, F_ZF);
-       CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-       /* AF == dont care */
-       CLEAR_FLAG(F_CF);
-}
-
-/****************************************************************************
-REMARKS:
-Implements the XOR instruction and side effects.
-****************************************************************************/
-u8 xor_byte(u8 d, u8 s)
-{
-       register u8 res;    /* all operands in native machine order */
-
-       res = d ^ s;
-       CLEAR_FLAG(F_OF);
-       CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
-       CONDITIONAL_SET_FLAG(res == 0, F_ZF);
-       CONDITIONAL_SET_FLAG(PARITY(res), F_PF);
-       CLEAR_FLAG(F_CF);
-       CLEAR_FLAG(F_AF);
-       return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the XOR instruction and side effects.
-****************************************************************************/
-u16 xor_word(u16 d, u16 s)
-{
-       register u16 res;   /* all operands in native machine order */
-
-       res = d ^ s;
-       CLEAR_FLAG(F_OF);
-       CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
-       CONDITIONAL_SET_FLAG(res == 0, F_ZF);
-       CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-       CLEAR_FLAG(F_CF);
-       CLEAR_FLAG(F_AF);
-       return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the XOR instruction and side effects.
-****************************************************************************/
-u32 xor_long(u32 d, u32 s)
-{
-       register u32 res;   /* all operands in native machine order */
-
-       res = d ^ s;
-       CLEAR_FLAG(F_OF);
-       CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
-       CONDITIONAL_SET_FLAG(res == 0, F_ZF);
-       CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
-       CLEAR_FLAG(F_CF);
-       CLEAR_FLAG(F_AF);
-       return res;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the IMUL instruction and side effects.
-****************************************************************************/
-void imul_byte(u8 s)
-{
-       s16 res = (s16)((s8)M.x86.R_AL * (s8)s);
-
-       M.x86.R_AX = res;
-       if (((M.x86.R_AL & 0x80) == 0 && M.x86.R_AH == 0x00) ||
-               ((M.x86.R_AL & 0x80) != 0 && M.x86.R_AH == 0xFF)) {
-               CLEAR_FLAG(F_CF);
-               CLEAR_FLAG(F_OF);
-       } else {
-               SET_FLAG(F_CF);
-               SET_FLAG(F_OF);
-       }
-}
-
-/****************************************************************************
-REMARKS:
-Implements the IMUL instruction and side effects.
-****************************************************************************/
-void imul_word(u16 s)
-{
-       s32 res = (s16)M.x86.R_AX * (s16)s;
-
-       M.x86.R_AX = (u16)res;
-       M.x86.R_DX = (u16)(res >> 16);
-       if (((M.x86.R_AX & 0x8000) == 0 && M.x86.R_DX == 0x00) ||
-               ((M.x86.R_AX & 0x8000) != 0 && M.x86.R_DX == 0xFF)) {
-               CLEAR_FLAG(F_CF);
-               CLEAR_FLAG(F_OF);
-       } else {
-               SET_FLAG(F_CF);
-               SET_FLAG(F_OF);
-       }
-}
-
-/****************************************************************************
-REMARKS:
-Implements the IMUL instruction and side effects.
-****************************************************************************/
-void imul_long_direct(u32 *res_lo, u32* res_hi,u32 d, u32 s)
-{
-#ifdef __HAS_LONG_LONG__
-       s64 res = (s32)d * (s32)s;
-
-       *res_lo = (u32)res;
-       *res_hi = (u32)(res >> 32);
-#else
-       u32     d_lo,d_hi,d_sign;
-       u32     s_lo,s_hi,s_sign;
-       u32     rlo_lo,rlo_hi,rhi_lo;
-
-       if ((d_sign = d & 0x80000000) != 0)
-               d = -d;
-       d_lo = d & 0xFFFF;
-       d_hi = d >> 16;
-       if ((s_sign = s & 0x80000000) != 0)
-               s = -s;
-       s_lo = s & 0xFFFF;
-       s_hi = s >> 16;
-       rlo_lo = d_lo * s_lo;
-       rlo_hi = (d_hi * s_lo + d_lo * s_hi) + (rlo_lo >> 16);
-       rhi_lo = d_hi * s_hi + (rlo_hi >> 16);
-       *res_lo = (rlo_hi << 16) | (rlo_lo & 0xFFFF);
-       *res_hi = rhi_lo;
-       if (d_sign != s_sign) {
-               d = ~*res_lo;
-               s = (((d & 0xFFFF) + 1) >> 16) + (d >> 16);
-               *res_lo = ~*res_lo+1;
-               *res_hi = ~*res_hi+(s >> 16);
-               }
-#endif
-}
-
-/****************************************************************************
-REMARKS:
-Implements the IMUL instruction and side effects.
-****************************************************************************/
-void imul_long(u32 s)
-{
-       imul_long_direct(&M.x86.R_EAX,&M.x86.R_EDX,M.x86.R_EAX,s);
-       if (((M.x86.R_EAX & 0x80000000) == 0 && M.x86.R_EDX == 0x00) ||
-               ((M.x86.R_EAX & 0x80000000) != 0 && M.x86.R_EDX == 0xFF)) {
-               CLEAR_FLAG(F_CF);
-               CLEAR_FLAG(F_OF);
-       } else {
-               SET_FLAG(F_CF);
-               SET_FLAG(F_OF);
-       }
-}
-
-/****************************************************************************
-REMARKS:
-Implements the MUL instruction and side effects.
-****************************************************************************/
-void mul_byte(u8 s)
-{
-       u16 res = (u16)(M.x86.R_AL * s);
-
-       M.x86.R_AX = res;
-       if (M.x86.R_AH == 0) {
-               CLEAR_FLAG(F_CF);
-               CLEAR_FLAG(F_OF);
-       } else {
-               SET_FLAG(F_CF);
-               SET_FLAG(F_OF);
-       }
-}
-
-/****************************************************************************
-REMARKS:
-Implements the MUL instruction and side effects.
-****************************************************************************/
-void mul_word(u16 s)
-{
-       u32 res = M.x86.R_AX * s;
-
-       M.x86.R_AX = (u16)res;
-       M.x86.R_DX = (u16)(res >> 16);
-       if (M.x86.R_DX == 0) {
-               CLEAR_FLAG(F_CF);
-               CLEAR_FLAG(F_OF);
-    } else {
-               SET_FLAG(F_CF);
-               SET_FLAG(F_OF);
-    }
-}
-
-/****************************************************************************
-REMARKS:
-Implements the MUL instruction and side effects.
-****************************************************************************/
-void mul_long(u32 s)
-{
-#ifdef __HAS_LONG_LONG__
-       u64 res = (u32)M.x86.R_EAX * (u32)s;
-
-       M.x86.R_EAX = (u32)res;
-       M.x86.R_EDX = (u32)(res >> 32);
-#else
-       u32     a,a_lo,a_hi;
-       u32     s_lo,s_hi;
-       u32     rlo_lo,rlo_hi,rhi_lo;
-
-       a = M.x86.R_EAX;
-       a_lo = a & 0xFFFF;
-       a_hi = a >> 16;
-       s_lo = s & 0xFFFF;
-       s_hi = s >> 16;
-       rlo_lo = a_lo * s_lo;
-       rlo_hi = (a_hi * s_lo + a_lo * s_hi) + (rlo_lo >> 16);
-       rhi_lo = a_hi * s_hi + (rlo_hi >> 16);
-       M.x86.R_EAX = (rlo_hi << 16) | (rlo_lo & 0xFFFF);
-       M.x86.R_EDX = rhi_lo;
-#endif
-
-       if (M.x86.R_EDX == 0) {
-               CLEAR_FLAG(F_CF);
-               CLEAR_FLAG(F_OF);
-       } else {
-               SET_FLAG(F_CF);
-               SET_FLAG(F_OF);
-    }
-}
-
-/****************************************************************************
-REMARKS:
-Implements the IDIV instruction and side effects.
-****************************************************************************/
-void idiv_byte(u8 s)
-{
-    s32 dvd, div, mod;
-
-       dvd = (s16)M.x86.R_AX;
-       if (s == 0) {
-               x86emu_intr_raise(0);
-       return;
-       }
-       div = dvd / (s8)s;
-       mod = dvd % (s8)s;
-       if (abs(div) > 0x7f) {
-               x86emu_intr_raise(0);
-               return;
-       }
-       M.x86.R_AL = (s8) div;
-       M.x86.R_AH = (s8) mod;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the IDIV instruction and side effects.
-****************************************************************************/
-void idiv_word(u16 s)
-{
-       s32 dvd, div, mod;
-
-       dvd = (((s32)M.x86.R_DX) << 16) | M.x86.R_AX;
-       if (s == 0) {
-               x86emu_intr_raise(0);
-               return;
-       }
-       div = dvd / (s16)s;
-       mod = dvd % (s16)s;
-       if (abs(div) > 0x7fff) {
-               x86emu_intr_raise(0);
-               return;
-       }
-       CLEAR_FLAG(F_CF);
-       CLEAR_FLAG(F_SF);
-       CONDITIONAL_SET_FLAG(div == 0, F_ZF);
-       CONDITIONAL_SET_FLAG(PARITY(mod & 0xff), F_PF);
-
-       M.x86.R_AX = (u16)div;
-       M.x86.R_DX = (u16)mod;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the IDIV instruction and side effects.
-****************************************************************************/
-void idiv_long(u32 s)
-{
-#ifdef __HAS_LONG_LONG__
-       s64 dvd, div, mod;
-
-       dvd = (((s64)M.x86.R_EDX) << 32) | M.x86.R_EAX;
-       if (s == 0) {
-               x86emu_intr_raise(0);
-               return;
-       }
-       div = dvd / (s32)s;
-       mod = dvd % (s32)s;
-       if (abs(div) > 0x7fffffff) {
-               x86emu_intr_raise(0);
-               return;
-       }
-#else
-       s32 div = 0, mod;
-       s32 h_dvd = M.x86.R_EDX;
-       u32 l_dvd = M.x86.R_EAX;
-       u32 abs_s = s & 0x7FFFFFFF;
-       u32 abs_h_dvd = h_dvd & 0x7FFFFFFF;
-       u32 h_s = abs_s >> 1;
-       u32 l_s = abs_s << 31;
-       int counter = 31;
-       int carry;
-
-       if (s == 0) {
-               x86emu_intr_raise(0);
-               return;
-       }
-       do {
-               div <<= 1;
-               carry = (l_dvd >= l_s) ? 0 : 1;
-
-               if (abs_h_dvd < (h_s + carry)) {
-                       h_s >>= 1;
-                       l_s = abs_s << (--counter);
-                       continue;
-               } else {
-                       abs_h_dvd -= (h_s + carry);
-                       l_dvd = carry ? ((0xFFFFFFFF - l_s) + l_dvd + 1)
-                               : (l_dvd - l_s);
-                       h_s >>= 1;
-                       l_s = abs_s << (--counter);
-                       div |= 1;
-                       continue;
-               }
-
-       } while (counter > -1);
-       /* overflow */
-       if (abs_h_dvd || (l_dvd > abs_s)) {
-               x86emu_intr_raise(0);
-               return;
-       }
-       /* sign */
-       div |= ((h_dvd & 0x10000000) ^ (s & 0x10000000));
-       mod = l_dvd;
-
-#endif
-       CLEAR_FLAG(F_CF);
-       CLEAR_FLAG(F_AF);
-       CLEAR_FLAG(F_SF);
-       SET_FLAG(F_ZF);
-       CONDITIONAL_SET_FLAG(PARITY(mod & 0xff), F_PF);
-
-       M.x86.R_EAX = (u32)div;
-       M.x86.R_EDX = (u32)mod;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the DIV instruction and side effects.
-****************************************************************************/
-void div_byte(u8 s)
-{
-       u32 dvd, div, mod;
-
-       dvd = M.x86.R_AX;
-    if (s == 0) {
-               x86emu_intr_raise(0);
-       return;
-    }
-       div = dvd / (u8)s;
-       mod = dvd % (u8)s;
-       if (abs(div) > 0xff) {
-               x86emu_intr_raise(0);
-       return;
-       }
-       M.x86.R_AL = (u8)div;
-       M.x86.R_AH = (u8)mod;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the DIV instruction and side effects.
-****************************************************************************/
-void div_word(u16 s)
-{
-       u32 dvd, div, mod;
-
-       dvd = (((u32)M.x86.R_DX) << 16) | M.x86.R_AX;
-       if (s == 0) {
-               x86emu_intr_raise(0);
-       return;
-    }
-       div = dvd / (u16)s;
-       mod = dvd % (u16)s;
-       if (abs(div) > 0xffff) {
-               x86emu_intr_raise(0);
-               return;
-       }
-       CLEAR_FLAG(F_CF);
-       CLEAR_FLAG(F_SF);
-       CONDITIONAL_SET_FLAG(div == 0, F_ZF);
-       CONDITIONAL_SET_FLAG(PARITY(mod & 0xff), F_PF);
-
-       M.x86.R_AX = (u16)div;
-       M.x86.R_DX = (u16)mod;
-}
-
-/****************************************************************************
-REMARKS:
-Implements the DIV instruction and side effects.
-****************************************************************************/
-void div_long(u32 s)
-{
-#ifdef __HAS_LONG_LONG__
-       u64 dvd, div, mod;
-
-       dvd = (((u64)M.x86.R_EDX) << 32) | M.x86.R_EAX;
-       if (s == 0) {
-               x86emu_intr_raise(0);
-               return;
-       }
-       div = dvd / (u32)s;
-       mod = dvd % (u32)s;
-       if (abs(div) > 0xffffffff) {
-               x86emu_intr_raise(0);
-               return;
-       }
-#else
-       s32 div = 0, mod;
-       s32 h_dvd = M.x86.R_EDX;
-       u32 l_dvd = M.x86.R_EAX;
-
-       u32 h_s = s;
-       u32 l_s = 0;
-       int counter = 32;
-       int carry;
-
-       if (s == 0) {
-               x86emu_intr_raise(0);
-               return;
-       }
-       do {
-               div <<= 1;
-               carry = (l_dvd >= l_s) ? 0 : 1;
-
-               if (h_dvd < (h_s + carry)) {
-                       h_s >>= 1;
-                       l_s = s << (--counter);
-                       continue;
-               } else {
-                       h_dvd -= (h_s + carry);
-                       l_dvd = carry ? ((0xFFFFFFFF - l_s) + l_dvd + 1)
-                               : (l_dvd - l_s);
-                       h_s >>= 1;
-                       l_s = s << (--counter);
-                       div |= 1;
-                       continue;
-               }
-
-       } while (counter > -1);
-       /* overflow */
-       if (h_dvd || (l_dvd > s)) {
-               x86emu_intr_raise(0);
-               return;
-       }
-       mod = l_dvd;
-#endif
-       CLEAR_FLAG(F_CF);
-       CLEAR_FLAG(F_AF);
-       CLEAR_FLAG(F_SF);
-       SET_FLAG(F_ZF);
-       CONDITIONAL_SET_FLAG(PARITY(mod & 0xff), F_PF);
-
-       M.x86.R_EAX = (u32)div;
-       M.x86.R_EDX = (u32)mod;
-}
-
-#endif /* __HAVE_INLINE_ASSEMBLER__ */
-
-/****************************************************************************
-REMARKS:
-Implements the IN string instruction and side effects.
-****************************************************************************/
-void ins(int size)
-{
-       int inc = size;
-
-       if (ACCESS_FLAG(F_DF)) {
-               inc = -size;
-       }
-       if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) {
-       /* dont care whether REPE or REPNE */
-       /* in until CX is ZERO. */
-               u32 count = ((M.x86.mode & SYSMODE_PREFIX_DATA) ?
-                                        M.x86.R_ECX : M.x86.R_CX);
-       switch (size) {
-         case 1:
-           while (count--) {
-                               store_data_byte_abs(M.x86.R_ES, M.x86.R_DI,
-                                                                       (*sys_inb)(M.x86.R_DX));
-                               M.x86.R_DI += inc;
-           }
-           break;
-
-         case 2:
-           while (count--) {
-                               store_data_word_abs(M.x86.R_ES, M.x86.R_DI,
-                                                                       (*sys_inw)(M.x86.R_DX));
-                               M.x86.R_DI += inc;
-           }
-           break;
-         case 4:
-           while (count--) {
-                               store_data_long_abs(M.x86.R_ES, M.x86.R_DI,
-                                                                       (*sys_inl)(M.x86.R_DX));
-                               M.x86.R_DI += inc;
-               break;
-           }
-       }
-               M.x86.R_CX = 0;
-               if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-                       M.x86.R_ECX = 0;
-       }
-               M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
-    } else {
-       switch (size) {
-         case 1:
-                       store_data_byte_abs(M.x86.R_ES, M.x86.R_DI,
-                                                               (*sys_inb)(M.x86.R_DX));
-           break;
-         case 2:
-                       store_data_word_abs(M.x86.R_ES, M.x86.R_DI,
-                                                               (*sys_inw)(M.x86.R_DX));
-           break;
-         case 4:
-                       store_data_long_abs(M.x86.R_ES, M.x86.R_DI,
-                                                               (*sys_inl)(M.x86.R_DX));
-           break;
-       }
-               M.x86.R_DI += inc;
-    }
-}
-
-/****************************************************************************
-REMARKS:
-Implements the OUT string instruction and side effects.
-****************************************************************************/
-void outs(int size)
-{
-    int inc = size;
-
-       if (ACCESS_FLAG(F_DF)) {
-       inc = -size;
-    }
-       if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) {
-       /* dont care whether REPE or REPNE */
-       /* out until CX is ZERO. */
-               u32 count = ((M.x86.mode & SYSMODE_PREFIX_DATA) ?
-                                        M.x86.R_ECX : M.x86.R_CX);
-       switch (size) {
-         case 1:
-           while (count--) {
-                               (*sys_outb)(M.x86.R_DX,
-                                                fetch_data_byte_abs(M.x86.R_ES, M.x86.R_SI));
-                               M.x86.R_SI += inc;
-           }
-           break;
-
-         case 2:
-           while (count--) {
-                               (*sys_outw)(M.x86.R_DX,
-                                                fetch_data_word_abs(M.x86.R_ES, M.x86.R_SI));
-                               M.x86.R_SI += inc;
-           }
-           break;
-         case 4:
-           while (count--) {
-                               (*sys_outl)(M.x86.R_DX,
-                                                fetch_data_long_abs(M.x86.R_ES, M.x86.R_SI));
-                               M.x86.R_SI += inc;
-               break;
-           }
-       }
-               M.x86.R_CX = 0;
-               if (M.x86.mode & SYSMODE_PREFIX_DATA) {
-                       M.x86.R_ECX = 0;
-       }
-               M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
-    } else {
-       switch (size) {
-         case 1:
-                       (*sys_outb)(M.x86.R_DX,
-                                        fetch_data_byte_abs(M.x86.R_ES, M.x86.R_SI));
-           break;
-         case 2:
-                       (*sys_outw)(M.x86.R_DX,
-                                        fetch_data_word_abs(M.x86.R_ES, M.x86.R_SI));
-           break;
-         case 4:
-                       (*sys_outl)(M.x86.R_DX,
-                                        fetch_data_long_abs(M.x86.R_ES, M.x86.R_SI));
-           break;
-       }
-               M.x86.R_SI += inc;
-    }
-}
-
-/****************************************************************************
-PARAMETERS:
-addr   - Address to fetch word from
-
-REMARKS:
-Fetches a word from emulator memory using an absolute address.
-****************************************************************************/
-u16 mem_access_word(int addr)
-{
-DB(    if (CHECK_MEM_ACCESS())
-         x86emu_check_mem_access(addr);)
-       return (*sys_rdw)(addr);
-}
-
-/****************************************************************************
-REMARKS:
-Pushes a word onto the stack.
-
-NOTE: Do not inline this, as (*sys_wrX) is already inline!
-****************************************************************************/
-void push_word(u16 w)
-{
-DB(    if (CHECK_SP_ACCESS())
-         x86emu_check_sp_access();)
-       M.x86.R_SP -= 2;
-       (*sys_wrw)(((u32)M.x86.R_SS << 4)  + M.x86.R_SP, w);
-}
-
-/****************************************************************************
-REMARKS:
-Pushes a long onto the stack.
-
-NOTE: Do not inline this, as (*sys_wrX) is already inline!
-****************************************************************************/
-void push_long(u32 w)
-{
-DB(    if (CHECK_SP_ACCESS())
-         x86emu_check_sp_access();)
-       M.x86.R_SP -= 4;
-       (*sys_wrl)(((u32)M.x86.R_SS << 4)  + M.x86.R_SP, w);
-}
-
-/****************************************************************************
-REMARKS:
-Pops a word from the stack.
-
-NOTE: Do not inline this, as (*sys_rdX) is already inline!
-****************************************************************************/
-u16 pop_word(void)
-{
-       register u16 res;
-
-DB(    if (CHECK_SP_ACCESS())
-         x86emu_check_sp_access();)
-       res = (*sys_rdw)(((u32)M.x86.R_SS << 4)  + M.x86.R_SP);
-       M.x86.R_SP += 2;
-       return res;
-}
-
-/****************************************************************************
-REMARKS:
-Pops a long from the stack.
-
-NOTE: Do not inline this, as (*sys_rdX) is already inline!
-****************************************************************************/
-u32 pop_long(void)
-{
-    register u32 res;
-
-DB(    if (CHECK_SP_ACCESS())
-         x86emu_check_sp_access();)
-       res = (*sys_rdl)(((u32)M.x86.R_SS << 4)  + M.x86.R_SP);
-       M.x86.R_SP += 4;
-    return res;
-}
-
-#ifdef __HAVE_INLINE_ASSEMBLER__
-
-u16 aaa_word (u16 d)
-{ return aaa_word_asm(&M.x86.R_EFLG,d); }
-
-u16 aas_word (u16 d)
-{ return aas_word_asm(&M.x86.R_EFLG,d); }
-
-u16 aad_word (u16 d)
-{ return aad_word_asm(&M.x86.R_EFLG,d); }
-
-u16 aam_word (u8 d)
-{ return aam_word_asm(&M.x86.R_EFLG,d); }
-
-u8 adc_byte (u8 d, u8 s)
-{ return adc_byte_asm(&M.x86.R_EFLG,d,s); }
-
-u16 adc_word (u16 d, u16 s)
-{ return adc_word_asm(&M.x86.R_EFLG,d,s); }
-
-u32 adc_long (u32 d, u32 s)
-{ return adc_long_asm(&M.x86.R_EFLG,d,s); }
-
-u8 add_byte (u8 d, u8 s)
-{ return add_byte_asm(&M.x86.R_EFLG,d,s); }
-
-u16 add_word (u16 d, u16 s)
-{ return add_word_asm(&M.x86.R_EFLG,d,s); }
-
-u32 add_long (u32 d, u32 s)
-{ return add_long_asm(&M.x86.R_EFLG,d,s); }
-
-u8 and_byte (u8 d, u8 s)
-{ return and_byte_asm(&M.x86.R_EFLG,d,s); }
-
-u16 and_word (u16 d, u16 s)
-{ return and_word_asm(&M.x86.R_EFLG,d,s); }
-
-u32 and_long (u32 d, u32 s)
-{ return and_long_asm(&M.x86.R_EFLG,d,s); }
-
-u8 cmp_byte (u8 d, u8 s)
-{ return cmp_byte_asm(&M.x86.R_EFLG,d,s); }
-
-u16 cmp_word (u16 d, u16 s)
-{ return cmp_word_asm(&M.x86.R_EFLG,d,s); }
-
-u32 cmp_long (u32 d, u32 s)
-{ return cmp_long_asm(&M.x86.R_EFLG,d,s); }
-
-u8 daa_byte (u8 d)
-{ return daa_byte_asm(&M.x86.R_EFLG,d); }
-
-u8 das_byte (u8 d)
-{ return das_byte_asm(&M.x86.R_EFLG,d); }
-
-u8 dec_byte (u8 d)
-{ return dec_byte_asm(&M.x86.R_EFLG,d); }
-
-u16 dec_word (u16 d)
-{ return dec_word_asm(&M.x86.R_EFLG,d); }
-
-u32 dec_long (u32 d)
-{ return dec_long_asm(&M.x86.R_EFLG,d); }
-
-u8 inc_byte (u8 d)
-{ return inc_byte_asm(&M.x86.R_EFLG,d); }
-
-u16 inc_word (u16 d)
-{ return inc_word_asm(&M.x86.R_EFLG,d); }
-
-u32 inc_long (u32 d)
-{ return inc_long_asm(&M.x86.R_EFLG,d); }
-
-u8 or_byte (u8 d, u8 s)
-{ return or_byte_asm(&M.x86.R_EFLG,d,s); }
-
-u16 or_word (u16 d, u16 s)
-{ return or_word_asm(&M.x86.R_EFLG,d,s); }
-
-u32 or_long (u32 d, u32 s)
-{ return or_long_asm(&M.x86.R_EFLG,d,s); }
-
-u8 neg_byte (u8 s)
-{ return neg_byte_asm(&M.x86.R_EFLG,s); }
-
-u16 neg_word (u16 s)
-{ return neg_word_asm(&M.x86.R_EFLG,s); }
-
-u32 neg_long (u32 s)
-{ return neg_long_asm(&M.x86.R_EFLG,s); }
-
-u8 not_byte (u8 s)
-{ return not_byte_asm(&M.x86.R_EFLG,s); }
-
-u16 not_word (u16 s)
-{ return not_word_asm(&M.x86.R_EFLG,s); }
-
-u32 not_long (u32 s)
-{ return not_long_asm(&M.x86.R_EFLG,s); }
-
-u8 rcl_byte (u8 d, u8 s)
-{ return rcl_byte_asm(&M.x86.R_EFLG,d,s); }
-
-u16 rcl_word (u16 d, u8 s)
-{ return rcl_word_asm(&M.x86.R_EFLG,d,s); }
-
-u32 rcl_long (u32 d, u8 s)
-{ return rcl_long_asm(&M.x86.R_EFLG,d,s); }
-
-u8 rcr_byte (u8 d, u8 s)
-{ return rcr_byte_asm(&M.x86.R_EFLG,d,s); }
-
-u16 rcr_word (u16 d, u8 s)
-{ return rcr_word_asm(&M.x86.R_EFLG,d,s); }
-
-u32 rcr_long (u32 d, u8 s)
-{ return rcr_long_asm(&M.x86.R_EFLG,d,s); }
-
-u8 rol_byte (u8 d, u8 s)
-{ return rol_byte_asm(&M.x86.R_EFLG,d,s); }
-
-u16 rol_word (u16 d, u8 s)
-{ return rol_word_asm(&M.x86.R_EFLG,d,s); }
-
-u32 rol_long (u32 d, u8 s)
-{ return rol_long_asm(&M.x86.R_EFLG,d,s); }
-
-u8 ror_byte (u8 d, u8 s)
-{ return ror_byte_asm(&M.x86.R_EFLG,d,s); }
-
-u16 ror_word (u16 d, u8 s)
-{ return ror_word_asm(&M.x86.R_EFLG,d,s); }
-
-u32 ror_long (u32 d, u8 s)
-{ return ror_long_asm(&M.x86.R_EFLG,d,s); }
-
-u8 shl_byte (u8 d, u8 s)
-{ return shl_byte_asm(&M.x86.R_EFLG,d,s); }
-
-u16 shl_word (u16 d, u8 s)
-{ return shl_word_asm(&M.x86.R_EFLG,d,s); }
-
-u32 shl_long (u32 d, u8 s)
-{ return shl_long_asm(&M.x86.R_EFLG,d,s); }
-
-u8 shr_byte (u8 d, u8 s)
-{ return shr_byte_asm(&M.x86.R_EFLG,d,s); }
-
-u16 shr_word (u16 d, u8 s)
-{ return shr_word_asm(&M.x86.R_EFLG,d,s); }
-
-u32 shr_long (u32 d, u8 s)
-{ return shr_long_asm(&M.x86.R_EFLG,d,s); }
-
-u8 sar_byte (u8 d, u8 s)
-{ return sar_byte_asm(&M.x86.R_EFLG,d,s); }
-
-u16 sar_word (u16 d, u8 s)
-{ return sar_word_asm(&M.x86.R_EFLG,d,s); }
-
-u32 sar_long (u32 d, u8 s)
-{ return sar_long_asm(&M.x86.R_EFLG,d,s); }
-
-u16 shld_word (u16 d, u16 fill, u8 s)
-{ return shld_word_asm(&M.x86.R_EFLG,d,fill,s); }
-
-u32 shld_long (u32 d, u32 fill, u8 s)
-{ return shld_long_asm(&M.x86.R_EFLG,d,fill,s); }
-
-u16 shrd_word (u16 d, u16 fill, u8 s)
-{ return shrd_word_asm(&M.x86.R_EFLG,d,fill,s); }
-
-u32 shrd_long (u32 d, u32 fill, u8 s)
-{ return shrd_long_asm(&M.x86.R_EFLG,d,fill,s); }
-
-u8 sbb_byte (u8 d, u8 s)
-{ return sbb_byte_asm(&M.x86.R_EFLG,d,s); }
-
-u16 sbb_word (u16 d, u16 s)
-{ return sbb_word_asm(&M.x86.R_EFLG,d,s); }
-
-u32 sbb_long (u32 d, u32 s)
-{ return sbb_long_asm(&M.x86.R_EFLG,d,s); }
-
-u8 sub_byte (u8 d, u8 s)
-{ return sub_byte_asm(&M.x86.R_EFLG,d,s); }
-
-u16 sub_word (u16 d, u16 s)
-{ return sub_word_asm(&M.x86.R_EFLG,d,s); }
-
-u32 sub_long (u32 d, u32 s)
-{ return sub_long_asm(&M.x86.R_EFLG,d,s); }
-
-void test_byte (u8 d, u8 s)
-{ test_byte_asm(&M.x86.R_EFLG,d,s); }
-
-void test_word (u16 d, u16 s)
-{ test_word_asm(&M.x86.R_EFLG,d,s); }
-
-void test_long (u32 d, u32 s)
-{ test_long_asm(&M.x86.R_EFLG,d,s); }
-
-u8 xor_byte (u8 d, u8 s)
-{ return xor_byte_asm(&M.x86.R_EFLG,d,s); }
-
-u16 xor_word (u16 d, u16 s)
-{ return xor_word_asm(&M.x86.R_EFLG,d,s); }
-
-u32 xor_long (u32 d, u32 s)
-{ return xor_long_asm(&M.x86.R_EFLG,d,s); }
-
-void imul_byte (u8 s)
-{ imul_byte_asm(&M.x86.R_EFLG,&M.x86.R_AX,M.x86.R_AL,s); }
-
-void imul_word (u16 s)
-{ imul_word_asm(&M.x86.R_EFLG,&M.x86.R_AX,&M.x86.R_DX,M.x86.R_AX,s); }
-
-void imul_long (u32 s)
-{ imul_long_asm(&M.x86.R_EFLG,&M.x86.R_EAX,&M.x86.R_EDX,M.x86.R_EAX,s); }
-
-void imul_long_direct(u32 *res_lo, u32* res_hi,u32 d, u32 s)
-{ imul_long_asm(&M.x86.R_EFLG,res_lo,res_hi,d,s); }
-
-void mul_byte (u8 s)
-{ mul_byte_asm(&M.x86.R_EFLG,&M.x86.R_AX,M.x86.R_AL,s); }
-
-void mul_word (u16 s)
-{ mul_word_asm(&M.x86.R_EFLG,&M.x86.R_AX,&M.x86.R_DX,M.x86.R_AX,s); }
-
-void mul_long (u32 s)
-{ mul_long_asm(&M.x86.R_EFLG,&M.x86.R_EAX,&M.x86.R_EDX,M.x86.R_EAX,s); }
-
-void idiv_byte (u8 s)
-{ idiv_byte_asm(&M.x86.R_EFLG,&M.x86.R_AL,&M.x86.R_AH,M.x86.R_AX,s); }
-
-void idiv_word (u16 s)
-{ idiv_word_asm(&M.x86.R_EFLG,&M.x86.R_AX,&M.x86.R_DX,M.x86.R_AX,M.x86.R_DX,s); }
-
-void idiv_long (u32 s)
-{ idiv_long_asm(&M.x86.R_EFLG,&M.x86.R_EAX,&M.x86.R_EDX,M.x86.R_EAX,M.x86.R_EDX,s); }
-
-void div_byte (u8 s)
-{ div_byte_asm(&M.x86.R_EFLG,&M.x86.R_AL,&M.x86.R_AH,M.x86.R_AX,s); }
-
-void div_word (u16 s)
-{ div_word_asm(&M.x86.R_EFLG,&M.x86.R_AX,&M.x86.R_DX,M.x86.R_AX,M.x86.R_DX,s); }
-
-void div_long (u32 s)
-{ div_long_asm(&M.x86.R_EFLG,&M.x86.R_EAX,&M.x86.R_EDX,M.x86.R_EAX,M.x86.R_EDX,s); }
-
-#endif
diff --git a/board/MAI/bios_emulator/scitech/src/x86emu/sys.c b/board/MAI/bios_emulator/scitech/src/x86emu/sys.c
deleted file mode 100644 (file)
index afe58f8..0000000
+++ /dev/null
@@ -1,658 +0,0 @@
-/****************************************************************************
-*
-*                                              Realmode X86 Emulator Library
-*
-*              Copyright (C) 1996-1999 SciTech Software, Inc.
-*                                   Copyright (C) David Mosberger-Tang
-*                                         Copyright (C) 1999 Egbert Eich
-*
-*  ========================================================================
-*
-*  Permission to use, copy, modify, distribute, and sell this software and
-*  its documentation for any purpose is hereby granted without fee,
-*  provided that the above copyright notice appear in all copies and that
-*  both that copyright notice and this permission notice appear in
-*  supporting documentation, and that the name of the authors not be used
-*  in advertising or publicity pertaining to distribution of the software
-*  without specific, written prior permission.  The authors makes no
-*  representations about the suitability of this software for any purpose.
-*  It is provided "as is" without express or implied warranty.
-*
-*  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-*  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-*  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-*  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-*  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-*  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-*  PERFORMANCE OF THIS SOFTWARE.
-*
-*  ========================================================================
-*
-* Language:            ANSI C
-* Environment: Any
-* Developer:    Kendall Bennett
-*
-* Description:  This file includes subroutines which are related to
-*                              programmed I/O and memory access. Included in this module
-*                              are default functions with limited usefulness. For real
-*                              uses these functions will most likely be overriden by the
-*                              user library.
-*
-****************************************************************************/
-
-#include "x86emu.h"
-#include "x86emu/regs.h"
-#include "x86emu/debug.h"
-#include "x86emu/prim_ops.h"
-#include <string.h>
-
-/*------------------------- Global Variables ------------------------------*/
-
-X86EMU_sysEnv          _X86EMU_env;            /* Global emulator machine state */
-X86EMU_intrFuncs       _X86EMU_intrTab[256];
-
-/*----------------------------- Implementation ----------------------------*/
-#ifdef __alpha__
-/* to cope with broken egcs-1.1.2 :-(((( */
-
-/*
- * inline functions to do unaligned accesses
- * from linux/include/asm-alpha/unaligned.h
- */
-
-/*
- * EGCS 1.1 knows about arbitrary unaligned loads.  Define some
- * packed structures to talk about such things with.
- */
-
-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 91
-struct __una_u64 { unsigned long  x __attribute__((packed)); };
-struct __una_u32 { unsigned int   x __attribute__((packed)); };
-struct __una_u16 { unsigned short x __attribute__((packed)); };
-#endif
-
-static __inline__ unsigned long ldq_u(unsigned long * r11)
-{
-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 91
-       const struct __una_u64 *ptr = (const struct __una_u64 *) r11;
-       return ptr->x;
-#else
-       unsigned long r1,r2;
-       __asm__("ldq_u %0,%3\n\t"
-               "ldq_u %1,%4\n\t"
-               "extql %0,%2,%0\n\t"
-               "extqh %1,%2,%1"
-               :"=&r" (r1), "=&r" (r2)
-               :"r" (r11),
-                "m" (*r11),
-                "m" (*(const unsigned long *)(7+(char *) r11)));
-       return r1 | r2;
-#endif
-}
-
-static __inline__ unsigned long ldl_u(unsigned int * r11)
-{
-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 91
-       const struct __una_u32 *ptr = (const struct __una_u32 *) r11;
-       return ptr->x;
-#else
-       unsigned long r1,r2;
-       __asm__("ldq_u %0,%3\n\t"
-               "ldq_u %1,%4\n\t"
-               "extll %0,%2,%0\n\t"
-               "extlh %1,%2,%1"
-               :"=&r" (r1), "=&r" (r2)
-               :"r" (r11),
-                "m" (*r11),
-                "m" (*(const unsigned long *)(3+(char *) r11)));
-       return r1 | r2;
-#endif
-}
-
-static __inline__ unsigned long ldw_u(unsigned short * r11)
-{
-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 91
-       const struct __una_u16 *ptr = (const struct __una_u16 *) r11;
-       return ptr->x;
-#else
-       unsigned long r1,r2;
-       __asm__("ldq_u %0,%3\n\t"
-               "ldq_u %1,%4\n\t"
-               "extwl %0,%2,%0\n\t"
-               "extwh %1,%2,%1"
-               :"=&r" (r1), "=&r" (r2)
-               :"r" (r11),
-                "m" (*r11),
-                "m" (*(const unsigned long *)(1+(char *) r11)));
-       return r1 | r2;
-#endif
-}
-
-/*
- * Elemental unaligned stores
- */
-
-static __inline__ void stq_u(unsigned long r5, unsigned long * r11)
-{
-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 91
-       struct __una_u64 *ptr = (struct __una_u64 *) r11;
-       ptr->x = r5;
-#else
-       unsigned long r1,r2,r3,r4;
-
-       __asm__("ldq_u %3,%1\n\t"
-               "ldq_u %2,%0\n\t"
-               "insqh %6,%7,%5\n\t"
-               "insql %6,%7,%4\n\t"
-               "mskqh %3,%7,%3\n\t"
-               "mskql %2,%7,%2\n\t"
-               "bis %3,%5,%3\n\t"
-               "bis %2,%4,%2\n\t"
-               "stq_u %3,%1\n\t"
-               "stq_u %2,%0"
-               :"=m" (*r11),
-                "=m" (*(unsigned long *)(7+(char *) r11)),
-                "=&r" (r1), "=&r" (r2), "=&r" (r3), "=&r" (r4)
-               :"r" (r5), "r" (r11));
-#endif
-}
-
-static __inline__ void stl_u(unsigned long r5, unsigned int * r11)
-{
-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 91
-       struct __una_u32 *ptr = (struct __una_u32 *) r11;
-       ptr->x = r5;
-#else
-       unsigned long r1,r2,r3,r4;
-
-       __asm__("ldq_u %3,%1\n\t"
-               "ldq_u %2,%0\n\t"
-               "inslh %6,%7,%5\n\t"
-               "insll %6,%7,%4\n\t"
-               "msklh %3,%7,%3\n\t"
-               "mskll %2,%7,%2\n\t"
-               "bis %3,%5,%3\n\t"
-               "bis %2,%4,%2\n\t"
-               "stq_u %3,%1\n\t"
-               "stq_u %2,%0"
-               :"=m" (*r11),
-                "=m" (*(unsigned long *)(3+(char *) r11)),
-                "=&r" (r1), "=&r" (r2), "=&r" (r3), "=&r" (r4)
-               :"r" (r5), "r" (r11));
-#endif
-}
-
-static __inline__ void stw_u(unsigned long r5, unsigned short * r11)
-{
-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 91
-       struct __una_u16 *ptr = (struct __una_u16 *) r11;
-       ptr->x = r5;
-#else
-       unsigned long r1,r2,r3,r4;
-
-       __asm__("ldq_u %3,%1\n\t"
-               "ldq_u %2,%0\n\t"
-               "inswh %6,%7,%5\n\t"
-               "inswl %6,%7,%4\n\t"
-               "mskwh %3,%7,%3\n\t"
-               "mskwl %2,%7,%2\n\t"
-               "bis %3,%5,%3\n\t"
-               "bis %2,%4,%2\n\t"
-               "stq_u %3,%1\n\t"
-               "stq_u %2,%0"
-               :"=m" (*r11),
-                "=m" (*(unsigned long *)(1+(char *) r11)),
-                "=&r" (r1), "=&r" (r2), "=&r" (r3), "=&r" (r4)
-               :"r" (r5), "r" (r11));
-#endif
-}
-
-#elif defined (__ia64__)
-/*
- * EGCS 1.1 knows about arbitrary unaligned loads.  Define some
- * packed structures to talk about such things with.
- */
-struct __una_u64 { unsigned long  x __attribute__((packed)); };
-struct __una_u32 { unsigned int   x __attribute__((packed)); };
-struct __una_u16 { unsigned short x __attribute__((packed)); };
-
-static __inline__ unsigned long
-__uldq (const unsigned long * r11)
-{
-       const struct __una_u64 *ptr = (const struct __una_u64 *) r11;
-       return ptr->x;
-}
-
-static __inline__ unsigned long
-uldl (const unsigned int * r11)
-{
-       const struct __una_u32 *ptr = (const struct __una_u32 *) r11;
-       return ptr->x;
-}
-
-static __inline__ unsigned long
-uldw (const unsigned short * r11)
-{
-       const struct __una_u16 *ptr = (const struct __una_u16 *) r11;
-       return ptr->x;
-}
-
-static __inline__ void
-ustq (unsigned long r5, unsigned long * r11)
-{
-       struct __una_u64 *ptr = (struct __una_u64 *) r11;
-       ptr->x = r5;
-}
-
-static __inline__ void
-ustl (unsigned long r5, unsigned int * r11)
-{
-       struct __una_u32 *ptr = (struct __una_u32 *) r11;
-       ptr->x = r5;
-}
-
-static __inline__ void
-ustw (unsigned long r5, unsigned short * r11)
-{
-       struct __una_u16 *ptr = (struct __una_u16 *) r11;
-       ptr->x = r5;
-}
-
-#endif
-
-/****************************************************************************
-PARAMETERS:
-addr   - Emulator memory address to read
-
-RETURNS:
-Byte value read from emulator memory.
-
-REMARKS:
-Reads a byte value from the emulator memory.
-****************************************************************************/
-u8 X86API rdb(
-    u32 addr)
-{
-       u8 val;
-
-       if (addr > M.mem_size - 1) {
-               DB(printk("mem_read: address %#lx out of range!\n", addr);)
-               HALT_SYS();
-               }
-       val = *(u8*)(M.mem_base + addr);
-DB(    if (DEBUG_MEM_TRACE())
-               printk("%#08x 1 -> %#x\n", addr, val);)
-       return val;
-}
-
-/****************************************************************************
-PARAMETERS:
-addr   - Emulator memory address to read
-
-RETURNS:
-Word value read from emulator memory.
-
-REMARKS:
-Reads a word value from the emulator memory.
-****************************************************************************/
-u16 X86API rdw(
-       u32 addr)
-{
-       u16 val = 0;
-
-       if (addr > M.mem_size - 2) {
-               DB(printk("mem_read: address %#lx out of range!\n", addr);)
-               HALT_SYS();
-               }
-#ifdef __BIG_ENDIAN__
-       if (addr & 0x1) {
-               val = (*(u8*)(M.mem_base + addr) |
-                         (*(u8*)(M.mem_base + addr + 1) << 8));
-               }
-       else
-#endif
-#ifdef __alpha__
-               val = ldw_u((u16*)(M.mem_base + addr));
-#elif defined (__ia64__)
-         val = uldw((u16*)(M.mem_base + addr));
-#else
-               val = *(u16*)(M.mem_base + addr);
-#endif
-               DB(     if (DEBUG_MEM_TRACE())
-               printk("%#08x 2 -> %#x\n", addr, val);)
-    return val;
-}
-
-/****************************************************************************
-PARAMETERS:
-addr   - Emulator memory address to read
-
-RETURNS:
-Long value read from emulator memory.
-REMARKS:
-Reads a long value from the emulator memory.
-****************************************************************************/
-u32 X86API rdl(
-       u32 addr)
-{
-       u32 val = 0;
-
-       if (addr > M.mem_size - 4) {
-               DB(printk("mem_read: address %#lx out of range!\n", addr);)
-               HALT_SYS();
-               }
-#ifdef __BIG_ENDIAN__
-       if (addr & 0x3) {
-               val = (*(u8*)(M.mem_base + addr + 0) |
-                         (*(u8*)(M.mem_base + addr + 1) << 8) |
-                         (*(u8*)(M.mem_base + addr + 2) << 16) |
-                         (*(u8*)(M.mem_base + addr + 3) << 24));
-               }
-       else
-#endif
-#ifdef __alpha__
-               val = ldl_u((u32*)(M.mem_base + addr));
-#elif defined (__ia64__)
-               val = uldl((u32*)(M.mem_base + addr));
-#else
-               val = *(u32*)(M.mem_base + addr);
-#endif
-DB(    if (DEBUG_MEM_TRACE())
-               printk("%#08x 4 -> %#x\n", addr, val);)
-       return val;
-}
-
-/****************************************************************************
-PARAMETERS:
-addr   - Emulator memory address to read
-val            - Value to store
-
-REMARKS:
-Writes a byte value to emulator memory.
-****************************************************************************/
-void X86API wrb(
-       u32 addr,
-       u8 val)
-{
-DB(    if (DEBUG_MEM_TRACE())
-               printk("%#08x 1 <- %#x\n", addr, val);)
-    if (addr > M.mem_size - 1) {
-               DB(printk("mem_write: address %#lx out of range!\n", addr);)
-               HALT_SYS();
-               }
-       *(u8*)(M.mem_base + addr) = val;
-}
-
-/****************************************************************************
-PARAMETERS:
-addr   - Emulator memory address to read
-val            - Value to store
-
-REMARKS:
-Writes a word value to emulator memory.
-****************************************************************************/
-void X86API wrw(
-       u32 addr,
-       u16 val)
-{
-DB(    if (DEBUG_MEM_TRACE())
-               printk("%#08x 2 <- %#x\n", addr, val);)
-       if (addr > M.mem_size - 2) {
-               DB(printk("mem_write: address %#lx out of range!\n", addr);)
-               HALT_SYS();
-               }
-#ifdef __BIG_ENDIAN__
-       if (addr & 0x1) {
-               *(u8*)(M.mem_base + addr + 0) = (val >> 0) & 0xff;
-               *(u8*)(M.mem_base + addr + 1) = (val >> 8) & 0xff;
-               }
-       else
-#endif
-#ifdef __alpha__
-        stw_u(val,(u16*)(M.mem_base + addr));
-#elif defined (__ia64__)
-        ustw(val,(u16*)(M.mem_base + addr));
-#else
-        *(u16*)(M.mem_base + addr) = val;
-#endif
-}
-
-/****************************************************************************
-PARAMETERS:
-addr   - Emulator memory address to read
-val            - Value to store
-
-REMARKS:
-Writes a long value to emulator memory.
-****************************************************************************/
-void X86API wrl(
-       u32 addr,
-       u32 val)
-{
-DB(    if (DEBUG_MEM_TRACE())
-               printk("%#08x 4 <- %#x\n", addr, val);)
-       if (addr > M.mem_size - 4) {
-               DB(printk("mem_write: address %#lx out of range!\n", addr);)
-               HALT_SYS();
-               }
-#ifdef __BIG_ENDIAN__
-       if (addr & 0x1) {
-               *(u8*)(M.mem_base + addr + 0) = (val >>  0) & 0xff;
-               *(u8*)(M.mem_base + addr + 1) = (val >>  8) & 0xff;
-               *(u8*)(M.mem_base + addr + 2) = (val >> 16) & 0xff;
-               *(u8*)(M.mem_base + addr + 3) = (val >> 24) & 0xff;
-               }
-       else
-#endif
-#ifdef __alpha__
-        stl_u(val,(u32*)(M.mem_base + addr));
-#elif defined (__ia64__)
-        ustl(val,(u32*)(M.mem_base + addr));
-#else
-        *(u32*)(M.mem_base + addr) = val;
-#endif
-}
-
-/****************************************************************************
-PARAMETERS:
-addr   - PIO address to read
-RETURN:
-0
-REMARKS:
-Default PIO byte read function. Doesn't perform real inb.
-****************************************************************************/
-static u8 X86API p_inb(
-       X86EMU_pioAddr addr)
-{
-DB(    if (DEBUG_IO_TRACE())
-               printk("inb %#04x \n", addr);)
-       return 0;
-}
-
-/****************************************************************************
-PARAMETERS:
-addr   - PIO address to read
-RETURN:
-0
-REMARKS:
-Default PIO word read function. Doesn't perform real inw.
-****************************************************************************/
-static u16 X86API p_inw(
-       X86EMU_pioAddr addr)
-{
-DB(    if (DEBUG_IO_TRACE())
-               printk("inw %#04x \n", addr);)
-       return 0;
-}
-
-/****************************************************************************
-PARAMETERS:
-addr   - PIO address to read
-RETURN:
-0
-REMARKS:
-Default PIO long read function. Doesn't perform real inl.
-****************************************************************************/
-static u32 X86API p_inl(
-       X86EMU_pioAddr addr)
-{
-DB(    if (DEBUG_IO_TRACE())
-               printk("inl %#04x \n", addr);)
-       return 0;
-}
-
-/****************************************************************************
-PARAMETERS:
-addr   - PIO address to write
-val     - Value to store
-REMARKS:
-Default PIO byte write function. Doesn't perform real outb.
-****************************************************************************/
-static void X86API p_outb(
-       X86EMU_pioAddr addr,
-       u8 val)
-{
-DB(    if (DEBUG_IO_TRACE())
-               printk("outb %#02x -> %#04x \n", val, addr);)
-    return;
-}
-
-/****************************************************************************
-PARAMETERS:
-addr   - PIO address to write
-val     - Value to store
-REMARKS:
-Default PIO word write function. Doesn't perform real outw.
-****************************************************************************/
-static void X86API p_outw(
-       X86EMU_pioAddr addr,
-       u16 val)
-{
-DB(    if (DEBUG_IO_TRACE())
-               printk("outw %#04x -> %#04x \n", val, addr);)
-       return;
-}
-
-/****************************************************************************
-PARAMETERS:
-addr   - PIO address to write
-val     - Value to store
-REMARKS:
-Default PIO ;ong write function. Doesn't perform real outl.
-****************************************************************************/
-static void X86API p_outl(
-       X86EMU_pioAddr addr,
-       u32 val)
-{
-DB(    if (DEBUG_IO_TRACE())
-               printk("outl %#08x -> %#04x \n", val, addr);)
-    return;
-}
-
-/*------------------------- Global Variables ------------------------------*/
-
-u8     (X86APIP sys_rdb)(u32 addr)                                 = rdb;
-u16    (X86APIP sys_rdw)(u32 addr)                                 = rdw;
-u32    (X86APIP sys_rdl)(u32 addr)                                 = rdl;
-void   (X86APIP sys_wrb)(u32 addr,u8 val)                          = wrb;
-void   (X86APIP sys_wrw)(u32 addr,u16 val)                 = wrw;
-void   (X86APIP sys_wrl)(u32 addr,u32 val)                 = wrl;
-u8     (X86APIP sys_inb)(X86EMU_pioAddr addr)              = p_inb;
-u16    (X86APIP sys_inw)(X86EMU_pioAddr addr)              = p_inw;
-u32    (X86APIP sys_inl)(X86EMU_pioAddr addr)              = p_inl;
-void   (X86APIP sys_outb)(X86EMU_pioAddr addr, u8 val)         = p_outb;
-void   (X86APIP sys_outw)(X86EMU_pioAddr addr, u16 val)        = p_outw;
-void   (X86APIP sys_outl)(X86EMU_pioAddr addr, u32 val)        = p_outl;
-
-/*----------------------------- Setup -------------------------------------*/
-
-/****************************************************************************
-PARAMETERS:
-funcs  - New memory function pointers to make active
-
-REMARKS:
-This function is used to set the pointers to functions which access
-memory space, allowing the user application to override these functions
-and hook them out as necessary for their application.
-****************************************************************************/
-void X86EMU_setupMemFuncs(
-       X86EMU_memFuncs *funcs)
-{
-       sys_rdb = funcs->rdb;
-    sys_rdw = funcs->rdw;
-    sys_rdl = funcs->rdl;
-    sys_wrb = funcs->wrb;
-    sys_wrw = funcs->wrw;
-    sys_wrl = funcs->wrl;
-}
-
-/****************************************************************************
-PARAMETERS:
-funcs  - New programmed I/O function pointers to make active
-
-REMARKS:
-This function is used to set the pointers to functions which access
-I/O space, allowing the user application to override these functions
-and hook them out as necessary for their application.
-****************************************************************************/
-void X86EMU_setupPioFuncs(
-       X86EMU_pioFuncs *funcs)
-{
-    sys_inb = funcs->inb;
-    sys_inw = funcs->inw;
-    sys_inl = funcs->inl;
-    sys_outb = funcs->outb;
-    sys_outw = funcs->outw;
-    sys_outl = funcs->outl;
-}
-
-/****************************************************************************
-PARAMETERS:
-funcs  - New interrupt vector table to make active
-
-REMARKS:
-This function is used to set the pointers to functions which handle
-interrupt processing in the emulator, allowing the user application to
-hook interrupts as necessary for their application. Any interrupts that
-are not hooked by the user application, and reflected and handled internally
-in the emulator via the interrupt vector table. This allows the application
-to get control when the code being emulated executes specific software
-interrupts.
-****************************************************************************/
-void X86EMU_setupIntrFuncs(
-       X86EMU_intrFuncs funcs[])
-{
-    int i;
-
-       for (i=0; i < 256; i++)
-               _X86EMU_intrTab[i] = NULL;
-       if (funcs) {
-               for (i = 0; i < 256; i++)
-                       _X86EMU_intrTab[i] = funcs[i];
-               }
-}
-
-/****************************************************************************
-PARAMETERS:
-int    - New software interrupt to prepare for
-
-REMARKS:
-This function is used to set up the emulator state to exceute a software
-interrupt. This can be used by the user application code to allow an
-interrupt to be hooked, examined and then reflected back to the emulator
-so that the code in the emulator will continue processing the software
-interrupt as per normal. This essentially allows system code to actively
-hook and handle certain software interrupts as necessary.
-****************************************************************************/
-void X86EMU_prepareForInt(
-       int num)
-{
-    push_word((u16)M.x86.R_FLG);
-    CLEAR_FLAG(F_IF);
-    CLEAR_FLAG(F_TF);
-    push_word(M.x86.R_CS);
-    M.x86.R_CS = mem_access_word(num * 4 + 2);
-    push_word(M.x86.R_IP);
-    M.x86.R_IP = mem_access_word(num * 4);
-       M.x86.intr = 0;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/x86emu/validate.c b/board/MAI/bios_emulator/scitech/src/x86emu/validate.c
deleted file mode 100644 (file)
index c951301..0000000
+++ /dev/null
@@ -1,765 +0,0 @@
-/****************************************************************************
-*
-*                                              Realmode X86 Emulator Library
-*
-*              Copyright (C) 1996-1999 SciTech Software, Inc.
-*                                   Copyright (C) David Mosberger-Tang
-*                                         Copyright (C) 1999 Egbert Eich
-*
-*  ========================================================================
-*
-*  Permission to use, copy, modify, distribute, and sell this software and
-*  its documentation for any purpose is hereby granted without fee,
-*  provided that the above copyright notice appear in all copies and that
-*  both that copyright notice and this permission notice appear in
-*  supporting documentation, and that the name of the authors not be used
-*  in advertising or publicity pertaining to distribution of the software
-*  without specific, written prior permission.  The authors makes no
-*  representations about the suitability of this software for any purpose.
-*  It is provided "as is" without express or implied warranty.
-*
-*  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-*  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-*  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-*  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-*  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-*  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-*  PERFORMANCE OF THIS SOFTWARE.
-*
-*  ========================================================================
-*
-* Language:     Watcom C 10.6 or later
-* Environment:  32-bit DOS
-* Developer:    Kendall Bennett
-*
-* Description:  Program to validate the x86 emulator library for
-*               correctness. We run the emulator primitive operations
-*               functions against the real x86 CPU, and compare the result
-*               and flags to ensure correctness.
-*
-*               We use inline assembler to compile and build this program.
-*
-****************************************************************************/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdarg.h>
-#include "x86emu.h"
-#include "x86emu/prim_asm.h"
-
-/*-------------------------- Implementation -------------------------------*/
-
-#define true 1
-#define false 0
-
-#define ALL_FLAGS   (F_CF | F_PF | F_AF | F_ZF | F_SF | F_OF)
-
-#define VAL_START_BINARY(parm_type,res_type,dmax,smax,dincr,sincr)  \
-{                                                                   \
-    parm_type   d,s;                                                \
-    res_type    r,r_asm;                                            \
-       ulong           flags,inflags;                                      \
-       int         f,failed = false;                                   \
-    char        buf1[80],buf2[80];                                  \
-    for (d = 0; d < dmax; d += dincr) {                             \
-       for (s = 0; s < smax; s += sincr) {                         \
-           M.x86.R_EFLG = inflags = flags = def_flags;             \
-           for (f = 0; f < 2; f++) {
-
-#define VAL_TEST_BINARY(name)                                           \
-               r_asm = name##_asm(&flags,d,s);                         \
-               r = name(d,s);                                  \
-               if (r != r_asm || M.x86.R_EFLG != flags)                \
-                   failed = true;                                      \
-               if (failed || trace) {
-
-#define VAL_TEST_BINARY_VOID(name)                                      \
-               name##_asm(&flags,d,s);                                 \
-               name(d,s);                                      \
-               r = r_asm = 0;                                          \
-               if (M.x86.R_EFLG != flags)                              \
-                   failed = true;                                      \
-               if (failed || trace) {
-
-#define VAL_FAIL_BYTE_BYTE_BINARY(name)                                                                 \
-                   if (failed)                                                                         \
-                       printk("fail\n");                                                               \
-                   printk("0x%02X = %-15s(0x%02X,0x%02X), flags = %s -> %s\n",                         \
-                       r, #name, d, s, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG));     \
-                   printk("0x%02X = %-15s(0x%02X,0x%02X), flags = %s -> %s\n",                         \
-                       r_asm, #name"_asm", d, s, print_flags(buf1,inflags), print_flags(buf2,flags));
-
-#define VAL_FAIL_WORD_WORD_BINARY(name)                                                                 \
-                   if (failed)                                                                         \
-                       printk("fail\n");                                                               \
-                   printk("0x%04X = %-15s(0x%04X,0x%04X), flags = %s -> %s\n",                         \
-                       r, #name, d, s, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG));   \
-                   printk("0x%04X = %-15s(0x%04X,0x%04X), flags = %s -> %s\n",                         \
-                       r_asm, #name"_asm", d, s, print_flags(buf1,inflags), print_flags(buf2,flags));
-
-#define VAL_FAIL_LONG_LONG_BINARY(name)                                                                 \
-                   if (failed)                                                                         \
-                       printk("fail\n");                                                               \
-                   printk("0x%08X = %-15s(0x%08X,0x%08X), flags = %s -> %s\n",                         \
-                       r, #name, d, s, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG)); \
-                   printk("0x%08X = %-15s(0x%08X,0x%08X), flags = %s -> %s\n",                         \
-                       r_asm, #name"_asm", d, s, print_flags(buf1,inflags), print_flags(buf2,flags));
-
-#define VAL_END_BINARY()                                                    \
-                   }                                                       \
-               M.x86.R_EFLG = inflags = flags = def_flags | (ALL_FLAGS & ~F_OF);   \
-               if (failed)                                                 \
-                   break;                                                  \
-               }                                                           \
-           if (failed)                                                     \
-               break;                                                      \
-           }                                                               \
-       if (failed)                                                         \
-           break;                                                          \
-       }                                                                   \
-    if (!failed)                                                            \
-       printk("passed\n");                                                 \
-}
-
-#define VAL_BYTE_BYTE_BINARY(name)          \
-    printk("Validating %s ... ", #name);    \
-    VAL_START_BINARY(u8,u8,0xFF,0xFF,1,1)   \
-    VAL_TEST_BINARY(name)                   \
-    VAL_FAIL_BYTE_BYTE_BINARY(name)         \
-    VAL_END_BINARY()
-
-#define VAL_WORD_WORD_BINARY(name)                      \
-    printk("Validating %s ... ", #name);                \
-    VAL_START_BINARY(u16,u16,0xFF00,0xFF00,0x100,0x100) \
-    VAL_TEST_BINARY(name)                               \
-    VAL_FAIL_WORD_WORD_BINARY(name)                     \
-    VAL_END_BINARY()
-
-#define VAL_LONG_LONG_BINARY(name)                                      \
-    printk("Validating %s ... ", #name);                                \
-    VAL_START_BINARY(u32,u32,0xFF000000,0xFF000000,0x1000000,0x1000000) \
-    VAL_TEST_BINARY(name)                                               \
-    VAL_FAIL_LONG_LONG_BINARY(name)                                     \
-    VAL_END_BINARY()
-
-#define VAL_VOID_BYTE_BINARY(name)          \
-    printk("Validating %s ... ", #name);    \
-    VAL_START_BINARY(u8,u8,0xFF,0xFF,1,1)   \
-    VAL_TEST_BINARY_VOID(name)              \
-    VAL_FAIL_BYTE_BYTE_BINARY(name)         \
-    VAL_END_BINARY()
-
-#define VAL_VOID_WORD_BINARY(name)                      \
-    printk("Validating %s ... ", #name);                \
-    VAL_START_BINARY(u16,u16,0xFF00,0xFF00,0x100,0x100) \
-    VAL_TEST_BINARY_VOID(name)                          \
-    VAL_FAIL_WORD_WORD_BINARY(name)                     \
-    VAL_END_BINARY()
-
-#define VAL_VOID_LONG_BINARY(name)                                      \
-    printk("Validating %s ... ", #name);                                \
-    VAL_START_BINARY(u32,u32,0xFF000000,0xFF000000,0x1000000,0x1000000) \
-    VAL_TEST_BINARY_VOID(name)                                          \
-    VAL_FAIL_LONG_LONG_BINARY(name)                                     \
-    VAL_END_BINARY()
-
-#define VAL_BYTE_ROTATE(name)               \
-    printk("Validating %s ... ", #name);    \
-    VAL_START_BINARY(u8,u8,0xFF,8,1,1)      \
-    VAL_TEST_BINARY(name)                   \
-    VAL_FAIL_BYTE_BYTE_BINARY(name)         \
-    VAL_END_BINARY()
-
-#define VAL_WORD_ROTATE(name)                           \
-    printk("Validating %s ... ", #name);                \
-    VAL_START_BINARY(u16,u16,0xFF00,16,0x100,1)         \
-    VAL_TEST_BINARY(name)                               \
-    VAL_FAIL_WORD_WORD_BINARY(name)                     \
-    VAL_END_BINARY()
-
-#define VAL_LONG_ROTATE(name)                                           \
-    printk("Validating %s ... ", #name);                                \
-    VAL_START_BINARY(u32,u32,0xFF000000,32,0x1000000,1)                 \
-    VAL_TEST_BINARY(name)                                               \
-    VAL_FAIL_LONG_LONG_BINARY(name)                                     \
-    VAL_END_BINARY()
-
-#define VAL_START_TERNARY(parm_type,res_type,dmax,smax,dincr,sincr,maxshift)\
-{                                                                   \
-    parm_type   d,s;                                                \
-    res_type    r,r_asm;                                            \
-    u8          shift;                                              \
-       u32         flags,inflags;                                      \
-    int         f,failed = false;                                   \
-    char        buf1[80],buf2[80];                                  \
-    for (d = 0; d < dmax; d += dincr) {                             \
-       for (s = 0; s < smax; s += sincr) {                         \
-           for (shift = 0; shift < maxshift; shift += 1) {        \
-               M.x86.R_EFLG = inflags = flags = def_flags;         \
-               for (f = 0; f < 2; f++) {
-
-#define VAL_TEST_TERNARY(name)                                          \
-                   r_asm = name##_asm(&flags,d,s,shift);               \
-                   r = name(d,s,shift);                           \
-                   if (r != r_asm || M.x86.R_EFLG != flags)            \
-                       failed = true;                                  \
-                   if (failed || trace) {
-
-#define VAL_FAIL_WORD_WORD_TERNARY(name)                                                                \
-                       if (failed)                                                                         \
-                           printk("fail\n");                                                               \
-                       printk("0x%04X = %-15s(0x%04X,0x%04X,%d), flags = %s -> %s\n",                      \
-                           r, #name, d, s, shift, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG));   \
-                       printk("0x%04X = %-15s(0x%04X,0x%04X,%d), flags = %s -> %s\n",                      \
-                           r_asm, #name"_asm", d, s, shift, print_flags(buf1,inflags), print_flags(buf2,flags));
-
-#define VAL_FAIL_LONG_LONG_TERNARY(name)                                                                \
-                       if (failed)                                                                         \
-                           printk("fail\n");                                                               \
-                       printk("0x%08X = %-15s(0x%08X,0x%08X,%d), flags = %s -> %s\n",                      \
-                           r, #name, d, s, shift, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG));  \
-                       printk("0x%08X = %-15s(0x%08X,0x%08X,%d), flags = %s -> %s\n",                      \
-                           r_asm, #name"_asm", d, s, shift, print_flags(buf1,inflags), print_flags(buf2,flags));
-
-#define VAL_END_TERNARY()                                                   \
-                       }                                                       \
-                   M.x86.R_EFLG = inflags = flags = def_flags | (ALL_FLAGS & ~F_OF);   \
-                   if (failed)                                                 \
-                       break;                                                  \
-                   }                                                           \
-               if (failed)                                                     \
-                   break;                                                      \
-               }                                                               \
-           if (failed)                                                     \
-               break;                                                      \
-           }                                                               \
-       if (failed)                                                         \
-           break;                                                          \
-       }                                                                   \
-    if (!failed)                                                            \
-       printk("passed\n");                                                 \
-}
-
-#define VAL_WORD_ROTATE_DBL(name)                           \
-    printk("Validating %s ... ", #name);                    \
-    VAL_START_TERNARY(u16,u16,0xFF00,0xFF00,0x100,0x100,16) \
-    VAL_TEST_TERNARY(name)                                  \
-    VAL_FAIL_WORD_WORD_TERNARY(name)                        \
-    VAL_END_TERNARY()
-
-#define VAL_LONG_ROTATE_DBL(name)                                           \
-    printk("Validating %s ... ", #name);                                    \
-    VAL_START_TERNARY(u32,u32,0xFF000000,0xFF000000,0x1000000,0x1000000,32) \
-    VAL_TEST_TERNARY(name)                                                  \
-    VAL_FAIL_LONG_LONG_TERNARY(name)                                        \
-    VAL_END_TERNARY()
-
-#define VAL_START_UNARY(parm_type,max,incr)                 \
-{                                                           \
-    parm_type   d,r,r_asm;                                  \
-       u32         flags,inflags;                              \
-    int         f,failed = false;                           \
-    char        buf1[80],buf2[80];                          \
-    for (d = 0; d < max; d += incr) {                       \
-       M.x86.R_EFLG = inflags = flags = def_flags;         \
-       for (f = 0; f < 2; f++) {
-
-#define VAL_TEST_UNARY(name)                                \
-           r_asm = name##_asm(&flags,d);                   \
-           r = name(d);                                \
-           if (r != r_asm || M.x86.R_EFLG != flags) {      \
-               failed = true;
-
-#define VAL_FAIL_BYTE_UNARY(name)                                                               \
-               printk("fail\n");                                                               \
-               printk("0x%02X = %-15s(0x%02X), flags = %s -> %s\n",                            \
-                   r, #name, d, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG));    \
-               printk("0x%02X = %-15s(0x%02X), flags = %s -> %s\n",                            \
-                   r_asm, #name"_asm", d, print_flags(buf1,inflags), print_flags(buf2,flags));
-
-#define VAL_FAIL_WORD_UNARY(name)                                                               \
-               printk("fail\n");                                                               \
-               printk("0x%04X = %-15s(0x%04X), flags = %s -> %s\n",                            \
-                   r, #name, d, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG));  \
-               printk("0x%04X = %-15s(0x%04X), flags = %s -> %s\n",                            \
-                   r_asm, #name"_asm", d, print_flags(buf1,inflags), print_flags(buf2,flags));
-
-#define VAL_FAIL_LONG_UNARY(name)                                                               \
-               printk("fail\n");                                                               \
-               printk("0x%08X = %-15s(0x%08X), flags = %s -> %s\n",                            \
-                   r, #name, d, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG));    \
-               printk("0x%08X = %-15s(0x%08X), flags = %s -> %s\n",                            \
-                   r_asm, #name"_asm", d, print_flags(buf1,inflags), print_flags(buf2,flags));
-
-#define VAL_END_UNARY()                                                 \
-               }                                                       \
-           M.x86.R_EFLG = inflags = flags = def_flags | ALL_FLAGS;     \
-           if (failed)                                                 \
-               break;                                                  \
-           }                                                           \
-       if (failed)                                                     \
-           break;                                                      \
-       }                                                               \
-    if (!failed)                                                        \
-       printk("passed\n");                                             \
-}
-
-#define VAL_BYTE_UNARY(name)                \
-    printk("Validating %s ... ", #name);    \
-    VAL_START_UNARY(u8,0xFF,0x1)            \
-    VAL_TEST_UNARY(name)                    \
-    VAL_FAIL_BYTE_UNARY(name)               \
-    VAL_END_UNARY()
-
-#define VAL_WORD_UNARY(name)                \
-    printk("Validating %s ... ", #name);    \
-    VAL_START_UNARY(u16,0xFF00,0x100)       \
-    VAL_TEST_UNARY(name)                    \
-    VAL_FAIL_WORD_UNARY(name)               \
-    VAL_END_UNARY()
-
-#define VAL_WORD_BYTE_UNARY(name)           \
-    printk("Validating %s ... ", #name);    \
-    VAL_START_UNARY(u16,0xFF,0x1)           \
-    VAL_TEST_UNARY(name)                    \
-    VAL_FAIL_WORD_UNARY(name)               \
-    VAL_END_UNARY()
-
-#define VAL_LONG_UNARY(name)                \
-    printk("Validating %s ... ", #name);    \
-    VAL_START_UNARY(u32,0xFF000000,0x1000000) \
-    VAL_TEST_UNARY(name)                    \
-    VAL_FAIL_LONG_UNARY(name)               \
-    VAL_END_UNARY()
-
-#define VAL_BYTE_MUL(name)                                              \
-    printk("Validating %s ... ", #name);                                \
-{                                                                       \
-    u8          d,s;                                                    \
-    u16         r,r_asm;                                                \
-       u32         flags,inflags;                                          \
-    int         f,failed = false;                                       \
-    char        buf1[80],buf2[80];                                      \
-    for (d = 0; d < 0xFF; d += 1) {                                     \
-       for (s = 0; s < 0xFF; s += 1) {                                 \
-           M.x86.R_EFLG = inflags = flags = def_flags;                 \
-           for (f = 0; f < 2; f++) {                                   \
-               name##_asm(&flags,&r_asm,d,s);                          \
-               M.x86.R_AL = d;                                         \
-               name(s);                                            \
-               r = M.x86.R_AX;                                         \
-               if (r != r_asm || M.x86.R_EFLG != flags)                \
-                   failed = true;                                      \
-               if (failed || trace) {                                  \
-                   if (failed)                                         \
-                       printk("fail\n");                               \
-                   printk("0x%04X = %-15s(0x%02X,0x%02X), flags = %s -> %s\n",                         \
-                       r, #name, d, s, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG));     \
-                   printk("0x%04X = %-15s(0x%02X,0x%02X), flags = %s -> %s\n",                         \
-                       r_asm, #name"_asm", d, s, print_flags(buf1,inflags), print_flags(buf2,flags));  \
-                   }                                                       \
-               M.x86.R_EFLG = inflags = flags = def_flags | (ALL_FLAGS & ~F_OF);   \
-               if (failed)                                                 \
-                   break;                                                  \
-               }                                                           \
-           if (failed)                                                     \
-               break;                                                      \
-           }                                                               \
-       if (failed)                                                         \
-           break;                                                          \
-       }                                                                   \
-    if (!failed)                                                            \
-       printk("passed\n");                                                 \
-}
-
-#define VAL_WORD_MUL(name)                                              \
-    printk("Validating %s ... ", #name);                                \
-{                                                                       \
-    u16         d,s;                                                    \
-    u16         r_lo,r_asm_lo;                                          \
-    u16         r_hi,r_asm_hi;                                          \
-       u32         flags,inflags;                                          \
-    int         f,failed = false;                                       \
-    char        buf1[80],buf2[80];                                      \
-    for (d = 0; d < 0xFF00; d += 0x100) {                               \
-       for (s = 0; s < 0xFF00; s += 0x100) {                           \
-           M.x86.R_EFLG = inflags = flags = def_flags;                 \
-           for (f = 0; f < 2; f++) {                                   \
-               name##_asm(&flags,&r_asm_lo,&r_asm_hi,d,s);             \
-               M.x86.R_AX = d;                                         \
-               name(s);                                            \
-               r_lo = M.x86.R_AX;                                      \
-               r_hi = M.x86.R_DX;                                      \
-               if (r_lo != r_asm_lo || r_hi != r_asm_hi || M.x86.R_EFLG != flags)\
-                   failed = true;                                      \
-               if (failed || trace) {                                  \
-                   if (failed)                                         \
-                       printk("fail\n");                               \
-                   printk("0x%04X:0x%04X = %-15s(0x%04X,0x%04X), flags = %s -> %s\n",                              \
-                       r_hi,r_lo, #name, d, s, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG));       \
-                   printk("0x%04X:0x%04X = %-15s(0x%04X,0x%04X), flags = %s -> %s\n",                              \
-                       r_asm_hi,r_asm_lo, #name"_asm", d, s, print_flags(buf1,inflags), print_flags(buf2,flags));  \
-                   }                                                                                               \
-               M.x86.R_EFLG = inflags = flags = def_flags | (ALL_FLAGS & ~F_OF);   \
-               if (failed)                                                 \
-                   break;                                                  \
-               }                                                           \
-           if (failed)                                                     \
-               break;                                                      \
-           }                                                               \
-       if (failed)                                                         \
-           break;                                                          \
-       }                                                                   \
-    if (!failed)                                                            \
-       printk("passed\n");                                                 \
-}
-
-#define VAL_LONG_MUL(name)                                              \
-    printk("Validating %s ... ", #name);                                \
-{                                                                       \
-    u32         d,s;                                                    \
-    u32         r_lo,r_asm_lo;                                          \
-    u32         r_hi,r_asm_hi;                                          \
-       u32         flags,inflags;                                          \
-    int         f,failed = false;                                       \
-    char        buf1[80],buf2[80];                                      \
-    for (d = 0; d < 0xFF000000; d += 0x1000000) {                       \
-       for (s = 0; s < 0xFF000000; s += 0x1000000) {                   \
-           M.x86.R_EFLG = inflags = flags = def_flags;                 \
-           for (f = 0; f < 2; f++) {                                   \
-               name##_asm(&flags,&r_asm_lo,&r_asm_hi,d,s);             \
-               M.x86.R_EAX = d;                                        \
-               name(s);                                            \
-               r_lo = M.x86.R_EAX;                                     \
-               r_hi = M.x86.R_EDX;                                     \
-               if (r_lo != r_asm_lo || r_hi != r_asm_hi || M.x86.R_EFLG != flags)\
-                   failed = true;                                      \
-               if (failed || trace) {                                  \
-                   if (failed)                                         \
-                       printk("fail\n");                               \
-                   printk("0x%08X:0x%08X = %-15s(0x%08X,0x%08X), flags = %s -> %s\n",                              \
-                       r_hi,r_lo, #name, d, s, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG));       \
-                   printk("0x%08X:0x%08X = %-15s(0x%08X,0x%08X), flags = %s -> %s\n",                              \
-                       r_asm_hi,r_asm_lo, #name"_asm", d, s, print_flags(buf1,inflags), print_flags(buf2,flags));  \
-                   }                                                                                               \
-               M.x86.R_EFLG = inflags = flags = def_flags | (ALL_FLAGS & ~F_OF);   \
-               if (failed)                                                 \
-                   break;                                                  \
-               }                                                           \
-           if (failed)                                                     \
-               break;                                                      \
-           }                                                               \
-       if (failed)                                                         \
-           break;                                                          \
-       }                                                                   \
-    if (!failed)                                                            \
-       printk("passed\n");                                                 \
-}
-
-#define VAL_BYTE_DIV(name)                                              \
-    printk("Validating %s ... ", #name);                                \
-{                                                                       \
-    u16         d,s;                                                    \
-    u8          r_quot,r_rem,r_asm_quot,r_asm_rem;                      \
-       u32         flags,inflags;                                          \
-    int         f,failed = false;                                       \
-    char        buf1[80],buf2[80];                                      \
-    for (d = 0; d < 0xFF00; d += 0x100) {                               \
-       for (s = 1; s < 0xFF; s += 1) {                                 \
-           M.x86.R_EFLG = inflags = flags = def_flags;                 \
-           for (f = 0; f < 2; f++) {                                   \
-               M.x86.intr = 0;                                         \
-               M.x86.R_AX = d;                                         \
-               name(s);                                            \
-               r_quot = M.x86.R_AL;                                    \
-               r_rem = M.x86.R_AH;                                     \
-               if (M.x86.intr & INTR_SYNCH)                            \
-                   continue;                                           \
-               name##_asm(&flags,&r_asm_quot,&r_asm_rem,d,s);          \
-               if (r_quot != r_asm_quot || r_rem != r_asm_rem || M.x86.R_EFLG != flags) \
-                   failed = true;                                      \
-               if (failed || trace) {                                  \
-                   if (failed)                                         \
-                       printk("fail\n");                               \
-                   printk("0x%02X:0x%02X = %-15s(0x%04X,0x%02X), flags = %s -> %s\n",                      \
-                       r_quot, r_rem, #name, d, s, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG));     \
-                   printk("0x%02X:0x%02X = %-15s(0x%04X,0x%02X), flags = %s -> %s\n",                      \
-                       r_asm_quot, r_asm_rem, #name"_asm", d, s, print_flags(buf1,inflags), print_flags(buf2,flags));  \
-                   }                                                       \
-               M.x86.R_EFLG = inflags = flags = def_flags | (ALL_FLAGS & ~F_OF);   \
-               if (failed)                                                 \
-                   break;                                                  \
-               }                                                           \
-           if (failed)                                                     \
-               break;                                                      \
-           }                                                               \
-       if (failed)                                                         \
-           break;                                                          \
-       }                                                                   \
-    if (!failed)                                                            \
-       printk("passed\n");                                                 \
-}
-
-#define VAL_WORD_DIV(name)                                              \
-    printk("Validating %s ... ", #name);                                \
-{                                                                       \
-    u32         d,s;                                                    \
-    u16         r_quot,r_rem,r_asm_quot,r_asm_rem;                      \
-       u32         flags,inflags;                                          \
-    int         f,failed = false;                                       \
-    char        buf1[80],buf2[80];                                      \
-    for (d = 0; d < 0xFF000000; d += 0x1000000) {                       \
-       for (s = 0x100; s < 0xFF00; s += 0x100) {                       \
-           M.x86.R_EFLG = inflags = flags = def_flags;                 \
-           for (f = 0; f < 2; f++) {                                   \
-               M.x86.intr = 0;                                         \
-               M.x86.R_AX = d & 0xFFFF;                                \
-               M.x86.R_DX = d >> 16;                                   \
-               name(s);                                            \
-               r_quot = M.x86.R_AX;                                    \
-               r_rem = M.x86.R_DX;                                     \
-               if (M.x86.intr & INTR_SYNCH)                            \
-                   continue;                                           \
-               name##_asm(&flags,&r_asm_quot,&r_asm_rem,d & 0xFFFF,d >> 16,s);\
-               if (r_quot != r_asm_quot || r_rem != r_asm_rem || M.x86.R_EFLG != flags) \
-                   failed = true;                                      \
-               if (failed || trace) {                                  \
-                   if (failed)                                         \
-                       printk("fail\n");                               \
-                   printk("0x%04X:0x%04X = %-15s(0x%08X,0x%04X), flags = %s -> %s\n",                      \
-                       r_quot, r_rem, #name, d, s, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG));     \
-                   printk("0x%04X:0x%04X = %-15s(0x%08X,0x%04X), flags = %s -> %s\n",                      \
-                       r_asm_quot, r_asm_rem, #name"_asm", d, s, print_flags(buf1,inflags), print_flags(buf2,flags));  \
-                   }                                                       \
-               M.x86.R_EFLG = inflags = flags = def_flags | (ALL_FLAGS & ~F_OF);   \
-               if (failed)                                                 \
-                   break;                                                  \
-               }                                                           \
-           if (failed)                                                     \
-               break;                                                      \
-           }                                                               \
-       if (failed)                                                         \
-           break;                                                          \
-       }                                                                   \
-    if (!failed)                                                            \
-       printk("passed\n");                                                 \
-}
-
-#define VAL_LONG_DIV(name)                                              \
-    printk("Validating %s ... ", #name);                                \
-{                                                                       \
-    u32         d,s;                                                    \
-    u32         r_quot,r_rem,r_asm_quot,r_asm_rem;                      \
-       u32         flags,inflags;                                          \
-    int         f,failed = false;                                       \
-    char        buf1[80],buf2[80];                                      \
-    for (d = 0; d < 0xFF000000; d += 0x1000000) {                       \
-       for (s = 0x100; s < 0xFF00; s += 0x100) {                       \
-           M.x86.R_EFLG = inflags = flags = def_flags;                 \
-           for (f = 0; f < 2; f++) {                                   \
-               M.x86.intr = 0;                                         \
-               M.x86.R_EAX = d;                                        \
-               M.x86.R_EDX = 0;                                        \
-               name(s);                                            \
-               r_quot = M.x86.R_EAX;                                   \
-               r_rem = M.x86.R_EDX;                                    \
-               if (M.x86.intr & INTR_SYNCH)                            \
-                   continue;                                           \
-               name##_asm(&flags,&r_asm_quot,&r_asm_rem,d,0,s);        \
-               if (r_quot != r_asm_quot || r_rem != r_asm_rem || M.x86.R_EFLG != flags) \
-                   failed = true;                                      \
-               if (failed || trace) {                                  \
-                   if (failed)                                         \
-                       printk("fail\n");                               \
-                   printk("0x%08X:0x%08X = %-15s(0x%08X:0x%08X,0x%08X), flags = %s -> %s\n",                       \
-                       r_quot, r_rem, #name, 0, d, s, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG));  \
-                   printk("0x%08X:0x%08X = %-15s(0x%08X:0x%08X,0x%08X), flags = %s -> %s\n",                       \
-                       r_asm_quot, r_asm_rem, #name"_asm", 0, d, s, print_flags(buf1,inflags), print_flags(buf2,flags));   \
-                   }                                                       \
-               M.x86.R_EFLG = inflags = flags = def_flags | (ALL_FLAGS & ~F_OF);   \
-               if (failed)                                                 \
-                   break;                                                  \
-               }                                                           \
-           if (failed)                                                     \
-               break;                                                      \
-           }                                                               \
-       if (failed)                                                         \
-           break;                                                          \
-       }                                                                   \
-    if (!failed)                                                            \
-       printk("passed\n");                                                 \
-}
-
-void printk(const char *fmt, ...)
-{
-    va_list argptr;
-    va_start(argptr, fmt);
-    vfprintf(stdout, fmt, argptr);
-    fflush(stdout);
-    va_end(argptr);
-}
-
-char * print_flags(char *buf,ulong flags)
-{
-    char *separator = "";
-
-    buf[0] = 0;
-    if (flags & F_CF) {
-       strcat(buf,separator);
-       strcat(buf,"CF");
-       separator = ",";
-       }
-    if (flags & F_PF) {
-       strcat(buf,separator);
-       strcat(buf,"PF");
-       separator = ",";
-       }
-    if (flags & F_AF) {
-       strcat(buf,separator);
-       strcat(buf,"AF");
-       separator = ",";
-       }
-    if (flags & F_ZF) {
-       strcat(buf,separator);
-       strcat(buf,"ZF");
-       separator = ",";
-       }
-    if (flags & F_SF) {
-       strcat(buf,separator);
-       strcat(buf,"SF");
-       separator = ",";
-       }
-    if (flags & F_OF) {
-       strcat(buf,separator);
-       strcat(buf,"OF");
-       separator = ",";
-       }
-    if (separator[0] == 0)
-       strcpy(buf,"None");
-    return buf;
-}
-
-int main(int argc)
-{
-    ulong   def_flags;
-    int trace = false;
-
-    if (argc > 1)
-       trace = true;
-    memset(&M, 0, sizeof(M));
-    def_flags = get_flags_asm() & ~ALL_FLAGS;
-
-    VAL_WORD_UNARY(aaa_word);
-    VAL_WORD_UNARY(aas_word);
-
-    VAL_WORD_UNARY(aad_word);
-    VAL_WORD_UNARY(aam_word);
-
-    VAL_BYTE_BYTE_BINARY(adc_byte);
-    VAL_WORD_WORD_BINARY(adc_word);
-    VAL_LONG_LONG_BINARY(adc_long);
-
-    VAL_BYTE_BYTE_BINARY(add_byte);
-    VAL_WORD_WORD_BINARY(add_word);
-    VAL_LONG_LONG_BINARY(add_long);
-
-    VAL_BYTE_BYTE_BINARY(and_byte);
-    VAL_WORD_WORD_BINARY(and_word);
-    VAL_LONG_LONG_BINARY(and_long);
-
-    VAL_BYTE_BYTE_BINARY(cmp_byte);
-    VAL_WORD_WORD_BINARY(cmp_word);
-    VAL_LONG_LONG_BINARY(cmp_long);
-
-    VAL_BYTE_UNARY(daa_byte);
-    VAL_BYTE_UNARY(das_byte);   /* Fails for 0x9A (out of range anyway) */
-
-    VAL_BYTE_UNARY(dec_byte);
-    VAL_WORD_UNARY(dec_word);
-    VAL_LONG_UNARY(dec_long);
-
-    VAL_BYTE_UNARY(inc_byte);
-    VAL_WORD_UNARY(inc_word);
-    VAL_LONG_UNARY(inc_long);
-
-    VAL_BYTE_BYTE_BINARY(or_byte);
-    VAL_WORD_WORD_BINARY(or_word);
-    VAL_LONG_LONG_BINARY(or_long);
-
-    VAL_BYTE_UNARY(neg_byte);
-    VAL_WORD_UNARY(neg_word);
-    VAL_LONG_UNARY(neg_long);
-
-    VAL_BYTE_UNARY(not_byte);
-    VAL_WORD_UNARY(not_word);
-    VAL_LONG_UNARY(not_long);
-
-    VAL_BYTE_ROTATE(rcl_byte);
-    VAL_WORD_ROTATE(rcl_word);
-    VAL_LONG_ROTATE(rcl_long);
-
-    VAL_BYTE_ROTATE(rcr_byte);
-    VAL_WORD_ROTATE(rcr_word);
-    VAL_LONG_ROTATE(rcr_long);
-
-    VAL_BYTE_ROTATE(rol_byte);
-    VAL_WORD_ROTATE(rol_word);
-    VAL_LONG_ROTATE(rol_long);
-
-    VAL_BYTE_ROTATE(ror_byte);
-    VAL_WORD_ROTATE(ror_word);
-    VAL_LONG_ROTATE(ror_long);
-
-    VAL_BYTE_ROTATE(shl_byte);
-    VAL_WORD_ROTATE(shl_word);
-    VAL_LONG_ROTATE(shl_long);
-
-    VAL_BYTE_ROTATE(shr_byte);
-    VAL_WORD_ROTATE(shr_word);
-    VAL_LONG_ROTATE(shr_long);
-
-    VAL_BYTE_ROTATE(sar_byte);
-    VAL_WORD_ROTATE(sar_word);
-    VAL_LONG_ROTATE(sar_long);
-
-    VAL_WORD_ROTATE_DBL(shld_word);
-    VAL_LONG_ROTATE_DBL(shld_long);
-
-    VAL_WORD_ROTATE_DBL(shrd_word);
-    VAL_LONG_ROTATE_DBL(shrd_long);
-
-    VAL_BYTE_BYTE_BINARY(sbb_byte);
-    VAL_WORD_WORD_BINARY(sbb_word);
-    VAL_LONG_LONG_BINARY(sbb_long);
-
-    VAL_BYTE_BYTE_BINARY(sub_byte);
-    VAL_WORD_WORD_BINARY(sub_word);
-    VAL_LONG_LONG_BINARY(sub_long);
-
-    VAL_BYTE_BYTE_BINARY(xor_byte);
-    VAL_WORD_WORD_BINARY(xor_word);
-    VAL_LONG_LONG_BINARY(xor_long);
-
-    VAL_VOID_BYTE_BINARY(test_byte);
-    VAL_VOID_WORD_BINARY(test_word);
-    VAL_VOID_LONG_BINARY(test_long);
-
-    VAL_BYTE_MUL(imul_byte);
-    VAL_WORD_MUL(imul_word);
-    VAL_LONG_MUL(imul_long);
-
-    VAL_BYTE_MUL(mul_byte);
-    VAL_WORD_MUL(mul_word);
-    VAL_LONG_MUL(mul_long);
-
-    VAL_BYTE_DIV(idiv_byte);
-    VAL_WORD_DIV(idiv_word);
-    VAL_LONG_DIV(idiv_long);
-
-    VAL_BYTE_DIV(div_byte);
-    VAL_WORD_DIV(div_word);
-    VAL_LONG_DIV(div_long);
-
-    return 0;
-}
diff --git a/board/MAI/bios_emulator/scitech/src/x86emu/x86emu/debug.h b/board/MAI/bios_emulator/scitech/src/x86emu/x86emu/debug.h
deleted file mode 100644 (file)
index 9a4a096..0000000
+++ /dev/null
@@ -1,210 +0,0 @@
-/****************************************************************************
-*
-*                                              Realmode X86 Emulator Library
-*
-*              Copyright (C) 1996-1999 SciTech Software, Inc.
-*                                   Copyright (C) David Mosberger-Tang
-*                                         Copyright (C) 1999 Egbert Eich
-*
-*  ========================================================================
-*
-*  Permission to use, copy, modify, distribute, and sell this software and
-*  its documentation for any purpose is hereby granted without fee,
-*  provided that the above copyright notice appear in all copies and that
-*  both that copyright notice and this permission notice appear in
-*  supporting documentation, and that the name of the authors not be used
-*  in advertising or publicity pertaining to distribution of the software
-*  without specific, written prior permission.  The authors makes no
-*  representations about the suitability of this software for any purpose.
-*  It is provided "as is" without express or implied warranty.
-*
-*  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-*  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-*  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-*  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-*  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-*  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-*  PERFORMANCE OF THIS SOFTWARE.
-*
-*  ========================================================================
-*
-* Language:            ANSI C
-* Environment: Any
-* Developer:    Kendall Bennett
-*
-* Description:  Header file for debug definitions.
-*
-****************************************************************************/
-
-#ifndef __X86EMU_DEBUG_H
-#define __X86EMU_DEBUG_H
-
-/*---------------------- Macros and type definitions ----------------------*/
-
-/* checks to be enabled for "runtime" */
-
-#define CHECK_IP_FETCH_F                0x1
-#define CHECK_SP_ACCESS_F               0x2
-#define CHECK_MEM_ACCESS_F              0x4 /*using regular linear pointer */
-#define CHECK_DATA_ACCESS_F             0x8 /*using segment:offset*/
-
-#ifdef DEBUG
-# define CHECK_IP_FETCH()                      (M.x86.check & CHECK_IP_FETCH_F)
-# define CHECK_SP_ACCESS()                     (M.x86.check & CHECK_SP_ACCESS_F)
-# define CHECK_MEM_ACCESS()                    (M.x86.check & CHECK_MEM_ACCESS_F)
-# define CHECK_DATA_ACCESS()                   (M.x86.check & CHECK_DATA_ACCESS_F)
-#else
-# define CHECK_IP_FETCH()
-# define CHECK_SP_ACCESS()
-# define CHECK_MEM_ACCESS()
-# define CHECK_DATA_ACCESS()
-#endif
-
-#ifdef DEBUG
-# define DEBUG_INSTRUMENT()            (M.x86.debug & DEBUG_INSTRUMENT_F)
-# define DEBUG_DECODE()                (M.x86.debug & DEBUG_DECODE_F)
-# define DEBUG_TRACE()                 (M.x86.debug & DEBUG_TRACE_F)
-# define DEBUG_STEP()                  (M.x86.debug & DEBUG_STEP_F)
-# define DEBUG_DISASSEMBLE()           (M.x86.debug & DEBUG_DISASSEMBLE_F)
-# define DEBUG_BREAK()                 (M.x86.debug & DEBUG_BREAK_F)
-# define DEBUG_SVC()                   (M.x86.debug & DEBUG_SVC_F)
-# define DEBUG_SAVE_IP_CS()     (M.x86.debug & DEBUG_SAVE_CS_IP)
-
-# define DEBUG_FS()                    (M.x86.debug & DEBUG_FS_F)
-# define DEBUG_PROC()                  (M.x86.debug & DEBUG_PROC_F)
-# define DEBUG_SYSINT()                (M.x86.debug & DEBUG_SYSINT_F)
-# define DEBUG_TRACECALL()             (M.x86.debug & DEBUG_TRACECALL_F)
-# define DEBUG_TRACECALLREGS()         (M.x86.debug & DEBUG_TRACECALL_REGS_F)
-# define DEBUG_SYS()                   (M.x86.debug & DEBUG_SYS_F)
-# define DEBUG_MEM_TRACE()             (M.x86.debug & DEBUG_MEM_TRACE_F)
-# define DEBUG_IO_TRACE()              (M.x86.debug & DEBUG_IO_TRACE_F)
-# define DEBUG_DECODE_NOPRINT() (M.x86.debug & DEBUG_DECODE_NOPRINT_F)
-#else
-# define DEBUG_INSTRUMENT()            0
-# define DEBUG_DECODE()                0
-# define DEBUG_TRACE()                 0
-# define DEBUG_STEP()                  0
-# define DEBUG_DISASSEMBLE()           0
-# define DEBUG_BREAK()                 0
-# define DEBUG_SVC()                   0
-# define DEBUG_SAVE_IP_CS()     0
-# define DEBUG_FS()                    0
-# define DEBUG_PROC()                  0
-# define DEBUG_SYSINT()                0
-# define DEBUG_TRACECALL()             0
-# define DEBUG_TRACECALLREGS()         0
-# define DEBUG_SYS()                   0
-# define DEBUG_MEM_TRACE()             0
-# define DEBUG_IO_TRACE()              0
-# define DEBUG_DECODE_NOPRINT() 0
-#endif
-
-#ifdef DEBUG
-
-# define DECODE_PRINTF(x)      if (DEBUG_DECODE()) \
-                                                                       x86emu_decode_printf(x)
-# define DECODE_PRINTF2(x,y)   if (DEBUG_DECODE()) \
-                                                                       x86emu_decode_printf2(x,y)
-
-/*
- * The following allow us to look at the bytes of an instruction.  The
- * first INCR_INSTRN_LEN, is called everytime bytes are consumed in
- * the decoding process.  The SAVE_IP_CS is called initially when the
- * major opcode of the instruction is accessed.
- */
-#define INC_DECODED_INST_LEN(x)                        \
-       if (DEBUG_DECODE())                             \
-               x86emu_inc_decoded_inst_len(x)
-
-#define SAVE_IP_CS(x,y)                                                \
-       if (DEBUG_DECODE() | DEBUG_TRACECALL() | DEBUG_BREAK() \
-             | DEBUG_IO_TRACE() | DEBUG_SAVE_IP_CS()) { \
-               M.x86.saved_cs = x;                                             \
-               M.x86.saved_ip = y;                                             \
-       }
-#else
-# define INC_DECODED_INST_LEN(x)
-# define DECODE_PRINTF(x)
-# define DECODE_PRINTF2(x,y)
-# define SAVE_IP_CS(x,y)
-#endif
-
-#ifdef DEBUG
-#define TRACE_REGS()                                                   \
-       if (DEBUG_DISASSEMBLE()) {                                      \
-               x86emu_just_disassemble();                              \
-               goto EndOfTheInstructionProcedure;                      \
-       }                                                       \
-       if (DEBUG_TRACE() || DEBUG_DECODE()) X86EMU_trace_regs()
-#else
-# define TRACE_REGS()
-#endif
-
-#ifdef DEBUG
-# define SINGLE_STEP()         if (DEBUG_STEP()) x86emu_single_step()
-#else
-# define SINGLE_STEP()
-#endif
-
-#define TRACE_AND_STEP()       \
-       TRACE_REGS();                   \
-       SINGLE_STEP()
-
-#ifdef DEBUG
-# define START_OF_INSTR()
-# define END_OF_INSTR()                EndOfTheInstructionProcedure: x86emu_end_instr();
-# define END_OF_INSTR_NO_TRACE()       x86emu_end_instr();
-#else
-# define START_OF_INSTR()
-# define END_OF_INSTR()
-# define END_OF_INSTR_NO_TRACE()
-#endif
-
-#ifdef DEBUG
-# define  CALL_TRACE(u,v,w,x,s)                                 \
-       if (DEBUG_TRACECALLREGS())                                                                      \
-               x86emu_dump_regs();                                     \
-       if (DEBUG_TRACECALL())                                          \
-               printk("%04x:%04x: CALL %s%04x:%04x\n", u , v, s, w, x);
-# define RETURN_TRACE(n,u,v)                                    \
-       if (DEBUG_TRACECALLREGS())                                                                      \
-               x86emu_dump_regs();                                     \
-       if (DEBUG_TRACECALL())                                          \
-               printk("%04x:%04x: %s\n",u,v,n);
-#else
-# define CALL_TRACE(u,v,w,x,s)
-# define RETURN_TRACE(n,u,v)
-#endif
-
-#ifdef DEBUG
-#define        DB(x)   x
-#else
-#define        DB(x)
-#endif
-
-/*-------------------------- Function Prototypes --------------------------*/
-
-#ifdef  __cplusplus
-extern "C" {                                   /* Use "C" linkage when in C++ mode */
-#endif
-
-extern void x86emu_inc_decoded_inst_len (int x);
-extern void x86emu_decode_printf (char *x);
-extern void x86emu_decode_printf2 (char *x, int y);
-extern void x86emu_just_disassemble (void);
-extern void x86emu_single_step (void);
-extern void x86emu_end_instr (void);
-extern void x86emu_dump_regs (void);
-extern void x86emu_dump_xregs (void);
-extern void x86emu_print_int_vect (u16 iv);
-extern void x86emu_instrument_instruction (void);
-extern void x86emu_check_ip_access (void);
-extern void x86emu_check_sp_access (void);
-extern void x86emu_check_mem_access (u32 p);
-extern void x86emu_check_data_access (uint s, uint o);
-
-#ifdef  __cplusplus
-}                                              /* End of "C" linkage for C++           */
-#endif
-
-#endif /* __X86EMU_DEBUG_H */
diff --git a/board/MAI/bios_emulator/scitech/src/x86emu/x86emu/decode.h b/board/MAI/bios_emulator/scitech/src/x86emu/x86emu/decode.h
deleted file mode 100644 (file)
index 321a345..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-/****************************************************************************
-*
-*                                              Realmode X86 Emulator Library
-*
-*              Copyright (C) 1996-1999 SciTech Software, Inc.
-*                                   Copyright (C) David Mosberger-Tang
-*                                         Copyright (C) 1999 Egbert Eich
-*
-*  ========================================================================
-*
-*  Permission to use, copy, modify, distribute, and sell this software and
-*  its documentation for any purpose is hereby granted without fee,
-*  provided that the above copyright notice appear in all copies and that
-*  both that copyright notice and this permission notice appear in
-*  supporting documentation, and that the name of the authors not be used
-*  in advertising or publicity pertaining to distribution of the software
-*  without specific, written prior permission.  The authors makes no
-*  representations about the suitability of this software for any purpose.
-*  It is provided "as is" without express or implied warranty.
-*
-*  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-*  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-*  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-*  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-*  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-*  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-*  PERFORMANCE OF THIS SOFTWARE.
-*
-*  ========================================================================
-*
-* Language:            ANSI C
-* Environment: Any
-* Developer:    Kendall Bennett
-*
-* Description:  Header file for instruction decoding logic.
-*
-****************************************************************************/
-
-#ifndef __X86EMU_DECODE_H
-#define __X86EMU_DECODE_H
-
-/*---------------------- Macros and type definitions ----------------------*/
-
-/* Instruction Decoding Stuff */
-
-#define FETCH_DECODE_MODRM(mod,rh,rl)  fetch_decode_modrm(&mod,&rh,&rl)
-#define DECODE_RM_BYTE_REGISTER(r)     decode_rm_byte_register(r)
-#define DECODE_RM_WORD_REGISTER(r)     decode_rm_word_register(r)
-#define DECODE_RM_LONG_REGISTER(r)     decode_rm_long_register(r)
-#define DECODE_CLEAR_SEGOVR()          M.x86.mode &= ~SYSMODE_CLRMASK
-
-/*-------------------------- Function Prototypes --------------------------*/
-
-#ifdef  __cplusplus
-extern "C" {                                   /* Use "C" linkage when in C++ mode */
-#endif
-
-void   x86emu_intr_raise (u8 type);
-void    fetch_decode_modrm (int *mod,int *regh,int *regl);
-u8      fetch_byte_imm (void);
-u16     fetch_word_imm (void);
-u32     fetch_long_imm (void);
-u8      fetch_data_byte (uint offset);
-u8      fetch_data_byte_abs (uint segment, uint offset);
-u16     fetch_data_word (uint offset);
-u16     fetch_data_word_abs (uint segment, uint offset);
-u32     fetch_data_long (uint offset);
-u32     fetch_data_long_abs (uint segment, uint offset);
-void    store_data_byte (uint offset, u8 val);
-void    store_data_byte_abs (uint segment, uint offset, u8 val);
-void    store_data_word (uint offset, u16 val);
-void    store_data_word_abs (uint segment, uint offset, u16 val);
-void    store_data_long (uint offset, u32 val);
-void    store_data_long_abs (uint segment, uint offset, u32 val);
-u8*    decode_rm_byte_register(int reg);
-u16*   decode_rm_word_register(int reg);
-u32*   decode_rm_long_register(int reg);
-u16*   decode_rm_seg_register(int reg);
-unsigned decode_rm00_address(int rm);
-unsigned decode_rm01_address(int rm);
-unsigned decode_rm10_address(int rm);
-
-#ifdef  __cplusplus
-}                                              /* End of "C" linkage for C++           */
-#endif
-
-#endif /* __X86EMU_DECODE_H */
diff --git a/board/MAI/bios_emulator/scitech/src/x86emu/x86emu/fpu.h b/board/MAI/bios_emulator/scitech/src/x86emu/x86emu/fpu.h
deleted file mode 100644 (file)
index 5fb2714..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/****************************************************************************
-*
-*                                              Realmode X86 Emulator Library
-*
-*              Copyright (C) 1996-1999 SciTech Software, Inc.
-*                                   Copyright (C) David Mosberger-Tang
-*                                         Copyright (C) 1999 Egbert Eich
-*
-*  ========================================================================
-*
-*  Permission to use, copy, modify, distribute, and sell this software and
-*  its documentation for any purpose is hereby granted without fee,
-*  provided that the above copyright notice appear in all copies and that
-*  both that copyright notice and this permission notice appear in
-*  supporting documentation, and that the name of the authors not be used
-*  in advertising or publicity pertaining to distribution of the software
-*  without specific, written prior permission.  The authors makes no
-*  representations about the suitability of this software for any purpose.
-*  It is provided "as is" without express or implied warranty.
-*
-*  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-*  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-*  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-*  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-*  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-*  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-*  PERFORMANCE OF THIS SOFTWARE.
-*
-*  ========================================================================
-*
-* Language:            ANSI C
-* Environment: Any
-* Developer:    Kendall Bennett
-*
-* Description:  Header file for FPU instruction decoding.
-*
-****************************************************************************/
-
-#ifndef __X86EMU_FPU_H
-#define __X86EMU_FPU_H
-
-#ifdef  __cplusplus
-extern "C" {                                   /* Use "C" linkage when in C++ mode */
-#endif
-
-/* these have to be defined, whether 8087 support compiled in or not. */
-
-extern void x86emuOp_esc_coprocess_d8 (u8 op1);
-extern void x86emuOp_esc_coprocess_d9 (u8 op1);
-extern void x86emuOp_esc_coprocess_da (u8 op1);
-extern void x86emuOp_esc_coprocess_db (u8 op1);
-extern void x86emuOp_esc_coprocess_dc (u8 op1);
-extern void x86emuOp_esc_coprocess_dd (u8 op1);
-extern void x86emuOp_esc_coprocess_de (u8 op1);
-extern void x86emuOp_esc_coprocess_df (u8 op1);
-
-#ifdef  __cplusplus
-}                                              /* End of "C" linkage for C++           */
-#endif
-
-#endif /* __X86EMU_FPU_H */
diff --git a/board/MAI/bios_emulator/scitech/src/x86emu/x86emu/ops.h b/board/MAI/bios_emulator/scitech/src/x86emu/x86emu/ops.h
deleted file mode 100644 (file)
index 65ea676..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/****************************************************************************
-*
-*                                              Realmode X86 Emulator Library
-*
-*              Copyright (C) 1996-1999 SciTech Software, Inc.
-*                                   Copyright (C) David Mosberger-Tang
-*                                         Copyright (C) 1999 Egbert Eich
-*
-*  ========================================================================
-*
-*  Permission to use, copy, modify, distribute, and sell this software and
-*  its documentation for any purpose is hereby granted without fee,
-*  provided that the above copyright notice appear in all copies and that
-*  both that copyright notice and this permission notice appear in
-*  supporting documentation, and that the name of the authors not be used
-*  in advertising or publicity pertaining to distribution of the software
-*  without specific, written prior permission.  The authors makes no
-*  representations about the suitability of this software for any purpose.
-*  It is provided "as is" without express or implied warranty.
-*
-*  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-*  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-*  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-*  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-*  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-*  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-*  PERFORMANCE OF THIS SOFTWARE.
-*
-*  ========================================================================
-*
-* Language:            ANSI C
-* Environment: Any
-* Developer:    Kendall Bennett
-*
-* Description:  Header file for operand decoding functions.
-*
-****************************************************************************/
-
-#ifndef __X86EMU_OPS_H
-#define __X86EMU_OPS_H
-
-extern void (*x86emu_optab[0x100])(u8 op1);
-extern void (*x86emu_optab2[0x100])(u8 op2);
-
-#endif /* __X86EMU_OPS_H */
diff --git a/board/MAI/bios_emulator/scitech/src/x86emu/x86emu/prim_asm.h b/board/MAI/bios_emulator/scitech/src/x86emu/x86emu/prim_asm.h
deleted file mode 100644 (file)
index e023cf8..0000000
+++ /dev/null
@@ -1,970 +0,0 @@
-/****************************************************************************
-*
-*                                              Realmode X86 Emulator Library
-*
-*              Copyright (C) 1996-1999 SciTech Software, Inc.
-*                                   Copyright (C) David Mosberger-Tang
-*                                         Copyright (C) 1999 Egbert Eich
-*
-*  ========================================================================
-*
-*  Permission to use, copy, modify, distribute, and sell this software and
-*  its documentation for any purpose is hereby granted without fee,
-*  provided that the above copyright notice appear in all copies and that
-*  both that copyright notice and this permission notice appear in
-*  supporting documentation, and that the name of the authors not be used
-*  in advertising or publicity pertaining to distribution of the software
-*  without specific, written prior permission.  The authors makes no
-*  representations about the suitability of this software for any purpose.
-*  It is provided "as is" without express or implied warranty.
-*
-*  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-*  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-*  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-*  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-*  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-*  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-*  PERFORMANCE OF THIS SOFTWARE.
-*
-*  ========================================================================
-*
-* Language:            Watcom C++ 10.6 or later
-* Environment: Any
-* Developer:    Kendall Bennett
-*
-* Description:  Inline assembler versions of the primitive operand
-*                              functions for faster performance. At the moment this is
-*                              x86 inline assembler, but these functions could be replaced
-*                              with native inline assembler for each supported processor
-*                              platform.
-*
-****************************************************************************/
-
-#ifndef        __X86EMU_PRIM_ASM_H
-#define        __X86EMU_PRIM_ASM_H
-
-#ifdef __WATCOMC__
-
-#ifndef        VALIDATE
-#define        __HAVE_INLINE_ASSEMBLER__
-#endif
-
-u32            get_flags_asm(void);
-#pragma aux get_flags_asm =                    \
-       "pushf"                         \
-       "pop    eax"                    \
-       value [eax]                     \
-       modify exact [eax];
-
-u16     aaa_word_asm(u32 *flags,u16 d);
-#pragma aux aaa_word_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "aaa"                                   \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [ax]                                 \
-       value [ax]                      \
-       modify exact [ax];
-
-u16     aas_word_asm(u32 *flags,u16 d);
-#pragma aux aas_word_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "aas"                                   \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [ax]                                 \
-       value [ax]                      \
-       modify exact [ax];
-
-u16     aad_word_asm(u32 *flags,u16 d);
-#pragma aux aad_word_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "aad"                                   \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [ax]                                 \
-       value [ax]                      \
-       modify exact [ax];
-
-u16     aam_word_asm(u32 *flags,u8 d);
-#pragma aux aam_word_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "aam"                                   \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [al]                                 \
-       value [ax]                      \
-       modify exact [ax];
-
-u8      adc_byte_asm(u32 *flags,u8 d, u8 s);
-#pragma aux adc_byte_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "adc    al,bl"                  \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [al] [bl]            \
-       value [al]                      \
-       modify exact [al bl];
-
-u16     adc_word_asm(u32 *flags,u16 d, u16 s);
-#pragma aux adc_word_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "adc    ax,bx"                  \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [ax] [bx]            \
-       value [ax]                      \
-       modify exact [ax bx];
-
-u32     adc_long_asm(u32 *flags,u32 d, u32 s);
-#pragma aux adc_long_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "adc    eax,ebx"                \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [eax] [ebx]          \
-       value [eax]                     \
-       modify exact [eax ebx];
-
-u8      add_byte_asm(u32 *flags,u8 d, u8 s);
-#pragma aux add_byte_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "add    al,bl"                  \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [al] [bl]            \
-       value [al]                      \
-       modify exact [al bl];
-
-u16     add_word_asm(u32 *flags,u16 d, u16 s);
-#pragma aux add_word_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "add    ax,bx"                  \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [ax] [bx]            \
-       value [ax]                      \
-       modify exact [ax bx];
-
-u32     add_long_asm(u32 *flags,u32 d, u32 s);
-#pragma aux add_long_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "add    eax,ebx"                \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [eax] [ebx]          \
-       value [eax]                     \
-       modify exact [eax ebx];
-
-u8      and_byte_asm(u32 *flags,u8 d, u8 s);
-#pragma aux and_byte_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "and    al,bl"                  \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [al] [bl]            \
-       value [al]                      \
-       modify exact [al bl];
-
-u16     and_word_asm(u32 *flags,u16 d, u16 s);
-#pragma aux and_word_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "and    ax,bx"                  \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [ax] [bx]            \
-       value [ax]                      \
-       modify exact [ax bx];
-
-u32     and_long_asm(u32 *flags,u32 d, u32 s);
-#pragma aux and_long_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "and    eax,ebx"                \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [eax] [ebx]          \
-       value [eax]                     \
-       modify exact [eax ebx];
-
-u8      cmp_byte_asm(u32 *flags,u8 d, u8 s);
-#pragma aux cmp_byte_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "cmp    al,bl"                  \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [al] [bl]            \
-       value [al]                      \
-       modify exact [al bl];
-
-u16     cmp_word_asm(u32 *flags,u16 d, u16 s);
-#pragma aux cmp_word_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "cmp    ax,bx"                  \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [ax] [bx]            \
-       value [ax]                      \
-       modify exact [ax bx];
-
-u32     cmp_long_asm(u32 *flags,u32 d, u32 s);
-#pragma aux cmp_long_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "cmp    eax,ebx"                \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [eax] [ebx]          \
-       value [eax]                     \
-       modify exact [eax ebx];
-
-u8      daa_byte_asm(u32 *flags,u8 d);
-#pragma aux daa_byte_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "daa"                                   \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [al]                         \
-       value [al]                      \
-       modify exact [al];
-
-u8      das_byte_asm(u32 *flags,u8 d);
-#pragma aux das_byte_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "das"                                   \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [al]                         \
-       value [al]                      \
-       modify exact [al];
-
-u8      dec_byte_asm(u32 *flags,u8 d);
-#pragma aux dec_byte_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "dec    al"                     \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [al]                         \
-       value [al]                      \
-       modify exact [al];
-
-u16     dec_word_asm(u32 *flags,u16 d);
-#pragma aux dec_word_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "dec    ax"                     \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [ax]                         \
-       value [ax]                      \
-       modify exact [ax];
-
-u32     dec_long_asm(u32 *flags,u32 d);
-#pragma aux dec_long_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "dec    eax"                    \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [eax]                        \
-       value [eax]                     \
-       modify exact [eax];
-
-u8      inc_byte_asm(u32 *flags,u8 d);
-#pragma aux inc_byte_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "inc    al"                     \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [al]                         \
-       value [al]                      \
-       modify exact [al];
-
-u16     inc_word_asm(u32 *flags,u16 d);
-#pragma aux inc_word_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "inc    ax"                     \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [ax]                         \
-       value [ax]                      \
-       modify exact [ax];
-
-u32     inc_long_asm(u32 *flags,u32 d);
-#pragma aux inc_long_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "inc    eax"                    \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [eax]                        \
-       value [eax]                     \
-       modify exact [eax];
-
-u8      or_byte_asm(u32 *flags,u8 d, u8 s);
-#pragma aux or_byte_asm =                      \
-       "push   [edi]"                          \
-       "popf"                          \
-       "or     al,bl"                          \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [al] [bl]            \
-       value [al]                      \
-       modify exact [al bl];
-
-u16     or_word_asm(u32 *flags,u16 d, u16 s);
-#pragma aux or_word_asm =                      \
-       "push   [edi]"                          \
-       "popf"                          \
-       "or     ax,bx"                          \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [ax] [bx]            \
-       value [ax]                      \
-       modify exact [ax bx];
-
-u32     or_long_asm(u32 *flags,u32 d, u32 s);
-#pragma aux or_long_asm =                      \
-       "push   [edi]"                          \
-       "popf"                          \
-       "or     eax,ebx"                        \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [eax] [ebx]          \
-       value [eax]                     \
-       modify exact [eax ebx];
-
-u8      neg_byte_asm(u32 *flags,u8 d);
-#pragma aux neg_byte_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "neg    al"                     \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [al]                         \
-       value [al]                      \
-       modify exact [al];
-
-u16     neg_word_asm(u32 *flags,u16 d);
-#pragma aux neg_word_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "neg    ax"                     \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [ax]                         \
-       value [ax]                      \
-       modify exact [ax];
-
-u32     neg_long_asm(u32 *flags,u32 d);
-#pragma aux neg_long_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "neg    eax"                    \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [eax]                        \
-       value [eax]                     \
-       modify exact [eax];
-
-u8      not_byte_asm(u32 *flags,u8 d);
-#pragma aux not_byte_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "not    al"                     \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [al]                         \
-       value [al]                      \
-       modify exact [al];
-
-u16     not_word_asm(u32 *flags,u16 d);
-#pragma aux not_word_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "not    ax"                     \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [ax]                         \
-       value [ax]                      \
-       modify exact [ax];
-
-u32     not_long_asm(u32 *flags,u32 d);
-#pragma aux not_long_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "not    eax"                    \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [eax]                        \
-       value [eax]                     \
-       modify exact [eax];
-
-u8      rcl_byte_asm(u32 *flags,u8 d, u8 s);
-#pragma aux rcl_byte_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "rcl    al,cl"                  \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [al] [cl]            \
-       value [al]                      \
-       modify exact [al cl];
-
-u16     rcl_word_asm(u32 *flags,u16 d, u8 s);
-#pragma aux rcl_word_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "rcl    ax,cl"                  \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [ax] [cl]            \
-       value [ax]                      \
-       modify exact [ax cl];
-
-u32     rcl_long_asm(u32 *flags,u32 d, u8 s);
-#pragma aux rcl_long_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "rcl    eax,cl"                 \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [eax] [cl]           \
-       value [eax]                     \
-       modify exact [eax cl];
-
-u8      rcr_byte_asm(u32 *flags,u8 d, u8 s);
-#pragma aux rcr_byte_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "rcr    al,cl"                  \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [al] [cl]            \
-       value [al]                      \
-       modify exact [al cl];
-
-u16     rcr_word_asm(u32 *flags,u16 d, u8 s);
-#pragma aux rcr_word_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "rcr    ax,cl"                  \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [ax] [cl]            \
-       value [ax]                      \
-       modify exact [ax cl];
-
-u32     rcr_long_asm(u32 *flags,u32 d, u8 s);
-#pragma aux rcr_long_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "rcr    eax,cl"                 \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [eax] [cl]           \
-       value [eax]                     \
-       modify exact [eax cl];
-
-u8      rol_byte_asm(u32 *flags,u8 d, u8 s);
-#pragma aux rol_byte_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "rol    al,cl"                  \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [al] [cl]            \
-       value [al]                      \
-       modify exact [al cl];
-
-u16     rol_word_asm(u32 *flags,u16 d, u8 s);
-#pragma aux rol_word_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "rol    ax,cl"                  \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [ax] [cl]            \
-       value [ax]                      \
-       modify exact [ax cl];
-
-u32     rol_long_asm(u32 *flags,u32 d, u8 s);
-#pragma aux rol_long_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "rol    eax,cl"                 \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [eax] [cl]           \
-       value [eax]                     \
-       modify exact [eax cl];
-
-u8      ror_byte_asm(u32 *flags,u8 d, u8 s);
-#pragma aux ror_byte_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "ror    al,cl"                  \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [al] [cl]            \
-       value [al]                      \
-       modify exact [al cl];
-
-u16     ror_word_asm(u32 *flags,u16 d, u8 s);
-#pragma aux ror_word_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "ror    ax,cl"                  \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [ax] [cl]            \
-       value [ax]                      \
-       modify exact [ax cl];
-
-u32     ror_long_asm(u32 *flags,u32 d, u8 s);
-#pragma aux ror_long_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "ror    eax,cl"                 \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [eax] [cl]           \
-       value [eax]                     \
-       modify exact [eax cl];
-
-u8      shl_byte_asm(u32 *flags,u8 d, u8 s);
-#pragma aux shl_byte_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "shl    al,cl"                  \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [al] [cl]            \
-       value [al]                      \
-       modify exact [al cl];
-
-u16     shl_word_asm(u32 *flags,u16 d, u8 s);
-#pragma aux shl_word_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "shl    ax,cl"                  \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [ax] [cl]            \
-       value [ax]                      \
-       modify exact [ax cl];
-
-u32     shl_long_asm(u32 *flags,u32 d, u8 s);
-#pragma aux shl_long_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "shl    eax,cl"                 \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [eax] [cl]           \
-       value [eax]                     \
-       modify exact [eax cl];
-
-u8      shr_byte_asm(u32 *flags,u8 d, u8 s);
-#pragma aux shr_byte_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "shr    al,cl"                  \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [al] [cl]            \
-       value [al]                      \
-       modify exact [al cl];
-
-u16     shr_word_asm(u32 *flags,u16 d, u8 s);
-#pragma aux shr_word_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "shr    ax,cl"                  \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [ax] [cl]            \
-       value [ax]                      \
-       modify exact [ax cl];
-
-u32     shr_long_asm(u32 *flags,u32 d, u8 s);
-#pragma aux shr_long_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "shr    eax,cl"                 \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [eax] [cl]           \
-       value [eax]                     \
-       modify exact [eax cl];
-
-u8      sar_byte_asm(u32 *flags,u8 d, u8 s);
-#pragma aux sar_byte_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "sar    al,cl"                  \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [al] [cl]            \
-       value [al]                      \
-       modify exact [al cl];
-
-u16     sar_word_asm(u32 *flags,u16 d, u8 s);
-#pragma aux sar_word_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "sar    ax,cl"                  \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [ax] [cl]            \
-       value [ax]                      \
-       modify exact [ax cl];
-
-u32     sar_long_asm(u32 *flags,u32 d, u8 s);
-#pragma aux sar_long_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "sar    eax,cl"                 \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [eax] [cl]           \
-       value [eax]                     \
-       modify exact [eax cl];
-
-u16            shld_word_asm(u32 *flags,u16 d, u16 fill, u8 s);
-#pragma aux shld_word_asm =                    \
-       "push   [edi]"                          \
-       "popf"                          \
-       "shld   ax,dx,cl"               \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [ax] [dx] [cl]       \
-       value [ax]                      \
-       modify exact [ax dx cl];
-
-u32     shld_long_asm(u32 *flags,u32 d, u32 fill, u8 s);
-#pragma aux shld_long_asm =                    \
-       "push   [edi]"                          \
-       "popf"                          \
-       "shld   eax,edx,cl"             \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [eax] [edx] [cl]     \
-       value [eax]                     \
-       modify exact [eax edx cl];
-
-u16            shrd_word_asm(u32 *flags,u16 d, u16 fill, u8 s);
-#pragma aux shrd_word_asm =                    \
-       "push   [edi]"                          \
-       "popf"                          \
-       "shrd   ax,dx,cl"               \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [ax] [dx] [cl]       \
-       value [ax]                      \
-       modify exact [ax dx cl];
-
-u32     shrd_long_asm(u32 *flags,u32 d, u32 fill, u8 s);
-#pragma aux shrd_long_asm =                    \
-       "push   [edi]"                          \
-       "popf"                          \
-       "shrd   eax,edx,cl"             \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [eax] [edx] [cl]     \
-       value [eax]                     \
-       modify exact [eax edx cl];
-
-u8      sbb_byte_asm(u32 *flags,u8 d, u8 s);
-#pragma aux sbb_byte_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "sbb    al,bl"                  \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [al] [bl]            \
-       value [al]                      \
-       modify exact [al bl];
-
-u16     sbb_word_asm(u32 *flags,u16 d, u16 s);
-#pragma aux sbb_word_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "sbb    ax,bx"                  \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [ax] [bx]            \
-       value [ax]                      \
-       modify exact [ax bx];
-
-u32     sbb_long_asm(u32 *flags,u32 d, u32 s);
-#pragma aux sbb_long_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "sbb    eax,ebx"                \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [eax] [ebx]          \
-       value [eax]                     \
-       modify exact [eax ebx];
-
-u8      sub_byte_asm(u32 *flags,u8 d, u8 s);
-#pragma aux sub_byte_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "sub    al,bl"                  \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [al] [bl]            \
-       value [al]                      \
-       modify exact [al bl];
-
-u16     sub_word_asm(u32 *flags,u16 d, u16 s);
-#pragma aux sub_word_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "sub    ax,bx"                  \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [ax] [bx]            \
-       value [ax]                      \
-       modify exact [ax bx];
-
-u32     sub_long_asm(u32 *flags,u32 d, u32 s);
-#pragma aux sub_long_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "sub    eax,ebx"                \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [eax] [ebx]          \
-       value [eax]                     \
-       modify exact [eax ebx];
-
-void   test_byte_asm(u32 *flags,u8 d, u8 s);
-#pragma aux test_byte_asm =                    \
-       "push   [edi]"                          \
-       "popf"                          \
-       "test   al,bl"                  \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [al] [bl]            \
-       modify exact [al bl];
-
-void   test_word_asm(u32 *flags,u16 d, u16 s);
-#pragma aux test_word_asm =                    \
-       "push   [edi]"                          \
-       "popf"                          \
-       "test   ax,bx"                  \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [ax] [bx]            \
-       modify exact [ax bx];
-
-void   test_long_asm(u32 *flags,u32 d, u32 s);
-#pragma aux test_long_asm =                    \
-       "push   [edi]"                          \
-       "popf"                          \
-       "test   eax,ebx"                \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [eax] [ebx]          \
-       modify exact [eax ebx];
-
-u8      xor_byte_asm(u32 *flags,u8 d, u8 s);
-#pragma aux xor_byte_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "xor    al,bl"                  \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [al] [bl]            \
-       value [al]                      \
-       modify exact [al bl];
-
-u16     xor_word_asm(u32 *flags,u16 d, u16 s);
-#pragma aux xor_word_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "xor    ax,bx"                  \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [ax] [bx]            \
-       value [ax]                      \
-       modify exact [ax bx];
-
-u32     xor_long_asm(u32 *flags,u32 d, u32 s);
-#pragma aux xor_long_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "xor    eax,ebx"                \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       parm [edi] [eax] [ebx]          \
-       value [eax]                     \
-       modify exact [eax ebx];
-
-void    imul_byte_asm(u32 *flags,u16 *ax,u8 d,u8 s);
-#pragma aux imul_byte_asm =                    \
-       "push   [edi]"                          \
-       "popf"                          \
-       "imul   bl"                     \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       "mov    [esi],ax"                               \
-       parm [edi] [esi] [al] [bl]      \
-       modify exact [esi ax bl];
-
-void    imul_word_asm(u32 *flags,u16 *ax,u16 *dx,u16 d,u16 s);
-#pragma aux imul_word_asm =                    \
-       "push   [edi]"                          \
-       "popf"                          \
-       "imul   bx"                     \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       "mov    [esi],ax"                               \
-       "mov    [ecx],dx"                               \
-       parm [edi] [esi] [ecx] [ax] [bx]\
-       modify exact [esi edi ax bx dx];
-
-void    imul_long_asm(u32 *flags,u32 *eax,u32 *edx,u32 d,u32 s);
-#pragma aux imul_long_asm =                    \
-       "push   [edi]"                          \
-       "popf"                          \
-       "imul   ebx"                    \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       "mov    [esi],eax"                              \
-       "mov    [ecx],edx"                              \
-       parm [edi] [esi] [ecx] [eax] [ebx] \
-       modify exact [esi edi eax ebx edx];
-
-void    mul_byte_asm(u32 *flags,u16 *ax,u8 d,u8 s);
-#pragma aux mul_byte_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "mul    bl"                     \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       "mov    [esi],ax"                               \
-       parm [edi] [esi] [al] [bl]      \
-       modify exact [esi ax bl];
-
-void    mul_word_asm(u32 *flags,u16 *ax,u16 *dx,u16 d,u16 s);
-#pragma aux mul_word_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "mul    bx"                     \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       "mov    [esi],ax"                               \
-       "mov    [ecx],dx"                               \
-       parm [edi] [esi] [ecx] [ax] [bx]\
-       modify exact [esi edi ax bx dx];
-
-void    mul_long_asm(u32 *flags,u32 *eax,u32 *edx,u32 d,u32 s);
-#pragma aux mul_long_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "mul    ebx"                    \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       "mov    [esi],eax"                              \
-       "mov    [ecx],edx"                              \
-       parm [edi] [esi] [ecx] [eax] [ebx] \
-       modify exact [esi edi eax ebx edx];
-
-void   idiv_byte_asm(u32 *flags,u8 *al,u8 *ah,u16 d,u8 s);
-#pragma aux idiv_byte_asm =                    \
-       "push   [edi]"                          \
-       "popf"                          \
-       "idiv   bl"                     \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       "mov    [esi],al"                               \
-       "mov    [ecx],ah"                               \
-       parm [edi] [esi] [ecx] [ax] [bl]\
-       modify exact [esi edi ax bl];
-
-void   idiv_word_asm(u32 *flags,u16 *ax,u16 *dx,u16 dlo,u16 dhi,u16 s);
-#pragma aux idiv_word_asm =                    \
-       "push   [edi]"                          \
-       "popf"                          \
-       "idiv   bx"                     \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       "mov    [esi],ax"                               \
-       "mov    [ecx],dx"                               \
-       parm [edi] [esi] [ecx] [ax] [dx] [bx]\
-       modify exact [esi edi ax dx bx];
-
-void   idiv_long_asm(u32 *flags,u32 *eax,u32 *edx,u32 dlo,u32 dhi,u32 s);
-#pragma aux idiv_long_asm =                    \
-       "push   [edi]"                          \
-       "popf"                          \
-       "idiv   ebx"                    \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       "mov    [esi],eax"                              \
-       "mov    [ecx],edx"                              \
-       parm [edi] [esi] [ecx] [eax] [edx] [ebx]\
-       modify exact [esi edi eax edx ebx];
-
-void   div_byte_asm(u32 *flags,u8 *al,u8 *ah,u16 d,u8 s);
-#pragma aux div_byte_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "div    bl"                     \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       "mov    [esi],al"                               \
-       "mov    [ecx],ah"                               \
-       parm [edi] [esi] [ecx] [ax] [bl]\
-       modify exact [esi edi ax bl];
-
-void   div_word_asm(u32 *flags,u16 *ax,u16 *dx,u16 dlo,u16 dhi,u16 s);
-#pragma aux div_word_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "div    bx"                     \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       "mov    [esi],ax"                               \
-       "mov    [ecx],dx"                               \
-       parm [edi] [esi] [ecx] [ax] [dx] [bx]\
-       modify exact [esi edi ax dx bx];
-
-void   div_long_asm(u32 *flags,u32 *eax,u32 *edx,u32 dlo,u32 dhi,u32 s);
-#pragma aux div_long_asm =                     \
-       "push   [edi]"                          \
-       "popf"                          \
-       "div    ebx"                    \
-       "pushf"                         \
-       "pop    [edi]"                          \
-       "mov    [esi],eax"                              \
-       "mov    [ecx],edx"                              \
-       parm [edi] [esi] [ecx] [eax] [edx] [ebx]\
-       modify exact [esi edi eax edx ebx];
-
-#endif
-
-#endif /* __X86EMU_PRIM_ASM_H */
diff --git a/board/MAI/bios_emulator/scitech/src/x86emu/x86emu/prim_ops.h b/board/MAI/bios_emulator/scitech/src/x86emu/x86emu/prim_ops.h
deleted file mode 100644 (file)
index 1633fe1..0000000
+++ /dev/null
@@ -1,231 +0,0 @@
-/****************************************************************************
-*
-*                                              Realmode X86 Emulator Library
-*
-*              Copyright (C) 1996-1999 SciTech Software, Inc.
-*                                   Copyright (C) David Mosberger-Tang
-*                                         Copyright (C) 1999 Egbert Eich
-*
-*  ========================================================================
-*
-*  Permission to use, copy, modify, distribute, and sell this software and
-*  its documentation for any purpose is hereby granted without fee,
-*  provided that the above copyright notice appear in all copies and that
-*  both that copyright notice and this permission notice appear in
-*  supporting documentation, and that the name of the authors not be used
-*  in advertising or publicity pertaining to distribution of the software
-*  without specific, written prior permission.  The authors makes no
-*  representations about the suitability of this software for any purpose.
-*  It is provided "as is" without express or implied warranty.
-*
-*  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-*  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-*  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-*  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-*  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-*  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-*  PERFORMANCE OF THIS SOFTWARE.
-*
-*  ========================================================================
-*
-* Language:            ANSI C
-* Environment: Any
-* Developer:    Kendall Bennett
-*
-* Description:  Header file for primitive operation functions.
-*
-****************************************************************************/
-
-#ifndef __X86EMU_PRIM_OPS_H
-#define __X86EMU_PRIM_OPS_H
-
-#include "x86emu/prim_asm.h"
-
-#ifdef  __cplusplus
-extern "C" {                                   /* Use "C" linkage when in C++ mode */
-#endif
-
-u16     aaa_word (u16 d);
-u16     aas_word (u16 d);
-u16     aad_word (u16 d);
-u16     aam_word (u8 d);
-u8      adc_byte (u8 d, u8 s);
-u16     adc_word (u16 d, u16 s);
-u32     adc_long (u32 d, u32 s);
-u8      add_byte (u8 d, u8 s);
-u16     add_word (u16 d, u16 s);
-u32     add_long (u32 d, u32 s);
-u8      and_byte (u8 d, u8 s);
-u16     and_word (u16 d, u16 s);
-u32     and_long (u32 d, u32 s);
-u8      cmp_byte (u8 d, u8 s);
-u16     cmp_word (u16 d, u16 s);
-u32     cmp_long (u32 d, u32 s);
-u8      daa_byte (u8 d);
-u8      das_byte (u8 d);
-u8      dec_byte (u8 d);
-u16     dec_word (u16 d);
-u32     dec_long (u32 d);
-u8      inc_byte (u8 d);
-u16     inc_word (u16 d);
-u32     inc_long (u32 d);
-u8      or_byte (u8 d, u8 s);
-u16     or_word (u16 d, u16 s);
-u32     or_long (u32 d, u32 s);
-u8      neg_byte (u8 s);
-u16     neg_word (u16 s);
-u32     neg_long (u32 s);
-u8      not_byte (u8 s);
-u16     not_word (u16 s);
-u32     not_long (u32 s);
-u8      rcl_byte (u8 d, u8 s);
-u16     rcl_word (u16 d, u8 s);
-u32     rcl_long (u32 d, u8 s);
-u8      rcr_byte (u8 d, u8 s);
-u16     rcr_word (u16 d, u8 s);
-u32     rcr_long (u32 d, u8 s);
-u8      rol_byte (u8 d, u8 s);
-u16     rol_word (u16 d, u8 s);
-u32     rol_long (u32 d, u8 s);
-u8      ror_byte (u8 d, u8 s);
-u16     ror_word (u16 d, u8 s);
-u32     ror_long (u32 d, u8 s);
-u8      shl_byte (u8 d, u8 s);
-u16     shl_word (u16 d, u8 s);
-u32     shl_long (u32 d, u8 s);
-u8      shr_byte (u8 d, u8 s);
-u16     shr_word (u16 d, u8 s);
-u32     shr_long (u32 d, u8 s);
-u8      sar_byte (u8 d, u8 s);
-u16     sar_word (u16 d, u8 s);
-u32     sar_long (u32 d, u8 s);
-u16     shld_word (u16 d, u16 fill, u8 s);
-u32     shld_long (u32 d, u32 fill, u8 s);
-u16     shrd_word (u16 d, u16 fill, u8 s);
-u32     shrd_long (u32 d, u32 fill, u8 s);
-u8      sbb_byte (u8 d, u8 s);
-u16     sbb_word (u16 d, u16 s);
-u32     sbb_long (u32 d, u32 s);
-u8      sub_byte (u8 d, u8 s);
-u16     sub_word (u16 d, u16 s);
-u32     sub_long (u32 d, u32 s);
-void    test_byte (u8 d, u8 s);
-void    test_word (u16 d, u16 s);
-void    test_long (u32 d, u32 s);
-u8      xor_byte (u8 d, u8 s);
-u16     xor_word (u16 d, u16 s);
-u32     xor_long (u32 d, u32 s);
-void    imul_byte (u8 s);
-void    imul_word (u16 s);
-void    imul_long (u32 s);
-void   imul_long_direct(u32 *res_lo, u32* res_hi,u32 d, u32 s);
-void    mul_byte (u8 s);
-void    mul_word (u16 s);
-void    mul_long (u32 s);
-void    idiv_byte (u8 s);
-void    idiv_word (u16 s);
-void    idiv_long (u32 s);
-void    div_byte (u8 s);
-void    div_word (u16 s);
-void    div_long (u32 s);
-void    ins (int size);
-void    outs (int size);
-u16     mem_access_word (int addr);
-void    push_word (u16 w);
-void    push_long (u32 w);
-u16     pop_word (void);
-u32            pop_long (void);
-
-#if  defined(__HAVE_INLINE_ASSEMBLER__) && !defined(PRIM_OPS_NO_REDEFINE_ASM)
-
-#define        aaa_word(d)             aaa_word_asm(&M.x86.R_EFLG,d)
-#define aas_word(d)            aas_word_asm(&M.x86.R_EFLG,d)
-#define aad_word(d)            aad_word_asm(&M.x86.R_EFLG,d)
-#define aam_word(d)            aam_word_asm(&M.x86.R_EFLG,d)
-#define adc_byte(d,s)  adc_byte_asm(&M.x86.R_EFLG,d,s)
-#define adc_word(d,s)  adc_word_asm(&M.x86.R_EFLG,d,s)
-#define adc_long(d,s)  adc_long_asm(&M.x86.R_EFLG,d,s)
-#define add_byte(d,s)  add_byte_asm(&M.x86.R_EFLG,d,s)
-#define add_word(d,s)  add_word_asm(&M.x86.R_EFLG,d,s)
-#define add_long(d,s)  add_long_asm(&M.x86.R_EFLG,d,s)
-#define and_byte(d,s)  and_byte_asm(&M.x86.R_EFLG,d,s)
-#define and_word(d,s)  and_word_asm(&M.x86.R_EFLG,d,s)
-#define and_long(d,s)  and_long_asm(&M.x86.R_EFLG,d,s)
-#define cmp_byte(d,s)  cmp_byte_asm(&M.x86.R_EFLG,d,s)
-#define cmp_word(d,s)  cmp_word_asm(&M.x86.R_EFLG,d,s)
-#define cmp_long(d,s)  cmp_long_asm(&M.x86.R_EFLG,d,s)
-#define daa_byte(d)            daa_byte_asm(&M.x86.R_EFLG,d)
-#define das_byte(d)            das_byte_asm(&M.x86.R_EFLG,d)
-#define dec_byte(d)            dec_byte_asm(&M.x86.R_EFLG,d)
-#define dec_word(d)            dec_word_asm(&M.x86.R_EFLG,d)
-#define dec_long(d)            dec_long_asm(&M.x86.R_EFLG,d)
-#define inc_byte(d)            inc_byte_asm(&M.x86.R_EFLG,d)
-#define inc_word(d)            inc_word_asm(&M.x86.R_EFLG,d)
-#define inc_long(d)            inc_long_asm(&M.x86.R_EFLG,d)
-#define or_byte(d,s)   or_byte_asm(&M.x86.R_EFLG,d,s)
-#define or_word(d,s)   or_word_asm(&M.x86.R_EFLG,d,s)
-#define or_long(d,s)   or_long_asm(&M.x86.R_EFLG,d,s)
-#define neg_byte(s)            neg_byte_asm(&M.x86.R_EFLG,s)
-#define neg_word(s)            neg_word_asm(&M.x86.R_EFLG,s)
-#define neg_long(s)            neg_long_asm(&M.x86.R_EFLG,s)
-#define not_byte(s)            not_byte_asm(&M.x86.R_EFLG,s)
-#define not_word(s)            not_word_asm(&M.x86.R_EFLG,s)
-#define not_long(s)            not_long_asm(&M.x86.R_EFLG,s)
-#define rcl_byte(d,s)  rcl_byte_asm(&M.x86.R_EFLG,d,s)
-#define rcl_word(d,s)  rcl_word_asm(&M.x86.R_EFLG,d,s)
-#define rcl_long(d,s)  rcl_long_asm(&M.x86.R_EFLG,d,s)
-#define rcr_byte(d,s)  rcr_byte_asm(&M.x86.R_EFLG,d,s)
-#define rcr_word(d,s)  rcr_word_asm(&M.x86.R_EFLG,d,s)
-#define rcr_long(d,s)  rcr_long_asm(&M.x86.R_EFLG,d,s)
-#define rol_byte(d,s)  rol_byte_asm(&M.x86.R_EFLG,d,s)
-#define rol_word(d,s)  rol_word_asm(&M.x86.R_EFLG,d,s)
-#define rol_long(d,s)  rol_long_asm(&M.x86.R_EFLG,d,s)
-#define ror_byte(d,s)  ror_byte_asm(&M.x86.R_EFLG,d,s)
-#define ror_word(d,s)  ror_word_asm(&M.x86.R_EFLG,d,s)
-#define ror_long(d,s)  ror_long_asm(&M.x86.R_EFLG,d,s)
-#define shl_byte(d,s)  shl_byte_asm(&M.x86.R_EFLG,d,s)
-#define shl_word(d,s)  shl_word_asm(&M.x86.R_EFLG,d,s)
-#define shl_long(d,s)  shl_long_asm(&M.x86.R_EFLG,d,s)
-#define shr_byte(d,s)  shr_byte_asm(&M.x86.R_EFLG,d,s)
-#define shr_word(d,s)  shr_word_asm(&M.x86.R_EFLG,d,s)
-#define shr_long(d,s)  shr_long_asm(&M.x86.R_EFLG,d,s)
-#define sar_byte(d,s)  sar_byte_asm(&M.x86.R_EFLG,d,s)
-#define sar_word(d,s)  sar_word_asm(&M.x86.R_EFLG,d,s)
-#define sar_long(d,s)  sar_long_asm(&M.x86.R_EFLG,d,s)
-#define shld_word(d,fill,s)    shld_word_asm(&M.x86.R_EFLG,d,fill,s)
-#define shld_long(d,fill,s)    shld_long_asm(&M.x86.R_EFLG,d,fill,s)
-#define shrd_word(d,fill,s)    shrd_word_asm(&M.x86.R_EFLG,d,fill,s)
-#define shrd_long(d,fill,s)    shrd_long_asm(&M.x86.R_EFLG,d,fill,s)
-#define sbb_byte(d,s)  sbb_byte_asm(&M.x86.R_EFLG,d,s)
-#define sbb_word(d,s)  sbb_word_asm(&M.x86.R_EFLG,d,s)
-#define sbb_long(d,s)  sbb_long_asm(&M.x86.R_EFLG,d,s)
-#define sub_byte(d,s)  sub_byte_asm(&M.x86.R_EFLG,d,s)
-#define sub_word(d,s)  sub_word_asm(&M.x86.R_EFLG,d,s)
-#define sub_long(d,s)  sub_long_asm(&M.x86.R_EFLG,d,s)
-#define test_byte(d,s) test_byte_asm(&M.x86.R_EFLG,d,s)
-#define test_word(d,s) test_word_asm(&M.x86.R_EFLG,d,s)
-#define test_long(d,s) test_long_asm(&M.x86.R_EFLG,d,s)
-#define xor_byte(d,s)  xor_byte_asm(&M.x86.R_EFLG,d,s)
-#define xor_word(d,s)  xor_word_asm(&M.x86.R_EFLG,d,s)
-#define xor_long(d,s)  xor_long_asm(&M.x86.R_EFLG,d,s)
-#define imul_byte(s)   imul_byte_asm(&M.x86.R_EFLG,&M.x86.R_AX,M.x86.R_AL,s)
-#define imul_word(s)   imul_word_asm(&M.x86.R_EFLG,&M.x86.R_AX,&M.x86.R_DX,M.x86.R_AX,s)
-#define imul_long(s)   imul_long_asm(&M.x86.R_EFLG,&M.x86.R_EAX,&M.x86.R_EDX,M.x86.R_EAX,s)
-#define imul_long_direct(res_lo,res_hi,d,s)    imul_long_asm(&M.x86.R_EFLG,res_lo,res_hi,d,s)
-#define mul_byte(s)            mul_byte_asm(&M.x86.R_EFLG,&M.x86.R_AX,M.x86.R_AL,s)
-#define mul_word(s)            mul_word_asm(&M.x86.R_EFLG,&M.x86.R_AX,&M.x86.R_DX,M.x86.R_AX,s)
-#define mul_long(s)            mul_long_asm(&M.x86.R_EFLG,&M.x86.R_EAX,&M.x86.R_EDX,M.x86.R_EAX,s)
-#define idiv_byte(s)   idiv_byte_asm(&M.x86.R_EFLG,&M.x86.R_AL,&M.x86.R_AH,M.x86.R_AX,s)
-#define idiv_word(s)   idiv_word_asm(&M.x86.R_EFLG,&M.x86.R_AX,&M.x86.R_DX,M.x86.R_AX,M.x86.R_DX,s)
-#define idiv_long(s)   idiv_long_asm(&M.x86.R_EFLG,&M.x86.R_EAX,&M.x86.R_EDX,M.x86.R_EAX,M.x86.R_EDX,s)
-#define div_byte(s)            div_byte_asm(&M.x86.R_EFLG,&M.x86.R_AL,&M.x86.R_AH,M.x86.R_AX,s)
-#define div_word(s)            div_word_asm(&M.x86.R_EFLG,&M.x86.R_AX,&M.x86.R_DX,M.x86.R_AX,M.x86.R_DX,s)
-#define div_long(s)            div_long_asm(&M.x86.R_EFLG,&M.x86.R_EAX,&M.x86.R_EDX,M.x86.R_EAX,M.x86.R_EDX,s)
-
-#endif
-
-#ifdef  __cplusplus
-}                                              /* End of "C" linkage for C++           */
-#endif
-
-#endif /* __X86EMU_PRIM_OPS_H */
diff --git a/board/MAI/bios_emulator/scitech/src/x86emu/x86emu/x86emui.h b/board/MAI/bios_emulator/scitech/src/x86emu/x86emu/x86emui.h
deleted file mode 100644 (file)
index bff4903..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-/****************************************************************************
-*
-*                                              Realmode X86 Emulator Library
-*
-*              Copyright (C) 1996-1999 SciTech Software, Inc.
-*                                   Copyright (C) David Mosberger-Tang
-*                                         Copyright (C) 1999 Egbert Eich
-*
-*  ========================================================================
-*
-*  Permission to use, copy, modify, distribute, and sell this software and
-*  its documentation for any purpose is hereby granted without fee,
-*  provided that the above copyright notice appear in all copies and that
-*  both that copyright notice and this permission notice appear in
-*  supporting documentation, and that the name of the authors not be used
-*  in advertising or publicity pertaining to distribution of the software
-*  without specific, written prior permission.  The authors makes no
-*  representations about the suitability of this software for any purpose.
-*  It is provided "as is" without express or implied warranty.
-*
-*  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-*  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-*  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-*  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-*  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-*  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-*  PERFORMANCE OF THIS SOFTWARE.
-*
-*  ========================================================================
-*
-* Language:            ANSI C
-* Environment: Any
-* Developer:    Kendall Bennett
-*
-* Description:  Header file for system specific functions. These functions
-*                              are always compiled and linked in the OS depedent libraries,
-*                              and never in a binary portable driver.
-*
-****************************************************************************/
-
-#ifndef __X86EMU_X86EMUI_H
-#define __X86EMU_X86EMUI_H
-
-/* If we are compiling in C++ mode, we can compile some functions as
- * inline to increase performance (however the code size increases quite
- * dramatically in this case).
- */
-
-#if    defined(__cplusplus) && !defined(_NO_INLINE)
-#define        _INLINE inline
-#else
-#define        _INLINE static
-#endif
-
-/* Get rid of unused parameters in C++ compilation mode */
-
-#ifdef __cplusplus
-#define        X86EMU_UNUSED(v)
-#else
-#define        X86EMU_UNUSED(v)        v
-#endif
-
-#include "x86emu.h"
-#include "x86emu/regs.h"
-#include "x86emu/debug.h"
-#include "x86emu/decode.h"
-#include "x86emu/ops.h"
-#include "x86emu/prim_ops.h"
-#include "x86emu/fpu.h"
-#include "x86emu/fpu_regs.h"
-#include <stdio.h>
-#include <string.h>
-
-/*--------------------------- Inline Functions ----------------------------*/
-
-#ifdef  __cplusplus
-extern "C" {                                   /* Use "C" linkage when in C++ mode */
-#endif
-
-extern u8      (X86APIP sys_rdb)(u32 addr);
-extern u16     (X86APIP sys_rdw)(u32 addr);
-extern u32     (X86APIP sys_rdl)(u32 addr);
-extern void (X86APIP sys_wrb)(u32 addr,u8 val);
-extern void (X86APIP sys_wrw)(u32 addr,u16 val);
-extern void (X86APIP sys_wrl)(u32 addr,u32 val);
-
-extern u8      (X86APIP sys_inb)(X86EMU_pioAddr addr);
-extern u16     (X86APIP sys_inw)(X86EMU_pioAddr addr);
-extern u32     (X86APIP sys_inl)(X86EMU_pioAddr addr);
-extern void (X86APIP sys_outb)(X86EMU_pioAddr addr,u8 val);
-extern void (X86APIP sys_outw)(X86EMU_pioAddr addr,u16 val);
-extern void    (X86APIP sys_outl)(X86EMU_pioAddr addr,u32 val);
-
-#ifdef  __cplusplus
-}                                              /* End of "C" linkage for C++           */
-#endif
-
-#endif /* __X86EMU_X86EMUI_H */
diff --git a/board/MAI/bios_emulator/x86interface.c b/board/MAI/bios_emulator/x86interface.c
deleted file mode 100644 (file)
index 909cb3c..0000000
+++ /dev/null
@@ -1,814 +0,0 @@
-#include "x86emu.h"
-#include "glue.h"
-
-
-/*
- * This isn't nice, but there are a lot of incompatibilities in the U-Boot and scitech include
- * files that this is the only really workable solution.
- * Might be cleaned out later.
- */
-
-#ifdef DEBUG
-#undef DEBUG
-#endif
-
-#undef IO_LOGGING
-#undef MEM_LOGGING
-
-#ifdef IO_LOGGING
-#define LOGIO(port, format, args...) if (dolog(port)) _printf(format , ## args)
-#else
-#define LOGIO(port, format, args...)
-#endif
-
-#ifdef MEM_LOGGIN
-#define LOGMEM(format, args...) _printf(format , ## args)
-#else
-#define LOGMEM(format, args...)
-#endif
-
-#ifdef DEBUG
-#define PRINTF(format, args...) _printf(format , ## args)
-#else
-#define PRINTF(format, argc...)
-#endif
-
-typedef unsigned char UBYTE;
-typedef unsigned short UWORD;
-typedef unsigned long ULONG;
-
-typedef char BYTE;
-typedef short WORT;
-typedef long LONG;
-
-#define EMULATOR_MEM_SIZE       (1024*1024)
-#define EMULATOR_BIOS_OFFSET    0xC0000
-#define EMULATOR_STRAP_OFFSET   0x30000
-#define EMULATOR_STACK_OFFSET   0x20000
-#define EMULATOR_LOGO_OFFSET    0x40000 /* If you change this, change the strap code, too */
-#define VIDEO_BASE (void *)0xFD0B8000
-
-extern char *getenv(char *);
-extern int tstc(void);
-extern int getc(void);
-extern unsigned char video_get_attr(void);
-
-int atoi(char *string)
-{
-    int res = 0;
-    while (*string>='0' && *string <='9')
-    {
-       res *= 10;
-       res += *string-'0';
-       string++;
-    }
-
-    return res;
-}
-
-void cons_gets(char *buffer)
-{
-    int i = 0;
-    char c = 0;
-
-    buffer[0] = 0;
-    if (getenv("x86_runthru")) return; /*FIXME: */
-    while (c != 0x0D && c != 0x0A)
-    {
-       while (!tstc());
-       c = getc();
-       if (c>=32 && c < 127)
-       {
-           buffer[i] = c;
-           i++;
-           buffer[i] = 0;
-           putc(c);
-       }
-       else
-       {
-           if (c == 0x08)
-           {
-               if (i>0) i--;
-               buffer[i] = 0;
-           }
-       }
-    }
-    buffer[i] = '\n';
-    buffer[i+1] = 0;
-}
-
-char *bios_date = "08/14/02";
-UBYTE model = 0xFC;
-UBYTE submodel = 0x00;
-
-static inline UBYTE read_byte(volatile UBYTE* from)
-{
-    int x;
-    asm volatile ("lbz %0,%1\n eieio" : "=r" (x) : "m" (*from));
-    return (UBYTE)x;
-}
-
-static inline void write_byte(volatile UBYTE *to, int x)
-{
-    asm volatile ("stb %1,%0\n eieio" : "=m" (*to) : "r" (x));
-}
-
-static inline UWORD read_word_little(volatile UWORD *from)
-{
-    int x;
-    asm volatile ("lhbrx %0,0,%1\n eieio" : "=r" (x) : "r" (from), "m" (*from));
-    return (UWORD)x;
-}
-
-static inline UWORD read_word_big(volatile UWORD *from)
-{
-    int x;
-    asm volatile ("lhz %0,%1\n eieio" : "=r" (x) : "m" (*from));
-    return (UWORD)x;
-}
-
-static inline void write_word_little(volatile UWORD *to, int x)
-{
-    asm volatile ("sthbrx %1,0,%2\n eieio" : "=m" (*to) : "r" (x), "r" (to));
-}
-
-static inline void write_word_big(volatile UWORD *to, int x)
-{
-    asm volatile ("sth %1,%0\n eieio" : "=m" (*to) : "r" (x));
-}
-
-static inline ULONG read_long_little(volatile ULONG *from)
-{
-    unsigned long x;
-    asm volatile ("lwbrx %0,0,%1\n eieio" : "=r" (x) : "r" (from), "m"(*from));
-    return (ULONG)x;
-}
-
-static inline ULONG read_long_big(volatile ULONG *from)
-{
-    unsigned long x;
-    asm volatile ("lwz %0,%1\n eieio" : "=r" (x) : "m" (*from));
-    return (ULONG)x;
-}
-
-static inline void write_long_little(volatile ULONG *to, ULONG x)
-{
-    asm volatile ("stwbrx %1,0,%2\n eieio" : "=m" (*to) : "r" (x), "r" (to));
-}
-
-static inline void write_long_big(volatile ULONG *to, ULONG x)
-{
-    asm volatile ("stw %1,%0\n eieio" : "=m" (*to) : "r" (x));
-}
-
-static int log_init = 0;
-static int log_do = 0;
-static int log_low = 0;
-
-int dolog(int port)
-{
-    if (log_init && log_do)
-    {
-       if (log_low && port > 0x400) return 0;
-       return 1;
-    }
-
-    if (!log_init)
-    {
-       log_init = 1;
-       log_do = (getenv("x86_logio") != (char *)0);
-       log_low = (getenv("x86_loglow") != (char *)0);
-       if (log_do)
-       {
-           if (log_low && port > 0x400) return 0;
-           return 1;
-       }
-    }
-    return 0;
-}
-
-/* Converts an emulator address to a physical address. */
-/* Handles all special cases (bios date, model etc), and might need work */
-u32 memaddr(u32 addr)
-{
-/*    if (addr >= 0xF0000 && addr < 0xFFFFF) printf("WARNING: Segment F access (0x%x)\n", addr); */
-/*    printf("MemAddr=%p\n", addr); */
-    if (addr >= 0xA0000 && addr < 0xC0000)
-       return 0xFD000000 + addr;
-    else if (addr >= 0xFFFF5 && addr < 0xFFFFE)
-    {
-       return (u32)bios_date+addr-0xFFFF5;
-    }
-    else if (addr == 0xFFFFE)
-       return (u32)&model;
-    else if (addr == 0xFFFFF)
-       return (u32)&submodel;
-    else if (addr >= 0x80000000)
-    {
-       /*printf("Warning: High memory access at 0x%x\n", addr); */
-       return addr;
-    }
-    else
-       return (u32)M.mem_base+addr;
-}
-
-u8 A1_rdb(u32 addr)
-{
-    u8 a = read_byte((UBYTE *)memaddr(addr));
-    LOGMEM("rdb: %x -> %x\n", addr, a);
-    return a;
-}
-
-u16 A1_rdw(u32 addr)
-{
-    u16 a = read_word_little((UWORD *)memaddr(addr));
-    LOGMEM("rdw: %x -> %x\n", addr, a);
-    return a;
-}
-
-u32 A1_rdl(u32 addr)
-{
-    u32 a = read_long_little((ULONG *)memaddr(addr));
-    LOGMEM("rdl: %x -> %x\n", addr, a);
-    return a;
-}
-
-void A1_wrb(u32 addr, u8 val)
-{
-    LOGMEM("wrb: %x <- %x\n", addr, val);
-    write_byte((UBYTE *)memaddr(addr), val);
-}
-
-void A1_wrw(u32 addr, u16 val)
-{
-    LOGMEM("wrw: %x <- %x\n", addr, val);
-    write_word_little((UWORD *)memaddr(addr), val);
-}
-
-void A1_wrl(u32 addr, u32 val)
-{
-    LOGMEM("wrl: %x <- %x\n", addr, val);
-    write_long_little((ULONG *)memaddr(addr), val);
-}
-
-X86EMU_memFuncs _A1_mem =
-{
-    A1_rdb,
-    A1_rdw,
-    A1_rdl,
-    A1_wrb,
-    A1_wrw,
-    A1_wrl,
-};
-
-#define ARTICIAS_PCI_CFGADDR  0xfec00cf8
-#define ARTICIAS_PCI_CFGDATA  0xfee00cfc
-#define IOBASE                0xFE000000
-
-#define in_byte(from) read_byte( (UBYTE *)port_to_mem(from))
-#define in_word(from) read_word_little((UWORD *)port_to_mem(from))
-#define in_long(from) read_long_little((ULONG *)port_to_mem(from))
-#define out_byte(to, val) write_byte((UBYTE *)port_to_mem(to), val)
-#define out_word(to, val) write_word_little((UWORD *)port_to_mem(to), val)
-#define out_long(to, val) write_long_little((ULONG *)port_to_mem(to), val)
-
-u32 port_to_mem(int port)
-{
-    if (port >= 0xCFC && port <= 0xCFF) return 0xFEE00000+port;
-    else if (port >= 0xCF8 && port <= 0xCFB) return 0xFEC00000+port;
-    else return IOBASE + port;
-}
-
-u8 A1_inb(int port)
-{
-    u8 a;
-    /*if (port == 0x3BA) return 0; */
-    a = in_byte(port);
-    LOGIO(port, "inb: %Xh -> %d (%Xh)\n", port, a, a);
-    return a;
-}
-
-u16 A1_inw(int port)
-{
-    u16 a = in_word(port);
-    LOGIO(port, "inw: %Xh -> %d (%Xh)\n", port, a, a);
-    return a;
-}
-
-u32 A1_inl(int port)
-{
-    u32 a = in_long(port);
-    LOGIO(port, "inl: %Xh -> %d (%Xh)\n", port, a, a);
-    return a;
-}
-
-void A1_outb(int port, u8 val)
-{
-    LOGIO(port, "outb: %Xh <- %d (%Xh)\n", port, val, val);
-/*    if (port == 0xCF8) port = 0xCFB;
-    else if (port == 0xCF9) port = 0xCFA;
-    else if (port == 0xCFA) port = 0xCF9;
-    else if (port == 0xCFB) port = 0xCF8;*/
-    out_byte(port, val);
-}
-
-void A1_outw(int port, u16 val)
-{
-    LOGIO(port, "outw: %Xh <- %d (%Xh)\n", port, val, val);
-    out_word(port, val);
-}
-
-void A1_outl(int port, u32 val)
-{
-    LOGIO(port, "outl: %Xh <- %d (%Xh)\n", port, val, val);
-    out_long(port, val);
-}
-
-X86EMU_pioFuncs _A1_pio =
-{
-    A1_inb,
-    A1_inw,
-    A1_inl,
-    A1_outb,
-    A1_outw,
-    A1_outl,
-};
-
-static int reloced_ops = 0;
-
-void reloc_ops(void *reloc_addr)
-{
-    extern void (*x86emu_optab[256])(u8);
-    extern void (*x86emu_optab2[256])(u8);
-    extern void tables_relocate(unsigned int offset);
-    int i;
-    unsigned long delta;
-    if (reloced_ops == 1) return;
-    reloced_ops = 1;
-
-    delta = TEXT_BASE - (unsigned long)reloc_addr;
-
-    for (i=0; i<256; i++)
-    {
-       x86emu_optab[i] -= delta;
-       x86emu_optab2[i] -= delta;
-    }
-
-    _A1_mem.rdb = A1_rdb;
-    _A1_mem.rdw = A1_rdw;
-    _A1_mem.rdl = A1_rdl;
-    _A1_mem.wrb = A1_wrb;
-    _A1_mem.wrw = A1_wrw;
-    _A1_mem.wrl = A1_wrl;
-
-    _A1_pio.inb = A1_inb;
-    _A1_pio.inw = A1_inw;
-    _A1_pio.inl = A1_inl;
-    _A1_pio.outb = A1_outb;
-    _A1_pio.outw = A1_outw;
-    _A1_pio.outl = A1_outl;
-
-    tables_relocate(delta);
-
-}
-
-
-#define ANY_KEY(text)                          \
-    printf(text);                              \
-    while (!tstc());
-
-
-unsigned char more_strap[] = {
-       0xb4, 0x0, 0xb0, 0x2, 0xcd, 0x10,
-};
-#define MORE_STRAP_BYTES 6 /* Additional bytes of strap code */
-
-
-unsigned char *done_msg="VGA Initialized\0";
-
-int execute_bios(pci_dev_t gr_dev, void *reloc_addr)
-{
-    extern void bios_init(void);
-    extern void remove_init_data(void);
-    extern int video_rows(void);
-    extern int video_cols(void);
-    extern int video_size(int, int);
-    u8 *strap;
-    unsigned char *logo;
-    u8 cfg;
-    int i;
-    char c;
-    char *s;
-#ifdef EASTEREGG
-    int easteregg_active = 0;
-#endif
-    char *pal_reset;
-    u8 *fb;
-    unsigned char *msg;
-    unsigned char current_attr;
-
-    PRINTF("Trying to remove init data\n");
-    remove_init_data();
-    PRINTF("Removed init data from cache, now in RAM\n");
-
-    reloc_ops(reloc_addr);
-    PRINTF("Attempting to run emulator on %02x:%02x:%02x\n",
-          PCI_BUS(gr_dev), PCI_DEV(gr_dev), PCI_FUNC(gr_dev));
-
-    /* Enable compatibility hole for emulator access to frame buffer */
-    PRINTF("Enabling compatibility hole\n");
-    enable_compatibility_hole();
-
-    /* Allocate memory */
-    /* FIXME: We shouldn't use this much memory really. */
-    memset(&M, 0, sizeof(X86EMU_sysEnv));
-    M.mem_base = malloc(EMULATOR_MEM_SIZE);
-    M.mem_size = EMULATOR_MEM_SIZE;
-
-    if (!M.mem_base)
-    {
-       PRINTF("Unable to allocate one megabyte for emulator\n");
-       return 0;
-    }
-
-    if (attempt_map_rom(gr_dev, M.mem_base + EMULATOR_BIOS_OFFSET) == 0)
-    {
-       PRINTF("Error mapping rom. Emulation terminated\n");
-       return 0;
-    }
-
-#if 1 /*def DEBUG*/
-    s = getenv("x86_ask_start");
-    if (s)
-    {
-       printf("Press 'q' to skip initialization, 'd' for dry init\n'i' for i/o session");
-       while (!tstc());
-       c = getc();
-       if (c == 'q') return 0;
-       if (c == 'd')
-       {
-           extern void bios_set_mode(int mode);
-           bios_set_mode(0x03);
-           return 0;
-       }
-       if (c == 'i') do_inout();
-    }
-
-
-#endif
-
-#ifdef EASTEREGG
-/*    if (tstc())
-    {
-       if (getc() == 'c')
-       {
-           easteregg_active = 1;
-       }
-    }
-*/
-    if (getenv("easteregg"))
-    {
-       easteregg_active = 1;
-    }
-
-    if (easteregg_active)
-    {
-       /* Yay! */
-       setenv("x86_mode", "1");
-       setenv("vga_fg_color", "11");
-       setenv("vga_bg_color", "1");
-       easteregg_active = 1;
-    }
-#endif
-
-    strap = (u8*)M.mem_base + EMULATOR_STRAP_OFFSET;
-
-    {
-       char *m = getenv("x86_mode");
-       if (m)
-       {
-           more_strap[3] = atoi(m);
-           if (more_strap[3] == 1) video_size(40, 25);
-           else                    video_size(80, 25);
-       }
-    }
-
-    /*
-     * Poke the strap routine. This might need a bit of extending
-     * if there is a mode switch involved, i.e. we want to int10
-     * afterwards to set a different graphics mode, or alternatively
-     * there might be a different start address requirement if the
-     * ROM doesn't have an x86 image in its first image.
-     */
-
-    PRINTF("Poking strap...\n");
-
-    /* FAR CALL c000:0003 */
-    *strap++ = 0x9A; *strap++ = 0x03; *strap++ = 0x00;
-    *strap++ = 0x00; *strap++ = 0xC0;
-
-#if 1
-    /* insert additional strap code */
-    for (i=0; i < MORE_STRAP_BYTES; i++)
-    {
-       *strap++ = more_strap[i];
-    }
-#endif
-    /* HALT */
-    *strap++ = 0xF4;
-
-    PRINTF("Setting up logo data\n");
-    logo = (unsigned char *)M.mem_base + EMULATOR_LOGO_OFFSET;
-    for (i=0; i<16; i++)
-    {
-       *logo++ = 0xFF;
-    }
-
-    /*
-     * Setup the init parameters.
-     * Per PCI specs, AH must contain the bus and AL
-     * must contain the devfn, encoded as (dev<<3)|fn
-     */
-
-    /* Execution starts here */
-    M.x86.R_CS = SEG(EMULATOR_STRAP_OFFSET);
-    M.x86.R_IP = OFF(EMULATOR_STRAP_OFFSET);
-
-    /* Stack at top of ram */
-    M.x86.R_SS = SEG(EMULATOR_STACK_OFFSET);
-    M.x86.R_SP = OFF(EMULATOR_STACK_OFFSET);
-
-    /* Input parameters */
-    M.x86.R_AH = PCI_BUS(gr_dev);
-    M.x86.R_AL = (PCI_DEV(gr_dev)<<3) | PCI_FUNC(gr_dev);
-
-    /* Set the I/O and memory access functions */
-    X86EMU_setupMemFuncs(&_A1_mem);
-    X86EMU_setupPioFuncs(&_A1_pio);
-
-    /* Enable timer 2 */
-    cfg = in_byte(0x61); /* Get Misc control */
-    cfg |= 0x01;         /* Enable timer 2 */
-    out_byte(0x61, cfg); /* output again */
-
-    /* Set up the timers */
-    out_byte(0x43, 0x54);
-    out_byte(0x41, 0x18);
-
-    out_byte(0x43, 0x36);
-    out_byte(0x40, 0x00);
-    out_byte(0x40, 0x00);
-
-    out_byte(0x43, 0xb6);
-    out_byte(0x42, 0x31);
-    out_byte(0x42, 0x13);
-
-    /* Init the "BIOS". */
-    bios_init();
-
-    /* Video Card Reset */
-    out_byte(0x3D8, 0);
-    out_byte(0x3B8, 1);
-    (void)in_byte(0x3BA);
-    (void)in_byte(0x3DA);
-    out_byte(0x3C0, 0);
-    out_byte(0x61, 0xFC);
-
-#ifdef DEBUG
-    s = _getenv("x86_singlestep");
-    if (s && strcmp(s, "on")==0)
-    {
-       PRINTF("Enabling single stepping for debug\n");
-       X86EMU_trace_on();
-    }
-#endif
-
-    /* Ready set go... */
-    PRINTF("Running emulator\n");
-    X86EMU_exec();
-    PRINTF("Done running emulator\n");
-
-/* FIXME: Remove me */
-    pal_reset = getenv("x86_palette_reset");
-    if (pal_reset && strcmp(pal_reset, "on") == 0)
-    {
-       PRINTF("Palette reset\n");
-       /*(void)in_byte(0x3da); */
-       /*out_byte(0x3c0, 0); */
-
-       out_byte(0x3C8, 0);
-       out_byte(0x3C9, 0);
-       out_byte(0x3C9, 0);
-       out_byte(0x3C9, 0);
-       for (i=0; i<254; i++)
-       {
-           out_byte(0x3C9, 63);
-           out_byte(0x3C9, 63);
-           out_byte(0x3C9, 63);
-       }
-
-       out_byte(0x3c0, 0x20);
-    }
-/* FIXME: remove me */
-#ifdef EASTEREGG
-    if (easteregg_active)
-    {
-       extern void video_easteregg(void);
-       video_easteregg();
-    }
-#endif
-/*
-    current_attr = video_get_attr();
-    fb = (u8 *)VIDEO_BASE;
-    for (i=0; i<video_rows()*video_cols()*2; i+=2)
-    {
-       *(fb+i) = ' ';
-       *(fb+i+1) = current_attr;
-    }
-
-    fb = (u8 *)VIDEO_BASE + (video_rows())-1*(video_cols()*2);
-    for (i=0; i<video_cols(); i++)
-    {
-       *(fb + 2*i)     = 32;
-       *(fb + 2*i + 1) = 0x17;
-    }
-
-    msg = done_msg;
-    while (*msg)
-    {
-       *fb = *msg;
-       fb  += 2;
-       msg ++;
-    }
-*/
-#ifdef DEBUG
-    if (getenv("x86_do_inout")) do_inout();
-#endif
-
-/*FIXME:    dcache_disable(); */
-    return 1;
-}
-
-/* Clean up the x86 mess */
-void shutdown_bios(void)
-{
-/*    disable_compatibility_hole(); */
-    /* Free the memory associated */
-    free(M.mem_base);
-
-}
-
-int to_int(char *buffer)
-{
-    int base = 0;
-    int res  = 0;
-
-    if (*buffer == '$')
-    {
-       base = 16;
-       buffer++;
-    }
-    else base = 10;
-
-    for (;;)
-    {
-       switch(*buffer)
-       {
-       case '0' ... '9':
-           res *= base;
-           res += *buffer - '0';
-           break;
-       case 'A':
-       case 'a':
-           res *= base;
-           res += 10;
-           break;
-       case 'B':
-       case 'b':
-           res *= base;
-           res += 11;
-           break;
-       case 'C':
-       case 'c':
-           res *= base;
-           res += 12;
-           break;
-       case 'D':
-       case 'd':
-           res *= base;
-           res += 13;
-           break;
-       case 'E':
-       case 'e':
-           res *= base;
-           res += 14;
-           break;
-       case 'F':
-       case 'f':
-           res *= base;
-           res += 15;
-           break;
-       default:
-           return res;
-       }
-       buffer++;
-    }
-    return res;
-}
-
-void one_arg(char *buffer, int *a)
-{
-    while (*buffer && *buffer != '\n')
-    {
-       if (*buffer == ' ') buffer++;
-       else break;
-    }
-
-    *a = to_int(buffer);
-}
-
-void two_args(char *buffer, int *a, int *b)
-{
-    while (*buffer && *buffer != '\n')
-    {
-       if (*buffer == ' ') buffer++;
-       else break;
-    }
-
-    *a = to_int(buffer);
-
-    while (*buffer && *buffer != '\n')
-    {
-       if (*buffer != ' ') buffer++;
-       else break;
-    }
-
-    while (*buffer && *buffer != '\n')
-    {
-       if (*buffer == ' ') buffer++;
-       else break;
-    }
-
-    *b = to_int(buffer);
-}
-
-void do_inout(void)
-{
-    char buffer[256];
-    char *arg1, *arg2;
-    int a,b;
-
-    printf("In/Out Session\nUse 'i[bwl]' for in, 'o[bwl]' for out and 'q' to quit\n");
-
-    do
-    {
-       cons_gets(buffer);
-       printf("\n");
-
-       *arg1 = buffer;
-       while (*arg1 != ' ' ) arg1++;
-       while (*arg1 == ' ') arg1++;
-
-       if (buffer[0] == 'i')
-       {
-           one_arg(buffer+2, &a);
-           switch (buffer[1])
-           {
-           case 'b':
-               printf("in_byte(%xh) = %xh\n", a, A1_inb(a));
-               break;
-           case 'w':
-               printf("in_word(%xh) = %xh\n", a, A1_inw(a));
-               break;
-           case 'l':
-               printf("in_dword(%xh) = %xh\n", a, A1_inl(a));
-               break;
-           default:
-               printf("Invalid length '%c'\n", buffer[1]);
-               break;
-           }
-       }
-       else if (buffer[0] == 'o')
-       {
-           two_args(buffer+2, &a, &b);
-           switch (buffer[1])
-           {
-           case 'b':
-               printf("out_byte(%d, %d)\n", a, b);
-               A1_outb(a,b);
-               break;
-           case 'w':
-               printf("out_word(%d, %d)\n", a, b);
-               A1_outw(a, b);
-               break;
-           case 'l':
-               printf("out_long(%d, %d)\n", a, b);
-               A1_outl(a, b);
-               break;
-           default:
-               printf("Invalid length '%c'\n", buffer[1]);
-               break;
-           }
-       } else if (buffer[0] == 'q') return;
-    } while (1);
-}
index a515bd8f2f0fbee60d29136e56f97f1dcdfdebaa..079f1ff16ef5d7786193d00c6881c6e565ca377e 100644 (file)
@@ -7,7 +7,7 @@ int do_menu( cmd_tbl_t *cmdtp, /*bd_t *bd,*/ int flag, int argc, char *argv[] )
        return 0;
 }
 
-#if defined(CONFIG_AMIGAONEG3SE) && (CONFIG_COMMANDS & CFG_CMD_BSP)
+#if defined(CONFIG_AMIGAONEG3SE) && defined(CONFIG_CMD_BSP)
 U_BOOT_CMD(
        menu,   1,      1,      do_menu,
        "menu    - display BIOS setup menu\n",
index 6a1d4d7f5c7632498d013ba92158bce9c4f2f1c3..01efbea77b195c80e842625363e6ba96df48c325 100644 (file)
@@ -145,7 +145,7 @@ void serial_puts (const char *s)
        }
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 void kgdb_serial_init (void)
 {
 }
@@ -169,4 +169,4 @@ void kgdb_interruptible (int yes)
 {
        return;
 }
-#endif /* CFG_CMD_KGDB */
+#endif
diff --git a/board/a3000/u-boot.lds b/board/a3000/u-boot.lds
deleted file mode 100644 (file)
index acb9ffd..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * (C) Copyright 2001
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc824x/start.o                (.text)
-    lib_ppc/board.o            (.text)
-    lib_ppc/ppcstring.o                (.text)
-    lib_generic/vsprintf.o     (.text)
-    lib_generic/crc32.o                (.text)
-    lib_generic/zlib.o         (.text)
-
-       . = DEFINED(env_offset) ? env_offset : .;
-    common/environment.o (.text)
-
-       *(.text)
-
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-
-  _end = . ;
-  PROVIDE (end = .);
-}
index 93874b24f5f31e78d1770e85de624f5399f45127..9531703fc936263dc2b7e69fe66a7da0dc657c95 100644 (file)
@@ -138,7 +138,7 @@ long int initdram (int board_type)
        size = dramSetup ();
 
 /* if iCache ad dCache is defined */
-#if (CONFIG_COMMANDS & CFG_CMD_CACHE)
+#if defined(CONFIG_CMD_CACHE)
 /*    setupBat(size);*/
 #endif
 
diff --git a/board/alaska/u-boot.lds b/board/alaska/u-boot.lds
deleted file mode 100644 (file)
index 889bc77..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * (C) Copyright 2003-2004
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc8220/start.o        (.text)
-    *(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
index 98ee7a71c962af93b8504b830e3b5ffa3c0eb16c..d0eb9eacb88cd2e4d36bbf898514d1ce9eb46006 100644 (file)
@@ -55,7 +55,7 @@ long int initdram (int board_type)
        return (0);
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_IDE)
+#if defined(CONFIG_CMD_IDE)
 int ide_preinit (void)
 {
        nios_pio_t *present = (nios_pio_t *) CFG_CF_PRESENT;
@@ -78,4 +78,4 @@ int ide_preinit (void)
 
        return 0;
 }
-#endif /* CONFIG_COMMANDS & CFG_CMD_IDE */
+#endif
index c6ee7728129db67f0cfa3dab0b3b5fcb8019ebc8..5e9e3a31eeae14c18a4a1c11406ef64aa29569a2 100644 (file)
@@ -84,7 +84,7 @@ void serial_puts (const char *s)
        }
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 void kgdb_serial_init (void)
 {
 }
@@ -108,4 +108,4 @@ void kgdb_interruptible (int yes)
 {
        return;
 }
-#endif /* CFG_CMD_KGDB */
+#endif
index 002981a762481e01cd3ce1816946d13c9bebdd13..c564f73a532073a5dc02acfb60d33753a8974b11 100644 (file)
@@ -62,7 +62,7 @@ int dram_init (void)
 }
 
 #ifdef CONFIG_DRIVER_ETHER
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
 
 /*
  * Name:
@@ -82,14 +82,14 @@ void at91rm9200_GetPhyInterface(AT91PS_PhyOps p_phyops)
        p_phyops->AutoNegotiate = dm9161_AutoNegotiate;
 }
 
-#endif /* CONFIG_COMMANDS & CFG_CMD_NET */
+#endif
 #endif /* CONFIG_DRIVER_ETHER */
 
 /*
  * Disk On Chip (NAND) Millenium initialization.
  * The NAND lives in the CS2* space
  */
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
 extern ulong nand_probe (ulong physadr);
 
 #define AT91_SMARTMEDIA_BASE 0x40000000        /* physical address to access memory on NCS3 */
index d2c6b3bfcd9bb257ca904abbabc8779e38bd21dc..fe321558224ebba5871c2b8b0b61738fbcb85c2a 100644 (file)
@@ -379,7 +379,7 @@ long int initdram (int board_type)
        return (psize);
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_DOC)
+#if defined(CONFIG_CMD_DOC)
 extern void doc_probe (ulong physadr);
 void doc_init (void)
 {
index d5e935c400a7bcddfa92ccac430e605a21e3770d..e112eca85d72a12fe5839612569d039665a97fdc 100644 (file)
@@ -591,7 +591,7 @@ exit:
        return rc;
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_PCMCIA)
+#if defined(CONFIG_CMD_PCMCIA)
 int pcmcia_off (void)
 {
        printf ("Disable PCMCIA " PCMCIA_SLOT_MSG "\n");
diff --git a/board/atc/u-boot.lds b/board/atc/u-boot.lds
deleted file mode 100644 (file)
index eee83d0..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * (C) Copyright 2001
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc8260/start.o        (.text)
-    *(.text)
-    common/environment.o(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
index 3a7916efed294be45c6bd1ea7222f044181f84f1..b2b1a12b1abcd119cf89f0e0c6ad02bcb73571ff 100644 (file)
@@ -27,7 +27,7 @@
 
 extern int macb_eth_initialize(int id, void *regs, unsigned int phy_addr);
 
-#if defined(CONFIG_MACB) && (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_MACB) && defined(CONFIG_CMD_NET)
 void atstk1000_eth_initialize(bd_t *bi)
 {
        int id = 0;
diff --git a/board/barco/u-boot.lds b/board/barco/u-boot.lds
deleted file mode 100644 (file)
index 7bf8531..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * (C) Copyright 2001
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)      }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)      }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)       }
-  .rela.got      : { *(.rela.got)      }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)       }
-  .rela.bss      : { *(.rela.bss)      }
-  .rel.plt       : { *(.rel.plt)       }
-  .rela.plt      : { *(.rela.plt)      }
-  .init          : { *(.init)          }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc824x/start.o        (.text)
-    lib_ppc/board.o    (.text)
-    lib_ppc/ppcstring.o        (.text)
-
-       . = DEFINED(env_offset) ? env_offset : .;
-    common/environment.o (.text)
-
-       *(.text)
-
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-
-  _end = . ;
-  PROVIDE (end = .);
-}
index 05bb7235f8bf4799fe7e7acd490a761f818c6a2a..56a73fe4d0c7acf84ef632e85ac6d2b27ab81002 100644 (file)
@@ -294,7 +294,7 @@ void pci_init_board(void)
 }
 #endif
 
-#if defined (CFG_CMD_IDE) && defined (CONFIG_IDE_RESET)
+#if defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_RESET)
 
 void init_ide_reset (void)
 {
@@ -315,7 +315,7 @@ void ide_set_reset (int idereset)
                *(vu_long *) MPC5XXX_WU_GPIO_DATA_O |=  GPIO_PSC1_4;
        }
 }
-#endif /* defined (CFG_CMD_IDE) && defined (CONFIG_IDE_RESET) */
+#endif
 
 #ifdef CONFIG_POST
 /*
index 6bbe4e6a5d2059cc68ca59ed7583d950354f3c9e..1455953078b8b6b43d6f127cba4ac0afe2415409 100644 (file)
@@ -30,7 +30,7 @@
 /*
  * BC3450 specific commands
  */
-#if (CONFIG_COMMANDS & CFG_CMD_BSP)
+#if defined(CONFIG_CMD_BSP)
 
 #undef DEBUG
 #ifdef DEBUG
@@ -824,4 +824,4 @@ U_BOOT_CMD (test, 2, 1, cmd_test, "test    - unit test routines\n", "\n"
            "test unit-off\n"
            "     - turns off the BC3450 unit\n"
            "       WARNING: Unsaved environment variables will be lost!\n");
-#endif /* CFG_CMD_BSP */
+#endif
diff --git a/board/bc3450/u-boot.lds b/board/bc3450/u-boot.lds
deleted file mode 100644 (file)
index 93b98a8..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * (C) Copyright 2003-2004
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc5xxx/start.o        (.text)
-    *(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
index 47f7c9edf6f666a405280577ba834b1bdad19467..919cef688dbdd5992fb225a42a0f9be8a4b1aa7b 100644 (file)
@@ -159,7 +159,7 @@ int misc_init_r(void)
        unsigned char *pMACaddr = (unsigned char *)0x203F0000;
        u8 SrcAddr[6] = { 0x02, 0x80, 0xAD, 0x20, 0x31, 0xB8 };
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
        /* The 0xFF check here is to make sure we don't use the address
         * in flash if it's simply been erased (aka all 0xFF values) */
        if (getenv("ethaddr") == NULL && is_valid_ether_addr(pMACaddr)) {
@@ -171,7 +171,7 @@ int misc_init_r(void)
        if (getenv("ethaddr")) {
                SetupMacAddr(SrcAddr);
        }
-#endif                         /* CONFIG_COMMANDS & CFG_CMD_NET */
+#endif
 #endif                         /* BFIN_BOOT_MODE == BF537_BYPASS_BOOT */
 
 #if defined(CONFIG_BFIN_IDE)
index 807b9e839b4a6237a769d6cdc36528592b1a84ce..36c1536e39fe4787a87ffb313897fc5be7837c5e 100644 (file)
@@ -42,7 +42,7 @@
 #define DEBUGF(fmt,args...)
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
 
 #define RXBUF_BASE_ADDR                0xFF900000
 #define TXBUF_BASE_ADDR                0xFF800000
@@ -542,4 +542,4 @@ int ether_post_test(int flags)
        return 0;
 }
 #endif
-#endif                         /* CFG_CMD_NET */
+#endif
index 4d6e7760d5219c43d0ae0c40fba4ac6ec5af7ef8..f95b584b314067ceef1664d8a76ef85898319c42 100644 (file)
@@ -23,7 +23,7 @@
 #include <common.h>
 #include <asm/io.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
 
 #include <nand.h>
 
@@ -103,4 +103,4 @@ void board_nand_init(struct nand_chip *nand)
        nand->dev_ready = bfin_device_ready;
        nand->chip_delay = 30;
 }
-#endif                         /* (CONFIG_COMMANDS & CFG_CMD_NAND) */
+#endif
diff --git a/board/bmw/u-boot.lds b/board/bmw/u-boot.lds
deleted file mode 100644 (file)
index eaee3fd..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * (C) Copyright 2001
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)      }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)      }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)       }
-  .rela.got      : { *(.rela.got)      }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)       }
-  .rela.bss      : { *(.rela.bss)      }
-  .rel.plt       : { *(.rel.plt)       }
-  .rela.plt      : { *(.rela.plt)      }
-  .init          : { *(.init)          }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc824x/start.o                (.text)
-    lib_ppc/board.o            (.text)
-    lib_ppc/ppcstring.o                (.text)
-    lib_generic/vsprintf.o     (.text)
-    lib_generic/crc32.o                (.text)
-    lib_generic/zlib.o         (.text)
-
-       . = DEFINED(env_offset) ? env_offset : .;
-    common/environment.o (.text)
-
-       *(.text)
-
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-
-  _end = . ;
-  PROVIDE (end = .);
-}
index 5e50c4d9bc129a8e85e8482aa7bfa32963fa36e6..c389c6778bebd4a8d7c73c20140dd606846055f8 100644 (file)
@@ -4,11 +4,11 @@
 
 #undef CONFIG_PCMCIA
 
-#if    (CONFIG_COMMANDS & CFG_CMD_PCMCIA)
+#if    defined(CONFIG_CMD_PCMCIA)
 #define        CONFIG_PCMCIA
 #endif
 
-#if    (CONFIG_COMMANDS & CFG_CMD_IDE) && defined(CONFIG_IDE_8xx_PCCARD)
+#if defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_8xx_PCCARD)
 #define        CONFIG_PCMCIA
 #endif
 
@@ -165,7 +165,7 @@ int pcmcia_hardware_enable(int slot)
 }
 
 
-#if (CONFIG_COMMANDS & CFG_CMD_PCMCIA)
+#if defined(CONFIG_CMD_PCMCIA)
 int pcmcia_hardware_disable(int slot)
 {
        volatile immap_t        *immap;
@@ -193,7 +193,7 @@ int pcmcia_hardware_disable(int slot)
 
        return (0);
 }
-#endif /* CFG_CMD_PCMCIA */
+#endif
 
 
 int pcmcia_voltage_set(int slot, int vcc, int vpp)
diff --git a/board/canmb/u-boot.lds b/board/canmb/u-boot.lds
deleted file mode 100644 (file)
index 88dc118..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * (C) Copyright 2005
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc5xxx/start.o        (.text)
-    *(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
diff --git a/board/cm1_qp1/Makefile b/board/cm1_qp1/Makefile
deleted file mode 100644 (file)
index e739326..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-#
-# (C) Copyright 2003-2007
-# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
-#
-# See file CREDITS for list of people who contributed to this
-# project.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-# MA 02111-1307 USA
-#
-
-include $(TOPDIR)/config.mk
-
-LIB    = $(obj)lib$(BOARD).a
-
-COBJS  := $(BOARD).o cmd_cm1_qp1.o fwupdate.o
-
-SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS))
-SOBJS  := $(addprefix $(obj),$(SOBJS))
-
-$(LIB):        $(obj).depend $(OBJS)
-       $(AR) $(ARFLAGS) $@ $(OBJS)
-
-clean:
-       rm -f $(SOBJS) $(OBJS)
-
-distclean:     clean
-       rm -f $(LIB) core *.bak .depend
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
diff --git a/board/cm1_qp1/cm1_qp1.c b/board/cm1_qp1/cm1_qp1.c
deleted file mode 100644 (file)
index b49298f..0000000
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- * (C) Copyright 2003-2007
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * (C) Copyright 2004
- * Mark Jonas, Freescale Semiconductor, mark.jonas@motorola.com.
- *
- * (C) Copyright 2004-2005
- * Martin Krause, TQ-Systems GmbH, martin.krause@tqs.de
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-#include <common.h>
-#include <mpc5xxx.h>
-#include <pci.h>
-#include <asm/processor.h>
-#include <i2c.h>
-#ifdef CONFIG_OF_FLAT_TREE
-#include <ft_build.h>
-#endif /* CONFIG_OF_FLAT_TREE */
-
-#include "fwupdate.h"
-
-#ifndef CFG_RAMBOOT
-/*
- * Helper function to initialize SDRAM controller.
- */
-static void sdram_start(int hi_addr)
-{
-       long hi_addr_bit = hi_addr ? 0x01000000 : 0;
-
-       /* unlock mode register */
-       *(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000000 |
-                                               hi_addr_bit;
-
-       /* precharge all banks */
-       *(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000002 |
-                                               hi_addr_bit;
-
-       /* auto refresh */
-       *(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000004 |
-                                               hi_addr_bit;
-
-       /* auto refresh, second time */
-       *(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000004 |
-                                               hi_addr_bit;
-
-       /* set mode register */
-       *(vu_long *)MPC5XXX_SDRAM_MODE = SDRAM_MODE;
-
-       /* normal operation */
-       *(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | hi_addr_bit;
-}
-#endif /* CFG_RAMBOOT */
-
-/*
- * Initalize SDRAM - configure SDRAM controller, detect memory size.
- */
-long int initdram(int board_type)
-{
-       ulong dramsize = 0;
-#ifndef CFG_RAMBOOT
-       ulong test1, test2;
-
-       /* configure SDRAM start/end for detection */
-       *(vu_long *)MPC5XXX_SDRAM_CS0CFG = 0x0000001e; /* 2G at 0x0 */
-
-       /* setup config registers */
-       *(vu_long *)MPC5XXX_SDRAM_CONFIG1 = SDRAM_CONFIG1;
-       *(vu_long *)MPC5XXX_SDRAM_CONFIG2 = SDRAM_CONFIG2;
-
-       sdram_start(0);
-       test1 = get_ram_size((long *)CFG_SDRAM_BASE, 0x80000000);
-       sdram_start(1);
-       test2 = get_ram_size((long *)CFG_SDRAM_BASE, 0x80000000);
-       if (test1 > test2) {
-               sdram_start(0);
-               dramsize = test1;
-       } else
-               dramsize = test2;
-
-       /* memory smaller than 1MB is impossible */
-       if (dramsize < (1 << 20))
-               dramsize = 0;
-
-       /* set SDRAM CS0 size according to the amount of RAM found */
-       if (dramsize > 0) {
-               *(vu_long *)MPC5XXX_SDRAM_CS0CFG = 0x13 +
-                       __builtin_ffs(dramsize >> 20) - 1;
-       } else
-               *(vu_long *)MPC5XXX_SDRAM_CS0CFG = 0; /* disabled */
-#else /* CFG_RAMBOOT */
-       /* retrieve size of memory connected to SDRAM CS0 */
-       dramsize = *(vu_long *)MPC5XXX_SDRAM_CS0CFG & 0xFF;
-       if (dramsize >= 0x13)
-               dramsize = (1 << (dramsize - 0x13)) << 20;
-       else
-               dramsize = 0;
-#endif /* CFG_RAMBOOT */
-
-       /*
-        * On MPC5200B we need to set the special configuration delay in the
-        * DDR controller.  Refer to chapter 8.7.5 SDelay--MBAR + 0x0190 of
-        * the MPC5200B User's Manual.
-        */
-       *(vu_long *)MPC5XXX_SDRAM_SDELAY = 0x04;
-       __asm__ volatile ("sync");
-
-       return dramsize;
-}
-
-
-int checkboard(void)
-{
-       puts("Board: CM1.QP1\n");
-       return 0;
-}
-
-
-int board_early_init_r(void)
-{
-       /*
-        * Now, when we are in RAM, enable flash write access for detection
-        * process. Note that CS_BOOT cannot be cleared when executing in
-        * flash.
-        */
-       *(vu_long *)MPC5XXX_BOOTCS_CFG &= ~0x1; /* clear RO */
-       return 0;
-}
-
-
-#ifdef CONFIG_POST
-int post_hotkeys_pressed(void)
-{
-       return 0;
-}
-#endif /* CONFIG_POST */
-
-
-#if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER)
-void post_word_store(ulong a)
-{
-       vu_long *save_addr = (vu_long *)(MPC5XXX_SRAM + MPC5XXX_SRAM_POST_SIZE);
-       *save_addr = a;
-}
-
-
-ulong post_word_load(void)
-{
-       vu_long *save_addr = (vu_long *)(MPC5XXX_SRAM + MPC5XXX_SRAM_POST_SIZE);
-       return *save_addr;
-}
-#endif /* CONFIG_POST || CONFIG_LOGBUFFER */
-
-
-#ifdef CONFIG_MISC_INIT_R
-int misc_init_r(void)
-{
-#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
-       uchar buf[6];
-       char str[18];
-
-       /* Read ethaddr from EEPROM */
-       if (i2c_read(CFG_I2C_EEPROM, CONFIG_MAC_OFFSET, 2, buf, 6) == 0) {
-               sprintf(str, "%02X:%02X:%02X:%02X:%02X:%02X",
-                       buf[0], buf[1], buf[2], buf[3], buf[4], buf[5]);
-               /* Check if MAC addr is owned by Schindler */
-               if (strstr(str, "00:06:C3") != str) {
-                       printf(LOG_PREFIX "Warning - Illegal MAC address (%s)"
-                               " in EEPROM.\n", str);
-                       printf(LOG_PREFIX "Using MAC from environment\n");
-               } else {
-                       printf(LOG_PREFIX "Using MAC (%s) from I2C EEPROM\n",
-                               str);
-                       setenv("ethaddr", str);
-               }
-       } else {
-               printf(LOG_PREFIX "Warning - Unable to read MAC from I2C"
-                       " device at address %02X:%04X\n", CFG_I2C_EEPROM,
-                       CONFIG_MAC_OFFSET);
-               printf(LOG_PREFIX "Using MAC from environment\n");
-       }
-       return 0;
-#endif /* defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C) */
-}
-#endif /* CONFIG_MISC_INIT_R */
-
-
-#ifdef CONFIG_LAST_STAGE_INIT
-int last_stage_init(void)
-{
-#ifdef CONFIG_USB_STORAGE
-       cm1_fwupdate();
-#endif /* CONFIG_USB_STORAGE */
-       return 0;
-}
-#endif /* CONFIG_LAST_STAGE_INIT */
-
-
-#if defined(CONFIG_OF_FLAT_TREE) && defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
-{
-       ft_cpu_setup(blob, bd);
-}
-#endif /* defined(CONFIG_OF_FLAT_TREE) && defined(CONFIG_OF_BOARD_SETUP) */
diff --git a/board/cm1_qp1/cmd_cm1_qp1.c b/board/cm1_qp1/cmd_cm1_qp1.c
deleted file mode 100644 (file)
index 4a01d2a..0000000
+++ /dev/null
@@ -1,446 +0,0 @@
-/*
- *  (C) Copyright 2007 Markus Kappeler <markus.kappeler@objectxp.com>
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-#include <common.h>
-#include <command.h>
-#include <i2c.h>
-#include <usb.h>
-
-#if (CONFIG_COMMANDS & CFG_CMD_BSP)
-
-int do_i2c(char *argv[])
-{
-       unsigned char temp, temp1;
-
-       printf("Starting I2C Test\n"
-               "Please set Jumper:\nI2C SDA 2-3\nI2C SCL 2-3\n\n"
-               "Please press any key to start\n\n");
-       getc();
-
-       temp = 0xf0; /* set io 0-4 as output */
-       i2c_write(CFG_I2C_IO, 3, 1, (uchar *)&temp, 1);
-
-       printf("Press I2C4-7. LED I2C0-3 should have the same state\n\n"
-               "Press any key to stop\n\n");
-
-       while (!tstc()) {
-               i2c_read(CFG_I2C_IO, 0, 1, (uchar *)&temp, 1);
-               temp1 = (temp >> 4) & 0x03;
-               temp1 |= (temp >> 3) & 0x08; /* S302 -> LED303 */
-               temp1 |= (temp >> 5) & 0x04; /* S303 -> LED302 */
-               temp = temp1;
-               i2c_write(CFG_I2C_IO, 1, 1, (uchar *)&temp, 1);
-       }
-       getc();
-
-       return 0;
-}
-
-int do_usbtest(char *argv[])
-{
-       int i;
-       static int usb_stor_curr_dev = -1; /* current device */
-
-       printf("Starting USB Test\n"
-               "Please insert USB Memmory Stick\n\n"
-               "Please press any key to start\n\n");
-       getc();
-
-       usb_stop();
-       printf("(Re)start USB...\n");
-       i = usb_init();
-#ifdef CONFIG_USB_STORAGE
-               /* try to recognize storage devices immediately */
-               if (i >= 0)
-                       usb_stor_curr_dev = usb_stor_scan(1);
-#endif /* CONFIG_USB_STORAGE */
-       if (usb_stor_curr_dev >= 0)
-               printf("Found USB Storage Dev continue with Test...\n");
-       else {
-               printf("No USB Storage Device detected.. Stop Test\n");
-               return 1;
-       }
-
-       usb_stor_info();
-
-       printf("stopping USB..\n");
-       usb_stop();
-
-       return 0;
-}
-
-int do_led(char *argv[])
-{
-       int i = 0;
-       struct mpc5xxx_gpt_0_7 *gpt = (struct mpc5xxx_gpt_0_7 *)MPC5XXX_GPT;
-
-       printf("Starting LED Test\n"
-               "Please set Switch S500 all off\n\n"
-               "Please press any key to start\n\n");
-       getc();
-
-       /* configure timer 2-3 for simple GPIO output High */
-       gpt->gpt2.emsr |= 0x00000034;
-       gpt->gpt3.emsr |= 0x00000034;
-
-       (*(vu_long *)MPC5XXX_WU_GPIO_ENABLE) |= 0x80000000;
-       (*(vu_long *)MPC5XXX_WU_GPIO_DIR) |= 0x80000000;
-       printf("Please press any key to stop\n\n");
-       while (!tstc()) {
-               if (i == 1) {
-                       (*(vu_long *)MPC5XXX_WU_GPIO_DATA_O) |= 0x80000000;
-                       gpt->gpt2.emsr &= ~0x00000010;
-                       gpt->gpt3.emsr &= ~0x00000010;
-               } else if (i == 2) {
-                       (*(vu_long *)MPC5XXX_WU_GPIO_DATA_O) &= ~0x80000000;
-                       gpt->gpt2.emsr &= ~0x00000010;
-                       gpt->gpt3.emsr |= 0x00000010;
-               } else if (i >= 3) {
-                       (*(vu_long *)MPC5XXX_WU_GPIO_DATA_O) &= ~0x80000000;
-                       gpt->gpt3.emsr &= ~0x00000010;
-                       gpt->gpt2.emsr |= 0x00000010;
-                       i = 0;
-               }
-               i++;
-               udelay(200000);
-       }
-       getc();
-
-       (*(vu_long *)MPC5XXX_WU_GPIO_DATA_O) |= 0x80000000;
-       gpt->gpt2.emsr |= 0x00000010;
-       gpt->gpt3.emsr |= 0x00000010;
-
-       return 0;
-}
-
-int do_rs232(char *argv[])
-{
-       int error_status = 0;
-       struct mpc5xxx_gpio *gpio = (struct mpc5xxx_gpio *)MPC5XXX_GPIO;
-       struct mpc5xxx_psc *psc1 = (struct mpc5xxx_psc *)MPC5XXX_PSC1;
-
-       /* Configure PSC 2-3-6 as GPIO */
-       gpio->port_config &= 0xFF0FF80F;
-
-       switch (simple_strtoul(argv[2], NULL, 10)) {
-       case 1:
-               /* check RTS <-> CTS loop */
-               /* set rts to 0 */
-               printf("Uart 1 test: RX TX tested by using U-Boot\n"
-                       "Please connect RTS with CTS on Uart1 plug\n\n"
-                       "Press any key to start\n\n");
-               getc();
-
-               psc1->op1 |= 0x01;
-
-               /* wait some time before requesting status */
-               udelay(10);
-
-               /* check status at cts */
-               if ((psc1->ip & 0x01) != 0) {
-                       error_status = 3;
-                       printf("%s: failure at rs232_1, cts status is %d "
-                               "(should be 0)\n",
-                               __FUNCTION__, (psc1->ip & 0x01));
-               }
-
-               /* set rts to 1 */
-               psc1->op0 |= 0x01;
-
-               /* wait some time before requesting status */
-               udelay(10);
-
-               /* check status at cts */
-               if ((psc1->ip & 0x01) != 1) {
-                       error_status = 3;
-                       printf("%s: failure at rs232_1, cts status is %d "
-                               "(should be 1)\n",
-                               __FUNCTION__, (psc1->ip & 0x01));
-               }
-               break;
-       case 2:
-               /* set PSC2_0, PSC2_2 as output and PSC2_1, PSC2_3 as input */
-               printf("Uart 2 test: Please use RS232 Loopback plug on UART2\n"
-                       "\nPress any key to start\n\n");
-               getc();
-
-               gpio->simple_gpioe &= ~(0x000000F0);
-               gpio->simple_gpioe |= 0x000000F0;
-               gpio->simple_ddr &= ~(0x000000F0);
-               gpio->simple_ddr |= 0x00000050;
-
-               /* check TXD <-> RXD loop */
-               /* set TXD to 1 */
-               gpio->simple_dvo |= (1 << 4);
-
-               /* wait some time before requesting status */
-               udelay(10);
-
-               if ((gpio->simple_ival & 0x00000020) != 0x00000020) {
-                       error_status = 2;
-                       printf("%s: failure at rs232_2, rxd status is %d "
-                               "(should be 1)\n", __FUNCTION__,
-                               (gpio->simple_ival & 0x00000020) >> 5);
-               }
-
-               /* set TXD to 0 */
-               gpio->simple_dvo &= ~(1 << 4);
-
-               /* wait some time before requesting status */
-               udelay(10);
-
-               if ((gpio->simple_ival & 0x00000020) != 0x00000000) {
-                       error_status = 2;
-                       printf("%s: failure at rs232_2, rxd status is %d "
-                               "(should be 0)\n", __FUNCTION__,
-                               (gpio->simple_ival & 0x00000020) >> 5);
-               }
-
-               /* check RTS <-> CTS loop */
-               /* set RTS to 1 */
-               gpio->simple_dvo |= (1 << 6);
-
-               /* wait some time before requesting status */
-               udelay(10);
-
-               if ((gpio->simple_ival & 0x00000080) != 0x00000080) {
-                       error_status = 3;
-                       printf("%s: failure at rs232_2, cts status is %d "
-                               "(should be 1)\n", __FUNCTION__,
-                               (gpio->simple_ival & 0x00000080) >> 7);
-               }
-
-               /* set RTS to 0 */
-               gpio->simple_dvo &= ~(1 << 6);
-
-               /* wait some time before requesting status */
-               udelay(10);
-
-               if ((gpio->simple_ival & 0x00000080) != 0x00000000) {
-                       error_status = 3;
-                       printf("%s: failure at rs232_2, cts status is %d "
-                               "(should be 0)\n", __FUNCTION__,
-                               (gpio->simple_ival & 0x00000080) >> 7);
-               }
-               break;
-       case 3:
-               /* set PSC3_0, PSC3_2 as output and PSC3_1, PSC3_3 as input */
-               printf("Uart 3 test: Please use RS232 Loopback plug on UART2\n"
-                       "\nPress any key to start\n\n");
-               getc();
-
-               gpio->simple_gpioe &= ~(0x00000F00);
-               gpio->simple_gpioe |= 0x00000F00;
-
-               gpio->simple_ddr &= ~(0x00000F00);
-               gpio->simple_ddr |= 0x00000500;
-
-               /* check TXD <-> RXD loop */
-               /* set TXD to 1 */
-               gpio->simple_dvo |= (1 << 8);
-
-               /* wait some time before requesting status */
-               udelay(10);
-
-               if ((gpio->simple_ival & 0x00000200) != 0x00000200) {
-                       error_status = 2;
-                       printf("%s: failure at rs232_3, rxd status is %d "
-                               "(should be 1)\n", __FUNCTION__,
-                               (gpio->simple_ival & 0x00000200) >> 9);
-               }
-
-               /* set TXD to 0 */
-               gpio->simple_dvo &= ~(1 << 8);
-
-               /* wait some time before requesting status */
-               udelay(10);
-
-               if ((gpio->simple_ival & 0x00000200) != 0x00000000) {
-                       error_status = 2;
-                       printf("%s: failure at rs232_3, rxd status is %d "
-                               "(should be 0)\n", __FUNCTION__,
-                               (gpio->simple_ival & 0x00000200) >> 9);
-               }
-
-               /* check RTS <-> CTS loop */
-               /* set RTS to 1 */
-               gpio->simple_dvo |= (1 << 10);
-
-               /* wait some time before requesting status */
-               udelay(10);
-
-               if ((gpio->simple_ival & 0x00000800) != 0x00000800) {
-                       error_status = 3;
-                       printf("%s: failure at rs232_3, cts status is %d "
-                               "(should be 1)\n", __FUNCTION__,
-                               (gpio->simple_ival & 0x00000800) >> 11);
-               }
-
-               /* set RTS to 0 */
-               gpio->simple_dvo &= ~(1 << 10);
-
-               /* wait some time before requesting status */
-               udelay(10);
-
-               if ((gpio->simple_ival & 0x00000800) != 0x00000000) {
-                       error_status = 3;
-                       printf("%s: failure at rs232_3, cts status is %d "
-                               "(should be 0)\n", __FUNCTION__,
-                               (gpio->simple_ival & 0x00000800) >> 11);
-               }
-               break;
-       case 4:
-               /* set PSC6_2, PSC6_3 as output and PSC6_0, PSC6_1 as input */
-               printf("Uart 4 test: Please use RS232 Loopback plug on UART2\n"
-                       "\nPress any key to start\n\n");
-               getc();
-
-               gpio->simple_gpioe &= ~(0xF0000000);
-               gpio->simple_gpioe |= 0x30000000;
-
-               gpio->simple_ddr &= ~(0xf0000000);
-               gpio->simple_ddr |= 0x30000000;
-
-               (*(vu_long *)MPC5XXX_WU_GPIO_ENABLE) |= 0x30000000;
-               (*(vu_long *)MPC5XXX_WU_GPIO_DIR) &= ~(0x30000000);
-
-               /* check TXD <-> RXD loop */
-               /* set TXD to 1 */
-               gpio->simple_dvo |= (1 << 28);
-
-               /* wait some time before requesting status */
-               udelay(10);
-
-               if (((*(vu_long *)MPC5XXX_WU_GPIO_DATA_I) & 0x10000000) !=
-                               0x10000000) {
-                       error_status = 2;
-                       printf("%s: failure at rs232_4, rxd status is %d "
-                               "(should be 1)\n", __FUNCTION__,
-                               ((*(vu_long *)MPC5XXX_WU_GPIO_DATA_I) &
-                                       0x10000000) >> 28);
-               }
-
-               /* set TXD to 0 */
-               gpio->simple_dvo &= ~(1 << 28);
-
-               /* wait some time before requesting status */
-               udelay(10);
-
-               if (((*(vu_long *)MPC5XXX_WU_GPIO_DATA_I) & 0x10000000) !=
-                               0x00000000) {
-                       error_status = 2;
-                       printf("%s: failure at rs232_4, rxd status is %d "
-                               "(should be 0)\n", __FUNCTION__,
-                               ((*(vu_long *)MPC5XXX_WU_GPIO_DATA_I) &
-                                       0x10000000) >> 28);
-               }
-
-               /* check RTS <-> CTS loop */
-               /* set RTS to 1 */
-               gpio->simple_dvo |= (1 << 29);
-
-               /* wait some time before requesting status */
-               udelay(10);
-
-               if (((*(vu_long *)MPC5XXX_WU_GPIO_DATA_I) & 0x20000000) !=
-                               0x20000000) {
-                       error_status = 3;
-                       printf("%s: failure at rs232_4, cts status is %d "
-                               "(should be 1)\n", __FUNCTION__,
-                               ((*(vu_long *)MPC5XXX_WU_GPIO_DATA_I) &
-                                       0x20000000) >> 29);
-               }
-
-               /* set RTS to 0 */
-               gpio->simple_dvo &= ~(1 << 29);
-
-               /* wait some time before requesting status */
-               udelay(10);
-
-               if (((*(vu_long *)MPC5XXX_WU_GPIO_DATA_I) & 0x20000000) !=
-                               0x00000000) {
-                       error_status = 3;
-                       printf("%s: failure at rs232_4, cts status is %d "
-                               "(should be 0)\n", __FUNCTION__,
-                               ((*(vu_long *)MPC5XXX_WU_GPIO_DATA_I) &
-                                       0x20000000) >> 29);
-               }
-               break;
-       default:
-               printf("%s: invalid rs232 number %s\n", __FUNCTION__, argv[2]);
-               error_status = 1;
-               break;
-       }
-       gpio->port_config |= (CFG_GPS_PORT_CONFIG & 0xFF0FF80F);
-
-       return error_status;
-}
-
-int cmd_fkt(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
-{
-       int rcode = -1;
-
-       switch (argc) {
-       case 2:
-               if (strncmp(argv[1], "i2c", 3) == 0)
-                       rcode = do_i2c(argv);
-               else if (strncmp(argv[1], "led", 3) == 0)
-                       rcode = do_led(argv);
-               else if (strncmp(argv[1], "usb", 3) == 0)
-                       rcode = do_usbtest(argv);
-               break;
-       case 3:
-               if (strncmp(argv[1], "rs232", 3) == 0)
-                       rcode = do_rs232(argv);
-               break;
-       }
-
-       switch (rcode) {
-       case -1:
-               printf("Usage:\n"
-                       "fkt { i2c | led | usb }\n"
-                       "fkt rs232 number\n");
-               rcode = 1;
-               break;
-       case 0:
-               printf("Test passed\n");
-               break;
-       default:
-               printf("Test failed with code: %d\n", rcode);
-       }
-
-       return rcode;
-}
-
-U_BOOT_CMD(
-       fkt,    4,      1,      cmd_fkt,
-       "fkt     - Function test routines\n",
-       "i2c\n"
-       "     - Test I2C communication\n"
-       "fkt led\n"
-       "     - Test LEDs\n"
-       "fkt rs232 number\n"
-       "     - Test RS232 (loopback plug(s) for RS232 required)\n"
-       "fkt usb\n"
-       "     - Test USB communication\n"
-);
-#endif /* CFG_CMD_BSP */
diff --git a/board/cm1_qp1/config.mk b/board/cm1_qp1/config.mk
deleted file mode 100644 (file)
index 7f06139..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# (C) Copyright 2007
-# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
-#
-# See file CREDITS for list of people who contributed to this
-# project.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-# MA 02111-1307 USA
-#
-
-TEXT_BASE = 0xfc000000
-
-PLATFORM_CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE) -I$(TOPDIR)/board
diff --git a/board/cm1_qp1/fwupdate.c b/board/cm1_qp1/fwupdate.c
deleted file mode 100644 (file)
index 637375e..0000000
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * (C) Copyright 2007 Schindler Lift Inc.
- * (C) Copyright 2007 Semihalf
- *
- * Author: Michel Marti <mma@objectxp.com>
- * Adapted for U-Boot 1.2 by Piotr Kruszynski <ppk@semihalf.com>:
- * - code clean-up
- * - bugfix for overwriting bootargs by user
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-#include <common.h>
-#include <command.h>
-#include <malloc.h>
-#include <image.h>
-#include <usb.h>
-#include <fat.h>
-
-#include "fwupdate.h"
-
-extern int do_bootm(cmd_tbl_t *, int, int, char *[]);
-extern long do_fat_read(const char *, void *, unsigned long, int);
-extern int do_fat_fsload(cmd_tbl_t *, int, int, char *[]);
-
-static int load_rescue_image(ulong);
-
-void cm1_fwupdate(void)
-{
-       cmd_tbl_t *bcmd;
-       char *rsargs;
-       char *tmp = NULL;
-       char ka[16];
-       char *argv[3] = { "bootm", ka, NULL };
-
-       /* Check if rescue system is disabled... */
-       if (getenv("norescue")) {
-               printf(LOG_PREFIX "Rescue System disabled.\n");
-               return;
-       }
-
-       /* Check if we have a USB storage device and load image */
-       if (load_rescue_image(LOAD_ADDR))
-               return;
-
-       bcmd = find_cmd("bootm");
-       if (!bcmd)
-               return;
-
-       sprintf(ka, "%lx", LOAD_ADDR);
-
-       /* prepare our bootargs */
-       rsargs = getenv("rs-args");
-       if (!rsargs)
-               rsargs = RS_BOOTARGS;
-       else {
-               tmp = malloc(strlen(rsargs+1));
-               if (!tmp) {
-                       printf(LOG_PREFIX "Memory allocation failed\n");
-                       return;
-               }
-               strcpy(tmp, rsargs);
-               rsargs = tmp;
-       }
-
-       setenv("bootargs", rsargs);
-
-       if (rsargs == tmp)
-               free(rsargs);
-
-       printf(LOG_PREFIX "Starting update system (bootargs=%s)...\n", rsargs);
-       do_bootm(bcmd, 0, 2, argv);
-}
-
-static int load_rescue_image(ulong addr)
-{
-       disk_partition_t info;
-       int devno;
-       int partno;
-       int i;
-       char fwdir[64];
-       char nxri[128];
-       char *tmp;
-       char dev[7];
-       char addr_str[16];
-       char *argv[6] = { "fatload", "usb", dev, addr_str, nxri, NULL };
-       block_dev_desc_t *stor_dev = NULL;
-       cmd_tbl_t *bcmd;
-
-       /* Get name of firmware directory */
-       tmp = getenv("fw-dir");
-
-       /* Copy it into fwdir */
-       strncpy(fwdir, tmp ? tmp : FW_DIR, sizeof(fwdir));
-       fwdir[sizeof(fwdir) - 1] = 0; /* Terminate string */
-
-       printf(LOG_PREFIX "Checking for firmware image directory '%s' on USB"
-               " storage...\n", fwdir);
-       usb_stop();
-       if (usb_init() != 0)
-               return 1;
-
-       /* Check for storage device */
-       if (usb_stor_scan(1) != 0) {
-               usb_stop();
-               return 1;
-       }
-
-       /* Detect storage device */
-       for (devno = 0; devno < USB_MAX_STOR_DEV; devno++) {
-               stor_dev = usb_stor_get_dev(devno);
-               if (stor_dev->type != DEV_TYPE_UNKNOWN)
-                       break;
-       }
-       if (!stor_dev || stor_dev->type == DEV_TYPE_UNKNOWN) {
-               printf(LOG_PREFIX "No valid storage device found...\n");
-               usb_stop();
-               return 1;
-       }
-
-       /* Detect partition */
-       for (partno = -1, i = 0; i < 6; i++) {
-               if (get_partition_info(stor_dev, i, &info) == 0) {
-                       if (fat_register_device(stor_dev, i) == 0) {
-                               /* Check if rescue image is present */
-                               FW_DEBUG("Looking for firmware directory '%s'"
-                                       " on partition %d\n", fwdir, i);
-                               if (do_fat_read(fwdir, NULL, 0, LS_NO) == -1) {
-                                       FW_DEBUG("No NX rescue image on "
-                                               "partition %d.\n", i);
-                               } else {
-                                       partno = i;
-                                       FW_DEBUG("Partition %d contains "
-                                               "firmware directory\n", partno);
-                                       break;
-                               }
-                       }
-               }
-       }
-
-       if (partno == -1) {
-               printf(LOG_PREFIX "Error: No valid (FAT) partition detected\n");
-               usb_stop();
-               return 1;
-       }
-
-       /* Load the rescue image */
-       bcmd = find_cmd("fatload");
-       if (!bcmd) {
-               printf(LOG_PREFIX "Error - 'fatload' command not present.\n");
-               usb_stop();
-               return 1;
-       }
-
-       tmp = getenv("nx-rescue-image");
-       sprintf(nxri, "%s/%s", fwdir, tmp ? tmp : RESCUE_IMAGE);
-       sprintf(dev, "%d:%d", devno, partno);
-       sprintf(addr_str, "%lx", addr);
-
-       FW_DEBUG("fat_fsload device='%s', addr='%s', file: %s\n",
-               dev, addr_str, nxri);
-
-       if (do_fat_fsload(bcmd, 0, 5, argv) != 0) {
-               usb_stop();
-               return 1;
-       }
-
-       /* Stop USB */
-       usb_stop();
-       return 0;
-}
diff --git a/board/cm1_qp1/fwupdate.h b/board/cm1_qp1/fwupdate.h
deleted file mode 100644 (file)
index 119c2d6..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * (C) Copyright 2007 Schindler Lift Inc.
- *
- * Author: Michel Marti <mma@objectxp.com>
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-#ifndef __FW_UPDATE_H
-#define __FW_UPDATE_H
-
-/* Default prefix for output messages */
-#define LOG_PREFIX     "CM1:   "
-
-/* Extra debug macro */
-#ifdef CONFIG_FWUPDATE_DEBUG
-#define FW_DEBUG(fmt...) printf(LOG_PREFIX fmt)
-#else
-#define FW_DEBUG(fmt...)
-#endif
-
-/* Name of the directory holding firmware images */
-#define FW_DIR         "nx-fw"
-#define RESCUE_IMAGE   "nxrs.img"
-#define LOAD_ADDR      0x400000
-#define RS_BOOTARGS    "ramdisk=8192K"
-
-/* Main function for fwupdate */
-void cm1_fwupdate(void);
-
-#endif /* __FW_UPDATE_H */
diff --git a/board/cm1_qp1/u-boot.lds b/board/cm1_qp1/u-boot.lds
deleted file mode 100644 (file)
index 8fa9c0f..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * (C) Copyright 2003-2007
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc5xxx/start.o        (.text)
-    *(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
diff --git a/board/cm5200/Makefile b/board/cm5200/Makefile
new file mode 100644 (file)
index 0000000..8ebdb1a
--- /dev/null
@@ -0,0 +1,50 @@
+#
+# (C) Copyright 2003-2007
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB    = $(obj)lib$(BOARD).a
+
+COBJS  := $(BOARD).o cmd_cm5200.o fwupdate.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
+       $(AR) $(ARFLAGS) $@ $(OBJS)
+
+clean:
+       rm -f $(SOBJS) $(OBJS)
+
+distclean:     clean
+       rm -f $(LIB) core *.bak .depend
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
diff --git a/board/cm5200/cm5200.c b/board/cm5200/cm5200.c
new file mode 100644 (file)
index 0000000..6804e33
--- /dev/null
@@ -0,0 +1,425 @@
+/*
+ * (C) Copyright 2003-2007
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * (C) Copyright 2004
+ * Mark Jonas, Freescale Semiconductor, mark.jonas@motorola.com.
+ *
+ * (C) Copyright 2004-2005
+ * Martin Krause, TQ-Systems GmbH, martin.krause@tqs.de
+ *
+ * Adapted to U-Boot 1.2 by:
+ *   Bartlomiej Sieka <tur@semihalf.com>:
+ *      - HW ID readout from EEPROM
+ *      - module detection
+ *   Grzegorz Bernacki <gjb@semihalf.com>:
+ *      - run-time SDRAM controller configuration
+ *      - LIBFDT support
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <common.h>
+#include <mpc5xxx.h>
+#include <pci.h>
+#include <asm/processor.h>
+#include <i2c.h>
+#include <linux/ctype.h>
+
+#ifdef CONFIG_OF_LIBFDT
+#include <libfdt.h>
+#include <libfdt_env.h>
+#include <fdt_support.h>
+#endif /* CONFIG_OF_LIBFDT */
+
+
+#include "cm5200.h"
+#include "fwupdate.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+static hw_id_t hw_id;
+
+
+#ifndef CFG_RAMBOOT
+/*
+ * Helper function to initialize SDRAM controller.
+ */
+static void sdram_start(int hi_addr, mem_conf_t *mem_conf)
+{
+       long hi_addr_bit = hi_addr ? 0x01000000 : 0;
+
+       /* unlock mode register */
+       *(vu_long *)MPC5XXX_SDRAM_CTRL = mem_conf->control | 0x80000000 |
+                                               hi_addr_bit;
+
+       /* precharge all banks */
+       *(vu_long *)MPC5XXX_SDRAM_CTRL = mem_conf->control | 0x80000002 |
+                                               hi_addr_bit;
+
+       /* auto refresh */
+       *(vu_long *)MPC5XXX_SDRAM_CTRL = mem_conf->control | 0x80000004 |
+                                               hi_addr_bit;
+
+       /* auto refresh, second time */
+       *(vu_long *)MPC5XXX_SDRAM_CTRL = mem_conf->control | 0x80000004 |
+                                               hi_addr_bit;
+
+       /* set mode register */
+       *(vu_long *)MPC5XXX_SDRAM_MODE = mem_conf->mode;
+
+       /* normal operation */
+       *(vu_long *)MPC5XXX_SDRAM_CTRL = mem_conf->control | hi_addr_bit;
+}
+#endif /* CFG_RAMBOOT */
+
+
+/*
+ * Retrieve memory configuration for a given module. board_type is the index
+ * in hw_id_list[] corresponding to the module we are executing on; we return
+ * SDRAM controller settings approprate for this module.
+ */
+static mem_conf_t* get_mem_config(int board_type)
+{
+       switch(board_type){
+               case CM1_QA:
+                       return memory_config[0];
+               case CM11_QA:
+               case CMU1_QA:
+                       return memory_config[1];
+               default:
+                       printf("ERROR: Unknown module, using a default SDRAM "
+                               "configuration - things may not work!!!.\n");
+                       return memory_config[0];
+       }
+}
+
+
+/*
+ * Initalize SDRAM - configure SDRAM controller, detect memory size.
+ */
+long int initdram(int board_type)
+{
+       ulong dramsize = 0;
+#ifndef CFG_RAMBOOT
+       ulong test1, test2;
+       mem_conf_t *mem_conf;
+
+       mem_conf = get_mem_config(board_type);
+       
+       /* configure SDRAM start/end for detection */
+       *(vu_long *)MPC5XXX_SDRAM_CS0CFG = 0x0000001e; /* 2G at 0x0 */
+
+       /* setup config registers */
+       *(vu_long *)MPC5XXX_SDRAM_CONFIG1 = mem_conf->config1;
+       *(vu_long *)MPC5XXX_SDRAM_CONFIG2 = mem_conf->config2;
+
+       sdram_start(0, mem_conf);
+       test1 = get_ram_size((long *)CFG_SDRAM_BASE, 0x80000000);
+       sdram_start(1, mem_conf);
+       test2 = get_ram_size((long *)CFG_SDRAM_BASE, 0x80000000);
+       if (test1 > test2) {
+               sdram_start(0, mem_conf);
+               dramsize = test1;
+       } else
+               dramsize = test2;
+
+       /* memory smaller than 1MB is impossible */
+       if (dramsize < (1 << 20))
+               dramsize = 0;
+
+       /* set SDRAM CS0 size according to the amount of RAM found */
+       if (dramsize > 0) {
+               *(vu_long *)MPC5XXX_SDRAM_CS0CFG = 0x13 +
+                       __builtin_ffs(dramsize >> 20) - 1;
+       } else
+               *(vu_long *)MPC5XXX_SDRAM_CS0CFG = 0; /* disabled */
+#else /* CFG_RAMBOOT */
+       /* retrieve size of memory connected to SDRAM CS0 */
+       dramsize = *(vu_long *)MPC5XXX_SDRAM_CS0CFG & 0xFF;
+       if (dramsize >= 0x13)
+               dramsize = (1 << (dramsize - 0x13)) << 20;
+       else
+               dramsize = 0;
+#endif /* !CFG_RAMBOOT */
+
+       /*
+        * On MPC5200B we need to set the special configuration delay in the
+        * DDR controller.  Refer to chapter 8.7.5 SDelay--MBAR + 0x0190 of
+        * the MPC5200B User's Manual.
+        */
+       *(vu_long *)MPC5XXX_SDRAM_SDELAY = 0x04;
+       __asm__ volatile ("sync");
+
+       return dramsize;
+}
+
+
+/*
+ * Read module hardware identification data from the I2C EEPROM.
+ */
+static void read_hw_id(hw_id_t hw_id)
+{
+       int i;
+       for (i = 0; i < HW_ID_ELEM_COUNT; ++i)
+               if (i2c_read(CFG_I2C_EEPROM,
+                               hw_id_format[i].offset,
+                               2,
+                               (uchar *)&hw_id[i][0],
+                               hw_id_format[i].length) != 0)
+                       printf("ERROR: can't read HW ID from EEPROM\n");
+}
+
+
+/*
+ * Identify module we are running on, set gd->board_type to the index in
+ * hw_id_list[] corresponding to the module identifed, or to
+ * CM5200_UNKNOWN_MODULE if we can't identify the module.
+ */
+static void identify_module(hw_id_t hw_id)
+{
+       int i, j, element;
+       char match;
+       gd->board_type = CM5200_UNKNOWN_MODULE;
+       for (i = 0; i < sizeof (hw_id_list) / sizeof (char **); ++i) {
+               match = 1;
+               for (j = 0; j < sizeof (hw_id_identify) / sizeof (int); ++j) {
+                       element = hw_id_identify[j];
+                       if (strncmp(hw_id_list[i][element],
+                                       &hw_id[element][0],
+                                       hw_id_format[element].length) != 0) {
+                               match = 0;
+                               break;
+                       }
+               }
+               if (match) {
+                       gd->board_type = i;
+                       break;
+               }
+       }
+}
+
+
+/*
+ * Compose string with module name.
+ * buf is assumed to have enough space, and be null-terminated.
+ */
+static void compose_module_name(hw_id_t hw_id, char *buf)
+{
+       char tmp[MODULE_NAME_MAXLEN];
+       strncat(buf, &hw_id[PCB_NAME][0], hw_id_format[PCB_NAME].length);
+       strncat(buf, ".", 1);
+       strncat(buf, &hw_id[FORM][0], hw_id_format[FORM].length);
+       strncat(buf, &hw_id[VERSION][0], hw_id_format[VERSION].length);
+       strncat(buf, " (", 2);
+       strncat(buf, &hw_id[IDENTIFICATION_NUMBER][0],
+               hw_id_format[IDENTIFICATION_NUMBER].length);
+       sprintf(tmp, " / %u.%u)",
+               hw_id[MAJOR_SW_VERSION][0],
+               hw_id[MINOR_SW_VERSION][0]);
+       strcat(buf, tmp);
+}
+
+
+/*
+ * Compose string with hostname.
+ * buf is assumed to have enough space, and be null-terminated.
+ */
+static void compose_hostname(hw_id_t hw_id, char *buf)
+{
+       char *p;
+       strncat(buf, &hw_id[PCB_NAME][0], hw_id_format[PCB_NAME].length);
+       strncat(buf, "_", 1);
+       strncat(buf, &hw_id[FORM][0], hw_id_format[FORM].length);
+       strncat(buf, &hw_id[VERSION][0], hw_id_format[VERSION].length);
+       for (p = buf; *p; ++p)
+               *p = tolower(*p);
+
+}
+
+
+#if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT)
+/*
+ * Update 'model' and 'memory' properties in the blob according to the module
+ * that we are running on.
+ */
+static void ft_blob_update(void *blob, bd_t *bd)
+{
+       int len, ret, nodeoffset = 0;
+       char module_name[MODULE_NAME_MAXLEN] = {0};
+       ulong memory_data[2] = {0};
+
+       compose_module_name(hw_id, module_name);
+       len = strlen(module_name) + 1;
+
+       ret = fdt_setprop(blob, nodeoffset, "model", module_name, len);
+       if (ret < 0)
+       printf("ft_blob_update(): cannot set /model property err:%s\n",
+               fdt_strerror(ret));
+
+       memory_data[0] = cpu_to_be32(bd->bi_memstart);
+       memory_data[1] = cpu_to_be32(bd->bi_memsize);
+
+       nodeoffset = fdt_find_node_by_path (blob, "/memory");
+       if (nodeoffset >= 0) {
+               ret = fdt_setprop(blob, nodeoffset, "reg", memory_data,
+                                       sizeof(memory_data));
+       if (ret < 0)
+               printf("ft_blob_update): cannot set /memory/reg "
+                       "property err:%s\n", fdt_strerror(ret));
+       }
+       else {
+               /* memory node is required in dts */
+               printf("ft_blob_update(): cannot find /memory node "
+               "err:%s\n", fdt_strerror(nodeoffset));
+       }
+}
+#endif /* defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT) */
+
+
+/*
+ * Read HW ID from I2C EEPROM and detect the modue we are running on. Note
+ * that we need to use local variable for readout, because global data is not
+ * writable yet (and we'll have to redo the readout later on).
+ */
+int checkboard(void)
+{
+       hw_id_t hw_id_tmp;
+       char module_name_tmp[MODULE_NAME_MAXLEN] = "";
+
+       /* 
+        * We need I2C to access HW ID data from EEPROM, so we call i2c_init()
+        * here despite the fact that it will be called again later on. We
+        * also use a little trick to silence I2C-related output.
+        */
+       gd->flags |= GD_FLG_SILENT;
+       i2c_init (CFG_I2C_SPEED, CFG_I2C_SLAVE);
+       gd->flags &= ~GD_FLG_SILENT;
+
+       read_hw_id(hw_id_tmp);
+       identify_module(hw_id_tmp);     /* this sets gd->board_type */
+       compose_module_name(hw_id_tmp, module_name_tmp);
+
+       if (gd->board_type != CM5200_UNKNOWN_MODULE)
+               printf("Board: %s\n", module_name_tmp);
+       else
+               printf("Board: unrecognized cm5200 module (%s)\n",
+                       module_name_tmp);
+       
+       return 0;
+}
+
+
+int board_early_init_r(void)
+{
+       /*
+        * Now, when we are in RAM, enable flash write access for detection
+        * process. Note that CS_BOOT cannot be cleared when executing in
+        * flash.
+        */
+       *(vu_long *)MPC5XXX_BOOTCS_CFG &= ~0x1; /* clear RO */
+
+       /* Now that we can write to global data, read HW ID again. */
+       read_hw_id(hw_id);
+       return 0;
+}
+
+
+#ifdef CONFIG_POST
+int post_hotkeys_pressed(void)
+{
+       return 0;
+}
+#endif /* CONFIG_POST */
+
+
+#if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER)
+void post_word_store(ulong a)
+{
+       vu_long *save_addr = (vu_long *)(MPC5XXX_SRAM + MPC5XXX_SRAM_POST_SIZE);
+       *save_addr = a;
+}
+
+
+ulong post_word_load(void)
+{
+       vu_long *save_addr = (vu_long *)(MPC5XXX_SRAM + MPC5XXX_SRAM_POST_SIZE);
+       return *save_addr;
+}
+#endif /* CONFIG_POST || CONFIG_LOGBUFFER */
+
+
+#ifdef CONFIG_MISC_INIT_R
+int misc_init_r(void)
+{
+#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
+       uchar buf[6];
+       char str[18];
+       char hostname[MODULE_NAME_MAXLEN];
+
+       /* Read ethaddr from EEPROM */
+       if (i2c_read(CFG_I2C_EEPROM, CONFIG_MAC_OFFSET, 2, buf, 6) == 0) {
+               sprintf(str, "%02X:%02X:%02X:%02X:%02X:%02X",
+                       buf[0], buf[1], buf[2], buf[3], buf[4], buf[5]);
+               /* Check if MAC addr is owned by Schindler */
+               if (strstr(str, "00:06:C3") != str)
+                       printf(LOG_PREFIX "Warning - Illegal MAC address (%s)"
+                               " in EEPROM.\n", str);
+               else {
+                       printf(LOG_PREFIX "Using MAC (%s) from I2C EEPROM\n",
+                               str);
+                       setenv("ethaddr", str);
+               }
+       } else {
+               printf(LOG_PREFIX "Warning - Unable to read MAC from I2C"
+                       " device at address %02X:%04X\n", CFG_I2C_EEPROM,
+                       CONFIG_MAC_OFFSET);
+       }
+#endif /* defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C) */
+       if (!getenv("ethaddr"))
+               printf(LOG_PREFIX "MAC address not set, networking is not "
+                                       "operational\n");
+
+       /* set the hostname appropriate to the module we're running on */
+       compose_hostname(hw_id, hostname);
+       setenv("hostname", hostname);
+
+       return 0;
+}
+#endif /* CONFIG_MISC_INIT_R */
+
+
+#ifdef CONFIG_LAST_STAGE_INIT
+int last_stage_init(void)
+{
+#ifdef CONFIG_USB_STORAGE
+       cm5200_fwupdate();
+#endif /* CONFIG_USB_STORAGE */
+       return 0;
+}
+#endif /* CONFIG_LAST_STAGE_INIT */
+
+
+#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
+void ft_board_setup(void *blob, bd_t *bd)
+{
+       ft_cpu_setup(blob, bd);
+       ft_blob_update(blob, bd);
+}
+#endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
diff --git a/board/cm5200/cm5200.h b/board/cm5200/cm5200.h
new file mode 100644 (file)
index 0000000..a6cbc88
--- /dev/null
@@ -0,0 +1,184 @@
+/*
+ * (C) Copyright 2007 DENX Software Engineering
+ *
+ * Author: Bartlomiej Sieka <tur@semihalf.com>
+ * Author: Grzegorz Bernacki <gjb@semihalf.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef _CM5200_H
+#define _CM5200_H
+
+
+/*
+ * Definitions and declarations for the modules of the cm5200 platform. Mostly
+ * related to reading the hardware identification data (HW ID) from the I2C
+ * EEPROM, detection of the particular module we are executing on, and
+ * appropriate SDRAM controller initialization.
+ */
+
+
+#define CM5200_UNKNOWN_MODULE  0xffffffff
+
+enum {
+       DEVICE_NAME,            /* 0 */
+       GENERATION,             /* 1 */
+       PCB_NAME,               /* 2 */
+       FORM,                   /* 3 */
+       VERSION,                /* 4 */
+       IDENTIFICATION_NUMBER,  /* 5 */
+       MAJOR_SW_VERSION,       /* 6 */
+       MINOR_SW_VERSION,       /* 7 */
+       /* add new alements above this line */
+       HW_ID_ELEM_COUNT        /* count */
+};
+
+/*
+ * Sect. 4.1 "CM1.Q/CMU1.Q Supervisory Microcontroller Interface Definition"
+ */
+
+#define DEVICE_NAME_OFFSET             0x02
+#define GENERATION_OFFSET              0x0b
+#define PCB_NAME_OFFSET                        0x0c
+#define FORM_OFFSET                    0x15
+#define VERSION_OFFSET                 0x16
+#define IDENTIFICATION_NUMBER_OFFSET   0x19
+#define MAJOR_SW_VERSION_OFFSET                0x0480
+#define MINOR_SW_VERSION_OFFSET                0x0481
+
+
+#define DEVICE_NAME_LEN                        0x09
+#define GENERATION_LEN                 0x01
+#define PCB_NAME_LEN                   0x09
+#define FORM_LEN                       0x01
+#define VERSION_LEN                    0x03
+#define IDENTIFICATION_NUMBER_LEN      0x09
+#define MAJOR_SW_VERSION_LEN           0x01
+#define MINOR_SW_VERSION_LEN           0x01
+
+#define HW_ID_ELEM_MAXLEN              0x09    /* MAX(XXX_LEN) */
+
+/* entire HW ID in EEPROM is 64 bytes, so longer module name is unlikely */
+#define MODULE_NAME_MAXLEN             64
+
+
+/* storage for HW ID read from EEPROM */
+typedef char hw_id_t[HW_ID_ELEM_COUNT][HW_ID_ELEM_MAXLEN];
+
+
+/* HW ID layout in EEPROM */
+static struct {
+       unsigned int offset;
+       unsigned int length;
+} hw_id_format[HW_ID_ELEM_COUNT] = {
+       {DEVICE_NAME_OFFSET,            DEVICE_NAME_LEN},
+       {GENERATION_OFFSET,             GENERATION_LEN},
+       {PCB_NAME_OFFSET,               PCB_NAME_LEN},
+       {FORM_OFFSET,                   FORM_LEN},
+       {VERSION_OFFSET,                VERSION_LEN},
+       {IDENTIFICATION_NUMBER_OFFSET,  IDENTIFICATION_NUMBER_LEN},
+       {MAJOR_SW_VERSION_OFFSET,       MAJOR_SW_VERSION_LEN},
+       {MINOR_SW_VERSION_OFFSET,       MINOR_SW_VERSION_LEN},
+};
+
+
+/* HW ID data found in EEPROM on supported modules */
+static char *cm1_qa_hw_id[HW_ID_ELEM_COUNT] = {
+       "CM",           /* DEVICE_NAME */
+       "1",            /* GENERATION */
+       "CM1",          /* PCB_NAME */
+       "Q",            /* FORM */
+       "A",            /* VERSION */
+       "591881",       /* IDENTIFICATION_NUMBER */
+       "",             /* MAJOR_SW_VERSION */
+       "",             /* MINOR_SW_VERSION */
+};
+
+static char *cm11_qa_hw_id[HW_ID_ELEM_COUNT] = {
+       "CM",           /* DEVICE_NAME */
+       "1",            /* GENERATION */
+       "CM11",         /* PCB_NAME */
+       "Q",            /* FORM */
+       "A",            /* VERSION */
+       "594200",       /* IDENTIFICATION_NUMBER */
+       "",             /* MAJOR_SW_VERSION */
+       "",             /* MINOR_SW_VERSION */
+};
+
+static char *cmu1_qa_hw_id[HW_ID_ELEM_COUNT] = {
+       "CMU",          /* DEVICE_NAME */
+       "1",            /* GENERATION */
+       "CMU1",         /* PCB_NAME */
+       "Q",            /* FORM */
+       "A",            /* VERSION */
+       "594128",       /* IDENTIFICATION_NUMBER */
+       "",             /* MAJOR_SW_VERSION */
+       "",             /* MINOR_SW_VERSION */
+};
+
+
+/* list of known modules */
+static char **hw_id_list[] = {
+       cm1_qa_hw_id,
+       cm11_qa_hw_id,
+       cmu1_qa_hw_id,
+};
+
+/* indices to the above list - keep in sync */ 
+enum {
+       CM1_QA,
+       CM11_QA,
+       CMU1_QA,
+};
+
+
+/* identify modules based on these hw id elements */
+static int hw_id_identify[] = {
+       PCB_NAME,
+       FORM,
+       VERSION,
+};
+
+
+/* Registers' settings for SDRAM controller intialization */
+typedef struct {
+       ulong mode;
+       ulong control;
+       ulong config1;
+       ulong config2;
+} mem_conf_t;
+
+static mem_conf_t k4s561632E = {
+       0x00CD0000,      /* CASL 3, burst length 8 */
+       0x514F0000,
+       0xE2333900,
+       0x8EE70000
+};
+
+static mem_conf_t mt48lc32m16a2 = {
+       0x00CD0000,      /* CASL 3, burst length 8 */
+       0x514F0000,
+       0xD2322800,
+       0x8AD70000
+};
+
+static mem_conf_t* memory_config[] = {
+       &k4s561632E,
+       &mt48lc32m16a2
+};
+
+#endif /* _CM5200_H */
diff --git a/board/cm5200/cmd_cm5200.c b/board/cm5200/cmd_cm5200.c
new file mode 100644 (file)
index 0000000..5119a99
--- /dev/null
@@ -0,0 +1,448 @@
+/*
+ * (C) Copyright 2007 Markus Kappeler <markus.kappeler@objectxp.com>
+ *
+ * Adapted for U-Boot 1.2 by Piotr Kruszynski <ppk@semihalf.com> 
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <common.h>
+#include <command.h>
+#include <i2c.h>
+#include <usb.h>
+
+#if (CONFIG_COMMANDS & CFG_CMD_BSP)
+
+int do_i2c(char *argv[])
+{
+       unsigned char temp, temp1;
+
+       printf("Starting I2C Test\n"
+               "Please set Jumper:\nI2C SDA 2-3\nI2C SCL 2-3\n\n"
+               "Please press any key to start\n\n");
+       getc();
+
+       temp = 0xf0; /* set io 0-4 as output */
+       i2c_write(CFG_I2C_IO, 3, 1, (uchar *)&temp, 1);
+
+       printf("Press I2C4-7. LED I2C0-3 should have the same state\n\n"
+               "Press any key to stop\n\n");
+
+       while (!tstc()) {
+               i2c_read(CFG_I2C_IO, 0, 1, (uchar *)&temp, 1);
+               temp1 = (temp >> 4) & 0x03;
+               temp1 |= (temp >> 3) & 0x08; /* S302 -> LED303 */
+               temp1 |= (temp >> 5) & 0x04; /* S303 -> LED302 */
+               temp = temp1;
+               i2c_write(CFG_I2C_IO, 1, 1, (uchar *)&temp, 1);
+       }
+       getc();
+
+       return 0;
+}
+
+int do_usbtest(char *argv[])
+{
+       int i;
+       static int usb_stor_curr_dev = -1; /* current device */
+
+       printf("Starting USB Test\n"
+               "Please insert USB Memmory Stick\n\n"
+               "Please press any key to start\n\n");
+       getc();
+
+       usb_stop();
+       printf("(Re)start USB...\n");
+       i = usb_init();
+#ifdef CONFIG_USB_STORAGE
+               /* try to recognize storage devices immediately */
+               if (i >= 0)
+                       usb_stor_curr_dev = usb_stor_scan(1);
+#endif /* CONFIG_USB_STORAGE */
+       if (usb_stor_curr_dev >= 0)
+               printf("Found USB Storage Dev continue with Test...\n");
+       else {
+               printf("No USB Storage Device detected.. Stop Test\n");
+               return 1;
+       }
+
+       usb_stor_info();
+
+       printf("stopping USB..\n");
+       usb_stop();
+
+       return 0;
+}
+
+int do_led(char *argv[])
+{
+       int i = 0;
+       struct mpc5xxx_gpt_0_7 *gpt = (struct mpc5xxx_gpt_0_7 *)MPC5XXX_GPT;
+
+       printf("Starting LED Test\n"
+               "Please set Switch S500 all off\n\n"
+               "Please press any key to start\n\n");
+       getc();
+
+       /* configure timer 2-3 for simple GPIO output High */
+       gpt->gpt2.emsr |= 0x00000034;
+       gpt->gpt3.emsr |= 0x00000034;
+
+       (*(vu_long *)MPC5XXX_WU_GPIO_ENABLE) |= 0x80000000;
+       (*(vu_long *)MPC5XXX_WU_GPIO_DIR) |= 0x80000000;
+       printf("Please press any key to stop\n\n");
+       while (!tstc()) {
+               if (i == 1) {
+                       (*(vu_long *)MPC5XXX_WU_GPIO_DATA_O) |= 0x80000000;
+                       gpt->gpt2.emsr &= ~0x00000010;
+                       gpt->gpt3.emsr &= ~0x00000010;
+               } else if (i == 2) {
+                       (*(vu_long *)MPC5XXX_WU_GPIO_DATA_O) &= ~0x80000000;
+                       gpt->gpt2.emsr &= ~0x00000010;
+                       gpt->gpt3.emsr |= 0x00000010;
+               } else if (i >= 3) {
+                       (*(vu_long *)MPC5XXX_WU_GPIO_DATA_O) &= ~0x80000000;
+                       gpt->gpt3.emsr &= ~0x00000010;
+                       gpt->gpt2.emsr |= 0x00000010;
+                       i = 0;
+               }
+               i++;
+               udelay(200000);
+       }
+       getc();
+
+       (*(vu_long *)MPC5XXX_WU_GPIO_DATA_O) |= 0x80000000;
+       gpt->gpt2.emsr |= 0x00000010;
+       gpt->gpt3.emsr |= 0x00000010;
+
+       return 0;
+}
+
+int do_rs232(char *argv[])
+{
+       int error_status = 0;
+       struct mpc5xxx_gpio *gpio = (struct mpc5xxx_gpio *)MPC5XXX_GPIO;
+       struct mpc5xxx_psc *psc1 = (struct mpc5xxx_psc *)MPC5XXX_PSC1;
+
+       /* Configure PSC 2-3-6 as GPIO */
+       gpio->port_config &= 0xFF0FF80F;
+
+       switch (simple_strtoul(argv[2], NULL, 10)) {
+       case 1:
+               /* check RTS <-> CTS loop */
+               /* set rts to 0 */
+               printf("Uart 1 test: RX TX tested by using U-Boot\n"
+                       "Please connect RTS with CTS on Uart1 plug\n\n"
+                       "Press any key to start\n\n");
+               getc();
+
+               psc1->op1 |= 0x01;
+
+               /* wait some time before requesting status */
+               udelay(10);
+
+               /* check status at cts */
+               if ((psc1->ip & 0x01) != 0) {
+                       error_status = 3;
+                       printf("%s: failure at rs232_1, cts status is %d "
+                               "(should be 0)\n",
+                               __FUNCTION__, (psc1->ip & 0x01));
+               }
+
+               /* set rts to 1 */
+               psc1->op0 |= 0x01;
+
+               /* wait some time before requesting status */
+               udelay(10);
+
+               /* check status at cts */
+               if ((psc1->ip & 0x01) != 1) {
+                       error_status = 3;
+                       printf("%s: failure at rs232_1, cts status is %d "
+                               "(should be 1)\n",
+                               __FUNCTION__, (psc1->ip & 0x01));
+               }
+               break;
+       case 2:
+               /* set PSC2_0, PSC2_2 as output and PSC2_1, PSC2_3 as input */
+               printf("Uart 2 test: Please use RS232 Loopback plug on UART2\n"
+                       "\nPress any key to start\n\n");
+               getc();
+
+               gpio->simple_gpioe &= ~(0x000000F0);
+               gpio->simple_gpioe |= 0x000000F0;
+               gpio->simple_ddr &= ~(0x000000F0);
+               gpio->simple_ddr |= 0x00000050;
+
+               /* check TXD <-> RXD loop */
+               /* set TXD to 1 */
+               gpio->simple_dvo |= (1 << 4);
+
+               /* wait some time before requesting status */
+               udelay(10);
+
+               if ((gpio->simple_ival & 0x00000020) != 0x00000020) {
+                       error_status = 2;
+                       printf("%s: failure at rs232_2, rxd status is %d "
+                               "(should be 1)\n", __FUNCTION__,
+                               (gpio->simple_ival & 0x00000020) >> 5);
+               }
+
+               /* set TXD to 0 */
+               gpio->simple_dvo &= ~(1 << 4);
+
+               /* wait some time before requesting status */
+               udelay(10);
+
+               if ((gpio->simple_ival & 0x00000020) != 0x00000000) {
+                       error_status = 2;
+                       printf("%s: failure at rs232_2, rxd status is %d "
+                               "(should be 0)\n", __FUNCTION__,
+                               (gpio->simple_ival & 0x00000020) >> 5);
+               }
+
+               /* check RTS <-> CTS loop */
+               /* set RTS to 1 */
+               gpio->simple_dvo |= (1 << 6);
+
+               /* wait some time before requesting status */
+               udelay(10);
+
+               if ((gpio->simple_ival & 0x00000080) != 0x00000080) {
+                       error_status = 3;
+                       printf("%s: failure at rs232_2, cts status is %d "
+                               "(should be 1)\n", __FUNCTION__,
+                               (gpio->simple_ival & 0x00000080) >> 7);
+               }
+
+               /* set RTS to 0 */
+               gpio->simple_dvo &= ~(1 << 6);
+
+               /* wait some time before requesting status */
+               udelay(10);
+
+               if ((gpio->simple_ival & 0x00000080) != 0x00000000) {
+                       error_status = 3;
+                       printf("%s: failure at rs232_2, cts status is %d "
+                               "(should be 0)\n", __FUNCTION__,
+                               (gpio->simple_ival & 0x00000080) >> 7);
+               }
+               break;
+       case 3:
+               /* set PSC3_0, PSC3_2 as output and PSC3_1, PSC3_3 as input */
+               printf("Uart 3 test: Please use RS232 Loopback plug on UART2\n"
+                       "\nPress any key to start\n\n");
+               getc();
+
+               gpio->simple_gpioe &= ~(0x00000F00);
+               gpio->simple_gpioe |= 0x00000F00;
+
+               gpio->simple_ddr &= ~(0x00000F00);
+               gpio->simple_ddr |= 0x00000500;
+
+               /* check TXD <-> RXD loop */
+               /* set TXD to 1 */
+               gpio->simple_dvo |= (1 << 8);
+
+               /* wait some time before requesting status */
+               udelay(10);
+
+               if ((gpio->simple_ival & 0x00000200) != 0x00000200) {
+                       error_status = 2;
+                       printf("%s: failure at rs232_3, rxd status is %d "
+                               "(should be 1)\n", __FUNCTION__,
+                               (gpio->simple_ival & 0x00000200) >> 9);
+               }
+
+               /* set TXD to 0 */
+               gpio->simple_dvo &= ~(1 << 8);
+
+               /* wait some time before requesting status */
+               udelay(10);
+
+               if ((gpio->simple_ival & 0x00000200) != 0x00000000) {
+                       error_status = 2;
+                       printf("%s: failure at rs232_3, rxd status is %d "
+                               "(should be 0)\n", __FUNCTION__,
+                               (gpio->simple_ival & 0x00000200) >> 9);
+               }
+
+               /* check RTS <-> CTS loop */
+               /* set RTS to 1 */
+               gpio->simple_dvo |= (1 << 10);
+
+               /* wait some time before requesting status */
+               udelay(10);
+
+               if ((gpio->simple_ival & 0x00000800) != 0x00000800) {
+                       error_status = 3;
+                       printf("%s: failure at rs232_3, cts status is %d "
+                               "(should be 1)\n", __FUNCTION__,
+                               (gpio->simple_ival & 0x00000800) >> 11);
+               }
+
+               /* set RTS to 0 */
+               gpio->simple_dvo &= ~(1 << 10);
+
+               /* wait some time before requesting status */
+               udelay(10);
+
+               if ((gpio->simple_ival & 0x00000800) != 0x00000000) {
+                       error_status = 3;
+                       printf("%s: failure at rs232_3, cts status is %d "
+                               "(should be 0)\n", __FUNCTION__,
+                               (gpio->simple_ival & 0x00000800) >> 11);
+               }
+               break;
+       case 4:
+               /* set PSC6_2, PSC6_3 as output and PSC6_0, PSC6_1 as input */
+               printf("Uart 4 test: Please use RS232 Loopback plug on UART2\n"
+                       "\nPress any key to start\n\n");
+               getc();
+
+               gpio->simple_gpioe &= ~(0xF0000000);
+               gpio->simple_gpioe |= 0x30000000;
+
+               gpio->simple_ddr &= ~(0xf0000000);
+               gpio->simple_ddr |= 0x30000000;
+
+               (*(vu_long *)MPC5XXX_WU_GPIO_ENABLE) |= 0x30000000;
+               (*(vu_long *)MPC5XXX_WU_GPIO_DIR) &= ~(0x30000000);
+
+               /* check TXD <-> RXD loop */
+               /* set TXD to 1 */
+               gpio->simple_dvo |= (1 << 28);
+
+               /* wait some time before requesting status */
+               udelay(10);
+
+               if (((*(vu_long *)MPC5XXX_WU_GPIO_DATA_I) & 0x10000000) !=
+                               0x10000000) {
+                       error_status = 2;
+                       printf("%s: failure at rs232_4, rxd status is %d "
+                               "(should be 1)\n", __FUNCTION__,
+                               ((*(vu_long *)MPC5XXX_WU_GPIO_DATA_I) &
+                                       0x10000000) >> 28);
+               }
+
+               /* set TXD to 0 */
+               gpio->simple_dvo &= ~(1 << 28);
+
+               /* wait some time before requesting status */
+               udelay(10);
+
+               if (((*(vu_long *)MPC5XXX_WU_GPIO_DATA_I) & 0x10000000) !=
+                               0x00000000) {
+                       error_status = 2;
+                       printf("%s: failure at rs232_4, rxd status is %d "
+                               "(should be 0)\n", __FUNCTION__,
+                               ((*(vu_long *)MPC5XXX_WU_GPIO_DATA_I) &
+                                       0x10000000) >> 28);
+               }
+
+               /* check RTS <-> CTS loop */
+               /* set RTS to 1 */
+               gpio->simple_dvo |= (1 << 29);
+
+               /* wait some time before requesting status */
+               udelay(10);
+
+               if (((*(vu_long *)MPC5XXX_WU_GPIO_DATA_I) & 0x20000000) !=
+                               0x20000000) {
+                       error_status = 3;
+                       printf("%s: failure at rs232_4, cts status is %d "
+                               "(should be 1)\n", __FUNCTION__,
+                               ((*(vu_long *)MPC5XXX_WU_GPIO_DATA_I) &
+                                       0x20000000) >> 29);
+               }
+
+               /* set RTS to 0 */
+               gpio->simple_dvo &= ~(1 << 29);
+
+               /* wait some time before requesting status */
+               udelay(10);
+
+               if (((*(vu_long *)MPC5XXX_WU_GPIO_DATA_I) & 0x20000000) !=
+                               0x00000000) {
+                       error_status = 3;
+                       printf("%s: failure at rs232_4, cts status is %d "
+                               "(should be 0)\n", __FUNCTION__,
+                               ((*(vu_long *)MPC5XXX_WU_GPIO_DATA_I) &
+                                       0x20000000) >> 29);
+               }
+               break;
+       default:
+               printf("%s: invalid rs232 number %s\n", __FUNCTION__, argv[2]);
+               error_status = 1;
+               break;
+       }
+       gpio->port_config |= (CFG_GPS_PORT_CONFIG & 0xFF0FF80F);
+
+       return error_status;
+}
+
+int cmd_fkt(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+{
+       int rcode = -1;
+
+       switch (argc) {
+       case 2:
+               if (strncmp(argv[1], "i2c", 3) == 0)
+                       rcode = do_i2c(argv);
+               else if (strncmp(argv[1], "led", 3) == 0)
+                       rcode = do_led(argv);
+               else if (strncmp(argv[1], "usb", 3) == 0)
+                       rcode = do_usbtest(argv);
+               break;
+       case 3:
+               if (strncmp(argv[1], "rs232", 3) == 0)
+                       rcode = do_rs232(argv);
+               break;
+       }
+
+       switch (rcode) {
+       case -1:
+               printf("Usage:\n"
+                       "fkt { i2c | led | usb }\n"
+                       "fkt rs232 number\n");
+               rcode = 1;
+               break;
+       case 0:
+               printf("Test passed\n");
+               break;
+       default:
+               printf("Test failed with code: %d\n", rcode);
+       }
+
+       return rcode;
+}
+
+U_BOOT_CMD(
+       fkt,    4,      1,      cmd_fkt,
+       "fkt     - Function test routines\n",
+       "i2c\n"
+       "     - Test I2C communication\n"
+       "fkt led\n"
+       "     - Test LEDs\n"
+       "fkt rs232 number\n"
+       "     - Test RS232 (loopback plug(s) for RS232 required)\n"
+       "fkt usb\n"
+       "     - Test USB communication\n"
+);
+#endif /* CFG_CMD_BSP */
diff --git a/board/cm5200/config.mk b/board/cm5200/config.mk
new file mode 100644 (file)
index 0000000..7f06139
--- /dev/null
@@ -0,0 +1,26 @@
+#
+# (C) Copyright 2007
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+TEXT_BASE = 0xfc000000
+
+PLATFORM_CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE) -I$(TOPDIR)/board
diff --git a/board/cm5200/fwupdate.c b/board/cm5200/fwupdate.c
new file mode 100644 (file)
index 0000000..19aa94a
--- /dev/null
@@ -0,0 +1,200 @@
+/*
+ * (C) Copyright 2007 Schindler Lift Inc.
+ * (C) Copyright 2007 DENX Software Engineering
+ *
+ * Author: Michel Marti <mma@objectxp.com>
+ * Adapted for U-Boot 1.2 by Piotr Kruszynski <ppk@semihalf.com>:
+ *   - code clean-up
+ *   - bugfix for overwriting bootargs by user
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <common.h>
+#include <command.h>
+#include <malloc.h>
+#include <image.h>
+#include <usb.h>
+#include <fat.h>
+
+#include "fwupdate.h"
+
+extern int do_bootm(cmd_tbl_t *, int, int, char *[]);
+extern long do_fat_read(const char *, void *, unsigned long, int);
+extern int do_fat_fsload(cmd_tbl_t *, int, int, char *[]);
+
+static int load_rescue_image(ulong);
+
+void cm5200_fwupdate(void)
+{
+       cmd_tbl_t *bcmd;
+       char *rsargs;
+       char *tmp = NULL;
+       char ka[16];
+       char *argv[3] = { "bootm", ka, NULL };
+
+       /* Check if rescue system is disabled... */
+       if (getenv("norescue")) {
+               printf(LOG_PREFIX "Rescue System disabled.\n");
+               return;
+       }
+
+       /* Check if we have a USB storage device and load image */
+       if (load_rescue_image(LOAD_ADDR))
+               return;
+
+       bcmd = find_cmd("bootm");
+       if (!bcmd)
+               return;
+
+       sprintf(ka, "%lx", LOAD_ADDR);
+
+       /* prepare our bootargs */
+       rsargs = getenv("rs-args");
+       if (!rsargs)
+               rsargs = RS_BOOTARGS;
+       else {
+               tmp = malloc(strlen(rsargs+1));
+               if (!tmp) {
+                       printf(LOG_PREFIX "Memory allocation failed\n");
+                       return;
+               }
+               strcpy(tmp, rsargs);
+               rsargs = tmp;
+       }
+
+       setenv("bootargs", rsargs);
+
+       if (rsargs == tmp)
+               free(rsargs);
+
+       printf(LOG_PREFIX "Starting update system (bootargs=%s)...\n", rsargs);
+       do_bootm(bcmd, 0, 2, argv);
+}
+
+static int load_rescue_image(ulong addr)
+{
+       disk_partition_t info;
+       int devno;
+       int partno;
+       int i;
+       char fwdir[64];
+       char nxri[128];
+       char *tmp;
+       char dev[7];
+       char addr_str[16];
+       char *argv[6] = { "fatload", "usb", dev, addr_str, nxri, NULL };
+       block_dev_desc_t *stor_dev = NULL;
+       cmd_tbl_t *bcmd;
+
+       /* Get name of firmware directory */
+       tmp = getenv("fw-dir");
+
+       /* Copy it into fwdir */
+       strncpy(fwdir, tmp ? tmp : FW_DIR, sizeof(fwdir));
+       fwdir[sizeof(fwdir) - 1] = 0; /* Terminate string */
+
+       printf(LOG_PREFIX "Checking for firmware image directory '%s' on USB"
+               " storage...\n", fwdir);
+       usb_stop();
+       if (usb_init() != 0)
+               return 1;
+
+       /* Check for storage device */
+       if (usb_stor_scan(1) != 0) {
+               usb_stop();
+               return 1;
+       }
+
+       /* Detect storage device */
+       for (devno = 0; devno < USB_MAX_STOR_DEV; devno++) {
+               stor_dev = usb_stor_get_dev(devno);
+               if (stor_dev->type != DEV_TYPE_UNKNOWN)
+                       break;
+       }
+       if (!stor_dev || stor_dev->type == DEV_TYPE_UNKNOWN) {
+               printf(LOG_PREFIX "No valid storage device found...\n");
+               usb_stop();
+               return 1;
+       }
+
+       /* Detect partition */
+       for (partno = -1, i = 0; i < 6; i++) {
+               if (get_partition_info(stor_dev, i, &info) == 0) {
+                       if (fat_register_device(stor_dev, i) == 0) {
+                               /* Check if rescue image is present */
+                               FW_DEBUG("Looking for firmware directory '%s'"
+                                       " on partition %d\n", fwdir, i);
+                               if (do_fat_read(fwdir, NULL, 0, LS_NO) == -1) {
+                                       FW_DEBUG("No NX rescue image on "
+                                               "partition %d.\n", i);
+                                       partno = -2;
+                               } else {
+                                       partno = i;
+                                       FW_DEBUG("Partition %d contains "
+                                               "firmware directory\n", partno);
+                                       break;
+                               }
+                       }
+               }
+       }
+
+       if (partno < 0) {
+               switch (partno) {
+               case -1:
+                       printf(LOG_PREFIX "Error: No valid (FAT) partition "
+                               "detected\n");
+                       break;
+               case -2:
+                       printf(LOG_PREFIX "Error: No NX rescue image on FAT "
+                               "partition\n");
+                       break;
+               default:
+                       printf(LOG_PREFIX "Error: Failed with code %d\n",
+                               partno);
+               }
+               usb_stop();
+               return 1;
+       }
+
+       /* Load the rescue image */
+       bcmd = find_cmd("fatload");
+       if (!bcmd) {
+               printf(LOG_PREFIX "Error - 'fatload' command not present.\n");
+               usb_stop();
+               return 1;
+       }
+
+       tmp = getenv("nx-rescue-image");
+       sprintf(nxri, "%s/%s", fwdir, tmp ? tmp : RESCUE_IMAGE);
+       sprintf(dev, "%d:%d", devno, partno);
+       sprintf(addr_str, "%lx", addr);
+
+       FW_DEBUG("fat_fsload device='%s', addr='%s', file: %s\n",
+               dev, addr_str, nxri);
+
+       if (do_fat_fsload(bcmd, 0, 5, argv) != 0) {
+               usb_stop();
+               return 1;
+       }
+
+       /* Stop USB */
+       usb_stop();
+       return 0;
+}
diff --git a/board/cm5200/fwupdate.h b/board/cm5200/fwupdate.h
new file mode 100644 (file)
index 0000000..4e3f1e1
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * (C) Copyright 2007 Schindler Lift Inc.
+ *
+ * Author: Michel Marti <mma@objectxp.com>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __FW_UPDATE_H
+#define __FW_UPDATE_H
+
+/* Default prefix for output messages */
+#define LOG_PREFIX     "CM5200:"
+
+/* Extra debug macro */
+#ifdef CONFIG_FWUPDATE_DEBUG
+#define FW_DEBUG(fmt...) printf(LOG_PREFIX fmt)
+#else
+#define FW_DEBUG(fmt...)
+#endif
+
+/* Name of the directory holding firmware images */
+#define FW_DIR         "nx-fw"
+#define RESCUE_IMAGE   "nxrs.img"
+#define LOAD_ADDR      0x400000
+#define RS_BOOTARGS    "ramdisk=8192K"
+
+/* Main function for fwupdate */
+void cm5200_fwupdate(void);
+
+#endif /* __FW_UPDATE_H */
diff --git a/board/cm5200/u-boot.lds b/board/cm5200/u-boot.lds
new file mode 100644 (file)
index 0000000..8fa9c0f
--- /dev/null
@@ -0,0 +1,123 @@
+/*
+ * (C) Copyright 2003-2007
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+OUTPUT_ARCH(powerpc)
+SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
+SECTIONS
+{
+  /* Read-only sections, merged into text segment: */
+  . = + SIZEOF_HEADERS;
+  .interp : { *(.interp) }
+  .hash          : { *(.hash)          }
+  .dynsym        : { *(.dynsym)                }
+  .dynstr        : { *(.dynstr)                }
+  .rel.text      : { *(.rel.text)              }
+  .rela.text     : { *(.rela.text)     }
+  .rel.data      : { *(.rel.data)              }
+  .rela.data     : { *(.rela.data)     }
+  .rel.rodata    : { *(.rel.rodata)    }
+  .rela.rodata   : { *(.rela.rodata)   }
+  .rel.got       : { *(.rel.got)               }
+  .rela.got      : { *(.rela.got)              }
+  .rel.ctors     : { *(.rel.ctors)     }
+  .rela.ctors    : { *(.rela.ctors)    }
+  .rel.dtors     : { *(.rel.dtors)     }
+  .rela.dtors    : { *(.rela.dtors)    }
+  .rel.bss       : { *(.rel.bss)               }
+  .rela.bss      : { *(.rela.bss)              }
+  .rel.plt       : { *(.rel.plt)               }
+  .rela.plt      : { *(.rela.plt)              }
+  .init          : { *(.init)  }
+  .plt : { *(.plt) }
+  .text      :
+  {
+    cpu/mpc5xxx/start.o        (.text)
+    *(.text)
+    *(.fixup)
+    *(.got1)
+    . = ALIGN(16);
+    *(.rodata)
+    *(.rodata1)
+    *(.rodata.str1.4)
+    *(.eh_frame)
+  }
+  .fini      : { *(.fini)    } =0
+  .ctors     : { *(.ctors)   }
+  .dtors     : { *(.dtors)   }
+
+  /* Read-write section, merged into data segment: */
+  . = (. + 0x0FFF) & 0xFFFFF000;
+  _erotext = .;
+  PROVIDE (erotext = .);
+  .reloc   :
+  {
+    *(.got)
+    _GOT2_TABLE_ = .;
+    *(.got2)
+    _FIXUP_TABLE_ = .;
+    *(.fixup)
+  }
+  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
+  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
+
+  .data    :
+  {
+    *(.data)
+    *(.data1)
+    *(.sdata)
+    *(.sdata2)
+    *(.dynamic)
+    CONSTRUCTORS
+  }
+  _edata  =  .;
+  PROVIDE (edata = .);
+
+  . = .;
+  __u_boot_cmd_start = .;
+  .u_boot_cmd : { *(.u_boot_cmd) }
+  __u_boot_cmd_end = .;
+
+
+  . = .;
+  __start___ex_table = .;
+  __ex_table : { *(__ex_table) }
+  __stop___ex_table = .;
+
+  . = ALIGN(4096);
+  __init_begin = .;
+  .text.init : { *(.text.init) }
+  .data.init : { *(.data.init) }
+  . = ALIGN(4096);
+  __init_end = .;
+
+  __bss_start = .;
+  .bss       :
+  {
+   *(.sbss) *(.scommon)
+   *(.dynbss)
+   *(.bss)
+   *(COMMON)
+  }
+  _end = . ;
+  PROVIDE (end = .);
+}
index 9ae3c42be50685ef92ff5e78f348348b08a68991..374cd0701311e6d0488bf79fb47f70be57649ff5 100644 (file)
@@ -155,7 +155,7 @@ int hw_detect (void)
 }
 
 #ifdef CONFIG_DRIVER_ETHER
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
 
 /*
  * Name:
@@ -175,5 +175,5 @@ void at91rm9200_GetPhyInterface(AT91PS_PhyOps p_phyops)
        p_phyops->AutoNegotiate = dm9161_AutoNegotiate;
 }
 
-#endif /* CONFIG_COMMANDS & CFG_CMD_NET */
+#endif
 #endif /* CONFIG_DRIVER_ETHER */
diff --git a/board/cmi/u-boot.lds b/board/cmi/u-boot.lds
deleted file mode 100644 (file)
index 5b03fef..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * (C) Copyright 2001  Wolfgang Denk, DENX Software Engineering, wd@denx.de
- * (C) Copyright 2003  Martin Winistoerfer, martinwinistoerfer@gmx.ch
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    /* WARNING - the following is hand-optimized to fit within */
-    /* the sector layout of our flash chips!   XXX FIXME XXX   */
-
-    cpu/mpc5xx/start.o (.text)
-
-    *(.text)
-    *(.fixup)
-    *(.got1)
-  }
-  _etext = .;
-  PROVIDE (etext = .);
-  .rodata    :
-  {
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x00FF) & 0xFFFFFF00;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
-  __fixup_entries = (. - _FIXUP_TABLE_)>>2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(256);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(256);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-
-  _end = . ;
-  PROVIDE (end = .);
-/*   . = env_start;
-       .ppcenv :
-       {
-               common/environment.o (.ppcenv)
-       }
-*/
-}
index ee779394bbe7666a61ed9324ab76f43c9cb4d2cd..35a5ed3d06a3808fd4bf842803b847337d358f4b 100644 (file)
@@ -29,3 +29,5 @@
 TEXT_BASE = 0xfff00000
 
 PLATFORM_CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE) -I$(TOPDIR)
+
+LDSCRIPT := $(SRCTREE)/board/cogent/u-boot.lds
index 2b595a85aea872c000407245c438fdcb0581e704..d9c27beee881c1951e98031dbcdea1b1f597ad6e 100644 (file)
@@ -90,7 +90,7 @@ int serial_tstc (void)
 
 #endif /* CONS_NONE */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB) && \
+#if defined(CONFIG_CMD_KGDB) && \
     defined(CONFIG_KGDB_NONE)
 
 #if CONFIG_KGDB_INDEX == CONFIG_CONS_INDEX
index 5ce2694cbf7dd85155267f865adc8d13d7a5419e..d87a39b249656b2cae495d8fece9184dff9a268b 100644 (file)
@@ -55,7 +55,6 @@ SECTIONS
   {
     *(.text)
     common/environment.o(.text)
-    *(.fixup)
     *(.got1)
   }
   _etext = .;
index 51b0085911b9edfb8574b4997044867aca3c93ac..79eb47317621dfa3f2a39f7246822e8a36b7d717 100644 (file)
@@ -240,7 +240,7 @@ int sysControlDisplay (int digit,   /* number of digit 0..7 */
        return (0);
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_PCMCIA)
+#if defined(CONFIG_CMD_PCMCIA)
 
 #ifdef CFG_PCMCIA_MEM_ADDR
 volatile unsigned char *pcmcia_mem = (unsigned char*)CFG_PCMCIA_MEM_ADDR;
@@ -257,7 +257,7 @@ int pcmcia_init(void)
        return rc;
 }
 
-#endif /* CFG_CMD_PCMCIA */
+#endif
 
 # ifdef CONFIG_IDE_LED
 void ide_led (uchar led, uchar status)
index 6ca3e7bd7ab62b69574229aad08de99f8ad73c97..d8f4be516d134dbd2e2a03e8b539cbbb9d60bdf1 100644 (file)
@@ -772,7 +772,7 @@ exit:
        return rc;
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_PCMCIA)
+#if defined(CONFIG_CMD_PCMCIA)
 int pcmcia_off (void)
 {
        printf ("Disable PCMCIA " PCMCIA_SLOT_MSG "\n");
diff --git a/board/cpc45/u-boot.lds b/board/cpc45/u-boot.lds
deleted file mode 100644 (file)
index 9ea26aa..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * (C) Copyright 2001-2003
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc824x/start.o        (.text)
-    lib_ppc/board.o (.text)
-    lib_ppc/ppcstring.o        (.text)
-    lib_generic/vsprintf.o     (.text)
-    lib_generic/crc32.o                (.text)
-    lib_generic/zlib.o         (.text)
-
-               . = DEFINED(env_offset) ? env_offset : .;
-    common/environment.o (.text)
-
-               *(.text)
-
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-
-  _end = . ;
-  PROVIDE (end = .);
-}
index 3eb5b354264d792360f8b32d4b84d6350dbc6dfa..0eb94efdaa70ce1384e513e9968a80cb71718284 100644 (file)
@@ -312,7 +312,7 @@ long int initdram (int board_type)
        return (psize);
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_DOC)
+#if defined(CONFIG_CMD_DOC)
 extern void doc_probe (ulong physadr);
 void doc_init (void)
 {
diff --git a/board/cpu86/u-boot.lds b/board/cpu86/u-boot.lds
deleted file mode 100644 (file)
index 05f29c6..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * (C) Copyright 2001
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc8260/start.o        (.text)
-    *(.text)
-    common/environment.o(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
index 9fecdd0dfefa67eda0ab141291de24377b7b7a8a..a2fd19398bd5f758648b6ad9f4d803bab7243a5f 100644 (file)
@@ -321,7 +321,7 @@ long int initdram (int board_type)
        return (psize);
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_DOC)
+#if defined(CONFIG_CMD_DOC)
 extern void doc_probe (ulong physadr);
 void doc_init (void)
 {
diff --git a/board/cpu87/u-boot.lds b/board/cpu87/u-boot.lds
deleted file mode 100644 (file)
index fb7e665..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * (C) Copyright 2001-2005
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc8260/start.o        (.text)
-    *(.text)
-    common/environment.o(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
index aeb1a138d254aa727784ef965c8e204b960f5b43..fbc3c87c5da05e323632ffc43c3f945491d60968 100644 (file)
@@ -57,7 +57,7 @@ int dram_init (void)
 }
 
 #ifdef CONFIG_DRIVER_ETHER
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
 
 /*
  * Name:
@@ -77,5 +77,5 @@ void at91rm9200_GetPhyInterface(AT91PS_PhyOps p_phyops)
        p_phyops->AutoNegotiate  = bcm5221_AutoNegotiate;
 }
 
-#endif /* CONFIG_COMMANDS & CFG_CMD_NET */
+#endif
 #endif /* CONFIG_DRIVER_ETHER */
diff --git a/board/cu824/u-boot.lds b/board/cu824/u-boot.lds
deleted file mode 100644 (file)
index 7be85e4..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * (C) Copyright 2001
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc824x/start.o        (.text)
-    lib_ppc/board.o (.text)
-    lib_ppc/ppcstring.o        (.text)
-    lib_generic/vsprintf.o     (.text)
-    lib_generic/crc32.o                (.text)
-    lib_generic/zlib.o         (.text)
-
-               . = DEFINED(env_offset) ? env_offset : .;
-    common/environment.o (.text)
-
-               *(.text)
-
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-
-  _end = . ;
-  PROVIDE (end = .);
-}
index f5c3dd9edc70e9d0e9836d214e2cf0baf6c7dfc1..09c0b043e7f3039b29b18a6e2081db2cf5dde78c 100644 (file)
@@ -23,7 +23,7 @@
 #include <common.h>
 
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
 
 #include <nand.h>
 
@@ -115,4 +115,4 @@ int board_nand_init(struct nand_chip *nand)
        nand->options = NAND_SAMSUNG_LP_OPTIONS;
        return 0;
 }
-#endif /* (CONFIG_COMMANDS & CFG_CMD_NAND) */
+#endif
index d170938c02058f57e275ae49918fddfcddb2af3c..a635a6521bbadea397727607579d928ea218fa0a 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <common.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
 #if !defined(CFG_NAND_LEGACY)
 
 #include <nand.h>
diff --git a/board/eXalion/u-boot.lds b/board/eXalion/u-boot.lds
deleted file mode 100644 (file)
index eaee3fd..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * (C) Copyright 2001
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)      }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)      }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)       }
-  .rela.got      : { *(.rela.got)      }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)       }
-  .rela.bss      : { *(.rela.bss)      }
-  .rel.plt       : { *(.rel.plt)       }
-  .rela.plt      : { *(.rela.plt)      }
-  .init          : { *(.init)          }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc824x/start.o                (.text)
-    lib_ppc/board.o            (.text)
-    lib_ppc/ppcstring.o                (.text)
-    lib_generic/vsprintf.o     (.text)
-    lib_generic/crc32.o                (.text)
-    lib_generic/zlib.o         (.text)
-
-       . = DEFINED(env_offset) ? env_offset : .;
-    common/environment.o (.text)
-
-       *(.text)
-
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-
-  _end = . ;
-  PROVIDE (end = .);
-}
index d741e6b5cef9400a0f8006a33cd27b2cb1aa5018..ccbd72a79b5b7e883842f4966e10529a1002cd80 100644 (file)
@@ -184,7 +184,7 @@ void pci_init_board(void)
 /*****************************************************************************
  * provide the IDE Reset Function
  *****************************************************************************/
-#if defined (CFG_CMD_IDE) && defined (CONFIG_IDE_RESET)
+#if defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_RESET)
 
 void init_ide_reset (void)
 {
@@ -205,4 +205,4 @@ void ide_set_reset (int idereset)
                *(vu_long *) MPC5XXX_WU_GPIO_DATA_O |=  GPIO_PSC1_4;
        }
 }
-#endif /* defined (CFG_CMD_IDE) && defined (CONFIG_IDE_RESET) */
+#endif
diff --git a/board/emk/top5200/u-boot.lds b/board/emk/top5200/u-boot.lds
deleted file mode 100644 (file)
index f23432e..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * (C) Copyright 2003
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc5xxx/start.o        (.text)
-    *(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
diff --git a/board/ep8248/u-boot.lds b/board/ep8248/u-boot.lds
deleted file mode 100644 (file)
index 18c4b46..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * (C) Copyright 2001
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * Modified by Yuli Barcohen <yuli@arabellasw.com>
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc8260/start.o        (.text)
-    *(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
-ENTRY(_start)
diff --git a/board/ep8260/u-boot.lds b/board/ep8260/u-boot.lds
deleted file mode 100644 (file)
index 4250e83..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * (C) Copyright 2001, 2002, 2002
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/opt/cross/lib); SEARCH_DIR(/opt/cross/powerpc-linux/lib);
-/* SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib); */
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)      }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)      }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)       }
-  .rela.got      : { *(.rela.got)      }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)       }
-  .rela.bss      : { *(.rela.bss)      }
-  .rel.plt       : { *(.rel.plt)       }
-  .rela.plt      : { *(.rela.plt)      }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc8260/start.o        (.text)
-    *(.text)
-/*    common/environment.o(.text) */
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
diff --git a/board/ep82xxm/u-boot.lds b/board/ep82xxm/u-boot.lds
deleted file mode 100644 (file)
index 18c4b46..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * (C) Copyright 2001
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * Modified by Yuli Barcohen <yuli@arabellasw.com>
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc8260/start.o        (.text)
-    *(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
-ENTRY(_start)
index 84fc3a01dc21e6e684b04c02b34ac5ea1c68c2b6..f41eb7b22cfb0176a6317f4a08114cde555f0866 100644 (file)
@@ -238,7 +238,7 @@ int testdram (void)
 
 /* ------------------------------------------------------------------------- */
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
 #include <linux/mtd/nand_legacy.h>
 extern struct nand_chip nand_dev_desc[CFG_MAX_NAND_DEVICE];
 
index cb04710737426121fe203211b755bda849df039e..635ba2fdb9c72b92dc35b30b659c9937c3bf94fd 100644 (file)
@@ -235,7 +235,7 @@ U_BOOT_CMD(eepwren, 2,      0,      do_eep_wren,
 
 /* ------------------------------------------------------------------------- */
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
 #include <linux/mtd/nand_legacy.h>
 extern struct nand_chip nand_dev_desc[CFG_MAX_NAND_DEVICE];
 
index 001fd68da42e0bbea25e6b5930067b5283eb1991..62f6c204340bc00c5ea2dd52ab1bfc437273561b 100644 (file)
@@ -24,7 +24,7 @@
 
 #include <common.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND) && !defined(CFG_NAND_LEGACY)
+#if defined(CONFIG_CMD_NAND) && !defined(CFG_NAND_LEGACY)
 #warning CFG_NAND_LEGACY not defined in a file using the legacy NAND support!
 #endif
 
@@ -39,8 +39,8 @@
 
 #ifdef CONFIG_AUTO_UPDATE
 
-#if !(CONFIG_COMMANDS & CFG_CMD_FAT)
-#error "must define CFG_CMD_FAT"
+#if !defined(CONFIG_CMD_FAT)
+#error "must define CONFIG_CMD_FAT"
 #endif
 
 extern au_image_t au_image[];
@@ -73,7 +73,7 @@ extern int flash_sect_erase(ulong, ulong);
 extern int flash_sect_protect (int, ulong, ulong);
 extern int flash_write (char *, ulong, ulong);
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND) && defined(CFG_NAND_LEGACY)
+#if defined(CONFIG_CMD_NAND) && defined(CFG_NAND_LEGACY)
 /* references to names in cmd_nand.c */
 #define NANDRW_READ    0x01
 #define NANDRW_WRITE   0x00
@@ -83,7 +83,7 @@ extern struct nand_chip nand_dev_desc[];
 extern int nand_legacy_rw(struct nand_chip* nand, int cmd, size_t start, size_t len,
                   size_t * retlen, u_char * buf);
 extern int nand_legacy_erase(struct nand_chip* nand, size_t ofs, size_t len, int clean);
-#endif /* (CONFIG_COMMANDS & CFG_CMD_NAND) && defined(CFG_NAND_LEGACY) */
+#endif
 
 extern block_dev_desc_t ide_dev_desc[CFG_IDE_MAXDEVICE];
 
@@ -187,7 +187,7 @@ int au_do_update(int i, long sz)
        int off, rc;
        uint nbytes;
        int k;
-#if (CONFIG_COMMANDS & CFG_CMD_NAND) && defined(CFG_NAND_LEGACY)
+#if defined(CONFIG_CMD_NAND) && defined(CFG_NAND_LEGACY)
        int total;
 #endif
 
@@ -261,7 +261,7 @@ int au_do_update(int i, long sz)
                        debug ("flash_sect_erase(%lx, %lx);\n", start, end);
                        flash_sect_erase(start, end);
                } else {
-#if (CONFIG_COMMANDS & CFG_CMD_NAND) && defined(CFG_NAND_LEGACY)
+#if defined(CONFIG_CMD_NAND) && defined(CFG_NAND_LEGACY)
                        printf("Updating NAND FLASH with image %s\n", au_image[i].name);
                        debug ("nand_legacy_erase(%lx, %lx);\n", start, end);
                        rc = nand_legacy_erase (nand_dev_desc, start, end - start + 1, 0);
@@ -289,7 +289,7 @@ int au_do_update(int i, long sz)
                        debug ("flash_write(%p, %lx %x)\n", addr, start, nbytes);
                        rc = flash_write((char *)addr, start, nbytes);
                } else {
-#if (CONFIG_COMMANDS & CFG_CMD_NAND) && defined(CFG_NAND_LEGACY)
+#if defined(CONFIG_CMD_NAND) && defined(CFG_NAND_LEGACY)
                        debug ("nand_legacy_rw(%p, %lx %x)\n", addr, start, nbytes);
                        rc = nand_legacy_rw(nand_dev_desc, NANDRW_WRITE | NANDRW_JFFS2,
                                     start, nbytes, (size_t *)&total, (uchar *)addr);
@@ -307,7 +307,7 @@ int au_do_update(int i, long sz)
                if (au_image[i].type != AU_NAND) {
                        rc = crc32 (0, (uchar *)(start + off), ntohl(hdr->ih_size));
                } else {
-#if (CONFIG_COMMANDS & CFG_CMD_NAND) && defined(CFG_NAND_LEGACY)
+#if defined(CONFIG_CMD_NAND) && defined(CFG_NAND_LEGACY)
                        rc = nand_legacy_rw(nand_dev_desc, NANDRW_READ | NANDRW_JFFS2 | NANDRW_JFFS2_SKIP,
                                     start, nbytes, (size_t *)&total, (uchar *)addr);
                        rc = crc32 (0, (uchar *)(addr + off), ntohl(hdr->ih_size));
index bf796ff9d14444d66be11d57adee1bba07ac3dd1..d88b3876dc29215e410c3dc101dbc65dcdd10484 100644 (file)
@@ -24,7 +24,7 @@
 #include <common.h>
 #include <command.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_BSP)
+#if defined(CONFIG_CMD_BSP)
 
 extern int do_bootm (cmd_tbl_t *, int, int, char *[]);
 extern int do_autoscript (cmd_tbl_t *, int, int, char *[]);
index a925b84fd9e5e07d78f468761be249314fa4e98d..adb8597e1cf70096d29bcda40fac575711628078 100644 (file)
@@ -196,7 +196,7 @@ void pci_init_board(void) {
 }
 #endif
 
-#if defined (CFG_CMD_IDE) && defined (CONFIG_IDE_RESET)
+#if defined(CONFIG_CMD_IDE) && defined (CONFIG_IDE_RESET)
 
 void init_ide_reset(void)
 {
@@ -217,7 +217,7 @@ void ide_set_reset(int idereset)
                *(vu_long *) MPC5XXX_WU_GPIO_DATA_O |= GPIO_PSC1_4;
        }
 }
-#endif                         /* defined (CFG_CMD_IDE) && defined (CONFIG_IDE_RESET) */
+#endif
 
 #define MPC5XXX_SIMPLEIO_GPIO_ENABLE       (MPC5XXX_GPIO + 0x0004)
 #define MPC5XXX_SIMPLEIO_GPIO_DIR          (MPC5XXX_GPIO + 0x000C)
diff --git a/board/esd/cpci5200/u-boot.lds b/board/esd/cpci5200/u-boot.lds
deleted file mode 100644 (file)
index f23432e..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * (C) Copyright 2003
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc5xxx/start.o        (.text)
-    *(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
index bea99ce8e721b13e2b33ea04c5179fab75789c48..01b90c631dd3d51cbea969d7a017571bf0a21745 100644 (file)
@@ -25,7 +25,7 @@
 
 
 #include <common.h>
-#ifdef CFG_CMD_IDE
+#if defined(CONFIG_CMD_IDE)
 #include <ata.h>
 #include <ide.h>
 #include <pci.h>
index c094755351cdb831f346e359ba66cac68af87c44..78d18801854658a817ff56e83357e6ff25f4091a 100644 (file)
@@ -1252,7 +1252,7 @@ static int check_dimm (uchar slot, AUX_MEM_DIMM_INFO * dimmInfo)
 /* sets up the GT properly with information passed in */
 int setup_sdram (AUX_MEM_DIMM_INFO * info)
 {
-       ulong tmp, check;
+       ulong tmp;
        ulong tmp_sdram_mode = 0;       /* 0x141c */
        ulong tmp_dunit_control_low = 0;        /* 0x1404 */
        int i;
index ba32ac12acedd54ee1b329a5592e55d361a4e5de..e1af37e1d8ac2ff49b9aff5994835ad01920ae05 100644 (file)
@@ -80,7 +80,7 @@ void serial_puts (const char *s)
        }
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 void kgdb_serial_init (void)
 {
 }
@@ -104,4 +104,4 @@ void kgdb_interruptible (int yes)
 {
        return;
 }
-#endif /* CFG_CMD_KGDB */
+#endif
index ea344c0f26dd2a7054932f62c0f3c15879113447..9ef5907cdd43177d0871f41eed1059ed1ebb266e 100644 (file)
@@ -690,7 +690,7 @@ void ide_set_reset(int on)
 #endif /* CONFIG_IDE_RESET */
 
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
 #include <linux/mtd/nand_legacy.h>
 extern struct nand_chip nand_dev_desc[CFG_MAX_NAND_DEVICE];
 
index 1e0accbe0e515a3a26b3775561bf56d6aaf8b33c..dd3706e1a86ed064413843b38630e8f1c37e6b78 100644 (file)
@@ -260,7 +260,7 @@ int testdram (void)
 }
 
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
 #include <linux/mtd/nand_legacy.h>
 extern struct nand_chip nand_dev_desc[CFG_MAX_NAND_DEVICE];
 
index c4b91e950bc86928f3cd5bf08d50480e904d4ee1..ea49f264ab866e531df16f7e391dc585a85b9459 100644 (file)
@@ -196,7 +196,7 @@ void pci_init_board(void)
 }
 #endif
 
-#if defined (CFG_CMD_IDE) && defined (CONFIG_IDE_RESET)
+#if defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_RESET)
 
 #define GPIO_PSC1_4    0x01000000UL
 
@@ -218,7 +218,7 @@ void ide_set_reset(int idereset)
        else
                *(vu_long *) MPC5XXX_WU_GPIO_DATA_O |= GPIO_PSC1_4;
 }
-#endif                         /* defined (CFG_CMD_IDE) && defined (CONFIG_IDE_RESET) */
+#endif
 
 #define MPC5XXX_SIMPLEIO_GPIO_ENABLE       (MPC5XXX_GPIO + 0x0004)
 #define MPC5XXX_SIMPLEIO_GPIO_DIR          (MPC5XXX_GPIO + 0x000C)
diff --git a/board/esd/mecp5200/u-boot.lds b/board/esd/mecp5200/u-boot.lds
deleted file mode 100644 (file)
index d999dd1..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * (C) Copyright 2003
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc5xxx/start.o        (.text)
-    *(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
index ffbb4adddcd5e9ae4a1daa0d5f90a19748dffd6d..4177f68ef4dfd5002554e92b2907231c5da57efa 100644 (file)
@@ -28,7 +28,7 @@
 #include <405gp_pci.h>
 
 
-#if (CONFIG_COMMANDS & CFG_CMD_BSP)
+#if defined(CONFIG_CMD_BSP)
 
 /*
  * Set device number on pci board
index 0315c3d97bac2a6e0c2932168d4247a70afb8552..5b5ad8c4465d8afd99ac5ba5f04d13386bffd15e 100644 (file)
@@ -33,7 +33,7 @@
 #include "pci405.h"
 
 
-#if (CONFIG_COMMANDS & CFG_CMD_BSP)
+#if defined(CONFIG_CMD_BSP)
 
 extern int do_bootm (cmd_tbl_t *, int, int, char *[]);
 extern int do_bootvx (cmd_tbl_t *, int, int, char *[]);
index 77e164bd18d5d6e42c3c63f0332aff0a5e0da0eb..48b80bfc5fb8d07e27f62fc6ce2c20d431480a8b 100644 (file)
@@ -196,7 +196,7 @@ void pci_init_board(void) {
 }
 #endif
 
-#if defined (CFG_CMD_IDE) && defined (CONFIG_IDE_RESET)
+#if defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_RESET)
 
 void init_ide_reset(void)
 {
@@ -217,7 +217,7 @@ void ide_set_reset(int idereset)
                *(vu_long *) MPC5XXX_WU_GPIO_DATA_O |= GPIO_PSC1_4;
        }
 }
-#endif                         /* defined (CFG_CMD_IDE) && defined (CONFIG_IDE_RESET) */
+#endif
 
 #define MPC5XXX_SIMPLEIO_GPIO_ENABLE       (MPC5XXX_GPIO + 0x0004)
 #define MPC5XXX_SIMPLEIO_GPIO_DIR          (MPC5XXX_GPIO + 0x000C)
diff --git a/board/esd/pf5200/u-boot.lds b/board/esd/pf5200/u-boot.lds
deleted file mode 100644 (file)
index f23432e..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * (C) Copyright 2003
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc5xxx/start.o        (.text)
-    *(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
index 59171f8f4c5cfbaf0fda5dcdb864ccbb5f320306..920f7178aec384dec0cf1821b82e5e24018ced5a 100644 (file)
@@ -262,7 +262,7 @@ void ide_set_reset(int on)
 #endif /* CONFIG_IDE_RESET */
 
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
 #include <linux/mtd/nand_legacy.h>
 extern struct nand_chip nand_dev_desc[CFG_MAX_NAND_DEVICE];
 
index 22995b50209db6bb4d7fa1ae3e480bc599030311..3e118e7655550f993f7bd8b5b85b66bb294696aa 100644 (file)
@@ -342,7 +342,7 @@ void ide_set_reset(int on)
 #endif /* CONFIG_IDE_RESET */
 
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
 #include <linux/mtd/nand_legacy.h>
 extern struct nand_chip nand_dev_desc[CFG_MAX_NAND_DEVICE];
 
index 5a1a3f3e8ee68fe38e07384fb72ba2f9b45a8b76..61d1d6c0ce66ab868355261b3d99975e000b025b 100644 (file)
@@ -238,7 +238,7 @@ int testdram (void)
 
 /* ------------------------------------------------------------------------- */
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
 #include <linux/mtd/nand_legacy.h>
 extern struct nand_chip nand_dev_desc[CFG_MAX_NAND_DEVICE];
 
index 0b81fc0c3aedbad5f0710beb3fb5665bba639849..18ab5005ef4bc2bbb29a13a0256a8c3bfd458996 100644 (file)
@@ -18,7 +18,7 @@
 #include <command.h>
 #include <rtc.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_DATE)
+#if defined(CONFIG_CMD_DATE)
 
 #define RTC_BASE (CFG_NVRAM_BASE_ADDR + 0x7fff8)
 
diff --git a/board/etin/debris/u-boot.lds b/board/etin/debris/u-boot.lds
deleted file mode 100644 (file)
index c742bcd..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * (C) Copyright 2001
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)      }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)      }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)       }
-  .rela.got      : { *(.rela.got)      }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)       }
-  .rela.bss      : { *(.rela.bss)      }
-  .rel.plt       : { *(.rel.plt)       }
-  .rela.plt      : { *(.rela.plt)      }
-  .init          : { *(.init)          }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc824x/start.o        (.text)
-    lib_ppc/board.o    (.text)
-    lib_ppc/ppcstring.o        (.text)
-
-       . = DEFINED(env_offset) ? env_offset : .;
-    common/environment.o (.text)
-
-       *(.text)
-
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-
-  _end = . ;
-  PROVIDE (end = .);
-}
diff --git a/board/etin/kvme080/u-boot.lds b/board/etin/kvme080/u-boot.lds
deleted file mode 100644 (file)
index dda3687..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * (C) Copyright 2001-2006
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)      }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)      }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)       }
-  .rela.got      : { *(.rela.got)      }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)       }
-  .rela.bss      : { *(.rela.bss)      }
-  .rel.plt       : { *(.rel.plt)       }
-  .rela.plt      : { *(.rela.plt)      }
-  .init          : { *(.init)          }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc824x/start.o        (.text)
-    lib_ppc/board.o    (.text)
-    lib_ppc/ppcstring.o        (.text)
-
-       . = DEFINED(env_offset) ? env_offset : .;
-    common/environment.o (.text)
-
-       *(.text)
-
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-
-  _end = . ;
-  PROVIDE (end = .);
-}
index eafa48bc6ea97ca837ff9fc5f2c64b82e8dd1377..add2b3df534c379a3a064f42d6c32c75998683a5 100644 (file)
@@ -31,7 +31,7 @@ Skeleton NIC driver for Etherboot
 #include "eth.h"
 #include "eth_addrtbl.h"
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET) && defined(CONFIG_NET_MULTI)
+#if defined(CONFIG_CMD_NET) && defined(CONFIG_NET_MULTI)
 
 #define GT6426x_ETH_BUF_SIZE   1536
 
@@ -797,11 +797,11 @@ gt6426x_eth_initialize(bd_t *bis)
 
 
                eth_register(dev);
-#if defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII)
+#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
                miiphy_register(dev->name,
                                gt6426x_miiphy_read, gt6426x_miiphy_write);
 #endif
        }
 
 }
-#endif /* CFG_CMD_NET && CONFIG_NET_MULTI */
+#endif
index 191445c691c4f0d9978f624f703d79af90f88717..f1bcab3f0056d920e4f75614facf6a26d1f8fe6e 100644 (file)
@@ -153,7 +153,7 @@ serial_puts (const char *s)
        }
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 void
 kgdb_serial_init(void)
 {
@@ -182,4 +182,4 @@ kgdb_interruptible (int yes)
 {
        return;
 }
-#endif /* CFG_CMD_KGDB */
+#endif
index d64025afd74803a8911c6999b1e654df6ba53f56..296e4619c9a31c10692c691f2d24ecd54d257be6 100644 (file)
@@ -1,7 +1,7 @@
 #include <common.h>
 #include <malloc.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_BSP)
+#if defined(CONFIG_CMD_BSP)
 #include <command.h>
 #endif
 
@@ -166,7 +166,7 @@ void zuma_init_pbb (void)
 
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_BSP)
+#if defined(CONFIG_CMD_BSP)
 
 static int last_cmd = 4;               /* write increment */
 static int last_size = 64;
@@ -217,4 +217,4 @@ U_BOOT_CMD(
        "    - init zuma mbox\n"
 );
 
-#endif /* CFG_CMD_BSP */
+#endif
index 7b04af56c9f7afa9afb6192be1f47bcf956624a5..8f5736b4141a08d3094fda521e759e3c884525e4 100644 (file)
@@ -778,7 +778,7 @@ int checkboard (void)
 
 /* ========================================================================= */
 
-#if (CONFIG_COMMANDS & CFG_CMD_PCMCIA)
+#if defined(CONFIG_CMD_PCMCIA)
 
 #ifdef CFG_PCMCIA_MEM_ADDR
 volatile unsigned char *pcmcia_mem = (unsigned char*)CFG_PCMCIA_MEM_ADDR;
@@ -921,7 +921,7 @@ int pcmcia_init(void)
        return 0;
 }
 
-#endif /* CFG_CMD_PCMCIA */
+#endif
 
 /* ========================================================================= */
 
index 41f18b5cf542b8d8c89637c3089a76ffa088504f..c6f7ccde077411b0f4dcb977b242d0b9903ba073 100644 (file)
 #define CFG_DISCOVER_PHY
 #endif
 
-#ifndef CONFIG_COMMANDS
-#define CONFIG_COMMANDS        (CONFIG_CMD_DFL   \
-                        | CFG_CMD_ASKENV \
-                        | CFG_CMD_DHCP   \
-                        | CFG_CMD_ECHO   \
-                        | CFG_CMD_IMMAP  \
-                        | CFG_CMD_JFFS2  \
-                        | CFG_CMD_MII    \
-                        | CFG_CMD_PCMCIA \
-                        | CFG_CMD_PING   \
-                       )
-#endif /* !CONFIG_COMMANDS */
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+#if !defined(FADS_COMMANDS_ALREADY_DEFINED)
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_ECHO
+#define CONFIG_CMD_IMMAP
+#define CONFIG_CMD_JFFS2
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_PCMCIA
+#define CONFIG_CMD_PING
+
+#endif
+
 
 /*
  * Miscellaneous configurable options
 #define CFG_HUSH_PARSER
 #define CFG_PROMPT_HUSH_PS2    "> "
 #define        CFG_LONGHELP                            /* #undef to save memory        */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE              1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE              256             /* Console I/O Buffer Size      */
 
 #define        CFG_DIRECT_FLASH_TFTP
 
-#if (CONFIG_COMMANDS & CFG_CMD_JFFS2)
+#if defined(CONFIG_CMD_JFFS2)
 
 /*
  * JFFS2 partitions
 */
 
 #define CFG_JFFS2_SORT_FRAGMENTS
-#endif /* CFG_CMD_JFFS2 */
+#endif
 
 /*-----------------------------------------------------------------------
  * Cache Configuration
 /*-----------------------------------------------------------------------
  * I2C configuration
  */
-#if (CONFIG_COMMANDS & CFG_CMD_I2C)
+#if defined(CONFIG_CMD_I2C)
 #define CONFIG_HARD_I2C                1       /* I2C with hardware support */
 #define CFG_I2C_SPEED          400000  /* I2C speed and slave address defaults */
 #define CFG_I2C_SLAVE          0x7F
 #define CONFIG_ISO_PARTITION   1
 
 #undef CONFIG_ATAPI
-#if 0  /* does not make sense when CFG_CMD_IDE is not enabled, too */
+#if 0  /* does not make sense when CONFIG_CMD_IDE is not enabled, too */
 #define CONFIG_IDE_8xx_PCCARD  1       /* Use IDE with PC Card Adapter */
 #endif
 #undef CONFIG_IDE_8xx_DIRECT           /* Direct IDE    not supported  */
index 978c16b9412e4893904b1828cf02b53245b2c1d6..57a24543a854d0eef3e948883df373dcd1ade663 100644 (file)
@@ -4,11 +4,11 @@
 
 #undef CONFIG_PCMCIA
 
-#if    (CONFIG_COMMANDS & CFG_CMD_PCMCIA)
+#if defined(CONFIG_CMD_PCMCIA)
 #define        CONFIG_PCMCIA
 #endif
 
-#if    (CONFIG_COMMANDS & CFG_CMD_IDE) && defined(CONFIG_IDE_8xx_PCCARD)
+#if defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_8xx_PCCARD)
 #define        CONFIG_PCMCIA
 #endif
 
@@ -73,12 +73,12 @@ int pcmcia_hardware_enable(int slot)
        return 0;
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_PCMCIA)
+#if defined(CONFIG_CMD_PCMCIA)
 int pcmcia_hardware_disable(int slot)
 {
        *((uint *)BCSR1) &= ~BCSR1_PCCEN;
        return 0;
 }
-#endif /* CFG_CMD_PCMCIA */
+#endif
 
 #endif /* CONFIG_PCMCIA */
index af98157dfd724d51acedd911a5e74c6b2aacc616..99cc2ee197ed1e1e8a83c5dc1a6cca974b0925fb 100644 (file)
@@ -321,10 +321,10 @@ static ulong strfractoint(uchar *strptr)
                mulconst = 1;
                for (i = 0; i < decarr_len; i++)
                        mulconst *= 10;
-               decval = simple_strtoul(decarr, NULL, 10);
+               decval = simple_strtoul((char *)decarr, NULL, 10);
        }
 
-       intval = simple_strtoul(intarr, NULL, 10);
+       intval = simple_strtoul((char *)intarr, NULL, 10);
        intval = intval * mulconst;
 
        retval = intval + decval;
@@ -362,7 +362,7 @@ pixis_reset_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 
                val = set_px_sysclk(simple_strtoul(argv[2], NULL, 10));
 
-               corepll = strfractoint(argv[3]);
+               corepll = strfractoint((uchar *)argv[3]);
                val = val + set_px_corepll(corepll);
                val = val + set_px_mpxpll(simple_strtoul(argv[4], NULL, 10));
                if (val == 3) {
@@ -410,7 +410,7 @@ pixis_reset_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                        read_from_px_regs(0);
                        read_from_px_regs_altbank(0);
                        val = set_px_sysclk(simple_strtoul(argv[3], NULL, 10));
-                       corepll = strfractoint(argv[4]);
+                       corepll = strfractoint((uchar *)argv[4]);
                        val = val + set_px_corepll(corepll);
                        val = val + set_px_mpxpll(simple_strtoul(argv[5],
                                                                 NULL, 10));
index bec21686391ed02ed9a0d8afca91ed5791839b22..308f707de032cf6df8fca75c489bfa75492d16ec 100644 (file)
@@ -24,9 +24,9 @@
 
 include $(TOPDIR)/config.mk
 
-ifneq ($(OBJTREE),$(SRCTREE))
-# $(shell mkdir -p $(obj)./common)
-endif
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+endif
 
 LIB    = $(obj)lib$(BOARD).a
 
index 03a03d0af097f3f444b0e9c57b20de1da7daa043..58b5b6eb106a58f74ea98db9b428441db6030df1 100644 (file)
@@ -31,7 +31,7 @@
 
 #include "m88e6060.h"
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
 static int             prtTab[M88X_PRT_CNT] = { 8, 9, 10, 11, 12, 13 };
 static int             phyTab[M88X_PHY_CNT] = { 0, 1, 2, 3, 4 };
 
diff --git a/board/funkwerk/vovpn-gw/u-boot.lds b/board/funkwerk/vovpn-gw/u-boot.lds
deleted file mode 100644 (file)
index bf8048d..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * (C) Copyright 2001-2003
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * Modified by Yuli Barcohen <yuli@arabellasw.com>
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc8260/start.o        (.text)
-    *(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
-ENTRY(_start)
index 97f81eefcfdbe53ef7f3a21bd1c6585453bcbc49..9b5429afa525f390acd82353d1739ff09120eb38 100644 (file)
@@ -184,7 +184,7 @@ const iop_conf_t iop_conf_tab[4][32] = {
 void reset_phy (void)
 {
        volatile ioport_t *iop;
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
        int i;
        unsigned short val;
 #endif
@@ -193,7 +193,7 @@ void reset_phy (void)
 
        /* Reset the PHY */
        iop->pdat &= 0xfff7ffff;        /* PA12 = |SWITCH_RESET */
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
        udelay(20000);
        iop->pdat |= 0x00080000;
        for (i=0; i<100; i++) {
index 39b5c701e02c34f3ed12f0ac94961fa33570aa72..2dfd87c78e596c6267a21ddab7ba01a6d05a27c2 100644 (file)
@@ -73,7 +73,7 @@ int misc_init_f (void)
 
 int misc_init_r (void)
 {
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
        /*
         * Set NAND-FLASH GPIO signals to default
         */
@@ -184,7 +184,7 @@ int testdram (void)
 }
 
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
 #include <linux/mtd/nand_legacy.h>
 extern struct nand_chip nand_dev_desc[CFG_MAX_NAND_DEVICE];
 
index eb732210053ada257bf28b0cc97e75b0f2f80769..d448f9fa33dc92540a04fb47d6b20eed2fc3f4d0 100644 (file)
@@ -36,7 +36,7 @@ DECLARE_GLOBAL_DATA_PTR;
 #include <status_led.h>
 #endif
 
-#if defined(CFG_CMD_MII) && defined(CONFIG_MII)
+#if defined(CONFIG_CMD_MII) && defined(CONFIG_MII)
 #include <net.h>
 #endif
 
@@ -222,7 +222,7 @@ long int initdram (int board_type)
  * Disk On Chip (DOC) Millenium initialization.
  * The DOC lives in the CS2* space
  */
-#if (CONFIG_COMMANDS & CFG_CMD_DOC)
+#if defined(CONFIG_CMD_DOC)
 extern void doc_probe (ulong physadr);
 
 void doc_init (void)
@@ -250,7 +250,7 @@ int misc_init_r (void)
 
        config_mpc8xx_ioports (immr);
 
-#if (CONFIG_COMMANDS & CFG_CMD_MII)
+#if defined(CONFIG_CMD_MII)
        mii_init ();
 #endif
 
index 5f8c8997e51dd7ddc9f946b135bf8a81529641d8..c75507f61d4167b046742e7004ffe164ce4ffd73 100644 (file)
@@ -267,7 +267,7 @@ static long int dram_size (long int mbmr_value, long int *base,
        return (size);
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_PCMCIA)
+#if defined(CONFIG_CMD_PCMCIA)
 
 #ifdef CFG_PCMCIA_MEM_ADDR
 volatile unsigned char *pcmcia_mem = (unsigned char *) CFG_PCMCIA_MEM_ADDR;
@@ -357,4 +357,4 @@ int pcmcia_init (void)
 
        return 0;
 }
-#endif /* CFG_CMD_PCMCIA */
+#endif
index fce5492635ebcf4cf8f47879871381fbb614669b..cffcbde89a27119a78ea1599ae10b045bf24b1f0 100644 (file)
@@ -4,11 +4,11 @@
 
 #undef CONFIG_PCMCIA
 
-#if    (CONFIG_COMMANDS & CFG_CMD_PCMCIA)
+#if defined(CONFIG_CMD_PCMCIA)
 #define        CONFIG_PCMCIA
 #endif
 
-#if    (CONFIG_COMMANDS & CFG_CMD_IDE) && defined(CONFIG_IDE_8xx_PCCARD)
+#if defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_8xx_PCCARD)
 #define        CONFIG_PCMCIA
 #endif
 
@@ -83,7 +83,7 @@ int pcmcia_hardware_enable (int slot)
 
        return 0;
 }
-#if (CONFIG_COMMANDS & CFG_CMD_PCMCIA)
+#if defined(CONFIG_CMD_PCMCIA)
 int pcmcia_hardware_disable(int slot)
 {
        return 0;       /* No hardware to disable */
diff --git a/board/gw8260/u-boot.lds b/board/gw8260/u-boot.lds
deleted file mode 100644 (file)
index ab65cb1..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * (C) Copyright 2000, 2001
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc8260/start.o        (.text)
-    *(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
diff --git a/board/hidden_dragon/u-boot.lds b/board/hidden_dragon/u-boot.lds
deleted file mode 100644 (file)
index 2a5cd2e..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * (C) Copyright 2001
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)      }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)      }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)       }
-  .rela.got      : { *(.rela.got)      }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)       }
-  .rela.bss      : { *(.rela.bss)      }
-  .rel.plt       : { *(.rel.plt)       }
-  .rela.plt      : { *(.rela.plt)      }
-  .init          : { *(.init)          }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc824x/start.o        (.text)
-    lib_ppc/board.o    (.text)
-    lib_ppc/ppcstring.o        (.text)
-
-       . = DEFINED(env_offset) ? env_offset : .;
-    common/environment.o (.text)
-
-       *(.text)
-
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-
-  _end = . ;
-  PROVIDE (end = .);
-}
index 51e8e84c5c304836c6a2def8b62f9ece430d3c82..4fe18316e5f654b83d8c4b688b1495c662b8175a 100644 (file)
@@ -39,3 +39,4 @@ TEXT_BASE = 0xFFF00000
 endif
 
 PLATFORM_CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE) -I$(TOPDIR)/board
+LDSCRIPT := $(SRCTREE)/cpu/mpc5xxx/u-boot-customlayout.lds
diff --git a/board/hmi1001/u-boot.lds b/board/hmi1001/u-boot.lds
deleted file mode 100644 (file)
index 123a14c..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * (C) Copyright 2003-2004
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    /* WARNING - the following is hand-optimized to fit within  */
-    /* the sector layout of our flash chips!    XXX FIXME XXX   */
-
-    cpu/mpc5xxx/start.o          (.text)
-    cpu/mpc5xxx/traps.o          (.text)
-    lib_generic/crc32.o         (.text)
-    lib_ppc/cache.o             (.text)
-    lib_ppc/time.o              (.text)
-
-    . = DEFINED(env_offset) ? env_offset : .;
-    common/environment.o        (.ppcenv)
-
-    *(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
index 6868f260c2094699772505fa06cfda896d593c8d..12f14020172f3b03c58654585c6388719656920c 100644 (file)
@@ -34,7 +34,7 @@ DECLARE_GLOBAL_DATA_PTR;
  * Board Special Commands: FPGA load/store, EEPROM erase
  */
 
-#if (CONFIG_COMMANDS & CFG_CMD_BSP)
+#if defined(CONFIG_CMD_BSP)
 
 #define LOAD_SUCCESS           0
 #define LOAD_FAIL_NOCONF       1
@@ -402,6 +402,4 @@ do_htest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        return 0;
 }
 
-#endif /* CFG_CMD_BSP */
-
-/* ------------------------------------------------------------------------- */
+#endif
index 0a9985f337c7247aa0bc91f3c454beac122de013..2df321fdde75caf200d31167fa5a01283c7eb3d8 100644 (file)
@@ -30,3 +30,5 @@ TEXT_BASE = 0x40000000
 PLATFORM_CPPFLAGS += -I$(TOPDIR)
 
 OBJCFLAGS = --remove-section=.ppcenv
+
+LDSCRIPT := $(SRCTREE)/board/hymod/u-boot.lds
index 337a3954d2de2a0f10692f76f4e0524bf8028c68..9bf0f0938a2fbf4e14329ce54bdf309ad87037c2 100644 (file)
@@ -69,7 +69,6 @@ SECTIONS
     common/environment.o(.text)
 
     *(.text)
-    *(.fixup)
     *(.got1)
   }
   _etext = .;
index 296099843421a0e489e47ffd843b75840b4d07fe..c027f6f34e61dad7107faf8c723cc83d5367182c 100644 (file)
@@ -359,7 +359,7 @@ void pci_init_board(void)
 }
 #endif
 
-#if defined (CFG_CMD_IDE) && defined (CONFIG_IDE_RESET)
+#if defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_RESET)
 
 void init_ide_reset (void)
 {
@@ -384,7 +384,7 @@ void ide_set_reset (int idereset)
                *(vu_long *) MPC5XXX_WU_GPIO_DATA_O |=  GPIO_PSC1_4;
        }
 }
-#endif /* defined (CFG_CMD_IDE) && defined (CONFIG_IDE_RESET) */
+#endif
 
 #if defined(CONFIG_OF_FLAT_TREE) && defined(CONFIG_OF_BOARD_SETUP)
 void
diff --git a/board/icecube/u-boot.lds b/board/icecube/u-boot.lds
deleted file mode 100644 (file)
index f23432e..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * (C) Copyright 2003
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc5xxx/start.o        (.text)
-    *(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
index 20f653ba2ba381ad34363c32275dd354e8e8d646..11de18317d1dc704a2332d2ff6055937ccb1f27e 100644 (file)
@@ -4,11 +4,11 @@
 
 #undef CONFIG_PCMCIA
 
-#if    (CONFIG_COMMANDS & CFG_CMD_PCMCIA)
+#if defined(CONFIG_CMD_PCMCIA)
 #define        CONFIG_PCMCIA
 #endif
 
-#if    (CONFIG_COMMANDS & CFG_CMD_IDE) && defined(CONFIG_IDE_8xx_PCCARD)
+#if defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_8xx_PCCARD)
 #define        CONFIG_PCMCIA
 #endif
 
@@ -155,7 +155,7 @@ int pcmcia_hardware_enable(int slot)
 }
 
 
-#if (CONFIG_COMMANDS & CFG_CMD_PCMCIA)
+#if defined(CONFIG_CMD_PCMCIA)
 int pcmcia_hardware_disable(int slot)
 {
        volatile immap_t        *immap;
@@ -183,7 +183,7 @@ int pcmcia_hardware_disable(int slot)
 
        return (0);
 }
-#endif /* CFG_CMD_PCMCIA */
+#endif
 
 
 int pcmcia_voltage_set(int slot, int vcc, int vpp)
index 7b9a83d0f954b195830391a02977ee2d3f78cecd..19823a474ed09f1c831cefbd260fab9c6d1e70af 100644 (file)
@@ -300,7 +300,7 @@ int misc_init_r (void)
        gd->bd->bi_flashstart = 0xff800000;
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
 extern ulong
 nand_probe (ulong physadr);
 
@@ -315,4 +315,4 @@ nand_init (void)
        printf ("%4lu MB\n", totlen >>20);
 }
 
-#endif /* CFG_CMD_NAND */
+#endif
diff --git a/board/ids8247/u-boot.lds b/board/ids8247/u-boot.lds
deleted file mode 100644 (file)
index 788aed3..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * (C) Copyright 2001
- * Heiko Schocher, DENX Software Engineering, <hs@denx.de>
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc8260/start.o        (.text)
-    *(.text)
-    common/environment.o(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
index cb19a7daeff2a4c57e78f1d86d5959fc150d86f7..fc70efeeed4d8d112434a48073e2b3de819b28b5 100644 (file)
@@ -39,3 +39,4 @@ TEXT_BASE = 0xFFE00000
 endif
 
 PLATFORM_CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE) -I$(TOPDIR)/board
+LDSCRIPT := $(SRCTREE)/cpu/mpc5xxx/u-boot-customlayout.lds
index d670cc35a003e0790ae566eb7e3fc0ede7faf76f..478a331b408e01007078c2a66ded3f4ed6cfc7ce 100644 (file)
@@ -236,7 +236,7 @@ void pci_init_board(void)
 }
 #endif
 
-#if defined (CFG_CMD_IDE) && defined (CONFIG_IDE_RESET)
+#if defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_RESET)
 
 void init_ide_reset (void)
 {
@@ -261,4 +261,4 @@ void ide_set_reset (int idereset)
                *(vu_long *) MPC5XXX_WU_GPIO_DATA_O |=  GPIO_PSC1_4;
        }
 }
-#endif /* defined (CFG_CMD_IDE) && defined (CONFIG_IDE_RESET) */
+#endif
diff --git a/board/inka4x0/u-boot.lds b/board/inka4x0/u-boot.lds
deleted file mode 100644 (file)
index 123a14c..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * (C) Copyright 2003-2004
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    /* WARNING - the following is hand-optimized to fit within  */
-    /* the sector layout of our flash chips!    XXX FIXME XXX   */
-
-    cpu/mpc5xxx/start.o          (.text)
-    cpu/mpc5xxx/traps.o          (.text)
-    lib_generic/crc32.o         (.text)
-    lib_ppc/cache.o             (.text)
-    lib_ppc/time.o              (.text)
-
-    . = DEFINED(env_offset) ? env_offset : .;
-    common/environment.o        (.ppcenv)
-
-    *(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
diff --git a/board/iphase4539/u-boot.lds b/board/iphase4539/u-boot.lds
deleted file mode 100644 (file)
index 4ea01ea..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * (C) Copyright 2001
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc8260/start.o        (.text)
-    *(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
diff --git a/board/ispan/u-boot.lds b/board/ispan/u-boot.lds
deleted file mode 100644 (file)
index bf8048d..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * (C) Copyright 2001-2003
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * Modified by Yuli Barcohen <yuli@arabellasw.com>
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc8260/start.o        (.text)
-    *(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
-ENTRY(_start)
index eaf7cdefe566342f03d8703316172c010d2278a9..2a33d6d0734e694f9ed0b06ba87edb4f6880b9d2 100644 (file)
@@ -112,7 +112,7 @@ int dram_init (void)
        return (0);
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_PCI) || defined(CONFIG_PCI)
+#if defined(CONFIG_CMD_PCI) || defined(CONFIG_PCI)
 extern struct pci_controller hose;
 extern void pci_ixp_init(struct pci_controller * hose);
 
index 04fda4a69f1bbd9e2bf9f25daecb33d4ead78e42..b2274875e5158f3a7464ba4f646bfada354315a9 100644 (file)
@@ -281,7 +281,7 @@ void pci_init_board(void)
 }
 #endif
 
-#if defined (CFG_CMD_IDE) && defined (CONFIG_IDE_RESET)
+#if defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_RESET)
 
 void init_ide_reset (void)
 {
@@ -306,7 +306,7 @@ void ide_set_reset (int idereset)
                *(vu_long *) MPC5XXX_WU_GPIO_DATA_O |=  GPIO_PSC1_4;
        }
 }
-#endif /* defined (CFG_CMD_IDE) && defined (CONFIG_IDE_RESET) */
+#endif
 
 #if defined(CONFIG_OF_FLAT_TREE) && defined(CONFIG_OF_BOARD_SETUP)
 void
diff --git a/board/jupiter/u-boot.lds b/board/jupiter/u-boot.lds
deleted file mode 100644 (file)
index f23432e..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * (C) Copyright 2003
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc5xxx/start.o        (.text)
-    *(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
index ec51dca914901c1a0bc8e2bde92f61be66d44a0a..59ed8ff6042b93ba3bb2db3c2d6ebb0a0e0b4534 100644 (file)
@@ -65,7 +65,7 @@ int dram_init (void)
 }
 
 #ifdef CONFIG_DRIVER_ETHER
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
 
 unsigned int lxt972_IsPhyConnected (AT91PS_EMAC p_mac);
 UCHAR lxt972_GetLinkSpeed (AT91PS_EMAC p_mac);
@@ -90,5 +90,5 @@ void at91rm9200_GetPhyInterface(AT91PS_PhyOps p_phyops)
        p_phyops->AutoNegotiate = lxt972_AutoNegotiate;
 }
 
-#endif /* CONFIG_COMMANDS & CFG_CMD_NET */
+#endif
 #endif /* CONFIG_DRIVER_ETHER */
index 1f61a0ecd197c360e8cf618ebd596c99a4150362..def38f1c687793a8726b8246c1770e470f4176b4 100644 (file)
@@ -4,11 +4,11 @@
 
 #undef CONFIG_PCMCIA
 
-#if    (CONFIG_COMMANDS & CFG_CMD_PCMCIA)
+#if defined(CONFIG_CMD_PCMCIA)
 #define        CONFIG_PCMCIA
 #endif
 
-#if    (CONFIG_COMMANDS & CFG_CMD_IDE) && defined(CONFIG_IDE_8xx_PCCARD)
+#if defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_8xx_PCCARD)
 #define        CONFIG_PCMCIA
 #endif
 
@@ -115,7 +115,7 @@ int pcmcia_hardware_enable(int slot)
 }
 
 
-#if (CONFIG_COMMANDS & CFG_CMD_PCMCIA)
+#if defined(CONFIG_CMD_PCMCIA)
 int pcmcia_hardware_disable(int slot)
 {
        volatile immap_t        *immap;
@@ -144,7 +144,7 @@ int pcmcia_hardware_disable(int slot)
 
        return (0);
 }
-#endif /* CFG_CMD_PCMCIA */
+#endif
 
 
 int pcmcia_voltage_set(int slot, int vcc, int vpp)
index 9e8ea2db194b91260188638b825bd927e07a0e6e..c68978aa984bb416a8db8e36f7b1da008a4e9436 100644 (file)
@@ -761,7 +761,7 @@ static uchar *key_match (uchar *kbd_data)
 
 /*---------------Board Special Commands: PIC read/write ---------------*/
 
-#if (CONFIG_COMMANDS & CFG_CMD_BSP)
+#if defined(CONFIG_CMD_BSP)
 /***********************************************************************
 F* Function:     int do_pic (cmd_tbl_t *cmdtp, int flag,
 F*                           int argc, char *argv[]) P*A*Z*
@@ -960,7 +960,7 @@ U_BOOT_CMD(
        "lsb     - print current setting\n"
 );
 
-#endif /* CFG_CMD_BSP */
+#endif
 
 /*----------------------------- Utilities -----------------------------*/
 /***********************************************************************
index 2349286bb252472e12be50e5ecfa734c7db4fca4..ebca7a2ca121f75a6f32f63e97d8190311755e75 100644 (file)
@@ -5,11 +5,11 @@
 
 #undef CONFIG_PCMCIA
 
-#if    (CONFIG_COMMANDS & CFG_CMD_PCMCIA)
+#if defined(CONFIG_CMD_PCMCIA)
 #define        CONFIG_PCMCIA
 #endif
 
-#if    (CONFIG_COMMANDS & CFG_CMD_IDE) && defined(CONFIG_IDE_8xx_PCCARD)
+#if defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_8xx_PCCARD)
 #define        CONFIG_PCMCIA
 #endif
 
@@ -127,7 +127,7 @@ int pcmcia_hardware_enable(int slot)
 }
 
 
-#if (CONFIG_COMMANDS & CFG_CMD_PCMCIA)
+#if defined(CONFIG_CMD_PCMCIA)
 int pcmcia_hardware_disable(int slot)
 {
        volatile immap_t        *immap;
@@ -166,7 +166,7 @@ int pcmcia_hardware_disable(int slot)
 
        return (0);
 }
-#endif /* CFG_CMD_PCMCIA */
+#endif
 
 
 int pcmcia_voltage_set(int slot, int vcc, int vpp)
index 132a68806d89e39be2a5269faadcbf8f5f874354..a02c84845dfb64789ad9e44eecff68b781953e10 100644 (file)
@@ -6,11 +6,11 @@
 
 #undef CONFIG_PCMCIA
 
-#if    (CONFIG_COMMANDS & CFG_CMD_PCMCIA)
+#if defined(CONFIG_CMD_PCMCIA)
 #define        CONFIG_PCMCIA
 #endif
 
-#if    (CONFIG_COMMANDS & CFG_CMD_IDE) && defined(CONFIG_IDE_8xx_PCCARD)
+#if defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_8xx_PCCARD)
 #define        CONFIG_PCMCIA
 #endif
 
@@ -156,11 +156,11 @@ int pcmcia_hardware_enable (int slot)
        return (0);
        }
 
-#if (CONFIG_COMMANDS & CFG_CMD_PCMCIA)
+#if defined(CONFIG_CMD_PCMCIA)
 int pcmcia_hardware_disable (int slot)
 {
        return 0;       /* No hardware to disable */
 }
-#endif /* CFG_CMD_PCMCIA */
+#endif
 
 #endif /* CONFIG_PCMCIA */
index 90d03ec47a85c1e38df0cbafd790ee75d0094b26..6044565ff043fac540d9c11437dd85cbb6bc3920 100644 (file)
@@ -44,8 +44,8 @@
 #error "must define CFG_HUSH_PARSER"
 #endif
 
-#if !(CONFIG_COMMANDS & CFG_CMD_FAT)
-#error "must define CFG_CMD_FAT"
+#if !defined(CONFIG_CMD_FAT)
+#error "must define CONFIG_CMD_FAT"
 #endif
 
 #undef AU_DEBUG
index af047e2a0772a281303f99590ddc79fe1739bc12..a4c4644b4c003513c9abc64ba341d937c1045b6b 100644 (file)
@@ -307,7 +307,7 @@ void pci_init_board(void)
 }
 #endif
 
-#if defined (CFG_CMD_IDE) && defined (CONFIG_IDE_RESET)
+#if defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_RESET)
 
 void init_ide_reset (void)
 {
@@ -320,9 +320,9 @@ void ide_set_reset (int idereset)
        debug ("ide_reset(%d)\n", idereset);
 
 }
-#endif /* defined (CFG_CMD_IDE) && defined (CONFIG_IDE_RESET) */
+#endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_DOC)
+#if defined(CONFIG_CMD_DOC)
 extern void doc_probe (ulong physadr);
 void doc_init (void)
 {
diff --git a/board/mcc200/u-boot.lds b/board/mcc200/u-boot.lds
deleted file mode 100644 (file)
index 4fdea6b..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * (C) Copyright 2003-2006
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc5xxx/start.o        (.text)
-    *(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
index 74687f12c63ba69c20ebcf42d2384dc1aa2ac058..659314572a1a8ac36fc23bec86e22a6a031cc47f 100644 (file)
@@ -88,7 +88,7 @@ void serial_puts (const char *s)
        }
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 void kgdb_serial_init (void)
 {
 }
@@ -112,4 +112,4 @@ void kgdb_interruptible (int yes)
 {
        return;
 }
-#endif /* CFG_CMD_KGDB */
+#endif
diff --git a/board/motionpro/u-boot.lds b/board/motionpro/u-boot.lds
deleted file mode 100644 (file)
index 8fa9c0f..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * (C) Copyright 2003-2007
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc5xxx/start.o        (.text)
-    *(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
index 64cffa4ee2d6d7fd75d41d000ad9a3eff820909f..933e6b32a0794fc7a16051967a74b02abdf22c89 100644 (file)
@@ -26,3 +26,5 @@
 #
 TEXT_BASE = 0xFFF00000
 PLATFORM_CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE)
+
+LDSCRIPT := $(SRCTREE)/board/mousse/u-boot.lds
index 57358b8a49dcb69640e30cf2a47be7ccc7e40078..eb4d8e4e2b61f97586643e2a7c15f4585cf32dc6 100644 (file)
@@ -60,7 +60,6 @@ SECTIONS
     lib_generic/crc32.o                (.text)
     lib_generic/zlib.o         (.text)
 
-    *(.fixup)
     *(.got1)
     . = ALIGN(16);
     *(.rodata)
index 486d44c202f1523f97ac0ec88625ad4ef943a8ae..dcda699dc876877d26b24220be9e289624c77c85 100644 (file)
@@ -61,7 +61,7 @@ int dram_init (void)
 }
 
 #ifdef CONFIG_DRIVER_ETHER
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
 
 /*
  * Name:
@@ -81,5 +81,5 @@ void at91rm9200_GetPhyInterface(AT91PS_PhyOps p_phyops)
        p_phyops->AutoNegotiate = dm9161_AutoNegotiate;
 }
 
-#endif /* CONFIG_COMMANDS & CFG_CMD_NET */
+#endif
 #endif /* CONFIG_DRIVER_ETHER */
diff --git a/board/mpc8260ads/u-boot.lds b/board/mpc8260ads/u-boot.lds
deleted file mode 100644 (file)
index bf8048d..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * (C) Copyright 2001-2003
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * Modified by Yuli Barcohen <yuli@arabellasw.com>
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc8260/start.o        (.text)
-    *(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
-ENTRY(_start)
diff --git a/board/mpc8266ads/u-boot.lds b/board/mpc8266ads/u-boot.lds
deleted file mode 100644 (file)
index 2220758..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * (C) Copyright 2001
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc8260/start.o        (.text)
-    *(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
diff --git a/board/mpc8313erdb/u-boot.lds b/board/mpc8313erdb/u-boot.lds
deleted file mode 100644 (file)
index 937c87a..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * (C) Copyright 2006
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc83xx/start.o        (.text)
-    *(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
-ENTRY(_start)
diff --git a/board/mpc832xemds/u-boot.lds b/board/mpc832xemds/u-boot.lds
deleted file mode 100644 (file)
index 937c87a..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * (C) Copyright 2006
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc83xx/start.o        (.text)
-    *(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
-ENTRY(_start)
diff --git a/board/mpc8349emds/u-boot.lds b/board/mpc8349emds/u-boot.lds
deleted file mode 100644 (file)
index 937c87a..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * (C) Copyright 2006
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc83xx/start.o        (.text)
-    *(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
-ENTRY(_start)
diff --git a/board/mpc8349itx/u-boot.lds b/board/mpc8349itx/u-boot.lds
deleted file mode 100644 (file)
index f044c0f..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Copyright (C) Freescale Semiconductor, Inc. 2006. All rights reserved.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc83xx/start.o        (.text)
-    *(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
-ENTRY(_start)
diff --git a/board/mpc8360emds/u-boot.lds b/board/mpc8360emds/u-boot.lds
deleted file mode 100644 (file)
index 937c87a..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * (C) Copyright 2006
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc83xx/start.o        (.text)
-    *(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
-ENTRY(_start)
index d19bad683533ffa822af5db2b9169c646f0993f8..41acb97af7eafd50f8fe4b6b35b3d5149bbb35cb 100644 (file)
@@ -549,9 +549,35 @@ pci_init_board(void)
 
 
 #if defined(CONFIG_OF_FLAT_TREE) && defined(CONFIG_OF_BOARD_SETUP)
+void
+ft_soc_setup(void *blob, bd_t *bd)
+{
+       u32 *p;
+       int len;
+       ulong data;
+
+       p = ft_get_prop(blob, "/" OF_SOC "/cpm@e0000000/brg-frequency", &len);
+
+       if (p != NULL)
+               *p = cpu_to_be32(bd->bi_brgfreq);
+
+       p = ft_get_prop(blob,
+                       "/" OF_SOC "/cpm@e0000000/scc@91a00/current-speed",
+                       &len);
+       if (p != NULL)
+               *p = cpu_to_be32(bd->bi_baudrate);
+
+       p = ft_get_prop(blob,
+                       "/" OF_SOC "/cpm@e0000000/scc@91a20/current-speed",
+                       &len);
+       if (p != NULL)
+               *p = cpu_to_be32(bd->bi_baudrate);
+}
+
 void
 ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
+       ft_soc_setup(blob, bd);
 }
 #endif
index 7d7e2afad31cc1389e4a3dcdf404d42448dac0e4..d2182aba5f0483c99e5698f702307d868318cbea 100644 (file)
@@ -11,7 +11,7 @@
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
@@ -24,6 +24,7 @@
 #include <pci.h>
 #include <asm/processor.h>
 #include <asm/immap_86xx.h>
+#include <asm/immap_fsl_pci.h>
 #include <spd.h>
 #include <asm/io.h>
 
@@ -55,36 +56,6 @@ int checkboard(void)
 {
        puts("Board: MPC8641HPCN\n");
 
-#ifdef CONFIG_PCI
-
-       volatile immap_t *immap = (immap_t *) CFG_CCSRBAR;
-       volatile ccsr_gur_t *gur = &immap->im_gur;
-       volatile ccsr_pex_t *pex1 = &immap->im_pex1;
-
-       uint devdisr = gur->devdisr;
-       uint io_sel = (gur->pordevsr & MPC86xx_PORDEVSR_IO_SEL) >> 16;
-       uint host1_agent = (gur->porbmsr & MPC86xx_PORBMSR_HA) >> 17;
-       uint pex1_agent = (host1_agent == 0) || (host1_agent == 1);
-
-       if ((io_sel == 2 || io_sel == 3 || io_sel == 5
-            || io_sel == 6 || io_sel == 7 || io_sel == 0xF)
-           && !(devdisr & MPC86xx_DEVDISR_PCIEX1)) {
-               debug("PCI-EXPRESS 1: %s \n", pex1_agent ? "Agent" : "Host");
-               debug("0x%08x=0x%08x ", &pex1->pme_msg_det, pex1->pme_msg_det);
-               if (pex1->pme_msg_det) {
-                       pex1->pme_msg_det = 0xffffffff;
-                       debug(" with errors.  Clearing.  Now 0x%08x",
-                             pex1->pme_msg_det);
-               }
-               debug("\n");
-       } else {
-               puts("PCI-EXPRESS 1: Disabled\n");
-       }
-
-#else
-       puts("PCI-EXPRESS1: Disabled\n");
-#endif
-
        return 0;
 }
 
@@ -219,21 +190,138 @@ static struct pci_config_table pci_fsl86xxads_config_table[] = {
 #endif
 
 
-static struct pci_controller hose = {
+static struct pci_controller pci1_hose = {
 #ifndef CONFIG_PCI_PNP
-      config_table:pci_mpc86xxcts_config_table,
+       config_table:pci_mpc86xxcts_config_table
 #endif
 };
-
 #endif /* CONFIG_PCI */
 
+#ifdef CONFIG_PCI2
+static struct pci_controller pci2_hose;
+#endif /* CONFIG_PCI2 */
+
+int first_free_busno = 0;
+
+
 void pci_init_board(void)
 {
-#ifdef CONFIG_PCI
-       extern void pci_mpc86xx_init(struct pci_controller *hose);
+       volatile immap_t *immap = (immap_t *) CFG_CCSRBAR;
+       volatile ccsr_gur_t *gur = &immap->im_gur;
+       uint devdisr = gur->devdisr;
+       uint io_sel = (gur->pordevsr & MPC86xx_PORDEVSR_IO_SEL) >> 16;
+
+#ifdef CONFIG_PCI1
+{
+       volatile ccsr_fsl_pci_t *pci = (ccsr_fsl_pci_t *) CFG_PCI1_ADDR;
+       extern void fsl_pci_init(struct pci_controller *hose);
+       struct pci_controller *hose = &pci1_hose;
+#ifdef DEBUG
+       uint host1_agent = (gur->porbmsr & MPC86xx_PORBMSR_HA) >> 17;
+       uint pex1_agent = (host1_agent == 0) || (host1_agent == 1);
+#endif
+       if ((io_sel == 2 || io_sel == 3 || io_sel == 5
+            || io_sel == 6 || io_sel == 7 || io_sel == 0xF)
+           && !(devdisr & MPC86xx_DEVDISR_PCIEX1)) {
+               debug("PCI-EXPRESS 1: %s \n", pex1_agent ? "Agent" : "Host");
+               debug("0x%08x=0x%08x ", &pci->pme_msg_det, pci->pme_msg_det);
+               if (pci->pme_msg_det) {
+                       pci->pme_msg_det = 0xffffffff;
+                       debug(" with errors.  Clearing.  Now 0x%08x",
+                             pci->pme_msg_det);
+               }
+               debug("\n");
+
+               /* inbound */
+               pci_set_region(hose->regions + 0,
+                              CFG_PCI_MEMORY_BUS,
+                              CFG_PCI_MEMORY_PHYS,
+                              CFG_PCI_MEMORY_SIZE,
+                              PCI_REGION_MEM | PCI_REGION_MEMORY);
+
+               /* outbound memory */
+               pci_set_region(hose->regions + 1,
+                              CFG_PCI1_MEM_BASE,
+                              CFG_PCI1_MEM_PHYS,
+                              CFG_PCI1_MEM_SIZE,
+                              PCI_REGION_MEM);
+
+               /* outbound io */
+               pci_set_region(hose->regions + 2,
+                              CFG_PCI1_IO_BASE,
+                              CFG_PCI1_IO_PHYS,
+                              CFG_PCI1_IO_SIZE,
+                              PCI_REGION_IO);
+
+               hose->region_count = 3;
+
+               hose->first_busno=first_free_busno;
+               pci_setup_indirect(hose, (int) &pci->cfg_addr, (int) &pci->cfg_data);
+
+               fsl_pci_init(hose);
+
+               first_free_busno=hose->last_busno+1;
+               printf ("    PCI-EXPRESS 1 on bus %02x - %02x\n",
+                       hose->first_busno,hose->last_busno);
+
+               /*
+                * Activate ULI1575 legacy chip by performing a fake
+                * memory access.  Needed to make ULI RTC work.
+                */
+               in_be32((unsigned *) CFG_PCI1_MEM_BASE
+                       + CFG_PCI1_MEM_SIZE - 0x1000000);
+
+       } else {
+               puts("PCI-EXPRESS 1: Disabled\n");
+       }
+}
+#else
+       puts("PCI-EXPRESS1: Disabled\n");
+#endif /* CONFIG_PCI1 */
+
+#ifdef CONFIG_PCI2
+{
+       volatile ccsr_fsl_pci_t *pci = (ccsr_fsl_pci_t *) CFG_PCI2_ADDR;
+       extern void fsl_pci_init(struct pci_controller *hose);
+       struct pci_controller *hose = &pci2_hose;
+
+
+       /* inbound */
+       pci_set_region(hose->regions + 0,
+                      CFG_PCI_MEMORY_BUS,
+                      CFG_PCI_MEMORY_PHYS,
+                      CFG_PCI_MEMORY_SIZE,
+                      PCI_REGION_MEM | PCI_REGION_MEMORY);
+
+       /* outbound memory */
+       pci_set_region(hose->regions + 1,
+                      CFG_PCI2_MEM_BASE,
+                      CFG_PCI2_MEM_PHYS,
+                      CFG_PCI2_MEM_SIZE,
+                      PCI_REGION_MEM);
+
+       /* outbound io */
+       pci_set_region(hose->regions + 2,
+                      CFG_PCI2_IO_BASE,
+                      CFG_PCI2_IO_PHYS,
+                      CFG_PCI2_IO_SIZE,
+                      PCI_REGION_IO);
+
+       hose->region_count = 3;
+
+       hose->first_busno=first_free_busno;
+       pci_setup_indirect(hose, (int) &pci->cfg_addr, (int) &pci->cfg_data);
+
+       fsl_pci_init(hose);
+
+       first_free_busno=hose->last_busno+1;
+       printf ("    PCI-EXPRESS 2 on bus %02x - %02x\n",
+               hose->first_busno,hose->last_busno);
+}
+#else
+       puts("PCI-EXPRESS 2: Disabled\n");
+#endif /* CONFIG_PCI2 */
 
-       pci_mpc86xx_init(&hose);
-#endif /* CONFIG_PCI */
 }
 
 #if defined(CONFIG_OF_FLAT_TREE) && defined(CONFIG_OF_BOARD_SETUP)
index 74e2a3d46ffd9cf6a0ba66d0b88a7a9927f43426..7bc663bba464f765a35f9c8fe725086a5f8c7ec9 100644 (file)
@@ -68,7 +68,7 @@ int mac_show(void)
               mac_data.date[5],
               mac_data.date[6]);
        for (i = 0; i < 8; i++) {
-               sprintf(ethaddr[i],
+               sprintf((char *)ethaddr[i],
                        "%02x:%02x:%02x:%02x:%02x:%02x",
                        mac_data.mac[i][0],
                        mac_data.mac[i][1],
@@ -79,10 +79,10 @@ int mac_show(void)
                printf("MAC %d %s\n", i, ethaddr[i]);
        }
 
-       setenv("ethaddr", ethaddr[0]);
-       setenv("eth1addr", ethaddr[1]);
-       setenv("eth2addr", ethaddr[2]);
-       setenv("eth3addr", ethaddr[3]);
+       setenv("ethaddr",  (char *)ethaddr[0]);
+       setenv("eth1addr", (char *)ethaddr[1]);
+       setenv("eth2addr", (char *)ethaddr[2]);
+       setenv("eth3addr", (char *)ethaddr[3]);
 
        return 0;
 }
@@ -236,7 +236,7 @@ int mac_read_from_eeprom(void)
        } else {
                for (i = 0; i < 4; i++) {
                        if (memcmp(&mac_data.mac[i], "\0\0\0\0\0\0", 6)) {
-                               sprintf(ethaddr[i],
+                               sprintf((char *)ethaddr[i],
                                        "%02x:%02x:%02x:%02x:%02x:%02x",
                                        mac_data.mac[i][0],
                                        mac_data.mac[i][1],
@@ -244,10 +244,10 @@ int mac_read_from_eeprom(void)
                                        mac_data.mac[i][3],
                                        mac_data.mac[i][4],
                                        mac_data.mac[i][5]);
-                               sprintf(enetvar,
+                               sprintf((char *)enetvar,
                                        i ? "eth%daddr" : "ethaddr",
                                        i);
-                               setenv(enetvar, ethaddr[i]);
+                               setenv((char *)enetvar, (char *)ethaddr[i]);
                        }
                }
        }
index 34b50e4be208c69336d572b343846cb5fac96419..58644648c78846388bcf8236858cc927d80fb01b 100644 (file)
@@ -57,11 +57,11 @@ SECTIONS
     cpu/mpc86xx/cpu_init.o (.text)
     cpu/mpc86xx/cpu.o (.text)
     cpu/mpc86xx/speed.o (.text)
-    cpu/mpc86xx/pci.o (.text)
     common/dlmalloc.o (.text)
     lib_generic/crc32.o (.text)
     lib_ppc/extable.o (.text)
     lib_generic/zlib.o (.text)
+    drivers/bios_emulator/atibios.o (.text)
     *(.text)
     *(.fixup)
     *(.got1)
index 06d021a026a04abc22dc225e75ebd704322454d8..278ad5c34880621bcad9f9450ca04a00a70e0a38 100644 (file)
@@ -471,7 +471,7 @@ int do_mplcommon(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 
        if (strcmp(argv[1], "flash") == 0)
        {
-#if (CONFIG_COMMANDS & CFG_CMD_FDC)
+#if defined(CONFIG_CMD_FDC)
                if (strcmp(argv[2], "floppy") == 0) {
                        char *local_args[3];
                        extern int do_fdcboot (cmd_tbl_t *, int, int, char *[]);
@@ -491,7 +491,7 @@ int do_mplcommon(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                        result=mpl_prg_image((uchar *)ld_addr);
                        return result;
                }
-#endif /* (CONFIG_COMMANDS & CFG_CMD_FDC) */
+#endif
                if (strcmp(argv[2], "mem") == 0) {
                        if(argc==4) {
                                ld_addr=simple_strtoul(argv[3], NULL, 16);
@@ -564,7 +564,7 @@ int do_mplcommon(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 }
 
 
-#if (CONFIG_COMMANDS & CFG_CMD_DOC)
+#if defined(CONFIG_CMD_DOC)
 extern void doc_probe(ulong physadr);
 void doc_init (void)
 {
index 8f2ec03f6e6cd44c9de2945f7bee05768387070c..d4b1f68dfa6e5f12786c26e1324fb6d43606d08c 100644 (file)
@@ -39,7 +39,7 @@ void get_backup_values(backup_t *buf);
 
 void show_stdio_dev(void);
 void check_env(void);
-#if (CONFIG_COMMANDS & CFG_CMD_DOC)
+#if defined(CONFIG_CMD_DOC)
 void doc_init (void);
 #endif
 
diff --git a/board/mpl/pati/u-boot.lds b/board/mpl/pati/u-boot.lds
deleted file mode 100644 (file)
index 5b03fef..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * (C) Copyright 2001  Wolfgang Denk, DENX Software Engineering, wd@denx.de
- * (C) Copyright 2003  Martin Winistoerfer, martinwinistoerfer@gmx.ch
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    /* WARNING - the following is hand-optimized to fit within */
-    /* the sector layout of our flash chips!   XXX FIXME XXX   */
-
-    cpu/mpc5xx/start.o (.text)
-
-    *(.text)
-    *(.fixup)
-    *(.got1)
-  }
-  _etext = .;
-  PROVIDE (etext = .);
-  .rodata    :
-  {
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x00FF) & 0xFFFFFF00;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
-  __fixup_entries = (. - _FIXUP_TABLE_)>>2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(256);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(256);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-
-  _end = . ;
-  PROVIDE (end = .);
-/*   . = env_start;
-       .ppcenv :
-       {
-               common/environment.o (.ppcenv)
-       }
-*/
-}
index 0d2003d2fc3ae89822d6b1915df9ef6223310ebc..45ab6548f607746554dabbfb213b6eb7054900d7 100644 (file)
@@ -132,7 +132,7 @@ int board_init(void)
 /*
  * NAND flash initialization.
  */
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
 extern ulong
 nand_probe(ulong physadr);
 
index c0167d51684c4bd1450e327d4f95e93e270f4724..7a32343748dd467b956d3df19e096eeefb37cf11 100644 (file)
@@ -31,7 +31,7 @@ extern int  mem_test(unsigned long start, unsigned long ramsize,int mode);
 
 void print_vcma9_info(void);
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
 typedef enum {
        NFCE_LOW,
        NFCE_HIGH
diff --git a/board/musenki/u-boot.lds b/board/musenki/u-boot.lds
deleted file mode 100644 (file)
index 7c05109..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * (C) Copyright 2001
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc824x/start.o                (.text)
-    lib_ppc/board.o            (.text)
-    lib_ppc/ppcstring.o                (.text)
-    lib_generic/vsprintf.o     (.text)
-    lib_generic/crc32.o                (.text)
-    lib_generic/zlib.o         (.text)
-
-       . = DEFINED(env_offset) ? env_offset : .;
-    common/environment.o (.text)
-
-       *(.text)
-
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-
-  _end = . ;
-  PROVIDE (end = .);
-}
diff --git a/board/mvblue/u-boot.lds b/board/mvblue/u-boot.lds
deleted file mode 100644 (file)
index 7c05109..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * (C) Copyright 2001
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc824x/start.o                (.text)
-    lib_ppc/board.o            (.text)
-    lib_ppc/ppcstring.o                (.text)
-    lib_generic/vsprintf.o     (.text)
-    lib_generic/crc32.o                (.text)
-    lib_generic/zlib.o         (.text)
-
-       . = DEFINED(env_offset) ? env_offset : .;
-    common/environment.o (.text)
-
-       *(.text)
-
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-
-  _end = . ;
-  PROVIDE (end = .);
-}
index 6bb7c31437586ff52ae5ce79c6b9c9aa1113ac72..8617f7445f300b0f0d179cfe3029a94abddb1afd 100644 (file)
@@ -24,7 +24,7 @@
 #include <common.h>
 
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
 
 #include <nand.h>
 
@@ -115,4 +115,4 @@ int board_nand_init(struct nand_chip *nand)
 /*     nand->options = NAND_SAMSUNG_LP_OPTIONS;*/
        return 0;
 }
-#endif /* (CONFIG_COMMANDS & CFG_CMD_NAND) */
+#endif
index 297de97a554ed25eae725acb6566f2ddcb3a6e71..ccc8b3ed85dfd24427c06a5fd27dd6f1393422fe 100644 (file)
@@ -597,7 +597,7 @@ int board_early_init_f(void)
        return 0;
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
 
 #include <linux/mtd/nand_legacy.h>
 
index 78523654eb95316361d16b7172c72bbb3f414fb8..d47e1d8e02c5b28a51b8e54ef82b9a7cd0b0a651 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <common.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
 
 #include <nand.h>
 
index 4923e3addafbfce87b9e7a41e4c606d1bec4cd03..5a75e53e0de6657a74c2b6946393afa2de5d4405 100644 (file)
@@ -555,7 +555,7 @@ int board_early_init_f(void)
        return 0;
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND) && defined(CFG_NAND_LEGACY)
+#if defined(CONFIG_CMD_NAND) && defined(CFG_NAND_LEGACY)
 
 #include <linux/mtd/nand_legacy.h>
 
@@ -570,7 +570,7 @@ void nand_init(void)
 }
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_PCMCIA)
+#if defined(CONFIG_CMD_PCMCIA)
 
 int pcmcia_init(void)
 {
index a3709f7f7772b2a4da2e0e38c00462db5b488401..86b3cfb992bc8d0b4be23fa5bead1c83f267ae9f 100644 (file)
@@ -4,11 +4,11 @@
 
 #undef CONFIG_PCMCIA
 
-#if    (CONFIG_COMMANDS & CFG_CMD_PCMCIA)
+#if defined(CONFIG_CMD_PCMCIA)
 #define        CONFIG_PCMCIA
 #endif
 
-#if    (CONFIG_COMMANDS & CFG_CMD_IDE) && defined(CONFIG_IDE_8xx_PCCARD)
+#if defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_8xx_PCCARD)
 #define        CONFIG_PCMCIA
 #endif
 
@@ -264,7 +264,7 @@ int pcmcia_hardware_enable(int slot)
 }
 
 
-#if (CONFIG_COMMANDS & CFG_CMD_PCMCIA)
+#if defined(CONFIG_CMD_PCMCIA)
 int pcmcia_hardware_disable(int slot)
 {
        volatile immap_t        *immap;
@@ -291,7 +291,7 @@ int pcmcia_hardware_disable(int slot)
 
        return (0);
 }
-#endif /* CFG_CMD_PCMCIA */
+#endif
 
 
 int pcmcia_voltage_set(int slot, int vcc, int vpp)
index 3ca7bd3c8677e86321d68a417a2e56ea2b17ee02..b216c5a8eff229ed504bebaf8e3caa0f131fd0b9 100644 (file)
@@ -595,7 +595,7 @@ int board_early_init_f(void)
        return 0;
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
 
 #include <linux/mtd/nand_legacy.h>
 
index 3e6c61663f202deb232cb831a32f56cd6f51c0d5..856b7769cd697ceb5222181984258fa0d52b4a0e 100644 (file)
@@ -416,7 +416,7 @@ int board_early_init_f(void)
        return 0;
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
 
 #include <linux/mtd/nand_legacy.h>
 
diff --git a/board/o2dnt/u-boot.lds b/board/o2dnt/u-boot.lds
deleted file mode 100644 (file)
index 88dc118..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * (C) Copyright 2005
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc5xxx/start.o        (.text)
-    *(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
index f7f75e0fe1a2a3162f1a98ff4d8274572553efbb..1b917b3147828a2e914beb614c995062a01ec95b 100644 (file)
@@ -31,7 +31,7 @@
 #include <asm/arch/mem.h>
 #include <i2c.h>
 #include <asm/mach-types.h>
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
 #include <linux/mtd/nand_legacy.h>
 extern struct nand_chip nand_dev_desc[CFG_MAX_NAND_DEVICE];
 #endif
@@ -847,7 +847,7 @@ void update_mux(u32 btype,u32 mtype)
        }
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
 void nand_init(void)
 {
     extern flash_info_t flash_info[];
diff --git a/board/oxc/u-boot.lds b/board/oxc/u-boot.lds
deleted file mode 100644 (file)
index 2a5cd2e..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * (C) Copyright 2001
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)      }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)      }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)       }
-  .rela.got      : { *(.rela.got)      }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)       }
-  .rela.bss      : { *(.rela.bss)      }
-  .rel.plt       : { *(.rel.plt)       }
-  .rela.plt      : { *(.rela.plt)      }
-  .init          : { *(.init)          }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc824x/start.o        (.text)
-    lib_ppc/board.o    (.text)
-    lib_ppc/ppcstring.o        (.text)
-
-       . = DEFINED(env_offset) ? env_offset : .;
-    common/environment.o (.text)
-
-       *(.text)
-
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-
-  _end = . ;
-  PROVIDE (end = .);
-}
index a216c55bc6ad149be937e92d0fb4a9a92b0933e3..1148c6aa273d814501f772917d11469db8ce5d43 100644 (file)
@@ -202,7 +202,7 @@ void watchdog_reset (void)
                enable_interrupts ();
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_BSP)
+#if defined(CONFIG_CMD_BSP)
 int do_wd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
        switch (argc) {
@@ -241,5 +241,5 @@ U_BOOT_CMD(
        "wd      - print current status\n"
 );
 
-#endif /* CFG_CMD_BSP */
+#endif
 #endif /* CONFIG_WATCHDOG */
index 65c529192a649782bd9f3715476a9ba1ec670b1c..14c3f1d442f0c1d0e06df7ae08053d84dc4016bb 100644 (file)
@@ -299,7 +299,7 @@ void pci_init_board(void)
 }
 #endif
 
-#if defined (CFG_CMD_IDE) && defined (CONFIG_IDE_RESET)
+#if defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_RESET)
 
 void init_ide_reset (void)
 {
@@ -312,9 +312,9 @@ void ide_set_reset (int idereset)
        debug ("ide_reset(%d)\n", idereset);
 
 }
-#endif /* defined (CFG_CMD_IDE) && defined (CONFIG_IDE_RESET) */
+#endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_DOC)
+#if defined(CONFIG_CMD_DOC)
 extern void doc_probe (ulong physadr);
 void doc_init (void)
 {
diff --git a/board/pm520/u-boot.lds b/board/pm520/u-boot.lds
deleted file mode 100644 (file)
index 3cc2968..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * (C) Copyright 2003-2004
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc5xxx/start.o        (.text)
-    *(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
index 7514cd77bb02fec2f6b573680805b3492e0f7000..1420e649d217da8941a01dcdc48729cc903e59e9 100644 (file)
@@ -310,7 +310,7 @@ long int initdram (int board_type)
        return (psize);
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_DOC)
+#if defined(CONFIG_CMD_DOC)
 extern void doc_probe (ulong physadr);
 void doc_init (void)
 {
diff --git a/board/pm826/u-boot.lds b/board/pm826/u-boot.lds
deleted file mode 100644 (file)
index 05f29c6..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * (C) Copyright 2001
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc8260/start.o        (.text)
-    *(.text)
-    common/environment.o(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
index 31932742a82a60a2601342fd3243529b4e4fb1a3..98cd80bc8d5a758562cb2de4ec2759ef6d35f37b 100644 (file)
@@ -343,7 +343,7 @@ long int initdram (int board_type)
        return (psize);
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_DOC)
+#if defined(CONFIG_CMD_DOC)
 extern void doc_probe (ulong physadr);
 void doc_init (void)
 {
diff --git a/board/pm828/u-boot.lds b/board/pm828/u-boot.lds
deleted file mode 100644 (file)
index 928c1cf..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * (C) Copyright 2001-2004
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc8260/start.o        (.text)
-    *(.text)
-    common/environment.o(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
index 3ea068d3529bb1375a155380cfbb21b1696f9ed7..ffa20cde3b33fd2da3ed7b45a302c4661fedb64c 100644 (file)
@@ -29,7 +29,7 @@
 #include <command.h>
 #include "pn62.h"
 
-#if (CONFIG_COMMANDS & CFG_CMD_BSP)
+#if defined(CONFIG_CMD_BSP)
 
 extern int do_bootm (cmd_tbl_t *, int, int, char *[]);
 
diff --git a/board/pn62/u-boot.lds b/board/pn62/u-boot.lds
deleted file mode 100644 (file)
index eaee3fd..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * (C) Copyright 2001
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)      }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)      }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)       }
-  .rela.got      : { *(.rela.got)      }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)       }
-  .rela.bss      : { *(.rela.bss)      }
-  .rel.plt       : { *(.rel.plt)       }
-  .rela.plt      : { *(.rela.plt)      }
-  .init          : { *(.init)          }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc824x/start.o                (.text)
-    lib_ppc/board.o            (.text)
-    lib_ppc/ppcstring.o                (.text)
-    lib_generic/vsprintf.o     (.text)
-    lib_generic/crc32.o                (.text)
-    lib_generic/zlib.o         (.text)
-
-       . = DEFINED(env_offset) ? env_offset : .;
-    common/environment.o (.text)
-
-       *(.text)
-
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-
-  _end = . ;
-  PROVIDE (end = .);
-}
diff --git a/board/ppmc8260/u-boot.lds b/board/ppmc8260/u-boot.lds
deleted file mode 100644 (file)
index 84d4b78..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * (C) Copyright 2000
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc8260/start.o        (.text)
-    *(.text)
-    common/environment.o(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
index d66b08847a59b8e0d912c0307f47962227d37d72..097e1837197a2772757510c68aab4e0ff570fd83 100644 (file)
@@ -26,7 +26,7 @@
 
 #include <common.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
 
 #include <asm/processor.h>
 #include <nand.h>
index ba32ac12acedd54ee1b329a5592e55d361a4e5de..e1af37e1d8ac2ff49b9aff5994835ad01920ae05 100644 (file)
@@ -80,7 +80,7 @@ void serial_puts (const char *s)
        }
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 void kgdb_serial_init (void)
 {
 }
@@ -104,4 +104,4 @@ void kgdb_interruptible (int yes)
 {
        return;
 }
-#endif /* CFG_CMD_KGDB */
+#endif
index 92f9c0190238cf7c63f4c9bd9b281663fc379294..b1e7041046f847c1abce934e238d2a6fe644c433 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <common.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
 
 #include <nand.h>
 
index e2fed5d7486eab3727b4001fe4daebbe88894db8..a1a310a1cba3385862756cdd10b14aa7c66d7c82 100644 (file)
@@ -236,7 +236,7 @@ U_BOOT_CMD(
        "address size\n    - boot FPGA with gzipped image at <address>\n"
 );
 
-#if (CONFIG_COMMANDS & CFG_CMD_PCI) || defined(CONFIG_PCI)
+#if defined(CONFIG_CMD_PCI) || defined(CONFIG_PCI)
 extern struct pci_controller hose;
 extern void pci_ixp_init(struct pci_controller * hose);
 
index 7d34ac80ae6134472fa497c0efb63052c19c5ae0..a83ca8da4727c97d37fbf2c80eae73d99cd53837 100644 (file)
@@ -4,11 +4,11 @@
 
 #undef CONFIG_PCMCIA
 
-#if    (CONFIG_COMMANDS & CFG_CMD_PCMCIA)
+#if defined(CONFIG_CMD_PCMCIA)
 #define        CONFIG_PCMCIA
 #endif
 
-#if    (CONFIG_COMMANDS & CFG_CMD_IDE) && defined(CONFIG_IDE_8xx_PCCARD)
+#if defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_8xx_PCCARD)
 #define        CONFIG_PCMCIA
 #endif
 
@@ -123,7 +123,7 @@ int pcmcia_hardware_enable(int slot)
 }
 
 
-#if (CONFIG_COMMANDS & CFG_CMD_PCMCIA)
+#if defined(CONFIG_CMD_PCMCIA)
 int pcmcia_hardware_disable(int slot)
 {
        volatile immap_t        *immap;
@@ -150,7 +150,7 @@ int pcmcia_hardware_disable(int slot)
 
        return (0);
 }
-#endif /* CFG_CMD_PCMCIA */
+#endif
 
 
 int pcmcia_voltage_set(int slot, int vcc, int vpp)
diff --git a/board/rattler/u-boot.lds b/board/rattler/u-boot.lds
deleted file mode 100644 (file)
index 522e6da..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * (C) Copyright 2001-2005
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * Modified by Yuli Barcohen <yuli@arabellasw.com>
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc8260/start.o        (.text)
-    *(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
-ENTRY(_start)
diff --git a/board/rpxsuper/u-boot.lds b/board/rpxsuper/u-boot.lds
deleted file mode 100644 (file)
index 9e623d0..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * (C) Copyright 2000
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc8260/start.o        (.text)
-    *(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
index 5844ec1ea4c1302d50c937e5d431d1770ad77606..35c3d8c7688d2aff0765093275125bb758d0f30a 100644 (file)
@@ -31,3 +31,5 @@
 
 TEXT_BASE = 0xff000000
 /*TEXT_BASE  = 0x00200000 */
+
+LDSCRIPT := $(SRCTREE)/board/rsdproto/u-boot.lds
index 70fc3a5d2799034dbc00711a89a4fb91fe9c70bc..9bd6248095267e3af50ebc40e9acaff8a1d27343 100644 (file)
@@ -55,7 +55,6 @@ SECTIONS
   {
     cpu/mpc8260/start.o        (.text)
     *(.text)
-    *(.fixup)
     *(.got1)
     /*. = env_offset; */
   }
index e50b7479238f5e758f8c2410da37b3847bbca6d3..25209e0546404c6a097691db9fbb52dbf31bcec9 100644 (file)
@@ -837,7 +837,7 @@ void show_boot_progress (int status)
 /*
  * The following are used to control the SPI chip selects for the SPI command.
  */
-#if (CONFIG_COMMANDS & CFG_CMD_SPI)
+#if defined(CONFIG_CMD_SPI)
 
 #define SPI_ADC_CS_MASK        0x00000800
 #define SPI_DAC_CS_MASK        0x00001000
@@ -873,7 +873,7 @@ spi_chipsel_type spi_chipsel[] = {
 };
 int spi_chipsel_cnt = sizeof(spi_chipsel) / sizeof(spi_chipsel[0]);
 
-#endif /* CFG_CMD_SPI */
+#endif
 
 #endif /* CONFIG_MISC_INIT_R */
 
diff --git a/board/sacsng/u-boot.lds b/board/sacsng/u-boot.lds
deleted file mode 100644 (file)
index 9e623d0..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * (C) Copyright 2000
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc8260/start.o        (.text)
-    *(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
diff --git a/board/sandpoint/u-boot.lds b/board/sandpoint/u-boot.lds
deleted file mode 100644 (file)
index 2a5cd2e..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * (C) Copyright 2001
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)      }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)      }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)       }
-  .rela.got      : { *(.rela.got)      }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)       }
-  .rela.bss      : { *(.rela.bss)      }
-  .rel.plt       : { *(.rel.plt)       }
-  .rela.plt      : { *(.rela.plt)      }
-  .init          : { *(.init)          }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc824x/start.o        (.text)
-    lib_ppc/board.o    (.text)
-    lib_ppc/ppcstring.o        (.text)
-
-       . = DEFINED(env_offset) ? env_offset : .;
-    common/environment.o (.text)
-
-       *(.text)
-
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-
-  _end = . ;
-  PROVIDE (end = .);
-}
index 7030985b29c5b98bdadd36f829fd25acdff0f000..b4865e1229c88461311a3809b5eec5b8da7dd21e 100644 (file)
@@ -31,7 +31,7 @@
 #include <common.h>
 #include <s3c2410.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
 #include <linux/mtd/nand.h>
 #endif
 
@@ -136,7 +136,7 @@ int dram_init (void)
        return 0;
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
 extern ulong nand_probe(ulong physadr);
 
 static inline void NF_Reset(void)
@@ -180,4 +180,4 @@ void nand_init(void)
 #endif
        printf ("%4lu MB\n", nand_probe((ulong)nand) >> 20);
 }
-#endif /* CONFIG_COMMANDS & CFG_CMD_NAND */
+#endif
diff --git a/board/sbc8240/u-boot.lds b/board/sbc8240/u-boot.lds
deleted file mode 100644 (file)
index 7be85e4..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * (C) Copyright 2001
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc824x/start.o        (.text)
-    lib_ppc/board.o (.text)
-    lib_ppc/ppcstring.o        (.text)
-    lib_generic/vsprintf.o     (.text)
-    lib_generic/crc32.o                (.text)
-    lib_generic/zlib.o         (.text)
-
-               . = DEFINED(env_offset) ? env_offset : .;
-    common/environment.o (.text)
-
-               *(.text)
-
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-
-  _end = . ;
-  PROVIDE (end = .);
-}
diff --git a/board/sbc8260/u-boot.lds b/board/sbc8260/u-boot.lds
deleted file mode 100644 (file)
index 9e623d0..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * (C) Copyright 2000
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc8260/start.o        (.text)
-    *(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
diff --git a/board/sbc8349/u-boot.lds b/board/sbc8349/u-boot.lds
deleted file mode 100644 (file)
index e32c075..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Copyright (c) 2006 Wind River Systems, Inc.
- * u-boot.lds for WindRiver SBC8349.
- *
- * Based on the MPC8349 u-boot.lds
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc83xx/start.o        (.text)
-    *(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
-ENTRY(_start)
index 7daa877cddccdc1e0400db194fdf3a9b9db81678..009567b50bf92eb381535664ff21c31f0a79adb5 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <common.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
 
 #include <nand.h>
 #include <asm/processor.h>
diff --git a/board/siemens/SCM/u-boot.lds b/board/siemens/SCM/u-boot.lds
deleted file mode 100644 (file)
index 05f29c6..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * (C) Copyright 2001
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc8260/start.o        (.text)
-    *(.text)
-    common/environment.o(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
old mode 100755 (executable)
new mode 100644 (file)
index e9941cda615b9236512cd764dea80d673f50cb81..f022ed6d512e2c904dc15f078047341d9cd5fd69 100644 (file)
@@ -219,7 +219,7 @@ static int fpga_load (fpga_t* fpga, ulong addr, int checkall)
     return 1;
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_BSP)
+#if defined(CONFIG_CMD_BSP)
 
 /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
 
@@ -299,7 +299,7 @@ U_BOOT_CMD(
        "fpga load [name] addr - load FPGA configuration data\n"
 );
 
-#endif /* CONFIG_COMMANDS & CFG_CMD_BSP */
+#endif
 
 /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
 
index 3f05e4a6abc96fc392a508209837e32cadf76633..2309069a606dac43241002fbc0365b2362e75ce8 100644 (file)
@@ -368,7 +368,7 @@ void reset_phy (void)
 /*-----------------------------------------------------------------------
  * Board Special Commands: access functions for "PUMA" FPGA
  */
-#if (CONFIG_COMMANDS & CFG_CMD_BSP)
+#if defined(CONFIG_CMD_BSP)
 
 #define        PUMA_READ_MODE  0
 #define PUMA_LOAD_MODE 1
@@ -408,7 +408,7 @@ U_BOOT_CMD (puma, 4, 1, do_puma,
            "status - print PUMA status\n"
            "puma load addr len - load PUMA configuration data\n");
 
-#endif /* CFG_CMD_BSP */
+#endif
 
 /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
 
index a4cb4dcf09772230823daa27fa798362f5db3a5a..798e1855bd4902028b093f4841a1cab29ef7a7fa 100644 (file)
@@ -33,7 +33,7 @@
 # include <status_led.h>
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
 #include <linux/mtd/nand_legacy.h>
 extern struct nand_chip nand_dev_desc[CFG_MAX_NAND_DEVICE];
 #endif
@@ -75,9 +75,9 @@ int checkboard (void)
 
 /* ------------------------------------------------------------------------- */
 
-#if (CONFIG_COMMANDS & CFG_CMD_PCMCIA)
+#if defined(CONFIG_CMD_PCMCIA)
 #error "SXNI855T has no PCMCIA port"
-#endif /* CFG_CMD_PCMCIA */
+#endif
 
 /* ------------------------------------------------------------------------- */
 
@@ -327,7 +327,7 @@ int misc_init_r (void)
        return (0);
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
 void nand_init(void)
 {
        unsigned long totlen = nand_probe(CFG_DFLASH_BASE);
diff --git a/board/sl8245/u-boot.lds b/board/sl8245/u-boot.lds
deleted file mode 100644 (file)
index acb9ffd..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * (C) Copyright 2001
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc824x/start.o                (.text)
-    lib_ppc/board.o            (.text)
-    lib_ppc/ppcstring.o                (.text)
-    lib_generic/vsprintf.o     (.text)
-    lib_generic/crc32.o                (.text)
-    lib_generic/zlib.o         (.text)
-
-       . = DEFINED(env_offset) ? env_offset : .;
-    common/environment.o (.text)
-
-       *(.text)
-
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-
-  _end = . ;
-  PROVIDE (end = .);
-}
diff --git a/board/sorcery/u-boot.lds b/board/sorcery/u-boot.lds
deleted file mode 100644 (file)
index 889bc77..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * (C) Copyright 2003-2004
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc8220/start.o        (.text)
-    *(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
index 3c36f7911bc216b8ff18cb57939d93669bb3c9b3..cd7799b277b6b97c68bfc02b97b8abacd260bcfd 100644 (file)
@@ -122,7 +122,9 @@ const uint dsp_table_fast[] =
 #define TINY_AUTOINC_BASE_ADDR 0x0
 
 static int hpi_activate(void);
+#if 0
 static void hpi_inactivate(void);
+#endif
 static void dsp_reset(void);
 
 static int hpi_write_inc(u32 addr, u32 *data, u32 count);
@@ -133,7 +135,9 @@ static u32 hpi_read_noinc(u32 addr);
 int hpi_test(void);
 static int hpi_write_addr_test(u32 addr);
 static int hpi_read_write_test(u32 addr, u32 data);
+#ifdef DO_TINY_TEST
 static int hpi_tiny_autoinc_test(void);
+#endif /* DO_TINY_TEST */
 #endif /* CONFIG_SPC1920_HPI_TEST */
 
 
@@ -185,6 +189,7 @@ static int hpi_activate(void)
        return 0;
 }
 
+#if 0
 /* turn off the host port interface */
 static void hpi_inactivate(void)
 {
@@ -200,6 +205,7 @@ static void hpi_inactivate(void)
        /* currently always on TBD */
 
 }
+#endif
 
 /* reset the DSP */
 static void dsp_reset(void)
@@ -570,6 +576,7 @@ static int hpi_read_write_test(u32 addr, u32 data)
        return 0;
 }
 
+#ifdef DO_TINY_TEST
 static int hpi_tiny_autoinc_test(void)
 {
        int i;
@@ -599,5 +606,6 @@ static int hpi_tiny_autoinc_test(void)
        }
        return 0;
 }
+#endif /* DO_TINY_TEST */
 
 #endif /* CONFIG_SPC1920_HPI_TEST */
index 2f704a0af9556ada2a87b7612ca8bbdf5bf46e15..2ec3a728d74ea5cb0a5ce9c43e60ecf57d48bd53 100644 (file)
@@ -65,7 +65,7 @@ long int initdram (int board_type)
 /*
  * The following are used to control the SPI chip selects for the SPI command.
  */
-#if (CONFIG_COMMANDS & CFG_CMD_SPI) && CONFIG_NIOS_SPI
+#if defined(CONFIG_CMD_SPI) && CONFIG_NIOS_SPI
 
 #define        SPI_RTC_CS_MASK 0x00000001
 
@@ -89,7 +89,7 @@ spi_chipsel_type spi_chipsel[] = {
 };
 int spi_chipsel_cnt = sizeof(spi_chipsel) / sizeof(spi_chipsel[0]);
 
-#endif /* CFG_CMD_SPI */
+#endif
 
 #if    defined(CONFIG_POST)
 /*
index d61fa3ed47fdf26a9f683299de9abb28069803ea..713ed65568cdf088bd48dfe3e63d4e04233b4756 100644 (file)
@@ -46,7 +46,7 @@ typedef struct {
 
 extern led_dev_t led_dev[];
 
-#if (CONFIG_COMMANDS & CFG_CMD_BSP)
+#if defined(CONFIG_CMD_BSP)
 int do_sled (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 {
        int led_id = 0;
@@ -158,5 +158,5 @@ int do_sled (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 U_BOOT_CMD (sled, 3, 0, do_sled,
            "sled    - check and set status led\n",
            "sled [name [state]]\n" __NAME_STR "    - state: on|off|blink\n");
-#endif /* CFG_CMD_BSP */
+#endif
 #endif /* CONFIG_STATUS_LED */
index 3215ac96aa7a322d6763c8c047a2c5eff295ec85..9945c5987e1cc434c59492042c0630020cb1a123 100644 (file)
@@ -112,7 +112,7 @@ void hw_watchdog_reset(void)
                enable_interrupts ();
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_BSP)
+#if defined(CONFIG_CMD_BSP)
 int do_wd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
        nios_pio_t *ena_piop     = (nios_pio_t*)CONFIG_HW_WDENA_BASE;
@@ -156,5 +156,5 @@ U_BOOT_CMD(
        "wd off  - switch watchdog off\n"
        "wd      - print current status\n"
 );
-#endif /* CFG_CMD_BSP */
+#endif
 #endif /* CONFIG_HW_WATCHDOG */
index 7caf06a0862d5af851b570464b6a8d3b5fc0b131..87a2022761384a5b37d5b1779035daef54b47161 100644 (file)
@@ -574,7 +574,7 @@ int board_early_init_f(void)
        return 0;
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
 
 #include <linux/mtd/nand_legacy.h>
 
index 9bb9fd019f76f3b9c84a1c211426894979effd99..b900e6bd1b770d4e091626492ff8967d2bdb3bd3 100644 (file)
@@ -153,7 +153,7 @@ long int initdram (int board_type)
        return (size_b0 );
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_DOC)
+#if defined(CONFIG_CMD_DOC)
 extern void doc_probe (ulong physadr);
 void doc_init (void)
 {
index 1a35187260a30f274036402ae668e9519ccd47cd..f32dadf5a2cc1900a89cf233d21932da4ffc0873 100644 (file)
@@ -109,7 +109,7 @@ void pci_init_board(void)
 }
 #endif
 
-#if defined (CFG_CMD_IDE) && defined (CONFIG_IDE_RESET)
+#if defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_RESET)
 
 /* IRDA_1 aka PSC6_3 (pin C13) */
 #define GPIO_IRDA_1    0x20000000UL
@@ -133,7 +133,7 @@ void ide_set_reset (int idereset)
                *(vu_long *) MPC5XXX_GPIO_DATA_O |=  GPIO_IRDA_1;
        }
 }
-#endif /* defined (CFG_CMD_IDE) && defined (CONFIG_IDE_RESET) */
+#endif
 
 #ifdef CONFIG_VIDEO_SED13806
 #include <sed13806.h>
diff --git a/board/total5200/u-boot.lds b/board/total5200/u-boot.lds
deleted file mode 100644 (file)
index 3cc2968..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * (C) Copyright 2003-2004
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc5xxx/start.o        (.text)
-    *(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
old mode 100755 (executable)
new mode 100644 (file)
index 7af69f2..b746679
@@ -29,7 +29,7 @@
 #include <common.h>
 #include <command.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_BSP)
+#if defined(CONFIG_CMD_BSP)
 
 #if defined(CONFIG_STK52XX) || defined(CONFIG_FO300)
 #define DEFAULT_VOL    45
@@ -1241,4 +1241,4 @@ U_BOOT_CMD(
        "     - loopback plug(s) for X21/X22 required\n"
 );
 #endif
-#endif /* CFG_CMD_BSP */
+#endif
index 8784b1f8003892228d208e77ebacc2f596b200e7..214dca65e534c2c97ac12ae8f4a87b356179697f 100644 (file)
@@ -29,7 +29,7 @@
 #include <common.h>
 #include <command.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_BSP)
+#if defined(CONFIG_CMD_BSP)
 #if defined (CONFIG_TB5200)
 
 #define SM501_PANEL_DISPLAY_CONTROL    0x00080000UL
@@ -101,4 +101,4 @@ U_BOOT_CMD(
        );
 
 #endif /* CONFIG_STK52XX */
-#endif /* CFG_CMD_BSP */
+#endif
index cf97603afc5295fa9faae21a784140f90ecb4835..51f4aebc06e0b46a990ab14003d4a75554f766fe 100644 (file)
@@ -336,7 +336,7 @@ void pci_init_board(void)
 }
 #endif
 
-#if defined (CFG_CMD_IDE) && defined (CONFIG_IDE_RESET)
+#if defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_RESET)
 
 #if defined (CONFIG_MINIFAP)
 #define SM501_POWER_MODE0_GATE         0x00000040UL
@@ -389,7 +389,7 @@ void ide_set_reset (int idereset)
        }
 #endif
 }
-#endif /* defined (CFG_CMD_IDE) && defined (CONFIG_IDE_RESET) */
+#endif
 
 #ifdef CONFIG_POST
 /*
diff --git a/board/tqm5200/u-boot.lds b/board/tqm5200/u-boot.lds
deleted file mode 100644 (file)
index 3cc2968..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * (C) Copyright 2003-2004
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc5xxx/start.o        (.text)
-    *(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
diff --git a/board/tqm8260/u-boot.lds b/board/tqm8260/u-boot.lds
deleted file mode 100644 (file)
index 05f29c6..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * (C) Copyright 2001
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc8260/start.o        (.text)
-    *(.text)
-    common/environment.o(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
index 70d1bb889f7d53993efba9470f909f87a2069a73..7bd64012c4ba35a757ad2fe73e190c791b497b34 100644 (file)
@@ -1065,7 +1065,7 @@ int update_flash_size (int flash_size)
 }
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
 
 #include <nand.h>
 #include <linux/mtd/mtd.h>
@@ -1212,7 +1212,7 @@ int board_nand_init(struct nand_chip *nand)
        return 0;
 }
 
-#endif /* CFG_CMD_NAND */
+#endif
 
 #ifdef CONFIG_PCI
 struct pci_controller hose;
diff --git a/board/tqm8272/u-boot.lds b/board/tqm8272/u-boot.lds
deleted file mode 100644 (file)
index 05f29c6..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * (C) Copyright 2001
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc8260/start.o        (.text)
-    *(.text)
-    common/environment.o(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
diff --git a/board/tqm834x/u-boot.lds b/board/tqm834x/u-boot.lds
deleted file mode 100644 (file)
index 020cfa6..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Copyright 2004 Freescale Semiconductor, Inc.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc83xx/start.o        (.text)
-    *(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
-ENTRY(_start)
index 868ca4281f180a6b0c105cd9ce0529e4e5da59bc..fbe1c3640fc661ab1218d8a83d9c1eaff316ed7d 100644 (file)
@@ -50,7 +50,6 @@ $(LIB):       $(obj).depend $(OBJS) $(SOBJS)
 $(obj)trab_fkt.srec:   $(OBJS_FKT) $(LIB)
        $(LD) -g -Ttext $(LOAD_ADDR) -o $(<:.o=) -e trab_fkt $^ $(LIB) \
                -L$(obj)../../examples -lstubs \
-               -L$(obj)../../lib_generic -lgeneric \
                -L$(gcclibdir) -lgcc
        $(OBJCOPY) -O srec $(<:.o=) $@
 
index f4074aecb11e45eee39723d66f4b5d89a803d8b0..ef40c5474857a608ced29b27c4f7827ff7eccd46 100644 (file)
@@ -46,8 +46,8 @@
 #error "must define CFG_HUSH_PARSER"
 #endif
 
-#if !(CONFIG_COMMANDS & CFG_CMD_FAT)
-#error "must define CFG_CMD_FAT"
+#if !defined(CONFIG_CMD_FAT)
+#error "must define CONFIG_CMD_FAT"
 #endif
 
 /*
index b82c8edef70d205fee248c1814476bacd0aa93ec..daa6aeefc73f5a6b0bc8d3b974ea8fca07416e49 100644 (file)
@@ -32,7 +32,7 @@
  * TRAB board specific commands. Especially commands for burn-in and function
  * test.
  */
-#if (CONFIG_COMMANDS & CFG_CMD_BSP)
+#if defined(CONFIG_CMD_BSP)
 
 /* limits for valid range of VCC5V in mV  */
 #define VCC5V_MIN       4500
@@ -846,7 +846,7 @@ int do_temp_log (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
        int contact_temp;
        int delay = 0;
-#if (CONFIG_COMMANDS & CFG_CMD_DATE)
+#if defined(CONFIG_CMD_DATE)
        struct rtc_time tm;
 #endif
 
@@ -862,7 +862,7 @@ int do_temp_log (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        spi_init ();
        while (1) {
 
-#if (CONFIG_COMMANDS & CFG_CMD_DATE)
+#if defined(CONFIG_CMD_DATE)
                rtc_get (&tm);
                printf ("%4d-%02d-%02d %2d:%02d:%02d - ",
                        tm.tm_year, tm.tm_mon, tm.tm_mday,
@@ -893,4 +893,4 @@ U_BOOT_CMD(
        "      For each measurment a timestamp is printeted\n"
 );
 
-#endif /* CFG_CMD_BSP */
+#endif
index 71be6e03e57c185e216d19dbe4ff37dc5dd47b06..7273ef97b659a7bf55f20fb74d6f6abd2d0ed754 100644 (file)
@@ -148,14 +148,14 @@ static int rs485_receive_chars (char *data, int timeout);
 static unsigned short updcrc(unsigned short icrc, unsigned char *icp,
                             unsigned int icnt);
 
-#if (CONFIG_COMMANDS & CFG_CMD_I2C)
+#if defined(CONFIG_CMD_I2C)
 static int trab_eeprom_read (char **argv);
 static int trab_eeprom_write (char **argv);
 int i2c_write_multiple (uchar chip, uint addr, int alen, uchar *buffer,
                        int len);
 int i2c_read_multiple ( uchar chip, uint addr, int alen, uchar *buffer,
                        int len);
-#endif /* CFG_CMD_I2C */
+#endif
 
 /*
  * TRAB board specific commands. Especially commands for burn-in and function
@@ -959,7 +959,7 @@ static int touch_check_pressed (void)
 
 static int touch_write_clibration_values (int calib_point, int x, int y)
 {
-#if (CONFIG_COMMANDS & CFG_CMD_I2C)
+#if defined(CONFIG_CMD_I2C)
        int x_verify = 0;
        int y_verify = 0;
 
@@ -1019,10 +1019,10 @@ static int touch_write_clibration_values (int calib_point, int x, int y)
        }
        return 1;
 #else
-       printf ("No I2C support enabled (CFG_CMD_I2C), could not write "
+       printf ("No I2C support enabled (CONFIG_CMD_I2C), could not write "
                "to EEPROM\n");
        return (1);
-#endif /* CFG_CMD_I2C */
+#endif
 }
 
 
@@ -1105,7 +1105,7 @@ static int rs485_receive_chars (char *data, int timeout)
 
 int do_serial_number (char **argv)
 {
-#if (CONFIG_COMMANDS & CFG_CMD_I2C)
+#if defined(CONFIG_CMD_I2C)
        unsigned int serial_number;
 
        if (strcmp (argv[2], "read") == 0) {
@@ -1130,16 +1130,16 @@ int do_serial_number (char **argv)
        printf ("%s: unknown command %s\n", __FUNCTION__, argv[2]);
        return (1);             /* unknown command, return error */
 #else
-       printf ("No I2C support enabled (CFG_CMD_I2C), could not write "
+       printf ("No I2C support enabled (CONFIG_CMD_I2C), could not write "
                "to EEPROM\n");
        return (1);
-#endif /* CFG_CMD_I2C */
+#endif
 }
 
 
 int do_crc16 (void)
 {
-#if (CONFIG_COMMANDS & CFG_CMD_I2C)
+#if defined(CONFIG_CMD_I2C)
        int crc;
        unsigned char buf[EEPROM_MAX_CRC_BUF];
 
@@ -1160,10 +1160,10 @@ int do_crc16 (void)
        }
        return (0);
 #else
-       printf ("No I2C support enabled (CFG_CMD_I2C), could not write "
+       printf ("No I2C support enabled (CONFIG_CMD_I2C), could not write "
                "to EEPROM\n");
        return (1);
-#endif /* CFG_CMD_I2C */
+#endif
 }
 
 
@@ -1260,7 +1260,7 @@ int do_gain (char **argv)
 
 int do_eeprom (char **argv)
 {
-#if (CONFIG_COMMANDS & CFG_CMD_I2C)
+#if defined(CONFIG_CMD_I2C)
        if (strcmp (argv[2], "read") == 0) {
                return (trab_eeprom_read (argv));
        }
@@ -1272,13 +1272,13 @@ int do_eeprom (char **argv)
        printf ("%s: invalid parameter %s\n", __FUNCTION__, argv[2]);
        return (1);
 #else
-       printf ("No I2C support enabled (CFG_CMD_I2C), could not write "
+       printf ("No I2C support enabled (CONFIG_CMD_I2C), could not write "
                "to EEPROM\n");
        return (1);
-#endif /* CFG_CMD_I2C */
+#endif
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_I2C)
+#if defined(CONFIG_CMD_I2C)
 static int trab_eeprom_read (char **argv)
 {
        int i;
@@ -1408,4 +1408,4 @@ int i2c_read_multiple ( uchar chip, uint addr, int alen,
        }
        return (0);
 }
-#endif /* CFG_CMD_I2C */
+#endif
index 6e4b6d6c66ff3b135dad14ab70e9f7a242814d05..407bdb73c6fa5bab26d7ee489eaecfee82fa31f9 100644 (file)
@@ -4,11 +4,11 @@
 
 #undef CONFIG_PCMCIA
 
-#if    (CONFIG_COMMANDS & CFG_CMD_PCMCIA)
+#if defined(CONFIG_CMD_PCMCIA)
 #define        CONFIG_PCMCIA
 #endif
 
-#if    (CONFIG_COMMANDS & CFG_CMD_IDE) && defined(CONFIG_IDE_8xx_PCCARD)
+#if (defined(CONFIG_CMD_IDE)) && defined(CONFIG_IDE_8xx_PCCARD)
 #define        CONFIG_PCMCIA
 #endif
 
@@ -123,7 +123,7 @@ int pcmcia_hardware_enable(int slot)
 }
 
 
-#if (CONFIG_COMMANDS & CFG_CMD_PCMCIA)
+#if defined(CONFIG_CMD_PCMCIA)
 int pcmcia_hardware_disable(int slot)
 {
        volatile immap_t        *immap;
@@ -149,7 +149,7 @@ int pcmcia_hardware_disable(int slot)
 
        return (0);
 }
-#endif /* CFG_CMD_PCMCIA */
+#endif
 
 
 int pcmcia_voltage_set(int slot, int vcc, int vpp)
index 51e8e84c5c304836c6a2def8b62f9ece430d3c82..4fe18316e5f654b83d8c4b688b1495c662b8175a 100644 (file)
@@ -39,3 +39,4 @@ TEXT_BASE = 0xFFF00000
 endif
 
 PLATFORM_CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE) -I$(TOPDIR)/board
+LDSCRIPT := $(SRCTREE)/cpu/mpc5xxx/u-boot-customlayout.lds
diff --git a/board/uc101/u-boot.lds b/board/uc101/u-boot.lds
deleted file mode 100644 (file)
index 123a14c..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * (C) Copyright 2003-2004
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    /* WARNING - the following is hand-optimized to fit within  */
-    /* the sector layout of our flash chips!    XXX FIXME XXX   */
-
-    cpu/mpc5xxx/start.o          (.text)
-    cpu/mpc5xxx/traps.o          (.text)
-    lib_generic/crc32.o         (.text)
-    lib_ppc/cache.o             (.text)
-    lib_ppc/time.o              (.text)
-
-    . = DEFINED(env_offset) ? env_offset : .;
-    common/environment.o        (.ppcenv)
-
-    *(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
diff --git a/board/utx8245/u-boot.lds b/board/utx8245/u-boot.lds
deleted file mode 100644 (file)
index 45f3018..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * (C) Copyright 2001
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * (C) Copyright 2002
- * Gregory E. Allen, gallen@arlut.utexas.edu
- * Matthew E. Karger, karger@arlut.utexas.edu
- * Applied Research Laboratories, The University of Texas at Austin
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)      }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)      }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)       }
-  .rela.got      : { *(.rela.got)      }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)       }
-  .rela.bss      : { *(.rela.bss)      }
-  .rel.plt       : { *(.rel.plt)       }
-  .rela.plt      : { *(.rela.plt)      }
-  .init          : { *(.init)          }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc824x/start.o                (.text)
-    lib_ppc/board.o            (.text)
-    lib_ppc/ppcstring.o                (.text)
-    lib_generic/vsprintf.o     (.text)
-    lib_generic/crc32.o                (.text)
-    lib_generic/zlib.o         (.text)
-
-       . = DEFINED(env_offset) ? env_offset : .;
-    common/environment.o (.text)
-
-       *(.text)
-
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-
-  _end = . ;
-  PROVIDE (end = .);
-}
diff --git a/board/v38b/u-boot.lds b/board/v38b/u-boot.lds
deleted file mode 100644 (file)
index 4fdea6b..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * (C) Copyright 2003-2006
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc5xxx/start.o        (.text)
-    *(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
index ace4aa2caed9f437df82d1571827de84b4465304..ec032eef8ded81c90a539de5e3608c7c10f49232 100644 (file)
@@ -224,7 +224,7 @@ int board_early_init_r(void)
 }
 
 
-#if defined (CFG_CMD_IDE) && defined (CONFIG_IDE_RESET)
+#if defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_RESET)
 void init_ide_reset(void)
 {
        debug("init_ide_reset\n");
@@ -248,7 +248,7 @@ void ide_set_reset(int idereset)
        } else
                *(vu_long *) MPC5XXX_WU_GPIO_DATA_O |=  GPIO_PSC1_4;
 }
-#endif /* defined (CFG_CMD_IDE) && defined (CONFIG_IDE_RESET) */
+#endif
 
 
 #ifdef CONFIG_HW_WATCHDOG
index 449089e4e63759d0f2457a45350f2a90523d8c2c..fdd6ceb8b521b0111aec93fcc8ccd8b3242bad84 100644 (file)
@@ -24,7 +24,7 @@
 #include <common.h>
 #include <command.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_BSP)
+#if defined(CONFIG_CMD_BSP)
 
 #include "vpd.h"
 
@@ -63,4 +63,4 @@ U_BOOT_CMD(
          "        - Read VPD Data from default address, or device address 'dev_addr'.\n"
 );
 
-#endif /* (CONFIG_COMMANDS & CFG_CMD_BSP) */
+#endif
index 9b03f89eff44e2f56c0f39775a3da2956534ce7e..ba41f856e4aacda6bd44f62c348a7a735d2dd5ff 100644 (file)
@@ -122,7 +122,7 @@ serial_puts(const char *s)
        }
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 void
 kgdb_serial_init(void)
 {
@@ -151,4 +151,4 @@ kgdb_interruptible(int yes)
 {
        return;
 }
-#endif                         /* CFG_CMD_KGDB */
+#endif
diff --git a/board/zpc1900/u-boot.lds b/board/zpc1900/u-boot.lds
deleted file mode 100644 (file)
index 18c4b46..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * (C) Copyright 2001
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * Modified by Yuli Barcohen <yuli@arabellasw.com>
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    cpu/mpc8260/start.o        (.text)
-    *(.text)
-    *(.fixup)
-    *(.got1)
-    . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-    *(.eh_frame)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
-}
-ENTRY(_start)
index a41714351f0e1e13e8446c765b9c31e975f3a10d..aa3932ad2ddd375f74e905aa2aa5d96e5e2d6b12 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <common.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
 #ifdef CONFIG_NEW_NAND_CODE
 
 #include <nand.h>
index 6966de74452c65c5c1f0581425ce592ac1b5810b..3bf1fc3cc7f06e11d20226a2640b6d4b1ddca548 100644 (file)
@@ -2,7 +2,7 @@
 
 #include <common.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_BEDBUG)
+#if defined(CONFIG_CMD_BEDBUG)
 
 #include <linux/ctype.h>
 #include <bedbug/bedbug.h>
@@ -1253,4 +1253,4 @@ int find_next_address (unsigned char *nextaddr, int step_over,
  * purpose.
  */
 
-#endif /* CONFIG_COMMANDS & CFG_CMD_BEDBUG */
+#endif
index e3253022dc92a08f8057af9d33472ff2ad1a0b92..a6038a6effd8a3a7c89ea33ea580f29edb42df38 100644 (file)
@@ -47,8 +47,7 @@
 #include <hush.h>
 #endif
 
-#if defined(CONFIG_AUTOSCRIPT) || \
-        (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT )
+#if defined(CONFIG_AUTOSCRIPT) || defined(CONFIG_CMD_AUTOSCRIPT)
 
 extern image_header_t header;          /* from cmd_bootm.c */
 int
@@ -150,9 +149,10 @@ autoscript (ulong addr)
        return rcode;
 }
 
-#endif /* CONFIG_AUTOSCRIPT || CFG_CMD_AUTOSCRIPT */
+#endif
+
 /**************************************************/
-#if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT)
+#if defined(CONFIG_CMD_AUTOSCRIPT)
 int
 do_autoscript (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
@@ -170,13 +170,13 @@ do_autoscript (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        return rcode;
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT)
+#if defined(CONFIG_CMD_AUTOSCRIPT)
 U_BOOT_CMD(
        autoscr, 2, 0,  do_autoscript,
        "autoscr - run script from memory\n",
        "[addr] - run script starting at addr"
        " - A valid autoscr header must be present\n"
 );
-#endif /* CFG_CMD_AUTOSCRIPT */
+#endif
 
-#endif /* CONFIG_AUTOSCRIPT || CFG_CMD_AUTOSCRIPT */
+#endif
index d97c09e88ee4f9d213014d6b11b130a704efe148..ccb826b8ab9dafbbd65371370a75858a25453f48 100644 (file)
@@ -30,7 +30,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#if (CONFIG_COMMANDS & CFG_CMD_BDI)
+#if defined(CONFIG_CMD_BDI)
 static void print_num(const char *, ulong);
 
 #ifndef CONFIG_ARM     /* PowerPC and other */
@@ -167,7 +167,7 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        print_num ("sram size",         (ulong)bd->bi_sramsize);
 #endif
 
-#if defined(CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
        puts ("ethaddr     =");
        for (i=0; i<6; ++i) {
                printf ("%c%02X", i ? ':' : ' ', bd->bi_enetaddr[i]);
@@ -195,7 +195,7 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        print_num ("sram start     ",   (ulong)bd->bi_sramstart);
        print_num ("sram size      ",   (ulong)bd->bi_sramsize);
 #endif
-#if defined(CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
        puts ("ethaddr     =");
        for (i=0; i<6; ++i) {
                printf ("%c%02X", i ? ':' : ' ', bd->bi_enetaddr[i]);
@@ -285,4 +285,4 @@ U_BOOT_CMD(
        "bdinfo  - print Board Info structure\n",
        NULL
 );
-#endif /* CFG_CMD_BDI */
+#endif
index 48086a62809d34ba4e6aaf824b95b48e0c26a2af..1c3547a1fcc680247d4401c244d7ef55b4f22916 100644 (file)
@@ -13,7 +13,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#if (CONFIG_COMMANDS & CFG_CMD_BEDBUG)
+#if defined(CONFIG_CMD_BEDBUG)
 
 #ifndef MAX
 #define MAX(a,b) ((a) > (b) ? (a) : (b))
@@ -413,7 +413,7 @@ int do_bedbug_rdump (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 U_BOOT_CMD (rdump, 1, 1, do_bedbug_rdump,
            "rdump   - Show registers.\n", " - Show registers.\n");
 /* ====================================================================== */
-#endif /* CFG_CMD_BEDBUG */
+#endif
 
 
 /*
index ad412c81eb8d39ee893ffa166af533156922eeda..241aa8357a3ce3ccea7e3fee4f137c53b1dcd128 100644 (file)
@@ -31,7 +31,7 @@
 #include <asm/byteorder.h>
 #include <malloc.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_BMP)
+#if defined(CONFIG_CMD_BMP)
 
 static int bmp_info (ulong addr);
 static int bmp_display (ulong addr, int x, int y);
@@ -188,4 +188,4 @@ static int bmp_display(ulong addr, int x, int y)
 #endif
 }
 
-#endif /* (CONFIG_COMMANDS & CFG_CMD_BMP) */
+#endif /* defined(CONFIG_CMD_BMP) */
index ba286f1e636c1f6d36ea41b0366b6e192ef03d0f..2436581b18cfe32a5c914432dedc5cb2f8a3fed9 100644 (file)
@@ -48,7 +48,7 @@ DECLARE_GLOBAL_DATA_PTR;
  /*cmd_boot.c*/
  extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
 
-#if (CONFIG_COMMANDS & CFG_CMD_DATE) || defined(CONFIG_TIMESTAMP)
+#if defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE)
 #include <rtc.h>
 #endif
 
@@ -82,11 +82,11 @@ int  gunzip (void *, int, unsigned char *, unsigned long *);
 static void *zalloc(void *, unsigned, unsigned);
 static void zfree(void *, void *, unsigned);
 
-#if (CONFIG_COMMANDS & CFG_CMD_IMI)
+#if defined(CONFIG_CMD_IMI)
 static int image_info (unsigned long addr);
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_IMLS)
+#if defined(CONFIG_CMD_IMLS)
 #include <flash.h>
 extern flash_info_t flash_info[]; /* info for FLASH chips */
 static int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
@@ -126,12 +126,12 @@ static void fixup_silent_linux (void);
 #endif
 static boot_os_Fcn do_bootm_netbsd;
 static boot_os_Fcn do_bootm_rtems;
-#if (CONFIG_COMMANDS & CFG_CMD_ELF)
+#if defined(CONFIG_CMD_ELF)
 static boot_os_Fcn do_bootm_vxworks;
 static boot_os_Fcn do_bootm_qnxelf;
 int do_bootvx ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[] );
 int do_bootelf (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[] );
-#endif /* CFG_CMD_ELF */
+#endif
 #if defined(CONFIG_ARTOS) && defined(CONFIG_PPC)
 static boot_os_Fcn do_bootm_artos;
 #endif
@@ -433,7 +433,7 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                             addr, len_ptr, verify);
            break;
 
-#if (CONFIG_COMMANDS & CFG_CMD_ELF)
+#if defined(CONFIG_CMD_ELF)
        case IH_OS_VXWORKS:
            do_bootm_vxworks (cmdtp, flag, argc, argv,
                              addr, len_ptr, verify);
@@ -442,7 +442,7 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
            do_bootm_qnxelf (cmdtp, flag, argc, argv,
                              addr, len_ptr, verify);
            break;
-#endif /* CFG_CMD_ELF */
+#endif
 #ifdef CONFIG_ARTOS
        case IH_OS_ARTOS:
            do_bootm_artos  (cmdtp, flag, argc, argv,
@@ -1212,7 +1212,7 @@ do_bootm_artos (cmd_tbl_t *cmdtp, int flag,
 #endif
 
 
-#if (CONFIG_COMMANDS & CFG_CMD_BOOTD)
+#if defined(CONFIG_CMD_BOOTD)
 int do_bootd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
        int rcode = 0;
@@ -1240,7 +1240,7 @@ U_BOOT_CMD(
 
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_IMI)
+#if defined(CONFIG_CMD_IMI)
 int do_iminfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
        int     arg;
@@ -1308,9 +1308,9 @@ U_BOOT_CMD(
        "      image contents (magic number, header and payload checksums)\n"
 );
 
-#endif /* CFG_CMD_IMI */
+#endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_IMLS)
+#if defined(CONFIG_CMD_IMLS)
 /*-----------------------------------------------------------------------
  * List all images found in flash.
  */
@@ -1366,23 +1366,23 @@ U_BOOT_CMD(
        "    - Prints information about all images found at sector\n"
        "      boundaries in flash.\n"
 );
-#endif /* CFG_CMD_IMLS */
+#endif
 
 void
 print_image_hdr (image_header_t *hdr)
 {
-#if (CONFIG_COMMANDS & CFG_CMD_DATE) || defined(CONFIG_TIMESTAMP)
+#if defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE)
        time_t timestamp = (time_t)ntohl(hdr->ih_time);
        struct rtc_time tm;
 #endif
 
        printf ("   Image Name:   %.*s\n", IH_NMLEN, hdr->ih_name);
-#if (CONFIG_COMMANDS & CFG_CMD_DATE) || defined(CONFIG_TIMESTAMP)
+#if defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE)
        to_tm (timestamp, &tm);
        printf ("   Created:      %4d-%02d-%02d  %2d:%02d:%02d UTC\n",
                tm.tm_year, tm.tm_mon, tm.tm_mday,
                tm.tm_hour, tm.tm_min, tm.tm_sec);
-#endif /* CFG_CMD_DATE, CONFIG_TIMESTAMP */
+#endif
        puts ("   Image Type:   "); print_type(hdr);
        printf ("\n   Data Size:    %d Bytes = ", ntohl(hdr->ih_size));
        print_size (ntohl(hdr->ih_size), "\n");
@@ -1581,7 +1581,7 @@ do_bootm_rtems (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
        (*entry_point ) ( gd->bd );
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_ELF)
+#if defined(CONFIG_CMD_ELF)
 static void
 do_bootm_vxworks (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
                  ulong addr, ulong *len_ptr, int verify)
@@ -1607,7 +1607,7 @@ do_bootm_qnxelf (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
        local_args[1] = str;    /* and provide it via the arguments */
        do_bootelf(cmdtp, 0, 2, local_args);
 }
-#endif /* CFG_CMD_ELF */
+#endif
 
 #ifdef CONFIG_LYNXKDI
 static void
index 6c250bc1c025cda68385d85db853ba43b82fe424..675d43fa1877cc8320d3684b17caaf6cf23b295f 100644 (file)
@@ -27,7 +27,7 @@
 #include <common.h>
 #include <command.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_CACHE)
+#if defined(CONFIG_CMD_CACHE)
 
 static int on_off (const char *);
 
@@ -109,4 +109,4 @@ U_BOOT_CMD(
        "    - enable or disable data (writethrough) cache\n"
 );
 
-#endif /* CFG_CMD_CACHE */
+#endif
index 1bd3709bd67d98f089861ff41d6f122725b3a043..5e0f990723b371c013fe315af27811db812fc2e4 100644 (file)
@@ -28,7 +28,7 @@
 #include <command.h>
 #include <devices.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_CONSOLE)
+#if defined(CONFIG_CMD_CONSOLE)
 
 extern void _do_coninfo (void);
 int do_coninfo (cmd_tbl_t * cmd, int flag, int argc, char *argv[])
@@ -68,4 +68,4 @@ U_BOOT_CMD(
        ""
 );
 
-#endif /* CFG_CMD_CONSOLE */
+#endif
index 33d2e5661e4466cb2429188ec84f0e99e744d74d..4a42534900a78c90ee6945874e437afa24ba5258 100644 (file)
@@ -31,7 +31,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#if (CONFIG_COMMANDS & CFG_CMD_DATE)
+#if defined(CONFIG_CMD_DATE)
 
 const char *weekdays[] = {
        "Sun", "Mon", "Tues", "Wednes", "Thurs", "Fri", "Satur",
@@ -211,4 +211,4 @@ U_BOOT_CMD(
        "  - with 'reset' argument: reset the RTC\n"
 );
 
-#endif /* CFG_CMD_DATE */
+#endif
index 7221a865ed49f94bfdac446df2d9047be3dd573d..12fa9db08d07bcd5037467c65f1f3d329beb503d 100644 (file)
@@ -29,7 +29,7 @@
 #include <config.h>
 #include <command.h>
 
-#if defined(CONFIG_4xx) && (CONFIG_COMMANDS & CFG_CMD_SETGETDCR)
+#if defined(CONFIG_4xx) && defined(CONFIG_CMD_SETGETDCR)
 
 unsigned long get_dcr (unsigned short);
 unsigned long set_dcr (unsigned short, unsigned long);
@@ -246,4 +246,4 @@ U_BOOT_CMD(
        "adr_dcrn[.dat_dcrn] offset value - write offset to adr_dcrn, write value to dat_dcrn.\n"
 );
 
-#endif /* CONFIG_4xx & CFG_CMD_SETGETDCR */
+#endif
index 45c4b31f5fa19b94d98e88f880f549c3335b2888..cb99b7700f7770dd8b014202544bb3e447231119 100644 (file)
@@ -28,7 +28,7 @@
 #include <command.h>
 #include <post.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_DIAG) && defined(CONFIG_POST)
+#if defined(CONFIG_CMD_DIAG) && defined(CONFIG_POST)
 
 int do_diag (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 {
@@ -77,4 +77,4 @@ U_BOOT_CMD(
        "         - run specified tests\n"
 );
 
-#endif /* CFG_CMD_DIAG */
+#endif
index abee8444e20bc00ace73614e27d90503f40a5435..d19f412819d2aba58a364122b8c714b6940bcba5 100644 (file)
@@ -24,7 +24,7 @@
 #include <common.h>
 #include <command.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_DISPLAY)
+#if defined(CONFIG_CMD_DISPLAY)
 
 #undef DEBUG_DISP
 
@@ -79,4 +79,4 @@ U_BOOT_CMD(
        "    - without arguments: clear dot matrix display\n"
 );
 
-#endif /* CFG_CMD_DISPLAY */
+#endif
index 9814d754fb7adf5ab8d07cd1b071656e26a04c45..d6d3aff8c875757e62067455643a94ad01a40194 100644 (file)
@@ -12,7 +12,7 @@
 #include <malloc.h>
 #include <asm/io.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_DOC)
+#if defined(CONFIG_CMD_DOC)
 
 #include <linux/mtd/nftl.h>
 #include <linux/mtd/doc2000.h>
@@ -1608,4 +1608,4 @@ void doc_probe(unsigned long physadr)
        }
 }
 
-#endif /* (CONFIG_COMMANDS & CFG_CMD_DOC) */
+#endif
index 4f7b049d792c60be7f78811559c458055ada3ca7..8da95bf9d39385d486634a34a9388cfcc823751e 100644 (file)
@@ -25,7 +25,7 @@
 #include <config.h>
 #include <command.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_DTT)
+#if defined(CONFIG_CMD_DTT)
 
 #include <dtt.h>
 #include <i2c.h>
@@ -61,4 +61,4 @@ U_BOOT_CMD(
          "        - Read temperature from digital thermometer and thermostat.\n"
 );
 
-#endif /* CONFIG_COMMANDS & CFG_CMD_DTT */
+#endif
index d15a4120577f617744487b25c95b8c4c84f9b764..e5000e9ff399f43dc21ab1015592f7f9cacf2aed 100644 (file)
@@ -42,7 +42,7 @@
 #include <command.h>
 #include <i2c.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_EEPROM) || defined(CFG_ENV_IS_IN_EEPROM)
+#if defined(CFG_ENV_IS_IN_EEPROM) || defined(CONFIG_CMD_EEPROM)
 
 extern void eeprom_init  (void);
 extern int  eeprom_read  (unsigned dev_addr, unsigned offset,
@@ -62,7 +62,7 @@ extern int eeprom_write_enable (unsigned dev_addr, int state);
 
 /* ------------------------------------------------------------------------- */
 
-#if (CONFIG_COMMANDS & CFG_CMD_EEPROM)
+#if defined(CONFIG_CMD_EEPROM)
 int do_eeprom ( cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 {
        const char *const fmt =
@@ -110,7 +110,7 @@ int do_eeprom ( cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
        printf ("Usage:\n%s\n", cmdtp->usage);
        return 1;
 }
-#endif /* CFG_CMD_EEPROM */
+#endif
 
 /*-----------------------------------------------------------------------
  *
@@ -121,7 +121,7 @@ int do_eeprom ( cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
  *   0x00000nxx for EEPROM address selectors and page number at n.
  */
 
-#if (CONFIG_COMMANDS & CFG_CMD_EEPROM) || defined(CFG_ENV_IS_IN_EEPROM)
+#if defined(CFG_ENV_IS_IN_EEPROM) || defined(CONFIG_CMD_EEPROM)
 
 #ifndef CONFIG_SPI
 #if !defined(CFG_I2C_EEPROM_ADDR_LEN) || CFG_I2C_EEPROM_ADDR_LEN < 1 || CFG_I2C_EEPROM_ADDR_LEN > 2
@@ -422,10 +422,11 @@ void eeprom_init  (void)
 }
 /*-----------------------------------------------------------------------
  */
-#endif /* CFG_CMD_EEPROM */
+#endif
+
 /***************************************************/
 
-#if (CONFIG_COMMANDS & CFG_CMD_EEPROM)
+#if defined(CONFIG_CMD_EEPROM)
 
 #ifdef CFG_I2C_MULTI_EEPROMS
 U_BOOT_CMD(
@@ -445,4 +446,4 @@ U_BOOT_CMD(
 );
 #endif /* CFG_I2C_MULTI_EEPROMS */
 
-#endif /* CFG_CMD_EEPROM */
+#endif
index 0e3d56f6bbb88ee0004f99f6ecb4b590bff59da7..63a5593e4343ae16964f4cb369b00cedbeaff6c4 100644 (file)
@@ -23,7 +23,7 @@
 DECLARE_GLOBAL_DATA_PTR;
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_ELF)
+#if defined(CONFIG_CMD_ELF)
 
 #ifndef MAX
 #define MAX(a,b) ((a) > (b) ? (a) : (b))
@@ -101,7 +101,7 @@ int do_bootvx (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        else
                addr = simple_strtoul (argv[1], NULL, 16);
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
        /* Check to see if we need to tftp the image ourselves before starting */
 
        if ((argc == 2) && (strcmp (argv[1], "tftp") == 0)) {
@@ -324,4 +324,4 @@ U_BOOT_CMD(
        " [address] - load address of vxWorks ELF image.\n"
 );
 
-#endif /* CFG_CMD_ELF */
+#endif
index 94bd9b61e6779a01f241700817fba6c817478348..8bd2b476e5448f2067f19b839194380cda93337c 100644 (file)
 #include <common.h>
 #include <part.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_EXT2)
+#if defined(CONFIG_CMD_EXT2)
 #include <config.h>
 #include <command.h>
 #include <image.h>
 #include <linux/ctype.h>
 #include <asm/byteorder.h>
 #include <ext2fs.h>
-#if ((CONFIG_COMMANDS & CFG_CMD_USB) && defined(CONFIG_USB_STORAGE))
+#if defined(CONFIG_CMD_USB) && defined(CONFIG_USB_STORAGE)
 #include <usb.h>
 #endif
 
@@ -260,4 +260,4 @@ U_BOOT_CMD(
        "      to address 'addr' from ext2 filesystem\n"
 );
 
-#endif /* CONFIG_COMMANDS & CFG_CMD_EXT2 */
+#endif
index afaf299569bf612b891ae04917585d28d7a2c3f3..54f0f9f9cec7f82a938888679212b9134d0c892a 100644 (file)
@@ -31,7 +31,7 @@
 #include <ata.h>
 #include <part.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_FAT)
+#if defined(CONFIG_CMD_FAT)
 
 #undef DEBUG
 
@@ -324,4 +324,4 @@ void hexdump (int cnt, unsigned char *data)
 }
 #endif /* NOT_IMPLEMENTED_YET */
 
-#endif /* CFG_CMD_FAT */
+#endif
index 03f4ce6d34c918d295091c8ac384161f0b42b234..7349412c77a92af60fa8700f9f48e5a012fda8d5 100644 (file)
 #endif
 
 
-/*#if (CONFIG_COMMANDS & CFG_CMD_DATE) */
+/*#if defined(CONFIG_CMD_DATE) */
 /*#include <rtc.h> */
 /*#endif */
 
-#if ((CONFIG_COMMANDS & CFG_CMD_FDC) || (CONFIG_COMMANDS & CFG_CMD_FDOS))
+#if defined(CONFIG_CMD_FDC) || defined(CONFIG_CMD_FDOS)
 
 
 typedef struct {
@@ -707,9 +707,9 @@ int fdc_setup(int drive, FDC_COMMAND_STRUCT *pCMD, FD_GEO_STRUCT *pFG)
 
        return TRUE;
 }
-#endif /* ((CONFIG_COMMANDS & CFG_CMD_FDC)||(CONFIG_COMMANDS & CFG_CMD_FDOS))*/
+#endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_FDOS)
+#if defined(CONFIG_CMD_FDOS)
 
 /* Low level functions for the Floppy-DOS layer                              */
 
@@ -772,9 +772,9 @@ int fdc_fdos_read (void *buffer, int len)
 
        return (fdc_read_data (buffer, len, pCMD, pFG));
 }
-#endif  /* (CONFIG_COMMANDS & CFG_CMD_FDOS)                                  */
+#endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_FDC)
+#if defined(CONFIG_CMD_FDC)
 /****************************************************************************
  * main routine do_fdcboot
  */
@@ -880,13 +880,13 @@ int do_fdcboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 }
 
 
-#endif /* CONFIG_COMMANDS & CFG_CMD_FDC */
+#endif
 
 
 /***************************************************/
 
 
-#if (CONFIG_COMMANDS & CFG_CMD_FDC)
+#if defined(CONFIG_CMD_FDC)
 
 U_BOOT_CMD(
        fdcboot,        3,      1,      do_fdcboot,
index dc02b3595c2a64035faf7021e7a3013b459c87ee..f9da98ddcc7e9491345435aedfa752fad4d861a6 100644 (file)
@@ -31,7 +31,7 @@
 #include <command.h>
 #include <fdc.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_FDOS)
+#if defined(CONFIG_CMD_FDOS)
 
 /*-----------------------------------------------------------------------------
  * do_fdosboot --
@@ -154,4 +154,4 @@ U_BOOT_CMD(
        "[directory]\n"
 );
 
-#endif /* CONFIG_COMMANDS & CFG_CMD_FDOS */
+#endif
index a34ab79c3da57bbb96b6f934db904b1fa7a854a9..11c8857313b42d2e0c95fb8b2b7d82ab4be6511a 100644 (file)
@@ -31,9 +31,9 @@
 #include <dataflash.h>
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_FLASH)
+#if defined(CONFIG_CMD_FLASH)
 
-#if (CONFIG_COMMANDS & CFG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
+#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
 #include <jffs2/jffs2.h>
 
 /* parition handling routines */
@@ -311,7 +311,7 @@ int do_flerase (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        flash_info_t *info;
        ulong bank, addr_first, addr_last;
        int n, sect_first, sect_last;
-#if (CONFIG_COMMANDS & CFG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
+#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
        struct mtd_device *dev;
        struct part_info *part;
        u8 dev_type, dev_num, pnum;
@@ -343,7 +343,7 @@ int do_flerase (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                return rcode;
        }
 
-#if (CONFIG_COMMANDS & CFG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
+#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
        /* erase <part-id> - erase partition */
        if ((argc == 2) && (id_parse(argv[1], NULL, &dev_type, &dev_num) == 0)) {
                mtdparts_init();
@@ -447,7 +447,7 @@ int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        flash_info_t *info;
        ulong bank, addr_first, addr_last;
        int i, p, n, sect_first, sect_last;
-#if (CONFIG_COMMANDS & CFG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
+#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
        struct mtd_device *dev;
        struct part_info *part;
        u8 dev_type, dev_num, pnum;
@@ -539,7 +539,7 @@ int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                return rcode;
        }
 
-#if (CONFIG_COMMANDS & CFG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
+#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
        /* protect on/off <part-id> */
        if ((argc == 3) && (id_parse(argv[2], NULL, &dev_type, &dev_num) == 0)) {
                mtdparts_init();
@@ -672,7 +672,7 @@ int flash_sect_protect (int p, ulong addr_first, ulong addr_last)
 
 
 /**************************************************/
-#if (CONFIG_COMMANDS & CFG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
+#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
 # define TMP_ERASE     "erase <part-id>\n    - erase partition\n"
 # define TMP_PROT_ON   "protect on <part-id>\n    - protect partition\n"
 # define TMP_PROT_OFF  "protect off <part-id>\n    - make partition writable\n"
@@ -732,4 +732,4 @@ U_BOOT_CMD(
 #undef TMP_PROT_ON
 #undef TMP_PROT_OFF
 
-#endif /* CFG_CMD_FLASH */
+#endif
index 34440918582b56573533f0b9eb2e6a56a295a449..3fc4fca9ae2991540f7d410b16fc6a31258a4306 100644 (file)
@@ -27,7 +27,7 @@
  */
 #include <common.h>
 #include <command.h>
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
 #include <net.h>
 #endif
 #include <fpga.h>
@@ -43,7 +43,7 @@
 #define PRINTF(fmt,args...)
 #endif
 
-#if defined (CONFIG_FPGA) && ( CONFIG_COMMANDS & CFG_CMD_FPGA )
+#if defined (CONFIG_FPGA) && defined(CONFIG_CMD_FPGA)
 
 /* Local functions */
 static void fpga_usage (cmd_tbl_t * cmdtp);
@@ -321,4 +321,4 @@ U_BOOT_CMD (fpga, 6, 1, do_fpga,
            "\tloadb\tLoad device from bitstream buffer (Xilinx devices only)\n"
            "\tloadmk\tLoad device generated with mkimage\n"
            "\tdump\tLoad device to memory buffer\n");
-#endif /* CONFIG_FPGA && CONFIG_COMMANDS & CFG_CMD_FPGA */
+#endif
index 755810d590419c4c5de528a1947a0111ca11d117..a684a580e6edc24f54f057ad0a93de8d40659d95 100644 (file)
@@ -86,7 +86,7 @@
 #include <i2c.h>
 #include <asm/byteorder.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_I2C)
+#if defined(CONFIG_CMD_I2C)
 
 
 /* Display values from last command.
@@ -657,7 +657,7 @@ int do_i2c_loop(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
  * The SDRAM command is separately configured because many
  * (most?) embedded boards don't use SDRAM DIMMs.
  */
-#if (CONFIG_COMMANDS & CFG_CMD_SDRAM)
+#if defined(CONFIG_CMD_SDRAM)
 
 /*
  * Syntax:
@@ -877,7 +877,7 @@ int do_sdram  ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 
        return 0;
 }
-#endif /* CFG_CMD_SDRAM */
+#endif
 
 #if defined(CONFIG_I2C_CMD_TREE)
 #if defined(CONFIG_I2C_MULTI_BUS)
@@ -938,10 +938,10 @@ int do_i2c(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
                return do_i2c_probe(cmdtp, flag, --argc, ++argv);
        if (!strncmp(argv[1], "lo", 2))
                return do_i2c_loop(cmdtp, flag, --argc, ++argv);
-#if (CONFIG_COMMANDS & CFG_CMD_SDRAM)
+#if defined(CONFIG_CMD_SDRAM)
        if (!strncmp(argv[1], "sd", 2))
                return do_sdram(cmdtp, flag, --argc, ++argv);
-#endif /* CFG_CMD_SDRAM */
+#endif
        else
                printf ("Usage:\n%s\n", cmdtp->usage);
        return 0;
@@ -965,9 +965,9 @@ U_BOOT_CMD(
        "i2c crc32 chip address[.0, .1, .2] count - compute CRC32 checksum\n"
        "i2c probe - show devices on the I2C bus\n"
        "i2c loop chip address[.0, .1, .2] [# of objects] - looping read of device\n"
-#if (CONFIG_COMMANDS & CFG_CMD_SDRAM)
+#if defined(CONFIG_CMD_SDRAM)
        "i2c sdram chip - print SDRAM configuration information\n"
-#endif  /* CFG_CMD_SDRAM */
+#endif
 );
 #endif /* CONFIG_I2C_CMD_TREE */
 U_BOOT_CMD(
@@ -1016,7 +1016,7 @@ U_BOOT_CMD(
        "    - loop, reading a set of addresses\n"
 );
 
-#if (CONFIG_COMMANDS & CFG_CMD_SDRAM)
+#if defined(CONFIG_CMD_SDRAM)
 U_BOOT_CMD(
        isdram, 2,      1,      do_sdram,
        "isdram  - print SDRAM configuration information\n",
@@ -1025,4 +1025,4 @@ U_BOOT_CMD(
 );
 #endif
 
-#endif /* CFG_CMD_I2C */
+#endif
index 877915694903a9bf07e753e5de07898b294d46f9..89fefed33d06fccdc535eefaad9a038d1626b621 100644 (file)
@@ -71,7 +71,7 @@ DECLARE_GLOBAL_DATA_PTR;
 # define SYNC          /* nothing */
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_IDE)
+#if defined(CONFIG_CMD_IDE)
 
 #ifdef CONFIG_IDE_8xx_DIRECT
 /* Timings for IDE Interface
@@ -2105,4 +2105,4 @@ U_BOOT_CMD(
        "loadAddr dev:part\n"
 );
 
-#endif /* CONFIG_COMMANDS & CFG_CMD_IDE */
+#endif
index fa79b45a3cc6182e5dbaf21185c07712691b72bf..ae95758247d5e15cd26da5aca3b36ea45cdba7f8 100644 (file)
@@ -28,7 +28,7 @@
 #include <common.h>
 #include <command.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_IMMAP) && \
+#if defined(CONFIG_CMD_IMMAP) && \
     (defined(CONFIG_8xx) || defined(CONFIG_8260))
 
 #if defined(CONFIG_8xx)
@@ -720,4 +720,4 @@ U_BOOT_CMD(
 );
 
 
-#endif /* CFG_CMD_IMMAP && (CONFIG_8xx || CONFIG_8260) */
+#endif
index 8ad134f4a680fe074361dfedad47633b0e6f1d8f..8e2051714ce6e441c808bd1e1136e328c41497f9 100644 (file)
@@ -32,7 +32,7 @@
 #include <config.h>
 #include <command.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_ITEST)
+#if defined(CONFIG_CMD_ITEST)
 
 #define EQ     0
 #define NE     1
@@ -197,4 +197,4 @@ U_BOOT_CMD(
        "itest\t- return true/false on integer compare\n",
        "[.b, .w, .l, .s] [*]value1 <op> [*]value2\n"
 );
-#endif /* CONFIG_COMMANDS & CFG_CMD_ITEST */
+#endif
index 8ea683d997422234a0611b82db2c4cb0e29e2ed0..3e6061a5202c7a341b405574a6fa98f4639cb447 100644 (file)
 #include <linux/list.h>
 #include <linux/ctype.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_JFFS2)
+#if defined(CONFIG_CMD_JFFS2)
 
 #include <cramfs/cramfs_fs.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
 #ifdef CFG_NAND_LEGACY
 #include <linux/mtd/nand_legacy.h>
 #else /* !CFG_NAND_LEGACY */
 #include <linux/mtd/nand.h>
 #include <nand.h>
 #endif /* !CFG_NAND_LEGACY */
-#endif /* (CONFIG_COMMANDS & CFG_CMD_NAND) */
+#endif
 /* enable/disable debugging messages */
 #define        DEBUG_JFFS
 #undef DEBUG_JFFS
@@ -326,7 +326,7 @@ static void current_save(void)
  */
 static int part_validate_nor(struct mtdids *id, struct part_info *part)
 {
-#if (CONFIG_COMMANDS & CFG_CMD_FLASH)
+#if defined(CONFIG_CMD_FLASH)
        /* info for FLASH chips */
        extern flash_info_t flash_info[];
        flash_info_t *flash;
@@ -375,7 +375,7 @@ static int part_validate_nor(struct mtdids *id, struct part_info *part)
  */
 static int part_validate_nand(struct mtdids *id, struct part_info *part)
 {
-#if defined(CONFIG_JFFS2_NAND) && (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_JFFS2_NAND) && defined(CONFIG_CMD_NAND)
        /* info for NAND chips */
        nand_info_t *nand;
 
@@ -724,7 +724,7 @@ static int part_parse(const char *const partdef, const char **ret, struct part_i
 static int device_validate(u8 type, u8 num, u32 *size)
 {
        if (type == MTD_DEV_TYPE_NOR) {
-#if (CONFIG_COMMANDS & CFG_CMD_FLASH)
+#if defined(CONFIG_CMD_FLASH)
                if (num < CFG_MAX_FLASH_BANKS) {
                        extern flash_info_t flash_info[];
                        *size = flash_info[num].size;
@@ -738,7 +738,7 @@ static int device_validate(u8 type, u8 num, u32 *size)
                printf("support for FLASH devices not present\n");
 #endif
        } else if (type == MTD_DEV_TYPE_NAND) {
-#if defined(CONFIG_JFFS2_NAND) && (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_JFFS2_NAND) && defined(CONFIG_CMD_NAND)
                if (num < CFG_MAX_NAND_DEVICE) {
 #ifndef CFG_NAND_LEGACY
                        *size = nand_info[num].size;
@@ -2210,4 +2210,4 @@ U_BOOT_CMD(
 
 /***************************************************/
 
-#endif /* CFG_CMD_JFFS2 */
+#endif
index f63b8e805617517d3912a41f3649e37b3c453a19..204c3ebf1930ddbb3dcce843402e1a3be9a558f4 100644 (file)
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#if (CONFIG_COMMANDS & CFG_CMD_LOADB)
+#if defined(CONFIG_CMD_LOADB)
 static ulong load_serial_ymodem (ulong offset);
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_LOADS)
+#if defined(CONFIG_CMD_LOADS)
 static ulong load_serial (ulong offset);
 static int read_record (char *buf, ulong len);
-# if (CONFIG_COMMANDS & CFG_CMD_SAVES)
+# if defined(CONFIG_CMD_SAVES)
 static int save_serial (ulong offset, ulong size);
 static int write_record (char *buf);
-# endif /* CFG_CMD_SAVES */
+#endif
 
 static int do_echo = 1;
-#endif /* CFG_CMD_LOADS */
+#endif
 
 /* -------------------------------------------------------------------- */
 
-#if (CONFIG_COMMANDS & CFG_CMD_LOADS)
+#if defined(CONFIG_CMD_LOADS)
 int do_load_serial (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
        ulong offset = 0;
@@ -253,7 +253,7 @@ read_record (char *buf, ulong len)
        return (p - buf);
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_SAVES)
+#if defined(CONFIG_CMD_SAVES)
 
 int do_save_serial (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
@@ -399,13 +399,15 @@ write_record (char *buf)
        }
        return (0);
 }
-# endif /* CFG_CMD_SAVES */
-
-#endif /* CFG_CMD_LOADS */
+# endif
 
+#endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_LOADB)  /* loadb command (load binary) included */
 
+#if defined(CONFIG_CMD_LOADB)
+/*
+ * loadb command (load binary) included
+ */
 #define XON_CHAR        17
 #define XOFF_CHAR       19
 #define START_CHAR      0x01
@@ -1036,11 +1038,11 @@ static ulong load_serial_ymodem (ulong offset)
        return offset;
 }
 
-#endif /* CFG_CMD_LOADB */
+#endif
 
 /* -------------------------------------------------------------------- */
 
-#if (CONFIG_COMMANDS & CFG_CMD_LOADS)
+#if defined(CONFIG_CMD_LOADS)
 
 #ifdef CFG_LOADS_BAUD_CHANGE
 U_BOOT_CMD(
@@ -1065,7 +1067,7 @@ U_BOOT_CMD(
  */
 
 
-#if (CONFIG_COMMANDS & CFG_CMD_SAVES)
+#if defined(CONFIG_CMD_SAVES)
 #ifdef CFG_LOADS_BAUD_CHANGE
 U_BOOT_CMD(
        saves, 4, 0,    do_save_serial,
@@ -1082,11 +1084,11 @@ U_BOOT_CMD(
        "    - save S-Record file over serial line with offset 'off' and size 'size'\n"
 );
 #endif /* CFG_LOADS_BAUD_CHANGE */
-#endif /* CFG_CMD_SAVES */
-#endif /* CFG_CMD_LOADS */
+#endif
+#endif
 
 
-#if (CONFIG_COMMANDS & CFG_CMD_LOADB)
+#if defined(CONFIG_CMD_LOADB)
 U_BOOT_CMD(
        loadb, 3, 0,    do_load_serial_bin,
        "loadb   - load binary file over serial line (kermit mode)\n",
@@ -1103,11 +1105,11 @@ U_BOOT_CMD(
        " with offset 'off' and baudrate 'baud'\n"
 );
 
-#endif /* CFG_CMD_LOADB */
+#endif
 
 /* -------------------------------------------------------------------- */
 
-#if (CONFIG_COMMANDS & CFG_CMD_HWFLOW)
+#if defined(CONFIG_CMD_HWFLOW)
 int do_hwflow (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
        extern int hwflow_onoff(int);
@@ -1133,4 +1135,4 @@ U_BOOT_CMD(
        "[on|off]\n - change RTS/CTS hardware flow control over serial line\n"
 );
 
-#endif /* CFG_CMD_HWFLOW */
+#endif
index fcbb0236d2501dc43af04b473fd1824d6af7ab27..a994211138665dff649b376ec69ef78fcf0deece 100644 (file)
 
 #include <common.h>
 #include <command.h>
-#if (CONFIG_COMMANDS & CFG_CMD_MMC)
+#if defined(CONFIG_CMD_MMC)
 #include <mmc.h>
 #endif
 #ifdef CONFIG_HAS_DATAFLASH
 #include <dataflash.h>
 #endif
 
-#if (CONFIG_COMMANDS & (CFG_CMD_MEMORY | \
-                       CFG_CMD_I2C     | \
-                       CFG_CMD_ITEST   | \
-                       CFG_CMD_PCI     | \
-                       CMD_CMD_PORTIO  ) )
+#if defined(CONFIG_CMD_MEMORY)         \
+    || defined(CONFIG_CMD_I2C)         \
+    || defined(CONFIG_CMD_ITEST)       \
+    || defined(CONFIG_CMD_PCI)         \
+    || defined(CONFIG_CMD_PORTIO)
+
 int cmd_get_data_size(char* arg, int default_size)
 {
        /* Check for a size specification .b, .w or .l.
@@ -64,7 +65,7 @@ int cmd_get_data_size(char* arg, int default_size)
 }
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_MEMORY)
+#if defined(CONFIG_CMD_MEMORY)
 
 #ifdef CMD_MEM_DEBUG
 #define        PRINTF(fmt,args...)     printf (fmt ,##args)
@@ -403,7 +404,7 @@ int do_mem_cp ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        }
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_MMC)
+#if defined(CONFIG_CMD_MMC)
        if (mmc2info(dest)) {
                int rc;
 
@@ -1149,7 +1150,7 @@ int do_mem_crc (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 #endif /* CONFIG_CRC32_VERIFY */
 
 /**************************************************/
-#if (CONFIG_COMMANDS & CFG_CMD_MEMORY)
+#if defined(CONFIG_CMD_MEMORY)
 U_BOOT_CMD(
        md,     3,     1,      do_mem_md,
        "md      - memory display\n",
@@ -1252,4 +1253,4 @@ U_BOOT_CMD(
 #endif /* CONFIG_MX_CYCLIC */
 
 #endif
-#endif /* CFG_CMD_MEMORY */
+#endif
index 337dfbb24e809f957c0fdb56c78f4d7a8e6aafe5..93cc873b05ab12cf1e707f4a2847ed238cf90401 100644 (file)
@@ -30,7 +30,7 @@
 #include <config.h>
 #include <command.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_MFSL)
+#if defined(CONFIG_CMD_MFSL)
 #include <asm/asm.h>
 
 int do_frd (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
@@ -415,4 +415,4 @@ U_BOOT_CMD (rspr, 3, 1, do_rspr,
                " 3 - EAR - Exception address register\n"
                " 5 - ESR - Exception status register\n");
 
-#endif                         /* CONFIG_MICROBLAZE & CFG_CMD_MFSL */
+#endif
index e6595360cbeca81a3fe144ee18ad7ae0e8d6bb0e..f6b98d1f3de7f6d50b61acb4a40c4156f69e7bde 100644 (file)
@@ -28,7 +28,7 @@
 #include <common.h>
 #include <command.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_MII)
+#if defined(CONFIG_CMD_MII)
 #include <miiphy.h>
 
 #ifdef CONFIG_TERSE_MII
@@ -595,4 +595,4 @@ U_BOOT_CMD(
 
 #endif /* CONFIG_TERSE_MII */
 
-#endif /* CFG_CMD_MII */
+#endif
index a99222d3efa5949d6a9a0b355c8f0e4d3f90b8b6..c0c6b8f05af54ae683dcfd102514657e6863dda8 100644 (file)
@@ -27,7 +27,7 @@
 #include <common.h>
 #include <command.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_MISC)
+#if defined(CONFIG_CMD_MISC)
 
 int do_sleep (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
@@ -52,7 +52,7 @@ int do_sleep (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 }
 
 /* Implemented in $(CPU)/interrupts.c */
-#if (CONFIG_COMMANDS & CFG_CMD_IRQ)
+#if defined(CONFIG_CMD_IRQ)
 int do_irqinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
 
 U_BOOT_CMD(
@@ -60,7 +60,7 @@ U_BOOT_CMD(
        "irqinfo - print information about IRQs\n",
        NULL
 );
-#endif  /* CONFIG_COMMANDS & CFG_CMD_IRQ */
+#endif
 
 U_BOOT_CMD(
        sleep ,    2,    1,     do_sleep,
@@ -69,4 +69,4 @@ U_BOOT_CMD(
        "    - delay execution for N seconds (N is _decimal_ !!!)\n"
 );
 
-#endif /* CFG_CMD_MISC */
+#endif
index 573eb97ead9c7c0a6dc35ffc6bba69b2febd65f9..069c6d02a066ab5a6a010cd0c3df883cd8b1bfe4 100644 (file)
@@ -24,7 +24,7 @@
 #include <common.h>
 #include <command.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_MMC)
+#if defined(CONFIG_CMD_MMC)
 
 #include <mmc.h>
 
@@ -43,4 +43,4 @@ U_BOOT_CMD(
        NULL
 );
 
-#endif /* CFG_CMD_MMC */
+#endif
index cb62661ec2703375099409ffaf71f3826d07bafa..c72612d0d6f3c828271d48ab5b4a053cb121576f 100644 (file)
@@ -19,7 +19,7 @@
  */
 #include <common.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
 
 #include <command.h>
 #include <watchdog.h>
@@ -28,7 +28,7 @@
 #include <jffs2/jffs2.h>
 #include <nand.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
+#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
 
 /* parition handling routines */
 int mtdparts_init(void);
@@ -96,7 +96,7 @@ static int
 arg_off_size(int argc, char *argv[], nand_info_t *nand, ulong *off, ulong *size)
 {
        int idx = nand_curr_device;
-#if (CONFIG_COMMANDS & CFG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
+#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
        struct mtd_device *dev;
        struct part_info *part;
        u8 pnum;
@@ -144,7 +144,7 @@ arg_off_size(int argc, char *argv[], nand_info_t *nand, ulong *off, ulong *size)
                *size = nand->size - *off;
        }
 
-#if (CONFIG_COMMANDS & CFG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
+#if  defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
 out:
 #endif
        printf("device %d ", idx);
@@ -529,7 +529,7 @@ int do_nandboot(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
        char *boot_device = NULL;
        int idx;
        ulong addr, offset = 0;
-#if (CONFIG_COMMANDS & CFG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
+#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
        struct mtd_device *dev;
        struct part_info *part;
        u8 pnum;
@@ -574,7 +574,7 @@ int do_nandboot(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
                offset = simple_strtoul(argv[3], NULL, 16);
                break;
        default:
-#if (CONFIG_COMMANDS & CFG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
+#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
 usage:
 #endif
                printf("Usage:\n%s\n", cmdtp->usage);
@@ -606,7 +606,7 @@ U_BOOT_CMD(nboot, 4, 1, do_nandboot,
        "nboot   - boot from NAND device\n",
        "[partition] | [[[loadAddr] dev] offset]\n");
 
-#endif                         /* (CONFIG_COMMANDS & CFG_CMD_NAND) */
+#endif
 
 #else /* CFG_NAND_LEGACY */
 /*
@@ -626,7 +626,7 @@ U_BOOT_CMD(nboot, 4, 1, do_nandboot,
 # define show_boot_progress(arg)
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
 #include <linux/mtd/nand_legacy.h>
 #if 0
 #include <linux/mtd/nand_ids.h>
@@ -991,6 +991,6 @@ U_BOOT_CMD(
        "loadAddr dev\n"
 );
 
-#endif /* (CONFIG_COMMANDS & CFG_CMD_NAND) */
+#endif
 
 #endif /* CFG_NAND_LEGACY */
index f1097a9951d368b9e1e5ac44cb6dba275405574c..0715fbc203ce06fc8fa2c61af5db240ec9de50b3 100644 (file)
@@ -28,7 +28,7 @@
 #include <command.h>
 #include <net.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
 
 extern int do_bootm (cmd_tbl_t *, int, int, char *[]);
 
@@ -67,7 +67,7 @@ U_BOOT_CMD(
        "[loadAddress] [bootfilename]\n"
 );
 
-#if (CONFIG_COMMANDS & CFG_CMD_DHCP)
+#if defined(CONFIG_CMD_DHCP)
 int do_dhcp (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
        return netboot_common(DHCP, cmdtp, argc, argv);
@@ -78,9 +78,9 @@ U_BOOT_CMD(
        "dhcp\t- invoke DHCP client to obtain IP/boot params\n",
        "\n"
 );
-#endif /* CFG_CMD_DHCP */
+#endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_NFS)
+#if defined(CONFIG_CMD_NFS)
 int do_nfs (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
        return netboot_common(NFS, cmdtp, argc, argv);
@@ -91,7 +91,7 @@ U_BOOT_CMD(
        "nfs\t- boot image via network using NFS protocol\n",
        "[loadAddress] [host ip addr:bootfilename]\n"
 );
-#endif /* CFG_CMD_NFS */
+#endif
 
 static void netboot_update_env (void)
 {
@@ -127,7 +127,7 @@ static void netboot_update_env (void)
                ip_to_string (NetOurDNSIP, tmp);
                setenv ("dnsip", tmp);
        }
-#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_DNS2)
+#if defined(CONFIG_BOOTP_DNS2)
        if (NetOurDNS2IP) {
                ip_to_string (NetOurDNS2IP, tmp);
                setenv ("dnsip2", tmp);
@@ -136,13 +136,15 @@ static void netboot_update_env (void)
        if (NetOurNISDomain[0])
                setenv ("domain", NetOurNISDomain);
 
-#if (CONFIG_COMMANDS & CFG_CMD_SNTP) && (CONFIG_BOOTP_MASK & CONFIG_BOOTP_TIMEOFFSET)
+#if defined(CONFIG_CMD_SNTP) \
+    && defined(CONFIG_BOOTP_TIMEOFFSET)
        if (NetTimeOffset) {
                sprintf (tmp, "%d", NetTimeOffset);
                setenv ("timeoffset", tmp);
        }
 #endif
-#if (CONFIG_COMMANDS & CFG_CMD_SNTP) && (CONFIG_BOOTP_MASK & CONFIG_BOOTP_NTPSERVER)
+#if defined(CONFIG_CMD_SNTP) \
+    && defined(CONFIG_BOOTP_NTPSERVER)
        if (NetNtpServerIP) {
                ip_to_string (NetNtpServerIP, tmp);
                setenv ("ntpserverip", tmp);
@@ -232,7 +234,7 @@ netboot_common (proto_t proto, cmd_tbl_t *cmdtp, int argc, char *argv[])
        return rcode;
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_PING)
+#if defined(CONFIG_CMD_PING)
 int do_ping (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
        if (argc < 2)
@@ -259,9 +261,9 @@ U_BOOT_CMD(
        "ping\t- send ICMP ECHO_REQUEST to network host\n",
        "pingAddress\n"
 );
-#endif /* CFG_CMD_PING */
+#endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_CDP)
+#if defined(CONFIG_CMD_CDP)
 
 static void cdp_update_env(void)
 {
@@ -302,9 +304,9 @@ U_BOOT_CMD(
        cdp,    1,      1,      do_cdp,
        "cdp\t- Perform CDP network configuration\n",
 );
-#endif /* CFG_CMD_CDP */
+#endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_SNTP)
+#if defined(CONFIG_CMD_SNTP)
 int do_sntp (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
        char *toff;
@@ -340,6 +342,6 @@ U_BOOT_CMD(
        "sntp\t- synchronize RTC via network\n",
        "[NTP server IP]\n"
 );
-#endif /* CFG_CMD_SNTP */
+#endif
 
-#endif /* CFG_CMD_NET */
+#endif
index 977ec5bae96153c390b37867546e6d5cb7b1c796..de5a5148f69bda90b173a2910a60baeae62615c8 100644 (file)
@@ -46,7 +46,7 @@
 #include <serial.h>
 #include <linux/stddef.h>
 #include <asm/byteorder.h>
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
 #include <net.h>
 #endif
 
@@ -367,12 +367,12 @@ int _do_setenv (int flag, int argc, char *argv[])
                load_addr = simple_strtoul(argv[2], NULL, 16);
                return 0;
        }
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
        if (strcmp(argv[1],"bootfile") == 0) {
                copy_filename (BootFile, argv[2], sizeof(BootFile));
                return 0;
        }
-#endif /* CFG_CMD_NET */
+#endif
 
 #ifdef CONFIG_AMIGAONEG3SE
        if (strcmp(argv[1], "vga_fg_color") == 0 ||
@@ -411,7 +411,7 @@ int do_setenv ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
  * Prompt for environment variable
  */
 
-#if (CONFIG_COMMANDS & CFG_CMD_ASKENV)
+#if defined(CONFIG_CMD_ASKENV)
 int do_askenv ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
        extern char console_buffer[CFG_CBSIZE];
@@ -483,7 +483,7 @@ int do_askenv ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        /* Continue calling setenv code */
        return _do_setenv (flag, len, local_args);
 }
-#endif /* CFG_CMD_ASKENV */
+#endif
 
 /************************************************************************
  * Look up variable from environment,
@@ -538,11 +538,9 @@ int getenv_r (char *name, char *buf, unsigned len)
        return (-1);
 }
 
-#if defined(CFG_ENV_IS_IN_NVRAM) || defined(CFG_ENV_IS_IN_EEPROM) || \
-    ((CONFIG_COMMANDS & (CFG_CMD_ENV|CFG_CMD_FLASH)) == \
-      (CFG_CMD_ENV|CFG_CMD_FLASH)) || \
-    ((CONFIG_COMMANDS & (CFG_CMD_ENV|CFG_CMD_NAND)) == \
-      (CFG_CMD_ENV|CFG_CMD_NAND))
+#if defined(CFG_ENV_IS_IN_NVRAM) || defined(CFG_ENV_IS_IN_EEPROM) \
+    || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_FLASH)) \
+    || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_NAND))
 int do_saveenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
        extern char * env_name_spec;
@@ -552,7 +550,6 @@ int do_saveenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        return (saveenv() ? 1 : 0);
 }
 
-
 #endif
 
 
@@ -596,20 +593,18 @@ U_BOOT_CMD(
        "    - delete environment variable 'name'\n"
 );
 
-#if defined(CFG_ENV_IS_IN_NVRAM) || defined(CFG_ENV_IS_IN_EEPROM) || \
-    ((CONFIG_COMMANDS & (CFG_CMD_ENV|CFG_CMD_FLASH)) == \
-      (CFG_CMD_ENV|CFG_CMD_FLASH)) || \
-    ((CONFIG_COMMANDS & (CFG_CMD_ENV|CFG_CMD_NAND)) == \
-      (CFG_CMD_ENV|CFG_CMD_NAND))
+#if defined(CFG_ENV_IS_IN_NVRAM) || defined(CFG_ENV_IS_IN_EEPROM) \
+    || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_FLASH)) \
+    || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_NAND))
 U_BOOT_CMD(
        saveenv, 1, 0,  do_saveenv,
        "saveenv - save environment variables to persistent storage\n",
        NULL
 );
 
-#endif /* CFG_CMD_ENV */
+#endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_ASKENV)
+#if defined(CONFIG_CMD_ASKENV)
 
 U_BOOT_CMD(
        askenv, CFG_MAXARGS,    1,      do_askenv,
@@ -624,9 +619,9 @@ U_BOOT_CMD(
        "    - display 'message' string and get environment variable 'name'"
        "from stdin (max 'size' chars)\n"
 );
-#endif /* CFG_CMD_ASKENV */
+#endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_RUN)
+#if defined(CONFIG_CMD_RUN)
 int do_run (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
 U_BOOT_CMD(
        run,    CFG_MAXARGS,    1,      do_run,
@@ -634,4 +629,4 @@ U_BOOT_CMD(
        "var [...]\n"
        "    - run the commands in the environment variable(s) 'var'\n"
 );
-#endif  /* CFG_CMD_RUN */
+#endif
index 45085462fc8d66872e8b3e1f9f8f73a53da32f41..8be6da93f936a4ca6d3353b9f9b3ac6c0041d4de 100644 (file)
@@ -38,7 +38,7 @@
 #include <asm/io.h>
 #include <pci.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_PCI)
+#if defined(CONFIG_CMD_PCI)
 
 extern int cmd_get_data_size(char* arg, int default_size);
 
@@ -565,6 +565,6 @@ U_BOOT_CMD(
        "    - write to CFG address\n"
 );
 
-#endif /* (CONFIG_COMMANDS & CFG_CMD_PCI) */
+#endif
 
 #endif /* CONFIG_PCI */
index b1a594f18be47dd234ba42aa1b7c784d98c3bd90..dcd07c05e57ffbaf9a2f44b5dd2fd99e212a58c2 100644 (file)
@@ -61,7 +61,7 @@
 
 /* -------------------------------------------------------------------- */
 
-#if    (CONFIG_COMMANDS & CFG_CMD_PCMCIA)
+#if defined(CONFIG_CMD_PCMCIA)
 
 extern int pcmcia_on (void);
 extern int pcmcia_off (void);
@@ -93,13 +93,13 @@ U_BOOT_CMD(
                        "pinit off - power off PCMCIA socket\n"
          );
 
-#endif /* CONFIG_COMMANDS & CFG_CMD_PCMCIA */
+#endif
 
 /* -------------------------------------------------------------------- */
 
 #undef CHECK_IDE_DEVICE
 
-#if    (CONFIG_COMMANDS & CFG_CMD_IDE) && defined(CONFIG_IDE_8xx_PCCARD)
+#if defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_8xx_PCCARD)
 #define        CHECK_IDE_DEVICE
 #endif
 
index d2e4c4b50434e1cbe8c6efe98eaf79a7e370bd4b..bfe33e3a8cbd5f0166dcf4bf29fc4fcd568695b9 100644 (file)
@@ -30,7 +30,7 @@
 #include <common.h>
 #include <command.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_PORTIO)
+#if defined(CONFIG_CMD_PORTIO)
 
 extern int cmd_get_data_size (char *arg, int default_size);
 
@@ -166,4 +166,4 @@ U_BOOT_CMD(
        "    - read datum from IO port\n"
 );
 
-#endif /* CFG_CMD_PORTIO */
+#endif
index f428f7e9aa66674cda441c887ce6129cbb04765d..17e9cd9072aa8cfbab4e11c75377db850af3403c 100644 (file)
@@ -32,7 +32,8 @@
 #elif defined (CONFIG_MPC5200)
 #include <mpc5xxx.h>
 #endif
-#if (CONFIG_COMMANDS & CFG_CMD_REGINFO)
+
+#if defined(CONFIG_CMD_REGINFO)
 
 int do_reginfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
@@ -334,14 +335,14 @@ int do_reginfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        return 0;
 }
 
-#endif /* CONFIG_COMMANDS & CFG_CMD_REGINFO */
+#endif
 
 
  /**************************************************/
 
 #if ( defined(CONFIG_8xx)   || defined(CONFIG_405GP) || \
       defined(CONFIG_405EP) || defined(CONFIG_MPC5200)  ) && \
-    (CONFIG_COMMANDS & CFG_CMD_REGINFO)
+    defined(CONFIG_CMD_REGINFO)
 
 U_BOOT_CMD(
        reginfo,        2,      1,      do_reginfo,
index d83c31ab3fe916ce39b32b1892550172eec83f67..1ba392990067ec384ab08d619f87b5b14fcd191a 100644 (file)
@@ -28,7 +28,7 @@
  */
 #include <common.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_REISER)
+#if defined(CONFIG_CMD_REISER)
 #include <config.h>
 #include <command.h>
 #include <image.h>
@@ -240,4 +240,4 @@ U_BOOT_CMD(
        "      to address 'addr' from dos filesystem\n"
 );
 
-#endif /* CONFIG_COMMANDS & CFG_CMD_REISER */
+#endif
index 00b84fad19acf315d260871bf2efac99290fcf16..f56393107faa807623623c6694685b3fdac3716b 100644 (file)
@@ -34,7 +34,7 @@
 #include <image.h>
 #include <pci.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_SCSI)
+#if defined(CONFIG_CMD_SCSI)
 
 #ifdef CONFIG_SCSI_SYM53C8XX
 #define SCSI_VEND_ID   0x1000
@@ -609,4 +609,4 @@ U_BOOT_CMD(
        "loadAddr dev:part\n"
 );
 
-#endif /* #if (CONFIG_COMMANDS & CFG_CMD_SCSI) */
+#endif
index a6fdf7fddbd0924e7d10c0a9171df35ec88b98c9..3118d279b97dcea25658f561b06d6b1bfde7ff29 100644 (file)
@@ -29,7 +29,7 @@
 #include <command.h>
 #include <spi.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_SPI)
+#if defined(CONFIG_CMD_SPI)
 
 /*-----------------------------------------------------------------------
  * Definitions
@@ -140,4 +140,4 @@ U_BOOT_CMD(
        "<dout>    - Hexadecimal string that gets sent\n"
 );
 
-#endif /* CFG_CMD_SPI */
+#endif
index 8d7b6fee125f52fbf8c9c23adbc0a0e159cd128e..8bf0b1f1e28da4d93233a9665fbc63e811ef4cf2 100644 (file)
@@ -28,7 +28,7 @@
 
 #include <universe.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_UNIVERSE)
+#if defined(CONFIG_CMD_UNIVERSE)
 
 #define PCI_VENDOR PCI_VENDOR_ID_TUNDRA
 #define PCI_DEVICE PCI_DEVICE_ID_TUNDRA_CA91C042
@@ -387,4 +387,4 @@ U_BOOT_CMD(
        "                                      03 -> D32 Data Width\n"
 );
 
-#endif /* (CONFIG_COMMANDS & CFG_CMD_UNIVERSE) */
+#endif
index 904df7159f42c7b5960717bcfbd6ad1df80c1ae8..45e07f175c8792b6c5814c776e51207aa1b482f2 100644 (file)
@@ -30,7 +30,7 @@
 #include <asm/byteorder.h>
 #include <part.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_USB)
+#if defined(CONFIG_CMD_USB)
 
 #include <usb.h>
 
@@ -609,10 +609,10 @@ int do_usb (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 }
 
 
-#endif /* (CONFIG_COMMANDS & CFG_CMD_USB) */
+#endif
 
 
-#if (CONFIG_COMMANDS & CFG_CMD_USB)
+#if defined(CONFIG_CMD_USB)
 
 #ifdef CONFIG_USB_STORAGE
 U_BOOT_CMD(
index 5e623a2705377af48f1ee4d2c5d9b0c4b1c550b3..29c349dab9c5d21e59dcb084c15cf7e505803b02 100644 (file)
@@ -35,7 +35,7 @@
 #include <common.h>
 #include <command.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_VFD)
+#if defined(CONFIG_CMD_VFD)
 
 #include <vfd_logo.h>
 #define VFD_TEST_LOGO_BMPNR 0
@@ -73,7 +73,7 @@ U_BOOT_CMD(
        "vfd ADDR\n"
        "    - load bitmap at address ADDR\n"
 );
-#endif /* CFG_CMD_VFD */
+#endif
 
 #ifdef CONFIG_VFD
 int trab_vfd (ulong bitmap)
index 8359153b2b56d78d19cc8649495294696d0f90cd..52e06144963adb737075cd325ef8ff8805e7aa7a 100644 (file)
@@ -24,7 +24,7 @@
  * MA 02111-1307 USA
  */
 
-#if (CONFIG_COMMANDS & CFG_CMD_XIMG)
+#if defined(CONFIG_CMD_XIMG)
 
 /*
  * Multi Image extract
@@ -141,4 +141,4 @@ U_BOOT_CMD(imxtract, 4, 1, do_imgextract,
           "addr part [dest]\n"
           "    - extract <part> from image at <addr> and copy to <dest>\n");
 
-#endif /* CONFIG_COMMANDS & CFG_CMD_XIMG */
+#endif
index e917975a7331d21f6cf02efad21660ac2e060c77..af2f8cbf7b8c163e74dc8530d89c50f67dc82665 100644 (file)
@@ -42,7 +42,7 @@ U_BOOT_CMD(
        NULL
 );
 
-#if (CONFIG_COMMANDS & CFG_CMD_ECHO)
+#if defined(CONFIG_CMD_ECHO)
 
 int
 do_echo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
@@ -76,7 +76,7 @@ U_BOOT_CMD(
        "    - echo args to console; \\c suppresses newline\n"
 );
 
-#endif /*  CFG_CMD_ECHO */
+#endif
 
 #ifdef CFG_HUSH_PARSER
 
@@ -409,7 +409,7 @@ void install_auto_complete(void)
 {
        install_auto_complete_handler("printenv", var_complete);
        install_auto_complete_handler("setenv", var_complete);
-#if (CONFIG_COMMANDS & CFG_CMD_RUN)
+#if defined(CONFIG_CMD_RUN)
        install_auto_complete_handler("run", var_complete);
 #endif
 }
index 79adb48958e8a13affa8497582cf1968874541c5..5daa6fc4054854ebd2b1ac456c084c5e0e223fca 100644 (file)
@@ -31,7 +31,7 @@
 #undef ECC_DEBUG
 #undef PSYCHO_DEBUG
 
-#if (CONFIG_COMMANDS & CFG_CMD_DOC)
+#if defined(CONFIG_CMD_DOC)
 
 #include <linux/mtd/doc2000.h>
 
@@ -514,4 +514,4 @@ int doc_decode_ecc(unsigned char sector[SECTOR_SIZE], unsigned char ecc1[6])
     return nb_errors;
 }
 
-#endif /* (CONFIG_COMMANDS & CFG_CMD_DOC) */
+#endif
index 1674b30e118d57c60d1a44684138555417fe34b6..7a37e550deb8f90bff6518bebbf3666e079dcf4f 100644 (file)
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#if ((CONFIG_COMMANDS&(CFG_CMD_ENV|CFG_CMD_FLASH)) == (CFG_CMD_ENV|CFG_CMD_FLASH))
+#if defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_FLASH)
 #define CMD_SAVEENV
 #elif defined(CFG_ENV_ADDR_REDUND)
-#error Cannot use CFG_ENV_ADDR_REDUND without CFG_CMD_ENV & CFG_CMD_FLASH
+#error Cannot use CFG_ENV_ADDR_REDUND without CONFIG_CMD_ENV & CONFIG_CMD_FLASH
 #endif
 
 #if defined(CFG_ENV_SIZE_REDUND) && (CFG_ENV_SIZE_REDUND < CFG_ENV_SIZE)
index 67c4a4e011761b92b92f291714cf9af4181696d3..38a07f8993f7ab1226044ed2497f05788ee9bfc5 100644 (file)
 #include <malloc.h>
 #include <nand.h>
 
-#if ((CONFIG_COMMANDS&(CFG_CMD_ENV|CFG_CMD_NAND)) == (CFG_CMD_ENV|CFG_CMD_NAND))
+#if defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_NAND)
 #define CMD_SAVEENV
 #elif defined(CFG_ENV_OFFSET_REDUND)
-#error Cannot use CFG_ENV_OFFSET_REDUND without CFG_CMD_ENV & CFG_CMD_NAND
+#error Cannot use CFG_ENV_OFFSET_REDUND without CONFIG_CMD_ENV & CONFIG_CMD_NAND
 #endif
 
 #if defined(CFG_ENV_SIZE_REDUND) && (CFG_ENV_SIZE_REDUND != CFG_ENV_SIZE)
index 0cb4396ea4ae0a73e781729fe0c267bc40e7bc24..ec4656bfbd172116be925a860cccb84d1c23ca77 100644 (file)
@@ -28,12 +28,14 @@ void jumptable_init (void)
        gd->jt[XF_get_timer] = (void *) get_timer;
        gd->jt[XF_simple_strtoul] = (void *) simple_strtoul;
        gd->jt[XF_udelay] = (void *) udelay;
+       gd->jt[XF_simple_strtol] = (void *) simple_strtol;
+       gd->jt[XF_strcmp] = (void *) strcmp;
 #if defined(CONFIG_I386) || defined(CONFIG_PPC)
        gd->jt[XF_install_hdlr] = (void *) irq_install_handler;
        gd->jt[XF_free_hdlr] = (void *) irq_free_handler;
 #endif /* I386 || PPC */
-#if (CONFIG_COMMANDS & CFG_CMD_I2C)
+#if defined(CONFIG_CMD_I2C)
        gd->jt[XF_i2c_write] = (void *) i2c_write;
        gd->jt[XF_i2c_read] = (void *) i2c_read;
-#endif /* CFG_CMD_I2C */
+#endif
 }
index feb5627ff2eef282b16312cbccca13b208b7ed96..582635c04c70621b2c94b3b1265e201f8d172313 100644 (file)
@@ -1682,7 +1682,7 @@ static int run_pipe_real(struct pipe *pi)
                                return -1;      /* give up after bad command */
                        } else {
                                int rcode;
-#if (CONFIG_COMMANDS & CFG_CMD_BOOTD)
+#if defined(CONFIG_CMD_BOOTD)
            extern int do_bootd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
 
                                /* avoid "bootd" recursion */
@@ -1694,7 +1694,7 @@ static int run_pipe_real(struct pipe *pi)
                                else
                                        flag |= CMD_FLAG_BOOTD;
                                }
-#endif /* CFG_CMD_BOOTD */
+#endif
                                /* found - check max args */
                                if ((child->argc - i) > cmdtp->maxargs) {
                                        printf ("Usage:\n%s\n", cmdtp->usage);
index 6de6ec99a22273c4ff8fd7ac515fcf42cff6ac85..1d346699a56ecfaafececc42a0d4813cca7351da 100644 (file)
@@ -92,7 +92,7 @@
 #include <kgdb.h>
 #include <command.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 
 #undef KGDB_DEBUG
 
@@ -591,4 +591,4 @@ U_BOOT_CMD(
 
 int kgdb_not_configured = 1;
 
-#endif /* CFG_CMD_KGDB */
+#endif
index eaed2abd80563d6fa6958d25b61dfeccd39dc551..914dc2ef7ca5b1f30d1238317213e32650c9018d 100644 (file)
@@ -571,7 +571,7 @@ void bitmap_plot (int x, int y)
 #endif /* CONFIG_LCD_LOGO */
 
 /*----------------------------------------------------------------------*/
-#if (CONFIG_COMMANDS & CFG_CMD_BMP) || defined(CONFIG_SPLASH_SCREEN)
+#if defined(CONFIG_CMD_BMP) || defined(CONFIG_SPLASH_SCREEN)
 /*
  * Display the BMP file located at address bmp_image.
  * Only uncompressed.
@@ -700,7 +700,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
 
        return (0);
 }
-#endif /* (CONFIG_COMMANDS & CFG_CMD_BMP) || CONFIG_SPLASH_SCREEN */
+#endif
 
 
 static void *lcd_logo (void)
index 000686d85a9a833a8521d896c1bef294f7fd642a..379695cc426b8c496c18b9b10295d0970c3a9690 100644 (file)
@@ -1317,7 +1317,7 @@ int run_command (const char *cmd, int flag)
                        continue;
                }
 
-#if (CONFIG_COMMANDS & CFG_CMD_BOOTD)
+#if defined(CONFIG_CMD_BOOTD)
                /* avoid "bootd" recursion */
                if (cmdtp->cmd == do_bootd) {
 #ifdef DEBUG_PARSER
@@ -1331,7 +1331,7 @@ int run_command (const char *cmd, int flag)
                                flag |= CMD_FLAG_BOOTD;
                        }
                }
-#endif /* CFG_CMD_BOOTD */
+#endif
 
                /* OK - call function to do the command */
                if ((cmdtp->cmd) (cmdtp, flag, argc, argv) != 0) {
@@ -1350,7 +1350,7 @@ int run_command (const char *cmd, int flag)
 
 /****************************************************************************/
 
-#if (CONFIG_COMMANDS & CFG_CMD_RUN)
+#if defined(CONFIG_CMD_RUN)
 int do_run (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 {
        int i;
@@ -1378,4 +1378,4 @@ int do_run (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
        }
        return 0;
 }
-#endif /* CFG_CMD_RUN */
+#endif
index e411e573c7b2bf1248b5759518e6bf40f0942379..c69501fedfb9a77150a4a9b7265d85d8465f24a5 100644 (file)
@@ -29,7 +29,7 @@
 #include <common.h>
 #include <miiphy.h>
 
-#if defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII)
+#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
 #include <asm/types.h>
 #include <linux/list.h>
 #include <malloc.h>
@@ -470,4 +470,4 @@ int miiphy_link (char *devname, unsigned char addr)
 }
 #endif
 
-#endif /* CONFIG_MII || (CONFIG_COMMANDS & CFG_CMD_MII) */
+#endif /* CONFIG_MII */
index 0857494b27b974c442b07d96b4f30c46d8d0c54b..933afa9e7bc32f8346fdad5b62732907887e82e0 100644 (file)
@@ -49,7 +49,7 @@
 #include <asm/processor.h>
 #include <linux/ctype.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_USB)
+#if defined(CONFIG_CMD_USB)
 
 #include <usb.h>
 #ifdef CONFIG_4xx
@@ -1247,6 +1247,6 @@ int usb_hub_probe(struct usb_device *dev, int ifnum)
        return ret;
 }
 
-#endif /* (CONFIG_COMMANDS & CFG_CMD_USB) */
+#endif
 
 /* EOF */
index 196ceb735934289255047991a41a4942798a93be..0f79f367c90b213bf1187cc1c43b278e6197353c 100644 (file)
@@ -55,7 +55,7 @@
 #include <asm/processor.h>
 
 
-#if (CONFIG_COMMANDS & CFG_CMD_USB)
+#if defined(CONFIG_CMD_USB)
 #include <part.h>
 #include <usb.h>
 
@@ -1249,4 +1249,4 @@ int usb_stor_get_info(struct usb_device *dev,struct us_data *ss,block_dev_desc_t
 }
 
 #endif /* CONFIG_USB_STORAGE */
-#endif /* CFG_CMD_USB */
+#endif
index e838513c1df1e159e353140db56398e88bb59a25..4f231228c2285950ed4f2df46f99ec01111bcc7f 100644 (file)
@@ -31,7 +31,7 @@
 #include <asm/cache.h>
 #include <asm/mmu.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 
  /*
  * cache flushing routines for kgdb
@@ -74,4 +74,4 @@ kgdb_flush_cache_range:
        SYNC
        blr
 
-#endif /* CFG_CMD_KGDB */
+#endif
index 50c5eeb4835802635bf1e0eec0fe880e2bfe0171..b06622769699e66fdc45b36639fb4d9bd9424863 100644 (file)
@@ -40,7 +40,7 @@
 DECLARE_GLOBAL_DATA_PTR;
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 int (*debugger_exception_handler)(struct pt_regs *) = 0;
 #endif
 
@@ -133,7 +133,7 @@ MachineCheckException(struct pt_regs *regs)
                return;
        }
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        if (debugger_exception_handler && (*debugger_exception_handler)(regs))
                return;
 #endif
@@ -166,7 +166,7 @@ MachineCheckException(struct pt_regs *regs)
 void
 AlignmentException(struct pt_regs *regs)
 {
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        if (debugger_exception_handler && (*debugger_exception_handler)(regs))
                return;
 #endif
@@ -181,7 +181,7 @@ ProgramCheckException(struct pt_regs *regs)
        unsigned char *p = regs ? (unsigned char *)(regs->nip) : NULL;
        int i, j;
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        if (debugger_exception_handler && (*debugger_exception_handler)(regs))
                return;
 #endif
@@ -204,7 +204,7 @@ ProgramCheckException(struct pt_regs *regs)
 void
 SoftEmuException(struct pt_regs *regs)
 {
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        if (debugger_exception_handler && (*debugger_exception_handler)(regs))
                return;
 #endif
@@ -217,7 +217,7 @@ SoftEmuException(struct pt_regs *regs)
 void
 UnknownException(struct pt_regs *regs)
 {
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        if (debugger_exception_handler && (*debugger_exception_handler)(regs))
                return;
 #endif
index 6db143562c89406fde77ee1ee09a035410e5a048..b52c615864c8739cb7acddac2b843bcfcf41ac8b 100644 (file)
@@ -32,7 +32,7 @@
 
 #ifdef CONFIG_DRIVER_ETHER
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
 
 /*
  * Name:
@@ -227,6 +227,6 @@ unsigned char bcm5221_AutoNegotiate (AT91PS_EMAC p_mac, int *status)
        return FALSE;
 }
 
-#endif /* CONFIG_COMMANDS & CFG_CMD_NET */
+#endif
 
 #endif /* CONFIG_DRIVER_ETHER */
index 4b13c237c7044ccc21475faf51f5b8f9c8269060..968f653081fc60fe856dce137cceedec3ebebb3e 100644 (file)
@@ -27,7 +27,7 @@
 
 #ifdef CONFIG_DRIVER_ETHER
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
 
 /*
  * Name:
@@ -220,6 +220,6 @@ UCHAR dm9161_AutoNegotiate (AT91PS_EMAC p_mac, int *status)
        return FALSE;
 }
 
-#endif /* CONFIG_COMMANDS & CFG_CMD_NET */
+#endif
 
 #endif /* CONFIG_DRIVER_ETHER */
index 67008d0b9112ece297408d2f5000b164a45e4ec1..c8f56aa52de37e1935e79e5d4119ef280b03d9dc 100644 (file)
@@ -50,7 +50,7 @@ typedef struct {
 
 #ifdef CONFIG_DRIVER_ETHER
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
 
 /* alignment as per Errata #11 (64 bytes) is insufficient! */
 rbf_t rbfdt[RBF_FRAMEMAX] __attribute((aligned(512)));
@@ -265,7 +265,7 @@ void eth_halt (void)
 {
 };
 
-#if defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII)
+#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
 int  at91rm9200_miiphy_read(char *devname, unsigned char addr,
                unsigned char reg, unsigned short * value)
 {
@@ -284,16 +284,16 @@ int  at91rm9200_miiphy_write(char *devname, unsigned char addr,
        return 0;
 }
 
-#endif /* defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII) */
+#endif
 
 int at91rm9200_miiphy_initialize(bd_t *bis)
 {
-#if defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII)
+#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
        miiphy_register("at91rm9200phy", at91rm9200_miiphy_read, at91rm9200_miiphy_write);
 #endif
        return 0;
 }
 
-#endif /* CONFIG_COMMANDS & CFG_CMD_NET */
+#endif
 
 #endif /* CONFIG_DRIVER_ETHER */
index f12c59c158d6f4e9d97781316f81be5af450f9da..4edcc9a1b9da8a398fdb914d1934522d128010a0 100644 (file)
@@ -33,7 +33,7 @@
 
 #ifdef CONFIG_DRIVER_ETHER
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
 
 /*
  * Name:
@@ -186,6 +186,6 @@ UCHAR lxt972_AutoNegotiate (AT91PS_EMAC p_mac, int *status)
        return (lxt972_GetLinkSpeed (p_mac));
 }
 
-#endif /* CONFIG_COMMANDS & CFG_CMD_NET */
+#endif
 
 #endif /* CONFIG_DRIVER_ETHER */
index e7299a7ebb0ea1d44955edcfa591633690935e6d..baf35e53d57db02cdb1b9a804aedde048d4a8311 100644 (file)
@@ -394,7 +394,7 @@ int serial_buffered_tstc(void)
 #endif /* CONFIG_SERIAL_SOFTWARE_FIFO */
 
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 /*
   AS HARNOIS : according to CONFIG_KGDB_SER_INDEX kgdb uses serial port
   number 0 or number 1
@@ -500,4 +500,4 @@ void kgdb_interruptible(int yes)
        return;
 }
 #endif /* (CONFIG_KGDB_SER_INDEX & 2) */
-#endif /* CFG_CMD_KGDB */
+#endif
index 7f9f3344b3f17d1f7e7e1a76140ff4a26eb677b2..2c7d5a01be7ec25b6482e191bdbe216c41017875 100644 (file)
@@ -85,7 +85,7 @@ int cpu_init (void)
        FIQ_STACK_START = IRQ_STACK_START - CONFIG_STACKSIZE_IRQ;
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_PCI) || defined (CONFIG_PCI)
+#if defined(CONFIG_CMD_PCI) || defined (CONFIG_PCI)
        pci_init();
 #endif
        return 0;
index ab7ca8bef04414b36c75e4d096b6bdb35683432f..7e4af441054bb1c3c44c81530b36a0f58bbc3c1b 100644 (file)
@@ -682,7 +682,7 @@ int npe_initialize(bd_t * bis)
 
                eth_register(dev);
 
-#if defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII)
+#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
                miiphy_register(dev->name, npe_miiphy_read, npe_miiphy_write);
 #endif
 
index b6540b55af69a3190541adc616ac4c6a27b4f1b1..ef9c7984ca32a176fcca6d493bb77aa8e9730063 100644 (file)
@@ -53,7 +53,7 @@
 #undef ET_DEBUG
 #undef MII_DEBUG
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET) && defined(FEC_ENET)
+#if defined(CONFIG_CMD_NET) && defined(FEC_ENET)
 
 #ifdef CFG_DISCOVER_PHY
 #include <miiphy.h>
@@ -363,7 +363,7 @@ void eth_halt (void)
 }
 
 
-#if defined(CFG_DISCOVER_PHY) || (CONFIG_COMMANDS & CFG_CMD_MII)
+#if defined(CFG_DISCOVER_PHY) || defined(CONFIG_CMD_MII)
 
 static int phyaddr = -1;       /* didn't find a PHY yet */
 static uint phytype;
@@ -419,7 +419,7 @@ static uint mii_send (uint mii_cmd)
 #endif
        return (mii_reply & 0xffff);    /* data read from phy */
 }
-#endif /* CFG_DISCOVER_PHY || (CONFIG_COMMANDS & CFG_CMD_MII) */
+#endif
 
 #if defined(CFG_DISCOVER_PHY)
 static void mii_discover_phy (void)
@@ -485,7 +485,7 @@ static void mii_discover_phy (void)
 }
 #endif /* CFG_DISCOVER_PHY */
 
-#if (CONFIG_COMMANDS & CFG_CMD_MII) && !defined(CONFIG_BITBANGMII)
+#if defined(CONFIG_CMD_MII) && !defined(CONFIG_BITBANGMII)
 
 static int mii_init_done = 0;
 
@@ -591,13 +591,13 @@ int mcf52x2_miiphy_write (char *devname, unsigned char addr,
 
        return 0;
 }
-#endif /* (CONFIG_COMMANDS & CFG_CMD_MII) && !defined(CONFIG_BITBANGMII) */
-#endif /* CFG_CMD_NET, FEC_ENET */
+#endif
+#endif
 
 int mcf52x2_miiphy_initialize(bd_t *bis)
 {
-#if (CONFIG_COMMANDS & CFG_CMD_NET) && defined(FEC_ENET)
-#if (CONFIG_COMMANDS & CFG_CMD_MII) && !defined(CONFIG_BITBANGMII)
+#if defined(CONFIG_CMD_NET) && defined(FEC_ENET)
+#if defined(CONFIG_CMD_MII) && !defined(CONFIG_BITBANGMII)
        miiphy_register("mcf52x2phy", mcf52x2_miiphy_read, mcf52x2_miiphy_write);
 #endif
 #endif
index 2f86a5440c6a90b38d1f04593cfc363dbd09a323..4b7866fae50721a705f2eb8ca7a62ca0e369844d 100644 (file)
@@ -25,7 +25,7 @@
 #include <common.h>
 #include <asm/asm.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_CACHE)
+#if defined(CONFIG_CMD_CACHE)
 
 int dcache_status (void)
 {
index b61153f8e6f596ed315dae852c8e1abf53a563b8..3f04b29983817fad2309aa3953bda182143c6115 100644 (file)
@@ -190,7 +190,7 @@ void interrupt_handler (void)
 }
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_IRQ)
+#if defined(CONFIG_CMD_IRQ)
 #ifdef CFG_INTC_0
 int do_irqinfo (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 {
@@ -217,4 +217,4 @@ int do_irqinfo (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
        puts ("Undefined interrupt controller\n");
 }
 #endif
-#endif                         /* CONFIG_COMMANDS & CFG_CMD_IRQ */
+#endif
index 078e8328b625d4262632f3a2c9803775dfc7dffe..b69741ae6833f9b40fabf06e26d56b54ee272497 100644 (file)
@@ -63,7 +63,7 @@
 #include <asm/io.h>
 #include <asm/au1x00.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_MII)
+#if defined(CONFIG_CMD_MII)
 #include <miiphy.h>
 #endif
 
@@ -241,7 +241,7 @@ int au1x00_enet_initialize(bd_t *bis){
 
        eth_register(dev);
 
-#if (CONFIG_COMMANDS & CFG_CMD_MII)
+#if defined(CONFIG_CMD_MII)
        miiphy_register(dev->name,
                au1x00_miiphy_read, au1x00_miiphy_write);
 #endif
@@ -249,7 +249,7 @@ int au1x00_enet_initialize(bd_t *bis){
        return 1;
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_MII)
+#if defined(CONFIG_CMD_MII)
 int  au1x00_miiphy_read(char *devname, unsigned char addr,
                unsigned char reg, unsigned short * value)
 {
@@ -306,6 +306,6 @@ int  au1x00_miiphy_write(char *devname, unsigned char addr,
        *mii_control_reg = mii_control;
        return 0;
 }
-#endif /* CONFIG_COMMANDS & CFG_CMD_MII */
+#endif
 
 #endif /* CONFIG_AU1X00 */
index 5b26a76b3e8f4530d48fc13c89dea67a6bd80941..e95b8a1a85514a062eb127b43aed697d56334ecc 100644 (file)
@@ -28,6 +28,9 @@
 #
 
 
-PLATFORM_RELFLAGS +=   -fPIC -ffixed-r14 -meabi
+PLATFORM_RELFLAGS +=   -fPIC -ffixed-r14 -meabi -mrelocatable
 
 PLATFORM_CPPFLAGS +=   -DCONFIG_5xx -ffixed-r2 -ffixed-r29 -mpowerpc -msoft-float
+
+# Use default linker script.  Board port can override in board/*/config.mk
+LDSCRIPT := $(SRCTREE)/cpu/mpc5xx/u-boot.lds
index 7f6e1363e7402e18a360ebcc27cc6ee1aee780d9..a4f47c74b5d6f3b9ed98375251aa14ff7b21e0eb 100644 (file)
@@ -178,7 +178,7 @@ void timer_interrupt_cpu (struct pt_regs *regs)
        return;
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_IRQ)
+#if defined(CONFIG_CMD_IRQ)
 /*******************************************************************************
  *
  * irqinfo - print information about IRQs
@@ -204,4 +204,4 @@ int do_irqinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 }
 
 
-#endif  /* CONFIG_COMMANDS & CFG_CMD_IRQ */
+#endif
index 14fd59e4fad9eeae44632565296f86983856990b..d22b89a1f52563de7e2c4d54ea0b1c558d6a602f 100644 (file)
 #include <command.h>
 #include <asm/processor.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 int (*debugger_exception_handler)(struct pt_regs *) = 0;
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_BEDBUG)
+#if defined(CONFIG_CMD_BEDBUG)
 extern void do_bedbug_breakpoint(struct pt_regs *);
 #endif
 
@@ -131,7 +131,7 @@ void MachineCheckException(struct pt_regs *regs)
                return;
        }
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        if (debugger_exception_handler && (*debugger_exception_handler)(regs))
                return;
 #endif
@@ -165,7 +165,7 @@ void MachineCheckException(struct pt_regs *regs)
  */
 void AlignmentException(struct pt_regs *regs)
 {
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        if (debugger_exception_handler && (*debugger_exception_handler)(regs))
                return;
 #endif
@@ -179,7 +179,7 @@ void AlignmentException(struct pt_regs *regs)
  */
 void ProgramCheckException(struct pt_regs *regs)
 {
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        if (debugger_exception_handler && (*debugger_exception_handler)(regs))
                return;
 #endif
@@ -193,7 +193,7 @@ void ProgramCheckException(struct pt_regs *regs)
  */
 void SoftEmuException(struct pt_regs *regs)
 {
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        if (debugger_exception_handler && (*debugger_exception_handler)(regs))
                return;
 #endif
@@ -208,7 +208,7 @@ void SoftEmuException(struct pt_regs *regs)
  */
 void UnknownException(struct pt_regs *regs)
 {
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        if (debugger_exception_handler && (*debugger_exception_handler)(regs))
                return;
 #endif
@@ -224,7 +224,7 @@ void DebugException(struct pt_regs *regs)
 {
        printf("Debugger trap at @ %lx\n", regs->nip );
        show_regs(regs);
-#if (CONFIG_COMMANDS & CFG_CMD_BEDBUG)
+#if defined(CONFIG_CMD_BEDBUG)
        do_bedbug_breakpoint( regs );
 #endif
 }
diff --git a/cpu/mpc5xx/u-boot.lds b/cpu/mpc5xx/u-boot.lds
new file mode 100644 (file)
index 0000000..10001b1
--- /dev/null
@@ -0,0 +1,139 @@
+/*
+ * (C) Copyright 2001  Wolfgang Denk, DENX Software Engineering, wd@denx.de
+ * (C) Copyright 2003  Martin Winistoerfer, martinwinistoerfer@gmx.ch
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+OUTPUT_ARCH(powerpc)
+SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
+/* Do we need any of these for elf?
+   __DYNAMIC = 0;    */
+SECTIONS
+{
+  /* Read-only sections, merged into text segment: */
+  . = + SIZEOF_HEADERS;
+  .interp : { *(.interp) }
+  .hash          : { *(.hash)          }
+  .dynsym        : { *(.dynsym)                }
+  .dynstr        : { *(.dynstr)                }
+  .rel.text      : { *(.rel.text)              }
+  .rela.text     : { *(.rela.text)     }
+  .rel.data      : { *(.rel.data)              }
+  .rela.data     : { *(.rela.data)     }
+  .rel.rodata    : { *(.rel.rodata)    }
+  .rela.rodata   : { *(.rela.rodata)   }
+  .rel.got       : { *(.rel.got)               }
+  .rela.got      : { *(.rela.got)              }
+  .rel.ctors     : { *(.rel.ctors)     }
+  .rela.ctors    : { *(.rela.ctors)    }
+  .rel.dtors     : { *(.rel.dtors)     }
+  .rela.dtors    : { *(.rela.dtors)    }
+  .rel.bss       : { *(.rel.bss)               }
+  .rela.bss      : { *(.rela.bss)              }
+  .rel.plt       : { *(.rel.plt)               }
+  .rela.plt      : { *(.rela.plt)              }
+  .init          : { *(.init)  }
+  .plt : { *(.plt) }
+  .text      :
+  {
+    /* WARNING - the following is hand-optimized to fit within */
+    /* the sector layout of our flash chips!   XXX FIXME XXX   */
+
+    cpu/mpc5xx/start.o (.text)
+
+    *(.text)
+    *(.got1)
+  }
+  _etext = .;
+  PROVIDE (etext = .);
+  .rodata    :
+  {
+    *(.rodata)
+    *(.rodata1)
+    *(.rodata.str1.4)
+    *(.eh_frame)
+  }
+  .fini      : { *(.fini)    } =0
+  .ctors     : { *(.ctors)   }
+  .dtors     : { *(.dtors)   }
+
+  /* Read-write section, merged into data segment: */
+  . = (. + 0x00FF) & 0xFFFFFF00;
+  _erotext = .;
+  PROVIDE (erotext = .);
+  .reloc   :
+  {
+    *(.got)
+    _GOT2_TABLE_ = .;
+    *(.got2)
+    _FIXUP_TABLE_ = .;
+    *(.fixup)
+  }
+  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __fixup_entries = (. - _FIXUP_TABLE_)>>2;
+
+  .data    :
+  {
+    *(.data)
+    *(.data1)
+    *(.sdata)
+    *(.sdata2)
+    *(.dynamic)
+    CONSTRUCTORS
+  }
+  _edata  =  .;
+  PROVIDE (edata = .);
+
+  . = .;
+  __u_boot_cmd_start = .;
+  .u_boot_cmd : { *(.u_boot_cmd) }
+  __u_boot_cmd_end = .;
+
+
+  . = .;
+  __start___ex_table = .;
+  __ex_table : { *(__ex_table) }
+  __stop___ex_table = .;
+
+  . = ALIGN(256);
+  __init_begin = .;
+  .text.init : { *(.text.init) }
+  .data.init : { *(.data.init) }
+  . = ALIGN(256);
+  __init_end = .;
+
+  __bss_start = .;
+  .bss       :
+  {
+   *(.sbss) *(.scommon)
+   *(.dynbss)
+   *(.bss)
+   *(COMMON)
+  }
+
+  _end = . ;
+  PROVIDE (end = .);
+/*   . = env_start;
+       .ppcenv :
+       {
+               common/environment.o (.ppcenv)
+       }
+*/
+}
index ecd94e9b34a2783e2599f8358a963fac950d65c7..0e861c4a0f8280679d9b96070279304378a11183 100644 (file)
 # MA 02111-1307 USA
 #
 
-PLATFORM_RELFLAGS += -fPIC -ffixed-r14 -meabi
+PLATFORM_RELFLAGS += -fPIC -ffixed-r14 -meabi -mrelocatable
 
 PLATFORM_CPPFLAGS += -DCONFIG_MPC5xxx -ffixed-r2 -ffixed-r29 \
                     -mstring -mcpu=603e -mmultiple
+
+# Use default linker script.  Board port can override in board/*/config.mk
+LDSCRIPT := $(SRCTREE)/cpu/mpc5xxx/u-boot.lds
index d7440308a45802bbb879c9141ce835c46eb0314a..bc6201ec0ac1abf9a2723fe1bf991fc9666b4a52 100644 (file)
@@ -198,7 +198,7 @@ int cpu_init_r (void)
        /* route critical ints to normal ints */
        *(vu_long *)MPC5XXX_ICTL_EXT |= 0x00000001;
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET) && defined(CONFIG_MPC5xxx_FEC)
+#if defined(CONFIG_CMD_NET) && defined(CONFIG_MPC5xxx_FEC)
        /* load FEC microcode */
        loadtask(0, 2);
 #endif
index 3d99d5c1ec66973f4a77842bded5c21cfcbc77cd..1d3da779a721534f71265ae8031a2bb79b38245b 100644 (file)
@@ -18,10 +18,10 @@ DECLARE_GLOBAL_DATA_PTR;
 
 /* #define DEBUG       0x28 */
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET) && defined(CONFIG_NET_MULTI) && \
+#if defined(CONFIG_CMD_NET) && defined(CONFIG_NET_MULTI) && \
        defined(CONFIG_MPC5xxx_FEC)
 
-#if !(defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII))
+#if !(defined(CONFIG_MII) || defined(CONFIG_CMD_MII))
 #error "CONFIG_MII has to be defined!"
 #endif
 
@@ -890,7 +890,7 @@ int mpc5xxx_fec_initialize(bd_t * bis)
        fec->tbdBase = (FEC_TBD *)FEC_BD_BASE;
        fec->rbdBase = (FEC_RBD *)(FEC_BD_BASE + FEC_TBD_NUM * sizeof(FEC_TBD));
 #if defined(CONFIG_CANMB)              || \
-       defined(CONFIG_CM1_QP1)         || \
+       defined(CONFIG_CM5200)          || \
        defined(CONFIG_HMI1001)         || \
        defined(CONFIG_ICECUBE)         || \
        defined(CONFIG_INKA4X0)         || \
@@ -924,7 +924,7 @@ int mpc5xxx_fec_initialize(bd_t * bis)
        sprintf(dev->name, "FEC ETHERNET");
        eth_register(dev);
 
-#if defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII)
+#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
        miiphy_register (dev->name,
                        fec5xxx_miiphy_read, fec5xxx_miiphy_write);
 #endif
index 29b99f6b15ddada936f3b3226dfdddf0e2d5098d..087ddac109dbef5d108a8a09e3b22cb9a153dd3f 100644 (file)
@@ -24,7 +24,7 @@
  */
 #include <common.h>
 
-#ifdef CFG_CMD_IDE
+#if defined(CONFIG_CMD_IDE)
 #include <mpc5xxx.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -85,4 +85,4 @@ int ide_preinit (void)
 
        return (0);
 }
-#endif /* CFG_CMD_IDE */
+#endif
index beeb222636ee82c454361ebdc74c0f3e584e5b57..8816dd1e2dc4fccf6c378411ff8c81238b6ede15 100644 (file)
@@ -310,7 +310,7 @@ void irq_free_handler(int irq)
 
 /****************************************************************************/
 
-#if (CONFIG_COMMANDS & CFG_CMD_IRQ)
+#if defined(CONFIG_CMD_IRQ)
 void do_irqinfo(cmd_tbl_t * cmdtp, bd_t * bd, int flag, int argc, char *argv[])
 {
        int irq, re_enable;
index 2ee782b9c86b3f4b2c641638f8e21df5cbd9944d..daa1ec6b58910674408fdc437768bbba38da2d51 100644 (file)
@@ -37,7 +37,7 @@
 #include <command.h>
 #include <asm/processor.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 int (*debugger_exception_handler)(struct pt_regs *) = 0;
 #endif
 
@@ -123,7 +123,7 @@ MachineCheckException(struct pt_regs *regs)
                return;
        }
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        if (debugger_exception_handler && (*debugger_exception_handler)(regs))
                return;
 #endif
@@ -158,7 +158,7 @@ MachineCheckException(struct pt_regs *regs)
 void
 AlignmentException(struct pt_regs *regs)
 {
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        if (debugger_exception_handler && (*debugger_exception_handler)(regs))
                return;
 #endif
@@ -170,7 +170,7 @@ AlignmentException(struct pt_regs *regs)
 void
 ProgramCheckException(struct pt_regs *regs)
 {
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        if (debugger_exception_handler && (*debugger_exception_handler)(regs))
                return;
 #endif
@@ -182,7 +182,7 @@ ProgramCheckException(struct pt_regs *regs)
 void
 SoftEmuException(struct pt_regs *regs)
 {
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        if (debugger_exception_handler && (*debugger_exception_handler)(regs))
                return;
 #endif
@@ -195,7 +195,7 @@ SoftEmuException(struct pt_regs *regs)
 void
 UnknownException(struct pt_regs *regs)
 {
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        if (debugger_exception_handler && (*debugger_exception_handler)(regs))
                return;
 #endif
@@ -204,7 +204,7 @@ UnknownException(struct pt_regs *regs)
        _exception(0, regs);
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_BEDBUG)
+#if defined(CONFIG_CMD_BEDBUG)
 extern void do_bedbug_breakpoint(struct pt_regs *);
 #endif
 
@@ -214,7 +214,7 @@ DebugException(struct pt_regs *regs)
 
   printf("Debugger trap at @ %lx\n", regs->nip );
   show_regs(regs);
-#if (CONFIG_COMMANDS & CFG_CMD_BEDBUG)
+#if defined(CONFIG_CMD_BEDBUG)
   do_bedbug_breakpoint( regs );
 #endif
 }
diff --git a/cpu/mpc5xxx/u-boot-customlayout.lds b/cpu/mpc5xxx/u-boot-customlayout.lds
new file mode 100644 (file)
index 0000000..1107943
--- /dev/null
@@ -0,0 +1,135 @@
+/*
+ * (C) Copyright 2003-2004
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+OUTPUT_ARCH(powerpc)
+SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
+/* Do we need any of these for elf?
+   __DYNAMIC = 0;    */
+SECTIONS
+{
+  /* Read-only sections, merged into text segment: */
+  . = + SIZEOF_HEADERS;
+  .interp : { *(.interp) }
+  .hash          : { *(.hash)          }
+  .dynsym        : { *(.dynsym)                }
+  .dynstr        : { *(.dynstr)                }
+  .rel.text      : { *(.rel.text)              }
+  .rela.text     : { *(.rela.text)     }
+  .rel.data      : { *(.rel.data)              }
+  .rela.data     : { *(.rela.data)     }
+  .rel.rodata    : { *(.rel.rodata)    }
+  .rela.rodata   : { *(.rela.rodata)   }
+  .rel.got       : { *(.rel.got)               }
+  .rela.got      : { *(.rela.got)              }
+  .rel.ctors     : { *(.rel.ctors)     }
+  .rela.ctors    : { *(.rela.ctors)    }
+  .rel.dtors     : { *(.rel.dtors)     }
+  .rela.dtors    : { *(.rela.dtors)    }
+  .rel.bss       : { *(.rel.bss)               }
+  .rela.bss      : { *(.rela.bss)              }
+  .rel.plt       : { *(.rel.plt)               }
+  .rela.plt      : { *(.rela.plt)              }
+  .init          : { *(.init)  }
+  .plt : { *(.plt) }
+  .text      :
+  {
+    /* WARNING - the following is hand-optimized to fit within  */
+    /* the sector layout of our flash chips!    XXX FIXME XXX   */
+
+    cpu/mpc5xxx/start.o          (.text)
+    cpu/mpc5xxx/traps.o          (.text)
+    lib_generic/crc32.o         (.text)
+    lib_ppc/cache.o             (.text)
+    lib_ppc/time.o              (.text)
+
+    . = DEFINED(env_offset) ? env_offset : .;
+    common/environment.o        (.ppcenv)
+
+    *(.text)
+    *(.got1)
+    . = ALIGN(16);
+    *(.rodata)
+    *(.rodata1)
+    *(.rodata.str1.4)
+    *(.eh_frame)
+  }
+  .fini      : { *(.fini)    } =0
+  .ctors     : { *(.ctors)   }
+  .dtors     : { *(.dtors)   }
+
+  /* Read-write section, merged into data segment: */
+  . = (. + 0x0FFF) & 0xFFFFF000;
+  _erotext = .;
+  PROVIDE (erotext = .);
+  .reloc   :
+  {
+    *(.got)
+    _GOT2_TABLE_ = .;
+    *(.got2)
+    _FIXUP_TABLE_ = .;
+    *(.fixup)
+  }
+  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
+  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
+
+  .data    :
+  {
+    *(.data)
+    *(.data1)
+    *(.sdata)
+    *(.sdata2)
+    *(.dynamic)
+    CONSTRUCTORS
+  }
+  _edata  =  .;
+  PROVIDE (edata = .);
+
+  . = .;
+  __u_boot_cmd_start = .;
+  .u_boot_cmd : { *(.u_boot_cmd) }
+  __u_boot_cmd_end = .;
+
+
+  . = .;
+  __start___ex_table = .;
+  __ex_table : { *(__ex_table) }
+  __stop___ex_table = .;
+
+  . = ALIGN(4096);
+  __init_begin = .;
+  .text.init : { *(.text.init) }
+  .data.init : { *(.data.init) }
+  . = ALIGN(4096);
+  __init_end = .;
+
+  __bss_start = .;
+  .bss       :
+  {
+   *(.sbss) *(.scommon)
+   *(.dynbss)
+   *(.bss)
+   *(COMMON)
+  }
+  _end = . ;
+  PROVIDE (end = .);
+}
diff --git a/cpu/mpc5xxx/u-boot.lds b/cpu/mpc5xxx/u-boot.lds
new file mode 100644 (file)
index 0000000..a28a3af
--- /dev/null
@@ -0,0 +1,124 @@
+/*
+ * (C) Copyright 2003-2007
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+OUTPUT_ARCH(powerpc)
+SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
+/* Do we need any of these for elf?
+   __DYNAMIC = 0;    */
+SECTIONS
+{
+  /* Read-only sections, merged into text segment: */
+  . = + SIZEOF_HEADERS;
+  .interp : { *(.interp) }
+  .hash          : { *(.hash)          }
+  .dynsym        : { *(.dynsym)                }
+  .dynstr        : { *(.dynstr)                }
+  .rel.text      : { *(.rel.text)              }
+  .rela.text     : { *(.rela.text)     }
+  .rel.data      : { *(.rel.data)              }
+  .rela.data     : { *(.rela.data)     }
+  .rel.rodata    : { *(.rel.rodata)    }
+  .rela.rodata   : { *(.rela.rodata)   }
+  .rel.got       : { *(.rel.got)               }
+  .rela.got      : { *(.rela.got)              }
+  .rel.ctors     : { *(.rel.ctors)     }
+  .rela.ctors    : { *(.rela.ctors)    }
+  .rel.dtors     : { *(.rel.dtors)     }
+  .rela.dtors    : { *(.rela.dtors)    }
+  .rel.bss       : { *(.rel.bss)               }
+  .rela.bss      : { *(.rela.bss)              }
+  .rel.plt       : { *(.rel.plt)               }
+  .rela.plt      : { *(.rela.plt)              }
+  .init          : { *(.init)  }
+  .plt : { *(.plt) }
+  .text      :
+  {
+    cpu/mpc5xxx/start.o        (.text)
+    *(.text)
+    *(.got1)
+    . = ALIGN(16);
+    *(.rodata)
+    *(.rodata1)
+    *(.rodata.str1.4)
+    *(.eh_frame)
+  }
+  .fini      : { *(.fini)    } =0
+  .ctors     : { *(.ctors)   }
+  .dtors     : { *(.dtors)   }
+
+  /* Read-write section, merged into data segment: */
+  . = (. + 0x0FFF) & 0xFFFFF000;
+  _erotext = .;
+  PROVIDE (erotext = .);
+  .reloc   :
+  {
+    *(.got)
+    _GOT2_TABLE_ = .;
+    *(.got2)
+    _FIXUP_TABLE_ = .;
+    *(.fixup)
+  }
+  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
+  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
+
+  .data    :
+  {
+    *(.data)
+    *(.data1)
+    *(.sdata)
+    *(.sdata2)
+    *(.dynamic)
+    CONSTRUCTORS
+  }
+  _edata  =  .;
+  PROVIDE (edata = .);
+
+  . = .;
+  __u_boot_cmd_start = .;
+  .u_boot_cmd : { *(.u_boot_cmd) }
+  __u_boot_cmd_end = .;
+
+
+  . = .;
+  __start___ex_table = .;
+  __ex_table : { *(__ex_table) }
+  __stop___ex_table = .;
+
+  . = ALIGN(4096);
+  __init_begin = .;
+  .text.init : { *(.text.init) }
+  .data.init : { *(.data.init) }
+  . = ALIGN(4096);
+  __init_end = .;
+
+  __bss_start = .;
+  .bss       :
+  {
+   *(.sbss) *(.scommon)
+   *(.dynbss)
+   *(.bss)
+   *(COMMON)
+  }
+  _end = . ;
+  PROVIDE (end = .);
+}
index 6fec5dfe60c19aa16ab8a84479337a924435da41..c41cafe97fef6c17dda4a48f10500ead4253ec9b 100644 (file)
 # MA 02111-1307 USA
 #
 
-PLATFORM_RELFLAGS += -fPIC -ffixed-r14 -meabi
+PLATFORM_RELFLAGS += -fPIC -ffixed-r14 -meabi -mrelocatable
 
 PLATFORM_CPPFLAGS += -DCONFIG_MPC8220 -ffixed-r2 -ffixed-r29 \
                     -mstring -mcpu=603e -mmultiple
+
+# Use default linker script.  Board port can override in board/*/config.mk
+LDSCRIPT := $(SRCTREE)/cpu/mpc8220/u-boot.lds
index 3cf5f66a13006554524e95601569d557489a8803..0daac5bbd4bf847132608ef34ef2cf2a527ac9b0 100644 (file)
@@ -128,7 +128,7 @@ int cpu_init_r (void)
        /* route critical ints to normal ints */
        *(vu_long *) 0xf0000710 |= 0x00000001;
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET) && defined(CONFIG_MPC8220_FEC)
+#if defined(CONFIG_CMD_NET) && defined(CONFIG_MPC8220_FEC)
        /* load FEC microcode */
        loadtask (0, 2);
 #endif
index 1201e794df4a5fe7330026e82342744a60e102f9..992e0ffbc4666922e29ef795cf19b808bb674b24 100644 (file)
 #include "fec.h"
 
 #undef  DEBUG
-#if (CONFIG_COMMANDS & CFG_CMD_NET) && defined(CONFIG_NET_MULTI) && \
+#if defined(CONFIG_CMD_NET) && defined(CONFIG_NET_MULTI) && \
     defined(CONFIG_MPC8220_FEC)
 
-#if !(defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII))
+#if !(defined(CONFIG_MII) || defined(CONFIG_CMD_MII))
 #error "CONFIG_MII has to be defined!"
 #endif
 
@@ -847,7 +847,7 @@ int mpc8220_fec_initialize (bd_t * bis)
        sprintf (dev->name, "FEC ETHERNET");
        eth_register (dev);
 
-#if defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII)
+#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
        miiphy_register (dev->name,
                        fec8220_miiphy_read, fec8220_miiphy_write);
 #endif
index cdee2be78b5757f9626592dd95c0a46cca02636c..89cca1d2237a5e6fd36075b88b720eab5f69e16d 100644 (file)
@@ -37,7 +37,7 @@
 #include <command.h>
 #include <asm/processor.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 int (*debugger_exception_handler) (struct pt_regs *) = 0;
 #endif
 
@@ -118,7 +118,7 @@ void MachineCheckException (struct pt_regs *regs)
                regs->nip = fixup;
                return;
        }
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        if (debugger_exception_handler
            && (*debugger_exception_handler) (regs))
                return;
@@ -152,7 +152,7 @@ void MachineCheckException (struct pt_regs *regs)
 
 void AlignmentException (struct pt_regs *regs)
 {
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        if (debugger_exception_handler
            && (*debugger_exception_handler) (regs))
                return;
@@ -164,7 +164,7 @@ void AlignmentException (struct pt_regs *regs)
 
 void ProgramCheckException (struct pt_regs *regs)
 {
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        if (debugger_exception_handler
            && (*debugger_exception_handler) (regs))
                return;
@@ -176,7 +176,7 @@ void ProgramCheckException (struct pt_regs *regs)
 
 void SoftEmuException (struct pt_regs *regs)
 {
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        if (debugger_exception_handler
            && (*debugger_exception_handler) (regs))
                return;
@@ -189,7 +189,7 @@ void SoftEmuException (struct pt_regs *regs)
 
 void UnknownException (struct pt_regs *regs)
 {
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        if (debugger_exception_handler
            && (*debugger_exception_handler) (regs))
                return;
@@ -199,7 +199,7 @@ void UnknownException (struct pt_regs *regs)
        _exception (0, regs);
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_BEDBUG)
+#if defined(CONFIG_CMD_BEDBUG)
 extern void do_bedbug_breakpoint (struct pt_regs *);
 #endif
 
@@ -208,7 +208,7 @@ void DebugException (struct pt_regs *regs)
 
        printf ("Debugger trap at @ %lx\n", regs->nip);
        show_regs (regs);
-#if (CONFIG_COMMANDS & CFG_CMD_BEDBUG)
+#if defined(CONFIG_CMD_BEDBUG)
        do_bedbug_breakpoint (regs);
 #endif
 }
diff --git a/cpu/mpc8220/u-boot.lds b/cpu/mpc8220/u-boot.lds
new file mode 100644 (file)
index 0000000..a199a64
--- /dev/null
@@ -0,0 +1,124 @@
+/*
+ * (C) Copyright 2003-2004
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+OUTPUT_ARCH(powerpc)
+SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
+/* Do we need any of these for elf?
+   __DYNAMIC = 0;    */
+SECTIONS
+{
+  /* Read-only sections, merged into text segment: */
+  . = + SIZEOF_HEADERS;
+  .interp : { *(.interp) }
+  .hash          : { *(.hash)          }
+  .dynsym        : { *(.dynsym)                }
+  .dynstr        : { *(.dynstr)                }
+  .rel.text      : { *(.rel.text)              }
+  .rela.text     : { *(.rela.text)     }
+  .rel.data      : { *(.rel.data)              }
+  .rela.data     : { *(.rela.data)     }
+  .rel.rodata    : { *(.rel.rodata)    }
+  .rela.rodata   : { *(.rela.rodata)   }
+  .rel.got       : { *(.rel.got)               }
+  .rela.got      : { *(.rela.got)              }
+  .rel.ctors     : { *(.rel.ctors)     }
+  .rela.ctors    : { *(.rela.ctors)    }
+  .rel.dtors     : { *(.rel.dtors)     }
+  .rela.dtors    : { *(.rela.dtors)    }
+  .rel.bss       : { *(.rel.bss)               }
+  .rela.bss      : { *(.rela.bss)              }
+  .rel.plt       : { *(.rel.plt)               }
+  .rela.plt      : { *(.rela.plt)              }
+  .init          : { *(.init)  }
+  .plt : { *(.plt) }
+  .text      :
+  {
+    cpu/mpc8220/start.o        (.text)
+    *(.text)
+    *(.got1)
+    . = ALIGN(16);
+    *(.rodata)
+    *(.rodata1)
+    *(.rodata.str1.4)
+    *(.eh_frame)
+  }
+  .fini      : { *(.fini)    } =0
+  .ctors     : { *(.ctors)   }
+  .dtors     : { *(.dtors)   }
+
+  /* Read-write section, merged into data segment: */
+  . = (. + 0x0FFF) & 0xFFFFF000;
+  _erotext = .;
+  PROVIDE (erotext = .);
+  .reloc   :
+  {
+    *(.got)
+    _GOT2_TABLE_ = .;
+    *(.got2)
+    _FIXUP_TABLE_ = .;
+    *(.fixup)
+  }
+  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
+  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
+
+  .data    :
+  {
+    *(.data)
+    *(.data1)
+    *(.sdata)
+    *(.sdata2)
+    *(.dynamic)
+    CONSTRUCTORS
+  }
+  _edata  =  .;
+  PROVIDE (edata = .);
+
+  . = .;
+  __u_boot_cmd_start = .;
+  .u_boot_cmd : { *(.u_boot_cmd) }
+  __u_boot_cmd_end = .;
+
+
+  . = .;
+  __start___ex_table = .;
+  __ex_table : { *(__ex_table) }
+  __stop___ex_table = .;
+
+  . = ALIGN(4096);
+  __init_begin = .;
+  .text.init : { *(.text.init) }
+  .data.init : { *(.data.init) }
+  . = ALIGN(4096);
+  __init_end = .;
+
+  __bss_start = .;
+  .bss       :
+  {
+   *(.sbss) *(.scommon)
+   *(.dynbss)
+   *(.bss)
+   *(COMMON)
+  }
+  _end = . ;
+  PROVIDE (end = .);
+}
index dac61d8d3e3ba3f4fab4c396c0e962f872a0789c..17fdb21d35a170b2c98472a507a2a7b6380e0472 100644 (file)
@@ -21,6 +21,9 @@
 # MA 02111-1307 USA
 #
 
-PLATFORM_RELFLAGS += -fPIC -ffixed-r14 -meabi -fno-strict-aliasing
+PLATFORM_RELFLAGS += -fPIC -ffixed-r14 -meabi -fno-strict-aliasing -mrelocatable
 
 PLATFORM_CPPFLAGS += -DCONFIG_MPC824X -ffixed-r2 -ffixed-r29 -mstring -mcpu=603e -msoft-float
+
+# Use default linker script.  Board port can override in board/*/config.mk
+LDSCRIPT := $(SRCTREE)/cpu/mpc824x/u-boot.lds
index 071d003f8c3e98a19b64ab24cf02baa2be9b5b81..0a7243020b6f648df49a04bdce46a3edd9c47de1 100644 (file)
@@ -175,7 +175,7 @@ UnknownException(struct pt_regs *regs)
        _exception(0, regs);
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_BEDBUG)
+#if defined(CONFIG_CMD_BEDBUG)
 extern void do_bedbug_breakpoint(struct pt_regs *);
 #endif
 
@@ -185,7 +185,7 @@ DebugException(struct pt_regs *regs)
 
   printf("Debugger trap at @ %lx\n", regs->nip );
   show_regs(regs);
-#if (CONFIG_COMMANDS & CFG_CMD_BEDBUG)
+#if defined(CONFIG_CMD_BEDBUG)
   do_bedbug_breakpoint( regs );
 #endif
 }
diff --git a/cpu/mpc824x/u-boot.lds b/cpu/mpc824x/u-boot.lds
new file mode 100644 (file)
index 0000000..8cbef4a
--- /dev/null
@@ -0,0 +1,124 @@
+/*
+ * (C) Copyright 2001-2007
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+OUTPUT_ARCH(powerpc)
+SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
+/* Do we need any of these for elf?
+   __DYNAMIC = 0;    */
+SECTIONS
+{
+  /* Read-only sections, merged into text segment: */
+  . = + SIZEOF_HEADERS;
+  .interp : { *(.interp) }
+  .hash          : { *(.hash)          }
+  .dynsym        : { *(.dynsym)                }
+  .dynstr        : { *(.dynstr)                }
+  .rel.text      : { *(.rel.text)              }
+  .rela.text     : { *(.rela.text)     }
+  .rel.data      : { *(.rel.data)              }
+  .rela.data     : { *(.rela.data)     }
+  .rel.rodata    : { *(.rel.rodata)    }
+  .rela.rodata   : { *(.rela.rodata)   }
+  .rel.got       : { *(.rel.got)               }
+  .rela.got      : { *(.rela.got)              }
+  .rel.ctors     : { *(.rel.ctors)     }
+  .rela.ctors    : { *(.rela.ctors)    }
+  .rel.dtors     : { *(.rel.dtors)     }
+  .rela.dtors    : { *(.rela.dtors)    }
+  .rel.bss       : { *(.rel.bss)               }
+  .rela.bss      : { *(.rela.bss)              }
+  .rel.plt       : { *(.rel.plt)               }
+  .rela.plt      : { *(.rela.plt)              }
+  .init          : { *(.init)  }
+  .plt : { *(.plt) }
+  .text      :
+  {
+    cpu/mpc824x/start.o                (.text)
+    *(.text)
+    *(.got1)
+    . = ALIGN(16);
+    *(.rodata)
+    *(.rodata1)
+    *(.rodata.str1.4)
+    *(.eh_frame)
+  }
+  .fini      : { *(.fini)    } =0
+  .ctors     : { *(.ctors)   }
+  .dtors     : { *(.dtors)   }
+
+  /* Read-write section, merged into data segment: */
+  . = (. + 0x0FFF) & 0xFFFFF000;
+  _erotext = .;
+  PROVIDE (erotext = .);
+  .reloc   :
+  {
+    *(.got)
+    _GOT2_TABLE_ = .;
+    *(.got2)
+    _FIXUP_TABLE_ = .;
+    *(.fixup)
+  }
+  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
+  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
+
+  .data    :
+  {
+    *(.data)
+    *(.data1)
+    *(.sdata)
+    *(.sdata2)
+    *(.dynamic)
+    CONSTRUCTORS
+  }
+  _edata  =  .;
+  PROVIDE (edata = .);
+
+  . = .;
+  __u_boot_cmd_start = .;
+  .u_boot_cmd : { *(.u_boot_cmd) }
+  __u_boot_cmd_end = .;
+
+
+  . = .;
+  __start___ex_table = .;
+  __ex_table : { *(__ex_table) }
+  __stop___ex_table = .;
+
+  . = ALIGN(4096);
+  __init_begin = .;
+  .text.init : { *(.text.init) }
+  .data.init : { *(.data.init) }
+  . = ALIGN(4096);
+  __init_end = .;
+
+  __bss_start = .;
+  .bss       :
+  {
+   *(.sbss) *(.scommon)
+   *(.dynbss)
+   *(.bss)
+   *(COMMON)
+  }
+  _end = . ;
+  PROVIDE (end = .);
+}
index be09cfb5c6184e8384d2b6d89cc1824055058530..f1be485e8eb90a9d0162a5be97c705b2ba2982c3 100644 (file)
@@ -10,7 +10,8 @@
 #include <bedbug/regs.h>
 #include <bedbug/ppc.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_BEDBUG) && (defined(CONFIG_MPC824X) || defined(CONFIG_MPC8260))
+#if defined(CONFIG_CMD_BEDBUG) \
+       && (defined(CONFIG_MPC824X) || defined(CONFIG_MPC8260))
 
 #define MAX_BREAK_POINTS 1
 
index dd7a71fdf36dd3319858f9bb28c6aae4a2342c5c..d401e4ca04f9e43e3f6e915bd8fc13d7ef75c713 100644 (file)
 # MA 02111-1307 USA
 #
 
-PLATFORM_RELFLAGS += -fPIC -ffixed-r14 -meabi
+PLATFORM_RELFLAGS += -fPIC -ffixed-r14 -meabi -mrelocatable
 
 PLATFORM_CPPFLAGS += -DCONFIG_8260 -DCONFIG_CPM2 -ffixed-r2 -ffixed-r29 \
                     -mstring -mcpu=603e -mmultiple
+
+# Use default linker script.  Board port can override in board/*/config.mk
+LDSCRIPT := $(SRCTREE)/cpu/mpc8260/u-boot.lds
index 380d7af13d3d6012743984a10578a46f61112f44..36fc1eba5fd1014458fcf4d453a219eacf6e3d9c 100644 (file)
@@ -182,7 +182,7 @@ void cpu_init_f (volatile immap_t * immr)
 #endif
 
        /* now restrict to preliminary range */
-       /* the PS came from the HRCW, don´t change it */
+       /* the PS came from the HRCW, don´t change it */
        memctl->memc_br0 = SET_VAL_MASK(memctl->memc_br0 , CFG_BR0_PRELIM, BRx_PS_MSK);
        memctl->memc_or0 = CFG_OR0_PRELIM;
 
index 584c40f17a174ace235fe4178787013589e98e17..37bf4456ed1b032a892abced7dffb7c138943d39 100644 (file)
 #include <config.h>
 #include <net.h>
 
-#if defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII)
+#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
 #include <miiphy.h>
 #endif
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#if defined(CONFIG_ETHER_ON_FCC) && (CONFIG_COMMANDS & CFG_CMD_NET) && \
+#if defined(CONFIG_ETHER_ON_FCC) && defined(CONFIG_CMD_NET) && \
        defined(CONFIG_NET_MULTI)
 
 static struct ether_fcc_info_s
@@ -393,7 +393,7 @@ int fec_initialize(bd_t *bis)
 
                eth_register(dev);
 
-#if (defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII)) \
+#if (defined(CONFIG_MII) || defined(CONFIG_CMD_MII)) \
                && defined(CONFIG_BITBANGMII)
                miiphy_register(dev->name,
                                bb_miiphy_read, bb_miiphy_write);
@@ -1187,4 +1187,4 @@ eth_loopback_test (void)
 
 #endif /* CONFIG_ETHER_LOOPBACK_TEST */
 
-#endif /* CONFIG_ETHER_ON_FCC && CFG_CMD_NET && CONFIG_NET_MULTI */
+#endif
index a733b45c01101444f196c29482c4e030095fe357..e56839d3aad020be2eb54c4f964774739dcfa7db 100644 (file)
@@ -36,7 +36,7 @@
 #include <command.h>
 #include <config.h>
 
-#if defined(CONFIG_ETHER_ON_SCC) && (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_ETHER_ON_SCC) && defined(CONFIG_CMD_NET)
 
 #if (CONFIG_ETHER_INDEX == 1)
 #  define PROFF_ENET            PROFF_SCC1
@@ -353,4 +353,4 @@ void restart(void)
 }
 #endif
 
-#endif  /* CONFIG_ETHER_ON_SCC && CFG_CMD_NET */
+#endif
index 56e9a721373f3245b3409d9ef001575e14e756e2..bf0d4d0d59f06a471f15c9ef347a0e044b411b23 100644 (file)
@@ -246,7 +246,7 @@ void timer_interrupt_cpu (struct pt_regs *regs)
 
 /****************************************************************************/
 
-#if (CONFIG_COMMANDS & CFG_CMD_IRQ)
+#if defined(CONFIG_CMD_IRQ)
 
 /* ripped this out of ppc4xx/interrupts.c */
 
@@ -276,4 +276,4 @@ do_irqinfo (cmd_tbl_t * cmdtp, bd_t * bd, int flag, int argc, char *argv[])
                enable_interrupts ();
 }
 
-#endif                                                 /* CONFIG_COMMANDS & CFG_CMD_IRQ */
+#endif
index 2a250249b89867e6f25ae5cc03b78d18ebdf9562..dae87bb97c77f0eff6596619f2da42d70f3c84c4 100644 (file)
@@ -34,7 +34,7 @@
 #include <asm/cache.h>
 #include <asm/mmu.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 
  /*
  * cache flushing routines for kgdb
@@ -69,4 +69,4 @@ kgdb_flush_cache_range:
        SYNC
        blr
 
-#endif /* CFG_CMD_KGDB */
+#endif
index 0c39e434ed34177470add5c97f4c7630ca74cf3c..b5d416c9741d87239fdfc592710b0afedb908b66 100644 (file)
@@ -37,7 +37,7 @@
 #include <asm/processor.h>
 #include <asm/m8260_pci.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 int (*debugger_exception_handler)(struct pt_regs *) = 0;
 #endif
 
@@ -150,7 +150,7 @@ MachineCheckException(struct pt_regs *regs)
                return;
        }
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        if (debugger_exception_handler && (*debugger_exception_handler)(regs))
                return;
 #endif
@@ -186,7 +186,7 @@ MachineCheckException(struct pt_regs *regs)
 void
 AlignmentException(struct pt_regs *regs)
 {
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        if (debugger_exception_handler && (*debugger_exception_handler)(regs))
                return;
 #endif
@@ -198,7 +198,7 @@ AlignmentException(struct pt_regs *regs)
 void
 ProgramCheckException(struct pt_regs *regs)
 {
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        if (debugger_exception_handler && (*debugger_exception_handler)(regs))
                return;
 #endif
@@ -210,7 +210,7 @@ ProgramCheckException(struct pt_regs *regs)
 void
 SoftEmuException(struct pt_regs *regs)
 {
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        if (debugger_exception_handler && (*debugger_exception_handler)(regs))
                return;
 #endif
@@ -223,7 +223,7 @@ SoftEmuException(struct pt_regs *regs)
 void
 UnknownException(struct pt_regs *regs)
 {
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        if (debugger_exception_handler && (*debugger_exception_handler)(regs))
                return;
 #endif
@@ -232,7 +232,7 @@ UnknownException(struct pt_regs *regs)
        _exception(0, regs);
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_BEDBUG)
+#if defined(CONFIG_CMD_BEDBUG)
 extern void do_bedbug_breakpoint(struct pt_regs *);
 #endif
 
@@ -242,7 +242,7 @@ DebugException(struct pt_regs *regs)
 
   printf("Debugger trap at @ %lx\n", regs->nip );
   show_regs(regs);
-#if (CONFIG_COMMANDS & CFG_CMD_BEDBUG)
+#if defined(CONFIG_CMD_BEDBUG)
   do_bedbug_breakpoint( regs );
 #endif
 }
diff --git a/cpu/mpc8260/u-boot.lds b/cpu/mpc8260/u-boot.lds
new file mode 100644 (file)
index 0000000..b8abc17
--- /dev/null
@@ -0,0 +1,124 @@
+/*
+ * (C) Copyright 2001-2007
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+OUTPUT_ARCH(powerpc)
+SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
+/* Do we need any of these for elf?
+   __DYNAMIC = 0;    */
+SECTIONS
+{
+  /* Read-only sections, merged into text segment: */
+  . = + SIZEOF_HEADERS;
+  .interp : { *(.interp) }
+  .hash          : { *(.hash)          }
+  .dynsym        : { *(.dynsym)                }
+  .dynstr        : { *(.dynstr)                }
+  .rel.text      : { *(.rel.text)              }
+  .rela.text     : { *(.rela.text)     }
+  .rel.data      : { *(.rel.data)              }
+  .rela.data     : { *(.rela.data)     }
+  .rel.rodata    : { *(.rel.rodata)    }
+  .rela.rodata   : { *(.rela.rodata)   }
+  .rel.got       : { *(.rel.got)               }
+  .rela.got      : { *(.rela.got)              }
+  .rel.ctors     : { *(.rel.ctors)     }
+  .rela.ctors    : { *(.rela.ctors)    }
+  .rel.dtors     : { *(.rel.dtors)     }
+  .rela.dtors    : { *(.rela.dtors)    }
+  .rel.bss       : { *(.rel.bss)               }
+  .rela.bss      : { *(.rela.bss)              }
+  .rel.plt       : { *(.rel.plt)               }
+  .rela.plt      : { *(.rela.plt)              }
+  .init          : { *(.init)  }
+  .plt : { *(.plt) }
+  .text      :
+  {
+    cpu/mpc8260/start.o                (.text)
+    *(.text)
+    *(.got1)
+    . = ALIGN(16);
+    *(.rodata)
+    *(.rodata1)
+    *(.rodata.str1.4)
+    *(.eh_frame)
+  }
+  .fini      : { *(.fini)    } =0
+  .ctors     : { *(.ctors)   }
+  .dtors     : { *(.dtors)   }
+
+  /* Read-write section, merged into data segment: */
+  . = (. + 0x0FFF) & 0xFFFFF000;
+  _erotext = .;
+  PROVIDE (erotext = .);
+  .reloc   :
+  {
+    *(.got)
+    _GOT2_TABLE_ = .;
+    *(.got2)
+    _FIXUP_TABLE_ = .;
+    *(.fixup)
+  }
+  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
+  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
+
+  .data    :
+  {
+    *(.data)
+    *(.data1)
+    *(.sdata)
+    *(.sdata2)
+    *(.dynamic)
+    CONSTRUCTORS
+  }
+  _edata  =  .;
+  PROVIDE (edata = .);
+
+  . = .;
+  __u_boot_cmd_start = .;
+  .u_boot_cmd : { *(.u_boot_cmd) }
+  __u_boot_cmd_end = .;
+
+
+  . = .;
+  __start___ex_table = .;
+  __ex_table : { *(__ex_table) }
+  __stop___ex_table = .;
+
+  . = ALIGN(4096);
+  __init_begin = .;
+  .text.init : { *(.text.init) }
+  .data.init : { *(.data.init) }
+  . = ALIGN(4096);
+  __init_end = .;
+
+  __bss_start = .;
+  .bss       :
+  {
+   *(.sbss) *(.scommon)
+   *(.dynbss)
+   *(.bss)
+   *(COMMON)
+  }
+  _end = . ;
+  PROVIDE (end = .);
+}
index 8b4ff92b19c6bb967705f50dc5698c9db382e751..2ec395d4ca9d57a7cd59aba67e685e0eea7dde40 100644 (file)
 # MA 02111-1307 USA
 #
 
-PLATFORM_RELFLAGS += -fPIC -ffixed-r14 -meabi
+PLATFORM_RELFLAGS += -fPIC -ffixed-r14 -meabi -mrelocatable
 
 PLATFORM_CPPFLAGS += -DCONFIG_MPC83XX -DCONFIG_E300 \
                        -ffixed-r2 -ffixed-r29 -msoft-float
+
+# Use default linker script.  Board port can override in board/*/config.mk
+LDSCRIPT := $(SRCTREE)/cpu/mpc83xx/u-boot.lds
index bb1fe1af3f3bba3c3ca199f7a884a640b79efb87..98ed21ccfa63af31d26e2b1a3de2f1b61cf29f89 100644 (file)
@@ -81,7 +81,7 @@ void timer_interrupt_cpu (struct pt_regs *regs)
 }
 
 
-#if (CONFIG_COMMANDS & CFG_CMD_IRQ)
+#if defined(CONFIG_CMD_IRQ)
 
 /* ripped this out of ppc4xx/interrupts.c */
 
@@ -94,4 +94,4 @@ do_irqinfo(cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[])
 {
 }
 
-#endif         /* CONFIG_COMMANDS & CFG_CMD_IRQ */
+#endif
index 152fa735612a2b164ed150984326437854a07fed..dfd6c038642192296e3bcf2d3bac5e7fb5829638 100644 (file)
@@ -140,7 +140,7 @@ MachineCheckException(struct pt_regs *regs)
                return;
        }
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        if (debugger_exception_handler && (*debugger_exception_handler)(regs))
                return;
 #endif
@@ -176,7 +176,7 @@ MachineCheckException(struct pt_regs *regs)
 void
 AlignmentException(struct pt_regs *regs)
 {
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        if (debugger_exception_handler && (*debugger_exception_handler)(regs))
                return;
 #endif
@@ -188,7 +188,7 @@ AlignmentException(struct pt_regs *regs)
 void
 ProgramCheckException(struct pt_regs *regs)
 {
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        if (debugger_exception_handler && (*debugger_exception_handler)(regs))
                return;
 #endif
@@ -200,7 +200,7 @@ ProgramCheckException(struct pt_regs *regs)
 void
 SoftEmuException(struct pt_regs *regs)
 {
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        if (debugger_exception_handler && (*debugger_exception_handler)(regs))
                return;
 #endif
@@ -213,7 +213,7 @@ SoftEmuException(struct pt_regs *regs)
 void
 UnknownException(struct pt_regs *regs)
 {
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        if (debugger_exception_handler && (*debugger_exception_handler)(regs))
                return;
 #endif
@@ -222,7 +222,7 @@ UnknownException(struct pt_regs *regs)
        _exception(0, regs);
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_BEDBUG)
+#if defined(CONFIG_CMD_BEDBUG)
 extern void do_bedbug_breakpoint(struct pt_regs *);
 #endif
 
@@ -231,7 +231,7 @@ DebugException(struct pt_regs *regs)
 {
        printf("Debugger trap at @ %lx\n", regs->nip );
        show_regs(regs);
-#if (CONFIG_COMMANDS & CFG_CMD_BEDBUG)
+#if defined(CONFIG_CMD_BEDBUG)
        do_bedbug_breakpoint( regs );
 #endif
 }
diff --git a/cpu/mpc83xx/u-boot.lds b/cpu/mpc83xx/u-boot.lds
new file mode 100644 (file)
index 0000000..ca663bc
--- /dev/null
@@ -0,0 +1,122 @@
+/*
+ * (C) Copyright 2006
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+OUTPUT_ARCH(powerpc)
+SECTIONS
+{
+  /* Read-only sections, merged into text segment: */
+  . = + SIZEOF_HEADERS;
+  .interp : { *(.interp) }
+  .hash          : { *(.hash)          }
+  .dynsym        : { *(.dynsym)                }
+  .dynstr        : { *(.dynstr)                }
+  .rel.text      : { *(.rel.text)              }
+  .rela.text     : { *(.rela.text)     }
+  .rel.data      : { *(.rel.data)              }
+  .rela.data     : { *(.rela.data)     }
+  .rel.rodata    : { *(.rel.rodata)    }
+  .rela.rodata   : { *(.rela.rodata)   }
+  .rel.got       : { *(.rel.got)               }
+  .rela.got      : { *(.rela.got)              }
+  .rel.ctors     : { *(.rel.ctors)     }
+  .rela.ctors    : { *(.rela.ctors)    }
+  .rel.dtors     : { *(.rel.dtors)     }
+  .rela.dtors    : { *(.rela.dtors)    }
+  .rel.bss       : { *(.rel.bss)               }
+  .rela.bss      : { *(.rela.bss)              }
+  .rel.plt       : { *(.rel.plt)               }
+  .rela.plt      : { *(.rela.plt)              }
+  .init          : { *(.init)  }
+  .plt : { *(.plt) }
+  .text      :
+  {
+    cpu/mpc83xx/start.o        (.text)
+    *(.text)
+    *(.got1)
+    . = ALIGN(16);
+    *(.rodata)
+    *(.rodata1)
+    *(.rodata.str1.4)
+    *(.eh_frame)
+  }
+  .fini      : { *(.fini)    } =0
+  .ctors     : { *(.ctors)   }
+  .dtors     : { *(.dtors)   }
+
+  /* Read-write section, merged into data segment: */
+  . = (. + 0x0FFF) & 0xFFFFF000;
+  _erotext = .;
+  PROVIDE (erotext = .);
+  .reloc   :
+  {
+    *(.got)
+    _GOT2_TABLE_ = .;
+    *(.got2)
+    _FIXUP_TABLE_ = .;
+    *(.fixup)
+  }
+  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
+  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
+
+  .data    :
+  {
+    *(.data)
+    *(.data1)
+    *(.sdata)
+    *(.sdata2)
+    *(.dynamic)
+    CONSTRUCTORS
+  }
+  _edata  =  .;
+  PROVIDE (edata = .);
+
+  . = .;
+  __u_boot_cmd_start = .;
+  .u_boot_cmd : { *(.u_boot_cmd) }
+  __u_boot_cmd_end = .;
+
+
+  . = .;
+  __start___ex_table = .;
+  __ex_table : { *(__ex_table) }
+  __stop___ex_table = .;
+
+  . = ALIGN(4096);
+  __init_begin = .;
+  .text.init : { *(.text.init) }
+  .data.init : { *(.data.init) }
+  . = ALIGN(4096);
+  __init_end = .;
+
+  __bss_start = .;
+  .bss       :
+  {
+   *(.sbss) *(.scommon)
+   *(.dynbss)
+   *(.bss)
+   *(COMMON)
+  }
+  _end = . ;
+  PROVIDE (end = .);
+}
+ENTRY(_start)
index d15d2424929eacb0437130a50b702718b35d13dd..5b23a80e1ca9892d3ec94cde83e0985eb563b75d 100644 (file)
 #include <config.h>
 #include <net.h>
 
-#if defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII)
+#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
 #include <miiphy.h>
 #endif
 
 #if defined(CONFIG_CPM2)
 
-#if defined(CONFIG_ETHER_ON_FCC) && (CONFIG_COMMANDS & CFG_CMD_NET) && \
+#if defined(CONFIG_ETHER_ON_FCC) && defined(CONFIG_CMD_NET) && \
        defined(CONFIG_NET_MULTI)
 
 static struct ether_fcc_info_s
@@ -458,7 +458,7 @@ int fec_initialize(bd_t *bis)
 
                eth_register(dev);
 
-#if (defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII)) \
+#if (defined(CONFIG_MII) || defined(CONFIG_CMD_MII)) \
                && defined(CONFIG_BITBANGMII)
                miiphy_register(dev->name,
                                bb_miiphy_read, bb_miiphy_write);
@@ -468,6 +468,6 @@ int fec_initialize(bd_t *bis)
        return 1;
 }
 
-#endif /* CONFIG_ETHER_ON_FCC && CFG_CMD_NET && CONFIG_NET_MULTI */
+#endif
 
 #endif /* CONFIG_CPM2 */
index 832781bab8ff9b608e60785af5de102b09fae0b2..dc246dca02878bff9ce8290295616176b4abb9c2 100644 (file)
@@ -144,7 +144,7 @@ void set_timer (ulong t)
        timestamp = t;
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_IRQ)
+#if defined(CONFIG_CMD_IRQ)
 
 /*******************************************************************************
  *
@@ -159,4 +159,4 @@ do_irqinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        return 0;
 }
 
-#endif  /* CONFIG_COMMANDS & CFG_CMD_IRQ */
+#endif
index 904f0523396d631a0aa8de698da0b4b6d1ba0cfc..9cd621c3ac4a27521d58f713a75c067e77aaeb24 100644 (file)
@@ -41,7 +41,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 int (*debugger_exception_handler)(struct pt_regs *) = 0;
 #endif
 
@@ -74,7 +74,7 @@ static __inline__ unsigned long get_esr(void)
 #define ESR_DIZ 0x00400000
 #define ESR_U0F 0x00008000
 
-#if (CONFIG_COMMANDS & CFG_CMD_BEDBUG)
+#if defined(CONFIG_CMD_BEDBUG)
 extern void do_bedbug_breakpoint(struct pt_regs *);
 #endif
 
@@ -159,7 +159,7 @@ MachineCheckException(struct pt_regs *regs)
                return;
        }
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        if (debugger_exception_handler && (*debugger_exception_handler)(regs))
                return;
 #endif
@@ -192,7 +192,7 @@ MachineCheckException(struct pt_regs *regs)
 void
 AlignmentException(struct pt_regs *regs)
 {
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        if (debugger_exception_handler && (*debugger_exception_handler)(regs))
                return;
 #endif
@@ -207,7 +207,7 @@ ProgramCheckException(struct pt_regs *regs)
 {
        long esr_val;
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        if (debugger_exception_handler && (*debugger_exception_handler)(regs))
                return;
 #endif
@@ -244,7 +244,7 @@ PITException(struct pt_regs *regs)
 void
 UnknownException(struct pt_regs *regs)
 {
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        if (debugger_exception_handler && (*debugger_exception_handler)(regs))
                return;
 #endif
@@ -259,7 +259,7 @@ DebugException(struct pt_regs *regs)
 {
        printf("Debugger trap at @ %lx\n", regs->nip );
        show_regs(regs);
-#if (CONFIG_COMMANDS & CFG_CMD_BEDBUG)
+#if defined(CONFIG_CMD_BEDBUG)
        do_bedbug_breakpoint( regs );
 #endif
 }
index fffcfd24029fbdea9f5f8150fdcc68189be22683..6d9300e22e7e18e7b71d09f4c4ba56d2ae2efc7b 100644 (file)
@@ -1,4 +1,5 @@
 #
+# Copyright 2007 Freescale Semiconductor, Inc.
 # (C) Copyright 2002,2003 Motorola Inc.
 # Xianghua Xiao,X.Xiao@motorola.com
 #
@@ -30,7 +31,7 @@ LIB   = $(obj)lib$(CPU).a
 START  = start.o #resetvec.o
 SOBJS  = cache.o
 COBJS  = traps.o cpu.o cpu_init.o speed.o interrupts.o \
-         pci.o pcie_indirect.o spd_sdram.o
+         spd_sdram.o
 
 SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
index 49820bbd81138fdb0675d5c62bf6b8651d84ddf4..08e0675fee4035179ed6eeeccac1c4ac0aa0feef 100644 (file)
@@ -71,7 +71,7 @@ static __inline__ void set_dec(unsigned long val)
 }
 
 /* interrupt is not supported yet */
-int interrupt_init_cpu(unsigned *decrementer_count)
+int interrupt_init_cpu(unsigned long *decrementer_count)
 {
        return 0;
 }
@@ -107,7 +107,7 @@ int interrupt_init(void)
                return ret;
 
        decrementer_count = get_tbclk() / CFG_HZ;
-       debug("interrupt init: tbclk() = %d MHz, decrementer_count = %d\n",
+       debug("interrupt init: tbclk() = %d MHz, decrementer_count = %ld\n",
              (get_tbclk() / 1000000),
              decrementer_count);
 
@@ -158,7 +158,7 @@ void timer_interrupt(struct pt_regs *regs)
 
        timestamp++;
 
-       ppcDcbf(&timestamp);
+       ppcDcbf((unsigned long)&timestamp);
 
        /* Restore Decrementer Count */
        set_dec(decrementer_count);
diff --git a/cpu/mpc86xx/pci.c b/cpu/mpc86xx/pci.c
deleted file mode 100644 (file)
index b86548d..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Copyright (C) Freescale Semiconductor,Inc.
- * 2005, 2006. All rights reserved.
- *
- * Ed Swarthout (ed.swarthout@freescale.com)
- * Jason Jin (Jason.jin@freescale.com)
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-/*
- * PCIE Configuration space access support for PCIE Bridge
- */
-#include <common.h>
-#include <pci.h>
-
-#if defined(CONFIG_PCI)
-void
-pci_mpc86xx_init(struct pci_controller *hose)
-{
-       volatile immap_t *immap = (immap_t *) CFG_CCSRBAR;
-       volatile ccsr_pex_t *pcie1 = &immap->im_pex1;
-       u16 temp16;
-       u32 temp32;
-
-       volatile ccsr_gur_t *gur = &immap->im_gur;
-       uint host1_agent = (gur->porbmsr & MPC86xx_PORBMSR_HA) >> 17;
-       uint pcie1_host = (host1_agent == 2) || (host1_agent == 3);
-       uint pcie1_agent = (host1_agent == 0) || (host1_agent == 1);
-       uint devdisr = gur->devdisr;
-       uint io_sel = (gur->pordevsr & MPC86xx_PORDEVSR_IO_SEL) >> 16;
-
-       if ((io_sel == 2 || io_sel == 3 || io_sel == 5 || io_sel == 6 ||
-            io_sel == 7 || io_sel == 0xf)
-           && !(devdisr & MPC86xx_DEVDISR_PCIEX1)) {
-               printf("PCI-EXPRESS 1: Configured as %s \n",
-                      pcie1_agent ? "Agent" : "Host");
-               if (pcie1_agent)
-                       return; /*Don't scan bus when configured as agent */
-               printf("               Scanning PCIE bus");
-               debug("0x%08x=0x%08x ",
-                     &pcie1->pme_msg_det,
-                     pcie1->pme_msg_det);
-               if (pcie1->pme_msg_det) {
-                       pcie1->pme_msg_det = 0xffffffff;
-                       debug(" with errors.  Clearing.  Now 0x%08x",
-                             pcie1->pme_msg_det);
-               }
-               debug("\n");
-       } else {
-               printf("PCI-EXPRESS 1 disabled!\n");
-               return;
-       }
-
-       /*
-        * Set first_bus=0 only skipped B0:D0:F0 which is
-        * a reserved device in M1575, but make it easy for
-        * most of the scan process.
-        */
-       hose->first_busno = 0x00;
-       hose->last_busno = 0xfe;
-
-       pcie_setup_indirect(hose, (CFG_IMMR + 0x8000), (CFG_IMMR + 0x8004));
-
-       pci_hose_read_config_word(hose,
-                                 PCI_BDF(0, 0, 0), PCI_COMMAND, &temp16);
-       temp16 |= PCI_COMMAND_SERR | PCI_COMMAND_MASTER |
-           PCI_COMMAND_MEMORY | PCI_COMMAND_IO;
-       pci_hose_write_config_word(hose,
-                                  PCI_BDF(0, 0, 0), PCI_COMMAND, temp16);
-
-       pci_hose_write_config_word(hose, PCI_BDF(0, 0, 0), PCI_STATUS, 0xffff);
-       pci_hose_write_config_byte(hose,
-                                  PCI_BDF(0, 0, 0), PCI_LATENCY_TIMER, 0x80);
-
-       pci_hose_read_config_dword(hose, PCI_BDF(0, 0, 0), PCI_PRIMARY_BUS,
-                                  &temp32);
-       temp32 = (temp32 & 0xff000000) | (0xff) | (0x0 << 8) | (0xfe << 16);
-       pci_hose_write_config_dword(hose, PCI_BDF(0, 0, 0), PCI_PRIMARY_BUS,
-                                   temp32);
-
-       pcie1->powar1 = 0;
-       pcie1->powar2 = 0;
-       pcie1->piwar1 = 0;
-       pcie1->piwar1 = 0;
-
-       pcie1->powbar1 = (CFG_PCI1_MEM_BASE >> 12) & 0x000fffff;
-       pcie1->powar1 = 0x8004401c;     /* 512M MEM space */
-       pcie1->potar1 = (CFG_PCI1_MEM_BASE >> 12) & 0x000fffff;
-       pcie1->potear1 = 0x00000000;
-
-       pcie1->powbar2 = (CFG_PCI1_IO_BASE >> 12) & 0x000fffff;
-       pcie1->powar2 = 0x80088017;     /* 16M IO space */
-       pcie1->potar2 = 0x00000000;
-       pcie1->potear2 = 0x00000000;
-
-       pcie1->pitar1 = 0x00000000;
-       pcie1->piwbar1 = 0x00000000;
-       /* Enable, Prefetch, Local Mem, * Snoop R/W, 2G */
-       pcie1->piwar1 = 0xa0f5501e;
-
-       pci_set_region(hose->regions + 0,
-                      CFG_PCI_MEMORY_BUS,
-                      CFG_PCI_MEMORY_PHYS,
-                      CFG_PCI_MEMORY_SIZE,
-                      PCI_REGION_MEM | PCI_REGION_MEMORY);
-
-       pci_set_region(hose->regions + 1,
-                      CFG_PCI1_MEM_BASE,
-                      CFG_PCI1_MEM_PHYS,
-                      CFG_PCI1_MEM_SIZE,
-                      PCI_REGION_MEM);
-
-       pci_set_region(hose->regions + 2,
-                      CFG_PCI1_IO_BASE,
-                      CFG_PCI1_IO_PHYS,
-                      CFG_PCI1_IO_SIZE,
-                      PCI_REGION_IO);
-
-       hose->region_count = 3;
-
-       pci_register_hose(hose);
-
-       hose->last_busno = pci_hose_scan(hose);
-       debug("pcie_mpc86xx_init: last_busno %x\n", hose->last_busno);
-       debug("pcie_mpc86xx init: current_busno %x\n ", hose->current_busno);
-
-       printf("....PCIE1 scan & enumeration done\n");
-}
-#endif                         /* CONFIG_PCI */
diff --git a/cpu/mpc86xx/pcie_indirect.c b/cpu/mpc86xx/pcie_indirect.c
deleted file mode 100644 (file)
index b00ad76..0000000
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * Support for indirect PCI bridges.
- *
- * Copyright (c) Freescale Semiconductor, Inc.
- * 2006. All rights reserved.
- *
- * Jason Jin <Jason.jin@freescale.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- *
- * partly derived from
- * arch/powerpc/platforms/86xx/mpc86xx_pcie.c
- */
-
-#include <common.h>
-
-#ifdef CONFIG_PCI
-
-#include <asm/processor.h>
-#include <asm/io.h>
-#include <pci.h>
-
-#define PCI_CFG_OUT    out_be32
-#define PEX_FIX                out_be32(hose->cfg_addr+0x4, 0x0400ffff)
-
-static int
-indirect_read_config_pcie(struct pci_controller *hose,
-                         pci_dev_t dev,
-                         int offset,
-                         int len,
-                         u32 *val)
-{
-       int bus = PCI_BUS(dev);
-
-       volatile unsigned char *cfg_data;
-       u32 temp;
-
-       PEX_FIX;
-       if (bus == 0xff) {
-               PCI_CFG_OUT(hose->cfg_addr,
-                           dev | (offset & 0xfc) | 0x80000001);
-       } else {
-               PCI_CFG_OUT(hose->cfg_addr,
-                           dev | (offset & 0xfc) | 0x80000000);
-       }
-       /*
-        * Note: the caller has already checked that offset is
-        * suitably aligned and that len is 1, 2 or 4.
-        */
-       /* ERRATA PCI-Ex 12 - Configuration Address/Data Alignment */
-       cfg_data = hose->cfg_data;
-       PEX_FIX;
-       temp = in_le32((u32 *) cfg_data);
-       switch (len) {
-       case 1:
-               *val = (temp >> (((offset & 3)) * 8)) & 0xff;
-               break;
-       case 2:
-               *val = (temp >> (((offset & 3)) * 8)) & 0xffff;
-               break;
-       default:
-               *val = temp;
-               break;
-       }
-
-       return 0;
-}
-
-static int
-indirect_write_config_pcie(struct pci_controller *hose,
-                          pci_dev_t dev,
-                          int offset,
-                          int len,
-                          u32 val)
-{
-       int bus = PCI_BUS(dev);
-       volatile unsigned char *cfg_data;
-       u32 temp;
-
-       PEX_FIX;
-       if (bus == 0xff) {
-               PCI_CFG_OUT(hose->cfg_addr,
-                           dev | (offset & 0xfc) | 0x80000001);
-       } else {
-               PCI_CFG_OUT(hose->cfg_addr,
-                           dev | (offset & 0xfc) | 0x80000000);
-       }
-
-       /*
-        * Note: the caller has already checked that offset is
-        * suitably aligned and that len is 1, 2 or 4.
-        */
-       /* ERRATA PCI-Ex 12 - Configuration Address/Data Alignment */
-       cfg_data = hose->cfg_data;
-       switch (len) {
-       case 1:
-               PEX_FIX;
-               temp = in_le32((u32 *) cfg_data);
-               temp = (temp & ~(0xff << ((offset & 3) * 8))) |
-                   (val << ((offset & 3) * 8));
-               PEX_FIX;
-               out_le32((u32 *) cfg_data, temp);
-               break;
-       case 2:
-               PEX_FIX;
-               temp = in_le32((u32 *) cfg_data);
-               temp = (temp & ~(0xffff << ((offset & 3) * 8)));
-               temp |= (val << ((offset & 3) * 8));
-               PEX_FIX;
-               out_le32((u32 *) cfg_data, temp);
-               break;
-       default:
-               PEX_FIX;
-               out_le32((u32 *) cfg_data, val);
-               break;
-       }
-       PEX_FIX;
-       return 0;
-}
-
-static int
-indirect_read_config_byte_pcie(struct pci_controller *hose,
-                              pci_dev_t dev,
-                              int offset,
-                              u8 *val)
-{
-       u32 val32;
-       indirect_read_config_pcie(hose, dev, offset, 1, &val32);
-       *val = (u8) val32;
-       return 0;
-}
-
-static int
-indirect_read_config_word_pcie(struct pci_controller *hose,
-                              pci_dev_t dev,
-                              int offset,
-                              u16 *val)
-{
-       u32 val32;
-       indirect_read_config_pcie(hose, dev, offset, 2, &val32);
-       *val = (u16) val32;
-       return 0;
-}
-
-static int
-indirect_read_config_dword_pcie(struct pci_controller *hose,
-                               pci_dev_t dev,
-                               int offset,
-                               u32 *val)
-{
-       return indirect_read_config_pcie(hose, dev, offset, 4, val);
-}
-
-static int
-indirect_write_config_byte_pcie(struct pci_controller *hose,
-                               pci_dev_t dev,
-                               int offset,
-                               u8 val)
-{
-       return indirect_write_config_pcie(hose, dev, offset, 1, (u32) val);
-}
-
-static int
-indirect_write_config_word_pcie(struct pci_controller *hose,
-                               pci_dev_t dev,
-                               int offset,
-                               unsigned short val)
-{
-       return indirect_write_config_pcie(hose, dev, offset, 2, (u32) val);
-}
-
-static int
-indirect_write_config_dword_pcie(struct pci_controller *hose,
-                                pci_dev_t dev,
-                                int offset,
-                                u32 val)
-{
-       return indirect_write_config_pcie(hose, dev, offset, 4, val);
-}
-
-void
-pcie_setup_indirect(struct pci_controller *hose, u32 cfg_addr, u32 cfg_data)
-{
-       pci_set_ops(hose,
-                   indirect_read_config_byte_pcie,
-                   indirect_read_config_word_pcie,
-                   indirect_read_config_dword_pcie,
-                   indirect_write_config_byte_pcie,
-                   indirect_write_config_word_pcie,
-                   indirect_write_config_dword_pcie);
-
-       hose->cfg_addr = (unsigned int *)cfg_addr;
-       hose->cfg_data = (unsigned char *)cfg_data;
-}
-
-#endif                         /* CONFIG_PCI */
index 8ea14e575f26c1d9c7a5fd4ceacac977f8203891..fab1975834e34ccc6ee0a3d623b95d28331b262c 100644 (file)
@@ -34,7 +34,7 @@
 #include <command.h>
 #include <asm/processor.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 int (*debugger_exception_handler)(struct pt_regs *) = 0;
 #endif
 
@@ -122,7 +122,7 @@ MachineCheckException(struct pt_regs *regs)
                return;
        }
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        if (debugger_exception_handler && (*debugger_exception_handler) (regs))
                return;
 #endif
@@ -155,7 +155,7 @@ MachineCheckException(struct pt_regs *regs)
 void
 AlignmentException(struct pt_regs *regs)
 {
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        if (debugger_exception_handler && (*debugger_exception_handler) (regs))
                return;
 #endif
@@ -170,7 +170,7 @@ ProgramCheckException(struct pt_regs *regs)
        unsigned char *p = regs ? (unsigned char *)(regs->nip) : NULL;
        int i, j;
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        if (debugger_exception_handler && (*debugger_exception_handler) (regs))
                return;
 #endif
@@ -193,7 +193,7 @@ ProgramCheckException(struct pt_regs *regs)
 void
 SoftEmuException(struct pt_regs *regs)
 {
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        if (debugger_exception_handler && (*debugger_exception_handler) (regs))
                return;
 #endif
@@ -205,7 +205,7 @@ SoftEmuException(struct pt_regs *regs)
 void
 UnknownException(struct pt_regs *regs)
 {
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        if (debugger_exception_handler && (*debugger_exception_handler) (regs))
                return;
 #endif
index e91a1006f7bc5ac3d36276f5ca8d976349330395..5d523663924f07d1cc7e791039782988562ba77d 100644 (file)
@@ -10,7 +10,7 @@
 #include <bedbug/ppc.h>
 #include <bedbug/type.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_BEDBUG) && defined(CONFIG_8xx)
+#if defined(CONFIG_CMD_BEDBUG) && defined(CONFIG_8xx)
 
 #define MAX_BREAK_POINTS 2
 
index 6d2755e8304f4370179ee4d31db029ffdf401e3d..08a3715812dc2ccda643fae2af38d0504fa01ebf 100644 (file)
@@ -31,7 +31,7 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #undef ET_DEBUG
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET) && \
+#if defined(CONFIG_CMD_NET) && \
        (defined(FEC_ENET) || defined(CONFIG_ETHER_ON_FEC1) || defined(CONFIG_ETHER_ON_FEC2))
 
 /* compatibility test, if only FEC_ENET defined assume ETHER on FEC1 */
@@ -49,7 +49,7 @@ DECLARE_GLOBAL_DATA_PTR;
 #if defined(WANT_MII)
 #include <miiphy.h>
 
-#if !(defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII))
+#if !(defined(CONFIG_MII) || defined(CONFIG_CMD_MII))
 #error "CONFIG_MII has to be defined!"
 #endif
 
@@ -182,7 +182,7 @@ int fec_initialize(bd_t *bis)
 
                eth_register(dev);
 
-#if defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII)
+#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
                miiphy_register(dev->name,
                        fec8xx_miiphy_read, fec8xx_miiphy_write);
 #endif
@@ -268,7 +268,7 @@ static int fec_recv (struct eth_device *dev)
 
                        length -= 4;
 
-#if (CONFIG_COMMANDS & CFG_CMD_CDP)
+#if defined(CONFIG_CMD_CDP)
                        if ((rx[0] & 1) != 0
                            && memcmp ((uchar *) rx, NetBcastAddr, 6) != 0
                            && memcmp ((uchar *) rx, NetCDPAddr, 6) != 0)
@@ -608,7 +608,7 @@ static int fec_init (struct eth_device *dev, bd_t * bd)
        fecp->fec_addr_high = (ea[4] << 8) | (ea[5]);
 #undef ea
 
-#if (CONFIG_COMMANDS & CFG_CMD_CDP)
+#if defined(CONFIG_CMD_CDP)
        /*
         * Turn on multicast address hash table
         */
@@ -787,7 +787,7 @@ static void fec_halt(struct eth_device* dev)
        efis->initialized = 0;
 }
 
-#if defined(CFG_DISCOVER_PHY) || defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII)
+#if defined(CFG_DISCOVER_PHY) || defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
 
 /* Make MII read/write commands for the FEC.
 */
@@ -852,7 +852,7 @@ mii_send(uint mii_cmd)
 #endif
        return (mii_reply & 0xffff);            /* data read from phy */
 }
-#endif /* CFG_DISCOVER_PHY || (CONFIG_COMMANDS & CFG_CMD_MII) */
+#endif
 
 #if defined(CFG_DISCOVER_PHY)
 static int mii_discover_phy(struct eth_device *dev)
@@ -926,7 +926,7 @@ static int mii_discover_phy(struct eth_device *dev)
 }
 #endif /* CFG_DISCOVER_PHY */
 
-#if (defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII)) && !defined(CONFIG_BITBANGMII)
+#if (defined(CONFIG_MII) || defined(CONFIG_CMD_MII)) && !defined(CONFIG_BITBANGMII)
 
 /****************************************************************************
  * mii_init -- Initialize the MII for MII command without ethernet
@@ -1020,6 +1020,6 @@ int fec8xx_miiphy_write(char *devname, unsigned char  addr,
 #endif
        return 0;
 }
-#endif /* (CONFIG_COMMANDS & CFG_CMD_MII) && !defined(CONFIG_BITBANGMII)*/
+#endif
 
-#endif /* CFG_CMD_NET, FEC_ENET */
+#endif
index 11c3c69339ef0e0c8b954dea9226c27f2fcdd2e0..812baa3ecd4d5158f2e2e73fc19f9a2417452759 100644 (file)
@@ -34,7 +34,7 @@
 #include <asm/cache.h>
 #include <asm/mmu.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 
  /*
  * cache flushing routines for kgdb
@@ -71,4 +71,4 @@ kgdb_flush_cache_range:
        SYNC
        blr
 
-#endif /* CFG_CMD_KGDB */
+#endif
index 6b9110f1301b3e3d27052a1e2a11c6b58b1b5163..744dcdde91f2e198bfd49428ff5ef1f9e733c61e 100644 (file)
@@ -38,7 +38,7 @@
 #include <net.h>
 #include <command.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET) && defined(SCC_ENET)
+#if defined(CONFIG_CMD_NET) && defined(SCC_ENET)
 
 /* Ethernet Transmit and Receive Buffers */
 #define DBUF_LENGTH  1520
@@ -567,4 +567,4 @@ void restart (void)
                (SCC_GSMRL_ENR | SCC_GSMRL_ENT);
 }
 #endif
-#endif /* CFG_CMD_NET, SCC_ENET */
+#endif
index ffc898c58769ff586499b8f35af9695233d1c275..68804cc43945012667604feef865f1dba4ffcc1a 100644 (file)
@@ -666,7 +666,7 @@ void enable_putc(void)
 }
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 
 void
 kgdb_serial_init(void)
@@ -723,6 +723,6 @@ kgdb_interruptible (int yes)
 {
        return;
 }
-#endif /* CFG_CMD_KGDB */
+#endif
 
 #endif /* CONFIG_8xx_CONS_NONE */
index 67b75cce2f754f54559458813919cc91101001ca..e1ec88961ab61bafda75a75fcc1aedc2888eaa42 100644 (file)
 #include <command.h>
 #include <asm/processor.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 int (*debugger_exception_handler)(struct pt_regs *) = 0;
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_BEDBUG)
+#if defined(CONFIG_CMD_BEDBUG)
 extern void do_bedbug_breakpoint(struct pt_regs *);
 #endif
 
@@ -126,7 +126,7 @@ MachineCheckException(struct pt_regs *regs)
                return;
        }
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        if (debugger_exception_handler && (*debugger_exception_handler)(regs))
                return;
 #endif
@@ -159,7 +159,7 @@ MachineCheckException(struct pt_regs *regs)
 void
 AlignmentException(struct pt_regs *regs)
 {
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        if (debugger_exception_handler && (*debugger_exception_handler)(regs))
                return;
 #endif
@@ -171,7 +171,7 @@ AlignmentException(struct pt_regs *regs)
 void
 ProgramCheckException(struct pt_regs *regs)
 {
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        if (debugger_exception_handler && (*debugger_exception_handler)(regs))
                return;
 #endif
@@ -183,7 +183,7 @@ ProgramCheckException(struct pt_regs *regs)
 void
 SoftEmuException(struct pt_regs *regs)
 {
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        if (debugger_exception_handler && (*debugger_exception_handler)(regs))
                return;
 #endif
@@ -196,7 +196,7 @@ SoftEmuException(struct pt_regs *regs)
 void
 UnknownException(struct pt_regs *regs)
 {
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        if (debugger_exception_handler && (*debugger_exception_handler)(regs))
                return;
 #endif
@@ -210,7 +210,7 @@ DebugException(struct pt_regs *regs)
 {
   printf("Debugger trap at @ %lx\n", regs->nip );
   show_regs(regs);
-#if (CONFIG_COMMANDS & CFG_CMD_BEDBUG)
+#if defined(CONFIG_CMD_BEDBUG)
   do_bedbug_breakpoint( regs );
 #endif
 }
index 48fc81e584882b6c2ccbb4a1efedf71f9a204765..75e491d8436cbbc1f3bd3e432c42d6da111f039b 100644 (file)
@@ -173,7 +173,7 @@ void irq_install_handler (int vec, interrupt_handler_t *handler, void *arg)
 }
 
 /*************************************************************************/
-#if (CONFIG_COMMANDS & CFG_CMD_IRQ)
+#if defined(CONFIG_CMD_IRQ)
 int do_irqinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
        int vec;
@@ -193,4 +193,4 @@ int do_irqinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 
        return (0);
 }
-#endif  /* CONFIG_COMMANDS & CFG_CMD_IRQ */
+#endif
index 4685161b88a5fe6cd1937c156b1f1338e73b9849..aeb5b65b330bb6c24ebe88024ed78f8b1e35835b 100644 (file)
@@ -204,7 +204,7 @@ int interrupt_init (void)
 
 
 /*************************************************************************/
-#if (CONFIG_COMMANDS & CFG_CMD_IRQ)
+#if defined(CONFIG_CMD_IRQ)
 int do_irqinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
        int i;
@@ -228,4 +228,4 @@ int do_irqinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 
        return (0);
 }
-#endif  /* CONFIG_COMMANDS & CFG_CMD_IRQ */
+#endif
index 1200d021af62a832477843e805a32caffdc8e0c6..d78279171e2934e3af87dabc1d359dcfc01a3397 100644 (file)
@@ -94,9 +94,9 @@
  * network support enabled.
  * Remark: CONFIG_405 describes Xilinx PPC405 FPGA without EMAC controller!
  */
-#if (CONFIG_COMMANDS & CFG_CMD_NET) && !defined(CONFIG_405) && !defined(CONFIG_IOP480)
+#if defined(CONFIG_CMD_NET) && !defined(CONFIG_405) && !defined(CONFIG_IOP480)
 
-#if !(defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII))
+#if !(defined(CONFIG_MII) || defined(CONFIG_CMD_MII))
 #error "CONFIG_MII has to be defined!"
 #endif
 
@@ -1683,7 +1683,7 @@ int ppc_4xx_eth_initialize (bd_t * bis)
 #endif
 
 #if defined(CONFIG_NET_MULTI)
-#if defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII)
+#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
                miiphy_register (dev->name,
                                 emac4xx_miiphy_read, emac4xx_miiphy_write);
 #endif
@@ -1724,7 +1724,7 @@ int eth_rx(void)
 
 int emac4xx_miiphy_initialize (bd_t * bis)
 {
-#if defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII)
+#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
        miiphy_register ("ppc_4xx_eth0",
                         emac4xx_miiphy_read, emac4xx_miiphy_write);
 #endif
@@ -1733,4 +1733,4 @@ int emac4xx_miiphy_initialize (bd_t * bis)
 }
 #endif /* !defined(CONFIG_NET_MULTI) */
 
-#endif /* #if (CONFIG_COMMANDS & CFG_CMD_NET) */
+#endif
index a3c2119764c9c1c5f60505ded11f8a73eef96a7c..5ef5607918d6a45e87b2a40098bd5b81ed973166 100644 (file)
@@ -10,7 +10,7 @@
 #include <bedbug/regs.h>
 #include <bedbug/ppc.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_BEDBUG) && defined(CONFIG_4xx)
+#if defined(CONFIG_CMD_BEDBUG) && defined(CONFIG_4xx)
 
 #define MAX_BREAK_POINTS 4
 
index 7102364ebdf6fdb7aa7cb6b18199634c8d2ea368..93465a3b513759074819bd4877eec4f472b067a7 100644 (file)
@@ -22,7 +22,7 @@
  */
 #include <config.h>
 
-#if defined(CONFIG_4xx) && defined(CFG_CMD_SETGETDCR)
+#if defined(CONFIG_4xx) && defined(CONFIG_CMD_SETGETDCR)
 
 #include <ppc4xx.h>
 
@@ -195,4 +195,4 @@ set_dcr:
                blr                             /* Return to calling function */
 .Lfe4:         .size   set_dcr,.Lfe4-set_dcr
 /* end set_dcr() */
-#endif /* CONFIG_4xx & CFG_CMD_SETGETDCR */
+#endif
index c5a9f02566af75c5d142d743392ef9ab9677e16a..ca565cc3e073f946b4d090cfc7907f09724bd2c9 100644 (file)
@@ -628,7 +628,7 @@ void timer_interrupt_cpu (struct pt_regs *regs)
 
 /****************************************************************************/
 
-#if (CONFIG_COMMANDS & CFG_CMD_IRQ)
+#if defined(CONFIG_CMD_IRQ)
 
 /*******************************************************************************
  *
@@ -698,4 +698,4 @@ do_irqinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 
        return 0;
 }
-#endif  /* CONFIG_COMMANDS & CFG_CMD_IRQ */
+#endif
index be283403e92c9ec9c8dad6371b3942d2d3702645..8c4bbf2e4de35dd908e8c1b5bd94ac281005e2cf 100644 (file)
@@ -34,7 +34,7 @@
 #include <asm/cache.h>
 #include <asm/mmu.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
  /*
  * cache flushing routines for kgdb
  */
@@ -75,4 +75,4 @@ kgdb_flush_cache_range:
        SYNC
        blr
 
-#endif /* CFG_CMD_KGDB */
+#endif
index f63fc79f6cb7770d9deac75ef4758a4abe4e4ad9..398457726f426b3898ff794b6ebcd1018eaf3f76 100644 (file)
@@ -31,7 +31,7 @@
 
 #include <common.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND) && !defined(CFG_NAND_LEGACY) && \
+#if defined(CONFIG_CMD_NAND) && !defined(CFG_NAND_LEGACY) && \
        (defined(CONFIG_440EP) || defined(CONFIG_440GR) ||           \
         defined(CONFIG_440EPX) || defined(CONFIG_440GRX) ||         \
         defined(CONFIG_405EZ))
index e62dd9dac5155c23f6cf4b2ffdc0ed63c09c918a..3f67136be5334d18c52441f866661d2fde97a1a4 100644 (file)
@@ -843,7 +843,7 @@ int serial_buffered_tstc (void)
 
 #endif /* CONFIG_SERIAL_SOFTWARE_FIFO */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 /*
   AS HARNOIS : according to CONFIG_KGDB_SER_INDEX kgdb uses serial port
   number 0 or number 1
@@ -949,7 +949,7 @@ void kgdb_interruptible (int yes)
        return;
 }
 #endif /* (CONFIG_KGDB_SER_INDEX & 2) */
-#endif /* CFG_CMD_KGDB */
+#endif
 
 
 #if defined(CONFIG_SERIAL_MULTI)
old mode 100755 (executable)
new mode 100644 (file)
index eb9420e..899cdbd
@@ -38,7 +38,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 int (*debugger_exception_handler)(struct pt_regs *) = 0;
 #endif
 
@@ -78,7 +78,7 @@ static __inline__ unsigned long get_esr(void)
 #define ESR_DIZ 0x00400000
 #define ESR_U0F 0x00008000
 
-#if (CONFIG_COMMANDS & CFG_CMD_BEDBUG)
+#if defined(CONFIG_CMD_BEDBUG)
 extern void do_bedbug_breakpoint(struct pt_regs *);
 #endif
 
@@ -158,7 +158,7 @@ MachineCheckException(struct pt_regs *regs)
                return;
        }
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        if (debugger_exception_handler && (*debugger_exception_handler)(regs))
                return;
 #endif
@@ -297,7 +297,7 @@ MachineCheckException(struct pt_regs *regs)
 void
 AlignmentException(struct pt_regs *regs)
 {
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        if (debugger_exception_handler && (*debugger_exception_handler)(regs))
                return;
 #endif
@@ -312,7 +312,7 @@ ProgramCheckException(struct pt_regs *regs)
 {
        long esr_val;
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        if (debugger_exception_handler && (*debugger_exception_handler)(regs))
                return;
 #endif
@@ -349,7 +349,7 @@ DecrementerPITException(struct pt_regs *regs)
 void
 UnknownException(struct pt_regs *regs)
 {
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        if (debugger_exception_handler && (*debugger_exception_handler)(regs))
                return;
 #endif
@@ -364,7 +364,7 @@ DebugException(struct pt_regs *regs)
 {
        printf("Debugger trap at @ %lx\n", regs->nip );
        show_regs(regs);
-#if (CONFIG_COMMANDS & CFG_CMD_BEDBUG)
+#if defined(CONFIG_CMD_BEDBUG)
        do_bedbug_breakpoint( regs );
 #endif
 }
index 6140d2a9089f4402d82957dfed129042925df67f..5924a6cb8470424ee610bf931ac8c0672070b482 100644 (file)
@@ -3,7 +3,7 @@
 #include <common.h>
 #include <asm/processor.h>
 
-#if (defined(CONFIG_440EP) || defined(CONFIG_440EPX)) && (CONFIG_COMMANDS & CFG_CMD_USB)
+#if (defined(CONFIG_440EP) || defined(CONFIG_440EPX)) && defined(CONFIG_CMD_USB)
 
 #include <usb.h>
 #include "usbdev.h"
old mode 100755 (executable)
new mode 100644 (file)
index 6ab5857..56b9427
@@ -34,9 +34,9 @@
 #define PRINTF(fmt,args...)
 #endif
 
-#if ((CONFIG_COMMANDS & CFG_CMD_IDE)   || \
-     (CONFIG_COMMANDS & CFG_CMD_SCSI)  || \
-     (CONFIG_COMMANDS & CFG_CMD_USB)   || \
+#if (defined(CONFIG_CMD_IDE) || \
+     defined(CONFIG_CMD_SCSI) || \
+     defined(CONFIG_CMD_USB) || \
      defined(CONFIG_MMC) || \
      defined(CONFIG_SYSTEMACE) )
 
@@ -46,13 +46,13 @@ struct block_drvr {
 };
 
 static const struct block_drvr block_drvr[] = {
-#if (CONFIG_COMMANDS & CFG_CMD_IDE)
+#if defined(CONFIG_CMD_IDE)
        { .name = "ide", .get_dev = ide_get_dev, },
 #endif
-#if (CONFIG_COMMANDS & CFG_CMD_SCSI)
+#if defined(CONFIG_CMD_SCSI)
        { .name = "scsi", .get_dev = scsi_get_dev, },
 #endif
-#if ((CONFIG_COMMANDS & CFG_CMD_USB) && defined(CONFIG_USB_STORAGE))
+#if defined(CONFIG_CMD_USB) && defined(CONFIG_USB_STORAGE)
        { .name = "usb", .get_dev = usb_stor_get_dev, },
 #endif
 #if defined(CONFIG_MMC)
@@ -86,9 +86,9 @@ block_dev_desc_t *get_dev(char* ifname, int dev)
 }
 #endif
 
-#if ((CONFIG_COMMANDS & CFG_CMD_IDE)   || \
-     (CONFIG_COMMANDS & CFG_CMD_SCSI)  || \
-     (CONFIG_COMMANDS & CFG_CMD_USB)   || \
+#if (defined(CONFIG_CMD_IDE) || \
+     defined(CONFIG_CMD_SCSI) || \
+     defined(CONFIG_CMD_USB) || \
      defined(CONFIG_MMC) || \
      defined(CONFIG_SYSTEMACE) )
 
@@ -174,11 +174,11 @@ void dev_print (block_dev_desc_t *dev_desc)
                puts ("            Capacity: not available\n");
        }
 }
-#endif /* CFG_CMD_IDE || CFG_CMD_SCSI || CFG_CMD_USB || CONFIG_MMC */
+#endif
 
-#if ((CONFIG_COMMANDS & CFG_CMD_IDE)   || \
-     (CONFIG_COMMANDS & CFG_CMD_SCSI)  || \
-     (CONFIG_COMMANDS & CFG_CMD_USB)   || \
+#if (defined(CONFIG_CMD_IDE) || \
+     defined(CONFIG_CMD_SCSI) || \
+     defined(CONFIG_CMD_USB) || \
      defined(CONFIG_MMC)               || \
      defined(CONFIG_SYSTEMACE)          )
 
@@ -330,4 +330,4 @@ void print_part (block_dev_desc_t * dev_desc)
 # error nor CONFIG_ISO_PARTITION configured!
 #endif
 
-#endif /* (CONFIG_COMMANDS & CFG_CMD_IDE) || CONFIG_COMMANDS & CFG_CMD_SCSI) */
+#endif
index 41e68fcf0b4216f4c41750280ac3a567280ec9c8..6c3d74897011e076ab6247b9e539f2ac1ddffe9e 100644 (file)
@@ -26,9 +26,9 @@
 #include <ide.h>
 #include "part_amiga.h"
 
-#if ((CONFIG_COMMANDS & CFG_CMD_IDE)   || \
-     (CONFIG_COMMANDS & CFG_CMD_SCSI)  || \
-     (CONFIG_COMMANDS & CFG_CMD_USB)   || \
+#if (defined(CONFIG_CMD_IDE) || \
+     defined(CONFIG_CMD_SCSI) || \
+     defined(CONFIG_CMD_USB) || \
      defined(CONFIG_MMC) || \
      defined(CONFIG_SYSTEMACE) ) && defined(CONFIG_AMIGA_PARTITION)
 
index 133ee7988343aa0e130a19232c0f8933a86143dc..4707f803dc182897a76289897894b30346f2f338 100644 (file)
@@ -35,9 +35,9 @@
 #include <ide.h>
 #include "part_dos.h"
 
-#if ((CONFIG_COMMANDS & CFG_CMD_IDE)   || \
-     (CONFIG_COMMANDS & CFG_CMD_SCSI)  || \
-     (CONFIG_COMMANDS & CFG_CMD_USB)   || \
+#if (defined(CONFIG_CMD_IDE) || \
+     defined(CONFIG_CMD_SCSI) || \
+     defined(CONFIG_CMD_USB) || \
      defined(CONFIG_MMC) || \
      defined(CONFIG_SYSTEMACE) ) && defined(CONFIG_DOS_PARTITION)
 
@@ -248,4 +248,4 @@ int get_partition_info_dos (block_dev_desc_t *dev_desc, int part, disk_partition
 }
 
 
-#endif /* (CONFIG_COMMANDS & CFG_CMD_IDE) && CONFIG_DOS_PARTITION */
+#endif
index 073532436e8bc90587310d248780a822148f8ba5..06dd75eff6d81047e136ba539c632c1ea35b173b 100644 (file)
@@ -25,9 +25,9 @@
 #include <command.h>
 #include "part_iso.h"
 
-#if ((CONFIG_COMMANDS & CFG_CMD_IDE)   || \
-     (CONFIG_COMMANDS & CFG_CMD_SCSI)  || \
-     (CONFIG_COMMANDS & CFG_CMD_USB)   || \
+#if (defined(CONFIG_CMD_IDE) || \
+     defined(CONFIG_CMD_SCSI) || \
+     defined(CONFIG_CMD_USB) || \
      defined(CONFIG_MMC) || \
      defined(CONFIG_SYSTEMACE) ) && defined(CONFIG_ISO_PARTITION)
 
@@ -257,4 +257,4 @@ int test_part_iso (block_dev_desc_t *dev_desc)
        return(get_partition_info_iso_verb(dev_desc,0,&info,0));
 }
 
-#endif /* ((CONFIG_COMMANDS & CFG_CMD_IDE) || (CONFIG_COMMANDS & CFG_CMD_SCSI)) && defined(CONFIG_ISO_PARTITION) */
+#endif
index 8c23e211f9cf4d9d9f6953bfc37c2e20432f0c8b..d303a73f297814e426adbd4f3beaafdcb285741d 100644 (file)
@@ -34,9 +34,9 @@
 #include <ide.h>
 #include "part_mac.h"
 
-#if ((CONFIG_COMMANDS & CFG_CMD_IDE)   || \
-     (CONFIG_COMMANDS & CFG_CMD_SCSI)  || \
-     (CONFIG_COMMANDS & CFG_CMD_USB)   || \
+#if (defined(CONFIG_CMD_IDE) || \
+     defined(CONFIG_CMD_SCSI) || \
+     defined(CONFIG_CMD_USB) || \
      defined(CONFIG_MMC) || \
      defined(CONFIG_SYSTEMACE) ) && defined(CONFIG_MAC_PARTITION)
 
@@ -251,4 +251,4 @@ int get_partition_info_mac (block_dev_desc_t *dev_desc, int part, disk_partition
        return (0);
 }
 
-#endif /* (CONFIG_COMMANDS & CFG_CMD_IDE) && CONFIG_MAC_PARTITION */
+#endif
index 270da9082fb93cfe6e6bbdf48614c4edfa96b143..c5d67fd4e058e48d00a84fede2b5489c2295eed8 100644 (file)
@@ -2,7 +2,7 @@ JFFS2 options and usage.
 -----------------------
 
 JFFS2 in U-Boot is a read only implementation of the file system in
-Linux with the same name. To use JFFS2 define CFG_CMD_JFFS2.
+Linux with the same name. To use JFFS2 define CONFIG_CMD_JFFS2.
 
 The module adds three new commands.
 fsload  - load binary file from a file system image
index c5ccf1875e224dad5978e0dfc1a1cc7b35ad5e56..610ff2161d683ef67e2a599380f788b50a48c391 100644 (file)
@@ -32,10 +32,8 @@ Changed files:
 - include/cmd_bsp.h            added PIP405 commands definitions
 - include/cmd_condefs.h                added Floppy and SCSI support
 - include/cmd_disk.h           changed to work with block device description
-- include/config_LANTEC.h      excluded CFG_CMD_FDC and CFG_CMD_SCSI from
-                               CONFIG_CMD_FULL
-- include/config_hymod.h       excluded CFG_CMD_FDC and CFG_CMD_SCSI from
-                               CONFIG_CMD_FULL
+- include/config_LANTEC.h      excluded CONFIG_CMD_FDC and CONFIG_CMD_SCSI
+- include/config_hymod.h       excluded CONFIG_CMD_FDC and CONFIG_CMD_SCSI
 - include/flash.h              added INTEL_ID_28F320C3T  0x88C488C4
 - include/i2c.h                        added "defined(CONFIG_PIP405)"
 - include/image.h              added IH_OS_U_BOOT, IH_TYPE_FIRMWARE
@@ -88,8 +86,8 @@ section "Changes".
 
 New Commands:
 -------------
-CFG_CMD_SCSI   SCSI Support
-CFG_CMF_FDC    Floppy disk support
+CONFIG_CMD_SCSI        SCSI Support
+CONFIG_CMF_FDC Floppy disk support
 
 IDE additions:
 --------------
@@ -172,8 +170,8 @@ Added Devices:
 Floppy support:
 ---------------
 Support of a standard floppy disk controller at address CFG_ISA_IO_BASE_ADDRESS
-+ 0x3F0. Enabled with define CFG_CMD_FDC. Reads a unformated floppy disk with a
-image header (see: mkimage). No interrupts and no DMA are used for this.
++ 0x3F0. Enabled with define CONFIG_CMD_FDC. Reads a unformated floppy disk
+with a image header (see: mkimage). No interrupts and no DMA are used for this.
 Added files:
 - common/cmd_fdc.c
 - include/cmd_fdc.h
index fd6f2098f9843c4092e80d844cb54b321b43f5d8..9edc957c6f1cd90b29b9bde13ae53986badbfabd 100644 (file)
@@ -1,5 +1,5 @@
-To use SNTP support, add a define CFG_CMD_SNTP to CONFIG_COMMANDS in
-the configuration file of the board.
+To use SNTP support, add define CONFIG_CMD_SNTP to the
+configuration file of the board.
 
 The "sntp" command gets network time from NTP time server and
 syncronize RTC of the board. This command needs the command line
index 9cfb4217fe1e9cf42ab3a79b99431cd946a668d1..2616acc65321bf9be4e41fec88bd307688b4a5a9 100644 (file)
@@ -31,12 +31,6 @@ can be easily implemented.
        if it is an illegal instruction, privileged instruction or
        a trap. Also added debug trap handler.
 
-./include/cmd_confdefs.h
-       Added definition of CFG_CMD_BEDBUG.
-
-./include/config_WALNUT405.h
-       Added CFG_CMD_BEDBUG to the CONFIG_COMMANDS for the WALNUT.
-
 ./include/ppc_asm.tmpl
        Added code to handle critical exceptions
 
@@ -78,10 +72,6 @@ Changes:
        cpu/mpc8xx/traps.c
                Added new routine DebugException()
 
-       include/config_MBX.h
-               Added CFG_CMD_BEDBUG to CONFIG_COMMANDS define
-
-
 New Files:
 
        cpu/mpc8xx/bedbug_860.c
index 5c31845a94c0a016f6c8a8021fea8a0639497650..c5c5ef29e6390df037679b2734737dceaca507ce 100644 (file)
@@ -93,8 +93,8 @@ Commands:
 
 Configuration Options:
 
-   CFG_CMD_NAND
-      A good one to add to CONFIG_COMMANDS since it enables NAND support.
+   CONFIG_CMD_NAND
+      Enables NAND support and commmands.
 
    CONFIG_MTD_NAND_ECC_JFFS2
       Define this if you want the Error Correction Code information in
index 41f76f4b7e4cf328efbec3eeccd1c5aa0194acaa..b3bcb91f40681ef67decade555f061058d996409 100644 (file)
@@ -73,8 +73,8 @@ Storage USB Commands:
 
 Config Switches:
 ----------------
-CFG_CMD_USB        enables basic USB support and the usb command
-CONFIG_USB_UHCI            defines the lowlevel part.A lowlevel part must be defined if
-                   using CFG_CMD_USB
+CONFIG_CMD_USB     enables basic USB support and the usb command
+CONFIG_USB_UHCI            defines the lowlevel part.A lowlevel part must be defined
+                   if using CONFIG_CMD_USB
 CONFIG_USB_KEYBOARD enables the USB Keyboard
 CONFIG_USB_STORAGE  enables the USB storage devices
index 48fd4eaade0c1c1b1ae193127f418cd42eefe62a..881153ac9dd48e42c9b94428cfbee0a752cb6d0e 100644 (file)
@@ -52,7 +52,7 @@ COBJS = 3c589.o 5701rls.o ali512x.o ata_piix.o atmel_usart.o \
          ks8695eth.o \
          pxa_pcmcia.o mpc8xx_pcmcia.o tqm8xx_pcmcia.o  \
          rpx_pcmcia.o \
-         fsl_i2c.o
+         fsl_i2c.o fsl_pci_init.o ati_radeon_fb.o
 
 SRCS   := $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS))
index 8ceff00925fffbe54332da2b9c7b1fa6ab289598..ccd4d71e8ae223328c729257502fbf54917649ea 100644 (file)
@@ -253,7 +253,8 @@ static void ahci_print_info(struct ahci_probe_ent *probe_ent)
 
 static int ahci_init_one(pci_dev_t pdev)
 {
-       u32 iobase, vendor;
+       u32 iobase;
+       u16 vendor;
        int rc;
 
        memset((void *)ataid, 0, sizeof(hd_driveid_t *) * AHCI_MAX_PORTS);
diff --git a/drivers/ati_ids.h b/drivers/ati_ids.h
new file mode 100644 (file)
index 0000000..3e72a7d
--- /dev/null
@@ -0,0 +1,211 @@
+/*
+ * ATI PCI IDs from XFree86, kept here to make sync'ing with
+ * XFree much simpler. Currently, this list is only used by
+ * radeonfb
+ */
+
+#define PCI_CHIP_RV380_3150             0x3150
+#define PCI_CHIP_RV380_3151             0x3151
+#define PCI_CHIP_RV380_3152             0x3152
+#define PCI_CHIP_RV380_3153             0x3153
+#define PCI_CHIP_RV380_3154             0x3154
+#define PCI_CHIP_RV380_3156             0x3156
+#define PCI_CHIP_RV380_3E50             0x3E50
+#define PCI_CHIP_RV380_3E51             0x3E51
+#define PCI_CHIP_RV380_3E52             0x3E52
+#define PCI_CHIP_RV380_3E53             0x3E53
+#define PCI_CHIP_RV380_3E54             0x3E54
+#define PCI_CHIP_RV380_3E56             0x3E56
+#define PCI_CHIP_RS100_4136            0x4136
+#define PCI_CHIP_RS200_4137            0x4137
+#define PCI_CHIP_R300_AD               0x4144
+#define PCI_CHIP_R300_AE               0x4145
+#define PCI_CHIP_R300_AF               0x4146
+#define PCI_CHIP_R300_AG               0x4147
+#define PCI_CHIP_R350_AH                0x4148
+#define PCI_CHIP_R350_AI                0x4149
+#define PCI_CHIP_R350_AJ                0x414A
+#define PCI_CHIP_R350_AK                0x414B
+#define PCI_CHIP_RV350_AP               0x4150
+#define PCI_CHIP_RV350_AQ               0x4151
+#define PCI_CHIP_RV360_AR               0x4152
+#define PCI_CHIP_RV350_AS               0x4153
+#define PCI_CHIP_RV350_AT               0x4154
+#define PCI_CHIP_RV350_AV               0x4156
+#define PCI_CHIP_MACH32                0x4158
+#define PCI_CHIP_RS250_4237            0x4237
+#define PCI_CHIP_R200_BB               0x4242
+#define PCI_CHIP_R200_BC               0x4243
+#define PCI_CHIP_RS100_4336            0x4336
+#define PCI_CHIP_RS200_4337            0x4337
+#define PCI_CHIP_MACH64CT              0x4354
+#define PCI_CHIP_MACH64CX              0x4358
+#define PCI_CHIP_RS250_4437            0x4437
+#define PCI_CHIP_MACH64ET              0x4554
+#define PCI_CHIP_MACH64GB              0x4742
+#define PCI_CHIP_MACH64GD              0x4744
+#define PCI_CHIP_MACH64GI              0x4749
+#define PCI_CHIP_MACH64GL              0x474C
+#define PCI_CHIP_MACH64GM              0x474D
+#define PCI_CHIP_MACH64GN              0x474E
+#define PCI_CHIP_MACH64GO              0x474F
+#define PCI_CHIP_MACH64GP              0x4750
+#define PCI_CHIP_MACH64GQ              0x4751
+#define PCI_CHIP_MACH64GR              0x4752
+#define PCI_CHIP_MACH64GS              0x4753
+#define PCI_CHIP_MACH64GT              0x4754
+#define PCI_CHIP_MACH64GU              0x4755
+#define PCI_CHIP_MACH64GV              0x4756
+#define PCI_CHIP_MACH64GW              0x4757
+#define PCI_CHIP_MACH64GX              0x4758
+#define PCI_CHIP_MACH64GY              0x4759
+#define PCI_CHIP_MACH64GZ              0x475A
+#define PCI_CHIP_RV250_Id              0x4964
+#define PCI_CHIP_RV250_Ie              0x4965
+#define PCI_CHIP_RV250_If              0x4966
+#define PCI_CHIP_RV250_Ig              0x4967
+#define PCI_CHIP_R420_JH                0x4A48
+#define PCI_CHIP_R420_JI                0x4A49
+#define PCI_CHIP_R420_JJ                0x4A4A
+#define PCI_CHIP_R420_JK                0x4A4B
+#define PCI_CHIP_R420_JL                0x4A4C
+#define PCI_CHIP_R420_JM                0x4A4D
+#define PCI_CHIP_R420_JN                0x4A4E
+#define PCI_CHIP_R420_JP                0x4A50
+#define PCI_CHIP_MACH64LB              0x4C42
+#define PCI_CHIP_MACH64LD              0x4C44
+#define PCI_CHIP_RAGE128LE             0x4C45
+#define PCI_CHIP_RAGE128LF             0x4C46
+#define PCI_CHIP_MACH64LG              0x4C47
+#define PCI_CHIP_MACH64LI              0x4C49
+#define PCI_CHIP_MACH64LM              0x4C4D
+#define PCI_CHIP_MACH64LN              0x4C4E
+#define PCI_CHIP_MACH64LP              0x4C50
+#define PCI_CHIP_MACH64LQ              0x4C51
+#define PCI_CHIP_MACH64LR              0x4C52
+#define PCI_CHIP_MACH64LS              0x4C53
+#define PCI_CHIP_MACH64LT              0x4C54
+#define PCI_CHIP_RADEON_LW             0x4C57
+#define PCI_CHIP_RADEON_LX             0x4C58
+#define PCI_CHIP_RADEON_LY             0x4C59
+#define PCI_CHIP_RADEON_LZ             0x4C5A
+#define PCI_CHIP_RV250_Ld              0x4C64
+#define PCI_CHIP_RV250_Le              0x4C65
+#define PCI_CHIP_RV250_Lf              0x4C66
+#define PCI_CHIP_RV250_Lg              0x4C67
+#define PCI_CHIP_RV250_Ln              0x4C6E
+#define PCI_CHIP_RAGE128MF             0x4D46
+#define PCI_CHIP_RAGE128ML             0x4D4C
+#define PCI_CHIP_R300_ND               0x4E44
+#define PCI_CHIP_R300_NE               0x4E45
+#define PCI_CHIP_R300_NF               0x4E46
+#define PCI_CHIP_R300_NG               0x4E47
+#define PCI_CHIP_R350_NH                0x4E48
+#define PCI_CHIP_R350_NI                0x4E49
+#define PCI_CHIP_R360_NJ                0x4E4A
+#define PCI_CHIP_R350_NK                0x4E4B
+#define PCI_CHIP_RV350_NP               0x4E50
+#define PCI_CHIP_RV350_NQ               0x4E51
+#define PCI_CHIP_RV350_NR               0x4E52
+#define PCI_CHIP_RV350_NS               0x4E53
+#define PCI_CHIP_RV350_NT               0x4E54
+#define PCI_CHIP_RV350_NV               0x4E56
+#define PCI_CHIP_RAGE128PA             0x5041
+#define PCI_CHIP_RAGE128PB             0x5042
+#define PCI_CHIP_RAGE128PC             0x5043
+#define PCI_CHIP_RAGE128PD             0x5044
+#define PCI_CHIP_RAGE128PE             0x5045
+#define PCI_CHIP_RAGE128PF             0x5046
+#define PCI_CHIP_RAGE128PG             0x5047
+#define PCI_CHIP_RAGE128PH             0x5048
+#define PCI_CHIP_RAGE128PI             0x5049
+#define PCI_CHIP_RAGE128PJ             0x504A
+#define PCI_CHIP_RAGE128PK             0x504B
+#define PCI_CHIP_RAGE128PL             0x504C
+#define PCI_CHIP_RAGE128PM             0x504D
+#define PCI_CHIP_RAGE128PN             0x504E
+#define PCI_CHIP_RAGE128PO             0x504F
+#define PCI_CHIP_RAGE128PP             0x5050
+#define PCI_CHIP_RAGE128PQ             0x5051
+#define PCI_CHIP_RAGE128PR             0x5052
+#define PCI_CHIP_RAGE128PS             0x5053
+#define PCI_CHIP_RAGE128PT             0x5054
+#define PCI_CHIP_RAGE128PU             0x5055
+#define PCI_CHIP_RAGE128PV             0x5056
+#define PCI_CHIP_RAGE128PW             0x5057
+#define PCI_CHIP_RAGE128PX             0x5058
+#define PCI_CHIP_RADEON_QD             0x5144
+#define PCI_CHIP_RADEON_QE             0x5145
+#define PCI_CHIP_RADEON_QF             0x5146
+#define PCI_CHIP_RADEON_QG             0x5147
+#define PCI_CHIP_R200_QH               0x5148
+#define PCI_CHIP_R200_QI               0x5149
+#define PCI_CHIP_R200_QJ               0x514A
+#define PCI_CHIP_R200_QK               0x514B
+#define PCI_CHIP_R200_QL               0x514C
+#define PCI_CHIP_R200_QM               0x514D
+#define PCI_CHIP_R200_QN               0x514E
+#define PCI_CHIP_R200_QO               0x514F
+#define PCI_CHIP_RV200_QW              0x5157
+#define PCI_CHIP_RV200_QX              0x5158
+#define PCI_CHIP_RV100_QY              0x5159
+#define PCI_CHIP_RV100_QZ              0x515A
+#define PCI_CHIP_RN50                  0x515E
+#define PCI_CHIP_RAGE128RE             0x5245
+#define PCI_CHIP_RAGE128RF             0x5246
+#define PCI_CHIP_RAGE128RG             0x5247
+#define PCI_CHIP_RAGE128RK             0x524B
+#define PCI_CHIP_RAGE128RL             0x524C
+#define PCI_CHIP_RAGE128SE             0x5345
+#define PCI_CHIP_RAGE128SF             0x5346
+#define PCI_CHIP_RAGE128SG             0x5347
+#define PCI_CHIP_RAGE128SH             0x5348
+#define PCI_CHIP_RAGE128SK             0x534B
+#define PCI_CHIP_RAGE128SL             0x534C
+#define PCI_CHIP_RAGE128SM             0x534D
+#define PCI_CHIP_RAGE128SN             0x534E
+#define PCI_CHIP_RAGE128TF             0x5446
+#define PCI_CHIP_RAGE128TL             0x544C
+#define PCI_CHIP_RAGE128TR             0x5452
+#define PCI_CHIP_RAGE128TS             0x5453
+#define PCI_CHIP_RAGE128TT             0x5454
+#define PCI_CHIP_RAGE128TU             0x5455
+#define PCI_CHIP_RV370_5460             0x5460
+#define PCI_CHIP_RV370_5461             0x5461
+#define PCI_CHIP_RV370_5462             0x5462
+#define PCI_CHIP_RV370_5463             0x5463
+#define PCI_CHIP_RV370_5464             0x5464
+#define PCI_CHIP_RV370_5465             0x5465
+#define PCI_CHIP_RV370_5466             0x5466
+#define PCI_CHIP_RV370_5467             0x5467
+#define PCI_CHIP_R423_UH                0x5548
+#define PCI_CHIP_R423_UI                0x5549
+#define PCI_CHIP_R423_UJ                0x554A
+#define PCI_CHIP_R423_UK                0x554B
+#define PCI_CHIP_R423_UQ                0x5551
+#define PCI_CHIP_R423_UR                0x5552
+#define PCI_CHIP_R423_UT                0x5554
+#define PCI_CHIP_MACH64VT              0x5654
+#define PCI_CHIP_MACH64VU              0x5655
+#define PCI_CHIP_MACH64VV              0x5656
+#define PCI_CHIP_RS300_5834            0x5834
+#define PCI_CHIP_RS300_5835            0x5835
+#define PCI_CHIP_RS300_5836            0x5836
+#define PCI_CHIP_RS300_5837            0x5837
+#define PCI_CHIP_RV370_5B60             0x5B60
+#define PCI_CHIP_RV370_5B61             0x5B61
+#define PCI_CHIP_RV370_5B62             0x5B62
+#define PCI_CHIP_RV370_5B63             0x5B63
+#define PCI_CHIP_RV370_5B64             0x5B64
+#define PCI_CHIP_RV370_5B65             0x5B65
+#define PCI_CHIP_RV370_5B66             0x5B66
+#define PCI_CHIP_RV370_5B67             0x5B67
+#define PCI_CHIP_RV280_5960            0x5960
+#define PCI_CHIP_RV280_5961            0x5961
+#define PCI_CHIP_RV280_5962            0x5962
+#define PCI_CHIP_RV280_5964            0x5964
+#define PCI_CHIP_RV280_5C61            0x5C61
+#define PCI_CHIP_RV280_5C63            0x5C63
+#define PCI_CHIP_R423_5D57              0x5D57
+#define PCI_CHIP_RS350_7834             0x7834
+#define PCI_CHIP_RS350_7835             0x7835
diff --git a/drivers/ati_radeon_fb.c b/drivers/ati_radeon_fb.c
new file mode 100644 (file)
index 0000000..c174f37
--- /dev/null
@@ -0,0 +1,486 @@
+/*
+ * ATI Radeon Video card Framebuffer driver.
+ *
+ * Copyright 2007 Freescale Semiconductor, Inc.
+ * Zhang Wei <wei.zhang@freescale.com>
+ * Jason Jin <jason.jin@freescale.com>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ * Some codes of this file is partly ported from Linux kernel
+ * ATI video framebuffer driver.
+ *
+ * Now the driver is tested on below ATI chips:
+ *   9200
+ *   X300
+ *   X700
+ *
+ */
+
+#include <common.h>
+
+#ifdef CONFIG_ATI_RADEON_FB
+
+#include <command.h>
+#include <pci.h>
+#include <asm/processor.h>
+#include <asm/errno.h>
+#include <asm/io.h>
+#include <malloc.h>
+#include <video_fb.h>
+
+#include <radeon.h>
+#include "ati_ids.h"
+#include "ati_radeon_fb.h"
+
+#undef DEBUG
+
+#ifdef DEBUG
+#define DPRINT(x...) printf(x)
+#else
+#define DPRINT(x...) do{}while(0)
+#endif
+
+#ifndef min_t
+#define min_t(type,x,y) \
+       ({ type __x = (x); type __y = (y); __x < __y ? __x: __y; })
+#endif
+
+#define MAX_MAPPED_VRAM        (2048*2048*4)
+#define MIN_MAPPED_VRAM        (1024*768*1)
+
+/*#define PCI_VENDOR_ID_ATI*/
+#define PCI_CHIP_RV280_5960            0x5960
+#define PCI_CHIP_RV280_5961            0x5961
+#define PCI_CHIP_RV280_5962            0x5962
+#define PCI_CHIP_RV280_5964            0x5964
+#define PCI_CHIP_RV370_5B60            0x5B60
+#define PCI_CHIP_RV380_5657            0x5657
+#define PCI_CHIP_R420_554d             0x554d
+
+static struct pci_device_id ati_radeon_pci_ids[] = {
+       {PCI_VENDOR_ID_ATI, PCI_CHIP_RV280_5960},
+       {PCI_VENDOR_ID_ATI, PCI_CHIP_RV280_5961},
+       {PCI_VENDOR_ID_ATI, PCI_CHIP_RV280_5962},
+       {PCI_VENDOR_ID_ATI, PCI_CHIP_RV280_5964},
+       {PCI_VENDOR_ID_ATI, PCI_CHIP_RV370_5B60},
+       {PCI_VENDOR_ID_ATI, PCI_CHIP_RV380_5657},
+       {PCI_VENDOR_ID_ATI, PCI_CHIP_R420_554d},
+       {0, 0}
+};
+
+static u16 ati_radeon_id_family_table[][2] = {
+       {PCI_CHIP_RV280_5960, CHIP_FAMILY_RV280},
+       {PCI_CHIP_RV280_5961, CHIP_FAMILY_RV280},
+       {PCI_CHIP_RV280_5962, CHIP_FAMILY_RV280},
+       {PCI_CHIP_RV280_5964, CHIP_FAMILY_RV280},
+       {PCI_CHIP_RV370_5B60, CHIP_FAMILY_RV380},
+       {PCI_CHIP_RV380_5657, CHIP_FAMILY_RV380},
+       {PCI_CHIP_R420_554d,  CHIP_FAMILY_R420},
+       {0, 0}
+};
+
+u16 get_radeon_id_family(u16 device)
+{
+       int i;
+       for (i=0; ati_radeon_id_family_table[0][i]; i+=2)
+               if (ati_radeon_id_family_table[0][i] == device)
+                       return ati_radeon_id_family_table[0][i + 1];
+       return 0;
+}
+
+struct radeonfb_info *rinfo;
+
+static void radeon_identify_vram(struct radeonfb_info *rinfo)
+{
+       u32 tmp;
+
+       /* framebuffer size */
+       if ((rinfo->family == CHIP_FAMILY_RS100) ||
+               (rinfo->family == CHIP_FAMILY_RS200) ||
+               (rinfo->family == CHIP_FAMILY_RS300)) {
+               u32 tom = INREG(NB_TOM);
+               tmp = ((((tom >> 16) - (tom & 0xffff) + 1) << 6) * 1024);
+
+               radeon_fifo_wait(6);
+               OUTREG(MC_FB_LOCATION, tom);
+               OUTREG(DISPLAY_BASE_ADDR, (tom & 0xffff) << 16);
+               OUTREG(CRTC2_DISPLAY_BASE_ADDR, (tom & 0xffff) << 16);
+               OUTREG(OV0_BASE_ADDR, (tom & 0xffff) << 16);
+
+               /* This is supposed to fix the crtc2 noise problem. */
+               OUTREG(GRPH2_BUFFER_CNTL, INREG(GRPH2_BUFFER_CNTL) & ~0x7f0000);
+
+               if ((rinfo->family == CHIP_FAMILY_RS100) ||
+                       (rinfo->family == CHIP_FAMILY_RS200)) {
+               /* This is to workaround the asic bug for RMX, some versions
+                  of BIOS dosen't have this register initialized correctly.
+               */
+                       OUTREGP(CRTC_MORE_CNTL, CRTC_H_CUTOFF_ACTIVE_EN,
+                               ~CRTC_H_CUTOFF_ACTIVE_EN);
+               }
+       } else {
+               tmp = INREG(CONFIG_MEMSIZE);
+       }
+
+       /* mem size is bits [28:0], mask off the rest */
+       rinfo->video_ram = tmp & CONFIG_MEMSIZE_MASK;
+
+       /*
+        * Hack to get around some busted production M6's
+        * reporting no ram
+        */
+       if (rinfo->video_ram == 0) {
+               switch (rinfo->pdev.device) {
+               case PCI_CHIP_RADEON_LY:
+               case PCI_CHIP_RADEON_LZ:
+                       rinfo->video_ram = 8192 * 1024;
+                       break;
+               default:
+                       break;
+               }
+       }
+
+       /*
+        * Now try to identify VRAM type
+        */
+       if ((rinfo->family >= CHIP_FAMILY_R300) ||
+           (INREG(MEM_SDRAM_MODE_REG) & (1<<30)))
+               rinfo->vram_ddr = 1;
+       else
+               rinfo->vram_ddr = 0;
+
+       tmp = INREG(MEM_CNTL);
+       if (IS_R300_VARIANT(rinfo)) {
+               tmp &=  R300_MEM_NUM_CHANNELS_MASK;
+               switch (tmp) {
+               case 0:  rinfo->vram_width = 64; break;
+               case 1:  rinfo->vram_width = 128; break;
+               case 2:  rinfo->vram_width = 256; break;
+               default: rinfo->vram_width = 128; break;
+               }
+       } else if ((rinfo->family == CHIP_FAMILY_RV100) ||
+                  (rinfo->family == CHIP_FAMILY_RS100) ||
+                  (rinfo->family == CHIP_FAMILY_RS200)){
+               if (tmp & RV100_MEM_HALF_MODE)
+                       rinfo->vram_width = 32;
+               else
+                       rinfo->vram_width = 64;
+       } else {
+               if (tmp & MEM_NUM_CHANNELS_MASK)
+                       rinfo->vram_width = 128;
+               else
+                       rinfo->vram_width = 64;
+       }
+
+       /* This may not be correct, as some cards can have half of channel disabled
+        * ToDo: identify these cases
+        */
+
+       DPRINT("radeonfb: Found %ldk of %s %d bits wide videoram\n",
+              rinfo->video_ram / 1024,
+              rinfo->vram_ddr ? "DDR" : "SDRAM",
+              rinfo->vram_width);
+
+}
+
+static void radeon_write_pll_regs(struct radeonfb_info *rinfo, struct radeon_regs *mode)
+{
+       int i;
+
+       radeon_fifo_wait(20);
+
+#if 0
+       /* Workaround from XFree */
+       if (rinfo->is_mobility) {
+               /* A temporal workaround for the occational blanking on certain laptop
+                * panels. This appears to related to the PLL divider registers
+                * (fail to lock?). It occurs even when all dividers are the same
+                * with their old settings. In this case we really don't need to
+                * fiddle with PLL registers. By doing this we can avoid the blanking
+                * problem with some panels.
+                */
+               if ((mode->ppll_ref_div == (INPLL(PPLL_REF_DIV) & PPLL_REF_DIV_MASK)) &&
+                   (mode->ppll_div_3 == (INPLL(PPLL_DIV_3) &
+                                         (PPLL_POST3_DIV_MASK | PPLL_FB3_DIV_MASK)))) {
+                       /* We still have to force a switch to selected PPLL div thanks to
+                        * an XFree86 driver bug which will switch it away in some cases
+                        * even when using UseFDev */
+                       OUTREGP(CLOCK_CNTL_INDEX,
+                               mode->clk_cntl_index & PPLL_DIV_SEL_MASK,
+                               ~PPLL_DIV_SEL_MASK);
+                       radeon_pll_errata_after_index(rinfo);
+                       radeon_pll_errata_after_data(rinfo);
+                       return;
+               }
+       }
+#endif
+       if(rinfo->pdev.device == PCI_CHIP_RV370_5B60) return;
+
+       /* Swich VCKL clock input to CPUCLK so it stays fed while PPLL updates*/
+       OUTPLLP(VCLK_ECP_CNTL, VCLK_SRC_SEL_CPUCLK, ~VCLK_SRC_SEL_MASK);
+
+       /* Reset PPLL & enable atomic update */
+       OUTPLLP(PPLL_CNTL,
+               PPLL_RESET | PPLL_ATOMIC_UPDATE_EN | PPLL_VGA_ATOMIC_UPDATE_EN,
+               ~(PPLL_RESET | PPLL_ATOMIC_UPDATE_EN | PPLL_VGA_ATOMIC_UPDATE_EN));
+
+       /* Switch to selected PPLL divider */
+       OUTREGP(CLOCK_CNTL_INDEX,
+               mode->clk_cntl_index & PPLL_DIV_SEL_MASK,
+               ~PPLL_DIV_SEL_MASK);
+
+       /* Set PPLL ref. div */
+       if (rinfo->family == CHIP_FAMILY_R300 ||
+           rinfo->family == CHIP_FAMILY_RS300 ||
+           rinfo->family == CHIP_FAMILY_R350 ||
+           rinfo->family == CHIP_FAMILY_RV350) {
+               if (mode->ppll_ref_div & R300_PPLL_REF_DIV_ACC_MASK) {
+                       /* When restoring console mode, use saved PPLL_REF_DIV
+                        * setting.
+                        */
+                       OUTPLLP(PPLL_REF_DIV, mode->ppll_ref_div, 0);
+               } else {
+                       /* R300 uses ref_div_acc field as real ref divider */
+                       OUTPLLP(PPLL_REF_DIV,
+                               (mode->ppll_ref_div << R300_PPLL_REF_DIV_ACC_SHIFT),
+                               ~R300_PPLL_REF_DIV_ACC_MASK);
+               }
+       } else
+               OUTPLLP(PPLL_REF_DIV, mode->ppll_ref_div, ~PPLL_REF_DIV_MASK);
+
+       /* Set PPLL divider 3 & post divider*/
+       OUTPLLP(PPLL_DIV_3, mode->ppll_div_3, ~PPLL_FB3_DIV_MASK);
+       OUTPLLP(PPLL_DIV_3, mode->ppll_div_3, ~PPLL_POST3_DIV_MASK);
+
+       /* Write update */
+       while (INPLL(PPLL_REF_DIV) & PPLL_ATOMIC_UPDATE_R)
+               ;
+       OUTPLLP(PPLL_REF_DIV, PPLL_ATOMIC_UPDATE_W, ~PPLL_ATOMIC_UPDATE_W);
+
+       /* Wait read update complete */
+       /* FIXME: Certain revisions of R300 can't recover here.  Not sure of
+          the cause yet, but this workaround will mask the problem for now.
+          Other chips usually will pass at the very first test, so the
+          workaround shouldn't have any effect on them. */
+       for (i = 0; (i < 10000 && INPLL(PPLL_REF_DIV) & PPLL_ATOMIC_UPDATE_R); i++)
+               ;
+
+       OUTPLL(HTOTAL_CNTL, 0);
+
+       /* Clear reset & atomic update */
+       OUTPLLP(PPLL_CNTL, 0,
+               ~(PPLL_RESET | PPLL_SLEEP | PPLL_ATOMIC_UPDATE_EN | PPLL_VGA_ATOMIC_UPDATE_EN));
+
+       /* We may want some locking ... oh well */
+       udelay(5000);
+
+       /* Switch back VCLK source to PPLL */
+       OUTPLLP(VCLK_ECP_CNTL, VCLK_SRC_SEL_PPLLCLK, ~VCLK_SRC_SEL_MASK);
+}
+
+typedef struct {
+       u16 reg;
+       u32 val;
+} reg_val;
+
+
+/* these common regs are cleared before mode setting so they do not
+ * interfere with anything
+ */
+static reg_val common_regs[] = {
+       { OVR_CLR, 0 },
+       { OVR_WID_LEFT_RIGHT, 0 },
+       { OVR_WID_TOP_BOTTOM, 0 },
+       { OV0_SCALE_CNTL, 0 },
+       { SUBPIC_CNTL, 0 },
+       { VIPH_CONTROL, 0 },
+       { I2C_CNTL_1, 0 },
+       { GEN_INT_CNTL, 0 },
+       { CAP0_TRIG_CNTL, 0 },
+       { CAP1_TRIG_CNTL, 0 },
+};
+
+
+void radeon_setmode(void)
+{
+       int i;
+       struct radeon_regs *mode = malloc(sizeof(struct radeon_regs));
+
+       mode->crtc_gen_cntl = 0x03000200;
+       mode->crtc_ext_cntl = 0x00008048;
+       mode->dac_cntl = 0xff002100;
+       mode->crtc_h_total_disp = 0x4f0063;
+       mode->crtc_h_sync_strt_wid = 0x8c02a2;
+       mode->crtc_v_total_disp = 0x01df020c;
+       mode->crtc_v_sync_strt_wid = 0x8201ea;
+       mode->crtc_pitch = 0x00500050;
+
+       OUTREG(CRTC_GEN_CNTL, mode->crtc_gen_cntl);
+       OUTREGP(CRTC_EXT_CNTL, mode->crtc_ext_cntl,
+               ~(CRTC_HSYNC_DIS | CRTC_VSYNC_DIS | CRTC_DISPLAY_DIS));
+       OUTREGP(DAC_CNTL, mode->dac_cntl, DAC_RANGE_CNTL | DAC_BLANKING);
+       OUTREG(CRTC_H_TOTAL_DISP, mode->crtc_h_total_disp);
+       OUTREG(CRTC_H_SYNC_STRT_WID, mode->crtc_h_sync_strt_wid);
+       OUTREG(CRTC_V_TOTAL_DISP, mode->crtc_v_total_disp);
+       OUTREG(CRTC_V_SYNC_STRT_WID, mode->crtc_v_sync_strt_wid);
+       OUTREG(CRTC_OFFSET, 0);
+       OUTREG(CRTC_OFFSET_CNTL, 0);
+       OUTREG(CRTC_PITCH, mode->crtc_pitch);
+
+       mode->clk_cntl_index = 0x300;
+       mode->ppll_ref_div = 0xc;
+       mode->ppll_div_3 = 0x00030059;
+
+       radeon_write_pll_regs(rinfo, mode);
+}
+
+int radeon_probe(struct radeonfb_info *rinfo)
+{
+       pci_dev_t pdev;
+       u16 did;
+
+       pdev = pci_find_devices(ati_radeon_pci_ids, 0);
+
+       if (pdev != -1) {
+               pci_read_config_word(pdev, PCI_DEVICE_ID, &did);
+               printf("ATI Radeon video card (%04x, %04x) found @(%d:%d:%d)\n",
+                               PCI_VENDOR_ID_ATI, did, (pdev >> 16) & 0xff,
+                               (pdev >> 11) & 0x1f, (pdev >> 8) & 0x7);
+
+               strcpy(rinfo->name, "ATI Radeon");
+               rinfo->pdev.vendor = PCI_VENDOR_ID_ATI;
+               rinfo->pdev.device = did;
+               rinfo->family = get_radeon_id_family(rinfo->pdev.device);
+               pci_read_config_dword(pdev, PCI_BASE_ADDRESS_0,
+                               &rinfo->fb_base_phys);
+               pci_read_config_dword(pdev, PCI_BASE_ADDRESS_2,
+                               &rinfo->mmio_base_phys);
+               rinfo->fb_base_phys &= 0xfffff000;
+               rinfo->mmio_base_phys &= ~0x04;
+
+               rinfo->mmio_base = (void *)rinfo->mmio_base_phys;
+               DPRINT("rinfo->mmio_base = 0x%x\n",rinfo->mmio_base);
+               rinfo->fb_local_base = INREG(MC_FB_LOCATION) << 16;
+               DPRINT("rinfo->fb_local_base = 0x%x\n",rinfo->fb_local_base);
+               /* PostBIOS with x86 emulater */
+               BootVideoCardBIOS(pdev, NULL, 0);
+
+               /*
+                * Check for errata
+                * (These will be added in the future for the chipfamily
+                * R300, RV200, RS200, RV100, RS100.)
+                */
+
+               /* Get VRAM size and type */
+               radeon_identify_vram(rinfo);
+
+               rinfo->mapped_vram = min_t(unsigned long, MAX_MAPPED_VRAM,
+                               rinfo->video_ram);
+               rinfo->fb_base = (void *)rinfo->fb_base_phys;
+
+               DPRINT("Radeon: framebuffer base phy address 0x%08x," \
+                     "MMIO base phy address 0x%08x," \
+                     "framebuffer local base 0x%08x.\n ",
+                     rinfo->fb_base_phys, rinfo->mmio_base_phys,
+                     rinfo->fb_local_base);
+
+               return 0;
+       }
+       return -1;
+}
+
+/*
+ * The Graphic Device
+ */
+GraphicDevice ctfb;
+
+#define CURSOR_SIZE    0x1000  /* in KByte for HW Cursor */
+#define PATTERN_ADR    (pGD->dprBase + CURSOR_SIZE)    /* pattern Memory after Cursor Memory */
+#define PATTERN_SIZE   8*8*4   /* 4 Bytes per Pixel 8 x 8 Pixel */
+#define ACCELMEMORY    (CURSOR_SIZE + PATTERN_SIZE)    /* reserved Memory for BITBlt and hw cursor */
+
+void *video_hw_init(void)
+{
+       GraphicDevice *pGD = (GraphicDevice *) & ctfb;
+       int i;
+       u32 *vm;
+
+       rinfo = malloc(sizeof(struct radeonfb_info));
+
+       if(radeon_probe(rinfo)) {
+               printf("No radeon video card found!\n");
+               return NULL;
+       }
+
+       /* fill in Graphic device struct */
+       sprintf (pGD->modeIdent, "%dx%dx%d %ldkHz %ldHz", 640,
+                480, 16, (1000 / 1000),
+                (2000 / 1000));
+       printf ("%s\n", pGD->modeIdent);
+
+       pGD->winSizeX = 640;
+       pGD->winSizeY = 480;
+       pGD->plnSizeX = 640;
+       pGD->plnSizeY = 480;
+
+       pGD->gdfBytesPP = 1;
+       pGD->gdfIndex = GDF__8BIT_INDEX;
+
+       pGD->isaBase = CFG_ISA_IO_BASE_ADDRESS;
+       pGD->pciBase = rinfo->fb_base_phys;
+       pGD->frameAdrs = rinfo->fb_base_phys;
+       pGD->memSize = 64 * 1024 * 1024;
+
+       /* Cursor Start Address */
+       pGD->dprBase =
+           (pGD->winSizeX * pGD->winSizeY * pGD->gdfBytesPP) + rinfo->fb_base_phys;
+       if ((pGD->dprBase & 0x0fff) != 0) {
+               /* allign it */
+               pGD->dprBase &= 0xfffff000;
+               pGD->dprBase += 0x00001000;
+       }
+       DPRINT ("Cursor Start %x Pattern Start %x\n", pGD->dprBase,
+               PATTERN_ADR);
+       pGD->vprBase = rinfo->fb_base_phys;     /* Dummy */
+       pGD->cprBase = rinfo->fb_base_phys;     /* Dummy */
+       /* set up Hardware */
+
+       /* Clear video memory */
+       i = pGD->memSize / 4;
+       vm = (unsigned int *) pGD->pciBase;
+       while (i--)
+               *vm++ = 0;
+       /*SetDrawingEngine (bits_per_pixel);*/
+
+       radeon_setmode();
+
+       return ((void *) pGD);
+}
+
+void video_set_lut (unsigned int index,        /* color number */
+              unsigned char r, /* red */
+              unsigned char g, /* green */
+              unsigned char b  /* blue */
+              )
+{
+       OUTREG(PALETTE_INDEX, index);
+       OUTREG(PALETTE_DATA, (r << 16) | (g << 8) | b);
+}
+#endif
diff --git a/drivers/ati_radeon_fb.h b/drivers/ati_radeon_fb.h
new file mode 100644 (file)
index 0000000..b5c4b8b
--- /dev/null
@@ -0,0 +1,282 @@
+#ifndef __ATI_RADEON_FB_H
+#define __ATI_RADEON_FB_H
+
+/***************************************************************
+ * Most of the definitions here are adapted right from XFree86 *
+ ***************************************************************/
+
+/*
+ * Chip families. Must fit in the low 16 bits of a long word
+ */
+enum radeon_family {
+       CHIP_FAMILY_UNKNOW,
+       CHIP_FAMILY_LEGACY,
+       CHIP_FAMILY_RADEON,
+       CHIP_FAMILY_RV100,
+       CHIP_FAMILY_RS100,    /* U1 (IGP320M) or A3 (IGP320)*/
+       CHIP_FAMILY_RV200,
+       CHIP_FAMILY_RS200,    /* U2 (IGP330M/340M/350M) or A4 (IGP330/340/345/350),
+                                RS250 (IGP 7000) */
+       CHIP_FAMILY_R200,
+       CHIP_FAMILY_RV250,
+       CHIP_FAMILY_RS300,    /* Radeon 9000 IGP */
+       CHIP_FAMILY_RV280,
+       CHIP_FAMILY_R300,
+       CHIP_FAMILY_R350,
+       CHIP_FAMILY_RV350,
+       CHIP_FAMILY_RV380,    /* RV370/RV380/M22/M24 */
+       CHIP_FAMILY_R420,     /* R420/R423/M18 */
+       CHIP_FAMILY_LAST,
+};
+
+#define IS_RV100_VARIANT(rinfo) (((rinfo)->family == CHIP_FAMILY_RV100)  || \
+                                ((rinfo)->family == CHIP_FAMILY_RV200)  || \
+                                ((rinfo)->family == CHIP_FAMILY_RS100)  || \
+                                ((rinfo)->family == CHIP_FAMILY_RS200)  || \
+                                ((rinfo)->family == CHIP_FAMILY_RV250)  || \
+                                ((rinfo)->family == CHIP_FAMILY_RV280)  || \
+                                ((rinfo)->family == CHIP_FAMILY_RS300))
+
+#define IS_R300_VARIANT(rinfo) (((rinfo)->family == CHIP_FAMILY_R300)  || \
+                               ((rinfo)->family == CHIP_FAMILY_RV350) || \
+                               ((rinfo)->family == CHIP_FAMILY_R350)  || \
+                               ((rinfo)->family == CHIP_FAMILY_RV380) || \
+                               ((rinfo)->family == CHIP_FAMILY_R420))
+
+struct radeonfb_info {
+       char name[20];
+
+       struct pci_device_id    pdev;
+       u16                     family;
+
+       u32                     fb_base_phys;
+       u32                     mmio_base_phys;
+
+       void                    *mmio_base;
+       void                    *fb_base;
+
+       u32                     video_ram;
+       u32                     mapped_vram;
+       int                     vram_width;
+       int                     vram_ddr;
+
+       u32                     fb_local_base;
+};
+
+#define INREG8(addr)           readb((rinfo->mmio_base)+addr)
+#define OUTREG8(addr,val)      writeb(val, (rinfo->mmio_base)+addr)
+#define INREG16(addr)          readw((rinfo->mmio_base)+addr)
+#define OUTREG16(addr,val)     writew(val, (rinfo->mmio_base)+addr)
+#define INREG(addr)            readl((rinfo->mmio_base)+addr)
+#define OUTREG(addr,val)       writel(val, (rinfo->mmio_base)+addr)
+
+static inline void _OUTREGP(struct radeonfb_info *rinfo, u32 addr,
+                      u32 val, u32 mask)
+{
+       unsigned int tmp;
+
+       tmp = INREG(addr);
+       tmp &= (mask);
+       tmp |= (val);
+       OUTREG(addr, tmp);
+}
+
+#define OUTREGP(addr,val,mask) _OUTREGP(rinfo, addr, val,mask)
+
+/*
+ * 2D Engine helper routines
+ */
+static inline void radeon_engine_flush (struct radeonfb_info *rinfo)
+{
+       int i;
+
+       /* initiate flush */
+       OUTREGP(RB2D_DSTCACHE_CTLSTAT, RB2D_DC_FLUSH_ALL,
+               ~RB2D_DC_FLUSH_ALL);
+
+       for (i=0; i < 2000000; i++) {
+               if (!(INREG(RB2D_DSTCACHE_CTLSTAT) & RB2D_DC_BUSY))
+                       return;
+               udelay(1);
+       }
+       printf("radeonfb: Flush Timeout !\n");
+}
+
+static inline void _radeon_fifo_wait(struct radeonfb_info *rinfo, int entries)
+{
+       int i;
+
+       for (i=0; i<2000000; i++) {
+               if ((INREG(RBBM_STATUS) & 0x7f) >= entries)
+                       return;
+               udelay(1);
+       }
+       printf("radeonfb: FIFO Timeout !\n");
+}
+
+static inline void _radeon_engine_idle(struct radeonfb_info *rinfo)
+{
+       int i;
+
+       /* ensure FIFO is empty before waiting for idle */
+       _radeon_fifo_wait (rinfo, 64);
+
+       for (i=0; i<2000000; i++) {
+               if (((INREG(RBBM_STATUS) & GUI_ACTIVE)) == 0) {
+                       radeon_engine_flush (rinfo);
+                       return;
+               }
+               udelay(1);
+       }
+       printf("radeonfb: Idle Timeout !\n");
+}
+
+#define radeon_engine_idle()           _radeon_engine_idle(rinfo)
+#define radeon_fifo_wait(entries)      _radeon_fifo_wait(rinfo,entries)
+#define radeon_msleep(ms)              _radeon_msleep(rinfo,ms)
+
+/*
+ * This structure contains the various registers manipulated by this
+ * driver for setting or restoring a mode. It's mostly copied from
+ * XFree's RADEONSaveRec structure. A few chip settings might still be
+ * tweaked without beeing reflected or saved in these registers though
+ */
+struct radeon_regs {
+       /* Common registers */
+       u32             ovr_clr;
+       u32             ovr_wid_left_right;
+       u32             ovr_wid_top_bottom;
+       u32             ov0_scale_cntl;
+       u32             mpp_tb_config;
+       u32             mpp_gp_config;
+       u32             subpic_cntl;
+       u32             viph_control;
+       u32             i2c_cntl_1;
+       u32             gen_int_cntl;
+       u32             cap0_trig_cntl;
+       u32             cap1_trig_cntl;
+       u32             bus_cntl;
+       u32             surface_cntl;
+       u32             bios_5_scratch;
+
+       /* Other registers to save for VT switches or driver load/unload */
+       u32             dp_datatype;
+       u32             rbbm_soft_reset;
+       u32             clock_cntl_index;
+       u32             amcgpio_en_reg;
+       u32             amcgpio_mask;
+
+       /* Surface/tiling registers */
+       u32             surf_lower_bound[8];
+       u32             surf_upper_bound[8];
+       u32             surf_info[8];
+
+       /* CRTC registers */
+       u32             crtc_gen_cntl;
+       u32             crtc_ext_cntl;
+       u32             dac_cntl;
+       u32             crtc_h_total_disp;
+       u32             crtc_h_sync_strt_wid;
+       u32             crtc_v_total_disp;
+       u32             crtc_v_sync_strt_wid;
+       u32             crtc_offset;
+       u32             crtc_offset_cntl;
+       u32             crtc_pitch;
+       u32             disp_merge_cntl;
+       u32             grph_buffer_cntl;
+       u32             crtc_more_cntl;
+
+       /* CRTC2 registers */
+       u32             crtc2_gen_cntl;
+       u32             dac2_cntl;
+       u32             disp_output_cntl;
+       u32             disp_hw_debug;
+       u32             disp2_merge_cntl;
+       u32             grph2_buffer_cntl;
+       u32             crtc2_h_total_disp;
+       u32             crtc2_h_sync_strt_wid;
+       u32             crtc2_v_total_disp;
+       u32             crtc2_v_sync_strt_wid;
+       u32             crtc2_offset;
+       u32             crtc2_offset_cntl;
+       u32             crtc2_pitch;
+
+       /* Flat panel regs */
+       u32             fp_crtc_h_total_disp;
+       u32             fp_crtc_v_total_disp;
+       u32             fp_gen_cntl;
+       u32             fp2_gen_cntl;
+       u32             fp_h_sync_strt_wid;
+       u32             fp2_h_sync_strt_wid;
+       u32             fp_horz_stretch;
+       u32             fp_panel_cntl;
+       u32             fp_v_sync_strt_wid;
+       u32             fp2_v_sync_strt_wid;
+       u32             fp_vert_stretch;
+       u32             lvds_gen_cntl;
+       u32             lvds_pll_cntl;
+       u32             tmds_crc;
+       u32             tmds_transmitter_cntl;
+
+       /* Computed values for PLL */
+       u32             dot_clock_freq;
+       int             feedback_div;
+       int             post_div;
+
+       /* PLL registers */
+       u32             ppll_div_3;
+       u32             ppll_ref_div;
+       u32             vclk_ecp_cntl;
+       u32             clk_cntl_index;
+
+       /* Computed values for PLL2 */
+       u32             dot_clock_freq_2;
+       int             feedback_div_2;
+       int             post_div_2;
+
+       /* PLL2 registers */
+       u32             p2pll_ref_div;
+       u32             p2pll_div_0;
+       u32             htotal_cntl2;
+
+       /* Palette */
+       int             palette_valid;
+};
+
+static inline u32 __INPLL(struct radeonfb_info *rinfo, u32 addr)
+{
+       u32 data;
+
+       OUTREG8(CLOCK_CNTL_INDEX, addr & 0x0000003f);
+       /* radeon_pll_errata_after_index(rinfo); */
+       data = INREG(CLOCK_CNTL_DATA);
+       /* radeon_pll_errata_after_data(rinfo); */
+       return data;
+}
+
+static inline void __OUTPLL(struct radeonfb_info *rinfo, unsigned int index,
+                           u32 val)
+{
+
+       OUTREG8(CLOCK_CNTL_INDEX, (index & 0x0000003f) | 0x00000080);
+       /* radeon_pll_errata_after_index(rinfo); */
+       OUTREG(CLOCK_CNTL_DATA, val);
+       /* radeon_pll_errata_after_data(rinfo); */
+}
+
+static inline void __OUTPLLP(struct radeonfb_info *rinfo, unsigned int index,
+                            u32 val, u32 mask)
+{
+       unsigned int tmp;
+
+       tmp  = __INPLL(rinfo, index);
+       tmp &= (mask);
+       tmp |= (val);
+       __OUTPLL(rinfo, index, tmp);
+}
+
+#define INPLL(addr)                    __INPLL(rinfo, addr)
+#define OUTPLL(index, val)             __OUTPLL(rinfo, index, val)
+#define OUTPLLP(index, val, mask)      __OUTPLLP(rinfo, index, val, mask)
+
+#endif
index 5f632a64692a8253482bc516d0eb859607d43527..703cda4865318ddfa35ad56730c1d7c3d053e7a2 100644 (file)
@@ -6,8 +6,8 @@
 
 #include <common.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET) && (!defined(CONFIG_NET_MULTI)) && \
-       defined(CONFIG_BCM570x)
+#if defined(CONFIG_CMD_NET) \
+       && (!defined(CONFIG_NET_MULTI)) && defined(CONFIG_BCM570x)
 
 #ifdef CONFIG_BMW
 #include <mpc824x.h>
@@ -1688,4 +1688,4 @@ QQ_GetTail(
     return pQueue->Array[Idx];
 }
 
-#endif /* CFG_CMD_NET, !CONFIG_NET_MULTI, CONFIG_BCM570x */
+#endif
diff --git a/drivers/bios_emulator/Makefile b/drivers/bios_emulator/Makefile
new file mode 100644 (file)
index 0000000..ba7d436
--- /dev/null
@@ -0,0 +1,30 @@
+include $(TOPDIR)/config.mk
+
+LIB := libatibiosemu.a
+
+X86DIR  = ./x86emu
+
+OBJS   = atibios.o biosemu.o besys.o bios.o  \
+       $(X86DIR)/decode.o \
+       $(X86DIR)/ops2.o \
+       $(X86DIR)/ops.o \
+       $(X86DIR)/prim_ops.o \
+       $(X86DIR)/sys.o \
+       $(X86DIR)/debug.o
+
+CFLAGS += -I. -I./include  -I$(X86DIR) -I$(TOPDIR)/include \
+       -D__PPC__  -D__BIG_ENDIAN__
+
+all:   $(LIB)
+
+$(LIB): $(OBJS)
+       $(AR) crv $@ $(OBJS)
+
+#########################################################################
+
+.depend:       Makefile $(OBJS:.o=.c)
+               $(CC) -M $(CFLAGS) $(OBJS:.o=.c) > $@
+
+sinclude .depend
+
+#########################################################################
diff --git a/drivers/bios_emulator/atibios.c b/drivers/bios_emulator/atibios.c
new file mode 100644 (file)
index 0000000..5779f99
--- /dev/null
@@ -0,0 +1,340 @@
+/****************************************************************************
+*
+*                   Video BOOT Graphics Card POST Module
+*
+*  ========================================================================
+*   Copyright (C) 2007 Freescale Semiconductor, Inc. All rights reserved.
+*   Jason Jin <Jason.jin@freescale.com>
+*
+*   Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
+*
+*   This file may be distributed and/or modified under the terms of the
+*   GNU General Public License version 2.0 as published by the Free
+*   Software Foundation and appearing in the file LICENSE.GPL included
+*   in the packaging of this file.
+*
+*   Licensees holding a valid Commercial License for this product from
+*   SciTech Software, Inc. may use this file in accordance with the
+*   Commercial License Agreement provided with the Software.
+*
+*   This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING
+*   THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+*   PURPOSE.
+*
+*   See http://www.scitechsoft.com/license/ for information about
+*   the licensing options available and how to purchase a Commercial
+*   License Agreement.
+*
+*   Contact license@scitechsoft.com if any conditions of this licensing
+*   are not clear to you, or you have questions about licensing options.
+*
+*  ========================================================================
+*
+* Language:    ANSI C
+* Environment: Linux Kernel
+* Developer:   Kendall Bennett
+*
+* Description: Module to implement booting PCI/AGP controllers on the
+*              bus. We use the x86 real mode emulator to run the BIOS on
+*              graphics controllers to bring the cards up.
+*
+*              Note that at present this module does *not* support
+*              multiple controllers.
+*
+*              The orignal name of this file is warmboot.c.
+*              Jason ported this file to u-boot to run the ATI video card
+*              BIOS in u-boot.
+****************************************************************************/
+#include <common.h>
+
+#ifdef CONFIG_BIOSEMU
+
+#include "biosemui.h"
+#include <malloc.h>
+
+/* Length of the BIOS image */
+#define MAX_BIOSLEN        (128 * 1024L)
+
+/* Define some useful types and macros */
+#define true               1
+#define false              0
+
+/* Place to save PCI BAR's that we change and later restore */
+static u32 saveROMBaseAddress;
+static u32 saveBaseAddress10;
+static u32 saveBaseAddress14;
+static u32 saveBaseAddress18;
+static u32 saveBaseAddress20;
+
+/****************************************************************************
+PARAMETERS:
+pcidev - PCI device info for the video card on the bus to boot
+VGAInfo - BIOS emulator VGA info structure
+
+REMARKS:
+This function executes the BIOS POST code on the controller. We assume that
+at this stage the controller has its I/O and memory space enabled and
+that all other controllers are in a disabled state.
+****************************************************************************/
+static void PCI_doBIOSPOST(pci_dev_t pcidev, BE_VGAInfo * VGAInfo)
+{
+       RMREGS regs;
+       RMSREGS sregs;
+
+       /* Determine the value to store in AX for BIOS POST. Per the PCI specs,
+        AH must contain the bus and AL must contain the devfn, encoded as
+        (dev << 3) | fn
+        */
+       memset(&regs, 0, sizeof(regs));
+       memset(&sregs, 0, sizeof(sregs));
+       regs.x.ax = ((int)PCI_BUS(pcidev) << 8) |
+           ((int)PCI_DEV(pcidev) << 3) | (int)PCI_FUNC(pcidev);
+
+       /*Setup the X86 emulator for the VGA BIOS*/
+       BE_setVGA(VGAInfo);
+
+       /*Execute the BIOS POST code*/
+       BE_callRealMode(0xC000, 0x0003, &regs, &sregs);
+
+       /*Cleanup and exit*/
+       BE_getVGA(VGAInfo);
+}
+
+/****************************************************************************
+PARAMETERS:
+pcidev - PCI device info for the video card on the bus
+bar    - Place to return the base address register offset to use
+
+RETURNS:
+The address to use to map the secondary BIOS (AGP devices)
+
+REMARKS:
+Searches all the PCI base address registers for the device looking for a
+memory mapping that is large enough to hold our ROM BIOS. We usually end up
+finding the framebuffer mapping (usually BAR 0x10), and we use this mapping
+to map the BIOS for the device into. We use a mapping that is already
+assigned to the device to ensure the memory range will be passed through
+by any PCI->PCI or AGP->PCI bridge that may be present.
+
+NOTE: Usually this function is only used for AGP devices, but it may be
+      used for PCI devices that have already been POST'ed and the BIOS
+      ROM base address has been zero'ed out.
+
+NOTE: This function leaves the original memory aperture disabled by leaving
+      it programmed to all 1's. It must be restored to the correct value
+      later.
+****************************************************************************/
+static u32 PCI_findBIOSAddr(pci_dev_t pcidev, int *bar)
+{
+       u32 base, size;
+
+       for (*bar = 0x10; *bar <= 0x14; (*bar) += 4) {
+               pci_read_config_dword(pcidev, *bar, &base);
+               if (!(base & 0x1)) {
+                       pci_write_config_dword(pcidev, *bar, 0xFFFFFFFF);
+                       pci_read_config_dword(pcidev, *bar, &size);
+                       size = ~(size & ~0xFF) + 1;
+                       if (size >= MAX_BIOSLEN)
+                               return base & ~0xFF;
+               }
+       }
+       return 0;
+}
+
+/****************************************************************************
+REMARKS:
+Some non-x86 Linux kernels map PCI relocateable I/O to values that
+are above 64K, which will not work with the BIOS image that requires
+the offset for the I/O ports to be a maximum of 16-bits. Ideally
+someone should fix the kernel to map the I/O ports for VGA compatible
+devices to a different location (or just all I/O ports since it is
+unlikely you can have enough devices in the machine to use up all
+64K of the I/O space - a total of more than 256 cards would be
+necessary).
+
+Anyway to fix this we change all I/O mapped base registers and
+chop off the top bits.
+****************************************************************************/
+static void PCI_fixupIObase(pci_dev_t pcidev, int reg, u32 * base)
+{
+       if ((*base & 0x1) && (*base > 0xFFFE)) {
+               *base &= 0xFFFF;
+               pci_write_config_dword(pcidev, reg, *base);
+
+       }
+}
+
+/****************************************************************************
+PARAMETERS:
+pcidev - PCI device info for the video card on the bus
+
+RETURNS:
+Pointers to the mapped BIOS image
+
+REMARKS:
+Maps a pointer to the BIOS image on the graphics card on the PCI bus.
+****************************************************************************/
+void *PCI_mapBIOSImage(pci_dev_t pcidev)
+{
+       u32 BIOSImagePhys;
+       int BIOSImageBAR;
+       u8 *BIOSImage;
+
+       /*Save PCI BAR registers that might get changed*/
+       pci_read_config_dword(pcidev, PCI_ROM_ADDRESS, &saveROMBaseAddress);
+       pci_read_config_dword(pcidev, PCI_BASE_ADDRESS_0, &saveBaseAddress10);
+       pci_read_config_dword(pcidev, PCI_BASE_ADDRESS_1, &saveBaseAddress14);
+       pci_read_config_dword(pcidev, PCI_BASE_ADDRESS_2, &saveBaseAddress18);
+       pci_read_config_dword(pcidev, PCI_BASE_ADDRESS_4, &saveBaseAddress20);
+
+       /*Fix up I/O base registers to less than 64K */
+       if(saveBaseAddress14 != 0)
+               PCI_fixupIObase(pcidev, PCI_BASE_ADDRESS_1, &saveBaseAddress14);
+       else
+               PCI_fixupIObase(pcidev, PCI_BASE_ADDRESS_4, &saveBaseAddress20);
+
+       /* Some cards have problems that stop us from being able to read the
+        BIOS image from the ROM BAR. To fix this we have to do some chipset
+        specific programming for different cards to solve this problem.
+       */
+
+       if ((BIOSImagePhys = PCI_findBIOSAddr(pcidev, &BIOSImageBAR)) == 0) {
+               printf("Find bios addr error\n");
+               return NULL;
+       }
+
+       BIOSImage = (u8 *) BIOSImagePhys;
+
+       /*Change the PCI BAR registers to map it onto the bus.*/
+       pci_write_config_dword(pcidev, BIOSImageBAR, 0);
+       pci_write_config_dword(pcidev, PCI_ROM_ADDRESS, BIOSImagePhys | 0x1);
+
+       udelay(1);
+
+       /*Check that the BIOS image is valid. If not fail, or return the
+        compiled in BIOS image if that option was enabled
+        */
+       if (BIOSImage[0] != 0x55 || BIOSImage[1] != 0xAA || BIOSImage[2] == 0) {
+               return NULL;
+       }
+
+       return BIOSImage;
+}
+
+/****************************************************************************
+PARAMETERS:
+pcidev - PCI device info for the video card on the bus
+
+REMARKS:
+Unmaps the BIOS image for the device and restores framebuffer mappings
+****************************************************************************/
+void PCI_unmapBIOSImage(pci_dev_t pcidev, void *BIOSImage)
+{
+       pci_write_config_dword(pcidev, PCI_ROM_ADDRESS, saveROMBaseAddress);
+       pci_write_config_dword(pcidev, PCI_BASE_ADDRESS_0, saveBaseAddress10);
+       pci_write_config_dword(pcidev, PCI_BASE_ADDRESS_1, saveBaseAddress14);
+       pci_write_config_dword(pcidev, PCI_BASE_ADDRESS_2, saveBaseAddress18);
+       pci_write_config_dword(pcidev, PCI_BASE_ADDRESS_4, saveBaseAddress20);
+}
+
+/****************************************************************************
+PARAMETERS:
+pcidev - PCI device info for the video card on the bus to boot
+VGAInfo - BIOS emulator VGA info structure
+
+RETURNS:
+True if successfully initialised, false if not.
+
+REMARKS:
+Loads and POST's the display controllers BIOS, directly from the BIOS
+image we can extract over the PCI bus.
+****************************************************************************/
+static int PCI_postController(pci_dev_t pcidev, BE_VGAInfo * VGAInfo)
+{
+       u32 BIOSImageLen;
+       uchar *mappedBIOS;
+       uchar *copyOfBIOS;
+
+       /*Allocate memory to store copy of BIOS from display controller*/
+       if ((mappedBIOS = PCI_mapBIOSImage(pcidev)) == NULL) {
+               printf("videoboot: Video ROM failed to map!\n");
+               return false;
+       }
+
+       BIOSImageLen = mappedBIOS[2] * 512;
+
+       if ((copyOfBIOS = malloc(BIOSImageLen)) == NULL) {
+               printf("videoboot: Out of memory!\n");
+               return false;
+       }
+       memcpy(copyOfBIOS, mappedBIOS, BIOSImageLen);
+
+       PCI_unmapBIOSImage(pcidev, mappedBIOS);
+
+       /*Save information in VGAInfo structure*/
+       VGAInfo->function = PCI_FUNC(pcidev);
+       VGAInfo->device = PCI_DEV(pcidev);
+       VGAInfo->bus = PCI_BUS(pcidev);
+       VGAInfo->pcidev = pcidev;
+       VGAInfo->BIOSImage = copyOfBIOS;
+       VGAInfo->BIOSImageLen = BIOSImageLen;
+
+       /*Now execute the BIOS POST for the device*/
+       if (copyOfBIOS[0] != 0x55 || copyOfBIOS[1] != 0xAA) {
+               printf("videoboot: Video ROM image is invalid!\n");
+               return false;
+       }
+
+       PCI_doBIOSPOST(pcidev, VGAInfo);
+
+       /*Reset the size of the BIOS image to the final size*/
+       VGAInfo->BIOSImageLen = copyOfBIOS[2] * 512;
+       return true;
+}
+
+/****************************************************************************
+PARAMETERS:
+pcidev     - PCI device info for the video card on the bus to boot
+pVGAInfo    - Place to return VGA info structure is requested
+cleanUp            - True to clean up on exit, false to leave emulator active
+
+REMARKS:
+Boots the PCI/AGP video card on the bus using the Video ROM BIOS image
+and the X86 BIOS emulator module.
+****************************************************************************/
+int BootVideoCardBIOS(pci_dev_t pcidev, BE_VGAInfo ** pVGAInfo, int cleanUp)
+{
+       BE_VGAInfo *VGAInfo;
+
+       printf("videoboot: Booting PCI video card bus %d, function %d, device %d\n",
+            PCI_BUS(pcidev), PCI_FUNC(pcidev), PCI_DEV(pcidev));
+
+       /*Initialise the x86 BIOS emulator*/
+       if ((VGAInfo = malloc(sizeof(*VGAInfo))) == NULL) {
+               printf("videoboot: Out of memory!\n");
+               return false;
+       }
+       memset(VGAInfo, 0, sizeof(*VGAInfo));
+       BE_init(0, 65536, VGAInfo, 0);
+
+       /*Post all the display controller BIOS'es*/
+       PCI_postController(pcidev, VGAInfo);
+
+       /*Cleanup and exit the emulator if requested. If the BIOS emulator
+       is needed after booting the card, we will not call BE_exit and
+       leave it enabled for further use (ie: VESA driver etc).
+       */
+       if (cleanUp) {
+               BE_exit();
+               if (VGAInfo->BIOSImage)
+                       free(VGAInfo->BIOSImage);
+               free(VGAInfo);
+               VGAInfo = NULL;
+       }
+       /*Return VGA info pointer if the caller requested it*/
+       if (pVGAInfo)
+               *pVGAInfo = VGAInfo;
+       return true;
+}
+
+#endif
diff --git a/drivers/bios_emulator/besys.c b/drivers/bios_emulator/besys.c
new file mode 100644 (file)
index 0000000..2a8e1a0
--- /dev/null
@@ -0,0 +1,719 @@
+/****************************************************************************
+*
+*                        BIOS emulator and interface
+*                      to Realmode X86 Emulator Library
+*
+*  ========================================================================
+*
+*   Copyright (C) 2007 Freescale Semiconductor, Inc. All rights reserved.
+*   Jason Jin<Jason.jin@freescale.com>
+*
+*   Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
+*
+*   This file may be distributed and/or modified under the terms of the
+*   GNU General Public License version 2.0 as published by the Free
+*   Software Foundation and appearing in the file LICENSE.GPL included
+*   in the packaging of this file.
+*
+*   Licensees holding a valid Commercial License for this product from
+*   SciTech Software, Inc. may use this file in accordance with the
+*   Commercial License Agreement provided with the Software.
+*
+*   This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING
+*   THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+*   PURPOSE.
+*
+*   See http://www.scitechsoft.com/license/ for information about
+*   the licensing options available and how to purchase a Commercial
+*   License Agreement.
+*
+*   Contact license@scitechsoft.com if any conditions of this licensing
+*   are not clear to you, or you have questions about licensing options.
+*
+*  ========================================================================
+*
+* Language:     ANSI C
+* Environment:  Any
+* Developer:    Kendall Bennett
+*
+* Description:  This file includes BIOS emulator I/O and memory access
+*               functions.
+*
+*              Jason ported this file to u-boot to run the ATI video card
+*              BIOS in u-boot. Removed some emulate functions such as the
+*              timer port access. Made all the VGA port except reading 0x3c3
+*              be emulated. Seems like reading 0x3c3 should return the high
+*              16 bit of the io port.
+*
+****************************************************************************/
+
+#include "biosemui.h"
+
+/*------------------------- Global Variables ------------------------------*/
+
+#ifndef __i386__
+static char *BE_biosDate = "08/14/99";
+static u8 BE_model = 0xFC;
+static u8 BE_submodel = 0x00;
+#endif
+
+/*----------------------------- Implementation ----------------------------*/
+
+/****************************************************************************
+PARAMETERS:
+addr    - Emulator memory address to convert
+
+RETURNS:
+Actual memory address to read or write the data
+
+REMARKS:
+This function converts an emulator memory address in a 32-bit range to
+a real memory address that we wish to access. It handles splitting up the
+memory address space appropriately to access the emulator BIOS image, video
+memory and system BIOS etc.
+****************************************************************************/
+static u8 *BE_memaddr(u32 addr)
+{
+       if (addr >= 0xC0000 && addr <= _BE_env.biosmem_limit) {
+               return (u8*)(_BE_env.biosmem_base + addr - 0xC0000);
+       } else if (addr > _BE_env.biosmem_limit && addr < 0xD0000) {
+               DB(printf("BE_memaddr: address %#lx may be invalid!\n", addr);)
+               return M.mem_base;
+       } else if (addr >= 0xA0000 && addr <= 0xBFFFF) {
+               return (u8*)(_BE_env.busmem_base + addr - 0xA0000);
+       }
+#ifdef __i386__
+       else if (addr >= 0xD0000 && addr <= 0xFFFFF) {
+               /* We map the real System BIOS directly on real PC's */
+               DB(printf("BE_memaddr: System BIOS address %#lx\n", addr);)
+                   return _BE_env.busmem_base + addr - 0xA0000;
+       }
+#else
+       else if (addr >= 0xFFFF5 && addr < 0xFFFFE) {
+               /* Return a faked BIOS date string for non-x86 machines */
+               DB(printf("BE_memaddr - Returning BIOS date\n");)
+               return BE_biosDate + addr - 0xFFFF5;
+       } else if (addr == 0xFFFFE) {
+               /* Return system model identifier for non-x86 machines */
+               DB(printf("BE_memaddr - Returning model\n");)
+               return &BE_model;
+       } else if (addr == 0xFFFFF) {
+               /* Return system submodel identifier for non-x86 machines */
+               DB(printf("BE_memaddr - Returning submodel\n");)
+               return &BE_submodel;
+       }
+#endif
+       else if (addr > M.mem_size - 1) {
+               HALT_SYS();
+               return M.mem_base;
+       }
+
+       return M.mem_base + addr;
+}
+
+/****************************************************************************
+PARAMETERS:
+addr    - Emulator memory address to read
+
+RETURNS:
+Byte value read from emulator memory.
+
+REMARKS:
+Reads a byte value from the emulator memory. We have three distinct memory
+regions that are handled differently, which this function handles.
+****************************************************************************/
+u8 X86API BE_rdb(u32 addr)
+{
+       if (_BE_env.emulateVGA && addr >= 0xA0000 && addr <= 0xBFFFF)
+               return 0;
+       else {
+               u8 val = readb_le(BE_memaddr(addr));
+               return val;
+       }
+}
+
+/****************************************************************************
+PARAMETERS:
+addr    - Emulator memory address to read
+
+RETURNS:
+Word value read from emulator memory.
+
+REMARKS:
+Reads a word value from the emulator memory. We have three distinct memory
+regions that are handled differently, which this function handles.
+****************************************************************************/
+u16 X86API BE_rdw(u32 addr)
+{
+       if (_BE_env.emulateVGA && addr >= 0xA0000 && addr <= 0xBFFFF)
+               return 0;
+       else {
+               u8 *base = BE_memaddr(addr);
+               u16 val = readw_le(base);
+               return val;
+       }
+}
+
+/****************************************************************************
+PARAMETERS:
+addr    - Emulator memory address to read
+
+RETURNS:
+Long value read from emulator memory.
+
+REMARKS:
+Reads a 32-bit value from the emulator memory. We have three distinct memory
+regions that are handled differently, which this function handles.
+****************************************************************************/
+u32 X86API BE_rdl(u32 addr)
+{
+       if (_BE_env.emulateVGA && addr >= 0xA0000 && addr <= 0xBFFFF)
+               return 0;
+       else {
+               u8 *base = BE_memaddr(addr);
+               u32 val = readl_le(base);
+               return val;
+       }
+}
+
+/****************************************************************************
+PARAMETERS:
+addr    - Emulator memory address to read
+val     - Value to store
+
+REMARKS:
+Writes a byte value to emulator memory. We have three distinct memory
+regions that are handled differently, which this function handles.
+****************************************************************************/
+void X86API BE_wrb(u32 addr, u8 val)
+{
+       if (!(_BE_env.emulateVGA && addr >= 0xA0000 && addr <= 0xBFFFF)) {
+               writeb_le(BE_memaddr(addr), val);
+       }
+}
+
+/****************************************************************************
+PARAMETERS:
+addr    - Emulator memory address to read
+val     - Value to store
+
+REMARKS:
+Writes a word value to emulator memory. We have three distinct memory
+regions that are handled differently, which this function handles.
+****************************************************************************/
+void X86API BE_wrw(u32 addr, u16 val)
+{
+       if (!(_BE_env.emulateVGA && addr >= 0xA0000 && addr <= 0xBFFFF)) {
+               u8 *base = BE_memaddr(addr);
+               writew_le(base, val);
+
+       }
+}
+
+/****************************************************************************
+PARAMETERS:
+addr    - Emulator memory address to read
+val     - Value to store
+
+REMARKS:
+Writes a 32-bit value to emulator memory. We have three distinct memory
+regions that are handled differently, which this function handles.
+****************************************************************************/
+void X86API BE_wrl(u32 addr, u32 val)
+{
+       if (!(_BE_env.emulateVGA && addr >= 0xA0000 && addr <= 0xBFFFF)) {
+               u8 *base = BE_memaddr(addr);
+               writel_le(base, val);
+       }
+}
+
+#if defined(DEBUG) || !defined(__i386__)
+
+/* For Non-Intel machines we may need to emulate some I/O port accesses that
+ * the BIOS may try to access, such as the PCI config registers.
+ */
+
+#define IS_TIMER_PORT(port) (0x40 <= port && port <= 0x43)
+#define IS_CMOS_PORT(port)  (0x70 <= port && port <= 0x71)
+/*#define IS_VGA_PORT(port)   (_BE_env.emulateVGA && 0x3C0 <= port && port <= 0x3DA)*/
+#define IS_VGA_PORT(port)   (0x3C0 <= port && port <= 0x3DA)
+#define IS_PCI_PORT(port)   (0xCF8 <= port && port <= 0xCFF)
+#define IS_SPKR_PORT(port)  (port == 0x61)
+
+/****************************************************************************
+PARAMETERS:
+port    - Port to read from
+type    - Type of access to perform
+
+REMARKS:
+Performs an emulated read from the Standard VGA I/O ports. If the target
+hardware does not support mapping the VGA I/O and memory (such as some
+PowerPC systems), we emulate the VGA so that the BIOS will still be able to
+set NonVGA display modes such as on ATI hardware.
+****************************************************************************/
+static u8 VGA_inpb (const int port)
+{
+       u8 val = 0xff;
+
+       switch (port) {
+       case 0x3C0:
+               /* 3C0 has funky characteristics because it can act as either
+                  a data register or index register depending on the state
+                  of an internal flip flop in the hardware. Hence we have
+                  to emulate that functionality in here. */
+               if (_BE_env.flipFlop3C0 == 0) {
+                       /* Access 3C0 as index register */
+                       val = _BE_env.emu3C0;
+               } else {
+                       /* Access 3C0 as data register */
+                       if (_BE_env.emu3C0 < ATT_C)
+                               val = _BE_env.emu3C1[_BE_env.emu3C0];
+               }
+               _BE_env.flipFlop3C0 ^= 1;
+               break;
+       case 0x3C1:
+               if (_BE_env.emu3C0 < ATT_C)
+                       return _BE_env.emu3C1[_BE_env.emu3C0];
+               break;
+       case 0x3CC:
+               return _BE_env.emu3C2;
+       case 0x3C4:
+               return _BE_env.emu3C4;
+       case 0x3C5:
+               if (_BE_env.emu3C4 < ATT_C)
+                       return _BE_env.emu3C5[_BE_env.emu3C4];
+               break;
+       case 0x3C6:
+               return _BE_env.emu3C6;
+       case 0x3C7:
+               return _BE_env.emu3C7;
+       case 0x3C8:
+               return _BE_env.emu3C8;
+       case 0x3C9:
+               if (_BE_env.emu3C7 < PAL_C)
+                       return _BE_env.emu3C9[_BE_env.emu3C7++];
+               break;
+       case 0x3CE:
+               return _BE_env.emu3CE;
+       case 0x3CF:
+               if (_BE_env.emu3CE < GRA_C)
+                       return _BE_env.emu3CF[_BE_env.emu3CE];
+               break;
+       case 0x3D4:
+               if (_BE_env.emu3C2 & 0x1)
+                       return _BE_env.emu3D4;
+               break;
+       case 0x3D5:
+               if ((_BE_env.emu3C2 & 0x1) && (_BE_env.emu3D4 < CRT_C))
+                       return _BE_env.emu3D5[_BE_env.emu3D4];
+               break;
+       case 0x3DA:
+               _BE_env.flipFlop3C0 = 0;
+               val = _BE_env.emu3DA;
+               _BE_env.emu3DA ^= 0x9;
+               break;
+       }
+       return val;
+}
+
+/****************************************************************************
+PARAMETERS:
+port    - Port to write to
+type    - Type of access to perform
+
+REMARKS:
+Performs an emulated write to one of the 8253 timer registers. For now
+we only emulate timer 0 which is the only timer that the BIOS code appears
+to use.
+****************************************************************************/
+static void VGA_outpb (int port, u8 val)
+{
+       switch (port) {
+       case 0x3C0:
+               /* 3C0 has funky characteristics because it can act as either
+                  a data register or index register depending on the state
+                  of an internal flip flop in the hardware. Hence we have
+                  to emulate that functionality in here. */
+               if (_BE_env.flipFlop3C0 == 0) {
+                       /* Access 3C0 as index register */
+                       _BE_env.emu3C0 = val;
+               } else {
+                       /* Access 3C0 as data register */
+                       if (_BE_env.emu3C0 < ATT_C)
+                               _BE_env.emu3C1[_BE_env.emu3C0] = val;
+               }
+               _BE_env.flipFlop3C0 ^= 1;
+               break;
+       case 0x3C2:
+               _BE_env.emu3C2 = val;
+               break;
+       case 0x3C4:
+               _BE_env.emu3C4 = val;
+               break;
+       case 0x3C5:
+               if (_BE_env.emu3C4 < ATT_C)
+                       _BE_env.emu3C5[_BE_env.emu3C4] = val;
+               break;
+       case 0x3C6:
+               _BE_env.emu3C6 = val;
+               break;
+       case 0x3C7:
+               _BE_env.emu3C7 = (int) val *3;
+
+               break;
+       case 0x3C8:
+               _BE_env.emu3C8 = (int) val *3;
+
+               break;
+       case 0x3C9:
+               if (_BE_env.emu3C8 < PAL_C)
+                       _BE_env.emu3C9[_BE_env.emu3C8++] = val;
+               break;
+       case 0x3CE:
+               _BE_env.emu3CE = val;
+               break;
+       case 0x3CF:
+               if (_BE_env.emu3CE < GRA_C)
+                       _BE_env.emu3CF[_BE_env.emu3CE] = val;
+               break;
+       case 0x3D4:
+               if (_BE_env.emu3C2 & 0x1)
+                       _BE_env.emu3D4 = val;
+               break;
+       case 0x3D5:
+               if ((_BE_env.emu3C2 & 0x1) && (_BE_env.emu3D4 < CRT_C))
+                       _BE_env.emu3D5[_BE_env.emu3D4] = val;
+               break;
+       }
+}
+
+/****************************************************************************
+PARAMETERS:
+regOffset   - Offset into register space for non-DWORD accesses
+value       - Value to write to register for PCI_WRITE_* operations
+func        - Function to perform (PCIAccessRegFlags)
+
+RETURNS:
+Value read from configuration register for PCI_READ_* operations
+
+REMARKS:
+Accesses a PCI configuration space register by decoding the value currently
+stored in the _BE_env.configAddress variable and passing it through to the
+portable PCI_accessReg function.
+****************************************************************************/
+static u32 BE_accessReg(int regOffset, u32 value, int func)
+{
+#ifdef __KERNEL__
+       int function, device, bus;
+       u8 val8;
+       u16 val16;
+       u32 val32;
+
+
+       /* Decode the configuration register values for the register we wish to
+        * access
+        */
+       regOffset += (_BE_env.configAddress & 0xFF);
+       function = (_BE_env.configAddress >> 8) & 0x7;
+       device = (_BE_env.configAddress >> 11) & 0x1F;
+       bus = (_BE_env.configAddress >> 16) & 0xFF;
+
+       /* Ignore accesses to all devices other than the one we're POSTing */
+       if ((function == _BE_env.vgaInfo.function) &&
+           (device == _BE_env.vgaInfo.device) &&
+           (bus == _BE_env.vgaInfo.bus)) {
+               switch (func) {
+               case REG_READ_BYTE:
+                       pci_read_config_byte(_BE_env.vgaInfo.pcidev, regOffset,
+                                            &val8);
+                       return val8;
+               case REG_READ_WORD:
+                       pci_read_config_word(_BE_env.vgaInfo.pcidev, regOffset,
+                                            &val16);
+                       return val16;
+               case REG_READ_DWORD:
+                       pci_read_config_dword(_BE_env.vgaInfo.pcidev, regOffset,
+                                             &val32);
+                       return val32;
+               case REG_WRITE_BYTE:
+                       pci_write_config_byte(_BE_env.vgaInfo.pcidev, regOffset,
+                                             value);
+
+                       return 0;
+               case REG_WRITE_WORD:
+                       pci_write_config_word(_BE_env.vgaInfo.pcidev, regOffset,
+                                             value);
+
+                       return 0;
+               case REG_WRITE_DWORD:
+                       pci_write_config_dword(_BE_env.vgaInfo.pcidev,
+                                              regOffset, value);
+
+                       return 0;
+               }
+       }
+       return 0;
+#else
+       PCIDeviceInfo pciInfo;
+
+       pciInfo.mech1 = 1;
+       pciInfo.slot.i = 0;
+       pciInfo.slot.p.Function = (_BE_env.configAddress >> 8) & 0x7;
+       pciInfo.slot.p.Device = (_BE_env.configAddress >> 11) & 0x1F;
+       pciInfo.slot.p.Bus = (_BE_env.configAddress >> 16) & 0xFF;
+       pciInfo.slot.p.Enable = 1;
+
+       /* Ignore accesses to all devices other than the one we're POSTing */
+       if ((pciInfo.slot.p.Function ==
+            _BE_env.vgaInfo.pciInfo->slot.p.Function)
+           && (pciInfo.slot.p.Device == _BE_env.vgaInfo.pciInfo->slot.p.Device)
+           && (pciInfo.slot.p.Bus == _BE_env.vgaInfo.pciInfo->slot.p.Bus))
+               return PCI_accessReg((_BE_env.configAddress & 0xFF) + regOffset,
+                                    value, func, &pciInfo);
+       return 0;
+#endif
+}
+
+/****************************************************************************
+PARAMETERS:
+port    - Port to read from
+type    - Type of access to perform
+
+REMARKS:
+Performs an emulated read from one of the PCI configuration space registers.
+We emulate this using our PCI_accessReg function which will access the PCI
+configuration space registers in a portable fashion.
+****************************************************************************/
+static u32 PCI_inp(int port, int type)
+{
+       switch (type) {
+       case REG_READ_BYTE:
+               if ((_BE_env.configAddress & 0x80000000) && 0xCFC <= port
+                   && port <= 0xCFF)
+                       return BE_accessReg(port - 0xCFC, 0, REG_READ_BYTE);
+               break;
+       case REG_READ_WORD:
+               if ((_BE_env.configAddress & 0x80000000) && 0xCFC <= port
+                   && port <= 0xCFF)
+                       return BE_accessReg(port - 0xCFC, 0, REG_READ_WORD);
+               break;
+       case REG_READ_DWORD:
+               if (port == 0xCF8)
+                       return _BE_env.configAddress;
+               else if ((_BE_env.configAddress & 0x80000000) && port == 0xCFC)
+                       return BE_accessReg(0, 0, REG_READ_DWORD);
+               break;
+       }
+       return 0;
+}
+
+/****************************************************************************
+PARAMETERS:
+port    - Port to write to
+type    - Type of access to perform
+
+REMARKS:
+Performs an emulated write to one of the PCI control registers.
+****************************************************************************/
+static void PCI_outp(int port, u32 val, int type)
+{
+       switch (type) {
+       case REG_WRITE_BYTE:
+               if ((_BE_env.configAddress & 0x80000000) && 0xCFC <= port
+                   && port <= 0xCFF)
+                       BE_accessReg(port - 0xCFC, val, REG_WRITE_BYTE);
+               break;
+       case REG_WRITE_WORD:
+               if ((_BE_env.configAddress & 0x80000000) && 0xCFC <= port
+                   && port <= 0xCFF)
+                       BE_accessReg(port - 0xCFC, val, REG_WRITE_WORD);
+               break;
+       case REG_WRITE_DWORD:
+               if (port == 0xCF8)
+               {
+                       _BE_env.configAddress = val & 0x80FFFFFC;
+               }
+               else if ((_BE_env.configAddress & 0x80000000) && port == 0xCFC)
+                       BE_accessReg(0, val, REG_WRITE_DWORD);
+               break;
+       }
+}
+
+#endif
+
+/****************************************************************************
+PARAMETERS:
+port    - Port to write to
+
+RETURNS:
+Value read from the I/O port
+
+REMARKS:
+Performs an emulated 8-bit read from an I/O port. We handle special cases
+that we need to emulate in here, and fall through to reflecting the write
+through to the real hardware if we don't need to special case it.
+****************************************************************************/
+u8 X86API BE_inb(X86EMU_pioAddr port)
+{
+       u8 val = 0;
+
+#if defined(DEBUG) || !defined(__i386__)
+       if (IS_VGA_PORT(port)){
+               /*seems reading port 0x3c3 return the high 16 bit of io port*/
+               if(port == 0x3c3)
+                       val = LOG_inpb(port);
+               else
+                       val = VGA_inpb(port);
+       }
+       else if (IS_TIMER_PORT(port))
+               DB(printf("Can not interept TIMER port now!\n");)
+       else if (IS_SPKR_PORT(port))
+               DB(printf("Can not interept SPEAKER port now!\n");)
+       else if (IS_CMOS_PORT(port))
+               DB(printf("Can not interept CMOS port now!\n");)
+       else if (IS_PCI_PORT(port))
+               val = PCI_inp(port, REG_READ_BYTE);
+       else if (port < 0x100) {
+               DB(printf("WARN: INVALID inb.%04X -> %02X\n", (u16) port, val);)
+               val = LOG_inpb(port);
+       } else
+#endif
+               val = LOG_inpb(port);
+       return val;
+}
+
+/****************************************************************************
+PARAMETERS:
+port    - Port to write to
+
+RETURNS:
+Value read from the I/O port
+
+REMARKS:
+Performs an emulated 16-bit read from an I/O port. We handle special cases
+that we need to emulate in here, and fall through to reflecting the write
+through to the real hardware if we don't need to special case it.
+****************************************************************************/
+u16 X86API BE_inw(X86EMU_pioAddr port)
+{
+       u16 val = 0;
+
+#if defined(DEBUG) || !defined(__i386__)
+       if (IS_PCI_PORT(port))
+               val = PCI_inp(port, REG_READ_WORD);
+       else if (port < 0x100) {
+               DB(printf("WARN: Maybe INVALID inw.%04X -> %04X\n", (u16) port, val);)
+               val = LOG_inpw(port);
+       } else
+#endif
+               val = LOG_inpw(port);
+       return val;
+}
+
+/****************************************************************************
+PARAMETERS:
+port    - Port to write to
+
+RETURNS:
+Value read from the I/O port
+
+REMARKS:
+Performs an emulated 32-bit read from an I/O port. We handle special cases
+that we need to emulate in here, and fall through to reflecting the write
+through to the real hardware if we don't need to special case it.
+****************************************************************************/
+u32 X86API BE_inl(X86EMU_pioAddr port)
+{
+       u32 val = 0;
+
+#if defined(DEBUG) || !defined(__i386__)
+       if (IS_PCI_PORT(port))
+               val = PCI_inp(port, REG_READ_DWORD);
+       else if (port < 0x100) {
+               val = LOG_inpd(port);
+       } else
+#endif
+               val = LOG_inpd(port);
+       return val;
+}
+
+/****************************************************************************
+PARAMETERS:
+port    - Port to write to
+val     - Value to write to port
+
+REMARKS:
+Performs an emulated 8-bit write to an I/O port. We handle special cases
+that we need to emulate in here, and fall through to reflecting the write
+through to the real hardware if we don't need to special case it.
+****************************************************************************/
+void X86API BE_outb(X86EMU_pioAddr port, u8 val)
+{
+#if defined(DEBUG) || !defined(__i386__)
+       if (IS_VGA_PORT(port))
+               VGA_outpb(port, val);
+       else if (IS_TIMER_PORT(port))
+               DB(printf("Can not interept TIMER port now!\n");)
+       else if (IS_SPKR_PORT(port))
+               DB(printf("Can not interept SPEAKER port now!\n");)
+       else if (IS_CMOS_PORT(port))
+               DB(printf("Can not interept CMOS port now!\n");)
+       else if (IS_PCI_PORT(port))
+               PCI_outp(port, val, REG_WRITE_BYTE);
+       else if (port < 0x100) {
+               DB(printf("WARN:Maybe INVALID outb.%04X <- %02X\n", (u16) port, val);)
+               LOG_outpb(port, val);
+       } else
+#endif
+               LOG_outpb(port, val);
+}
+
+/****************************************************************************
+PARAMETERS:
+port    - Port to write to
+val     - Value to write to port
+
+REMARKS:
+Performs an emulated 16-bit write to an I/O port. We handle special cases
+that we need to emulate in here, and fall through to reflecting the write
+through to the real hardware if we don't need to special case it.
+****************************************************************************/
+void X86API BE_outw(X86EMU_pioAddr port, u16 val)
+{
+#if defined(DEBUG) || !defined(__i386__)
+               if (IS_VGA_PORT(port)) {
+                       VGA_outpb(port, val);
+                       VGA_outpb(port + 1, val >> 8);
+               } else if (IS_PCI_PORT(port))
+                       PCI_outp(port, val, REG_WRITE_WORD);
+               else if (port < 0x100) {
+                       DB(printf("WARN: MAybe INVALID outw.%04X <- %04X\n", (u16) port,
+                              val);)
+                       LOG_outpw(port, val);
+               } else
+#endif
+                       LOG_outpw(port, val);
+}
+
+/****************************************************************************
+PARAMETERS:
+port    - Port to write to
+val     - Value to write to port
+
+REMARKS:
+Performs an emulated 32-bit write to an I/O port. We handle special cases
+that we need to emulate in here, and fall through to reflecting the write
+through to the real hardware if we don't need to special case it.
+****************************************************************************/
+void X86API BE_outl(X86EMU_pioAddr port, u32 val)
+{
+#if defined(DEBUG) || !defined(__i386__)
+       if (IS_PCI_PORT(port))
+               PCI_outp(port, val, REG_WRITE_DWORD);
+       else if (port < 0x100) {
+               DB(printf("WARN: INVALID outl.%04X <- %08X\n", (u16) port,val);)
+               LOG_outpd(port, val);
+       } else
+#endif
+               LOG_outpd(port, val);
+}
diff --git a/drivers/bios_emulator/bios.c b/drivers/bios_emulator/bios.c
new file mode 100644 (file)
index 0000000..ed5437e
--- /dev/null
@@ -0,0 +1,321 @@
+/****************************************************************************
+*
+*                        BIOS emulator and interface
+*                      to Realmode X86 Emulator Library
+*
+*  Copyright (C) 2007 Freescale Semiconductor, Inc. All rights reserved.
+*  Jason Jin <Jason.jin@freescale.com>
+*
+*               Copyright (C) 1996-1999 SciTech Software, Inc.
+*
+*  ========================================================================
+*
+*  Permission to use, copy, modify, distribute, and sell this software and
+*  its documentation for any purpose is hereby granted without fee,
+*  provided that the above copyright notice appear in all copies and that
+*  both that copyright notice and this permission notice appear in
+*  supporting documentation, and that the name of the authors not be used
+*  in advertising or publicity pertaining to distribution of the software
+*  without specific, written prior permission.  The authors makes no
+*  representations about the suitability of this software for any purpose.
+*  It is provided "as is" without express or implied warranty.
+*
+*  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+*  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+*  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+*  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+*  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+*  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+*  PERFORMANCE OF THIS SOFTWARE.
+*
+*  ========================================================================
+*
+* Language:     ANSI C
+* Environment:  Any
+* Developer:    Kendall Bennett
+*
+* Description:  Module implementing the BIOS specific functions.
+*
+*              Jason ported this file to u-boot to run the ATI video card
+*              video BIOS.
+*
+****************************************************************************/
+
+#include "biosemui.h"
+
+/*----------------------------- Implementation ----------------------------*/
+
+/****************************************************************************
+PARAMETERS:
+intno   - Interrupt number being serviced
+
+REMARKS:
+Handler for undefined interrupts.
+****************************************************************************/
+static void X86API undefined_intr(int intno)
+{
+       if (BE_rdw(intno * 4 + 2) == BIOS_SEG) {
+               DB(printf("biosEmu: undefined interrupt %xh called!\n", intno);)
+       } else
+               X86EMU_prepareForInt(intno);
+}
+
+/****************************************************************************
+PARAMETERS:
+intno   - Interrupt number being serviced
+
+REMARKS:
+This function handles the default system BIOS Int 10h (the default is stored
+in the Int 42h vector by the system BIOS at bootup). We only need to handle
+a small number of special functions used by the BIOS during POST time.
+****************************************************************************/
+static void X86API int42(int intno)
+{
+       if (M.x86.R_AH == 0x12 && M.x86.R_BL == 0x32) {
+               if (M.x86.R_AL == 0) {
+                       /* Enable CPU accesses to video memory */
+                       PM_outpb(0x3c2, PM_inpb(0x3cc) | (u8) 0x02);
+                       return;
+               } else if (M.x86.R_AL == 1) {
+                       /* Disable CPU accesses to video memory */
+                       PM_outpb(0x3c2, PM_inpb(0x3cc) & (u8) ~ 0x02);
+                       return;
+               }
+#ifdef  DEBUG
+               else {
+                       printf("int42: unknown function AH=0x12, BL=0x32, AL=%#02x\n",
+                            M.x86.R_AL);
+               }
+#endif
+       }
+#ifdef  DEBUG
+       else {
+               printf("int42: unknown function AH=%#02x, AL=%#02x, BL=%#02x\n",
+                    M.x86.R_AH, M.x86.R_AL, M.x86.R_BL);
+       }
+#endif
+}
+
+/****************************************************************************
+PARAMETERS:
+intno   - Interrupt number being serviced
+
+REMARKS:
+This function handles the default system BIOS Int 10h. If the POST code
+has not yet re-vectored the Int 10h BIOS interrupt vector, we handle this
+by simply calling the int42 interrupt handler above. Very early in the
+BIOS POST process, the vector gets replaced and we simply let the real
+mode interrupt handler process the interrupt.
+****************************************************************************/
+static void X86API int10(int intno)
+{
+       if (BE_rdw(intno * 4 + 2) == BIOS_SEG)
+               int42(intno);
+       else
+               X86EMU_prepareForInt(intno);
+}
+
+/* Result codes returned by the PCI BIOS */
+
+#define SUCCESSFUL          0x00
+#define FUNC_NOT_SUPPORT    0x81
+#define BAD_VENDOR_ID       0x83
+#define DEVICE_NOT_FOUND    0x86
+#define BAD_REGISTER_NUMBER 0x87
+#define SET_FAILED          0x88
+#define BUFFER_TOO_SMALL    0x89
+
+/****************************************************************************
+PARAMETERS:
+intno   - Interrupt number being serviced
+
+REMARKS:
+This function handles the default Int 1Ah interrupt handler for the real
+mode code, which provides support for the PCI BIOS functions. Since we only
+want to allow the real mode BIOS code *only* see the PCI config space for
+its own device, we only return information for the specific PCI config
+space that we have passed in to the init function. This solves problems
+when using the BIOS to warm boot a secondary adapter when there is an
+identical adapter before it on the bus (some BIOS'es get confused in this
+case).
+****************************************************************************/
+static void X86API int1A(int unused)
+{
+       u16 pciSlot;
+
+#ifdef __KERNEL__
+       u8 interface, subclass, baseclass;
+
+       /* Initialise the PCI slot number */
+       pciSlot = ((int)_BE_env.vgaInfo.bus << 8) |
+           ((int)_BE_env.vgaInfo.device << 3) | (int)_BE_env.vgaInfo.function;
+#else
+/* Fail if no PCI device information has been registered */
+       if (!_BE_env.vgaInfo.pciInfo)
+               return;
+
+       pciSlot = (u16) (_BE_env.vgaInfo.pciInfo->slot.i >> 8);
+#endif
+       switch (M.x86.R_AX) {
+       case 0xB101:            /* PCI bios present? */
+               M.x86.R_AL = 0x00;      /* no config space/special cycle generation support */
+               M.x86.R_EDX = 0x20494350;       /* " ICP" */
+               M.x86.R_BX = 0x0210;    /* Version 2.10 */
+               M.x86.R_CL = 0; /* Max bus number in system */
+               CLEAR_FLAG(F_CF);
+               break;
+       case 0xB102:            /* Find PCI device */
+               M.x86.R_AH = DEVICE_NOT_FOUND;
+#ifdef __KERNEL__
+               if (M.x86.R_DX == _BE_env.vgaInfo.VendorID &&
+                   M.x86.R_CX == _BE_env.vgaInfo.DeviceID && M.x86.R_SI == 0) {
+#else
+               if (M.x86.R_DX == _BE_env.vgaInfo.pciInfo->VendorID &&
+                   M.x86.R_CX == _BE_env.vgaInfo.pciInfo->DeviceID &&
+                   M.x86.R_SI == 0) {
+#endif
+                       M.x86.R_AH = SUCCESSFUL;
+                       M.x86.R_BX = pciSlot;
+               }
+               CONDITIONAL_SET_FLAG((M.x86.R_AH != SUCCESSFUL), F_CF);
+               break;
+       case 0xB103:            /* Find PCI class code */
+               M.x86.R_AH = DEVICE_NOT_FOUND;
+#ifdef __KERNEL__
+               pci_read_config_byte(_BE_env.vgaInfo.pcidev, PCI_CLASS_PROG,
+                                    &interface);
+               pci_read_config_byte(_BE_env.vgaInfo.pcidev, PCI_CLASS_DEVICE,
+                                    &subclass);
+               pci_read_config_byte(_BE_env.vgaInfo.pcidev,
+                                    PCI_CLASS_DEVICE + 1, &baseclass);
+               if (M.x86.R_CL == interface && M.x86.R_CH == subclass
+                   && (u8) (M.x86.R_ECX >> 16) == baseclass) {
+#else
+               if (M.x86.R_CL == _BE_env.vgaInfo.pciInfo->Interface &&
+                   M.x86.R_CH == _BE_env.vgaInfo.pciInfo->SubClass &&
+                   (u8) (M.x86.R_ECX >> 16) ==
+                   _BE_env.vgaInfo.pciInfo->BaseClass) {
+#endif
+                       M.x86.R_AH = SUCCESSFUL;
+                       M.x86.R_BX = pciSlot;
+               }
+               CONDITIONAL_SET_FLAG((M.x86.R_AH != SUCCESSFUL), F_CF);
+               break;
+       case 0xB108:            /* Read configuration byte */
+               M.x86.R_AH = BAD_REGISTER_NUMBER;
+               if (M.x86.R_BX == pciSlot) {
+                       M.x86.R_AH = SUCCESSFUL;
+#ifdef __KERNEL__
+                       pci_read_config_byte(_BE_env.vgaInfo.pcidev, M.x86.R_DI,
+                                            &M.x86.R_CL);
+#else
+                       M.x86.R_CL =
+                           (u8) PCI_accessReg(M.x86.R_DI, 0, PCI_READ_BYTE,
+                                              _BE_env.vgaInfo.pciInfo);
+#endif
+               }
+               CONDITIONAL_SET_FLAG((M.x86.R_AH != SUCCESSFUL), F_CF);
+               break;
+       case 0xB109:            /* Read configuration word */
+               M.x86.R_AH = BAD_REGISTER_NUMBER;
+               if (M.x86.R_BX == pciSlot) {
+                       M.x86.R_AH = SUCCESSFUL;
+#ifdef __KERNEL__
+                       pci_read_config_word(_BE_env.vgaInfo.pcidev, M.x86.R_DI,
+                                            &M.x86.R_CX);
+#else
+                       M.x86.R_CX =
+                           (u16) PCI_accessReg(M.x86.R_DI, 0, PCI_READ_WORD,
+                                               _BE_env.vgaInfo.pciInfo);
+#endif
+               }
+               CONDITIONAL_SET_FLAG((M.x86.R_AH != SUCCESSFUL), F_CF);
+               break;
+       case 0xB10A:            /* Read configuration dword */
+               M.x86.R_AH = BAD_REGISTER_NUMBER;
+               if (M.x86.R_BX == pciSlot) {
+                       M.x86.R_AH = SUCCESSFUL;
+#ifdef __KERNEL__
+                       pci_read_config_dword(_BE_env.vgaInfo.pcidev,
+                                             M.x86.R_DI, &M.x86.R_ECX);
+#else
+                       M.x86.R_ECX =
+                           (u32) PCI_accessReg(M.x86.R_DI, 0, PCI_READ_DWORD,
+                                               _BE_env.vgaInfo.pciInfo);
+#endif
+               }
+               CONDITIONAL_SET_FLAG((M.x86.R_AH != SUCCESSFUL), F_CF);
+               break;
+       case 0xB10B:            /* Write configuration byte */
+               M.x86.R_AH = BAD_REGISTER_NUMBER;
+               if (M.x86.R_BX == pciSlot) {
+                       M.x86.R_AH = SUCCESSFUL;
+#ifdef __KERNEL__
+                       pci_write_config_byte(_BE_env.vgaInfo.pcidev,
+                                             M.x86.R_DI, M.x86.R_CL);
+#else
+                       PCI_accessReg(M.x86.R_DI, M.x86.R_CL, PCI_WRITE_BYTE,
+                                     _BE_env.vgaInfo.pciInfo);
+#endif
+               }
+               CONDITIONAL_SET_FLAG((M.x86.R_AH != SUCCESSFUL), F_CF);
+               break;
+       case 0xB10C:            /* Write configuration word */
+               M.x86.R_AH = BAD_REGISTER_NUMBER;
+               if (M.x86.R_BX == pciSlot) {
+                       M.x86.R_AH = SUCCESSFUL;
+#ifdef __KERNEL__
+                       pci_write_config_word(_BE_env.vgaInfo.pcidev,
+                                             M.x86.R_DI, M.x86.R_CX);
+#else
+                       PCI_accessReg(M.x86.R_DI, M.x86.R_CX, PCI_WRITE_WORD,
+                                     _BE_env.vgaInfo.pciInfo);
+#endif
+               }
+               CONDITIONAL_SET_FLAG((M.x86.R_AH != SUCCESSFUL), F_CF);
+               break;
+       case 0xB10D:            /* Write configuration dword */
+               M.x86.R_AH = BAD_REGISTER_NUMBER;
+               if (M.x86.R_BX == pciSlot) {
+                       M.x86.R_AH = SUCCESSFUL;
+#ifdef __KERNEL__
+                       pci_write_config_dword(_BE_env.vgaInfo.pcidev,
+                                              M.x86.R_DI, M.x86.R_ECX);
+#else
+                       PCI_accessReg(M.x86.R_DI, M.x86.R_ECX, PCI_WRITE_DWORD,
+                                     _BE_env.vgaInfo.pciInfo);
+#endif
+               }
+               CONDITIONAL_SET_FLAG((M.x86.R_AH != SUCCESSFUL), F_CF);
+               break;
+       default:
+               printf("biosEmu/bios.int1a: unknown function AX=%#04x\n",
+                      M.x86.R_AX);
+       }
+}
+
+/****************************************************************************
+REMARKS:
+This function initialises the BIOS emulation functions for the specific
+PCI display device. We insulate the real mode BIOS from any other devices
+on the bus, so that it will work correctly thinking that it is the only
+device present on the bus (ie: avoiding any adapters present in from of
+the device we are trying to control).
+****************************************************************************/
+#define BE_constLE_32(v)    ((((((v)&0xff00)>>8)|(((v)&0xff)<<8))<<16)|(((((v)&0xff000000)>>8)|(((v)&0x00ff0000)<<8))>>16))
+
+void _BE_bios_init(u32 * intrTab)
+{
+       int i;
+       X86EMU_intrFuncs bios_intr_tab[256];
+
+       for (i = 0; i < 256; ++i) {
+               intrTab[i] = BE_constLE_32(BIOS_SEG << 16);
+               bios_intr_tab[i] = undefined_intr;
+       }
+       bios_intr_tab[0x10] = int10;
+       bios_intr_tab[0x1A] = int1A;
+       bios_intr_tab[0x42] = int42;
+       bios_intr_tab[0x6D] = int10;
+       X86EMU_setupIntrFuncs(bios_intr_tab);
+}
diff --git a/drivers/bios_emulator/biosemu.c b/drivers/bios_emulator/biosemu.c
new file mode 100644 (file)
index 0000000..06d4ad3
--- /dev/null
@@ -0,0 +1,370 @@
+/****************************************************************************
+*
+*                       BIOS emulator and interface
+*                     to Realmode X86 Emulator Library
+*
+*  Copyright (C) 2007 Freescale Semiconductor, Inc. All rights reserved.
+*  Jason Jin <Jason.jin@freescale.com>
+*
+*              Copyright (C) 1996-1999 SciTech Software, Inc.
+*
+*  ========================================================================
+*
+*  Permission to use, copy, modify, distribute, and sell this software and
+*  its documentation for any purpose is hereby granted without fee,
+*  provided that the above copyright notice appear in all copies and that
+*  both that copyright notice and this permission notice appear in
+*  supporting documentation, and that the name of the authors not be used
+*  in advertising or publicity pertaining to distribution of the software
+*  without specific, written prior permission. The authors makes no
+*  representations about the suitability of this software for any purpose.
+*  It is provided "as is" without express or implied warranty.
+*
+*  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+*  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+*  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+*  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+*  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+*  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+*  PERFORMANCE OF THIS SOFTWARE.
+*
+*  ========================================================================
+*
+* Language:    ANSI C
+* Environment: Any
+* Developer:   Kendall Bennett
+*
+* Description: Module implementing the system specific functions. This
+*              module is always compiled and linked in the OS depedent
+*              libraries, and never in a binary portable driver.
+*
+*              Jason ported this file to u-boot to run the ATI video card BIOS
+*              in u-boot. Made all the video memory be emulated during the
+*              BIOS runing process which may affect the VGA function but the
+*              frambuffer function can work after run the BIOS.
+*
+****************************************************************************/
+
+#include "biosemui.h"
+#include <malloc.h>
+
+BE_sysEnv _BE_env = {{0}};
+static X86EMU_memFuncs _BE_mem __attribute__((section(".got2"))) = {
+       BE_rdb,
+       BE_rdw,
+       BE_rdl,
+       BE_wrb,
+       BE_wrw,
+       BE_wrl,
+       };
+
+static X86EMU_pioFuncs _BE_pio __attribute__((section(".got2"))) = {
+       BE_inb,
+       BE_inw,
+       BE_inl,
+       BE_outb,
+       BE_outw,
+       BE_outl,
+       };
+
+#define OFF(addr)      (u16)(((addr) >> 0) & 0xffff)
+#define SEG(addr)      (u16)(((addr) >> 4) & 0xf000)
+
+/****************************************************************************
+PARAMETERS:
+debugFlags  - Flags to enable debugging options (debug builds only)
+memSize            - Amount of memory to allocate for real mode machine
+info       - Pointer to default VGA device information
+
+REMARKS:
+This functions initialises the BElib, and uses the passed in
+BIOS image as the BIOS that is used and emulated at 0xC0000.
+****************************************************************************/
+int X86API BE_init(u32 debugFlags, int memSize, BE_VGAInfo * info, int shared)
+{
+#if !defined(__DRIVER__)  && !defined(__KERNEL__)
+
+       PM_init();
+#endif
+       memset(&M, 0, sizeof(M));
+       if (memSize < 20480){
+               printf("Emulator requires at least 20Kb of memory!\n");
+               return 0;
+       }
+
+       M.mem_base = (unsigned long)malloc(memSize);
+
+       if (M.mem_base == NULL){
+               printf("Biosemu:Out of memory!");
+               return 0;
+       }
+       M.mem_size = memSize;
+
+       _BE_env.emulateVGA = 0;
+       _BE_env.busmem_base = (unsigned long)malloc(128 * 1024);
+       if (_BE_env.busmem_base == NULL){
+               printf("Biosemu:Out of memory!");
+               return 0;
+       }
+       M.x86.debug = debugFlags;
+       _BE_bios_init((u32*)info->LowMem);
+       X86EMU_setupMemFuncs(&_BE_mem);
+       X86EMU_setupPioFuncs(&_BE_pio);
+       BE_setVGA(info);
+       return 1;
+}
+
+/****************************************************************************
+PARAMETERS:
+info       - Pointer to VGA device information to make current
+
+REMARKS:
+This function sets the VGA BIOS functions in the emulator to point to the
+specific VGA BIOS in use. This includes swapping the BIOS interrupt
+vectors, BIOS image and BIOS data area to the new BIOS. This allows the
+real mode BIOS to be swapped without resetting the entire emulator.
+****************************************************************************/
+void X86API BE_setVGA(BE_VGAInfo * info)
+{
+
+#ifdef __KERNEL__
+       _BE_env.vgaInfo.function = info->function;
+       _BE_env.vgaInfo.device = info->device;
+       _BE_env.vgaInfo.bus = info->bus;
+       _BE_env.vgaInfo.pcidev = info->pcidev;
+#else
+       _BE_env.vgaInfo.pciInfo = info->pciInfo;
+#endif
+       _BE_env.vgaInfo.BIOSImage = info->BIOSImage;
+       if (info->BIOSImage) {
+               _BE_env.biosmem_base = (ulong) info->BIOSImage;
+               _BE_env.biosmem_limit = 0xC0000 + info->BIOSImageLen - 1;
+       } else {
+               _BE_env.biosmem_base = _BE_env.busmem_base + 0x20000;
+               _BE_env.biosmem_limit = 0xC7FFF;
+       }
+       if (*((u32 *) info->LowMem) == 0)
+               _BE_bios_init((u32 *) info->LowMem);
+       memcpy((u8 *) M.mem_base, info->LowMem, sizeof(info->LowMem));
+}
+
+/****************************************************************************
+PARAMETERS:
+info       - Pointer to VGA device information to retrieve current
+
+REMARKS:
+This function returns the VGA BIOS functions currently active in the
+emulator, so they can be restored at a later date.
+****************************************************************************/
+void X86API BE_getVGA(BE_VGAInfo * info)
+{
+#ifdef __KERNEL__
+       info->function = _BE_env.vgaInfo.function;
+       info->device = _BE_env.vgaInfo.device;
+       info->bus = _BE_env.vgaInfo.bus;
+       info->pcidev = _BE_env.vgaInfo.pcidev;
+#else
+       info->pciInfo = _BE_env.vgaInfo.pciInfo;
+#endif
+       info->BIOSImage = _BE_env.vgaInfo.BIOSImage;
+       memcpy(info->LowMem, (u8 *) M.mem_base, sizeof(info->LowMem));
+}
+
+/****************************************************************************
+PARAMETERS:
+r_seg  - Segment for pointer to convert
+r_off  - Offset for pointer to convert
+
+REMARKS:
+This function maps a real mode pointer in the emulator memory to a protected
+mode pointer that can be used to directly access the memory.
+
+NOTE:  The memory is *always* in little endian format, son on non-x86
+       systems you will need to do endian translations to access this
+       memory.
+****************************************************************************/
+void *X86API BE_mapRealPointer(uint r_seg, uint r_off)
+{
+       u32 addr = ((u32) r_seg << 4) + r_off;
+
+       if (addr >= 0xC0000 && addr <= _BE_env.biosmem_limit) {
+               return (void *)(_BE_env.biosmem_base + addr - 0xC0000);
+       } else if (addr >= 0xA0000 && addr <= 0xFFFFF) {
+               return (void *)(_BE_env.busmem_base + addr - 0xA0000);
+       }
+       return (void *)(M.mem_base + addr);
+}
+
+/****************************************************************************
+PARAMETERS:
+len    - Return the length of the VESA buffer
+rseg   - Place to store VESA buffer segment
+roff   - Place to store VESA buffer offset
+
+REMARKS:
+This function returns the address of the VESA transfer buffer in real
+_BE_piomode emulator memory. The VESA transfer buffer is always 1024 bytes long,
+and located at 15Kb into the start of the real mode memory (16Kb is where
+we put the real mode code we execute for issuing interrupts).
+
+NOTE:  The memory is *always* in little endian format, son on non-x86
+       systems you will need to do endian translations to access this
+       memory.
+****************************************************************************/
+void *X86API BE_getVESABuf(uint * len, uint * rseg, uint * roff)
+{
+       *len = 1024;
+       *rseg = SEG(0x03C00);
+       *roff = OFF(0x03C00);
+       return (void *)(M.mem_base + ((u32) * rseg << 4) + *roff);
+}
+
+/****************************************************************************
+REMARKS:
+Cleans up and exits the emulator.
+****************************************************************************/
+void X86API BE_exit(void)
+{
+       free(M.mem_base);
+       free(_BE_env.busmem_base);
+}
+
+/****************************************************************************
+PARAMETERS:
+seg    - Segment of code to call
+off    - Offset of code to call
+regs   - Real mode registers to load
+sregs  - Real mode segment registers to load
+
+REMARKS:
+This functions calls a real mode far function at the specified address,
+and loads all the x86 registers from the passed in registers structure.
+On exit the registers returned from the call are returned in the same
+structures.
+****************************************************************************/
+void X86API BE_callRealMode(uint seg, uint off, RMREGS * regs, RMSREGS * sregs)
+{
+       M.x86.R_EAX = regs->e.eax;
+       M.x86.R_EBX = regs->e.ebx;
+       M.x86.R_ECX = regs->e.ecx;
+       M.x86.R_EDX = regs->e.edx;
+       M.x86.R_ESI = regs->e.esi;
+       M.x86.R_EDI = regs->e.edi;
+       M.x86.R_DS = sregs->ds;
+       M.x86.R_ES = sregs->es;
+       M.x86.R_FS = sregs->fs;
+       M.x86.R_GS = sregs->gs;
+
+       ((u8 *) M.mem_base)[0x4000] = 0x9A;
+       ((u8 *) M.mem_base)[0x4001] = (u8) off;
+       ((u8 *) M.mem_base)[0x4002] = (u8) (off >> 8);
+       ((u8 *) M.mem_base)[0x4003] = (u8) seg;
+       ((u8 *) M.mem_base)[0x4004] = (u8) (seg >> 8);
+       ((u8 *) M.mem_base)[0x4005] = 0xF1;     /* Illegal op-code */
+       M.x86.R_CS = SEG(0x04000);
+       M.x86.R_IP = OFF(0x04000);
+
+       M.x86.R_SS = SEG(M.mem_size - 2);
+       M.x86.R_SP = OFF(M.mem_size - 2) + 2;
+
+       X86EMU_exec();
+
+       regs->e.cflag = M.x86.R_EFLG & F_CF;
+       regs->e.eax = M.x86.R_EAX;
+       regs->e.ebx = M.x86.R_EBX;
+       regs->e.ecx = M.x86.R_ECX;
+       regs->e.edx = M.x86.R_EDX;
+       regs->e.esi = M.x86.R_ESI;
+       regs->e.edi = M.x86.R_EDI;
+       sregs->ds = M.x86.R_DS;
+       sregs->es = M.x86.R_ES;
+       sregs->fs = M.x86.R_FS;
+       sregs->gs = M.x86.R_GS;
+}
+
+/****************************************************************************
+PARAMETERS:
+intno  - Interrupt number to execute
+in     - Real mode registers to load
+out    - Place to store resulting real mode registers
+
+REMARKS:
+This functions calls a real mode interrupt function at the specified address,
+and loads all the x86 registers from the passed in registers structure.
+On exit the registers returned from the call are returned in out stucture.
+****************************************************************************/
+int X86API BE_int86(int intno, RMREGS * in, RMREGS * out)
+{
+       M.x86.R_EAX = in->e.eax;
+       M.x86.R_EBX = in->e.ebx;
+       M.x86.R_ECX = in->e.ecx;
+       M.x86.R_EDX = in->e.edx;
+       M.x86.R_ESI = in->e.esi;
+       M.x86.R_EDI = in->e.edi;
+       ((u8 *) M.mem_base)[0x4000] = 0xCD;
+       ((u8 *) M.mem_base)[0x4001] = (u8) intno;
+       ((u8 *) M.mem_base)[0x4002] = 0xF1;
+       M.x86.R_CS = SEG(0x04000);
+       M.x86.R_IP = OFF(0x04000);
+
+       M.x86.R_SS = SEG(M.mem_size - 1);
+       M.x86.R_SP = OFF(M.mem_size - 1) - 1;
+
+       X86EMU_exec();
+       out->e.cflag = M.x86.R_EFLG & F_CF;
+       out->e.eax = M.x86.R_EAX;
+       out->e.ebx = M.x86.R_EBX;
+       out->e.ecx = M.x86.R_ECX;
+       out->e.edx = M.x86.R_EDX;
+       out->e.esi = M.x86.R_ESI;
+       out->e.edi = M.x86.R_EDI;
+       return out->x.ax;
+}
+
+/****************************************************************************
+PARAMETERS:
+intno  - Interrupt number to execute
+in     - Real mode registers to load
+out    - Place to store resulting real mode registers
+sregs  - Real mode segment registers to load
+
+REMARKS:
+This functions calls a real mode interrupt function at the specified address,
+and loads all the x86 registers from the passed in registers structure.
+On exit the registers returned from the call are returned in out stucture.
+****************************************************************************/
+int X86API BE_int86x(int intno, RMREGS * in, RMREGS * out, RMSREGS * sregs)
+{
+       M.x86.R_EAX = in->e.eax;
+       M.x86.R_EBX = in->e.ebx;
+       M.x86.R_ECX = in->e.ecx;
+       M.x86.R_EDX = in->e.edx;
+       M.x86.R_ESI = in->e.esi;
+       M.x86.R_EDI = in->e.edi;
+       M.x86.R_DS = sregs->ds;
+       M.x86.R_ES = sregs->es;
+       M.x86.R_FS = sregs->fs;
+       M.x86.R_GS = sregs->gs;
+       ((u8 *) M.mem_base)[0x4000] = 0xCD;
+       ((u8 *) M.mem_base)[0x4001] = (u8) intno;
+       ((u8 *) M.mem_base)[0x4002] = 0xF1;
+       M.x86.R_CS = SEG(0x04000);
+       M.x86.R_IP = OFF(0x04000);
+
+       M.x86.R_SS = SEG(M.mem_size - 1);
+       M.x86.R_SP = OFF(M.mem_size - 1) - 1;
+
+       X86EMU_exec();
+       out->e.cflag = M.x86.R_EFLG & F_CF;
+       out->e.eax = M.x86.R_EAX;
+       out->e.ebx = M.x86.R_EBX;
+       out->e.ecx = M.x86.R_ECX;
+       out->e.edx = M.x86.R_EDX;
+       out->e.esi = M.x86.R_ESI;
+       out->e.edi = M.x86.R_EDI;
+       sregs->ds = M.x86.R_DS;
+       sregs->es = M.x86.R_ES;
+       sregs->fs = M.x86.R_FS;
+       sregs->gs = M.x86.R_GS;
+       return out->x.ax;
+}
diff --git a/drivers/bios_emulator/biosemui.h b/drivers/bios_emulator/biosemui.h
new file mode 100644 (file)
index 0000000..e85e656
--- /dev/null
@@ -0,0 +1,169 @@
+/****************************************************************************
+*
+*                       BIOS emulator and interface
+*                     to Realmode X86 Emulator Library
+*
+*  Copyright (C) 2007 Freescale Semiconductor, Inc. All rights reserved.
+*  Jason Jin <Jason.jin@freescale.com>
+*
+*              Copyright (C) 1996-1999 SciTech Software, Inc.
+*
+*  ========================================================================
+*
+*  Permission to use, copy, modify, distribute, and sell this software and
+*  its documentation for any purpose is hereby granted without fee,
+*  provided that the above copyright notice appear in all copies and that
+*  both that copyright notice and this permission notice appear in
+*  supporting documentation, and that the name of the authors not be used
+*  in advertising or publicity pertaining to distribution of the software
+*  without specific, written prior permission. The authors makes no
+*  representations about the suitability of this software for any purpose.
+*  It is provided "as is" without express or implied warranty.
+*
+*  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+*  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+*  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+*  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+*  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+*  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+*  PERFORMANCE OF THIS SOFTWARE.
+*
+*  ========================================================================
+*
+* Language:    ANSI C
+* Environment: Any
+* Developer:   Kendall Bennett
+*
+* Description: Internal header file for the BIOS emulator library.
+*
+*              Jason ported this file to u-boot, Added some architecture
+*              related Macro.
+*
+****************************************************************************/
+
+#ifndef __BIOSEMUI_H
+#define __BIOSEMUI_H
+
+#include "biosemu.h"
+#include <asm/io.h>
+/*---------------------- Macros and type definitions ----------------------*/
+
+#ifdef DEBUG
+#define DB(x)  x
+#else
+#define DB(x)  do{}while(0);
+#endif
+
+#define BIOS_SEG       0xfff0
+extern X86EMU_sysEnv _X86EMU_env;
+#define M              _X86EMU_env
+
+/* Macros to read and write values to x86 emulator memory. Memory is always
+ * considered to be little endian, so we use macros to do endian swapping
+ * where necessary.
+ */
+
+#ifdef __BIG_ENDIAN__
+#define readb_le(base)     *((u8*)(base))
+#define readw_le(base)     ((u16)readb_le(base) | ((u16)readb_le((base) + 1) << 8))
+#define readl_le(base)     ((u32)readb_le((base) + 0) | ((u32)readb_le((base) + 1) << 8) | \
+                           ((u32)readb_le((base) + 2) << 16) | ((u32)readb_le((base) + 3) << 24))
+#define writeb_le(base, v)  *((u8*)(base)) = (v)
+#define writew_le(base, v)  writeb_le(base + 0, (v >> 0) & 0xff),      \
+                           writeb_le(base + 1, (v >> 8) & 0xff)
+#define writel_le(base, v)  writeb_le(base + 0, (v >> 0) & 0xff),      \
+                           writeb_le(base + 1, (v >> 8) & 0xff),       \
+                           writeb_le(base + 2, (v >> 16) & 0xff),      \
+                           writeb_le(base + 3, (v >> 24) & 0xff)
+#else
+#define readb_le(base)     *((u8*)(base))
+#define readw_le(base)     *((u16*)(base))
+#define readl_le(base)     *((u32*)(base))
+#define writeb_le(base, v)  *((u8*)(base)) = (v)
+#define writew_le(base, v)  *((u16*)(base)) = (v)
+#define writel_le(base, v)  *((u32*)(base)) = (v)
+#endif
+
+/****************************************************************************
+REMARKS:
+Function codes passed to the emulated I/O port functions to determine the
+type of operation to perform.
+****************************************************************************/
+typedef enum {
+       REG_READ_BYTE = 0,
+       REG_READ_WORD = 1,
+       REG_READ_DWORD = 2,
+       REG_WRITE_BYTE = 3,
+       REG_WRITE_WORD = 4,
+       REG_WRITE_DWORD = 5
+} RegisterFlags;
+
+/****************************************************************************
+REMARKS:
+Function codes passed to the emulated I/O port functions to determine the
+type of operation to perform.
+****************************************************************************/
+typedef enum {
+       PORT_BYTE = 1,
+       PORT_WORD = 2,
+       PORT_DWORD = 3,
+} PortInfoFlags;
+
+/****************************************************************************
+REMARKS:
+Data structure used to describe the details for the BIOS emulator system
+environment as used by the X86 emulator library.
+
+HEADER:
+biosemu.h
+
+MEMBERS:
+type       - Type of port access (1 = byte, 2 = word, 3 = dword)
+defVal     - Default power on value
+finalVal    - Final value
+****************************************************************************/
+typedef struct {
+       u8 type;
+       u32 defVal;
+       u32 finalVal;
+} BE_portInfo;
+
+#define PM_inpb(port)  inb(port+VIDEO_IO_OFFSET)
+#define PM_inpw(port)  inw(port+VIDEO_IO_OFFSET)
+#define PM_inpd(port)  inl(port+VIDEO_IO_OFFSET)
+#define PM_outpb(port,val)     outb(val,port+VIDEO_IO_OFFSET)
+#define PM_outpw(port,val)     outw(val,port+VIDEO_IO_OFFSET)
+#define PM_outpd(port,val)     outl(val,port+VIDEO_IO_OFFSET)
+
+#define LOG_inpb(port) PM_inpb(port)
+#define LOG_inpw(port) PM_inpw(port)
+#define LOG_inpd(port) PM_inpd(port)
+#define LOG_outpb(port,val)    PM_outpb(port,val)
+#define LOG_outpw(port,val)    PM_outpw(port,val)
+#define LOG_outpd(port,val)    PM_outpd(port,val)
+
+/*-------------------------- Function Prototypes --------------------------*/
+
+/* bios.c */
+
+void _BE_bios_init(u32 * intrTab);
+void _BE_setup_funcs(void);
+
+/* besys.c */
+#define DEBUG_IO()     (M.x86.debug & DEBUG_IO_TRACE_F)
+
+u8 X86API BE_rdb(u32 addr);
+u16 X86API BE_rdw(u32 addr);
+u32 X86API BE_rdl(u32 addr);
+void X86API BE_wrb(u32 addr, u8 val);
+void X86API BE_wrw(u32 addr, u16 val);
+void X86API BE_wrl(u32 addr, u32 val);
+
+u8 X86API BE_inb(X86EMU_pioAddr port);
+u16 X86API BE_inw(X86EMU_pioAddr port);
+u32 X86API BE_inl(X86EMU_pioAddr port);
+void X86API BE_outb(X86EMU_pioAddr port, u8 val);
+void X86API BE_outw(X86EMU_pioAddr port, u16 val);
+void X86API BE_outl(X86EMU_pioAddr port, u32 val);
+#endif
+/* __BIOSEMUI_H */
diff --git a/drivers/bios_emulator/include/biosemu.h b/drivers/bios_emulator/include/biosemu.h
new file mode 100644 (file)
index 0000000..13cb317
--- /dev/null
@@ -0,0 +1,392 @@
+/****************************************************************************
+*
+*                        BIOS emulator and interface
+*                      to Realmode X86 Emulator Library
+*
+*               Copyright (C) 1996-1999 SciTech Software, Inc.
+*
+*  ========================================================================
+*
+*  Permission to use, copy, modify, distribute, and sell this software and
+*  its documentation for any purpose is hereby granted without fee,
+*  provided that the above copyright notice appear in all copies and that
+*  both that copyright notice and this permission notice appear in
+*  supporting documentation, and that the name of the authors not be used
+*  in advertising or publicity pertaining to distribution of the software
+*  without specific, written prior permission.  The authors makes no
+*  representations about the suitability of this software for any purpose.
+*  It is provided "as is" without express or implied warranty.
+*
+*  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+*  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+*  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+*  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+*  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+*  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+*  PERFORMANCE OF THIS SOFTWARE.
+*
+*  ========================================================================
+*
+* Language:     ANSI C
+* Environment:  Any
+* Developer:    Kendall Bennett
+*
+* Description:  Header file for the real mode x86 BIOS emulator, which is
+*               used to warmboot any number of VGA compatible PCI/AGP
+*               controllers under any OS, on any processor family that
+*               supports PCI. We also allow the user application to call
+*               real mode BIOS functions and Int 10h functions (including
+*               the VESA BIOS).
+*
+****************************************************************************/
+
+#ifndef __BIOSEMU_H
+#define __BIOSEMU_H
+
+#ifdef __KERNEL__
+#include "x86emu.h"
+#else
+#include "x86emu.h"
+#include "pmapi.h"
+#include "pcilib.h"
+#endif
+
+/*---------------------- Macros and type definitions ----------------------*/
+
+#pragma pack(1)
+
+#ifndef __KERNEL__
+/****************************************************************************
+REMARKS:
+Data structure used to describe the details specific to a particular VGA
+controller. This information is used to allow the VGA controller to be
+swapped on the fly within the BIOS emulator.
+
+HEADER:
+biosemu.h
+
+MEMBERS:
+pciInfo         - PCI device information block for the controller
+BIOSImage       - Pointer to a read/write copy of the BIOS image
+BIOSImageLen    - Length of the BIOS image
+LowMem          - Copy of key low memory areas
+****************************************************************************/
+typedef struct {
+       PCIDeviceInfo *pciInfo;
+       void *BIOSImage;
+       ulong BIOSImageLen;
+       uchar LowMem[1536];
+} BE_VGAInfo;
+#else
+/****************************************************************************
+REMARKS:
+Data structure used to describe the details for the BIOS emulator system
+environment as used by the X86 emulator library.
+
+HEADER:
+biosemu.h
+
+MEMBERS:
+vgaInfo         - VGA BIOS information structure
+biosmem_base    - Base of the BIOS image
+biosmem_limit   - Limit of the BIOS image
+busmem_base     - Base of the VGA bus memory
+****************************************************************************/
+typedef struct {
+       int function;
+       int device;
+       int bus;
+       u32 VendorID;
+       u32 DeviceID;
+       pci_dev_t pcidev;
+       void *BIOSImage;
+       u32 BIOSImageLen;
+       u8 LowMem[1536];
+} BE_VGAInfo;
+
+#endif                         /* __KERNEL__ */
+
+#define CRT_C   24             /* 24  CRT Controller Registers             */
+#define ATT_C   21             /* 21  Attribute Controller Registers       */
+#define GRA_C   9              /* 9   Graphics Controller Registers        */
+#define SEQ_C   5              /* 5   Sequencer Registers                  */
+#define PAL_C   768            /* 768 Palette Registers                    */
+
+/****************************************************************************
+REMARKS:
+Data structure used to describe the details for the BIOS emulator system
+environment as used by the X86 emulator library.
+
+HEADER:
+biosemu.h
+
+MEMBERS:
+vgaInfo         - VGA BIOS information structure
+biosmem_base    - Base of the BIOS image
+biosmem_limit   - Limit of the BIOS image
+busmem_base     - Base of the VGA bus memory
+timer           - Timer used to emulate PC timer ports
+timer0          - Latched value for timer 0
+timer0Latched   - True if timer 0 value was just latched
+timer2          - Current value for timer 2
+emulateVGA      - True to emulate VGA I/O and memory accesses
+****************************************************************************/
+
+typedef struct {
+       BE_VGAInfo vgaInfo;
+       ulong biosmem_base;
+       ulong biosmem_limit;
+       ulong busmem_base;
+
+       u32 timer0;
+       int timer0Latched;
+       u32 timer1;
+       int timer1Latched;
+       u32 timer2;
+       int timer2Latched;
+
+       int emulateVGA;
+       u8 emu61;
+       u8 emu70;
+       int flipFlop3C0;
+       u32 configAddress;
+       u8 emu3C0;
+       u8 emu3C1[ATT_C];
+       u8 emu3C2;
+       u8 emu3C4;
+       u8 emu3C5[SEQ_C];
+       u8 emu3C6;
+       uint emu3C7;
+       uint emu3C8;
+       u8 emu3C9[PAL_C];
+       u8 emu3CE;
+       u8 emu3CF[GRA_C];
+       u8 emu3D4;
+       u8 emu3D5[CRT_C];
+       u8 emu3DA;
+
+} BE_sysEnv;
+
+#ifdef __KERNEL__
+
+/* Define some types when compiling for the Linux kernel that normally
+ * come from the SciTech PM library.
+ */
+
+/****************************************************************************
+REMARKS:
+Structure describing the 32-bit extended x86 CPU registers
+
+HEADER:
+pmapi.h
+
+MEMBERS:
+eax     - Value of the EAX register
+ebx     - Value of the EBX register
+ecx     - Value of the ECX register
+edx     - Value of the EDX register
+esi     - Value of the ESI register
+edi     - Value of the EDI register
+cflag   - Value of the carry flag
+****************************************************************************/
+typedef struct {
+       u32 eax;
+       u32 ebx;
+       u32 ecx;
+       u32 edx;
+       u32 esi;
+       u32 edi;
+       u32 cflag;
+} RMDWORDREGS;
+
+/****************************************************************************
+REMARKS:
+Structure describing the 16-bit x86 CPU registers
+
+HEADER:
+pmapi.h
+
+MEMBERS:
+ax      - Value of the AX register
+bx      - Value of the BX register
+cx      - Value of the CX register
+dx      - Value of the DX register
+si      - Value of the SI register
+di      - Value of the DI register
+cflag   - Value of the carry flag
+****************************************************************************/
+#ifdef __BIG_ENDIAN__
+typedef struct {
+       u16 ax_hi, ax;
+       u16 bx_hi, bx;
+       u16 cx_hi, cx;
+       u16 dx_hi, dx;
+       u16 si_hi, si;
+       u16 di_hi, di;
+       u16 cflag_hi, cflag;
+} RMWORDREGS;
+#else
+typedef struct {
+       u16 ax, ax_hi;
+       u16 bx, bx_hi;
+       u16 cx, cx_hi;
+       u16 dx, dx_hi;
+       u16 si, si_hi;
+       u16 di, di_hi;
+       u16 cflag, cflag_hi;
+} RMWORDREGS;
+#endif
+
+/****************************************************************************
+REMARKS:
+Structure describing the 8-bit x86 CPU registers
+
+HEADER:
+pmapi.h
+
+MEMBERS:
+al      - Value of the AL register
+ah      - Value of the AH register
+bl      - Value of the BL register
+bh      - Value of the BH register
+cl      - Value of the CL register
+ch      - Value of the CH register
+dl      - Value of the DL register
+dh      - Value of the DH register
+****************************************************************************/
+#ifdef __BIG_ENDIAN__
+typedef struct {
+       u16 ax_hi;
+       u8 ah, al;
+       u16 bx_hi;
+       u8 bh, bl;
+       u16 cx_hi;
+       u8 ch, cl;
+       u16 dx_hi;
+       u8 dh, dl;
+} RMBYTEREGS;
+#else
+typedef struct {
+       u8 al;
+       u8 ah;
+       u16 ax_hi;
+       u8 bl;
+       u8 bh;
+       u16 bx_hi;
+       u8 cl;
+       u8 ch;
+       u16 cx_hi;
+       u8 dl;
+       u8 dh;
+       u16 dx_hi;
+} RMBYTEREGS;
+#endif
+
+/****************************************************************************
+REMARKS:
+Structure describing all the x86 CPU registers
+
+HEADER:
+pmapi.h
+
+MEMBERS:
+e   - Member to access registers as 32-bit values
+x   - Member to access registers as 16-bit values
+h   - Member to access registers as 8-bit values
+****************************************************************************/
+typedef union {
+       RMDWORDREGS e;
+       RMWORDREGS x;
+       RMBYTEREGS h;
+} RMREGS;
+
+/****************************************************************************
+REMARKS:
+Structure describing all the x86 segment registers
+
+HEADER:
+pmapi.h
+
+MEMBERS:
+es  - ES segment register
+cs  - CS segment register
+ss  - SS segment register
+ds  - DS segment register
+fs  - FS segment register
+gs  - GS segment register
+****************************************************************************/
+typedef struct {
+       u16 es;
+       u16 cs;
+       u16 ss;
+       u16 ds;
+       u16 fs;
+       u16 gs;
+} RMSREGS;
+
+#endif                         /* __KERNEL__ */
+
+#ifndef __KERNEL__
+
+/****************************************************************************
+REMARKS:
+Structure defining all the BIOS Emulator API functions as exported from
+the Binary Portable DLL.
+{secret}
+****************************************************************************/
+typedef struct {
+       ulong dwSize;
+        ibool(PMAPIP BE_init) (u32 debugFlags, int memSize, BE_VGAInfo * info);
+       void (PMAPIP BE_setVGA) (BE_VGAInfo * info);
+       void (PMAPIP BE_getVGA) (BE_VGAInfo * info);
+       void *(PMAPIP BE_mapRealPointer) (uint r_seg, uint r_off);
+       void *(PMAPIP BE_getVESABuf) (uint * len, uint * rseg, uint * roff);
+       void (PMAPIP BE_callRealMode) (uint seg, uint off, RMREGS * regs,
+                                      RMSREGS * sregs);
+       int (PMAPIP BE_int86) (int intno, RMREGS * in, RMREGS * out);
+       int (PMAPIP BE_int86x) (int intno, RMREGS * in, RMREGS * out,
+                               RMSREGS * sregs);
+       void *reserved1;
+       void (PMAPIP BE_exit) (void);
+} BE_exports;
+
+/****************************************************************************
+REMARKS:
+Function pointer type for the Binary Portable DLL initialisation entry point.
+{secret}
+****************************************************************************/
+typedef BE_exports *(PMAPIP BE_initLibrary_t) (PM_imports * PMImp);
+#endif
+
+#pragma pack()
+
+/*---------------------------- Global variables ---------------------------*/
+
+#ifdef  __cplusplus
+extern "C" {                   /* Use "C" linkage when in C++ mode */
+#endif
+
+/* {secret} Global BIOS emulator system environment */
+       extern BE_sysEnv _BE_env;
+
+/*-------------------------- Function Prototypes --------------------------*/
+
+/* BIOS emulator library entry points */
+       int X86API BE_init(u32 debugFlags, int memSize, BE_VGAInfo * info,
+                          int shared);
+       void X86API BE_setVGA(BE_VGAInfo * info);
+       void X86API BE_getVGA(BE_VGAInfo * info);
+       void X86API BE_setDebugFlags(u32 debugFlags);
+       void *X86API BE_mapRealPointer(uint r_seg, uint r_off);
+       void *X86API BE_getVESABuf(uint * len, uint * rseg, uint * roff);
+       void X86API BE_callRealMode(uint seg, uint off, RMREGS * regs,
+                                   RMSREGS * sregs);
+       int X86API BE_int86(int intno, RMREGS * in, RMREGS * out);
+       int X86API BE_int86x(int intno, RMREGS * in, RMREGS * out,
+                            RMSREGS * sregs);
+       void X86API BE_exit(void);
+
+#ifdef  __cplusplus
+}                              /* End of "C" linkage for C++       */
+#endif
+#endif                         /* __BIOSEMU_H */
diff --git a/drivers/bios_emulator/include/x86emu.h b/drivers/bios_emulator/include/x86emu.h
new file mode 100644 (file)
index 0000000..6004beb
--- /dev/null
@@ -0,0 +1,191 @@
+/****************************************************************************
+*
+*                       Realmode X86 Emulator Library
+*
+*               Copyright (C) 1996-1999 SciTech Software, Inc.
+*                    Copyright (C) David Mosberger-Tang
+*                      Copyright (C) 1999 Egbert Eich
+*
+*  ========================================================================
+*
+*  Permission to use, copy, modify, distribute, and sell this software and
+*  its documentation for any purpose is hereby granted without fee,
+*  provided that the above copyright notice appear in all copies and that
+*  both that copyright notice and this permission notice appear in
+*  supporting documentation, and that the name of the authors not be used
+*  in advertising or publicity pertaining to distribution of the software
+*  without specific, written prior permission.  The authors makes no
+*  representations about the suitability of this software for any purpose.
+*  It is provided "as is" without express or implied warranty.
+*
+*  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+*  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+*  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+*  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+*  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+*  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+*  PERFORMANCE OF THIS SOFTWARE.
+*
+*  ========================================================================
+*
+* Language:     ANSI C
+* Environment:  Any
+* Developer:    Kendall Bennett
+*
+* Description:  Header file for public specific functions.
+*               Any application linking against us should only
+*               include this header
+*
+****************************************************************************/
+
+#ifndef __X86EMU_X86EMU_H
+#define __X86EMU_X86EMU_H
+
+#include <asm/types.h>
+#include <common.h>
+#include <pci.h>
+#include <asm/io.h>
+#define X86API
+#define X86APIP *
+typedef u16 X86EMU_pioAddr;
+
+#include "x86emu/regs.h"
+
+/*---------------------- Macros and type definitions ----------------------*/
+
+#pragma pack(1)
+
+/****************************************************************************
+REMARKS:
+Data structure containing ponters to programmed I/O functions used by the
+emulator. This is used so that the user program can hook all programmed
+I/O for the emulator to handled as necessary by the user program. By
+default the emulator contains simple functions that do not do access the
+hardware in any way. To allow the emualtor access the hardware, you will
+need to override the programmed I/O functions using the X86EMU_setupPioFuncs
+function.
+
+HEADER:
+x86emu.h
+
+MEMBERS:
+inb     - Function to read a byte from an I/O port
+inw     - Function to read a word from an I/O port
+inl     - Function to read a dword from an I/O port
+outb    - Function to write a byte to an I/O port
+outw    - Function to write a word to an I/O port
+outl    - Function to write a dword to an I/O port
+****************************************************************************/
+typedef struct {
+       u8(X86APIP inb) (X86EMU_pioAddr addr);
+       u16(X86APIP inw) (X86EMU_pioAddr addr);
+       u32(X86APIP inl) (X86EMU_pioAddr addr);
+       void (X86APIP outb) (X86EMU_pioAddr addr, u8 val);
+       void (X86APIP outw) (X86EMU_pioAddr addr, u16 val);
+       void (X86APIP outl) (X86EMU_pioAddr addr, u32 val);
+} X86EMU_pioFuncs;
+
+/****************************************************************************
+REMARKS:
+Data structure containing ponters to memory access functions used by the
+emulator. This is used so that the user program can hook all memory
+access functions as necessary for the emulator. By default the emulator
+contains simple functions that only access the internal memory of the
+emulator. If you need specialised functions to handle access to different
+types of memory (ie: hardware framebuffer accesses and BIOS memory access
+etc), you will need to override this using the X86EMU_setupMemFuncs
+function.
+
+HEADER:
+x86emu.h
+
+MEMBERS:
+rdb     - Function to read a byte from an address
+rdw     - Function to read a word from an address
+rdl     - Function to read a dword from an address
+wrb     - Function to write a byte to an address
+wrw     - Function to write a word to an address
+wrl     - Function to write a dword to an address
+****************************************************************************/
+typedef struct {
+       u8(X86APIP rdb) (u32 addr);
+       u16(X86APIP rdw) (u32 addr);
+       u32(X86APIP rdl) (u32 addr);
+       void (X86APIP wrb) (u32 addr, u8 val);
+       void (X86APIP wrw) (u32 addr, u16 val);
+       void (X86APIP wrl) (u32 addr, u32 val);
+} X86EMU_memFuncs;
+
+/****************************************************************************
+  Here are the default memory read and write
+  function in case they are needed as fallbacks.
+***************************************************************************/
+extern u8 X86API rdb(u32 addr);
+extern u16 X86API rdw(u32 addr);
+extern u32 X86API rdl(u32 addr);
+extern void X86API wrb(u32 addr, u8 val);
+extern void X86API wrw(u32 addr, u16 val);
+extern void X86API wrl(u32 addr, u32 val);
+
+#pragma pack()
+
+/*--------------------- type definitions -----------------------------------*/
+
+typedef void (X86APIP X86EMU_intrFuncs) (int num);
+extern X86EMU_intrFuncs _X86EMU_intrTab[256];
+
+/*-------------------------- Function Prototypes --------------------------*/
+
+#ifdef  __cplusplus
+extern "C" {                   /* Use "C" linkage when in C++ mode */
+#endif
+
+       void X86EMU_setupMemFuncs(X86EMU_memFuncs * funcs);
+       void X86EMU_setupPioFuncs(X86EMU_pioFuncs * funcs);
+       void X86EMU_setupIntrFuncs(X86EMU_intrFuncs funcs[]);
+       void X86EMU_prepareForInt(int num);
+
+/* decode.c */
+
+       void X86EMU_exec(void);
+       void X86EMU_halt_sys(void);
+
+#ifdef  DEBUG
+#define HALT_SYS()  \
+    printf("halt_sys: file %s, line %d\n", __FILE__, __LINE__), \
+    X86EMU_halt_sys()
+#else
+#define HALT_SYS()  X86EMU_halt_sys()
+#endif
+
+/* Debug options */
+
+#define DEBUG_DECODE_F          0x0001 /* print decoded instruction  */
+#define DEBUG_TRACE_F           0x0002 /* dump regs before/after execution */
+#define DEBUG_STEP_F            0x0004
+#define DEBUG_DISASSEMBLE_F     0x0008
+#define DEBUG_BREAK_F           0x0010
+#define DEBUG_SVC_F             0x0020
+#define DEBUG_SAVE_CS_IP        0x0040
+#define DEBUG_FS_F              0x0080
+#define DEBUG_PROC_F            0x0100
+#define DEBUG_SYSINT_F          0x0200 /* bios system interrupts. */
+#define DEBUG_TRACECALL_F       0x0400
+#define DEBUG_INSTRUMENT_F      0x0800
+#define DEBUG_MEM_TRACE_F       0x1000
+#define DEBUG_IO_TRACE_F        0x2000
+#define DEBUG_TRACECALL_REGS_F  0x4000
+#define DEBUG_DECODE_NOPRINT_F  0x8000
+#define DEBUG_EXIT              0x10000
+#define DEBUG_SYS_F             (DEBUG_SVC_F|DEBUG_FS_F|DEBUG_PROC_F)
+
+       void X86EMU_trace_regs(void);
+       void X86EMU_trace_xregs(void);
+       void X86EMU_dump_memory(u16 seg, u16 off, u32 amt);
+       int X86EMU_trace_on(void);
+       int X86EMU_trace_off(void);
+
+#ifdef  __cplusplus
+}                              /* End of "C" linkage for C++       */
+#endif
+#endif                         /* __X86EMU_X86EMU_H */
diff --git a/drivers/bios_emulator/include/x86emu/debug.h b/drivers/bios_emulator/include/x86emu/debug.h
new file mode 100644 (file)
index 0000000..268c9d3
--- /dev/null
@@ -0,0 +1,209 @@
+/****************************************************************************
+*
+*                      Realmode X86 Emulator Library
+*
+*              Copyright (C) 1991-2004 SciTech Software, Inc.
+*                   Copyright (C) David Mosberger-Tang
+*                     Copyright (C) 1999 Egbert Eich
+*
+*  ========================================================================
+*
+*  Permission to use, copy, modify, distribute, and sell this software and
+*  its documentation for any purpose is hereby granted without fee,
+*  provided that the above copyright notice appear in all copies and that
+*  both that copyright notice and this permission notice appear in
+*  supporting documentation, and that the name of the authors not be used
+*  in advertising or publicity pertaining to distribution of the software
+*  without specific, written prior permission. The authors makes no
+*  representations about the suitability of this software for any purpose.
+*  It is provided "as is" without express or implied warranty.
+*
+*  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+*  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+*  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+*  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+*  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+*  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+*  PERFORMANCE OF THIS SOFTWARE.
+*
+*  ========================================================================
+*
+* Language:    ANSI C
+* Environment: Any
+* Developer:   Kendall Bennett
+*
+* Description: Header file for debug definitions.
+*
+****************************************************************************/
+
+#ifndef __X86EMU_DEBUG_H
+#define __X86EMU_DEBUG_H
+
+/*---------------------- Macros and type definitions ----------------------*/
+
+/* checks to be enabled for "runtime" */
+
+#define CHECK_IP_FETCH_F               0x1
+#define CHECK_SP_ACCESS_F              0x2
+#define CHECK_MEM_ACCESS_F             0x4     /*using regular linear pointer */
+#define CHECK_DATA_ACCESS_F            0x8     /*using segment:offset */
+
+#ifdef DEBUG
+# define CHECK_IP_FETCH()              (M.x86.check & CHECK_IP_FETCH_F)
+# define CHECK_SP_ACCESS()             (M.x86.check & CHECK_SP_ACCESS_F)
+# define CHECK_MEM_ACCESS()            (M.x86.check & CHECK_MEM_ACCESS_F)
+# define CHECK_DATA_ACCESS()           (M.x86.check & CHECK_DATA_ACCESS_F)
+#else
+# define CHECK_IP_FETCH()
+# define CHECK_SP_ACCESS()
+# define CHECK_MEM_ACCESS()
+# define CHECK_DATA_ACCESS()
+#endif
+
+#ifdef DEBUG
+# define DEBUG_INSTRUMENT()    (M.x86.debug & DEBUG_INSTRUMENT_F)
+# define DEBUG_DECODE()                (M.x86.debug & DEBUG_DECODE_F)
+# define DEBUG_TRACE()         (M.x86.debug & DEBUG_TRACE_F)
+# define DEBUG_STEP()          (M.x86.debug & DEBUG_STEP_F)
+# define DEBUG_DISASSEMBLE()   (M.x86.debug & DEBUG_DISASSEMBLE_F)
+# define DEBUG_BREAK()         (M.x86.debug & DEBUG_BREAK_F)
+# define DEBUG_SVC()           (M.x86.debug & DEBUG_SVC_F)
+# define DEBUG_SAVE_IP_CS()    (M.x86.debug & DEBUG_SAVE_CS_IP)
+
+# define DEBUG_FS()            (M.x86.debug & DEBUG_FS_F)
+# define DEBUG_PROC()          (M.x86.debug & DEBUG_PROC_F)
+# define DEBUG_SYSINT()                (M.x86.debug & DEBUG_SYSINT_F)
+# define DEBUG_TRACECALL()     (M.x86.debug & DEBUG_TRACECALL_F)
+# define DEBUG_TRACECALLREGS() (M.x86.debug & DEBUG_TRACECALL_REGS_F)
+# define DEBUG_SYS()           (M.x86.debug & DEBUG_SYS_F)
+# define DEBUG_MEM_TRACE()     (M.x86.debug & DEBUG_MEM_TRACE_F)
+# define DEBUG_IO_TRACE()      (M.x86.debug & DEBUG_IO_TRACE_F)
+# define DEBUG_DECODE_NOPRINT() (M.x86.debug & DEBUG_DECODE_NOPRINT_F)
+#else
+# define DEBUG_INSTRUMENT()    0
+# define DEBUG_DECODE()                0
+# define DEBUG_TRACE()         0
+# define DEBUG_STEP()          0
+# define DEBUG_DISASSEMBLE()   0
+# define DEBUG_BREAK()         0
+# define DEBUG_SVC()           0
+# define DEBUG_SAVE_IP_CS()    0
+# define DEBUG_FS()            0
+# define DEBUG_PROC()          0
+# define DEBUG_SYSINT()                0
+# define DEBUG_TRACECALL()     0
+# define DEBUG_TRACECALLREGS() 0
+# define DEBUG_SYS()           0
+# define DEBUG_MEM_TRACE()     0
+# define DEBUG_IO_TRACE()      0
+# define DEBUG_DECODE_NOPRINT() 0
+#endif
+
+#ifdef DEBUG
+
+# define DECODE_PRINTF(x)      if (DEBUG_DECODE()) \
+                                   x86emu_decode_printf(x)
+# define DECODE_PRINTF2(x,y)   if (DEBUG_DECODE()) \
+                                   x86emu_decode_printf2(x,y)
+
+/*
+ * The following allow us to look at the bytes of an instruction.  The
+ * first INCR_INSTRN_LEN, is called everytime bytes are consumed in
+ * the decoding process.  The SAVE_IP_CS is called initially when the
+ * major opcode of the instruction is accessed.
+ */
+#define INC_DECODED_INST_LEN(x)                            \
+    if (DEBUG_DECODE())                                    \
+       x86emu_inc_decoded_inst_len(x)
+
+#define SAVE_IP_CS(x,y)                                                \
+    if (DEBUG_DECODE() | DEBUG_TRACECALL() | DEBUG_BREAK() \
+             | DEBUG_IO_TRACE() | DEBUG_SAVE_IP_CS()) { \
+       M.x86.saved_cs = x;                                     \
+       M.x86.saved_ip = y;                                     \
+    }
+#else
+# define INC_DECODED_INST_LEN(x)
+# define DECODE_PRINTF(x)
+# define DECODE_PRINTF2(x,y)
+# define SAVE_IP_CS(x,y)
+#endif
+
+#ifdef DEBUG
+#define TRACE_REGS()                                       \
+    if (DEBUG_DISASSEMBLE()) {                             \
+       x86emu_just_disassemble();                          \
+       goto EndOfTheInstructionProcedure;                  \
+    }                                                      \
+    if (DEBUG_TRACE() || DEBUG_DECODE()) X86EMU_trace_regs()
+#else
+# define TRACE_REGS()
+#endif
+
+#ifdef DEBUG
+# define SINGLE_STEP()     if (DEBUG_STEP()) x86emu_single_step()
+#else
+# define SINGLE_STEP()
+#endif
+
+#define TRACE_AND_STEP()    \
+    TRACE_REGS();          \
+    SINGLE_STEP()
+
+#ifdef DEBUG
+# define START_OF_INSTR()
+# define END_OF_INSTR()            EndOfTheInstructionProcedure: x86emu_end_instr();
+# define END_OF_INSTR_NO_TRACE()    x86emu_end_instr();
+#else
+# define START_OF_INSTR()
+# define END_OF_INSTR()
+# define END_OF_INSTR_NO_TRACE()
+#endif
+
+#ifdef DEBUG
+# define  CALL_TRACE(u,v,w,x,s)                                        \
+    if (DEBUG_TRACECALLREGS())                                 \
+       x86emu_dump_regs();                                     \
+    if (DEBUG_TRACECALL())                                     \
+       printk("%04x:%04x: CALL %s%04x:%04x\n", u , v, s, w, x);
+# define RETURN_TRACE(n,u,v)                                   \
+    if (DEBUG_TRACECALLREGS())                                 \
+       x86emu_dump_regs();                                     \
+    if (DEBUG_TRACECALL())                                     \
+       printk("%04x:%04x: %s\n",u,v,n);
+#else
+# define CALL_TRACE(u,v,w,x,s)
+# define RETURN_TRACE(n,u,v)
+#endif
+
+#ifdef DEBUG
+#define DB(x)  x
+#else
+#define DB(x)
+#endif
+
+/*-------------------------- Function Prototypes --------------------------*/
+
+#ifdef __cplusplus
+extern "C" {                   /* Use "C" linkage when in C++ mode */
+#endif
+
+       extern void x86emu_inc_decoded_inst_len(int x);
+       extern void x86emu_decode_printf(char *x);
+       extern void x86emu_decode_printf2(char *x, int y);
+       extern void x86emu_just_disassemble(void);
+       extern void x86emu_single_step(void);
+       extern void x86emu_end_instr(void);
+       extern void x86emu_dump_regs(void);
+       extern void x86emu_dump_xregs(void);
+       extern void x86emu_print_int_vect(u16 iv);
+       extern void x86emu_instrument_instruction(void);
+       extern void x86emu_check_ip_access(void);
+       extern void x86emu_check_sp_access(void);
+       extern void x86emu_check_mem_access(u32 p);
+       extern void x86emu_check_data_access(uint s, uint o);
+
+#ifdef __cplusplus
+}                              /* End of "C" linkage for C++       */
+#endif
+#endif                         /* __X86EMU_DEBUG_H */
diff --git a/drivers/bios_emulator/include/x86emu/decode.h b/drivers/bios_emulator/include/x86emu/decode.h
new file mode 100644 (file)
index 0000000..77769f0
--- /dev/null
@@ -0,0 +1,88 @@
+/****************************************************************************
+*
+*                       Realmode X86 Emulator Library
+*
+*               Copyright (C) 1991-2004 SciTech Software, Inc.
+*                    Copyright (C) David Mosberger-Tang
+*                      Copyright (C) 1999 Egbert Eich
+*
+*  ========================================================================
+*
+*  Permission to use, copy, modify, distribute, and sell this software and
+*  its documentation for any purpose is hereby granted without fee,
+*  provided that the above copyright notice appear in all copies and that
+*  both that copyright notice and this permission notice appear in
+*  supporting documentation, and that the name of the authors not be used
+*  in advertising or publicity pertaining to distribution of the software
+*  without specific, written prior permission.  The authors makes no
+*  representations about the suitability of this software for any purpose.
+*  It is provided "as is" without express or implied warranty.
+*
+*  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+*  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+*  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+*  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+*  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+*  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+*  PERFORMANCE OF THIS SOFTWARE.
+*
+*  ========================================================================
+*
+* Language:     ANSI C
+* Environment:  Any
+* Developer:    Kendall Bennett
+*
+* Description:  Header file for instruction decoding logic.
+*
+****************************************************************************/
+
+#ifndef __X86EMU_DECODE_H
+#define __X86EMU_DECODE_H
+
+/*---------------------- Macros and type definitions ----------------------*/
+
+/* Instruction Decoding Stuff */
+
+#define FETCH_DECODE_MODRM(mod,rh,rl)   fetch_decode_modrm(&mod,&rh,&rl)
+#define DECODE_RM_BYTE_REGISTER(r)      decode_rm_byte_register(r)
+#define DECODE_RM_WORD_REGISTER(r)      decode_rm_word_register(r)
+#define DECODE_RM_LONG_REGISTER(r)      decode_rm_long_register(r)
+#define DECODE_CLEAR_SEGOVR()           M.x86.mode &= ~SYSMODE_CLRMASK
+
+/*-------------------------- Function Prototypes --------------------------*/
+
+#ifdef  __cplusplus
+extern "C" {                        /* Use "C" linkage when in C++ mode */
+#endif
+
+void    x86emu_intr_raise (u8 type);
+void    fetch_decode_modrm (int *mod,int *regh,int *regl);
+u8      fetch_byte_imm (void);
+u16     fetch_word_imm (void);
+u32     fetch_long_imm (void);
+u8      fetch_data_byte (uint offset);
+u8      fetch_data_byte_abs (uint segment, uint offset);
+u16     fetch_data_word (uint offset);
+u16     fetch_data_word_abs (uint segment, uint offset);
+u32     fetch_data_long (uint offset);
+u32     fetch_data_long_abs (uint segment, uint offset);
+void    store_data_byte (uint offset, u8 val);
+void    store_data_byte_abs (uint segment, uint offset, u8 val);
+void    store_data_word (uint offset, u16 val);
+void    store_data_word_abs (uint segment, uint offset, u16 val);
+void    store_data_long (uint offset, u32 val);
+void    store_data_long_abs (uint segment, uint offset, u32 val);
+u8*     decode_rm_byte_register(int reg);
+u16*    decode_rm_word_register(int reg);
+u32*    decode_rm_long_register(int reg);
+u16*    decode_rm_seg_register(int reg);
+unsigned decode_rm00_address(int rm);
+unsigned decode_rm01_address(int rm);
+unsigned decode_rm10_address(int rm);
+unsigned decode_rmXX_address(int mod, int rm);
+
+#ifdef  __cplusplus
+}                                   /* End of "C" linkage for C++       */
+#endif
+
+#endif /* __X86EMU_DECODE_H */
diff --git a/drivers/bios_emulator/include/x86emu/ops.h b/drivers/bios_emulator/include/x86emu/ops.h
new file mode 100644 (file)
index 0000000..a4f2316
--- /dev/null
@@ -0,0 +1,45 @@
+/****************************************************************************
+*
+*                       Realmode X86 Emulator Library
+*
+*               Copyright (C) 1991-2004 SciTech Software, Inc.
+*                    Copyright (C) David Mosberger-Tang
+*                      Copyright (C) 1999 Egbert Eich
+*
+*  ========================================================================
+*
+*  Permission to use, copy, modify, distribute, and sell this software and
+*  its documentation for any purpose is hereby granted without fee,
+*  provided that the above copyright notice appear in all copies and that
+*  both that copyright notice and this permission notice appear in
+*  supporting documentation, and that the name of the authors not be used
+*  in advertising or publicity pertaining to distribution of the software
+*  without specific, written prior permission.  The authors makes no
+*  representations about the suitability of this software for any purpose.
+*  It is provided "as is" without express or implied warranty.
+*
+*  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+*  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+*  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+*  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+*  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+*  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+*  PERFORMANCE OF THIS SOFTWARE.
+*
+*  ========================================================================
+*
+* Language:     ANSI C
+* Environment:  Any
+* Developer:    Kendall Bennett
+*
+* Description:  Header file for operand decoding functions.
+*
+****************************************************************************/
+
+#ifndef __X86EMU_OPS_H
+#define __X86EMU_OPS_H
+
+extern void (*x86emu_optab[0x100])(u8 op1);
+extern void (*x86emu_optab2[0x100])(u8 op2);
+
+#endif /* __X86EMU_OPS_H */
diff --git a/drivers/bios_emulator/include/x86emu/prim_asm.h b/drivers/bios_emulator/include/x86emu/prim_asm.h
new file mode 100644 (file)
index 0000000..4cb4cab
--- /dev/null
@@ -0,0 +1,970 @@
+/****************************************************************************
+*
+*                       Realmode X86 Emulator Library
+*
+*               Copyright (C) 1991-2004 SciTech Software, Inc.
+*                    Copyright (C) David Mosberger-Tang
+*                      Copyright (C) 1999 Egbert Eich
+*
+*  ========================================================================
+*
+*  Permission to use, copy, modify, distribute, and sell this software and
+*  its documentation for any purpose is hereby granted without fee,
+*  provided that the above copyright notice appear in all copies and that
+*  both that copyright notice and this permission notice appear in
+*  supporting documentation, and that the name of the authors not be used
+*  in advertising or publicity pertaining to distribution of the software
+*  without specific, written prior permission.  The authors makes no
+*  representations about the suitability of this software for any purpose.
+*  It is provided "as is" without express or implied warranty.
+*
+*  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+*  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+*  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+*  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+*  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+*  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+*  PERFORMANCE OF THIS SOFTWARE.
+*
+*  ========================================================================
+*
+* Language:     Watcom C++ 10.6 or later
+* Environment:  Any
+* Developer:    Kendall Bennett
+*
+* Description:  Inline assembler versions of the primitive operand
+*               functions for faster performance. At the moment this is
+*               x86 inline assembler, but these functions could be replaced
+*               with native inline assembler for each supported processor
+*               platform.
+*
+****************************************************************************/
+
+#ifndef __X86EMU_PRIM_ASM_H
+#define __X86EMU_PRIM_ASM_H
+
+#ifdef  __WATCOMC__
+
+#ifndef VALIDATE
+#define __HAVE_INLINE_ASSEMBLER__
+#endif
+
+u32 get_flags_asm(void);
+#pragma aux get_flags_asm =         \
+    "pushf"                         \
+    "pop    eax"                    \
+    value [eax]                     \
+    modify exact [eax];
+
+u16 aaa_word_asm(u32 * flags, u16 d);
+#pragma aux aaa_word_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "aaa"                           \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [ax]                 \
+    value [ax]                      \
+    modify exact [ax];
+
+u16 aas_word_asm(u32 * flags, u16 d);
+#pragma aux aas_word_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "aas"                           \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [ax]                 \
+    value [ax]                      \
+    modify exact [ax];
+
+u16 aad_word_asm(u32 * flags, u16 d);
+#pragma aux aad_word_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "aad"                           \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [ax]                 \
+    value [ax]                      \
+    modify exact [ax];
+
+u16 aam_word_asm(u32 * flags, u8 d);
+#pragma aux aam_word_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "aam"                           \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [al]                 \
+    value [ax]                      \
+    modify exact [ax];
+
+u8 adc_byte_asm(u32 * flags, u8 d, u8 s);
+#pragma aux adc_byte_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "adc    al,bl"                  \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [al] [bl]            \
+    value [al]                      \
+    modify exact [al bl];
+
+u16 adc_word_asm(u32 * flags, u16 d, u16 s);
+#pragma aux adc_word_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "adc    ax,bx"                  \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [ax] [bx]            \
+    value [ax]                      \
+    modify exact [ax bx];
+
+u32 adc_long_asm(u32 * flags, u32 d, u32 s);
+#pragma aux adc_long_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "adc    eax,ebx"                \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [eax] [ebx]          \
+    value [eax]                     \
+    modify exact [eax ebx];
+
+u8 add_byte_asm(u32 * flags, u8 d, u8 s);
+#pragma aux add_byte_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "add    al,bl"                  \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [al] [bl]            \
+    value [al]                      \
+    modify exact [al bl];
+
+u16 add_word_asm(u32 * flags, u16 d, u16 s);
+#pragma aux add_word_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "add    ax,bx"                  \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [ax] [bx]            \
+    value [ax]                      \
+    modify exact [ax bx];
+
+u32 add_long_asm(u32 * flags, u32 d, u32 s);
+#pragma aux add_long_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "add    eax,ebx"                \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [eax] [ebx]          \
+    value [eax]                     \
+    modify exact [eax ebx];
+
+u8 and_byte_asm(u32 * flags, u8 d, u8 s);
+#pragma aux and_byte_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "and    al,bl"                  \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [al] [bl]            \
+    value [al]                      \
+    modify exact [al bl];
+
+u16 and_word_asm(u32 * flags, u16 d, u16 s);
+#pragma aux and_word_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "and    ax,bx"                  \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [ax] [bx]            \
+    value [ax]                      \
+    modify exact [ax bx];
+
+u32 and_long_asm(u32 * flags, u32 d, u32 s);
+#pragma aux and_long_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "and    eax,ebx"                \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [eax] [ebx]          \
+    value [eax]                     \
+    modify exact [eax ebx];
+
+u8 cmp_byte_asm(u32 * flags, u8 d, u8 s);
+#pragma aux cmp_byte_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "cmp    al,bl"                  \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [al] [bl]            \
+    value [al]                      \
+    modify exact [al bl];
+
+u16 cmp_word_asm(u32 * flags, u16 d, u16 s);
+#pragma aux cmp_word_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "cmp    ax,bx"                  \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [ax] [bx]            \
+    value [ax]                      \
+    modify exact [ax bx];
+
+u32 cmp_long_asm(u32 * flags, u32 d, u32 s);
+#pragma aux cmp_long_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "cmp    eax,ebx"                \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [eax] [ebx]          \
+    value [eax]                     \
+    modify exact [eax ebx];
+
+u8 daa_byte_asm(u32 * flags, u8 d);
+#pragma aux daa_byte_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "daa"                           \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [al]                 \
+    value [al]                      \
+    modify exact [al];
+
+u8 das_byte_asm(u32 * flags, u8 d);
+#pragma aux das_byte_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "das"                           \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [al]                 \
+    value [al]                      \
+    modify exact [al];
+
+u8 dec_byte_asm(u32 * flags, u8 d);
+#pragma aux dec_byte_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "dec    al"                     \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [al]                 \
+    value [al]                      \
+    modify exact [al];
+
+u16 dec_word_asm(u32 * flags, u16 d);
+#pragma aux dec_word_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "dec    ax"                     \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [ax]                 \
+    value [ax]                      \
+    modify exact [ax];
+
+u32 dec_long_asm(u32 * flags, u32 d);
+#pragma aux dec_long_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "dec    eax"                    \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [eax]                \
+    value [eax]                     \
+    modify exact [eax];
+
+u8 inc_byte_asm(u32 * flags, u8 d);
+#pragma aux inc_byte_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "inc    al"                     \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [al]                 \
+    value [al]                      \
+    modify exact [al];
+
+u16 inc_word_asm(u32 * flags, u16 d);
+#pragma aux inc_word_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "inc    ax"                     \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [ax]                 \
+    value [ax]                      \
+    modify exact [ax];
+
+u32 inc_long_asm(u32 * flags, u32 d);
+#pragma aux inc_long_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "inc    eax"                    \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [eax]                \
+    value [eax]                     \
+    modify exact [eax];
+
+u8 or_byte_asm(u32 * flags, u8 d, u8 s);
+#pragma aux or_byte_asm =           \
+    "push   [edi]"                  \
+    "popf"                          \
+    "or al,bl"                      \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [al] [bl]            \
+    value [al]                      \
+    modify exact [al bl];
+
+u16 or_word_asm(u32 * flags, u16 d, u16 s);
+#pragma aux or_word_asm =           \
+    "push   [edi]"                  \
+    "popf"                          \
+    "or ax,bx"                      \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [ax] [bx]            \
+    value [ax]                      \
+    modify exact [ax bx];
+
+u32 or_long_asm(u32 * flags, u32 d, u32 s);
+#pragma aux or_long_asm =           \
+    "push   [edi]"                  \
+    "popf"                          \
+    "or eax,ebx"                    \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [eax] [ebx]          \
+    value [eax]                     \
+    modify exact [eax ebx];
+
+u8 neg_byte_asm(u32 * flags, u8 d);
+#pragma aux neg_byte_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "neg    al"                     \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [al]                 \
+    value [al]                      \
+    modify exact [al];
+
+u16 neg_word_asm(u32 * flags, u16 d);
+#pragma aux neg_word_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "neg    ax"                     \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [ax]                 \
+    value [ax]                      \
+    modify exact [ax];
+
+u32 neg_long_asm(u32 * flags, u32 d);
+#pragma aux neg_long_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "neg    eax"                    \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [eax]                \
+    value [eax]                     \
+    modify exact [eax];
+
+u8 not_byte_asm(u32 * flags, u8 d);
+#pragma aux not_byte_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "not    al"                     \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [al]                 \
+    value [al]                      \
+    modify exact [al];
+
+u16 not_word_asm(u32 * flags, u16 d);
+#pragma aux not_word_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "not    ax"                     \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [ax]                 \
+    value [ax]                      \
+    modify exact [ax];
+
+u32 not_long_asm(u32 * flags, u32 d);
+#pragma aux not_long_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "not    eax"                    \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [eax]                \
+    value [eax]                     \
+    modify exact [eax];
+
+u8 rcl_byte_asm(u32 * flags, u8 d, u8 s);
+#pragma aux rcl_byte_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "rcl    al,cl"                  \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [al] [cl]            \
+    value [al]                      \
+    modify exact [al cl];
+
+u16 rcl_word_asm(u32 * flags, u16 d, u8 s);
+#pragma aux rcl_word_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "rcl    ax,cl"                  \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [ax] [cl]            \
+    value [ax]                      \
+    modify exact [ax cl];
+
+u32 rcl_long_asm(u32 * flags, u32 d, u8 s);
+#pragma aux rcl_long_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "rcl    eax,cl"                 \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [eax] [cl]           \
+    value [eax]                     \
+    modify exact [eax cl];
+
+u8 rcr_byte_asm(u32 * flags, u8 d, u8 s);
+#pragma aux rcr_byte_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "rcr    al,cl"                  \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [al] [cl]            \
+    value [al]                      \
+    modify exact [al cl];
+
+u16 rcr_word_asm(u32 * flags, u16 d, u8 s);
+#pragma aux rcr_word_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "rcr    ax,cl"                  \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [ax] [cl]            \
+    value [ax]                      \
+    modify exact [ax cl];
+
+u32 rcr_long_asm(u32 * flags, u32 d, u8 s);
+#pragma aux rcr_long_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "rcr    eax,cl"                 \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [eax] [cl]           \
+    value [eax]                     \
+    modify exact [eax cl];
+
+u8 rol_byte_asm(u32 * flags, u8 d, u8 s);
+#pragma aux rol_byte_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "rol    al,cl"                  \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [al] [cl]            \
+    value [al]                      \
+    modify exact [al cl];
+
+u16 rol_word_asm(u32 * flags, u16 d, u8 s);
+#pragma aux rol_word_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "rol    ax,cl"                  \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [ax] [cl]            \
+    value [ax]                      \
+    modify exact [ax cl];
+
+u32 rol_long_asm(u32 * flags, u32 d, u8 s);
+#pragma aux rol_long_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "rol    eax,cl"                 \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [eax] [cl]           \
+    value [eax]                     \
+    modify exact [eax cl];
+
+u8 ror_byte_asm(u32 * flags, u8 d, u8 s);
+#pragma aux ror_byte_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "ror    al,cl"                  \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [al] [cl]            \
+    value [al]                      \
+    modify exact [al cl];
+
+u16 ror_word_asm(u32 * flags, u16 d, u8 s);
+#pragma aux ror_word_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "ror    ax,cl"                  \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [ax] [cl]            \
+    value [ax]                      \
+    modify exact [ax cl];
+
+u32 ror_long_asm(u32 * flags, u32 d, u8 s);
+#pragma aux ror_long_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "ror    eax,cl"                 \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [eax] [cl]           \
+    value [eax]                     \
+    modify exact [eax cl];
+
+u8 shl_byte_asm(u32 * flags, u8 d, u8 s);
+#pragma aux shl_byte_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "shl    al,cl"                  \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [al] [cl]            \
+    value [al]                      \
+    modify exact [al cl];
+
+u16 shl_word_asm(u32 * flags, u16 d, u8 s);
+#pragma aux shl_word_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "shl    ax,cl"                  \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [ax] [cl]            \
+    value [ax]                      \
+    modify exact [ax cl];
+
+u32 shl_long_asm(u32 * flags, u32 d, u8 s);
+#pragma aux shl_long_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "shl    eax,cl"                 \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [eax] [cl]           \
+    value [eax]                     \
+    modify exact [eax cl];
+
+u8 shr_byte_asm(u32 * flags, u8 d, u8 s);
+#pragma aux shr_byte_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "shr    al,cl"                  \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [al] [cl]            \
+    value [al]                      \
+    modify exact [al cl];
+
+u16 shr_word_asm(u32 * flags, u16 d, u8 s);
+#pragma aux shr_word_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "shr    ax,cl"                  \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [ax] [cl]            \
+    value [ax]                      \
+    modify exact [ax cl];
+
+u32 shr_long_asm(u32 * flags, u32 d, u8 s);
+#pragma aux shr_long_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "shr    eax,cl"                 \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [eax] [cl]           \
+    value [eax]                     \
+    modify exact [eax cl];
+
+u8 sar_byte_asm(u32 * flags, u8 d, u8 s);
+#pragma aux sar_byte_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "sar    al,cl"                  \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [al] [cl]            \
+    value [al]                      \
+    modify exact [al cl];
+
+u16 sar_word_asm(u32 * flags, u16 d, u8 s);
+#pragma aux sar_word_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "sar    ax,cl"                  \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [ax] [cl]            \
+    value [ax]                      \
+    modify exact [ax cl];
+
+u32 sar_long_asm(u32 * flags, u32 d, u8 s);
+#pragma aux sar_long_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "sar    eax,cl"                 \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [eax] [cl]           \
+    value [eax]                     \
+    modify exact [eax cl];
+
+u16 shld_word_asm(u32 * flags, u16 d, u16 fill, u8 s);
+#pragma aux shld_word_asm =         \
+    "push   [edi]"                  \
+    "popf"                          \
+    "shld   ax,dx,cl"               \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [ax] [dx] [cl]       \
+    value [ax]                      \
+    modify exact [ax dx cl];
+
+u32 shld_long_asm(u32 * flags, u32 d, u32 fill, u8 s);
+#pragma aux shld_long_asm =         \
+    "push   [edi]"                  \
+    "popf"                          \
+    "shld   eax,edx,cl"             \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [eax] [edx] [cl]     \
+    value [eax]                     \
+    modify exact [eax edx cl];
+
+u16 shrd_word_asm(u32 * flags, u16 d, u16 fill, u8 s);
+#pragma aux shrd_word_asm =         \
+    "push   [edi]"                  \
+    "popf"                          \
+    "shrd   ax,dx,cl"               \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [ax] [dx] [cl]       \
+    value [ax]                      \
+    modify exact [ax dx cl];
+
+u32 shrd_long_asm(u32 * flags, u32 d, u32 fill, u8 s);
+#pragma aux shrd_long_asm =         \
+    "push   [edi]"                  \
+    "popf"                          \
+    "shrd   eax,edx,cl"             \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [eax] [edx] [cl]     \
+    value [eax]                     \
+    modify exact [eax edx cl];
+
+u8 sbb_byte_asm(u32 * flags, u8 d, u8 s);
+#pragma aux sbb_byte_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "sbb    al,bl"                  \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [al] [bl]            \
+    value [al]                      \
+    modify exact [al bl];
+
+u16 sbb_word_asm(u32 * flags, u16 d, u16 s);
+#pragma aux sbb_word_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "sbb    ax,bx"                  \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [ax] [bx]            \
+    value [ax]                      \
+    modify exact [ax bx];
+
+u32 sbb_long_asm(u32 * flags, u32 d, u32 s);
+#pragma aux sbb_long_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "sbb    eax,ebx"                \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [eax] [ebx]          \
+    value [eax]                     \
+    modify exact [eax ebx];
+
+u8 sub_byte_asm(u32 * flags, u8 d, u8 s);
+#pragma aux sub_byte_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "sub    al,bl"                  \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [al] [bl]            \
+    value [al]                      \
+    modify exact [al bl];
+
+u16 sub_word_asm(u32 * flags, u16 d, u16 s);
+#pragma aux sub_word_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "sub    ax,bx"                  \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [ax] [bx]            \
+    value [ax]                      \
+    modify exact [ax bx];
+
+u32 sub_long_asm(u32 * flags, u32 d, u32 s);
+#pragma aux sub_long_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "sub    eax,ebx"                \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [eax] [ebx]          \
+    value [eax]                     \
+    modify exact [eax ebx];
+
+void test_byte_asm(u32 * flags, u8 d, u8 s);
+#pragma aux test_byte_asm =         \
+    "push   [edi]"                  \
+    "popf"                          \
+    "test   al,bl"                  \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [al] [bl]            \
+    modify exact [al bl];
+
+void test_word_asm(u32 * flags, u16 d, u16 s);
+#pragma aux test_word_asm =         \
+    "push   [edi]"                  \
+    "popf"                          \
+    "test   ax,bx"                  \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [ax] [bx]            \
+    modify exact [ax bx];
+
+void test_long_asm(u32 * flags, u32 d, u32 s);
+#pragma aux test_long_asm =         \
+    "push   [edi]"                  \
+    "popf"                          \
+    "test   eax,ebx"                \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [eax] [ebx]          \
+    modify exact [eax ebx];
+
+u8 xor_byte_asm(u32 * flags, u8 d, u8 s);
+#pragma aux xor_byte_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "xor    al,bl"                  \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [al] [bl]            \
+    value [al]                      \
+    modify exact [al bl];
+
+u16 xor_word_asm(u32 * flags, u16 d, u16 s);
+#pragma aux xor_word_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "xor    ax,bx"                  \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [ax] [bx]            \
+    value [ax]                      \
+    modify exact [ax bx];
+
+u32 xor_long_asm(u32 * flags, u32 d, u32 s);
+#pragma aux xor_long_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "xor    eax,ebx"                \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    parm [edi] [eax] [ebx]          \
+    value [eax]                     \
+    modify exact [eax ebx];
+
+void imul_byte_asm(u32 * flags, u16 * ax, u8 d, u8 s);
+#pragma aux imul_byte_asm =         \
+    "push   [edi]"                  \
+    "popf"                          \
+    "imul   bl"                     \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    "mov    [esi],ax"               \
+    parm [edi] [esi] [al] [bl]      \
+    modify exact [esi ax bl];
+
+void imul_word_asm(u32 * flags, u16 * ax, u16 * dx, u16 d, u16 s);
+#pragma aux imul_word_asm =         \
+    "push   [edi]"                  \
+    "popf"                          \
+    "imul   bx"                     \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    "mov    [esi],ax"               \
+    "mov    [ecx],dx"               \
+    parm [edi] [esi] [ecx] [ax] [bx]\
+    modify exact [esi edi ax bx dx];
+
+void imul_long_asm(u32 * flags, u32 * eax, u32 * edx, u32 d, u32 s);
+#pragma aux imul_long_asm =         \
+    "push   [edi]"                  \
+    "popf"                          \
+    "imul   ebx"                    \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    "mov    [esi],eax"              \
+    "mov    [ecx],edx"              \
+    parm [edi] [esi] [ecx] [eax] [ebx] \
+    modify exact [esi edi eax ebx edx];
+
+void mul_byte_asm(u32 * flags, u16 * ax, u8 d, u8 s);
+#pragma aux mul_byte_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "mul    bl"                     \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    "mov    [esi],ax"               \
+    parm [edi] [esi] [al] [bl]      \
+    modify exact [esi ax bl];
+
+void mul_word_asm(u32 * flags, u16 * ax, u16 * dx, u16 d, u16 s);
+#pragma aux mul_word_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "mul    bx"                     \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    "mov    [esi],ax"               \
+    "mov    [ecx],dx"               \
+    parm [edi] [esi] [ecx] [ax] [bx]\
+    modify exact [esi edi ax bx dx];
+
+void mul_long_asm(u32 * flags, u32 * eax, u32 * edx, u32 d, u32 s);
+#pragma aux mul_long_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "mul    ebx"                    \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    "mov    [esi],eax"              \
+    "mov    [ecx],edx"              \
+    parm [edi] [esi] [ecx] [eax] [ebx] \
+    modify exact [esi edi eax ebx edx];
+
+void idiv_byte_asm(u32 * flags, u8 * al, u8 * ah, u16 d, u8 s);
+#pragma aux idiv_byte_asm =         \
+    "push   [edi]"                  \
+    "popf"                          \
+    "idiv   bl"                     \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    "mov    [esi],al"               \
+    "mov    [ecx],ah"               \
+    parm [edi] [esi] [ecx] [ax] [bl]\
+    modify exact [esi edi ax bl];
+
+void idiv_word_asm(u32 * flags, u16 * ax, u16 * dx, u16 dlo, u16 dhi, u16 s);
+#pragma aux idiv_word_asm =         \
+    "push   [edi]"                  \
+    "popf"                          \
+    "idiv   bx"                     \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    "mov    [esi],ax"               \
+    "mov    [ecx],dx"               \
+    parm [edi] [esi] [ecx] [ax] [dx] [bx]\
+    modify exact [esi edi ax dx bx];
+
+void idiv_long_asm(u32 * flags, u32 * eax, u32 * edx, u32 dlo, u32 dhi, u32 s);
+#pragma aux idiv_long_asm =         \
+    "push   [edi]"                  \
+    "popf"                          \
+    "idiv   ebx"                    \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    "mov    [esi],eax"              \
+    "mov    [ecx],edx"              \
+    parm [edi] [esi] [ecx] [eax] [edx] [ebx]\
+    modify exact [esi edi eax edx ebx];
+
+void div_byte_asm(u32 * flags, u8 * al, u8 * ah, u16 d, u8 s);
+#pragma aux div_byte_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "div    bl"                     \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    "mov    [esi],al"               \
+    "mov    [ecx],ah"               \
+    parm [edi] [esi] [ecx] [ax] [bl]\
+    modify exact [esi edi ax bl];
+
+void div_word_asm(u32 * flags, u16 * ax, u16 * dx, u16 dlo, u16 dhi, u16 s);
+#pragma aux div_word_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "div    bx"                     \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    "mov    [esi],ax"               \
+    "mov    [ecx],dx"               \
+    parm [edi] [esi] [ecx] [ax] [dx] [bx]\
+    modify exact [esi edi ax dx bx];
+
+void div_long_asm(u32 * flags, u32 * eax, u32 * edx, u32 dlo, u32 dhi, u32 s);
+#pragma aux div_long_asm =          \
+    "push   [edi]"                  \
+    "popf"                          \
+    "div    ebx"                    \
+    "pushf"                         \
+    "pop    [edi]"                  \
+    "mov    [esi],eax"              \
+    "mov    [ecx],edx"              \
+    parm [edi] [esi] [ecx] [eax] [edx] [ebx]\
+    modify exact [esi edi eax edx ebx];
+
+#endif
+
+#endif                         /* __X86EMU_PRIM_ASM_H */
diff --git a/drivers/bios_emulator/include/x86emu/prim_ops.h b/drivers/bios_emulator/include/x86emu/prim_ops.h
new file mode 100644 (file)
index 0000000..2291e84
--- /dev/null
@@ -0,0 +1,141 @@
+/****************************************************************************
+*
+*                       Realmode X86 Emulator Library
+*
+*               Copyright (C) 1991-2004 SciTech Software, Inc.
+*                    Copyright (C) David Mosberger-Tang
+*                      Copyright (C) 1999 Egbert Eich
+*
+*  ========================================================================
+*
+*  Permission to use, copy, modify, distribute, and sell this software and
+*  its documentation for any purpose is hereby granted without fee,
+*  provided that the above copyright notice appear in all copies and that
+*  both that copyright notice and this permission notice appear in
+*  supporting documentation, and that the name of the authors not be used
+*  in advertising or publicity pertaining to distribution of the software
+*  without specific, written prior permission.  The authors makes no
+*  representations about the suitability of this software for any purpose.
+*  It is provided "as is" without express or implied warranty.
+*
+*  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+*  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+*  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+*  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+*  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+*  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+*  PERFORMANCE OF THIS SOFTWARE.
+*
+*  ========================================================================
+*
+* Language:     ANSI C
+* Environment:  Any
+* Developer:    Kendall Bennett
+*
+* Description:  Header file for primitive operation functions.
+*
+****************************************************************************/
+
+#ifndef __X86EMU_PRIM_OPS_H
+#define __X86EMU_PRIM_OPS_H
+
+#ifdef  __cplusplus
+extern "C" {                        /* Use "C" linkage when in C++ mode */
+#endif
+
+u16     aaa_word (u16 d);
+u16     aas_word (u16 d);
+u16     aad_word (u16 d);
+u16     aam_word (u8 d);
+u8      adc_byte (u8 d, u8 s);
+u16     adc_word (u16 d, u16 s);
+u32     adc_long (u32 d, u32 s);
+u8      add_byte (u8 d, u8 s);
+u16     add_word (u16 d, u16 s);
+u32     add_long (u32 d, u32 s);
+u8      and_byte (u8 d, u8 s);
+u16     and_word (u16 d, u16 s);
+u32     and_long (u32 d, u32 s);
+u8      cmp_byte (u8 d, u8 s);
+u16     cmp_word (u16 d, u16 s);
+u32     cmp_long (u32 d, u32 s);
+u8      daa_byte (u8 d);
+u8      das_byte (u8 d);
+u8      dec_byte (u8 d);
+u16     dec_word (u16 d);
+u32     dec_long (u32 d);
+u8      inc_byte (u8 d);
+u16     inc_word (u16 d);
+u32     inc_long (u32 d);
+u8      or_byte (u8 d, u8 s);
+u16     or_word (u16 d, u16 s);
+u32     or_long (u32 d, u32 s);
+u8      neg_byte (u8 s);
+u16     neg_word (u16 s);
+u32     neg_long (u32 s);
+u8      not_byte (u8 s);
+u16     not_word (u16 s);
+u32     not_long (u32 s);
+u8      rcl_byte (u8 d, u8 s);
+u16     rcl_word (u16 d, u8 s);
+u32     rcl_long (u32 d, u8 s);
+u8      rcr_byte (u8 d, u8 s);
+u16     rcr_word (u16 d, u8 s);
+u32     rcr_long (u32 d, u8 s);
+u8      rol_byte (u8 d, u8 s);
+u16     rol_word (u16 d, u8 s);
+u32     rol_long (u32 d, u8 s);
+u8      ror_byte (u8 d, u8 s);
+u16     ror_word (u16 d, u8 s);
+u32     ror_long (u32 d, u8 s);
+u8      shl_byte (u8 d, u8 s);
+u16     shl_word (u16 d, u8 s);
+u32     shl_long (u32 d, u8 s);
+u8      shr_byte (u8 d, u8 s);
+u16     shr_word (u16 d, u8 s);
+u32     shr_long (u32 d, u8 s);
+u8      sar_byte (u8 d, u8 s);
+u16     sar_word (u16 d, u8 s);
+u32     sar_long (u32 d, u8 s);
+u16     shld_word (u16 d, u16 fill, u8 s);
+u32     shld_long (u32 d, u32 fill, u8 s);
+u16     shrd_word (u16 d, u16 fill, u8 s);
+u32     shrd_long (u32 d, u32 fill, u8 s);
+u8      sbb_byte (u8 d, u8 s);
+u16     sbb_word (u16 d, u16 s);
+u32     sbb_long (u32 d, u32 s);
+u8      sub_byte (u8 d, u8 s);
+u16     sub_word (u16 d, u16 s);
+u32     sub_long (u32 d, u32 s);
+void    test_byte (u8 d, u8 s);
+void    test_word (u16 d, u16 s);
+void    test_long (u32 d, u32 s);
+u8      xor_byte (u8 d, u8 s);
+u16     xor_word (u16 d, u16 s);
+u32     xor_long (u32 d, u32 s);
+void    imul_byte (u8 s);
+void    imul_word (u16 s);
+void    imul_long (u32 s);
+void    imul_long_direct(u32 *res_lo, u32* res_hi,u32 d, u32 s);
+void    mul_byte (u8 s);
+void    mul_word (u16 s);
+void    mul_long (u32 s);
+void    idiv_byte (u8 s);
+void    idiv_word (u16 s);
+void    idiv_long (u32 s);
+void    div_byte (u8 s);
+void    div_word (u16 s);
+void    div_long (u32 s);
+void    ins (int size);
+void    outs (int size);
+u16     mem_access_word (int addr);
+void    push_word (u16 w);
+void    push_long (u32 w);
+u16     pop_word (void);
+u32     pop_long (void);
+
+#ifdef  __cplusplus
+}                                   /* End of "C" linkage for C++       */
+#endif
+
+#endif /* __X86EMU_PRIM_OPS_H */
diff --git a/drivers/bios_emulator/include/x86emu/regs.h b/drivers/bios_emulator/include/x86emu/regs.h
new file mode 100644 (file)
index 0000000..a7fedd2
--- /dev/null
@@ -0,0 +1,340 @@
+/****************************************************************************
+*
+*                      Realmode X86 Emulator Library
+*
+*              Copyright (C) 1991-2004 SciTech Software, Inc.
+*                   Copyright (C) David Mosberger-Tang
+*                     Copyright (C) 1999 Egbert Eich
+*
+*  ========================================================================
+*
+*  Permission to use, copy, modify, distribute, and sell this software and
+*  its documentation for any purpose is hereby granted without fee,
+*  provided that the above copyright notice appear in all copies and that
+*  both that copyright notice and this permission notice appear in
+*  supporting documentation, and that the name of the authors not be used
+*  in advertising or publicity pertaining to distribution of the software
+*  without specific, written prior permission. The authors makes no
+*  representations about the suitability of this software for any purpose.
+*  It is provided "as is" without express or implied warranty.
+*
+*  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+*  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+*  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+*  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+*  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+*  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+*  PERFORMANCE OF THIS SOFTWARE.
+*
+*  ========================================================================
+*
+* Language:    ANSI C
+* Environment: Any
+* Developer:   Kendall Bennett
+*
+* Description: Header file for x86 register definitions.
+*
+****************************************************************************/
+
+#ifndef __X86EMU_REGS_H
+#define __X86EMU_REGS_H
+
+/*---------------------- Macros and type definitions ----------------------*/
+
+#pragma pack(1)
+
+/*
+ * General EAX, EBX, ECX, EDX type registers.  Note that for
+ * portability, and speed, the issue of byte swapping is not addressed
+ * in the registers.  All registers are stored in the default format
+ * available on the host machine.  The only critical issue is that the
+ * registers should line up EXACTLY in the same manner as they do in
+ * the 386.  That is:
+ *
+ * EAX & 0xff  === AL
+ * EAX & 0xffff == AX
+ *
+ * etc.         The result is that alot of the calculations can then be
+ * done using the native instruction set fully.
+ */
+
+#ifdef __BIG_ENDIAN__
+
+typedef struct {
+       u32 e_reg;
+} I32_reg_t;
+
+typedef struct {
+       u16 filler0, x_reg;
+} I16_reg_t;
+
+typedef struct {
+       u8 filler0, filler1, h_reg, l_reg;
+} I8_reg_t;
+
+#else                          /* !__BIG_ENDIAN__ */
+
+typedef struct {
+       u32 e_reg;
+} I32_reg_t;
+
+typedef struct {
+       u16 x_reg;
+} I16_reg_t;
+
+typedef struct {
+       u8 l_reg, h_reg;
+} I8_reg_t;
+
+#endif                         /* BIG_ENDIAN */
+
+typedef union {
+       I32_reg_t I32_reg;
+       I16_reg_t I16_reg;
+       I8_reg_t I8_reg;
+} i386_general_register;
+
+struct i386_general_regs {
+       i386_general_register A, B, C, D;
+};
+
+typedef struct i386_general_regs Gen_reg_t;
+
+struct i386_special_regs {
+       i386_general_register SP, BP, SI, DI, IP;
+       u32 FLAGS;
+};
+
+/*
+ * Segment registers here represent the 16 bit quantities
+ * CS, DS, ES, SS.
+ */
+
+#undef CS
+#undef DS
+#undef SS
+#undef ES
+#undef FS
+#undef GS
+
+struct i386_segment_regs {
+       u16 CS, DS, SS, ES, FS, GS;
+};
+
+/* 8 bit registers */
+#define R_AH  gen.A.I8_reg.h_reg
+#define R_AL  gen.A.I8_reg.l_reg
+#define R_BH  gen.B.I8_reg.h_reg
+#define R_BL  gen.B.I8_reg.l_reg
+#define R_CH  gen.C.I8_reg.h_reg
+#define R_CL  gen.C.I8_reg.l_reg
+#define R_DH  gen.D.I8_reg.h_reg
+#define R_DL  gen.D.I8_reg.l_reg
+
+/* 16 bit registers */
+#define R_AX  gen.A.I16_reg.x_reg
+#define R_BX  gen.B.I16_reg.x_reg
+#define R_CX  gen.C.I16_reg.x_reg
+#define R_DX  gen.D.I16_reg.x_reg
+
+/* 32 bit extended registers */
+#define R_EAX  gen.A.I32_reg.e_reg
+#define R_EBX  gen.B.I32_reg.e_reg
+#define R_ECX  gen.C.I32_reg.e_reg
+#define R_EDX  gen.D.I32_reg.e_reg
+
+/* special registers */
+#define R_SP  spc.SP.I16_reg.x_reg
+#define R_BP  spc.BP.I16_reg.x_reg
+#define R_SI  spc.SI.I16_reg.x_reg
+#define R_DI  spc.DI.I16_reg.x_reg
+#define R_IP  spc.IP.I16_reg.x_reg
+#define R_FLG spc.FLAGS
+
+/* special registers */
+#define R_SP  spc.SP.I16_reg.x_reg
+#define R_BP  spc.BP.I16_reg.x_reg
+#define R_SI  spc.SI.I16_reg.x_reg
+#define R_DI  spc.DI.I16_reg.x_reg
+#define R_IP  spc.IP.I16_reg.x_reg
+#define R_FLG spc.FLAGS
+
+/* special registers */
+#define R_ESP  spc.SP.I32_reg.e_reg
+#define R_EBP  spc.BP.I32_reg.e_reg
+#define R_ESI  spc.SI.I32_reg.e_reg
+#define R_EDI  spc.DI.I32_reg.e_reg
+#define R_EIP  spc.IP.I32_reg.e_reg
+#define R_EFLG spc.FLAGS
+
+/* segment registers */
+#define R_CS  seg.CS
+#define R_DS  seg.DS
+#define R_SS  seg.SS
+#define R_ES  seg.ES
+#define R_FS  seg.FS
+#define R_GS  seg.GS
+
+/* flag conditions   */
+#define FB_CF 0x0001           /* CARRY flag  */
+#define FB_PF 0x0004           /* PARITY flag */
+#define FB_AF 0x0010           /* AUX  flag   */
+#define FB_ZF 0x0040           /* ZERO flag   */
+#define FB_SF 0x0080           /* SIGN flag   */
+#define FB_TF 0x0100           /* TRAP flag   */
+#define FB_IF 0x0200           /* INTERRUPT ENABLE flag */
+#define FB_DF 0x0400           /* DIR flag    */
+#define FB_OF 0x0800           /* OVERFLOW flag */
+
+/* 80286 and above always have bit#1 set */
+#define F_ALWAYS_ON  (0x0002)  /* flag bits always on */
+
+/*
+ * Define a mask for only those flag bits we will ever pass back
+ * (via PUSHF)
+ */
+#define F_MSK (FB_CF|FB_PF|FB_AF|FB_ZF|FB_SF|FB_TF|FB_IF|FB_DF|FB_OF)
+
+/* following bits masked in to a 16bit quantity */
+
+#define F_CF 0x0001            /* CARRY flag  */
+#define F_PF 0x0004            /* PARITY flag */
+#define F_AF 0x0010            /* AUX  flag   */
+#define F_ZF 0x0040            /* ZERO flag   */
+#define F_SF 0x0080            /* SIGN flag   */
+#define F_TF 0x0100            /* TRAP flag   */
+#define F_IF 0x0200            /* INTERRUPT ENABLE flag */
+#define F_DF 0x0400            /* DIR flag    */
+#define F_OF 0x0800            /* OVERFLOW flag */
+
+#define TOGGLE_FLAG(flag)      (M.x86.R_FLG ^= (flag))
+#define SET_FLAG(flag)         (M.x86.R_FLG |= (flag))
+#define CLEAR_FLAG(flag)       (M.x86.R_FLG &= ~(flag))
+#define ACCESS_FLAG(flag)      (M.x86.R_FLG & (flag))
+#define CLEARALL_FLAG(m)       (M.x86.R_FLG = 0)
+
+#define CONDITIONAL_SET_FLAG(COND,FLAG) \
+  if (COND) SET_FLAG(FLAG); else CLEAR_FLAG(FLAG)
+
+#define F_PF_CALC 0x010000     /* PARITY flag has been calced    */
+#define F_ZF_CALC 0x020000     /* ZERO flag has been calced      */
+#define F_SF_CALC 0x040000     /* SIGN flag has been calced      */
+
+#define F_ALL_CALC     0xff0000        /* All have been calced   */
+
+/*
+ * Emulator machine state.
+ * Segment usage control.
+ */
+#define SYSMODE_SEG_DS_SS      0x00000001
+#define SYSMODE_SEGOVR_CS      0x00000002
+#define SYSMODE_SEGOVR_DS      0x00000004
+#define SYSMODE_SEGOVR_ES      0x00000008
+#define SYSMODE_SEGOVR_FS      0x00000010
+#define SYSMODE_SEGOVR_GS      0x00000020
+#define SYSMODE_SEGOVR_SS      0x00000040
+#define SYSMODE_PREFIX_REPE    0x00000080
+#define SYSMODE_PREFIX_REPNE   0x00000100
+#define SYSMODE_PREFIX_DATA    0x00000200
+#define SYSMODE_PREFIX_ADDR    0x00000400
+#define SYSMODE_INTR_PENDING   0x10000000
+#define SYSMODE_EXTRN_INTR     0x20000000
+#define SYSMODE_HALTED         0x40000000
+
+#define SYSMODE_SEGMASK (SYSMODE_SEG_DS_SS     | \
+                        SYSMODE_SEGOVR_CS      | \
+                        SYSMODE_SEGOVR_DS      | \
+                        SYSMODE_SEGOVR_ES      | \
+                        SYSMODE_SEGOVR_FS      | \
+                        SYSMODE_SEGOVR_GS      | \
+                        SYSMODE_SEGOVR_SS)
+#define SYSMODE_CLRMASK (SYSMODE_SEG_DS_SS     | \
+                        SYSMODE_SEGOVR_CS      | \
+                        SYSMODE_SEGOVR_DS      | \
+                        SYSMODE_SEGOVR_ES      | \
+                        SYSMODE_SEGOVR_FS      | \
+                        SYSMODE_SEGOVR_GS      | \
+                        SYSMODE_SEGOVR_SS      | \
+                        SYSMODE_PREFIX_DATA    | \
+                        SYSMODE_PREFIX_ADDR)
+
+#define         INTR_SYNCH           0x1
+#define         INTR_ASYNCH          0x2
+#define         INTR_HALTED          0x4
+
+typedef struct {
+       struct i386_general_regs gen;
+       struct i386_special_regs spc;
+       struct i386_segment_regs seg;
+       /*
+        * MODE contains information on:
+        *  REPE prefix             2 bits  repe,repne
+        *  SEGMENT overrides       5 bits  normal,DS,SS,CS,ES
+        *  Delayed flag set        3 bits  (zero, signed, parity)
+        *  reserved                6 bits
+        *  interrupt #             8 bits  instruction raised interrupt
+        *  BIOS video segregs      4 bits
+        *  Interrupt Pending       1 bits
+        *  Extern interrupt        1 bits
+        *  Halted                  1 bits
+        */
+       long mode;
+       u8 intno;
+       volatile int intr;      /* mask of pending interrupts */
+       int debug;
+#ifdef DEBUG
+       int check;
+       u16 saved_ip;
+       u16 saved_cs;
+       int enc_pos;
+       int enc_str_pos;
+       char decode_buf[32];    /* encoded byte stream  */
+       char decoded_buf[256];  /* disassembled strings */
+#endif
+} X86EMU_regs;
+
+/****************************************************************************
+REMARKS:
+Structure maintaining the emulator machine state.
+
+MEMBERS:
+x86            - X86 registers
+mem_base       - Base real mode memory for the emulator
+mem_size       - Size of the real mode memory block for the emulator
+****************************************************************************/
+#undef x86
+typedef struct {
+       X86EMU_regs x86;
+       u8 *mem_base;
+       u32 mem_size;
+       void *private;
+} X86EMU_sysEnv;
+
+#pragma pack()
+
+/*----------------------------- Global Variables --------------------------*/
+
+#ifdef __cplusplus
+extern "C" {                   /* Use "C" linkage when in C++ mode */
+#endif
+
+/* Global emulator machine state.
+ *
+ * We keep it global to avoid pointer dereferences in the code for speed.
+ */
+
+       extern X86EMU_sysEnv _X86EMU_env;
+#define          M             _X86EMU_env
+
+/*-------------------------- Function Prototypes --------------------------*/
+
+/* Function to log information at runtime */
+
+#ifndef __KERNEL__
+       void printk(const char *fmt, ...);
+#endif
+
+#ifdef __cplusplus
+}                              /* End of "C" linkage for C++       */
+#endif
+#endif                         /* __X86EMU_REGS_H */
diff --git a/drivers/bios_emulator/include/x86emu/x86emui.h b/drivers/bios_emulator/include/x86emu/x86emui.h
new file mode 100644 (file)
index 0000000..a74957d
--- /dev/null
@@ -0,0 +1,101 @@
+/****************************************************************************
+*
+*                       Realmode X86 Emulator Library
+*
+*               Copyright (C) 1991-2004 SciTech Software, Inc.
+*                    Copyright (C) David Mosberger-Tang
+*                      Copyright (C) 1999 Egbert Eich
+*
+*  ========================================================================
+*
+*  Permission to use, copy, modify, distribute, and sell this software and
+*  its documentation for any purpose is hereby granted without fee,
+*  provided that the above copyright notice appear in all copies and that
+*  both that copyright notice and this permission notice appear in
+*  supporting documentation, and that the name of the authors not be used
+*  in advertising or publicity pertaining to distribution of the software
+*  without specific, written prior permission.  The authors makes no
+*  representations about the suitability of this software for any purpose.
+*  It is provided "as is" without express or implied warranty.
+*
+*  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+*  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+*  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+*  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+*  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+*  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+*  PERFORMANCE OF THIS SOFTWARE.
+*
+*  ========================================================================
+*
+* Language:     ANSI C
+* Environment:  Any
+* Developer:    Kendall Bennett
+*
+* Description:  Header file for system specific functions. These functions
+*               are always compiled and linked in the OS depedent libraries,
+*               and never in a binary portable driver.
+*
+****************************************************************************/
+
+#ifndef __X86EMU_X86EMUI_H
+#define __X86EMU_X86EMUI_H
+
+/* If we are compiling in C++ mode, we can compile some functions as
+ * inline to increase performance (however the code size increases quite
+ * dramatically in this case).
+ */
+
+#if defined(__cplusplus) && !defined(_NO_INLINE)
+#define _INLINE inline
+#else
+#define _INLINE static
+#endif
+
+/* Get rid of unused parameters in C++ compilation mode */
+
+#ifdef __cplusplus
+#define X86EMU_UNUSED(v)
+#else
+#define X86EMU_UNUSED(v)    v
+#endif
+
+#include "x86emu.h"
+#include "x86emu/regs.h"
+#include "x86emu/debug.h"
+#include "x86emu/decode.h"
+#include "x86emu/ops.h"
+#include "x86emu/prim_ops.h"
+#ifndef __KERNEL__
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#endif
+
+#define printk printf
+
+
+/*--------------------------- Inline Functions ----------------------------*/
+
+#ifdef  __cplusplus
+extern "C" {                   /* Use "C" linkage when in C++ mode */
+#endif
+
+       extern u8(X86APIP sys_rdb) (u32 addr);
+       extern u16(X86APIP sys_rdw) (u32 addr);
+       extern u32(X86APIP sys_rdl) (u32 addr);
+       extern void (X86APIP sys_wrb) (u32 addr, u8 val);
+       extern void (X86APIP sys_wrw) (u32 addr, u16 val);
+       extern void (X86APIP sys_wrl) (u32 addr, u32 val);
+
+       extern u8(X86APIP sys_inb) (X86EMU_pioAddr addr);
+       extern u16(X86APIP sys_inw) (X86EMU_pioAddr addr);
+       extern u32(X86APIP sys_inl) (X86EMU_pioAddr addr);
+       extern void (X86APIP sys_outb) (X86EMU_pioAddr addr, u8 val);
+       extern void (X86APIP sys_outw) (X86EMU_pioAddr addr, u16 val);
+       extern void (X86APIP sys_outl) (X86EMU_pioAddr addr, u32 val);
+
+#ifdef  __cplusplus
+}                              /* End of "C" linkage for C++       */
+#endif
+#endif                         /* __X86EMU_X86EMUI_H */
diff --git a/drivers/bios_emulator/x86emu/debug.c b/drivers/bios_emulator/x86emu/debug.c
new file mode 100644 (file)
index 0000000..0f58a69
--- /dev/null
@@ -0,0 +1,461 @@
+/****************************************************************************
+*
+*                       Realmode X86 Emulator Library
+*
+*               Copyright (C) 1991-2004 SciTech Software, Inc.
+*                    Copyright (C) David Mosberger-Tang
+*                      Copyright (C) 1999 Egbert Eich
+*
+*  ========================================================================
+*
+*  Permission to use, copy, modify, distribute, and sell this software and
+*  its documentation for any purpose is hereby granted without fee,
+*  provided that the above copyright notice appear in all copies and that
+*  both that copyright notice and this permission notice appear in
+*  supporting documentation, and that the name of the authors not be used
+*  in advertising or publicity pertaining to distribution of the software
+*  without specific, written prior permission.  The authors makes no
+*  representations about the suitability of this software for any purpose.
+*  It is provided "as is" without express or implied warranty.
+*
+*  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+*  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+*  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+*  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+*  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+*  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+*  PERFORMANCE OF THIS SOFTWARE.
+*
+*  ========================================================================
+*
+* Language:     ANSI C
+* Environment:  Any
+* Developer:    Kendall Bennett
+*
+* Description:  This file contains the code to handle debugging of the
+*               emulator.
+*
+****************************************************************************/
+
+#include "x86emu/x86emui.h"
+#include <stdarg.h>
+
+/*----------------------------- Implementation ----------------------------*/
+
+#ifdef DEBUG
+
+static void print_encoded_bytes(u16 s, u16 o);
+static void print_decoded_instruction(void);
+static int parse_line(char *s, int *ps, int *n);
+
+/* should look something like debug's output. */
+void X86EMU_trace_regs(void)
+{
+       if (DEBUG_TRACE()) {
+               x86emu_dump_regs();
+       }
+       if (DEBUG_DECODE() && !DEBUG_DECODE_NOPRINT()) {
+               printk("%04x:%04x ", M.x86.saved_cs, M.x86.saved_ip);
+               print_encoded_bytes(M.x86.saved_cs, M.x86.saved_ip);
+               print_decoded_instruction();
+       }
+}
+
+void X86EMU_trace_xregs(void)
+{
+       if (DEBUG_TRACE()) {
+               x86emu_dump_xregs();
+       }
+}
+
+void x86emu_just_disassemble(void)
+{
+       /*
+        * This routine called if the flag DEBUG_DISASSEMBLE is set kind
+        * of a hack!
+        */
+       printk("%04x:%04x ", M.x86.saved_cs, M.x86.saved_ip);
+       print_encoded_bytes(M.x86.saved_cs, M.x86.saved_ip);
+       print_decoded_instruction();
+}
+
+static void disassemble_forward(u16 seg, u16 off, int n)
+{
+       X86EMU_sysEnv tregs;
+       int i;
+       u8 op1;
+       /*
+        * hack, hack, hack.  What we do is use the exact machinery set up
+        * for execution, except that now there is an additional state
+        * flag associated with the "execution", and we are using a copy
+        * of the register struct.  All the major opcodes, once fully
+        * decoded, have the following two steps: TRACE_REGS(r,m);
+        * SINGLE_STEP(r,m); which disappear if DEBUG is not defined to
+        * the preprocessor.  The TRACE_REGS macro expands to:
+        *
+        * if (debug&DEBUG_DISASSEMBLE)
+        *     {just_disassemble(); goto EndOfInstruction;}
+        *     if (debug&DEBUG_TRACE) trace_regs(r,m);
+        *
+        * ......  and at the last line of the routine.
+        *
+        * EndOfInstruction: end_instr();
+        *
+        * Up to the point where TRACE_REG is expanded, NO modifications
+        * are done to any register EXCEPT the IP register, for fetch and
+        * decoding purposes.
+        *
+        * This was done for an entirely different reason, but makes a
+        * nice way to get the system to help debug codes.
+        */
+       tregs = M;
+       tregs.x86.R_IP = off;
+       tregs.x86.R_CS = seg;
+
+       /* reset the decoding buffers */
+       tregs.x86.enc_str_pos = 0;
+       tregs.x86.enc_pos = 0;
+
+       /* turn on the "disassemble only, no execute" flag */
+       tregs.x86.debug |= DEBUG_DISASSEMBLE_F;
+
+       /* DUMP NEXT n instructions to screen in straight_line fashion */
+       /*
+        * This looks like the regular instruction fetch stream, except
+        * that when this occurs, each fetched opcode, upon seeing the
+        * DEBUG_DISASSEMBLE flag set, exits immediately after decoding
+        * the instruction.  XXX --- CHECK THAT MEM IS NOT AFFECTED!!!
+        * Note the use of a copy of the register structure...
+        */
+       for (i = 0; i < n; i++) {
+               op1 = (*sys_rdb) (((u32) M.x86.R_CS << 4) + (M.x86.R_IP++));
+               (x86emu_optab[op1]) (op1);
+       }
+       /* end major hack mode. */
+}
+
+void x86emu_check_ip_access(void)
+{
+       /* NULL as of now */
+}
+
+void x86emu_check_sp_access(void)
+{
+}
+
+void x86emu_check_mem_access(u32 dummy)
+{
+       /*  check bounds, etc */
+}
+
+void x86emu_check_data_access(uint dummy1, uint dummy2)
+{
+       /*  check bounds, etc */
+}
+
+void x86emu_inc_decoded_inst_len(int x)
+{
+       M.x86.enc_pos += x;
+}
+
+void x86emu_decode_printf(char *x)
+{
+       sprintf(M.x86.decoded_buf + M.x86.enc_str_pos, "%s", x);
+       M.x86.enc_str_pos += strlen(x);
+}
+
+void x86emu_decode_printf2(char *x, int y)
+{
+       char temp[100];
+       sprintf(temp, x, y);
+       sprintf(M.x86.decoded_buf + M.x86.enc_str_pos, "%s", temp);
+       M.x86.enc_str_pos += strlen(temp);
+}
+
+void x86emu_end_instr(void)
+{
+       M.x86.enc_str_pos = 0;
+       M.x86.enc_pos = 0;
+}
+
+static void print_encoded_bytes(u16 s, u16 o)
+{
+       int i;
+       char buf1[64];
+       for (i = 0; i < M.x86.enc_pos; i++) {
+               sprintf(buf1 + 2 * i, "%02x", fetch_data_byte_abs(s, o + i));
+       }
+       printk("%-20s", buf1);
+}
+
+static void print_decoded_instruction(void)
+{
+       printk("%s", M.x86.decoded_buf);
+}
+
+void x86emu_print_int_vect(u16 iv)
+{
+       u16 seg, off;
+
+       if (iv > 256)
+               return;
+       seg = fetch_data_word_abs(0, iv * 4);
+       off = fetch_data_word_abs(0, iv * 4 + 2);
+       printk("%04x:%04x ", seg, off);
+}
+
+void X86EMU_dump_memory(u16 seg, u16 off, u32 amt)
+{
+       u32 start = off & 0xfffffff0;
+       u32 end = (off + 16) & 0xfffffff0;
+       u32 i;
+       u32 current;
+
+       current = start;
+       while (end <= off + amt) {
+               printk("%04x:%04x ", seg, start);
+               for (i = start; i < off; i++)
+                       printk("   ");
+               for (; i < end; i++)
+                       printk("%02x ", fetch_data_byte_abs(seg, i));
+               printk("\n");
+               start = end;
+               end = start + 16;
+       }
+}
+
+void x86emu_single_step(void)
+{
+       char s[1024];
+       int ps[10];
+       int ntok;
+       int cmd;
+       int done;
+       int segment;
+       int offset;
+       static int breakpoint;
+       static int noDecode = 1;
+
+       char *p;
+
+       if (DEBUG_BREAK()) {
+               if (M.x86.saved_ip != breakpoint) {
+                       return;
+               } else {
+                       M.x86.debug &= ~DEBUG_DECODE_NOPRINT_F;
+                       M.x86.debug |= DEBUG_TRACE_F;
+                       M.x86.debug &= ~DEBUG_BREAK_F;
+                       print_decoded_instruction();
+                       X86EMU_trace_regs();
+               }
+       }
+       done = 0;
+       offset = M.x86.saved_ip;
+       while (!done) {
+               printk("-");
+               cmd = parse_line(s, ps, &ntok);
+               switch (cmd) {
+               case 'u':
+                       disassemble_forward(M.x86.saved_cs, (u16) offset, 10);
+                       break;
+               case 'd':
+                       if (ntok == 2) {
+                               segment = M.x86.saved_cs;
+                               offset = ps[1];
+                               X86EMU_dump_memory(segment, (u16) offset, 16);
+                               offset += 16;
+                       } else if (ntok == 3) {
+                               segment = ps[1];
+                               offset = ps[2];
+                               X86EMU_dump_memory(segment, (u16) offset, 16);
+                               offset += 16;
+                       } else {
+                               segment = M.x86.saved_cs;
+                               X86EMU_dump_memory(segment, (u16) offset, 16);
+                               offset += 16;
+                       }
+                       break;
+               case 'c':
+                       M.x86.debug ^= DEBUG_TRACECALL_F;
+                       break;
+               case 's':
+                       M.x86.debug ^=
+                           DEBUG_SVC_F | DEBUG_SYS_F | DEBUG_SYSINT_F;
+                       break;
+               case 'r':
+                       X86EMU_trace_regs();
+                       break;
+               case 'x':
+                       X86EMU_trace_xregs();
+                       break;
+               case 'g':
+                       if (ntok == 2) {
+                               breakpoint = ps[1];
+                               if (noDecode) {
+                                       M.x86.debug |= DEBUG_DECODE_NOPRINT_F;
+                               } else {
+                                       M.x86.debug &= ~DEBUG_DECODE_NOPRINT_F;
+                               }
+                               M.x86.debug &= ~DEBUG_TRACE_F;
+                               M.x86.debug |= DEBUG_BREAK_F;
+                               done = 1;
+                       }
+                       break;
+               case 'q':
+                       M.x86.debug |= DEBUG_EXIT;
+                       return;
+               case 'P':
+                       noDecode = (noDecode) ? 0 : 1;
+                       printk("Toggled decoding to %s\n",
+                              (noDecode) ? "FALSE" : "TRUE");
+                       break;
+               case 't':
+               case 0:
+                       done = 1;
+                       break;
+               }
+       }
+}
+
+int X86EMU_trace_on(void)
+{
+       return M.x86.debug |= DEBUG_STEP_F | DEBUG_DECODE_F | DEBUG_TRACE_F;
+}
+
+int X86EMU_trace_off(void)
+{
+       return M.x86.debug &= ~(DEBUG_STEP_F | DEBUG_DECODE_F | DEBUG_TRACE_F);
+}
+
+static int parse_line(char *s, int *ps, int *n)
+{
+       int cmd;
+
+       *n = 0;
+       while (*s == ' ' || *s == '\t')
+               s++;
+       ps[*n] = *s;
+       switch (*s) {
+       case '\n':
+               *n += 1;
+               return 0;
+       default:
+               cmd = *s;
+               *n += 1;
+       }
+
+       while (1) {
+               while (*s != ' ' && *s != '\t' && *s != '\n')
+                       s++;
+
+               if (*s == '\n')
+                       return cmd;
+
+               while (*s == ' ' || *s == '\t')
+                       s++;
+
+               *n += 1;
+       }
+}
+
+#endif                         /* DEBUG */
+
+void x86emu_dump_regs(void)
+{
+       printk("\tAX=%04x  ", M.x86.R_AX);
+       printk("BX=%04x  ", M.x86.R_BX);
+       printk("CX=%04x  ", M.x86.R_CX);
+       printk("DX=%04x  ", M.x86.R_DX);
+       printk("SP=%04x  ", M.x86.R_SP);
+       printk("BP=%04x  ", M.x86.R_BP);
+       printk("SI=%04x  ", M.x86.R_SI);
+       printk("DI=%04x\n", M.x86.R_DI);
+       printk("\tDS=%04x  ", M.x86.R_DS);
+       printk("ES=%04x  ", M.x86.R_ES);
+       printk("SS=%04x  ", M.x86.R_SS);
+       printk("CS=%04x  ", M.x86.R_CS);
+       printk("IP=%04x   ", M.x86.R_IP);
+       if (ACCESS_FLAG(F_OF))
+               printk("OV ");  /* CHECKED... */
+       else
+               printk("NV ");
+       if (ACCESS_FLAG(F_DF))
+               printk("DN ");
+       else
+               printk("UP ");
+       if (ACCESS_FLAG(F_IF))
+               printk("EI ");
+       else
+               printk("DI ");
+       if (ACCESS_FLAG(F_SF))
+               printk("NG ");
+       else
+               printk("PL ");
+       if (ACCESS_FLAG(F_ZF))
+               printk("ZR ");
+       else
+               printk("NZ ");
+       if (ACCESS_FLAG(F_AF))
+               printk("AC ");
+       else
+               printk("NA ");
+       if (ACCESS_FLAG(F_PF))
+               printk("PE ");
+       else
+               printk("PO ");
+       if (ACCESS_FLAG(F_CF))
+               printk("CY ");
+       else
+               printk("NC ");
+       printk("\n");
+}
+
+void x86emu_dump_xregs(void)
+{
+       printk("\tEAX=%08x  ", M.x86.R_EAX);
+       printk("EBX=%08x  ", M.x86.R_EBX);
+       printk("ECX=%08x  ", M.x86.R_ECX);
+       printk("EDX=%08x  \n", M.x86.R_EDX);
+       printk("\tESP=%08x  ", M.x86.R_ESP);
+       printk("EBP=%08x  ", M.x86.R_EBP);
+       printk("ESI=%08x  ", M.x86.R_ESI);
+       printk("EDI=%08x\n", M.x86.R_EDI);
+       printk("\tDS=%04x  ", M.x86.R_DS);
+       printk("ES=%04x  ", M.x86.R_ES);
+       printk("SS=%04x  ", M.x86.R_SS);
+       printk("CS=%04x  ", M.x86.R_CS);
+       printk("EIP=%08x\n\t", M.x86.R_EIP);
+       if (ACCESS_FLAG(F_OF))
+               printk("OV ");  /* CHECKED... */
+       else
+               printk("NV ");
+       if (ACCESS_FLAG(F_DF))
+               printk("DN ");
+       else
+               printk("UP ");
+       if (ACCESS_FLAG(F_IF))
+               printk("EI ");
+       else
+               printk("DI ");
+       if (ACCESS_FLAG(F_SF))
+               printk("NG ");
+       else
+               printk("PL ");
+       if (ACCESS_FLAG(F_ZF))
+               printk("ZR ");
+       else
+               printk("NZ ");
+       if (ACCESS_FLAG(F_AF))
+               printk("AC ");
+       else
+               printk("NA ");
+       if (ACCESS_FLAG(F_PF))
+               printk("PE ");
+       else
+               printk("PO ");
+       if (ACCESS_FLAG(F_CF))
+               printk("CY ");
+       else
+               printk("NC ");
+       printk("\n");
+}
diff --git a/drivers/bios_emulator/x86emu/decode.c b/drivers/bios_emulator/x86emu/decode.c
new file mode 100644 (file)
index 0000000..1e2dcfe
--- /dev/null
@@ -0,0 +1,1144 @@
+/****************************************************************************
+*
+*                      Realmode X86 Emulator Library
+*
+*              Copyright (C) 1991-2004 SciTech Software, Inc.
+*                   Copyright (C) David Mosberger-Tang
+*                     Copyright (C) 1999 Egbert Eich
+*
+*  ========================================================================
+*
+*  Permission to use, copy, modify, distribute, and sell this software and
+*  its documentation for any purpose is hereby granted without fee,
+*  provided that the above copyright notice appear in all copies and that
+*  both that copyright notice and this permission notice appear in
+*  supporting documentation, and that the name of the authors not be used
+*  in advertising or publicity pertaining to distribution of the software
+*  without specific, written prior permission. The authors makes no
+*  representations about the suitability of this software for any purpose.
+*  It is provided "as is" without express or implied warranty.
+*
+*  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+*  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+*  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+*  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+*  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+*  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+*  PERFORMANCE OF THIS SOFTWARE.
+*
+*  ========================================================================
+*
+* Language:    ANSI C
+* Environment: Any
+* Developer:   Kendall Bennett
+*
+* Description: This file includes subroutines which are related to
+*              instruction decoding and accessess of immediate data via IP.  etc.
+*
+****************************************************************************/
+
+#include "x86emu/x86emui.h"
+
+/*----------------------------- Implementation ----------------------------*/
+
+/****************************************************************************
+REMARKS:
+Handles any pending asychronous interrupts.
+****************************************************************************/
+static void x86emu_intr_handle(void)
+{
+    u8 intno;
+
+    if (M.x86.intr & INTR_SYNCH) {
+       intno = M.x86.intno;
+       if (_X86EMU_intrTab[intno]) {
+           (*_X86EMU_intrTab[intno])(intno);
+       } else {
+           push_word((u16)M.x86.R_FLG);
+           CLEAR_FLAG(F_IF);
+           CLEAR_FLAG(F_TF);
+           push_word(M.x86.R_CS);
+           M.x86.R_CS = mem_access_word(intno * 4 + 2);
+           push_word(M.x86.R_IP);
+           M.x86.R_IP = mem_access_word(intno * 4);
+           M.x86.intr = 0;
+       }
+    }
+}
+
+/****************************************************************************
+PARAMETERS:
+intrnum - Interrupt number to raise
+
+REMARKS:
+Raise the specified interrupt to be handled before the execution of the
+next instruction.
+****************************************************************************/
+void x86emu_intr_raise(
+    u8 intrnum)
+{
+    M.x86.intno = intrnum;
+    M.x86.intr |= INTR_SYNCH;
+}
+
+/****************************************************************************
+REMARKS:
+Main execution loop for the emulator. We return from here when the system
+halts, which is normally caused by a stack fault when we return from the
+original real mode call.
+****************************************************************************/
+void X86EMU_exec(void)
+{
+    u8 op1;
+
+    M.x86.intr = 0;
+    DB(x86emu_end_instr();)
+
+    for (;;) {
+DB(    if (CHECK_IP_FETCH())
+           x86emu_check_ip_access();)
+       /* If debugging, save the IP and CS values. */
+       SAVE_IP_CS(M.x86.R_CS, M.x86.R_IP);
+       INC_DECODED_INST_LEN(1);
+       if (M.x86.intr) {
+           if (M.x86.intr & INTR_HALTED) {
+DB(            if (M.x86.R_SP != 0) {
+                   printk("halted\n");
+                   X86EMU_trace_regs();
+                   }
+               else {
+                   if (M.x86.debug)
+                       printk("Service completed successfully\n");
+                   })
+               return;
+           }
+           if (((M.x86.intr & INTR_SYNCH) && (M.x86.intno == 0 || M.x86.intno == 2)) ||
+               !ACCESS_FLAG(F_IF)) {
+               x86emu_intr_handle();
+           }
+       }
+       op1 = (*sys_rdb)(((u32)M.x86.R_CS << 4) + (M.x86.R_IP++));
+       (*x86emu_optab[op1])(op1);
+       if (M.x86.debug & DEBUG_EXIT) {
+           M.x86.debug &= ~DEBUG_EXIT;
+           return;
+       }
+    }
+}
+
+/****************************************************************************
+REMARKS:
+Halts the system by setting the halted system flag.
+****************************************************************************/
+void X86EMU_halt_sys(void)
+{
+    M.x86.intr |= INTR_HALTED;
+}
+
+/****************************************************************************
+PARAMETERS:
+mod    - Mod value from decoded byte
+regh   - Reg h value from decoded byte
+regl   - Reg l value from decoded byte
+
+REMARKS:
+Raise the specified interrupt to be handled before the execution of the
+next instruction.
+
+NOTE: Do not inline this function, as (*sys_rdb) is already inline!
+****************************************************************************/
+void fetch_decode_modrm(
+    int *mod,
+    int *regh,
+    int *regl)
+{
+    int fetched;
+
+DB( if (CHECK_IP_FETCH())
+       x86emu_check_ip_access();)
+    fetched = (*sys_rdb)(((u32)M.x86.R_CS << 4) + (M.x86.R_IP++));
+    INC_DECODED_INST_LEN(1);
+    *mod  = (fetched >> 6) & 0x03;
+    *regh = (fetched >> 3) & 0x07;
+    *regl = (fetched >> 0) & 0x07;
+}
+
+/****************************************************************************
+RETURNS:
+Immediate byte value read from instruction queue
+
+REMARKS:
+This function returns the immediate byte from the instruction queue, and
+moves the instruction pointer to the next value.
+
+NOTE: Do not inline this function, as (*sys_rdb) is already inline!
+****************************************************************************/
+u8 fetch_byte_imm(void)
+{
+    u8 fetched;
+
+DB( if (CHECK_IP_FETCH())
+       x86emu_check_ip_access();)
+    fetched = (*sys_rdb)(((u32)M.x86.R_CS << 4) + (M.x86.R_IP++));
+    INC_DECODED_INST_LEN(1);
+    return fetched;
+}
+
+/****************************************************************************
+RETURNS:
+Immediate word value read from instruction queue
+
+REMARKS:
+This function returns the immediate byte from the instruction queue, and
+moves the instruction pointer to the next value.
+
+NOTE: Do not inline this function, as (*sys_rdw) is already inline!
+****************************************************************************/
+u16 fetch_word_imm(void)
+{
+    u16 fetched;
+
+DB( if (CHECK_IP_FETCH())
+       x86emu_check_ip_access();)
+    fetched = (*sys_rdw)(((u32)M.x86.R_CS << 4) + (M.x86.R_IP));
+    M.x86.R_IP += 2;
+    INC_DECODED_INST_LEN(2);
+    return fetched;
+}
+
+/****************************************************************************
+RETURNS:
+Immediate lone value read from instruction queue
+
+REMARKS:
+This function returns the immediate byte from the instruction queue, and
+moves the instruction pointer to the next value.
+
+NOTE: Do not inline this function, as (*sys_rdw) is already inline!
+****************************************************************************/
+u32 fetch_long_imm(void)
+{
+    u32 fetched;
+
+DB( if (CHECK_IP_FETCH())
+       x86emu_check_ip_access();)
+    fetched = (*sys_rdl)(((u32)M.x86.R_CS << 4) + (M.x86.R_IP));
+    M.x86.R_IP += 4;
+    INC_DECODED_INST_LEN(4);
+    return fetched;
+}
+
+/****************************************************************************
+RETURNS:
+Value of the default data segment
+
+REMARKS:
+Inline function that returns the default data segment for the current
+instruction.
+
+On the x86 processor, the default segment is not always DS if there is
+no segment override. Address modes such as -3[BP] or 10[BP+SI] all refer to
+addresses relative to SS (ie: on the stack). So, at the minimum, all
+decodings of addressing modes would have to set/clear a bit describing
+whether the access is relative to DS or SS.  That is the function of the
+cpu-state-varible M.x86.mode. There are several potential states:
+
+    repe prefix seen  (handled elsewhere)
+    repne prefix seen  (ditto)
+
+    cs segment override
+    ds segment override
+    es segment override
+    fs segment override
+    gs segment override
+    ss segment override
+
+    ds/ss select (in absense of override)
+
+Each of the above 7 items are handled with a bit in the mode field.
+****************************************************************************/
+_INLINE u32 get_data_segment(void)
+{
+#define GET_SEGMENT(segment)
+    switch (M.x86.mode & SYSMODE_SEGMASK) {
+      case 0:                  /* default case: use ds register */
+      case SYSMODE_SEGOVR_DS:
+      case SYSMODE_SEGOVR_DS | SYSMODE_SEG_DS_SS:
+       return  M.x86.R_DS;
+      case SYSMODE_SEG_DS_SS:  /* non-overridden, use ss register */
+       return  M.x86.R_SS;
+      case SYSMODE_SEGOVR_CS:
+      case SYSMODE_SEGOVR_CS | SYSMODE_SEG_DS_SS:
+       return  M.x86.R_CS;
+      case SYSMODE_SEGOVR_ES:
+      case SYSMODE_SEGOVR_ES | SYSMODE_SEG_DS_SS:
+       return  M.x86.R_ES;
+      case SYSMODE_SEGOVR_FS:
+      case SYSMODE_SEGOVR_FS | SYSMODE_SEG_DS_SS:
+       return  M.x86.R_FS;
+      case SYSMODE_SEGOVR_GS:
+      case SYSMODE_SEGOVR_GS | SYSMODE_SEG_DS_SS:
+       return  M.x86.R_GS;
+      case SYSMODE_SEGOVR_SS:
+      case SYSMODE_SEGOVR_SS | SYSMODE_SEG_DS_SS:
+       return  M.x86.R_SS;
+      default:
+#ifdef DEBUG
+       printk("error: should not happen:  multiple overrides.\n");
+#endif
+       HALT_SYS();
+       return 0;
+    }
+}
+
+/****************************************************************************
+PARAMETERS:
+offset - Offset to load data from
+
+RETURNS:
+Byte value read from the absolute memory location.
+
+NOTE: Do not inline this function as (*sys_rdX) is already inline!
+****************************************************************************/
+u8 fetch_data_byte(
+    uint offset)
+{
+#ifdef DEBUG
+    if (CHECK_DATA_ACCESS())
+       x86emu_check_data_access((u16)get_data_segment(), offset);
+#endif
+    return (*sys_rdb)((get_data_segment() << 4) + offset);
+}
+
+/****************************************************************************
+PARAMETERS:
+offset - Offset to load data from
+
+RETURNS:
+Word value read from the absolute memory location.
+
+NOTE: Do not inline this function as (*sys_rdX) is already inline!
+****************************************************************************/
+u16 fetch_data_word(
+    uint offset)
+{
+#ifdef DEBUG
+    if (CHECK_DATA_ACCESS())
+       x86emu_check_data_access((u16)get_data_segment(), offset);
+#endif
+    return (*sys_rdw)((get_data_segment() << 4) + offset);
+}
+
+/****************************************************************************
+PARAMETERS:
+offset - Offset to load data from
+
+RETURNS:
+Long value read from the absolute memory location.
+
+NOTE: Do not inline this function as (*sys_rdX) is already inline!
+****************************************************************************/
+u32 fetch_data_long(
+    uint offset)
+{
+#ifdef DEBUG
+    if (CHECK_DATA_ACCESS())
+       x86emu_check_data_access((u16)get_data_segment(), offset);
+#endif
+    return (*sys_rdl)((get_data_segment() << 4) + offset);
+}
+
+/****************************************************************************
+PARAMETERS:
+segment - Segment to load data from
+offset - Offset to load data from
+
+RETURNS:
+Byte value read from the absolute memory location.
+
+NOTE: Do not inline this function as (*sys_rdX) is already inline!
+****************************************************************************/
+u8 fetch_data_byte_abs(
+    uint segment,
+    uint offset)
+{
+#ifdef DEBUG
+    if (CHECK_DATA_ACCESS())
+       x86emu_check_data_access(segment, offset);
+#endif
+    return (*sys_rdb)(((u32)segment << 4) + offset);
+}
+
+/****************************************************************************
+PARAMETERS:
+segment - Segment to load data from
+offset - Offset to load data from
+
+RETURNS:
+Word value read from the absolute memory location.
+
+NOTE: Do not inline this function as (*sys_rdX) is already inline!
+****************************************************************************/
+u16 fetch_data_word_abs(
+    uint segment,
+    uint offset)
+{
+#ifdef DEBUG
+    if (CHECK_DATA_ACCESS())
+       x86emu_check_data_access(segment, offset);
+#endif
+    return (*sys_rdw)(((u32)segment << 4) + offset);
+}
+
+/****************************************************************************
+PARAMETERS:
+segment - Segment to load data from
+offset - Offset to load data from
+
+RETURNS:
+Long value read from the absolute memory location.
+
+NOTE: Do not inline this function as (*sys_rdX) is already inline!
+****************************************************************************/
+u32 fetch_data_long_abs(
+    uint segment,
+    uint offset)
+{
+#ifdef DEBUG
+    if (CHECK_DATA_ACCESS())
+       x86emu_check_data_access(segment, offset);
+#endif
+    return (*sys_rdl)(((u32)segment << 4) + offset);
+}
+
+/****************************************************************************
+PARAMETERS:
+offset - Offset to store data at
+val    - Value to store
+
+REMARKS:
+Writes a word value to an segmented memory location. The segment used is
+the current 'default' segment, which may have been overridden.
+
+NOTE: Do not inline this function as (*sys_wrX) is already inline!
+****************************************************************************/
+void store_data_byte(
+    uint offset,
+    u8 val)
+{
+#ifdef DEBUG
+    if (CHECK_DATA_ACCESS())
+       x86emu_check_data_access((u16)get_data_segment(), offset);
+#endif
+    (*sys_wrb)((get_data_segment() << 4) + offset, val);
+}
+
+/****************************************************************************
+PARAMETERS:
+offset - Offset to store data at
+val    - Value to store
+
+REMARKS:
+Writes a word value to an segmented memory location. The segment used is
+the current 'default' segment, which may have been overridden.
+
+NOTE: Do not inline this function as (*sys_wrX) is already inline!
+****************************************************************************/
+void store_data_word(
+    uint offset,
+    u16 val)
+{
+#ifdef DEBUG
+    if (CHECK_DATA_ACCESS())
+       x86emu_check_data_access((u16)get_data_segment(), offset);
+#endif
+    (*sys_wrw)((get_data_segment() << 4) + offset, val);
+}
+
+/****************************************************************************
+PARAMETERS:
+offset - Offset to store data at
+val    - Value to store
+
+REMARKS:
+Writes a long value to an segmented memory location. The segment used is
+the current 'default' segment, which may have been overridden.
+
+NOTE: Do not inline this function as (*sys_wrX) is already inline!
+****************************************************************************/
+void store_data_long(
+    uint offset,
+    u32 val)
+{
+#ifdef DEBUG
+    if (CHECK_DATA_ACCESS())
+       x86emu_check_data_access((u16)get_data_segment(), offset);
+#endif
+    (*sys_wrl)((get_data_segment() << 4) + offset, val);
+}
+
+/****************************************************************************
+PARAMETERS:
+segment - Segment to store data at
+offset - Offset to store data at
+val    - Value to store
+
+REMARKS:
+Writes a byte value to an absolute memory location.
+
+NOTE: Do not inline this function as (*sys_wrX) is already inline!
+****************************************************************************/
+void store_data_byte_abs(
+    uint segment,
+    uint offset,
+    u8 val)
+{
+#ifdef DEBUG
+    if (CHECK_DATA_ACCESS())
+       x86emu_check_data_access(segment, offset);
+#endif
+    (*sys_wrb)(((u32)segment << 4) + offset, val);
+}
+
+/****************************************************************************
+PARAMETERS:
+segment - Segment to store data at
+offset - Offset to store data at
+val    - Value to store
+
+REMARKS:
+Writes a word value to an absolute memory location.
+
+NOTE: Do not inline this function as (*sys_wrX) is already inline!
+****************************************************************************/
+void store_data_word_abs(
+    uint segment,
+    uint offset,
+    u16 val)
+{
+#ifdef DEBUG
+    if (CHECK_DATA_ACCESS())
+       x86emu_check_data_access(segment, offset);
+#endif
+    (*sys_wrw)(((u32)segment << 4) + offset, val);
+}
+
+/****************************************************************************
+PARAMETERS:
+segment - Segment to store data at
+offset - Offset to store data at
+val    - Value to store
+
+REMARKS:
+Writes a long value to an absolute memory location.
+
+NOTE: Do not inline this function as (*sys_wrX) is already inline!
+****************************************************************************/
+void store_data_long_abs(
+    uint segment,
+    uint offset,
+    u32 val)
+{
+#ifdef DEBUG
+    if (CHECK_DATA_ACCESS())
+       x86emu_check_data_access(segment, offset);
+#endif
+    (*sys_wrl)(((u32)segment << 4) + offset, val);
+}
+
+/****************************************************************************
+PARAMETERS:
+reg - Register to decode
+
+RETURNS:
+Pointer to the appropriate register
+
+REMARKS:
+Return a pointer to the register given by the R/RM field of the
+modrm byte, for byte operands. Also enables the decoding of instructions.
+****************************************************************************/
+u8* decode_rm_byte_register(
+    int reg)
+{
+    switch (reg) {
+      case 0:
+       DECODE_PRINTF("AL");
+       return &M.x86.R_AL;
+      case 1:
+       DECODE_PRINTF("CL");
+       return &M.x86.R_CL;
+      case 2:
+       DECODE_PRINTF("DL");
+       return &M.x86.R_DL;
+      case 3:
+       DECODE_PRINTF("BL");
+       return &M.x86.R_BL;
+      case 4:
+       DECODE_PRINTF("AH");
+       return &M.x86.R_AH;
+      case 5:
+       DECODE_PRINTF("CH");
+       return &M.x86.R_CH;
+      case 6:
+       DECODE_PRINTF("DH");
+       return &M.x86.R_DH;
+      case 7:
+       DECODE_PRINTF("BH");
+       return &M.x86.R_BH;
+    }
+    HALT_SYS();
+    return NULL;               /* NOT REACHED OR REACHED ON ERROR */
+}
+
+/****************************************************************************
+PARAMETERS:
+reg - Register to decode
+
+RETURNS:
+Pointer to the appropriate register
+
+REMARKS:
+Return a pointer to the register given by the R/RM field of the
+modrm byte, for word operands. Also enables the decoding of instructions.
+****************************************************************************/
+u16* decode_rm_word_register(
+    int reg)
+{
+    switch (reg) {
+      case 0:
+       DECODE_PRINTF("AX");
+       return &M.x86.R_AX;
+      case 1:
+       DECODE_PRINTF("CX");
+       return &M.x86.R_CX;
+      case 2:
+       DECODE_PRINTF("DX");
+       return &M.x86.R_DX;
+      case 3:
+       DECODE_PRINTF("BX");
+       return &M.x86.R_BX;
+      case 4:
+       DECODE_PRINTF("SP");
+       return &M.x86.R_SP;
+      case 5:
+       DECODE_PRINTF("BP");
+       return &M.x86.R_BP;
+      case 6:
+       DECODE_PRINTF("SI");
+       return &M.x86.R_SI;
+      case 7:
+       DECODE_PRINTF("DI");
+       return &M.x86.R_DI;
+    }
+    HALT_SYS();
+    return NULL;               /* NOTREACHED OR REACHED ON ERROR */
+}
+
+/****************************************************************************
+PARAMETERS:
+reg - Register to decode
+
+RETURNS:
+Pointer to the appropriate register
+
+REMARKS:
+Return a pointer to the register given by the R/RM field of the
+modrm byte, for dword operands.         Also enables the decoding of instructions.
+****************************************************************************/
+u32* decode_rm_long_register(
+    int reg)
+{
+    switch (reg) {
+      case 0:
+       DECODE_PRINTF("EAX");
+       return &M.x86.R_EAX;
+      case 1:
+       DECODE_PRINTF("ECX");
+       return &M.x86.R_ECX;
+      case 2:
+       DECODE_PRINTF("EDX");
+       return &M.x86.R_EDX;
+      case 3:
+       DECODE_PRINTF("EBX");
+       return &M.x86.R_EBX;
+      case 4:
+       DECODE_PRINTF("ESP");
+       return &M.x86.R_ESP;
+      case 5:
+       DECODE_PRINTF("EBP");
+       return &M.x86.R_EBP;
+      case 6:
+       DECODE_PRINTF("ESI");
+       return &M.x86.R_ESI;
+      case 7:
+       DECODE_PRINTF("EDI");
+       return &M.x86.R_EDI;
+    }
+    HALT_SYS();
+    return NULL;               /* NOTREACHED OR REACHED ON ERROR */
+}
+
+/****************************************************************************
+PARAMETERS:
+reg - Register to decode
+
+RETURNS:
+Pointer to the appropriate register
+
+REMARKS:
+Return a pointer to the register given by the R/RM field of the
+modrm byte, for word operands, modified from above for the weirdo
+special case of segreg operands.  Also enables the decoding of instructions.
+****************************************************************************/
+u16* decode_rm_seg_register(
+    int reg)
+{
+    switch (reg) {
+      case 0:
+       DECODE_PRINTF("ES");
+       return &M.x86.R_ES;
+      case 1:
+       DECODE_PRINTF("CS");
+       return &M.x86.R_CS;
+      case 2:
+       DECODE_PRINTF("SS");
+       return &M.x86.R_SS;
+      case 3:
+       DECODE_PRINTF("DS");
+       return &M.x86.R_DS;
+      case 4:
+       DECODE_PRINTF("FS");
+       return &M.x86.R_FS;
+      case 5:
+       DECODE_PRINTF("GS");
+       return &M.x86.R_GS;
+      case 6:
+      case 7:
+       DECODE_PRINTF("ILLEGAL SEGREG");
+       break;
+    }
+    HALT_SYS();
+    return NULL;               /* NOT REACHED OR REACHED ON ERROR */
+}
+
+/****************************************************************************
+PARAMETERS:
+scale - scale value of SIB byte
+index - index value of SIB byte
+
+RETURNS:
+Value of scale * index
+
+REMARKS:
+Decodes scale/index of SIB byte and returns relevant offset part of
+effective address.
+****************************************************************************/
+unsigned decode_sib_si(
+    int scale,
+    int index)
+{
+    scale = 1 << scale;
+    if (scale > 1) {
+       DECODE_PRINTF2("[%d*", scale);
+    } else {
+       DECODE_PRINTF("[");
+    }
+    switch (index) {
+      case 0:
+       DECODE_PRINTF("EAX]");
+       return M.x86.R_EAX * index;
+      case 1:
+       DECODE_PRINTF("ECX]");
+       return M.x86.R_ECX * index;
+      case 2:
+       DECODE_PRINTF("EDX]");
+       return M.x86.R_EDX * index;
+      case 3:
+       DECODE_PRINTF("EBX]");
+       return M.x86.R_EBX * index;
+      case 4:
+       DECODE_PRINTF("0]");
+       return 0;
+      case 5:
+       DECODE_PRINTF("EBP]");
+       return M.x86.R_EBP * index;
+      case 6:
+       DECODE_PRINTF("ESI]");
+       return M.x86.R_ESI * index;
+      case 7:
+       DECODE_PRINTF("EDI]");
+       return M.x86.R_EDI * index;
+    }
+    HALT_SYS();
+    return 0;                  /* NOT REACHED OR REACHED ON ERROR */
+}
+
+/****************************************************************************
+PARAMETERS:
+mod - MOD value of preceding ModR/M byte
+
+RETURNS:
+Offset in memory for the address decoding
+
+REMARKS:
+Decodes SIB addressing byte and returns calculated effective address.
+****************************************************************************/
+unsigned decode_sib_address(
+    int mod)
+{
+    int sib   = fetch_byte_imm();
+    int ss    = (sib >> 6) & 0x03;
+    int index = (sib >> 3) & 0x07;
+    int base  = sib & 0x07;
+    int offset = 0;
+    int displacement;
+
+    switch (base) {
+      case 0:
+       DECODE_PRINTF("[EAX]");
+       offset = M.x86.R_EAX;
+       break;
+      case 1:
+       DECODE_PRINTF("[ECX]");
+       offset = M.x86.R_ECX;
+       break;
+      case 2:
+       DECODE_PRINTF("[EDX]");
+       offset = M.x86.R_EDX;
+       break;
+      case 3:
+       DECODE_PRINTF("[EBX]");
+       offset = M.x86.R_EBX;
+       break;
+      case 4:
+       DECODE_PRINTF("[ESP]");
+       offset = M.x86.R_ESP;
+       break;
+      case 5:
+       switch (mod) {
+         case 0:
+           displacement = (s32)fetch_long_imm();
+           DECODE_PRINTF2("[%d]", displacement);
+           offset = displacement;
+           break;
+         case 1:
+           displacement = (s8)fetch_byte_imm();
+           DECODE_PRINTF2("[%d][EBP]", displacement);
+           offset = M.x86.R_EBP + displacement;
+           break;
+         case 2:
+           displacement = (s32)fetch_long_imm();
+           DECODE_PRINTF2("[%d][EBP]", displacement);
+           offset = M.x86.R_EBP + displacement;
+           break;
+         default:
+           HALT_SYS();
+       }
+       DECODE_PRINTF("[EAX]");
+       offset = M.x86.R_EAX;
+       break;
+      case 6:
+       DECODE_PRINTF("[ESI]");
+       offset = M.x86.R_ESI;
+       break;
+      case 7:
+       DECODE_PRINTF("[EDI]");
+       offset = M.x86.R_EDI;
+       break;
+      default:
+       HALT_SYS();
+    }
+    offset += decode_sib_si(ss, index);
+    return offset;
+
+}
+
+/****************************************************************************
+PARAMETERS:
+rm  - RM value to decode
+
+RETURNS:
+Offset in memory for the address decoding
+
+REMARKS:
+Return the offset given by mod=00 addressing.  Also enables the
+decoding of instructions.
+
+NOTE:  The code which specifies the corresponding segment (ds vs ss)
+       below in the case of [BP+..].  The assumption here is that at the
+       point that this subroutine is called, the bit corresponding to
+       SYSMODE_SEG_DS_SS will be zero.  After every instruction
+       except the segment override instructions, this bit (as well
+       as any bits indicating segment overrides) will be clear.  So
+       if a SS access is needed, set this bit.  Otherwise, DS access
+       occurs (unless any of the segment override bits are set).
+****************************************************************************/
+unsigned decode_rm00_address(
+    int rm)
+{
+    unsigned offset;
+
+    if (M.x86.mode & SYSMODE_PREFIX_ADDR) {
+       /* 32-bit addressing */
+       switch (rm) {
+         case 0:
+           DECODE_PRINTF("[EAX]");
+           return M.x86.R_EAX;
+         case 1:
+           DECODE_PRINTF("[ECX]");
+           return M.x86.R_ECX;
+         case 2:
+           DECODE_PRINTF("[EDX]");
+           return M.x86.R_EDX;
+         case 3:
+           DECODE_PRINTF("[EBX]");
+           return M.x86.R_EBX;
+         case 4:
+           return decode_sib_address(0);
+         case 5:
+           offset = fetch_long_imm();
+           DECODE_PRINTF2("[%08x]", offset);
+           return offset;
+         case 6:
+           DECODE_PRINTF("[ESI]");
+           return M.x86.R_ESI;
+         case 7:
+           DECODE_PRINTF("[EDI]");
+           return M.x86.R_EDI;
+       }
+    } else {
+       /* 16-bit addressing */
+       switch (rm) {
+         case 0:
+           DECODE_PRINTF("[BX+SI]");
+           return (M.x86.R_BX + M.x86.R_SI) & 0xffff;
+         case 1:
+           DECODE_PRINTF("[BX+DI]");
+           return (M.x86.R_BX + M.x86.R_DI) & 0xffff;
+         case 2:
+           DECODE_PRINTF("[BP+SI]");
+           M.x86.mode |= SYSMODE_SEG_DS_SS;
+           return (M.x86.R_BP + M.x86.R_SI) & 0xffff;
+         case 3:
+           DECODE_PRINTF("[BP+DI]");
+           M.x86.mode |= SYSMODE_SEG_DS_SS;
+           return (M.x86.R_BP + M.x86.R_DI) & 0xffff;
+         case 4:
+           DECODE_PRINTF("[SI]");
+           return M.x86.R_SI;
+         case 5:
+           DECODE_PRINTF("[DI]");
+           return M.x86.R_DI;
+         case 6:
+           offset = fetch_word_imm();
+           DECODE_PRINTF2("[%04x]", offset);
+           return offset;
+         case 7:
+           DECODE_PRINTF("[BX]");
+           return M.x86.R_BX;
+       }
+    }
+    HALT_SYS();
+    return 0;
+}
+
+/****************************************************************************
+PARAMETERS:
+rm  - RM value to decode
+
+RETURNS:
+Offset in memory for the address decoding
+
+REMARKS:
+Return the offset given by mod=01 addressing.  Also enables the
+decoding of instructions.
+****************************************************************************/
+unsigned decode_rm01_address(
+    int rm)
+{
+    int displacement;
+
+    if (M.x86.mode & SYSMODE_PREFIX_ADDR) {
+       /* 32-bit addressing */
+       if (rm != 4)
+           displacement = (s8)fetch_byte_imm();
+       else
+           displacement = 0;
+
+       switch (rm) {
+         case 0:
+           DECODE_PRINTF2("%d[EAX]", displacement);
+           return M.x86.R_EAX + displacement;
+         case 1:
+           DECODE_PRINTF2("%d[ECX]", displacement);
+           return M.x86.R_ECX + displacement;
+         case 2:
+           DECODE_PRINTF2("%d[EDX]", displacement);
+           return M.x86.R_EDX + displacement;
+         case 3:
+           DECODE_PRINTF2("%d[EBX]", displacement);
+           return M.x86.R_EBX + displacement;
+         case 4: {
+           int offset = decode_sib_address(1);
+           displacement = (s8)fetch_byte_imm();
+           DECODE_PRINTF2("[%d]", displacement);
+           return offset + displacement;
+         }
+         case 5:
+           DECODE_PRINTF2("%d[EBP]", displacement);
+           return M.x86.R_EBP + displacement;
+         case 6:
+           DECODE_PRINTF2("%d[ESI]", displacement);
+           return M.x86.R_ESI + displacement;
+         case 7:
+           DECODE_PRINTF2("%d[EDI]", displacement);
+           return M.x86.R_EDI + displacement;
+       }
+    } else {
+       /* 16-bit addressing */
+       displacement = (s8)fetch_byte_imm();
+       switch (rm) {
+         case 0:
+           DECODE_PRINTF2("%d[BX+SI]", displacement);
+           return (M.x86.R_BX + M.x86.R_SI + displacement) & 0xffff;
+         case 1:
+           DECODE_PRINTF2("%d[BX+DI]", displacement);
+           return (M.x86.R_BX + M.x86.R_DI + displacement) & 0xffff;
+         case 2:
+           DECODE_PRINTF2("%d[BP+SI]", displacement);
+           M.x86.mode |= SYSMODE_SEG_DS_SS;
+           return (M.x86.R_BP + M.x86.R_SI + displacement) & 0xffff;
+         case 3:
+           DECODE_PRINTF2("%d[BP+DI]", displacement);
+           M.x86.mode |= SYSMODE_SEG_DS_SS;
+           return (M.x86.R_BP + M.x86.R_DI + displacement) & 0xffff;
+         case 4:
+           DECODE_PRINTF2("%d[SI]", displacement);
+           return (M.x86.R_SI + displacement) & 0xffff;
+         case 5:
+           DECODE_PRINTF2("%d[DI]", displacement);
+           return (M.x86.R_DI + displacement) & 0xffff;
+         case 6:
+           DECODE_PRINTF2("%d[BP]", displacement);
+           M.x86.mode |= SYSMODE_SEG_DS_SS;
+           return (M.x86.R_BP + displacement) & 0xffff;
+         case 7:
+           DECODE_PRINTF2("%d[BX]", displacement);
+           return (M.x86.R_BX + displacement) & 0xffff;
+       }
+    }
+    HALT_SYS();
+    return 0;                  /* SHOULD NOT HAPPEN */
+}
+
+/****************************************************************************
+PARAMETERS:
+rm  - RM value to decode
+
+RETURNS:
+Offset in memory for the address decoding
+
+REMARKS:
+Return the offset given by mod=10 addressing.  Also enables the
+decoding of instructions.
+****************************************************************************/
+unsigned decode_rm10_address(
+    int rm)
+{
+    if (M.x86.mode & SYSMODE_PREFIX_ADDR) {
+       int displacement;
+
+       /* 32-bit addressing */
+       if (rm != 4)
+           displacement = (s32)fetch_long_imm();
+       else
+           displacement = 0;
+
+       switch (rm) {
+         case 0:
+           DECODE_PRINTF2("%d[EAX]", displacement);
+           return M.x86.R_EAX + displacement;
+         case 1:
+           DECODE_PRINTF2("%d[ECX]", displacement);
+           return M.x86.R_ECX + displacement;
+         case 2:
+           DECODE_PRINTF2("%d[EDX]", displacement);
+           return M.x86.R_EDX + displacement;
+         case 3:
+           DECODE_PRINTF2("%d[EBX]", displacement);
+           return M.x86.R_EBX + displacement;
+         case 4: {
+           int offset = decode_sib_address(2);
+           displacement = (s32)fetch_long_imm();
+           DECODE_PRINTF2("[%d]", displacement);
+           return offset + displacement;
+         }
+         case 5:
+           DECODE_PRINTF2("%d[EBP]", displacement);
+           return M.x86.R_EBP + displacement;
+         case 6:
+           DECODE_PRINTF2("%d[ESI]", displacement);
+           return M.x86.R_ESI + displacement;
+         case 7:
+           DECODE_PRINTF2("%d[EDI]", displacement);
+           return M.x86.R_EDI + displacement;
+       }
+    } else {
+       int displacement = (s16)fetch_word_imm();
+
+       /* 16-bit addressing */
+       switch (rm) {
+         case 0:
+           DECODE_PRINTF2("%d[BX+SI]", displacement);
+           return (M.x86.R_BX + M.x86.R_SI + displacement) & 0xffff;
+         case 1:
+           DECODE_PRINTF2("%d[BX+DI]", displacement);
+           return (M.x86.R_BX + M.x86.R_DI + displacement) & 0xffff;
+         case 2:
+           DECODE_PRINTF2("%d[BP+SI]", displacement);
+           M.x86.mode |= SYSMODE_SEG_DS_SS;
+           return (M.x86.R_BP + M.x86.R_SI + displacement) & 0xffff;
+         case 3:
+           DECODE_PRINTF2("%d[BP+DI]", displacement);
+           M.x86.mode |= SYSMODE_SEG_DS_SS;
+           return (M.x86.R_BP + M.x86.R_DI + displacement) & 0xffff;
+         case 4:
+           DECODE_PRINTF2("%d[SI]", displacement);
+           return (M.x86.R_SI + displacement) & 0xffff;
+         case 5:
+           DECODE_PRINTF2("%d[DI]", displacement);
+           return (M.x86.R_DI + displacement) & 0xffff;
+         case 6:
+           DECODE_PRINTF2("%d[BP]", displacement);
+           M.x86.mode |= SYSMODE_SEG_DS_SS;
+           return (M.x86.R_BP + displacement) & 0xffff;
+         case 7:
+           DECODE_PRINTF2("%d[BX]", displacement);
+           return (M.x86.R_BX + displacement) & 0xffff;
+       }
+    }
+    HALT_SYS();
+    return 0;                  /* SHOULD NOT HAPPEN */
+}
+
+/****************************************************************************
+PARAMETERS:
+mod - modifier
+rm  - RM value to decode
+
+RETURNS:
+Offset in memory for the address decoding, multiplexing calls to
+the decode_rmXX_address functions
+
+REMARKS:
+Return the offset given by "mod" addressing.
+****************************************************************************/
+
+unsigned decode_rmXX_address(int mod, int rm)
+{
+  if(mod == 0)
+    return decode_rm00_address(rm);
+  if(mod == 1)
+    return decode_rm01_address(rm);
+  return decode_rm10_address(rm);
+}
diff --git a/drivers/bios_emulator/x86emu/ops.c b/drivers/bios_emulator/x86emu/ops.c
new file mode 100644 (file)
index 0000000..d1380ce
--- /dev/null
@@ -0,0 +1,5431 @@
+/****************************************************************************
+*                      Realmode X86 Emulator Library
+*
+*  Copyright (C) 2007 Freescale Semiconductor, Inc. All rights reserved.
+*  Jason Jin <Jason.jin@freescale.com>
+*
+*              Copyright (C) 1991-2004 SciTech Software, Inc.
+*                                   Copyright (C) David Mosberger-Tang
+*                                         Copyright (C) 1999 Egbert Eich
+*
+*  ========================================================================
+*
+*  Permission to use, copy, modify, distribute, and sell this software and
+*  its documentation for any purpose is hereby granted without fee,
+*  provided that the above copyright notice appear in all copies and that
+*  both that copyright notice and this permission notice appear in
+*  supporting documentation, and that the name of the authors not be used
+*  in advertising or publicity pertaining to distribution of the software
+*  without specific, written prior permission. The authors makes no
+*  representations about the suitability of this software for any purpose.
+*  It is provided "as is" without express or implied warranty.
+*
+*  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+*  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+*  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+*  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+*  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+*  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+*  PERFORMANCE OF THIS SOFTWARE.
+*
+*  ========================================================================
+*
+* Language:            ANSI C
+* Environment: Any
+* Developer:   Kendall Bennett
+*
+* Description: This file includes subroutines to implement the decoding
+*              and emulation of all the x86 processor instructions.
+*
+* There are approximately 250 subroutines in here, which correspond
+* to the 256 byte-"opcodes" found on the 8086. The table which
+* dispatches this is found in the files optab.[ch].
+*
+* Each opcode proc has a comment preceeding it which gives it's table
+* address.  Several opcodes are missing (undefined) in the table.
+*
+* Each proc includes information for decoding (DECODE_PRINTF and
+* DECODE_PRINTF2), debugging (TRACE_REGS, SINGLE_STEP), and misc
+* functions (START_OF_INSTR, END_OF_INSTR).
+*
+* Many of the procedures are *VERY* similar in coding. This has
+* allowed for a very large amount of code to be generated in a fairly
+* short amount of time (i.e. cut, paste, and modify).  The result is
+* that much of the code below could have been folded into subroutines
+* for a large reduction in size of this file.  The downside would be
+* that there would be a penalty in execution speed.  The file could
+* also have been *MUCH* larger by inlining certain functions which
+* were called. This could have resulted even faster execution.  The
+* prime directive I used to decide whether to inline the code or to
+* modularize it, was basically: 1) no unnecessary subroutine calls,
+* 2) no routines more than about 200 lines in size, and 3) modularize
+* any code that I might not get right the first time.  The fetch_*
+* subroutines fall into the latter category.  The The decode_* fall
+* into the second category.  The coding of the "switch(mod){ .... }"
+* in many of the subroutines below falls into the first category.
+* Especially, the coding of {add,and,or,sub,...}_{byte,word}
+* subroutines are an especially glaring case of the third guideline.
+* Since so much of the code is cloned from other modules (compare
+* opcode #00 to opcode #01), making the basic operations subroutine
+* calls is especially important; otherwise mistakes in coding an
+* "add" would represent a nightmare in maintenance.
+*
+* Jason ported this file to u-boot. place all the function pointer in
+* the got2 sector. Removed some opcode.
+*
+****************************************************************************/
+
+#include "x86emu/x86emui.h"
+/*----------------------------- Implementation ----------------------------*/
+
+/* constant arrays to do several instructions in just one function */
+
+#ifdef DEBUG
+static char *x86emu_GenOpName[8] = {
+    "ADD", "OR", "ADC", "SBB", "AND", "SUB", "XOR", "CMP"};
+#endif
+
+/* used by several opcodes  */
+static u8 (*genop_byte_operation[])(u8 d, u8 s) __attribute__ ((section(".got2"))) =
+{
+    add_byte,          /* 00 */
+    or_byte,           /* 01 */
+    adc_byte,          /* 02 */
+    sbb_byte,          /* 03 */
+    and_byte,          /* 04 */
+    sub_byte,          /* 05 */
+    xor_byte,          /* 06 */
+    cmp_byte,          /* 07 */
+};
+
+static u16 (*genop_word_operation[])(u16 d, u16 s) __attribute__ ((section(".got2"))) =
+{
+    add_word,          /*00 */
+    or_word,           /*01 */
+    adc_word,          /*02 */
+    sbb_word,          /*03 */
+    and_word,          /*04 */
+    sub_word,          /*05 */
+    xor_word,          /*06 */
+    cmp_word,          /*07 */
+};
+
+static u32 (*genop_long_operation[])(u32 d, u32 s) __attribute__ ((section(".got2"))) =
+{
+    add_long,          /*00 */
+    or_long,           /*01 */
+    adc_long,          /*02 */
+    sbb_long,          /*03 */
+    and_long,          /*04 */
+    sub_long,          /*05 */
+    xor_long,          /*06 */
+    cmp_long,          /*07 */
+};
+
+/* used by opcodes 80, c0, d0, and d2. */
+static u8(*opcD0_byte_operation[])(u8 d, u8 s) __attribute__ ((section(".got2"))) =
+{
+    rol_byte,
+    ror_byte,
+    rcl_byte,
+    rcr_byte,
+    shl_byte,
+    shr_byte,
+    shl_byte,          /* sal_byte === shl_byte  by definition */
+    sar_byte,
+};
+
+/* used by opcodes c1, d1, and d3. */
+static u16(*opcD1_word_operation[])(u16 s, u8 d) __attribute__ ((section(".got2"))) =
+{
+    rol_word,
+    ror_word,
+    rcl_word,
+    rcr_word,
+    shl_word,
+    shr_word,
+    shl_word,          /* sal_byte === shl_byte  by definition */
+    sar_word,
+};
+
+/* used by opcodes c1, d1, and d3. */
+static u32 (*opcD1_long_operation[])(u32 s, u8 d) __attribute__ ((section(".got2"))) =
+{
+    rol_long,
+    ror_long,
+    rcl_long,
+    rcr_long,
+    shl_long,
+    shr_long,
+    shl_long,          /* sal_byte === shl_byte  by definition */
+    sar_long,
+};
+
+#ifdef DEBUG
+
+static char *opF6_names[8] =
+  { "TEST\t", "", "NOT\t", "NEG\t", "MUL\t", "IMUL\t", "DIV\t", "IDIV\t" };
+
+#endif
+
+/****************************************************************************
+PARAMETERS:
+op1 - Instruction op code
+
+REMARKS:
+Handles illegal opcodes.
+****************************************************************************/
+void x86emuOp_illegal_op(
+    u8 op1)
+{
+    START_OF_INSTR();
+    if (M.x86.R_SP != 0) {
+       DECODE_PRINTF("ILLEGAL X86 OPCODE\n");
+       TRACE_REGS();
+       DB( printk("%04x:%04x: %02X ILLEGAL X86 OPCODE!\n",
+           M.x86.R_CS, M.x86.R_IP-1,op1));
+       HALT_SYS();
+       }
+    else {
+       /* If we get here, it means the stack pointer is back to zero
+        * so we are just returning from an emulator service call
+        * so therte is no need to display an error message. We trap
+        * the emulator with an 0xF1 opcode to finish the service
+        * call.
+        */
+       X86EMU_halt_sys();
+       }
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcodes 0x00, 0x08, 0x10, 0x18, 0x20, 0x28, 0x30, 0x38
+****************************************************************************/
+void x86emuOp_genop_byte_RM_R(u8 op1)
+{
+    int mod, rl, rh;
+    uint destoffset;
+    u8 *destreg, *srcreg;
+    u8 destval;
+
+    op1 = (op1 >> 3) & 0x7;
+
+    START_OF_INSTR();
+    DECODE_PRINTF(x86emu_GenOpName[op1]);
+    DECODE_PRINTF("\t");
+    FETCH_DECODE_MODRM(mod, rh, rl);
+    if(mod<3)
+       { destoffset = decode_rmXX_address(mod,rl);
+       DECODE_PRINTF(",");
+       destval = fetch_data_byte(destoffset);
+       srcreg = DECODE_RM_BYTE_REGISTER(rh);
+       DECODE_PRINTF("\n");
+       TRACE_AND_STEP();
+       destval = genop_byte_operation[op1](destval, *srcreg);
+       store_data_byte(destoffset, destval);
+       }
+    else
+       {                       /* register to register */
+       destreg = DECODE_RM_BYTE_REGISTER(rl);
+       DECODE_PRINTF(",");
+       srcreg = DECODE_RM_BYTE_REGISTER(rh);
+       DECODE_PRINTF("\n");
+       TRACE_AND_STEP();
+       *destreg = genop_byte_operation[op1](*destreg, *srcreg);
+       }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcodes 0x01, 0x09, 0x11, 0x19, 0x21, 0x29, 0x31, 0x39
+****************************************************************************/
+void x86emuOp_genop_word_RM_R(u8 op1)
+{
+    int mod, rl, rh;
+    uint destoffset;
+
+    op1 = (op1 >> 3) & 0x7;
+
+    START_OF_INSTR();
+    DECODE_PRINTF(x86emu_GenOpName[op1]);
+    DECODE_PRINTF("\t");
+    FETCH_DECODE_MODRM(mod, rh, rl);
+
+    if(mod<3) {
+       destoffset = decode_rmXX_address(mod,rl);
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 destval;
+           u32 *srcreg;
+
+           DECODE_PRINTF(",");
+           destval = fetch_data_long(destoffset);
+           srcreg = DECODE_RM_LONG_REGISTER(rh);
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           destval = genop_long_operation[op1](destval, *srcreg);
+           store_data_long(destoffset, destval);
+       } else {
+           u16 destval;
+           u16 *srcreg;
+
+           DECODE_PRINTF(",");
+           destval = fetch_data_word(destoffset);
+           srcreg = DECODE_RM_WORD_REGISTER(rh);
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           destval = genop_word_operation[op1](destval, *srcreg);
+           store_data_word(destoffset, destval);
+       }
+    } else {                   /* register to register */
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 *destreg,*srcreg;
+
+           destreg = DECODE_RM_LONG_REGISTER(rl);
+           DECODE_PRINTF(",");
+           srcreg = DECODE_RM_LONG_REGISTER(rh);
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           *destreg = genop_long_operation[op1](*destreg, *srcreg);
+       } else {
+           u16 *destreg,*srcreg;
+
+           destreg = DECODE_RM_WORD_REGISTER(rl);
+           DECODE_PRINTF(",");
+           srcreg = DECODE_RM_WORD_REGISTER(rh);
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           *destreg = genop_word_operation[op1](*destreg, *srcreg);
+       }
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcodes 0x02, 0x0a, 0x12, 0x1a, 0x22, 0x2a, 0x32, 0x3a
+****************************************************************************/
+void x86emuOp_genop_byte_R_RM(u8 op1)
+{
+    int mod, rl, rh;
+    u8 *destreg, *srcreg;
+    uint srcoffset;
+    u8 srcval;
+
+    op1 = (op1 >> 3) & 0x7;
+
+    START_OF_INSTR();
+    DECODE_PRINTF(x86emu_GenOpName[op1]);
+    DECODE_PRINTF("\t");
+    FETCH_DECODE_MODRM(mod, rh, rl);
+    if (mod < 3) {
+       destreg = DECODE_RM_BYTE_REGISTER(rh);
+       DECODE_PRINTF(",");
+       srcoffset = decode_rmXX_address(mod,rl);
+       srcval = fetch_data_byte(srcoffset);
+    } else {    /* register to register */
+       destreg = DECODE_RM_BYTE_REGISTER(rh);
+       DECODE_PRINTF(",");
+       srcreg = DECODE_RM_BYTE_REGISTER(rl);
+       srcval = *srcreg;
+    }
+    DECODE_PRINTF("\n");
+    TRACE_AND_STEP();
+    *destreg = genop_byte_operation[op1](*destreg, srcval);
+
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcodes 0x03, 0x0b, 0x13, 0x1b, 0x23, 0x2b, 0x33, 0x3b
+****************************************************************************/
+void x86emuOp_genop_word_R_RM(u8 op1)
+{
+    int mod, rl, rh;
+    uint srcoffset;
+    u32 *destreg32, srcval;
+    u16 *destreg;
+
+    op1 = (op1 >> 3) & 0x7;
+
+    START_OF_INSTR();
+    DECODE_PRINTF(x86emu_GenOpName[op1]);
+    DECODE_PRINTF("\t");
+    FETCH_DECODE_MODRM(mod, rh, rl);
+    if (mod < 3) {
+       srcoffset = decode_rmXX_address(mod,rl);
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           destreg32 = DECODE_RM_LONG_REGISTER(rh);
+           DECODE_PRINTF(",");
+           srcval = fetch_data_long(srcoffset);
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           *destreg32 = genop_long_operation[op1](*destreg32, srcval);
+       } else {
+           destreg = DECODE_RM_WORD_REGISTER(rh);
+           DECODE_PRINTF(",");
+           srcval = fetch_data_word(srcoffset);
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           *destreg = genop_word_operation[op1](*destreg, srcval);
+       }
+    } else {                    /* register to register */
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 *srcreg;
+           destreg32 = DECODE_RM_LONG_REGISTER(rh);
+           DECODE_PRINTF(",");
+           srcreg = DECODE_RM_LONG_REGISTER(rl);
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           *destreg32 = genop_long_operation[op1](*destreg32, *srcreg);
+       } else {
+           u16 *srcreg;
+           destreg = DECODE_RM_WORD_REGISTER(rh);
+           DECODE_PRINTF(",");
+           srcreg = DECODE_RM_WORD_REGISTER(rl);
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           *destreg = genop_word_operation[op1](*destreg, *srcreg);
+       }
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcodes 0x04, 0x0c, 0x14, 0x1c, 0x24, 0x2c, 0x34, 0x3c
+****************************************************************************/
+void x86emuOp_genop_byte_AL_IMM(u8 op1)
+{
+    u8 srcval;
+
+    op1 = (op1 >> 3) & 0x7;
+
+    START_OF_INSTR();
+    DECODE_PRINTF(x86emu_GenOpName[op1]);
+    DECODE_PRINTF("\tAL,");
+    srcval = fetch_byte_imm();
+    DECODE_PRINTF2("%x\n", srcval);
+    TRACE_AND_STEP();
+    M.x86.R_AL = genop_byte_operation[op1](M.x86.R_AL, srcval);
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcodes 0x05, 0x0d, 0x15, 0x1d, 0x25, 0x2d, 0x35, 0x3d
+****************************************************************************/
+void x86emuOp_genop_word_AX_IMM(u8 op1)
+{
+    u32 srcval;
+
+    op1 = (op1 >> 3) & 0x7;
+
+    START_OF_INSTR();
+    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+       DECODE_PRINTF(x86emu_GenOpName[op1]);
+       DECODE_PRINTF("\tEAX,");
+       srcval = fetch_long_imm();
+    } else {
+       DECODE_PRINTF(x86emu_GenOpName[op1]);
+       DECODE_PRINTF("\tAX,");
+       srcval = fetch_word_imm();
+    }
+    DECODE_PRINTF2("%x\n", srcval);
+    TRACE_AND_STEP();
+    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+       M.x86.R_EAX = genop_long_operation[op1](M.x86.R_EAX, srcval);
+    } else {
+       M.x86.R_AX = genop_word_operation[op1](M.x86.R_AX, (u16)srcval);
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x06
+****************************************************************************/
+void x86emuOp_push_ES(u8 X86EMU_UNUSED(op1))
+{
+    START_OF_INSTR();
+    DECODE_PRINTF("PUSH\tES\n");
+    TRACE_AND_STEP();
+    push_word(M.x86.R_ES);
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x07
+****************************************************************************/
+void x86emuOp_pop_ES(u8 X86EMU_UNUSED(op1))
+{
+    START_OF_INSTR();
+    DECODE_PRINTF("POP\tES\n");
+    TRACE_AND_STEP();
+    M.x86.R_ES = pop_word();
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0e
+****************************************************************************/
+void x86emuOp_push_CS(u8 X86EMU_UNUSED(op1))
+{
+    START_OF_INSTR();
+    DECODE_PRINTF("PUSH\tCS\n");
+    TRACE_AND_STEP();
+    push_word(M.x86.R_CS);
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f. Escape for two-byte opcode (286 or better)
+****************************************************************************/
+void x86emuOp_two_byte(u8 X86EMU_UNUSED(op1))
+{
+    u8 op2 = (*sys_rdb)(((u32)M.x86.R_CS << 4) + (M.x86.R_IP++));
+    INC_DECODED_INST_LEN(1);
+    (*x86emu_optab2[op2])(op2);
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x16
+****************************************************************************/
+void x86emuOp_push_SS(u8 X86EMU_UNUSED(op1))
+{
+    START_OF_INSTR();
+    DECODE_PRINTF("PUSH\tSS\n");
+    TRACE_AND_STEP();
+    push_word(M.x86.R_SS);
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x17
+****************************************************************************/
+void x86emuOp_pop_SS(u8 X86EMU_UNUSED(op1))
+{
+    START_OF_INSTR();
+    DECODE_PRINTF("POP\tSS\n");
+    TRACE_AND_STEP();
+    M.x86.R_SS = pop_word();
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x1e
+****************************************************************************/
+void x86emuOp_push_DS(u8 X86EMU_UNUSED(op1))
+{
+    START_OF_INSTR();
+    DECODE_PRINTF("PUSH\tDS\n");
+    TRACE_AND_STEP();
+    push_word(M.x86.R_DS);
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x1f
+****************************************************************************/
+void x86emuOp_pop_DS(u8 X86EMU_UNUSED(op1))
+{
+    START_OF_INSTR();
+    DECODE_PRINTF("POP\tDS\n");
+    TRACE_AND_STEP();
+    M.x86.R_DS = pop_word();
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x26
+****************************************************************************/
+void x86emuOp_segovr_ES(u8 X86EMU_UNUSED(op1))
+{
+    START_OF_INSTR();
+    DECODE_PRINTF("ES:\n");
+    TRACE_AND_STEP();
+    M.x86.mode |= SYSMODE_SEGOVR_ES;
+    /*
+     * note the lack of DECODE_CLEAR_SEGOVR(r) since, here is one of 4
+     * opcode subroutines we do not want to do this.
+     */
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x27
+****************************************************************************/
+void x86emuOp_daa(u8 X86EMU_UNUSED(op1))
+{
+    START_OF_INSTR();
+    DECODE_PRINTF("DAA\n");
+    TRACE_AND_STEP();
+    M.x86.R_AL = daa_byte(M.x86.R_AL);
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x2e
+****************************************************************************/
+void x86emuOp_segovr_CS(u8 X86EMU_UNUSED(op1))
+{
+    START_OF_INSTR();
+    DECODE_PRINTF("CS:\n");
+    TRACE_AND_STEP();
+    M.x86.mode |= SYSMODE_SEGOVR_CS;
+    /* note no DECODE_CLEAR_SEGOVR here. */
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x2f
+****************************************************************************/
+void x86emuOp_das(u8 X86EMU_UNUSED(op1))
+{
+    START_OF_INSTR();
+    DECODE_PRINTF("DAS\n");
+    TRACE_AND_STEP();
+    M.x86.R_AL = das_byte(M.x86.R_AL);
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x36
+****************************************************************************/
+void x86emuOp_segovr_SS(u8 X86EMU_UNUSED(op1))
+{
+    START_OF_INSTR();
+    DECODE_PRINTF("SS:\n");
+    TRACE_AND_STEP();
+    M.x86.mode |= SYSMODE_SEGOVR_SS;
+    /* no DECODE_CLEAR_SEGOVR ! */
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x37
+****************************************************************************/
+void x86emuOp_aaa(u8 X86EMU_UNUSED(op1))
+{
+    START_OF_INSTR();
+    DECODE_PRINTF("AAA\n");
+    TRACE_AND_STEP();
+    M.x86.R_AX = aaa_word(M.x86.R_AX);
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x3e
+****************************************************************************/
+void x86emuOp_segovr_DS(u8 X86EMU_UNUSED(op1))
+{
+    START_OF_INSTR();
+    DECODE_PRINTF("DS:\n");
+    TRACE_AND_STEP();
+    M.x86.mode |= SYSMODE_SEGOVR_DS;
+    /* NO DECODE_CLEAR_SEGOVR! */
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x3f
+****************************************************************************/
+void x86emuOp_aas(u8 X86EMU_UNUSED(op1))
+{
+    START_OF_INSTR();
+    DECODE_PRINTF("AAS\n");
+    TRACE_AND_STEP();
+    M.x86.R_AX = aas_word(M.x86.R_AX);
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x40 - 0x47
+****************************************************************************/
+void x86emuOp_inc_register(u8 op1)
+{
+    START_OF_INSTR();
+    op1 &= 0x7;
+    DECODE_PRINTF("INC\t");
+    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+       u32 *reg;
+       reg = DECODE_RM_LONG_REGISTER(op1);
+       DECODE_PRINTF("\n");
+       TRACE_AND_STEP();
+       *reg = inc_long(*reg);
+    } else {
+       u16 *reg;
+       reg = DECODE_RM_WORD_REGISTER(op1);
+       DECODE_PRINTF("\n");
+       TRACE_AND_STEP();
+       *reg = inc_word(*reg);
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x48 - 0x4F
+****************************************************************************/
+void x86emuOp_dec_register(u8 op1)
+{
+    START_OF_INSTR();
+    op1 &= 0x7;
+    DECODE_PRINTF("DEC\t");
+    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+       u32 *reg;
+       reg = DECODE_RM_LONG_REGISTER(op1);
+       DECODE_PRINTF("\n");
+       TRACE_AND_STEP();
+       *reg = dec_long(*reg);
+    } else {
+       u16 *reg;
+       reg = DECODE_RM_WORD_REGISTER(op1);
+       DECODE_PRINTF("\n");
+       TRACE_AND_STEP();
+       *reg = dec_word(*reg);
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x50 - 0x57
+****************************************************************************/
+void x86emuOp_push_register(u8 op1)
+{
+    START_OF_INSTR();
+    op1 &= 0x7;
+    DECODE_PRINTF("PUSH\t");
+    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+       u32 *reg;
+       reg = DECODE_RM_LONG_REGISTER(op1);
+       DECODE_PRINTF("\n");
+       TRACE_AND_STEP();
+       push_long(*reg);
+    } else {
+       u16 *reg;
+       reg = DECODE_RM_WORD_REGISTER(op1);
+       DECODE_PRINTF("\n");
+       TRACE_AND_STEP();
+       push_word(*reg);
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x58 - 0x5F
+****************************************************************************/
+void x86emuOp_pop_register(u8 op1)
+{
+    START_OF_INSTR();
+    op1 &= 0x7;
+    DECODE_PRINTF("POP\t");
+    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+       u32 *reg;
+       reg = DECODE_RM_LONG_REGISTER(op1);
+       DECODE_PRINTF("\n");
+       TRACE_AND_STEP();
+       *reg = pop_long();
+    } else {
+       u16 *reg;
+       reg = DECODE_RM_WORD_REGISTER(op1);
+       DECODE_PRINTF("\n");
+       TRACE_AND_STEP();
+       *reg = pop_word();
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x60
+****************************************************************************/
+void x86emuOp_push_all(u8 X86EMU_UNUSED(op1))
+{
+    START_OF_INSTR();
+    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+       DECODE_PRINTF("PUSHAD\n");
+    } else {
+       DECODE_PRINTF("PUSHA\n");
+    }
+    TRACE_AND_STEP();
+    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+       u32 old_sp = M.x86.R_ESP;
+
+       push_long(M.x86.R_EAX);
+       push_long(M.x86.R_ECX);
+       push_long(M.x86.R_EDX);
+       push_long(M.x86.R_EBX);
+       push_long(old_sp);
+       push_long(M.x86.R_EBP);
+       push_long(M.x86.R_ESI);
+       push_long(M.x86.R_EDI);
+    } else {
+       u16 old_sp = M.x86.R_SP;
+
+       push_word(M.x86.R_AX);
+       push_word(M.x86.R_CX);
+       push_word(M.x86.R_DX);
+       push_word(M.x86.R_BX);
+       push_word(old_sp);
+       push_word(M.x86.R_BP);
+       push_word(M.x86.R_SI);
+       push_word(M.x86.R_DI);
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x61
+****************************************************************************/
+void x86emuOp_pop_all(u8 X86EMU_UNUSED(op1))
+{
+    START_OF_INSTR();
+    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+       DECODE_PRINTF("POPAD\n");
+    } else {
+       DECODE_PRINTF("POPA\n");
+    }
+    TRACE_AND_STEP();
+    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+       M.x86.R_EDI = pop_long();
+       M.x86.R_ESI = pop_long();
+       M.x86.R_EBP = pop_long();
+       M.x86.R_ESP += 4;              /* skip ESP */
+       M.x86.R_EBX = pop_long();
+       M.x86.R_EDX = pop_long();
+       M.x86.R_ECX = pop_long();
+       M.x86.R_EAX = pop_long();
+    } else {
+       M.x86.R_DI = pop_word();
+       M.x86.R_SI = pop_word();
+       M.x86.R_BP = pop_word();
+       M.x86.R_SP += 2;               /* skip SP */
+       M.x86.R_BX = pop_word();
+       M.x86.R_DX = pop_word();
+       M.x86.R_CX = pop_word();
+       M.x86.R_AX = pop_word();
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/*opcode 0x62  ILLEGAL OP, calls x86emuOp_illegal_op() */
+/*opcode 0x63  ILLEGAL OP, calls x86emuOp_illegal_op() */
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x64
+****************************************************************************/
+void x86emuOp_segovr_FS(u8 X86EMU_UNUSED(op1))
+{
+    START_OF_INSTR();
+    DECODE_PRINTF("FS:\n");
+    TRACE_AND_STEP();
+    M.x86.mode |= SYSMODE_SEGOVR_FS;
+    /*
+     * note the lack of DECODE_CLEAR_SEGOVR(r) since, here is one of 4
+     * opcode subroutines we do not want to do this.
+     */
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x65
+****************************************************************************/
+void x86emuOp_segovr_GS(u8 X86EMU_UNUSED(op1))
+{
+    START_OF_INSTR();
+    DECODE_PRINTF("GS:\n");
+    TRACE_AND_STEP();
+    M.x86.mode |= SYSMODE_SEGOVR_GS;
+    /*
+     * note the lack of DECODE_CLEAR_SEGOVR(r) since, here is one of 4
+     * opcode subroutines we do not want to do this.
+     */
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x66 - prefix for 32-bit register
+****************************************************************************/
+void x86emuOp_prefix_data(u8 X86EMU_UNUSED(op1))
+{
+    START_OF_INSTR();
+    DECODE_PRINTF("DATA:\n");
+    TRACE_AND_STEP();
+    M.x86.mode |= SYSMODE_PREFIX_DATA;
+    /* note no DECODE_CLEAR_SEGOVR here. */
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x67 - prefix for 32-bit address
+****************************************************************************/
+void x86emuOp_prefix_addr(u8 X86EMU_UNUSED(op1))
+{
+    START_OF_INSTR();
+    DECODE_PRINTF("ADDR:\n");
+    TRACE_AND_STEP();
+    M.x86.mode |= SYSMODE_PREFIX_ADDR;
+    /* note no DECODE_CLEAR_SEGOVR here. */
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x68
+****************************************************************************/
+void x86emuOp_push_word_IMM(u8 X86EMU_UNUSED(op1))
+{
+    u32 imm;
+
+    START_OF_INSTR();
+    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+       imm = fetch_long_imm();
+    } else {
+       imm = fetch_word_imm();
+    }
+    DECODE_PRINTF2("PUSH\t%x\n", imm);
+    TRACE_AND_STEP();
+    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+       push_long(imm);
+    } else {
+       push_word((u16)imm);
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x69
+****************************************************************************/
+void x86emuOp_imul_word_IMM(u8 X86EMU_UNUSED(op1))
+{
+    int mod, rl, rh;
+    uint srcoffset;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("IMUL\t");
+    FETCH_DECODE_MODRM(mod, rh, rl);
+    if (mod < 3) {
+       srcoffset = decode_rmXX_address(mod, rl);
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 *destreg;
+           u32 srcval;
+           u32 res_lo,res_hi;
+           s32 imm;
+
+           destreg = DECODE_RM_LONG_REGISTER(rh);
+           DECODE_PRINTF(",");
+           srcval = fetch_data_long(srcoffset);
+           imm = fetch_long_imm();
+           DECODE_PRINTF2(",%d\n", (s32)imm);
+           TRACE_AND_STEP();
+           imul_long_direct(&res_lo,&res_hi,(s32)srcval,(s32)imm);
+           if ((((res_lo & 0x80000000) == 0) && (res_hi == 0x00000000)) ||
+               (((res_lo & 0x80000000) != 0) && (res_hi == 0xFFFFFFFF))) {
+               CLEAR_FLAG(F_CF);
+               CLEAR_FLAG(F_OF);
+           } else {
+               SET_FLAG(F_CF);
+               SET_FLAG(F_OF);
+           }
+           *destreg = (u32)res_lo;
+       } else {
+           u16 *destreg;
+           u16 srcval;
+           u32 res;
+           s16 imm;
+
+           destreg = DECODE_RM_WORD_REGISTER(rh);
+           DECODE_PRINTF(",");
+           srcval = fetch_data_word(srcoffset);
+           imm = fetch_word_imm();
+           DECODE_PRINTF2(",%d\n", (s32)imm);
+           TRACE_AND_STEP();
+           res = (s16)srcval * (s16)imm;
+           if ((((res & 0x8000) == 0) && ((res >> 16) == 0x0000)) ||
+               (((res & 0x8000) != 0) && ((res >> 16) == 0xFFFF))) {
+               CLEAR_FLAG(F_CF);
+               CLEAR_FLAG(F_OF);
+           } else {
+               SET_FLAG(F_CF);
+               SET_FLAG(F_OF);
+           }
+           *destreg = (u16)res;
+       }
+    } else {                    /* register to register */
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 *destreg,*srcreg;
+           u32 res_lo,res_hi;
+           s32 imm;
+
+           destreg = DECODE_RM_LONG_REGISTER(rh);
+           DECODE_PRINTF(",");
+           srcreg = DECODE_RM_LONG_REGISTER(rl);
+           imm = fetch_long_imm();
+           DECODE_PRINTF2(",%d\n", (s32)imm);
+           TRACE_AND_STEP();
+           imul_long_direct(&res_lo,&res_hi,(s32)*srcreg,(s32)imm);
+           if ((((res_lo & 0x80000000) == 0) && (res_hi == 0x00000000)) ||
+               (((res_lo & 0x80000000) != 0) && (res_hi == 0xFFFFFFFF))) {
+               CLEAR_FLAG(F_CF);
+               CLEAR_FLAG(F_OF);
+           } else {
+               SET_FLAG(F_CF);
+               SET_FLAG(F_OF);
+           }
+           *destreg = (u32)res_lo;
+       } else {
+           u16 *destreg,*srcreg;
+           u32 res;
+           s16 imm;
+
+           destreg = DECODE_RM_WORD_REGISTER(rh);
+           DECODE_PRINTF(",");
+           srcreg = DECODE_RM_WORD_REGISTER(rl);
+           imm = fetch_word_imm();
+           DECODE_PRINTF2(",%d\n", (s32)imm);
+           res = (s16)*srcreg * (s16)imm;
+           if ((((res & 0x8000) == 0) && ((res >> 16) == 0x0000)) ||
+               (((res & 0x8000) != 0) && ((res >> 16) == 0xFFFF))) {
+               CLEAR_FLAG(F_CF);
+               CLEAR_FLAG(F_OF);
+           } else {
+               SET_FLAG(F_CF);
+               SET_FLAG(F_OF);
+           }
+           *destreg = (u16)res;
+       }
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x6a
+****************************************************************************/
+void x86emuOp_push_byte_IMM(u8 X86EMU_UNUSED(op1))
+{
+    s16 imm;
+
+    START_OF_INSTR();
+    imm = (s8)fetch_byte_imm();
+    DECODE_PRINTF2("PUSH\t%d\n", imm);
+    TRACE_AND_STEP();
+    push_word(imm);
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x6b
+****************************************************************************/
+void x86emuOp_imul_byte_IMM(u8 X86EMU_UNUSED(op1))
+{
+    int mod, rl, rh;
+    uint srcoffset;
+    s8 imm;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("IMUL\t");
+    FETCH_DECODE_MODRM(mod, rh, rl);
+    if (mod < 3) {
+       srcoffset = decode_rmXX_address(mod, rl);
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 *destreg;
+           u32 srcval;
+           u32 res_lo,res_hi;
+
+           destreg = DECODE_RM_LONG_REGISTER(rh);
+           DECODE_PRINTF(",");
+           srcval = fetch_data_long(srcoffset);
+           imm = fetch_byte_imm();
+           DECODE_PRINTF2(",%d\n", (s32)imm);
+           TRACE_AND_STEP();
+           imul_long_direct(&res_lo,&res_hi,(s32)srcval,(s32)imm);
+           if ((((res_lo & 0x80000000) == 0) && (res_hi == 0x00000000)) ||
+               (((res_lo & 0x80000000) != 0) && (res_hi == 0xFFFFFFFF))) {
+               CLEAR_FLAG(F_CF);
+               CLEAR_FLAG(F_OF);
+           } else {
+               SET_FLAG(F_CF);
+               SET_FLAG(F_OF);
+           }
+           *destreg = (u32)res_lo;
+       } else {
+           u16 *destreg;
+           u16 srcval;
+           u32 res;
+
+           destreg = DECODE_RM_WORD_REGISTER(rh);
+           DECODE_PRINTF(",");
+           srcval = fetch_data_word(srcoffset);
+           imm = fetch_byte_imm();
+           DECODE_PRINTF2(",%d\n", (s32)imm);
+           TRACE_AND_STEP();
+           res = (s16)srcval * (s16)imm;
+           if ((((res & 0x8000) == 0) && ((res >> 16) == 0x0000)) ||
+               (((res & 0x8000) != 0) && ((res >> 16) == 0xFFFF))) {
+               CLEAR_FLAG(F_CF);
+               CLEAR_FLAG(F_OF);
+           } else {
+               SET_FLAG(F_CF);
+               SET_FLAG(F_OF);
+           }
+           *destreg = (u16)res;
+       }
+    } else {                    /* register to register */
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 *destreg,*srcreg;
+           u32 res_lo,res_hi;
+
+           destreg = DECODE_RM_LONG_REGISTER(rh);
+           DECODE_PRINTF(",");
+           srcreg = DECODE_RM_LONG_REGISTER(rl);
+           imm = fetch_byte_imm();
+           DECODE_PRINTF2(",%d\n", (s32)imm);
+           TRACE_AND_STEP();
+           imul_long_direct(&res_lo,&res_hi,(s32)*srcreg,(s32)imm);
+           if ((((res_lo & 0x80000000) == 0) && (res_hi == 0x00000000)) ||
+               (((res_lo & 0x80000000) != 0) && (res_hi == 0xFFFFFFFF))) {
+               CLEAR_FLAG(F_CF);
+               CLEAR_FLAG(F_OF);
+           } else {
+               SET_FLAG(F_CF);
+               SET_FLAG(F_OF);
+           }
+           *destreg = (u32)res_lo;
+       } else {
+           u16 *destreg,*srcreg;
+           u32 res;
+
+           destreg = DECODE_RM_WORD_REGISTER(rh);
+           DECODE_PRINTF(",");
+           srcreg = DECODE_RM_WORD_REGISTER(rl);
+           imm = fetch_byte_imm();
+           DECODE_PRINTF2(",%d\n", (s32)imm);
+           TRACE_AND_STEP();
+           res = (s16)*srcreg * (s16)imm;
+           if ((((res & 0x8000) == 0) && ((res >> 16) == 0x0000)) ||
+               (((res & 0x8000) != 0) && ((res >> 16) == 0xFFFF))) {
+               CLEAR_FLAG(F_CF);
+               CLEAR_FLAG(F_OF);
+           } else {
+               SET_FLAG(F_CF);
+               SET_FLAG(F_OF);
+           }
+           *destreg = (u16)res;
+       }
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x6c
+****************************************************************************/
+void x86emuOp_ins_byte(u8 X86EMU_UNUSED(op1))
+{
+    START_OF_INSTR();
+    DECODE_PRINTF("INSB\n");
+    ins(1);
+    TRACE_AND_STEP();
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x6d
+****************************************************************************/
+void x86emuOp_ins_word(u8 X86EMU_UNUSED(op1))
+{
+    START_OF_INSTR();
+    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+       DECODE_PRINTF("INSD\n");
+       ins(4);
+    } else {
+       DECODE_PRINTF("INSW\n");
+       ins(2);
+    }
+    TRACE_AND_STEP();
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x6e
+****************************************************************************/
+void x86emuOp_outs_byte(u8 X86EMU_UNUSED(op1))
+{
+    START_OF_INSTR();
+    DECODE_PRINTF("OUTSB\n");
+    outs(1);
+    TRACE_AND_STEP();
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x6f
+****************************************************************************/
+void x86emuOp_outs_word(u8 X86EMU_UNUSED(op1))
+{
+    START_OF_INSTR();
+    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+       DECODE_PRINTF("OUTSD\n");
+       outs(4);
+    } else {
+       DECODE_PRINTF("OUTSW\n");
+       outs(2);
+    }
+    TRACE_AND_STEP();
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x70 - 0x7F
+****************************************************************************/
+int x86emu_check_jump_condition(u8 op);
+
+void x86emuOp_jump_near_cond(u8 op1)
+{
+    s8 offset;
+    u16 target;
+    int cond;
+
+    /* jump to byte offset if overflow flag is set */
+    START_OF_INSTR();
+    cond = x86emu_check_jump_condition(op1 & 0xF);
+    offset = (s8)fetch_byte_imm();
+    target = (u16)(M.x86.R_IP + (s16)offset);
+    DECODE_PRINTF2("%x\n", target);
+    TRACE_AND_STEP();
+    if (cond)
+       M.x86.R_IP = target;
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x80
+****************************************************************************/
+void x86emuOp_opc80_byte_RM_IMM(u8 X86EMU_UNUSED(op1))
+{
+    int mod, rl, rh;
+    u8 *destreg;
+    uint destoffset;
+    u8 imm;
+    u8 destval;
+
+    /*
+     * Weirdo special case instruction format. Part of the opcode
+     * held below in "RH".  Doubly nested case would result, except
+     * that the decoded instruction
+     */
+    START_OF_INSTR();
+    FETCH_DECODE_MODRM(mod, rh, rl);
+#ifdef DEBUG
+    if (DEBUG_DECODE()) {
+       /* XXX DECODE_PRINTF may be changed to something more
+          general, so that it is important to leave the strings
+          in the same format, even though the result is that the
+          above test is done twice. */
+
+       switch (rh) {
+       case 0:
+           DECODE_PRINTF("ADD\t");
+           break;
+       case 1:
+           DECODE_PRINTF("OR\t");
+           break;
+       case 2:
+           DECODE_PRINTF("ADC\t");
+           break;
+       case 3:
+           DECODE_PRINTF("SBB\t");
+           break;
+       case 4:
+           DECODE_PRINTF("AND\t");
+           break;
+       case 5:
+           DECODE_PRINTF("SUB\t");
+           break;
+       case 6:
+           DECODE_PRINTF("XOR\t");
+           break;
+       case 7:
+           DECODE_PRINTF("CMP\t");
+           break;
+       }
+    }
+#endif
+    /* know operation, decode the mod byte to find the addressing
+       mode. */
+    if (mod < 3) {
+       DECODE_PRINTF("BYTE PTR ");
+       destoffset = decode_rmXX_address(mod, rl);
+       DECODE_PRINTF(",");
+       destval = fetch_data_byte(destoffset);
+       imm = fetch_byte_imm();
+       DECODE_PRINTF2("%x\n", imm);
+       TRACE_AND_STEP();
+       destval = (*genop_byte_operation[rh]) (destval, imm);
+       if (rh != 7)
+           store_data_byte(destoffset, destval);
+    } else {                    /* register to register */
+       destreg = DECODE_RM_BYTE_REGISTER(rl);
+       DECODE_PRINTF(",");
+       imm = fetch_byte_imm();
+       DECODE_PRINTF2("%x\n", imm);
+       TRACE_AND_STEP();
+       destval = (*genop_byte_operation[rh]) (*destreg, imm);
+       if (rh != 7)
+           *destreg = destval;
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x81
+****************************************************************************/
+void x86emuOp_opc81_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+{
+    int mod, rl, rh;
+    uint destoffset;
+
+    /*
+     * Weirdo special case instruction format. Part of the opcode
+     * held below in "RH".  Doubly nested case would result, except
+     * that the decoded instruction
+     */
+    START_OF_INSTR();
+    FETCH_DECODE_MODRM(mod, rh, rl);
+#ifdef DEBUG
+    if (DEBUG_DECODE()) {
+       /* XXX DECODE_PRINTF may be changed to something more
+          general, so that it is important to leave the strings
+          in the same format, even though the result is that the
+          above test is done twice. */
+
+       switch (rh) {
+       case 0:
+           DECODE_PRINTF("ADD\t");
+           break;
+       case 1:
+           DECODE_PRINTF("OR\t");
+           break;
+       case 2:
+           DECODE_PRINTF("ADC\t");
+           break;
+       case 3:
+           DECODE_PRINTF("SBB\t");
+           break;
+       case 4:
+           DECODE_PRINTF("AND\t");
+           break;
+       case 5:
+           DECODE_PRINTF("SUB\t");
+           break;
+       case 6:
+           DECODE_PRINTF("XOR\t");
+           break;
+       case 7:
+           DECODE_PRINTF("CMP\t");
+           break;
+       }
+    }
+#endif
+    /*
+     * Know operation, decode the mod byte to find the addressing
+     * mode.
+     */
+    if (mod < 3) {
+       DECODE_PRINTF("DWORD PTR ");
+       destoffset = decode_rmXX_address(mod, rl);
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 destval,imm;
+
+           DECODE_PRINTF(",");
+           destval = fetch_data_long(destoffset);
+           imm = fetch_long_imm();
+           DECODE_PRINTF2("%x\n", imm);
+           TRACE_AND_STEP();
+           destval = (*genop_long_operation[rh]) (destval, imm);
+           if (rh != 7)
+               store_data_long(destoffset, destval);
+       } else {
+           u16 destval,imm;
+
+           DECODE_PRINTF(",");
+           destval = fetch_data_word(destoffset);
+           imm = fetch_word_imm();
+           DECODE_PRINTF2("%x\n", imm);
+           TRACE_AND_STEP();
+           destval = (*genop_word_operation[rh]) (destval, imm);
+           if (rh != 7)
+               store_data_word(destoffset, destval);
+       }
+    } else {                    /* register to register */
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 *destreg;
+           u32 destval,imm;
+
+           destreg = DECODE_RM_LONG_REGISTER(rl);
+           DECODE_PRINTF(",");
+           imm = fetch_long_imm();
+           DECODE_PRINTF2("%x\n", imm);
+           TRACE_AND_STEP();
+           destval = (*genop_long_operation[rh]) (*destreg, imm);
+           if (rh != 7)
+               *destreg = destval;
+       } else {
+           u16 *destreg;
+           u16 destval,imm;
+
+           destreg = DECODE_RM_WORD_REGISTER(rl);
+           DECODE_PRINTF(",");
+           imm = fetch_word_imm();
+           DECODE_PRINTF2("%x\n", imm);
+           TRACE_AND_STEP();
+           destval = (*genop_word_operation[rh]) (*destreg, imm);
+           if (rh != 7)
+               *destreg = destval;
+       }
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x82
+****************************************************************************/
+void x86emuOp_opc82_byte_RM_IMM(u8 X86EMU_UNUSED(op1))
+{
+    int mod, rl, rh;
+    u8 *destreg;
+    uint destoffset;
+    u8 imm;
+    u8 destval;
+
+    /*
+     * Weirdo special case instruction format. Part of the opcode
+     * held below in "RH".  Doubly nested case would result, except
+     * that the decoded instruction Similar to opcode 81, except that
+     * the immediate byte is sign extended to a word length.
+     */
+    START_OF_INSTR();
+    FETCH_DECODE_MODRM(mod, rh, rl);
+#ifdef DEBUG
+    if (DEBUG_DECODE()) {
+       /* XXX DECODE_PRINTF may be changed to something more
+          general, so that it is important to leave the strings
+          in the same format, even though the result is that the
+          above test is done twice. */
+       switch (rh) {
+       case 0:
+           DECODE_PRINTF("ADD\t");
+           break;
+       case 1:
+           DECODE_PRINTF("OR\t");
+           break;
+       case 2:
+           DECODE_PRINTF("ADC\t");
+           break;
+       case 3:
+           DECODE_PRINTF("SBB\t");
+           break;
+       case 4:
+           DECODE_PRINTF("AND\t");
+           break;
+       case 5:
+           DECODE_PRINTF("SUB\t");
+           break;
+       case 6:
+           DECODE_PRINTF("XOR\t");
+           break;
+       case 7:
+           DECODE_PRINTF("CMP\t");
+           break;
+       }
+    }
+#endif
+    /* know operation, decode the mod byte to find the addressing
+       mode. */
+    if (mod < 3) {
+       DECODE_PRINTF("BYTE PTR ");
+       destoffset = decode_rmXX_address(mod, rl);
+       destval = fetch_data_byte(destoffset);
+       imm = fetch_byte_imm();
+       DECODE_PRINTF2(",%x\n", imm);
+       TRACE_AND_STEP();
+       destval = (*genop_byte_operation[rh]) (destval, imm);
+       if (rh != 7)
+           store_data_byte(destoffset, destval);
+    } else {                    /* register to register */
+       destreg = DECODE_RM_BYTE_REGISTER(rl);
+       imm = fetch_byte_imm();
+       DECODE_PRINTF2(",%x\n", imm);
+       TRACE_AND_STEP();
+       destval = (*genop_byte_operation[rh]) (*destreg, imm);
+       if (rh != 7)
+           *destreg = destval;
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x83
+****************************************************************************/
+void x86emuOp_opc83_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+{
+    int mod, rl, rh;
+    uint destoffset;
+
+    /*
+     * Weirdo special case instruction format. Part of the opcode
+     * held below in "RH".  Doubly nested case would result, except
+     * that the decoded instruction Similar to opcode 81, except that
+     * the immediate byte is sign extended to a word length.
+     */
+    START_OF_INSTR();
+    FETCH_DECODE_MODRM(mod, rh, rl);
+#ifdef DEBUG
+    if (DEBUG_DECODE()) {
+       /* XXX DECODE_PRINTF may be changed to something more
+          general, so that it is important to leave the strings
+          in the same format, even though the result is that the
+          above test is done twice. */
+       switch (rh) {
+       case 0:
+           DECODE_PRINTF("ADD\t");
+           break;
+       case 1:
+           DECODE_PRINTF("OR\t");
+           break;
+       case 2:
+           DECODE_PRINTF("ADC\t");
+           break;
+       case 3:
+           DECODE_PRINTF("SBB\t");
+           break;
+       case 4:
+           DECODE_PRINTF("AND\t");
+           break;
+       case 5:
+           DECODE_PRINTF("SUB\t");
+           break;
+       case 6:
+           DECODE_PRINTF("XOR\t");
+           break;
+       case 7:
+           DECODE_PRINTF("CMP\t");
+           break;
+       }
+    }
+#endif
+    /* know operation, decode the mod byte to find the addressing
+       mode. */
+    if (mod < 3) {
+       DECODE_PRINTF("DWORD PTR ");
+       destoffset = decode_rmXX_address(mod,rl);
+
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 destval,imm;
+
+           destval = fetch_data_long(destoffset);
+           imm = (s8) fetch_byte_imm();
+           DECODE_PRINTF2(",%x\n", imm);
+           TRACE_AND_STEP();
+           destval = (*genop_long_operation[rh]) (destval, imm);
+           if (rh != 7)
+               store_data_long(destoffset, destval);
+       } else {
+           u16 destval,imm;
+
+           destval = fetch_data_word(destoffset);
+           imm = (s8) fetch_byte_imm();
+           DECODE_PRINTF2(",%x\n", imm);
+           TRACE_AND_STEP();
+           destval = (*genop_word_operation[rh]) (destval, imm);
+           if (rh != 7)
+               store_data_word(destoffset, destval);
+       }
+    } else {                    /* register to register */
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 *destreg;
+           u32 destval,imm;
+
+           destreg = DECODE_RM_LONG_REGISTER(rl);
+           imm = (s8) fetch_byte_imm();
+           DECODE_PRINTF2(",%x\n", imm);
+           TRACE_AND_STEP();
+           destval = (*genop_long_operation[rh]) (*destreg, imm);
+           if (rh != 7)
+               *destreg = destval;
+       } else {
+           u16 *destreg;
+           u16 destval,imm;
+
+           destreg = DECODE_RM_WORD_REGISTER(rl);
+           imm = (s8) fetch_byte_imm();
+           DECODE_PRINTF2(",%x\n", imm);
+           TRACE_AND_STEP();
+           destval = (*genop_word_operation[rh]) (*destreg, imm);
+           if (rh != 7)
+               *destreg = destval;
+       }
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x84
+****************************************************************************/
+void x86emuOp_test_byte_RM_R(u8 X86EMU_UNUSED(op1))
+{
+    int mod, rl, rh;
+    u8 *destreg, *srcreg;
+    uint destoffset;
+    u8 destval;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("TEST\t");
+    FETCH_DECODE_MODRM(mod, rh, rl);
+    if (mod < 3) {
+       destoffset = decode_rmXX_address(mod, rl);
+       DECODE_PRINTF(",");
+       destval = fetch_data_byte(destoffset);
+       srcreg = DECODE_RM_BYTE_REGISTER(rh);
+       DECODE_PRINTF("\n");
+       TRACE_AND_STEP();
+       test_byte(destval, *srcreg);
+    } else {                    /* register to register */
+       destreg = DECODE_RM_BYTE_REGISTER(rl);
+       DECODE_PRINTF(",");
+       srcreg = DECODE_RM_BYTE_REGISTER(rh);
+       DECODE_PRINTF("\n");
+       TRACE_AND_STEP();
+       test_byte(*destreg, *srcreg);
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x85
+****************************************************************************/
+void x86emuOp_test_word_RM_R(u8 X86EMU_UNUSED(op1))
+{
+    int mod, rl, rh;
+    uint destoffset;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("TEST\t");
+    FETCH_DECODE_MODRM(mod, rh, rl);
+    if (mod < 3) {
+       destoffset = decode_rmXX_address(mod, rl);
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 destval;
+           u32 *srcreg;
+
+           DECODE_PRINTF(",");
+           destval = fetch_data_long(destoffset);
+           srcreg = DECODE_RM_LONG_REGISTER(rh);
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           test_long(destval, *srcreg);
+       } else {
+           u16 destval;
+           u16 *srcreg;
+
+           DECODE_PRINTF(",");
+           destval = fetch_data_word(destoffset);
+           srcreg = DECODE_RM_WORD_REGISTER(rh);
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           test_word(destval, *srcreg);
+       }
+    } else {                    /* register to register */
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 *destreg,*srcreg;
+
+           destreg = DECODE_RM_LONG_REGISTER(rl);
+           DECODE_PRINTF(",");
+           srcreg = DECODE_RM_LONG_REGISTER(rh);
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           test_long(*destreg, *srcreg);
+       } else {
+           u16 *destreg,*srcreg;
+
+           destreg = DECODE_RM_WORD_REGISTER(rl);
+           DECODE_PRINTF(",");
+           srcreg = DECODE_RM_WORD_REGISTER(rh);
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           test_word(*destreg, *srcreg);
+       }
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x86
+****************************************************************************/
+void x86emuOp_xchg_byte_RM_R(u8 X86EMU_UNUSED(op1))
+{
+    int mod, rl, rh;
+    u8 *destreg, *srcreg;
+    uint destoffset;
+    u8 destval;
+    u8 tmp;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("XCHG\t");
+    FETCH_DECODE_MODRM(mod, rh, rl);
+    if (mod < 3) {
+       destoffset = decode_rmXX_address(mod, rl);
+       DECODE_PRINTF(",");
+       destval = fetch_data_byte(destoffset);
+       srcreg = DECODE_RM_BYTE_REGISTER(rh);
+       DECODE_PRINTF("\n");
+       TRACE_AND_STEP();
+       tmp = *srcreg;
+       *srcreg = destval;
+       destval = tmp;
+       store_data_byte(destoffset, destval);
+    } else {                    /* register to register */
+       destreg = DECODE_RM_BYTE_REGISTER(rl);
+       DECODE_PRINTF(",");
+       srcreg = DECODE_RM_BYTE_REGISTER(rh);
+       DECODE_PRINTF("\n");
+       TRACE_AND_STEP();
+       tmp = *srcreg;
+       *srcreg = *destreg;
+       *destreg = tmp;
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x87
+****************************************************************************/
+void x86emuOp_xchg_word_RM_R(u8 X86EMU_UNUSED(op1))
+{
+    int mod, rl, rh;
+    uint destoffset;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("XCHG\t");
+    FETCH_DECODE_MODRM(mod, rh, rl);
+    if (mod < 3) {
+       destoffset = decode_rmXX_address(mod, rl);
+       DECODE_PRINTF(",");
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 *srcreg;
+           u32 destval,tmp;
+
+           destval = fetch_data_long(destoffset);
+           srcreg = DECODE_RM_LONG_REGISTER(rh);
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           tmp = *srcreg;
+           *srcreg = destval;
+           destval = tmp;
+           store_data_long(destoffset, destval);
+       } else {
+           u16 *srcreg;
+           u16 destval,tmp;
+
+           destval = fetch_data_word(destoffset);
+           srcreg = DECODE_RM_WORD_REGISTER(rh);
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           tmp = *srcreg;
+           *srcreg = destval;
+           destval = tmp;
+           store_data_word(destoffset, destval);
+       }
+    } else {                    /* register to register */
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 *destreg,*srcreg;
+           u32 tmp;
+
+           destreg = DECODE_RM_LONG_REGISTER(rl);
+           DECODE_PRINTF(",");
+           srcreg = DECODE_RM_LONG_REGISTER(rh);
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           tmp = *srcreg;
+           *srcreg = *destreg;
+           *destreg = tmp;
+       } else {
+           u16 *destreg,*srcreg;
+           u16 tmp;
+
+           destreg = DECODE_RM_WORD_REGISTER(rl);
+           DECODE_PRINTF(",");
+           srcreg = DECODE_RM_WORD_REGISTER(rh);
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           tmp = *srcreg;
+           *srcreg = *destreg;
+           *destreg = tmp;
+       }
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x88
+****************************************************************************/
+void x86emuOp_mov_byte_RM_R(u8 X86EMU_UNUSED(op1))
+{
+    int mod, rl, rh;
+    u8 *destreg, *srcreg;
+    uint destoffset;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("MOV\t");
+    FETCH_DECODE_MODRM(mod, rh, rl);
+    if (mod < 3) {
+       destoffset = decode_rmXX_address(mod, rl);
+       DECODE_PRINTF(",");
+       srcreg = DECODE_RM_BYTE_REGISTER(rh);
+       DECODE_PRINTF("\n");
+       TRACE_AND_STEP();
+       store_data_byte(destoffset, *srcreg);
+    } else {                    /* register to register */
+       destreg = DECODE_RM_BYTE_REGISTER(rl);
+       DECODE_PRINTF(",");
+       srcreg = DECODE_RM_BYTE_REGISTER(rh);
+       DECODE_PRINTF("\n");
+       TRACE_AND_STEP();
+       *destreg = *srcreg;
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x89
+****************************************************************************/
+void x86emuOp_mov_word_RM_R(u8 X86EMU_UNUSED(op1))
+{
+    int mod, rl, rh;
+    uint destoffset;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("MOV\t");
+    FETCH_DECODE_MODRM(mod, rh, rl);
+    if (mod < 3) {
+       destoffset = decode_rmXX_address(mod, rl);
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 *srcreg;
+
+           DECODE_PRINTF(",");
+           srcreg = DECODE_RM_LONG_REGISTER(rh);
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           store_data_long(destoffset, *srcreg);
+       } else {
+           u16 *srcreg;
+
+           DECODE_PRINTF(",");
+           srcreg = DECODE_RM_WORD_REGISTER(rh);
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           store_data_word(destoffset, *srcreg);
+       }
+    } else {                    /* register to register */
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 *destreg,*srcreg;
+
+           destreg = DECODE_RM_LONG_REGISTER(rl);
+           DECODE_PRINTF(",");
+           srcreg = DECODE_RM_LONG_REGISTER(rh);
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           *destreg = *srcreg;
+       } else {
+           u16 *destreg,*srcreg;
+
+           destreg = DECODE_RM_WORD_REGISTER(rl);
+           DECODE_PRINTF(",");
+           srcreg = DECODE_RM_WORD_REGISTER(rh);
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           *destreg = *srcreg;
+       }
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x8a
+****************************************************************************/
+void x86emuOp_mov_byte_R_RM(u8 X86EMU_UNUSED(op1))
+{
+    int mod, rl, rh;
+    u8 *destreg, *srcreg;
+    uint srcoffset;
+    u8 srcval;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("MOV\t");
+    FETCH_DECODE_MODRM(mod, rh, rl);
+    if (mod < 3) {
+       destreg = DECODE_RM_BYTE_REGISTER(rh);
+       DECODE_PRINTF(",");
+       srcoffset = decode_rmXX_address(mod, rl);
+       srcval = fetch_data_byte(srcoffset);
+       DECODE_PRINTF("\n");
+       TRACE_AND_STEP();
+       *destreg = srcval;
+    } else {                    /* register to register */
+       destreg = DECODE_RM_BYTE_REGISTER(rh);
+       DECODE_PRINTF(",");
+       srcreg = DECODE_RM_BYTE_REGISTER(rl);
+       DECODE_PRINTF("\n");
+       TRACE_AND_STEP();
+       *destreg = *srcreg;
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x8b
+****************************************************************************/
+void x86emuOp_mov_word_R_RM(u8 X86EMU_UNUSED(op1))
+{
+    int mod, rl, rh;
+    uint srcoffset;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("MOV\t");
+    FETCH_DECODE_MODRM(mod, rh, rl);
+    if (mod < 3) {
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 *destreg;
+           u32 srcval;
+
+           destreg = DECODE_RM_LONG_REGISTER(rh);
+           DECODE_PRINTF(",");
+           srcoffset = decode_rmXX_address(mod, rl);
+           srcval = fetch_data_long(srcoffset);
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           *destreg = srcval;
+       } else {
+           u16 *destreg;
+           u16 srcval;
+
+           destreg = DECODE_RM_WORD_REGISTER(rh);
+           DECODE_PRINTF(",");
+           srcoffset = decode_rmXX_address(mod, rl);
+           srcval = fetch_data_word(srcoffset);
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           *destreg = srcval;
+       }
+    } else {                    /* register to register */
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 *destreg, *srcreg;
+
+           destreg = DECODE_RM_LONG_REGISTER(rh);
+           DECODE_PRINTF(",");
+           srcreg = DECODE_RM_LONG_REGISTER(rl);
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           *destreg = *srcreg;
+       } else {
+           u16 *destreg, *srcreg;
+
+           destreg = DECODE_RM_WORD_REGISTER(rh);
+           DECODE_PRINTF(",");
+           srcreg = DECODE_RM_WORD_REGISTER(rl);
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           *destreg = *srcreg;
+       }
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x8c
+****************************************************************************/
+void x86emuOp_mov_word_RM_SR(u8 X86EMU_UNUSED(op1))
+{
+    int mod, rl, rh;
+    u16 *destreg, *srcreg;
+    uint destoffset;
+    u16 destval;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("MOV\t");
+    FETCH_DECODE_MODRM(mod, rh, rl);
+    if (mod < 3) {
+       destoffset = decode_rmXX_address(mod, rl);
+       DECODE_PRINTF(",");
+       srcreg = decode_rm_seg_register(rh);
+       DECODE_PRINTF("\n");
+       TRACE_AND_STEP();
+       destval = *srcreg;
+       store_data_word(destoffset, destval);
+    } else {                    /* register to register */
+       destreg = DECODE_RM_WORD_REGISTER(rl);
+       DECODE_PRINTF(",");
+       srcreg = decode_rm_seg_register(rh);
+       DECODE_PRINTF("\n");
+       TRACE_AND_STEP();
+       *destreg = *srcreg;
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x8d
+****************************************************************************/
+void x86emuOp_lea_word_R_M(u8 X86EMU_UNUSED(op1))
+{
+    int mod, rl, rh;
+    u16 *srcreg;
+    uint destoffset;
+
+/*
+ * TODO: Need to handle address size prefix!
+ *
+ * lea eax,[eax+ebx*2] ??
+ */
+
+    START_OF_INSTR();
+    DECODE_PRINTF("LEA\t");
+    FETCH_DECODE_MODRM(mod, rh, rl);
+    if (mod < 3) {
+       srcreg = DECODE_RM_WORD_REGISTER(rh);
+       DECODE_PRINTF(",");
+       destoffset = decode_rmXX_address(mod, rl);
+       DECODE_PRINTF("\n");
+       TRACE_AND_STEP();
+       *srcreg = (u16)destoffset;
+       }
+    /* } else { undefined.  Do nothing. } */
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x8e
+****************************************************************************/
+void x86emuOp_mov_word_SR_RM(u8 X86EMU_UNUSED(op1))
+{
+    int mod, rl, rh;
+    u16 *destreg, *srcreg;
+    uint srcoffset;
+    u16 srcval;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("MOV\t");
+    FETCH_DECODE_MODRM(mod, rh, rl);
+    if (mod < 3) {
+       destreg = decode_rm_seg_register(rh);
+       DECODE_PRINTF(",");
+       srcoffset = decode_rmXX_address(mod, rl);
+       srcval = fetch_data_word(srcoffset);
+       DECODE_PRINTF("\n");
+       TRACE_AND_STEP();
+       *destreg = srcval;
+    } else {                    /* register to register */
+       destreg = decode_rm_seg_register(rh);
+       DECODE_PRINTF(",");
+       srcreg = DECODE_RM_WORD_REGISTER(rl);
+       DECODE_PRINTF("\n");
+       TRACE_AND_STEP();
+       *destreg = *srcreg;
+    }
+    /*
+     * Clean up, and reset all the R_xSP pointers to the correct
+     * locations.  This is about 3x too much overhead (doing all the
+     * segreg ptrs when only one is needed, but this instruction
+     * *cannot* be that common, and this isn't too much work anyway.
+     */
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x8f
+****************************************************************************/
+void x86emuOp_pop_RM(u8 X86EMU_UNUSED(op1))
+{
+    int mod, rl, rh;
+    uint destoffset;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("POP\t");
+    FETCH_DECODE_MODRM(mod, rh, rl);
+    if (rh != 0) {
+       DECODE_PRINTF("ILLEGAL DECODE OF OPCODE 8F\n");
+       HALT_SYS();
+    }
+    if (mod < 3) {
+       destoffset = decode_rmXX_address(mod, rl);
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 destval;
+
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           destval = pop_long();
+           store_data_long(destoffset, destval);
+       } else {
+           u16 destval;
+
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           destval = pop_word();
+           store_data_word(destoffset, destval);
+       }
+    } else {                   /* register to register */
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 *destreg;
+
+           destreg = DECODE_RM_LONG_REGISTER(rl);
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           *destreg = pop_long();
+       } else {
+           u16 *destreg;
+
+           destreg = DECODE_RM_WORD_REGISTER(rl);
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           *destreg = pop_word();
+       }
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x90
+****************************************************************************/
+void x86emuOp_nop(u8 X86EMU_UNUSED(op1))
+{
+    START_OF_INSTR();
+    DECODE_PRINTF("NOP\n");
+    TRACE_AND_STEP();
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x91-0x97
+****************************************************************************/
+void x86emuOp_xchg_word_AX_register(u8 X86EMU_UNUSED(op1))
+{
+    u32 tmp;
+
+    op1 &= 0x7;
+
+    START_OF_INSTR();
+
+    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+       u32 *reg32;
+       DECODE_PRINTF("XCHG\tEAX,");
+       reg32 = DECODE_RM_LONG_REGISTER(op1);
+       DECODE_PRINTF("\n");
+       TRACE_AND_STEP();
+       tmp = M.x86.R_EAX;
+       M.x86.R_EAX = *reg32;
+       *reg32 = tmp;
+    } else {
+       u16 *reg16;
+       DECODE_PRINTF("XCHG\tAX,");
+       reg16 = DECODE_RM_WORD_REGISTER(op1);
+       DECODE_PRINTF("\n");
+       TRACE_AND_STEP();
+       tmp = M.x86.R_AX;
+       M.x86.R_EAX = *reg16;
+       *reg16 = (u16)tmp;
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x98
+****************************************************************************/
+void x86emuOp_cbw(u8 X86EMU_UNUSED(op1))
+{
+    START_OF_INSTR();
+    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+       DECODE_PRINTF("CWDE\n");
+    } else {
+       DECODE_PRINTF("CBW\n");
+    }
+    TRACE_AND_STEP();
+    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+       if (M.x86.R_AX & 0x8000) {
+           M.x86.R_EAX |= 0xffff0000;
+       } else {
+           M.x86.R_EAX &= 0x0000ffff;
+       }
+    } else {
+       if (M.x86.R_AL & 0x80) {
+           M.x86.R_AH = 0xff;
+       } else {
+           M.x86.R_AH = 0x0;
+       }
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x99
+****************************************************************************/
+void x86emuOp_cwd(u8 X86EMU_UNUSED(op1))
+{
+    START_OF_INSTR();
+    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+       DECODE_PRINTF("CDQ\n");
+    } else {
+       DECODE_PRINTF("CWD\n");
+    }
+    DECODE_PRINTF("CWD\n");
+    TRACE_AND_STEP();
+    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+       if (M.x86.R_EAX & 0x80000000) {
+           M.x86.R_EDX = 0xffffffff;
+       } else {
+           M.x86.R_EDX = 0x0;
+       }
+    } else {
+       if (M.x86.R_AX & 0x8000) {
+           M.x86.R_DX = 0xffff;
+       } else {
+           M.x86.R_DX = 0x0;
+       }
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x9a
+****************************************************************************/
+void x86emuOp_call_far_IMM(u8 X86EMU_UNUSED(op1))
+{
+    u16 farseg, faroff;
+
+    START_OF_INSTR();
+       DECODE_PRINTF("CALL\t");
+       faroff = fetch_word_imm();
+       farseg = fetch_word_imm();
+       DECODE_PRINTF2("%04x:", farseg);
+       DECODE_PRINTF2("%04x\n", faroff);
+       CALL_TRACE(M.x86.saved_cs, M.x86.saved_ip, farseg, faroff, "FAR ");
+
+    /* XXX
+     *
+     * Hooked interrupt vectors calling into our "BIOS" will cause
+     * problems unless all intersegment stuff is checked for BIOS
+     * access. Check needed here.  For moment, let it alone.
+     */
+    TRACE_AND_STEP();
+    push_word(M.x86.R_CS);
+    M.x86.R_CS = farseg;
+    push_word(M.x86.R_IP);
+    M.x86.R_IP = faroff;
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x9b
+****************************************************************************/
+void x86emuOp_wait(u8 X86EMU_UNUSED(op1))
+{
+    START_OF_INSTR();
+    DECODE_PRINTF("WAIT");
+    TRACE_AND_STEP();
+    /* NADA.  */
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x9c
+****************************************************************************/
+void x86emuOp_pushf_word(u8 X86EMU_UNUSED(op1))
+{
+    u32 flags;
+
+    START_OF_INSTR();
+    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+       DECODE_PRINTF("PUSHFD\n");
+    } else {
+       DECODE_PRINTF("PUSHF\n");
+    }
+    TRACE_AND_STEP();
+
+    /* clear out *all* bits not representing flags, and turn on real bits */
+    flags = (M.x86.R_EFLG & F_MSK) | F_ALWAYS_ON;
+    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+       push_long(flags);
+    } else {
+       push_word((u16)flags);
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x9d
+****************************************************************************/
+void x86emuOp_popf_word(u8 X86EMU_UNUSED(op1))
+{
+    START_OF_INSTR();
+    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+       DECODE_PRINTF("POPFD\n");
+    } else {
+       DECODE_PRINTF("POPF\n");
+    }
+    TRACE_AND_STEP();
+    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+       M.x86.R_EFLG = pop_long();
+    } else {
+       M.x86.R_FLG = pop_word();
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x9e
+****************************************************************************/
+void x86emuOp_sahf(u8 X86EMU_UNUSED(op1))
+{
+    START_OF_INSTR();
+    DECODE_PRINTF("SAHF\n");
+    TRACE_AND_STEP();
+    /* clear the lower bits of the flag register */
+    M.x86.R_FLG &= 0xffffff00;
+    /* or in the AH register into the flags register */
+    M.x86.R_FLG |= M.x86.R_AH;
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x9f
+****************************************************************************/
+void x86emuOp_lahf(u8 X86EMU_UNUSED(op1))
+{
+    START_OF_INSTR();
+    DECODE_PRINTF("LAHF\n");
+    TRACE_AND_STEP();
+       M.x86.R_AH = (u8)(M.x86.R_FLG & 0xff);
+    /*undocumented TC++ behavior??? Nope.  It's documented, but
+       you have too look real hard to notice it. */
+    M.x86.R_AH |= 0x2;
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xa0
+****************************************************************************/
+void x86emuOp_mov_AL_M_IMM(u8 X86EMU_UNUSED(op1))
+{
+    u16 offset;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("MOV\tAL,");
+    offset = fetch_word_imm();
+    DECODE_PRINTF2("[%04x]\n", offset);
+    TRACE_AND_STEP();
+    M.x86.R_AL = fetch_data_byte(offset);
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xa1
+****************************************************************************/
+void x86emuOp_mov_AX_M_IMM(u8 X86EMU_UNUSED(op1))
+{
+    u16 offset;
+
+    START_OF_INSTR();
+    offset = fetch_word_imm();
+    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+       DECODE_PRINTF2("MOV\tEAX,[%04x]\n", offset);
+    } else {
+       DECODE_PRINTF2("MOV\tAX,[%04x]\n", offset);
+    }
+    TRACE_AND_STEP();
+    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+       M.x86.R_EAX = fetch_data_long(offset);
+    } else {
+       M.x86.R_AX = fetch_data_word(offset);
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xa2
+****************************************************************************/
+void x86emuOp_mov_M_AL_IMM(u8 X86EMU_UNUSED(op1))
+{
+    u16 offset;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("MOV\t");
+    offset = fetch_word_imm();
+    DECODE_PRINTF2("[%04x],AL\n", offset);
+    TRACE_AND_STEP();
+    store_data_byte(offset, M.x86.R_AL);
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xa3
+****************************************************************************/
+void x86emuOp_mov_M_AX_IMM(u8 X86EMU_UNUSED(op1))
+{
+    u16 offset;
+
+    START_OF_INSTR();
+    offset = fetch_word_imm();
+    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+       DECODE_PRINTF2("MOV\t[%04x],EAX\n", offset);
+    } else {
+       DECODE_PRINTF2("MOV\t[%04x],AX\n", offset);
+    }
+    TRACE_AND_STEP();
+    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+       store_data_long(offset, M.x86.R_EAX);
+    } else {
+       store_data_word(offset, M.x86.R_AX);
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xa4
+****************************************************************************/
+void x86emuOp_movs_byte(u8 X86EMU_UNUSED(op1))
+{
+    u8 val;
+    u32 count;
+    int inc;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("MOVS\tBYTE\n");
+    if (ACCESS_FLAG(F_DF))   /* down */
+       inc = -1;
+    else
+       inc = 1;
+    TRACE_AND_STEP();
+    count = 1;
+    if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) {
+       /* dont care whether REPE or REPNE */
+       /* move them until CX is ZERO. */
+       count = M.x86.R_CX;
+       M.x86.R_CX = 0;
+       M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
+    }
+    while (count--) {
+       val = fetch_data_byte(M.x86.R_SI);
+       store_data_byte_abs(M.x86.R_ES, M.x86.R_DI, val);
+       M.x86.R_SI += inc;
+       M.x86.R_DI += inc;
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xa5
+****************************************************************************/
+void x86emuOp_movs_word(u8 X86EMU_UNUSED(op1))
+{
+    u32 val;
+    int inc;
+    u32 count;
+
+    START_OF_INSTR();
+    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+       DECODE_PRINTF("MOVS\tDWORD\n");
+       if (ACCESS_FLAG(F_DF))      /* down */
+           inc = -4;
+       else
+           inc = 4;
+    } else {
+       DECODE_PRINTF("MOVS\tWORD\n");
+       if (ACCESS_FLAG(F_DF))      /* down */
+           inc = -2;
+       else
+           inc = 2;
+    }
+    TRACE_AND_STEP();
+    count = 1;
+    if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) {
+       /* dont care whether REPE or REPNE */
+       /* move them until CX is ZERO. */
+       count = M.x86.R_CX;
+       M.x86.R_CX = 0;
+       M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
+    }
+    while (count--) {
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           val = fetch_data_long(M.x86.R_SI);
+           store_data_long_abs(M.x86.R_ES, M.x86.R_DI, val);
+       } else {
+           val = fetch_data_word(M.x86.R_SI);
+           store_data_word_abs(M.x86.R_ES, M.x86.R_DI, (u16)val);
+       }
+       M.x86.R_SI += inc;
+       M.x86.R_DI += inc;
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xa6
+****************************************************************************/
+void x86emuOp_cmps_byte(u8 X86EMU_UNUSED(op1))
+{
+    s8 val1, val2;
+    int inc;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("CMPS\tBYTE\n");
+    TRACE_AND_STEP();
+    if (ACCESS_FLAG(F_DF))   /* down */
+       inc = -1;
+    else
+       inc = 1;
+
+    if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) {
+       /* REPE  */
+       /* move them until CX is ZERO. */
+       while (M.x86.R_CX != 0) {
+           val1 = fetch_data_byte(M.x86.R_SI);
+           val2 = fetch_data_byte_abs(M.x86.R_ES, M.x86.R_DI);
+                    cmp_byte(val1, val2);
+           M.x86.R_CX -= 1;
+           M.x86.R_SI += inc;
+           M.x86.R_DI += inc;
+           if ( (M.x86.mode & SYSMODE_PREFIX_REPE) && (ACCESS_FLAG(F_ZF) == 0) ) break;
+           if ( (M.x86.mode & SYSMODE_PREFIX_REPNE) && ACCESS_FLAG(F_ZF) ) break;
+       }
+       M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
+    } else {
+       val1 = fetch_data_byte(M.x86.R_SI);
+       val2 = fetch_data_byte_abs(M.x86.R_ES, M.x86.R_DI);
+       cmp_byte(val1, val2);
+       M.x86.R_SI += inc;
+       M.x86.R_DI += inc;
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xa7
+****************************************************************************/
+void x86emuOp_cmps_word(u8 X86EMU_UNUSED(op1))
+{
+    u32 val1,val2;
+    int inc;
+
+    START_OF_INSTR();
+    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+       DECODE_PRINTF("CMPS\tDWORD\n");
+       inc = 4;
+    } else {
+       DECODE_PRINTF("CMPS\tWORD\n");
+       inc = 2;
+    }
+    if (ACCESS_FLAG(F_DF))   /* down */
+       inc = -inc;
+
+    TRACE_AND_STEP();
+    if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) {
+       /* REPE  */
+       /* move them until CX is ZERO. */
+       while (M.x86.R_CX != 0) {
+           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+               val1 = fetch_data_long(M.x86.R_SI);
+               val2 = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI);
+               cmp_long(val1, val2);
+           } else {
+               val1 = fetch_data_word(M.x86.R_SI);
+               val2 = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI);
+               cmp_word((u16)val1, (u16)val2);
+           }
+           M.x86.R_CX -= 1;
+           M.x86.R_SI += inc;
+           M.x86.R_DI += inc;
+           if ( (M.x86.mode & SYSMODE_PREFIX_REPE) && ACCESS_FLAG(F_ZF) == 0 ) break;
+           if ( (M.x86.mode & SYSMODE_PREFIX_REPNE) && ACCESS_FLAG(F_ZF) ) break;
+       }
+       M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
+    } else {
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           val1 = fetch_data_long(M.x86.R_SI);
+           val2 = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI);
+           cmp_long(val1, val2);
+       } else {
+           val1 = fetch_data_word(M.x86.R_SI);
+           val2 = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI);
+           cmp_word((u16)val1, (u16)val2);
+       }
+       M.x86.R_SI += inc;
+       M.x86.R_DI += inc;
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xa8
+****************************************************************************/
+void x86emuOp_test_AL_IMM(u8 X86EMU_UNUSED(op1))
+{
+    int imm;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("TEST\tAL,");
+    imm = fetch_byte_imm();
+    DECODE_PRINTF2("%04x\n", imm);
+    TRACE_AND_STEP();
+       test_byte(M.x86.R_AL, (u8)imm);
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xa9
+****************************************************************************/
+void x86emuOp_test_AX_IMM(u8 X86EMU_UNUSED(op1))
+{
+    u32 srcval;
+
+    START_OF_INSTR();
+    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+       DECODE_PRINTF("TEST\tEAX,");
+       srcval = fetch_long_imm();
+    } else {
+       DECODE_PRINTF("TEST\tAX,");
+       srcval = fetch_word_imm();
+    }
+    DECODE_PRINTF2("%x\n", srcval);
+    TRACE_AND_STEP();
+    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+       test_long(M.x86.R_EAX, srcval);
+    } else {
+       test_word(M.x86.R_AX, (u16)srcval);
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xaa
+****************************************************************************/
+void x86emuOp_stos_byte(u8 X86EMU_UNUSED(op1))
+{
+    int inc;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("STOS\tBYTE\n");
+    if (ACCESS_FLAG(F_DF))   /* down */
+       inc = -1;
+    else
+       inc = 1;
+    TRACE_AND_STEP();
+    if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) {
+       /* dont care whether REPE or REPNE */
+       /* move them until CX is ZERO. */
+       while (M.x86.R_CX != 0) {
+           store_data_byte_abs(M.x86.R_ES, M.x86.R_DI, M.x86.R_AL);
+           M.x86.R_CX -= 1;
+           M.x86.R_DI += inc;
+       }
+       M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
+    } else {
+       store_data_byte_abs(M.x86.R_ES, M.x86.R_DI, M.x86.R_AL);
+       M.x86.R_DI += inc;
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xab
+****************************************************************************/
+void x86emuOp_stos_word(u8 X86EMU_UNUSED(op1))
+{
+    int inc;
+    u32 count;
+
+    START_OF_INSTR();
+    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+       DECODE_PRINTF("STOS\tDWORD\n");
+       if (ACCESS_FLAG(F_DF))   /* down */
+           inc = -4;
+       else
+           inc = 4;
+    } else {
+       DECODE_PRINTF("STOS\tWORD\n");
+       if (ACCESS_FLAG(F_DF))   /* down */
+           inc = -2;
+       else
+           inc = 2;
+    }
+    TRACE_AND_STEP();
+    count = 1;
+    if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) {
+       /* dont care whether REPE or REPNE */
+       /* move them until CX is ZERO. */
+       count = M.x86.R_CX;
+       M.x86.R_CX = 0;
+       M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
+    }
+    while (count--) {
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           store_data_long_abs(M.x86.R_ES, M.x86.R_DI, M.x86.R_EAX);
+       } else {
+           store_data_word_abs(M.x86.R_ES, M.x86.R_DI, M.x86.R_AX);
+       }
+       M.x86.R_DI += inc;
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xac
+****************************************************************************/
+void x86emuOp_lods_byte(u8 X86EMU_UNUSED(op1))
+{
+    int inc;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("LODS\tBYTE\n");
+    TRACE_AND_STEP();
+    if (ACCESS_FLAG(F_DF))   /* down */
+       inc = -1;
+    else
+       inc = 1;
+    if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) {
+       /* dont care whether REPE or REPNE */
+       /* move them until CX is ZERO. */
+       while (M.x86.R_CX != 0) {
+           M.x86.R_AL = fetch_data_byte(M.x86.R_SI);
+           M.x86.R_CX -= 1;
+           M.x86.R_SI += inc;
+       }
+       M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
+    } else {
+       M.x86.R_AL = fetch_data_byte(M.x86.R_SI);
+       M.x86.R_SI += inc;
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xad
+****************************************************************************/
+void x86emuOp_lods_word(u8 X86EMU_UNUSED(op1))
+{
+    int inc;
+    u32 count;
+
+    START_OF_INSTR();
+    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+       DECODE_PRINTF("LODS\tDWORD\n");
+       if (ACCESS_FLAG(F_DF))   /* down */
+           inc = -4;
+       else
+           inc = 4;
+    } else {
+       DECODE_PRINTF("LODS\tWORD\n");
+       if (ACCESS_FLAG(F_DF))   /* down */
+           inc = -2;
+       else
+           inc = 2;
+    }
+    TRACE_AND_STEP();
+    count = 1;
+    if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) {
+       /* dont care whether REPE or REPNE */
+       /* move them until CX is ZERO. */
+       count = M.x86.R_CX;
+       M.x86.R_CX = 0;
+       M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
+    }
+    while (count--) {
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           M.x86.R_EAX = fetch_data_long(M.x86.R_SI);
+       } else {
+           M.x86.R_AX = fetch_data_word(M.x86.R_SI);
+       }
+       M.x86.R_SI += inc;
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xae
+****************************************************************************/
+void x86emuOp_scas_byte(u8 X86EMU_UNUSED(op1))
+{
+    s8 val2;
+    int inc;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("SCAS\tBYTE\n");
+    TRACE_AND_STEP();
+    if (ACCESS_FLAG(F_DF))   /* down */
+       inc = -1;
+    else
+       inc = 1;
+    if (M.x86.mode & SYSMODE_PREFIX_REPE) {
+       /* REPE  */
+       /* move them until CX is ZERO. */
+       while (M.x86.R_CX != 0) {
+           val2 = fetch_data_byte_abs(M.x86.R_ES, M.x86.R_DI);
+           cmp_byte(M.x86.R_AL, val2);
+           M.x86.R_CX -= 1;
+           M.x86.R_DI += inc;
+           if (ACCESS_FLAG(F_ZF) == 0)
+               break;
+       }
+       M.x86.mode &= ~SYSMODE_PREFIX_REPE;
+    } else if (M.x86.mode & SYSMODE_PREFIX_REPNE) {
+       /* REPNE  */
+       /* move them until CX is ZERO. */
+       while (M.x86.R_CX != 0) {
+           val2 = fetch_data_byte_abs(M.x86.R_ES, M.x86.R_DI);
+           cmp_byte(M.x86.R_AL, val2);
+           M.x86.R_CX -= 1;
+           M.x86.R_DI += inc;
+           if (ACCESS_FLAG(F_ZF))
+               break;          /* zero flag set means equal */
+       }
+       M.x86.mode &= ~SYSMODE_PREFIX_REPNE;
+    } else {
+       val2 = fetch_data_byte_abs(M.x86.R_ES, M.x86.R_DI);
+       cmp_byte(M.x86.R_AL, val2);
+       M.x86.R_DI += inc;
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xaf
+****************************************************************************/
+void x86emuOp_scas_word(u8 X86EMU_UNUSED(op1))
+{
+    int inc;
+    u32 val;
+
+    START_OF_INSTR();
+    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+       DECODE_PRINTF("SCAS\tDWORD\n");
+       if (ACCESS_FLAG(F_DF))   /* down */
+           inc = -4;
+       else
+           inc = 4;
+    } else {
+       DECODE_PRINTF("SCAS\tWORD\n");
+       if (ACCESS_FLAG(F_DF))   /* down */
+           inc = -2;
+       else
+           inc = 2;
+    }
+    TRACE_AND_STEP();
+    if (M.x86.mode & SYSMODE_PREFIX_REPE) {
+       /* REPE  */
+       /* move them until CX is ZERO. */
+       while (M.x86.R_CX != 0) {
+           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+               val = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI);
+               cmp_long(M.x86.R_EAX, val);
+           } else {
+               val = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI);
+               cmp_word(M.x86.R_AX, (u16)val);
+           }
+           M.x86.R_CX -= 1;
+           M.x86.R_DI += inc;
+           if (ACCESS_FLAG(F_ZF) == 0)
+               break;
+       }
+       M.x86.mode &= ~SYSMODE_PREFIX_REPE;
+    } else if (M.x86.mode & SYSMODE_PREFIX_REPNE) {
+       /* REPNE  */
+       /* move them until CX is ZERO. */
+       while (M.x86.R_CX != 0) {
+           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+               val = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI);
+               cmp_long(M.x86.R_EAX, val);
+           } else {
+               val = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI);
+               cmp_word(M.x86.R_AX, (u16)val);
+           }
+           M.x86.R_CX -= 1;
+           M.x86.R_DI += inc;
+           if (ACCESS_FLAG(F_ZF))
+               break;          /* zero flag set means equal */
+       }
+       M.x86.mode &= ~SYSMODE_PREFIX_REPNE;
+    } else {
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           val = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI);
+           cmp_long(M.x86.R_EAX, val);
+       } else {
+           val = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI);
+           cmp_word(M.x86.R_AX, (u16)val);
+       }
+       M.x86.R_DI += inc;
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xb0 - 0xb7
+****************************************************************************/
+void x86emuOp_mov_byte_register_IMM(u8 op1)
+{
+    u8 imm, *ptr;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("MOV\t");
+    ptr = DECODE_RM_BYTE_REGISTER(op1 & 0x7);
+    DECODE_PRINTF(",");
+    imm = fetch_byte_imm();
+    DECODE_PRINTF2("%x\n", imm);
+    TRACE_AND_STEP();
+    *ptr = imm;
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xb8 - 0xbf
+****************************************************************************/
+void x86emuOp_mov_word_register_IMM(u8 X86EMU_UNUSED(op1))
+{
+    u32 srcval;
+
+    op1 &= 0x7;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("MOV\t");
+    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+       u32 *reg32;
+       reg32 = DECODE_RM_LONG_REGISTER(op1);
+       srcval = fetch_long_imm();
+       DECODE_PRINTF2(",%x\n", srcval);
+       TRACE_AND_STEP();
+       *reg32 = srcval;
+    } else {
+       u16 *reg16;
+       reg16 = DECODE_RM_WORD_REGISTER(op1);
+       srcval = fetch_word_imm();
+       DECODE_PRINTF2(",%x\n", srcval);
+       TRACE_AND_STEP();
+       *reg16 = (u16)srcval;
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xc0
+****************************************************************************/
+void x86emuOp_opcC0_byte_RM_MEM(u8 X86EMU_UNUSED(op1))
+{
+    int mod, rl, rh;
+    u8 *destreg;
+    uint destoffset;
+    u8 destval;
+    u8 amt;
+
+    /*
+     * Yet another weirdo special case instruction format.  Part of
+     * the opcode held below in "RH".  Doubly nested case would
+     * result, except that the decoded instruction
+     */
+    START_OF_INSTR();
+    FETCH_DECODE_MODRM(mod, rh, rl);
+#ifdef DEBUG
+    if (DEBUG_DECODE()) {
+       /* XXX DECODE_PRINTF may be changed to something more
+          general, so that it is important to leave the strings
+          in the same format, even though the result is that the
+          above test is done twice. */
+
+       switch (rh) {
+       case 0:
+           DECODE_PRINTF("ROL\t");
+           break;
+       case 1:
+           DECODE_PRINTF("ROR\t");
+           break;
+       case 2:
+           DECODE_PRINTF("RCL\t");
+           break;
+       case 3:
+           DECODE_PRINTF("RCR\t");
+           break;
+       case 4:
+           DECODE_PRINTF("SHL\t");
+           break;
+       case 5:
+           DECODE_PRINTF("SHR\t");
+           break;
+       case 6:
+           DECODE_PRINTF("SAL\t");
+           break;
+       case 7:
+           DECODE_PRINTF("SAR\t");
+           break;
+       }
+    }
+#endif
+    /* know operation, decode the mod byte to find the addressing
+       mode. */
+    if (mod < 3) {
+       DECODE_PRINTF("BYTE PTR ");
+       destoffset = decode_rmXX_address(mod, rl);
+       amt = fetch_byte_imm();
+       DECODE_PRINTF2(",%x\n", amt);
+       destval = fetch_data_byte(destoffset);
+       TRACE_AND_STEP();
+       destval = (*opcD0_byte_operation[rh]) (destval, amt);
+       store_data_byte(destoffset, destval);
+    } else {                    /* register to register */
+       destreg = DECODE_RM_BYTE_REGISTER(rl);
+       amt = fetch_byte_imm();
+       DECODE_PRINTF2(",%x\n", amt);
+       TRACE_AND_STEP();
+       destval = (*opcD0_byte_operation[rh]) (*destreg, amt);
+       *destreg = destval;
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xc1
+****************************************************************************/
+void x86emuOp_opcC1_word_RM_MEM(u8 X86EMU_UNUSED(op1))
+{
+    int mod, rl, rh;
+    uint destoffset;
+    u8 amt;
+
+    /*
+     * Yet another weirdo special case instruction format.  Part of
+     * the opcode held below in "RH".  Doubly nested case would
+     * result, except that the decoded instruction
+     */
+    START_OF_INSTR();
+    FETCH_DECODE_MODRM(mod, rh, rl);
+#ifdef DEBUG
+    if (DEBUG_DECODE()) {
+       /* XXX DECODE_PRINTF may be changed to something more
+          general, so that it is important to leave the strings
+          in the same format, even though the result is that the
+          above test is done twice. */
+
+       switch (rh) {
+       case 0:
+           DECODE_PRINTF("ROL\t");
+           break;
+       case 1:
+           DECODE_PRINTF("ROR\t");
+           break;
+       case 2:
+           DECODE_PRINTF("RCL\t");
+           break;
+       case 3:
+           DECODE_PRINTF("RCR\t");
+           break;
+       case 4:
+           DECODE_PRINTF("SHL\t");
+           break;
+       case 5:
+           DECODE_PRINTF("SHR\t");
+           break;
+       case 6:
+           DECODE_PRINTF("SAL\t");
+           break;
+       case 7:
+           DECODE_PRINTF("SAR\t");
+           break;
+       }
+    }
+#endif
+    /* know operation, decode the mod byte to find the addressing
+       mode. */
+    if (mod < 3) {
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 destval;
+
+           DECODE_PRINTF("DWORD PTR ");
+           destoffset = decode_rmXX_address(mod, rl);
+           amt = fetch_byte_imm();
+           DECODE_PRINTF2(",%x\n", amt);
+           destval = fetch_data_long(destoffset);
+           TRACE_AND_STEP();
+           destval = (*opcD1_long_operation[rh]) (destval, amt);
+           store_data_long(destoffset, destval);
+       } else {
+           u16 destval;
+
+           DECODE_PRINTF("WORD PTR ");
+           destoffset = decode_rmXX_address(mod, rl);
+           amt = fetch_byte_imm();
+           DECODE_PRINTF2(",%x\n", amt);
+           destval = fetch_data_word(destoffset);
+           TRACE_AND_STEP();
+           destval = (*opcD1_word_operation[rh]) (destval, amt);
+           store_data_word(destoffset, destval);
+       }
+    } else {                    /* register to register */
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 *destreg;
+
+           destreg = DECODE_RM_LONG_REGISTER(rl);
+           amt = fetch_byte_imm();
+           DECODE_PRINTF2(",%x\n", amt);
+           TRACE_AND_STEP();
+           *destreg = (*opcD1_long_operation[rh]) (*destreg, amt);
+       } else {
+           u16 *destreg;
+
+           destreg = DECODE_RM_WORD_REGISTER(rl);
+           amt = fetch_byte_imm();
+           DECODE_PRINTF2(",%x\n", amt);
+           TRACE_AND_STEP();
+           *destreg = (*opcD1_word_operation[rh]) (*destreg, amt);
+       }
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xc2
+****************************************************************************/
+void x86emuOp_ret_near_IMM(u8 X86EMU_UNUSED(op1))
+{
+    u16 imm;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("RET\t");
+    imm = fetch_word_imm();
+    DECODE_PRINTF2("%x\n", imm);
+       RETURN_TRACE("RET",M.x86.saved_cs,M.x86.saved_ip);
+       TRACE_AND_STEP();
+    M.x86.R_IP = pop_word();
+    M.x86.R_SP += imm;
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xc3
+****************************************************************************/
+void x86emuOp_ret_near(u8 X86EMU_UNUSED(op1))
+{
+    START_OF_INSTR();
+    DECODE_PRINTF("RET\n");
+       RETURN_TRACE("RET",M.x86.saved_cs,M.x86.saved_ip);
+       TRACE_AND_STEP();
+    M.x86.R_IP = pop_word();
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xc4
+****************************************************************************/
+void x86emuOp_les_R_IMM(u8 X86EMU_UNUSED(op1))
+{
+    int mod, rh, rl;
+    u16 *dstreg;
+    uint srcoffset;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("LES\t");
+    FETCH_DECODE_MODRM(mod, rh, rl);
+    if (mod < 3) {
+       dstreg = DECODE_RM_WORD_REGISTER(rh);
+       DECODE_PRINTF(",");
+       srcoffset = decode_rmXX_address(mod, rl);
+       DECODE_PRINTF("\n");
+       TRACE_AND_STEP();
+       *dstreg = fetch_data_word(srcoffset);
+       M.x86.R_ES = fetch_data_word(srcoffset + 2);
+    }
+    /* else UNDEFINED!                  register to register */
+
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xc5
+****************************************************************************/
+void x86emuOp_lds_R_IMM(u8 X86EMU_UNUSED(op1))
+{
+    int mod, rh, rl;
+    u16 *dstreg;
+    uint srcoffset;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("LDS\t");
+    FETCH_DECODE_MODRM(mod, rh, rl);
+    if (mod < 3) {
+       dstreg = DECODE_RM_WORD_REGISTER(rh);
+       DECODE_PRINTF(",");
+       srcoffset = decode_rmXX_address(mod, rl);
+       DECODE_PRINTF("\n");
+       TRACE_AND_STEP();
+       *dstreg = fetch_data_word(srcoffset);
+       M.x86.R_DS = fetch_data_word(srcoffset + 2);
+    }
+    /* else UNDEFINED! */
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xc6
+****************************************************************************/
+void x86emuOp_mov_byte_RM_IMM(u8 X86EMU_UNUSED(op1))
+{
+    int mod, rl, rh;
+    u8 *destreg;
+    uint destoffset;
+    u8 imm;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("MOV\t");
+    FETCH_DECODE_MODRM(mod, rh, rl);
+    if (rh != 0) {
+       DECODE_PRINTF("ILLEGAL DECODE OF OPCODE c6\n");
+       HALT_SYS();
+    }
+    if (mod < 3) {
+       DECODE_PRINTF("BYTE PTR ");
+       destoffset = decode_rmXX_address(mod, rl);
+       imm = fetch_byte_imm();
+       DECODE_PRINTF2(",%2x\n", imm);
+       TRACE_AND_STEP();
+       store_data_byte(destoffset, imm);
+    } else {                    /* register to register */
+       destreg = DECODE_RM_BYTE_REGISTER(rl);
+       imm = fetch_byte_imm();
+       DECODE_PRINTF2(",%2x\n", imm);
+       TRACE_AND_STEP();
+       *destreg = imm;
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xc7
+****************************************************************************/
+void x86emuOp_mov_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+{
+    int mod, rl, rh;
+    uint destoffset;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("MOV\t");
+    FETCH_DECODE_MODRM(mod, rh, rl);
+    if (rh != 0) {
+       DECODE_PRINTF("ILLEGAL DECODE OF OPCODE 8F\n");
+       HALT_SYS();
+    }
+    if (mod < 3) {
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 imm;
+
+           DECODE_PRINTF("DWORD PTR ");
+           destoffset = decode_rmXX_address(mod, rl);
+           imm = fetch_long_imm();
+           DECODE_PRINTF2(",%x\n", imm);
+           TRACE_AND_STEP();
+           store_data_long(destoffset, imm);
+       } else {
+           u16 imm;
+
+           DECODE_PRINTF("WORD PTR ");
+           destoffset = decode_rmXX_address(mod, rl);
+           imm = fetch_word_imm();
+           DECODE_PRINTF2(",%x\n", imm);
+           TRACE_AND_STEP();
+           store_data_word(destoffset, imm);
+       }
+    } else {                    /* register to register */
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+                       u32 *destreg;
+                       u32 imm;
+
+           destreg = DECODE_RM_LONG_REGISTER(rl);
+           imm = fetch_long_imm();
+           DECODE_PRINTF2(",%x\n", imm);
+           TRACE_AND_STEP();
+           *destreg = imm;
+       } else {
+                       u16 *destreg;
+                       u16 imm;
+
+           destreg = DECODE_RM_WORD_REGISTER(rl);
+           imm = fetch_word_imm();
+           DECODE_PRINTF2(",%x\n", imm);
+           TRACE_AND_STEP();
+           *destreg = imm;
+       }
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xc8
+****************************************************************************/
+void x86emuOp_enter(u8 X86EMU_UNUSED(op1))
+{
+    u16 local,frame_pointer;
+    u8 nesting;
+    int i;
+
+    START_OF_INSTR();
+    local = fetch_word_imm();
+    nesting = fetch_byte_imm();
+    DECODE_PRINTF2("ENTER %x\n", local);
+    DECODE_PRINTF2(",%x\n", nesting);
+    TRACE_AND_STEP();
+    push_word(M.x86.R_BP);
+    frame_pointer = M.x86.R_SP;
+    if (nesting > 0) {
+       for (i = 1; i < nesting; i++) {
+           M.x86.R_BP -= 2;
+           push_word(fetch_data_word_abs(M.x86.R_SS, M.x86.R_BP));
+           }
+       push_word(frame_pointer);
+       }
+    M.x86.R_BP = frame_pointer;
+    M.x86.R_SP = (u16)(M.x86.R_SP - local);
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xc9
+****************************************************************************/
+void x86emuOp_leave(u8 X86EMU_UNUSED(op1))
+{
+    START_OF_INSTR();
+    DECODE_PRINTF("LEAVE\n");
+    TRACE_AND_STEP();
+    M.x86.R_SP = M.x86.R_BP;
+    M.x86.R_BP = pop_word();
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xca
+****************************************************************************/
+void x86emuOp_ret_far_IMM(u8 X86EMU_UNUSED(op1))
+{
+    u16 imm;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("RETF\t");
+    imm = fetch_word_imm();
+    DECODE_PRINTF2("%x\n", imm);
+       RETURN_TRACE("RETF",M.x86.saved_cs,M.x86.saved_ip);
+       TRACE_AND_STEP();
+    M.x86.R_IP = pop_word();
+    M.x86.R_CS = pop_word();
+    M.x86.R_SP += imm;
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xcb
+****************************************************************************/
+void x86emuOp_ret_far(u8 X86EMU_UNUSED(op1))
+{
+    START_OF_INSTR();
+    DECODE_PRINTF("RETF\n");
+       RETURN_TRACE("RETF",M.x86.saved_cs,M.x86.saved_ip);
+       TRACE_AND_STEP();
+    M.x86.R_IP = pop_word();
+    M.x86.R_CS = pop_word();
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xcc
+****************************************************************************/
+void x86emuOp_int3(u8 X86EMU_UNUSED(op1))
+{
+    u16 tmp;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("INT 3\n");
+    tmp = (u16) mem_access_word(3 * 4 + 2);
+    /* access the segment register */
+    TRACE_AND_STEP();
+       if (_X86EMU_intrTab[3]) {
+               (*_X86EMU_intrTab[3])(3);
+    } else {
+       push_word((u16)M.x86.R_FLG);
+       CLEAR_FLAG(F_IF);
+       CLEAR_FLAG(F_TF);
+       push_word(M.x86.R_CS);
+       M.x86.R_CS = mem_access_word(3 * 4 + 2);
+       push_word(M.x86.R_IP);
+       M.x86.R_IP = mem_access_word(3 * 4);
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xcd
+****************************************************************************/
+void x86emuOp_int_IMM(u8 X86EMU_UNUSED(op1))
+{
+    u16 tmp;
+    u8 intnum;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("INT\t");
+    intnum = fetch_byte_imm();
+    DECODE_PRINTF2("%x\n", intnum);
+    tmp = mem_access_word(intnum * 4 + 2);
+    TRACE_AND_STEP();
+       if (_X86EMU_intrTab[intnum]) {
+               (*_X86EMU_intrTab[intnum])(intnum);
+    } else {
+       push_word((u16)M.x86.R_FLG);
+       CLEAR_FLAG(F_IF);
+       CLEAR_FLAG(F_TF);
+       push_word(M.x86.R_CS);
+       M.x86.R_CS = mem_access_word(intnum * 4 + 2);
+       push_word(M.x86.R_IP);
+       M.x86.R_IP = mem_access_word(intnum * 4);
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xce
+****************************************************************************/
+void x86emuOp_into(u8 X86EMU_UNUSED(op1))
+{
+    u16 tmp;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("INTO\n");
+    TRACE_AND_STEP();
+    if (ACCESS_FLAG(F_OF)) {
+       tmp = mem_access_word(4 * 4 + 2);
+               if (_X86EMU_intrTab[4]) {
+                       (*_X86EMU_intrTab[4])(4);
+       } else {
+           push_word((u16)M.x86.R_FLG);
+           CLEAR_FLAG(F_IF);
+           CLEAR_FLAG(F_TF);
+           push_word(M.x86.R_CS);
+           M.x86.R_CS = mem_access_word(4 * 4 + 2);
+           push_word(M.x86.R_IP);
+           M.x86.R_IP = mem_access_word(4 * 4);
+       }
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xcf
+****************************************************************************/
+void x86emuOp_iret(u8 X86EMU_UNUSED(op1))
+{
+    START_OF_INSTR();
+    DECODE_PRINTF("IRET\n");
+
+    TRACE_AND_STEP();
+
+    M.x86.R_IP = pop_word();
+    M.x86.R_CS = pop_word();
+    M.x86.R_FLG = pop_word();
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xd0
+****************************************************************************/
+void x86emuOp_opcD0_byte_RM_1(u8 X86EMU_UNUSED(op1))
+{
+    int mod, rl, rh;
+    u8 *destreg;
+    uint destoffset;
+    u8 destval;
+
+    /*
+     * Yet another weirdo special case instruction format.  Part of
+     * the opcode held below in "RH".  Doubly nested case would
+     * result, except that the decoded instruction
+     */
+    START_OF_INSTR();
+    FETCH_DECODE_MODRM(mod, rh, rl);
+#ifdef DEBUG
+    if (DEBUG_DECODE()) {
+       /* XXX DECODE_PRINTF may be changed to something more
+          general, so that it is important to leave the strings
+          in the same format, even though the result is that the
+          above test is done twice. */
+       switch (rh) {
+       case 0:
+           DECODE_PRINTF("ROL\t");
+           break;
+       case 1:
+           DECODE_PRINTF("ROR\t");
+           break;
+       case 2:
+           DECODE_PRINTF("RCL\t");
+           break;
+       case 3:
+           DECODE_PRINTF("RCR\t");
+           break;
+       case 4:
+           DECODE_PRINTF("SHL\t");
+           break;
+       case 5:
+           DECODE_PRINTF("SHR\t");
+           break;
+       case 6:
+           DECODE_PRINTF("SAL\t");
+           break;
+       case 7:
+           DECODE_PRINTF("SAR\t");
+           break;
+       }
+    }
+#endif
+    /* know operation, decode the mod byte to find the addressing
+       mode. */
+    if (mod < 3) {
+       DECODE_PRINTF("BYTE PTR ");
+       destoffset = decode_rmXX_address(mod, rl);
+       DECODE_PRINTF(",1\n");
+       destval = fetch_data_byte(destoffset);
+       TRACE_AND_STEP();
+       destval = (*opcD0_byte_operation[rh]) (destval, 1);
+       store_data_byte(destoffset, destval);
+    } else {                    /* register to register */
+       destreg = DECODE_RM_BYTE_REGISTER(rl);
+       DECODE_PRINTF(",1\n");
+       TRACE_AND_STEP();
+       destval = (*opcD0_byte_operation[rh]) (*destreg, 1);
+       *destreg = destval;
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xd1
+****************************************************************************/
+void x86emuOp_opcD1_word_RM_1(u8 X86EMU_UNUSED(op1))
+{
+    int mod, rl, rh;
+    uint destoffset;
+
+    /*
+     * Yet another weirdo special case instruction format.  Part of
+     * the opcode held below in "RH".  Doubly nested case would
+     * result, except that the decoded instruction
+     */
+    START_OF_INSTR();
+    FETCH_DECODE_MODRM(mod, rh, rl);
+#ifdef DEBUG
+    if (DEBUG_DECODE()) {
+       /* XXX DECODE_PRINTF may be changed to something more
+          general, so that it is important to leave the strings
+          in the same format, even though the result is that the
+          above test is done twice. */
+       switch (rh) {
+       case 0:
+           DECODE_PRINTF("ROL\t");
+           break;
+       case 1:
+           DECODE_PRINTF("ROR\t");
+           break;
+       case 2:
+           DECODE_PRINTF("RCL\t");
+           break;
+       case 3:
+           DECODE_PRINTF("RCR\t");
+           break;
+       case 4:
+           DECODE_PRINTF("SHL\t");
+           break;
+       case 5:
+           DECODE_PRINTF("SHR\t");
+           break;
+       case 6:
+           DECODE_PRINTF("SAL\t");
+           break;
+       case 7:
+           DECODE_PRINTF("SAR\t");
+           break;
+       }
+    }
+#endif
+    /* know operation, decode the mod byte to find the addressing
+       mode. */
+    if (mod < 3) {
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 destval;
+
+           DECODE_PRINTF("DWORD PTR ");
+           destoffset = decode_rmXX_address(mod, rl);
+           DECODE_PRINTF(",1\n");
+           destval = fetch_data_long(destoffset);
+           TRACE_AND_STEP();
+           destval = (*opcD1_long_operation[rh]) (destval, 1);
+           store_data_long(destoffset, destval);
+       } else {
+           u16 destval;
+
+           DECODE_PRINTF("WORD PTR ");
+           destoffset = decode_rmXX_address(mod, rl);
+           DECODE_PRINTF(",1\n");
+           destval = fetch_data_word(destoffset);
+           TRACE_AND_STEP();
+           destval = (*opcD1_word_operation[rh]) (destval, 1);
+           store_data_word(destoffset, destval);
+       }
+    } else {                    /* register to register */
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+                       u32 destval;
+                       u32 *destreg;
+
+           destreg = DECODE_RM_LONG_REGISTER(rl);
+           DECODE_PRINTF(",1\n");
+           TRACE_AND_STEP();
+           destval = (*opcD1_long_operation[rh]) (*destreg, 1);
+           *destreg = destval;
+       } else {
+                       u16 destval;
+                       u16 *destreg;
+
+           destreg = DECODE_RM_WORD_REGISTER(rl);
+           DECODE_PRINTF(",1\n");
+           TRACE_AND_STEP();
+           destval = (*opcD1_word_operation[rh]) (*destreg, 1);
+           *destreg = destval;
+       }
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xd2
+****************************************************************************/
+void x86emuOp_opcD2_byte_RM_CL(u8 X86EMU_UNUSED(op1))
+{
+    int mod, rl, rh;
+    u8 *destreg;
+    uint destoffset;
+    u8 destval;
+    u8 amt;
+
+    /*
+     * Yet another weirdo special case instruction format.  Part of
+     * the opcode held below in "RH".  Doubly nested case would
+     * result, except that the decoded instruction
+     */
+    START_OF_INSTR();
+    FETCH_DECODE_MODRM(mod, rh, rl);
+#ifdef DEBUG
+    if (DEBUG_DECODE()) {
+       /* XXX DECODE_PRINTF may be changed to something more
+          general, so that it is important to leave the strings
+          in the same format, even though the result is that the
+          above test is done twice. */
+       switch (rh) {
+       case 0:
+           DECODE_PRINTF("ROL\t");
+           break;
+       case 1:
+           DECODE_PRINTF("ROR\t");
+           break;
+       case 2:
+           DECODE_PRINTF("RCL\t");
+           break;
+       case 3:
+           DECODE_PRINTF("RCR\t");
+           break;
+       case 4:
+           DECODE_PRINTF("SHL\t");
+           break;
+       case 5:
+           DECODE_PRINTF("SHR\t");
+           break;
+       case 6:
+           DECODE_PRINTF("SAL\t");
+           break;
+       case 7:
+           DECODE_PRINTF("SAR\t");
+           break;
+       }
+    }
+#endif
+    /* know operation, decode the mod byte to find the addressing
+       mode. */
+    amt = M.x86.R_CL;
+    if (mod < 3) {
+       DECODE_PRINTF("BYTE PTR ");
+       destoffset = decode_rmXX_address(mod, rl);
+       DECODE_PRINTF(",CL\n");
+       destval = fetch_data_byte(destoffset);
+       TRACE_AND_STEP();
+       destval = (*opcD0_byte_operation[rh]) (destval, amt);
+       store_data_byte(destoffset, destval);
+    } else {                    /* register to register */
+       destreg = DECODE_RM_BYTE_REGISTER(rl);
+       DECODE_PRINTF(",CL\n");
+       TRACE_AND_STEP();
+       destval = (*opcD0_byte_operation[rh]) (*destreg, amt);
+       *destreg = destval;
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xd3
+****************************************************************************/
+void x86emuOp_opcD3_word_RM_CL(u8 X86EMU_UNUSED(op1))
+{
+    int mod, rl, rh;
+    uint destoffset;
+    u8 amt;
+
+    /*
+     * Yet another weirdo special case instruction format.  Part of
+     * the opcode held below in "RH".  Doubly nested case would
+     * result, except that the decoded instruction
+     */
+    START_OF_INSTR();
+    FETCH_DECODE_MODRM(mod, rh, rl);
+#ifdef DEBUG
+    if (DEBUG_DECODE()) {
+       /* XXX DECODE_PRINTF may be changed to something more
+          general, so that it is important to leave the strings
+          in the same format, even though the result is that the
+          above test is done twice. */
+       switch (rh) {
+       case 0:
+           DECODE_PRINTF("ROL\t");
+           break;
+       case 1:
+           DECODE_PRINTF("ROR\t");
+           break;
+       case 2:
+           DECODE_PRINTF("RCL\t");
+           break;
+       case 3:
+           DECODE_PRINTF("RCR\t");
+           break;
+       case 4:
+           DECODE_PRINTF("SHL\t");
+           break;
+       case 5:
+           DECODE_PRINTF("SHR\t");
+           break;
+       case 6:
+           DECODE_PRINTF("SAL\t");
+           break;
+       case 7:
+           DECODE_PRINTF("SAR\t");
+           break;
+       }
+    }
+#endif
+    /* know operation, decode the mod byte to find the addressing
+       mode. */
+    amt = M.x86.R_CL;
+    if (mod < 3) {
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 destval;
+
+           DECODE_PRINTF("DWORD PTR ");
+           destoffset = decode_rmXX_address(mod, rl);
+           DECODE_PRINTF(",CL\n");
+           destval = fetch_data_long(destoffset);
+           TRACE_AND_STEP();
+           destval = (*opcD1_long_operation[rh]) (destval, amt);
+           store_data_long(destoffset, destval);
+       } else {
+           u16 destval;
+
+           DECODE_PRINTF("WORD PTR ");
+           destoffset = decode_rmXX_address(mod, rl);
+           DECODE_PRINTF(",CL\n");
+           destval = fetch_data_word(destoffset);
+           TRACE_AND_STEP();
+           destval = (*opcD1_word_operation[rh]) (destval, amt);
+           store_data_word(destoffset, destval);
+       }
+    } else {                    /* register to register */
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 *destreg;
+
+           destreg = DECODE_RM_LONG_REGISTER(rl);
+           DECODE_PRINTF(",CL\n");
+           TRACE_AND_STEP();
+           *destreg = (*opcD1_long_operation[rh]) (*destreg, amt);
+       } else {
+           u16 *destreg;
+
+           destreg = DECODE_RM_WORD_REGISTER(rl);
+           DECODE_PRINTF(",CL\n");
+           TRACE_AND_STEP();
+           *destreg = (*opcD1_word_operation[rh]) (*destreg, amt);
+       }
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xd4
+****************************************************************************/
+void x86emuOp_aam(u8 X86EMU_UNUSED(op1))
+{
+    u8 a;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("AAM\n");
+    a = fetch_byte_imm();      /* this is a stupid encoding. */
+    if (a != 10) {
+       DECODE_PRINTF("ERROR DECODING AAM\n");
+       TRACE_REGS();
+       HALT_SYS();
+    }
+    TRACE_AND_STEP();
+    /* note the type change here --- returning AL and AH in AX. */
+    M.x86.R_AX = aam_word(M.x86.R_AL);
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xd5
+****************************************************************************/
+void x86emuOp_aad(u8 X86EMU_UNUSED(op1))
+{
+    u8 a;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("AAD\n");
+    a = fetch_byte_imm();
+    TRACE_AND_STEP();
+    M.x86.R_AX = aad_word(M.x86.R_AX);
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/* opcode 0xd6 ILLEGAL OPCODE */
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xd7
+****************************************************************************/
+void x86emuOp_xlat(u8 X86EMU_UNUSED(op1))
+{
+    u16 addr;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("XLAT\n");
+    TRACE_AND_STEP();
+       addr = (u16)(M.x86.R_BX + (u8)M.x86.R_AL);
+    M.x86.R_AL = fetch_data_byte(addr);
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/* instuctions D8 .. DF are in i87_ops.c */
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xe0
+****************************************************************************/
+void x86emuOp_loopne(u8 X86EMU_UNUSED(op1))
+{
+    s16 ip;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("LOOPNE\t");
+    ip = (s8) fetch_byte_imm();
+    ip += (s16) M.x86.R_IP;
+    DECODE_PRINTF2("%04x\n", ip);
+    TRACE_AND_STEP();
+    M.x86.R_CX -= 1;
+    if (M.x86.R_CX != 0 && !ACCESS_FLAG(F_ZF))     /* CX != 0 and !ZF */
+       M.x86.R_IP = ip;
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xe1
+****************************************************************************/
+void x86emuOp_loope(u8 X86EMU_UNUSED(op1))
+{
+    s16 ip;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("LOOPE\t");
+    ip = (s8) fetch_byte_imm();
+    ip += (s16) M.x86.R_IP;
+    DECODE_PRINTF2("%04x\n", ip);
+    TRACE_AND_STEP();
+    M.x86.R_CX -= 1;
+    if (M.x86.R_CX != 0 && ACCESS_FLAG(F_ZF))      /* CX != 0 and ZF */
+       M.x86.R_IP = ip;
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xe2
+****************************************************************************/
+void x86emuOp_loop(u8 X86EMU_UNUSED(op1))
+{
+    s16 ip;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("LOOP\t");
+    ip = (s8) fetch_byte_imm();
+    ip += (s16) M.x86.R_IP;
+    DECODE_PRINTF2("%04x\n", ip);
+    TRACE_AND_STEP();
+    M.x86.R_CX -= 1;
+    if (M.x86.R_CX != 0)
+       M.x86.R_IP = ip;
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xe3
+****************************************************************************/
+void x86emuOp_jcxz(u8 X86EMU_UNUSED(op1))
+{
+    u16 target;
+    s8 offset;
+
+    /* jump to byte offset if overflow flag is set */
+    START_OF_INSTR();
+    DECODE_PRINTF("JCXZ\t");
+    offset = (s8)fetch_byte_imm();
+    target = (u16)(M.x86.R_IP + offset);
+    DECODE_PRINTF2("%x\n", target);
+    TRACE_AND_STEP();
+    if (M.x86.R_CX == 0)
+       M.x86.R_IP = target;
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xe4
+****************************************************************************/
+void x86emuOp_in_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+{
+    u8 port;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("IN\t");
+       port = (u8) fetch_byte_imm();
+    DECODE_PRINTF2("%x,AL\n", port);
+    TRACE_AND_STEP();
+    M.x86.R_AL = (*sys_inb)(port);
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xe5
+****************************************************************************/
+void x86emuOp_in_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+{
+    u8 port;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("IN\t");
+       port = (u8) fetch_byte_imm();
+    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+       DECODE_PRINTF2("EAX,%x\n", port);
+    } else {
+       DECODE_PRINTF2("AX,%x\n", port);
+    }
+    TRACE_AND_STEP();
+    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+       M.x86.R_EAX = (*sys_inl)(port);
+    } else {
+       M.x86.R_AX = (*sys_inw)(port);
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xe6
+****************************************************************************/
+void x86emuOp_out_byte_IMM_AL(u8 X86EMU_UNUSED(op1))
+{
+    u8 port;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("OUT\t");
+       port = (u8) fetch_byte_imm();
+    DECODE_PRINTF2("%x,AL\n", port);
+    TRACE_AND_STEP();
+    (*sys_outb)(port, M.x86.R_AL);
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xe7
+****************************************************************************/
+void x86emuOp_out_word_IMM_AX(u8 X86EMU_UNUSED(op1))
+{
+    u8 port;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("OUT\t");
+       port = (u8) fetch_byte_imm();
+    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+       DECODE_PRINTF2("%x,EAX\n", port);
+    } else {
+       DECODE_PRINTF2("%x,AX\n", port);
+    }
+    TRACE_AND_STEP();
+    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+       (*sys_outl)(port, M.x86.R_EAX);
+    } else {
+       (*sys_outw)(port, M.x86.R_AX);
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xe8
+****************************************************************************/
+void x86emuOp_call_near_IMM(u8 X86EMU_UNUSED(op1))
+{
+    s16 ip;
+
+    START_OF_INSTR();
+       DECODE_PRINTF("CALL\t");
+       ip = (s16) fetch_word_imm();
+       ip += (s16) M.x86.R_IP;    /* CHECK SIGN */
+       DECODE_PRINTF2("%04x\n", ip);
+       CALL_TRACE(M.x86.saved_cs, M.x86.saved_ip, M.x86.R_CS, ip, "");
+    TRACE_AND_STEP();
+    push_word(M.x86.R_IP);
+    M.x86.R_IP = ip;
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xe9
+****************************************************************************/
+void x86emuOp_jump_near_IMM(u8 X86EMU_UNUSED(op1))
+{
+    int ip;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("JMP\t");
+    ip = (s16)fetch_word_imm();
+    ip += (s16)M.x86.R_IP;
+    DECODE_PRINTF2("%04x\n", ip);
+    TRACE_AND_STEP();
+    M.x86.R_IP = (u16)ip;
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xea
+****************************************************************************/
+void x86emuOp_jump_far_IMM(u8 X86EMU_UNUSED(op1))
+{
+    u16 cs, ip;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("JMP\tFAR ");
+    ip = fetch_word_imm();
+    cs = fetch_word_imm();
+    DECODE_PRINTF2("%04x:", cs);
+    DECODE_PRINTF2("%04x\n", ip);
+    TRACE_AND_STEP();
+    M.x86.R_IP = ip;
+    M.x86.R_CS = cs;
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xeb
+****************************************************************************/
+void x86emuOp_jump_byte_IMM(u8 X86EMU_UNUSED(op1))
+{
+    u16 target;
+    s8 offset;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("JMP\t");
+    offset = (s8)fetch_byte_imm();
+    target = (u16)(M.x86.R_IP + offset);
+    DECODE_PRINTF2("%x\n", target);
+    TRACE_AND_STEP();
+    M.x86.R_IP = target;
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xec
+****************************************************************************/
+void x86emuOp_in_byte_AL_DX(u8 X86EMU_UNUSED(op1))
+{
+    START_OF_INSTR();
+    DECODE_PRINTF("IN\tAL,DX\n");
+    TRACE_AND_STEP();
+    M.x86.R_AL = (*sys_inb)(M.x86.R_DX);
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xed
+****************************************************************************/
+void x86emuOp_in_word_AX_DX(u8 X86EMU_UNUSED(op1))
+{
+    START_OF_INSTR();
+    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+       DECODE_PRINTF("IN\tEAX,DX\n");
+    } else {
+       DECODE_PRINTF("IN\tAX,DX\n");
+    }
+    TRACE_AND_STEP();
+    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+       M.x86.R_EAX = (*sys_inl)(M.x86.R_DX);
+    } else {
+       M.x86.R_AX = (*sys_inw)(M.x86.R_DX);
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xee
+****************************************************************************/
+void x86emuOp_out_byte_DX_AL(u8 X86EMU_UNUSED(op1))
+{
+    START_OF_INSTR();
+    DECODE_PRINTF("OUT\tDX,AL\n");
+    TRACE_AND_STEP();
+    (*sys_outb)(M.x86.R_DX, M.x86.R_AL);
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xef
+****************************************************************************/
+void x86emuOp_out_word_DX_AX(u8 X86EMU_UNUSED(op1))
+{
+    START_OF_INSTR();
+    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+       DECODE_PRINTF("OUT\tDX,EAX\n");
+    } else {
+       DECODE_PRINTF("OUT\tDX,AX\n");
+    }
+    TRACE_AND_STEP();
+    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+       (*sys_outl)(M.x86.R_DX, M.x86.R_EAX);
+    } else {
+       (*sys_outw)(M.x86.R_DX, M.x86.R_AX);
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xf0
+****************************************************************************/
+void x86emuOp_lock(u8 X86EMU_UNUSED(op1))
+{
+    START_OF_INSTR();
+    DECODE_PRINTF("LOCK:\n");
+    TRACE_AND_STEP();
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/*opcode 0xf1 ILLEGAL OPERATION */
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xf2
+****************************************************************************/
+void x86emuOp_repne(u8 X86EMU_UNUSED(op1))
+{
+    START_OF_INSTR();
+    DECODE_PRINTF("REPNE\n");
+    TRACE_AND_STEP();
+    M.x86.mode |= SYSMODE_PREFIX_REPNE;
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xf3
+****************************************************************************/
+void x86emuOp_repe(u8 X86EMU_UNUSED(op1))
+{
+    START_OF_INSTR();
+    DECODE_PRINTF("REPE\n");
+    TRACE_AND_STEP();
+    M.x86.mode |= SYSMODE_PREFIX_REPE;
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xf4
+****************************************************************************/
+void x86emuOp_halt(u8 X86EMU_UNUSED(op1))
+{
+    START_OF_INSTR();
+    DECODE_PRINTF("HALT\n");
+    TRACE_AND_STEP();
+    HALT_SYS();
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xf5
+****************************************************************************/
+void x86emuOp_cmc(u8 X86EMU_UNUSED(op1))
+{
+    /* complement the carry flag. */
+    START_OF_INSTR();
+    DECODE_PRINTF("CMC\n");
+    TRACE_AND_STEP();
+    TOGGLE_FLAG(F_CF);
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xf6
+****************************************************************************/
+void x86emuOp_opcF6_byte_RM(u8 X86EMU_UNUSED(op1))
+{
+    int mod, rl, rh;
+    u8 *destreg;
+    uint destoffset;
+    u8 destval, srcval;
+
+    /* long, drawn out code follows.  Double switch for a total
+       of 32 cases.  */
+    START_OF_INSTR();
+    FETCH_DECODE_MODRM(mod, rh, rl);
+    DECODE_PRINTF(opF6_names[rh]);
+    if (mod < 3) {
+       DECODE_PRINTF("BYTE PTR ");
+       destoffset = decode_rmXX_address(mod, rl);
+       destval = fetch_data_byte(destoffset);
+
+       switch (rh) {
+       case 0:         /* test byte imm */
+           DECODE_PRINTF(",");
+           srcval = fetch_byte_imm();
+           DECODE_PRINTF2("%02x\n", srcval);
+           TRACE_AND_STEP();
+           test_byte(destval, srcval);
+           break;
+       case 1:
+           DECODE_PRINTF("ILLEGAL OP MOD=00 RH=01 OP=F6\n");
+           HALT_SYS();
+           break;
+       case 2:
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           destval = not_byte(destval);
+           store_data_byte(destoffset, destval);
+           break;
+       case 3:
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           destval = neg_byte(destval);
+           store_data_byte(destoffset, destval);
+           break;
+       case 4:
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           mul_byte(destval);
+           break;
+       case 5:
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           imul_byte(destval);
+           break;
+       case 6:
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           div_byte(destval);
+           break;
+       default:
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           idiv_byte(destval);
+           break;
+       }
+    } else {                    /* mod=11 */
+       destreg = DECODE_RM_BYTE_REGISTER(rl);
+       switch (rh) {
+       case 0:         /* test byte imm */
+           DECODE_PRINTF(",");
+           srcval = fetch_byte_imm();
+           DECODE_PRINTF2("%02x\n", srcval);
+           TRACE_AND_STEP();
+           test_byte(*destreg, srcval);
+           break;
+       case 1:
+           DECODE_PRINTF("ILLEGAL OP MOD=00 RH=01 OP=F6\n");
+           HALT_SYS();
+           break;
+       case 2:
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           *destreg = not_byte(*destreg);
+           break;
+       case 3:
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           *destreg = neg_byte(*destreg);
+           break;
+       case 4:
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           mul_byte(*destreg);      /*!!!  */
+           break;
+       case 5:
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           imul_byte(*destreg);
+           break;
+       case 6:
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           div_byte(*destreg);
+           break;
+       default:
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           idiv_byte(*destreg);
+           break;
+       }
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xf7
+****************************************************************************/
+void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+{
+    int mod, rl, rh;
+    uint destoffset;
+
+    START_OF_INSTR();
+    FETCH_DECODE_MODRM(mod, rh, rl);
+    DECODE_PRINTF(opF6_names[rh]);
+    if (mod < 3) {
+
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 destval, srcval;
+
+           DECODE_PRINTF("DWORD PTR ");
+           destoffset = decode_rmXX_address(mod, rl);
+           destval = fetch_data_long(destoffset);
+
+           switch (rh) {
+           case 0:
+               DECODE_PRINTF(",");
+               srcval = fetch_long_imm();
+               DECODE_PRINTF2("%x\n", srcval);
+               TRACE_AND_STEP();
+               test_long(destval, srcval);
+               break;
+           case 1:
+               DECODE_PRINTF("ILLEGAL OP MOD=00 RH=01 OP=F7\n");
+               HALT_SYS();
+               break;
+           case 2:
+               DECODE_PRINTF("\n");
+               TRACE_AND_STEP();
+               destval = not_long(destval);
+               store_data_long(destoffset, destval);
+               break;
+           case 3:
+               DECODE_PRINTF("\n");
+               TRACE_AND_STEP();
+               destval = neg_long(destval);
+               store_data_long(destoffset, destval);
+               break;
+           case 4:
+               DECODE_PRINTF("\n");
+               TRACE_AND_STEP();
+               mul_long(destval);
+               break;
+           case 5:
+               DECODE_PRINTF("\n");
+               TRACE_AND_STEP();
+               imul_long(destval);
+               break;
+           case 6:
+               DECODE_PRINTF("\n");
+               TRACE_AND_STEP();
+               div_long(destval);
+               break;
+           case 7:
+               DECODE_PRINTF("\n");
+               TRACE_AND_STEP();
+               idiv_long(destval);
+               break;
+           }
+       } else {
+           u16 destval, srcval;
+
+           DECODE_PRINTF("WORD PTR ");
+           destoffset = decode_rmXX_address(mod, rl);
+           destval = fetch_data_word(destoffset);
+
+           switch (rh) {
+           case 0:         /* test word imm */
+               DECODE_PRINTF(",");
+               srcval = fetch_word_imm();
+               DECODE_PRINTF2("%x\n", srcval);
+               TRACE_AND_STEP();
+               test_word(destval, srcval);
+               break;
+           case 1:
+               DECODE_PRINTF("ILLEGAL OP MOD=00 RH=01 OP=F7\n");
+               HALT_SYS();
+               break;
+           case 2:
+               DECODE_PRINTF("\n");
+               TRACE_AND_STEP();
+               destval = not_word(destval);
+               store_data_word(destoffset, destval);
+               break;
+           case 3:
+               DECODE_PRINTF("\n");
+               TRACE_AND_STEP();
+               destval = neg_word(destval);
+               store_data_word(destoffset, destval);
+               break;
+           case 4:
+               DECODE_PRINTF("\n");
+               TRACE_AND_STEP();
+               mul_word(destval);
+               break;
+           case 5:
+               DECODE_PRINTF("\n");
+               TRACE_AND_STEP();
+               imul_word(destval);
+               break;
+           case 6:
+               DECODE_PRINTF("\n");
+               TRACE_AND_STEP();
+               div_word(destval);
+               break;
+           case 7:
+               DECODE_PRINTF("\n");
+               TRACE_AND_STEP();
+               idiv_word(destval);
+               break;
+           }
+       }
+
+    } else {                    /* mod=11 */
+
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 *destreg;
+           u32 srcval;
+
+           destreg = DECODE_RM_LONG_REGISTER(rl);
+
+           switch (rh) {
+           case 0:         /* test word imm */
+               DECODE_PRINTF(",");
+               srcval = fetch_long_imm();
+               DECODE_PRINTF2("%x\n", srcval);
+               TRACE_AND_STEP();
+               test_long(*destreg, srcval);
+               break;
+           case 1:
+               DECODE_PRINTF("ILLEGAL OP MOD=00 RH=01 OP=F6\n");
+               HALT_SYS();
+               break;
+           case 2:
+               DECODE_PRINTF("\n");
+               TRACE_AND_STEP();
+               *destreg = not_long(*destreg);
+               break;
+           case 3:
+               DECODE_PRINTF("\n");
+               TRACE_AND_STEP();
+               *destreg = neg_long(*destreg);
+               break;
+           case 4:
+               DECODE_PRINTF("\n");
+               TRACE_AND_STEP();
+               mul_long(*destreg);      /*!!!  */
+               break;
+           case 5:
+               DECODE_PRINTF("\n");
+               TRACE_AND_STEP();
+               imul_long(*destreg);
+               break;
+           case 6:
+               DECODE_PRINTF("\n");
+               TRACE_AND_STEP();
+               div_long(*destreg);
+               break;
+           case 7:
+               DECODE_PRINTF("\n");
+               TRACE_AND_STEP();
+               idiv_long(*destreg);
+               break;
+           }
+       } else {
+           u16 *destreg;
+           u16 srcval;
+
+           destreg = DECODE_RM_WORD_REGISTER(rl);
+
+           switch (rh) {
+           case 0:         /* test word imm */
+               DECODE_PRINTF(",");
+               srcval = fetch_word_imm();
+               DECODE_PRINTF2("%x\n", srcval);
+               TRACE_AND_STEP();
+               test_word(*destreg, srcval);
+               break;
+           case 1:
+               DECODE_PRINTF("ILLEGAL OP MOD=00 RH=01 OP=F6\n");
+               HALT_SYS();
+               break;
+           case 2:
+               DECODE_PRINTF("\n");
+               TRACE_AND_STEP();
+               *destreg = not_word(*destreg);
+               break;
+           case 3:
+               DECODE_PRINTF("\n");
+               TRACE_AND_STEP();
+               *destreg = neg_word(*destreg);
+               break;
+           case 4:
+               DECODE_PRINTF("\n");
+               TRACE_AND_STEP();
+               mul_word(*destreg);      /*!!!  */
+               break;
+           case 5:
+               DECODE_PRINTF("\n");
+               TRACE_AND_STEP();
+               imul_word(*destreg);
+               break;
+           case 6:
+               DECODE_PRINTF("\n");
+               TRACE_AND_STEP();
+               div_word(*destreg);
+               break;
+           case 7:
+               DECODE_PRINTF("\n");
+               TRACE_AND_STEP();
+               idiv_word(*destreg);
+               break;
+           }
+       }
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xf8
+****************************************************************************/
+void x86emuOp_clc(u8 X86EMU_UNUSED(op1))
+{
+    /* clear the carry flag. */
+    START_OF_INSTR();
+    DECODE_PRINTF("CLC\n");
+    TRACE_AND_STEP();
+    CLEAR_FLAG(F_CF);
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xf9
+****************************************************************************/
+void x86emuOp_stc(u8 X86EMU_UNUSED(op1))
+{
+    /* set the carry flag. */
+    START_OF_INSTR();
+    DECODE_PRINTF("STC\n");
+    TRACE_AND_STEP();
+    SET_FLAG(F_CF);
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xfa
+****************************************************************************/
+void x86emuOp_cli(u8 X86EMU_UNUSED(op1))
+{
+    /* clear interrupts. */
+    START_OF_INSTR();
+    DECODE_PRINTF("CLI\n");
+    TRACE_AND_STEP();
+    CLEAR_FLAG(F_IF);
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xfb
+****************************************************************************/
+void x86emuOp_sti(u8 X86EMU_UNUSED(op1))
+{
+    /* enable  interrupts. */
+    START_OF_INSTR();
+    DECODE_PRINTF("STI\n");
+    TRACE_AND_STEP();
+    SET_FLAG(F_IF);
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xfc
+****************************************************************************/
+void x86emuOp_cld(u8 X86EMU_UNUSED(op1))
+{
+    /* clear interrupts. */
+    START_OF_INSTR();
+    DECODE_PRINTF("CLD\n");
+    TRACE_AND_STEP();
+    CLEAR_FLAG(F_DF);
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xfd
+****************************************************************************/
+void x86emuOp_std(u8 X86EMU_UNUSED(op1))
+{
+    /* clear interrupts. */
+    START_OF_INSTR();
+    DECODE_PRINTF("STD\n");
+    TRACE_AND_STEP();
+    SET_FLAG(F_DF);
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xfe
+****************************************************************************/
+void x86emuOp_opcFE_byte_RM(u8 X86EMU_UNUSED(op1))
+{
+    int mod, rh, rl;
+    u8 destval;
+    uint destoffset;
+    u8 *destreg;
+
+    /* Yet another special case instruction. */
+    START_OF_INSTR();
+    FETCH_DECODE_MODRM(mod, rh, rl);
+#ifdef DEBUG
+    if (DEBUG_DECODE()) {
+       /* XXX DECODE_PRINTF may be changed to something more
+          general, so that it is important to leave the strings
+          in the same format, even though the result is that the
+          above test is done twice. */
+
+       switch (rh) {
+       case 0:
+           DECODE_PRINTF("INC\t");
+           break;
+       case 1:
+           DECODE_PRINTF("DEC\t");
+           break;
+       case 2:
+       case 3:
+       case 4:
+       case 5:
+       case 6:
+       case 7:
+           DECODE_PRINTF2("ILLEGAL OP MAJOR OP 0xFE MINOR OP %x \n", mod);
+           HALT_SYS();
+           break;
+       }
+    }
+#endif
+    if (mod < 3) {
+       DECODE_PRINTF("BYTE PTR ");
+       destoffset = decode_rmXX_address(mod, rl);
+       DECODE_PRINTF("\n");
+       destval = fetch_data_byte(destoffset);
+       TRACE_AND_STEP();
+       if (rh == 0)
+         destval = inc_byte(destval);
+       else
+         destval = dec_byte(destval);
+       store_data_byte(destoffset, destval);
+    } else {
+       destreg = DECODE_RM_BYTE_REGISTER(rl);
+       DECODE_PRINTF("\n");
+       TRACE_AND_STEP();
+       if (rh == 0)
+         *destreg = inc_byte(*destreg);
+       else
+         *destreg = dec_byte(*destreg);
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xff
+****************************************************************************/
+void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
+{
+    int mod, rh, rl;
+    uint destoffset = 0;
+       u16 *destreg;
+       u16 destval,destval2;
+
+    /* Yet another special case instruction. */
+    START_OF_INSTR();
+    FETCH_DECODE_MODRM(mod, rh, rl);
+#ifdef DEBUG
+    if (DEBUG_DECODE()) {
+       /* XXX DECODE_PRINTF may be changed to something more
+          general, so that it is important to leave the strings
+          in the same format, even though the result is that the
+          above test is done twice. */
+
+       switch (rh) {
+       case 0:
+           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+               DECODE_PRINTF("INC\tDWORD PTR ");
+           } else {
+               DECODE_PRINTF("INC\tWORD PTR ");
+           }
+           break;
+       case 1:
+           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+               DECODE_PRINTF("DEC\tDWORD PTR ");
+           } else {
+               DECODE_PRINTF("DEC\tWORD PTR ");
+           }
+           break;
+       case 2:
+           DECODE_PRINTF("CALL\t ");
+           break;
+       case 3:
+           DECODE_PRINTF("CALL\tFAR ");
+           break;
+       case 4:
+           DECODE_PRINTF("JMP\t");
+           break;
+       case 5:
+           DECODE_PRINTF("JMP\tFAR ");
+           break;
+       case 6:
+           DECODE_PRINTF("PUSH\t");
+           break;
+       case 7:
+           DECODE_PRINTF("ILLEGAL DECODING OF OPCODE FF\t");
+           HALT_SYS();
+           break;
+       }
+    }
+#endif
+    if (mod < 3) {
+       destoffset = decode_rmXX_address(mod, rl);
+       DECODE_PRINTF("\n");
+       switch (rh) {
+       case 0:         /* inc word ptr ... */
+           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+               u32 destval;
+
+               destval = fetch_data_long(destoffset);
+               TRACE_AND_STEP();
+               destval = inc_long(destval);
+               store_data_long(destoffset, destval);
+           } else {
+               u16 destval;
+
+               destval = fetch_data_word(destoffset);
+               TRACE_AND_STEP();
+               destval = inc_word(destval);
+               store_data_word(destoffset, destval);
+           }
+           break;
+       case 1:         /* dec word ptr ... */
+           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+               u32 destval;
+
+               destval = fetch_data_long(destoffset);
+               TRACE_AND_STEP();
+               destval = dec_long(destval);
+               store_data_long(destoffset, destval);
+           } else {
+               u16 destval;
+
+               destval = fetch_data_word(destoffset);
+               TRACE_AND_STEP();
+               destval = dec_word(destval);
+               store_data_word(destoffset, destval);
+           }
+           break;
+       case 2:         /* call word ptr ... */
+           destval = fetch_data_word(destoffset);
+           TRACE_AND_STEP();
+           push_word(M.x86.R_IP);
+           M.x86.R_IP = destval;
+           break;
+       case 3:         /* call far ptr ... */
+           destval = fetch_data_word(destoffset);
+           destval2 = fetch_data_word(destoffset + 2);
+           TRACE_AND_STEP();
+           push_word(M.x86.R_CS);
+           M.x86.R_CS = destval2;
+           push_word(M.x86.R_IP);
+           M.x86.R_IP = destval;
+           break;
+       case 4:         /* jmp word ptr ... */
+           destval = fetch_data_word(destoffset);
+           TRACE_AND_STEP();
+           M.x86.R_IP = destval;
+           break;
+       case 5:         /* jmp far ptr ... */
+           destval = fetch_data_word(destoffset);
+           destval2 = fetch_data_word(destoffset + 2);
+           TRACE_AND_STEP();
+           M.x86.R_IP = destval;
+           M.x86.R_CS = destval2;
+           break;
+       case 6:         /*  push word ptr ... */
+           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+               u32 destval;
+
+               destval = fetch_data_long(destoffset);
+               TRACE_AND_STEP();
+               push_long(destval);
+           } else {
+               u16 destval;
+
+               destval = fetch_data_word(destoffset);
+               TRACE_AND_STEP();
+               push_word(destval);
+           }
+           break;
+       }
+    } else {
+       switch (rh) {
+       case 0:
+           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+               u32 *destreg;
+
+               destreg = DECODE_RM_LONG_REGISTER(rl);
+               DECODE_PRINTF("\n");
+               TRACE_AND_STEP();
+               *destreg = inc_long(*destreg);
+           } else {
+               u16 *destreg;
+
+               destreg = DECODE_RM_WORD_REGISTER(rl);
+               DECODE_PRINTF("\n");
+               TRACE_AND_STEP();
+               *destreg = inc_word(*destreg);
+           }
+           break;
+       case 1:
+           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+               u32 *destreg;
+
+               destreg = DECODE_RM_LONG_REGISTER(rl);
+               DECODE_PRINTF("\n");
+               TRACE_AND_STEP();
+               *destreg = dec_long(*destreg);
+           } else {
+               u16 *destreg;
+
+               destreg = DECODE_RM_WORD_REGISTER(rl);
+               DECODE_PRINTF("\n");
+               TRACE_AND_STEP();
+               *destreg = dec_word(*destreg);
+           }
+           break;
+       case 2:         /* call word ptr ... */
+           destreg = DECODE_RM_WORD_REGISTER(rl);
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           push_word(M.x86.R_IP);
+           M.x86.R_IP = *destreg;
+           break;
+       case 3:         /* jmp far ptr ... */
+           DECODE_PRINTF("OPERATION UNDEFINED 0XFF \n");
+           TRACE_AND_STEP();
+           HALT_SYS();
+           break;
+
+       case 4:         /* jmp  ... */
+           destreg = DECODE_RM_WORD_REGISTER(rl);
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           M.x86.R_IP = (u16) (*destreg);
+           break;
+       case 5:         /* jmp far ptr ... */
+           DECODE_PRINTF("OPERATION UNDEFINED 0XFF \n");
+           TRACE_AND_STEP();
+           HALT_SYS();
+           break;
+       case 6:
+           if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+               u32 *destreg;
+
+               destreg = DECODE_RM_LONG_REGISTER(rl);
+               DECODE_PRINTF("\n");
+               TRACE_AND_STEP();
+               push_long(*destreg);
+           } else {
+               u16 *destreg;
+
+               destreg = DECODE_RM_WORD_REGISTER(rl);
+               DECODE_PRINTF("\n");
+               TRACE_AND_STEP();
+               push_word(*destreg);
+           }
+           break;
+       }
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/***************************************************************************
+ * Single byte operation code table:
+ **************************************************************************/
+void (*x86emu_optab[256])(u8) __attribute__ ((section(".got2"))) =
+{
+/*  0x00 */ x86emuOp_genop_byte_RM_R,
+/*  0x01 */ x86emuOp_genop_word_RM_R,
+/*  0x02 */ x86emuOp_genop_byte_R_RM,
+/*  0x03 */ x86emuOp_genop_word_R_RM,
+/*  0x04 */ x86emuOp_genop_byte_AL_IMM,
+/*  0x05 */ x86emuOp_genop_word_AX_IMM,
+/*  0x06 */ x86emuOp_push_ES,
+/*  0x07 */ x86emuOp_pop_ES,
+
+/*  0x08 */ x86emuOp_genop_byte_RM_R,
+/*  0x09 */ x86emuOp_genop_word_RM_R,
+/*  0x0a */ x86emuOp_genop_byte_R_RM,
+/*  0x0b */ x86emuOp_genop_word_R_RM,
+/*  0x0c */ x86emuOp_genop_byte_AL_IMM,
+/*  0x0d */ x86emuOp_genop_word_AX_IMM,
+/*  0x0e */ x86emuOp_push_CS,
+/*  0x0f */ x86emuOp_two_byte,
+
+/*  0x10 */ x86emuOp_genop_byte_RM_R,
+/*  0x11 */ x86emuOp_genop_word_RM_R,
+/*  0x12 */ x86emuOp_genop_byte_R_RM,
+/*  0x13 */ x86emuOp_genop_word_R_RM,
+/*  0x14 */ x86emuOp_genop_byte_AL_IMM,
+/*  0x15 */ x86emuOp_genop_word_AX_IMM,
+/*  0x16 */ x86emuOp_push_SS,
+/*  0x17 */ x86emuOp_pop_SS,
+
+/*  0x18 */ x86emuOp_genop_byte_RM_R,
+/*  0x19 */ x86emuOp_genop_word_RM_R,
+/*  0x1a */ x86emuOp_genop_byte_R_RM,
+/*  0x1b */ x86emuOp_genop_word_R_RM,
+/*  0x1c */ x86emuOp_genop_byte_AL_IMM,
+/*  0x1d */ x86emuOp_genop_word_AX_IMM,
+/*  0x1e */ x86emuOp_push_DS,
+/*  0x1f */ x86emuOp_pop_DS,
+
+/*  0x20 */ x86emuOp_genop_byte_RM_R,
+/*  0x21 */ x86emuOp_genop_word_RM_R,
+/*  0x22 */ x86emuOp_genop_byte_R_RM,
+/*  0x23 */ x86emuOp_genop_word_R_RM,
+/*  0x24 */ x86emuOp_genop_byte_AL_IMM,
+/*  0x25 */ x86emuOp_genop_word_AX_IMM,
+/*  0x26 */ x86emuOp_segovr_ES,
+/*  0x27 */ x86emuOp_daa,
+
+/*  0x28 */ x86emuOp_genop_byte_RM_R,
+/*  0x29 */ x86emuOp_genop_word_RM_R,
+/*  0x2a */ x86emuOp_genop_byte_R_RM,
+/*  0x2b */ x86emuOp_genop_word_R_RM,
+/*  0x2c */ x86emuOp_genop_byte_AL_IMM,
+/*  0x2d */ x86emuOp_genop_word_AX_IMM,
+/*  0x2e */ x86emuOp_segovr_CS,
+/*  0x2f */ x86emuOp_das,
+
+/*  0x30 */ x86emuOp_genop_byte_RM_R,
+/*  0x31 */ x86emuOp_genop_word_RM_R,
+/*  0x32 */ x86emuOp_genop_byte_R_RM,
+/*  0x33 */ x86emuOp_genop_word_R_RM,
+/*  0x34 */ x86emuOp_genop_byte_AL_IMM,
+/*  0x35 */ x86emuOp_genop_word_AX_IMM,
+/*  0x36 */ x86emuOp_segovr_SS,
+/*  0x37 */ x86emuOp_aaa,
+
+/*  0x38 */ x86emuOp_genop_byte_RM_R,
+/*  0x39 */ x86emuOp_genop_word_RM_R,
+/*  0x3a */ x86emuOp_genop_byte_R_RM,
+/*  0x3b */ x86emuOp_genop_word_R_RM,
+/*  0x3c */ x86emuOp_genop_byte_AL_IMM,
+/*  0x3d */ x86emuOp_genop_word_AX_IMM,
+/*  0x3e */ x86emuOp_segovr_DS,
+/*  0x3f */ x86emuOp_aas,
+
+/*  0x40 */ x86emuOp_inc_register,
+/*  0x41 */ x86emuOp_inc_register,
+/*  0x42 */ x86emuOp_inc_register,
+/*  0x43 */ x86emuOp_inc_register,
+/*  0x44 */ x86emuOp_inc_register,
+/*  0x45 */ x86emuOp_inc_register,
+/*  0x46 */ x86emuOp_inc_register,
+/*  0x47 */ x86emuOp_inc_register,
+
+/*  0x48 */ x86emuOp_dec_register,
+/*  0x49 */ x86emuOp_dec_register,
+/*  0x4a */ x86emuOp_dec_register,
+/*  0x4b */ x86emuOp_dec_register,
+/*  0x4c */ x86emuOp_dec_register,
+/*  0x4d */ x86emuOp_dec_register,
+/*  0x4e */ x86emuOp_dec_register,
+/*  0x4f */ x86emuOp_dec_register,
+
+/*  0x50 */ x86emuOp_push_register,
+/*  0x51 */ x86emuOp_push_register,
+/*  0x52 */ x86emuOp_push_register,
+/*  0x53 */ x86emuOp_push_register,
+/*  0x54 */ x86emuOp_push_register,
+/*  0x55 */ x86emuOp_push_register,
+/*  0x56 */ x86emuOp_push_register,
+/*  0x57 */ x86emuOp_push_register,
+
+/*  0x58 */ x86emuOp_pop_register,
+/*  0x59 */ x86emuOp_pop_register,
+/*  0x5a */ x86emuOp_pop_register,
+/*  0x5b */ x86emuOp_pop_register,
+/*  0x5c */ x86emuOp_pop_register,
+/*  0x5d */ x86emuOp_pop_register,
+/*  0x5e */ x86emuOp_pop_register,
+/*  0x5f */ x86emuOp_pop_register,
+
+/*  0x60 */ x86emuOp_push_all,
+/*  0x61 */ x86emuOp_pop_all,
+/*  0x62 */ x86emuOp_illegal_op,   /* bound */
+/*  0x63 */ x86emuOp_illegal_op,   /* arpl */
+/*  0x64 */ x86emuOp_segovr_FS,
+/*  0x65 */ x86emuOp_segovr_GS,
+/*  0x66 */ x86emuOp_prefix_data,
+/*  0x67 */ x86emuOp_prefix_addr,
+
+/*  0x68 */ x86emuOp_push_word_IMM,
+/*  0x69 */ x86emuOp_imul_word_IMM,
+/*  0x6a */ x86emuOp_push_byte_IMM,
+/*  0x6b */ x86emuOp_imul_byte_IMM,
+/*  0x6c */ x86emuOp_ins_byte,
+/*  0x6d */ x86emuOp_ins_word,
+/*  0x6e */ x86emuOp_outs_byte,
+/*  0x6f */ x86emuOp_outs_word,
+
+/*  0x70 */ x86emuOp_jump_near_cond,
+/*  0x71 */ x86emuOp_jump_near_cond,
+/*  0x72 */ x86emuOp_jump_near_cond,
+/*  0x73 */ x86emuOp_jump_near_cond,
+/*  0x74 */ x86emuOp_jump_near_cond,
+/*  0x75 */ x86emuOp_jump_near_cond,
+/*  0x76 */ x86emuOp_jump_near_cond,
+/*  0x77 */ x86emuOp_jump_near_cond,
+
+/*  0x78 */ x86emuOp_jump_near_cond,
+/*  0x79 */ x86emuOp_jump_near_cond,
+/*  0x7a */ x86emuOp_jump_near_cond,
+/*  0x7b */ x86emuOp_jump_near_cond,
+/*  0x7c */ x86emuOp_jump_near_cond,
+/*  0x7d */ x86emuOp_jump_near_cond,
+/*  0x7e */ x86emuOp_jump_near_cond,
+/*  0x7f */ x86emuOp_jump_near_cond,
+
+/*  0x80 */ x86emuOp_opc80_byte_RM_IMM,
+/*  0x81 */ x86emuOp_opc81_word_RM_IMM,
+/*  0x82 */ x86emuOp_opc82_byte_RM_IMM,
+/*  0x83 */ x86emuOp_opc83_word_RM_IMM,
+/*  0x84 */ x86emuOp_test_byte_RM_R,
+/*  0x85 */ x86emuOp_test_word_RM_R,
+/*  0x86 */ x86emuOp_xchg_byte_RM_R,
+/*  0x87 */ x86emuOp_xchg_word_RM_R,
+
+/*  0x88 */ x86emuOp_mov_byte_RM_R,
+/*  0x89 */ x86emuOp_mov_word_RM_R,
+/*  0x8a */ x86emuOp_mov_byte_R_RM,
+/*  0x8b */ x86emuOp_mov_word_R_RM,
+/*  0x8c */ x86emuOp_mov_word_RM_SR,
+/*  0x8d */ x86emuOp_lea_word_R_M,
+/*  0x8e */ x86emuOp_mov_word_SR_RM,
+/*  0x8f */ x86emuOp_pop_RM,
+
+/*  0x90 */ x86emuOp_nop,
+/*  0x91 */ x86emuOp_xchg_word_AX_register,
+/*  0x92 */ x86emuOp_xchg_word_AX_register,
+/*  0x93 */ x86emuOp_xchg_word_AX_register,
+/*  0x94 */ x86emuOp_xchg_word_AX_register,
+/*  0x95 */ x86emuOp_xchg_word_AX_register,
+/*  0x96 */ x86emuOp_xchg_word_AX_register,
+/*  0x97 */ x86emuOp_xchg_word_AX_register,
+
+/*  0x98 */ x86emuOp_cbw,
+/*  0x99 */ x86emuOp_cwd,
+/*  0x9a */ x86emuOp_call_far_IMM,
+/*  0x9b */ x86emuOp_wait,
+/*  0x9c */ x86emuOp_pushf_word,
+/*  0x9d */ x86emuOp_popf_word,
+/*  0x9e */ x86emuOp_sahf,
+/*  0x9f */ x86emuOp_lahf,
+
+/*  0xa0 */ x86emuOp_mov_AL_M_IMM,
+/*  0xa1 */ x86emuOp_mov_AX_M_IMM,
+/*  0xa2 */ x86emuOp_mov_M_AL_IMM,
+/*  0xa3 */ x86emuOp_mov_M_AX_IMM,
+/*  0xa4 */ x86emuOp_movs_byte,
+/*  0xa5 */ x86emuOp_movs_word,
+/*  0xa6 */ x86emuOp_cmps_byte,
+/*  0xa7 */ x86emuOp_cmps_word,
+/*  0xa8 */ x86emuOp_test_AL_IMM,
+/*  0xa9 */ x86emuOp_test_AX_IMM,
+/*  0xaa */ x86emuOp_stos_byte,
+/*  0xab */ x86emuOp_stos_word,
+/*  0xac */ x86emuOp_lods_byte,
+/*  0xad */ x86emuOp_lods_word,
+/*  0xac */ x86emuOp_scas_byte,
+/*  0xad */ x86emuOp_scas_word,
+
+/*  0xb0 */ x86emuOp_mov_byte_register_IMM,
+/*  0xb1 */ x86emuOp_mov_byte_register_IMM,
+/*  0xb2 */ x86emuOp_mov_byte_register_IMM,
+/*  0xb3 */ x86emuOp_mov_byte_register_IMM,
+/*  0xb4 */ x86emuOp_mov_byte_register_IMM,
+/*  0xb5 */ x86emuOp_mov_byte_register_IMM,
+/*  0xb6 */ x86emuOp_mov_byte_register_IMM,
+/*  0xb7 */ x86emuOp_mov_byte_register_IMM,
+
+/*  0xb8 */ x86emuOp_mov_word_register_IMM,
+/*  0xb9 */ x86emuOp_mov_word_register_IMM,
+/*  0xba */ x86emuOp_mov_word_register_IMM,
+/*  0xbb */ x86emuOp_mov_word_register_IMM,
+/*  0xbc */ x86emuOp_mov_word_register_IMM,
+/*  0xbd */ x86emuOp_mov_word_register_IMM,
+/*  0xbe */ x86emuOp_mov_word_register_IMM,
+/*  0xbf */ x86emuOp_mov_word_register_IMM,
+
+/*  0xc0 */ x86emuOp_opcC0_byte_RM_MEM,
+/*  0xc1 */ x86emuOp_opcC1_word_RM_MEM,
+/*  0xc2 */ x86emuOp_ret_near_IMM,
+/*  0xc3 */ x86emuOp_ret_near,
+/*  0xc4 */ x86emuOp_les_R_IMM,
+/*  0xc5 */ x86emuOp_lds_R_IMM,
+/*  0xc6 */ x86emuOp_mov_byte_RM_IMM,
+/*  0xc7 */ x86emuOp_mov_word_RM_IMM,
+/*  0xc8 */ x86emuOp_enter,
+/*  0xc9 */ x86emuOp_leave,
+/*  0xca */ x86emuOp_ret_far_IMM,
+/*  0xcb */ x86emuOp_ret_far,
+/*  0xcc */ x86emuOp_int3,
+/*  0xcd */ x86emuOp_int_IMM,
+/*  0xce */ x86emuOp_into,
+/*  0xcf */ x86emuOp_iret,
+
+/*  0xd0 */ x86emuOp_opcD0_byte_RM_1,
+/*  0xd1 */ x86emuOp_opcD1_word_RM_1,
+/*  0xd2 */ x86emuOp_opcD2_byte_RM_CL,
+/*  0xd3 */ x86emuOp_opcD3_word_RM_CL,
+/*  0xd4 */ x86emuOp_aam,
+/*  0xd5 */ x86emuOp_aad,
+/*  0xd6 */ x86emuOp_illegal_op,   /* Undocumented SETALC instruction */
+/*  0xd7 */ x86emuOp_xlat,
+/*  0xd8 */ NULL, /*x86emuOp_esc_coprocess_d8,*/
+/*  0xd9 */ NULL, /*x86emuOp_esc_coprocess_d9,*/
+/*  0xda */ NULL, /*x86emuOp_esc_coprocess_da,*/
+/*  0xdb */ NULL, /*x86emuOp_esc_coprocess_db,*/
+/*  0xdc */ NULL, /*x86emuOp_esc_coprocess_dc,*/
+/*  0xdd */ NULL, /*x86emuOp_esc_coprocess_dd,*/
+/*  0xde */ NULL, /*x86emuOp_esc_coprocess_de,*/
+/*  0xdf */ NULL, /*x86emuOp_esc_coprocess_df,*/
+
+/*  0xe0 */ x86emuOp_loopne,
+/*  0xe1 */ x86emuOp_loope,
+/*  0xe2 */ x86emuOp_loop,
+/*  0xe3 */ x86emuOp_jcxz,
+/*  0xe4 */ x86emuOp_in_byte_AL_IMM,
+/*  0xe5 */ x86emuOp_in_word_AX_IMM,
+/*  0xe6 */ x86emuOp_out_byte_IMM_AL,
+/*  0xe7 */ x86emuOp_out_word_IMM_AX,
+
+/*  0xe8 */ x86emuOp_call_near_IMM,
+/*  0xe9 */ x86emuOp_jump_near_IMM,
+/*  0xea */ x86emuOp_jump_far_IMM,
+/*  0xeb */ x86emuOp_jump_byte_IMM,
+/*  0xec */ x86emuOp_in_byte_AL_DX,
+/*  0xed */ x86emuOp_in_word_AX_DX,
+/*  0xee */ x86emuOp_out_byte_DX_AL,
+/*  0xef */ x86emuOp_out_word_DX_AX,
+
+/*  0xf0 */ x86emuOp_lock,
+/*  0xf1 */ x86emuOp_illegal_op,
+/*  0xf2 */ x86emuOp_repne,
+/*  0xf3 */ x86emuOp_repe,
+/*  0xf4 */ x86emuOp_halt,
+/*  0xf5 */ x86emuOp_cmc,
+/*  0xf6 */ x86emuOp_opcF6_byte_RM,
+/*  0xf7 */ x86emuOp_opcF7_word_RM,
+
+/*  0xf8 */ x86emuOp_clc,
+/*  0xf9 */ x86emuOp_stc,
+/*  0xfa */ x86emuOp_cli,
+/*  0xfb */ x86emuOp_sti,
+/*  0xfc */ x86emuOp_cld,
+/*  0xfd */ x86emuOp_std,
+/*  0xfe */ x86emuOp_opcFE_byte_RM,
+/*  0xff */ x86emuOp_opcFF_word_RM,
+};
diff --git a/drivers/bios_emulator/x86emu/ops2.c b/drivers/bios_emulator/x86emu/ops2.c
new file mode 100644 (file)
index 0000000..631a340
--- /dev/null
@@ -0,0 +1,1770 @@
+/****************************************************************************
+*
+*                      Realmode X86 Emulator Library
+*
+*  Copyright (C) 2007 Freescale Semiconductor, Inc. All rights reserved.
+*  Jason Jin <Jason.jin@freescale.com>
+*
+*              Copyright (C) 1991-2004 SciTech Software, Inc.
+*                   Copyright (C) David Mosberger-Tang
+*                     Copyright (C) 1999 Egbert Eich
+*
+*  ========================================================================
+*
+*  Permission to use, copy, modify, distribute, and sell this software and
+*  its documentation for any purpose is hereby granted without fee,
+*  provided that the above copyright notice appear in all copies and that
+*  both that copyright notice and this permission notice appear in
+*  supporting documentation, and that the name of the authors not be used
+*  in advertising or publicity pertaining to distribution of the software
+*  without specific, written prior permission. The authors makes no
+*  representations about the suitability of this software for any purpose.
+*  It is provided "as is" without express or implied warranty.
+*
+*  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+*  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+*  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+*  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+*  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+*  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+*  PERFORMANCE OF THIS SOFTWARE.
+*
+*  ========================================================================
+*
+* Language:    ANSI C
+* Environment: Any
+* Developer:   Kendall Bennett
+*
+* Description: This file includes subroutines to implement the decoding
+*              and emulation of all the x86 extended two-byte processor
+*              instructions.
+*
+*              Jason port this file to u-boot. Put the function pointer into
+*              got2 sector.
+*
+****************************************************************************/
+
+#include "x86emu/x86emui.h"
+
+/*----------------------------- Implementation ----------------------------*/
+
+/****************************************************************************
+PARAMETERS:
+op1 - Instruction op code
+
+REMARKS:
+Handles illegal opcodes.
+****************************************************************************/
+void x86emuOp2_illegal_op(
+    u8 op2)
+{
+    START_OF_INSTR();
+    DECODE_PRINTF("ILLEGAL EXTENDED X86 OPCODE\n");
+    TRACE_REGS();
+    printk("%04x:%04x: %02X ILLEGAL EXTENDED X86 OPCODE!\n",
+       M.x86.R_CS, M.x86.R_IP-2,op2);
+    HALT_SYS();
+    END_OF_INSTR();
+}
+
+#define xorl(a,b)   ((a) && !(b)) || (!(a) && (b))
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0x80-0x8F
+****************************************************************************/
+int x86emu_check_jump_condition(u8 op)
+{
+    switch (op) {
+      case 0x0:
+       DECODE_PRINTF("JO\t");
+       return ACCESS_FLAG(F_OF);
+      case 0x1:
+       DECODE_PRINTF("JNO\t");
+       return !ACCESS_FLAG(F_OF);
+       break;
+      case 0x2:
+       DECODE_PRINTF("JB\t");
+       return ACCESS_FLAG(F_CF);
+       break;
+      case 0x3:
+       DECODE_PRINTF("JNB\t");
+       return !ACCESS_FLAG(F_CF);
+       break;
+      case 0x4:
+       DECODE_PRINTF("JZ\t");
+       return ACCESS_FLAG(F_ZF);
+       break;
+      case 0x5:
+       DECODE_PRINTF("JNZ\t");
+       return !ACCESS_FLAG(F_ZF);
+       break;
+      case 0x6:
+       DECODE_PRINTF("JBE\t");
+       return ACCESS_FLAG(F_CF) || ACCESS_FLAG(F_ZF);
+       break;
+      case 0x7:
+       DECODE_PRINTF("JNBE\t");
+       return !(ACCESS_FLAG(F_CF) || ACCESS_FLAG(F_ZF));
+       break;
+      case 0x8:
+       DECODE_PRINTF("JS\t");
+       return ACCESS_FLAG(F_SF);
+       break;
+      case 0x9:
+       DECODE_PRINTF("JNS\t");
+       return !ACCESS_FLAG(F_SF);
+       break;
+      case 0xa:
+       DECODE_PRINTF("JP\t");
+       return ACCESS_FLAG(F_PF);
+       break;
+      case 0xb:
+       DECODE_PRINTF("JNP\t");
+       return !ACCESS_FLAG(F_PF);
+       break;
+      case 0xc:
+       DECODE_PRINTF("JL\t");
+       return xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF));
+       break;
+      case 0xd:
+       DECODE_PRINTF("JNL\t");
+       return !xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF));
+       break;
+      case 0xe:
+       DECODE_PRINTF("JLE\t");
+       return (xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF)) ||
+               ACCESS_FLAG(F_ZF));
+       break;
+      default:
+       DECODE_PRINTF("JNLE\t");
+       return !(xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF)) ||
+                ACCESS_FLAG(F_ZF));
+    }
+}
+
+void x86emuOp2_long_jump(u8 op2)
+{
+    s32 target;
+    int cond;
+
+    /* conditional jump to word offset. */
+    START_OF_INSTR();
+    cond = x86emu_check_jump_condition(op2 & 0xF);
+    target = (s16) fetch_word_imm();
+    target += (s16) M.x86.R_IP;
+    DECODE_PRINTF2("%04x\n", target);
+    TRACE_AND_STEP();
+    if (cond)
+       M.x86.R_IP = (u16)target;
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0x90-0x9F
+****************************************************************************/
+void x86emuOp2_set_byte(u8 op2)
+{
+    int mod, rl, rh;
+    uint destoffset;
+    u8 *destreg;
+    char *name = 0;
+    int cond = 0;
+
+    START_OF_INSTR();
+    switch (op2) {
+      case 0x90:
+       name = "SETO\t";
+       cond =  ACCESS_FLAG(F_OF);
+       break;
+      case 0x91:
+       name = "SETNO\t";
+       cond = !ACCESS_FLAG(F_OF);
+       break;
+      case 0x92:
+       name = "SETB\t";
+       cond = ACCESS_FLAG(F_CF);
+       break;
+      case 0x93:
+       name = "SETNB\t";
+       cond = !ACCESS_FLAG(F_CF);
+       break;
+      case 0x94:
+       name = "SETZ\t";
+       cond = ACCESS_FLAG(F_ZF);
+       break;
+      case 0x95:
+       name = "SETNZ\t";
+       cond = !ACCESS_FLAG(F_ZF);
+       break;
+      case 0x96:
+       name = "SETBE\t";
+       cond = ACCESS_FLAG(F_CF) || ACCESS_FLAG(F_ZF);
+       break;
+      case 0x97:
+       name = "SETNBE\t";
+       cond = !(ACCESS_FLAG(F_CF) || ACCESS_FLAG(F_ZF));
+       break;
+      case 0x98:
+       name = "SETS\t";
+       cond = ACCESS_FLAG(F_SF);
+       break;
+      case 0x99:
+       name = "SETNS\t";
+       cond = !ACCESS_FLAG(F_SF);
+       break;
+      case 0x9a:
+       name = "SETP\t";
+       cond = ACCESS_FLAG(F_PF);
+       break;
+      case 0x9b:
+       name = "SETNP\t";
+       cond = !ACCESS_FLAG(F_PF);
+       break;
+      case 0x9c:
+       name = "SETL\t";
+       cond = xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF));
+       break;
+      case 0x9d:
+       name = "SETNL\t";
+       cond = !xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF));
+       break;
+      case 0x9e:
+       name = "SETLE\t";
+       cond = (xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF)) ||
+               ACCESS_FLAG(F_ZF));
+       break;
+      case 0x9f:
+       name = "SETNLE\t";
+       cond = !(xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF)) ||
+                ACCESS_FLAG(F_ZF));
+       break;
+    }
+    DECODE_PRINTF(name);
+    FETCH_DECODE_MODRM(mod, rh, rl);
+    if (mod < 3) {
+       destoffset = decode_rmXX_address(mod, rl);
+       TRACE_AND_STEP();
+       store_data_byte(destoffset, cond ? 0x01 : 0x00);
+    } else {                    /* register to register */
+       destreg = DECODE_RM_BYTE_REGISTER(rl);
+       TRACE_AND_STEP();
+       *destreg = cond ? 0x01 : 0x00;
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0xa0
+****************************************************************************/
+void x86emuOp2_push_FS(u8 X86EMU_UNUSED(op2))
+{
+    START_OF_INSTR();
+    DECODE_PRINTF("PUSH\tFS\n");
+    TRACE_AND_STEP();
+    push_word(M.x86.R_FS);
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0xa1
+****************************************************************************/
+void x86emuOp2_pop_FS(u8 X86EMU_UNUSED(op2))
+{
+    START_OF_INSTR();
+    DECODE_PRINTF("POP\tFS\n");
+    TRACE_AND_STEP();
+    M.x86.R_FS = pop_word();
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0xa3
+****************************************************************************/
+void x86emuOp2_bt_R(u8 X86EMU_UNUSED(op2))
+{
+    int mod, rl, rh;
+    uint srcoffset;
+    int bit,disp;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("BT\t");
+    FETCH_DECODE_MODRM(mod, rh, rl);
+    if (mod < 3) {
+       srcoffset = decode_rmXX_address(mod, rl);
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 srcval;
+           u32 *shiftreg;
+
+           DECODE_PRINTF(",");
+           shiftreg = DECODE_RM_LONG_REGISTER(rh);
+           TRACE_AND_STEP();
+           bit = *shiftreg & 0x1F;
+           disp = (s16)*shiftreg >> 5;
+           srcval = fetch_data_long(srcoffset+disp);
+           CONDITIONAL_SET_FLAG(srcval & (0x1 << bit),F_CF);
+       } else {
+           u16 srcval;
+           u16 *shiftreg;
+
+           DECODE_PRINTF(",");
+           shiftreg = DECODE_RM_WORD_REGISTER(rh);
+           TRACE_AND_STEP();
+           bit = *shiftreg & 0xF;
+           disp = (s16)*shiftreg >> 4;
+           srcval = fetch_data_word(srcoffset+disp);
+           CONDITIONAL_SET_FLAG(srcval & (0x1 << bit),F_CF);
+       }
+    } else {                    /* register to register */
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 *srcreg,*shiftreg;
+
+           srcreg = DECODE_RM_LONG_REGISTER(rl);
+           DECODE_PRINTF(",");
+           shiftreg = DECODE_RM_LONG_REGISTER(rh);
+           TRACE_AND_STEP();
+           bit = *shiftreg & 0x1F;
+           CONDITIONAL_SET_FLAG(*srcreg & (0x1 << bit),F_CF);
+       } else {
+           u16 *srcreg,*shiftreg;
+
+           srcreg = DECODE_RM_WORD_REGISTER(rl);
+           DECODE_PRINTF(",");
+           shiftreg = DECODE_RM_WORD_REGISTER(rh);
+           TRACE_AND_STEP();
+           bit = *shiftreg & 0xF;
+           CONDITIONAL_SET_FLAG(*srcreg & (0x1 << bit),F_CF);
+       }
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0xa4
+****************************************************************************/
+void x86emuOp2_shld_IMM(u8 X86EMU_UNUSED(op2))
+{
+    int mod, rl, rh;
+    uint destoffset;
+    u8 shift;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("SHLD\t");
+    FETCH_DECODE_MODRM(mod, rh, rl);
+    if (mod < 3) {
+       destoffset = decode_rmXX_address(mod, rl);
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 destval;
+           u32 *shiftreg;
+
+           DECODE_PRINTF(",");
+           shiftreg = DECODE_RM_LONG_REGISTER(rh);
+           DECODE_PRINTF(",");
+           shift = fetch_byte_imm();
+           DECODE_PRINTF2("%d\n", shift);
+           TRACE_AND_STEP();
+           destval = fetch_data_long(destoffset);
+           destval = shld_long(destval,*shiftreg,shift);
+           store_data_long(destoffset, destval);
+       } else {
+           u16 destval;
+           u16 *shiftreg;
+
+           DECODE_PRINTF(",");
+           shiftreg = DECODE_RM_WORD_REGISTER(rh);
+           DECODE_PRINTF(",");
+           shift = fetch_byte_imm();
+           DECODE_PRINTF2("%d\n", shift);
+           TRACE_AND_STEP();
+           destval = fetch_data_word(destoffset);
+           destval = shld_word(destval,*shiftreg,shift);
+           store_data_word(destoffset, destval);
+       }
+    } else {                    /* register to register */
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 *destreg,*shiftreg;
+
+           destreg = DECODE_RM_LONG_REGISTER(rl);
+           DECODE_PRINTF(",");
+           shiftreg = DECODE_RM_LONG_REGISTER(rh);
+           DECODE_PRINTF(",");
+           shift = fetch_byte_imm();
+           DECODE_PRINTF2("%d\n", shift);
+           TRACE_AND_STEP();
+           *destreg = shld_long(*destreg,*shiftreg,shift);
+       } else {
+           u16 *destreg,*shiftreg;
+
+           destreg = DECODE_RM_WORD_REGISTER(rl);
+           DECODE_PRINTF(",");
+           shiftreg = DECODE_RM_WORD_REGISTER(rh);
+           DECODE_PRINTF(",");
+           shift = fetch_byte_imm();
+           DECODE_PRINTF2("%d\n", shift);
+           TRACE_AND_STEP();
+           *destreg = shld_word(*destreg,*shiftreg,shift);
+       }
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0xa5
+****************************************************************************/
+void x86emuOp2_shld_CL(u8 X86EMU_UNUSED(op2))
+{
+    int mod, rl, rh;
+    uint destoffset;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("SHLD\t");
+    FETCH_DECODE_MODRM(mod, rh, rl);
+    if (mod < 3) {
+       destoffset = decode_rmXX_address(mod, rl);
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 destval;
+           u32 *shiftreg;
+
+           DECODE_PRINTF(",");
+           shiftreg = DECODE_RM_LONG_REGISTER(rh);
+           DECODE_PRINTF(",CL\n");
+           TRACE_AND_STEP();
+           destval = fetch_data_long(destoffset);
+           destval = shld_long(destval,*shiftreg,M.x86.R_CL);
+           store_data_long(destoffset, destval);
+       } else {
+           u16 destval;
+           u16 *shiftreg;
+
+           DECODE_PRINTF(",");
+           shiftreg = DECODE_RM_WORD_REGISTER(rh);
+           DECODE_PRINTF(",CL\n");
+           TRACE_AND_STEP();
+           destval = fetch_data_word(destoffset);
+           destval = shld_word(destval,*shiftreg,M.x86.R_CL);
+           store_data_word(destoffset, destval);
+       }
+    } else {                    /* register to register */
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 *destreg,*shiftreg;
+
+           destreg = DECODE_RM_LONG_REGISTER(rl);
+           DECODE_PRINTF(",");
+           shiftreg = DECODE_RM_LONG_REGISTER(rh);
+           DECODE_PRINTF(",CL\n");
+           TRACE_AND_STEP();
+           *destreg = shld_long(*destreg,*shiftreg,M.x86.R_CL);
+       } else {
+           u16 *destreg,*shiftreg;
+
+           destreg = DECODE_RM_WORD_REGISTER(rl);
+           DECODE_PRINTF(",");
+           shiftreg = DECODE_RM_WORD_REGISTER(rh);
+           DECODE_PRINTF(",CL\n");
+           TRACE_AND_STEP();
+           *destreg = shld_word(*destreg,*shiftreg,M.x86.R_CL);
+       }
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0xa8
+****************************************************************************/
+void x86emuOp2_push_GS(u8 X86EMU_UNUSED(op2))
+{
+    START_OF_INSTR();
+    DECODE_PRINTF("PUSH\tGS\n");
+    TRACE_AND_STEP();
+    push_word(M.x86.R_GS);
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0xa9
+****************************************************************************/
+void x86emuOp2_pop_GS(u8 X86EMU_UNUSED(op2))
+{
+    START_OF_INSTR();
+    DECODE_PRINTF("POP\tGS\n");
+    TRACE_AND_STEP();
+    M.x86.R_GS = pop_word();
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0xaa
+****************************************************************************/
+void x86emuOp2_bts_R(u8 X86EMU_UNUSED(op2))
+{
+    int mod, rl, rh;
+    uint srcoffset;
+    int bit,disp;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("BTS\t");
+    FETCH_DECODE_MODRM(mod, rh, rl);
+    if (mod < 3) {
+       srcoffset = decode_rmXX_address(mod, rl);
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 srcval,mask;
+           u32 *shiftreg;
+
+           DECODE_PRINTF(",");
+           shiftreg = DECODE_RM_LONG_REGISTER(rh);
+           TRACE_AND_STEP();
+           bit = *shiftreg & 0x1F;
+           disp = (s16)*shiftreg >> 5;
+           srcval = fetch_data_long(srcoffset+disp);
+           mask = (0x1 << bit);
+           CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+           store_data_long(srcoffset+disp, srcval | mask);
+       } else {
+           u16 srcval,mask;
+           u16 *shiftreg;
+
+           DECODE_PRINTF(",");
+           shiftreg = DECODE_RM_WORD_REGISTER(rh);
+           TRACE_AND_STEP();
+           bit = *shiftreg & 0xF;
+           disp = (s16)*shiftreg >> 4;
+           srcval = fetch_data_word(srcoffset+disp);
+           mask = (u16)(0x1 << bit);
+           CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+           store_data_word(srcoffset+disp, srcval | mask);
+       }
+    } else {                    /* register to register */
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 *srcreg,*shiftreg;
+           u32 mask;
+
+           srcreg = DECODE_RM_LONG_REGISTER(rl);
+           DECODE_PRINTF(",");
+           shiftreg = DECODE_RM_LONG_REGISTER(rh);
+           TRACE_AND_STEP();
+           bit = *shiftreg & 0x1F;
+           mask = (0x1 << bit);
+           CONDITIONAL_SET_FLAG(*srcreg & mask,F_CF);
+           *srcreg |= mask;
+       } else {
+           u16 *srcreg,*shiftreg;
+           u16 mask;
+
+           srcreg = DECODE_RM_WORD_REGISTER(rl);
+           DECODE_PRINTF(",");
+           shiftreg = DECODE_RM_WORD_REGISTER(rh);
+           TRACE_AND_STEP();
+           bit = *shiftreg & 0xF;
+           mask = (u16)(0x1 << bit);
+           CONDITIONAL_SET_FLAG(*srcreg & mask,F_CF);
+           *srcreg |= mask;
+       }
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0xac
+****************************************************************************/
+void x86emuOp2_shrd_IMM(u8 X86EMU_UNUSED(op2))
+{
+    int mod, rl, rh;
+    uint destoffset;
+    u8 shift;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("SHLD\t");
+    FETCH_DECODE_MODRM(mod, rh, rl);
+    if (mod < 3) {
+       destoffset = decode_rmXX_address(mod, rl);
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 destval;
+           u32 *shiftreg;
+
+           DECODE_PRINTF(",");
+           shiftreg = DECODE_RM_LONG_REGISTER(rh);
+           DECODE_PRINTF(",");
+           shift = fetch_byte_imm();
+           DECODE_PRINTF2("%d\n", shift);
+           TRACE_AND_STEP();
+           destval = fetch_data_long(destoffset);
+           destval = shrd_long(destval,*shiftreg,shift);
+           store_data_long(destoffset, destval);
+       } else {
+           u16 destval;
+           u16 *shiftreg;
+
+           DECODE_PRINTF(",");
+           shiftreg = DECODE_RM_WORD_REGISTER(rh);
+           DECODE_PRINTF(",");
+           shift = fetch_byte_imm();
+           DECODE_PRINTF2("%d\n", shift);
+           TRACE_AND_STEP();
+           destval = fetch_data_word(destoffset);
+           destval = shrd_word(destval,*shiftreg,shift);
+           store_data_word(destoffset, destval);
+       }
+    } else {                    /* register to register */
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 *destreg,*shiftreg;
+
+           destreg = DECODE_RM_LONG_REGISTER(rl);
+           DECODE_PRINTF(",");
+           shiftreg = DECODE_RM_LONG_REGISTER(rh);
+           DECODE_PRINTF(",");
+           shift = fetch_byte_imm();
+           DECODE_PRINTF2("%d\n", shift);
+           TRACE_AND_STEP();
+           *destreg = shrd_long(*destreg,*shiftreg,shift);
+       } else {
+           u16 *destreg,*shiftreg;
+
+           destreg = DECODE_RM_WORD_REGISTER(rl);
+           DECODE_PRINTF(",");
+           shiftreg = DECODE_RM_WORD_REGISTER(rh);
+           DECODE_PRINTF(",");
+           shift = fetch_byte_imm();
+           DECODE_PRINTF2("%d\n", shift);
+           TRACE_AND_STEP();
+           *destreg = shrd_word(*destreg,*shiftreg,shift);
+       }
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0xad
+****************************************************************************/
+void x86emuOp2_shrd_CL(u8 X86EMU_UNUSED(op2))
+{
+    int mod, rl, rh;
+    uint destoffset;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("SHLD\t");
+    FETCH_DECODE_MODRM(mod, rh, rl);
+    if (mod < 3) {
+       destoffset = decode_rmXX_address(mod, rl);
+       DECODE_PRINTF(",");
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 destval;
+           u32 *shiftreg;
+
+           shiftreg = DECODE_RM_LONG_REGISTER(rh);
+           DECODE_PRINTF(",CL\n");
+           TRACE_AND_STEP();
+           destval = fetch_data_long(destoffset);
+           destval = shrd_long(destval,*shiftreg,M.x86.R_CL);
+           store_data_long(destoffset, destval);
+       } else {
+           u16 destval;
+           u16 *shiftreg;
+
+           shiftreg = DECODE_RM_WORD_REGISTER(rh);
+           DECODE_PRINTF(",CL\n");
+           TRACE_AND_STEP();
+           destval = fetch_data_word(destoffset);
+           destval = shrd_word(destval,*shiftreg,M.x86.R_CL);
+           store_data_word(destoffset, destval);
+       }
+    } else {                    /* register to register */
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 *destreg,*shiftreg;
+
+           destreg = DECODE_RM_LONG_REGISTER(rl);
+           DECODE_PRINTF(",");
+           shiftreg = DECODE_RM_LONG_REGISTER(rh);
+           DECODE_PRINTF(",CL\n");
+           TRACE_AND_STEP();
+           *destreg = shrd_long(*destreg,*shiftreg,M.x86.R_CL);
+       } else {
+           u16 *destreg,*shiftreg;
+
+           destreg = DECODE_RM_WORD_REGISTER(rl);
+           DECODE_PRINTF(",");
+           shiftreg = DECODE_RM_WORD_REGISTER(rh);
+           DECODE_PRINTF(",CL\n");
+           TRACE_AND_STEP();
+           *destreg = shrd_word(*destreg,*shiftreg,M.x86.R_CL);
+       }
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0xaf
+****************************************************************************/
+void x86emuOp2_imul_R_RM(u8 X86EMU_UNUSED(op2))
+{
+    int mod, rl, rh;
+    uint srcoffset;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("IMUL\t");
+    FETCH_DECODE_MODRM(mod, rh, rl);
+    if (mod < 3) {
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 *destreg;
+           u32 srcval;
+           u32 res_lo,res_hi;
+
+           destreg = DECODE_RM_LONG_REGISTER(rh);
+           DECODE_PRINTF(",");
+           srcoffset = decode_rmXX_address(mod, rl);
+           srcval = fetch_data_long(srcoffset);
+           TRACE_AND_STEP();
+           imul_long_direct(&res_lo,&res_hi,(s32)*destreg,(s32)srcval);
+           if (res_hi != 0) {
+               SET_FLAG(F_CF);
+               SET_FLAG(F_OF);
+           } else {
+               CLEAR_FLAG(F_CF);
+               CLEAR_FLAG(F_OF);
+           }
+           *destreg = (u32)res_lo;
+       } else {
+           u16 *destreg;
+           u16 srcval;
+           u32 res;
+
+           destreg = DECODE_RM_WORD_REGISTER(rh);
+           DECODE_PRINTF(",");
+           srcoffset = decode_rmXX_address(mod, rl);
+           srcval = fetch_data_word(srcoffset);
+           TRACE_AND_STEP();
+           res = (s16)*destreg * (s16)srcval;
+           if (res > 0xFFFF) {
+               SET_FLAG(F_CF);
+               SET_FLAG(F_OF);
+           } else {
+               CLEAR_FLAG(F_CF);
+               CLEAR_FLAG(F_OF);
+           }
+           *destreg = (u16)res;
+       }
+    } else {                    /* register to register */
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 *destreg,*srcreg;
+           u32 res_lo,res_hi;
+
+           destreg = DECODE_RM_LONG_REGISTER(rh);
+           DECODE_PRINTF(",");
+           srcreg = DECODE_RM_LONG_REGISTER(rl);
+           TRACE_AND_STEP();
+           imul_long_direct(&res_lo,&res_hi,(s32)*destreg,(s32)*srcreg);
+           if (res_hi != 0) {
+               SET_FLAG(F_CF);
+               SET_FLAG(F_OF);
+           } else {
+               CLEAR_FLAG(F_CF);
+               CLEAR_FLAG(F_OF);
+           }
+           *destreg = (u32)res_lo;
+       } else {
+           u16 *destreg,*srcreg;
+           u32 res;
+
+           destreg = DECODE_RM_WORD_REGISTER(rh);
+           DECODE_PRINTF(",");
+           srcreg = DECODE_RM_WORD_REGISTER(rl);
+           res = (s16)*destreg * (s16)*srcreg;
+           if (res > 0xFFFF) {
+               SET_FLAG(F_CF);
+               SET_FLAG(F_OF);
+           } else {
+               CLEAR_FLAG(F_CF);
+               CLEAR_FLAG(F_OF);
+           }
+           *destreg = (u16)res;
+       }
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0xb2
+****************************************************************************/
+void x86emuOp2_lss_R_IMM(u8 X86EMU_UNUSED(op2))
+{
+    int mod, rh, rl;
+    u16 *dstreg;
+    uint srcoffset;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("LSS\t");
+    FETCH_DECODE_MODRM(mod, rh, rl);
+    if (mod < 3) {
+       dstreg = DECODE_RM_WORD_REGISTER(rh);
+       DECODE_PRINTF(",");
+       srcoffset = decode_rmXX_address(mod, rl);
+       DECODE_PRINTF("\n");
+       TRACE_AND_STEP();
+       *dstreg = fetch_data_word(srcoffset);
+       M.x86.R_SS = fetch_data_word(srcoffset + 2);
+    } else {                    /* register to register */
+       /* UNDEFINED! */
+       TRACE_AND_STEP();
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0xb3
+****************************************************************************/
+void x86emuOp2_btr_R(u8 X86EMU_UNUSED(op2))
+{
+    int mod, rl, rh;
+    uint srcoffset;
+    int bit,disp;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("BTR\t");
+    FETCH_DECODE_MODRM(mod, rh, rl);
+    if (mod < 3) {
+       srcoffset = decode_rmXX_address(mod, rl);
+       DECODE_PRINTF(",");
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 srcval,mask;
+           u32 *shiftreg;
+
+           shiftreg = DECODE_RM_LONG_REGISTER(rh);
+           TRACE_AND_STEP();
+           bit = *shiftreg & 0x1F;
+           disp = (s16)*shiftreg >> 5;
+           srcval = fetch_data_long(srcoffset+disp);
+           mask = (0x1 << bit);
+           CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+           store_data_long(srcoffset+disp, srcval & ~mask);
+       } else {
+           u16 srcval,mask;
+           u16 *shiftreg;
+
+           shiftreg = DECODE_RM_WORD_REGISTER(rh);
+           TRACE_AND_STEP();
+           bit = *shiftreg & 0xF;
+           disp = (s16)*shiftreg >> 4;
+           srcval = fetch_data_word(srcoffset+disp);
+           mask = (u16)(0x1 << bit);
+           CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+           store_data_word(srcoffset+disp, (u16)(srcval & ~mask));
+       }
+    } else {                    /* register to register */
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 *srcreg,*shiftreg;
+           u32 mask;
+
+           srcreg = DECODE_RM_LONG_REGISTER(rl);
+           DECODE_PRINTF(",");
+           shiftreg = DECODE_RM_LONG_REGISTER(rh);
+           TRACE_AND_STEP();
+           bit = *shiftreg & 0x1F;
+           mask = (0x1 << bit);
+           CONDITIONAL_SET_FLAG(*srcreg & mask,F_CF);
+           *srcreg &= ~mask;
+       } else {
+           u16 *srcreg,*shiftreg;
+           u16 mask;
+
+           srcreg = DECODE_RM_WORD_REGISTER(rl);
+           DECODE_PRINTF(",");
+           shiftreg = DECODE_RM_WORD_REGISTER(rh);
+           TRACE_AND_STEP();
+           bit = *shiftreg & 0xF;
+           mask = (u16)(0x1 << bit);
+           CONDITIONAL_SET_FLAG(*srcreg & mask,F_CF);
+           *srcreg &= ~mask;
+       }
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0xb4
+****************************************************************************/
+void x86emuOp2_lfs_R_IMM(u8 X86EMU_UNUSED(op2))
+{
+    int mod, rh, rl;
+    u16 *dstreg;
+    uint srcoffset;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("LFS\t");
+    FETCH_DECODE_MODRM(mod, rh, rl);
+    if (mod < 3) {
+       dstreg = DECODE_RM_WORD_REGISTER(rh);
+       DECODE_PRINTF(",");
+       srcoffset = decode_rmXX_address(mod, rl);
+       DECODE_PRINTF("\n");
+       TRACE_AND_STEP();
+       *dstreg = fetch_data_word(srcoffset);
+       M.x86.R_FS = fetch_data_word(srcoffset + 2);
+    } else {                    /* register to register */
+       /* UNDEFINED! */
+       TRACE_AND_STEP();
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0xb5
+****************************************************************************/
+void x86emuOp2_lgs_R_IMM(u8 X86EMU_UNUSED(op2))
+{
+    int mod, rh, rl;
+    u16 *dstreg;
+    uint srcoffset;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("LGS\t");
+    FETCH_DECODE_MODRM(mod, rh, rl);
+    if (mod < 3) {
+       dstreg = DECODE_RM_WORD_REGISTER(rh);
+       DECODE_PRINTF(",");
+       srcoffset = decode_rmXX_address(mod, rl);
+       DECODE_PRINTF("\n");
+       TRACE_AND_STEP();
+       *dstreg = fetch_data_word(srcoffset);
+       M.x86.R_GS = fetch_data_word(srcoffset + 2);
+    } else {                    /* register to register */
+       /* UNDEFINED! */
+       TRACE_AND_STEP();
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0xb6
+****************************************************************************/
+void x86emuOp2_movzx_byte_R_RM(u8 X86EMU_UNUSED(op2))
+{
+    int mod, rl, rh;
+    uint srcoffset;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("MOVZX\t");
+    FETCH_DECODE_MODRM(mod, rh, rl);
+    if (mod < 3) {
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 *destreg;
+           u32 srcval;
+
+           destreg = DECODE_RM_LONG_REGISTER(rh);
+           DECODE_PRINTF(",");
+           srcoffset = decode_rmXX_address(mod, rl);
+           srcval = fetch_data_byte(srcoffset);
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           *destreg = srcval;
+       } else {
+           u16 *destreg;
+           u16 srcval;
+
+           destreg = DECODE_RM_WORD_REGISTER(rh);
+           DECODE_PRINTF(",");
+           srcoffset = decode_rmXX_address(mod, rl);
+           srcval = fetch_data_byte(srcoffset);
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           *destreg = srcval;
+       }
+    } else {                    /* register to register */
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 *destreg;
+           u8  *srcreg;
+
+           destreg = DECODE_RM_LONG_REGISTER(rh);
+           DECODE_PRINTF(",");
+           srcreg = DECODE_RM_BYTE_REGISTER(rl);
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           *destreg = *srcreg;
+       } else {
+           u16 *destreg;
+           u8  *srcreg;
+
+           destreg = DECODE_RM_WORD_REGISTER(rh);
+           DECODE_PRINTF(",");
+           srcreg = DECODE_RM_BYTE_REGISTER(rl);
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           *destreg = *srcreg;
+       }
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0xb7
+****************************************************************************/
+void x86emuOp2_movzx_word_R_RM(u8 X86EMU_UNUSED(op2))
+{
+    int mod, rl, rh;
+    uint srcoffset;
+    u32 *destreg;
+    u32 srcval;
+    u16 *srcreg;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("MOVZX\t");
+    FETCH_DECODE_MODRM(mod, rh, rl);
+    if (mod < 3) {
+       destreg = DECODE_RM_LONG_REGISTER(rh);
+       DECODE_PRINTF(",");
+       srcoffset = decode_rmXX_address(mod, rl);
+       srcval = fetch_data_word(srcoffset);
+       DECODE_PRINTF("\n");
+       TRACE_AND_STEP();
+       *destreg = srcval;
+    } else {                    /* register to register */
+       destreg = DECODE_RM_LONG_REGISTER(rh);
+       DECODE_PRINTF(",");
+       srcreg = DECODE_RM_WORD_REGISTER(rl);
+       DECODE_PRINTF("\n");
+       TRACE_AND_STEP();
+       *destreg = *srcreg;
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0xba
+****************************************************************************/
+void x86emuOp2_btX_I(u8 X86EMU_UNUSED(op2))
+{
+    int mod, rl, rh;
+    uint srcoffset;
+    u8 shift;
+    int bit;
+
+    START_OF_INSTR();
+    FETCH_DECODE_MODRM(mod, rh, rl);
+    switch (rh) {
+    case 4:
+       DECODE_PRINTF("BT\t");
+       break;
+    case 5:
+       DECODE_PRINTF("BTS\t");
+       break;
+    case 6:
+       DECODE_PRINTF("BTR\t");
+       break;
+    case 7:
+       DECODE_PRINTF("BTC\t");
+       break;
+    default:
+       DECODE_PRINTF("ILLEGAL EXTENDED X86 OPCODE\n");
+       TRACE_REGS();
+       printk("%04x:%04x: %02X%02X ILLEGAL EXTENDED X86 OPCODE EXTENSION!\n",
+               M.x86.R_CS, M.x86.R_IP-3,op2, (mod<<6)|(rh<<3)|rl);
+       HALT_SYS();
+    }
+    if (mod < 3) {
+
+       srcoffset = decode_rmXX_address(mod, rl);
+       shift = fetch_byte_imm();
+       DECODE_PRINTF2(",%d\n", shift);
+       TRACE_AND_STEP();
+
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 srcval, mask;
+
+           bit = shift & 0x1F;
+           srcval = fetch_data_long(srcoffset);
+           mask = (0x1 << bit);
+           CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+           switch (rh) {
+           case 5:
+               store_data_long(srcoffset, srcval | mask);
+               break;
+           case 6:
+               store_data_long(srcoffset, srcval & ~mask);
+               break;
+           case 7:
+               store_data_long(srcoffset, srcval ^ mask);
+               break;
+           default:
+               break;
+           }
+       } else {
+           u16 srcval, mask;
+
+           bit = shift & 0xF;
+           srcval = fetch_data_word(srcoffset);
+           mask = (0x1 << bit);
+           CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+           switch (rh) {
+           case 5:
+               store_data_word(srcoffset, srcval | mask);
+               break;
+           case 6:
+               store_data_word(srcoffset, srcval & ~mask);
+               break;
+           case 7:
+               store_data_word(srcoffset, srcval ^ mask);
+               break;
+           default:
+               break;
+           }
+       }
+    } else {                    /* register to register */
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 *srcreg;
+           u32 mask;
+
+           srcreg = DECODE_RM_LONG_REGISTER(rl);
+           shift = fetch_byte_imm();
+           DECODE_PRINTF2(",%d\n", shift);
+           TRACE_AND_STEP();
+           bit = shift & 0x1F;
+           mask = (0x1 << bit);
+           CONDITIONAL_SET_FLAG(*srcreg & mask,F_CF);
+           switch (rh) {
+           case 5:
+               *srcreg |= mask;
+               break;
+           case 6:
+               *srcreg &= ~mask;
+               break;
+           case 7:
+               *srcreg ^= mask;
+               break;
+           default:
+               break;
+           }
+       } else {
+           u16 *srcreg;
+           u16 mask;
+
+           srcreg = DECODE_RM_WORD_REGISTER(rl);
+           shift = fetch_byte_imm();
+           DECODE_PRINTF2(",%d\n", shift);
+           TRACE_AND_STEP();
+           bit = shift & 0xF;
+           mask = (0x1 << bit);
+           CONDITIONAL_SET_FLAG(*srcreg & mask,F_CF);
+           switch (rh) {
+           case 5:
+               *srcreg |= mask;
+               break;
+           case 6:
+               *srcreg &= ~mask;
+               break;
+           case 7:
+               *srcreg ^= mask;
+               break;
+           default:
+               break;
+           }
+       }
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0xbb
+****************************************************************************/
+void x86emuOp2_btc_R(u8 X86EMU_UNUSED(op2))
+{
+    int mod, rl, rh;
+    uint srcoffset;
+    int bit,disp;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("BTC\t");
+    FETCH_DECODE_MODRM(mod, rh, rl);
+    if (mod < 3) {
+       srcoffset = decode_rmXX_address(mod, rl);
+       DECODE_PRINTF(",");
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 srcval,mask;
+           u32 *shiftreg;
+
+           shiftreg = DECODE_RM_LONG_REGISTER(rh);
+           TRACE_AND_STEP();
+           bit = *shiftreg & 0x1F;
+           disp = (s16)*shiftreg >> 5;
+           srcval = fetch_data_long(srcoffset+disp);
+           mask = (0x1 << bit);
+           CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+           store_data_long(srcoffset+disp, srcval ^ mask);
+       } else {
+           u16 srcval,mask;
+           u16 *shiftreg;
+
+           shiftreg = DECODE_RM_WORD_REGISTER(rh);
+           TRACE_AND_STEP();
+           bit = *shiftreg & 0xF;
+           disp = (s16)*shiftreg >> 4;
+           srcval = fetch_data_word(srcoffset+disp);
+           mask = (u16)(0x1 << bit);
+           CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+           store_data_word(srcoffset+disp, (u16)(srcval ^ mask));
+       }
+    } else {                    /* register to register */
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 *srcreg,*shiftreg;
+           u32 mask;
+
+           srcreg = DECODE_RM_LONG_REGISTER(rl);
+           DECODE_PRINTF(",");
+           shiftreg = DECODE_RM_LONG_REGISTER(rh);
+           TRACE_AND_STEP();
+           bit = *shiftreg & 0x1F;
+           mask = (0x1 << bit);
+           CONDITIONAL_SET_FLAG(*srcreg & mask,F_CF);
+           *srcreg ^= mask;
+       } else {
+           u16 *srcreg,*shiftreg;
+           u16 mask;
+
+           srcreg = DECODE_RM_WORD_REGISTER(rl);
+           DECODE_PRINTF(",");
+           shiftreg = DECODE_RM_WORD_REGISTER(rh);
+           TRACE_AND_STEP();
+           bit = *shiftreg & 0xF;
+           mask = (u16)(0x1 << bit);
+           CONDITIONAL_SET_FLAG(*srcreg & mask,F_CF);
+           *srcreg ^= mask;
+       }
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0xbc
+****************************************************************************/
+void x86emuOp2_bsf(u8 X86EMU_UNUSED(op2))
+{
+    int mod, rl, rh;
+    uint srcoffset;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("BSF\n");
+    FETCH_DECODE_MODRM(mod, rh, rl);
+    if (mod < 3) {
+       srcoffset = decode_rmXX_address(mod, rl);
+       DECODE_PRINTF(",");
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 srcval, *dstreg;
+
+           dstreg = DECODE_RM_LONG_REGISTER(rh);
+           TRACE_AND_STEP();
+           srcval = fetch_data_long(srcoffset);
+           CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
+           for(*dstreg = 0; *dstreg < 32; (*dstreg)++)
+               if ((srcval >> *dstreg) & 1) break;
+       } else {
+           u16 srcval, *dstreg;
+
+           dstreg = DECODE_RM_WORD_REGISTER(rh);
+           TRACE_AND_STEP();
+           srcval = fetch_data_word(srcoffset);
+           CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
+           for(*dstreg = 0; *dstreg < 16; (*dstreg)++)
+               if ((srcval >> *dstreg) & 1) break;
+       }
+    } else {            /* register to register */
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 *srcreg, *dstreg;
+
+           srcreg = DECODE_RM_LONG_REGISTER(rl);
+           DECODE_PRINTF(",");
+           dstreg = DECODE_RM_LONG_REGISTER(rh);
+           TRACE_AND_STEP();
+           CONDITIONAL_SET_FLAG(*srcreg == 0, F_ZF);
+           for(*dstreg = 0; *dstreg < 32; (*dstreg)++)
+               if ((*srcreg >> *dstreg) & 1) break;
+       } else {
+           u16 *srcreg, *dstreg;
+
+           srcreg = DECODE_RM_WORD_REGISTER(rl);
+           DECODE_PRINTF(",");
+           dstreg = DECODE_RM_WORD_REGISTER(rh);
+           TRACE_AND_STEP();
+           CONDITIONAL_SET_FLAG(*srcreg == 0, F_ZF);
+           for(*dstreg = 0; *dstreg < 16; (*dstreg)++)
+               if ((*srcreg >> *dstreg) & 1) break;
+       }
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0xbd
+****************************************************************************/
+void x86emuOp2_bsr(u8 X86EMU_UNUSED(op2))
+{
+    int mod, rl, rh;
+    uint srcoffset;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("BSF\n");
+    FETCH_DECODE_MODRM(mod, rh, rl);
+    if (mod < 3) {
+       srcoffset = decode_rmXX_address(mod, rl);
+       DECODE_PRINTF(",");
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 srcval, *dstreg;
+
+           dstreg = DECODE_RM_LONG_REGISTER(rh);
+           TRACE_AND_STEP();
+           srcval = fetch_data_long(srcoffset);
+           CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
+           for(*dstreg = 31; *dstreg > 0; (*dstreg)--)
+               if ((srcval >> *dstreg) & 1) break;
+       } else {
+           u16 srcval, *dstreg;
+
+           dstreg = DECODE_RM_WORD_REGISTER(rh);
+           TRACE_AND_STEP();
+           srcval = fetch_data_word(srcoffset);
+           CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
+           for(*dstreg = 15; *dstreg > 0; (*dstreg)--)
+               if ((srcval >> *dstreg) & 1) break;
+       }
+    } else {            /* register to register */
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 *srcreg, *dstreg;
+
+           srcreg = DECODE_RM_LONG_REGISTER(rl);
+           DECODE_PRINTF(",");
+           dstreg = DECODE_RM_LONG_REGISTER(rh);
+           TRACE_AND_STEP();
+           CONDITIONAL_SET_FLAG(*srcreg == 0, F_ZF);
+           for(*dstreg = 31; *dstreg > 0; (*dstreg)--)
+               if ((*srcreg >> *dstreg) & 1) break;
+       } else {
+           u16 *srcreg, *dstreg;
+
+           srcreg = DECODE_RM_WORD_REGISTER(rl);
+           DECODE_PRINTF(",");
+           dstreg = DECODE_RM_WORD_REGISTER(rh);
+           TRACE_AND_STEP();
+           CONDITIONAL_SET_FLAG(*srcreg == 0, F_ZF);
+           for(*dstreg = 15; *dstreg > 0; (*dstreg)--)
+               if ((*srcreg >> *dstreg) & 1) break;
+       }
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0xbe
+****************************************************************************/
+void x86emuOp2_movsx_byte_R_RM(u8 X86EMU_UNUSED(op2))
+{
+    int mod, rl, rh;
+    uint srcoffset;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("MOVSX\t");
+    FETCH_DECODE_MODRM(mod, rh, rl);
+    if (mod < 3) {
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 *destreg;
+           u32 srcval;
+
+           destreg = DECODE_RM_LONG_REGISTER(rh);
+           DECODE_PRINTF(",");
+           srcoffset = decode_rmXX_address(mod, rl);
+           srcval = (s32)((s8)fetch_data_byte(srcoffset));
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           *destreg = srcval;
+       } else {
+           u16 *destreg;
+           u16 srcval;
+
+           destreg = DECODE_RM_WORD_REGISTER(rh);
+           DECODE_PRINTF(",");
+           srcoffset = decode_rmXX_address(mod, rl);
+           srcval = (s16)((s8)fetch_data_byte(srcoffset));
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           *destreg = srcval;
+       }
+    } else {                    /* register to register */
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           u32 *destreg;
+           u8  *srcreg;
+
+           destreg = DECODE_RM_LONG_REGISTER(rh);
+           DECODE_PRINTF(",");
+           srcreg = DECODE_RM_BYTE_REGISTER(rl);
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           *destreg = (s32)((s8)*srcreg);
+       } else {
+           u16 *destreg;
+           u8  *srcreg;
+
+           destreg = DECODE_RM_WORD_REGISTER(rh);
+           DECODE_PRINTF(",");
+           srcreg = DECODE_RM_BYTE_REGISTER(rl);
+           DECODE_PRINTF("\n");
+           TRACE_AND_STEP();
+           *destreg = (s16)((s8)*srcreg);
+       }
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0xbf
+****************************************************************************/
+void x86emuOp2_movsx_word_R_RM(u8 X86EMU_UNUSED(op2))
+{
+    int mod, rl, rh;
+    uint srcoffset;
+    u32 *destreg;
+    u32 srcval;
+    u16 *srcreg;
+
+    START_OF_INSTR();
+    DECODE_PRINTF("MOVSX\t");
+    FETCH_DECODE_MODRM(mod, rh, rl);
+    if (mod < 3) {
+       destreg = DECODE_RM_LONG_REGISTER(rh);
+       DECODE_PRINTF(",");
+       srcoffset = decode_rmXX_address(mod, rl);
+       srcval = (s32)((s16)fetch_data_word(srcoffset));
+       DECODE_PRINTF("\n");
+       TRACE_AND_STEP();
+       *destreg = srcval;
+    } else {                    /* register to register */
+       destreg = DECODE_RM_LONG_REGISTER(rh);
+       DECODE_PRINTF(",");
+       srcreg = DECODE_RM_WORD_REGISTER(rl);
+       DECODE_PRINTF("\n");
+       TRACE_AND_STEP();
+       *destreg = (s32)((s16)*srcreg);
+    }
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/***************************************************************************
+ * Double byte operation code table:
+ **************************************************************************/
+void (*x86emu_optab2[256])(u8) __attribute__((section(".got2"))) =
+{
+/*  0x00 */ x86emuOp2_illegal_op,  /* Group F (ring 0 PM)      */
+/*  0x01 */ x86emuOp2_illegal_op,  /* Group G (ring 0 PM)      */
+/*  0x02 */ x86emuOp2_illegal_op,  /* lar (ring 0 PM)         */
+/*  0x03 */ x86emuOp2_illegal_op,  /* lsl (ring 0 PM)         */
+/*  0x04 */ x86emuOp2_illegal_op,
+/*  0x05 */ x86emuOp2_illegal_op,  /* loadall (undocumented)   */
+/*  0x06 */ x86emuOp2_illegal_op,  /* clts (ring 0 PM)        */
+/*  0x07 */ x86emuOp2_illegal_op,  /* loadall (undocumented)   */
+/*  0x08 */ x86emuOp2_illegal_op,  /* invd (ring 0 PM)        */
+/*  0x09 */ x86emuOp2_illegal_op,  /* wbinvd (ring 0 PM)       */
+/*  0x0a */ x86emuOp2_illegal_op,
+/*  0x0b */ x86emuOp2_illegal_op,
+/*  0x0c */ x86emuOp2_illegal_op,
+/*  0x0d */ x86emuOp2_illegal_op,
+/*  0x0e */ x86emuOp2_illegal_op,
+/*  0x0f */ x86emuOp2_illegal_op,
+
+/*  0x10 */ x86emuOp2_illegal_op,
+/*  0x11 */ x86emuOp2_illegal_op,
+/*  0x12 */ x86emuOp2_illegal_op,
+/*  0x13 */ x86emuOp2_illegal_op,
+/*  0x14 */ x86emuOp2_illegal_op,
+/*  0x15 */ x86emuOp2_illegal_op,
+/*  0x16 */ x86emuOp2_illegal_op,
+/*  0x17 */ x86emuOp2_illegal_op,
+/*  0x18 */ x86emuOp2_illegal_op,
+/*  0x19 */ x86emuOp2_illegal_op,
+/*  0x1a */ x86emuOp2_illegal_op,
+/*  0x1b */ x86emuOp2_illegal_op,
+/*  0x1c */ x86emuOp2_illegal_op,
+/*  0x1d */ x86emuOp2_illegal_op,
+/*  0x1e */ x86emuOp2_illegal_op,
+/*  0x1f */ x86emuOp2_illegal_op,
+
+/*  0x20 */ x86emuOp2_illegal_op,  /* mov reg32,creg (ring 0 PM) */
+/*  0x21 */ x86emuOp2_illegal_op,  /* mov reg32,dreg (ring 0 PM) */
+/*  0x22 */ x86emuOp2_illegal_op,  /* mov creg,reg32 (ring 0 PM) */
+/*  0x23 */ x86emuOp2_illegal_op,  /* mov dreg,reg32 (ring 0 PM) */
+/*  0x24 */ x86emuOp2_illegal_op,  /* mov reg32,treg (ring 0 PM) */
+/*  0x25 */ x86emuOp2_illegal_op,
+/*  0x26 */ x86emuOp2_illegal_op,  /* mov treg,reg32 (ring 0 PM) */
+/*  0x27 */ x86emuOp2_illegal_op,
+/*  0x28 */ x86emuOp2_illegal_op,
+/*  0x29 */ x86emuOp2_illegal_op,
+/*  0x2a */ x86emuOp2_illegal_op,
+/*  0x2b */ x86emuOp2_illegal_op,
+/*  0x2c */ x86emuOp2_illegal_op,
+/*  0x2d */ x86emuOp2_illegal_op,
+/*  0x2e */ x86emuOp2_illegal_op,
+/*  0x2f */ x86emuOp2_illegal_op,
+
+/*  0x30 */ x86emuOp2_illegal_op,
+/*  0x31 */ x86emuOp2_illegal_op,
+/*  0x32 */ x86emuOp2_illegal_op,
+/*  0x33 */ x86emuOp2_illegal_op,
+/*  0x34 */ x86emuOp2_illegal_op,
+/*  0x35 */ x86emuOp2_illegal_op,
+/*  0x36 */ x86emuOp2_illegal_op,
+/*  0x37 */ x86emuOp2_illegal_op,
+/*  0x38 */ x86emuOp2_illegal_op,
+/*  0x39 */ x86emuOp2_illegal_op,
+/*  0x3a */ x86emuOp2_illegal_op,
+/*  0x3b */ x86emuOp2_illegal_op,
+/*  0x3c */ x86emuOp2_illegal_op,
+/*  0x3d */ x86emuOp2_illegal_op,
+/*  0x3e */ x86emuOp2_illegal_op,
+/*  0x3f */ x86emuOp2_illegal_op,
+
+/*  0x40 */ x86emuOp2_illegal_op,
+/*  0x41 */ x86emuOp2_illegal_op,
+/*  0x42 */ x86emuOp2_illegal_op,
+/*  0x43 */ x86emuOp2_illegal_op,
+/*  0x44 */ x86emuOp2_illegal_op,
+/*  0x45 */ x86emuOp2_illegal_op,
+/*  0x46 */ x86emuOp2_illegal_op,
+/*  0x47 */ x86emuOp2_illegal_op,
+/*  0x48 */ x86emuOp2_illegal_op,
+/*  0x49 */ x86emuOp2_illegal_op,
+/*  0x4a */ x86emuOp2_illegal_op,
+/*  0x4b */ x86emuOp2_illegal_op,
+/*  0x4c */ x86emuOp2_illegal_op,
+/*  0x4d */ x86emuOp2_illegal_op,
+/*  0x4e */ x86emuOp2_illegal_op,
+/*  0x4f */ x86emuOp2_illegal_op,
+
+/*  0x50 */ x86emuOp2_illegal_op,
+/*  0x51 */ x86emuOp2_illegal_op,
+/*  0x52 */ x86emuOp2_illegal_op,
+/*  0x53 */ x86emuOp2_illegal_op,
+/*  0x54 */ x86emuOp2_illegal_op,
+/*  0x55 */ x86emuOp2_illegal_op,
+/*  0x56 */ x86emuOp2_illegal_op,
+/*  0x57 */ x86emuOp2_illegal_op,
+/*  0x58 */ x86emuOp2_illegal_op,
+/*  0x59 */ x86emuOp2_illegal_op,
+/*  0x5a */ x86emuOp2_illegal_op,
+/*  0x5b */ x86emuOp2_illegal_op,
+/*  0x5c */ x86emuOp2_illegal_op,
+/*  0x5d */ x86emuOp2_illegal_op,
+/*  0x5e */ x86emuOp2_illegal_op,
+/*  0x5f */ x86emuOp2_illegal_op,
+
+/*  0x60 */ x86emuOp2_illegal_op,
+/*  0x61 */ x86emuOp2_illegal_op,
+/*  0x62 */ x86emuOp2_illegal_op,
+/*  0x63 */ x86emuOp2_illegal_op,
+/*  0x64 */ x86emuOp2_illegal_op,
+/*  0x65 */ x86emuOp2_illegal_op,
+/*  0x66 */ x86emuOp2_illegal_op,
+/*  0x67 */ x86emuOp2_illegal_op,
+/*  0x68 */ x86emuOp2_illegal_op,
+/*  0x69 */ x86emuOp2_illegal_op,
+/*  0x6a */ x86emuOp2_illegal_op,
+/*  0x6b */ x86emuOp2_illegal_op,
+/*  0x6c */ x86emuOp2_illegal_op,
+/*  0x6d */ x86emuOp2_illegal_op,
+/*  0x6e */ x86emuOp2_illegal_op,
+/*  0x6f */ x86emuOp2_illegal_op,
+
+/*  0x70 */ x86emuOp2_illegal_op,
+/*  0x71 */ x86emuOp2_illegal_op,
+/*  0x72 */ x86emuOp2_illegal_op,
+/*  0x73 */ x86emuOp2_illegal_op,
+/*  0x74 */ x86emuOp2_illegal_op,
+/*  0x75 */ x86emuOp2_illegal_op,
+/*  0x76 */ x86emuOp2_illegal_op,
+/*  0x77 */ x86emuOp2_illegal_op,
+/*  0x78 */ x86emuOp2_illegal_op,
+/*  0x79 */ x86emuOp2_illegal_op,
+/*  0x7a */ x86emuOp2_illegal_op,
+/*  0x7b */ x86emuOp2_illegal_op,
+/*  0x7c */ x86emuOp2_illegal_op,
+/*  0x7d */ x86emuOp2_illegal_op,
+/*  0x7e */ x86emuOp2_illegal_op,
+/*  0x7f */ x86emuOp2_illegal_op,
+
+/*  0x80 */ x86emuOp2_long_jump,
+/*  0x81 */ x86emuOp2_long_jump,
+/*  0x82 */ x86emuOp2_long_jump,
+/*  0x83 */ x86emuOp2_long_jump,
+/*  0x84 */ x86emuOp2_long_jump,
+/*  0x85 */ x86emuOp2_long_jump,
+/*  0x86 */ x86emuOp2_long_jump,
+/*  0x87 */ x86emuOp2_long_jump,
+/*  0x88 */ x86emuOp2_long_jump,
+/*  0x89 */ x86emuOp2_long_jump,
+/*  0x8a */ x86emuOp2_long_jump,
+/*  0x8b */ x86emuOp2_long_jump,
+/*  0x8c */ x86emuOp2_long_jump,
+/*  0x8d */ x86emuOp2_long_jump,
+/*  0x8e */ x86emuOp2_long_jump,
+/*  0x8f */ x86emuOp2_long_jump,
+
+/*  0x90 */ x86emuOp2_set_byte,
+/*  0x91 */ x86emuOp2_set_byte,
+/*  0x92 */ x86emuOp2_set_byte,
+/*  0x93 */ x86emuOp2_set_byte,
+/*  0x94 */ x86emuOp2_set_byte,
+/*  0x95 */ x86emuOp2_set_byte,
+/*  0x96 */ x86emuOp2_set_byte,
+/*  0x97 */ x86emuOp2_set_byte,
+/*  0x98 */ x86emuOp2_set_byte,
+/*  0x99 */ x86emuOp2_set_byte,
+/*  0x9a */ x86emuOp2_set_byte,
+/*  0x9b */ x86emuOp2_set_byte,
+/*  0x9c */ x86emuOp2_set_byte,
+/*  0x9d */ x86emuOp2_set_byte,
+/*  0x9e */ x86emuOp2_set_byte,
+/*  0x9f */ x86emuOp2_set_byte,
+
+/*  0xa0 */ x86emuOp2_push_FS,
+/*  0xa1 */ x86emuOp2_pop_FS,
+/*  0xa2 */ x86emuOp2_illegal_op,
+/*  0xa3 */ x86emuOp2_bt_R,
+/*  0xa4 */ x86emuOp2_shld_IMM,
+/*  0xa5 */ x86emuOp2_shld_CL,
+/*  0xa6 */ x86emuOp2_illegal_op,
+/*  0xa7 */ x86emuOp2_illegal_op,
+/*  0xa8 */ x86emuOp2_push_GS,
+/*  0xa9 */ x86emuOp2_pop_GS,
+/*  0xaa */ x86emuOp2_illegal_op,
+/*  0xab */ x86emuOp2_bt_R,
+/*  0xac */ x86emuOp2_shrd_IMM,
+/*  0xad */ x86emuOp2_shrd_CL,
+/*  0xae */ x86emuOp2_illegal_op,
+/*  0xaf */ x86emuOp2_imul_R_RM,
+
+/*  0xb0 */ x86emuOp2_illegal_op,  /* TODO: cmpxchg */
+/*  0xb1 */ x86emuOp2_illegal_op,  /* TODO: cmpxchg */
+/*  0xb2 */ x86emuOp2_lss_R_IMM,
+/*  0xb3 */ x86emuOp2_btr_R,
+/*  0xb4 */ x86emuOp2_lfs_R_IMM,
+/*  0xb5 */ x86emuOp2_lgs_R_IMM,
+/*  0xb6 */ x86emuOp2_movzx_byte_R_RM,
+/*  0xb7 */ x86emuOp2_movzx_word_R_RM,
+/*  0xb8 */ x86emuOp2_illegal_op,
+/*  0xb9 */ x86emuOp2_illegal_op,
+/*  0xba */ x86emuOp2_btX_I,
+/*  0xbb */ x86emuOp2_btc_R,
+/*  0xbc */ x86emuOp2_bsf,
+/*  0xbd */ x86emuOp2_bsr,
+/*  0xbe */ x86emuOp2_movsx_byte_R_RM,
+/*  0xbf */ x86emuOp2_movsx_word_R_RM,
+
+/*  0xc0 */ x86emuOp2_illegal_op,  /* TODO: xadd */
+/*  0xc1 */ x86emuOp2_illegal_op,  /* TODO: xadd */
+/*  0xc2 */ x86emuOp2_illegal_op,
+/*  0xc3 */ x86emuOp2_illegal_op,
+/*  0xc4 */ x86emuOp2_illegal_op,
+/*  0xc5 */ x86emuOp2_illegal_op,
+/*  0xc6 */ x86emuOp2_illegal_op,
+/*  0xc7 */ x86emuOp2_illegal_op,
+/*  0xc8 */ x86emuOp2_illegal_op,  /* TODO: bswap */
+/*  0xc9 */ x86emuOp2_illegal_op,  /* TODO: bswap */
+/*  0xca */ x86emuOp2_illegal_op,  /* TODO: bswap */
+/*  0xcb */ x86emuOp2_illegal_op,  /* TODO: bswap */
+/*  0xcc */ x86emuOp2_illegal_op,  /* TODO: bswap */
+/*  0xcd */ x86emuOp2_illegal_op,  /* TODO: bswap */
+/*  0xce */ x86emuOp2_illegal_op,  /* TODO: bswap */
+/*  0xcf */ x86emuOp2_illegal_op,  /* TODO: bswap */
+
+/*  0xd0 */ x86emuOp2_illegal_op,
+/*  0xd1 */ x86emuOp2_illegal_op,
+/*  0xd2 */ x86emuOp2_illegal_op,
+/*  0xd3 */ x86emuOp2_illegal_op,
+/*  0xd4 */ x86emuOp2_illegal_op,
+/*  0xd5 */ x86emuOp2_illegal_op,
+/*  0xd6 */ x86emuOp2_illegal_op,
+/*  0xd7 */ x86emuOp2_illegal_op,
+/*  0xd8 */ x86emuOp2_illegal_op,
+/*  0xd9 */ x86emuOp2_illegal_op,
+/*  0xda */ x86emuOp2_illegal_op,
+/*  0xdb */ x86emuOp2_illegal_op,
+/*  0xdc */ x86emuOp2_illegal_op,
+/*  0xdd */ x86emuOp2_illegal_op,
+/*  0xde */ x86emuOp2_illegal_op,
+/*  0xdf */ x86emuOp2_illegal_op,
+
+/*  0xe0 */ x86emuOp2_illegal_op,
+/*  0xe1 */ x86emuOp2_illegal_op,
+/*  0xe2 */ x86emuOp2_illegal_op,
+/*  0xe3 */ x86emuOp2_illegal_op,
+/*  0xe4 */ x86emuOp2_illegal_op,
+/*  0xe5 */ x86emuOp2_illegal_op,
+/*  0xe6 */ x86emuOp2_illegal_op,
+/*  0xe7 */ x86emuOp2_illegal_op,
+/*  0xe8 */ x86emuOp2_illegal_op,
+/*  0xe9 */ x86emuOp2_illegal_op,
+/*  0xea */ x86emuOp2_illegal_op,
+/*  0xeb */ x86emuOp2_illegal_op,
+/*  0xec */ x86emuOp2_illegal_op,
+/*  0xed */ x86emuOp2_illegal_op,
+/*  0xee */ x86emuOp2_illegal_op,
+/*  0xef */ x86emuOp2_illegal_op,
+
+/*  0xf0 */ x86emuOp2_illegal_op,
+/*  0xf1 */ x86emuOp2_illegal_op,
+/*  0xf2 */ x86emuOp2_illegal_op,
+/*  0xf3 */ x86emuOp2_illegal_op,
+/*  0xf4 */ x86emuOp2_illegal_op,
+/*  0xf5 */ x86emuOp2_illegal_op,
+/*  0xf6 */ x86emuOp2_illegal_op,
+/*  0xf7 */ x86emuOp2_illegal_op,
+/*  0xf8 */ x86emuOp2_illegal_op,
+/*  0xf9 */ x86emuOp2_illegal_op,
+/*  0xfa */ x86emuOp2_illegal_op,
+/*  0xfb */ x86emuOp2_illegal_op,
+/*  0xfc */ x86emuOp2_illegal_op,
+/*  0xfd */ x86emuOp2_illegal_op,
+/*  0xfe */ x86emuOp2_illegal_op,
+/*  0xff */ x86emuOp2_illegal_op,
+};
diff --git a/drivers/bios_emulator/x86emu/prim_ops.c b/drivers/bios_emulator/x86emu/prim_ops.c
new file mode 100644 (file)
index 0000000..e0827d7
--- /dev/null
@@ -0,0 +1,2445 @@
+/****************************************************************************
+*
+*                      Realmode X86 Emulator Library
+*
+*              Copyright (C) 1991-2004 SciTech Software, Inc.
+*                   Copyright (C) David Mosberger-Tang
+*                     Copyright (C) 1999 Egbert Eich
+*
+*  ========================================================================
+*
+*  Permission to use, copy, modify, distribute, and sell this software and
+*  its documentation for any purpose is hereby granted without fee,
+*  provided that the above copyright notice appear in all copies and that
+*  both that copyright notice and this permission notice appear in
+*  supporting documentation, and that the name of the authors not be used
+*  in advertising or publicity pertaining to distribution of the software
+*  without specific, written prior permission. The authors makes no
+*  representations about the suitability of this software for any purpose.
+*  It is provided "as is" without express or implied warranty.
+*
+*  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+*  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+*  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+*  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+*  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+*  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+*  PERFORMANCE OF THIS SOFTWARE.
+*
+*  ========================================================================
+*
+* Language:    ANSI C
+* Environment: Any
+* Developer:   Kendall Bennett
+*
+* Description: This file contains the code to implement the primitive
+*              machine operations used by the emulation code in ops.c
+*
+* Carry Chain Calculation
+*
+* This represents a somewhat expensive calculation which is
+* apparently required to emulate the setting of the OF343364 and AF flag.
+* The latter is not so important, but the former is.  The overflow
+* flag is the XOR of the top two bits of the carry chain for an
+* addition (similar for subtraction).  Since we do not want to
+* simulate the addition in a bitwise manner, we try to calculate the
+* carry chain given the two operands and the result.
+*
+* So, given the following table, which represents the addition of two
+* bits, we can derive a formula for the carry chain.
+*
+* a   b          cin   r     cout
+* 0   0          0     0     0
+* 0   0          1     1     0
+* 0   1          0     1     0
+* 0   1          1     0     1
+* 1   0          0     1     0
+* 1   0          1     0     1
+* 1   1          0     0     1
+* 1   1          1     1     1
+*
+* Construction of table for cout:
+*
+* ab
+* r  \ 00   01   11  10
+* |------------------
+* 0  |  0    1    1   1
+* 1  |  0    0    1   0
+*
+* By inspection, one gets:  cc = ab +  r'(a + b)
+*
+* That represents alot of operations, but NO CHOICE....
+*
+* Borrow Chain Calculation.
+*
+* The following table represents the subtraction of two bits, from
+* which we can derive a formula for the borrow chain.
+*
+* a   b          bin   r     bout
+* 0   0          0     0     0
+* 0   0          1     1     1
+* 0   1          0     1     1
+* 0   1          1     0     1
+* 1   0          0     1     0
+* 1   0          1     0     0
+* 1   1          0     0     0
+* 1   1          1     1     1
+*
+* Construction of table for cout:
+*
+* ab
+* r  \ 00   01   11  10
+* |------------------
+* 0  |  0    1    0   0
+* 1  |  1    1    1   0
+*
+* By inspection, one gets:  bc = a'b + r(a' + b)
+*
+****************************************************************************/
+
+#define PRIM_OPS_NO_REDEFINE_ASM
+#include "x86emu/x86emui.h"
+
+/*------------------------- Global Variables ------------------------------*/
+
+static u32 x86emu_parity_tab[8] =
+{
+    0x96696996,
+    0x69969669,
+    0x69969669,
+    0x96696996,
+    0x69969669,
+    0x96696996,
+    0x96696996,
+    0x69969669,
+};
+
+#define PARITY(x)   (((x86emu_parity_tab[(x) / 32] >> ((x) % 32)) & 1) == 0)
+#define XOR2(x)            (((x) ^ ((x)>>1)) & 0x1)
+/*----------------------------- Implementation ----------------------------*/
+int abs(int v)
+{
+       return (v>0)?v:-v;
+}
+
+/*----------------------------- Implementation ----------------------------*/
+
+
+/*--------- Side effects helper functions -------*/
+
+/****************************************************************************
+REMARKS:
+implements side efects for byte operations that don't overflow
+****************************************************************************/
+
+static void set_parity_flag(u32 res)
+{
+    CONDITIONAL_SET_FLAG(PARITY(res & 0xFF), F_PF);
+}
+
+static void set_szp_flags_8(u8 res)
+{
+    CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
+    CONDITIONAL_SET_FLAG(res == 0, F_ZF);
+    set_parity_flag(res);
+}
+
+static void set_szp_flags_16(u16 res)
+{
+    CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+    CONDITIONAL_SET_FLAG(res == 0, F_ZF);
+    set_parity_flag(res);
+}
+
+static void set_szp_flags_32(u32 res)
+{
+    CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+    CONDITIONAL_SET_FLAG(res == 0, F_ZF);
+    set_parity_flag(res);
+}
+
+static void no_carry_byte_side_eff(u8 res)
+{
+    CLEAR_FLAG(F_OF);
+    CLEAR_FLAG(F_CF);
+    CLEAR_FLAG(F_AF);
+    set_szp_flags_8(res);
+}
+
+static void no_carry_word_side_eff(u16 res)
+{
+    CLEAR_FLAG(F_OF);
+    CLEAR_FLAG(F_CF);
+    CLEAR_FLAG(F_AF);
+    set_szp_flags_16(res);
+}
+
+static void no_carry_long_side_eff(u32 res)
+{
+    CLEAR_FLAG(F_OF);
+    CLEAR_FLAG(F_CF);
+    CLEAR_FLAG(F_AF);
+    set_szp_flags_32(res);
+}
+
+static void calc_carry_chain(int bits, u32 d, u32 s, u32 res, int set_carry)
+{
+    u32 cc;
+
+    cc = (s & d) | ((~res) & (s | d));
+    CONDITIONAL_SET_FLAG(XOR2(cc >> (bits - 2)), F_OF);
+    CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
+    if (set_carry) {
+       CONDITIONAL_SET_FLAG(res & (1 << bits), F_CF);
+    }
+}
+
+static void calc_borrow_chain(int bits, u32 d, u32 s, u32 res, int set_carry)
+{
+    u32 bc;
+
+    bc = (res & (~d | s)) | (~d & s);
+    CONDITIONAL_SET_FLAG(XOR2(bc >> (bits - 2)), F_OF);
+    CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+    if (set_carry) {
+       CONDITIONAL_SET_FLAG(bc & (1 << (bits - 1)), F_CF);
+    }
+}
+
+/****************************************************************************
+REMARKS:
+Implements the AAA instruction and side effects.
+****************************************************************************/
+u16 aaa_word(u16 d)
+{
+    u16 res;
+    if ((d & 0xf) > 0x9 || ACCESS_FLAG(F_AF)) {
+       d += 0x6;
+       d += 0x100;
+       SET_FLAG(F_AF);
+       SET_FLAG(F_CF);
+    } else {
+       CLEAR_FLAG(F_CF);
+       CLEAR_FLAG(F_AF);
+    }
+    res = (u16)(d & 0xFF0F);
+    set_szp_flags_16(res);
+    return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the AAA instruction and side effects.
+****************************************************************************/
+u16 aas_word(u16 d)
+{
+    u16 res;
+    if ((d & 0xf) > 0x9 || ACCESS_FLAG(F_AF)) {
+       d -= 0x6;
+       d -= 0x100;
+       SET_FLAG(F_AF);
+       SET_FLAG(F_CF);
+    } else {
+       CLEAR_FLAG(F_CF);
+       CLEAR_FLAG(F_AF);
+    }
+    res = (u16)(d & 0xFF0F);
+    set_szp_flags_16(res);
+    return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the AAD instruction and side effects.
+****************************************************************************/
+u16 aad_word(u16 d)
+{
+    u16 l;
+    u8 hb, lb;
+
+    hb = (u8)((d >> 8) & 0xff);
+    lb = (u8)((d & 0xff));
+    l = (u16)((lb + 10 * hb) & 0xFF);
+
+    no_carry_byte_side_eff(l & 0xFF);
+    return l;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the AAM instruction and side effects.
+****************************************************************************/
+u16 aam_word(u8 d)
+{
+    u16 h, l;
+
+    h = (u16)(d / 10);
+    l = (u16)(d % 10);
+    l |= (u16)(h << 8);
+
+    no_carry_byte_side_eff(l & 0xFF);
+    return l;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the ADC instruction and side effects.
+****************************************************************************/
+u8 adc_byte(u8 d, u8 s)
+{
+    u32 res;   /* all operands in native machine order */
+
+    res = d + s;
+    if (ACCESS_FLAG(F_CF)) res++;
+
+    set_szp_flags_8(res);
+    calc_carry_chain(8,s,d,res,1);
+
+    return (u8)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the ADC instruction and side effects.
+****************************************************************************/
+u16 adc_word(u16 d, u16 s)
+{
+    u32 res;   /* all operands in native machine order */
+
+    res = d + s;
+    if (ACCESS_FLAG(F_CF))
+       res++;
+
+    set_szp_flags_16((u16)res);
+    calc_carry_chain(16,s,d,res,1);
+
+    return (u16)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the ADC instruction and side effects.
+****************************************************************************/
+u32 adc_long(u32 d, u32 s)
+{
+    u32 lo;    /* all operands in native machine order */
+    u32 hi;
+    u32 res;
+
+    lo = (d & 0xFFFF) + (s & 0xFFFF);
+    res = d + s;
+
+    if (ACCESS_FLAG(F_CF)) {
+       lo++;
+       res++;
+    }
+
+    hi = (lo >> 16) + (d >> 16) + (s >> 16);
+
+    set_szp_flags_32(res);
+    calc_carry_chain(32,s,d,res,0);
+
+    CONDITIONAL_SET_FLAG(hi & 0x10000, F_CF);
+
+    return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the ADD instruction and side effects.
+****************************************************************************/
+u8 add_byte(u8 d, u8 s)
+{
+    u32 res;   /* all operands in native machine order */
+
+    res = d + s;
+    set_szp_flags_8((u8)res);
+    calc_carry_chain(8,s,d,res,1);
+
+    return (u8)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the ADD instruction and side effects.
+****************************************************************************/
+u16 add_word(u16 d, u16 s)
+{
+    u32 res;   /* all operands in native machine order */
+
+    res = d + s;
+    set_szp_flags_16((u16)res);
+    calc_carry_chain(16,s,d,res,1);
+
+    return (u16)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the ADD instruction and side effects.
+****************************************************************************/
+u32 add_long(u32 d, u32 s)
+{
+    u32 res;
+
+    res = d + s;
+    set_szp_flags_32(res);
+    calc_carry_chain(32,s,d,res,0);
+
+    CONDITIONAL_SET_FLAG(res < d || res < s, F_CF);
+
+    return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the AND instruction and side effects.
+****************************************************************************/
+u8 and_byte(u8 d, u8 s)
+{
+    u8 res;    /* all operands in native machine order */
+
+    res = d & s;
+
+    no_carry_byte_side_eff(res);
+    return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the AND instruction and side effects.
+****************************************************************************/
+u16 and_word(u16 d, u16 s)
+{
+    u16 res;   /* all operands in native machine order */
+
+    res = d & s;
+
+    no_carry_word_side_eff(res);
+    return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the AND instruction and side effects.
+****************************************************************************/
+u32 and_long(u32 d, u32 s)
+{
+    u32 res;   /* all operands in native machine order */
+
+    res = d & s;
+    no_carry_long_side_eff(res);
+    return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the CMP instruction and side effects.
+****************************************************************************/
+u8 cmp_byte(u8 d, u8 s)
+{
+    u32 res;   /* all operands in native machine order */
+
+    res = d - s;
+    set_szp_flags_8((u8)res);
+    calc_borrow_chain(8, d, s, res, 1);
+
+    return d;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the CMP instruction and side effects.
+****************************************************************************/
+u16 cmp_word(u16 d, u16 s)
+{
+    u32 res;   /* all operands in native machine order */
+
+    res = d - s;
+    set_szp_flags_16((u16)res);
+    calc_borrow_chain(16, d, s, res, 1);
+
+    return d;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the CMP instruction and side effects.
+****************************************************************************/
+u32 cmp_long(u32 d, u32 s)
+{
+    u32 res;   /* all operands in native machine order */
+
+    res = d - s;
+    set_szp_flags_32(res);
+    calc_borrow_chain(32, d, s, res, 1);
+
+    return d;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the DAA instruction and side effects.
+****************************************************************************/
+u8 daa_byte(u8 d)
+{
+    u32 res = d;
+    if ((d & 0xf) > 9 || ACCESS_FLAG(F_AF)) {
+       res += 6;
+       SET_FLAG(F_AF);
+    }
+    if (res > 0x9F || ACCESS_FLAG(F_CF)) {
+       res += 0x60;
+       SET_FLAG(F_CF);
+    }
+    set_szp_flags_8((u8)res);
+    return (u8)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the DAS instruction and side effects.
+****************************************************************************/
+u8 das_byte(u8 d)
+{
+    if ((d & 0xf) > 9 || ACCESS_FLAG(F_AF)) {
+       d -= 6;
+       SET_FLAG(F_AF);
+    }
+    if (d > 0x9F || ACCESS_FLAG(F_CF)) {
+       d -= 0x60;
+       SET_FLAG(F_CF);
+    }
+    set_szp_flags_8(d);
+    return d;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the DEC instruction and side effects.
+****************************************************************************/
+u8 dec_byte(u8 d)
+{
+    u32 res;   /* all operands in native machine order */
+
+    res = d - 1;
+    set_szp_flags_8((u8)res);
+    calc_borrow_chain(8, d, 1, res, 0);
+
+    return (u8)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the DEC instruction and side effects.
+****************************************************************************/
+u16 dec_word(u16 d)
+{
+    u32 res;   /* all operands in native machine order */
+
+    res = d - 1;
+    set_szp_flags_16((u16)res);
+    calc_borrow_chain(16, d, 1, res, 0);
+
+    return (u16)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the DEC instruction and side effects.
+****************************************************************************/
+u32 dec_long(u32 d)
+{
+    u32 res;   /* all operands in native machine order */
+
+    res = d - 1;
+
+    set_szp_flags_32(res);
+    calc_borrow_chain(32, d, 1, res, 0);
+
+    return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the INC instruction and side effects.
+****************************************************************************/
+u8 inc_byte(u8 d)
+{
+    u32 res;   /* all operands in native machine order */
+
+    res = d + 1;
+    set_szp_flags_8((u8)res);
+    calc_carry_chain(8, d, 1, res, 0);
+
+    return (u8)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the INC instruction and side effects.
+****************************************************************************/
+u16 inc_word(u16 d)
+{
+    u32 res;   /* all operands in native machine order */
+
+    res = d + 1;
+    set_szp_flags_16((u16)res);
+    calc_carry_chain(16, d, 1, res, 0);
+
+    return (u16)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the INC instruction and side effects.
+****************************************************************************/
+u32 inc_long(u32 d)
+{
+    u32 res;   /* all operands in native machine order */
+
+    res = d + 1;
+    set_szp_flags_32(res);
+    calc_carry_chain(32, d, 1, res, 0);
+
+    return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the OR instruction and side effects.
+****************************************************************************/
+u8 or_byte(u8 d, u8 s)
+{
+    u8 res;    /* all operands in native machine order */
+
+    res = d | s;
+    no_carry_byte_side_eff(res);
+
+    return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the OR instruction and side effects.
+****************************************************************************/
+u16 or_word(u16 d, u16 s)
+{
+    u16 res;   /* all operands in native machine order */
+
+    res = d | s;
+    no_carry_word_side_eff(res);
+    return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the OR instruction and side effects.
+****************************************************************************/
+u32 or_long(u32 d, u32 s)
+{
+    u32 res;   /* all operands in native machine order */
+
+    res = d | s;
+    no_carry_long_side_eff(res);
+    return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the OR instruction and side effects.
+****************************************************************************/
+u8 neg_byte(u8 s)
+{
+    u8 res;
+
+    CONDITIONAL_SET_FLAG(s != 0, F_CF);
+    res = (u8)-s;
+    set_szp_flags_8(res);
+    calc_borrow_chain(8, 0, s, res, 0);
+
+    return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the OR instruction and side effects.
+****************************************************************************/
+u16 neg_word(u16 s)
+{
+    u16 res;
+
+    CONDITIONAL_SET_FLAG(s != 0, F_CF);
+    res = (u16)-s;
+    set_szp_flags_16((u16)res);
+    calc_borrow_chain(16, 0, s, res, 0);
+
+    return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the OR instruction and side effects.
+****************************************************************************/
+u32 neg_long(u32 s)
+{
+    u32 res;
+
+    CONDITIONAL_SET_FLAG(s != 0, F_CF);
+    res = (u32)-s;
+    set_szp_flags_32(res);
+    calc_borrow_chain(32, 0, s, res, 0);
+
+    return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the NOT instruction and side effects.
+****************************************************************************/
+u8 not_byte(u8 s)
+{
+    return ~s;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the NOT instruction and side effects.
+****************************************************************************/
+u16 not_word(u16 s)
+{
+    return ~s;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the NOT instruction and side effects.
+****************************************************************************/
+u32 not_long(u32 s)
+{
+    return ~s;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the RCL instruction and side effects.
+****************************************************************************/
+u8 rcl_byte(u8 d, u8 s)
+{
+    unsigned int res, cnt, mask, cf;
+
+    /* s is the rotate distance.  It varies from 0 - 8. */
+    /* have
+
+       CF  B_7 B_6 B_5 B_4 B_3 B_2 B_1 B_0
+
+       want to rotate through the carry by "s" bits.  We could
+       loop, but that's inefficient.  So the width is 9,
+       and we split into three parts:
+
+       The new carry flag   (was B_n)
+       the stuff in B_n-1 .. B_0
+       the stuff in B_7 .. B_n+1
+
+       The new rotate is done mod 9, and given this,
+       for a rotation of n bits (mod 9) the new carry flag is
+       then located n bits from the MSB.  The low part is
+       then shifted up cnt bits, and the high part is or'd
+       in.  Using CAPS for new values, and lowercase for the
+       original values, this can be expressed as:
+
+       IF n > 0
+       1) CF <-         b_(8-n)
+       2) B_(7) .. B_(n)  <-  b_(8-(n+1)) .. b_0
+       3) B_(n-1) <- cf
+       4) B_(n-2) .. B_0 <-  b_7 .. b_(8-(n-1))
+     */
+    res = d;
+    if ((cnt = s % 9) != 0) {
+       /* extract the new CARRY FLAG. */
+       /* CF <-  b_(8-n)             */
+       cf = (d >> (8 - cnt)) & 0x1;
+
+       /* get the low stuff which rotated
+          into the range B_7 .. B_cnt */
+       /* B_(7) .. B_(n)  <-  b_(8-(n+1)) .. b_0  */
+       /* note that the right hand side done by the mask */
+       res = (d << cnt) & 0xff;
+
+       /* now the high stuff which rotated around
+          into the positions B_cnt-2 .. B_0 */
+       /* B_(n-2) .. B_0 <-  b_7 .. b_(8-(n-1)) */
+       /* shift it downward, 7-(n-2) = 9-n positions.
+          and mask off the result before or'ing in.
+        */
+       mask = (1 << (cnt - 1)) - 1;
+       res |= (d >> (9 - cnt)) & mask;
+
+       /* if the carry flag was set, or it in.  */
+       if (ACCESS_FLAG(F_CF)) {     /* carry flag is set */
+           /*  B_(n-1) <- cf */
+           res |= 1 << (cnt - 1);
+       }
+       /* set the new carry flag, based on the variable "cf" */
+       CONDITIONAL_SET_FLAG(cf, F_CF);
+       /* OVERFLOW is set *IFF* cnt==1, then it is the
+          xor of CF and the most significant bit.  Blecck. */
+       /* parenthesized this expression since it appears to
+          be causing OF to be misset */
+       CONDITIONAL_SET_FLAG(cnt == 1 && XOR2(cf + ((res >> 6) & 0x2)),
+                            F_OF);
+
+    }
+    return (u8)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the RCL instruction and side effects.
+****************************************************************************/
+u16 rcl_word(u16 d, u8 s)
+{
+    unsigned int res, cnt, mask, cf;
+
+    res = d;
+    if ((cnt = s % 17) != 0) {
+       cf = (d >> (16 - cnt)) & 0x1;
+       res = (d << cnt) & 0xffff;
+       mask = (1 << (cnt - 1)) - 1;
+       res |= (d >> (17 - cnt)) & mask;
+       if (ACCESS_FLAG(F_CF)) {
+           res |= 1 << (cnt - 1);
+       }
+       CONDITIONAL_SET_FLAG(cf, F_CF);
+       CONDITIONAL_SET_FLAG(cnt == 1 && XOR2(cf + ((res >> 14) & 0x2)),
+                            F_OF);
+    }
+    return (u16)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the RCL instruction and side effects.
+****************************************************************************/
+u32 rcl_long(u32 d, u8 s)
+{
+    u32 res, cnt, mask, cf;
+
+    res = d;
+    if ((cnt = s % 33) != 0) {
+       cf = (d >> (32 - cnt)) & 0x1;
+       res = (d << cnt) & 0xffffffff;
+       mask = (1 << (cnt - 1)) - 1;
+       res |= (d >> (33 - cnt)) & mask;
+       if (ACCESS_FLAG(F_CF)) {     /* carry flag is set */
+           res |= 1 << (cnt - 1);
+       }
+       CONDITIONAL_SET_FLAG(cf, F_CF);
+       CONDITIONAL_SET_FLAG(cnt == 1 && XOR2(cf + ((res >> 30) & 0x2)),
+                            F_OF);
+    }
+    return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the RCR instruction and side effects.
+****************************************************************************/
+u8 rcr_byte(u8 d, u8 s)
+{
+    u32 res, cnt;
+    u32 mask, cf, ocf = 0;
+
+    /* rotate right through carry */
+    /*
+       s is the rotate distance.  It varies from 0 - 8.
+       d is the byte object rotated.
+
+       have
+
+       CF  B_7 B_6 B_5 B_4 B_3 B_2 B_1 B_0
+
+       The new rotate is done mod 9, and given this,
+       for a rotation of n bits (mod 9) the new carry flag is
+       then located n bits from the LSB.  The low part is
+       then shifted up cnt bits, and the high part is or'd
+       in.  Using CAPS for new values, and lowercase for the
+       original values, this can be expressed as:
+
+       IF n > 0
+       1) CF <-         b_(n-1)
+       2) B_(8-(n+1)) .. B_(0) <-  b_(7) .. b_(n)
+       3) B_(8-n) <- cf
+       4) B_(7) .. B_(8-(n-1)) <-  b_(n-2) .. b_(0)
+     */
+    res = d;
+    if ((cnt = s % 9) != 0) {
+       /* extract the new CARRY FLAG. */
+       /* CF <-  b_(n-1)              */
+       if (cnt == 1) {
+           cf = d & 0x1;
+           /* note hackery here.  Access_flag(..) evaluates to either
+              0 if flag not set
+              non-zero if flag is set.
+              doing access_flag(..) != 0 casts that into either
+              0..1 in any representation of the flags register
+              (i.e. packed bit array or unpacked.)
+            */
+           ocf = ACCESS_FLAG(F_CF) != 0;
+       } else
+           cf = (d >> (cnt - 1)) & 0x1;
+
+       /* B_(8-(n+1)) .. B_(0)  <-  b_(7) .. b_n  */
+       /* note that the right hand side done by the mask
+          This is effectively done by shifting the
+          object to the right.  The result must be masked,
+          in case the object came in and was treated
+          as a negative number.  Needed??? */
+
+       mask = (1 << (8 - cnt)) - 1;
+       res = (d >> cnt) & mask;
+
+       /* now the high stuff which rotated around
+          into the positions B_cnt-2 .. B_0 */
+       /* B_(7) .. B_(8-(n-1)) <-  b_(n-2) .. b_(0) */
+       /* shift it downward, 7-(n-2) = 9-n positions.
+          and mask off the result before or'ing in.
+        */
+       res |= (d << (9 - cnt));
+
+       /* if the carry flag was set, or it in.  */
+       if (ACCESS_FLAG(F_CF)) {     /* carry flag is set */
+           /*  B_(8-n) <- cf */
+           res |= 1 << (8 - cnt);
+       }
+       /* set the new carry flag, based on the variable "cf" */
+       CONDITIONAL_SET_FLAG(cf, F_CF);
+       /* OVERFLOW is set *IFF* cnt==1, then it is the
+          xor of CF and the most significant bit.  Blecck. */
+       /* parenthesized... */
+       if (cnt == 1) {
+           CONDITIONAL_SET_FLAG(XOR2(ocf + ((d >> 6) & 0x2)),
+                                F_OF);
+       }
+    }
+    return (u8)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the RCR instruction and side effects.
+****************************************************************************/
+u16 rcr_word(u16 d, u8 s)
+{
+    u32 res, cnt;
+    u32 mask, cf, ocf = 0;
+
+    /* rotate right through carry */
+    res = d;
+    if ((cnt = s % 17) != 0) {
+       if (cnt == 1) {
+           cf = d & 0x1;
+           ocf = ACCESS_FLAG(F_CF) != 0;
+       } else
+           cf = (d >> (cnt - 1)) & 0x1;
+       mask = (1 << (16 - cnt)) - 1;
+       res = (d >> cnt) & mask;
+       res |= (d << (17 - cnt));
+       if (ACCESS_FLAG(F_CF)) {
+           res |= 1 << (16 - cnt);
+       }
+       CONDITIONAL_SET_FLAG(cf, F_CF);
+       if (cnt == 1) {
+           CONDITIONAL_SET_FLAG(XOR2(ocf + ((d >> 14) & 0x2)),
+                                F_OF);
+       }
+    }
+    return (u16)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the RCR instruction and side effects.
+****************************************************************************/
+u32 rcr_long(u32 d, u8 s)
+{
+    u32 res, cnt;
+    u32 mask, cf, ocf = 0;
+
+    /* rotate right through carry */
+    res = d;
+    if ((cnt = s % 33) != 0) {
+       if (cnt == 1) {
+           cf = d & 0x1;
+           ocf = ACCESS_FLAG(F_CF) != 0;
+       } else
+           cf = (d >> (cnt - 1)) & 0x1;
+       mask = (1 << (32 - cnt)) - 1;
+       res = (d >> cnt) & mask;
+       if (cnt != 1)
+           res |= (d << (33 - cnt));
+       if (ACCESS_FLAG(F_CF)) {     /* carry flag is set */
+           res |= 1 << (32 - cnt);
+       }
+       CONDITIONAL_SET_FLAG(cf, F_CF);
+       if (cnt == 1) {
+           CONDITIONAL_SET_FLAG(XOR2(ocf + ((d >> 30) & 0x2)),
+                                F_OF);
+       }
+    }
+    return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the ROL instruction and side effects.
+****************************************************************************/
+u8 rol_byte(u8 d, u8 s)
+{
+    unsigned int res, cnt, mask;
+
+    /* rotate left */
+    /*
+       s is the rotate distance.  It varies from 0 - 8.
+       d is the byte object rotated.
+
+       have
+
+       CF  B_7 ... B_0
+
+       The new rotate is done mod 8.
+       Much simpler than the "rcl" or "rcr" operations.
+
+       IF n > 0
+       1) B_(7) .. B_(n)  <-  b_(8-(n+1)) .. b_(0)
+       2) B_(n-1) .. B_(0) <-  b_(7) .. b_(8-n)
+     */
+    res = d;
+    if ((cnt = s % 8) != 0) {
+       /* B_(7) .. B_(n)  <-  b_(8-(n+1)) .. b_(0) */
+       res = (d << cnt);
+
+       /* B_(n-1) .. B_(0) <-  b_(7) .. b_(8-n) */
+       mask = (1 << cnt) - 1;
+       res |= (d >> (8 - cnt)) & mask;
+
+       /* set the new carry flag, Note that it is the low order
+          bit of the result!!!                               */
+       CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
+       /* OVERFLOW is set *IFF* s==1, then it is the
+          xor of CF and the most significant bit.  Blecck. */
+       CONDITIONAL_SET_FLAG(s == 1 &&
+                            XOR2((res & 0x1) + ((res >> 6) & 0x2)),
+                            F_OF);
+    } if (s != 0) {
+       /* set the new carry flag, Note that it is the low order
+          bit of the result!!!                               */
+       CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
+    }
+    return (u8)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the ROL instruction and side effects.
+****************************************************************************/
+u16 rol_word(u16 d, u8 s)
+{
+    unsigned int res, cnt, mask;
+
+    res = d;
+    if ((cnt = s % 16) != 0) {
+       res = (d << cnt);
+       mask = (1 << cnt) - 1;
+       res |= (d >> (16 - cnt)) & mask;
+       CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
+       CONDITIONAL_SET_FLAG(s == 1 &&
+                            XOR2((res & 0x1) + ((res >> 14) & 0x2)),
+                            F_OF);
+    } if (s != 0) {
+       /* set the new carry flag, Note that it is the low order
+          bit of the result!!!                               */
+       CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
+    }
+    return (u16)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the ROL instruction and side effects.
+****************************************************************************/
+u32 rol_long(u32 d, u8 s)
+{
+    u32 res, cnt, mask;
+
+    res = d;
+    if ((cnt = s % 32) != 0) {
+       res = (d << cnt);
+       mask = (1 << cnt) - 1;
+       res |= (d >> (32 - cnt)) & mask;
+       CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
+       CONDITIONAL_SET_FLAG(s == 1 &&
+                            XOR2((res & 0x1) + ((res >> 30) & 0x2)),
+                            F_OF);
+    } if (s != 0) {
+       /* set the new carry flag, Note that it is the low order
+          bit of the result!!!                               */
+       CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
+    }
+    return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the ROR instruction and side effects.
+****************************************************************************/
+u8 ror_byte(u8 d, u8 s)
+{
+    unsigned int res, cnt, mask;
+
+    /* rotate right */
+    /*
+       s is the rotate distance.  It varies from 0 - 8.
+       d is the byte object rotated.
+
+       have
+
+       B_7 ... B_0
+
+       The rotate is done mod 8.
+
+       IF n > 0
+       1) B_(8-(n+1)) .. B_(0) <-  b_(7) .. b_(n)
+       2) B_(7) .. B_(8-n) <-  b_(n-1) .. b_(0)
+     */
+    res = d;
+    if ((cnt = s % 8) != 0) {          /* not a typo, do nada if cnt==0 */
+       /* B_(7) .. B_(8-n) <-  b_(n-1) .. b_(0) */
+       res = (d << (8 - cnt));
+
+       /* B_(8-(n+1)) .. B_(0)  <-  b_(7) .. b_(n) */
+       mask = (1 << (8 - cnt)) - 1;
+       res |= (d >> (cnt)) & mask;
+
+       /* set the new carry flag, Note that it is the low order
+          bit of the result!!!                               */
+       CONDITIONAL_SET_FLAG(res & 0x80, F_CF);
+       /* OVERFLOW is set *IFF* s==1, then it is the
+          xor of the two most significant bits.  Blecck. */
+       CONDITIONAL_SET_FLAG(s == 1 && XOR2(res >> 6), F_OF);
+    } else if (s != 0) {
+       /* set the new carry flag, Note that it is the low order
+          bit of the result!!!                               */
+       CONDITIONAL_SET_FLAG(res & 0x80, F_CF);
+    }
+    return (u8)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the ROR instruction and side effects.
+****************************************************************************/
+u16 ror_word(u16 d, u8 s)
+{
+    unsigned int res, cnt, mask;
+
+    res = d;
+    if ((cnt = s % 16) != 0) {
+       res = (d << (16 - cnt));
+       mask = (1 << (16 - cnt)) - 1;
+       res |= (d >> (cnt)) & mask;
+       CONDITIONAL_SET_FLAG(res & 0x8000, F_CF);
+       CONDITIONAL_SET_FLAG(s == 1 && XOR2(res >> 14), F_OF);
+    } else if (s != 0) {
+       /* set the new carry flag, Note that it is the low order
+          bit of the result!!!                               */
+       CONDITIONAL_SET_FLAG(res & 0x8000, F_CF);
+    }
+    return (u16)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the ROR instruction and side effects.
+****************************************************************************/
+u32 ror_long(u32 d, u8 s)
+{
+    u32 res, cnt, mask;
+
+    res = d;
+    if ((cnt = s % 32) != 0) {
+       res = (d << (32 - cnt));
+       mask = (1 << (32 - cnt)) - 1;
+       res |= (d >> (cnt)) & mask;
+       CONDITIONAL_SET_FLAG(res & 0x80000000, F_CF);
+       CONDITIONAL_SET_FLAG(s == 1 && XOR2(res >> 30), F_OF);
+    } else if (s != 0) {
+       /* set the new carry flag, Note that it is the low order
+          bit of the result!!!                               */
+       CONDITIONAL_SET_FLAG(res & 0x80000000, F_CF);
+    }
+    return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the SHL instruction and side effects.
+****************************************************************************/
+u8 shl_byte(u8 d, u8 s)
+{
+    unsigned int cnt, res, cf;
+
+    if (s < 8) {
+       cnt = s % 8;
+
+       /* last bit shifted out goes into carry flag */
+       if (cnt > 0) {
+           res = d << cnt;
+           cf = d & (1 << (8 - cnt));
+           CONDITIONAL_SET_FLAG(cf, F_CF);
+           set_szp_flags_8((u8)res);
+       } else {
+           res = (u8) d;
+       }
+
+       if (cnt == 1) {
+           /* Needs simplification. */
+           CONDITIONAL_SET_FLAG(
+                                   (((res & 0x80) == 0x80) ^
+                                    (ACCESS_FLAG(F_CF) != 0)),
+           /* was (M.x86.R_FLG&F_CF)==F_CF)), */
+                                   F_OF);
+       } else {
+           CLEAR_FLAG(F_OF);
+       }
+    } else {
+       res = 0;
+       CONDITIONAL_SET_FLAG((d << (s-1)) & 0x80, F_CF);
+       CLEAR_FLAG(F_OF);
+       CLEAR_FLAG(F_SF);
+       SET_FLAG(F_PF);
+       SET_FLAG(F_ZF);
+    }
+    return (u8)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the SHL instruction and side effects.
+****************************************************************************/
+u16 shl_word(u16 d, u8 s)
+{
+    unsigned int cnt, res, cf;
+
+    if (s < 16) {
+       cnt = s % 16;
+       if (cnt > 0) {
+           res = d << cnt;
+           cf = d & (1 << (16 - cnt));
+           CONDITIONAL_SET_FLAG(cf, F_CF);
+           set_szp_flags_16((u16)res);
+       } else {
+           res = (u16) d;
+       }
+
+       if (cnt == 1) {
+           CONDITIONAL_SET_FLAG(
+                                   (((res & 0x8000) == 0x8000) ^
+                                    (ACCESS_FLAG(F_CF) != 0)),
+                                   F_OF);
+       } else {
+           CLEAR_FLAG(F_OF);
+       }
+    } else {
+       res = 0;
+       CONDITIONAL_SET_FLAG((d << (s-1)) & 0x8000, F_CF);
+       CLEAR_FLAG(F_OF);
+       CLEAR_FLAG(F_SF);
+       SET_FLAG(F_PF);
+       SET_FLAG(F_ZF);
+    }
+    return (u16)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the SHL instruction and side effects.
+****************************************************************************/
+u32 shl_long(u32 d, u8 s)
+{
+    unsigned int cnt, res, cf;
+
+    if (s < 32) {
+       cnt = s % 32;
+       if (cnt > 0) {
+           res = d << cnt;
+           cf = d & (1 << (32 - cnt));
+           CONDITIONAL_SET_FLAG(cf, F_CF);
+           set_szp_flags_32((u32)res);
+       } else {
+           res = d;
+       }
+       if (cnt == 1) {
+           CONDITIONAL_SET_FLAG((((res & 0x80000000) == 0x80000000) ^
+                                 (ACCESS_FLAG(F_CF) != 0)), F_OF);
+       } else {
+           CLEAR_FLAG(F_OF);
+       }
+    } else {
+       res = 0;
+       CONDITIONAL_SET_FLAG((d << (s-1)) & 0x80000000, F_CF);
+       CLEAR_FLAG(F_OF);
+       CLEAR_FLAG(F_SF);
+       SET_FLAG(F_PF);
+       SET_FLAG(F_ZF);
+    }
+    return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the SHR instruction and side effects.
+****************************************************************************/
+u8 shr_byte(u8 d, u8 s)
+{
+    unsigned int cnt, res, cf;
+
+    if (s < 8) {
+       cnt = s % 8;
+       if (cnt > 0) {
+           cf = d & (1 << (cnt - 1));
+           res = d >> cnt;
+           CONDITIONAL_SET_FLAG(cf, F_CF);
+           set_szp_flags_8((u8)res);
+       } else {
+           res = (u8) d;
+       }
+
+       if (cnt == 1) {
+           CONDITIONAL_SET_FLAG(XOR2(res >> 6), F_OF);
+       } else {
+           CLEAR_FLAG(F_OF);
+       }
+    } else {
+       res = 0;
+       CONDITIONAL_SET_FLAG((d >> (s-1)) & 0x1, F_CF);
+       CLEAR_FLAG(F_OF);
+       CLEAR_FLAG(F_SF);
+       SET_FLAG(F_PF);
+       SET_FLAG(F_ZF);
+    }
+    return (u8)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the SHR instruction and side effects.
+****************************************************************************/
+u16 shr_word(u16 d, u8 s)
+{
+    unsigned int cnt, res, cf;
+
+    if (s < 16) {
+       cnt = s % 16;
+       if (cnt > 0) {
+           cf = d & (1 << (cnt - 1));
+           res = d >> cnt;
+           CONDITIONAL_SET_FLAG(cf, F_CF);
+           set_szp_flags_16((u16)res);
+       } else {
+           res = d;
+       }
+
+       if (cnt == 1) {
+           CONDITIONAL_SET_FLAG(XOR2(res >> 14), F_OF);
+       } else {
+           CLEAR_FLAG(F_OF);
+       }
+    } else {
+       res = 0;
+       CLEAR_FLAG(F_CF);
+       CLEAR_FLAG(F_OF);
+       SET_FLAG(F_ZF);
+       CLEAR_FLAG(F_SF);
+       CLEAR_FLAG(F_PF);
+    }
+    return (u16)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the SHR instruction and side effects.
+****************************************************************************/
+u32 shr_long(u32 d, u8 s)
+{
+    unsigned int cnt, res, cf;
+
+    if (s < 32) {
+       cnt = s % 32;
+       if (cnt > 0) {
+           cf = d & (1 << (cnt - 1));
+           res = d >> cnt;
+           CONDITIONAL_SET_FLAG(cf, F_CF);
+           set_szp_flags_32((u32)res);
+       } else {
+           res = d;
+       }
+       if (cnt == 1) {
+           CONDITIONAL_SET_FLAG(XOR2(res >> 30), F_OF);
+       } else {
+           CLEAR_FLAG(F_OF);
+       }
+    } else {
+       res = 0;
+       CLEAR_FLAG(F_CF);
+       CLEAR_FLAG(F_OF);
+       SET_FLAG(F_ZF);
+       CLEAR_FLAG(F_SF);
+       CLEAR_FLAG(F_PF);
+    }
+    return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the SAR instruction and side effects.
+****************************************************************************/
+u8 sar_byte(u8 d, u8 s)
+{
+    unsigned int cnt, res, cf, mask, sf;
+
+    res = d;
+    sf = d & 0x80;
+    cnt = s % 8;
+    if (cnt > 0 && cnt < 8) {
+       mask = (1 << (8 - cnt)) - 1;
+       cf = d & (1 << (cnt - 1));
+       res = (d >> cnt) & mask;
+       CONDITIONAL_SET_FLAG(cf, F_CF);
+       if (sf) {
+           res |= ~mask;
+       }
+       set_szp_flags_8((u8)res);
+    } else if (cnt >= 8) {
+       if (sf) {
+           res = 0xff;
+           SET_FLAG(F_CF);
+           CLEAR_FLAG(F_ZF);
+           SET_FLAG(F_SF);
+           SET_FLAG(F_PF);
+       } else {
+           res = 0;
+           CLEAR_FLAG(F_CF);
+           SET_FLAG(F_ZF);
+           CLEAR_FLAG(F_SF);
+           CLEAR_FLAG(F_PF);
+       }
+    }
+    return (u8)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the SAR instruction and side effects.
+****************************************************************************/
+u16 sar_word(u16 d, u8 s)
+{
+    unsigned int cnt, res, cf, mask, sf;
+
+    sf = d & 0x8000;
+    cnt = s % 16;
+    res = d;
+    if (cnt > 0 && cnt < 16) {
+       mask = (1 << (16 - cnt)) - 1;
+       cf = d & (1 << (cnt - 1));
+       res = (d >> cnt) & mask;
+       CONDITIONAL_SET_FLAG(cf, F_CF);
+       if (sf) {
+           res |= ~mask;
+       }
+       set_szp_flags_16((u16)res);
+    } else if (cnt >= 16) {
+       if (sf) {
+           res = 0xffff;
+           SET_FLAG(F_CF);
+           CLEAR_FLAG(F_ZF);
+           SET_FLAG(F_SF);
+           SET_FLAG(F_PF);
+       } else {
+           res = 0;
+           CLEAR_FLAG(F_CF);
+           SET_FLAG(F_ZF);
+           CLEAR_FLAG(F_SF);
+           CLEAR_FLAG(F_PF);
+       }
+    }
+    return (u16)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the SAR instruction and side effects.
+****************************************************************************/
+u32 sar_long(u32 d, u8 s)
+{
+    u32 cnt, res, cf, mask, sf;
+
+    sf = d & 0x80000000;
+    cnt = s % 32;
+    res = d;
+    if (cnt > 0 && cnt < 32) {
+       mask = (1 << (32 - cnt)) - 1;
+       cf = d & (1 << (cnt - 1));
+       res = (d >> cnt) & mask;
+       CONDITIONAL_SET_FLAG(cf, F_CF);
+       if (sf) {
+           res |= ~mask;
+       }
+       set_szp_flags_32(res);
+    } else if (cnt >= 32) {
+       if (sf) {
+           res = 0xffffffff;
+           SET_FLAG(F_CF);
+           CLEAR_FLAG(F_ZF);
+           SET_FLAG(F_SF);
+           SET_FLAG(F_PF);
+       } else {
+           res = 0;
+           CLEAR_FLAG(F_CF);
+           SET_FLAG(F_ZF);
+           CLEAR_FLAG(F_SF);
+           CLEAR_FLAG(F_PF);
+       }
+    }
+    return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the SHLD instruction and side effects.
+****************************************************************************/
+u16 shld_word (u16 d, u16 fill, u8 s)
+{
+    unsigned int cnt, res, cf;
+
+    if (s < 16) {
+       cnt = s % 16;
+       if (cnt > 0) {
+           res = (d << cnt) | (fill >> (16-cnt));
+           cf = d & (1 << (16 - cnt));
+           CONDITIONAL_SET_FLAG(cf, F_CF);
+           set_szp_flags_16((u16)res);
+       } else {
+           res = d;
+       }
+       if (cnt == 1) {
+           CONDITIONAL_SET_FLAG((((res & 0x8000) == 0x8000) ^
+                                 (ACCESS_FLAG(F_CF) != 0)), F_OF);
+       } else {
+           CLEAR_FLAG(F_OF);
+       }
+    } else {
+       res = 0;
+       CONDITIONAL_SET_FLAG((d << (s-1)) & 0x8000, F_CF);
+       CLEAR_FLAG(F_OF);
+       CLEAR_FLAG(F_SF);
+       SET_FLAG(F_PF);
+       SET_FLAG(F_ZF);
+    }
+    return (u16)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the SHLD instruction and side effects.
+****************************************************************************/
+u32 shld_long (u32 d, u32 fill, u8 s)
+{
+    unsigned int cnt, res, cf;
+
+    if (s < 32) {
+       cnt = s % 32;
+       if (cnt > 0) {
+           res = (d << cnt) | (fill >> (32-cnt));
+           cf = d & (1 << (32 - cnt));
+           CONDITIONAL_SET_FLAG(cf, F_CF);
+           set_szp_flags_32((u32)res);
+       } else {
+           res = d;
+       }
+       if (cnt == 1) {
+           CONDITIONAL_SET_FLAG((((res & 0x80000000) == 0x80000000) ^
+                                 (ACCESS_FLAG(F_CF) != 0)), F_OF);
+       } else {
+           CLEAR_FLAG(F_OF);
+       }
+    } else {
+       res = 0;
+       CONDITIONAL_SET_FLAG((d << (s-1)) & 0x80000000, F_CF);
+       CLEAR_FLAG(F_OF);
+       CLEAR_FLAG(F_SF);
+       SET_FLAG(F_PF);
+       SET_FLAG(F_ZF);
+    }
+    return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the SHRD instruction and side effects.
+****************************************************************************/
+u16 shrd_word (u16 d, u16 fill, u8 s)
+{
+    unsigned int cnt, res, cf;
+
+    if (s < 16) {
+       cnt = s % 16;
+       if (cnt > 0) {
+           cf = d & (1 << (cnt - 1));
+           res = (d >> cnt) | (fill << (16 - cnt));
+           CONDITIONAL_SET_FLAG(cf, F_CF);
+           set_szp_flags_16((u16)res);
+       } else {
+           res = d;
+       }
+
+       if (cnt == 1) {
+           CONDITIONAL_SET_FLAG(XOR2(res >> 14), F_OF);
+       } else {
+           CLEAR_FLAG(F_OF);
+       }
+    } else {
+       res = 0;
+       CLEAR_FLAG(F_CF);
+       CLEAR_FLAG(F_OF);
+       SET_FLAG(F_ZF);
+       CLEAR_FLAG(F_SF);
+       CLEAR_FLAG(F_PF);
+    }
+    return (u16)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the SHRD instruction and side effects.
+****************************************************************************/
+u32 shrd_long (u32 d, u32 fill, u8 s)
+{
+    unsigned int cnt, res, cf;
+
+    if (s < 32) {
+       cnt = s % 32;
+       if (cnt > 0) {
+           cf = d & (1 << (cnt - 1));
+           res = (d >> cnt) | (fill << (32 - cnt));
+           CONDITIONAL_SET_FLAG(cf, F_CF);
+           set_szp_flags_32((u32)res);
+       } else {
+           res = d;
+       }
+       if (cnt == 1) {
+           CONDITIONAL_SET_FLAG(XOR2(res >> 30), F_OF);
+       } else {
+           CLEAR_FLAG(F_OF);
+       }
+    } else {
+       res = 0;
+       CLEAR_FLAG(F_CF);
+       CLEAR_FLAG(F_OF);
+       SET_FLAG(F_ZF);
+       CLEAR_FLAG(F_SF);
+       CLEAR_FLAG(F_PF);
+    }
+    return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the SBB instruction and side effects.
+****************************************************************************/
+u8 sbb_byte(u8 d, u8 s)
+{
+    u32 res;   /* all operands in native machine order */
+    u32 bc;
+
+    if (ACCESS_FLAG(F_CF))
+       res = d - s - 1;
+    else
+       res = d - s;
+    set_szp_flags_8((u8)res);
+
+    /* calculate the borrow chain.  See note at top */
+    bc = (res & (~d | s)) | (~d & s);
+    CONDITIONAL_SET_FLAG(bc & 0x80, F_CF);
+    CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF);
+    CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+    return (u8)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the SBB instruction and side effects.
+****************************************************************************/
+u16 sbb_word(u16 d, u16 s)
+{
+    u32 res;   /* all operands in native machine order */
+    u32 bc;
+
+    if (ACCESS_FLAG(F_CF))
+       res = d - s - 1;
+    else
+       res = d - s;
+    set_szp_flags_16((u16)res);
+
+    /* calculate the borrow chain.  See note at top */
+    bc = (res & (~d | s)) | (~d & s);
+    CONDITIONAL_SET_FLAG(bc & 0x8000, F_CF);
+    CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF);
+    CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+    return (u16)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the SBB instruction and side effects.
+****************************************************************************/
+u32 sbb_long(u32 d, u32 s)
+{
+    u32 res;   /* all operands in native machine order */
+    u32 bc;
+
+    if (ACCESS_FLAG(F_CF))
+       res = d - s - 1;
+    else
+       res = d - s;
+
+    set_szp_flags_32(res);
+
+    /* calculate the borrow chain.  See note at top */
+    bc = (res & (~d | s)) | (~d & s);
+    CONDITIONAL_SET_FLAG(bc & 0x80000000, F_CF);
+    CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF);
+    CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+    return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the SUB instruction and side effects.
+****************************************************************************/
+u8 sub_byte(u8 d, u8 s)
+{
+    u32 res;   /* all operands in native machine order */
+    u32 bc;
+
+    res = d - s;
+    set_szp_flags_8((u8)res);
+
+    /* calculate the borrow chain.  See note at top */
+    bc = (res & (~d | s)) | (~d & s);
+    CONDITIONAL_SET_FLAG(bc & 0x80, F_CF);
+    CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF);
+    CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+    return (u8)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the SUB instruction and side effects.
+****************************************************************************/
+u16 sub_word(u16 d, u16 s)
+{
+    u32 res;   /* all operands in native machine order */
+    u32 bc;
+
+    res = d - s;
+    set_szp_flags_16((u16)res);
+
+    /* calculate the borrow chain.  See note at top */
+    bc = (res & (~d | s)) | (~d & s);
+    CONDITIONAL_SET_FLAG(bc & 0x8000, F_CF);
+    CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF);
+    CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+    return (u16)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the SUB instruction and side effects.
+****************************************************************************/
+u32 sub_long(u32 d, u32 s)
+{
+    u32 res;   /* all operands in native machine order */
+    u32 bc;
+
+    res = d - s;
+    set_szp_flags_32(res);
+
+    /* calculate the borrow chain.  See note at top */
+    bc = (res & (~d | s)) | (~d & s);
+    CONDITIONAL_SET_FLAG(bc & 0x80000000, F_CF);
+    CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF);
+    CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+    return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the TEST instruction and side effects.
+****************************************************************************/
+void test_byte(u8 d, u8 s)
+{
+    u32 res;   /* all operands in native machine order */
+
+    res = d & s;
+
+    CLEAR_FLAG(F_OF);
+    set_szp_flags_8((u8)res);
+    /* AF == dont care */
+    CLEAR_FLAG(F_CF);
+}
+
+/****************************************************************************
+REMARKS:
+Implements the TEST instruction and side effects.
+****************************************************************************/
+void test_word(u16 d, u16 s)
+{
+    u32 res;   /* all operands in native machine order */
+
+    res = d & s;
+
+    CLEAR_FLAG(F_OF);
+    set_szp_flags_16((u16)res);
+    /* AF == dont care */
+    CLEAR_FLAG(F_CF);
+}
+
+/****************************************************************************
+REMARKS:
+Implements the TEST instruction and side effects.
+****************************************************************************/
+void test_long(u32 d, u32 s)
+{
+    u32 res;   /* all operands in native machine order */
+
+    res = d & s;
+
+    CLEAR_FLAG(F_OF);
+    set_szp_flags_32(res);
+    /* AF == dont care */
+    CLEAR_FLAG(F_CF);
+}
+
+/****************************************************************************
+REMARKS:
+Implements the XOR instruction and side effects.
+****************************************************************************/
+u8 xor_byte(u8 d, u8 s)
+{
+    u8 res;    /* all operands in native machine order */
+
+    res = d ^ s;
+    no_carry_byte_side_eff(res);
+    return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the XOR instruction and side effects.
+****************************************************************************/
+u16 xor_word(u16 d, u16 s)
+{
+    u16 res;   /* all operands in native machine order */
+
+    res = d ^ s;
+    no_carry_word_side_eff(res);
+    return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the XOR instruction and side effects.
+****************************************************************************/
+u32 xor_long(u32 d, u32 s)
+{
+    u32 res;   /* all operands in native machine order */
+
+    res = d ^ s;
+    no_carry_long_side_eff(res);
+    return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the IMUL instruction and side effects.
+****************************************************************************/
+void imul_byte(u8 s)
+{
+    s16 res = (s16)((s8)M.x86.R_AL * (s8)s);
+
+    M.x86.R_AX = res;
+    if (((M.x86.R_AL & 0x80) == 0 && M.x86.R_AH == 0x00) ||
+       ((M.x86.R_AL & 0x80) != 0 && M.x86.R_AH == 0xFF)) {
+       CLEAR_FLAG(F_CF);
+       CLEAR_FLAG(F_OF);
+    } else {
+       SET_FLAG(F_CF);
+       SET_FLAG(F_OF);
+    }
+}
+
+/****************************************************************************
+REMARKS:
+Implements the IMUL instruction and side effects.
+****************************************************************************/
+void imul_word(u16 s)
+{
+    s32 res = (s16)M.x86.R_AX * (s16)s;
+
+    M.x86.R_AX = (u16)res;
+    M.x86.R_DX = (u16)(res >> 16);
+    if (((M.x86.R_AX & 0x8000) == 0 && M.x86.R_DX == 0x0000) ||
+       ((M.x86.R_AX & 0x8000) != 0 && M.x86.R_DX == 0xFFFF)) {
+       CLEAR_FLAG(F_CF);
+       CLEAR_FLAG(F_OF);
+    } else {
+       SET_FLAG(F_CF);
+       SET_FLAG(F_OF);
+    }
+}
+
+/****************************************************************************
+REMARKS:
+Implements the IMUL instruction and side effects.
+****************************************************************************/
+void imul_long_direct(u32 *res_lo, u32* res_hi,u32 d, u32 s)
+{
+#ifdef __HAS_LONG_LONG__
+    s64 res = (s32)d * (s32)s;
+
+    *res_lo = (u32)res;
+    *res_hi = (u32)(res >> 32);
+#else
+    u32 d_lo,d_hi,d_sign;
+    u32 s_lo,s_hi,s_sign;
+    u32 rlo_lo,rlo_hi,rhi_lo;
+
+    if ((d_sign = d & 0x80000000) != 0)
+       d = -d;
+    d_lo = d & 0xFFFF;
+    d_hi = d >> 16;
+    if ((s_sign = s & 0x80000000) != 0)
+       s = -s;
+    s_lo = s & 0xFFFF;
+    s_hi = s >> 16;
+    rlo_lo = d_lo * s_lo;
+    rlo_hi = (d_hi * s_lo + d_lo * s_hi) + (rlo_lo >> 16);
+    rhi_lo = d_hi * s_hi + (rlo_hi >> 16);
+    *res_lo = (rlo_hi << 16) | (rlo_lo & 0xFFFF);
+    *res_hi = rhi_lo;
+    if (d_sign != s_sign) {
+       d = ~*res_lo;
+       s = (((d & 0xFFFF) + 1) >> 16) + (d >> 16);
+       *res_lo = ~*res_lo+1;
+       *res_hi = ~*res_hi+(s >> 16);
+       }
+#endif
+}
+
+/****************************************************************************
+REMARKS:
+Implements the IMUL instruction and side effects.
+****************************************************************************/
+void imul_long(u32 s)
+{
+    imul_long_direct(&M.x86.R_EAX,&M.x86.R_EDX,M.x86.R_EAX,s);
+    if (((M.x86.R_EAX & 0x80000000) == 0 && M.x86.R_EDX == 0x00000000) ||
+       ((M.x86.R_EAX & 0x80000000) != 0 && M.x86.R_EDX == 0xFFFFFFFF)) {
+       CLEAR_FLAG(F_CF);
+       CLEAR_FLAG(F_OF);
+    } else {
+       SET_FLAG(F_CF);
+       SET_FLAG(F_OF);
+    }
+}
+
+/****************************************************************************
+REMARKS:
+Implements the MUL instruction and side effects.
+****************************************************************************/
+void mul_byte(u8 s)
+{
+    u16 res = (u16)(M.x86.R_AL * s);
+
+    M.x86.R_AX = res;
+    if (M.x86.R_AH == 0) {
+       CLEAR_FLAG(F_CF);
+       CLEAR_FLAG(F_OF);
+    } else {
+       SET_FLAG(F_CF);
+       SET_FLAG(F_OF);
+    }
+}
+
+/****************************************************************************
+REMARKS:
+Implements the MUL instruction and side effects.
+****************************************************************************/
+void mul_word(u16 s)
+{
+    u32 res = M.x86.R_AX * s;
+
+    M.x86.R_AX = (u16)res;
+    M.x86.R_DX = (u16)(res >> 16);
+    if (M.x86.R_DX == 0) {
+       CLEAR_FLAG(F_CF);
+       CLEAR_FLAG(F_OF);
+    } else {
+       SET_FLAG(F_CF);
+       SET_FLAG(F_OF);
+    }
+}
+
+/****************************************************************************
+REMARKS:
+Implements the MUL instruction and side effects.
+****************************************************************************/
+void mul_long(u32 s)
+{
+#ifdef __HAS_LONG_LONG__
+    u64 res = (u32)M.x86.R_EAX * (u32)s;
+
+    M.x86.R_EAX = (u32)res;
+    M.x86.R_EDX = (u32)(res >> 32);
+#else
+    u32 a,a_lo,a_hi;
+    u32 s_lo,s_hi;
+    u32 rlo_lo,rlo_hi,rhi_lo;
+
+    a = M.x86.R_EAX;
+    a_lo = a & 0xFFFF;
+    a_hi = a >> 16;
+    s_lo = s & 0xFFFF;
+    s_hi = s >> 16;
+    rlo_lo = a_lo * s_lo;
+    rlo_hi = (a_hi * s_lo + a_lo * s_hi) + (rlo_lo >> 16);
+    rhi_lo = a_hi * s_hi + (rlo_hi >> 16);
+    M.x86.R_EAX = (rlo_hi << 16) | (rlo_lo & 0xFFFF);
+    M.x86.R_EDX = rhi_lo;
+#endif
+    if (M.x86.R_EDX == 0) {
+       CLEAR_FLAG(F_CF);
+       CLEAR_FLAG(F_OF);
+    } else {
+       SET_FLAG(F_CF);
+       SET_FLAG(F_OF);
+    }
+}
+
+/****************************************************************************
+REMARKS:
+Implements the IDIV instruction and side effects.
+****************************************************************************/
+void idiv_byte(u8 s)
+{
+    s32 dvd, div, mod;
+
+    dvd = (s16)M.x86.R_AX;
+    if (s == 0) {
+       x86emu_intr_raise(0);
+       return;
+    }
+    div = dvd / (s8)s;
+    mod = dvd % (s8)s;
+    if (abs(div) > 0x7f) {
+       x86emu_intr_raise(0);
+       return;
+    }
+    M.x86.R_AL = (s8) div;
+    M.x86.R_AH = (s8) mod;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the IDIV instruction and side effects.
+****************************************************************************/
+void idiv_word(u16 s)
+{
+    s32 dvd, div, mod;
+
+    dvd = (((s32)M.x86.R_DX) << 16) | M.x86.R_AX;
+    if (s == 0) {
+       x86emu_intr_raise(0);
+       return;
+    }
+    div = dvd / (s16)s;
+    mod = dvd % (s16)s;
+    if (abs(div) > 0x7fff) {
+       x86emu_intr_raise(0);
+       return;
+    }
+    CLEAR_FLAG(F_CF);
+    CLEAR_FLAG(F_SF);
+    CONDITIONAL_SET_FLAG(div == 0, F_ZF);
+    set_parity_flag(mod);
+
+    M.x86.R_AX = (u16)div;
+    M.x86.R_DX = (u16)mod;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the IDIV instruction and side effects.
+****************************************************************************/
+void idiv_long(u32 s)
+{
+#ifdef __HAS_LONG_LONG__
+    s64 dvd, div, mod;
+
+    dvd = (((s64)M.x86.R_EDX) << 32) | M.x86.R_EAX;
+    if (s == 0) {
+       x86emu_intr_raise(0);
+       return;
+    }
+    div = dvd / (s32)s;
+    mod = dvd % (s32)s;
+    if (abs(div) > 0x7fffffff) {
+       x86emu_intr_raise(0);
+       return;
+    }
+#else
+    s32 div = 0, mod;
+    s32 h_dvd = M.x86.R_EDX;
+    u32 l_dvd = M.x86.R_EAX;
+    u32 abs_s = s & 0x7FFFFFFF;
+    u32 abs_h_dvd = h_dvd & 0x7FFFFFFF;
+    u32 h_s = abs_s >> 1;
+    u32 l_s = abs_s << 31;
+    int counter = 31;
+    int carry;
+
+    if (s == 0) {
+       x86emu_intr_raise(0);
+       return;
+    }
+    do {
+       div <<= 1;
+       carry = (l_dvd >= l_s) ? 0 : 1;
+
+       if (abs_h_dvd < (h_s + carry)) {
+           h_s >>= 1;
+           l_s = abs_s << (--counter);
+           continue;
+       } else {
+           abs_h_dvd -= (h_s + carry);
+           l_dvd = carry ? ((0xFFFFFFFF - l_s) + l_dvd + 1)
+               : (l_dvd - l_s);
+           h_s >>= 1;
+           l_s = abs_s << (--counter);
+           div |= 1;
+           continue;
+       }
+
+    } while (counter > -1);
+    /* overflow */
+    if (abs_h_dvd || (l_dvd > abs_s)) {
+       x86emu_intr_raise(0);
+       return;
+    }
+    /* sign */
+    div |= ((h_dvd & 0x10000000) ^ (s & 0x10000000));
+    mod = l_dvd;
+
+#endif
+    CLEAR_FLAG(F_CF);
+    CLEAR_FLAG(F_AF);
+    CLEAR_FLAG(F_SF);
+    SET_FLAG(F_ZF);
+    set_parity_flag(mod);
+
+    M.x86.R_EAX = (u32)div;
+    M.x86.R_EDX = (u32)mod;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the DIV instruction and side effects.
+****************************************************************************/
+void div_byte(u8 s)
+{
+    u32 dvd, div, mod;
+
+    dvd = M.x86.R_AX;
+    if (s == 0) {
+       x86emu_intr_raise(0);
+       return;
+    }
+    div = dvd / (u8)s;
+    mod = dvd % (u8)s;
+    if (abs(div) > 0xff) {
+       x86emu_intr_raise(0);
+       return;
+    }
+    M.x86.R_AL = (u8)div;
+    M.x86.R_AH = (u8)mod;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the DIV instruction and side effects.
+****************************************************************************/
+void div_word(u16 s)
+{
+    u32 dvd, div, mod;
+
+    dvd = (((u32)M.x86.R_DX) << 16) | M.x86.R_AX;
+    if (s == 0) {
+       x86emu_intr_raise(0);
+       return;
+    }
+    div = dvd / (u16)s;
+    mod = dvd % (u16)s;
+    if (abs(div) > 0xffff) {
+       x86emu_intr_raise(0);
+       return;
+    }
+    CLEAR_FLAG(F_CF);
+    CLEAR_FLAG(F_SF);
+    CONDITIONAL_SET_FLAG(div == 0, F_ZF);
+    set_parity_flag(mod);
+
+    M.x86.R_AX = (u16)div;
+    M.x86.R_DX = (u16)mod;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the DIV instruction and side effects.
+****************************************************************************/
+void div_long(u32 s)
+{
+#ifdef __HAS_LONG_LONG__
+    u64 dvd, div, mod;
+
+    dvd = (((u64)M.x86.R_EDX) << 32) | M.x86.R_EAX;
+    if (s == 0) {
+       x86emu_intr_raise(0);
+       return;
+    }
+    div = dvd / (u32)s;
+    mod = dvd % (u32)s;
+    if (abs(div) > 0xffffffff) {
+       x86emu_intr_raise(0);
+       return;
+    }
+#else
+    s32 div = 0, mod;
+    s32 h_dvd = M.x86.R_EDX;
+    u32 l_dvd = M.x86.R_EAX;
+
+    u32 h_s = s;
+    u32 l_s = 0;
+    int counter = 32;
+    int carry;
+
+    if (s == 0) {
+       x86emu_intr_raise(0);
+       return;
+    }
+    do {
+       div <<= 1;
+       carry = (l_dvd >= l_s) ? 0 : 1;
+
+       if (h_dvd < (h_s + carry)) {
+           h_s >>= 1;
+           l_s = s << (--counter);
+           continue;
+       } else {
+           h_dvd -= (h_s + carry);
+           l_dvd = carry ? ((0xFFFFFFFF - l_s) + l_dvd + 1)
+               : (l_dvd - l_s);
+           h_s >>= 1;
+           l_s = s << (--counter);
+           div |= 1;
+           continue;
+       }
+
+    } while (counter > -1);
+    /* overflow */
+    if (h_dvd || (l_dvd > s)) {
+       x86emu_intr_raise(0);
+       return;
+    }
+    mod = l_dvd;
+#endif
+    CLEAR_FLAG(F_CF);
+    CLEAR_FLAG(F_AF);
+    CLEAR_FLAG(F_SF);
+    SET_FLAG(F_ZF);
+    set_parity_flag(mod);
+
+    M.x86.R_EAX = (u32)div;
+    M.x86.R_EDX = (u32)mod;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the IN string instruction and side effects.
+****************************************************************************/
+
+static void single_in(int size)
+{
+    if(size == 1)
+       store_data_byte_abs(M.x86.R_ES, M.x86.R_DI,(*sys_inb)(M.x86.R_DX));
+    else if (size == 2)
+       store_data_word_abs(M.x86.R_ES, M.x86.R_DI,(*sys_inw)(M.x86.R_DX));
+    else
+       store_data_long_abs(M.x86.R_ES, M.x86.R_DI,(*sys_inl)(M.x86.R_DX));
+}
+
+void ins(int size)
+{
+    int inc = size;
+
+    if (ACCESS_FLAG(F_DF)) {
+       inc = -size;
+    }
+    if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) {
+       /* dont care whether REPE or REPNE */
+       /* in until CX is ZERO. */
+       u32 count = ((M.x86.mode & SYSMODE_PREFIX_DATA) ?
+                    M.x86.R_ECX : M.x86.R_CX);
+
+       while (count--) {
+         single_in(size);
+         M.x86.R_DI += inc;
+         }
+       M.x86.R_CX = 0;
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           M.x86.R_ECX = 0;
+       }
+       M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
+    } else {
+       single_in(size);
+       M.x86.R_DI += inc;
+    }
+}
+
+/****************************************************************************
+REMARKS:
+Implements the OUT string instruction and side effects.
+****************************************************************************/
+
+static void single_out(int size)
+{
+     if(size == 1)
+       (*sys_outb)(M.x86.R_DX,fetch_data_byte_abs(M.x86.R_ES, M.x86.R_SI));
+     else if (size == 2)
+       (*sys_outw)(M.x86.R_DX,fetch_data_word_abs(M.x86.R_ES, M.x86.R_SI));
+     else
+       (*sys_outl)(M.x86.R_DX,fetch_data_long_abs(M.x86.R_ES, M.x86.R_SI));
+}
+
+void outs(int size)
+{
+    int inc = size;
+
+    if (ACCESS_FLAG(F_DF)) {
+       inc = -size;
+    }
+    if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) {
+       /* dont care whether REPE or REPNE */
+       /* out until CX is ZERO. */
+       u32 count = ((M.x86.mode & SYSMODE_PREFIX_DATA) ?
+                    M.x86.R_ECX : M.x86.R_CX);
+       while (count--) {
+         single_out(size);
+         M.x86.R_SI += inc;
+         }
+       M.x86.R_CX = 0;
+       if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+           M.x86.R_ECX = 0;
+       }
+       M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
+    } else {
+       single_out(size);
+       M.x86.R_SI += inc;
+    }
+}
+
+/****************************************************************************
+PARAMETERS:
+addr   - Address to fetch word from
+
+REMARKS:
+Fetches a word from emulator memory using an absolute address.
+****************************************************************************/
+u16 mem_access_word(int addr)
+{
+DB( if (CHECK_MEM_ACCESS())
+      x86emu_check_mem_access(addr);)
+    return (*sys_rdw)(addr);
+}
+
+/****************************************************************************
+REMARKS:
+Pushes a word onto the stack.
+
+NOTE: Do not inline this, as (*sys_wrX) is already inline!
+****************************************************************************/
+void push_word(u16 w)
+{
+DB( if (CHECK_SP_ACCESS())
+      x86emu_check_sp_access();)
+    M.x86.R_SP -= 2;
+    (*sys_wrw)(((u32)M.x86.R_SS << 4)  + M.x86.R_SP, w);
+}
+
+/****************************************************************************
+REMARKS:
+Pushes a long onto the stack.
+
+NOTE: Do not inline this, as (*sys_wrX) is already inline!
+****************************************************************************/
+void push_long(u32 w)
+{
+DB( if (CHECK_SP_ACCESS())
+      x86emu_check_sp_access();)
+    M.x86.R_SP -= 4;
+    (*sys_wrl)(((u32)M.x86.R_SS << 4)  + M.x86.R_SP, w);
+}
+
+/****************************************************************************
+REMARKS:
+Pops a word from the stack.
+
+NOTE: Do not inline this, as (*sys_rdX) is already inline!
+****************************************************************************/
+u16 pop_word(void)
+{
+    u16 res;
+
+DB( if (CHECK_SP_ACCESS())
+      x86emu_check_sp_access();)
+    res = (*sys_rdw)(((u32)M.x86.R_SS << 4)  + M.x86.R_SP);
+    M.x86.R_SP += 2;
+    return res;
+}
+
+/****************************************************************************
+REMARKS:
+Pops a long from the stack.
+
+NOTE: Do not inline this, as (*sys_rdX) is already inline!
+****************************************************************************/
+u32 pop_long(void)
+{
+    u32 res;
+
+DB( if (CHECK_SP_ACCESS())
+      x86emu_check_sp_access();)
+    res = (*sys_rdl)(((u32)M.x86.R_SS << 4)  + M.x86.R_SP);
+    M.x86.R_SP += 4;
+    return res;
+}
diff --git a/drivers/bios_emulator/x86emu/sys.c b/drivers/bios_emulator/x86emu/sys.c
new file mode 100644 (file)
index 0000000..bb7fcd9
--- /dev/null
@@ -0,0 +1,322 @@
+/****************************************************************************
+*
+*                       Realmode X86 Emulator Library
+*
+*               Copyright (C) 1991-2004 SciTech Software, Inc.
+*                    Copyright (C) David Mosberger-Tang
+*                      Copyright (C) 1999 Egbert Eich
+*
+*  ========================================================================
+*
+*  Permission to use, copy, modify, distribute, and sell this software and
+*  its documentation for any purpose is hereby granted without fee,
+*  provided that the above copyright notice appear in all copies and that
+*  both that copyright notice and this permission notice appear in
+*  supporting documentation, and that the name of the authors not be used
+*  in advertising or publicity pertaining to distribution of the software
+*  without specific, written prior permission.  The authors makes no
+*  representations about the suitability of this software for any purpose.
+*  It is provided "as is" without express or implied warranty.
+*
+*  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+*  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+*  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+*  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+*  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+*  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+*  PERFORMANCE OF THIS SOFTWARE.
+*
+*  ========================================================================
+*
+* Language:     ANSI C
+* Environment:  Any
+* Developer:    Kendall Bennett
+*
+* Description:  This file includes subroutines which are related to
+*               programmed I/O and memory access. Included in this module
+*               are default functions that do nothing. For real uses these
+*               functions will have to be overriden by the user library.
+*
+****************************************************************************/
+
+#include "x86emu/x86emui.h"
+
+/*------------------------- Global Variables ------------------------------*/
+
+X86EMU_sysEnv _X86EMU_env;     /* Global emulator machine state */
+X86EMU_intrFuncs _X86EMU_intrTab[256];
+
+int debug_intr;
+
+/*----------------------------- Implementation ----------------------------*/
+
+/****************************************************************************
+PARAMETERS:
+addr    - Emulator memory address to read
+
+RETURNS:
+Byte value read from emulator memory.
+
+REMARKS:
+Reads a byte value from the emulator memory.
+****************************************************************************/
+u8 X86API rdb(u32 addr)
+{
+       return 0;
+}
+
+/****************************************************************************
+PARAMETERS:
+addr    - Emulator memory address to read
+
+RETURNS:
+Word value read from emulator memory.
+
+REMARKS:
+Reads a word value from the emulator memory.
+****************************************************************************/
+u16 X86API rdw(u32 addr)
+{
+       return 0;
+}
+
+/****************************************************************************
+PARAMETERS:
+addr    - Emulator memory address to read
+
+RETURNS:
+Long value read from emulator memory.
+REMARKS:
+Reads a long value from the emulator memory.
+****************************************************************************/
+u32 X86API rdl(u32 addr)
+{
+       return 0;
+}
+
+/****************************************************************************
+PARAMETERS:
+addr    - Emulator memory address to read
+val     - Value to store
+
+REMARKS:
+Writes a byte value to emulator memory.
+****************************************************************************/
+void X86API wrb(u32 addr, u8 val)
+{
+}
+
+/****************************************************************************
+PARAMETERS:
+addr    - Emulator memory address to read
+val     - Value to store
+
+REMARKS:
+Writes a word value to emulator memory.
+****************************************************************************/
+void X86API wrw(u32 addr, u16 val)
+{
+}
+
+/****************************************************************************
+PARAMETERS:
+addr    - Emulator memory address to read
+val     - Value to store
+
+REMARKS:
+Writes a long value to emulator memory.
+****************************************************************************/
+void X86API wrl(u32 addr, u32 val)
+{
+}
+
+/****************************************************************************
+PARAMETERS:
+addr    - PIO address to read
+RETURN:
+0
+REMARKS:
+Default PIO byte read function. Doesn't perform real inb.
+****************************************************************************/
+static u8 X86API p_inb(X86EMU_pioAddr addr)
+{
+       DB(if (DEBUG_IO_TRACE())
+          printk("inb %#04x \n", addr);)
+               return 0;
+}
+
+/****************************************************************************
+PARAMETERS:
+addr    - PIO address to read
+RETURN:
+0
+REMARKS:
+Default PIO word read function. Doesn't perform real inw.
+****************************************************************************/
+static u16 X86API p_inw(X86EMU_pioAddr addr)
+{
+       DB(if (DEBUG_IO_TRACE())
+          printk("inw %#04x \n", addr);)
+               return 0;
+}
+
+/****************************************************************************
+PARAMETERS:
+addr    - PIO address to read
+RETURN:
+0
+REMARKS:
+Default PIO long read function. Doesn't perform real inl.
+****************************************************************************/
+static u32 X86API p_inl(X86EMU_pioAddr addr)
+{
+       DB(if (DEBUG_IO_TRACE())
+          printk("inl %#04x \n", addr);)
+               return 0;
+}
+
+/****************************************************************************
+PARAMETERS:
+addr    - PIO address to write
+val     - Value to store
+REMARKS:
+Default PIO byte write function. Doesn't perform real outb.
+****************************************************************************/
+static void X86API p_outb(X86EMU_pioAddr addr, u8 val)
+{
+       DB(if (DEBUG_IO_TRACE())
+          printk("outb %#02x -> %#04x \n", val, addr);)
+               return;
+}
+
+/****************************************************************************
+PARAMETERS:
+addr    - PIO address to write
+val     - Value to store
+REMARKS:
+Default PIO word write function. Doesn't perform real outw.
+****************************************************************************/
+static void X86API p_outw(X86EMU_pioAddr addr, u16 val)
+{
+       DB(if (DEBUG_IO_TRACE())
+          printk("outw %#04x -> %#04x \n", val, addr);)
+               return;
+}
+
+/****************************************************************************
+PARAMETERS:
+addr    - PIO address to write
+val     - Value to store
+REMARKS:
+Default PIO ;ong write function. Doesn't perform real outl.
+****************************************************************************/
+static void X86API p_outl(X86EMU_pioAddr addr, u32 val)
+{
+       DB(if (DEBUG_IO_TRACE())
+          printk("outl %#08x -> %#04x \n", val, addr);)
+               return;
+}
+
+/*------------------------- Global Variables ------------------------------*/
+
+u8(X86APIP sys_rdb) (u32 addr) = rdb;
+u16(X86APIP sys_rdw) (u32 addr) = rdw;
+u32(X86APIP sys_rdl) (u32 addr) = rdl;
+void (X86APIP sys_wrb) (u32 addr, u8 val) = wrb;
+void (X86APIP sys_wrw) (u32 addr, u16 val) = wrw;
+void (X86APIP sys_wrl) (u32 addr, u32 val) = wrl;
+u8(X86APIP sys_inb) (X86EMU_pioAddr addr) = p_inb;
+u16(X86APIP sys_inw) (X86EMU_pioAddr addr) = p_inw;
+u32(X86APIP sys_inl) (X86EMU_pioAddr addr) = p_inl;
+void (X86APIP sys_outb) (X86EMU_pioAddr addr, u8 val) = p_outb;
+void (X86APIP sys_outw) (X86EMU_pioAddr addr, u16 val) = p_outw;
+void (X86APIP sys_outl) (X86EMU_pioAddr addr, u32 val) = p_outl;
+
+/*----------------------------- Setup -------------------------------------*/
+
+/****************************************************************************
+PARAMETERS:
+funcs   - New memory function pointers to make active
+
+REMARKS:
+This function is used to set the pointers to functions which access
+memory space, allowing the user application to override these functions
+and hook them out as necessary for their application.
+****************************************************************************/
+void X86EMU_setupMemFuncs(X86EMU_memFuncs * funcs)
+{
+       sys_rdb = funcs->rdb;
+       sys_rdw = funcs->rdw;
+       sys_rdl = funcs->rdl;
+       sys_wrb = funcs->wrb;
+       sys_wrw = funcs->wrw;
+       sys_wrl = funcs->wrl;
+}
+
+/****************************************************************************
+PARAMETERS:
+funcs   - New programmed I/O function pointers to make active
+
+REMARKS:
+This function is used to set the pointers to functions which access
+I/O space, allowing the user application to override these functions
+and hook them out as necessary for their application.
+****************************************************************************/
+void X86EMU_setupPioFuncs(X86EMU_pioFuncs * funcs)
+{
+       sys_inb = funcs->inb;
+       sys_inw = funcs->inw;
+       sys_inl = funcs->inl;
+       sys_outb = funcs->outb;
+       sys_outw = funcs->outw;
+       sys_outl = funcs->outl;
+}
+
+/****************************************************************************
+PARAMETERS:
+funcs   - New interrupt vector table to make active
+
+REMARKS:
+This function is used to set the pointers to functions which handle
+interrupt processing in the emulator, allowing the user application to
+hook interrupts as necessary for their application. Any interrupts that
+are not hooked by the user application, and reflected and handled internally
+in the emulator via the interrupt vector table. This allows the application
+to get control when the code being emulated executes specific software
+interrupts.
+****************************************************************************/
+void X86EMU_setupIntrFuncs(X86EMU_intrFuncs funcs[])
+{
+       int i;
+
+       for (i = 0; i < 256; i++)
+               _X86EMU_intrTab[i] = NULL;
+       if (funcs) {
+               for (i = 0; i < 256; i++)
+                       _X86EMU_intrTab[i] = funcs[i];
+       }
+}
+
+/****************************************************************************
+PARAMETERS:
+int - New software interrupt to prepare for
+
+REMARKS:
+This function is used to set up the emulator state to exceute a software
+interrupt. This can be used by the user application code to allow an
+interrupt to be hooked, examined and then reflected back to the emulator
+so that the code in the emulator will continue processing the software
+interrupt as per normal. This essentially allows system code to actively
+hook and handle certain software interrupts as necessary.
+****************************************************************************/
+void X86EMU_prepareForInt(int num)
+{
+       push_word((u16) M.x86.R_FLG);
+       CLEAR_FLAG(F_IF);
+       CLEAR_FLAG(F_TF);
+       push_word(M.x86.R_CS);
+       M.x86.R_CS = mem_access_word(num * 4 + 2);
+       push_word(M.x86.R_IP);
+       M.x86.R_IP = mem_access_word(num * 4);
+       M.x86.intr = 0;
+}
index 9727aebbcb2ffe03f51f752add36e0ed9e97978c..bcf877194e0fdbc5b08514f017c33de8e7decf19 100644 (file)
@@ -63,7 +63,7 @@
                               loop in VIDEO_TSTC_FCT (i8042)
  CFG_CONSOLE_BLINK_COUNT     - value for delay loop - blink rate
  CONFIG_CONSOLE_TIME        - display time/date in upper right corner,
-                              needs CFG_CMD_DATE and CONFIG_CONSOLE_CURSOR
+                              needs CONFIG_CMD_DATE and CONFIG_CONSOLE_CURSOR
  CONFIG_VIDEO_LOGO          - display Linux Logo in upper left corner
  CONFIG_VIDEO_BMP_LOGO      - use bmp_logo instead of linux_logo
  CONFIG_CONSOLE_EXTRA_INFO   - display additional board information strings
@@ -175,15 +175,15 @@ CONFIG_VIDEO_HW_CURSOR:        - Uses the hardware cursor capability of the
 #include <linux/types.h>
 #include <devices.h>
 #include <video_font.h>
-#ifdef CFG_CMD_DATE
-#include <rtc.h>
 
+#if defined(CONFIG_CMD_DATE)
+#include <rtc.h>
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_BMP) || defined(CONFIG_SPLASH_SCREEN)
+#if defined(CONFIG_CMD_BMP) || defined(CONFIG_SPLASH_SCREEN)
 #include <watchdog.h>
 #include <bmp_layout.h>
-#endif /* (CONFIG_COMMANDS & CFG_CMD_BMP) || CONFIG_SPLASH_SCREEN */
+#endif
 
 /*****************************************************************************/
 /* Cursor definition:                                                       */
@@ -709,7 +709,7 @@ void video_puts (const char *s)
 
 /*****************************************************************************/
 
-#if (CONFIG_COMMANDS & CFG_CMD_BMP) || defined(CONFIG_SPLASH_SCREEN)
+#if defined(CONFIG_CMD_BMP) || defined(CONFIG_SPLASH_SCREEN)
 
 #define FILL_8BIT_332RGB(r,g,b)        {                       \
        *fb = ((r>>5)<<5) | ((g>>5)<<2) | (b>>6);       \
@@ -1004,7 +1004,7 @@ int video_display_bitmap (ulong bmp_image, int x, int y)
 
        return (0);
 }
-#endif /* (CONFIG_COMMANDS & CFG_CMD_BMP) || CONFIG_SPLASH_SCREEN */
+#endif
 
 /*****************************************************************************/
 
index 082434ca289db97426101c3cdc26fb75b405a32c..80c4ba21a6849fd1ab7ed18163eb312a7e35f919 100644 (file)
@@ -43,7 +43,7 @@
 
 #ifdef CONFIG_DRIVER_CS8900
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
 
 #undef DEBUG
 
index c43cd5ec2fe918ca1cad7d59a618fc15e1b4f122..d5275dceb0fb6a8603f4881b16d32d4dc40fe4f8 100644 (file)
@@ -20,8 +20,8 @@
 
 #include <common.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET) && defined(CONFIG_NET_MULTI) \
-       && defined(CONFIG_TULIP)
+#if defined(CONFIG_CMD_NET) \
+       && defined(CONFIG_NET_MULTI) && defined(CONFIG_TULIP)
 
 #include <malloc.h>
 #include <net.h>
@@ -768,4 +768,4 @@ static void update_srom(struct eth_device *dev, bd_t *bis)
 }
 #endif /* UPDATE_SROM */
 
-#endif /* CFG_CMD_NET && CONFIG_NET_MULTI && CONFIG_TULIP */
+#endif
index 927acbb26737a20e02962f67047e192545a870a1..f0741da82b29b49bc054b0d8b34a4798bc6131e4 100644 (file)
@@ -44,8 +44,8 @@ tested on both gig copper and gig fiber boards
 
 #include "e1000.h"
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET) && defined(CONFIG_NET_MULTI) && \
-       defined(CONFIG_E1000)
+#if defined(CONFIG_CMD_NET) \
+       && defined(CONFIG_NET_MULTI) && defined(CONFIG_E1000)
 
 #define TOUT_LOOP   100000
 
index 04c17f69f6e6d94a3b96a1519989a215c9cec1ba..738146e6618e08e05656ca28ab879e38e0ff6fb2 100644 (file)
@@ -30,8 +30,8 @@
 
 #undef DEBUG
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET) && defined(CONFIG_NET_MULTI) && \
-       defined(CONFIG_EEPRO100)
+#if defined(CONFIG_CMD_NET) \
+       && defined(CONFIG_NET_MULTI) && defined(CONFIG_EEPRO100)
 
        /* Ethernet chip registers.
         */
@@ -272,7 +272,7 @@ static inline void OUTL (struct eth_device *dev, int command, u_long addr)
        *(volatile u32 *) ((addr + dev->iobase)) = cpu_to_le32 (command);
 }
 
-#if defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII)
+#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
 static inline int INL (struct eth_device *dev, u_long addr)
 {
        return le32_to_cpu (*(volatile u32 *) (addr + dev->iobase));
@@ -386,7 +386,7 @@ static int eepro100_miiphy_write (char *devname, unsigned char addr,
        return 0;
 }
 
-#endif /* defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII) */
+#endif
 
 /* Wait for the chip get the command.
 */
@@ -462,7 +462,7 @@ int eepro100_initialize (bd_t * bis)
 
                eth_register (dev);
 
-#if defined (CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII)
+#if defined (CONFIG_MII) || defined(CONFIG_CMD_MII)
                /* register mii command access routines */
                miiphy_register(dev->name,
                                eepro100_miiphy_read, eepro100_miiphy_write);
old mode 100755 (executable)
new mode 100644 (file)
diff --git a/drivers/fsl_pci_init.c b/drivers/fsl_pci_init.c
new file mode 100644 (file)
index 0000000..1d1f6df
--- /dev/null
@@ -0,0 +1,180 @@
+/*
+ * Copyright 2007 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * Version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+#define DEBUG
+#include <common.h>
+
+#ifdef CONFIG_FSL_PCI_INIT
+
+/*
+ * PCI/PCIE Controller initialization for mpc85xx/mpc86xx soc's
+ *
+ * Initialize controller and call the common driver/pci pci_hose_scan to
+ * scan for bridges and devices.
+ *
+ * Hose fields which need to be pre-initialized by board specific code:
+ *   regions[]
+ *   first_busno
+ *
+ * Fields updated:
+ *   last_busno
+ */
+
+#include <pci.h>
+#include <asm/immap_fsl_pci.h>
+
+void pciauto_prescan_setup_bridge(struct pci_controller *hose,
+                               pci_dev_t dev, int sub_bus);
+void pciauto_postscan_setup_bridge(struct pci_controller *hose,
+                               pci_dev_t dev, int sub_bus);
+
+void pciauto_config_init(struct pci_controller *hose);
+void
+fsl_pci_init(struct pci_controller *hose)
+{
+       u16 temp16;
+       u32 temp32;
+       int busno = hose->first_busno;
+       int enabled;
+       u16 ltssm;
+       u8 temp8;
+       int r;
+       int bridge;
+       volatile ccsr_fsl_pci_t *pci = (ccsr_fsl_pci_t *) hose->cfg_addr;
+       pci_dev_t dev = PCI_BDF(busno,0,0);
+
+       /* Initialize ATMU registers based on hose regions and flags */
+       volatile pot_t *po=&pci->pot[1];        /* skip 0 */
+       volatile pit_t *pi=&pci->pit[0];        /* ranges from: 3 to 1 */
+
+#ifdef DEBUG
+       int neg_link_w;
+#endif
+
+       for (r=0; r<hose->region_count; r++) {
+               if (hose->regions[r].flags & PCI_REGION_MEMORY) { /* inbound */
+                       pi->pitar = (hose->regions[r].bus_start >> 12) & 0x000fffff;
+                       pi->piwbar = (hose->regions[r].phys_start >> 12) & 0x000fffff;
+                       pi->piwbear = 0;
+                       pi->piwar = PIWAR_EN | PIWAR_PF | PIWAR_LOCAL |
+                               PIWAR_READ_SNOOP | PIWAR_WRITE_SNOOP |
+                               (__ilog2(hose->regions[r].size) - 1);
+                       pi++;
+               } else { /* Outbound */
+                       po->powbar = (hose->regions[r].phys_start >> 12) & 0x000fffff;
+                       po->potar = (hose->regions[r].bus_start >> 12) & 0x000fffff;
+                       po->potear = 0;
+                       if (hose->regions[r].flags & PCI_REGION_IO)
+                               po->powar = POWAR_EN | POWAR_IO_READ | POWAR_IO_WRITE |
+                                       (__ilog2(hose->regions[r].size) - 1);
+                       else
+                               po->powar = POWAR_EN | POWAR_MEM_READ | POWAR_MEM_WRITE |
+                                       (__ilog2(hose->regions[r].size) - 1);
+                       po++;
+               }
+       }
+
+       pci_register_hose(hose);
+       pciauto_config_init(hose);      /* grab pci_{mem,prefetch,io} */
+       hose->current_busno = hose->first_busno;
+
+       pci->pedr = 0xffffffff;         /* Clear any errors */
+       pci->peer = 0xffffffff;         /* Enable Error Interupts */
+       pci_hose_read_config_dword (hose, dev, PCI_DCR, &temp32);
+       temp32 |= 0xf000e;              /* set URR, FER, NFER (but not CER) */
+       pci_hose_write_config_dword(hose, dev, PCI_DCR, temp32);
+
+       pci_hose_read_config_byte (hose, dev, PCI_HEADER_TYPE, &temp8);
+       bridge = temp8 & PCI_HEADER_TYPE_BRIDGE; /* Bridge, such as pcie */
+
+       if ( bridge ) {
+
+               pci_hose_read_config_word(hose, dev, PCI_LTSSM, &ltssm);
+               enabled = ltssm >= PCI_LTSSM_L0;
+
+               if (!enabled) {
+                       debug("....PCIE link error.  Skipping scan."
+                             "LTSSM=0x%02x\n", temp16);
+                       hose->last_busno = hose->first_busno;
+                       return;
+               }
+
+               pci->pme_msg_det = 0xffffffff;
+               pci->pme_msg_int_en = 0xffffffff;
+#ifdef DEBUG
+               pci_hose_read_config_word(hose, dev, PCI_LSR, &temp16);
+               neg_link_w = (temp16 & 0x3f0 ) >> 4;
+               debug("...PCIE LTSSM=0x%x, Negotiated link width=%d\n",
+                     ltssm, neg_link_w);
+#endif
+               hose->current_busno++; /* Start scan with secondary */
+               pciauto_prescan_setup_bridge(hose, dev, hose->current_busno);
+
+       } else {
+#if 0
+/* done in pci_hose_config_device() */
+               pci_hose_read_config_word(hose, dev, PCI_COMMAND, &temp16);
+               temp16 |= PCI_COMMAND_SERR | PCI_COMMAND_MASTER |
+                       PCI_COMMAND_MEMORY | PCI_COMMAND_IO;
+               pci_hose_write_config_word(hose, dev, PCI_COMMAND, temp16);
+               pci_hose_write_config_word(hose, dev, PCI_STATUS, 0xffff);
+               pci_hose_write_config_byte(hose, dev, PCI_LATENCY_TIMER, 0x80);
+#endif
+       }
+
+       /* Call setup to allocate PCSRBAR window */
+       pciauto_setup_device(hose, dev, 1, hose->pci_mem,
+                            hose->pci_prefetch, hose->pci_io);
+
+       printf ("               Scanning PCI bus %02x\n", hose->current_busno);
+       hose->last_busno = pci_hose_scan_bus(hose,hose->current_busno);
+
+       if ( bridge ) { /* update limit regs and subordinate busno */
+               pciauto_postscan_setup_bridge(hose, dev, hose->last_busno);
+       }
+
+       /* Clear all error indications */
+
+       if (pci->pme_msg_det && pci->pme_msg_det != 0xffffffff) {
+               debug("pci_fsl_init: pme_msg_det@%x=%x.  Clearing\n",
+                       &pci->pme_msg_det, pci->pme_msg_det);
+               pci->pme_msg_det = 0xffffffff;
+       }
+
+       if (pci->pedr) {
+               debug("pci_fsl_init: pedr@%x=%x.  Clearing\n",
+                       &pci->pedr, pci->pedr);
+               pci->pedr = 0xffffffff;
+       }
+
+       pci_hose_read_config_word (hose, dev, PCI_DSR, &temp16);
+       if (temp16) {
+               debug("pci_fsl_init: PCI_DSR@%x=%x.  Clearing\n",
+                       PCI_DSR, temp16);
+               pci_hose_write_config_word(hose, dev,
+                                          PCI_DSR, 0xffff);
+       }
+
+       pci_hose_read_config_word (hose, dev, PCI_SEC_STATUS, &temp16);
+       if (temp16) {
+               debug("pci_fsl_init: PCI_SEC_STATUS@%x=%x.  Clearing\n",
+                       PCI_SEC_STATUS, temp16);
+               pci_hose_write_config_word(hose, dev, PCI_SEC_STATUS, 0xffff);
+       }
+}
+
+#endif /* CONFIG_FSL_PCI */
index ab22b4d5385417d5563bc73029157a6e3a129fcb..e4aaed6afbc6c1709987c5fbc3226cc0a5487525 100644 (file)
@@ -26,8 +26,8 @@
 
 #include <common.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET) && defined(CONFIG_NET_MULTI) \
-       && defined(CONFIG_INCA_IP_SWITCH)
+#if defined(CONFIG_CMD_NET) \
+       && defined(CONFIG_NET_MULTI) && defined(CONFIG_INCA_IP_SWITCH)
 
 #include <malloc.h>
 #include <net.h>
index a50c5f0abece39e993eb6454ede10f3363ed07af..ecdcbd9b32b10c27aba0281c7cfa43d8f4cff487 100644 (file)
@@ -65,7 +65,7 @@
 
 #ifdef CONFIG_DRIVER_LAN91C96
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
 
 /*------------------------------------------------------------------------
  *
index 186ab19d35ef2f0b42c9a2e8cb2b87f1071684db..bf7853aadd7252236be4307fea4b371f7b3c3ce5 100644 (file)
@@ -17,7 +17,8 @@
  */
 #include <common.h>
 
-#if defined(CONFIG_MACB) && (CONFIG_COMMANDS & (CFG_CMD_NET | CFG_CMD_MII))
+#if defined(CONFIG_MACB) \
+       && (defined(CONFIG_CMD_NET) || defined(CONFIG_CMD_MII))
 
 /*
  * The u-boot networking stack is a little weird.  It seems like the
@@ -163,7 +164,7 @@ static u16 macb_mdio_read(struct macb_device *macb, u8 reg)
        return MACB_BFEXT(DATA, frame);
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
 
 static int macb_send(struct eth_device *netdev, volatile void *packet,
                     int length)
@@ -492,9 +493,9 @@ int macb_eth_initialize(int id, void *regs, unsigned int phy_addr)
        return 0;
 }
 
-#endif /* (CONFIG_COMMANDS & CFG_CMD_NET) */
+#endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_MII)
+#if defined(CONFIG_CMD_MII)
 
 int miiphy_read(unsigned char addr, unsigned char reg, unsigned short *value)
 {
@@ -570,6 +571,6 @@ int miiphy_write(unsigned char addr, unsigned char reg, unsigned short value)
        return 0;
 }
 
-#endif /* (CONFIG_COMMANDS & CFG_CMD_MII) */
+#endif
 
 #endif /* CONFIG_MACB */
index 399a719e56593f04478e27c9a387b870e7f0ecf8..8a34cd305474258db521207ecde5528aaabaef6e 100644 (file)
@@ -6,11 +6,11 @@
 
 #undef CONFIG_PCMCIA
 
-#if    (CONFIG_COMMANDS & CFG_CMD_PCMCIA)
+#if defined(CONFIG_CMD_PCMCIA)
 #define        CONFIG_PCMCIA
 #endif
 
-#if    (CONFIG_COMMANDS & CFG_CMD_IDE) && defined(CONFIG_IDE_8xx_PCCARD)
+#if defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_8xx_PCCARD)
 #define        CONFIG_PCMCIA
 #endif
 
@@ -23,7 +23,7 @@ extern int check_ide_device (int slot);
 extern int pcmcia_hardware_enable (int slot);
 extern int pcmcia_voltage_set(int slot, int vcc, int vpp);
 
-#if    (CONFIG_COMMANDS & CFG_CMD_PCMCIA)
+#if defined(CONFIG_CMD_PCMCIA)
 extern int pcmcia_hardware_disable(int slot);
 #endif
 
@@ -189,7 +189,7 @@ int pcmcia_on (void)
        return rc;
 }
 
-#if    (CONFIG_COMMANDS & CFG_CMD_PCMCIA)
+#if defined(CONFIG_CMD_PCMCIA)
 int pcmcia_off (void)
 {
        int i;
@@ -221,7 +221,7 @@ int pcmcia_off (void)
        pcmcia_hardware_disable(_slot_);
        return 0;
 }
-#endif /* CFG_CMD_PCMCIA */
+#endif
 
 
 static u_int m8xx_get_graycode(u_int size)
index 9fef71d62938a5cd3ca5222f0893b8d5fa42edc0..27b5792bcc95aed29149949ec4c0aae7fb7d3187 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <common.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND) && !defined(CFG_NAND_LEGACY)
+#if defined(CONFIG_CMD_NAND) && !defined(CFG_NAND_LEGACY)
 
 #include <nand.h>
 
index c6fee18222b494297066c89ae1db1e2f330c93f1..151f535c58bddbe2fac6873abd04cf7d84856011 100644 (file)
@@ -72,7 +72,7 @@
 
 #include <common.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND) && !defined(CFG_NAND_LEGACY)
+#if defined(CONFIG_CMD_NAND) && !defined(CFG_NAND_LEGACY)
 
 #include <malloc.h>
 #include <watchdog.h>
index aaa9400e54d501bd8bea6bbc3b813d06080b28e1..19a9bc2a5b6cdc6469118545fa2fdc0cfd80f5d0 100644 (file)
@@ -54,7 +54,7 @@
 
 #include <common.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND) && !defined(CFG_NAND_LEGACY)
+#if defined(CONFIG_CMD_NAND) && !defined(CFG_NAND_LEGACY)
 
 #include <malloc.h>
 #include <linux/mtd/compat.h>
index 90274e6d6dd7eb94570ba8902d3f05e1486503ff..4c532b0794e17f7a47c1ae2c755f37cc91692392 100644 (file)
@@ -37,7 +37,7 @@
 
 #include <common.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND) && !defined(CFG_NAND_LEGACY)
+#if defined(CONFIG_CMD_NAND) && !defined(CFG_NAND_LEGACY)
 
 #include<linux/mtd/mtd.h>
 
@@ -197,4 +197,4 @@ int nand_correct_data(struct mtd_info *mtd, u_char *dat,
        return -1;
 }
 
-#endif /* CONFIG_COMMANDS & CFG_CMD_NAND */
+#endif
index 8b58736bc10e35c8b252e0e6d12d9ebbec0c9073..075cae66b06eced8ad0ceace2c77c6a4e56080f8 100644 (file)
@@ -13,7 +13,7 @@
 
 #include <common.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND) && !defined(CFG_NAND_LEGACY)
+#if defined(CONFIG_CMD_NAND) && !defined(CFG_NAND_LEGACY)
 
 #include <linux/mtd/nand.h>
 
index 10bf03659ede94c2827b0bd28967f52764587a91..88c1df6c20b8601a458518fc5e55ba06ff8a882a 100644 (file)
@@ -32,7 +32,7 @@
 
 #include <common.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND) && !defined(CFG_NAND_LEGACY)
+#if defined(CONFIG_CMD_NAND) && !defined(CFG_NAND_LEGACY)
 
 #include <command.h>
 #include <watchdog.h>
@@ -859,4 +859,4 @@ int nand_unlock(nand_info_t *meminfo, ulong start, ulong length)
        return ret;
 }
 
-#endif /* (CONFIG_COMMANDS & CFG_CMD_NAND) && !defined(CFG_NAND_LEGACY) */
+#endif
index 753f5412953c1635b9be192556023f0745b230ac..49d2ebb67d3fd8392c6d2b0e75c5788830a933ee 100644 (file)
@@ -15,7 +15,7 @@
 #include <asm/io.h>
 #include <watchdog.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND) && defined(CFG_NAND_LEGACY)
+#if defined(CONFIG_CMD_NAND) && defined(CFG_NAND_LEGACY)
 
 #include <linux/mtd/nand_legacy.h>
 #include <linux/mtd/nand_ids.h>
@@ -1609,4 +1609,4 @@ int read_jffs2_nand(size_t start, size_t len,
 }
 #endif /* CONFIG_JFFS2_NAND */
 
-#endif /* (CONFIG_COMMANDS & CFG_CMD_NAND) && defined(CFG_NAND_LEGACY) */
+#endif
index b009db63ebe404f5e816b8a0de22d7050f222fb7..075d6c52c45cdd97c7f6d458453a5d0a06863c1a 100644 (file)
@@ -56,8 +56,8 @@
 #include <asm/io.h>
 #include <pci.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET) && defined(CONFIG_NET_MULTI) && \
-       defined(CONFIG_NATSEMI)
+#if defined(CONFIG_CMD_NET) \
+       && defined(CONFIG_NET_MULTI) && defined(CONFIG_NATSEMI)
 
 /* defines */
 #define EEPROM_SIZE 0xb /*12 16-bit chunks, or 24 bytes*/
index 89b3a8394ed97aa67ee84ee391f876a91af0b58c..a99ee5da2e31a44efcf2bc2a58cebdc6c6997407 100644 (file)
@@ -30,7 +30,7 @@
 #include <asm/arch/netarm_registers.h>
 
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
 
 static int na_mii_poll_busy (void);
 
index 976f86aaff5d41405affd4cd13a8c77dc625aa81..f8b143a01a60f25282440776c0c138d21fc4cb16 100644 (file)
@@ -56,8 +56,8 @@
 #include <asm/io.h>
 #include <pci.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET) && defined(CONFIG_NET_MULTI) && \
-       defined(CONFIG_NS8382X)
+#if defined(CONFIG_CMD_NET) \
+       && defined(CONFIG_NET_MULTI) && defined(CONFIG_NS8382X)
 
 /* defines */
 #define DSIZE     0x00000FFF
index 050582f782677833f755e20dd39994505a7b27c8..41589192c1c835669eaa98437840e9a6f97063ea 100644 (file)
@@ -490,10 +490,16 @@ int pci_hose_scan_bus(struct pci_controller *hose, int bus)
 
 int pci_hose_scan(struct pci_controller *hose)
 {
+       /* Start scan at current_busno.
+        * PCIe will start scan at first_busno+1.
+        */
+       /* For legacy support, ensure current>=first */
+       if (hose->first_busno > hose->current_busno)
+               hose->current_busno = hose->first_busno;
 #ifdef CONFIG_PCI_PNP
        pciauto_config_init(hose);
 #endif
-       return pci_hose_scan_bus(hose, hose->first_busno);
+       return pci_hose_scan_bus(hose, hose->current_busno);
 }
 
 void pci_init(void)
index f170c2db89e066420771a5fbb813385905c9baf2..a3c609ba49ccd9f7abbc00522f4784dae85d95a9 100644 (file)
@@ -65,7 +65,7 @@ int pciauto_region_allocate(struct pci_region* res, unsigned int size, unsigned
 
        res->bus_lower = addr + size;
 
-       DEBUGF("address=0x%lx", addr);
+       DEBUGF("address=0x%lx bus_lower=%x", addr, res->bus_lower);
 
        *bar = addr;
        return 0;
@@ -154,7 +154,7 @@ void pciauto_setup_device(struct pci_controller *hose,
        pci_hose_write_config_byte(hose, dev, PCI_LATENCY_TIMER, 0x80);
 }
 
-static void pciauto_prescan_setup_bridge(struct pci_controller *hose,
+void pciauto_prescan_setup_bridge(struct pci_controller *hose,
                                         pci_dev_t dev, int sub_bus)
 {
        struct pci_region *pci_mem = hose->pci_mem;
@@ -165,8 +165,10 @@ static void pciauto_prescan_setup_bridge(struct pci_controller *hose,
        pci_hose_read_config_dword(hose, dev, PCI_COMMAND, &cmdstat);
 
        /* Configure bus number registers */
-       pci_hose_write_config_byte(hose, dev, PCI_PRIMARY_BUS, PCI_BUS(dev));
-       pci_hose_write_config_byte(hose, dev, PCI_SECONDARY_BUS, sub_bus);
+       pci_hose_write_config_byte(hose, dev, PCI_PRIMARY_BUS,
+                                  PCI_BUS(dev) - hose->first_busno);
+       pci_hose_write_config_byte(hose, dev, PCI_SECONDARY_BUS,
+                                  sub_bus - hose->first_busno);
        pci_hose_write_config_byte(hose, dev, PCI_SUBORDINATE_BUS, 0xff);
 
        if (pci_mem) {
@@ -211,7 +213,7 @@ static void pciauto_prescan_setup_bridge(struct pci_controller *hose,
        pci_hose_write_config_dword(hose, dev, PCI_COMMAND, cmdstat | PCI_COMMAND_MASTER);
 }
 
-static void pciauto_postscan_setup_bridge(struct pci_controller *hose,
+void pciauto_postscan_setup_bridge(struct pci_controller *hose,
                                          pci_dev_t dev, int sub_bus)
 {
        struct pci_region *pci_mem = hose->pci_mem;
@@ -219,7 +221,8 @@ static void pciauto_postscan_setup_bridge(struct pci_controller *hose,
        struct pci_region *pci_io = hose->pci_io;
 
        /* Configure bus number registers */
-       pci_hose_write_config_byte(hose, dev, PCI_SUBORDINATE_BUS, sub_bus);
+       pci_hose_write_config_byte(hose, dev, PCI_SUBORDINATE_BUS,
+                                  sub_bus - hose->first_busno);
 
        if (pci_mem) {
                /* Round memory allocator to 1MB boundary */
@@ -282,25 +285,36 @@ void pciauto_config_init(struct pci_controller *hose)
        if (hose->pci_mem) {
                pciauto_region_init(hose->pci_mem);
 
-               DEBUGF("PCI Autoconfig: Memory region: [%lx-%lx]\n",
+               DEBUGF("PCI Autoconfig: Bus Memory region: [%lx-%lx],\n"
+                      "\t\tPhysical Memory [%x-%x]\n",
                    hose->pci_mem->bus_start,
-                   hose->pci_mem->bus_start + hose->pci_mem->size - 1);
+                   hose->pci_mem->bus_start + hose->pci_mem->size - 1,
+                   hose->pci_mem->phys_start,
+                   hose->pci_mem->phys_start + hose->pci_mem->size - 1);
        }
 
        if (hose->pci_prefetch) {
                pciauto_region_init(hose->pci_prefetch);
 
-               DEBUGF("PCI Autoconfig: Prefetchable Memory region: [%lx-%lx]\n",
+               DEBUGF("PCI Autoconfig: Bus Prefetchable Mem: [%lx-%lx],\n"
+                      "\t\tPhysical Memory [%x-%x]\n",
                    hose->pci_prefetch->bus_start,
-                   hose->pci_prefetch->bus_start + hose->pci_prefetch->size - 1);
+                   hose->pci_prefetch->bus_start + hose->pci_prefetch->size - 1,
+                   hose->pci_prefetch->phys_start,
+                   hose->pci_prefetch->phys_start +
+                               hose->pci_prefetch->size - 1);
        }
 
        if (hose->pci_io) {
                pciauto_region_init(hose->pci_io);
 
-               DEBUGF("PCI Autoconfig: I/O region: [%lx-%lx]\n",
+               DEBUGF("PCI Autoconfig: Bus I/O region: [%lx-%lx],\n"
+                      "\t\tPhysical Memory: [%x-%x]\n",
                    hose->pci_io->bus_start,
-                   hose->pci_io->bus_start + hose->pci_io->size - 1);
+                   hose->pci_io->bus_start + hose->pci_io->size - 1,
+                   hose->pci_io->phys_start,
+                   hose->pci_io->phys_start + hose->pci_io->size - 1);
+
        }
 }
 
@@ -317,6 +331,12 @@ int pciauto_config_device(struct pci_controller *hose, pci_dev_t dev)
        pci_hose_read_config_word(hose, dev, PCI_CLASS_DEVICE, &class);
 
        switch(class) {
+       case PCI_CLASS_PROCESSOR_POWERPC: /* an agent or end-point */
+               DEBUGF("PCI AutoConfig: Found PowerPC device\n");
+               pciauto_setup_device(hose, dev, 6, hose->pci_mem,
+                                    hose->pci_prefetch, hose->pci_io);
+               break;
+
        case PCI_CLASS_BRIDGE_PCI:
                hose->current_busno++;
                pciauto_setup_device(hose, dev, 2, hose->pci_mem, hose->pci_prefetch, hose->pci_io);
index d7be0810f57ae0cd695cdf08ffc94f2c90c59151..a8220fb4117c2ac8de84da417814c051caad3254 100644 (file)
@@ -45,7 +45,7 @@ indirect_##rw##_config_##size(struct pci_controller *hose,             \
        cfg_##rw(val, hose->cfg_data + (offset & mask), type, op);       \
        return 0;                                                        \
 }
-#elif defined(CONFIG_E500)
+#elif defined(CONFIG_E500) || defined(CONFIG_MPC86xx)
 #define INDIRECT_PCI_OP(rw, size, type, op, mask)                        \
 static int                                                               \
 indirect_##rw##_config_##size(struct pci_controller *hose,               \
@@ -55,7 +55,7 @@ indirect_##rw##_config_##size(struct pci_controller *hose,               \
        b = PCI_BUS(dev); d = PCI_DEV(dev); f = PCI_FUNC(dev);           \
        b = b - hose->first_busno;                                       \
        dev = PCI_BDF(b, d, f);                                          \
-       *(hose->cfg_addr) = dev | (offset & 0xfc) | 0x80000000;          \
+       *(hose->cfg_addr) = dev | (offset & 0xfc) | ((offset & 0xf00) << 16) | 0x80000000; \
        sync();                                                          \
        cfg_##rw(val, hose->cfg_data + (offset & mask), type, op);       \
        return 0;                                                        \
index da9ac7f99affc56887827389b0e6ccac10b91978..2af0e8f244f3384af18c67cb6df366c51fd43982 100644 (file)
@@ -45,8 +45,8 @@
 #define PCNET_DEBUG2(fmt,args...)
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET) && defined(CONFIG_NET_MULTI) \
-    && defined(CONFIG_PCNET)
+#if defined(CONFIG_CMD_NET) \
+       && defined(CONFIG_NET_MULTI) && defined(CONFIG_PCNET)
 
 #if !defined(CONF_PCNET_79C973) && defined(CONF_PCNET_79C975)
 #error "Macro for PCnet chip version is not defined!"
index 4c683d7a5c451760de281c02630235986bb4f7fc..0ae5d808a6f9d055ad73f2202737adf4c58f1dbb 100644 (file)
@@ -25,8 +25,8 @@
 
 #include <common.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET) && defined(CONFIG_NET_MULTI) \
-       && defined(CONFIG_PLB2800_ETHER)
+#if defined(CONFIG_CMD_NET) \
+       && defined(CONFIG_NET_MULTI) && defined(CONFIG_PLB2800_ETHER)
 
 #include <malloc.h>
 #include <net.h>
index d9d38bbfcd8048253f5b703ddc701f999ca88f7b..6020e46283abc966f5de4b3f5fb183402138e683 100644 (file)
@@ -85,7 +85,7 @@ int pcmcia_on (void)
        return rc;
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_PCMCIA)
+#if defined(CONFIG_CMD_PCMCIA)
 int pcmcia_off (void)
 {
        return 0;
index 2a0a9e05a27de32688b1d6393ce918a3e3080e87..c7c425b93cf8c67145c2d5f8c1f08459c262cd0c 100644 (file)
@@ -9,11 +9,11 @@
 
 #undef CONFIG_PCMCIA
 
-#if    CONFIG_COMMANDS & CFG_CMD_PCMCIA
+#if defined(CONFIG_CMD_PCMCIA)
 #define        CONFIG_PCMCIA
 #endif
 
-#if    (CONFIG_COMMANDS & CFG_CMD_IDE) && defined(CONFIG_IDE_8xx_PCCARD)
+#if defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_8xx_PCCARD)
 #define        CONFIG_PCMCIA
 #endif
 
@@ -62,12 +62,12 @@ int pcmcia_hardware_enable (int slot)
        return 0;       /* No hardware to enable */
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_PCMCIA)
+#if defined(CONFIG_CMD_PCMCIA)
 static int pcmcia_hardware_disable(int slot)
 {
        return 0;       /* No hardware to disable */
 }
-#endif /* CONFIG_COMMANDS & CFG_CMD_PCMCIA */
+#endif
 
 
 #endif /* CONFIG_PCMCIA && (CONFIG_RPXCLASSIC || CONFIG_RPXLITE) */
index 62b9245517ba3ab0d4003f548b981fdca98058b0..409a69f0214e21d8088b98ed858babdda15974f1 100644 (file)
@@ -34,7 +34,7 @@
 
 #ifdef CONFIG_DRIVER_RTL8019
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
 
 
 /* packet page register access functions */
index afe1a4fdaf6508d131de91308d2e43aec2b63de7..9045523a3126a4cef541a7da2b1d035a6a601314 100644 (file)
@@ -77,7 +77,7 @@
 #include <asm/io.h>
 #include <pci.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET) && defined(CONFIG_NET_MULTI) && \
+#if defined(CONFIG_CMD_NET) && defined(CONFIG_NET_MULTI) && \
        defined(CONFIG_RTL8139)
 
 #define TICKS_PER_SEC  CFG_HZ
@@ -535,4 +535,4 @@ static void rtl_disable(struct eth_device *dev)
                udelay (100); /* wait 100us */
        }
 }
-#endif /* CFG_CMD_NET && CONFIG_NET_MULTI && CONFIG_RTL8139 */
+#endif
index 3393ba890ae2e1d6eea64c5379901c275aa0fcc5..63ea2cca9b1090e8945d46ec35458d1da10d6535 100644 (file)
@@ -55,7 +55,7 @@
 #include <asm/io.h>
 #include <pci.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET) && defined(CONFIG_NET_MULTI) && \
+#if defined(CONFIG_CMD_NET) && defined(CONFIG_NET_MULTI) && \
        defined(CONFIG_RTL8169)
 
 #undef DEBUG_RTL8169
index 263dac810693fbab05fda2c266b583eb996a776d..d02cd1be2427adab1e229e166fbfef5697ff0bc3 100644 (file)
@@ -25,7 +25,7 @@
 
 #include <common.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET) && defined(CONFIG_NET_MULTI) && \
+#if defined(CONFIG_CMD_NET) && defined(CONFIG_NET_MULTI) && \
        defined(CONFIG_SK98)
 
 #include "h/skdrv1st.h"
index ae10f80ecfb11720140a5124c30bdb6741ef70f8..29eeccd9a8f79c6934fb94aadc627d1c38debeb2 100644 (file)
@@ -51,7 +51,7 @@
 #define PRINTF(fmt,args...)
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_SCSI) && defined(CONFIG_SCSI_SYM53C8XX)
+#if defined(CONFIG_CMD_SCSI) && defined(CONFIG_SCSI_SYM53C8XX)
 
 #undef SCSI_SINGLE_STEP
 /*
@@ -787,7 +787,7 @@ void scsi_chip_init(void)
        scsi_write_byte(DMODE,0x00);
 #endif
 }
-#endif /* (CONFIG_COMMANDS & CFG_CMD_SCSI) */
+#endif
 
 
 #endif /* CONFIG_SCSI_SYM53C8XX */
index d5297b57213e635f3b1907b6be766640470c45c2..208ca50a743ecb88b56ab8daa6665f85d19ee65f 100644 (file)
@@ -64,7 +64,7 @@
 
 #include <pcmcia.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_PCMCIA) && defined(CONFIG_IDE_TI_CARDBUS)
+#if defined(CONFIG_CMD_PCMCIA) && defined(CONFIG_IDE_TI_CARDBUS)
 
 int pcmcia_on(int ide_base_bus);
 
index ec2cd2ac36ff29b7ef3e5ab628a8b28ea8765b86..860a8894fc760f3b58bac8a516bbb633ef104eb4 100644 (file)
@@ -12,7 +12,7 @@
 /******************************************************************************/
 #include <common.h>
 #include <asm/types.h>
-#if (CONFIG_COMMANDS & CFG_CMD_NET) && !defined(CONFIG_NET_MULTI) && \
+#if defined(CONFIG_CMD_NET) && !defined(CONFIG_NET_MULTI) && \
        defined(CONFIG_TIGON3)
 #ifdef CONFIG_BMW
 #include <mpc824x.h>
@@ -6197,4 +6197,4 @@ LM_DmaTest(PLM_DEVICE_BLOCK pDevice, PLM_UINT8 pBufferVirt,
     }
     return LM_STATUS_SUCCESS;
 }
-#endif /* CFG_CMD_NET, !CONFIG_NET_MULTI, CONFIG_TIGON3 */
+#endif
index a0f53cd6841a21c7c22a37da5d908ffbcfc43308..132c7a5169b649e59a255b5265a34e4f0eff345d 100644 (file)
 
 #undef CONFIG_PCMCIA
 
-#if    (CONFIG_COMMANDS & CFG_CMD_PCMCIA)
+#if defined(CONFIG_CMD_PCMCIA)
 #define        CONFIG_PCMCIA
 #endif
 
-#if    (CONFIG_COMMANDS & CFG_CMD_IDE) && defined(CONFIG_IDE_8xx_PCCARD)
+#if defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_8xx_PCCARD)
 #define        CONFIG_PCMCIA
 #endif
 
@@ -241,7 +241,7 @@ int pcmcia_hardware_enable(int slot)
 }
 
 
-#if (CONFIG_COMMANDS & CFG_CMD_PCMCIA)
+#if defined(CONFIG_CMD_PCMCIA)
 int pcmcia_hardware_disable(int slot)
 {
        u_long reg;
@@ -263,7 +263,7 @@ int pcmcia_hardware_disable(int slot)
 
        return (0);
 }
-#endif /* CFG_CMD_PCMCIA */
+#endif
 
 int pcmcia_voltage_set(int slot, int vcc, int vpp)
 {
index 1298478704fe3cb78709855b8fbbe5078055ef52..60bef9af39472c4fc4a6623a7070845ba698afd4 100644 (file)
@@ -176,7 +176,7 @@ int tsec_initialize(bd_t * bis, int index, char *devname)
        priv->regs->maccfg1 |= MACCFG1_SOFT_RESET;
        priv->regs->maccfg1 &= ~(MACCFG1_SOFT_RESET);
 
-#if defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII) \
+#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) \
        && !defined(BITBANGMII)
        miiphy_register(dev->name, tsec_miiphy_read, tsec_miiphy_write);
 #endif
@@ -898,6 +898,39 @@ static void tsec_halt(struct eth_device *dev)
                phy_run_commands(priv, priv->phyinfo->shutdown);
 }
 
+struct phy_info phy_info_M88E1149S = {
+       0x1410ca,
+       "Marvell 88E1149S",
+       4,
+       (struct phy_cmd[]){     /* config */
+               /* Reset and configure the PHY */
+               {MIIM_CONTROL, MIIM_CONTROL_RESET, NULL},
+               {0x1d, 0x1f, NULL},
+               {0x1e, 0x200c, NULL},
+               {0x1d, 0x5, NULL},
+               {0x1e, 0x0, NULL},
+               {0x1e, 0x100, NULL},
+               {MIIM_GBIT_CONTROL, MIIM_GBIT_CONTROL_INIT, NULL},
+               {MIIM_ANAR, MIIM_ANAR_INIT, NULL},
+               {MIIM_CONTROL, MIIM_CONTROL_RESET, NULL},
+               {MIIM_CONTROL, MIIM_CONTROL_INIT, &mii_cr_init},
+               {miim_end,}
+       },
+       (struct phy_cmd[]){     /* startup */
+               /* Status is read once to clear old link state */
+               {MIIM_STATUS, miim_read, NULL},
+               /* Auto-negotiate */
+               {MIIM_STATUS, miim_read, &mii_parse_sr},
+               /* Read the status */
+               {MIIM_88E1011_PHY_STATUS, miim_read,
+                &mii_parse_88E1011_psr},
+               {miim_end,}
+       },
+       (struct phy_cmd[]){     /* shutdown */
+               {miim_end,}
+       },
+};
+
 /* The 5411 id is 0x206070, the 5421 is 0x2060e0 */
 struct phy_info phy_info_BCM5461S = {
        0x02060c1,      /* 5461 ID */
@@ -993,11 +1026,6 @@ struct phy_info phy_info_M88E1111S = {
        (struct phy_cmd[]){     /* config */
                           /* Reset and configure the PHY */
                           {MIIM_CONTROL, MIIM_CONTROL_RESET, NULL},
-                          {0x1d, 0x1f, NULL},
-                          {0x1e, 0x200c, NULL},
-                          {0x1d, 0x5, NULL},
-                          {0x1e, 0x0, NULL},
-                          {0x1e, 0x100, NULL},
                           {0x14, 0x0cd2, NULL}, /* Delay RGMII TX and RX */
                           {MIIM_GBIT_CONTROL, MIIM_GBIT_CONTROL_INIT, NULL},
                           {MIIM_ANAR, MIIM_ANAR_INIT, NULL},
@@ -1037,14 +1065,16 @@ static struct phy_info phy_info_M88E1145 = {
        "Marvell 88E1145",
        4,
        (struct phy_cmd[]){     /* config */
+                          /* Reset the PHY */
+                          {MIIM_CONTROL, MIIM_CONTROL_RESET, NULL},
+
                           /* Errata E0, E1 */
                           {29, 0x001b, NULL},
                           {30, 0x418f, NULL},
                           {29, 0x0016, NULL},
                           {30, 0xa2da, NULL},
 
-                          /* Reset and configure the PHY */
-                          {MIIM_CONTROL, MIIM_CONTROL_RESET, NULL},
+                          /* Configure the PHY */
                           {MIIM_GBIT_CONTROL, MIIM_GBIT_CONTROL_INIT, NULL},
                           {MIIM_ANAR, MIIM_ANAR_INIT, NULL},
                           {MIIM_88E1011_PHY_SCR, MIIM_88E1011_PHY_MDI_X_AUTO,
@@ -1321,6 +1351,7 @@ struct phy_info *phy_info[] = {
        &phy_info_M88E1011S,
        &phy_info_M88E1111S,
        &phy_info_M88E1145,
+       &phy_info_M88E1149S,
        &phy_info_dm9161,
        &phy_info_lxt971,
        &phy_info_VSC8244,
@@ -1351,8 +1382,10 @@ struct phy_info *get_phy_info(struct eth_device *dev)
        /* loop through all the known PHY types, and find one that */
        /* matches the ID we read from the PHY. */
        for (i = 0; phy_info[i]; i++) {
-               if (phy_info[i]->id == (phy_ID >> phy_info[i]->shift))
+               if (phy_info[i]->id == (phy_ID >> phy_info[i]->shift)) {
                        theInfo = phy_info[i];
+                       break;
+               }
        }
 
        if (theInfo == NULL) {
@@ -1443,7 +1476,7 @@ static void relocate_cmds(void)
        relocated = 1;
 }
 
-#if defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII) \
+#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) \
        && !defined(BITBANGMII)
 
 struct tsec_private *get_priv_for_phy(unsigned char phyaddr)
@@ -1502,7 +1535,6 @@ static int tsec_miiphy_write(char *devname, unsigned char addr,
        return 0;
 }
 
-#endif /* defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII)
-               && !defined(BITBANGMII) */
+#endif
 
 #endif /* CONFIG_TSEC_ENET */
index 47341bee7f142e142824b25b85ff40d87d39c9b0..524e9daa4cb4a79ec99a4ffaaf5bcfb7afbda8f4 100644 (file)
@@ -27,7 +27,7 @@
 
 #include <config.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET) && defined(CONFIG_NET_MULTI) \
+#if defined(CONFIG_CMD_NET) && defined(CONFIG_NET_MULTI) \
        && defined(CONFIG_TSI108_ETH)
 
 #if !defined(CONFIG_TSI108_ETH_NUM_PORTS) || (CONFIG_TSI108_ETH_NUM_PORTS > 2)
index eb52cb66c961b6f8c9219c584733a04e4679dc08..3a3b75c39bf4b5606edb298e1057708e73a81a29 100644 (file)
@@ -28,7 +28,7 @@
 #ifdef CONFIG_TSI108_I2C
 #include <tsi108.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_I2C)
+#if defined(CONFIG_CMD_I2C)
 
 #define I2C_DELAY      100000
 #undef  DEBUG_I2C
@@ -279,5 +279,5 @@ int i2c_probe (uchar chip)
        return i2c_read (chip, 0, 1, (char *)&tmp, 1);
 }
 
-#endif /* (CONFIG_COMMANDS & CFG_CMD_I2C) */
+#endif
 #endif /* CONFIG_TSI108_I2C */
index 48e7f63aa4d720a272614d0aa29b537bb8ba460d..369d1f16740a2abbb040842f994c694f966f8234 100644 (file)
@@ -27,7 +27,7 @@
 #include <common.h>
 #include <malloc.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_JFFS2)
+#if defined(CONFIG_CMD_JFFS2)
 
 #include <asm/byteorder.h>
 #include <linux/stat.h>
index 170832a9c5314c39ea4403218cfdb09892222955..2e906eb4cfa498a2c61e1f5d39050fe6ef894628 100644 (file)
@@ -25,7 +25,7 @@
 #include <watchdog.h>
 #include <zlib.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_JFFS2)
+#if defined(CONFIG_CMD_JFFS2)
 
 static z_stream stream;
 
index 1469e982b74fc4e6cab8e3c05348ddc24799f4d7..643a1a8c850182daa37f7b9232b4047f7a83d936 100644 (file)
@@ -25,7 +25,7 @@
 
 
 #include <common.h>
-#if (CONFIG_COMMANDS & CFG_CMD_EXT2)
+#if defined(CONFIG_CMD_EXT2)
 
 #include <config.h>
 #include <ext2fs.h>
@@ -123,4 +123,4 @@ int ext2fs_devread (int sector, int byte_offset, int byte_len, char *buf) {
        }
        return (1);
 }
-#endif /* CFG_CMD_EXT2FS */
+#endif
index 9cf2fb7ba494499a1afe38a63f6c6fb378895cf1..513a2f9e3201fb78f9c068f9277ee134ba98ad18 100644 (file)
@@ -25,7 +25,7 @@
 
 #include <common.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_EXT2)
+#if defined(CONFIG_CMD_EXT2)
 #include <ext2fs.h>
 #include <malloc.h>
 #include <asm/byteorder.h>
@@ -875,4 +875,4 @@ fail:
        return (0);
 }
 
-#endif /* CFG_CMD_EXT2FS */
+#endif
old mode 100755 (executable)
new mode 100644 (file)
index 21a00b8..e98e50a
@@ -31,7 +31,7 @@
 #include <asm/byteorder.h>
 #include <part.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_FAT)
+#if defined(CONFIG_CMD_FAT)
 
 /*
  * Convert a string to lowercase.
@@ -85,39 +85,46 @@ fat_register_device(block_dev_desc_t *dev_desc, int part_no)
                /* no signature found */
                return -1;
        }
-#if ((CONFIG_COMMANDS & CFG_CMD_IDE)   || \
-     (CONFIG_COMMANDS & CFG_CMD_SCSI)  || \
-     (CONFIG_COMMANDS & CFG_CMD_USB)   || \
-     (defined(CONFIG_MMC)) || \
-     defined(CONFIG_SYSTEMACE)          )
-       /* First we assume, there is a MBR */
-       if (!get_partition_info (dev_desc, part_no, &info)) {
-               part_offset = info.start;
-               cur_part = part_no;
-       } else if (!strncmp((char *)&buffer[DOS_FS_TYPE_OFFSET], "FAT", 3)) {
+       if(!strncmp((char *)&buffer[DOS_FS_TYPE_OFFSET],"FAT",3)) {
                /* ok, we assume we are on a PBR only */
                cur_part = 1;
-               part_offset = 0;
+               part_offset=0;
        } else {
-               printf ("** Partition %d not valid on device %d **\n", part_no, dev_desc->dev);
-               return -1;
-       }
+#if (defined(CONFIG_CMD_IDE) || \
+     defined(CONFIG_CMD_SCSI) || \
+     defined(CONFIG_CMD_USB) || \
+     (defined(CONFIG_MMC) && defined(CONFIG_LPC2292)) || \
+     defined(CONFIG_SYSTEMACE)          )
+               /* First we assume, there is a MBR */
+               if (!get_partition_info (dev_desc, part_no, &info)) {
+                       part_offset = info.start;
+                       cur_part = part_no;
+               } else if (!strncmp((char *)&buffer[DOS_FS_TYPE_OFFSET], "FAT", 3)) {
+                       /* ok, we assume we are on a PBR only */
+                       cur_part = 1;
+                       part_offset = 0;
+               } else {
+                       printf ("** Partition %d not valid on device %d **\n",
+                               part_no, dev_desc->dev);
+                       return -1;
+               }
 #else
-       if(!strncmp((char *)&buffer[DOS_FS_TYPE_OFFSET],"FAT",3)) {
-               /* ok, we assume we are on a PBR only */
-               cur_part = 1;
-               part_offset = 0;
-               info.start = part_offset;
-       } else {
-               /* FIXME we need to determine the start block of the
-                * partition where the DOS FS resides. This can be done
-                * by using the get_partition_info routine. For this
-                * purpose the libpart must be included.
-                */
-               part_offset = 32;
-               cur_part = 1;
-       }
+               if(!strncmp((char *)&buffer[DOS_FS_TYPE_OFFSET],"FAT",3)) {
+                       /* ok, we assume we are on a PBR only */
+                       cur_part = 1;
+                       part_offset = 0;
+                       info.start = part_offset;
+               } else {
+                       /* FIXME we need to determine the start block of the
+                        * partition where the DOS FS resides. This can be done
+                        * by using the get_partition_info routine. For this
+                        * purpose the libpart must be included.
+                        */
+                       part_offset = 32;
+                       cur_part = 1;
+               }
 #endif
+       }
        return 0;
 }
 
@@ -979,8 +986,10 @@ file_fat_detectfs(void)
                printf("No current device\n");
                return 1;
        }
-#if (CONFIG_COMMANDS & CFG_CMD_IDE) || (CONFIG_COMMANDS & CFG_CMD_SCSI) || \
-    (CONFIG_COMMANDS & CFG_CMD_USB) || (CONFIG_MMC)
+#if defined(CONFIG_CMD_IDE) || \
+    defined(CONFIG_CMD_SCSI) || \
+    defined(CONFIG_CMD_USB) || \
+    (CONFIG_MMC)
        printf("Interface:  ");
        switch(cur_dev->if_type) {
                case IF_TYPE_IDE :      printf("IDE"); break;
@@ -1021,4 +1030,4 @@ file_fat_read(const char *filename, void *buffer, unsigned long maxsize)
        return do_fat_read(filename, buffer, maxsize, LS_NO);
 }
 
-#endif /* #if (CONFIG_COMMANDS & CFG_CMD_FAT) */
+#endif
index f999ac5a254a846856f2c2523c6f6d9a12d045b1..514dbaecba8129bdb62c318ee7ac281530aacccd 100644 (file)
@@ -32,7 +32,7 @@
 #include <linux/stat.h>
 #include <linux/time.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_FAT)
+#if defined(CONFIG_CMD_FAT)
 
 /* Supported filesystems */
 static const struct filesystem filesystems[] = {
@@ -205,4 +205,4 @@ file_read(const char *filename, void *buffer, unsigned long maxsize)
        return filesystems[current_filesystem].read(arg, buffer, maxsize);
 }
 
-#endif /* #if (CONFIG_COMMANDS & CFG_CMD_FAT) */
+#endif
index 5dea5cd788050b90ac17effd1bfb8b9e6d4cad42..271d0e790b7a1b815a174c77880a9a06bba5765e 100644 (file)
@@ -28,7 +28,7 @@
 #include "dos.h"
 #include "fdos.h"
 
-#if (CONFIG_COMMANDS & CFG_CMD_FDOS)
+#if defined(CONFIG_CMD_FDOS)
 
 #define NB_HEADS        2
 #define NB_TRACKS       80
index 2ef2371e17f19c29df4e3fb92105811437ab4fb8..2e2d2b8cefb0ee0ad48a2ce7982dc2afaa326548 100644 (file)
@@ -26,7 +26,7 @@
 #include <config.h>
 #include <malloc.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_FDOS)
+#if defined(CONFIG_CMD_FDOS)
 
 #include "dos.h"
 #include "fdos.h"
index a29f43d978891b9f51e7aa40a0b9086c46f82467..5be6a960e7ac2352240e28dff1457cd1a3fd4f61 100644 (file)
@@ -25,7 +25,7 @@
 #include <common.h>
 #include <config.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_FDOS)
+#if defined(CONFIG_CMD_FDOS)
 #include <malloc.h>
 #include "dos.h"
 #include "fdos.h"
index 3b9d09e490367402a5b29f724c0f2d3c5bc05c3a..aded6708d1f20cbbce87ba725b5af7c8d61d6c56 100644 (file)
@@ -26,7 +26,7 @@
 #include <config.h>
 #include <malloc.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_FDOS)
+#if defined(CONFIG_CMD_FDOS)
 
 #include "dos.h"
 #include "fdos.h"
index 97b25047ae4dc15923999b037b262c25e9be2549..497f554f915c3ef572b16f2507ea0bced54ba360 100644 (file)
@@ -26,7 +26,7 @@
 #include <config.h>
 #include <malloc.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_FDOS)
+#if defined(CONFIG_CMD_FDOS)
 
 #include "dos.h"
 #include "fdos.h"
index 46a464b293f44a50ec5a4f86b8ebb88af50f561f..0e7883b0ab370f529f4a0246ad318f1442df1e71 100644 (file)
@@ -25,7 +25,7 @@
 #include <common.h>
 #include <config.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_FDOS)
+#if defined(CONFIG_CMD_FDOS)
 #include <linux/ctype.h>
 
 #include "dos.h"
index 828b6e5515b12a2bd06bd9b1ab1c44025df51690..f64bc74a9ee7ad9bc24ae55a04d37f4f63c7cf3a 100644 (file)
@@ -50,7 +50,7 @@ All rights reserved. Permission granted for non-commercial use.
 
 
 #include <config.h>
-#if ((CONFIG_COMMANDS & CFG_CMD_JFFS2) && defined(CONFIG_JFFS2_LZO_LZARI))
+#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_LZO_LZARI)
 
 #include <linux/stddef.h>
 #include <jffs2/jffs2.h>
@@ -259,4 +259,4 @@ int lzari_decompress(unsigned char *data_in, unsigned char *cpage_out,
 {
     return Decode(data_in, cpage_out, srclen, destlen);
 }
-#endif /* ((CONFIG_COMMANDS & CFG_CMD_JFFS2) && defined(CONFIG_JFFS2_LZO_LZARI)) */
+#endif
index b6c590ac8f3a75615548633b2bfabd8255b86a37..a32b9934e4f62ed577e5406d74b4468050367d67 100644 (file)
@@ -67,7 +67,7 @@
 
 
 #include <config.h>
-#if ((CONFIG_COMMANDS & CFG_CMD_JFFS2) && defined(CONFIG_JFFS2_LZO_LZARI))
+#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_LZO_LZARI)
 
 #include <linux/stddef.h>
 #include <jffs2/jffs2.h>
@@ -402,4 +402,4 @@ int lzo_decompress(unsigned char *data_in, unsigned char *cpage_out,
        return lzo1x_decompress (data_in, srclen, cpage_out, &outlen, NULL);
 }
 
-#endif /* ((CONFIG_COMMANDS & CFG_CMD_JFFS2) && defined(CONFIG_JFFS2_LZO_LZARI)) */
+#endif
index 9bb4f1bcb63f2399f0bd2ce6d56574e39a543c70..144263c4225fc119bd767c46881fdda8fd486825 100644 (file)
@@ -46,7 +46,7 @@
  */
 
 #include <config.h>
-#if (CONFIG_COMMANDS & CFG_CMD_JFFS2)
+#if defined(CONFIG_CMD_JFFS2)
 
 #include <jffs2/jffs2.h>
 
@@ -88,4 +88,4 @@ void rtime_decompress(unsigned char *data_in, unsigned char *cpage_out,
        }
 }
 
-#endif /* CFG_CMD_JFFS2 */
+#endif
index 74577d9c62b39c2b0662c62a59f1feee1a2d8dbe..f6f3fa1b5887c1f3bfc2ebc85e77e9242a63fe53 100644 (file)
@@ -39,7 +39,7 @@
  */
 
 #include <config.h>
-#if (CONFIG_COMMANDS & CFG_CMD_JFFS2)
+#if defined(CONFIG_CMD_JFFS2)
 
 #include <jffs2/jffs2.h>
 #include <jffs2/compr_rubin.h>
@@ -123,4 +123,4 @@ void dynrubin_decompress(unsigned char *data_in, unsigned char *cpage_out,
        rubin_do_decompress(bits, data_in+8, cpage_out, dstlen);
 }
 
-#endif /* CFG_CMD_JFFS2 */
+#endif
index d88d0f8f36e349db35317f84bb118a282735bd15..29dfe1b66401c52682e90dda39185f7f43cca98f 100644 (file)
@@ -37,7 +37,7 @@
 
 #include <common.h>
 #include <config.h>
-#if (CONFIG_COMMANDS & CFG_CMD_JFFS2)
+#if defined(CONFIG_CMD_JFFS2)
 
 #include <jffs2/jffs2.h>
 #include <jffs2/mini_inflate.h>
@@ -49,4 +49,4 @@ long zlib_decompress(unsigned char *data_in, unsigned char *cpage_out,
 
 }
 
-#endif /* CFG_CMD_JFFS2 */
+#endif
index 41ff4c1fbbd369a191debb703c03caf3ac36e86e..53166683fd07b4266c41cec782002b404b64c816 100644 (file)
 #include <linux/stat.h>
 #include <linux/time.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_JFFS2)
+#if defined(CONFIG_CMD_JFFS2)
 
 #include <jffs2/jffs2.h>
 #include <jffs2/jffs2_1pass.h>
 /* keeps pointer to currentlu processed partition */
 static struct part_info *current_part;
 
-#if defined(CONFIG_JFFS2_NAND) && (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if (defined(CONFIG_JFFS2_NAND) && \
+     defined(CONFIG_CMD_NAND) )
 #if defined(CFG_NAND_LEGACY)
 #include <linux/mtd/nand_legacy.h>
 #else
@@ -274,10 +275,10 @@ static void put_fl_mem_nand(void *buf)
 {
        free(buf);
 }
-#endif /* #if defined(CONFIG_JFFS2_NAND) && (CONFIG_COMMANDS & CFG_CMD_NAND) */
+#endif
 
 
-#if (CONFIG_COMMANDS & CFG_CMD_FLASH)
+#if defined(CONFIG_CMD_FLASH)
 /*
  * Support for jffs2 on top of NOR-flash
  *
@@ -300,7 +301,7 @@ static inline void *get_node_mem_nor(u32 off)
 {
        return (void*)get_fl_mem_nor(off);
 }
-#endif /* #if (CONFIG_COMMANDS & CFG_CMD_FLASH) */
+#endif
 
 
 /*
@@ -311,12 +312,12 @@ static inline void *get_fl_mem(u32 off, u32 size, void *ext_buf)
 {
        struct mtdids *id = current_part->dev->id;
 
-#if (CONFIG_COMMANDS & CFG_CMD_FLASH)
+#if defined(CONFIG_CMD_FLASH)
        if (id->type == MTD_DEV_TYPE_NOR)
                return get_fl_mem_nor(off);
 #endif
 
-#if defined(CONFIG_JFFS2_NAND) && (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_JFFS2_NAND) && defined(CONFIG_CMD_NAND)
        if (id->type == MTD_DEV_TYPE_NAND)
                return get_fl_mem_nand(off, size, ext_buf);
 #endif
@@ -329,12 +330,13 @@ static inline void *get_node_mem(u32 off)
 {
        struct mtdids *id = current_part->dev->id;
 
-#if (CONFIG_COMMANDS & CFG_CMD_FLASH)
+#if defined(CONFIG_CMD_FLASH)
        if (id->type == MTD_DEV_TYPE_NOR)
                return get_node_mem_nor(off);
 #endif
 
-#if defined(CONFIG_JFFS2_NAND) && (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_JFFS2_NAND) && \
+    defined(CONFIG_CMD_NAND)
        if (id->type == MTD_DEV_TYPE_NAND)
                return get_node_mem_nand(off);
 #endif
@@ -345,7 +347,8 @@ static inline void *get_node_mem(u32 off)
 
 static inline void put_fl_mem(void *buf)
 {
-#if defined(CONFIG_JFFS2_NAND) && (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_JFFS2_NAND) && \
+    defined(CONFIG_CMD_NAND)
        struct mtdids *id = current_part->dev->id;
 
        if (id->type == MTD_DEV_TYPE_NAND)
@@ -1394,4 +1397,4 @@ jffs2_1pass_info(struct part_info * part)
        return 1;
 }
 
-#endif /* CFG_CMD_JFFS2 */
+#endif
index e78af7578b6a7d712d5f962e0999aa1c6de6e08f..3a4c64985a4eb21498ef7c704baebb935327642b 100644 (file)
@@ -1,6 +1,6 @@
 #include <common.h>
 
-#if !defined(CFG_NAND_LEGACY) && (CONFIG_COMMANDS & CFG_CMD_JFFS2)
+#if !defined(CFG_NAND_LEGACY) && defined(CONFIG_CMD_JFFS2)
 
 #include <malloc.h>
 #include <linux/stat.h>
@@ -1033,4 +1033,4 @@ jffs2_1pass_info(struct part_info * part)
        return 1;
 }
 
-#endif /* CFG_CMD_JFFS2 */
+#endif
index 4f511ec1a479e8d5fa93e5ea87c559102cfd2de1..4c50fc32dc20f6c53561c394ad9605c9f32d9914 100644 (file)
@@ -25,7 +25,7 @@
 
 #include <config.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_JFFS2)
+#if defined(CONFIG_CMD_JFFS2)
 
 #include <jffs2/mini_inflate.h>
 
@@ -393,4 +393,4 @@ long decompress_block(unsigned char *dest, unsigned char *source,
        return stream.error ? -stream.error : stream.decoded;
 }
 
-#endif /* CFG_CMD_JFFS2 */
+#endif
index 6f6056f337741e94dee95f10dc2afc67ae49be4f..6b36c06b5c12ccfc4c84a3070ca3e2d94cc43ff7 100644 (file)
@@ -19,7 +19,7 @@
 
 
 #include <common.h>
-#if (CONFIG_COMMANDS & CFG_CMD_REISER)
+#if defined(CONFIG_CMD_REISER)
 
 #include <config.h>
 #include <reiserfs.h>
@@ -120,4 +120,4 @@ int reiserfs_devread (int sector, int byte_offset, int byte_len, char *buf)
        return 1;
 }
 
-#endif /* CFG_CMD_REISERFS */
+#endif
index bc565fbddd2bdfea718100915a18d8abde273b5c..ae98834df48709e8260d62bbbd9f649ae71f08f3 100644 (file)
@@ -26,7 +26,7 @@
 
 
 #include <common.h>
-#if (CONFIG_COMMANDS & CFG_CMD_REISER)
+#if defined(CONFIG_CMD_REISER)
 #include <linux/stat.h>
 
 #if ( S_ISUID != 04000 ) || ( S_ISGID != 02000 ) || ( S_ISVTX != 01000 ) \
@@ -139,4 +139,4 @@ const char *bb_mode_string(int mode)
 
 #endif
 
-#endif /* CFG_CMD_REISER */
+#endif
index 31c25ebc7b1acf34fb2c8c24b39ab82d7a983614..aa96361638e9320456d4ac0063108eaab0f753c4 100644 (file)
@@ -29,7 +29,7 @@
  */
 
 #include <common.h>
-#if (CONFIG_COMMANDS & CFG_CMD_REISER)
+#if defined(CONFIG_CMD_REISER)
 
 #include <malloc.h>
 #include <linux/ctype.h>
@@ -983,4 +983,4 @@ reiserfs_open (char *filename)
        return filemax;
 }
 
-#endif /* CFG_CMD_REISER */
+#endif
index 2b8ec3d3f91d288b52b4f77f7811c20ef7db80cb..da6e088163e48d55edd45fbd8b50407864cffc26 100644 (file)
@@ -15,7 +15,9 @@ EXPORT_FUNC(do_reset)
 EXPORT_FUNC(getenv)
 EXPORT_FUNC(setenv)
 EXPORT_FUNC(simple_strtoul)
-#if (CONFIG_COMMANDS & CFG_CMD_I2C)
+EXPORT_FUNC(simple_strtol)
+EXPORT_FUNC(strcmp)
+#if defined(CONFIG_CMD_I2C)
 EXPORT_FUNC(i2c_write)
 EXPORT_FUNC(i2c_read)
-#endif /* CFG_CMD_I2C */
+#endif
index 5377c2eb5bed2c7d5c1dde187c76249ab8719656..e002d2838e9bfe26990cd88477186b0833bd8d59 100644 (file)
@@ -1548,7 +1548,9 @@ typedef struct ccsr_gur {
        char    res9[12];
        uint    pvr;            /* 0xe00a0 - Processor version register */
        uint    svr;            /* 0xe00a4 - System version register */
-       char    res10[3416];
+       char    res10a[8];
+       uint    rstcr;          /* 0xe00b0 - Reset control register */
+       char    res10b[3404];
        uint    clkocr;         /* 0xe0e00 - Clock out select register */
        char    res11[12];
        uint    ddrdllcr;       /* 0xe0e10 - DDR DLL control register */
diff --git a/include/asm-ppc/immap_fsl_pci.h b/include/asm-ppc/immap_fsl_pci.h
new file mode 100644 (file)
index 0000000..bd732b6
--- /dev/null
@@ -0,0 +1,150 @@
+/* (C) Copyright 2007 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ */
+
+#ifndef __IMMAP_85xx_fsl_pci__
+#define __IMMAP_85xx_fsl_pci__
+
+/*
+ * Common PCI/PCIE Register structure for mpc85xx and mpc86xx
+ */
+
+/*
+ * PCI Translation Registers
+ */
+typedef struct pci_outbound_window {
+       u32     potar;          /* 0x00 - Address */
+       u32     potear;         /* 0x04 - Address Extended */
+       u32     powbar;         /* 0x08 - Window Base Address */
+       u32     res1;
+       u32     powar;          /* 0x10 - Window Attributes */
+#define POWAR_EN       0x80000000
+#define POWAR_IO_READ  0x00080000
+#define POWAR_MEM_READ 0x00040000
+#define POWAR_IO_WRITE 0x00008000
+#define POWAR_MEM_WRITE        0x00004000
+       u32     res2[3];
+} pot_t;
+
+typedef struct pci_inbound_window {
+       u32     pitar;          /* 0x00 - Address */
+       u32     res1;
+       u32     piwbar;         /* 0x08 - Window Base Address */
+       u32     piwbear;        /* 0x0c - Window Base Address Extended */
+       u32     piwar;          /* 0x10 - Window Attributes */
+#define PIWAR_EN               0x80000000
+#define PIWAR_PF               0x20000000
+#define PIWAR_LOCAL            0x00f00000
+#define PIWAR_READ_SNOOP       0x00050000
+#define PIWAR_WRITE_SNOOP      0x00005000
+       u32     res2[3];
+} pit_t;
+
+/* PCI/PCI Express Registers */
+typedef struct ccsr_pci {
+       u32     cfg_addr;       /* 0x000 - PCI Configuration Address Register */
+       u32     cfg_data;       /* 0x004 - PCI Configuration Data Register */
+       u32     int_ack;        /* 0x008 - PCI Interrupt Acknowledge Register */
+       u32     out_comp_to;    /* 0x00C - PCI Outbound Completion Timeout Register */
+       u32     out_conf_to;    /* 0x010 - PCI Configuration Timeout Register */
+       u32     config;         /* 0x014 - PCIE CONFIG Register */
+       char    res2[8];
+       u32     pme_msg_det;    /* 0x020 - PCIE PME & message detect register */
+       u32     pme_msg_dis;    /* 0x024 - PCIE PME & message disable register */
+       u32     pme_msg_int_en; /* 0x028 - PCIE PME & message interrupt enable register */
+       u32     pm_command;     /* 0x02c - PCIE PM Command register */
+       char    res4[3016];     /*     (- #xbf8  #x30)3016 */
+       u32     block_rev1;     /* 0xbf8 - PCIE Block Revision register 1 */
+       u32     block_rev2;     /* 0xbfc - PCIE Block Revision register 2 */
+
+       pot_t   pot[5];         /* 0xc00 - 0xc9f Outbound ATMU's 0, 1, 2, 3, and 4 */
+       u32     res5[64];
+       pit_t   pit[3];         /* 0xda0 - 0xdff Inbound ATMU's 3, 2, and 1 */
+#define PIT3 0
+#define PIT2 1
+#define PIT1 2
+
+#if 0
+       u32     potar0;         /* 0xc00 - PCI Outbound Transaction Address Register 0 */
+       u32     potear0;        /* 0xc04 - PCI Outbound Translation Extended Address Register 0 */
+       char    res5[8];
+       u32     powar0;         /* 0xc10 - PCI Outbound Window Attributes Register 0 */
+       char    res6[12];
+       u32     potar1;         /* 0xc20 - PCI Outbound Transaction Address Register 1 */
+       u32     potear1;        /* 0xc24 - PCI Outbound Translation Extended Address Register 1 */
+       u32     powbar1;        /* 0xc28 - PCI Outbound Window Base Address Register 1 */
+       char    res7[4];
+       u32     powar1;         /* 0xc30 - PCI Outbound Window Attributes Register 1 */
+       char    res8[12];
+       u32     potar2;         /* 0xc40 - PCI Outbound Transaction Address Register 2 */
+       u32     potear2;        /* 0xc44 - PCI Outbound Translation Extended Address Register 2 */
+       u32     powbar2;        /* 0xc48 - PCI Outbound Window Base Address Register 2 */
+       char    res9[4];
+       u32     powar2;         /* 0xc50 - PCI Outbound Window Attributes Register 2 */
+       char    res10[12];
+       u32     potar3;         /* 0xc60 - PCI Outbound Transaction Address Register 3 */
+       u32     potear3;        /* 0xc64 - PCI Outbound Translation Extended Address Register 3 */
+       u32     powbar3;        /* 0xc68 - PCI Outbound Window Base Address Register 3 */
+       char    res11[4];
+       u32     powar3;         /* 0xc70 - PCI Outbound Window Attributes Register 3 */
+       char    res12[12];
+       u32     potar4;         /* 0xc80 - PCI Outbound Transaction Address Register 4 */
+       u32     potear4;        /* 0xc84 - PCI Outbound Translation Extended Address Register 4 */
+       u32     powbar4;        /* 0xc88 - PCI Outbound Window Base Address Register 4 */
+       char    res13[4];
+       u32     powar4;         /* 0xc90 - PCI Outbound Window Attributes Register 4 */
+       char    res14[268];
+       u32     pitar3;         /* 0xda0 - PCI Inbound Translation Address Register 3 */
+       char    res15[4];
+       u32     piwbar3;        /* 0xda8 - PCI Inbound Window Base Address Register 3 */
+       u32     piwbear3;       /* 0xdac - PCI Inbound Window Base Extended Address Register 3 */
+       u32     piwar3;         /* 0xdb0 - PCI Inbound Window Attributes Register 3 */
+       char    res16[12];
+       u32     pitar2;         /* 0xdc0 - PCI Inbound Translation Address Register 2 */
+       char    res17[4];
+       u32     piwbar2;        /* 0xdc8 - PCI Inbound Window Base Address Register 2 */
+       u32     piwbear2;       /* 0xdcc - PCI Inbound Window Base Extended Address Register 2 */
+       u32     piwar2;         /* 0xdd0 - PCI Inbound Window Attributes Register 2 */
+       char    res18[12];
+       u32     pitar1;         /* 0xde0 - PCI Inbound Translation Address Register 1 */
+       char    res19[4];
+       u32     piwbar1;        /* 0xde8 - PCI Inbound Window Base Address Register 1 */
+       char    res20[4];
+       u32     piwar1;         /* 0xdf0 - PCI Inbound Window Attributes Register 1 */
+       char    res21[12];
+#endif
+       u32     pedr;           /* 0xe00 - PCI Error Detect Register */
+       u32     pecdr;          /* 0xe04 - PCI Error Capture Disable Register */
+       u32     peer;           /* 0xe08 - PCI Error Interrupt Enable Register */
+       u32     peattrcr;       /* 0xe0c - PCI Error Attributes Capture Register */
+       u32     peaddrcr;       /* 0xe10 - PCI Error Address Capture Register */
+/*     u32     perr_disr        * 0xe10 - PCIE Erorr Disable Register */
+       u32     peextaddrcr;    /* 0xe14 - PCI  Error Extended Address Capture Register */
+       u32     pedlcr;         /* 0xe18 - PCI Error Data Low Capture Register */
+       u32     pedhcr;         /* 0xe1c - PCI Error Error Data High Capture Register */
+       u32     gas_timr;       /* 0xe20 - PCI Gasket Timer Register */
+/*     u32     perr_cap_stat;   * 0xe20 - PCIE Error Capture Status Register */
+       char    res22[4];
+       u32     perr_cap0;      /* 0xe28 - PCIE Error Capture Register 0 */
+       u32     perr_cap1;      /* 0xe2c - PCIE Error Capture Register 1 */
+       u32     perr_cap2;      /* 0xe30 - PCIE Error Capture Register 2 */
+       u32     perr_cap3;      /* 0xe34 - PCIE Error Capture Register 3 */
+       char    res23[456];     /*     (- #x1000 #xe38) 456 */
+} ccsr_fsl_pci_t;
+
+#endif /*__IMMAP_fsl_pci__*/
diff --git a/include/cmd_confdefs.h b/include/cmd_confdefs.h
deleted file mode 100644 (file)
index b3ccdce..0000000
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * (C) Copyright 2000-2002
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-/*
- * Definitions for Configuring the monitor commands
- */
-#ifndef _CMD_CONFIG_H
-#define _CMD_CONFIG_H
-
-/*
- * Configurable monitor commands
- */
-#define CFG_CMD_BDI            0x00000001ULL   /* bdinfo                       */
-#define CFG_CMD_LOADS          0x00000002ULL   /* loads                        */
-#define CFG_CMD_LOADB          0x00000004ULL   /* loadb                        */
-#define CFG_CMD_IMI            0x00000008ULL   /* iminfo                       */
-#define CFG_CMD_CACHE          0x00000010ULL   /* icache, dcache               */
-#define CFG_CMD_FLASH          0x00000020ULL   /* flinfo, erase, protect       */
-#define CFG_CMD_MEMORY         0x00000040ULL   /* md, mm, nm, mw, cp, cmp,     */
-                                               /* crc, base, loop, mtest       */
-#define CFG_CMD_NET            0x00000080ULL   /* bootp, tftpboot, rarpboot    */
-#define CFG_CMD_ENV            0x00000100ULL   /* saveenv                      */
-#define CFG_CMD_KGDB           0x0000000000000200ULL   /* kgdb                         */
-#define CFG_CMD_PCMCIA         0x00000400ULL   /* PCMCIA support               */
-#define CFG_CMD_IDE            0x00000800ULL   /* IDE harddisk support         */
-#define CFG_CMD_PCI            0x00001000ULL   /* pciinfo                      */
-#define CFG_CMD_IRQ            0x00002000ULL   /* irqinfo                      */
-#define CFG_CMD_BOOTD          0x00004000ULL   /* bootd                        */
-#define CFG_CMD_CONSOLE                0x00008000ULL   /* coninfo                      */
-#define CFG_CMD_EEPROM         0x00010000ULL   /* EEPROM read/write support    */
-#define CFG_CMD_ASKENV         0x00020000ULL   /* ask for env variable         */
-#define CFG_CMD_RUN            0x00040000ULL   /* run command in env variable  */
-#define CFG_CMD_ECHO           0x00080000ULL   /* echo arguments               */
-#define CFG_CMD_I2C            0x00100000ULL   /* I2C serial bus support       */
-#define CFG_CMD_REGINFO                0x00200000ULL   /* Register dump                */
-#define CFG_CMD_IMMAP          0x00400000ULL   /* IMMR dump support            */
-#define CFG_CMD_DATE           0x00800000ULL   /* support for RTC, date/time...*/
-#define CFG_CMD_DHCP           0x01000000ULL   /* DHCP Support                 */
-#define CFG_CMD_BEDBUG         0x02000000ULL   /* Include BedBug Debugger      */
-#define CFG_CMD_FDC            0x04000000ULL   /* Floppy Disk Support          */
-#define CFG_CMD_SCSI           0x08000000ULL   /* SCSI Support                 */
-#define CFG_CMD_AUTOSCRIPT     0x10000000ULL   /* Autoscript Support           */
-#define CFG_CMD_MII            0x20000000ULL   /* MII support                  */
-#define CFG_CMD_SETGETDCR      0x40000000ULL   /* DCR support on 4xx           */
-#define CFG_CMD_BSP            0x80000000ULL   /* Board Specific functions     */
-
-#define CFG_CMD_ELF    0x0000000100000000ULL   /* ELF (VxWorks) load/boot cmd  */
-#define CFG_CMD_MISC   0x0000000200000000ULL   /* Misc functions like sleep etc*/
-#define CFG_CMD_USB    0x0000000400000000ULL   /* USB Support                  */
-#define CFG_CMD_DOC    0x0000000800000000ULL   /* Disk-On-Chip Support         */
-#define CFG_CMD_JFFS2  0x0000001000000000ULL   /* JFFS2 Support                */
-#define CFG_CMD_DTT    0x0000002000000000ULL   /* Digital Therm and Thermostat */
-#define CFG_CMD_SDRAM  0x0000004000000000ULL   /* SDRAM DIMM SPD info printout */
-#define CFG_CMD_DIAG   0x0000008000000000ULL   /* Diagnostics                  */
-#define CFG_CMD_FPGA   0x0000010000000000ULL   /* FPGA configuration Support   */
-#define CFG_CMD_HWFLOW 0x0000020000000000ULL   /* RTS/CTS hw flow control      */
-#define CFG_CMD_SAVES  0x0000040000000000ULL   /* save S record dump           */
-#define CFG_CMD_SPI    0x0000100000000000ULL   /* SPI utility                  */
-#define CFG_CMD_FDOS   0x0000200000000000ULL   /* Floppy DOS support           */
-#define CFG_CMD_VFD    0x0000400000000000ULL   /* VFD support (TRAB)           */
-#define CFG_CMD_NAND   0x0000800000000000ULL   /* NAND support                 */
-#define CFG_CMD_BMP    0x0001000000000000ULL   /* BMP support                  */
-#define CFG_CMD_PORTIO 0x0002000000000000ULL   /* Port I/O                     */
-#define CFG_CMD_PING   0x0004000000000000ULL   /* ping support                 */
-#define CFG_CMD_MMC    0x0008000000000000ULL   /* MMC support                  */
-#define CFG_CMD_FAT    0x0010000000000000ULL   /* FAT support                  */
-#define CFG_CMD_IMLS   0x0020000000000000ULL   /* List all found images        */
-#define CFG_CMD_ITEST  0x0040000000000000ULL   /* Integer (and string) test    */
-#define CFG_CMD_NFS    0x0080000000000000ULL   /* NFS support                  */
-#define CFG_CMD_REISER 0x0100000000000000ULL   /* Reiserfs support             */
-#define CFG_CMD_CDP    0x0200000000000000ULL   /* Cisco Discovery Protocol     */
-#define CFG_CMD_XIMG   0x0400000000000000ULL   /* Load part of Multi Image     */
-#define CFG_CMD_UNIVERSE 0x0800000000000000ULL /* Tundra Universe Support      */
-#define CFG_CMD_EXT2   0x1000000000000000ULL   /* EXT2 Support                 */
-#define CFG_CMD_SNTP   0x2000000000000000ULL   /* SNTP support                 */
-#define CFG_CMD_DISPLAY        0x4000000000000000ULL   /* Display support              */
-#define CFG_CMD_MFSL   0x8000000000000000ULL   /* FSL support for Microblaze   */
-
-#define CFG_CMD_ALL    0xFFFFFFFFFFFFFFFFULL   /* ALL commands                 */
-
-/* Commands that are considered "non-standard" for some reason
- * (memory hogs, requires special hardware, not fully tested, etc.)
- */
-#define CFG_CMD_NONSTD (CFG_CMD_ASKENV | \
-                       CFG_CMD_BEDBUG  | \
-                       CFG_CMD_BMP     | \
-                       CFG_CMD_BSP     | \
-                       CFG_CMD_CACHE   | \
-                       CFG_CMD_CDP     | \
-                       CFG_CMD_DATE    | \
-                       CFG_CMD_DHCP    | \
-                       CFG_CMD_DIAG    | \
-                       CFG_CMD_DISPLAY | \
-                       CFG_CMD_DOC     | \
-                       CFG_CMD_DTT     | \
-                       CFG_CMD_EEPROM  | \
-                       CFG_CMD_ELF     | \
-                       CFG_CMD_EXT2    | \
-                       CFG_CMD_FDC     | \
-                       CFG_CMD_FAT     | \
-                       CFG_CMD_FDOS    | \
-                       CFG_CMD_HWFLOW  | \
-                       CFG_CMD_I2C     | \
-                       CFG_CMD_IDE     | \
-                       CFG_CMD_IMMAP   | \
-                       CFG_CMD_IRQ     | \
-                       CFG_CMD_JFFS2   | \
-                       CFG_CMD_KGDB    | \
-                       CFG_CMD_MFSL    | \
-                       CFG_CMD_MII     | \
-                       CFG_CMD_MMC     | \
-                       CFG_CMD_NAND    | \
-                       CFG_CMD_PCI     | \
-                       CFG_CMD_PCMCIA  | \
-                       CFG_CMD_PING    | \
-                       CFG_CMD_PORTIO  | \
-                       CFG_CMD_REGINFO | \
-                       CFG_CMD_REISER  | \
-                       CFG_CMD_SAVES   | \
-                       CFG_CMD_SCSI    | \
-                       CFG_CMD_SDRAM   | \
-                       CFG_CMD_SNTP    | \
-                       CFG_CMD_SPI     | \
-                       CFG_CMD_UNIVERSE | \
-                       CFG_CMD_USB     | \
-                       CFG_CMD_VFD     )
-
-/* Default configuration
- */
-#define CONFIG_CMD_DFL (CFG_CMD_ALL & ~CFG_CMD_NONSTD)
-
-#ifndef CONFIG_COMMANDS
-#define CONFIG_COMMANDS CONFIG_CMD_DFL
-#endif
-
-
-/*
- * optional BOOTP fields
- */
-
-#define CONFIG_BOOTP_SUBNETMASK                0x00000001
-#define CONFIG_BOOTP_GATEWAY           0x00000002
-#define CONFIG_BOOTP_HOSTNAME          0x00000004
-#define CONFIG_BOOTP_NISDOMAIN         0x00000008
-#define CONFIG_BOOTP_BOOTPATH          0x00000010
-#define CONFIG_BOOTP_BOOTFILESIZE      0x00000020
-#define CONFIG_BOOTP_DNS               0x00000040
-#define CONFIG_BOOTP_DNS2              0x00000080
-#define CONFIG_BOOTP_SEND_HOSTNAME     0x00000100
-#define CONFIG_BOOTP_NTPSERVER         0x00000200
-#define CONFIG_BOOTP_TIMEOFFSET                0x00000400
-
-#define CONFIG_BOOTP_VENDOREX          0x80000000
-
-#define CONFIG_BOOTP_ALL               (~CONFIG_BOOTP_VENDOREX)
-
-
-#define CONFIG_BOOTP_DEFAULT           (CONFIG_BOOTP_SUBNETMASK | \
-                                       CONFIG_BOOTP_GATEWAY     | \
-                                       CONFIG_BOOTP_HOSTNAME    | \
-                                       CONFIG_BOOTP_BOOTPATH)
-
-#ifndef CONFIG_BOOTP_MASK
-#define CONFIG_BOOTP_MASK              CONFIG_BOOTP_DEFAULT
-#endif
-
-#endif /* _CMD_CONFIG_H */
index a2936ad8b3e583e30fc57012c1395bcc8c8dfacb..0597c10dafe2e566f4a8773946beeda4a2d0237e 100644 (file)
@@ -84,12 +84,6 @@ typedef      void    command_t (cmd_tbl_t *, int, int, char *[]);
 #define CMD_FLAG_REPEAT                0x0001  /* repeat last command          */
 #define CMD_FLAG_BOOTD         0x0002  /* command is from bootd        */
 
-/*
- * Configurable monitor commands definitions have been moved
- * to include/cmd_confdefs.h
- */
-
-
 #define Struct_Section  __attribute__ ((unused,section (".u_boot_cmd")))
 
 #ifdef  CFG_LONGHELP
index d823733b67fd4d65f4a30e14f242fad81990e4d3..ac29d3aac6cce3d628381f3f904e2d56b4342393 100644 (file)
@@ -63,13 +63,19 @@ typedef volatile unsigned char      vu_char;
 #endif
 #elif defined(CONFIG_5xx)
 #include <asm/5xx_immap.h>
+#define CONFIG_RELOC_FIXUP_WORKS
 #elif defined(CONFIG_MPC5xxx)
 #include <mpc5xxx.h>
+#define CONFIG_RELOC_FIXUP_WORKS
 #elif defined(CONFIG_MPC512X)
 #include <mpc512x.h>
 #include <asm/immap_512x.h>
+#define CONFIG_RELOC_FIXUP_WORKS
 #elif defined(CONFIG_MPC8220)
 #include <asm/immap_8220.h>
+#define CONFIG_RELOC_FIXUP_WORKS
+#elif defined(CONFIG_824X)
+#define CONFIG_RELOC_FIXUP_WORKS
 #elif defined(CONFIG_8260)
 #if   defined(CONFIG_MPC8247) \
    || defined(CONFIG_MPC8248) \
@@ -81,6 +87,7 @@ typedef volatile unsigned char        vu_char;
 #define CONFIG_MPC8260 1
 #endif
 #include <asm/immap_8260.h>
+#define CONFIG_RELOC_FIXUP_WORKS
 #endif
 #ifdef CONFIG_MPC86xx
 #include <mpc86xx.h>
@@ -93,6 +100,7 @@ typedef volatile unsigned char       vu_char;
 #ifdef CONFIG_MPC83XX
 #include <mpc83xx.h>
 #include <asm/immap_83xx.h>
+#define CONFIG_RELOC_FIXUP_WORKS
 #endif
 #ifdef CONFIG_4xx
 #include <ppc4xx.h>
diff --git a/include/config_cmd_all.h b/include/config_cmd_all.h
new file mode 100644 (file)
index 0000000..14801b5
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2007 Freescale Semiconductor, Inc.
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License Version 2. This file is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#ifndef _CONFIG_CMD_ALL_H
+#define _CONFIG_CMD_ALL_H
+
+/*
+ * Alphabetical list of all possible commands.
+ */
+
+#define CONFIG_CMD_ASKENV      /* ask for env variable         */
+#define CONFIG_CMD_AUTOSCRIPT  /* Autoscript Support           */
+#define CONFIG_CMD_BDI         /* bdinfo                       */
+#define CONFIG_CMD_BEDBUG      /* Include BedBug Debugger      */
+#define CONFIG_CMD_BMP         /* BMP support                  */
+#define CONFIG_CMD_BOOTD       /* bootd                        */
+#define CONFIG_CMD_BSP         /* Board Specific functions     */
+#define CONFIG_CMD_CACHE       /* icache, dcache               */
+#define CONFIG_CMD_CDP         /* Cisco Discovery Protocol     */
+#define CONFIG_CMD_CONSOLE     /* coninfo                      */
+#define CONFIG_CMD_DATE                /* support for RTC, date/time...*/
+#define CONFIG_CMD_DHCP                /* DHCP Support                 */
+#define CONFIG_CMD_DIAG                /* Diagnostics                  */
+#define CONFIG_CMD_DISPLAY     /* Display support              */
+#define CONFIG_CMD_DOC         /* Disk-On-Chip Support         */
+#define CONFIG_CMD_DTT         /* Digital Therm and Thermostat */
+#define CONFIG_CMD_ECHO                /* echo arguments               */
+#define CONFIG_CMD_EEPROM      /* EEPROM read/write support    */
+#define CONFIG_CMD_ELF         /* ELF (VxWorks) load/boot cmd  */
+#define CONFIG_CMD_ENV         /* saveenv                      */
+#define CONFIG_CMD_EXT2                /* EXT2 Support                 */
+#define CONFIG_CMD_FAT         /* FAT support                  */
+#define CONFIG_CMD_FDC         /* Floppy Disk Support          */
+#define CONFIG_CMD_FDOS                /* Floppy DOS support           */
+#define CONFIG_CMD_FLASH       /* flinfo, erase, protect       */
+#define CONFIG_CMD_FPGA                /* FPGA configuration Support   */
+#define CONFIG_CMD_HWFLOW      /* RTS/CTS hw flow control      */
+#define CONFIG_CMD_I2C         /* I2C serial bus support       */
+#define CONFIG_CMD_IDE         /* IDE harddisk support         */
+#define CONFIG_CMD_IMI         /* iminfo                       */
+#define CONFIG_CMD_IMLS                /* List all found images        */
+#define CONFIG_CMD_IMMAP       /* IMMR dump support            */
+#define CONFIG_CMD_IRQ         /* irqinfo                      */
+#define CONFIG_CMD_ITEST       /* Integer (and string) test    */
+#define CONFIG_CMD_JFFS2       /* JFFS2 Support                */
+#define CONFIG_CMD_KGDB                /* kgdb                         */
+#define CONFIG_CMD_LOADB       /* loadb                        */
+#define CONFIG_CMD_LOADS       /* loads                        */
+#define CONFIG_CMD_MEMORY      /* md mm nm mw cp cmp crc base loop mtest */
+#define CONFIG_CMD_MFSL                /* FSL support for Microblaze   */
+#define CONFIG_CMD_MII         /* MII support                  */
+#define CONFIG_CMD_MISC                /* Misc functions like sleep etc*/
+#define CONFIG_CMD_MMC         /* MMC support                  */
+#define CONFIG_CMD_NAND                /* NAND support                 */
+#define CONFIG_CMD_NET         /* bootp, tftpboot, rarpboot    */
+#define CONFIG_CMD_NFS         /* NFS support                  */
+#define CONFIG_CMD_PCI         /* pciinfo                      */
+#define CONFIG_CMD_PCMCIA      /* PCMCIA support               */
+#define CONFIG_CMD_PING                /* ping support                 */
+#define CONFIG_CMD_PORTIO      /* Port I/O                     */
+#define CONFIG_CMD_REGINFO     /* Register dump                */
+#define CONFIG_CMD_REISER      /* Reiserfs support             */
+#define CONFIG_CMD_RUN         /* run command in env variable  */
+#define CONFIG_CMD_SAVES       /* save S record dump           */
+#define CONFIG_CMD_SCSI                /* SCSI Support                 */
+#define CONFIG_CMD_SDRAM       /* SDRAM DIMM SPD info printout */
+#define CONFIG_CMD_SETGETDCR   /* DCR support on 4xx           */
+#define CONFIG_CMD_SNTP                /* SNTP support                 */
+#define CONFIG_CMD_SPI         /* SPI utility                  */
+#define CONFIG_CMD_UNIVERSE    /* Tundra Universe Support      */
+#define CONFIG_CMD_USB         /* USB Support                  */
+#define CONFIG_CMD_VFD         /* VFD support (TRAB)           */
+#define CONFIG_CMD_XIMG                /* Load part of Multi Image     */
+
+#endif /* _CONFIG_CMD_ALL_H */
diff --git a/include/config_cmd_default.h b/include/config_cmd_default.h
new file mode 100644 (file)
index 0000000..f61cfc9
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2007 Freescale Semiconductor, Inc.
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License Version 2. This file is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#ifndef _CONFIG_CMD_DEFAULT_H
+#define _CONFIG_CMD_DEFAULT_H
+
+/*
+ * Alphabetical list of all commands that are configured by default.
+ * This is essentially all commands minus those that are considered
+ * "non-standard" for some reason (memory hogs, requires special
+ * hardware, not fully tested, etc.).
+ */
+
+#define CONFIG_CMD_AUTOSCRIPT  /* Autoscript Support           */
+#define CONFIG_CMD_BDI         /* bdinfo                       */
+#define CONFIG_CMD_BOOTD       /* bootd                        */
+#define CONFIG_CMD_CONSOLE     /* coninfo                      */
+#define CONFIG_CMD_ECHO                /* echo arguments               */
+#define CONFIG_CMD_ENV         /* saveenv                      */
+#define CONFIG_CMD_FLASH       /* flinfo, erase, protect       */
+#define CONFIG_CMD_FPGA                /* FPGA configuration Support   */
+#define CONFIG_CMD_IMI         /* iminfo                       */
+#define CONFIG_CMD_IMLS                /* List all found images        */
+#define CONFIG_CMD_ITEST       /* Integer (and string) test    */
+#define CONFIG_CMD_LOADB       /* loadb                        */
+#define CONFIG_CMD_LOADS       /* loads                        */
+#define CONFIG_CMD_MEMORY      /* md mm nm mw cp cmp crc base loop mtest */
+#define CONFIG_CMD_MISC                /* Misc functions like sleep etc*/
+#define CONFIG_CMD_NET         /* bootp, tftpboot, rarpboot    */
+#define CONFIG_CMD_NFS         /* NFS support                  */
+#define CONFIG_CMD_RUN         /* run command in env variable  */
+#define CONFIG_CMD_SETGETDCR   /* DCR support on 4xx           */
+#define CONFIG_CMD_XIMG                /* Load part of Multi Image     */
+
+#endif /* _CONFIG_CMD_DEFAULT_H */
index ca9592c23bcbd08f5361bd20a928038fa957a2dd..0a9a1ff90c843e7de9c41fd62647a8e0ac963d64 100644 (file)
 
 #define CONFIG_BOOTDELAY       5
 
-#if 0
-#define CONFIG_COMMANDS                ( CONFIG_CMD_DFL | \
-                                 CFG_CMD_BEDBUG | \
-                                 CFG_CMD_BSP    | \
-                                 CFG_CMD_ELF    | \
-                                 CFG_CMD_I2C    | \
-                                 CFG_CMD_FLASH | \
-                                 CFG_CMD_BEDBUG | \
-                                 CFG_CMD_NET    | \
-                                 CFG_CMD_PCI )
-#endif
 
-#define CONFIG_COMMANDS                ( CONFIG_CMD_DFL )
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any)      */
 
-#include <cmd_confdefs.h>
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
 
 
 /*
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     32
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value        */
 #endif
 
index 821efe5d48b65dd52e8ae600985b562efa8a6225..46329918ef1cb4a9c20cb830bbb048a9a2e8a4b6 100644 (file)
 #define CONFIG_IPADDR          10.0.18.222
 #define CONFIG_SERVERIP                10.0.18.190
 
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_ASKENV  )
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_ASKENV
+
 
 /*
  * Miscellaneous configurable options
  */
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT     "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
  */
 #define CFG_DCACHE_SIZE                2048    /* For PLX IOP480                       */
 #define CFG_CACHELINE_SIZE     16      /* For AMCC 401/403 CPUs                */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index 2efca1056e927b102e5cc5ccdd59e785fffeddb6..77938b140da9821607a9192e29789e2819b22f33 100644 (file)
 #define        CONFIG_RTC_DS1306       1       /* Dallas 1306 real time clock  */
 #define CFG_SPI_RTC_DEVID      0       /*        as 1st SPI device     */
 
-#define        __SPI_CMD_OFF           0       /* allow default commands:      */
-                                       /*      CFG_CMD_SPI             */
-                                       /*      CFG_CMD_DATE            */
-
 #else
 #undef CONFIG_NIOS_SPI                         /* NO SPI support       */
-#define        __SPI_CMD_OFF   (       CFG_CMD_SPI     \
-                       |       CFG_CMD_DATE    \
-                       )
 #endif
 
 /*------------------------------------------------------------------------
 #define        CONFIG_POST                     CFG_POST_RTC
 #define        CFG_NIOS_POST_WORD_ADDR         (CFG_MONITOR_BASE + CFG_MONITOR_LEN)
 
-/*------------------------------------------------------------------------
- * COMMANDS
- *----------------------------------------------------------------------*/
-#define CONFIG_COMMANDS                (CFG_CMD_ALL & ~( \
-                                CFG_CMD_ASKENV | \
-                                CFG_CMD_BEDBUG | \
-                                CFG_CMD_BMP    | \
-                                CFG_CMD_CACHE  | \
-                                CFG_CMD_DOC    | \
-                                CFG_CMD_DTT    | \
-                                CFG_CMD_EEPROM | \
-                                CFG_CMD_ELF    | \
-                                CFG_CMD_FAT    | \
-                                CFG_CMD_FDC    | \
-                                CFG_CMD_FDOS   | \
-                                CFG_CMD_HWFLOW | \
-                                CFG_CMD_IDE    | \
-                                CFG_CMD_I2C    | \
-                                CFG_CMD_JFFS2  | \
-                                CFG_CMD_KGDB   | \
-                                CFG_CMD_NAND   | \
-                                CFG_CMD_NFS    | \
-                                CFG_CMD_MMC    | \
-                                CFG_CMD_MII    | \
-                                CFG_CMD_PCI    | \
-                                CFG_CMD_PCMCIA | \
-                                CFG_CMD_SCSI   | \
-                                CFG_CMD_VFD    | \
-                                CFG_CMD_USB    | \
-                                CFG_CMD_XIMG   | \
-                                __SPI_CMD_OFF  ) )
-
-
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_all.h>
+
+#undef CONFIG_CMD_ASKENV
+#undef CONFIG_CMD_BEDBUG
+#undef CONFIG_CMD_BMP
+#undef CONFIG_CMD_CACHE
+#undef CONFIG_CMD_DOC
+#undef CONFIG_CMD_DTT
+#undef CONFIG_CMD_EEPROM
+#undef CONFIG_CMD_ELF
+#undef CONFIG_CMD_FAT
+#undef CONFIG_CMD_FDC
+#undef CONFIG_CMD_FDOS
+#undef CONFIG_CMD_HWFLOW
+#undef CONFIG_CMD_IDE
+#undef CONFIG_CMD_I2C
+#undef CONFIG_CMD_JFFS2
+#undef CONFIG_CMD_KGDB
+#undef CONFIG_CMD_NAND
+#undef CONFIG_CMD_NFS
+#undef CONFIG_CMD_MMC
+#undef CONFIG_CMD_MII
+#undef CONFIG_CMD_PCI
+#undef CONFIG_CMD_PCMCIA
+#undef CONFIG_CMD_SCSI
+#undef CONFIG_CMD_VFD
+#undef CONFIG_CMD_USB
+#undef CONFIG_CMD_XIMG
+
+#if (CFG_NIOS_CPU_SPI_NUMS != 1)
+#undef CONFIG_CMD_SPI
+#undef CONFIG_CMD_DATE
+#endif
 
 /*------------------------------------------------------------------------
  * KGDB
  *----------------------------------------------------------------------*/
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   9600
 #endif
 
 #undef CFG_LOAD_ADDR           /* force error break */
 #endif
 
-
 /* MEM test area */
 #if    (CFG_SDRAM_SIZE != 0)
 
index df20965640e64b37a697f41d6cfb9ad84d131e09..2ee8c61cea45874adf12f41620dd2f5941f5f889 100644 (file)
 
 #define CONFIG_DRAM_50MHZ              1
 
-#define CONFIG_COMMANDS (CONFIG_CMD_DFL   \
-                        | CFG_CMD_DHCP   \
-                        | CFG_CMD_IMMAP  \
-                        | CFG_CMD_PCMCIA \
-                        | CFG_CMD_PING   \
-                       )
 
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_IMMAP
+#define CONFIG_CMD_PCMCIA
+#define CONFIG_CMD_PING
+
+/* This is picked up again in fads.h */
+#define FADS_COMMANDS_ALREADY_DEFINED
 
 #include "fads.h"
 
index 14d56bfd97d1c8b4ca7eb4a9c93a84fec478e08e..6f64038073977f95f510329a8083d46b1447e7ca 100644 (file)
 
 #undef CONFIG_BOOTARGS
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#undef CONFIG_WATCHDOG                 /* watchdog disabled            */
+
+#define        CONFIG_SCC1_ENET        1       /* use SCC1 ethernet */
+
+#define        CONFIG_RTC_MPC8xx               /* use internal RTC of MPC8xx   */
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_SNTP
+
+
+#if defined(CONFIG_CMD_KGDB)
 #undef CONFIG_KGDB_ON_SMC              /* define if kgdb on SMC */
 #define        CONFIG_KGDB_ON_SCC              /* define if kgdb on SCC */
 #undef CONFIG_KGDB_NONE                /* define if kgdb on something else */
 #endif
 
 
-#undef CONFIG_WATCHDOG                 /* watchdog disabled            */
-
-#define        CONFIG_SCC1_ENET        1       /* use SCC1 ethernet */
-
-#define        CONFIG_RTC_MPC8xx               /* use internal RTC of MPC8xx   */
-
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_SNTP    )
-
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_SUBNETMASK
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
 
 /*
  * Miscellaneous configurable options
  */
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define        CFG_PROMPT              "=> "   /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index ba4b1a2bc8cdf373513d785e5a352dbe9c8689d0..d25aa74a4527df8019842e7d51d00a2c88baebad 100644 (file)
 #define CONFIG_LOADS_ECHO      1       /* echo on for serial download  */
 #define CFG_LOADS_BAUD_CHANGE  1       /* allow baudrate change        */
 
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_MVENV   | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_PING    \
-                              )
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_MVENV
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_PING
+
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled        */
 
@@ -89,7 +99,7 @@
  * Miscellaneous configurable options
  */
 #define CFG_LONGHELP                   /* undef to save memory     */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size  */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
  */
 #define CFG_DCACHE_SIZE                16384
 #define CFG_CACHELINE_SIZE     32
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value    */
 #endif
 
 #define BOOTFLAG_COLD  0x01            /* Normal Power-On: Boot from FLASH */
 #define BOOTFLAG_WARM  0x02            /* Software reboot              */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
index 3df99a008b9787e693ac3a02000a6ba55c63cae8..f6495e4841ac6e121972652deb8750199f9cb778 100644 (file)
 
 #define CONFIG_PHY_CLK_FREQ    EMAC_STACR_CLK_66MHZ /* 66 MHz OPB clock*/
 
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_IDE     | \
-                               CFG_CMD_FAT     | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_EEPROM  )
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_EEPROM
 
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 
 #define CONFIG_SUPPORT_VFAT
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-
 #undef  CONFIG_WATCHDOG                        /* watchdog disabled            */
 
 #define CONFIG_RTC_MC146818             /* DS1685 is MC146818 compatible*/
 #define        CFG_PROMPT_HUSH_PS2     "> "
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
 #define CFG_DCACHE_SIZE                16384   /* For AMCC 405 CPUs, older 405 ppc's   */
                                        /* have only 8kB, 16kB is save here     */
 #define CFG_CACHELINE_SIZE     32      /* ...                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value        */
 #endif
 
index 1cd0280e2178c159d0fc93e36eb1409be30877dd..0f301ec0c6af4d6419e5be09945b3913d2a29330 100644 (file)
 #define CONFIG_PHY_ADDR                0       /* PHY address                  */
 #define CONFIG_LXT971_NO_SLEEP  1       /* disable sleep mode in LXT971 */
 
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_BSP     )
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_BSP
+
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
  */
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT     "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
 #define CFG_DCACHE_SIZE                16384   /* For AMCC 405 CPUs, older 405 ppc's   */
                                        /* have only 8kB, 16kB is save here     */
 #define CFG_CACHELINE_SIZE     32      /* ...                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value        */
 #endif
 
index d03c05bf349fd141f95d5711aa82a50ac57e62ff..9e0ee371c2ce23864e15ab3d0ace114341ff24e7 100644 (file)
 
 #define CONFIG_PHY_CLK_FREQ    EMAC_STACR_CLK_66MHZ /* 66 MHz OPB clock*/
 
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_NAND    | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_EEPROM  )
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_NAND
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_EEPROM
+
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
 #define CFG_PROMPT_HUSH_PS2    "> "
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
 #define CFG_DCACHE_SIZE                16384   /* For AMCC 405 CPUs, older 405 ppc's   */
                                        /* have only 8kB, 16kB is save here     */
 #define CFG_CACHELINE_SIZE     32      /* ...                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value        */
 #endif
 
index 0e6b50f8b0e019e8124ccb6c818908e68c1da92f..4304ecca7dee043915af476dfa5a59286a7ba041 100644 (file)
 #define CFG_8xx_CPUCLK_MAX             133000000
 #endif /* CONFIG_MPC852T */
 
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL  \
-                               | CFG_CMD_DHCP   \
-                               | CFG_CMD_IMMAP  \
-                               | CFG_CMD_MII    \
-                               | CFG_CMD_PING   \
-                               )
-
-/* This must be included AFTER the definition of CONFIG_COMMANDS */
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_IMMAP
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_PING
+
 
 #define CONFIG_BOOTDELAY       5               /* Autoboot after 5 seconds     */
 #define CONFIG_BOOTCOMMAND     "bootm fe040000"        /* Autoboot command     */
index c08b2c39f8854a08f8b6b5260499b77c8afdca45..3f2f6140f634da7fda0895ae8136a7957bf1ff14 100644 (file)
 #define BOOTFLAG_COLD          0x01    /* Normal Power-On: Boot from FLASH */
 #define BOOTFLAG_WARM          0x02    /* Software reboot      */
 
-#define CFG_CACHELINE_SIZE     32      /* For MPC8220 CPUs */
-
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
-#  define CFG_CACHELINE_SHIFT  5   /* log base 2 of the above value */
-#endif
-
 /*
  * Serial console configuration
  */
 
 #define CONFIG_TIMESTAMP                       /* Print image info with timestamp */
 
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
 /*
- * Supported commands
+ * Command line configuration.
  */
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_BOOTD   | \
-                               CFG_CMD_CACHE   | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_DIAG    | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_NET     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_REGINFO | \
-                               CFG_CMD_SDRAM   | \
-                               CFG_CMD_SNTP    )
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_BOOTD
+#define CONFIG_CMD_CACHE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_DIAG
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_SDRAM
+#define CONFIG_CMD_SNTP
+
 
 #define CONFIG_NET_MULTI
 #define CONFIG_MII
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-
 /*
  * Autobooting
  */
  */
 #define CFG_LONGHELP                       /* undef to save memory     */
 #define CFG_PROMPT             "=> "       /* Monitor Command Prompt   */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024        /* Console I/O Buffer Size  */
 #else
 #define CFG_CBSIZE             256         /* Console I/O Buffer Size  */
 
 #define CFG_HZ                 1000        /* decrementer freq: 1 ms ticks */
 
+#define CFG_CACHELINE_SIZE     32      /* For MPC8220 CPUs */
+#if defined(CONFIG_CMD_KGDB)
+#  define CFG_CACHELINE_SHIFT  5   /* log base 2 of the above value */
+#endif
+
 /*
  * Various low-level settings
  */
index ea50f41504c76feac9bbcf8acb4f20f98c19e9ae..d914dccfbb4d922830dc77314897f19c7dca7b0b 100644 (file)
 
 #define CONFIG_BOOTARGS                "root=/dev/ram rw ramdisk=4096"
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | \
-                                CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
 
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 #define CONFIG_AMIGA_PARTITION
 
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL | \
-                                CFG_CMD_ASKENV | \
-                                CFG_CMD_BSP    | \
-                                CFG_CMD_DATE   | \
-                                CFG_CMD_DHCP   | \
-                                CFG_CMD_ELF    | \
-                                CFG_CMD_NET    | \
-                                CFG_CMD_IDE    | \
-                                CFG_CMD_FDC    | \
-                                CFG_CMD_CACHE  | \
-                                CFG_CMD_CONSOLE| \
-                                CFG_CMD_USB    | \
-                                CFG_CMD_BSP    | \
-                                CFG_CMD_PCI    )
-
-/*                                 CFG_CMD_MII    | \ */
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_BSP
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_FDC
+#define CONFIG_CMD_CACHE
+#define CONFIG_CMD_CONSOLE|
+#define CONFIG_CMD_USB
+#define CONFIG_CMD_BSP
+#define CONFIG_CMD_PCI
+
 
 #define CONFIG_PCI             1
 /* #define CONFIG_PCI_SCAN_SHOW 1 */
 #define CONFIG_PCI_PNP         1       /* PCI plug-and-play */
 
-/* This must be included AFTER the definition of CONFIG_COMMANDS (if any)
- */
-#include <cmd_confdefs.h>
-
+#define atoi(x)                simple_strtoul(x,NULL,10)
 
 /*
  * Miscellaneous configurable options
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     32
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value        */
 #endif
 
 
 #define CONFIG_3COM
 /* #define CONFIG_BOOTP_RANDOM_DELAY */
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | \
-                                CONFIG_BOOTP_BOOTFILESIZE)
 
 /*
  * USB configuration
index e55858d34bc071417f612dd87567a6c33d4b906a..f1411db66c36e0d162152480040cccbd0c9a3a4e 100644 (file)
 
 #define CONFIG_BAUDRATE                115200
 
-#define CONFIG_BOOTP_MASK       (CONFIG_BOOTP_DEFAULT|CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
 
-#define CONFIG_COMMANDS                ( CONFIG_CMD_DFL | \
-                                                               CFG_CMD_DATE | \
-                                                               CFG_CMD_ELF     | \
-                                                               CFG_CMD_EEPROM  | \
-                                                               CFG_CMD_I2C     )
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_I2C
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
 
 #define CONFIG_BOOTDELAY       5
 #define CONFIG_ETHADDR 00:50:c2:1e:af:fb
index 46bdfa2ee62c880c53558440dbb299a36343e1f9..c11e9c911d337fa10fe5c82437b7534707e97b76 100644 (file)
 #define CONFIG_LOADS_ECHO       0       /* echo off for serial download */
 #define CFG_LOADS_BAUD_CHANGE           /* allow baudrate changes */
 
-#define CONFIG_BOOTP_MASK       (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+
+#define CONFIG_BOOTP_BOOTFILESIZE
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
 
-#define CONFIG_COMMANDS         (CONFIG_CMD_DFL | CFG_CMD_PCI | CFG_CMD_JFFS2 |\
-                                CFG_CMD_SCSI   | CFG_CMD_IDE | CFG_CMD_DATE  |\
-                                CFG_CMD_FDC    | CFG_CMD_ELF)
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_JFFS2
+#define CONFIG_CMD_SCSI
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_FDC
+#define CONFIG_CMD_ELF
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
 
 /*
  * Miscellaneous configurable options
  */
 #define CONFIG_CONS_INDEX       1
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE              1024        /* Console I/O Buffer Size */
 #else
 #define CFG_CBSIZE              256         /* Console I/O Buffer Size */
@@ -436,7 +452,7 @@ extern  unsigned long           bab7xx_get_gclk_freq (void);
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE        32    /* For all MPC74xx CPUs */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT        5    /* log base 2 of the above value */
 #endif
 
index bc30977fd7ad416bf8443e5b4c06bb72327b55eb..5c2bfc991f5023ab5d462d5c0030faf27ef7f4be 100644 (file)
 #define BOOTFLAG_COLD          0x01    /* Normal Power-On: Boot from FLASH */
 #define BOOTFLAG_WARM          0x02    /* Software reboot                  */
 
-#define CFG_CACHELINE_SIZE     32      /* For MPC5xxx CPUs                 */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
-#  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value    */
-#endif
-
 /*
  * Serial console configuration
  */
 #define CFG_RX_ETH_BUFFER      8       /* use 8 rx buffer on eepro100  */
 #define CONFIG_NS8382X         1
 
-#ifdef CONFIG_PCI
-# define ADD_PCI_CMD           CFG_CMD_PCI
-#else
-# define ADD_PCI_CMD           0
-#endif
-
 /*
  * Video console
  */
 # define CONFIG_SPLASH_SCREEN
 # define CFG_CONSOLE_IS_IN_ENV
 
-#ifdef CONFIG_VIDEO
-# define ADD_BMP_CMD           CFG_CMD_BMP
-#else
-# define ADD_BMP_CMD           0
-#endif
-
 /*
  * Partitions
  */
  */
 #ifdef CONFIG_BC3450_USB
 # define CONFIG_USB_OHCI
-# define ADD_USB_CMD           CFG_CMD_USB
 # define CONFIG_USB_STORAGE
-#else /* !CONFIG_BC3450_USB */
-# define ADD_USB_CMD           0
 #endif /* CONFIG_BC3450_USB */
 
 /*
                                 CFG_POST_I2C)
 
 #ifdef CONFIG_POST
-# define CFG_CMD_POST_DIAG CFG_CMD_DIAG
 /* preserve space for the post_word at end of on-chip SRAM */
 # define MPC5XXX_SRAM_POST_SIZE MPC5XXX_SRAM_SIZE-4
-#else
-# define CFG_CMD_POST_DIAG 0
 #endif /* CONFIG_POST */
 
-/*
- * IDE
- */
-#ifdef CONFIG_BC3450_IDE
-# define ADD_IDE_CMD           CFG_CMD_IDE
-#else
-# define ADD_IDE_CMD           0
-#endif /* CONFIG_BC3450_IDE */
 
 /*
- * Filesystem support
+ * BOOTP options
  */
-#if defined (CONFIG_BC3450_IDE) || defined (CONFIG_BC3450_USB)
-#ifdef CONFIG_FAT
-# define ADD_FAT_CMD           CFG_CMD_FAT
-#else
-# define ADD_FAT_CMD           0
-#endif /* CONFIG_FAT */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
 
-#ifdef CONFIG_EXT2
-# define ADD_EXT2_CMD          CFG_CMD_EXT2
-#else
-# define ADD_EXT2_CMD          0
-#endif /* CONFIG_EXT2 */
-#endif /* CONFIG_BC3450_IDE / _USB */
 
 /*
- * Supported commands
+ * Command line configuration.
  */
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               ADD_BMP_CMD     | \
-                               ADD_IDE_CMD     | \
-                               ADD_FAT_CMD     | \
-                               ADD_EXT2_CMD    | \
-                               ADD_PCI_CMD     | \
-                               ADD_USB_CMD     | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_ECHO    | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_JFFS2   | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_POST_DIAG | \
-                               CFG_CMD_REGINFO | \
-                               CFG_CMD_SNTP    | \
-                               CFG_CMD_BSP)
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_ECHO
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_JFFS2
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_SNTP
+#define CONFIG_CMD_BSP
+
+#ifdef CONFIG_VIDEO
+    #define CONFIG_CMD_BMP
+#endif
+
+#ifdef CONFIG_BC3450_IDE
+    #define CONFIG_CMD_IDE
+#endif
+
+#if defined(CONFIG_BC3450_IDE) || defined(CONFIG_BC3450_USB)
+    #ifdef CONFIG_FAT
+       #define CONFIG_CMD_FAT
+    #endif
+
+    #ifdef CONFIG_EXT2
+       #define CONFIG_CMD_EXT2
+    #endif
+#endif
+
+#ifdef CONFIG_BC3450_USB
+    #define CONFIG_CMD_USB
+#endif
+
+#ifdef CONFIG_PCI
+    #define CONFIG_CMD_PCI
+#endif
+
+#ifdef CONFIG_POST
+    #define CONFIG_CMD_DIAG
+#endif
+
 
 #define CONFIG_TIMESTAMP               /* display image timestamps */
 
  */
 #define CFG_LONGHELP                           /* undef to save memory     */
 #define CFG_PROMPT             "=> "           /* Monitor Command Prompt   */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024            /* Console I/O Buffer Size  */
 #else
 #define CFG_CBSIZE             256             /* Console I/O Buffer Size  */
 
 #define CFG_HZ                 1000            /* dec freq: 1ms ticks      */
 
+#define CFG_CACHELINE_SIZE     32      /* For MPC5xxx CPUs                 */
+#if defined(CONFIG_CMD_KGDB)
+#  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value    */
+#endif
+
 /*
- * Enable loopw commando. This has only affect, if CFG_CMD_MEM is defined,
- * which is normally part of the default commands (CFV_CMD_DFL)
+ * Enable loopw command.
  */
 #define CONFIG_LOOPW
 
index 3bd43d836930aaaee01924ea3bc3d367b663cec6..bb7856f675d91b75d0a71bf35fbfe790eb21d29a 100644 (file)
 #define CFG_DOC_SUPPORT_2000    1
 #define CFG_DOC_SUPPORT_MILLENNIUM 1
 #define CFG_DOC_SHORT_TIMEOUT    1
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DOC     | \
-                               CFG_CMD_ELF     | \
-                               0 )
 
-/* CFG_CMD_DOC required legacy NAND support */
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DOC
+#define CONFIG_CMD_ELF
+
+
+/* CONFIG_CMD_DOC required legacy NAND support */
 #define CFG_NAND_LEGACY
 
 #if 0
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL | CFG_CMD_DHCP | \
-                                CFG_CMD_PCI | CFG_CMD_DOC | CFG_CMD_DATE)
-
 #define CONFIG_PCI             1
 #define CONFIG_PCI_PNP         1       /* PCI plug-and-play */
 #endif
 
-/* This must be included AFTER the definition of CONFIG_COMMANDS (if any)
- */
-#include <cmd_confdefs.h>
-
-
 /*
  * Miscellaneous configurable options
  */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     32
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value   */
 #endif
 
index e0262a8f6748f42c06d27bd3df20a9f9144b4b07..ae32f6b14acd393b21569e54a9b378335de04c1a 100644 (file)
 
 #define CONFIG_PHY_ADDR                0       /* PHY address                  */
 
-#define CONFIG_COMMANDS             (( CONFIG_CMD_DFL  |       \
-                               CFG_CMD_IRQ     |       \
-                               CFG_CMD_EEPROM      ) & \
-                              ~CFG_CMD_NET)
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_EEPROM
+
+#undef CONFIG_CMD_NET
+
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
@@ -73,7 +86,7 @@
  */
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT     "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
  */
 #define CFG_DCACHE_SIZE                8192    /* For AMCC 405 CPUs                    */
 #define CFG_CACHELINE_SIZE     32      /* ...                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value        */
 #endif
 
index 7ec4599ebb5df33c8916ce3797ddb3c00f2d6b5e..62a2eaa23659e5d1c667c596f2f3466c78410456 100644 (file)
 
 #define        CONFIG_TIMESTAMP                /* Print image info with timestamp */
 
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_JFFS2   | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_NAND    | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_SNTP    )
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_JFFS2
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_NAND
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_SNTP
+
 
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
 #define CONFIG_RTC_MC146818            /* DS1685 is MC146818 compatible*/
 #define CFG_PROMPT_HUSH_PS2    "> "
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
 #define CFG_DCACHE_SIZE                16384   /* For AMCC 405 CPUs, older 405 ppc's   */
                                        /* have only 8kB, 16kB is save here     */
 #define CFG_CACHELINE_SIZE     32      /* ...                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value        */
 #endif
 
index e8994ffef79439017caab3f14f36d923dfdb2efd..9f06957d2ff2df864092808dd41f205ca34eb8de 100644 (file)
 #define CONFIG_MAC_PARTITION           /* nod used yet                 */
 #define CONFIG_DOS_PARTITION
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
 
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_BSP     | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_SNTP    )
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+#define CONFIG_CMD_BSP
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_SNTP
 
-/*----------------------------------------------------------------------*/
 
 /*
  * Miscellaneous configurable options
  */
 #define        CFG_LONGHELP                    /* undef to save memory         */
 #define        CFG_PROMPT      "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
index 1cca2859f4ba8dc4f2d45a10244619490825c0cc..08ef9b5da6ba330cd760c0b929526f126e8c2b3d 100644 (file)
 #define CONFIG_LXT971_NO_SLEEP  1       /* disable sleep mode in LXT971 */
 #define CONFIG_RESET_PHY_R      1       /* use reset_phy() to disable phy sleep mode */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | \
-                                CONFIG_BOOTP_DNS | \
-                                CONFIG_BOOTP_DNS2 | \
-                                CONFIG_BOOTP_SEND_HOSTNAME )
-
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_BSP     | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_NAND    | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_EEPROM  )
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_DNS
+#define CONFIG_BOOTP_DNS2
+#define CONFIG_BOOTP_SEND_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_BSP
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_NAND
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_EEPROM
+
 
 #define CFG_NAND_LEGACY
 
 #define CFG_PROMPT_HUSH_PS2    "> "
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
 #define CFG_DCACHE_SIZE                16384   /* For AMCC 405 CPUs, older 405 ppc's   */
                                        /* have only 8kB, 16kB is save here     */
 #define CFG_CACHELINE_SIZE     32      /* ...                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value        */
 #endif
 
index b882f7a9bfee03b00edca5bb7f0340d7e8787e70..aea85233f96b3544e32bfa3ad5a11036114921c8 100644 (file)
 
 #define CONFIG_BOOTDELAY       5
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
-
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_BEDBUG  | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_EXT2    | \
-                               CFG_CMD_FAT     | \
-                               CFG_CMD_FLASH   | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_IDE     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_SDRAM   | \
-                               CFG_CMD_SNTP    )
-
-/* This must be included AFTER the definition of CONFIG_COMMANDS (if any)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+
+#define CONFIG_BOOTP_BOOTFILESIZE
+
+
+/*
+ * Command line configuration.
  */
-#include <cmd_confdefs.h>
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_BEDBUG
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_EXT2
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_FLASH
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_SDRAM
+#define CONFIG_CMD_SNTP
 
 
 /*
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     32
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value        */
 #endif
 
index 56fd9a6d356687b2b7d7427470a2eee5438e2d3c..a3717b9052f5802006e8cd8e733738f7fe7f936a 100644 (file)
 #define CONFIG_MII             1       /* MII PHY management           */
 #define CONFIG_PHY_ADDR                0       /* PHY address                  */
 
-#define CONFIG_COMMANDS              ( (CONFIG_CMD_DFL & ~CFG_CMD_NET) | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_BSP     | \
-                               CFG_CMD_EEPROM  )
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_BSP
+#define CONFIG_CMD_EEPROM
+
+#undef CONFIG_CMD_NET
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
@@ -80,7 +93,7 @@
 #define CFG_PROMPT_HUSH_PS2    "> "
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
 #define CFG_DCACHE_SIZE                16384   /* For AMCC 405 CPUs, older 405 ppc's   */
                                        /* have only 8kB, 16kB is save here     */
 #define CFG_CACHELINE_SIZE     32      /* ...                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value        */
 #endif
 
index 9acde1e6f03b6a1a334099afef97d5885638ebb4..0a4e1e9d30d1fd67f224366c78942e8201ce26ff 100644 (file)
 #define CONFIG_NET_MULTI       1
 #undef  CONFIG_HAS_ETH1
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | \
-                                CONFIG_BOOTP_DNS | \
-                                CONFIG_BOOTP_DNS2 | \
-                                CONFIG_BOOTP_SEND_HOSTNAME )
-
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_IDE     | \
-                               CFG_CMD_FAT     | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_EEPROM  )
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_DNS
+#define CONFIG_BOOTP_DNS2
+#define CONFIG_BOOTP_SEND_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_EEPROM
+
 
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 
 #define CONFIG_SUPPORT_VFAT
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-
 #define CFG_NAND_LEGACY
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 #define CFG_PROMPT_HUSH_PS2    "> "
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
  */
 #define CFG_DCACHE_SIZE                8192    /* For AMCC 405 CPUs                    */
 #define CFG_CACHELINE_SIZE     32      /* ...                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value        */
 #endif
 
index 3fc99c50244820adf460c922d33bbc510a89783c..ceeba6e122e9368ca1956444adeec04f2e348c40 100644 (file)
 
 #define CONFIG_RTC_M48T35A     1               /* ST Electronics M48 timekeeper */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | \
-                                CONFIG_BOOTP_DNS | \
-                                CONFIG_BOOTP_DNS2 | \
-                                CONFIG_BOOTP_SEND_HOSTNAME )
-
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_IDE     | \
-                               CFG_CMD_FAT     | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_JFFS2   | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_BSP     | \
-                               CFG_CMD_EEPROM  )
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_DNS
+#define CONFIG_BOOTP_DNS2
+#define CONFIG_BOOTP_SEND_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_JFFS2
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_BSP
+#define CONFIG_CMD_EEPROM
+
 
 #if 0 /* test-only */
 #define CONFIG_NETCONSOLE
 #define CONFIG_AUTO_UPDATE      1       /* autoupdate via compactflash  */
 #endif
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-
 #define CFG_NAND_LEGACY
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 #define CFG_PROMPT_HUSH_PS2    "> "
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
 #define CFG_DCACHE_SIZE                16384   /* For AMCC 405 CPUs, older 405 ppc's   */
                                        /* have only 8kB, 16kB is save here     */
 #define CFG_CACHELINE_SIZE     32      /* ...                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value        */
 #endif
 
index 4e2e1a834d890bbc1366ebaf878ad376cb0b5043..1aefbbac686e3f4b7d5441ac0284902993525229 100644 (file)
 
 #define CONFIG_RTC_M48T35A     1               /* ST Electronics M48 timekeeper */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | \
-                                CONFIG_BOOTP_DNS | \
-                                CONFIG_BOOTP_DNS2 | \
-                                CONFIG_BOOTP_SEND_HOSTNAME )
-
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_IDE     | \
-                               CFG_CMD_FAT     | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_JFFS2   | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_EEPROM  )
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_DNS
+#define CONFIG_BOOTP_DNS2
+#define CONFIG_BOOTP_SEND_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_JFFS2
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_EEPROM
+
 
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 
 #define CONFIG_SUPPORT_VFAT
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-
 #define CFG_NAND_LEGACY
 
 
 #define CFG_PROMPT_HUSH_PS2    "> "
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
 #define CFG_DCACHE_SIZE                16384   /* For AMCC 405 CPUs, older 405 ppc's   */
                                        /* have only 8kB, 16kB is save here     */
 #define CFG_CACHELINE_SIZE     32      /* ...                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value        */
 #endif
 
index ab302df7437ddbaec80fba3e62881f8929134896..e2652e6aa6e130473399f8b16ca6958cb2ac0059 100644 (file)
 
 #define CONFIG_RTC_M48T35A     1               /* ST Electronics M48 timekeeper */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | \
-                                CONFIG_BOOTP_DNS | \
-                                CONFIG_BOOTP_DNS2 | \
-                                CONFIG_BOOTP_SEND_HOSTNAME )
-
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_IDE     | \
-                               CFG_CMD_FAT     | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_JFFS2   | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_BSP     | \
-                               CFG_CMD_EEPROM  )
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_DNS
+#define CONFIG_BOOTP_DNS2
+#define CONFIG_BOOTP_SEND_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_JFFS2
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_BSP
+#define CONFIG_CMD_EEPROM
+
 
 #if 0 /* test-only */
 #define CONFIG_NETCONSOLE
 
 #undef  CONFIG_AUTO_UPDATE              /* autoupdate via compactflash  */
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-
 #define CFG_NAND_LEGACY
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 #define CFG_PROMPT_HUSH_PS2    "> "
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
 #define CFG_DCACHE_SIZE                16384   /* For AMCC 405 CPUs, older 405 ppc's   */
                                        /* have only 8kB, 16kB is save here     */
 #define CFG_CACHELINE_SIZE     32      /* ...                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value        */
 #endif
 
index 7b5f72836e668c6eec542edbbfe5e3b2cf025699..318ada1a4fba7f1c61a9f820f08346d81a09e741 100644 (file)
 #define CONFIG_PHY_ADDR                1       /* PHY address                  */
 #define CONFIG_LXT971_NO_SLEEP  1       /* disable sleep mode in LXT971 */
 
-#if 0 /* test-only */
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_KGDB    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_BEDBUG  | \
-                               CFG_CMD_ELF     )
-#else
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_EEPROM  )
-/* test-only: support fehlt bisher... */
-/*                             CFG_CMD_IDE     | \*/
-/*                             CFG_CMD_PCI     | \*/
-#endif
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_EEPROM
+
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
  */
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT     "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
  */
 #define CFG_DCACHE_SIZE                32768   /* For AMCC 440 CPUs                    */
 #define CFG_CACHELINE_SIZE     32      /* ...                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value        */
 #endif
 
 #define BOOTFLAG_COLD  0x01            /* Normal Power-On: Boot from FLASH     */
 #define BOOTFLAG_WARM  0x02            /* Software reboot                      */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
index bc23fc0278863445fe2c122003cae149c9a4fe42..48e29a20876cd2330ec4c8fa68c2564372aed573 100644 (file)
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 #undef CONFIG_ALTIVEC                  /* undef to disable             */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | \
-                                CONFIG_BOOTP_BOOTFILESIZE)
-
-
-#define CONFIG_COMMANDS (CONFIG_CMD_DFL           \
-                        | CFG_CMD_ASKENV  \
-                        | CFG_CMD_I2C     \
-                        | CFG_CMD_CACHE   \
-                        | CFG_CMD_EEPROM  \
-                        | CFG_CMD_PCI     \
-                        | CFG_CMD_ELF     \
-                        | CFG_CMD_DATE    \
-                        | CFG_CMD_NET     \
-                        | CFG_CMD_PING    \
-                        | CFG_CMD_IDE     \
-                        | CFG_CMD_FAT     \
-                        | CFG_CMD_EXT2    \
-                                       )
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
 
-#define CONFIG_DOS_PARTITION
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_CACHE
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_EXT2
+
+
+#define CONFIG_DOS_PARTITION
 
 #define CONFIG_USE_CPCIDVI
 
 #define CFG_GT_DUAL_CPU                        /* also for JTAG even with one cpu */
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT     "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     32      /* For all MPC74xx CPUs          */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value */
 #endif
 
index 93d49f3862d0ed61eebef32734b4c2de82593e61..c7b623a1d6d0d3dfe69a4ac2deb3b7d3a351b8a8 100644 (file)
 #define CONFIG_PHY_ADDR                0       /* PHY address                  */
 #define CONFIG_LXT971_NO_SLEEP  1       /* disable sleep mode in LXT971 */
 
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_EEPROM  )
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_EEPROM
+
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
@@ -73,7 +94,7 @@
  */
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT     "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
  */
 #define CFG_DCACHE_SIZE                8192    /* For AMCC 405 CPUs                    */
 #define CFG_CACHELINE_SIZE     32      /* ...                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value        */
 #endif
 
index 16a9ea5dd710db9aae16ea1bf2ceeff1d0f26866..c589f288789d3dbd37e9da0ac0723a16a8fa1caf 100644 (file)
@@ -68,9 +68,7 @@
  * for FCC)
  *
  * if CONFIG_ETHER_NONE is defined, then either the ethernet routines must be
- * defined elsewhere (as for the console), or CFG_CMD_NET must be removed
- * from CONFIG_COMMANDS to remove support for networking.
- *
+ * defined elsewhere (as for the console), or CONFIG_CMD_NET must be unset.
  */
 #undef CONFIG_ETHER_ON_SCC             /* define if ether on SCC       */
 #define        CONFIG_ETHER_ON_FCC             /* define if ether on FCC       */
 #define CONFIG_LOADS_ECHO      1       /* echo on for serial download  */
 #undef CFG_LOADS_BAUD_CHANGE           /* don't allow baudrate change  */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT|CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
 
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               CFG_CMD_BEDBUG  | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_DOC     | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_SNTP    )
+#define CONFIG_CMD_BEDBUG
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_DOC
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_SNTP
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
 
 /*
  * Miscellaneous configurable options
  */
 #define        CFG_LONGHELP                    /* undef to save memory         */
 #define        CFG_PROMPT      "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE      32      /* For MPC8260 CPU              */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 # define CFG_CACHELINE_SHIFT   5       /* log base 2 of the above value */
 #endif
 
index ce969ecdd18030d08d40ab4bc63e607a8afe6638..b087ebaa0bc2bb99fad8eef2e4975b0fbbaedaee 100644 (file)
@@ -69,9 +69,7 @@
  * for FCC)
  *
  * if CONFIG_ETHER_NONE is defined, then either the ethernet routines must be
- * defined elsewhere (as for the console), or CFG_CMD_NET must be removed
- * from CONFIG_COMMANDS to remove support for networking.
- *
+ * defined elsewhere (as for the console), or CONFIG_CMD_NET must be unset.
  */
 #undef CONFIG_ETHER_ON_SCC             /* define if ether on SCC       */
 #define CONFIG_ETHER_ON_FCC            /* define if ether on FCC       */
 #define CONFIG_LOADS_ECHO      1       /* echo on for serial download  */
 #undef CFG_LOADS_BAUD_CHANGE           /* don't allow baudrate change  */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT|CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_BEDBUG
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DOC
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_I2C
 
 #ifdef CONFIG_PCI
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL | \
-                                CFG_CMD_BEDBUG | \
-                                CFG_CMD_DATE   | \
-                                CFG_CMD_DOC    | \
-                                CFG_CMD_EEPROM | \
-                                CFG_CMD_I2C    | \
-                                CFG_CMD_PCI)
-#else  /* ! PCI */
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL | \
-                                CFG_CMD_BEDBUG | \
-                                CFG_CMD_DATE   | \
-                                CFG_CMD_DOC    | \
-                                CFG_CMD_EEPROM | \
-                                CFG_CMD_I2C    )
-#endif /* CONFIG_PCI */
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+    #define CONFIG_CMD_PCI
+#endif
+
 
 #define CFG_NAND_LEGACY
 
  */
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT     "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     32      /* For MPC8260 CPU              */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 # define CFG_CACHELINE_SHIFT   5       /* log base 2 of the above value */
 #endif
 
index 63d7a924043f7500262911c77068521e3c5a5667..a965c125f3fbf31ab46a9ebcb69637216a06c010 100644 (file)
 #define CONFIG_AUTOSCRIPT              1
 
 
-#define CONFIG_COMMANDS         (\
-       CFG_CMD_BDI|\
-       CFG_CMD_IMI|\
-       CFG_CMD_FLASH|\
-       CFG_CMD_MEMORY|\
-       CFG_CMD_NET|\
-       CFG_CMD_ENV|\
-       CFG_CMD_CONSOLE|\
-       CFG_CMD_ASKENV|\
-       CFG_CMD_ECHO|\
-       CFG_CMD_IMMAP|\
-       CFG_CMD_REGINFO|\
-       CFG_CMD_DHCP|\
-       CFG_CMD_DATE|\
-       CFG_CMD_RUN|\
-       CFG_CMD_I2C|\
-       CFG_CMD_EEPROM|\
-       CFG_CMD_DIAG|\
-       CFG_CMD_AUTOSCRIPT|\
-       CFG_CMD_SETGETDCR)
+/*
+ * Command line configuration.
+ */
+
+#define CONFIG_CMD_BDI
+#define CONFIG_CMD_IMI
+#define CONFIG_CMD_FLASH
+#define CONFIG_CMD_MEMORY
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_ENV
+#define CONFIG_CMD_CONSOLE
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_ECHO
+#define CONFIG_CMD_IMMAP
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_RUN
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_DIAG
+#define CONFIG_CMD_AUTOSCRIPT
+#define CONFIG_CMD_SETGETDCR
+
 
 /*
- * optional BOOTP / DHCP fields
+ * BOOTP options
  */
-#define CONFIG_BOOTP_MASK (\
-       CONFIG_BOOTP_VENDOREX|\
-       CONFIG_BOOTP_SUBNETMASK|\
-       CONFIG_BOOTP_GATEWAY|\
-       CONFIG_BOOTP_DNS|\
-       CONFIG_BOOTP_HOSTNAME|\
-       CONFIG_BOOTP_BOOTFILESIZE|\
-       CONFIG_BOOTP_BOOTPATH)
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_VENDOREX
+#define CONFIG_BOOTP_DNS
+#define CONFIG_BOOTP_BOOTFILESIZE
+
 
 /*
  * how many time to fail & restart a net-TFTP before giving up & resetting
 #define CFG_BAUDRATE_TABLE  \
     {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400}
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-
 /*
  * Miscellaneous configurable options
  */
index acc8484717885e574557d8cffc78492e4551ead9..68e816a74436874e7dffea468977be26b611367a 100644 (file)
 #define CONFIG_BOOTCOMMAND     "bootm FE020000"        /* autoboot command     */
 #define CONFIG_BOOTDELAY       5
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
 
 #define        CONFIG_TIMESTAMP                /* Print image info with timestamp */
 
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_BEDBUG  | \
-                               0 /* CFG_CMD_DATE */    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_SNTP    )
 
-/* This must be included AFTER the definition of CONFIG_COMMANDS (if any)
+/*
+ * Command line configuration.
  */
-#include <cmd_confdefs.h>
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_BEDBUG
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_SNTP
 
 
 /*
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     32
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value        */
 #endif
 
index 997e1baa9a767a2c35c40e52b350cfc22c0e5128..627ea14826bea26312614a1826cb0dc7962d4e70 100644 (file)
 #define CONFIG_IPADDR          10.0.18.222
 #define CONFIG_SERVERIP                10.0.18.190
 
-#if 0
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_BSP     | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_ELF     )
-#else
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_BSP     )
-#endif
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_BSP
+
 
 #if 0 /* Does not appear to be used?!  If it is used, needs to be fixed */
 #define CONFIG_SOFT_I2C                        /* Software I2C support enabled */
 #endif
 #define CFG_I2C_EEPROM_ADDR_LEN 1      /* Bytes of address             */
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-
 /*
  * Miscellaneous configurable options
  */
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT     "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
  */
 #define CFG_DCACHE_SIZE                2048    /* For PLX IOP480                       */
 #define CFG_CACHELINE_SIZE     16      /* For AMCC 401/403 CPUs                */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index bd7aff12cc189aff61116c3d2c6523397a61355f..db2e96c227df6b3df8649e12d6608e365d3c6b0e 100644 (file)
@@ -215,8 +215,16 @@ ip=${ipaddr}:${serverip}${bootargs_end}; bootm 0x400000;\0"
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 #undef CONFIG_ALTIVEC                  /* undef to disable             */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | \
-                                CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
+
 /*
  * JFFS2 partitions
  *
@@ -239,17 +247,20 @@ ip=${ipaddr}:${serverip}${bootargs_end}; bootm 0x400000;\0"
 #define MTDPARTS_DEFAULT       "mtdparts=db64360-1:-(jffs2)"
 */
 
-#define CONFIG_COMMANDS (CONFIG_CMD_DFL \
-                        | CFG_CMD_ASKENV \
-                        | CFG_CMD_I2C \
-                        | CFG_CMD_EEPROM \
-                        | CFG_CMD_CACHE \
-                        | CFG_CMD_JFFS2 \
-                        | CFG_CMD_PCI \
-                        | CFG_CMD_NET )
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_CACHE
+#define CONFIG_CMD_JFFS2
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_NET
+
 
 /*
  * Miscellaneous configurable options
@@ -261,7 +272,7 @@ ip=${ipaddr}:${serverip}${bootargs_end}; bootm 0x400000;\0"
 /* #define CFG_GT_DUAL_CPU      also for JTAG even with one cpu */
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT     "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
@@ -558,7 +569,7 @@ ip=${ipaddr}:${serverip}${bootargs_end}; bootm 0x400000;\0"
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     32      /* For all MPC74xx CPUs          */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value */
 #endif
 
index 4b72e9b9e4022961ecb80466393e506225f37f05..b5d3f773f38e0cbeda2c6239c68d094cdf03264c 100644 (file)
@@ -153,8 +153,16 @@ ip=${ipaddr}:${serverip}${bootargs_end}; bootm 0x400000;\0"
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 #undef CONFIG_ALTIVEC                  /* undef to disable             */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | \
-                                CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
+
 /*
  * JFFS2 partitions
  *
@@ -177,17 +185,20 @@ ip=${ipaddr}:${serverip}${bootargs_end}; bootm 0x400000;\0"
 #define MTDPARTS_DEFAULT       "mtdparts=db64460-1:-(jffs2)"
 */
 
-#define CONFIG_COMMANDS (CONFIG_CMD_DFL \
-                        | CFG_CMD_ASKENV \
-                        | CFG_CMD_I2C \
-                        | CFG_CMD_EEPROM \
-                        | CFG_CMD_CACHE \
-                        | CFG_CMD_JFFS2 \
-                        | CFG_CMD_PCI \
-                        | CFG_CMD_NET )
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_CACHE
+#define CONFIG_CMD_JFFS2
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_NET
+
 
 /*
  * Miscellaneous configurable options
@@ -199,7 +210,7 @@ ip=${ipaddr}:${serverip}${bootargs_end}; bootm 0x400000;\0"
 /* #define CFG_GT_DUAL_CPU      also for JTAG even with one cpu */
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT     "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
@@ -496,7 +507,7 @@ ip=${ipaddr}:${serverip}${bootargs_end}; bootm 0x400000;\0"
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     32      /* For all MPC74xx CPUs          */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value */
 #endif
 
index b58846d83169e98d0d59987e5fa4e9fdde87f949..0ddf0e3aeb974c92901f5507b17960932a4cea28 100644 (file)
 #define CONFIG_NIOS_ASMI                          /* Enable ASMI       */
 #define CFG_NIOS_ASMIBASE      CFG_NIOS_CPU_ASMI0 /* ASMI base address */
 
-/*------------------------------------------------------------------------
- * COMMANDS
- *----------------------------------------------------------------------*/
-#define CONFIG_COMMANDS                (CFG_CMD_ALL & ~( \
-                                CFG_CMD_ASKENV | \
-                                CFG_CMD_BEDBUG | \
-                                CFG_CMD_BMP    | \
-                                CFG_CMD_BSP    | \
-                                CFG_CMD_CACHE  | \
-                                CFG_CMD_DATE   | \
-                                CFG_CMD_DOC    | \
-                                CFG_CMD_DTT    | \
-                                CFG_CMD_EEPROM | \
-                                CFG_CMD_ELF    | \
-                                CFG_CMD_FDC    | \
-                                CFG_CMD_FDOS   | \
-                                CFG_CMD_HWFLOW | \
-                                CFG_CMD_I2C    | \
-                                CFG_CMD_JFFS2  | \
-                                CFG_CMD_KGDB   | \
-                                CFG_CMD_NAND   | \
-                                CFG_CMD_NFS    | \
-                                CFG_CMD_MMC    | \
-                                CFG_CMD_MII    | \
-                                CFG_CMD_PCI    | \
-                                CFG_CMD_PCMCIA | \
-                                CFG_CMD_REISER | \
-                                CFG_CMD_SCSI   | \
-                                CFG_CMD_SPI    | \
-                                CFG_CMD_VFD    | \
-                                CFG_CMD_USB    | \
-                                CFG_CMD_XIMG   ) )
-
-
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_all.h>
+
+#undef CONFIG_CMD_ASKENV
+#undef CONFIG_CMD_BEDBUG
+#undef CONFIG_CMD_BMP
+#undef CONFIG_CMD_BSP
+#undef CONFIG_CMD_CACHE
+#undef CONFIG_CMD_DATE
+#undef CONFIG_CMD_DOC
+#undef CONFIG_CMD_DTT
+#undef CONFIG_CMD_EEPROM
+#undef CONFIG_CMD_ELF
+#undef CONFIG_CMD_FDC
+#undef CONFIG_CMD_FDOS
+#undef CONFIG_CMD_HWFLOW
+#undef CONFIG_CMD_I2C
+#undef CONFIG_CMD_JFFS2
+#undef CONFIG_CMD_KGDB
+#undef CONFIG_CMD_NAND
+#undef CONFIG_CMD_NFS
+#undef CONFIG_CMD_MMC
+#undef CONFIG_CMD_MII
+#undef CONFIG_CMD_PCI
+#undef CONFIG_CMD_PCMCIA
+#undef CONFIG_CMD_REISER
+#undef CONFIG_CMD_SCSI
+#undef CONFIG_CMD_SPI
+#undef CONFIG_CMD_VFD
+#undef CONFIG_CMD_USB
+#undef CONFIG_CMD_XIMG
+
 
 /*------------------------------------------------------------------------
  * COMPACT FLASH
  *----------------------------------------------------------------------*/
-#if (CONFIG_COMMANDS & CFG_CMD_IDE)
+#if defined(CONFIG_CMD_IDE)
 #define CONFIG_IDE_PREINIT                     /* Implement id_preinit */
 #define CFG_IDE_MAXBUS         1               /* 1 IDE bus            */
 #define CFG_IDE_MAXDEVICE      1               /* 1 drive per IDE bus  */
 #define CFG_CF_POWER           0x009209c0      /* CF Power FET PIO base*/
 #define CFG_CF_ATASEL          0x009209d0      /* CF ATASEL PIO base   */
 
-#endif /* CONFIG_COMMANDS & CFG_CMD_IDE */
+#endif
 
 /*------------------------------------------------------------------------
  * KGDB
  *----------------------------------------------------------------------*/
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   9600
 #endif
 
index 3e3803cd235b3b649848f072a95c75ae4c38bd31..0032fd3db71f1083fd40f9458da462f49291dedc 100644 (file)
 
 #endif /* CFG_NIOS_CPU_PIO_NUMS */
 
-/*------------------------------------------------------------------------
- * COMMANDS
- *----------------------------------------------------------------------*/
-#define CONFIG_COMMANDS                (CFG_CMD_ALL & ~( \
-                                CFG_CMD_ASKENV | \
-                                CFG_CMD_BEDBUG | \
-                                CFG_CMD_BMP    | \
-                                CFG_CMD_BSP    | \
-                                CFG_CMD_CACHE  | \
-                                CFG_CMD_DATE   | \
-                                CFG_CMD_DOC    | \
-                                CFG_CMD_DTT    | \
-                                CFG_CMD_EEPROM | \
-                                CFG_CMD_ELF    | \
-                                CFG_CMD_FAT    | \
-                                CFG_CMD_FDC    | \
-                                CFG_CMD_FDOS   | \
-                                CFG_CMD_HWFLOW | \
-                                CFG_CMD_IDE    | \
-                                CFG_CMD_I2C    | \
-                                CFG_CMD_JFFS2  | \
-                                CFG_CMD_KGDB   | \
-                                CFG_CMD_NAND   | \
-                                CFG_CMD_NFS    | \
-                                CFG_CMD_MMC    | \
-                                CFG_CMD_MII    | \
-                                CFG_CMD_PCI    | \
-                                CFG_CMD_PCMCIA | \
-                                CFG_CMD_SCSI   | \
-                                CFG_CMD_SPI    | \
-                                CFG_CMD_VFD    | \
-                                CFG_CMD_USB    | \
-                                CFG_CMD_XIMG   ) )
-
-
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_all.h>
+
+#undef CONFIG_CMD_ASKENV
+#undef COND_CMD_BEDBUG
+#undef COND_CMD_BMP
+#undef COND_CMD_BSP
+#undef COND_CMD_CACHE
+#undef COND_CMD_DATE
+#undef COND_CMD_DOC
+#undef COND_CMD_DTT
+#undef COND_CMD_EEPROM
+#undef COND_CMD_ELF
+#undef COND_CMD_FAT
+#undef COND_CMD_FDC
+#undef COND_CMD_FDOS
+#undef COND_CMD_HWFLOW
+#undef COND_CMD_IDE
+#undef COND_CMD_I2C
+#undef COND_CMD_JFFS2
+#undef COND_CMD_KGDB
+#undef COND_CMD_NAND
+#undef COND_CMD_NFS
+#undef COND_CMD_MMC
+#undef COND_CMD_MII
+#undef COND_CMD_PCI
+#undef COND_CMD_PCMCIA
+#undef COND_CMD_SCSI
+#undef COND_CMD_SPI
+#undef COND_CMD_VFD
+#undef COND_CMD_USB
+#undef COND_CMD_XIMG
+
 
 /*------------------------------------------------------------------------
  * KGDB
  *----------------------------------------------------------------------*/
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   9600
 #endif
 
index 2ae794dc26ca1bd11095df0dff8e6959229f9574..2eadbea35d6968c2322f13b9ec6ac96932f380f3 100644 (file)
 #define CONFIG_MII             1       /* MII PHY management           */
 #define CONFIG_PHY_ADDR                0       /* PHY address                  */
 
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_BSP     | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_EEPROM  )
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_BSP
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_EEPROM
+
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
@@ -87,7 +99,7 @@
 #define CFG_PROMPT_HUSH_PS2    "> "
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
 #define CFG_DCACHE_SIZE                16384   /* For AMCC 405 CPUs, older 405 ppc's   */
                                        /* have only 8kB, 16kB is save here     */
 #define CFG_CACHELINE_SIZE     32      /* ...                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value        */
 #endif
 
index 5489a539360c46e544f916734aa4ea484b34f920..5c595f57d264c2f0a1bb769774d1633eba4006b4 100644 (file)
 #define CONFIG_PHY_ADDR                0       /* PHY address                  */
 #define CONFIG_LXT971_NO_SLEEP  1       /* disable sleep mode in LXT971 */
 
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_IDE     | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_EEPROM  )
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_EEPROM
+
 
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
 #define CONFIG_RTC_MC146818            /* BQ3285 is MC146818 compatible*/
@@ -85,7 +97,7 @@
  */
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT     "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
  */
 #define CFG_DCACHE_SIZE                8192    /* For AMCC 405 CPUs                    */
 #define CFG_CACHELINE_SIZE     32      /* ...                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value        */
 #endif
 
index 720b335b099158ce83733ab331c4ee63c53a442b..a8697ec88de877e1e7a0010aa45e00c1acf4e664 100644 (file)
 #define CFG_ENV_IS_IN_FLASH    1
 #endif
 
-/*#define CONFIG_COMMANDS  ( CONFIG_CMD_DFL & ~(CFG_CMD_LOADS | CFG_CMD_LOADB) ) */
-#define CONFIG_COMMANDS  ( CONFIG_CMD_DFL & ~(CFG_CMD_LOADB))
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#undef CONFIG_CMD_LOADB
+
 
 #define CONFIG_BOOTDELAY       5
 #define CFG_PROMPT             "\nEV123 U-Boot> "
 #define        CFG_LONGHELP                            /* undef to save memory         */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE              1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE              256             /* Console I/O Buffer Size      */
index 2c99b4b16283818dbdbebe72803eb65c2ff8b3cc..bb771887243baa317604444cb795965c6b20af28 100644 (file)
 #define CONFIG_LOADS_ECHO       0       /* echo off for serial download */
 #define CFG_LOADS_BAUD_CHANGE           /* allow baudrate changes */
 
-#define CONFIG_BOOTP_MASK       (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+
+#define CONFIG_BOOTP_BOOTFILESIZE
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
 
-#define CONFIG_COMMANDS         (CONFIG_CMD_DFL | CFG_CMD_PCI | CFG_CMD_JFFS2)
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_JFFS2
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
 
 /*
  * Miscellaneous configurable options
@@ -84,7 +97,7 @@
  */
 #define CONFIG_CONS_INDEX       1
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE              1024        /* Console I/O Buffer Size */
 #else
 #define CFG_CBSIZE              256         /* Console I/O Buffer Size */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE        32    /* For all MPC74xx CPUs */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT        5    /* log base 2 of the above value */
 #endif
 
index e73bcec4485fa81a5dcfab40b5c52d17747bc641..f927a2c9cca3c335a76b9ca3e104b121ad4d57f5 100644 (file)
     ""
 #define CONFIG_BOOTCOMMAND     "run ramboot"
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
 
 #undef   CONFIG_WATCHDOG               /* watchdog disabled            */
 #undef   CONFIG_CAN_DRIVER             /* CAN Driver support disabled  */
 #define CONFIG_LOADS_ECHO      1       /* echo on for serial download  */
 #undef   CFG_LOADS_BAUD_CHANGE         /* don't allow baudrate change  */
 
-#define CONFIG_COMMANDS                ( CONFIG_CMD_DFL | \
-                                 CFG_CMD_ASKENV | \
-                                 CFG_CMD_DATE   )
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DATE
+
 
 /*
  * Miscellaneous configurable options
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT     "LEOX_elpt860: " /* Monitor Command Prompt      */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #  define CFG_CBSIZE   1024            /* Console I/O Buffer Size      */
 #else
 #  define CFG_CBSIZE    256            /* Console I/O Buffer Size      */
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs               */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #  define CFG_CACHELINE_SHIFT   4      /* log base 2 of the above value     */
 #endif
 
index 5507f352b909c32ec1a59f92c29a1173125619d7..cfa6335927a5c77ed13e4cff00a6718b85f09a01 100644 (file)
 #define CONFIG_IPADDR          192.168.2.21
 #define CONFIG_SERVERIP                192.168.2.16
 
-/*------------------------------------------------------------------------
- * COMMANDS
- *----------------------------------------------------------------------*/
-#define CONFIG_COMMANDS                (CFG_CMD_BDI    | \
-                                CFG_CMD_DHCP   | \
-                                CFG_CMD_ECHO   | \
-                                CFG_CMD_ENV    | \
-                                CFG_CMD_FLASH  | \
-                                CFG_CMD_IMI    | \
-                                CFG_CMD_IRQ    | \
-                                CFG_CMD_LOADS  | \
-                                CFG_CMD_LOADB  | \
-                                CFG_CMD_MEMORY | \
-                                CFG_CMD_MISC   | \
-                                CFG_CMD_NET    | \
-                                CFG_CMD_PING   | \
-                                CFG_CMD_RUN    | \
-                                CFG_CMD_SAVES  )
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_SAVES
+
+#undef CONFIG_CMD_AUTOSCRIPT
+#undef CONFIG_CMD_BOOTD
+#undef CONFIG_CMD_CONSOLE
+#undef CONFIG_CMD_FPGA
+#undef CONFIG_CMD_IMLS
+#undef CONFIG_CMD_ITEST
+#undef CONFIG_CMD_NFS
+#undef CONFIG_CMD_SETGETDCR
+#undef CONFIG_CMD_XIMG
+
 
 /*------------------------------------------------------------------------
  * MISC
index 6eca9f23dc74180e39e533e429696085bc569945..7c526f759e7acb32dda06f659b6314952ff38a93 100644 (file)
 #define CONFIG_IPADDR          192.168.2.21
 #define CONFIG_SERVERIP                192.168.2.16
 
-/*------------------------------------------------------------------------
- * COMMANDS
- *----------------------------------------------------------------------*/
-#define CONFIG_COMMANDS                (CFG_CMD_BDI    | \
-                                CFG_CMD_DHCP   | \
-                                CFG_CMD_ECHO   | \
-                                CFG_CMD_ENV    | \
-                                CFG_CMD_FLASH  | \
-                                CFG_CMD_IMI    | \
-                                CFG_CMD_IRQ    | \
-                                CFG_CMD_LOADS  | \
-                                CFG_CMD_LOADB  | \
-                                CFG_CMD_MEMORY | \
-                                CFG_CMD_MISC   | \
-                                CFG_CMD_NET    | \
-                                CFG_CMD_PING   | \
-                                CFG_CMD_RUN    | \
-                                CFG_CMD_SAVES  )
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#define CONFIG_CMD_BDI
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_ECHO
+#define CONFIG_CMD_ENV
+#define CONFIG_CMD_FLASH
+#define CONFIG_CMD_IMI
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_LOADS
+#define CONFIG_CMD_LOADB
+#define CONFIG_CMD_MEMORY
+#define CONFIG_CMD_MISC
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_RUN
+#define CONFIG_CMD_SAVES
+
 
 /*------------------------------------------------------------------------
  * MISC
index 976e79acb6fcb802a7d0696ceb112eebcc6434cd..1fe8f68c2e6f480a0e585b40b95a0be8b2ca19d2 100644 (file)
 #define CONFIG_IPADDR          192.168.2.21
 #define CONFIG_SERVERIP                192.168.2.16
 
-/*------------------------------------------------------------------------
- * COMMANDS
- *----------------------------------------------------------------------*/
-#define CONFIG_COMMANDS                (CFG_CMD_BDI    | \
-                                CFG_CMD_DHCP   | \
-                                CFG_CMD_ECHO   | \
-                                CFG_CMD_ENV    | \
-                                CFG_CMD_FLASH  | \
-                                CFG_CMD_IMI    | \
-                                CFG_CMD_IRQ    | \
-                                CFG_CMD_LOADS  | \
-                                CFG_CMD_LOADB  | \
-                                CFG_CMD_MEMORY | \
-                                CFG_CMD_MISC   | \
-                                CFG_CMD_NET    | \
-                                CFG_CMD_PING   | \
-                                CFG_CMD_RUN    | \
-                                CFG_CMD_SAVES  )
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#define CONFIG_CMD_BDI
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_ECHO
+#define CONFIG_CMD_ENV
+#define CONFIG_CMD_FLASH
+#define CONFIG_CMD_IMI
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_LOADS
+#define CONFIG_CMD_LOADB
+#define CONFIG_CMD_MEMORY
+#define CONFIG_CMD_MISC
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_RUN
+#define CONFIG_CMD_SAVES
+
 
 /*------------------------------------------------------------------------
  * MISC
index 738763b86ff15fba0903e7a5d79880f253168d9c..89e0eebeead22e21e88465d1492e545695791b8b 100644 (file)
 #define CFG_8xx_CPUCLK_MIN             40000000
 #define CFG_8xx_CPUCLK_MAX             133000000
 
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL  \
-                               | CFG_CMD_DHCP   \
-                               | CFG_CMD_IMMAP  \
-                               | CFG_CMD_MII    \
-                               | CFG_CMD_PING   \
-                               )
-
-/* This must be included AFTER the definition of CONFIG_COMMANDS */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_IMMAP
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_PING
+
 
 #define CONFIG_BOOTDELAY       5               /* Autoboot after 5 seconds     */
 #define CONFIG_BOOTCOMMAND     "bootm fe060000"        /* Autoboot command     */
index c203aea92458cae11ff3d339ec29f1b401f6599f..5d48d2bbb6888d0973c2e1f849fe1c360c17595e 100644 (file)
 #define CONFIG_MII             1       /* MII PHY management           */
 #define CONFIG_PHY_ADDR                1       /* PHY address                  */
 
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_ENV     | \
-                               CFG_CMD_FLASH)
 
 /*
- * #define CONFIG_COMMANDS     (CONFIG_CMD_DFL | CFG_CMD_PCI | CFG_CMD_IRQ | \
- *                              CFG_CMD_KGDB | CFG_CMD_I2C | CFG_CMD_EEPROM | \
- *                              CFG_CMD_ENV | CFG_CMD_FLASH)
+ * BOOTP options
  */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
 
-/* CFG_CMD_ENV est definie */
-/*     ((CONFIG_CMD_DFL | CFG_CMD_PCI | CFG_CMD_IRQ | CFG_CMD_KGDB) & ~(CFG_CMD_ENV))
+
+/*
+ * Command line configuration.
  */
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_ENV
+#define CONFIG_CMD_FLASH
+
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
  */
 #undef CFG_LONGHELP                    /* undef to save memory         */
 #define CFG_PROMPT     "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
  */
 #define CFG_DCACHE_SIZE                8192    /* For AMCC 405 CPUs                    */
 #define CFG_CACHELINE_SIZE     32      /* ...                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value        */
 #endif
 
 #define BOOTFLAG_COLD  0x01            /* Normal Power-On: Boot from FLASH     */
 #define BOOTFLAG_WARM  0x02            /* Software reboot                      */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
index b176c6f37e912365dcf618849608c9cc832f1955..66e1203b7dd556243f711d4f3664fe584c11b457 100644 (file)
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
 
 #define        CFG_LONGHELP                    /* undef to save memory         */
 #define        CFG_PROMPT      "BOOT: "        /* Monitor Command Prompt       */
index d55eb7d192ec644aad06c9cbd809ecdfba226c45..ed439b1922b1e1903172e2146a86cc6ed3e5f87d 100644 (file)
 
 #define        CONFIG_STATUS_LED       1       /* Status LED enabled           */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
 
 /*
  * Miscellaneous configurable options
  */
 #define        CFG_LONGHELP                    /* undef to save memory         */
 #define        CFG_PROMPT      "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index 78e571688546967cd0532fee60824ad8a7af1495..1c44a0c6d73c6f093772c3aea224bca10951ba2a 100644 (file)
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 #undef CONFIG_ALTIVEC                  /* undef to disable             */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | \
-                                CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
 
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
 
-#define CONFIG_COMMANDS        (CONFIG_CMD_DFL | CFG_CMD_ASKENV)
+#define CONFIG_CMD_ASKENV
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
 
 /*
  * Miscellaneous configurable options
  */
 #define        CFG_LONGHELP                    /* undef to save memory         */
 #define        CFG_PROMPT      "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     32      /* For all MPC74xx CPUs          */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value */
 #endif
 
index d85be424a2aeeb19978e2fc7dc8d271fdc794004..a3f38bb3a3237e542581cdbc596117ad6d7b7230 100644 (file)
 #define CONFIG_MII             1       /* MII PHY management           */
 #define CONFIG_PHY_ADDR                0       /* PHY address                  */
 
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL)
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
  */
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT     "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
 #define BOOTFLAG_COLD  0x01            /* Normal Power-On: Boot from FLASH     */
 #define BOOTFLAG_WARM  0x02            /* Software reboot                      */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
index 1b562d606354388f87ef9ff841d815f1252c40da..a562b2fa4e86486875329e14c1ac0c0eb10d19e6 100644 (file)
@@ -46,7 +46,6 @@
 #define CFG_I2C_SPEED          400000  /* I2C speed and slave address */
 #define CFG_I2C_SLAVE          0x7F
 
-/*Now included by CFG_CMD_PCMCIA */
 /*#define CONFIG_PCMCIA                1       / * To enable PCMCIA support */
 
 /* Video related */
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
-#define CONFIG_BOOTP_MASK      CONFIG_BOOTP_ALL
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_NISDOMAIN
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_DNS
+#define CONFIG_BOOTP_DNS2
+#define CONFIG_BOOTP_SEND_HOSTNAME
+#define CONFIG_BOOTP_NTPSERVER
+#define CONFIG_BOOTP_TIMEOFFSET
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
 
 /*
  * Miscellaneous configurable options
  */
 #define        CFG_LONGHELP                            /* undef to save memory         */
 #define        CFG_PROMPT              ":>"            /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE              1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE              256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index 2a986f07680905930da252155e3a20e8727191b5..c8ce25957b02a5e412f0f309301d488fd2977863 100644 (file)
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
 
 /*
  * Miscellaneous configurable options
  */
 #undef CFG_LONGHELP                    /* undef to save memory         */
 #define        CFG_PROMPT              ":>"            /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index 8babee140f9ebaf2762a044f8b7d547a073ee434..431844c7f3d1314a176b5cb283ec27c201333488 100644 (file)
 /*#define      CONFIG_WATCHDOG*/       /* watchdog enabled             */
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
+
+/*
+ * Command line configuration.
+ */
 
-#define CONFIG_COMMANDS (CFG_CMD_BDI | CFG_CMD_IMI | CFG_CMD_CACHE | \
-               CFG_CMD_MEMORY | CFG_CMD_FLASH | CFG_CMD_LOADB | CFG_CMD_LOADS | \
-               CFG_CMD_ENV | CFG_CMD_REGINFO | CFG_CMD_IMMAP | CFG_CMD_NET)
+#define CONFIG_CMD_BDI
+#define CONFIG_CMD_IMI
+#define CONFIG_CMD_CACHE
+#define CONFIG_CMD_MEMORY
+#define CONFIG_CMD_FLASH
+#define CONFIG_CMD_LOADB
+#define CONFIG_CMD_LOADS
+#define CONFIG_CMD_ENV
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_IMMAP
+#define CONFIG_CMD_NET
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
 
 /*
  * Miscellaneous configurable options
  */
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT     "EEG> "         /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index 0dd21bc618c89defac4efbbd810c8da6b1ab8fbf..322158c7b81347c9be7c415009913c379cc8a207 100644 (file)
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
-#define CONFIG_BOOTP_MASK      CONFIG_BOOTP_ALL
 
-#define CONFIG_COMMANDS            ( CONFIG_CMD_DFL &          ~( \
-                                       CFG_CMD_CONSOLE | \
-                                       CFG_CMD_BDI     | \
-                                       CFG_CMD_LOADS   | \
-                                       CFG_CMD_LOADB   | \
-                                       CFG_CMD_CACHE   ) )
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_NISDOMAIN
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_DNS
+#define CONFIG_BOOTP_DNS2
+#define CONFIG_BOOTP_SEND_HOSTNAME
+#define CONFIG_BOOTP_NTPSERVER
+#define CONFIG_BOOTP_TIMEOFFSET
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#undef CONFIG_CMD_CONSOLE
+#undef CONFIG_CMD_BDI
+#undef CONFIG_CMD_LOADS
+#undef CONFIG_CMD_LOADB
+#undef CONFIG_CMD_CACHE
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
 
 /*
  * Miscellaneous configurable options
  */
 #define        CFG_LONGHELP                    /* undef to save memory         */
 #define        CFG_PROMPT      "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index 423d74ea07a0222901a9754a734c7567fced4583..f8698b570857f1a44a465275f3269d1130000c4c 100644 (file)
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
-#define CONFIG_BOOTP_MASK      CONFIG_BOOTP_ALL
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_NISDOMAIN
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_DNS
+#define CONFIG_BOOTP_DNS2
+#define CONFIG_BOOTP_SEND_HOSTNAME
+#define CONFIG_BOOTP_NTPSERVER
+#define CONFIG_BOOTP_TIMEOFFSET
 
 #define        CONFIG_RTC_MPC8xx               /* use internal RTC of MPC8xx   */
 
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_SNTP    )
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_SNTP
+
 
 /*
  * Miscellaneous configurable options
  */
 #define        CFG_LONGHELP                    /* undef to save memory         */
 #define        CFG_PROMPT      "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index db42fd06fe50cb060378500918f301867abe359d..9c713c6c26f2fdca67f67efa14b4a59744cb34f1 100644 (file)
 #define CONFIG_PHY_CLK_FREQ    EMAC_STACR_CLK_66MHZ /* 66 MHz OPB clock*/
 #endif
 
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_BSP     | \
-                               CFG_CMD_EEPROM  )
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_BSP
+#define CONFIG_CMD_EEPROM
+
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
 #define CFG_PROMPT_HUSH_PS2    "> "
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
 #define CFG_DCACHE_SIZE                16384   /* For AMCC 405 CPUs, older 405 ppc's   */
                                        /* have only 8kB, 16kB is save here     */
 #define CFG_CACHELINE_SIZE     32      /* ...                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value        */
 #endif
 
index 6613f90a770075547700e0cfd12c08d5fc0023b6..bfbf3a839cf7cbfe2b29c0b4f22017dd3e548367 100644 (file)
 /*
  * BOOTP options
  */
-#define CONFIG_BOOTP_MASK                              ( CONFIG_BOOTP_DEFAULT          | \
-                                                                                 CONFIG_BOOTP_BOOTFILESIZE   \
-                                                                               )
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
 
 /*
  * The GEN860T network interface uses the on-chip 10/100 FEC with
                                                                CFG_POST_UART           | \
                                                                CFG_POST_SPR )
 
-#ifdef CONFIG_POST
-#define CFG_CMD_POST_DIAG CFG_CMD_DIAG
-#else
-#define CFG_CMD_POST_DIAG              0
-#endif
 
 /*
- * List of available monitor commands.  Use the system default list
- * plus add some of the "non-standard" commands back in.
- * See ./cmd_confdefs.h
- */
-#define BASE_CONFIG_COMMANDS   ( CONFIG_CMD_DFL        | \
-                                                               CFG_CMD_ASKENV  | \
-                                                               CFG_CMD_DHCP    | \
-                                                               CFG_CMD_I2C             | \
-                                                               CFG_CMD_EEPROM  | \
-                                                               CFG_CMD_REGINFO | \
-                                                               CFG_CMD_IMMAP   | \
-                                                               CFG_CMD_ELF             | \
-                                                               CFG_CMD_DATE    | \
-                                                               CFG_CMD_FPGA    | \
-                                                               CFG_CMD_MII     | \
-                                                               CFG_CMD_BEDBUG  | \
-                                                               CFG_CMD_POST_DIAG )
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_IMMAP
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_FPGA
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_BEDBUG
 
 #if !defined(CONFIG_SC)
-#define        CONFIG_COMMANDS ( BASE_CONFIG_COMMANDS | CFG_CMD_DOC )
-#else
-#define CONFIG_COMMANDS        BASE_CONFIG_COMMANDS
+    #define CONFIG_CMD_DOC
+#endif
+
+#ifdef CONFIG_POST
+#define CONFIG_CMD_DIAG
 #endif
 
 /*
 #define CFG_FPGA_PROG_FEEDBACK
 
 
-/************************************************************************
- * This must be included AFTER the definition of any CONFIG_COMMANDS
- */
-#include <cmd_confdefs.h>
-
 #define CFG_NAND_LEGACY
 
 /*
 /*
  * Set buffer size for console I/O
  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE                      1024
 #else
 #define        CFG_CBSIZE                      256
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE             16      /* For all MPC8xx CPUs                          */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT            4       /* log base 2 of above value            */
 #endif
 
index 8c01d97fa33fecdde140ba85fbb104bcf03ed385..785355a8e6679bde8b826308b254a9fa4e2525c3 100644 (file)
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
 
 /*
  * Miscellaneous configurable options
  */
 #define        CFG_LONGHELP                            /* undef to save memory         */
 #define        CFG_PROMPT              ":>"            /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE              256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index 03b965949794327ca95b6aafda08401e8ae0e114..79f5714e6f0bd185e5b99877a6359305e56dc9c6 100644 (file)
 #error Both CONFIG_SCC1_ENET and CONFIG_FEC_ENET configured
 #endif
 
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL | CFG_CMD_IDE)
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_IDE
+
+
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-
 /*
  * Miscellaneous configurable options
  */
 #define        CFG_PROMPT              "=>"    /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index dc40ebc861d715e6a65684db2631761b12957404..00f481c4b52d0bc5ba3e0492bd19cb37bc397152 100644 (file)
 #define CONFIG_VIDEO_BMP_GZIP          /* gzip compressed bmp images   */
 #define CFG_VIDEO_LOGO_MAX_SIZE        (2 << 20)       /* for decompressed img */
 
-#define ADD_BMP_CMD            CFG_CMD_BMP
-#else
-#define ADD_BMP_CMD            0
 #endif /* CONFIG_VIDEO */
 
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_IDE     | \
-                               CFG_CMD_FAT     | \
-                               CFG_CMD_EXT2    | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_NAND    | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_PING    | \
-                               ADD_BMP_CMD     | \
-                               CFG_CMD_EEPROM  )
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_EXT2
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_NAND
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_EEPROM
+
+#ifdef CONFIG_VIDEO
+#define CONFIG_CMD_BMP
+#endif
 
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 #define CONFIG_AUTO_UPDATE      1       /* autoupdate via compactflash  */
 #undef CONFIG_AUTO_UPDATE_SHOW          /* use board show routine       */
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-
 #define CFG_NAND_LEGACY
 
 #undef  CONFIG_BZIP2    /* include support for bzip2 compressed images */
 #define        CFG_PROMPT_HUSH_PS2     "> "
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
 #define CFG_DCACHE_SIZE                16384   /* For AMCC 405 CPUs, older 405 ppc's    */
                                        /* have only 8kB, 16kB is save here     */
 #define CFG_CACHELINE_SIZE     32      /* ...                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value        */
 #endif
 
index 6864740773325a928397d86c3116e96812ccef0b..26dd954c18a7eff11f31506475feed5f11d7f0f5 100644 (file)
 #define CONFIG_BAUDRATE                9600
 #define CONFIG_DRAM_SPEED      100             /* MHz                          */
 
-#define CONFIG_COMMANDS                ( CONFIG_CMD_DFL | \
-                                 CFG_CMD_EEPROM | \
-                                 CFG_CMD_ELF   | \
-                                 CFG_CMD_I2C   | \
-                                 CFG_CMD_NET   | \
-                                 CFG_CMD_PCI   | \
-                                 CFG_CMD_PING  )
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any)      */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_PING
 
 /*
  * Miscellaneous configurable options
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     32      /* For MPC8240 CPU                      */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
 #endif
 
index 7cce876924e4f2c66246c34396e7458a4e850504..02ae5d005dffc5e33a6883f5ce5bebc7d4a87bb0 100644 (file)
 
 #define CONFIG_CAN_DRIVER      1       /* CAN Driver support enabled   */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
 
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 #define CONFIG_RTC_DS1337              /* Use ds1337 rtc via i2c       */
 #define CFG_I2C_RTC_ADDR 0x68          /* at address 0x68              */
 
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_SNTP
+
 #ifdef CONFIG_SPLASH_SCREEN
-# define CONFIG_COMMANDS      ( CONFIG_CMD_DFL | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_BMP     | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_FAT     | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_IDE     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_SNTP    )
-#else
-# define CONFIG_COMMANDS      ( CONFIG_CMD_DFL | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_FAT     | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_IDE     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_SNTP    )
+    #define CONFIG_CMD_BMP
 #endif
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
 
 /*
  * Miscellaneous configurable options
 #define CFG_PROMPT_HUSH_PS2    "> "
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024    /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE             256     /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index f84e356216bd9a0e941872f9739a01a7e29d9099..661b895f9a1a796ec7fade0010ecc537015fe019 100644 (file)
 
 #define CONFIG_PHY_CLK_FREQ    EMAC_STACR_CLK_66MHZ /* 66 MHz OPB clock*/
 
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_NAND    | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_EEPROM  )
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_NAND
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_EEPROM
+
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
 #define CFG_PROMPT_HUSH_PS2    "> "
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
 #define CFG_DCACHE_SIZE                16384   /* For AMCC 405 CPUs, older 405 ppc's   */
                                        /* have only 8kB, 16kB is save here     */
 #define CFG_CACHELINE_SIZE     32      /* ...                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value        */
 #endif
 
index 35d84aedf8ad35eea743c4ad4d46d0b9beeca14a..bd0894c29abcaa41086895e819776cdc7dcac9b4 100644 (file)
 
 /* #define     CONFIG_STATUS_LED       1*/     /* Status LED enabled           */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
 
 # undef  CONFIG_SCC1_ENET              /* disable SCC1 ethernet */
 # define CONFIG_FEC_ENET    1  /* use FEC ethernet  */
 
 #define        CONFIG_RTC_MPC8xx               /* use internal RTC of MPC8xx   */
 
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_DATE    )
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_DATE
+
 
 /*
  * Miscellaneous configurable options
  */
 #define        CFG_LONGHELP                    /* undef to save memory         */
 #define        CFG_PROMPT      "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index cd17935893f5e25002f266d3dc491605cbd50f2e..27a5bc302fc1446ffe57bd74fb2a3548e8c8eb3f 100644 (file)
 
 #define        CONFIG_STATUS_LED       1       /* Status LED enabled           */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
 
 #undef CONFIG_SCC1_ENET                /* disable SCC1 ethernet */
 #define        CONFIG_FEC_ENET         1       /* use FEC ethernet  */
 
 #define        CONFIG_RTC_MPC8xx               /* use internal RTC of MPC8xx   */
 
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_IDE     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_SNTP    )
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_SNTP
+
 
 /*
  * Miscellaneous configurable options
  */
 #define        CFG_LONGHELP                    /* undef to save memory         */
 #define        CFG_PROMPT      "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index 29eb874dbf0e210586aedf350461a03b224152a1..85d2bb3f513f5e25d47c358b3e6f2146f7328fdf 100644 (file)
  * for FCC)
  *
  * if CONFIG_ETHER_NONE is defined, then either the ethernet routines must be
- * defined elsewhere (as for the console), or CFG_CMD_NET must be removed
- * from CONFIG_COMMANDS to remove support for networking.
- *
+ * defined elsewhere (as for the console), or CONFIG_CMD_NET must be unset.
  */
 #undef CONFIG_ETHER_ON_SCC             /* define if ether on SCC       */
 #define        CONFIG_ETHER_ON_FCC             /* define if ether on FCC       */
 
 #define        CONFIG_TIMESTAMP                /* Print image info with timestamp */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT|CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
 
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_NAND    | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_SNTP    )
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_NAND
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_SNTP
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
 
 /*
  * Miscellaneous configurable options
  */
 #define        CFG_LONGHELP                    /* undef to save memory         */
 #define        CFG_PROMPT      "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
  * NAND-FLASH stuff
  *-----------------------------------------------------------------------
  */
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
 
 #define CFG_NAND_LEGACY
 #define CFG_NAND0_BASE 0xE1000000
 #define WRITE_NAND(d, adr) do{ *(volatile __u8 *)((unsigned long)(adr + 0x0)) = (__u8)d; } while(0)
 #define READ_NAND(adr) ((volatile unsigned char)(*(volatile __u8 *)(unsigned long)(adr + 0x0)))
 
-#endif /* CFG_CMD_NAND */
+#endif /* CONFIG_CMD_NAND */
 
 /*-----------------------------------------------------------------------
  * Hard Reset Configuration Words
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE      32      /* For MPC8260 CPU              */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 # define CFG_CACHELINE_SHIFT   5       /* log base 2 of the above value */
 #endif
 
 #define CFG_OR0_PRELIM  (MEG_TO_AM(CFG_FLASH_SIZE)      |\
                         ORxG_SCY_6_CLK                 )
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
 /* Bank 1 - NAND Flash
 */
 #define        CFG_NAND_BASE           CFG_NAND0_BASE
index 0e20e5676349be1b2a42c41ad59150c5390d5a53..bd961d8426ac26372375c193cc8ef0e1135a9752 100644 (file)
 
 #define        CONFIG_TIMESTAMP                /* Print image info with timestamp */
 
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               CFG_CMD_BEDBUG  | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_SNTP    )
 
-#define CONFIG_BOOTP_MASK      CONFIG_BOOTP_DEFAULT
-
-/*----------------------------------------------------------------------*/
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+#define CONFIG_CMD_BEDBUG
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_SNTP
 
-/*----------------------------------------------------------------------*/
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
 
 /*
  * Miscellaneous configurable options
  */
 #define        CFG_LONGHELP                    /* undef to save memory         */
 #define        CFG_PROMPT      "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index c1565fc037ccb22d81022a80dd9b5ae4d185acb0..6fee4558dee0ccd372b7ab731f83ab69b9883181 100644 (file)
@@ -67,8 +67,7 @@
  * for FCC)
  *
  * if CONFIG_ETHER_NONE is defined, then either the ethernet routines must be
- * defined elsewhere (as for the console), or CFG_CMD_NET must be removed
- * from CONFIG_COMMANDS to remove support for networking.
+ * defined elsewhere (as for the console), or CONFIG_CMD_NET must be unset.
  */
 #undef CONFIG_ETHER_ON_SCC             /* define if ether on SCC   */
 #define CONFIG_ETHER_ON_FCC            /* define if ether on FCC   */
 #define CONFIG_8260_CLKIN      66666666        /* in Hz */
 #define CONFIG_BAUDRATE                19200
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT|CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
 
 /*
  * select i2c support configuration
 #define I2C_DELAY      udelay(5)       /* 1/4 I2C clock duration */
 #endif /* CONFIG_SOFT_I2C */
 
-#define CONFIG_COMMANDS                CONFIG_CMD_DFL
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
 
 
 #define CONFIG_BOOTDELAY       5       /* autoboot after 5 seconds */
 #define CONFIG_BOOTCOMMAND     "bootm 100000"  /* autoboot command */
 #define CONFIG_BOOTARGS                "root=/dev/ram rw"
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #undef CONFIG_KGDB_ON_SMC              /* define if kgdb on SMC */
 #define CONFIG_KGDB_ON_SCC             /* define if kgdb on SCC */
 #undef CONFIG_KGDB_NONE                /* define if kgdb on something else */
  */
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT     "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     32     /* For MPC8260 CPU               */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 # define CFG_CACHELINE_SHIFT   5      /* log base 2 of the above value */
 #endif
 
index 706bdb94f57ddd038ba9418b3a58c57a6e298b60..965b515f0e6f9d273af9b5b7b6c01f5350daae77 100644 (file)
@@ -58,8 +58,7 @@
  * for FCC).
  *
  * If CONFIG_ETHER_NONE is defined, then either the Ethernet routines must
- * be defined elsewhere (as for the console), or CFG_CMD_NET must be removed
- * from CONFIG_COMMANDS to remove support for networking.
+ * be defined elsewhere (as for the console), or CONFIG_CMD_NET must be unset.
  */
 #undef CONFIG_ETHER_ON_SCC             /* Define if Ethernet on SCC            */
 #define CONFIG_ETHER_ON_FCC            /* Define if Ethernet on FCC            */
 #define CONFIG_8260_CLKIN      65536000        /* in Hz */
 #define CONFIG_BAUDRATE                38400
 
-#define CONFIG_COMMANDS                ( CONFIG_CMD_DFL  \
-                               | CFG_CMD_ASKENV  \
-                               | CFG_CMD_DHCP    \
-                               | CFG_CMD_IMMAP   \
-                               | CFG_CMD_MII     \
-                               | CFG_CMD_PING    \
-                               | CFG_CMD_REGINFO \
-                               )
-
-/* This must be included AFTER the definition of CONFIG_COMMANDS */
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_IMMAP
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_REGINFO
+
 
 #define CONFIG_BOOTDELAY       5               /* autoboot after 5 seconds     */
 #define CONFIG_BOOTCOMMAND     "bootm fe010000"        /* autoboot command     */
index a0cb1dd484bcb709c1971bb2b732de3d32ef15a6..1142f2afac14b337f71058661ab987445722444b 100644 (file)
 
 #define        CONFIG_STATUS_LED       1       /* Status LED enabled           */
 
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL | CFG_CMD_IDE)
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_IDE
+
+
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 
-#define CONFIG_BOOTP_MASK \
-    ((CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE) & ~CONFIG_BOOTP_GATEWAY)
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
 
-/*----------------------------------------------------------------------*/
 
 /*
  * Miscellaneous configurable options
  */
 #define        CFG_LONGHELP                    /* undef to save memory         */
 #define        CFG_PROMPT      "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index 46b4d535462f3ddd2ae166ab15e485aba41107ee..bd19dad1ff46b511af1b226ffa8aa96b15d16182 100644 (file)
 
 #define        CONFIG_STATUS_LED       1       /* Status LED enabled           */
 
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL | CFG_CMD_IDE)
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_IDE
+
+
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 
-#define CONFIG_BOOTP_MASK \
-    ((CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE) & ~CONFIG_BOOTP_GATEWAY)
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
 
-/*----------------------------------------------------------------------*/
 
 /*
  * Miscellaneous configurable options
  */
 #define        CFG_LONGHELP                    /* undef to save memory         */
 #define        CFG_PROMPT      "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index 73be06950bc1c35612b99650592719125fb1624e..cc902c842d563f88cbb229beed3dab9f41b936d0 100644 (file)
 #define BOOTFLAG_COLD          0x01    /* Normal Power-On: Boot from FLASH  */
 #define BOOTFLAG_WARM          0x02    /* Software reboot           */
 
-#define CFG_CACHELINE_SIZE     32      /* For MPC5xxx CPUs */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
-#  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
-#endif
-
 /*
  * Serial console configuration
  */
@@ -69,7 +64,6 @@
 #define CONFIG_PCI_IO_BUS      0x50000000
 #define CONFIG_PCI_IO_PHYS     CONFIG_PCI_IO_BUS
 #define CONFIG_PCI_IO_SIZE     0x01000000
-#define ADD_PCI_CMD            CFG_CMD_PCI
 #endif
 
 #define CFG_XLB_PIPELINING     1
 #define CFG_RX_ETH_BUFFER      8  /* use 8 rx buffer on eepro100  */
 #define CONFIG_NS8382X         1
 
-#else  /* MPC5100 */
-
+#else
 #define CONFIG_MII             1
-#define ADD_PCI_CMD            0  /* no CFG_CMD_PCI */
-
 #endif
 
 /* Partitions */
 /* USB */
 #if 1
 #define CONFIG_USB_OHCI
-#define ADD_USB_CMD             CFG_CMD_USB | CFG_CMD_FAT
 #define CONFIG_USB_STORAGE
-#else
-#define ADD_USB_CMD             0
 #endif
 
 #define        CONFIG_TIMESTAMP                /* Print image info with timestamp */
 
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
 /*
- * Supported commands
+ * Command line configuration.
  */
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_FAT     | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_IDE     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_SNTP    | \
-                               ADD_PCI_CMD     | \
-                               ADD_USB_CMD     )
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_SNTP
+#define CONFIG_CMD_USB
+
+#if defined(CONFIG_PCI)
+#define CONFIG_CMD_PCI
+#endif
+
 
 #if (TEXT_BASE == 0xFF000000)          /* Boot low with 16 MB Flash */
 #   define CFG_LOWBOOT         1
  */
 #define CFG_LONGHELP                   /* undef to save memory     */
 #define CFG_PROMPT             "=> "   /* Monitor Command Prompt   */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024    /* Console I/O Buffer Size  */
 #else
 #define CFG_CBSIZE             256     /* Console I/O Buffer Size  */
 
 #define CFG_HZ                 1000    /* decrementer freq: 1 ms ticks */
 
+#define CFG_CACHELINE_SIZE     32      /* For MPC5xxx CPUs */
+#if defined(CONFIG_CMD_KGDB)
+#  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
+#endif
+
 /*
  * Various low-level settings
  */
index 7fa9ed2d42a1c23b4dc7f96455be87f30feaf2eb..ea3b0b4a3256020ecf226501709fe2602c59edb4 100644 (file)
 #define CONFIG_MII             1       /* MII PHY management           */
 #define CONFIG_PHY_ADDR                1       /* PHY address                  */
 
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_FAT     | \
-                               CFG_CMD_FLASH   | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_NET     | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_PING    )
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_FLASH
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_PING
+
 
   /* watchdog disabled */
 #undef CONFIG_WATCHDOG
 #define CFG_PROMPT_HUSH_PS2    "> "
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
  */
 #define CFG_DCACHE_SIZE                16384   /* For AMCC 405GPr CPUs */
 #define CFG_CACHELINE_SIZE     32      /* ...                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value */
 #endif
 
 #define BOOTFLAG_COLD  0x01            /* Normal Power-On: Boot from FLASH     */
 #define BOOTFLAG_WARM  0x02            /* Software reboot                      */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
index 48b94ee45ecb6fbdef2e708ade94d29cf32b8d90..3644e43885e70f8b6792fd5ddcff4d681b6caf50 100644 (file)
 #define CFG_RX_ETH_BUFFER     32            /* #eth rx buff & descrs   */
 
 
-/*-----------------------------------------------------------------------
- * Console/Commands/Parser
- *----------------------------------------------------------------------*/
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_BEDBUG  | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_DIAG    | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_NET     | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_IDE     | \
-                               CFG_CMD_FAT)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_BEDBUG
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_DIAG
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_FAT
+
 
 /* Include NetConsole support */
 #define CONFIG_NETCONSOLE
 #define CONFIG_AUTO_COMPLETE 1
 #define CFG_ALT_MEMTEST             1       /* use real memory test     */
 
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-
 #define CFG_LONGHELP                        /* undef to save memory    */
 #define CFG_PROMPT           "KaRefDes=> "  /* Monitor Command Prompt  */
 
 /*-----------------------------------------------------------------------
  * Console Buffer
  *----------------------------------------------------------------------*/
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE           1024           /* Console I/O Buffer Size */
 #else
 #define CFG_CBSIZE           256            /* Console I/O Buffer Size */
  */
 #define CFG_DCACHE_SIZE              8192           /* For AMCC 405 CPUs       */
 #define CFG_CACHELINE_SIZE    32
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT   5                     /* log base 2 of the above */
 #endif
 
 #define BOOTFLAG_COLD        0x01           /* Normal PowerOn: Boot from FLASH */
 #define BOOTFLAG_WARM        0x02           /* Software reboot */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE  230400        /* kgdb serial port baud   */
 #define CONFIG_KGDB_SER_INDEX 2                     /* kgdb serial port        */
 #endif
index 9b950fc5d169ca3083636ac7c8c83e42a9785a99..f6c31ea84972e2ca8c2cce256e79f073dcf062e1 100644 (file)
 
 #undef CONFIG_CAN_DRIVER               /* CAN Driver support disabled  */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
 
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 #define CONFIG_POST            (CFG_POST_CPU      | \
                                 CFG_POST_RTC      | \
                                 CFG_POST_I2C)
-
-#ifdef CONFIG_POST
-#define CFG_CMD_POST_DIAG CFG_CMD_DIAG
-#else
-#define CFG_CMD_POST_DIAG 0
-#endif
 #endif
 
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_IDE     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_POST_DIAG       | \
-                               CFG_CMD_SNTP    )
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_SNTP
+
+#ifdef CONFIG_POST
+    #define CONFIG_CMD_DIAG
+#endif
 
 /*
  * Miscellaneous configurable options
  */
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT     "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index cd38b0f2c2f4b790d649f53337d8e1fab9bd5a7d..e558aa481b3d6f1adb43e49c841358f1ea6afb16 100644 (file)
 
 #undef CONFIG_CAN_DRIVER               /* CAN Driver support disabled  */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
 
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 #define CONFIG_POST            (CFG_POST_CPU      | \
                                 CFG_POST_RTC      | \
                                 CFG_POST_I2C)
-
-#ifdef CONFIG_POST
-#define CFG_CMD_POST_DIAG CFG_CMD_DIAG
-#else
-#define CFG_CMD_POST_DIAG 0
-#endif
 #endif
 
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_FAT     | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_IDE     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_POST_DIAG       | \
-                               CFG_CMD_SNTP    | \
-                               CFG_CMD_USB     )
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_SNTP
+#define CONFIG_CMD_USB
+
+#ifdef CONFIG_POST
+    #define CONFIG_CMD_DIAG
+#endif
 
 /*
  * Miscellaneous configurable options
  */
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT     "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index e44f1cc627a7578cc64c2b3a38f93946dd243238..46edd08a91f5b34762c8b5621907cd7438bfc7d8 100644 (file)
 
 #define        CONFIG_STATUS_LED       1       /* Status LED enabled           */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
-
-#define CONFIG_CMD_MINIMAL     0
-#define CONFIG_CMD_TINY                (CFG_CMD_FLASH  | \
-                                CFG_CMD_MEMORY | \
-                                CFG_CMD_LOADS  | \
-                                CFG_CMD_LOADB)
-#define CONFIG_CMD_NORMAL      (CONFIG_CMD_DFL & ~CFG_CMD_BOOTD & ~CFG_CMD_REISER)
-#define CONFIG_CMD_GDB         (CONFIG_CMD_NORMAL | CFG_CMD_KGDB)
-#define CONFIG_CMD_FULL                (CFG_CMD_ALL & ~CFG_CMD_BEDBUG  \
-                                            & ~CFG_CMD_BMP     \
-                                            & ~CFG_CMD_BSP     \
-                                            & ~CFG_CMD_DISPLAY \
-                                            & ~CFG_CMD_DOC     \
-                                            & ~CFG_CMD_DTT     \
-                                            & ~CFG_CMD_EEPROM  \
-                                            & ~CFG_CMD_ELF     \
-                                            & ~CFG_CMD_EXT2    \
-                                            & ~CFG_CMD_FDC     \
-                                            & ~CFG_CMD_FDOS    \
-                                            & ~CFG_CMD_HWFLOW  \
-                                            & ~CFG_CMD_I2C     \
-                                            & ~CFG_CMD_IDE     \
-                                            & ~CFG_CMD_IRQ     \
-                                            & ~CFG_CMD_JFFS2   \
-                                            & ~CFG_CMD_KGDB    \
-                                            & ~CFG_CMD_MII     \
-                                            & ~CFG_CMD_MMC     \
-                                            & ~CFG_CMD_NAND    \
-                                            & ~CFG_CMD_PCI     \
-                                            & ~CFG_CMD_PCMCIA  \
-                                            & ~CFG_CMD_REISER  \
-                                            & ~CFG_CMD_SCSI    \
-                                            & ~CFG_CMD_SPI     \
-                                            & ~CFG_CMD_UNIVERSE\
-                                            & ~CFG_CMD_USB     \
-                                            & ~CFG_CMD_VFD     \
-                                            & ~CFG_CMD_XIMG    )
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
 
-#if CONFIG_LANTEC >= 2
-#define        CONFIG_RTC_MPC8xx               /* use internal RTC of MPC8xx   */
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_all.h>
+
+#undef CONFIG_CMD_BEDBUG
+#undef CONFIG_CMD_BMP
+#undef CONFIG_CMD_BSP
+#undef CONFIG_CMD_DISPLAY
+#undef CONFIG_CMD_DOC
+#undef CONFIG_CMD_DTT
+#undef CONFIG_CMD_EEPROM
+#undef CONFIG_CMD_ELF
+#undef CONFIG_CMD_EXT2
+#undef CONFIG_CMD_FDC
+#undef CONFIG_CMD_FDOS
+#undef CONFIG_CMD_HWFLOW
+#undef CONFIG_CMD_I2C
+#undef CONFIG_CMD_IDE
+#undef CONFIG_CMD_IRQ
+#undef CONFIG_CMD_JFFS2
+#undef CONFIG_CMD_KGDB
+#undef CONFIG_CMD_MFSL
+#undef CONFIG_CMD_MII
+#undef CONFIG_CMD_MMC
+#undef CONFIG_CMD_NAND
+#undef CONFIG_CMD_PCI
+#undef CONFIG_CMD_PCMCIA
+#undef CONFIG_CMD_REISER
+#undef CONFIG_CMD_SCSI
+#undef CONFIG_CMD_SPI
+#undef CONFIG_CMD_UNIVERSE
+#undef CONFIG_CMD_USB
+#undef CONFIG_CMD_VFD
+#undef CONFIG_CMD_XIMG
+
+#if !(CONFIG_LANTEC >= 2)
+    #undef CONFIG_CMD_DATE
+    #undef CONFIG_CMD_NET
 #endif
 
+
 #if CONFIG_LANTEC >= 2
-# define CONFIG_COMMANDS       CONFIG_CMD_FULL
-#else
-# define CONFIG_COMMANDS       (CONFIG_CMD_FULL & ~CFG_CMD_DATE & ~CFG_CMD_NET)
+#define        CONFIG_RTC_MPC8xx               /* use internal RTC of MPC8xx   */
 #endif
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-
 /*
  * Miscellaneous configurable options
  */
 #define        CFG_LONGHELP                    /* undef to save memory         */
 #define        CFG_PROMPT      "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index f0fc013434143eb9075bcc5e419a349a3b458c06..885a8821bf9e7c68c1237097743c47b338e9f41a 100644 (file)
 #define CFG_ENV_IS_IN_FLASH    1
 #endif
 
-#define CONFIG_COMMANDS         ((CONFIG_CMD_DFL | CFG_CMD_PING | CFG_CMD_NET ) & ~(CFG_CMD_LOADS | CFG_CMD_LOADB))
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_NET
+
+#undef CONFIG_CMD_LOADS
+#undef CONFIG_CMD_LOADB
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
 
 #define CFG_PROMPT             "=> "
 #define CFG_LONGHELP                           /* undef to save memory         */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE             256             /* Console I/O Buffer Size      */
index 5fd6a95c4d175727c930279156676fa8635ba506..cc456dc08a9c9ab886b7211ceac6c3bbe4c0e7e9 100644 (file)
 #define CFG_ENV_IS_IN_FLASH    1
 #endif
 
-#define CONFIG_COMMANDS         ( CONFIG_CMD_DFL & ~(CFG_CMD_LOADS | CFG_CMD_LOADB) | \
-                          CFG_CMD_MII)
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_MII
+
+#undef CONFIG_CMD_LOADS
+#undef CONFIG_CMD_LOADB
+
+
 #define CONFIG_BOOTDELAY       5
 
 #define CFG_PROMPT             "-> "
 #define CFG_LONGHELP                           /* undef to save memory         */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE             256             /* Console I/O Buffer Size      */
index cbb3e3bb9f947cc429f7c3ff1885b215604aaefd..f2a7644930f37e0aecb6001a657332d51ad1b124 100644 (file)
 #define CFG_ENV_IS_IN_FLASH    1
 
 
-#define CONFIG_COMMANDS  ( CONFIG_CMD_DFL & ~(CFG_CMD_LOADS | CFG_CMD_LOADB) )
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#undef CONFIG_CMD_LOADS
+#undef CONFIG_CMD_LOADB
+
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
 #define CONFIG_BOOTDELAY       5
 
 #define CFG_PROMPT             "-> "
 #define        CFG_LONGHELP                            /* undef to save memory         */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE              1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE              256             /* Console I/O Buffer Size      */
index d6e3fb8de9b125021101be98f5ca9f9eec5a2a7d..d9f2addb56599a60169670f69acea3542986e63c 100644 (file)
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
-#define CONFIG_COMMANDS                ( CFG_CMD_NET | CONFIG_CMD_DFL | CFG_CMD_SDRAM | \
-                             CFG_CMD_PCMCIA | CFG_CMD_IDE )
 
-#define CONFIG_DOS_PARTITION
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+
+/*
+ * Command line configuration.
+ */
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_DFL
+#define CONFIG_CMD_SDRAM
+#define CONFIG_CMD_PCMCIA
+#define CONFIG_CMD_IDE
+
+
+#define CONFIG_DOS_PARTITION
 
 /*
  * Miscellaneous configurable options
 #ifdef CFG_HUSH_PARSER
 #define CFG_PROMPT_HUSH_PS2    "> "
 #endif
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index 0ca0970075cb6296420f1b02b02844e0f6862594..69d195dc028671ebf4a3727719e20544814b075c 100644 (file)
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index 7aae2bd1437340648925d66bb6defcb8ffa40dc8..8d7ec5926bc7267815678d930b3449be61f6c2e3 100644 (file)
 #define CFG_RX_ETH_BUFFER     32            /* #eth rx buff & descrs   */
 
 
-/*-----------------------------------------------------------------------
- * Console/Commands/Parser
- *----------------------------------------------------------------------*/
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_BEDBUG  | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_DIAG    | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_NET     | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_IDE     | \
-                               CFG_CMD_FAT)
-
-/* tbs 09-March-2005 Removed to be able to use 2nd serial */
-/*                               CFG_CMD_KGDB    | \ */
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_BEDBUG
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_DIAG
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_FAT
 
 
 /* Include NetConsole support */
 #define CONFIG_AUTO_COMPLETE 1
 #define CFG_ALT_MEMTEST             1       /* use real memory test     */
 
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-
 #define CFG_LONGHELP                        /* undef to save memory    */
 #define CFG_PROMPT           "MetroBox=> "  /* Monitor Command Prompt  */
 
 /*-----------------------------------------------------------------------
  * Console Buffer
  *----------------------------------------------------------------------*/
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE           1024           /* Console I/O Buffer Size */
 #else
 #define CFG_CBSIZE           256            /* Console I/O Buffer Size */
  */
 #define CFG_DCACHE_SIZE              8192           /* For AMCC 405 CPUs       */
 #define CFG_CACHELINE_SIZE    32
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT   5                     /* log base 2 of the above */
 #endif
 
 #define BOOTFLAG_COLD        0x01           /* Normal PowerOn: Boot from FLASH */
 #define BOOTFLAG_WARM        0x02           /* Software reboot */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE  230400        /* kgdb serial port baud   */
 #define CONFIG_KGDB_SER_INDEX 2                     /* kgdb serial port        */
 #endif
index 53684ca6b57f2ef32f0ea150a64bde54f628f139..dde774271135bcc6329da3f030e0898c8084b85f 100644 (file)
 
 #define CONFIG_BR0_WORKAROUND  1
 
-#define CONFIG_COMMANDS             ( CONFIG_CMD_DFL  | \
-                              CFG_CMD_DATE    | \
-                              CFG_CMD_EEPROM  | \
-                              CFG_CMD_ELF     | \
-                              CFG_CMD_I2C     | \
-                              CFG_CMD_JFFS2   | \
-                              CFG_CMD_REGINFO )
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_JFFS2
+#define CONFIG_CMD_REGINFO
+
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
 
 /*
  * Miscellaneous configurable options
  */
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT     "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index 7e57a0fae1497c9afba1960aa688f16f0bd341dc..5b526a0993f84a2f8918c49c9a340461702c4aa7 100644 (file)
  ***********************************************************/
 #define CONFIG_SYS_CLK_FREQ    33000000 /* external frequency to pll   */
 
-/***********************************************************
- * Command definitions
- ***********************************************************/
-#define MIP405_COMMON_CMDS \
-                      (CONFIG_CMD_DFL  | \
-                       CFG_CMD_CACHE   | \
-                       CFG_CMD_DATE    | \
-                       CFG_CMD_DHCP    | \
-                       CFG_CMD_EEPROM  | \
-                       CFG_CMD_ELF     | \
-                       CFG_CMD_FAT     | \
-                       CFG_CMD_I2C     | \
-                       CFG_CMD_IDE     | \
-                       CFG_CMD_IRQ     | \
-                       CFG_CMD_JFFS2   | \
-                       CFG_CMD_MII     | \
-                       CFG_CMD_PCI     | \
-                       CFG_CMD_PING    | \
-                       CFG_CMD_REGINFO | \
-                       CFG_CMD_SAVES   | \
-                       CFG_CMD_BSP     )
 
-#if defined(CONFIG_MIP405T)
-#define CONFIG_COMMANDS                \
-                       MIP405_COMMON_CMDS
-#else
-#define CONFIG_COMMANDS                \
-                       (MIP405_COMMON_CMDS | \
-                       CFG_CMD_USB     | \
-                       CFG_CMD_DOC     )
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
 
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_CACHE
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_JFFS2
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_SAVES
+#define CONFIG_CMD_BSP
+
+#if !defined(CONFIG_MIP405T)
+    #define CONFIG_CMD_USB
+    #define CONFIG_CMD_DOC
 #endif
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS  (if any) */
-#include <cmd_confdefs.h>
 
 #define CFG_NAND_LEGACY
 
  **********************************************************/
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT     "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
  */
 #define CFG_DCACHE_SIZE                0x4000  /* For AMCC 405GPr CPUs                 */
 #define CFG_CACHELINE_SIZE     32      /* ...                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value        */
 #endif
 
 /************************************************************
  * Debug support
  ************************************************************/
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
index d8805ea5a7059b30b9167532cf1960e2e29c90cb..f488275f239d7911b9475680b259567e5f49ff3f 100644 (file)
 #define CFG_LOADS_BAUD_CHANGE  1       /* allow baudrate change        */
 
 
-#define CONFIG_COMMANDS               ((CONFIG_CMD_DFL & \
-                                    ~( CFG_CMD_NET | \
-                                       CFG_CMD_RTC | \
-                                       CFG_CMD_PCI | \
-                                       CFG_CMD_I2C   \
-                                     ) ) | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_KGDB    | \
-                               CFG_CMD_BEDBUG  | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_JFFS2     )
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_KGDB
+#define CONFIG_CMD_BEDBUG
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_JFFS2
+
+#undef CONFIG_CMD_NET
+#undef CONFIG_CMD_RTC
+#undef CONFIG_CMD_PCI
+#undef CONFIG_CMD_I2C
+
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
  */
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT     "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
  */
 #define CFG_DCACHE_SIZE                8192    /* For AMCC 405 CPUs                    */
 #define CFG_CACHELINE_SIZE     32      /* ...                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value        */
 #endif
 
 #define BOOTFLAG_COLD  0x01            /* Normal Power-On: Boot from FLASH     */
 #define BOOTFLAG_WARM  0x02            /* Software reboot                      */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
index 6ad2feb28e7e705864462b04f8557c0a629e035a..9370c24c500ec7040e05c3b72be387f792431776 100644 (file)
 #endif
 #define CONFIG_BOOTARGS      "console=ttyS0 root=/dev/nfs rw nfsroot=209.128.93.133:/boot nfsaddrs=209.128.93.133:209.128.93.138"
 #define CONFIG_BOOTDELAY     3
-#define CONFIG_COMMANDS      (CONFIG_CMD_DFL|CFG_CMD_ASKENV|CFG_CMD_DATE)
+
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DATE
+
+
 #define CONFIG_ENV_OVERWRITE 1
 #define CONFIG_ETH_ADDR      "00:10:18:10:00:06"
 
 #define CONFIG_DOS_PARTITION  1 /* MSDOS bootable partitiion support */
-/* This must be included AFTER the definition of CONFIG_COMMANDS (if any)
- */
-#include <cmd_confdefs.h>
+
 #include "../board/mousse/mousse.h"
 
 /*
index 6195bca85ba92b517cc4de59d65e2a084753ee8d..713518d0da247427351f5283890caa2ba2bedcb8 100644 (file)
  * for FCC)
  *
  * if CONFIG_ETHER_NONE is defined, then either the ethernet routines must be
- * defined elsewhere (as for the console), or CFG_CMD_NET must be removed
- * from CONFIG_COMMANDS to remove support for networking.
+ * defined elsewhere (as for the console), or CONFIG_CMD_NET must be unset.
  */
 #undef CONFIG_ETHER_ON_SCC             /* define if ether on SCC   */
 #define CONFIG_ETHER_ON_FCC            /* define if ether on FCC   */
 
 #define CONFIG_BAUDRATE                115200
 
-#define CFG_EXCLUDE            CFG_CMD_BEDBUG  | \
-                               CFG_CMD_BMP     | \
-                               CFG_CMD_BSP     | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DISPLAY | \
-                               CFG_CMD_DOC     | \
-                               CFG_CMD_DTT     | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_EXT2    | \
-                               CFG_CMD_FAT     | \
-                               CFG_CMD_FDC     | \
-                               CFG_CMD_FDOS    | \
-                               CFG_CMD_HWFLOW  | \
-                               CFG_CMD_IDE     | \
-                               CFG_CMD_KGDB    | \
-                               CFG_CMD_MMC     | \
-                               CFG_CMD_NAND    | \
-                               CFG_CMD_PCMCIA  | \
-                               CFG_CMD_REISER  | \
-                               CFG_CMD_SCSI    | \
-                               CFG_CMD_SPI     | \
-                               CFG_CMD_SNTP    | \
-                               CFG_CMD_UNIVERSE | \
-                               CFG_CMD_USB     | \
-                               CFG_CMD_VFD     | \
-                               CFG_CMD_XIMG
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_all.h>
+
+#undef CONFIG_CMD_BEDBUG
+#undef CONFIG_CMD_BMP
+#undef CONFIG_CMD_BSP
+#undef CONFIG_CMD_DATE
+#undef CONFIG_CMD_DISPLAY
+#undef CONFIG_CMD_DOC
+#undef CONFIG_CMD_DTT
+#undef CONFIG_CMD_EEPROM
+#undef CONFIG_CMD_ELF
+#undef CONFIG_CMD_EXT2
+#undef CONFIG_CMD_FAT
+#undef CONFIG_CMD_FDC
+#undef CONFIG_CMD_FDOS
+#undef CONFIG_CMD_HWFLOW
+#undef CONFIG_CMD_IDE
+#undef CONFIG_CMD_KGDB
+#undef CONFIG_CMD_MFSL
+#undef CONFIG_CMD_MMC
+#undef CONFIG_CMD_NAND
+#undef CONFIG_CMD_PCMCIA
+#undef CONFIG_CMD_REISER
+#undef CONFIG_CMD_SCSI
+#undef CONFIG_CMD_SPI
+#undef CONFIG_CMD_SNTP
+#undef CONFIG_CMD_UNIVERSE
+#undef CONFIG_CMD_USB
+#undef CONFIG_CMD_VFD
+#undef CONFIG_CMD_XIMG
 
 #if CONFIG_ADSTYPE == CFG_8272ADS
-#define CONFIG_COMMANDS                (CFG_CMD_ALL & ~( \
-                                CFG_CMD_SDRAM  | \
-                                CFG_CMD_I2C    | \
-                                CFG_EXCLUDE    ) )
+    #undef CONFIG_CMD_SDRAM
+    #undef CONFIG_CMD_I2C
+
 #elif CONFIG_ADSTYPE >= CFG_PQ2FADS
-#define CONFIG_COMMANDS                (CFG_CMD_ALL & ~( \
-                                CFG_CMD_SDRAM  | \
-                                CFG_CMD_I2C    | \
-                                CFG_CMD_PCI    | \
-                                CFG_EXCLUDE    ) )
+    #undef CONFIG_CMD_SDRAM
+    #undef CONFIG_CMD_I2C
+    #undef CONFIG_CMD_PCI
+
 #else
-#define CONFIG_COMMANDS                (CFG_CMD_ALL & ~( \
-                                CMD_CFG_PCI    | \
-                                CFG_EXCLUDE    ) )
+    #undef CONFIG_CMD_PCI
+
 #endif /* CONFIG_ADSTYPE >= CFG_PQ2FADS */
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
 
 #define CONFIG_BOOTDELAY       5               /* autoboot after 5 seconds */
 #define CONFIG_BOOTCOMMAND     "bootm fff80000"        /* autoboot command */
 #define CONFIG_BOOTARGS                "root=/dev/mtdblock2"
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #undef CONFIG_KGDB_ON_SMC              /* define if kgdb on SMC */
 #define CONFIG_KGDB_ON_SCC             /* define if kgdb on SCC */
 #undef CONFIG_KGDB_NONE                /* define if kgdb on something else */
 #define CFG_PROMPT_HUSH_PS2 "> "
 #define CFG_LONGHELP                   /* undef to save memory     */
 #define CFG_PROMPT     "=> "           /* Monitor Command Prompt   */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size  */
 #else
 #define CFG_CBSIZE     256                     /* Console I/O Buffer Size  */
 #endif /* CFG_RAMBOOT */
 
 #define CFG_CACHELINE_SIZE     32      /* For MPC8260 CPU */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
 #endif
 
 #define CFG_BCR                        0x100C0000
 #define CFG_SIUMCR             0x0A200000
 #define CFG_SCCR               SCCR_DFBRG01
-#define CFG_BR0_PRELIM         CFG_FLASH_BASE | 0x00001801
+#define CFG_BR0_PRELIM         (CFG_FLASH_BASE | 0x00001801)
 #define CFG_OR0_PRELIM         0xFF800876
-#define CFG_BR1_PRELIM         CFG_BCSR | 0x00001801
+#define CFG_BR1_PRELIM         (CFG_BCSR | 0x00001801)
 #define CFG_OR1_PRELIM         0xFFFF8010
 
 /*We need to configure chip select to use CPLD PCI IC on MPC8272ADS*/
index 4953b7053be1fff3e126cf6736a6db6f554de6ea..14b041e3aecb0a7e897bfec0e6149c77221ef346 100644 (file)
@@ -83,8 +83,7 @@
  * for FCC)
  *
  * if CONFIG_ETHER_NONE is defined, then either the ethernet routines must be
- * defined elsewhere (as for the console), or CFG_CMD_NET must be removed
- * from CONFIG_COMMANDS to remove support for networking.
+ * defined elsewhere (as for the console), or CONFIG_CMD_NET must be unset.
  */
 #undef CONFIG_ETHER_ON_SCC             /* define if ether on SCC   */
 #define CONFIG_ETHER_ON_FCC            /* define if ether on FCC   */
  */
 #define SPD_EEPROM_ADDRESS     0x50
 
-
 #define CONFIG_8260_CLKIN      66000000        /* in Hz */
 #define CONFIG_BAUDRATE                115200
 
-
-#define CONFIG_COMMANDS              ( CFG_CMD_ALL & ~( \
-                               CFG_CMD_BEDBUG  | \
-                               CFG_CMD_BMP     | \
-                               CFG_CMD_BSP     | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_DISPLAY | \
-                               CFG_CMD_DOC     | \
-                               CFG_CMD_DTT     | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_EXT2    | \
-                               CFG_CMD_FDC     | \
-                               CFG_CMD_FDOS    | \
-                               CFG_CMD_HWFLOW  | \
-                               CFG_CMD_IDE     | \
-                               CFG_CMD_JFFS2   | \
-                               CFG_CMD_KGDB    | \
-                               CFG_CMD_MMC     | \
-                               CFG_CMD_NAND    | \
-                               CFG_CMD_PCMCIA  | \
-                               CFG_CMD_REISER  | \
-                               CFG_CMD_SCSI    | \
-                               CFG_CMD_SPI     | \
-                               CFG_CMD_SNTP    | \
-                               CFG_CMD_VFD     | \
-                               CFG_CMD_UNIVERSE | \
-                               CFG_CMD_USB     | \
-                               CFG_CMD_XIMG    ) )
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_all.h>
+
+#undef CONFIG_CMD_BEDBUG
+#undef CONFIG_CMD_BMP
+#undef CONFIG_CMD_BSP
+#undef CONFIG_CMD_DATE
+#undef CONFIG_CMD_DHCP
+#undef CONFIG_CMD_DISPLAY
+#undef CONFIG_CMD_DOC
+#undef CONFIG_CMD_DTT
+#undef CONFIG_CMD_EEPROM
+#undef CONFIG_CMD_ELF
+#undef CONFIG_CMD_EXT2
+#undef CONFIG_CMD_FDC
+#undef CONFIG_CMD_FDOS
+#undef CONFIG_CMD_HWFLOW
+#undef CONFIG_CMD_IDE
+#undef CONFIG_CMD_JFFS2
+#undef CONFIG_CMD_KGDB
+#undef CONFIG_CMD_MFSL
+#undef CONFIG_CMD_MMC
+#undef CONFIG_CMD_NAND
+#undef CONFIG_CMD_PCMCIA
+#undef CONFIG_CMD_REISER
+#undef CONFIG_CMD_SCSI
+#undef CONFIG_CMD_SPI
+#undef CONFIG_CMD_SNTP
+#undef CONFIG_CMD_VFD
+#undef CONFIG_CMD_UNIVERSE
+#undef CONFIG_CMD_USB
+#undef CONFIG_CMD_XIMG
 
 /* Define a command string that is automatically executed when no character
  * is read on the console interface withing "Boot Delay" after reset.
        "bootm"
 #endif /* CONFIG_BOOT_ROOT_NFS */
 
-/* Add support for a few extra bootp options like:
- *     - File size
- *     - DNS
+/*
+ * BOOTP options
  */
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | \
-                                CONFIG_BOOTP_BOOTFILESIZE | \
-                                CONFIG_BOOTP_DNS)
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_DNS
 
 #define CONFIG_BOOTDELAY       5       /* autoboot after 5 seconds */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #undef CONFIG_KGDB_ON_SMC              /* define if kgdb on SMC */
 #define CONFIG_KGDB_ON_SCC             /* define if kgdb on SCC */
 #undef CONFIG_KGDB_NONE                /* define if kgdb on something else */
  */
 #define CFG_LONGHELP                   /* undef to save memory     */
 #define CFG_PROMPT     "=> "           /* Monitor Command Prompt   */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size  */
 #else
 #define CFG_CBSIZE     256                     /* Console I/O Buffer Size  */
 
 #define SDRAM_SPD_ADDR 0x50
 
-
 /*-----------------------------------------------------------------------
  * BR2,BR3 - Base Register
  *     Ref: Section 10.3.1 on page 10-14
 #error "INVALID SDRAM CONFIGURATION"
 #endif
 
-
 #define RS232EN_1              0x02000002
 #define RS232EN_2              0x01000001
 #define FETHIEN                        0x08000008
 #define CFG_GBL_DATA_OFFSET    (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
 #define CFG_INIT_SP_OFFSET     CFG_GBL_DATA_OFFSET
 
-
 /* Use this HRCW for booting from address 0xfe00000 (JP3 in setting 1-2)  */
 /* 0x0EB2B645 */
 #define CFG_HRCW_MASTER (( HRCW_BPS11 | HRCW_CIP )                             |\
 #  define CFG_ENV_SIZE         0x200
 #endif /* CFG_RAMBOOT */
 
-
 #define CFG_CACHELINE_SIZE     32      /* For MPC8260 CPU */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
 #endif
 
-
 /*-----------------------------------------------------------------------
  * HIDx - Hardware Implementation-dependent Registers                   2-11
  *-----------------------------------------------------------------------
index 7e1005c1ae92d0984cc506a6ff4f8b653102b878..81db96f4661e79d4cae14a1c9b103f01006c46ab 100644 (file)
 #define CONFIG_I2C_CMD_TREE
 #define CFG_I2C_SPEED          400000  /* I2C speed and slave address */
 #define CFG_I2C_SLAVE          0x7F
-#define CFG_I2C_NOPROBES       {0x69}  /* Don't probe these addrs */
+#define CFG_I2C_NOPROBES       {{0,0x69}} /* Don't probe these addrs */
 #define CFG_I2C_OFFSET         0x3000
 #define CFG_I2C2_OFFSET                0x3100
 
 #define CONFIG_LOADS_ECHO      1       /* echo on for serial download */
 #define CFG_LOADS_BAUD_CHANGE  1       /* allow baudrate change */
 
-#define CFG_BASE_COMMANDS      ( CONFIG_CMD_DFL        \
-                               | CFG_CMD_PING          \
-                               | CFG_CMD_DHCP          \
-                               | CFG_CMD_I2C           \
-                               | CFG_CMD_MII           \
-                               | CFG_CMD_DATE          \
-                               | CFG_CMD_PCI)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
 
-#define CONFIG_CMDLINE_EDITING 1
 
-#define CFG_RAMBOOT_COMMANDS   (CFG_BASE_COMMANDS & \
-                                ~(CFG_CMD_ENV | CFG_CMD_LOADS))
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_PCI
 
 #if defined(CFG_RAMBOOT)
-#define CONFIG_COMMANDS CFG_RAMBOOT_COMMANDS
-#else
-#define CONFIG_COMMANDS CFG_BASE_COMMANDS
+    #undef CONFIG_CMD_ENV
+    #undef CONFIG_CMD_LOADS
 #endif
 
-#include <cmd_confdefs.h>
+#define CONFIG_CMDLINE_EDITING 1
+
 
 /*
  * Miscellaneous configurable options
index cecb2258ffe4973aabc8a5b59ddcb13c5a54120b..f62ca2c42bea298e74ffd4821dec3abefd97ad2e 100644 (file)
 #define CONFIG_LOADS_ECHO      1       /* echo on for serial download */
 #define CFG_LOADS_BAUD_CHANGE  1       /* allow baudrate change */
 
-#if defined(CFG_RAMBOOT)
-#if defined(CONFIG_PCI)
-#define  CONFIG_COMMANDS       ((CONFIG_CMD_DFL \
-                               | CFG_CMD_PING \
-                               | CFG_CMD_ASKENV \
-                               | CFG_CMD_PCI \
-                               | CFG_CMD_I2C) \
-                               & \
-                               ~(CFG_CMD_ENV \
-                               | CFG_CMD_LOADS))
-#else
-#define  CONFIG_COMMANDS       ((CONFIG_CMD_DFL \
-                               | CFG_CMD_PING \
-                               | CFG_CMD_ASKENV \
-                               | CFG_CMD_I2C) \
-                               & \
-                               ~(CFG_CMD_ENV \
-                               | CFG_CMD_LOADS))
-#endif
-#else
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_ASKENV
+
 #if defined(CONFIG_PCI)
-#define  CONFIG_COMMANDS       (CONFIG_CMD_DFL \
-                               | CFG_CMD_PCI \
-                               | CFG_CMD_PING \
-                               | CFG_CMD_ASKENV \
-                               | CFG_CMD_I2C)
-#else
-#define  CONFIG_COMMANDS       (CONFIG_CMD_DFL \
-                               | CFG_CMD_PING \
-                               | CFG_CMD_ASKENV \
-                               | CFG_CMD_I2C  )
+    #define CONFIG_CMD_PCI
 #endif
+
+#if defined(CFG_RAMBOOT)
+    #undef CONFIG_CMD_ENV
+    #undef CONFIG_CMD_LOADS
 #endif
 
-#include <cmd_confdefs.h>
 
 #undef CONFIG_WATCHDOG         /* watchdog disabled */
 
 #define CFG_LOAD_ADDR          0x2000000       /* default load address */
 #define CFG_PROMPT             "=> "   /* Monitor Command Prompt */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        #define CFG_CBSIZE      1024    /* Console I/O Buffer Size */
 #else
        #define CFG_CBSIZE      256     /* Console I/O Buffer Size */
  */
 #define CFG_DCACHE_SIZE                16384
 #define CFG_CACHELINE_SIZE     32
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /*log base 2 of the above value */
 #endif
 
 #define BOOTFLAG_COLD  0x01    /* Normal Power-On: Boot from FLASH */
 #define BOOTFLAG_WARM  0x02    /* Software reboot */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed of kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
index 20c6d5a365ec3bd1b010d83bdbcc0cbe46cdcf56..1567fcfae32cfca9a1248d38d38fe95ee139611f 100644 (file)
 #define CONFIG_LOADS_ECHO      1       /* echo on for serial download */
 #define CFG_LOADS_BAUD_CHANGE  1       /* allow baudrate change */
 
-#if defined(CFG_RAMBOOT)
-#if defined(CONFIG_PCI)
-#define  CONFIG_COMMANDS       ((CONFIG_CMD_DFL        \
-                                | CFG_CMD_PING         \
-                                | CFG_CMD_PCI          \
-                                | CFG_CMD_I2C          \
-                                | CFG_CMD_DATE)        \
-                               &                       \
-                                ~(CFG_CMD_ENV          \
-                                 | CFG_CMD_LOADS))
-#else
-#define  CONFIG_COMMANDS       ((CONFIG_CMD_DFL        \
-                                | CFG_CMD_PING         \
-                                | CFG_CMD_I2C          \
-                                | CFG_CMD_DATE)        \
-                               &                       \
-                                ~(CFG_CMD_ENV          \
-                                 | CFG_CMD_LOADS))
-#endif
-#else
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_MII
+
 #if defined(CONFIG_PCI)
-#define  CONFIG_COMMANDS       (CONFIG_CMD_DFL         \
-                               | CFG_CMD_PCI           \
-                               | CFG_CMD_PING          \
-                               | CFG_CMD_I2C           \
-                               | CFG_CMD_DATE          \
-                               )
-#else
-#define  CONFIG_COMMANDS       (CONFIG_CMD_DFL         \
-                               | CFG_CMD_PING          \
-                               | CFG_CMD_I2C           \
-                               | CFG_CMD_MII           \
-                               | CFG_CMD_DATE          \
-                               )
+    #define CONFIG_CMD_PCI
 #endif
+
+#if defined(CFG_RAMBOOT)
+    #undef CONFIG_CMD_ENV
+    #undef CONFIG_CMD_LOADS
 #endif
 
-#include <cmd_confdefs.h>
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled */
 
 #define CFG_LOAD_ADDR  0x2000000       /* default load address */
 #define CFG_PROMPT     "=> "           /* Monitor Command Prompt */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        #define CFG_CBSIZE      1024            /* Console I/O Buffer Size */
 #else
        #define CFG_CBSIZE      256             /* Console I/O Buffer Size */
 /* Cache Configuration */
 #define CFG_DCACHE_SIZE                32768
 #define CFG_CACHELINE_SIZE     32
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /*log base 2 of the above value*/
 #endif
 
 #define BOOTFLAG_COLD  0x01    /* Normal Power-On: Boot from FLASH */
 #define BOOTFLAG_WARM  0x02    /* Software reboot */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed of kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
index 834934d0b6a5ac292a4f2894f53cd62ec5df0fc5..121ff06dc5cecb4c7a474ffe11b2fc32dbdf96eb 100644 (file)
@@ -372,7 +372,7 @@ boards, we say we have two, but don't display a message if we find only one. */
 
 #define CONFIG_NET_MULTI
 #define CONFIG_MII
-#define CONFIG_PHY_GIGE                /* In case CFG_CMD_MII is specified */
+#define CONFIG_PHY_GIGE                /* In case CONFIG_CMD_MII is specified */
 
 #define CONFIG_TSEC1
 
@@ -416,37 +416,40 @@ boards, we say we have two, but don't display a message if we find only one. */
 #define CONFIG_LOADS_ECHO      /* echo on for serial download */
 #define CFG_LOADS_BAUD_CHANGE  /* allow baudrate change */
 
-/* CONFIG_COMMANDS */
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_CACHE
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_SDRAM
 
 #ifdef CONFIG_COMPACT_FLASH
-#define CONFIG_COMMANDS_CF     (CFG_CMD_IDE | CFG_CMD_FAT)
-#else
-#define CONFIG_COMMANDS_CF     0
+    #define CONFIG_CMD_IDE
+    #define CONFIG_CMD_FAT
 #endif
 
 #ifdef CONFIG_PCI
-#define CONFIG_COMMANDS_PCI    CFG_CMD_PCI
-#else
-#define CONFIG_COMMANDS_PCI    0
+    #define CONFIG_CMD_PCI
 #endif
 
 #ifdef CONFIG_HARD_I2C
-#define CONFIG_COMMANDS_I2C    CFG_CMD_I2C
-#else
-#define CONFIG_COMMANDS_I2C    0
+    #define CONFIG_CMD_I2C
 #endif
 
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL | \
-                               CONFIG_COMMANDS_CF      | \
-                               CFG_CMD_NET     | \
-                               CFG_CMD_PING    | \
-                               CONFIG_COMMANDS_I2C     | \
-                               CONFIG_COMMANDS_PCI     | \
-                               CFG_CMD_SDRAM   | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_CACHE   | \
-                               CFG_CMD_IRQ)
-#include <cmd_confdefs.h>
 
 /* Watchdog */
 
@@ -469,7 +472,7 @@ boards, we say we have two, but don't display a message if we find only one. */
 #define CFG_PROMPT     "MPC8349E-mITX-GP> "    /* Monitor Command Prompt */
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
     #define CFG_CBSIZE 1024            /* Console I/O Buffer Size */
 #else
     #define CFG_CBSIZE 256             /* Console I/O Buffer Size */
@@ -492,7 +495,7 @@ boards, we say we have two, but don't display a message if we find only one. */
  */
 #define CFG_DCACHE_SIZE                32768
 #define CFG_CACHELINE_SIZE     32
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log2 of the above value */
 #endif
 
@@ -617,7 +620,7 @@ boards, we say we have two, but don't display a message if we find only one. */
 #define BOOTFLAG_COLD  0x01    /* Normal Power-On: Boot from FLASH */
 #define BOOTFLAG_WARM  0x02    /* Software reboot */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed of kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
index 79937dcd8f9bc42d01bf94f68a2c8e37f0d6a0bd..4b32a140e8182305a066f69560e6f20597cebbe8 100644 (file)
 #define CONFIG_LOADS_ECHO      1       /* echo on for serial download */
 #define CFG_LOADS_BAUD_CHANGE  1       /* allow baudrate change */
 
-#if defined(CFG_RAMBOOT)
-#if defined(CONFIG_PCI)
-#define         CONFIG_COMMANDS        ((CONFIG_CMD_DFL \
-                               | CFG_CMD_PING \
-                               | CFG_CMD_ASKENV \
-                               | CFG_CMD_PCI \
-                               | CFG_CMD_I2C) \
-                               & \
-                               ~(CFG_CMD_ENV \
-                               | CFG_CMD_LOADS))
-#else
-#define         CONFIG_COMMANDS        ((CONFIG_CMD_DFL \
-                               | CFG_CMD_PING \
-                               | CFG_CMD_ASKENV \
-                               | CFG_CMD_I2C) \
-                               & \
-                               ~(CFG_CMD_ENV \
-                               | CFG_CMD_LOADS))
-#endif
-#else
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_ASKENV
+
 #if defined(CONFIG_PCI)
-#define         CONFIG_COMMANDS        (CONFIG_CMD_DFL \
-                               | CFG_CMD_PCI \
-                               | CFG_CMD_PING \
-                               | CFG_CMD_ASKENV \
-                               | CFG_CMD_I2C)
-#else
-#define         CONFIG_COMMANDS        (CONFIG_CMD_DFL \
-                               | CFG_CMD_PING \
-                               | CFG_CMD_ASKENV \
-                               | CFG_CMD_I2C  )
+    #define CONFIG_CMD_PCI
 #endif
+
+#if defined(CFG_RAMBOOT)
+    #undef CONFIG_CMD_ENV
+    #undef CONFIG_CMD_LOADS
 #endif
 
-#include <cmd_confdefs.h>
 
 #undef CONFIG_WATCHDOG         /* watchdog disabled */
 
 #define CFG_LOAD_ADDR          0x2000000 /* default load address */
 #define CFG_PROMPT             "=> "   /* Monitor Command Prompt */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        #define CFG_CBSIZE      1024 /* Console I/O Buffer Size */
 #else
        #define CFG_CBSIZE      256 /* Console I/O Buffer Size */
  */
 #define CFG_DCACHE_SIZE                32768
 #define CFG_CACHELINE_SIZE     32
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5 /*log base 2 of the above value */
 #endif
 
 #define BOOTFLAG_COLD  0x01 /* Normal Power-On: Boot from FLASH */
 #define BOOTFLAG_WARM  0x02 /* Software reboot */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed of kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
index 9176be388e6fdec37bfe916d06c2241d6b787617..5a7c879a53305ad8865da5b5a5be3d77c8de8ef9 100644 (file)
 #define CONFIG_LOADS_ECHO      1       /* echo on for serial download */
 #define CFG_LOADS_BAUD_CHANGE  1       /* allow baudrate change */
 
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_I2C
+
+#if defined(CONFIG_PCI)
+    #define CONFIG_CMD_PCI
+#endif
+
 #if defined(CFG_RAMBOOT)
-  #if defined(CONFIG_PCI)
-    #define  CONFIG_COMMANDS   ((CONFIG_CMD_DFL        \
-                                | CFG_CMD_PING         \
-                                | CFG_CMD_PCI          \
-                                | CFG_CMD_I2C)         \
-                               &                       \
-                                ~(CFG_CMD_ENV          \
-                                 | CFG_CMD_LOADS))
-  #else
-    #define  CONFIG_COMMANDS   ((CONFIG_CMD_DFL        \
-                                | CFG_CMD_PING         \
-                                | CFG_CMD_I2C)         \
-                               &                       \
-                                ~(CFG_CMD_ENV          \
-                                 | CFG_CMD_LOADS))
-  #endif
-#else
-  #if defined(CONFIG_PCI)
-    #define  CONFIG_COMMANDS   (CONFIG_CMD_DFL         \
-                               | CFG_CMD_PCI           \
-                               | CFG_CMD_PING          \
-                               | CFG_CMD_I2C)
-  #else
-    #define  CONFIG_COMMANDS   (CONFIG_CMD_DFL         \
-                               | CFG_CMD_PING          \
-                               | CFG_CMD_I2C)
-  #endif
+    #undef CONFIG_CMD_ENV
+    #undef CONFIG_CMD_LOADS
 #endif
 
-#include <cmd_confdefs.h>
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled */
 
 #define CFG_LOAD_ADDR  0x2000000       /* default load address */
 #define CFG_PROMPT     "=> "           /* Monitor Command Prompt */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
     #define CFG_CBSIZE 1024            /* Console I/O Buffer Size */
 #else
     #define CFG_CBSIZE 256             /* Console I/O Buffer Size */
 /* Cache Configuration */
 #define CFG_DCACHE_SIZE                32768
 #define CFG_CACHELINE_SIZE     32
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /*log base 2 of the above value*/
 #endif
 
 #define BOOTFLAG_COLD  0x01            /* Normal Power-On: Boot from FLASH */
 #define BOOTFLAG_WARM  0x02            /* Software reboot */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 #define        CONFIG_EXTRA_ENV_SETTINGS                                       \
    "netdev=eth0\0"                                                      \
    "consoledev=ttyS0\0"                                                 \
-   "ramdiskaddr=600000\0"                                              \
+   "ramdiskaddr=1000000\0"                                             \
    "ramdiskfile=your.ramdisk.u-boot\0"                                 \
    "fdtaddr=400000\0"                                                  \
    "fdtfile=your.fdt.dtb\0"
    "tftp $ramdiskaddr $ramdiskfile;"                                    \
    "tftp $loadaddr $bootfile;"                                          \
    "tftp $fdtaddr $fdtfile;"                                           \
-   "bootm $loadaddr $ramdiskaddr"
+   "bootm $loadaddr $ramdiskaddr $fdtaddr"
 
 #define CONFIG_BOOTCOMMAND  CONFIG_NFSBOOTCOMMAND
 
index b568cb4df7575d903763979acf4aa321705e4be1..0ce25cf24e74f7ffec61e3ca2e1503d0dc6ad1ac 100644 (file)
 #define CONFIG_LOADS_ECHO      1       /* echo on for serial download  */
 #define CFG_LOADS_BAUD_CHANGE  1       /* allow baudrate change        */
 
-#if defined(CFG_RAMBOOT) || defined(CONFIG_RAM_AS_FLASH)
-#if defined(CONFIG_PCI)
-#define  CONFIG_COMMANDS       ((CONFIG_CMD_DFL | CFG_CMD_PING \
-                               | CFG_CMD_PCI | CFG_CMD_I2C ) & \
-                                ~(CFG_CMD_ENV | CFG_CMD_LOADS ))
-#else
-#define  CONFIG_COMMANDS       ((CONFIG_CMD_DFL | CFG_CMD_PING \
-                               | CFG_CMD_I2C ) & \
-                                ~(CFG_CMD_ENV | CFG_CMD_LOADS ))
-#endif
-#else
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_I2C
+
 #if defined(CONFIG_PCI)
-#define  CONFIG_COMMANDS       (CONFIG_CMD_DFL | CFG_CMD_PCI \
-                               | CFG_CMD_PING | CFG_CMD_I2C )
-#else
-#define  CONFIG_COMMANDS       (CONFIG_CMD_DFL | CFG_CMD_PING | CFG_CMD_I2C )
+    #define CONFIG_CMD_PCI
 #endif
+
+#if defined(CFG_RAMBOOT) || defined(CONFIG_RAM_AS_FLASH)
+    #undef CONFIG_CMD_ENV
+    #undef CONFIG_CMD_LOADS
 #endif
 
-#include <cmd_confdefs.h>
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_LOAD_ADDR   0x2000000       /* default load address */
 #define CFG_PROMPT     "MPC8540EVAL=> "/* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
 /* Cache Configuration */
 #define CFG_DCACHE_SIZE        32768
 #define CFG_CACHELINE_SIZE     32
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value */
 #endif
 
 #define BOOTFLAG_COLD  0x01            /* Normal Power-On: Boot from FLASH */
 #define BOOTFLAG_WARM  0x02            /* Software reboot              */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
index e047e259a5b53c00849d68b63455bec9b22eb090..50d3b6b8727eda2eea0cf5dce2e0d99945d48670 100644 (file)
@@ -401,19 +401,28 @@ extern unsigned long get_clock_freq(void);
 #define CONFIG_LOADS_ECHO      1       /* echo on for serial download */
 #define CFG_LOADS_BAUD_CHANGE  1       /* allow baudrate change */
 
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_MII
+
 #if defined(CONFIG_PCI)
-#define  CONFIG_COMMANDS       (CONFIG_CMD_DFL \
-                               | CFG_CMD_PCI \
-                               | CFG_CMD_PING \
-                               | CFG_CMD_I2C \
-                               | CFG_CMD_MII)
-#else
-#define  CONFIG_COMMANDS       (CONFIG_CMD_DFL \
-                               | CFG_CMD_PING \
-                               | CFG_CMD_I2C \
-                               | CFG_CMD_MII)
+    #define CONFIG_CMD_PCI
 #endif
-#include <cmd_confdefs.h>
+
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled */
 
@@ -423,7 +432,7 @@ extern unsigned long get_clock_freq(void);
 #define CFG_LONGHELP                   /* undef to save memory */
 #define CFG_LOAD_ADDR  0x2000000       /* default load address */
 #define CFG_PROMPT     "=> "           /* Monitor Command Prompt */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size */
@@ -443,7 +452,7 @@ extern unsigned long get_clock_freq(void);
 /* Cache Configuration */
 #define CFG_DCACHE_SIZE        32768
 #define CFG_CACHELINE_SIZE     32
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /*log base 2 of the above value*/
 #endif
 
@@ -455,7 +464,7 @@ extern unsigned long get_clock_freq(void);
 #define BOOTFLAG_COLD  0x01            /* Normal Power-On: Boot from FLASH */
 #define BOOTFLAG_WARM  0x02            /* Software reboot */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
index 7cd62e95a917dba6e58991484e63ec555d014fcf..d0f94a3e22098cb9b0ad5b160b2fe344cc4bf96e 100644 (file)
@@ -392,21 +392,31 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 #define CONFIG_LOADS_ECHO      1       /* echo on for serial download */
 #define CFG_LOADS_BAUD_CHANGE  1       /* allow baudrate change */
 
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_MII
+
 #if defined(CONFIG_PCI)
-#define        CONFIG_COMMANDS (CONFIG_CMD_DFL \
-                               | CFG_CMD_PCI \
-                               | CFG_CMD_PING \
-                               | CFG_CMD_I2C \
-                               | CFG_CMD_MII \
-                               | CFG_CMD_BEDBUG \
-                               | CFG_CMD_NET)
-#else
-#define        CONFIG_COMMANDS (CONFIG_CMD_DFL \
-                               | CFG_CMD_PING \
-                               | CFG_CMD_I2C \
-                               | CFG_CMD_MII)
+    #define CONFIG_CMD_PCI
+    #define CONFIG_CMD_BEDBUG
+    #define CONFIG_CMD_NET
 #endif
-#include <cmd_confdefs.h>
+
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled */
 
@@ -416,7 +426,7 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 #define CFG_LONGHELP                   /* undef to save memory */
 #define CFG_LOAD_ADDR  0x2000000       /* default load address */
 #define CFG_PROMPT     "=> "           /* Monitor Command Prompt */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size */
@@ -436,7 +446,7 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 /* Cache Configuration */
 #define CFG_DCACHE_SIZE        32768
 #define CFG_CACHELINE_SIZE     32
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /*log base 2 of the above value*/
 #endif
 
@@ -448,7 +458,7 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 #define BOOTFLAG_COLD  0x01            /* Normal Power-On: Boot from FLASH */
 #define BOOTFLAG_WARM  0x02            /* Software reboot */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
index a0d291eef481926931c4c1e8005cca834ee396e4..2e84fc8748d5e760171d1aa38b247871b273bcf6 100644 (file)
@@ -427,19 +427,28 @@ extern unsigned long get_clock_freq(void);
 #define CONFIG_LOADS_ECHO      1       /* echo on for serial download */
 #define CFG_LOADS_BAUD_CHANGE  1       /* allow baudrate change */
 
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_MII
+
 #if defined(CONFIG_PCI)
-#define  CONFIG_COMMANDS       (CONFIG_CMD_DFL \
-                               | CFG_CMD_PCI \
-                               | CFG_CMD_PING \
-                               | CFG_CMD_I2C \
-                               | CFG_CMD_MII)
-#else
-#define  CONFIG_COMMANDS       (CONFIG_CMD_DFL \
-                               | CFG_CMD_PING \
-                               | CFG_CMD_I2C \
-                               | CFG_CMD_MII)
+    #define CONFIG_CMD_PCI
 #endif
-#include <cmd_confdefs.h>
+
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled */
 
@@ -449,7 +458,7 @@ extern unsigned long get_clock_freq(void);
 #define CFG_LONGHELP                   /* undef to save memory */
 #define CFG_LOAD_ADDR  0x2000000       /* default load address */
 #define CFG_PROMPT     "=> "           /* Monitor Command Prompt */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size */
@@ -469,7 +478,7 @@ extern unsigned long get_clock_freq(void);
 /* Cache Configuration */
 #define CFG_DCACHE_SIZE        32768
 #define CFG_CACHELINE_SIZE     32
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /*log base 2 of the above value*/
 #endif
 
@@ -481,7 +490,7 @@ extern unsigned long get_clock_freq(void);
 #define BOOTFLAG_COLD  0x01            /* Normal Power-On: Boot from FLASH */
 #define BOOTFLAG_WARM  0x02            /* Software reboot */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
index b7e703ca183dca4f7886da15566e5a2d616a1633..a3025bd715768bb73529b93c784365a8c6373c22 100644 (file)
@@ -401,19 +401,28 @@ extern unsigned long get_clock_freq(void);
 #define CONFIG_LOADS_ECHO      1       /* echo on for serial download */
 #define CFG_LOADS_BAUD_CHANGE  1       /* allow baudrate change */
 
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_MII
+
 #if defined(CONFIG_PCI)
-#define  CONFIG_COMMANDS       (CONFIG_CMD_DFL \
-                               | CFG_CMD_PCI \
-                               | CFG_CMD_PING \
-                               | CFG_CMD_I2C \
-                               | CFG_CMD_MII)
-#else
-#define  CONFIG_COMMANDS       (CONFIG_CMD_DFL \
-                               | CFG_CMD_PING \
-                               | CFG_CMD_I2C \
-                               | CFG_CMD_MII)
+    #define CONFIG_CMD_PCI
 #endif
-#include <cmd_confdefs.h>
+
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled */
 
@@ -423,7 +432,7 @@ extern unsigned long get_clock_freq(void);
 #define CFG_LONGHELP                   /* undef to save memory */
 #define CFG_LOAD_ADDR  0x2000000       /* default load address */
 #define CFG_PROMPT     "=> "           /* Monitor Command Prompt */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size */
@@ -443,7 +452,7 @@ extern unsigned long get_clock_freq(void);
 /* Cache Configuration */
 #define CFG_DCACHE_SIZE        32768
 #define CFG_CACHELINE_SIZE     32
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /*log base 2 of the above value*/
 #endif
 
@@ -455,7 +464,7 @@ extern unsigned long get_clock_freq(void);
 #define BOOTFLAG_COLD  0x01            /* Normal Power-On: Boot from FLASH */
 #define BOOTFLAG_WARM  0x02            /* Software reboot */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
index 043397fc21b7b5327fabe071b3f53e7ea49517b5..c10e551e408d2cd01a1c3918d6fd60d226af7bea 100644 (file)
@@ -43,9 +43,7 @@
 
 #define CONFIG_PCI
 #define CONFIG_TSEC_ENET               /* tsec ethernet support */
-#undef CONFIG_TSEC_ENET                /* tsec ethernet support */
-#undef  CONFIG_ETHER_ON_FCC             /* cpm FCC ethernet support */
-#define  CONFIG_ETHER_ON_FCC             /* cpm FCC ethernet support */
+#undef CONFIG_ETHER_ON_FCC             /* cpm FCC ethernet support */
 #define CONFIG_ENV_OVERWRITE
 #define CONFIG_SPD_EEPROM              /* Use SPD EEPROM for DDR setup*/
 #define CONFIG_DDR_DLL                 /* possible DLL fix needed */
 #endif /* CONFIG_PCI */
 
 
-#if defined(CONFIG_TSEC_ENET)
+#ifdef CONFIG_TSEC_ENET
 
 #ifndef CONFIG_NET_MULTI
 #define CONFIG_NET_MULTI       1
 #endif
 
+#ifndef CONFIG_MII
 #define CONFIG_MII             1       /* MII PHY management */
+#endif
 #define CONFIG_TSEC1   1
 #define CONFIG_TSEC1_NAME      "TSEC0"
 #define CONFIG_TSEC2   1
 /* Options are: TSEC[0-1] */
 #define CONFIG_ETHPRIME                "TSEC0"
 
-#elif defined(CONFIG_ETHER_ON_FCC)     /* CPM FCC Ethernet */
+#endif /* CONFIG_TSEC_ENET */
+
+#ifdef CONFIG_ETHER_ON_FCC     /* CPM FCC Ethernet */
 
-#define CONFIG_ETHER_ON_FCC    /* define if ether on FCC   */
 #undef  CONFIG_ETHER_NONE      /* define if ether on something else */
 #define CONFIG_ETHER_INDEX      2       /* which channel for ether */
 
   #define FETH3_RST            0x80
 #endif                                 /* CONFIG_ETHER_INDEX */
 
-#define CONFIG_MII                     /* MII PHY management */
+#ifndef CONFIG_MII
+#define CONFIG_MII             1       /* MII PHY management */
+#endif
+
 #define CONFIG_BITBANGMII              /* bit-bang MII PHY management */
 
 /*
 #define CONFIG_LOADS_ECHO      1       /* echo on for serial download */
 #define CFG_LOADS_BAUD_CHANGE  1       /* allow baudrate change */
 
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_I2C
+
+#if defined(CONFIG_PCI)
+    #define CONFIG_CMD_PCI
+#endif
+
+#if defined(CONFIG_ETHER_ON_FCC)
+    #define CONFIG_CMD_MII
+#endif
+
 #if defined(CFG_RAMBOOT)
-  #if defined(CONFIG_PCI)
-    #define  CONFIG_COMMANDS   ((CONFIG_CMD_DFL        \
-                                | CFG_CMD_PING         \
-                                | CFG_CMD_PCI          \
-                                | CFG_CMD_I2C)         \
-                               &                       \
-                                ~(CFG_CMD_ENV          \
-                                 | CFG_CMD_LOADS))
-  #elif defined(CONFIG_TSEC_ENET)
-    #define  CONFIG_COMMANDS   ((CONFIG_CMD_DFL        \
-                               | CFG_CMD_PING          \
-                               | CFG_CMD_I2C)          \
-                               & ~(CFG_CMD_ENV))
-  #elif defined(CONFIG_ETHER_ON_FCC)
-    #define  CONFIG_COMMANDS   ((CONFIG_CMD_DFL        \
-                                | CFG_CMD_MII          \
-                                | CFG_CMD_PING         \
-                                | CFG_CMD_I2C)         \
-                               & ~(CFG_CMD_ENV))
-  #endif
-#else
-  #if defined(CONFIG_PCI)
-    #define  CONFIG_COMMANDS   (CONFIG_CMD_DFL         \
-                               | CFG_CMD_PCI           \
-                               | CFG_CMD_PING          \
-                               | CFG_CMD_I2C)
-  #elif defined(CONFIG_TSEC_ENET)
-    #define  CONFIG_COMMANDS   (CONFIG_CMD_DFL         \
-                               | CFG_CMD_PING          \
-                               | CFG_CMD_I2C)
-  #elif defined(CONFIG_ETHER_ON_FCC)
-    #define  CONFIG_COMMANDS   (CONFIG_CMD_DFL         \
-                               | CFG_CMD_MII           \
-                               | CFG_CMD_PING          \
-                               | CFG_CMD_I2C)
-  #endif
+    #undef CONFIG_CMD_ENV
+    #undef CONFIG_CMD_LOADS
 #endif
 
-#include <cmd_confdefs.h>
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled */
 
 #define CFG_LOAD_ADDR  0x1000000       /* default load address */
 #define CFG_PROMPT     "=> "           /* Monitor Command Prompt */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
     #define CFG_CBSIZE 1024            /* Console I/O Buffer Size */
 #else
     #define CFG_CBSIZE 256             /* Console I/O Buffer Size */
 /* Cache Configuration */
 #define CFG_DCACHE_SIZE                32768
 #define CFG_CACHELINE_SIZE     32
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /*log base 2 of the above value*/
 #endif
 
 #define BOOTFLAG_COLD  0x01            /* Normal Power-On: Boot from FLASH */
 #define BOOTFLAG_WARM  0x02            /* Software reboot */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 #define        CONFIG_EXTRA_ENV_SETTINGS                                       \
    "netdev=eth0\0"                                                      \
-   "consoledev=ttyS0\0"                                                 \
-   "ramdiskaddr=400000\0"                                              \
-   "ramdiskfile=your.ramdisk.u-boot\0"
+   "consoledev=ttyCPM\0"                                               \
+   "ramdiskaddr=1000000\0"                                             \
+   "ramdiskfile=your.ramdisk.u-boot\0"                                 \
+   "fdtaddr=400000\0"                                                  \
+   "fdtfile=mpc8560ads.dtb\0"
 
 #define CONFIG_NFSBOOTCOMMAND                                          \
    "setenv bootargs root=/dev/nfs rw "                                  \
       "ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:off " \
       "console=$consoledev,$baudrate $othbootargs;"                     \
    "tftp $loadaddr $bootfile;"                                          \
-   "bootm $loadaddr"
+   "tftp $fdtaddr $fdtfile;"                                           \
+   "bootm $loadaddr - $fdtaddr"
 
 #define CONFIG_RAMBOOTCOMMAND \
    "setenv bootargs root=/dev/ram rw "                                  \
       "console=$consoledev,$baudrate $othbootargs;"                     \
    "tftp $ramdiskaddr $ramdiskfile;"                                    \
    "tftp $loadaddr $bootfile;"                                          \
-   "bootm $loadaddr $ramdiskaddr"
+   "tftp $fdtaddr $fdtfile;"                                           \
+   "bootm $loadaddr $ramdiskaddr $fdtaddr"
 
 #define CONFIG_BOOTCOMMAND  CONFIG_NFSBOOTCOMMAND
 
index 0ff0416138d58364be59a8bb580dd9c8222f8947..eef168c252d469d8b1efc31f2ccb9e6aa8aad702 100644 (file)
@@ -383,19 +383,29 @@ extern unsigned long get_clock_freq(void);
 #define CONFIG_LOADS_ECHO      1       /* echo on for serial download */
 #define CFG_LOADS_BAUD_CHANGE  1       /* allow baudrate change */
 
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_MII
+
 #if defined(CONFIG_PCI)
-#define  CONFIG_COMMANDS       (CONFIG_CMD_DFL \
-                               | CFG_CMD_PCI \
-                               | CFG_CMD_PING \
-                               | CFG_CMD_I2C \
-                               | CFG_CMD_MII)
-#else
-#define  CONFIG_COMMANDS       (CONFIG_CMD_DFL \
-                               | CFG_CMD_PING \
-                               | CFG_CMD_I2C \
-                               | CFG_CMD_MII)
+    #define CONFIG_CMD_PCI
 #endif
-#include <cmd_confdefs.h>
+
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled */
 
@@ -405,7 +415,7 @@ extern unsigned long get_clock_freq(void);
 #define CFG_LONGHELP                   /* undef to save memory */
 #define CFG_LOAD_ADDR  0x2000000       /* default load address */
 #define CFG_PROMPT     "=> "           /* Monitor Command Prompt */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size */
 #else
 #define CFG_CBSIZE     256                     /* Console I/O Buffer Size */
@@ -425,7 +435,7 @@ extern unsigned long get_clock_freq(void);
 /* Cache Configuration */
 #define CFG_DCACHE_SIZE        32768
 #define CFG_CACHELINE_SIZE     32
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /*log base 2 of the above value*/
 #endif
 
@@ -437,7 +447,7 @@ extern unsigned long get_clock_freq(void);
 #define BOOTFLAG_COLD  0x01            /* Normal Power-On: Boot from FLASH */
 #define BOOTFLAG_WARM  0x02            /* Software reboot */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
index 12af24f74994942ee310d9c40d26356091a14126..888af530c24e88b09a585505da389274e0a6d774 100644 (file)
 
 #define CFG_RESET_ADDRESS    0xfff00100
 
-/*#undef CONFIG_PCI*/
-#define CONFIG_PCI
+#define CONFIG_PCI             1       /* Enable PCI/PCIE */
+#define CONFIG_PCI1            1       /* PCIE controler 1 (ULI bridge) */
+#define CONFIG_PCI2            1       /* PCIE controler 2 (slot) */
+#define CONFIG_FSL_PCI_INIT    1       /* Use common FSL init code */
 
 #define CONFIG_TSEC_ENET               /* tsec ethernet support */
 #define CONFIG_ENV_OVERWRITE
@@ -76,6 +78,9 @@
 #define L2_ENABLE      (L2CR_L2E)
 
 #ifndef CONFIG_SYS_CLK_FREQ
+#ifndef __ASSEMBLY__
+extern unsigned long get_board_sys_clk(unsigned long dummy);
+#endif
 #define CONFIG_SYS_CLK_FREQ     get_board_sys_clk(0)
 #endif
 
@@ -93,6 +98,9 @@
 #define CFG_CCSRBAR            0xf8000000      /* relocated CCSRBAR */
 #define CFG_IMMR               CFG_CCSRBAR     /* PQII uses CFG_IMMR */
 
+#define CFG_PCI1_ADDR          (CFG_CCSRBAR+0x8000)
+#define CFG_PCI2_ADDR          (CFG_CCSRBAR+0x9000)
+
 /*
  * DDR Setup
  */
 #define CFG_INIT_SP_OFFSET     CFG_GBL_DATA_OFFSET
 
 #define CFG_MONITOR_LEN                (256 * 1024)    /* Reserve 256 kB for Mon */
-#define CFG_MALLOC_LEN         (128 * 1024)    /* Reserved for malloc */
+#define CFG_MALLOC_LEN         (1024 * 1024)    /* Reserved for malloc */
 
 /* Serial Port */
 #define CONFIG_CONS_INDEX     1
 #define CFG_PCI1_MEM_BASE      0x80000000
 #define CFG_PCI1_MEM_PHYS      CFG_PCI1_MEM_BASE
 #define CFG_PCI1_MEM_SIZE      0x20000000      /* 512M */
-#define CFG_PCI1_IO_BASE       0xe2000000
-#define CFG_PCI1_IO_PHYS       CFG_PCI1_IO_BASE
-#define CFG_PCI1_IO_SIZE       0x1000000       /* 16M */
+#define CFG_PCI1_IO_BASE       0x00000000
+#define CFG_PCI1_IO_PHYS       0xe2000000
+#define CFG_PCI1_IO_SIZE       0x00100000      /* 1M */
 
 /* PCI view of System Memory */
 #define CFG_PCI_MEMORY_BUS      0x00000000
 
 #define CFG_PCI2_MEM_BASE      0xa0000000
 #define CFG_PCI2_MEM_PHYS      CFG_PCI2_MEM_BASE
-#define CFG_PCI2_MEM_SIZE      0x10000000      /* 256M */
-#define CFG_PCI2_IO_BASE       0xe3000000
-#define CFG_PCI2_IO_PHYS       CFG_PCI2_IO_BASE
-#define CFG_PCI2_IO_SIZE       0x1000000       /* 16M */
+#define CFG_PCI2_MEM_SIZE      0x20000000      /* 512M */
+#define CFG_PCI2_IO_BASE       0x00000000
+#define CFG_PCI2_IO_PHYS       0xe3000000
+#define CFG_PCI2_IO_SIZE       0x00100000      /* 1M */
 
 #if defined(CONFIG_PCI)
 
     #define PCI_IDSEL_NUMBER   0x0c    /* slot0->3(IDSEL)=12->15 */
 #endif
 
+/*PCIE video card used*/
+#define VIDEO_IO_OFFSET                CFG_PCI2_IO_PHYS
+
+/*PCI video card used*/
+/*#define VIDEO_IO_OFFSET      CFG_PCI1_IO_PHYS*/
+
+/* video */
+#define CONFIG_VIDEO
+
+#if defined(CONFIG_VIDEO)
+#define CONFIG_BIOSEMU
+#define CONFIG_CFB_CONSOLE
+#define CONFIG_VIDEO_SW_CURSOR
+#define CONFIG_VGA_AS_SINGLE_DEVICE
+#define CONFIG_ATI_RADEON_FB
+#define CONFIG_VIDEO_LOGO
+/*#define CONFIG_CONSOLE_CURSOR*/
+#define CFG_ISA_IO_BASE_ADDRESS CFG_PCI2_IO_PHYS
+#endif
+
 #undef CONFIG_PCI_SCAN_SHOW            /* show pci devices on startup */
 
 #define CONFIG_DOS_PARTITION
 #define CFG_SCSI_MAXDEVICE     CFG_SCSI_MAX_DEVICE
 #endif
 
+#define CONFIG_MPC86XX_PCI2
+
 #endif /* CONFIG_PCI */
 
 #if defined(CONFIG_TSEC_ENET)
  * 0xa000_0000  512M   PCI-Express 2 Memory
  *     Changed it for operating from 0xd0000000
  */
-#define CFG_DBAT1L      ( CFG_PCI1_MEM_BASE | BATL_PP_RW \
+#define CFG_DBAT1L      ( CFG_PCI1_MEM_PHYS | BATL_PP_RW \
                        | BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
-#define CFG_DBAT1U      (CFG_PCI1_MEM_BASE | BATU_BL_256M | BATU_VS | BATU_VP)
-#define CFG_IBAT1L      (CFG_PCI1_MEM_BASE | BATL_PP_RW | BATL_CACHEINHIBIT)
+#define CFG_DBAT1U     (CFG_PCI1_MEM_PHYS | BATU_BL_1G | BATU_VS | BATU_VP)
+#define CFG_IBAT1L     (CFG_PCI1_MEM_PHYS | BATL_PP_RW | BATL_CACHEINHIBIT)
 #define CFG_IBAT1U      CFG_DBAT1U
 
 /*
  * BAT2         512M   Cache-inhibited, guarded
  * 0xc000_0000  512M   RapidIO Memory
  */
-#define CFG_DBAT2L      (CFG_RIO_MEM_BASE | BATL_PP_RW \
+#define CFG_DBAT2L      (CFG_RIO_MEM_PHYS | BATL_PP_RW \
                        | BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
-#define CFG_DBAT2U      (CFG_RIO_MEM_BASE | BATU_BL_512M | BATU_VS | BATU_VP)
-#define CFG_IBAT2L      (CFG_RIO_MEM_BASE | BATL_PP_RW | BATL_CACHEINHIBIT)
+#define CFG_DBAT2U     (CFG_RIO_MEM_PHYS | BATU_BL_512M | BATU_VS | BATU_VP)
+#define CFG_IBAT2L     (CFG_RIO_MEM_PHYS | BATL_PP_RW | BATL_CACHEINHIBIT)
 #define CFG_IBAT2U      CFG_DBAT2U
 
 /*
  * 0xe300_0000  16M    PCI-Express 2 I/0
  *    Note that this is at 0xe0000000
  */
-#define CFG_DBAT4L      ( CFG_PCI1_IO_BASE | BATL_PP_RW \
+#define CFG_DBAT4L      ( CFG_PCI1_IO_PHYS | BATL_PP_RW \
                        | BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
-#define CFG_DBAT4U      (CFG_PCI1_IO_BASE | BATU_BL_32M | BATU_VS | BATU_VP)
-#define CFG_IBAT4L      (CFG_PCI1_IO_BASE | BATL_PP_RW | BATL_CACHEINHIBIT)
+#define CFG_DBAT4U     (CFG_PCI1_IO_PHYS | BATU_BL_32M | BATU_VS | BATU_VP)
+#define CFG_IBAT4L     (CFG_PCI1_IO_PHYS | BATL_PP_RW | BATL_CACHEINHIBIT)
 #define CFG_IBAT4U      CFG_DBAT4U
 
 /*
  */
 #ifndef CFG_RAMBOOT
     #define CFG_ENV_IS_IN_FLASH        1
-    #define CFG_ENV_ADDR               (CFG_MONITOR_BASE + 0x40000)
-    #define CFG_ENV_SECT_SIZE          0x40000 /* 256K(one sector) for env */
+    #define CFG_ENV_ADDR               (CFG_MONITOR_BASE + 0x60000)
+    #define CFG_ENV_SECT_SIZE          0x10000 /* 64K(one sector) for env */
     #define CFG_ENV_SIZE               0x2000
 #else
     #define CFG_ENV_IS_NOWHERE 1       /* Store ENV in memory only */
 #define CONFIG_LOADS_ECHO      1       /* echo on for serial download */
 #define CFG_LOADS_BAUD_CHANGE  1       /* allow baudrate change */
 
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_I2C
+
 #if defined(CFG_RAMBOOT)
-  #if defined(CONFIG_PCI)
-    #define  CONFIG_COMMANDS   ((CONFIG_CMD_DFL        \
-                                | CFG_CMD_PING         \
-                                | CFG_CMD_PCI          \
-                                | CFG_CMD_I2C          \
-                                | CFG_CMD_SCSI         \
-                                | CFG_CMD_EXT2)        \
-                               &                       \
-                                ~(CFG_CMD_ENV))
-  #else
-    #define  CONFIG_COMMANDS   ((CONFIG_CMD_DFL        \
-                                | CFG_CMD_PING         \
-                                | CFG_CMD_I2C)         \
-                               &                       \
-                                ~(CFG_CMD_ENV))
-  #endif
-#else
-  #if defined(CONFIG_PCI)
-    #define  CONFIG_COMMANDS   (CONFIG_CMD_DFL         \
-                               | CFG_CMD_PCI           \
-                               | CFG_CMD_PING          \
-                               | CFG_CMD_I2C           \
-                               | CFG_CMD_SCSI          \
-                               | CFG_CMD_EXT2)
-  #else
-    #define  CONFIG_COMMANDS   (CONFIG_CMD_DFL         \
-                               | CFG_CMD_PING          \
-                               | CFG_CMD_I2C)
-  #endif
+    #undef CONFIG_CMD_ENV
+#endif
+
+#if defined(CONFIG_PCI)
+    #define CONFIG_CMD_PCI
+    #define CONFIG_CMD_SCSI
+    #define CONFIG_CMD_EXT2
 #endif
 
-#include <cmd_confdefs.h>
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled */
 
 #define CFG_LOAD_ADDR  0x2000000       /* default load address */
 #define CFG_PROMPT     "=> "           /* Monitor Command Prompt */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
     #define CFG_CBSIZE 1024            /* Console I/O Buffer Size */
 #else
     #define CFG_CBSIZE 256             /* Console I/O Buffer Size */
 /* Cache Configuration */
 #define CFG_DCACHE_SIZE                32768
 #define CFG_CACHELINE_SIZE     32
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
-#define CFG_CACHELINE_SHIFT    5       /*log base 2 of the above value*/
+#if defined(CONFIG_CMD_KGDB)
+    #define CFG_CACHELINE_SHIFT        5       /*log base 2 of the above value*/
 #endif
 
 /*
 #define BOOTFLAG_COLD  0x01            /* Normal Power-On: Boot from FLASH */
 #define BOOTFLAG_WARM  0x02            /* Software reboot */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
-#define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
-#define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
+#if defined(CONFIG_CMD_KGDB)
+    #define CONFIG_KGDB_BAUDRATE       230400  /* speed to run kgdb serial port */
+    #define CONFIG_KGDB_SER_INDEX      2       /* which serial port to use */
 #endif
 
 /*
index da52e0ec0b82399b6cf6fa03b4b4dea178dfc485..f8cf01e5d3eb13bc3f1b42fd5193461afca66415 100644 (file)
 
 #define CONFIG_BOOTDELAY       5
 
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL)
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any)      */
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
 
-#include <cmd_confdefs.h>
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
 
 
 /*
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     32
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value        */
 #endif
 
index 88eefa190749693ba2be2bd922bf8168f185c61c..0defafec260027673ce426325f4f1868665d16c6 100644 (file)
 #define CONFIG_ZERO_BOOTDELAY_CHECK
 #define CONFIG_RESET_TO_RETRY          60
 
-#define CONFIG_COMMANDS                ( CFG_CMD_ASKENV | CFG_CMD_BOOTD | CFG_CMD_CACHE | CFG_CMD_DHCP | \
-                                 CFG_CMD_ECHO   | CFG_CMD_ENV   | CFG_CMD_FLASH | CFG_CMD_IMI  | \
-                                 CFG_CMD_IRQ    | CFG_CMD_NET   | CFG_CMD_PCI   | CFG_CMD_RUN   )
 
+/*
+ * Command line configuration.
+ */
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_BOOTD
+#define CONFIG_CMD_CACHE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_ECHO
+#define CONFIG_CMD_ENV
+#define CONFIG_CMD_FLASH
+#define CONFIG_CMD_IMI
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_RUN
 
-#define CONFIG_BOOTP_MASK   ( 0xffffffff )
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any)      */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_NISDOMAIN
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_DNS
+#define CONFIG_BOOTP_DNS2
+#define CONFIG_BOOTP_SEND_HOSTNAME
+#define CONFIG_BOOTP_NTPSERVER
+#define CONFIG_BOOTP_TIMEOFFSET
+
 
 /*
  * Miscellaneous configurable options
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     32
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value        */
 #endif
 
index 5995918266d0d7fee30a42e3e32c234e89c4b3ec..75efd1e0e421c18c5f814daf0166a1c4422a6558 100644 (file)
 
 #undef  CONFIG_CAN_DRIVER       /* CAN Driver support disabled  */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_VENDOREX )
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_VENDOREX
 
 #undef CONFIG_MAC_PARTITION
 #undef CONFIG_DOS_PARTITION
 
 #define        CONFIG_RTC_MPC8xx               /* use internal RTC of MPC8xx   */
 
-/* MVsensor uses a really minimal U-Boot ! */
-#define CONFIG_COMMANDS               (CFG_CMD_LOADS   | \
-                               CFG_CMD_LOADB   | \
-                               CFG_CMD_IMI     | \
-                               CFG_CMD_FLASH   | \
-                               CFG_CMD_MEMORY  | \
-                               CFG_CMD_NET     | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_ENV     | \
-                               CFG_CMD_BOOTD   | \
-                               CFG_CMD_RUN     )
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+
+/*
+ * Command line configuration.
+ */
+#define CONFIG_CMD_LOADS
+#define CONFIG_CMD_LOADB
+#define CONFIG_CMD_IMI
+#define CONFIG_CMD_FLASH
+#define CONFIG_CMD_MEMORY
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_ENV
+#define CONFIG_CMD_BOOTD
+#define CONFIG_CMD_RUN
+
 
 /*
  * Miscellaneous configurable options
 #define CFG_PROMPT_HUSH_PS2     "> "
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index a12c8da13eccfde105145355259467446aabf199..c051a351e85b1b2579041866e5c5d534a9b2962b 100644 (file)
 
 #undef CONFIG_STATUS_LED               /* Status LED disabled          */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
 
 #define        CONFIG_FEC_ENET         1       /* use FEC ethernet  */
 #define FEC_ENET
 #define CONFIG_RTC_PCF8563
 #define CFG_I2C_RTC_ADDR               0x51
 
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_NAND    | \
-                               CFG_CMD_JFFS2   | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_SNTP    )
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_NAND
+#define CONFIG_CMD_JFFS2
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_SNTP
+
 
 /*
  * Miscellaneous configurable options
  */
 #define        CFG_LONGHELP                    /* undef to save memory         */
 #define        CFG_PROMPT      "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index 444f721cc85a847bfdf704002a49ebae75043b80..bb3d19d14cadd15fb31fae92269c29c138d0903f 100644 (file)
 #define        CONFIG_STATUS_LED       1       /* Status LED enabled           */
 #define CONFIG_BOARD_SPECIFIC_LED      /* version has board specific leds */
 
-#define CONFIG_BOOTP_MASK              (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE | CONFIG_BOOTP_NISDOMAIN)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_NISDOMAIN
 
 #undef CONFIG_MAC_PARTITION
 #undef CONFIG_DOS_PARTITION
 
 #define CONFIG_ENV_OVERWRITE   1       /* allow modification of vendor params */
 
-#define CONFIG_COMMANDS       ( CONFIG_CMD_DFL | \
-                               CFG_CMD_NAND    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_CDP       \
-                               )
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_NAND
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_CDP
+
 
 #define CONFIG_BOARD_EARLY_INIT_F      1
 #define CONFIG_MISC_INIT_R
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-
 /*
  * Miscellaneous configurable options
  */
 #define CFG_HUSH_PARSER        1
 #define CFG_PROMPT_HUSH_PS2    "> "
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index 25b63457c74d814d4b22a0ed0489a2752d92f8a5..19743c04e87d12106d1da82c073bba41cce0b6fb 100644 (file)
 
 #undef CONFIG_CAN_DRIVER               /* CAN Driver support disabled  */
 
-#define CONFIG_BOOTP_MASK              (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE | CONFIG_BOOTP_NISDOMAIN)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_NISDOMAIN
+
 
 #undef CONFIG_MAC_PARTITION
 #undef CONFIG_DOS_PARTITION
                                 CFG_POST_CODEC    | \
                                 CFG_POST_DSP      )
 
-#define CONFIG_COMMANDS       ( CONFIG_CMD_DFL | \
-                               CFG_CMD_CDP     | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_DIAG    | \
-                               CFG_CMD_FAT     | \
-                               CFG_CMD_IDE     | \
-                               CFG_CMD_JFFS2   | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_NAND    | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_PCMCIA  | \
-                               CFG_CMD_PING    | \
-                               0)
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_CDP
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_DIAG
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_JFFS2
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_NAND
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_PCMCIA
+#define CONFIG_CMD_PING
+
 
 #define CONFIG_BOARD_EARLY_INIT_F      1
 #define CONFIG_MISC_INIT_R
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-
 /*
  * Miscellaneous configurable options
  */
 #define CFG_HUSH_PARSER        1
 #define CFG_PROMPT_HUSH_PS2    "> "
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index e20e72495ccbc8dce1602f8817690d9ae9684601..fb8085d56c7d6d7dcada520d59260b65322204e8 100644 (file)
 #define        CONFIG_STATUS_LED       1       /* Status LED enabled           */
 #define CONFIG_BOARD_SPECIFIC_LED      /* version has board specific leds */
 
-#define CONFIG_BOOTP_MASK              (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE | CONFIG_BOOTP_NISDOMAIN)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_NISDOMAIN
+
 
 #undef CONFIG_MAC_PARTITION
 #undef CONFIG_DOS_PARTITION
 
 #define CONFIG_ENV_OVERWRITE   1       /* allow modification of vendor params */
 
-#define CONFIG_COMMANDS       ( CONFIG_CMD_DFL | \
-                               CFG_CMD_NAND    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_CDP       \
-                               )
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_NAND
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_CDP
+
 
 #define CONFIG_BOARD_EARLY_INIT_F      1
 #define CONFIG_MISC_INIT_R
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-
 /*
  * Miscellaneous configurable options
  */
 #define CFG_HUSH_PARSER        1
 #define CFG_PROMPT_HUSH_PS2    "> "
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index e30be0987aa47619863424afe90229304ad54c25..d4cb9e7ea9e63c941ecc7c2e5c1876dce3a0bf10 100644 (file)
 
 #undef CONFIG_CAN_DRIVER               /* CAN Driver support disabled  */
 
-#define CONFIG_BOOTP_MASK              (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE | CONFIG_BOOTP_NISDOMAIN)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_NISDOMAIN
+
 
 #undef CONFIG_MAC_PARTITION
 #undef CONFIG_DOS_PARTITION
 
 #define        CONFIG_RTC_MPC8xx               /* use internal RTC of MPC8xx   */
 
-#define CONFIG_COMMANDS_BASE  ( CONFIG_CMD_DFL | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_PING )
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_PING
 
 #if defined(CONFIG_NETVIA_VERSION) && CONFIG_NETVIA_VERSION >= 2
-#define CONFIG_COMMANDS                (CONFIG_COMMANDS_BASE | CFG_CMD_NAND)
-#else
-#define CONFIG_COMMANDS                CONFIG_COMMANDS_BASE
+#define CONFIG_CMD_NAND
 #endif
 
+
 #define CONFIG_BOARD_EARLY_INIT_F 1
 #define CONFIG_MISC_INIT_R
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-
 /*
  * Miscellaneous configurable options
  */
 #define        CFG_LONGHELP                    /* undef to save memory         */
 #define        CFG_PROMPT      "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index d994420096b1f8d4573b8da099d0b4ed5736c094..4cd447206117b3a29fc92a687f6fe8f70a0270ce 100644 (file)
 
 #undef CONFIG_CAN_DRIVER               /* CAN Driver support disabled  */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
 
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 
 #define        CONFIG_ISP1362_USB              /* ISP1362 USB OTG controller   */
 
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_IDE     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_SNTP    )
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_SNTP
+
 
 /*
  * Miscellaneous configurable options
 #define        CFG_PROMPT_HUSH_PS2     "> "
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE              1024    /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE              256     /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index 1cb8b8ff3b599692ded83c2ed990aabcf397a812..524aa0621b945862f8bbe703cffe7f3419d75f84 100644 (file)
 #define CONFIG_LOADS_ECHO      1       /* echo on for serial download  */
 #undef CFG_LOADS_BAUD_CHANGE           /* don't allow baudrate change  */
 #undef CONFIG_WATCHDOG                 /* watchdog disabled, for now       */
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL | CFG_CMD_AUTOSCRIPT)
 #define CONFIG_AUTOSCRIPT
 
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_AUTOSCRIPT
+
+
 /* call various generic functions */
 #define CONFIG_MISC_INIT_R
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-
 /*
  * Miscellaneous configurable options
  */
 #define CFG_LONGHELP                   /* undef to save memory     */
 #define CFG_PROMPT             "=> "   /* Monitor Command Prompt   */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024    /* Console I/O Buffer Size  */
 #else
 #define CFG_CBSIZE             256     /* Console I/O Buffer Size  */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs          */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value    */
 #endif
 
index aa9d1ba735a028d73b9adbe9ca41f62f4e212d25..5840ea25f4bf42aebc0f659030f3cc9db43a396a 100644 (file)
 #define CONFIG_PHY_ADDR                0       /* PHY address                  */
 #define CONFIG_LXT971_NO_SLEEP  1       /* disable sleep mode in LXT971 */
 
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_BSP     | \
-                               CFG_CMD_EEPROM  )
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_BSP
+#define CONFIG_CMD_EEPROM
+
 
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
 #define CONFIG_SDRAM_BANK0     1       /* init onboard SDRAM bank 0    */
@@ -77,7 +89,7 @@
  */
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT     "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
  */
 #define CFG_DCACHE_SIZE                8192    /* For AMCC 405 CPUs                    */
 #define CFG_CACHELINE_SIZE     32      /* ...                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value        */
 #endif
 
index 2e7c505f99ea45fe019e5904c546eff40ae0b442..937df229f1609b29a83f292087b945f3eee4bd87 100644 (file)
 #define CONFIG_PHY_ADDR                0       /* PHY address                  */
 #define CONFIG_LXT971_NO_SLEEP  1       /* disable sleep mode in LXT971 */
 
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_BSP     | \
-                               CFG_CMD_EEPROM  )
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_BSP
+#define CONFIG_CMD_EEPROM
+
 
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
 #define CONFIG_SDRAM_BANK0     1       /* init onboard SDRAM bank 0    */
@@ -77,7 +89,7 @@
  */
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT     "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
  */
 #define CFG_DCACHE_SIZE                8192    /* For AMCC 405 CPUs                    */
 #define CFG_CACHELINE_SIZE     32      /* ...                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value        */
 #endif
 
index 787407c5eb85b64177a92cb8c905bb0b66e8233c..8d61bcd2d419eed84c495994982c03bea8cba9fc 100644 (file)
 #define CONFIG_BAUDRATE                9600
 #define CFG_BAUDRATE_TABLE     { 9600, 19200, 38400, 57600, 115200 }
 
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL | CFG_CMD_ELF)
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any)      */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ELF
+
 
 /*
  * Miscellaneous configurable options
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     32      /* For MPC8240 CPU                      */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
 #endif
 
index a933e1b180cf5c8decef3a1a2fe74e3da18c7ff3..ef970f1cd7e458a814a634f964bc6519737f846a 100644 (file)
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 #undef CONFIG_ALTIVEC                  /* undef to disable             */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | \
-                                CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
 
 #define        CONFIG_TIMESTAMP                /* Print image info with timestamp */
 
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_UNIVERSE| \
-                               CFG_CMD_BSP     )
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_UNIVERSE
+#define CONFIG_CMD_BSP
+
 
 /*
  * Miscellaneous configurable options
  */
 #define        CFG_LONGHELP                    /* undef to save memory         */
 #define        CFG_PROMPT      "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     32      /* For all MPC74xx CPUs          */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value */
 #endif
 
index d88fff33eade5db767a8d797e130609e9d075836..0de7591da660a7bee403d6fb0b303c9cb08f55fd 100644 (file)
 
 #define CONFIG_BAUDRATE                9600
 
-#define CONFIG_COMMANDS                (CFG_CMD_MEMORY | CFG_CMD_LOADB | CFG_CMD_REGINFO |             \
-                                CFG_CMD_FLASH | CFG_CMD_LOADS | CFG_CMD_ENV |  CFG_CMD_REGINFO |               \
-                                CFG_CMD_BDI | CFG_CMD_CONSOLE | CFG_CMD_RUN | CFG_CMD_BSP |    \
-                                CFG_CMD_IMI | CFG_CMD_EEPROM  | CFG_CMD_IRQ | CFG_CMD_MISC \
-)
 
-/* This must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#define CONFIG_CMD_MEMORY
+#define CONFIG_CMD_LOADB
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_FLASH
+#define CONFIG_CMD_LOADS
+#define CONFIG_CMD_ENV
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_BDI
+#define CONFIG_CMD_CONSOLE
+#define CONFIG_CMD_RUN
+#define CONFIG_CMD_BSP
+#define CONFIG_CMD_IMI
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_MISC
+
 
 #if 0
 #define CONFIG_BOOTDELAY       -1              /* autoboot disabled                    */
@@ -71,7 +92,7 @@
 
 #define        CFG_LONGHELP                            /* undef to save memory         */
 #define        CFG_PROMPT              "pati=> "               /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE              1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE              256             /* Console I/O Buffer Size      */
index 027dd22bf4676fd544b0372bd698b3ccbbed38e7..d6e7082f6a95e924e2932e37de414d2ce3c2b5f6 100644 (file)
 
 #define CONFIG_RTC_M48T35A     1               /* ST Electronics M48 timekeeper */
 
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_BSP     | \
-                               CFG_CMD_EEPROM  )
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_BSP
+#define CONFIG_CMD_EEPROM
+
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
 #define CFG_PROMPT_HUSH_PS2    "> "
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
  */
 #define CFG_DCACHE_SIZE                8192    /* For AMCC 405 CPUs                    */
 #define CFG_CACHELINE_SIZE     32      /* ...                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value        */
 #endif
 
index 3a7f7f06474e09165b15b9cadd732aeaff7ea732..24b25d985003089a0dafc9d55abc4efb4e570201 100644 (file)
 #define CFG_NIOS_TMRCNT        (CFG_NIOS_TMRMS * (CONFIG_SYS_CLK_FREQ/1000))
 #define        CFG_HZ          (CONFIG_SYS_CLK_FREQ/(CFG_NIOS_TMRCNT + 1))
 
-/*------------------------------------------------------------------------
- * COMMANDS
- *----------------------------------------------------------------------*/
-#define CONFIG_COMMANDS                (CFG_CMD_BDI    | \
-                                CFG_CMD_ECHO   | \
-                                CFG_CMD_ENV    | \
-                                CFG_CMD_FLASH  | \
-                                CFG_CMD_IMI    | \
-                                CFG_CMD_IRQ    | \
-                                CFG_CMD_LOADS  | \
-                                CFG_CMD_LOADB  | \
-                                CFG_CMD_MEMORY | \
-                                CFG_CMD_MISC   | \
-                                CFG_CMD_RUN    | \
-                                CFG_CMD_SAVES  )
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#define CONFIG_CMD_BDI
+#define CONFIG_CMD_ECHO
+#define CONFIG_CMD_ENV
+#define CONFIG_CMD_FLASH
+#define CONFIG_CMD_IMI
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_LOADS
+#define CONFIG_CMD_LOADB
+#define CONFIG_CMD_MEMORY
+#define CONFIG_CMD_MISC
+#define CONFIG_CMD_RUN
+#define CONFIG_CMD_SAVES
+
 
 /*------------------------------------------------------------------------
  * MISC
index 3a97fbcbde84056918ad52d625c72fe2a966b2a5..268b0343a360fb32efe4245df215af87c66b2966 100644 (file)
 #define CONFIG_PREBOOT         ""
 #define CONFIG_BOOTDELAY       5
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | \
-                                CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
 
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_BSP     | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_DOC     | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_SNTP    )
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_BSP
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_DOC
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_SNTP
 
 #define CONFIG_PCI             1
 #define CONFIG_PCI_PNP         1       /* PCI plug-and-play */
 
-/* This must be included AFTER the definition of CONFIG_COMMANDS (if any)
- */
-#include <cmd_confdefs.h>
-
 #define CFG_NAND_LEGACY
 
 /*
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     32
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value        */
 #endif
 
index 130beb78e637682ed35a69ba5dcd9150e9fcf779..250b58604815e630f011d42ac7b155a77ccd23c9 100644 (file)
 #define CONFIG_PREBOOT         ""
 #define CONFIG_BOOTDELAY       5
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | \
-                                CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
 
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 
-#define CONFIG_COMMANDS        (CONFIG_CMD_DFL | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_BSP     | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_DOC     | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_SCSI    | \
-                               CFG_CMD_SNTP    )
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_BSP
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_DOC
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_SCSI
+#define CONFIG_CMD_SNTP
 
 
 #define CONFIG_PCI             1
 #define CONFIG_PCI_PNP         1       /* PCI plug-and-play */
 
-/* This must be included AFTER the definition of CONFIG_COMMANDS (if any)
- */
-#include <cmd_confdefs.h>
-
 #define CFG_NAND_LEGACY
 
 /*
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     32
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value        */
 #endif
 
index 806e95f48083d2c943652fbf87309d5f09de0726..efa015746e164cc8a6fe788e6d07f735106857ae 100644 (file)
  ***********************************************************/
 #define CONFIG_SYS_CLK_FREQ    33000000 /* external frequency to pll   */
 
-/***********************************************************
- * Command definitions
- ***********************************************************/
-#define CONFIG_COMMANDS                \
-                      (CONFIG_CMD_DFL  | \
-                       CFG_CMD_IDE     | \
-                       CFG_CMD_DHCP    | \
-                       CFG_CMD_PCI     | \
-                       CFG_CMD_CACHE   | \
-                       CFG_CMD_IRQ     | \
-                       CFG_CMD_EEPROM  | \
-                       CFG_CMD_I2C     | \
-                       CFG_CMD_REGINFO | \
-                       CFG_CMD_FDC     | \
-                       CFG_CMD_SCSI    | \
-                       CFG_CMD_FAT     | \
-                       CFG_CMD_DATE    | \
-                       CFG_CMD_ELF     | \
-                       CFG_CMD_USB     | \
-                       CFG_CMD_MII     | \
-                       CFG_CMD_SDRAM   | \
-                       CFG_CMD_DOC     | \
-                       CFG_CMD_PING    | \
-                       CFG_CMD_SAVES   | \
-                       CFG_CMD_BSP     )
-/* this must be included AFTER the definition of CONFIG_COMMANDS  (if any) */
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_CACHE
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_FDC
+#define CONFIG_CMD_SCSI
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_USB
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_SDRAM
+#define CONFIG_CMD_DOC
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_SAVES
+#define CONFIG_CMD_BSP
+
 
 #define CFG_NAND_LEGACY
 
  **********************************************************/
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT     "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
  */
 #define CFG_DCACHE_SIZE                8192    /* For AMCC 405 CPUs                    */
 #define CFG_CACHELINE_SIZE     32      /* ...                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value        */
 #endif
 
 /************************************************************
  * Debug support
  ************************************************************/
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
index 83a7ec27b4365cd4e6b7f2f9776eb9eed85fbfe1..d90351add35c80d15ed73e2a72f17579653dfda2 100644 (file)
 #define CONFIG_IPADDR          192.168.2.21
 #define CONFIG_SERVERIP                192.168.2.16
 
-/*------------------------------------------------------------------------
- * COMMANDS
- *----------------------------------------------------------------------*/
-#define CONFIG_COMMANDS                (CFG_CMD_BDI    | \
-                                CFG_CMD_DHCP   | \
-                                CFG_CMD_ECHO   | \
-                                CFG_CMD_ENV    | \
-                                CFG_CMD_FLASH  | \
-                                CFG_CMD_IMI    | \
-                                CFG_CMD_IRQ    | \
-                                CFG_CMD_LOADS  | \
-                                CFG_CMD_LOADB  | \
-                                CFG_CMD_MEMORY | \
-                                CFG_CMD_MISC   | \
-                                CFG_CMD_NET    | \
-                                CFG_CMD_PING   | \
-                                CFG_CMD_RUN    | \
-                                CFG_CMD_SAVES  )
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+
+#define CONFIG_CMD_BDI
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_ECHO
+#define CONFIG_CMD_ENV
+#define CONFIG_CMD_FLASH
+#define CONFIG_CMD_IMI
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_LOADS
+#define CONFIG_CMD_LOADB
+#define CONFIG_CMD_MEMORY
+#define CONFIG_CMD_MISC
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_RUN
+#define CONFIG_CMD_SAVES
+
 
 /*------------------------------------------------------------------------
  * COMPACT FLASH
  *----------------------------------------------------------------------*/
-#if (CONFIG_COMMANDS & CFG_CMD_IDE)
+#if defined(CONFIG_CMD_IDE)
 #define CONFIG_IDE_PREINIT                     /* Implement id_preinit */
 #define CFG_IDE_MAXBUS         1               /* 1 IDE bus            */
 #define CFG_IDE_MAXDEVICE      1               /* 1 drive per IDE bus  */
 #define CFG_CF_POWER           0x00900890      /* CF Power FET PIO base*/
 #define CFG_CF_ATASEL          0x009008a0      /* CF ATASEL PIO base   */
 
-#endif /* CONFIG_COMMANDS & CFG_CMD_IDE */
+#endif
 
 /*------------------------------------------------------------------------
  * JFFS2
  *----------------------------------------------------------------------*/
-#if (CONFIG_COMMANDS & CFG_CMD_JFFS2)
+#if defined(CONFIG_CMD_JFFS2)
 #define CFG_JFFS_CUSTOM_PART                   /* board defined part   */
 #endif
 
index d02c39b28f96b4b88271f873b05a367fb5c6857c..54703731af7467fe673ca1f3e87fa1dcca138f70 100644 (file)
 
 #define CONFIG_PHY_CLK_FREQ    EMAC_STACR_CLK_66MHZ /* 66 MHz OPB clock*/
 
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_IDE     | \
-                               CFG_CMD_FAT     | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_NAND    | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_EEPROM  )
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_NAND
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_EEPROM
+
 
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
@@ -83,9 +98,6 @@
 #define CONFIG_AUTO_UPDATE      1       /* autoupdate via compactflash  */
 #define CONFIG_AUTO_UPDATE_SHOW 1       /* use board show routine       */
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
 #define CONFIG_RTC_MC146818            /* DS1685 is MC146818 compatible*/
 #define CFG_PROMPT_HUSH_PS2    "> "
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
 #define CFG_DCACHE_SIZE                16384   /* For AMCC 405 CPUs, older 405 ppc's   */
                                        /* have only 8kB, 16kB is save here     */
 #define CFG_CACHELINE_SIZE     32      /* ...                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value        */
 #endif
 
index 7d91a0160c4de04d0b10d580c70689f6a42a397e..5ba8f4a4e2aa40d84d31d2303461bb328887ee4a 100644 (file)
 #define BOOTFLAG_COLD          0x01    /* Normal Power-On: Boot from FLASH  */
 #define BOOTFLAG_WARM          0x02    /* Software reboot           */
 
-#define CFG_CACHELINE_SIZE     32      /* For MPC5xxx CPUs */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
-#  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
-#endif
-
 /*
  * Serial console configuration
  */
 #define CFG_RX_ETH_BUFFER      8  /* use 8 rx buffer on eepro100  */
 #undef  CONFIG_NS8382X
 
-#define ADD_PCI_CMD            CFG_CMD_PCI
-
-#else  /* MPC5100 */
-
-#define ADD_PCI_CMD            0  /* no CFG_CMD_PCI */
-
 #endif
 
 /* Partitions */
 /* USB */
 #if 1
 #define CONFIG_USB_OHCI
-#define ADD_USB_CMD             CFG_CMD_USB | CFG_CMD_FAT
 #define CONFIG_USB_STORAGE
-#else
-#define ADD_USB_CMD             0
 #endif
 
-#if defined(CONFIG_BOOT_ROM)
-#define ADD_DOC_CMD             0
-#else
-#define ADD_DOC_CMD             CFG_CMD_DOC
+#if !defined(CONFIG_BOOT_ROM)
 /* DoC requires legacy NAND for now */
 #define CFG_NAND_LEGACY
 #endif
 
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
 /*
- * Supported commands
+ * Command line configuration.
  */
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               ADD_DOC_CMD     | \
-                               ADD_PCI_CMD     | \
-                               ADD_USB_CMD     | \
-                               CFG_CMD_BEDBUG  | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_FAT     | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_IDE     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_SNTP    )
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_BEDBUG
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_SNTP
+#define CONFIG_CMD_USB
+
+#if !defined(CONFIG_BOOT_ROM)
+#define CONFIG_CMD_DOC
+#endif
+
+#if defined(CONFIG_MPC5200)
+#define CONFIG_CMD_PCI
+#endif
+
 
 /*
  * Autobooting
  */
 #define CFG_LONGHELP                   /* undef to save memory     */
 #define CFG_PROMPT             "=> "   /* Monitor Command Prompt   */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024    /* Console I/O Buffer Size  */
 #else
 #define CFG_CBSIZE             256     /* Console I/O Buffer Size  */
 
 #define CFG_HZ                 1000    /* decrementer freq: 1 ms ticks */
 
+#define CFG_CACHELINE_SIZE     32      /* For MPC5xxx CPUs */
+#if defined(CONFIG_CMD_KGDB)
+#  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
+#endif
+
 /*
  * Various low-level settings
  */
index 88fdb51adef553924a89c326cd81454170ab6c8b..c80b15388078f1509a99b830a0913f2b36235eec 100644 (file)
  *   - CONFIG_NET_MULTI must be defined
  *
  * if CONFIG_ETHER_NONE is defined, then either the ethernet routines must be
- * defined elsewhere (as for the console), or CFG_CMD_NET must be removed
- * from CONFIG_COMMANDS to remove support for networking.
+ * defined elsewhere (as for the console), or CONFIG_CMD_NET must be unset.
  */
 #define        CONFIG_NET_MULTI
 #undef CONFIG_ETHER_NONE               /* define if ether on something else */
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT|CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_BEDBUG
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_DOC
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_SNTP
 
 #ifdef CONFIG_PCI
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               CFG_CMD_BEDBUG  | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_DOC     | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_SNTP    )
-#else  /* ! PCI */
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               CFG_CMD_BEDBUG  | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_DOC     | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_SNTP    )
-#endif /* CONFIG_PCI */
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+#define CONFIG_CMD_PCI
+#endif
+
 
 #define CFG_NAND_LEGACY
 
  */
 #define        CFG_LONGHELP                    /* undef to save memory         */
 #define        CFG_PROMPT      "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE      32      /* For MPC8260 CPU              */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
 #endif
 
index 37ee9771b52fa5c3b57ef27c2d7b98a765734b64..8f5be5f63a5950f6524a61a6bbf39607d58b34b6 100644 (file)
  *   - CONFIG_NET_MULTI must be defined
  *
  * if CONFIG_ETHER_NONE is defined, then either the ethernet routines must be
- * defined elsewhere (as for the console), or CFG_CMD_NET must be removed
- * from CONFIG_COMMANDS to remove support for networking.
+ * defined elsewhere (as for the console), or CONFIG_CMD_NET must be unset.
  */
 #define CONFIG_NET_MULTI
 #undef CONFIG_ETHER_NONE               /* define if ether on something else */
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT|CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_BEDBUG
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_DOC
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_SNTP
 
 #ifdef CONFIG_PCI
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               CFG_CMD_BEDBUG  | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_DOC     | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_SNTP    )
-#else  /* ! PCI */
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               CFG_CMD_BEDBUG  | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_DOC     | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_SNTP    )
-#endif /* CONFIG_PCI */
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+#define CONFIG_CMD_PCI
+#endif
+
 
 /*
  * Disk-On-Chip configuration
  */
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT     "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     32      /* For MPC8260 CPU              */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
 #endif
 
index 8f130f5ccd834d05a490679c6cda83d59e024d6c..dbf94228ae658fb09cbe08f83f5014a0579fe209 100644 (file)
 #define CONFIG_LOADS_ECHO      1       /* echo on for serial download */
 #define CFG_LOADS_BAUD_CHANGE  1       /* allow baudrate change */
 
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_EEPROM
+
+#if defined(CONFIG_PCI)
+    #define CONFIG_CMD_PCI
+#endif
+
 #if defined(CFG_RAMBOOT)
-  #if defined(CONFIG_PCI)
-    #define  CONFIG_COMMANDS   ((CONFIG_CMD_DFL        \
-                                | CFG_CMD_PING         \
-                                | CFG_CMD_PCI          \
-                                | CFG_CMD_I2C)         \
-                               &                       \
-                                ~(CFG_CMD_ENV          \
-                                 | CFG_CMD_LOADS))
-  #else
-    #define  CONFIG_COMMANDS   ((CONFIG_CMD_DFL        \
-                                | CFG_CMD_PING         \
-                                | CFG_CMD_I2C)         \
-                               &                       \
-                                ~(CFG_CMD_ENV          \
-                                 | CFG_CMD_LOADS))
-  #endif
-#else
-  #if defined(CONFIG_PCI)
-    #define  CONFIG_COMMANDS   (CONFIG_CMD_DFL         \
-                               | CFG_CMD_EEPROM        \
-                               | CFG_CMD_DATE          \
-                               | CFG_CMD_MII           \
-                               | CFG_CMD_PCI           \
-                               | CFG_CMD_PING          \
-                               | CFG_CMD_I2C)
-  #else
-    #define  CONFIG_COMMANDS   (CONFIG_CMD_DFL         \
-                               | CFG_CMD_EEPROM        \
-                               | CFG_CMD_DATE          \
-                               | CFG_CMD_MII           \
-                               | CFG_CMD_PING          \
-                               | CFG_CMD_I2C)
-  #endif
+    #undef CONFIG_CMD_ENV
+    #undef CONFIG_CMD_LOADS
 #endif
 
-#include <cmd_confdefs.h>
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled */
 
 #define CFG_LOAD_ADDR  0x2000000       /* default load address */
 #define CFG_PROMPT     "=> "           /* Monitor Command Prompt */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
     #define CFG_CBSIZE 1024            /* Console I/O Buffer Size */
 #else
     #define CFG_CBSIZE 256             /* Console I/O Buffer Size */
 /* Cache Configuration */
 #define CFG_DCACHE_SIZE                32768
 #define CFG_CACHELINE_SIZE     32
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /*log base 2 of the above value*/
 #endif
 
 #define BOOTFLAG_COLD  0x01            /* Normal Power-On: Boot from FLASH */
 #define BOOTFLAG_WARM  0x02            /* Software reboot */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
index 0286b53e017cc0654af0bc552cf368d85b23b61f..6bdfa5d8f1ff175807e1c64c7697fd582e72726f 100644 (file)
 #define CONFIG_LOADS_ECHO      1       /* echo on for serial download */
 #define CFG_LOADS_BAUD_CHANGE  1       /* allow baudrate change */
 
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_EEPROM
+
+#if defined(CONFIG_PCI)
+    #define CONFIG_CMD_PCI
+#endif
+
 #if defined(CFG_RAMBOOT)
-  #if defined(CONFIG_PCI)
-    #define  CONFIG_COMMANDS   ((CONFIG_CMD_DFL        \
-                                | CFG_CMD_PING         \
-                                | CFG_CMD_PCI          \
-                                | CFG_CMD_I2C)         \
-                               &                       \
-                                ~(CFG_CMD_ENV          \
-                                 | CFG_CMD_LOADS))
-  #else
-    #define  CONFIG_COMMANDS   ((CONFIG_CMD_DFL        \
-                                | CFG_CMD_PING         \
-                                | CFG_CMD_I2C)         \
-                               &                       \
-                                ~(CFG_CMD_ENV          \
-                                 | CFG_CMD_LOADS))
-  #endif
-#else
-  #if defined(CONFIG_PCI)
-    #define  CONFIG_COMMANDS   (CONFIG_CMD_DFL         \
-                               | CFG_CMD_EEPROM        \
-                               | CFG_CMD_DATE          \
-                               | CFG_CMD_PCI           \
-                               | CFG_CMD_PING          \
-                               | CFG_CMD_I2C)
-  #else
-    #define  CONFIG_COMMANDS   (CONFIG_CMD_DFL         \
-                               | CFG_CMD_EEPROM        \
-                               | CFG_CMD_DATE          \
-                               | CFG_CMD_PING          \
-                               | CFG_CMD_I2C)
-  #endif
+    #undef CONFIG_CMD_ENV
+    #undef CONFIG_CMD_LOADS
 #endif
 
-#include <cmd_confdefs.h>
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled */
 
 #define CFG_LOAD_ADDR  0x1000000       /* default load address */
 #define CFG_PROMPT     "=> "           /* Monitor Command Prompt */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
     #define CFG_CBSIZE 1024            /* Console I/O Buffer Size */
 #else
     #define CFG_CBSIZE 256             /* Console I/O Buffer Size */
 /* Cache Configuration */
 #define CFG_DCACHE_SIZE                32768
 #define CFG_CACHELINE_SIZE     32
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /*log base 2 of the above value*/
 #endif
 
 #define BOOTFLAG_COLD  0x01            /* Normal Power-On: Boot from FLASH */
 #define BOOTFLAG_WARM  0x02            /* Software reboot */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
index 6e0bd7f23ec7408bba2bdc33801b4f442a46ccfd..b29f368f57c252aa1686718c90ec943002e69e8d 100644 (file)
 
 #define CONFIG_NETCONSOLE              /* include NetConsole support   */
 
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_BSP     | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_JFFS2   | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_UNIVERSE | \
-                               CFG_CMD_EEPROM  )
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_BSP
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_JFFS2
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_UNIVERSE
+#define CONFIG_CMD_EEPROM
+
 
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
 #define CONFIG_RTC_MC146818             /* DS1685 is MC146818 compatible*/
 #define CFG_PROMPT_HUSH_PS2    "> "
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
 #define CFG_DCACHE_SIZE                16384   /* For AMCC 405 CPUs, older 405 ppc's   */
                                        /* have only 8kB, 16kB is save here     */
 #define CFG_CACHELINE_SIZE     32      /* ...                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value        */
 #endif
 
index a717659bb695682418b75f2d030455ce23c9664a..72acf5ae8d57572f12bb6af6c9506ace4bab370d 100644 (file)
 #define CONFIG_CONS_INDEX      1
 
 
-#define REMOVE_COMMANDS         ( CFG_CMD_AUTOSCRIPT   | \
-                                 CFG_CMD_LOADS         | \
-                                 CFG_CMD_ENV           | \
-                                 CFG_CMD_FLASH         | \
-                                 CFG_CMD_IMLS          )
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_BSP
+
+#undef CONFIG_CMD_AUTOSCRIPT
+#undef CONFIG_CMD_LOADS
+#undef CONFIG_CMD_ENV
+#undef CONFIG_CMD_FLASH
+#undef CONFIG_CMD_IMLS
 
-#define CONFIG_COMMANDS                ( (CONFIG_CMD_DFL & ~REMOVE_COMMANDS) |\
-                                 CFG_CMD_PCI |\
-                                 CFG_CMD_BSP)
 
 #define CONFIG_BAUDRATE                19200   /* console baudrate             */
 
                        "loadp 200000; bootm"
 #endif
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any)      */
-#include <cmd_confdefs.h>
-
-
 /*
  * Miscellaneous configurable options
  */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     32      /* For MPC8240 CPU                      */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
 #endif
 
index 16e2cc6d648b08a667e67d938f5fd057defe9927..dd1decdcd9499d9fc5344e03f04e8514c5eea16d 100644 (file)
 #endif
 #define CONFIG_PHY_CLK_FREQ    EMAC_STACR_CLK_66MHZ
 
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_JFFS2   | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_NAND    | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_SNTP    )
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_JFFS2
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_NAND
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_SNTP
+
 
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
 #define CONFIG_RTC_M41T11      1       /* uses a M41T00 RTC            */
 #define CFG_PROMPT_HUSH_PS2    "> "
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
 #define CFG_DCACHE_SIZE                16384   /* For AMCC 405 CPUs, older 405 ppc's   */
                                        /* have only 8kB, 16kB is save here     */
 #define CFG_CACHELINE_SIZE     32      /* ...                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value        */
 #endif
 
index 235bc480c7fec6cd905944bfcffa8ca27f373311..3657feaf70350863edc9e4f1db83d0126a107fc4 100644 (file)
 #undef CONFIG_STATUS_LED               /* Status LED disabled */
 #undef CONFIG_CAN_DRIVER               /* CAN Driver support disabled */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
 
 #undef CONFIG_MAC_PARTITION
 #undef CONFIG_DOS_PARTITION
 
 #define CONFIG_RTC_MPC8xx      /* use internal RTC of MPC8xx */
 
-#define CONFIG_COMMANDS                (CFG_CMD_BDI    | \
-       CFG_CMD_BOOTD   | \
-       CFG_CMD_CONSOLE | \
-       CFG_CMD_DATE    | \
-       CFG_CMD_ENV     | \
-       CFG_CMD_FLASH   | \
-       CFG_CMD_IMI     | \
-       CFG_CMD_IMMAP   | \
-       CFG_CMD_MEMORY  | \
-       CFG_CMD_NET     | \
-       CFG_CMD_RUN)
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+
+/*
+ * Command line configuration.
+ */
+#define CONFIG_CMD_BDI
+#define CONFIG_CMD_BOOTD
+#define CONFIG_CMD_CONSOLE
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_ENV
+#define CONFIG_CMD_FLASH
+#define CONFIG_CMD_IMI
+#define CONFIG_CMD_IMMAP
+#define CONFIG_CMD_MEMORY
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_RUN
+
 
 /*-----------------------------------------------------------------------
  * Environment variable storage is in FLASH, one sector before U-boot
 #define CFG_HUSH_PARSER                1               /* use "hush" command parser */
 #define CFG_PROMPT_HUSH_PS2    "> "
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024            /* Console I/O Buffer Size */
 #else
 #define CFG_CBSIZE             256             /* Console I/O Buffer Size */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16              /* For all MPC8xx CPUs */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4               /* log base 2 of the above value */
 #endif
 
index 967582b45ed5bf8d4e4e558641b9d4ac61de513d..3db539fa90ab77c726e8ea8434901bd9be3466d4 100644 (file)
 #undef CONFIG_STATUS_LED               /* Status LED disabled */
 #undef CONFIG_CAN_DRIVER               /* CAN Driver support disabled */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
 
 #undef CONFIG_MAC_PARTITION
 #undef CONFIG_DOS_PARTITION
 
 #define CONFIG_RTC_MPC8xx      /* use internal RTC of MPC8xx */
 
-#define CONFIG_COMMANDS                (CFG_CMD_BDI    | \
-       CFG_CMD_BOOTD   | \
-       CFG_CMD_CONSOLE | \
-       CFG_CMD_DATE    | \
-       CFG_CMD_ENV     | \
-       CFG_CMD_FLASH   | \
-       CFG_CMD_IMI     | \
-       CFG_CMD_IMMAP   | \
-       CFG_CMD_MEMORY  | \
-       CFG_CMD_NET     | \
-       CFG_CMD_RUN)
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+
+/*
+ * Command line configuration.
+ */
+
+#define CONFIG_CMD_BDI
+#define CONFIG_CMD_BOOTD
+#define CONFIG_CMD_CONSOLE
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_ENV
+#define CONFIG_CMD_FLASH
+#define CONFIG_CMD_IMI
+#define CONFIG_CMD_IMMAP
+#define CONFIG_CMD_MEMORY
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_RUN
+
 
 /*-----------------------------------------------------------------------
  * Environment variable storage is in FLASH, one sector before U-boot
 #define CFG_HUSH_PARSER                1               /* use "hush" command parser */
 #define CFG_PROMPT_HUSH_PS2    "> "
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024            /* Console I/O Buffer Size */
 #else
 #define CFG_CBSIZE             256             /* Console I/O Buffer Size */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16              /* For all MPC8xx CPUs */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4               /* log base 2 of the above value */
 #endif
 
index 32faa61607bca133eab2461ec01e52961414c461..b3442de3627596564c9e8338c519635d430f6f9e 100644 (file)
 
 #undef CONFIG_CAN_DRIVER               /* CAN Driver support disabled */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
 
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 
 #define CONFIG_RTC_MPC8xx      /* use internal RTC of MPC8xx */
 
-#define CONFIG_COMMANDS                ( CONFIG_CMD_DFL | \
-       CFG_CMD_REGINFO | \
-       CFG_CMD_IMMAP   | \
-       CFG_CMD_ASKENV  | \
-       CFG_CMD_NET     | \
-       CFG_CMD_DHCP    | \
-       CFG_CMD_DATE    )
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_IMMAP
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_DATE
 
 
 /* TODO */
@@ -136,7 +146,7 @@ CONFIG_SPI
 #define CFG_HUSH_PARSER                1               /* use "hush" command parser */
 #define CFG_PROMPT_HUSH_PS2    "> "
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024            /* Console I/O Buffer Size */
 #else
 #define CFG_CBSIZE             256             /* Console I/O Buffer Size */
@@ -210,7 +220,7 @@ CONFIG_SPI
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16              /* For all MPC8xx CPUs */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4               /* log base 2 of the above value */
 #endif
 
index 82228c0126b5027a8b6ae7b3249b50827225f274..516ec643d6543f68c87e3fd23f4dc57017c99161 100644 (file)
 
 #define        CONFIG_CAN_DRIVER               /* CAN Driver support enabled   */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
 
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 #define CFG_I2C_KEY_ADDR       0x9     /* Keyboard coprocessor */
 #define CFG_I2C_TEM_ADDR       0x49    /* Temperature Sensors */
 
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_BMP     | \
-                               CFG_CMD_BSP     | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_IDE     | \
-                               CFG_CMD_JFFS2   | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_PCMCIA  | \
-                               CFG_CMD_SNTP    )
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_BMP
+#define CONFIG_CMD_BSP
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_JFFS2
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_PCMCIA
+#define CONFIG_CMD_SNTP
+
 
 /*
  * Miscellaneous configurable options
 
 #define        CFG_LONGHELP                    /* undef to save memory         */
 #define        CFG_PROMPT      "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index 242c837a3b86ab5be554761fa7cd130a18c9be8c..2f6de815514de24f5c89f3553c2b20321e72a45a 100644 (file)
 
 #undef CONFIG_CAN_DRIVER               /* CAN Driver support disabled  */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
 
 #undef CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 #define CFG_EEPROM_WRITE_BITS          4
 #define CFG_EEPROM_WRITE_DELAY_MS      10
 
-#define CONFIG_COMMANDS              ( CFG_CMD_ALL     & \
-                               ~CFG_CMD_BSP    & \
-                               ~CFG_CMD_DATE   & \
-                               ~CFG_CMD_DISPLAY& \
-                               ~CFG_CMD_DTT    & \
-                               ~CFG_CMD_EXT2   & \
-                               ~CFG_CMD_FDC    & \
-                               ~CFG_CMD_FDOS   & \
-                               ~CFG_CMD_HWFLOW & \
-                               ~CFG_CMD_IDE    & \
-                               ~CFG_CMD_IRQ    & \
-                               ~CFG_CMD_JFFS2  & \
-                               ~CFG_CMD_MII    & \
-                               ~CFG_CMD_MMC    & \
-                               ~CFG_CMD_NAND   & \
-                               ~CFG_CMD_PCI    & \
-                               ~CFG_CMD_PCMCIA & \
-                               ~CFG_CMD_REISER & \
-                               ~CFG_CMD_SCSI   & \
-                               ~CFG_CMD_SETGETDCR & \
-                               ~CFG_CMD_SNTP   & \
-                               ~CFG_CMD_SPI    & \
-                               ~CFG_CMD_UNIVERSE & \
-                               ~CFG_CMD_USB    & \
-                               ~CFG_CMD_VFD    & \
-                               ~CFG_CMD_XIMG   )
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_all.h>
+
+#undef CONFIG_CMD_BSP
+#undef CONFIG_CMD_DATE
+#undef CONFIG_CMD_DISPLAY
+#undef CONFIG_CMD_DTT
+#undef CONFIG_CMD_EXT2
+#undef CONFIG_CMD_FDC
+#undef CONFIG_CMD_FDOS
+#undef CONFIG_CMD_HWFLOW
+#undef CONFIG_CMD_IDE
+#undef CONFIG_CMD_IRQ
+#undef CONFIG_CMD_JFFS2
+#undef CONFIG_CMD_MII
+#undef CONFIG_CMD_MFSL
+#undef CONFIG_CMD_MMC
+#undef CONFIG_CMD_NAND
+#undef CONFIG_CMD_PCI
+#undef CONFIG_CMD_PCMCIA
+#undef CONFIG_CMD_REISER
+#undef CONFIG_CMD_SCSI
+#undef CONFIG_CMD_SETGETDCR
+#undef CONFIG_CMD_SNTP
+#undef CONFIG_CMD_SPI
+#undef CONFIG_CMD_UNIVERSE
+#undef CONFIG_CMD_USB
+#undef CONFIG_CMD_VFD
+#undef CONFIG_CMD_XIMG
+
 
 /*
  * Miscellaneous configurable options
  */
 #define        CFG_LONGHELP                    /* undef to save memory         */
 #define        CFG_PROMPT      "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index 591382cd24d8d3ba1597824156306bba885cf7b8..793b1db88943e163a801d9b3c5105c685f750070 100644 (file)
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
 
 #define        CONFIG_CLOCKS_IN_MHZ    1       /* clocks passsed to Linux in MHz */
 
 
-#define CONFIG_COMMANDS        ((CFG_CMD_ALL & ~CFG_CMD_NONSTD) | CFG_CMD_ELF)
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ELF
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
 
 /*
  * Miscellaneous configurable options
 #define CFG_RESET_ADDRESS      0x80000000
 #define        CFG_LONGHELP                    /* undef to save memory         */
 #define        CFG_PROMPT      "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
 #define        CFG_SDRAM_BASE          0x00000000
 #define CFG_FLASH_BASE 0xFF000000
 
-#if defined(DEBUG) || defined (CONFIG_VIDEO_SED13806) || (CONFIG_COMMANDS & CFG_CMD_IDE)
+#if defined(DEBUG) || defined (CONFIG_VIDEO_SED13806) || defined(CONFIG_CMD_IDE)
 #define        CFG_MONITOR_LEN         (256 << 10)     /* Reserve 256 kB for Monitor   */
 #else
 #define        CFG_MONITOR_LEN         (128 << 10)     /* Reserve 128 kB for Monitor   */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index 48ada0ed9b6f9afc8feeaf51796adaf669018eeb..3c5e6b89139c93179897873f0176790461eae1fa 100644 (file)
 #define CONFIG_BZIP2           /* Include support for bzip2 compressed images  */
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
 
 /*
  * Miscellaneous configurable options
  */
 #define        CFG_LONGHELP                    /* undef to save memory         */
 #define        CFG_PROMPT      "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index 31025473f43799793381a33a437f6b2a6316a35f..872765c92f40370b1724f9f17e412ec56050d8ea 100644 (file)
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 #undef CONFIG_STATUS_LED               /* disturbs display. Status LED disabled. */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
 
 #if 1         /* Enable this stuff could make image enlarge about 25KB. Mask it if you
                  don't want the advanced function */
 
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_JFFS2
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_DHCP
+
 #ifdef CONFIG_SPLASH_SCREEN
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_BMP     | \
-                               CFG_CMD_JFFS2   | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_REGINFO | \
-                               CFG_CMD_DHCP    )
-#else
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_JFFS2   | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_REGINFO | \
-                               CFG_CMD_DHCP    )
-#endif /* CONFIG_SPLASH_SCREEN */
+#define CONFIG_CMD_BMP
+#endif
+
 
 /* test-only */
 #define CFG_JFFS2_FIRST_BANK   0           /* use for JFFS2 */
 
 #endif /* 1 */
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-
 /*
  * Miscellaneous configurable options
  */
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT     "u-boot>"       /* Monitor Command Prompt   */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
 #define CFG_SDRAM_BASE         0x00000000
 #define CFG_FLASH_BASE         0xFF000000
 
-#if defined(DEBUG) || (CONFIG_COMMANDS & CFG_CMD_IDE)
+#if defined(DEBUG) || defined(CONFIG_CMD_IDE)
 #define CFG_MONITOR_LEN                (256 << 10)     /* Reserve 256 kB for Monitor   */
 #else
 #define CFG_MONITOR_LEN                (128 << 10)     /* Reserve 128 kB for Monitor */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index 45907aa0e79f562d05e820f80fcf967445875e55..dfadd2a11f06e8a4f1a21a4371f532f80d493e42 100644 (file)
@@ -91,8 +91,7 @@
  * for FCC)
  *
  * if CONFIG_ETHER_NONE is defined, then either the ethernet routines must be
- * defined elsewhere (as for the console), or CFG_CMD_NET must be removed
- * from CONFIG_COMMANDS to remove support for networking.
+ * defined elsewhere (as for the console), or CONFIG_CMD_NET must be unset.
  */
 #undef  CONFIG_ETHER_ON_SCC           /* define if ethernet on SCC    */
 #define CONFIG_ETHER_ON_FCC           /* define if ethernet on FCC    */
 /* Monitor Command Prompt       */
 #define CFG_PROMPT              "=> "
 
-/* What U-Boot subsytems do you want enabled? */
-#define CONFIG_COMMANDS         ( CONFIG_CMD_DFL | \
-                                 CFG_CMD_IMMAP  | \
-                                 CFG_CMD_ASKENV | \
-                                 CFG_CMD_I2C    | \
-                                 CFG_CMD_REGINFO & \
-                                ~CFG_CMD_KGDB )
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_IMMAP
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_REGINFO
+
+#undef CONFIG_CMD_KGDB
+
 
 /* Where do the internal registers live? */
 #define CFG_IMMR               0xF0000000
 
 #define CONFIG_BOARD_EARLY_INIT_F 1    /* Call board_early_init_f      */
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-
 /*
  * Miscellaneous configurable options
  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #  define CFG_CBSIZE              1024       /* Console I/O Buffer Size      */
 #else
 #  define CFG_CBSIZE              256        /* Console I/O Buffer Size      */
  */
 #define CFG_CACHELINE_SIZE      32      /* For MPC8260 CPU */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #  define CFG_CACHELINE_SHIFT     5     /* log base 2 of the above value */
 #endif
 
index 3885bcdb1ef56c3313ea6e316622bb1fed2660a1..1e6e8c0aa233039f87289072137383355c3c3a75 100644 (file)
 
 #undef CONFIG_CAN_DRIVER               /* CAN Driver support disabled  */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
 
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 #endif /* CONFIG_SOFT_I2C */
 
 
-#define CONFIG_COMMANDS            ( ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_IDE     | \
-                               CFG_CMD_DATE    ) & \
-                            ~( CFG_CMD_PCMCIA  | \
-                               CFG_CMD_IDE     ) )
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_DATE
+
+#undef CONFIG_CMD_PCMCIA
+#undef CONFIG_CMD_IDE
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
 
 /*
  * Miscellaneous configurable options
  */
 #define        CFG_LONGHELP                    /* undef to save memory         */
 #define        CFG_PROMPT      "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index dbc57e8b271cd9742ee979da0d82be72a81ecbad..d7652fa9ba5c867321d267760348f16b7ff5df1c 100644 (file)
@@ -62,8 +62,8 @@
  * SCC, 1-3 for FCC)
  *
  * If CONFIG_ETHER_NONE is defined, then either the ethernet routines
- * must be defined elsewhere (as for the console), or CFG_CMD_NET must
- * be removed from CONFIG_COMMANDS to remove support for networking.
+ * must be defined elsewhere (as for the console), or CONFIG_CMD_NET
+ * must be unset.
  */
 #undef CONFIG_ETHER_ON_SCC             /* Ethernet is not on SCC */
 #define CONFIG_ETHER_ON_FCC            /* Ethernet is on FCC     */
 
 #define CONFIG_BAUDRATE                38400
 
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL   \
-                               | CFG_CMD_DHCP    \
-                               | CFG_CMD_IMMAP   \
-                               | CFG_CMD_JFFS2   \
-                               | CFG_CMD_MII     \
-                               | CFG_CMD_PING    \
-                               )
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_IMMAP
+#define CONFIG_CMD_JFFS2
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_PING
+
 
 #define CONFIG_BOOTDELAY       5       /* autoboot after 5 seconds */
 #define CONFIG_BOOTCOMMAND     "bootm FE040000"        /* autoboot command */
 #define CONFIG_BOOTARGS                "root=/dev/mtdblock2 rw mtdparts=phys:1M(ROM)ro,-(root)"
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #undef CONFIG_KGDB_ON_SMC              /* define if kgdb on SMC */
 #define CONFIG_KGDB_ON_SCC             /* define if kgdb on SCC */
 #undef CONFIG_KGDB_NONE                /* define if kgdb on something else */
 #define CFG_PROMPT_HUSH_PS2    "> "
 #define CFG_LONGHELP                   /* undef to save memory     */
 #define CFG_PROMPT             "=> "   /* Monitor Command Prompt   */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024    /* Console I/O Buffer Size  */
 #else
 #define CFG_CBSIZE             256     /* Console I/O Buffer Size  */
 
 #define        CFG_DIRECT_FLASH_TFTP
 
-#if (CONFIG_COMMANDS & CFG_CMD_JFFS2)
+#if defined(CONFIG_CMD_JFFS2)
 #define CFG_JFFS2_NUM_BANKS    CFG_MAX_FLASH_BANKS
 #define CFG_JFFS2_SORT_FRAGMENTS
 
 #define MTDIDS_DEFAULT         "nor0=rattler-0"
 #define MTDPARTS_DEFAULT       "mtdparts=rattler-0:-@1m(jffs2)"
 */
-#endif /* CFG_CMD_JFFS2 */
+#endif /* CONFIG_CMD_JFFS2 */
 
 #define CFG_MONITOR_BASE       TEXT_BASE
 #if (CFG_MONITOR_BASE < CFG_FLASH_BASE)
 #define CFG_BOOTMAPSZ          (8 << 20)       /* Initial Memory map for Linux */
 
 #define CFG_CACHELINE_SIZE     32      /* For MPC8260 CPUs */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
 #endif
 
index f8e3397a3f069cd523ca3764b309b07218237974..f2c3699ab744a48fda1f5ea0c87e645fb79c4dfc 100644 (file)
 #define CONFIG_LOADS_ECHO      1       /* echo on for serial download  */
 #define CFG_LOADS_BAUD_CHANGE  1       /* allow baudrate change        */
 
-#if defined(CFG_RAMBOOT) || defined(CONFIG_RAM_AS_FLASH)
-  #if defined(CONFIG_PCI)
-    #define  CONFIG_COMMANDS   ((CONFIG_CMD_DFL | CFG_CMD_PCI | \
-                               CFG_CMD_PING | CFG_CMD_I2C) & \
-                                ~(CFG_CMD_ENV | \
-                                 CFG_CMD_LOADS ))
-  #elif (defined(CONFIG_TSEC_ENET) || defined(CONFIG_ETHER_ON_FCC))
-    #define  CONFIG_COMMANDS   ((CONFIG_CMD_DFL | CFG_CMD_MII | \
-                               CFG_CMD_PING | CFG_CMD_I2C) & \
-                               ~(CFG_CMD_ENV))
-  #endif
-#else
-  #if defined(CONFIG_PCI)
-    #define  CONFIG_COMMANDS   (CONFIG_CMD_DFL | CFG_CMD_PCI | \
-                               CFG_CMD_PING | CFG_CMD_I2C)
-  #elif (defined(CONFIG_TSEC_ENET) || defined(CONFIG_ETHER_ON_FCC))
-    #define  CONFIG_COMMANDS   (CONFIG_CMD_DFL | CFG_CMD_MII | \
-                               CFG_CMD_PING | CFG_CMD_I2C)
-  #endif
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_I2C
+
+#if defined(CONFIG_PCI)
+    #define CONFIG_CMD_PCI
+#endif
+
+#if defined(CONFIG_TSEC_ENET) || defined(CONFIG_ETHER_ON_FCC)
+    #define CONFIG_CMD_MII
+#endif
+
+#if defined(CFG_RAMBOOT)
+    #undef CONFIG_CMD_ENV
+    #undef CONFIG_CMD_LOADS
 #endif
 
-#include <cmd_confdefs.h>
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
  */
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT     "SBC8540=> " /* Monitor Command Prompt  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
   #define CFG_CBSIZE   1024            /* Console I/O Buffer Size      */
 #else
   #define CFG_CBSIZE   256             /* Console I/O Buffer Size      */
 /* Cache Configuration */
 #define CFG_DCACHE_SIZE                32768
 #define CFG_CACHELINE_SIZE     32
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
   #define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
 #endif
 
 #define BOOTFLAG_COLD  0x01            /* Normal Power-On: Boot from FLASH */
 #define BOOTFLAG_WARM  0x02            /* Software reboot              */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
   #define CONFIG_KGDB_BAUDRATE 230400  /* speed to run kgdb serial port */
   #define CONFIG_KGDB_SER_INDEX        2       /* which serial port to use */
 #endif
index e263db65a2f7b84b1faccc7a8d402182c5c8962d..f900968c5a1c87ab8bf2fd5c11c9bdd66477504b 100644 (file)
  * for FCC)
  *
  * if CONFIG_ETHER_NONE is defined, then either the ethernet routines must be
- * defined elsewhere (as for the console), or CFG_CMD_NET must be removed
- * from CONFIG_COMMANDS to remove support for networking.
+ * defined elsewhere (as for the console), or CONFIG_CMD_NET must be unset.
  *
  * (On TQM8260 either SCC1 or FCC2 may be chosen: SCC1 is hardwired to the
  * X.29 connector, and FCC2 is hardwired to the X.1 connector)
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT|CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
 
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL | \
-                                CFG_CMD_DHCP   | \
-                                CFG_CMD_I2C    | \
-                                CFG_CMD_EEPROM | \
-                                CFG_CMD_BSP)
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_BSP
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
 
 /*
  * Miscellaneous configurable options
  */
 #define        CFG_LONGHELP                    /* undef to save memory         */
 #define        CFG_PROMPT      "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE      32      /* For MPC8260 CPU              */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 # define CFG_CACHELINE_SHIFT   5       /* log base 2 of the above value */
 #endif
 
index 61896d0d7d1d6ce80eca4910bdf02f05513c0d78..4d9d41b9277bc578c7b56493b58c146d714f8559 100644 (file)
 
 #define        CONFIG_TIMESTAMP                /* Print image info with timestamp */
 
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL | CFG_CMD_PCI)
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any)      */
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
 
-#include <cmd_confdefs.h>
+#define CONFIG_CMD_PCI
 
 
 /*
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     32
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value        */
 #endif
 
index 49776291211d899995c832b8ad057fe52faeb484..41a54f0f5adb052de7618808f46b5857fd301438 100644 (file)
 
 #undef CONFIG_CAN_DRIVER               /* CAN Driver support disabled  */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
 
 #define CONFIG_RTC_MPC8xx              /* use internal RTC of MPC8xx   */
 
-#define CONFIG_COMMANDS                ( CONFIG_CMD_DFL        | \
-                                 CFG_CMD_DHCP          | \
-                                 CFG_CMD_DATE          )
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_DATE
+
 
 /*
  * Miscellaneous configurable options
  */
 #define        CFG_LONGHELP                    /* undef to save memory         */
 #define        CFG_PROMPT      "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB) && defined(KGDB_DEBUG)
+#if defined(CONFIG_CMD_KGDB) && defined(KGDB_DEBUG)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
old mode 100755 (executable)
new mode 100644 (file)
index d588818..a5d3d69
 
 #define CONFIG_BAUDRATE                115200
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT|CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
 
 /* enable I2C and select the hardware/software driver */
 #undef CONFIG_HARD_I2C                 /* I2C with hardware support    */
                                                  PUT32(IO0DIR, i2ctmp); }
 #endif /* CONFIG_SOFT_I2C */
 
+
 /*
- * Supported commands
+ * Command line configuration.
  */
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_FAT             | \
-                               CFG_CMD_MMC             | \
-                               CFG_CMD_NET             | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_PING)
+#include <config_cmd_default.h>
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_MMC
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_PING
 
-#define CONFIG_DOS_PARTITION
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+#define CONFIG_DOS_PARTITION
 
 #define CONFIG_BOOTDELAY       5
 
index ae4dcc2ccca9d73064c4b42957f5a00f132ff761..395c7a1e7a03ad805dbb5e0a48e3d8402ea51132 100644 (file)
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
-#define CONFIG_COMMANDS \
-((CONFIG_CMD_DFL & ~(CFG_CMD_FLASH)) | CFG_CMD_IDE) /* no Flash, but IDE */
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_IDE
+
+#undef CONFIG_CMD_FLASH
+
+
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
 
 /*----------------------------------------------------------------------*/
 #define CONFIG_ETHADDR         00:D0:93:00:01:CB
@@ -82,7 +96,7 @@
  */
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT     "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index 6ed98b8fb1889e6847324723df38cac3b2107a86..05cef873e5febc3536b13aaaf1d78435fc6ece3b 100644 (file)
 #define CONFIG_BAUDRATE                115200
 #define CFG_BAUDRATE_TABLE     { 9600, 19200, 38400, 57600, 115200 }
 
-#define CONFIG_COMMANDS                (( CONFIG_CMD_DFL | \
-                                  CFG_CMD_I2C ) & \
-                                 ~CFG_CMD_NET)
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_I2C
+
+#undef CONFIG_CMD_NET
+
+
 #include <configs/omap1510.h>
 
 #define CONFIG_BOOTARGS                "mem=16M console=ttyS0,115200n8 root=/dev/mtdblock3 rw"
index a8454d99fc0a8fc450048d71cfdc044584aba679..8f2a5ece2c733c62bcaf214cfb1300c4b589651e 100644 (file)
 
 #define CFG_DISCOVER_PHY
 
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL         | \
-                                CFG_CMD_EEPROM         | \
-                                CFG_CMD_JFFS2          | \
-                                CFG_CMD_NAND           | \
-                                CFG_CMD_DATE)
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_JFFS2
+#define CONFIG_CMD_NAND
+#define CONFIG_CMD_DATE
+
 
 #define CFG_JFFS2_SORT_FRAGMENTS
 
  */
 #define        CFG_LONGHELP                    /* undef to save a little memory */
 #define        CFG_PROMPT              "=>"    /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index f4339ecd9c8209fb0ce3a4299bc8eedf15f6d94e..5bbe3c5919d261faef084d51aa48e40269334abe 100644 (file)
        ""
 #define CONFIG_BOOTCOMMAND     "run flash_self"
 
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_SDRAM   | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_SNTP    )
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any)      */
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_SDRAM
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_SNTP
+
 
 #define CONFIG_DRAM_SPEED      100             /* MHz                          */
 
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     32      /* For MPC8240 CPU                      */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
 #endif
 
index d42bd69231e6470229be0b9fd3dd16c8078ff7c2..a08451eb30b7e3cafc8182765f37b37e6b92daa5 100644 (file)
 
 #define        CONFIG_TIMESTAMP                /* Print image info with timestamp */
 
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_SNTP    )
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any)      */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_SNTP
 
 
 /*
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     32      /* For MPC8240 CPU                      */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
 #endif
 
index 119bc2442bb5e8993d0ec666bab02daf3fbcf4a1..2b2ae01f6350728f2a5bfcd7a399424a0ff74531 100644 (file)
 
 #undef CONFIG_MONITOR_IS_IN_RAM                      /* no pre-loader required!!! ;-) */
 
-#define CONFIG_COMMANDS              ((CONFIG_CMD_DFL        |    \
-                               CFG_CMD_BSP           |    \
-                               CFG_CMD_EEPROM        |    \
-                               CFG_CMD_I2C            ) & \
-                              ~(CFG_CMD_NET))
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_BSP
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_I2C
+
+#undef CONFIG_CMD_NET
+
+
 #define CONFIG_BOOTDELAY       3
 
 #define CFG_PROMPT             "=> "
 #define CFG_LONGHELP                           /* undef to save memory         */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE             256             /* Console I/O Buffer Size      */
index 712668ab8a25aae9d1c12918d5cf72b5e6de5633..1c6a9ae4f1b8aaa42d5a24961559d4c097af4272 100644 (file)
 #define BOOTFLAG_COLD          0x01    /* Normal Power-On: Boot from FLASH  */
 #define BOOTFLAG_WARM          0x02    /* Software reboot           */
 
-#define CFG_CACHELINE_SIZE     32      /* For MPC5xxx CPUs */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
-#  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
-#endif
-
 /*
  * Serial console configuration
  */
 #define CFG_CONSOLE_IS_IN_ENV
 #endif
 
-#ifdef CONFIG_VIDEO
-#define ADD_BMP_CMD            CFG_CMD_BMP
-#else
-#define ADD_BMP_CMD            0
-#endif
-
 /* Partitions */
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
@@ -85,7 +74,6 @@
 
 /* USB */
 #define CONFIG_USB_OHCI
-#define ADD_USB_CMD            CFG_CMD_USB | CFG_CMD_FAT
 #define CONFIG_USB_STORAGE
 
 /* POST support */
                                 CFG_POST_I2C)
 
 #ifdef CONFIG_POST
-#define CFG_CMD_POST_DIAG CFG_CMD_DIAG
 /* preserve space for the post_word at end of on-chip SRAM */
 #define MPC5XXX_SRAM_POST_SIZE MPC5XXX_SRAM_SIZE-4
-#else
-#define CFG_CMD_POST_DIAG 0
 #endif
 
-/* IDE */
-#define ADD_IDE_CMD            (CFG_CMD_IDE | CFG_CMD_FAT | CFG_CMD_EXT2)
 
 /*
- * Supported commands
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
  */
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               ADD_BMP_CMD     | \
-                               ADD_IDE_CMD     | \
-                               ADD_PCI_CMD     | \
-                               ADD_USB_CMD     | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_ECHO    | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_JFFS2   | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_POST_DIAG | \
-                               CFG_CMD_REGINFO | \
-                               CFG_CMD_SNTP    | \
-                               CFG_CMD_BSP)
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_ECHO
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_EXT2
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_JFFS2
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_SNTP
+#define CONFIG_CMD_BSP
+#define CONFIG_CMD_USB
+
+#ifdef CONFIG_VIDEO
+#define CONFIG_CMD_BMP
+#endif
+
+#ifdef CONFIG_POST
+#define CONFIG__CMD_DIAG
+#endif
+
 
 #define        CONFIG_TIMESTAMP                /* display image timestamps */
 
  */
 #define CFG_LONGHELP                   /* undef to save memory     */
 #define CFG_PROMPT             "=> "   /* Monitor Command Prompt   */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024    /* Console I/O Buffer Size  */
 #else
 #define CFG_CBSIZE             256     /* Console I/O Buffer Size  */
 #define CFG_MAXARGS            16      /* max number of command args   */
 #define CFG_BARGSIZE           CFG_CBSIZE      /* Boot Argument Buffer Size    */
 
+#define CFG_CACHELINE_SIZE     32      /* For MPC5xxx CPUs */
+#if defined(CONFIG_CMD_KGDB)
+#  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
+#endif
+
 /* Enable an alternate, more extensive memory test */
 #define CFG_ALT_MEMTEST
 
 #define CFG_HZ                 1000    /* decrementer freq: 1 ms ticks */
 
 /*
- * Enable loopw commando. This has only affect, if CFG_CMD_MEM is defined,
- * which is normally part of the default commands (CFV_CMD_DFL)
+ * Enable loopw command.
  */
 #define CONFIG_LOOPW
 
index 1cc9ce94f916aece0486b59b75264d4f6ab264da..7240ce12835b57d43f750f2a6d6f0bf7a5fb655d 100644 (file)
 #define BOOTFLAG_COLD          0x01    /* Normal Power-On: Boot from FLASH  */
 #define BOOTFLAG_WARM          0x02    /* Software reboot           */
 
-#define CFG_CACHELINE_SIZE     32      /* For MPC5xxx CPUs */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
-#  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
-#endif
-
 /*
  * Serial console configuration
  */
 #  define CONFIG_PCI_IO_PHYS   CONFIG_PCI_IO_BUS
 #  define CONFIG_PCI_IO_SIZE   0x01000000
 
-#  define ADD_PCI_CMD          CFG_CMD_PCI
-
-#else  /* no Evaluation board */
-
-#  define ADD_PCI_CMD          0  /* no CFG_CMD_PCI */
-
 #endif
 
 /* USB */
 #  else
 #    define CONFIG_USB_CONFIG  0x00001000
 #  endif
-#  define ADD_USB_CMD             CFG_CMD_USB | CFG_CMD_FAT
 #  define CONFIG_DOS_PARTITION
 #  define CONFIG_USB_STORAGE
 
-#else
-
-#  define ADD_USB_CMD          0
-
 #endif
 
 /* IDE */
 #if defined (CONFIG_EVAL5200) || defined (CONFIG_LITE5200)
-
-#  define ADD_IDE_CMD             CFG_CMD_IDE | CFG_CMD_FAT
 #  define CONFIG_DOS_PARTITION
+#endif
 
-#else
 
-#  define ADD_IDE_CMD          0
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
 
-#endif
 
 /*
- * Supported commands
+ * Command line configuration.
  */
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               ADD_PCI_CMD     | \
-                               ADD_USB_CMD     | \
-                               ADD_IDE_CMD     | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_REGINFO | \
-                               CFG_CMD_IMMAP   | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_BEDBUG  \
-                             )
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_BEDBUG
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_IMMAP
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_REGINFO
+
+#if defined (CONFIG_EVAL5200) || defined (CONFIG_LITE5200)
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_USB
+#define CONFIG_CMD_PCI
+#endif
+
 
 /*
  * MUST be low boot - HIGHBOOT is not supported anymore
  */
 #define CFG_LONGHELP                   /* undef to save memory     */
 #define CFG_PROMPT             "=> "   /* Monitor Command Prompt   */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #  define CFG_CBSIZE           1024    /* Console I/O Buffer Size  */
 #else
 #  define CFG_CBSIZE           256     /* Console I/O Buffer Size  */
 
 #define CFG_HZ                 1000    /* decrementer freq: 1 ms ticks */
 
+#define CFG_CACHELINE_SIZE     32      /* For MPC5xxx CPUs */
+#if defined(CONFIG_CMD_KGDB)
+#  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
+#endif
+
+
 #ifdef CONFIG_EVAL5200         /* M48T08 is available with the Evaluation board only */
   #define CONFIG_RTC_MK48T59   1       /* use M48T08 on EVAL5200 */
   #define RTC(reg)             (0xf0010000+reg)
index 2344b96811b9eaf1f2c4f744e0ab817e3b4623d5..66f7a1150d00aa092c1adced601b8a6221155a7a 100644 (file)
  */
 #define CFG_MATCH_PARTIAL_CMD
 
+
 /*
- * List of available monitor commands.  Use the system default list
- * plus add some of the "non-standard" commands back in.
- * See ./cmd_confdefs.h
- */
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                                                               CFG_CMD_ASKENV  | \
-                                                               CFG_CMD_DHCP    | \
-                                                               CFG_CMD_I2C             | \
-                                                               CFG_CMD_EEPROM  | \
-                                                               CFG_CMD_REGINFO | \
-                                                               CFG_CMD_IMMAP   | \
-                                                               CFG_CMD_ELF             | \
-                                                               CFG_CMD_DATE    | \
-                                                               CFG_CMD_MII     | \
-                                                               CFG_CMD_BEDBUG  \
-                                                     )
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_IMMAP
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_BEDBUG
+
 
 #define        CONFIG_AUTOSCRIPT               1
 #define        CFG_LOADS_BAUD_CHANGE   1
 #undef CONFIG_LOADS_ECHO                       /* NO echo on for serial download       */
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
 
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT     "=> "           /* Monitor Command Prompt       */
  #define CFG_PROMPT_HUSH_PS2   "> "
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
  #define CFG_CBSIZE    1024            /* Console I/O Buffer Size      */
 #else
  #define CFG_CBSIZE    256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
 /*
  * BOOTP options
  */
-#undef CONFIG_BOOTP_MASK
-#define CONFIG_BOOTP_MASK                              ( CONFIG_BOOTP_DEFAULT          | \
-                                                                                 CONFIG_BOOTP_BOOTFILESIZE   \
-                                                                               )
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
 
 
 /*
index aa3627b4d77d4797e3e71a420f4e971abb087843..63d77e2941aa618bf0cfd6fbb713769594c1c8b6 100644 (file)
 #define BOOTFLAG_COLD          0x01    /* Normal Power-On: Boot from FLASH     */
 #define BOOTFLAG_WARM          0x02    /* Software reboot                      */
 
-#define CFG_CACHELINE_SIZE     32      /* For MPC5xxx CPUs                     */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
-#  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value        */
-#endif
-
 /*
  * Serial console configuration
  */
 #define CONFIG_NS8382X         1
 #endif /* CONFIG_STK52XX */
 
-#ifdef CONFIG_PCI
-#define ADD_PCI_CMD            CFG_CMD_PCI
-#else
-#define ADD_PCI_CMD            0
-#endif
-
 /*
  * Video console
  */
 #define CFG_CONSOLE_IS_IN_ENV
 #endif /* #ifndef CONFIG_TQM5200S */
 
-#ifdef CONFIG_VIDEO
-#define ADD_BMP_CMD            CFG_CMD_BMP
-#else
-#define ADD_BMP_CMD            0
-#endif
 
 /* Partitions */
 #define CONFIG_MAC_PARTITION
 /* USB */
 #if defined(CONFIG_STK52XX) || defined(CONFIG_FO300)
 #define CONFIG_USB_OHCI
-#define ADD_USB_CMD            CFG_CMD_USB | CFG_CMD_FAT
 #define CONFIG_USB_STORAGE
-#else
-#define ADD_USB_CMD            0
 #endif
 
 #ifndef CONFIG_CAM5200
 #endif
 
 #ifdef CONFIG_POST
-#define CFG_CMD_POST_DIAG CFG_CMD_DIAG
 /* preserve space for the post_word at end of on-chip SRAM */
 #define MPC5XXX_SRAM_POST_SIZE MPC5XXX_SRAM_SIZE-4
-#else
-#define CFG_CMD_POST_DIAG 0
 #endif
 
-/* IDE */
-#if defined (CONFIG_MINIFAP) || defined (CONFIG_STK52XX) || defined(CONFIG_FO300)
-#define ADD_IDE_CMD            (CFG_CMD_IDE | CFG_CMD_FAT | CFG_CMD_EXT2)
-#else
-#define ADD_IDE_CMD            0
-#endif
 
 /*
- * Supported commands
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
  */
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               ADD_BMP_CMD     | \
-                               ADD_IDE_CMD     | \
-                               ADD_PCI_CMD     | \
-                               ADD_USB_CMD     | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_JFFS2   | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_POST_DIAG | \
-                               CFG_CMD_REGINFO | \
-                               CFG_CMD_SNTP    | \
-                               CFG_CMD_BSP)
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_JFFS2
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_SNTP
+#define CONFIG_CMD_BSP
+
+#ifdef CONFIG_VIDEO
+    #define CONFIG_CMD_BMP
+#endif
+
+#ifdef CONFIG_PCI
+#define CONFIG_CMD_CMD_PCI
+#endif
+
+#if defined(CONFIG_MINIFAP) || defined(CONFIG_STK52XX) || defined(CONFIG_FO300)
+    #define CONFIG_CMD_IDE
+    #define CONFIG_CMD_FAT
+    #define CONFIG_CMD_EXT2
+#endif
+
+#if defined(CONFIG_STK52XX) || defined(CONFIG_FO300)
+    #define CONFIG_CFG_USB
+    #define CONFIG_CFG_FAT
+#endif
+
+#ifdef CONFIG_POST
+    #define CONFIG_CMD_DIAG
+#endif
+
 
 #define        CONFIG_TIMESTAMP                /* display image timestamps */
 
 #define        CFG_HUSH_PARSER         1       /* use "hush" command parser    */
 #define        CFG_PROMPT_HUSH_PS2     "> "
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#define CFG_CACHELINE_SIZE     32      /* For MPC5xxx CPUs */
+#if defined(CONFIG_CMD_KGDB)
+#define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value */
+#endif
+
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024    /* Console I/O Buffer Size  */
 #else
 #define CFG_CBSIZE             256     /* Console I/O Buffer Size  */
 #define CFG_HZ                 1000    /* decrementer freq: 1 ms ticks */
 
 /*
- * Enable loopw commando. This has only affect, if CFG_CMD_MEM is defined,
- * which is normally part of the default commands (CFV_CMD_DFL)
+ * Enable loopw command.
  */
 #define CONFIG_LOOPW
 
index 247f705fb66c0c44a78f9b61b406c15da30f109d..2bdcf2cf951f0b48bf15f540c304b69be179d638 100644 (file)
 
 #undef CONFIG_CAN_DRIVER               /* CAN Driver support disabled  */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
 
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 
 #define        CONFIG_RTC_MPC8xx               /* use internal RTC of MPC8xx   */
 
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_SNTP
+
 #ifdef CONFIG_SPLASH_SCREEN
-# define CONFIG_COMMANDS      ( CONFIG_CMD_DFL | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_BMP     | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_IDE     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_SNTP    )
-#else
-# define CONFIG_COMMANDS      ( CONFIG_CMD_DFL | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_IDE     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_SNTP    )
+    #define CONFIG_CMD_BMP
 #endif
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
 
 /*
  * Miscellaneous configurable options
 #define        CFG_PROMPT_HUSH_PS2     "> "
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE              1024    /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE              256     /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index 1461b5f20318181397aa7889f48abf2d739b4148..58bc5d3f95696c08e919812d90fc004769c161f8 100644 (file)
 
 #undef CONFIG_CAN_DRIVER               /* CAN Driver support disabled  */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
 
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 
 #define        CONFIG_RTC_MPC8xx               /* use internal RTC of MPC8xx   */
 
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_IDE     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_SNTP    )
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_SNTP
+
 
 /*
  * Miscellaneous configurable options
 #define        CFG_PROMPT_HUSH_PS2     "> "
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE              1024    /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE              256     /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index ffd5c0b95caa8faff4c2b7e5c5a9fa3a0f8fd504..3b7832397f247cf1bf037b80d475a21f91a4fabf 100644 (file)
  * for FCC)
  *
  * if CONFIG_ETHER_NONE is defined, then either the ethernet routines must be
- * defined elsewhere (as for the console), or CFG_CMD_NET must be removed
- * from CONFIG_COMMANDS to remove support for networking.
+ * defined elsewhere (as for the console), or CONFIG_CMD_NET must be unset.
  *
  * (On TQM8260 either SCC1 or FCC2 may be chosen: SCC1 is hardwired to the
  * X.29 connector, and FCC2 is hardwired to the X.1 connector)
 
 #define        CONFIG_TIMESTAMP                /* Print image info with timestamp */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT|CONFIG_BOOTP_BOOTFILESIZE)
 
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_SNTP    )
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_SNTP
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
 
 /*
  * Miscellaneous configurable options
 #define        CFG_PROMPT_HUSH_PS2     "> "
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE      32      /* For MPC8260 CPU              */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 # define CFG_CACHELINE_SHIFT   5       /* log base 2 of the above value */
 #endif
 
index 925bf343171f8dd2b532069b6d5d27130cd5c6df..50f67524fded963abb1e4aaa3d42ba07eba2747f 100644 (file)
 /* enable I2C and select the hardware/software driver */
 #undef  CONFIG_HARD_I2C                        /* I2C with hardware support    */
 #define CONFIG_SOFT_I2C                1       /* I2C bit-banged               */
-#define ADD_CMD_I2C            CFG_CMD_I2C     | \
-                               CFG_CMD_DATE    |\
-                               CFG_CMD_DTT     |\
-                               CFG_CMD_EEPROM
 #define CFG_I2C_SPEED          400000  /* I2C speed and slave address  */
 #define CFG_I2C_SLAVE          0x7F
 
 #else
 #undef CONFIG_HARD_I2C
 #undef CONFIG_SOFT_I2C
-#define ADD_CMD_I2C            0
 #endif
 
 /*
  * for FCC)
  *
  * if CONFIG_ETHER_NONE is defined, then either the ethernet routines must be
- * defined elsewhere (as for the console), or CFG_CMD_NET must be removed
- * from CONFIG_COMMANDS to remove support for networking.
+ * defined elsewhere (as for the console), or CONFIG_CMD_NET must be unset.
  *
  * (On TQM8272 either SCC1 or FCC2 may be chosen: SCC1 is hardwired to the
  * X.29 connector, and FCC2 is hardwired to the X.1 connector)
 
 #define        CONFIG_TIMESTAMP                /* Print image info with timestamp */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT|CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
 
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               CFG_CMD_NAND    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_PING    | \
-                               ADD_CMD_I2C     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_SNTP    )
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_NAND
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_SNTP
+
+#if CONFIG_I2C
+    #define CONFIG_CMD_I2C
+    #define CONFIG_CMD_DATE
+    #define CONFIG_CMD_DTT
+    #define CONFIG_CMD_EEPROM
+#endif
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
 
 /*
  * Miscellaneous configurable options
 #endif
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
  * NAND-FLASH stuff
  *-----------------------------------------------------------------------
  */
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
 
 #define CFG_NAND_CS_DIST               0x80
 #define CFG_NAND_UPM_WRITE_CMD_OFS     0x20
        WRITE_NAND(d, addr); \
 } while(0)
 
-#endif /* CFG_CMD_NAND */
+#endif /* CONFIG_CMD_NAND */
 
 #define        CONFIG_PCI
 #ifdef CONFIG_PCI
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE      32      /* For MPC8260 CPU              */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 # define CFG_CACHELINE_SHIFT   5       /* log base 2 of the above value */
 #endif
 
index 4a5f8b67578ef147c4f999ca9829c11d697ea660..c3efb7bb9c7a5cf3b61281e3b08268e7bfac9269 100644 (file)
@@ -281,7 +281,6 @@ extern int tqm834x_num_flash_banks;
 #define CFG_PCI1_IO_PHYS        CFG_PCI1_IO_BASE
 #define CFG_PCI1_IO_SIZE        0x1000000       /* 16M */
 
-
 #undef CONFIG_EEPRO100
 #define CONFIG_EEPRO100
 #undef CONFIG_TULIP
@@ -316,38 +315,36 @@ extern int tqm834x_num_flash_banks;
 #define CONFIG_LOADS_ECHO              1       /* echo on for serial download */
 #define CFG_LOADS_BAUD_CHANGE          1       /* allow baudrate change */
 
-/* Common commands */
-#define CFG_CMD_TQM8349_COMMON CFG_CMD_DATE | CFG_CMD_I2C | CFG_CMD_DTT\
-                               | CFG_CMD_PING | CFG_CMD_EEPROM         \
-                               | CFG_CMD_MII | CFG_CMD_JFFS2
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
 
-#if defined(CFG_RAMBOOT)
 
-#if defined(CONFIG_PCI)
-#define  CONFIG_COMMANDS       ((CONFIG_CMD_DFL | CFG_CMD_PCI  \
-                               | CFG_CMD_TQM8349_COMMON)       \
-                               &                               \
-                               ~(CFG_CMD_ENV | CFG_CMD_LOADS))
-#else
-#define  CONFIG_COMMANDS       ((CONFIG_CMD_DFL                \
-                               | CFG_CMD_TQM8349_COMMON)       \
-                               &                               \
-                               ~(CFG_CMD_ENV | CFG_CMD_LOADS))
-#endif
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
 
-#else /* CFG_RAMBOOT */
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DTT
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_JFFS2
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_PING
 
 #if defined(CONFIG_PCI)
-#define  CONFIG_COMMANDS       (CONFIG_CMD_DFL | CFG_CMD_PCI   \
-                               | CFG_CMD_TQM8349_COMMON)
-#else
-#define  CONFIG_COMMANDS       (CONFIG_CMD_DFL                 \
-                               | CFG_CMD_TQM8349_COMMON)
+    #define CONFIG_CMD_PCI
 #endif
 
-#endif /* CFG_RAMBOOT */
-
-#include <cmd_confdefs.h>
+#if defined(CFG_RAMBOOT)
+    #undef CONFIG_CMD_ENV
+    #undef CONFIG_CMD_LOADS
+#endif
 
 /*
  * Miscellaneous configurable options
@@ -362,7 +359,7 @@ extern int tqm834x_num_flash_banks;
 #define        CFG_PROMPT_HUSH_PS2     "> "
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        #define CFG_CBSIZE      1024            /* Console I/O Buffer Size */
 #else
        #define CFG_CBSIZE      256             /* Console I/O Buffer Size */
@@ -387,7 +384,7 @@ extern int tqm834x_num_flash_banks;
  */
 #define CFG_DCACHE_SIZE                32768
 #define CFG_CACHELINE_SIZE     32
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /*log base 2 of the above value*/
 #endif
 
@@ -495,7 +492,7 @@ extern int tqm834x_num_flash_banks;
 #define BOOTFLAG_COLD          0x01    /* Normal Power-On: Boot from FLASH */
 #define BOOTFLAG_WARM          0x02    /* Software reboot */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed of kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
index 90ecbadb2e181f412dd2a910abf62e9b2372bb14..74b16c7cf9c7f6f78f5b6b42491e9d3c5f733b2e 100644 (file)
 
 #undef CONFIG_CAN_DRIVER               /* CAN Driver support disabled  */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
 
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 
 #define        CONFIG_RTC_MPC8xx               /* use internal RTC of MPC8xx   */
 
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_IDE     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_SNTP    )
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_SNTP
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
 
 /*
  * Miscellaneous configurable options
 #define        CFG_PROMPT_HUSH_PS2     "> "
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE              1024    /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE              256     /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index b3f8f8d835a31332197604dddc69aadb21b71531..e3936c33043417fbaef92fce34433f0714d7e463 100644 (file)
 
 #undef CONFIG_CAN_DRIVER               /* CAN Driver support disabled  */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
 
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 
 #define        CONFIG_RTC_MPC8xx               /* use internal RTC of MPC8xx   */
 
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_IDE     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_SNTP    )
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_SNTP
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
 
 /*
  * Miscellaneous configurable options
 #define        CFG_PROMPT_HUSH_PS2     "> "
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE              1024    /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE              256     /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index 49aaeea44de3790e7c7a6622d0cb078e2b4e45d1..ae22b77d7f9a7ef7d691a5aec2db1a1add5e6078 100644 (file)
 
 #undef CONFIG_CAN_DRIVER               /* CAN Driver support disabled  */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
 
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 
 #define        CONFIG_RTC_MPC8xx               /* use internal RTC of MPC8xx   */
 
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_IDE     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_SNTP    )
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_SNTP
+
 
 /*
  * Miscellaneous configurable options
 #define        CFG_PROMPT_HUSH_PS2     "> "
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE              1024    /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE              256     /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index 50df49e93ccd5d6553737fde6f6279654a5523be..5d54f876c8a7e2420cc9d804fa192564dba13780 100644 (file)
 #define CFG_EEPROM_PAGE_WRITE_BITS     5
 #endif
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
 
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 
 #define        CONFIG_RTC_MPC8xx               /* use internal RTC of MPC8xx   */
 
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_IDE     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_SNTP    )
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_SNTP
+
 
 /*
  * Miscellaneous configurable options
 #define        CFG_PROMPT_HUSH_PS2     "> "
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE              1024    /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE              256     /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index b0b9dd3ab8976dde1ad7177d4b1d240b7c80a8f7..d5ce3ba7169932d9c64df0c3a22068a4f473f72c 100644 (file)
 
 #define        CONFIG_TIMESTAMP                /* Print image info with ts     */
 
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_SNTP
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_DTT
+#define CONFIG_CMD_MII
+
 #if defined(CONFIG_PCI)
-# define ADD_PCI_CMD           (CFG_CMD_PCI)
-#else
-# define ADD_PCI_CMD           0
+    #define CONFIG_CMD_PCI
 #endif
 
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL | \
-                                CFG_CMD_DHCP   | \
-                                CFG_CMD_NFS    | \
-                                CFG_CMD_SNTP   | \
-                                ADD_PCI_CMD    | \
-                                CFG_CMD_I2C    | \
-                                CFG_CMD_DATE   | \
-                                CFG_CMD_EEPROM | \
-                                CFG_CMD_DTT    | \
-                                CFG_CMD_MII    | \
-                                CFG_CMD_PING   )
-#include <cmd_confdefs.h>
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
 #define CFG_LOAD_ADDR  0x2000000       /* default load address         */
 #define CFG_PROMPT     "=> "           /* Monitor Command Prompt       */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
     #define CFG_CBSIZE 1024            /* Console I/O Buffer Size      */
 #else
     #define CFG_CBSIZE 256             /* Console I/O Buffer Size      */
 /* Cache Configuration */
 #define CFG_DCACHE_SIZE                32768
 #define CFG_CACHELINE_SIZE     32
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /*log base 2 of the above value */
 #endif
 
 #define BOOTFLAG_COLD  0x01            /* Power-On: Boot from FLASH    */
 #define BOOTFLAG_WARM  0x02            /* Software reboot              */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port*/
 #define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use     */
 #endif
index 9be5db1e424e2115ada09d5b1e7d83efd5007bb8..40c0940d5a26442ebdbb251ef229adf2323184b7 100644 (file)
 
 #undef CONFIG_CAN_DRIVER               /* CAN Driver support disabled  */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
 
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 
 #define        CONFIG_RTC_MPC8xx               /* use internal RTC of MPC8xx   */
 
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_IDE     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_SNTP    )
 
-#define CONFIG_NETCONSOLE
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_SNTP
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+
+#define CONFIG_NETCONSOLE
 
 /*
  * Miscellaneous configurable options
 #define        CFG_PROMPT_HUSH_PS2     "> "
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE              1024    /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE              256     /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index 37f6c985d3a4e7e4691e6091b8a6ee8cde5127e7..481e3d0d53250759d6625c36fc00e34cc6e23b6e 100644 (file)
 
 #undef CONFIG_CAN_DRIVER               /* CAN Driver support disabled  */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
 
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 
 #define        CONFIG_RTC_MPC8xx               /* use internal RTC of MPC8xx   */
 
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_IDE     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_SNTP    )
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_SNTP
+
 
 /*
  * Miscellaneous configurable options
 #define        CFG_PROMPT_HUSH_PS2     "> "
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE              1024    /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE              256     /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index f03690a7b21b92041bcee7178db21adffd843bb0..bb3b1cc5411f674fd420caaaef9c52127ac4dd1f 100644 (file)
 
 #undef CONFIG_CAN_DRIVER               /* CAN Driver support disabled  */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
 
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 
 #define        CONFIG_RTC_MPC8xx               /* use internal RTC of MPC8xx   */
 
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_IDE     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_SNTP    )
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_SNTP
+
 
 /*
  * Miscellaneous configurable options
 #define        CFG_PROMPT_HUSH_PS2     "> "
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE              1024    /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE              256     /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index 495934045f975881773f98cff3ee0a780f56b314..d687d082c94177f5994232fe79522544dea15e47 100644 (file)
 
 #undef CONFIG_CAN_DRIVER               /* CAN Driver support disabled  */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
 
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 
 #define        CONFIG_RTC_MPC8xx               /* use internal RTC of MPC8xx   */
 
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_IDE     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_SNTP    )
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_SNTP
+
 
 /*
  * Miscellaneous configurable options
 #define        CFG_PROMPT_HUSH_PS2     "> "
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE              1024    /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE              256     /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index 148490b58631e02c26cb606867f08301ea6000fe..ff00c1330808b46c57a348eb5990f826e62624be 100644 (file)
 #define CFG_EEPROM_PAGE_WRITE_BITS     4
 #define CFG_EEPROM_PAGE_WRITE_DELAY_MS 10      /* and takes up to 10 msec */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
 
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 
 #define        CONFIG_TIMESTAMP                /* but print image timestmps    */
 
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_IDE     | \
-                               CFG_CMD_NFS     )
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_NFS
+
 
 /*
  * Miscellaneous configurable options
 #define        CFG_PROMPT_HUSH_PS2     "> "
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024    /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE             256     /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index d470ade847d4254eb92dbe920cdf9b6d249c8064..f36b729cd5ef619adaccf4e2512a115d181564f0 100644 (file)
 # define CONFIG_RTC_DS1337 1
 # define CFG_I2C_RTC_ADDR 0x68
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
 
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 
 #define        CONFIG_TIMESTAMP                /* but print image timestmps    */
 
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_IDE     | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_PING )
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_PING
+
 
 /*
  * Miscellaneous configurable options
 #define        CFG_PROMPT_HUSH_PS2     "> "
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024    /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE             256     /* Console I/O Buffer Size      */
 #define CFG_BAUDRATE_TABLE     { 9600, 19200, 38400, 57600, 115200 }
 
 /*
- * Enable loopw commando. This has only effect, if CFG_CMD_MEM is defined,
- * which is normally part of the default commands (CFV_CMD_DFL)
+ * Enable loopw command.
  */
 #define CONFIG_LOOPW
 
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
 #define CONFIG_ETHER_ON_FEC1           /* ... for FEC1 */
 #define CONFIG_ETHER_ON_FEC2           /* ... for FEC2 */
 
-#if (CONFIG_COMMANDS & CFG_CMD_MII)
+#if defined(CONFIG_CMD_MII)
 #define CFG_DISCOVER_PHY
 #endif
 
index d8686dd39c0072b5b6ce1f06c4db764578abf112..9edf79022dc8b00b952bb8a8e17eeee60e18ad2f 100644 (file)
 #define BOOTFLAG_COLD          0x01    /* Normal Power-On: Boot from FLASH  */
 #define BOOTFLAG_WARM          0x02    /* Software reboot           */
 
-#define CFG_CACHELINE_SIZE     32      /* For MPC5xxx CPUs */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
-#  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
-#endif
-
 /*
  * Serial console configuration
  */
@@ -63,7 +58,6 @@
 /*
  * Video console
  */
-#if 1
 #define CONFIG_VIDEO
 #define CONFIG_VIDEO_SED13806
 #define CONFIG_VIDEO_SED13806_16BPP
 #define CONFIG_VIDEO_SW_CURSOR
 #define CONFIG_SPLASH_SCREEN
 
-#define ADD_VIDEO_CMD  CFG_CMD_BMP
-#else
-#define ADD_VIDEO_CMD  0
-#endif
 
 #ifdef CONFIG_MPC5200  /* MGT5100 PCI is not supported yet. */
 /*
 #define CFG_RX_ETH_BUFFER      8  /* use 8 rx buffer on eepro100  */
 #define CONFIG_NS8382X         1
 
-#define ADD_PCI_CMD            CFG_CMD_PCI
-
 #else  /* MGT5100 */
 
 #define CONFIG_MII             1
-#define ADD_PCI_CMD            0  /* no CFG_CMD_PCI */
 
 #endif
 
 #define CONFIG_DOS_PARTITION
 
 /* USB */
-#if 1
 #define CONFIG_USB_OHCI
-#define ADD_USB_CMD             CFG_CMD_USB | CFG_CMD_FAT
 #define CONFIG_USB_STORAGE
-#else
-#define ADD_USB_CMD             0
-#endif
+
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
 
 /*
- * Supported commands
+ * Command line configuration.
  */
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL | \
-                                CFG_CMD_PING   | \
-                                CFG_CMD_I2C    | \
-                                CFG_CMD_EEPROM | \
-                                CFG_CMD_FAT    | \
-                                CFG_CMD_IDE    | \
-                                ADD_VIDEO_CMD  | \
-                                ADD_PCI_CMD    | \
-                                ADD_USB_CMD)
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+#include <config_cmd_default.h>
+
+#if defined(CONFIG_MPC5200)
+    #define CONFIG_CMD_PCI
+#endif
+
+#define CONFIG_CMD_BMP
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_USB
+
 
 #if (TEXT_BASE == 0xFE000000)          /* Boot low */
 #   define CFG_LOWBOOT         1
  */
 #define CFG_LONGHELP                   /* undef to save memory     */
 #define CFG_PROMPT             "=> "   /* Monitor Command Prompt   */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024    /* Console I/O Buffer Size  */
 #else
 #define CFG_CBSIZE             256     /* Console I/O Buffer Size  */
 
 #define CFG_HZ                 1000    /* decrementer freq: 1 ms ticks */
 
+#define CFG_CACHELINE_SIZE     32      /* For MPC5xxx CPUs */
+#if defined(CONFIG_CMD_KGDB)
+#  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
+#endif
+
+
 /*
  * Various low-level settings
  */
index 5f48a709381f4a39f19a5040972953aaf90c8132..df6894f3240a69451890281289d6e3e9c3e5b1b7 100644 (file)
 #define CONFIG_SETUP_MEMORY_TAGS 1
 #define CONFIG_INITRD_TAG       1
 
-/***********************************************************
- * Command definition
- ***********************************************************/
-#define CONFIG_COMMANDS \
-                       (CONFIG_CMD_DFL  | \
-                       CFG_CMD_CACHE    | \
-                       /*CFG_CMD_JFFS2  |*/ \
-                       /*CFG_CMD_NAND   |*/ \
-                       CFG_CMD_EEPROM   | \
-                       CFG_CMD_I2C      | \
-                       CFG_CMD_USB      | \
-                       CFG_CMD_REGINFO  | \
-                       CFG_CMD_FAT      | \
-                       CFG_CMD_DATE     | \
-                       CFG_CMD_ELF      | \
-                       CFG_CMD_DHCP     | \
-                       CFG_CMD_PING     | \
-                       CFG_CMD_BSP)
-
-/* this must be included after the definiton of CONFIG_COMMANDS */
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_CACHE
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_USB
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_BSP
+
 
 #define CFG_HUSH_PARSER
 #define CFG_PROMPT_HUSH_PS2 "> "
 #define CONFIG_IPADDR          10.0.0.110
 #define CONFIG_SERVERIP                10.0.0.1
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   115200          /* speed to run kgdb serial port */
 /* what's this ? it's not used anywhere */
 #define CONFIG_KGDB_SER_INDEX  1               /* which serial port to use */
 /*-----------------------------------------------------------------------
  * NAND flash settings
  */
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
 
 #define CFG_NAND_LEGACY
 #define CFG_MAX_NAND_DEVICE    1       /* Max number of NAND devices           */
 #define CONFIG_MTD_NAND_VERIFY_WRITE   1
 #define CONFIG_MTD_NAND_ECC_JFFS2      1
 
-#endif /* CONFIG_COMMANDS & CFG_CMD_NAND */
+#endif
 
 #endif /* __CONFIG_H */
index 96f3d26cc5eea997c1406a525222030180ac36ba..34f0ebdcfa2607b53ba27531bc2967a5e303f0ff 100644 (file)
 
 #define CONFIG_PHY_CLK_FREQ    EMAC_STACR_CLK_66MHZ /* 66 MHz OPB clock*/
 
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_IDE     | \
-                               CFG_CMD_FAT     | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_NAND    | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_EEPROM  )
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_NAND
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_EEPROM
+
 
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 
 #define CONFIG_SUPPORT_VFAT
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
 #define CONFIG_RTC_MC146818            /* DS1685 is MC146818 compatible*/
 #define CFG_PROMPT_HUSH_PS2    "> "
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
 #define CFG_DCACHE_SIZE                16384   /* For AMCC 405 CPUs, older 405 ppc's   */
                                        /* have only 8kB, 16kB is save here     */
 #define CFG_CACHELINE_SIZE     32      /* ...                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value        */
 #endif
 
index f2f3ea7cc4d2f7ccc91889780a0aefb2d111cbc2..5512f4be21a83846d113e1aec6f27cbb5aa728af 100644 (file)
 #define CONFIG_LXT971_NO_SLEEP  1       /* disable sleep mode in LXT971 */
 #define CONFIG_RESET_PHY_R      1       /* use reset_phy() to disable phy sleep mode */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | \
-                                CONFIG_BOOTP_DNS | \
-                                CONFIG_BOOTP_DNS2 | \
-                                CONFIG_BOOTP_SEND_HOSTNAME )
-
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_BSP     | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_EEPROM  )
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_DNS
+#define CONFIG_BOOTP_DNS2
+#define CONFIG_BOOTP_SEND_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_BSP
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_EEPROM
+
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
 #define CFG_PROMPT_HUSH_PS2    "> "
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
 #define CFG_DCACHE_SIZE                16384   /* For AMCC 405 CPUs, older 405 ppc's   */
                                        /* have only 8kB, 16kB is save here     */
 #define CFG_CACHELINE_SIZE     32      /* ...                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value        */
 #endif
 
index 92bade5187e13911bf15b1a190aac59053769187..14057847b82e655994a786d5a81648e9bd689f95 100644 (file)
@@ -95,8 +95,7 @@
  * for FCC)
  *
  * if CONFIG_ETHER_NONE is defined, then either the ethernet routines must be
- * defined elsewhere (as for the console), or CFG_CMD_NET must be removed
- * from CONFIG_COMMANDS to remove support for networking.
+ * defined elsewhere (as for the console), or CONFIG_CMD_NET must be unset.
  */
 #undef CONFIG_ETHER_ON_SCC
 #define        CONFIG_ETHER_ON_FCC
 
 #endif
 
-/* configure commands */
-#define CONFIG_COMMANDS                (       CFG_CMD_AUTOSCRIPT      | \
-                                       CFG_CMD_BDI             | \
-                                       CFG_CMD_CONSOLE         | \
-                                       CFG_CMD_ECHO            | \
-                                       CFG_CMD_ENV             | \
-                                       CFG_CMD_FLASH           | \
-                                       CFG_CMD_IMI             | \
-                                       CFG_CMD_IMLS            | \
-                                       CFG_CMD_LOADB           | \
-                                       CFG_CMD_MEMORY          | \
-                                       CFG_CMD_MISC            | \
-                                       CFG_CMD_NET             | \
-                                       CFG_CMD_PING            | \
-                                       CFG_CMD_RUN     )
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+
+#define CONFIG_CMD_AUTOSCRIPT
+#define CONFIG_CMD_BDI
+#define CONFIG_CMD_CONSOLE
+#define CONFIG_CMD_ECHO
+#define CONFIG_CMD_ENV
+#define CONFIG_CMD_FLASH
+#define CONFIG_CMD_IMI
+#define CONFIG_CMD_IMLS
+#define CONFIG_CMD_LOADB
+#define CONFIG_CMD_MEMORY
+#define CONFIG_CMD_MISC
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_RUN
+
 
 /*
  * boot options & environment
 #define        CFG_PROMPT                      "=> "
 
 /* console i/o buffer size */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE                      1024
 #else
 #define        CFG_CBSIZE                      256
 
 /* cache configuration */
 #define CFG_CACHELINE_SIZE             32      /* for MPC8260 */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT            5       /* log base 2 of above */
 #endif
 
index 8dc623ea069c6899e5ea59e8096a8274c2968480..fc177fb1f560a5e52eadab8c9630452d88b0e1a3 100644 (file)
 
 #define CONFIG_RTC_M48T35A     1               /* ST Electronics M48 timekeeper */
 
-#define CONFIG_COMMANDS                \
-       (CONFIG_CMD_DFL | CFG_CMD_PCI | CFG_CMD_IRQ | CFG_CMD_ASKENV | \
-        CFG_CMD_DHCP | CFG_CMD_BEDBUG | CFG_CMD_DATE | CFG_CMD_I2C | \
-        CFG_CMD_EEPROM | CFG_CMD_ELF | CFG_CMD_BSP | CFG_CMD_REGINFO)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_BEDBUG
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_BSP
+#define CONFIG_CMD_REGINFO
 
 #undef CONFIG_WATCHDOG                         /* watchdog disabled            */
 #define CONFIG_HW_WATCHDOG                     /* HW Watchdog, board specific  */
 #ifdef  CFG_HUSH_PARSER
 #define CFG_PROMPT_HUSH_PS2     "> "
 #endif
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE             256             /* Console I/O Buffer Size      */
  */
 #define CFG_DCACHE_SIZE                8192            /* For AMCC 405 CPUs                    */
 #define CFG_CACHELINE_SIZE     32              /* ...          */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5               /* log base 2 of the above val. */
 #endif
 
 #define BOOTFLAG_COLD          0x01            /* Normal Power-On: Boot from FLASH */
 #define BOOTFLAG_WARM          0x02            /* Software reboot              */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400          /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2               /* which serial port to use     */
 #endif
index 2bd98b3af33e1338630287b963c295afca238f21..20d693fa478e7a6383ac95d82557704df553c857 100644 (file)
 #define CFG_DTT_LOW_TEMP       -30
 #define CFG_DTT_HYSTERESIS     3
 
-#define CONFIG_COMMANDS                \
-       (CONFIG_CMD_DFL | CFG_CMD_PCI | CFG_CMD_IRQ | CFG_CMD_ASKENV | \
-        CFG_CMD_DHCP | CFG_CMD_BEDBUG | CFG_CMD_DATE | CFG_CMD_I2C | \
-        CFG_CMD_EEPROM | CFG_CMD_ELF | CFG_CMD_BSP | CFG_CMD_REGINFO | \
-        CFG_CMD_DTT)
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_BEDBUG
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_BSP
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_DTT
+
 
 #undef CONFIG_WATCHDOG                         /* watchdog disabled            */
 #define CONFIG_HW_WATCHDOG                     /* HW Watchdog, board specific  */
 #ifdef  CFG_HUSH_PARSER
 #define CFG_PROMPT_HUSH_PS2     "> "
 #endif
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE             256             /* Console I/O Buffer Size      */
  */
 #define CFG_DCACHE_SIZE                8192            /* For AMCC 405 CPUs                    */
 #define CFG_CACHELINE_SIZE     32              /* ...          */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5               /* log base 2 of the above val. */
 #endif
 
 #define BOOTFLAG_COLD          0x01            /* Normal Power-On: Boot from FLASH */
 #define BOOTFLAG_WARM          0x02            /* Software reboot              */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400          /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2               /* which serial port to use     */
 #endif
index faf855d2492c072fe238a4e978ac7fc7de7204e8..c1b3da863edab700e15e57e03a5e0fd3c0e98455 100644 (file)
 
 #define CONFIG_PHY_CLK_FREQ    EMAC_STACR_CLK_66MHZ /* 66 MHz OPB clock*/
 
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_NAND    | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_EEPROM  )
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_NAND
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_EEPROM
+
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
 #define CFG_PROMPT_HUSH_PS2    "> "
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
 #define CFG_DCACHE_SIZE                16384   /* For AMCC 405 CPUs, older 405 ppc's   */
                                        /* have only 8kB, 16kB is save here     */
 #define CFG_CACHELINE_SIZE     32      /* ...                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value        */
 #endif
 
index f2ad097db291f1709c8cc3df92b3e09598882b95..611f5a62caa385af584ec79529a5a9b89ff1ba8b 100644 (file)
@@ -182,25 +182,33 @@ extern void out32(unsigned int, unsigned long);
 #define CONFIG_HAS_ETH2                1       /* add support for "eth2addr"   */
 #define CONFIG_HAS_ETH3                1       /* add support for "eth3addr"   */
 
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_BEDBUG  | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_PING | \
-                               CFG_CMD_ELF | \
-                               CFG_CMD_MII | \
-                               CFG_CMD_DIAG | \
-                               CFG_CMD_FAT )
-
-/*                             CFG_CMD_DHCP    | \ */
-/*                             CFG_CMD_KGDB    | \ */
-
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_BEDBUG
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_DIAG
+#define CONFIG_CMD_FAT
+
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
@@ -209,7 +217,7 @@ extern void out32(unsigned int, unsigned long);
  */
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT     "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
@@ -254,7 +262,7 @@ extern void out32(unsigned int, unsigned long);
  */
 #define CFG_DCACHE_SIZE                8192 /* For AMCC 440GX CPUs */
 #define CFG_CACHELINE_SIZE     32      /* ...                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value        */
 #endif
 
@@ -266,7 +274,7 @@ extern void out32(unsigned int, unsigned long);
 #define BOOTFLAG_COLD  0x01            /* Normal Power-On: Boot from FLASH     */
 #define BOOTFLAG_WARM  0x02            /* Software reboot                      */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
index 37ef1058f90dad6b6517032664b8f37880ef0ebf..00c4ff093a6ce78f995e673d3a15291598894d19 100644 (file)
 #define BOOTFLAG_COLD          0x01    /* Normal Power-On: Boot from FLASH */
 #define BOOTFLAG_WARM          0x02    /* Software reboot      */
 
-#define CFG_CACHELINE_SIZE     32      /* For MPC8220 CPUs */
-
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
-#  define CFG_CACHELINE_SHIFT  5   /* log base 2 of the above value */
-#endif
-
 /*
  * Serial console configuration
  */
 
 #define CONFIG_TIMESTAMP                       /* Print image info with timestamp */
 
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
 /*
- * Supported commands
+ * Command line configuration.
  */
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_BOOTD   | \
-                               CFG_CMD_CACHE   | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_DIAG    | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_NET     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_REGINFO | \
-                               CFG_CMD_SDRAM   | \
-                               CFG_CMD_SNTP    )
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_BOOTD
+#define CONFIG_CMD_CACHE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_DIAG
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_SDRAM
+#define CONFIG_CMD_SNTP
+
 
 #define CONFIG_NET_MULTI
 #define CONFIG_MII
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-
 /*
  * Autobooting
  */
  */
 #define CFG_LONGHELP                       /* undef to save memory     */
 #define CFG_PROMPT             "=> "       /* Monitor Command Prompt   */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024        /* Console I/O Buffer Size  */
 #else
 #define CFG_CBSIZE             256         /* Console I/O Buffer Size  */
 
 #define CFG_HZ                 1000        /* decrementer freq: 1 ms ticks */
 
+#define CFG_CACHELINE_SIZE     32      /* For MPC8220 CPUs */
+#if defined(CONFIG_CMD_KGDB)
+#  define CFG_CACHELINE_SHIFT  5   /* log base 2 of the above value */
+#endif
+
 /*
  * Various low-level settings
  */
index a5085cfb79d52fdfbcc048252dac6845d3f144db..7c1a5b9e88f626a0a7cf6cec321ad47bc7c49c8b 100644 (file)
@@ -55,8 +55,8 @@
  * SCC, 1-3 for FCC)
  *
  * If CONFIG_ETHER_NONE is defined, then either the ethernet routines
- * must be defined elsewhere (as for the console), or CFG_CMD_NET must
- * be removed from CONFIG_COMMANDS to remove support for networking.
+ * must be defined elsewhere (as for the console), or CONFIG_CMD_NET
+ * must be unset.
  */
 #undef CONFIG_ETHER_ON_SCC             /* Ethernet is not on SCC */
 #define CONFIG_ETHER_ON_FCC            /* Ethernet is on FCC     */
 
 #define CONFIG_BAUDRATE                38400
 
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL   \
-                               | CFG_CMD_ASKENV  \
-                               | CFG_CMD_DHCP    \
-                               | CFG_CMD_IMMAP   \
-                               | CFG_CMD_MII     \
-                               | CFG_CMD_PING    \
-                               )
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_IMMAP
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_PING
+
 
 #define CONFIG_BOOTDELAY       5       /* autoboot after 5 seconds */
 #define CONFIG_BOOTCOMMAND     "dhcp;bootm"    /* autoboot command */
 #define CONFIG_BOOTARGS                "root=/dev/nfs rw ip=:::::eth0:dhcp"
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #undef CONFIG_KGDB_ON_SMC              /* define if kgdb on SMC */
 #define CONFIG_KGDB_ON_SCC             /* define if kgdb on SCC */
 #undef CONFIG_KGDB_NONE                /* define if kgdb on something else */
 #define CFG_PROMPT_HUSH_PS2    "> "
 #define CFG_LONGHELP                   /* undef to save memory     */
 #define CFG_PROMPT             "=> "   /* Monitor Command Prompt   */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024    /* Console I/O Buffer Size  */
 #else
 #define CFG_CBSIZE             256     /* Console I/O Buffer Size  */
 #endif
 
 #define CFG_CACHELINE_SIZE     32      /* For MPC8260 CPU */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
 #endif
 
 #define CFG_LSRT               0x0F
 #define CFG_MPTPR              0x4000
 
-#define CFG_PSDRAM_BR          CFG_SDRAM_BASE | 0x00000041
+#define CFG_PSDRAM_BR          (CFG_SDRAM_BASE | 0x00000041)
 #define CFG_PSDRAM_OR          0xFC0028C0
-#define CFG_LSDRAM_BR          CFG_LSDRAM_BASE | 0x00001861
+#define CFG_LSDRAM_BR          (CFG_LSDRAM_BASE | 0x00001861)
 #define CFG_LSDRAM_OR          0xFF803480
 
-#define CFG_BR0_PRELIM         CFG_FLASH_BASE | 0x00000801
+#define CFG_BR0_PRELIM         (CFG_FLASH_BASE | 0x00000801)
 #define CFG_OR0_PRELIM         0xFFE00856
-#define CFG_BR5_PRELIM         CFG_EEPROM | 0x00000801
+#define CFG_BR5_PRELIM         (CFG_EEPROM | 0x00000801)
 #define CFG_OR5_PRELIM         0xFFFF03F6
-#define CFG_BR6_PRELIM         CFG_FLSIMM_BASE | 0x00001801
+#define CFG_BR6_PRELIM         (CFG_FLSIMM_BASE | 0x00001801)
 #define CFG_OR6_PRELIM         0xFF000856
-#define CFG_BR7_PRELIM         CFG_BCSR | 0x00000801
+#define CFG_BR7_PRELIM         (CFG_BCSR | 0x00000801)
 #define CFG_OR7_PRELIM         0xFFFF83F6
 
 #define CFG_RESET_ADDRESS      0xC0000000
index f163d003b9adf21cdc907194bd4bcd657d18bd9a..5ba8d1a7157d90318a73516f8c70ec8f5b1087f0 100644 (file)
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 #undef CONFIG_ALTIVEC                  /* undef to disable             */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | \
-                                CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
 
 #define CONFIG_MII             /* enable MII commands */
 
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL | \
-                                CFG_CMD_ASKENV | \
-                                CFG_CMD_BSP    | \
-                                CFG_CMD_JFFS2  | \
-                                CFG_CMD_MII    | \
-                                CFG_CMD_DATE)
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_BSP
+#define CONFIG_CMD_JFFS2
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_DATE
+
 
 /*
  * JFFS2 partitions
 #define MTDPARTS_DEFAULT       "mtdparts=zuma-1:-(jffs2),zuma-2:-(user)"
 */
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-
 /*
  * Miscellaneous configurable options
  */
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT     "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     32      /* For all MPC74xx CPUs          */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value */
 #endif
 
index 517d130d5cad933aa27b9e998ed5174b675fbba8..e3f6e2c8b34afdd83fd0a631b872b316c48f3eb5 100644 (file)
 #define CFG_FLASH_USE_BUFFER_WRITE 1   /* use buffered writes (20x faster)     */
 #define CFG_FLASH_EMPTY_INFO           /* print 'E' for empty sector on flinfo */
 
-#define        _CFG_CMD_INCLUDE        (CFG_CMD_ALL)
 #else
 #define        CFG_NO_FLASH            1       /* No NOR on Acadia when NAND-booting   */
-#define        _CFG_CMD_INCLUDE        ((CFG_CMD_ALL) & ~(CFG_CMD_FLASH | CFG_CMD_IMLS))
 #endif
 
 #ifdef CFG_ENV_IS_IN_FLASH
 
 #define CONFIG_SUPPORT_VFAT
 
-#define CONFIG_COMMANDS        ((CONFIG_CMD_DFL & _CFG_CMD_INCLUDE)    |       \
-                        CFG_CMD_ASKENV |                               \
-                        CFG_CMD_DHCP   |                               \
-                        CFG_CMD_DTT    |                               \
-                        CFG_CMD_DIAG   |                               \
-                        CFG_CMD_EEPROM |                               \
-                        CFG_CMD_ELF    |                               \
-                        CFG_CMD_FAT    |                               \
-                        CFG_CMD_I2C    |                               \
-                        CFG_CMD_IRQ    |                               \
-                        CFG_CMD_MII    |                               \
-                        CFG_CMD_NAND   |                               \
-                        CFG_CMD_NET    |                               \
-                        CFG_CMD_NFS    |                               \
-                        CFG_CMD_PCI    |                               \
-                        CFG_CMD_PING   |                               \
-                        CFG_CMD_REGINFO |                              \
-                        CFG_CMD_USB)
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_DTT
+#define CONFIG_CMD_DIAG
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_NAND
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_USB
+
+/*
+ * No NOR on Acadia when NAND-booting
+ */
+#if defined(CONFIG_NAND_U_BOOT) || defined(CONFIG_NAND_SPL)
+#undef CONFIG_CMD_FLASH
+#undef CONFIG_CMD_IMLS
+#endif
 
 #undef CONFIG_WATCHDOG                                 /* watchdog disabled            */
 
  *----------------------------------------------------------------------*/
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT             "=> "   /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024    /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE             256     /* Console I/O Buffer Size      */
  */
 #define CFG_DCACHE_SIZE                16384           /* For AMCC 405EZ CPU           */
 #define CFG_CACHELINE_SIZE     32              /* ...                          */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5               /* log base 2 of the above value*/
 #endif
 
 #define BOOTFLAG_COLD  0x01            /* Normal Power-On: Boot from FLASH     */
 #define BOOTFLAG_WARM  0x02            /* Software reboot                      */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
   #define CONFIG_KGDB_BAUDRATE 230400  /* speed to run kgdb serial port */
   #define CONFIG_KGDB_SER_INDEX        2       /* which serial port to use */
 #endif
index c4108912a6b0b7ff770820b270a82c84f4ddf718..703d3124e6fbebf1d14452f009e3bbe7a7c425f5 100644 (file)
 
 #define CONFIG_DOS_PARTITION   1
 
-#define CONFIG_COMMANDS                ((CONFIG_CMD_DFL & ~CFG_CMD_NET) | CFG_CMD_MMC | CFG_CMD_FAT | CFG_CMD_IDE | CFG_CMD_PCMCIA)
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_MMC
+#define CONFIG_CMD_PCMCIA
+
+#undef CONFIG_CMD_NET
+
 
 #undef CONFIG_SHOW_BOOT_PROGRESS
 
 #define CONFIG_CMDLINE_TAG      1      /* enable passing of ATAGs      */
 /* #define CONFIG_INITRD_TAG    1 */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400          /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2               /* which serial port to use */
 #endif
index f6f530cedbd6c33b748dd6a2e9f3e0c975b02353..5bab793e9cc494a939ae56223cfbb0f870a8d0e4 100644 (file)
 #define BOOTFLAG_COLD          0x01    /* Normal Power-On: Boot from FLASH  */
 #define BOOTFLAG_WARM          0x02    /* Software reboot           */
 
-#define CFG_CACHELINE_SIZE     32      /* For MPC5xxx CPUs */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
-#  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
-#endif
-
 /*
  * Serial console configuration
  */
                                 CFG_POST_I2C)
 
 #ifdef CONFIG_POST
-#define CFG_CMD_POST_DIAG CFG_CMD_DIAG
 /* preserve space for the post_word at end of on-chip SRAM */
 #define MPC5XXX_SRAM_POST_SIZE MPC5XXX_SRAM_SIZE-4
-#else
-#define CFG_CMD_POST_DIAG 0
 #endif
 
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
 /*
- * Supported commands
+ * Command line configuration.
  */
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               ADD_BMP_CMD     | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_ECHO    | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_POST_DIAG | \
-                               CFG_CMD_REGINFO | \
-                               CFG_CMD_SNTP    )
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_ECHO
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_SNTP
+
+#ifdef CONFIG_POST
+#define CONFIG_CMD_DIAG
+#endif
+
 
 #define        CONFIG_TIMESTAMP                /* display image timestamps */
 
  */
 #define CFG_LONGHELP                   /* undef to save memory     */
 #define CFG_PROMPT             "=> "   /* Monitor Command Prompt   */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024    /* Console I/O Buffer Size  */
 #else
 #define CFG_CBSIZE             256     /* Console I/O Buffer Size  */
 
 #define CFG_HZ                 1000    /* decrementer freq: 1 ms ticks */
 
+#define CFG_CACHELINE_SIZE     32      /* For MPC5xxx CPUs */
+#if defined(CONFIG_CMD_KGDB)
+#  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
+#endif
+
 /*
- * Enable loopw commando. This has only affect, if CFG_CMD_MEM is defined,
- * which is normally part of the default commands (CFV_CMD_DFL)
+ * Enable loopw command.
  */
 #define CONFIG_LOOPW
 
index df057d9c953e0a7aa6fcaa4bf4133f0ba3876358..d88c3ad43b0ec63d3d6a2debb7badd0e7efb0ab5 100644 (file)
 
 #define CONFIG_NETCONSOLE              /* include NetConsole support   */
 
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_DIAG    | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_NET     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_FPGA    | \
-                               CFG_CMD_NAND    | \
-                               CFG_CMD_REGINFO)
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_DIAG
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_FPGA
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_NAND
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_REGINFO
+
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
  */
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT     "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
 #define BOOTFLAG_COLD  0x01            /* Normal Power-On: Boot from FLASH     */
 #define BOOTFLAG_WARM  0x02            /* Software reboot                      */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
index 9a1c5596b7afb0a426e938b52ef9ef989a227059..73a88854b38fb06a6cab85dc42f01a0ff86cafeb 100644 (file)
 
 #define CONFIG_BAUDRATE                115200
 
-#define CONFIG_BOOTP_MASK       (CONFIG_BOOTP_DEFAULT|CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
 
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL) /* | CFG_CMD_JFFS2)*/
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
 
 #define CONFIG_BOOTDELAY       3
 #define CONFIG_BOOTARGS        "root=/dev/ram0 rootfstype=ext2 console=ttyAM0,115200"
index 1a69ebe0dae79ebd760d2b3f21954bdde38abba9..226ad54723ebffec5a0e3f687e014ccdcd06671c 100644 (file)
 
 #define CONFIG_BAUDRATE                115200
 
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL | CFG_CMD_DHCP)
-#define CONFIG_BOOTP_MASK      CONFIG_BOOTP_DEFAULT
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DHCP
+
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+
 
 #define CONFIG_BOOTDELAY       3
 #define CONFIG_BOOTARGS                "console=ttySA0,115200n8 root=/dev/nfs ip=bootp"
 #define CONFIG_BOOTCOMMAND     "bootp;tftp;bootm"
 #define CFG_AUTOLOAD            "n"    /* No autoload */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   115200  /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
index 8fad55d81cf4c36c84f7815996a2d0faeda08298..ecfa21d828028e9efb904d449628c07ba6478afa 100644 (file)
 #define CONFIG_BOOTDELAY      3
 /* #define CONFIG_ENV_OVERWRITE        1 */
 
-#define CONFIG_COMMANDS                \
-                      ((CONFIG_CMD_DFL | CFG_CMD_MII |\
-                       CFG_CMD_DHCP ) & \
-                     ~(CFG_CMD_BDI | \
-                       CFG_CMD_IMI | \
-                       CFG_CMD_AUTOSCRIPT | \
-                       CFG_CMD_FPGA | \
-                       CFG_CMD_MISC | \
-                       CFG_CMD_LOADS ))
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_DHCP
+
+#undef CONFIG_CMD_BDI
+#undef CONFIG_CMD_IMI
+#undef CONFIG_CMD_AUTOSCRIPT
+#undef CONFIG_CMD_FPGA
+#undef CONFIG_CMD_MISC
+#undef CONFIG_CMD_LOADS
+
 
 #define CFG_MAX_NAND_DEVICE    1       /* Max number of NAND devices           */
 #define SECTORSIZE 512
index bf6c1709d909f1cc6b20d2c27ce56b4a12331742..3ff4b68083ad572f382d2d5218019aeed3cbe9b9 100644 (file)
@@ -64,9 +64,7 @@
  * for FCC)
  *
  * if CONFIG_ETHER_NONE is defined, then either the ethernet routines must be
- * defined elsewhere (as for the console), or CFG_CMD_NET must be removed
- * from CONFIG_COMMANDS to remove support for networking.
- *
+ * defined elsewhere (as for the console), or CONFIG_CMD_NET must be unset.
  */
 #undef CONFIG_ETHER_ON_SCC             /* define if ether on SCC       */
 #undef CONFIG_ETHER_NONE               /* define if ether on something else */
 #define CONFIG_LOADS_ECHO      1       /* echo on for serial download  */
 #undef CFG_LOADS_BAUD_CHANGE           /* don't allow baudrate change  */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT|CONFIG_BOOTP_BOOTFILESIZE)
 
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL | \
-                                CFG_CMD_EEPROM | \
-                                CFG_CMD_PCI | \
-                                CFG_CMD_PCMCIA | \
-                                CFG_CMD_DATE | \
-                                CFG_CMD_IDE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
 
 
-#define CONFIG_DOS_PARTITION
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_PCMCIA
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_IDE
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+
+#define CONFIG_DOS_PARTITION
 
 /*
  * Miscellaneous configurable options
  */
 #define        CFG_LONGHELP                    /* undef to save memory         */
 #define        CFG_PROMPT      "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE      32      /* For MPC8260 CPU              */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 # define CFG_CACHELINE_SHIFT   5       /* log base 2 of the above value */
 #endif
 
index beaf3851dc8ece66173b667179b36ab03a820e6d..e1d8f74c5ec9334f9e0ac71ecdf9a6999cbbc85f 100644 (file)
 #define CONFIG_OVERWRITE_ETHADDR_ONCE  1
 #define CONFIG_NET_MULTI               1
 
-#define CONFIG_BOOTP_MASK              (CONFIG_BOOTP_SUBNETMASK        \
-                                        | CONFIG_BOOTP_GATEWAY)
-
-#define CONFIG_COMMANDS                        (CFG_CMD_BDI                    \
-                                        | CFG_CMD_LOADS                \
-                                        | CFG_CMD_LOADB                \
-                                        | CFG_CMD_IMI                  \
-                                        /* | CFG_CMD_CACHE */          \
-                                        | CFG_CMD_FLASH                \
-                                        | CFG_CMD_MEMORY               \
-                                        | CFG_CMD_NET                  \
-                                        | CFG_CMD_ENV                  \
-                                        /* | CFG_CMD_IRQ */            \
-                                        | CFG_CMD_BOOTD                \
-                                        | CFG_CMD_CONSOLE              \
-                                        /* | CFG_CMD_EEPROM */         \
-                                        | CFG_CMD_ASKENV               \
-                                        | CFG_CMD_RUN                  \
-                                        | CFG_CMD_ECHO                 \
-                                        /* | CFG_CMD_I2C */            \
-                                        | CFG_CMD_REGINFO              \
-                                        /* | CFG_CMD_DATE */           \
-                                        | CFG_CMD_DHCP                 \
-                                        /* | CFG_CMD_AUTOSCRIPT */     \
-                                        /* | CFG_CMD_MII */            \
-                                        | CFG_CMD_MISC                 \
-                                        /* | CFG_CMD_SDRAM */          \
-                                        /* | CFG_CMD_DIAG */           \
-                                        /* | CFG_CMD_HWFLOW */         \
-                                        /* | CFG_CMD_SAVES */          \
-                                        /* | CFG_CMD_SPI */            \
-                                        /* | CFG_CMD_PING */           \
-                                        | CFG_CMD_MMC                  \
-                                        | CFG_CMD_FAT                  \
-                                        | CFG_CMD_IMLS                 \
-                                        /* | CFG_CMD_ITEST */          \
-                                        | CFG_CMD_EXT2                 \
-                                        | CFG_CMD_JFFS2                \
-               )
-
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_EXT2
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_JFFS2
+#define CONFIG_CMD_MMC
+#define CONFIG_CMD_REGINFO
+
+#undef CONFIG_CMD_AUTOSCRIPT
+#undef CONFIG_CMD_SETGETDCR
+#undef CONFIG_CMD_XIMG
 
 #define CONFIG_ATMEL_USART             1
 #define CONFIG_MACB                    1
index d58344d71773a120b451ef86aaee9e243b3bcf50..19b29aaf36c2d967e84fab3955f49633ded459c8 100644 (file)
 #define USB_2_0_DEVICE
 #endif /*CONFIG_440EP*/
 
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_DIAG
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_SDRAM
+#define CONFIG_CMD_USB
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_EXT2
+#define CONFIG_CMD_SNTP
+
 #ifdef CONFIG_BAMBOO_NAND
-#define _CFG_CMD_NAND CFG_CMD_NAND
-#else
-#define _CFG_CMD_NAND 0
-#endif /* CONFIG_BAMBOO_NAND */
+#define CONFIG_CMD_NAND
+#endif
 
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_DIAG    | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_NET     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_REGINFO | \
-                               CFG_CMD_SDRAM   | \
-                               CFG_CMD_USB     | \
-                               CFG_CMD_FAT     | \
-                               CFG_CMD_EXT2    | \
-                               _CFG_CMD_NAND   | \
-                               CFG_CMD_SNTP    )
 
 #define CONFIG_SUPPORT_VFAT
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-
 /*
  * Miscellaneous configurable options
  */
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT             "=> "   /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024    /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE             256     /* Console I/O Buffer Size      */
  */
 #define CFG_DCACHE_SIZE                (32<<10) /* For AMCC 440 CPUs                   */
 #define CFG_CACHELINE_SIZE     32      /* ...                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value        */
 #endif
 
 #define BOOTFLAG_COLD  0x01            /* Normal Power-On: Boot from FLASH     */
 #define BOOTFLAG_WARM  0x02            /* Software reboot                      */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
index 624fa1d6e28da082884ff61b96529ffde8e3faed..0bb446f78447ea442d84ee57b60b0fb1507d32bc 100644 (file)
 
 #define CONFIG_BOOTARGS "mem=32M"
 
-/* Add support for a few extra bootp options like:
- *     - File size
- *     - DNS
+
+/*
+ * BOOTP options
  */
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | \
-                                CONFIG_BOOTP_BOOTFILESIZE | \
-                                CONFIG_BOOTP_DNS)
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_DNS
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_PCI
 
-#define CONFIG_COMMANDS                ( CONFIG_CMD_DFL | \
-                                 CFG_CMD_ELF    | \
-                                 CFG_CMD_I2C    | \
-                                 CFG_CMD_EEPROM | \
-                                 CFG_CMD_PCI    )
+#undef CONFIG_CMD_NET
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any)      */
-#include <cmd_confdefs.h>
 
 #define CONFIG_HUSH_PARSER     1 /* use "hush" command parser */
 #define CONFIG_BOOTDELAY       1
  */
 #define CONFIG_PCI                             /* include pci support          */
 #undef CONFIG_PCI_PNP
-#undef CFG_CMD_NET
 
 #define PCI_ENET0_IOADDR       0x80000000
 #define PCI_ENET0_MEMADDR      0x80000000
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     32      /* For MPC8240 CPU                      */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
 #endif
 
index 65dfc815548ba1bd124eb54365f87b4f06c4881e..6cb6bc4f71c815f7fb86640173f50353740c0061 100644 (file)
 #define CONFIG_LOADS_ECHO      1
 
 
-#define CONFIG_COMMANDS                        (CONFIG_CMD_DFL | \
-                                        CFG_CMD_PING   | \
-                                        CFG_CMD_ELF    | \
-                                        CFG_CMD_I2C    | \
-                                        CFG_CMD_JFFS2  | \
-                                        CFG_CMD_DATE)
-#define CONFIG_BOOTARGS "root=/dev/mtdblock0 ip=192.168.0.15:192.168.0.2:192.168.0.1:255.255.255.0:ezkit:eth0:off console=ttyBF0,57600"
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_JFFS2
+#define CONFIG_CMD_DATE
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+
+#define CONFIG_BOOTARGS "root=/dev/mtdblock0 ip=192.168.0.15:192.168.0.2:192.168.0.1:255.255.255.0:ezkit:eth0:off console=ttyBF0,57600"
 
 #define        CFG_PROMPT              "ezkit> "       /* Monitor Command Prompt */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE              1024    /* Console I/O Buffer Size */
 #else
 #define        CFG_CBSIZE              256     /* Console I/O Buffer Size */
index 79a1404a40db3e3ed291b9950c5faeac3248b914..cce6ef79f272e35fefd1a96c77f359d7f13bd3f4 100644 (file)
 
 #define CONFIG_BOOTARGS                "root=/dev/mtdblock0 rw console=ttyBF0,57600"
 
-#if (CONFIG_DRIVER_SMC91111)
-#define CONFIG_COMMANDS1       (CONFIG_CMD_DFL | \
-                                CFG_CMD_PING   | \
-                                CFG_CMD_ELF    | \
-                                CFG_CMD_CACHE  | \
-                                CFG_CMD_JFFS2  | \
-                                CFG_CMD_EEPROM | \
-                                CFG_CMD_DATE)
-
-#else
-#define CONFIG_COMMANDS1       (CONFIG_CMD_DFL | \
-                                CFG_CMD_ELF    | \
-                                CFG_CMD_CACHE  | \
-                                CFG_CMD_JFFS2  | \
-                                CFG_CMD_EEPROM | \
-                                CFG_CMD_DATE)
-#endif
 
 #if (BFIN_BOOT_MODE == BF533_BYPASS_BOOT)
 #if (CONFIG_DRIVER_SMC91111)
 #endif
 #endif
 
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_CACHE
+#define CONFIG_CMD_JFFS2
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_DATE
+
+#if (CONFIG_DRIVER_SMC91111)
+#define CONFIG_CMD_PING
+#endif
+
 #if (CONFIG_SOFT_I2C)
-#define CONFIG_COMMANDS2   CFG_CMD_I2C
-#else
-#define CONFIG_COMMANDS2 0
-#endif /* CONFIG_SOFT_I2C */
+#define CONFIG_CMD_I2C
+#endif
 
 #if (BFIN_BOOT_MODE == BF533_BYPASS_BOOT)
-#define CONFIG_COMMANDS  ( CONFIG_COMMANDS1 | CONFIG_COMMANDS2 | CFG_CMD_DHCP)
-#elif (BFIN_BOOT_MODE == BF533_SPI_BOOT)
-#define CONFIG_COMMANDS  ( CONFIG_COMMANDS1 | CONFIG_COMMANDS2)
+#define CONFIG_CMD_DHCP
 #endif
 
-/* This must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
 
 /*
  * Console settings
 #endif
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size */
 /* Enabled below option for CF support */
 /* #define CONFIG_STAMP_CF     1 */
 
-#if defined(CONFIG_STAMP_CF) && (CONFIG_COMMANDS & CFG_CMD_IDE)
+#if defined(CONFIG_STAMP_CF) && defined(CONFIG_CMD_IDE)
 
 #define CONFIG_MISC_INIT_R     1
 #define CONFIG_DOS_PARTITION   1
index f6755acf694e67c6722e5b752ff5d55c2ae35829..b9a9e3cb79203294f9320bc4cc920be7a20d8353 100644 (file)
 #endif
 
 #ifdef CONFIG_POST
-#define CFG_CMD_POST_DIAG      CFG_CMD_DIAG
 #define FLASH_START_POST_BLOCK 11      /* Should > = 11 */
 #define FLASH_END_POST_BLOCK   71      /* Should < = 71 */
-#else
-#define CFG_CMD_POST_DIAG      0
 #endif
 
 /* CF-CARD IDE-HDD Support */
 
 #if defined(CONFIG_BFIN_CF_IDE) || defined(CONFIG_BFIN_HDD_IDE) || defined(CONFIG_BFIN_TRUE_IDE)
 # define CONFIG_BFIN_IDE       1
-# define ADD_IDE_CMD           CFG_CMD_IDE
-#else
-# define ADD_IDE_CMD           0
 #endif
 
 /*#define CONFIG_BF537_NAND */         /* Add nand flash support */
 
-#ifdef CONFIG_BF537_NAND
-# define ADD_NAND_CMD          CFG_CMD_NAND
-#else
-# define ADD_NAND_CMD          0
-#endif
-
 #define CONFIG_NETCONSOLE      1
 #define CONFIG_NET_MULTI       1
 
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#if (BFIN_BOOT_MODE == BF537_BYPASS_BOOT) || (BFIN_BOOT_MODE == BF537_SPI_MASTER_BOOT)
+
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_CACHE
+#define CONFIG_CMD_JFFS2
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_DATE
+
 #if (BFIN_CPU == ADSP_BF534)
-#define CONFIG_BFIN_CMD                (CONFIG_CMD_DFL & ~CFG_CMD_NET)
+#undef CONFIG_CMD_NET
 #else
-#define CONFIG_BFIN_CMD                (CONFIG_CMD_DFL | CFG_CMD_PING)
+#define CONFIG_CMD_PING
+#endif
+
+#if defined(CONFIG_BFIN_CF_IDE) \
+       || defined(CONFIG_BFIN_HDD_IDE) \
+       || defined(CONFIG_BFIN_TRUE_IDE)
+#define CONFIG_CMD_IDE
+#endif
+
 #endif
 
 #if (BFIN_BOOT_MODE == BF537_BYPASS_BOOT)
-#define CONFIG_COMMANDS                (CONFIG_BFIN_CMD| \
-                                CFG_CMD_ELF    | \
-                                CFG_CMD_I2C    | \
-                                CFG_CMD_CACHE  | \
-                                CFG_CMD_JFFS2  | \
-                                CFG_CMD_EEPROM | \
-                                CFG_CMD_DHCP   | \
-                                ADD_IDE_CMD    | \
-                                ADD_NAND_CMD   | \
-                                CFG_CMD_POST_DIAG | \
-                                CFG_CMD_DATE)
-#elif (BFIN_BOOT_MODE == BF537_SPI_MASTER_BOOT)
-#define CONFIG_COMMANDS                (CONFIG_BFIN_CMD| \
-                                CFG_CMD_ELF    | \
-                                CFG_CMD_I2C    | \
-                                CFG_CMD_CACHE  | \
-                                CFG_CMD_JFFS2  | \
-                                CFG_CMD_EEPROM | \
-                                ADD_IDE_CMD    | \
-                                CFG_CMD_DATE)
+
+#define CONFIG_CMD_DHCP
+
+#if defined(CONFIG_POST)
+#define CONFIG_CMD_DIAG
 #endif
 
+#ifdef CONFIG_BF537_NAND
+#define CONFIG_CMD_NAND
+#endif
+
+#endif
+
+
 #define CONFIG_BOOTARGS "root=/dev/mtdblock0 rw console=ttyBF0,57600"
 #define CONFIG_LOADADDR        0x1000000
 
 #endif
 #endif
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-
 #if (BFIN_BOOT_MODE == BF537_SPI_MASTER_BOOT)
 #if (BFIN_CPU == ADSP_BF534)
 #define        CFG_PROMPT              "serial_bf534> "        /* Monitor Command Prompt */
 #endif
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE              1024    /* Console I/O Buffer Size */
 #else
 #define        CFG_CBSIZE              256     /* Console I/O Buffer Size */
index 8d826faaa0d99d0fdf162d9cad3e1015067664f5..29662604f99266e7d2d5847501619ffd5da22ac8 100644 (file)
 #define CONFIG_BOOTARGS                "root=/dev/mtdblock0 rw console=ttyBF0,57600"
 
 #if (CONFIG_DRIVER_SMC91111)
-#define CONFIG_COMMANDS1       (CONFIG_CMD_DFL | \
-                                CFG_CMD_PING   | \
-                                CFG_CMD_ELF    | \
-                                CFG_CMD_CACHE  | \
-                                CFG_CMD_JFFS2  | \
-                                CFG_CMD_DHCP)
 #define CONFIG_EXTRA_ENV_SETTINGS \
        "ramargs=setenv bootargs root=/dev/mtdblock0 rw console=ttyBF0,57600\0"                 \
        "nfsargs=setenv bootargs root=/dev/nfs rw nfsroot=$(serverip):" \
                "cp.b $(loadaddr) 0x20000000 $(filesize)\0" \
        ""
 #else
-#define CONFIG_COMMANDS1       (CONFIG_CMD_DFL | \
-                                CFG_CMD_ELF    | \
-                                CFG_CMD_CACHE  | \
-                                CFG_CMD_JFFS2)
 #define CONFIG_EXTRA_ENV_SETTINGS \
        "ramargs=setenv bootargs root=/dev/mtdblock0 rw console=ttyBF0,57600\0"         \
        "flashboot=bootm 0x20100000\0"                                  \
        ""
 #endif
 
-#define CONFIG_COMMANDS ( CONFIG_COMMANDS1 | CONFIG_COMMANDS2 )
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_CACHE
+#define CONFIG_CMD_JFFS2
+
+#if defined(CONFIG_DRIVER_SMC91111)
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_DHCP
+#endif
+
 
 /*
  * Console settings
 
 #define        CFG_PROMPT              "ezkit> "       /* Monitor Command Prompt */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE              1024            /* Console I/O Buffer Size */
 #else
 #define        CFG_CBSIZE              256             /* Console I/O Buffer Size */
index 10c48143117c4fe643492876c9c5f479251adb88..7736a1e32d0668a986dd7729689d8448d892dc6c 100644 (file)
 
 #define CONFIG_RTC_DS174x      1       /* use DS1743 RTC in Bubinga    */
 
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_CACHE   | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_NET     | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_REGINFO | \
-                               CFG_CMD_SDRAM   | \
-                               CFG_CMD_SNTP    )
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_CACHE
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_SDRAM
+#define CONFIG_CMD_SNTP
+
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
  */
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT     "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
 #define CFG_I2C_NOPROBES       { 0x69 }        /* avoid iprobe hangup (why?) */
 #define CFG_EEPROM_PAGE_WRITE_DELAY_MS 6       /* 24C02 requires 5ms delay */
 
-#if (CONFIG_COMMANDS & CFG_CMD_EEPROM)
+#if defined(CONFIG_CMD_EEPROM)
 #define CFG_I2C_EEPROM_ADDR    0x50    /* I2C boot EEPROM (24C02W)     */
 #define CFG_I2C_EEPROM_ADDR_LEN        1       /* Bytes of address             */
 #endif
  */
 #define CFG_DCACHE_SIZE                16384   /* For AMCC 405EP CPU                   */
 #define CFG_CACHELINE_SIZE     32      /* ...                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value        */
 #endif
 
 #define BOOTFLAG_COLD  0x01            /* Normal Power-On: Boot from FLASH     */
 #define BOOTFLAG_WARM  0x02            /* Software reboot                      */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
index ae75539c37aabee0b57af3a4a83efdf90cffcdf9..a9a52547756fa16252120fe4ec08d41a1deadc68 100644 (file)
 
 #undef CONFIG_CAN_DRIVER               /* CAN Driver support disabled  */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
 
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 
 #define        CONFIG_RTC_MPC8xx               /* use internal RTC of MPC8xx   */
 
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_IDE     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_SNTP    )
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_SNTP
+
 
 /*
  * Miscellaneous configurable options
 #define        CFG_PROMPT_HUSH_PS2     "> "
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE              1024    /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE              256     /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index ec6d57e1e69c9cf86d7f3b63eb1c3a1efb984101..d577b95e05decba247d0b5867922e981c000b07d 100644 (file)
 #define BOOTFLAG_COLD          0x01    /* Normal Power-On: Boot from FLASH  */
 #define BOOTFLAG_WARM          0x02    /* Software reboot           */
 
-#define CFG_CACHELINE_SIZE     32      /* For MPC5xxx CPUs */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
-#  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
-#endif
-
 #define CONFIG_BOARD_EARLY_INIT_R
 
 /*
 #define CONFIG_BAUDRATE                115200  /* ... at 115200 bps */
 #define CFG_BAUDRATE_TABLE     { 9600, 19200, 38400, 57600, 115200, 230400 }
 
+
 /*
- * Supported commands
+ * BOOTP options
  */
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_IMMAP   | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_REGINFO | \
-                               CFG_CMD_SNTP    )
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_IMMAP
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_SNTP
+
 
 /*
  * MUST be low boot - HIGHBOOT is not supported anymore
  */
 #define CFG_LONGHELP                   /* undef to save memory     */
 #define CFG_PROMPT             "=> "   /* Monitor Command Prompt   */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #  define CFG_CBSIZE           1024    /* Console I/O Buffer Size  */
 #else
 #  define CFG_CBSIZE           256     /* Console I/O Buffer Size  */
 
 #define CONFIG_RTC_MPC5200     1       /* use internal MPC5200 RTC */
 
+#define CFG_CACHELINE_SIZE     32      /* For MPC5xxx CPUs */
+#if defined(CONFIG_CMD_KGDB)
+#  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
+#endif
+
 /*
  * Various low-level settings
  */
index 6997c7a6f4378ae71d41672060e0e9faada1a468..e06735da631faa33411e86b57090b23518d442c6 100644 (file)
 
 /* allow to overwrite serial and ethaddr */
 #define CONFIG_ENV_OVERWRITE
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL)
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
 
 #define CONFIG_BOOTDELAY       3
 #define CONFIG_ETHADDR         00:D0:CA:F1:3C:D2
@@ -75,7 +86,7 @@
 #define CONFIG_BOOTARGS                "root=/dev/mtdblock3 rootfstype=jffs2 console=ttyS0,38400"
 #define CONFIG_CMDLINE_TAG
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2               /* which serial port to use */
 #endif
diff --git a/include/configs/cm1_qp1.h b/include/configs/cm1_qp1.h
deleted file mode 100644 (file)
index effa41c..0000000
+++ /dev/null
@@ -1,358 +0,0 @@
-/*
- * (C) Copyright 2003-2007
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-/*
- * High Level Configuration Options
- */
-#define CONFIG_MPC5xxx         1       /* This is an MPC5xxx CPU */
-#define CONFIG_MPC5200         1       /* (more precisely an MPC5200 CPU) */
-#define CONFIG_CM1_QP1         1       /* ... on CM1.QP1 module */
-
-
-/*
- * Supported commands
- */
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_ECHO    | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_FLASH   | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_DIAG    | \
-                               CFG_CMD_REGINFO | \
-                               CFG_CMD_SNTP    | \
-                               CFG_CMD_BSP     | \
-                               CFG_CMD_USB     | \
-                               CFG_CMD_FAT     | \
-                               CFG_CMD_JFFS2)
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-
-
-/*
- * Serial console configuration
- */
-#define CONFIG_PSC_CONSOLE     1       /* console is on PSC1 */
-#define CONFIG_BAUDRATE                57600   /* ... at 57600 bps */
-#define CFG_BAUDRATE_TABLE     { 9600, 19200, 38400, 57600, 115200, 230400 }
-
-
-/*
- * Ethernet configuration
- */
-#define CONFIG_MPC5xxx_FEC     1
-#define CONFIG_PHY_ADDR                0x00
-#define CONFIG_ENV_OVERWRITE   1       /* allow overwriting of ethaddr */
-/* use misc_init_r() to read ethaddr from I2C EEPROM (see CFG_I2C_EEPROM) */
-#define CONFIG_MISC_INIT_R     1
-#define CONFIG_MAC_OFFSET      0x35    /* MAC address offset in I2C EEPROM */
-
-
-/*
- * POST support
- */
-#define CONFIG_POST            (CFG_POST_MEMORY | CFG_POST_CPU | CFG_POST_I2C)
-#define MPC5XXX_SRAM_POST_SIZE (MPC5XXX_SRAM_SIZE - 4)
-/* List of I2C addresses to be verified by POST */
-#define I2C_ADDR_LIST          { CFG_I2C_SLAVE, CFG_I2C_IO, CFG_I2C_EEPROM }
-
-
-/* display image timestamps */
-#define CONFIG_TIMESTAMP       1
-
-
-/*
- * Autobooting
- */
-#define CONFIG_BOOTDELAY       5       /* autoboot after 5 seconds */
-#define CONFIG_PREBOOT "echo;" \
-       "echo Type \"run net_nfs_fdt\" to mount root filesystem over NFS;" \
-       "echo"
-#undef CONFIG_BOOTARGS
-
-/*
- * Default environment settings
- */
-#define CONFIG_EXTRA_ENV_SETTINGS                                      \
-       "netdev=eth0\0"                                                 \
-       "hostname=cm1_qp1\0"                                            \
-       "netmask=255.255.0.0\0"                                         \
-       "ipaddr=192.168.160.33\0"                                       \
-       "serverip=192.168.1.1\0"                                        \
-       "gatewayip=192.168.1.1\0"                                       \
-       "console=ttyPSC0\0"                                             \
-       "u-boot_addr=100000\0"                                          \
-       "kernel_addr=200000\0"                                          \
-       "kernel_addr_flash=fc0c0000\0"                                  \
-       "fdt_addr=400000\0"                                             \
-       "fdt_addr_flash=fc0a0000\0"                                     \
-       "ramdisk_addr=500000\0"                                         \
-       "rootpath=/opt/eldk-4.1/ppc_6xx\0"                              \
-       "u-boot=/tftpboot/cm1_qp1/u-boot.bin\0"                         \
-       "bootfile=/tftpboot/cm1_qp1/uImage\0"                           \
-       "fdt_file=/tftpboot/cm1_qp1/cm1_qp1.dtb\0"                      \
-       "load=tftp ${u-boot_addr} ${u-boot}\0"                          \
-       "update=prot off fc000000 fc05ffff; era fc000000 fc05ffff; "    \
-               "cp.b ${u-boot_addr} fc000000 ${filesize}; "            \
-               "prot on fc000000 fc05ffff\0"                           \
-       "nfsargs=setenv bootargs root=/dev/nfs rw "                     \
-               "nfsroot=${serverip}:${rootpath}\0"                     \
-       "flashargs=setenv bootargs root=/dev/mtdblock5 rw\0"            \
-       "addmtd=setenv bootargs ${bootargs} ${mtdparts}\0"              \
-       "addinit=setenv bootargs ${bootargs} init=/linuxrc\0"           \
-       "addcons=setenv bootargs ${bootargs} "                          \
-               "console=${console},${baudrate}\0"                      \
-       "addip=setenv bootargs ${bootargs} "                            \
-               "ip=${ipaddr}:${serverip}:${gatewayip}:"                \
-               "${netmask}:${hostname}:${netdev}:off panic=1\0"        \
-       "flash_flash=run flashargs addinit addip addcons;"              \
-               "bootm ${kernel_addr_flash} - ${fdt_addr_flash}\0"      \
-       "net_nfs_fdt=tftp ${kernel_addr} ${bootfile_fdt}; "             \
-               "tftp ${fdt_addr} ${fdt_file}; run nfsargs addip "      \
-               "addcons; bootm ${kernel_addr} - ${fdt_addr}\0"         \
-       ""
-#define CONFIG_BOOTCOMMAND     "run flash_flash"
-
-
-/*
- * Low level configuration
- */
-
-
-/*
- * Clock configuration
- */
-#define CFG_MPC5XXX_CLKIN      33000000        /* SYS_XTAL_IN = 33MHz */
-#define CFG_IPBCLK_EQUALS_XLBCLK       1       /* IPB = 133MHz */
-
-
-/*
- * Memory map
- */
-#define CFG_MBAR               0xF0000000
-#define CFG_SDRAM_BASE         0x00000000
-#define CFG_DEFAULT_MBAR       0x80000000
-
-#define CFG_LOWBOOT            1
-
-/* Use ON-Chip SRAM until RAM will be available */
-#define CFG_INIT_RAM_ADDR      MPC5XXX_SRAM
-#ifdef CONFIG_POST
-/* preserve space for the post_word at end of on-chip SRAM */
-#define CFG_INIT_RAM_END       MPC5XXX_SRAM_POST_SIZE
-#else
-#define CFG_INIT_RAM_END       MPC5XXX_SRAM_SIZE
-#endif
-
-#define CFG_GBL_DATA_SIZE      128     /* size in bytes for initial data */
-#define CFG_GBL_DATA_OFFSET    (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
-#define CFG_INIT_SP_OFFSET     CFG_GBL_DATA_OFFSET
-
-#define CFG_MONITOR_BASE       TEXT_BASE
-#define CFG_MONITOR_LEN                (384 << 10)     /* 384 kB for Monitor */
-#define CFG_MALLOC_LEN         (256 << 10)     /* 256 kB for malloc() */
-#define CFG_BOOTMAPSZ          (8 << 20)       /* initial mem map for Linux */
-
-#if (CFG_MONITOR_BASE < CFG_FLASH_BASE)
-#define CFG_RAMBOOT            1
-#endif
-
-
-/*
- * Chip selects configuration
- */
-/* Boot Chipselect */
-#define CFG_BOOTCS_START       CFG_FLASH_BASE
-#define CFG_BOOTCS_SIZE                CFG_FLASH_SIZE
-#define CFG_BOOTCS_CFG         0x00087D31      /* for pci_clk = 33 MHz */
-/* use board_early_init_r to enable flash write in CS_BOOT */
-#define CONFIG_BOARD_EARLY_INIT_R
-
-/* Flash memory addressing */
-#define CFG_CS0_START          CFG_FLASH_BASE
-#define CFG_CS0_SIZE           CFG_FLASH_SIZE
-
-/* No burst, dead cycle = 1 for CS0 (Flash) */
-#define CFG_CS_BURST           0x00000000
-#define CFG_CS_DEADCYCLE       0x00000001
-
-
-/*
- * SDRAM configuration
- * settings for k4s561632E-xx75, assuming XLB = 132 MHz
- */
-#define SDRAM_MODE     0x00CD0000      /* CASL 3, burst length 8 */
-#define SDRAM_CONTROL  0x514F0000
-#define SDRAM_CONFIG1  0xE2333900
-#define SDRAM_CONFIG2  0x8EE70000
-
-
-/*
- * Flash configuration
- */
-#define CFG_FLASH_CFI          1
-#define CFG_FLASH_CFI_DRIVER   1
-#define CFG_FLASH_BASE         TEXT_BASE
-/* we need these despite using CFI */
-#define CFG_MAX_FLASH_BANKS    1       /* max num of flash banks */
-#define CFG_MAX_FLASH_SECT     256     /* max num of sectors on one chip */
-#define CFG_FLASH_SIZE         0x02000000 /* 32 MiB */
-
-
-/*
- * MTD configuration
- */
-#define CONFIG_JFFS2_CMDLINE   1
-#define MTDIDS_DEFAULT         "nor0=cm1qp1-0"
-#define MTDPARTS_DEFAULT       "mtdparts=cm1qp1-0:"                    \
-                                       "384k(uboot),128k(env),"        \
-                                       "128k(redund_env),128k(dtb),"   \
-                                       "2m(kernel),27904k(rootfs),"    \
-                                       "-(config)"
-
-
-/*
- * I2C configuration
- */
-#define CONFIG_HARD_I2C                1       /* I2C with hardware support */
-#define CFG_I2C_MODULE         2       /* Select I2C module #2 */
-#define CFG_I2C_SPEED          40000   /* 40 kHz */
-#define CFG_I2C_SLAVE          0x0
-#define CFG_I2C_IO             0x38    /* PCA9554AD I2C I/O port address */
-#define CFG_I2C_EEPROM         0x53    /* I2C EEPROM device address */
-
-
-/*
- * RTC configuration
- */
-#define CONFIG_RTC_MPC5200     1       /* use internal MPC5200 RTC */
-
-
-/*
- * USB configuration
- */
-#define CONFIG_USB_OHCI                1
-#define CONFIG_USB_STORAGE     1
-#define CONFIG_USB_CLOCK       0x0001BBBB
-#define CONFIG_USB_CONFIG      0x00001000
-/* Partitions (for USB) */
-#define CONFIG_MAC_PARTITION   1
-#define CONFIG_DOS_PARTITION   1
-#define CONFIG_ISO_PARTITION   1
-
-/*
- * Invoke our last_stage_init function - needed by fwupdate
- */
-#define CONFIG_LAST_STAGE_INIT 1
-
-/*
- * Environment settings
- */
-#define CFG_ENV_IS_IN_FLASH    1
-#define CFG_ENV_SIZE           0x10000
-#define CFG_ENV_SECT_SIZE      0x20000
-#define CFG_ENV_ADDR           (CFG_FLASH_BASE + CFG_MONITOR_LEN)
-/* Configuration of redundant environment */
-#define CFG_ENV_ADDR_REDUND    (CFG_ENV_ADDR + CFG_ENV_SECT_SIZE)
-#define CFG_ENV_SIZE_REDUND    (CFG_ENV_SIZE)
-
-
-/*
- * Pin multiplexing configuration
- */
-
-/*
- * CS1/GPIO_WKUP_6: GPIO (default)
- * ALTs: CAN1 on I2C1, CAN2 on TIMER0/1
- * IRDA/PSC6: UART
- * Ether: Ethernet 100Mbit with MD
- * PCI_DIS: PCI controller disabled
- * USB: USB
- * PSC3: SPI with UART3
- * PSC2: UART
- * PSC1: UART
- */
-#define CFG_GPS_PORT_CONFIG    0x10559C44
-
-
-/*
- * Miscellaneous configurable options
- */
-#define CFG_LONGHELP           1       /* undef to save memory */
-#define CFG_PROMPT             "=> "   /* Monitor Command Prompt */
-#define CFG_CBSIZE             1024    /* Console I/O Buffer Size */
-#define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16) /* Print Buffer Size */
-#define CFG_MAXARGS            16      /* max number of command args */
-#define CFG_BARGSIZE           CFG_CBSIZE      /* Boot Argument Buffer Size */
-
-#define CFG_ALT_MEMTEST                1
-#define CFG_MEMTEST_START      0x00100000      /* memtest works on */
-#define CFG_MEMTEST_END                0x03f00000      /* 1 .. 63 MiB in SDRAM */
-
-#define CONFIG_LOOPW           1
-
-#define CFG_LOAD_ADDR          0x100000        /* default load address */
-#define CFG_HZ                 1000    /* decrementer freq: 1 ms ticks */
-
-
-/*
- * Various low-level settings
- */
-#define CFG_HID0_INIT          HID0_ICE | HID0_ICFI
-#define CFG_HID0_FINAL         HID0_ICE
-
-#define BOOTFLAG_COLD          0x01    /* Normal Power-On: Boot from FLASH */
-#define BOOTFLAG_WARM          0x02    /* Software reboot */
-
-#define CFG_XLB_PIPELINING     1       /* enable transaction pipeling */
-
-
-/*
- * Cache Configuration
- */
-#define CFG_CACHELINE_SIZE     32      /* For MPC5xxx CPUs */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
-#define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value */
-#endif
-
-
-/*
- * Flat Device Tree support
- */
-#define CONFIG_OF_FLAT_TREE    1
-#define CONFIG_OF_BOARD_SETUP  1
-#define OF_FLAT_TREE_MAX_SIZE  8192    /* max size of the flat tree (8K) */
-#define OF_CPU                 "PowerPC,5200@0"
-#define OF_SOC                 "soc5200@f0000000"
-#define OF_TBCLK               (bd->bi_busfreq / 4)
-#define OF_STDOUT_PATH         "/soc5200@f0000000/serial@2000"
-
-#endif /* __CONFIG_H */
index 5947c2a3193e128753def69c8fde5f8d37fe5d89..ae40b358e951e06c80c5c69069a26a409ff7b73f 100644 (file)
 #define CONFIG_BAUDRATE                115200
 #define CFG_BAUDRATE_TABLE     { 9600, 19200, 38400, 57600, 115200 }
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-#undef CONFIG_COMMANDS
-#define        CONFIG_COMMANDS         (CONFIG_CMD_DFL & ~(CFG_CMD_NONSTD | CFG_CMD_ENV))
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#undef CONFIG_CMD_ENV
+
 
 #define CONFIG_BOOTDELAY       0
 #define CONFIG_BOOTARGS                "mem=16M console=ttyAM0,115200"
index e62fc06337b242c24b991a786ead0ce489840acc..c1dd33d1d25bb431e002430f1aa45cfc729205f3 100644 (file)
 #define CONFIG_BAUDRATE                115200
 #define CFG_BAUDRATE_TABLE     { 9600, 19200, 38400, 57600, 115200 }
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-#undef CONFIG_COMMANDS
-#define        CONFIG_COMMANDS         (CONFIG_CMD_DFL & ~(CFG_CMD_NONSTD | CFG_CMD_ENV))
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#undef CONFIG_CMD_ENV
+
 
 #define CONFIG_BOOTDELAY       0
 #define CONFIG_BOOTARGS                "mem=32M console=ttyAM0,115200"
diff --git a/include/configs/cm5200.h b/include/configs/cm5200.h
new file mode 100644 (file)
index 0000000..7662856
--- /dev/null
@@ -0,0 +1,362 @@
+/*
+ * (C) Copyright 2003-2007
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+/*
+ * High Level Configuration Options
+ */
+#define CONFIG_MPC5xxx         1       /* This is an MPC5xxx CPU */
+#define CONFIG_MPC5200         1       /* (more precisely an MPC5200 CPU) */
+#define CONFIG_CM5200          1       /* ... on CM5200 platform */
+
+
+/*
+ * Supported commands
+ */
+#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
+                               CFG_CMD_ASKENV  | \
+                               CFG_CMD_DATE    | \
+                               CFG_CMD_DHCP    | \
+                               CFG_CMD_ECHO    | \
+                               CFG_CMD_I2C     | \
+                               CFG_CMD_FLASH   | \
+                               CFG_CMD_MII     | \
+                               CFG_CMD_NFS     | \
+                               CFG_CMD_PING    | \
+                               CFG_CMD_DIAG    | \
+                               CFG_CMD_REGINFO | \
+                               CFG_CMD_SNTP    | \
+                               CFG_CMD_BSP     | \
+                               CFG_CMD_USB     | \
+                               CFG_CMD_FAT     | \
+                               CFG_CMD_JFFS2)
+
+/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
+#include <cmd_confdefs.h>
+
+
+/*
+ * Serial console configuration
+ */
+#define CONFIG_PSC_CONSOLE     1       /* console is on PSC1 */
+#define CONFIG_BAUDRATE                57600   /* ... at 57600 bps */
+#define CFG_BAUDRATE_TABLE     { 9600, 19200, 38400, 57600, 115200, 230400 }
+#define CONFIG_SILENT_CONSOLE  1       /* needed to silence i2c_init() */
+
+
+/*
+ * Ethernet configuration
+ */
+#define CONFIG_MPC5xxx_FEC     1
+#define CONFIG_PHY_ADDR                0x00
+#define CONFIG_ENV_OVERWRITE   1       /* allow overwriting of ethaddr */
+/* use misc_init_r() to read ethaddr from I2C EEPROM (see CFG_I2C_EEPROM) */
+#define CONFIG_MISC_INIT_R     1
+#define CONFIG_MAC_OFFSET      0x35    /* MAC address offset in I2C EEPROM */
+
+
+/*
+ * POST support
+ */
+#define CONFIG_POST            (CFG_POST_MEMORY | CFG_POST_CPU | CFG_POST_I2C)
+#define MPC5XXX_SRAM_POST_SIZE (MPC5XXX_SRAM_SIZE - 4)
+/* List of I2C addresses to be verified by POST */
+#define I2C_ADDR_LIST          { CFG_I2C_SLAVE, CFG_I2C_IO, CFG_I2C_EEPROM }
+
+
+/* display image timestamps */
+#define CONFIG_TIMESTAMP       1
+
+
+/*
+ * Autobooting
+ */
+#define CONFIG_BOOTDELAY       5       /* autoboot after 5 seconds */
+#define CONFIG_PREBOOT "echo;" \
+       "echo Type \"run net_nfs_fdt\" to mount root filesystem over NFS;" \
+       "echo"
+#undef CONFIG_BOOTARGS
+
+/*
+ * Default environment settings
+ */
+#define CONFIG_EXTRA_ENV_SETTINGS                                      \
+       "netdev=eth0\0"                                                 \
+       "netmask=255.255.0.0\0"                                         \
+       "ipaddr=192.168.160.33\0"                                       \
+       "serverip=192.168.1.1\0"                                        \
+       "gatewayip=192.168.1.1\0"                                       \
+       "console=ttyPSC0\0"                                             \
+       "u-boot_addr=100000\0"                                          \
+       "kernel_addr=200000\0"                                          \
+       "kernel_addr_flash=fc0c0000\0"                                  \
+       "fdt_addr=400000\0"                                             \
+       "fdt_addr_flash=fc0a0000\0"                                     \
+       "ramdisk_addr=500000\0"                                         \
+       "rootpath=/opt/eldk-4.1/ppc_6xx\0"                              \
+       "u-boot=/tftpboot/cm5200/u-boot.bin\0"                          \
+       "bootfile_fdt=/tftpboot/cm5200/uImage\0"                        \
+       "fdt_file=/tftpboot/cm5200/cm5200.dtb\0"                        \
+       "load=tftp ${u-boot_addr} ${u-boot}\0"                          \
+       "update=prot off fc000000 +${filesize}; "                       \
+               "era fc000000 +${filesize}; "                           \
+               "cp.b ${u-boot_addr} fc000000 ${filesize}; "            \
+               "prot on fc000000 +${filesize}\0"                       \
+       "nfsargs=setenv bootargs root=/dev/nfs rw "                     \
+               "nfsroot=${serverip}:${rootpath}\0"                     \
+       "flashargs=setenv bootargs root=/dev/mtdblock5 rw\0"            \
+       "addmtd=setenv bootargs ${bootargs} ${mtdparts}\0"              \
+       "addinit=setenv bootargs ${bootargs} init=/linuxrc\0"           \
+       "addcons=setenv bootargs ${bootargs} "                          \
+               "console=${console},${baudrate}\0"                      \
+       "addip=setenv bootargs ${bootargs} "                            \
+               "ip=${ipaddr}:${serverip}:${gatewayip}:"                \
+               "${netmask}:${hostname}:${netdev}:off panic=1\0"        \
+       "flash_flash=run flashargs addinit addip addcons;"              \
+               "bootm ${kernel_addr_flash} - ${fdt_addr_flash}\0"      \
+       "net_nfs_fdt=tftp ${kernel_addr} ${bootfile_fdt}; "             \
+               "tftp ${fdt_addr} ${fdt_file}; run nfsargs addip "      \
+               "addcons; bootm ${kernel_addr} - ${fdt_addr}\0"         \
+       ""
+#define CONFIG_BOOTCOMMAND     "run flash_flash"
+
+
+/*
+ * Low level configuration
+ */
+
+
+/*
+ * Clock configuration
+ */
+#define CFG_MPC5XXX_CLKIN      33000000        /* SYS_XTAL_IN = 33MHz */
+#define CFG_IPBCLK_EQUALS_XLBCLK       1       /* IPB = 133MHz */
+
+
+/*
+ * Memory map
+ */
+#define CFG_MBAR               0xF0000000
+#define CFG_SDRAM_BASE         0x00000000
+#define CFG_DEFAULT_MBAR       0x80000000
+
+#define CFG_LOWBOOT            1
+
+/* Use ON-Chip SRAM until RAM will be available */
+#define CFG_INIT_RAM_ADDR      MPC5XXX_SRAM
+#ifdef CONFIG_POST
+/* preserve space for the post_word at end of on-chip SRAM */
+#define CFG_INIT_RAM_END       MPC5XXX_SRAM_POST_SIZE
+#else
+#define CFG_INIT_RAM_END       MPC5XXX_SRAM_SIZE
+#endif
+
+#define CFG_GBL_DATA_SIZE      128     /* size in bytes for initial data */
+#define CFG_GBL_DATA_OFFSET    (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
+#define CONFIG_BOARD_TYPES     1       /* we use board_type */
+
+#define CFG_INIT_SP_OFFSET     CFG_GBL_DATA_OFFSET
+
+#define CFG_MONITOR_BASE       TEXT_BASE
+#define CFG_MONITOR_LEN                (384 << 10)     /* 384 kB for Monitor */
+#define CFG_MALLOC_LEN         (256 << 10)     /* 256 kB for malloc() */
+#define CFG_BOOTMAPSZ          (8 << 20)       /* initial mem map for Linux */
+
+/*
+ * Flash configuration
+ */
+#define CFG_FLASH_CFI          1
+#define CFG_FLASH_CFI_DRIVER   1
+#define CFG_FLASH_BASE         0xfc000000      
+/* we need these despite using CFI */
+#define CFG_MAX_FLASH_BANKS    1       /* max num of flash banks */
+#define CFG_MAX_FLASH_SECT     256     /* max num of sectors on one chip */
+#define CFG_FLASH_SIZE         0x02000000 /* 32 MiB */
+
+
+#if (CFG_MONITOR_BASE < CFG_FLASH_BASE)
+#define CFG_RAMBOOT            1
+#undef CFG_LOWBOOT
+#endif
+
+
+/*
+ * Chip selects configuration
+ */
+/* Boot Chipselect */
+#define CFG_BOOTCS_START       CFG_FLASH_BASE
+#define CFG_BOOTCS_SIZE                CFG_FLASH_SIZE
+#define CFG_BOOTCS_CFG         0x00087D31      /* for pci_clk = 33 MHz */
+/* use board_early_init_r to enable flash write in CS_BOOT */
+#define CONFIG_BOARD_EARLY_INIT_R
+
+/* Flash memory addressing */
+#define CFG_CS0_START          CFG_FLASH_BASE
+#define CFG_CS0_SIZE           CFG_FLASH_SIZE
+
+/* No burst, dead cycle = 1 for CS0 (Flash) */
+#define CFG_CS_BURST           0x00000000
+#define CFG_CS_DEADCYCLE       0x00000001
+
+
+/*
+ * SDRAM configuration
+ * settings for k4s561632E-xx75, assuming XLB = 132 MHz
+ */
+#define SDRAM_MODE     0x00CD0000      /* CASL 3, burst length 8 */
+#define SDRAM_CONTROL  0x514F0000
+#define SDRAM_CONFIG1  0xE2333900
+#define SDRAM_CONFIG2  0x8EE70000
+
+
+
+/*
+ * MTD configuration
+ */
+#define CONFIG_JFFS2_CMDLINE   1
+#define MTDIDS_DEFAULT         "nor0=cm5200-0"
+#define MTDPARTS_DEFAULT       "mtdparts=cm5200-0:"                    \
+                                       "384k(uboot),128k(env),"        \
+                                       "128k(redund_env),128k(dtb),"   \
+                                       "2m(kernel),27904k(rootfs),"    \
+                                       "-(config)"
+
+
+/*
+ * I2C configuration
+ */
+#define CONFIG_HARD_I2C                1       /* I2C with hardware support */
+#define CFG_I2C_MODULE         2       /* Select I2C module #2 */
+#define CFG_I2C_SPEED          40000   /* 40 kHz */
+#define CFG_I2C_SLAVE          0x0
+#define CFG_I2C_IO             0x38    /* PCA9554AD I2C I/O port address */
+#define CFG_I2C_EEPROM         0x53    /* I2C EEPROM device address */
+
+
+/*
+ * RTC configuration
+ */
+#define CONFIG_RTC_MPC5200     1       /* use internal MPC5200 RTC */
+
+
+/*
+ * USB configuration
+ */
+#define CONFIG_USB_OHCI                1
+#define CONFIG_USB_STORAGE     1
+#define CONFIG_USB_CLOCK       0x0001BBBB
+#define CONFIG_USB_CONFIG      0x00001000
+/* Partitions (for USB) */
+#define CONFIG_MAC_PARTITION   1
+#define CONFIG_DOS_PARTITION   1
+#define CONFIG_ISO_PARTITION   1
+
+/*
+ * Invoke our last_stage_init function - needed by fwupdate
+ */
+#define CONFIG_LAST_STAGE_INIT 1
+
+/*
+ * Environment settings
+ */
+#define CFG_ENV_IS_IN_FLASH    1
+#define CFG_ENV_SIZE           0x10000
+#define CFG_ENV_SECT_SIZE      0x20000
+#define CFG_ENV_ADDR           (CFG_FLASH_BASE + CFG_MONITOR_LEN)
+/* Configuration of redundant environment */
+#define CFG_ENV_ADDR_REDUND    (CFG_ENV_ADDR + CFG_ENV_SECT_SIZE)
+#define CFG_ENV_SIZE_REDUND    (CFG_ENV_SIZE)
+
+
+/*
+ * Pin multiplexing configuration
+ */
+
+/*
+ * CS1/GPIO_WKUP_6: GPIO (default)
+ * ALTs: CAN1 on I2C1, CAN2 on TIMER0/1
+ * IRDA/PSC6: UART
+ * Ether: Ethernet 100Mbit with MD
+ * PCI_DIS: PCI controller disabled
+ * USB: USB
+ * PSC3: SPI with UART3
+ * PSC2: UART
+ * PSC1: UART
+ */
+#define CFG_GPS_PORT_CONFIG    0x10559C44
+
+
+/*
+ * Miscellaneous configurable options
+ */
+#define CFG_LONGHELP           1       /* undef to save memory */
+#define CFG_PROMPT             "=> "   /* Monitor Command Prompt */
+#define CFG_CBSIZE             1024    /* Console I/O Buffer Size */
+#define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16) /* Print Buffer Size */
+#define CFG_MAXARGS            16      /* max number of command args */
+#define CFG_BARGSIZE           CFG_CBSIZE      /* Boot Argument Buffer Size */
+
+#define CFG_ALT_MEMTEST                1
+#define CFG_MEMTEST_START      0x00100000      /* memtest works on */
+#define CFG_MEMTEST_END                0x03f00000      /* 1 .. 63 MiB in SDRAM */
+
+#define CONFIG_LOOPW           1
+
+#define CFG_LOAD_ADDR          0x100000        /* default load address */
+#define CFG_HZ                 1000    /* decrementer freq: 1 ms ticks */
+
+
+/*
+ * Various low-level settings
+ */
+#define CFG_HID0_INIT          HID0_ICE | HID0_ICFI
+#define CFG_HID0_FINAL         HID0_ICE
+
+#define BOOTFLAG_COLD          0x01    /* Normal Power-On: Boot from FLASH */
+#define BOOTFLAG_WARM          0x02    /* Software reboot */
+
+#define CFG_XLB_PIPELINING     1       /* enable transaction pipeling */
+
+
+/*
+ * Cache Configuration
+ */
+#define CFG_CACHELINE_SIZE     32      /* For MPC5xxx CPUs */
+#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value */
+#endif
+
+
+/*
+ * Flat Device Tree support
+ */
+#define CONFIG_OF_LIBFDT       1
+#define CONFIG_OF_BOARD_SETUP  1
+#define OF_CPU                 "PowerPC,5200@0"
+#define OF_SOC                 "soc5200@f0000000"
+#define OF_TBCLK               (bd->bi_busfreq / 4)
+#define OF_STDOUT_PATH         "/soc5200@f0000000/serial@2000"
+
+#endif /* __CONFIG_H */
index 572a70f12003727d7953a1f1e5f9ff8f93922eb8..f32c8c2c66bf421c97f92accbda50d2fea9db6f0 100644 (file)
 #define CFG_I2C_EEPROM_ADDR    0x50
 #define CFG_I2C_EEPROM_ADDR_LEN 1
 #define CFG_I2C_EEPROM_ADDR_OVERFLOW
+#else
+#define CONFIG_TIMESTAMP
 #endif
 /* still about 20 kB free with this defined */
 #define CFG_LONGHELP
 
 #define CONFIG_BOOTDELAY      1
 
-#ifdef CONFIG_HARD_I2C
-#define CONFIG_COMMANDS                \
-                      ((CONFIG_CMD_DFL | \
-                       CFG_CMD_DATE    | \
-                       CFG_CMD_DHCP    | \
-                       CFG_CMD_EEPROM  | \
-                       CFG_CMD_I2C     | \
-                       CFG_CMD_NFS     | \
-                       CFG_CMD_SNTP  ) & \
-                     ~(CFG_CMD_FPGA | CFG_CMD_MISC) )
-#else
-#define CONFIG_COMMANDS                \
-                      ((CONFIG_CMD_DFL | \
-                       CFG_CMD_DHCP    | \
-                       CFG_CMD_NFS     | \
-                       CFG_CMD_SNTP  ) & \
-                     ~(CFG_CMD_FPGA | CFG_CMD_MISC) )
-#define CONFIG_TIMESTAMP
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_SNTP
+
+#undef CONFIG_CMD_FPGA
+#undef CONFIG_CMD_MISC
+
+#if defined(CONFIG_HARD_I2C)
+    #define CONFIG_CMD_DATE
+    #define CONFIG_CMD_EEPROM
+    #define CONFIG_CMD_I2C
 #endif
-#define CFG_LONGHELP
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+
+#define CFG_LONGHELP
 
 #define AT91_SMART_MEDIA_ALE   (1 << 22)       /* our ALE is AD22 */
 #define AT91_SMART_MEDIA_CLE   (1 << 21)       /* our CLE is AD21 */
index e4599192941c7dbb79f05bb616b15b57c7e63e5e..cd92af235223a4a2e8d12d88cfcde6d0804417fe 100644 (file)
 
 #define CONFIG_BAUDRATE                57600
 
-#define CONFIG_COMMANDS                (CFG_CMD_MEMORY | CFG_CMD_LOADB | CFG_CMD_REGINFO |             \
-                                CFG_CMD_FLASH | CFG_CMD_LOADS | CFG_CMD_ASKENV |               \
-                                CFG_CMD_BDI | CFG_CMD_CONSOLE | CFG_CMD_ENV | CFG_CMD_RUN |    \
-                                CFG_CMD_IMI)
 
-/* This must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_MEMORY
+#define CONFIG_CMD_LOADB
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_FLASH
+#define CONFIG_CMD_LOADS
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_BDI
+#define CONFIG_CMD_CONSOLE
+#define CONFIG_CMD_ENV
+#define CONFIG_CMD_RUN
+#define CONFIG_CMD_IMI
+
 
 #if 0
 #define CONFIG_BOOTDELAY       -1              /* autoboot disabled                    */
@@ -73,7 +93,7 @@
 
 #define        CFG_LONGHELP                            /* undef to save memory         */
 #define        CFG_PROMPT              "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE              1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE              256             /* Console I/O Buffer Size      */
index 9033fa88ed1669b05b21f0f3dc5c07f9ca905812..510524ad36a12ffdf99d5a50cdc5c7209d540c18 100644 (file)
 #define CFG_ENV_IS_IN_FLASH    1
 #endif
 
-/* ---
- * Define which commmands should be available at u-boot command prompt
- * ---
+
+/*
+ * BOOTP options
  */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_PING
 
-#define CONFIG_COMMANDS         ( CONFIG_CMD_DFL | CFG_CMD_PING & ~(CFG_CMD_LOADS | \
-CFG_CMD_LOADB) | CFG_CMD_MII)
+#undef CONFIG_CMD_LOADS
+#undef CONFIG_CMD_LOADB
+#undef CONFIG_CMD_MII
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
 
 /*
  *-----------------------------------------------------------------------------
@@ -184,7 +195,7 @@ from which user programs will be started */
 
 #define CFG_LONGHELP                           /* undef to save memory         */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE             256             /* Console I/O Buffer Size      */
index aea2e64365a0f92c5d2426ef2a5300439766f5ee..84d50c71dd5f6f10ad65859cf445252fc5a85ac9 100644 (file)
@@ -71,8 +71,7 @@
  * for FCC)
  *
  * if CONFIG_ETHER_NONE is defined, then either the ethernet routines must be
- * defined elsewhere (as for the console), or CFG_CMD_NET must be removed
- * from CONFIG_COMMANDS to remove support for networking.
+ * defined elsewhere (as for the console), or CONFIG_CMD_NET must be unset.
  */
 #undef CONFIG_ETHER_ON_SCC             /* define if ether on SCC       */
 #undef CONFIG_ETHER_ON_FCC             /* define if ether on FCC       */
 #define CONFIG_BAUDRATE                9600
 #endif
 
-#define CONFIG_COMMANDS                ((CONFIG_CMD_DFL|CFG_CMD_KGDB)&~CFG_CMD_NET)
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_KGDB
+
+#undef CONFIG_CMD_NET
+
 
 #ifdef DEBUG
 #define CONFIG_BOOTDELAY       -1      /* autoboot disabled            */
 
 #define CONFIG_BOOTARGS                "root=/dev/ram rw"
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CONFIG_KGDB_ON_SMC              /* define if kgdb on SMC */
 #undef CONFIG_KGDB_ON_SCC              /* define if kgdb on SCC */
 #undef CONFIG_KGDB_NONE                /* define if kgdb on something else */
  */
 #define        CFG_LONGHELP                    /* undef to save memory         */
 #define        CFG_PROMPT      "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     32      /* For MPC8260 CPU              */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 # define CFG_CACHELINE_SHIFT   5       /* log base 2 of the above value*/
 #endif
 
index 80962d35fdfc8a2915eb23e294d01fd6b33f6790..ce38af1dd851f8d4ee27810c04cc840d2dd8a112 100644 (file)
 #define CFG_I2C_SLAVE          0x7F
 
 
-#define CONFIG_COMMANDS                ((CONFIG_CMD_DFL | CFG_CMD_KGDB | CFG_CMD_I2C) & ~CFG_CMD_NET)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_KGDB
+#define CONFIG_CMD_I2C
+
+#undef CONFIG_CMD_NET
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
 
 #if 0
 #define CONFIG_BOOTDELAY       -1      /* autoboot disabled            */
@@ -73,7 +88,7 @@
 
 #define CONFIG_BOOTARGS                "root=/dev/ram rw"
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #undef CONFIG_KGDB_ON_SMC              /* define if kgdb on SMC */
 #undef CONFIG_KGDB_ON_SCC              /* define if kgdb on SCC */
 #define        CONFIG_KGDB_NONE                /* define if kgdb on something else */
  */
 #define        CFG_LONGHELP                    /* undef to save memory         */
 #define        CFG_PROMPT      "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index f5efcd911a5c0a1d56e9a031d357caff403c67e0..ce4ea1f8dbe9fb0469258223aa58d5b310b19dc0 100644 (file)
 #define BOOTFLAG_COLD          0x01    /* Normal Power-On: Boot from FLASH  */
 #define BOOTFLAG_WARM          0x02    /* Software reboot           */
 
-#define CFG_CACHELINE_SIZE     32      /* For MPC5xxx CPUs */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
-#  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
-#endif
-
 /*
  * Serial console configuration
  */
 #define CONFIG_NS8382X         1
 #endif
 
-#define ADD_PCI_CMD            CFG_CMD_PCI
-
-#else                          /* MPC5100 */
-
-#define ADD_PCI_CMD            0       /* no CFG_CMD_PCI */
-
 #endif
 
 /* Partitions */
 /* USB */
 #if 0
 #define CONFIG_USB_OHCI
-#define ADD_USB_CMD            CFG_CMD_USB | CFG_CMD_FAT
 #define CONFIG_USB_STORAGE
-#else
-#define ADD_USB_CMD            0
 #endif
 
 /*
- * Supported commands
+ * BOOTP options
  */
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL | \
-                                CFG_CMD_EEPROM | \
-                                CFG_CMD_FAT    | \
-                                CFG_CMD_IDE    | \
-                                CFG_CMD_I2C    | \
-                                CFG_CMD_BSP    | \
-                                CFG_CMD_ELF    | \
-                                CFG_CMD_EXT2   | \
-                                CFG_CMD_DATE   | \
-                                ADD_PCI_CMD      )
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#if defined(CONFIG_PCI)
+#define CONFIG_CMD_PCI
+#endif
+
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_BSP
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_EXT2
+#define CONFIG_CMD_DATE
 
 #if (TEXT_BASE == 0xFF000000)  /* Boot low with 16 MB Flash */
 #   define CFG_LOWBOOT         1
  */
 #define CFG_LONGHELP           /* undef to save memory     */
 #define CFG_PROMPT             "=> "   /* Monitor Command Prompt   */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024    /* Console I/O Buffer Size  */
 #else
 #define CFG_CBSIZE             256     /* Console I/O Buffer Size  */
 
 #define CFG_VXWORKS_MAC_PTR    0x00000000      /* Pass Ethernet MAC to VxWorks */
 
+#define CFG_CACHELINE_SIZE     32      /* For MPC5xxx CPUs */
+#if defined(CONFIG_CMD_KGDB)
+#  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
+#endif
+
 /*
  * Various low-level settings
  */
index 776e1d2b7f736aa65fa0137a6e30236081ab74fe..eb93a8f083f7e4ab2f2039de445c90d4817013fb 100644 (file)
 
 #define CONFIG_BAUDRATE         115200
 
-#define CONFIG_COMMANDS         (CONFIG_CMD_DFL)
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
 
 #define CONFIG_BOOTDELAY        3
 #define CONFIG_BOOTARGS         "root=/dev/mtdblock2 console=ttyS0,115200"
index f04102e95c5dfa6d0285b8bf6145633e080b3bfe..0be0f2192481a30693ee6d0ab093afc0288d2224 100644 (file)
 #define CONFIG_BAUDRATE                19200
 #undef  CONFIG_MISC_INIT_R             /* not used yet                     */
 
-#define CONFIG_COMMANDS (CFG_CMD_BDI|CFG_CMD_LOADB|CFG_CMD_IMI|CFG_CMD_FLASH|CFG_CMD_MEMORY|CFG_CMD_NET|CFG_CMD_ENV|CFG_CMD_RUN|CFG_CMD_ASKENV|CFG_CMD_ECHO|CFG_CMD_DHCP|CFG_CMD_CACHE)
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_BDI
+#define CONFIG_CMD_LOADB
+#define CONFIG_CMD_IMI
+#define CONFIG_CMD_FLASH
+#define CONFIG_CMD_MEMORY
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_ENV
+#define CONFIG_CMD_RUN
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_ECHO
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_CACHE
+
 
 #define CONFIG_BOOTDELAY       3
 #define CONFIG_BOOTARGS                "console=ttyS0,19200 ip=192.168.1.10,192.168.1.5,,255,255,255,0,csb root=/dev/nfs, ether=0,0x08000000,eth0"
@@ -73,7 +97,7 @@
 
 #define CONFIG_CMDLINE_TAG     1
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   19200           /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2               /* which serial port to use */
 #endif
index 27d64c1e434a91eb30619f620cf54dec38ca89df..c43b49737d92c0fcf6cf7d6f727eeb3444841b6e 100644 (file)
 #endif
 
 /*
- * BOOTP/DHCP protocol configuration
- *
+ * BOOTP options
  */
-#define CONFIG_BOOTP_MASK      ( CONFIG_BOOTP_DEFAULT          | \
-                                 CONFIG_BOOTP_DNS2             | \
-                                 CONFIG_BOOTP_BOOTFILESIZE     )
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_DNS2
+
+
 /*
- * U-Boot Monitor Command Line Functions Configuration
- *
+ * Command line configuration.
  */
-#define CONFIG_COMMANDS                ( CONFIG_CMD_DFL        | \
-                                 CFG_CMD_ASKENV        | \
-                                 CFG_CMD_BEDBUG        | \
-                                 CFG_CMD_ELF           | \
-                                 CFG_CMD_IRQ           | \
-                                 CFG_CMD_I2C           | \
-                                 CFG_CMD_PCI           | \
-                                 CFG_CMD_DATE          | \
-                                 CFG_CMD_MII           | \
-                                 CFG_CMD_PING          | \
-                                 CFG_CMD_DHCP           )
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_BEDBUG
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_DHCP
+
 
 /*
  * Serial download configuration
  * KGDB Configuration
  *
  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 #define CFG_LONGHELP                   /* undef to save memory */
 #define CFG_PROMPT             "=> "   /* Monitor Command Prompt */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE              1024    /* Console I/O Buffer Size */
 #else
 #define        CFG_CBSIZE              256     /* Console I/O Buffer Size */
index 09d52ded9eeb58bfd10e53e9d497334d380c26d9..a7120aa57f9d07d28ea4eb1d22ee18638d9d0416 100644 (file)
 #endif
 
 /*
- * BOOTP/DHCP protocol configuration
- *
+ * BOOTP options
  */
-#define CONFIG_BOOTP_MASK      ( CONFIG_BOOTP_DEFAULT          | \
-                                 CONFIG_BOOTP_DNS2             | \
-                                 CONFIG_BOOTP_BOOTFILESIZE     )
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_DNS2
+
+
 /*
- * U-Boot Monitor Command Line Functions Configuration
- *
+ * Command line configuration.
  */
-#define CONFIG_COMMANDS                ( CONFIG_CMD_DFL        | \
-                                 CFG_CMD_ASKENV        | \
-                                 CFG_CMD_BEDBUG        | \
-                                 CFG_CMD_ELF           | \
-                                 CFG_CMD_IRQ           | \
-                                 CFG_CMD_I2C           | \
-                                 CFG_CMD_PCI           | \
-                                 CFG_CMD_DATE          | \
-                                 CFG_CMD_MII           | \
-                                 CFG_CMD_PING          | \
-                                 CFG_CMD_DHCP           )
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_BEDBUG
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_DHCP
 
 /*
  * Serial download configuration
  * KGDB Configuration
  *
  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
 #define CFG_LONGHELP                   /* undef to save memory */
 #define CFG_PROMPT             "=> "   /* Monitor Command Prompt */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE              1024    /* Console I/O Buffer Size */
 #else
 #define        CFG_CBSIZE              256     /* Console I/O Buffer Size */
index 071d5b7f36c5646581660f89c1225a30ff2c8fc0..976dae39f6966aab8dd9483a28610c4c04f27ca7 100644 (file)
 #define CONFIG_BOOTDELAY      3
 /* #define CONFIG_ENV_OVERWRITE        1 */
 
-#define CONFIG_COMMANDS                \
-                      ((CONFIG_CMD_DFL | \
-                       CFG_CMD_JFFS2 | \
-                       CFG_CMD_DHCP | \
-                       CFG_CMD_PING ) & \
-                     ~(CFG_CMD_BDI | \
-                       CFG_CMD_IMI | \
-                       CFG_CMD_AUTOSCRIPT | \
-                       CFG_CMD_FPGA | \
-                       CFG_CMD_MISC | \
-                       CFG_CMD_LOADS ))
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_JFFS2
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_PING
+
+#undef CONFIG_CMD_BDI
+#undef CONFIG_CMD_IMI
+#undef CONFIG_CMD_AUTOSCRIPT
+#undef CONFIG_CMD_FPGA
+#undef CONFIG_CMD_MISC
+#undef CONFIG_CMD_LOADS
+
 
 #define CFG_MAX_NAND_DEVICE    1       /* Max number of NAND devices           */
 #define SECTORSIZE 512
index 4cc5085293b430d0187b1856ba205a4f62327811..b2f606f498b794042ce474afd282ac373b9448d6 100644 (file)
 #ifdef CONFIG_DBAU1550
 /* Boot from flash by default, revert to bootp */
 #define CONFIG_BOOTCOMMAND     "bootm 0xbfc20000; bootp; bootm"
-
-#define CONFIG_COMMANDS                ((CONFIG_CMD_DFL | CFG_CMD_FLASH | CFG_CMD_LOADB | CFG_CMD_NET) & \
-                                ~(CFG_CMD_ENV | CFG_CMD_FAT | CFG_CMD_FPGA | CFG_CMD_IDE | \
-                                  CFG_CMD_MII | CFG_CMD_RUN | CFG_CMD_BDI | CFG_CMD_BEDBUG | \
-                                  CFG_CMD_NFS | CFG_CMD_ELF | CFG_CMD_PCMCIA | CFG_CMD_I2C))
 #else /* CONFIG_DBAU1550 */
 #define CONFIG_BOOTCOMMAND     "bootp;bootm"
-
-#define CONFIG_COMMANDS                ((CONFIG_CMD_DFL | CFG_CMD_IDE | CFG_CMD_DHCP | CFG_CMD_ELF) & \
-                                ~(CFG_CMD_ENV | CFG_CMD_FAT | CFG_CMD_FLASH | CFG_CMD_FPGA | \
-                                  CFG_CMD_MII | CFG_CMD_LOADS | CFG_CMD_RUN | CFG_CMD_LOADB | \
-                                  CFG_CMD_ELF | CFG_CMD_BDI | CFG_CMD_BEDBUG))
 #endif /* CONFIG_DBAU1550 */
 
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#undef CONFIG_CMD_BDI
+#undef CONFIG_CMD_BEDBUG
+#undef CONFIG_CMD_ELF
+#undef CONFIG_CMD_ENV
+#undef CONFIG_CMD_FAT
+#undef CONFIG_CMD_FPGA
+#undef CONFIG_CMD_MII
+#undef CONFIG_CMD_RUN
+
+
+#ifdef CONFIG_DBAU1550
+
+#define CONFIG_CMD_FLASH
+#define CONFIG_CMD_LOADB
+#define CONFIG_CMD_NET
+
+#undef CONFIG_CMD_I2C
+#undef CONFIG_CMD_IDE
+#undef CONFIG_CMD_NFS
+#undef CONFIG_CMD_PCMCIA
+
+#else
+
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_DHCP
+
+#undef CONFIG_CMD_FLASH
+#undef CONFIG_CMD_LOADB
+#undef CONFIG_CMD_LOADS
+
+#endif
+
 
 /*
  * Miscellaneous configurable options
index 8ff963f55a2ff9d7b5f3a75fa4c222dea2438db1..7667e5e60e3c184f5f7db8290bdae7a0b3bbeb69 100644 (file)
 #define CONFIG_BAUDRATE                9600
 #define CONFIG_DRAM_SPEED      100             /* MHz */
 
-#define CONFIG_COMMANDS                ( CONFIG_CMD_DFL        | \
-                                 CFG_CMD_ASKENV        | \
-                                 CFG_CMD_CACHE         | \
-                                 CFG_CMD_DATE          | \
-                                 CFG_CMD_DHCP          | \
-                                 CFG_CMD_DIAG          | \
-                                 CFG_CMD_EEPROM        | \
-                                 CFG_CMD_ELF           | \
-                                 CFG_CMD_I2C           | \
-                                 CFG_CMD_JFFS2         | \
-                                 CFG_CMD_KGBD          | \
-                                 CFG_CMD_PCI           | \
-                                 CFG_CMD_PING          | \
-                                 CFG_CMD_SAVES         | \
-                                 CFG_CMD_SDRAM)
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any)      */
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_CACHE
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_DIAG
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_JFFS2
+#define CONFIG_CMD_KGBD
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_SAVES
+#define CONFIG_CMD_SDRAM
 
 
 /*
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     32      /* For MPC8240 CPU                      */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
 #endif
 
index 15681208b62355232030a7f39c160d9165500e8c..dbfe7a702b54bc61b75da1375efa33be048c571b 100644 (file)
 
 #define CONFIG_BAUDRATE                115200
 
-/* #define CONFIG_COMMANDS       (CONFIG_CMD_DFL | CFG_CMD_MMC | CFG_CMD_FAT) */
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
 #ifdef TURN_ON_ETHERNET
-# define CONFIG_COMMANDS        (CONFIG_CMD_DFL | CFG_CMD_PING)
+
+#define CONFIG_CMD_PING
+
 #else
-# define CONFIG_COMMANDS       ((CONFIG_CMD_DFL \
-                                 | CFG_CMD_ENV \
-                                 | CFG_CMD_NAND \
-                                 | CFG_CMD_I2C) \
-                                & ~(CFG_CMD_NET \
-                                    | CFG_CMD_FLASH \
-                                    | CFG_CMD_IMLS))
-#endif
 
+#define CONFIG_CMD_ENV
+#define CONFIG_CMD_NAND
+#define CONFIG_CMD_I2C
+
+#undef CONFIG_CMD_NET
+#undef CONFIG_CMD_FLASH
+#undef CONFIG_CMD_IMLS
+
+#endif
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
 
 #define CONFIG_BOOTDELAY       -1
 #define CONFIG_ETHADDR         08:00:3e:26:0a:5b
 #define CONFIG_CMDLINE_TAG
 #define CONFIG_TIMESTAMP
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400          /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2               /* which serial port to use */
 #endif
index 9ac2856f65317e1c48de73fc9ad730fb5c348f1d..d32e04602348db28cfdaa71d7298515138b45ff5 100644 (file)
 
 #define CONFIG_BAUDRATE                115200
 
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL)
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
 
 #define CONFIG_BOOTDELAY       3
 #define CONFIG_BOOTARGS        "root=ramfs devfs=mount console=ttySA0,115200"
@@ -80,7 +91,7 @@
 #define CONFIG_BOOTFILE                "dnp1110"
 #define CONFIG_BOOTCOMMAND     "tftp; bootm"
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400          /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2               /* which serial port to use */
 #endif
index a014c7c07f80d36c6d5299067b318a2659cadbcf..f8e2c885b064d6112dad78fb080fc19de68c9881 100644 (file)
 
                                                    /*#define CONFIG_DRAM_SPEED       66   */ /* MHz                         */
 
-#define CONFIG_COMMANDS                (   CONFIG_CMD_DFL  | \
-                                   CFG_CMD_FLASH   | \
-                                   CFG_CMD_SDRAM   | \
-                                   CFG_CMD_I2C     | \
-                                   CFG_CMD_IDE     | \
-                                   CFG_CMD_FAT     | \
-                                   CFG_CMD_ENV     | \
-                                   CFG_CMD_PCI )
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any)      */
-#include <cmd_confdefs.h>
+#define CONFIG_CMD_FLASH
+#define CONFIG_CMD_SDRAM
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_ENV
+#define CONFIG_CMD_PCI
 
 
 /*-----------------------------------------------------------------------
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     32
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
 #endif
 
index 4a1385ccb92cc93493857387cfe676fc1681fdef..2c626a0328881cfd9d611ea01101f36d246fa391 100644 (file)
 
 #define CONFIG_NETCONSOLE              /* include NetConsole support   */
 
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_DIAG    | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_NET     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_REGINFO | \
-                               CFG_CMD_SDRAM   | \
-                               CFG_CMD_SNTP    )
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_DIAG
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_SDRAM
+#define CONFIG_CMD_SNTP
+
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
  */
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT     "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
  */
 #define CFG_DCACHE_SIZE                8192    /* For AMCC 405 CPUs                    */
 #define CFG_CACHELINE_SIZE     32      /* ...                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value        */
 #endif
 
 #define BOOTFLAG_COLD  0x01            /* Normal Power-On: Boot from FLASH     */
 #define BOOTFLAG_WARM  0x02            /* Software reboot                      */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
index bdda6292ed7a7da02a22aaa9658e41912faacae6..f5cf477a31356437e40b13c70c8e078237e051dc 100644 (file)
 
 #define CONFIG_BAUDRATE                9600
 
-#define CONFIG_BOOTP_MASK       (CONFIG_BOOTP_DEFAULT|CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
 
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL | CFG_CMD_JFFS2)
+#define CONFIG_CMD_JFFS2
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
 
 #define CONFIG_BOOTDELAY       3
 #define CONFIG_BOOTARGS        "devfs=mount root=ramfs console=ttyS0,9600"
@@ -78,7 +89,7 @@
 /*#define CONFIG_BOOTFILE      "impa7" */
 #define CONFIG_BOOTCOMMAND     "bootp;bootm"
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400          /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2               /* which serial port to use */
 #endif
index 04147a55d1d1c790cc5df2c9c16993f532acd8d2..85ad70a0d5083ddccb2d54a94873eaf70497de25 100644 (file)
@@ -60,8 +60,8 @@
  * SCC, 1-3 for FCC)
  *
  * If CONFIG_ETHER_NONE is defined, then either the ethernet routines
- * must be defined elsewhere (as for the console), or CFG_CMD_NET must
- * be removed from CONFIG_COMMANDS to remove support for networking.
+ * must be defined elsewhere (as for the console), or CONFIG_CMD_NET
+ * must be unset.
  */
 #undef CONFIG_ETHER_ON_SCC             /* Ethernet is not on SCC */
 #define CONFIG_ETHER_ON_FCC            /* Ethernet is on FCC     */
 
 #define CONFIG_BAUDRATE                38400
 
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL   \
-                               | CFG_CMD_DHCP    \
-                               | CFG_CMD_ECHO    \
-                               | CFG_CMD_I2C     \
-                               | CFG_CMD_IMMAP   \
-                               | CFG_CMD_MII     \
-                               | CFG_CMD_PING    \
-                               )
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_ECHO
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_IMMAP
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_PING
+
 
 #define CONFIG_BOOTDELAY       5       /* autoboot after 5 seconds */
 #define CONFIG_BOOTCOMMAND     "bootm FF860000"        /* autoboot command */
 #define CONFIG_BOOTARGS                "root=/dev/mtdblock1 rw mtdparts=phys:7M(root),-(root)ro"
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #undef CONFIG_KGDB_ON_SMC              /* define if kgdb on SMC */
 #define CONFIG_KGDB_ON_SCC             /* define if kgdb on SCC */
 #undef CONFIG_KGDB_NONE                /* define if kgdb on something else */
 #define CFG_PROMPT_HUSH_PS2    "> "
 #define CFG_LONGHELP                   /* undef to save memory     */
 #define CFG_PROMPT             "=> "   /* Monitor Command Prompt   */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024    /* Console I/O Buffer Size  */
 #else
 #define CFG_CBSIZE             256     /* Console I/O Buffer Size  */
 
 #define        CFG_DIRECT_FLASH_TFTP
 
-#if (CONFIG_COMMANDS & CFG_CMD_JFFS2)
+#if defined(CONFIG_CMD_JFFS2)
 #define CFG_JFFS2_FIRST_BANK   0
 #define CFG_JFFS2_NUM_BANKS    CFG_MAX_FLASH_BANKS
 #define CFG_JFFS2_FIRST_SECTOR  0
 #define CFG_JFFS2_LAST_SECTOR   62
 #define CFG_JFFS2_SORT_FRAGMENTS
 #define CFG_JFFS_CUSTOM_PART
-#endif /* CFG_CMD_JFFS2 */
+#endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_I2C)
+#if defined(CONFIG_CMD_I2C)
 #define CONFIG_HARD_I2C                1       /* To enable I2C support        */
 #define CFG_I2C_SPEED          100000  /* I2C speed                    */
 #define CFG_I2C_SLAVE          0x7F    /* I2C slave address            */
-#endif /* CFG_CMD_I2C */
+#endif
 
 #define CFG_MONITOR_BASE       TEXT_BASE
 #if (CFG_MONITOR_BASE < CFG_FLASH_BASE)
 #define CFG_BOOTMAPSZ          (8 << 20)       /* Initial Memory map for Linux */
 
 #define CFG_CACHELINE_SIZE     32      /* For MPC8260 CPUs */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
 #endif
 
index 686251930918bf87afcca4ff66d5b0073a0de2cb..025c24960d2118441b14dc0015d5bd0c29d40e6a 100644 (file)
  * for FCC)
  *
  * if CONFIG_ETHER_NONE is defined, then either the ethernet routines must be
- * defined elsewhere (as for the console), or CFG_CMD_NET must be removed
- * from CONFIG_COMMANDS to remove support for networking.
+ * defined elsewhere (as for the console), or CONFIG_CMD_NET must be unset.
  */
 #undef  CONFIG_ETHER_ON_SCC           /* define if ethernet on SCC    */
 #define CONFIG_ETHER_ON_FCC           /* define if ethernet on FCC    */
 #define CFG_HUSH_PARSER
 #define CFG_PROMPT_HUSH_PS2    "> "
 
-/* What U-Boot subsytems do you want enabled? */
+
 /*
-*/
-#define CONFIG_COMMANDS                ( CFG_CMD_ALL     & \
-                                 ~(    CFG_CMD_BMP     | \
-                                       CFG_CMD_BSP     | \
-                                       CFG_CMD_DCR     | \
-                                       CFG_CMD_DHCP    | \
-                                       CFG_CMD_DISPLAY | \
-                                       CFG_CMD_DOC     | \
-                                       CFG_CMD_DTT     | \
-                                       CFG_CMD_EEPROM  | \
-                                       CFG_CMD_EXT2    | \
-                                       CFG_CMD_FDC     | \
-                                       CFG_CMD_FDOS    | \
-                                       CFG_CMD_HWFLOW  | \
-                                       CFG_CMD_IDE     | \
-                                       CFG_CMD_JFFS2   | \
-                                       CFG_CMD_KGDB    | \
-                                       CFG_CMD_MII     | \
-                                       CFG_CMD_MMC     | \
-                                       CFG_CMD_NAND    | \
-                                       CFG_CMD_PCI     | \
-                                       CFG_CMD_PCMCIA  | \
-                                       CFG_CMD_REISER  | \
-                                       CFG_CMD_SCSI    | \
-                                       CFG_CMD_SPI     | \
-                                       CFG_CMD_UNIVERSE| \
-                                       CFG_CMD_USB     | \
-                                       CFG_CMD_VFD     | \
-                                       CFG_CMD_XIMG    ) )
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_all.h>
+
+#undef CONFIG_CMD_BMP
+#undef CONFIG_CMD_BSP
+#undef CONFIG_CMD_DCR
+#undef CONFIG_CMD_DHCP
+#undef CONFIG_CMD_DISPLAY
+#undef CONFIG_CMD_DOC
+#undef CONFIG_CMD_DTT
+#undef CONFIG_CMD_EEPROM
+#undef CONFIG_CMD_EXT2
+#undef CONFIG_CMD_FDC
+#undef CONFIG_CMD_FDOS
+#undef CONFIG_CMD_HWFLOW
+#undef CONFIG_CMD_IDE
+#undef CONFIG_CMD_JFFS2
+#undef CONFIG_CMD_KGDB
+#undef CONFIG_CMD_MII
+#undef CONFIG_CMD_MFSL
+#undef CONFIG_CMD_MMC
+#undef CONFIG_CMD_NAND
+#undef CONFIG_CMD_PCI
+#undef CONFIG_CMD_PCMCIA
+#undef CONFIG_CMD_REISER
+#undef CONFIG_CMD_SCSI
+#undef CONFIG_CMD_SPI
+#undef CONFIG_CMD_UNIVERSE
+#undef CONFIG_CMD_USB
+#undef CONFIG_CMD_VFD
+#undef CONFIG_CMD_XIMG
 
 
 /* Where do the internal registers live? */
 
 #define CONFIG_BOARD_EARLY_INIT_F 1        /* Call board_early_init_f  */
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-
 /*
  * Miscellaneous configurable options
  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #  define CFG_CBSIZE              1024       /* Console I/O Buffer Size      */
 #else
 #  define CFG_CBSIZE              256        /* Console I/O Buffer Size      */
  */
 #define CFG_CACHELINE_SIZE      32      /* For MPC8260 CPU */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #  define CFG_CACHELINE_SHIFT     5     /* log base 2 of the above value */
 #endif
 
index a77ccef63b94f0bbdcdae406c74d4f0f423d220f..4febd322a4f0e848a073b97ebec3fa3dfcf6cbc9 100644 (file)
@@ -60,8 +60,8 @@
  * SCC, 1-3 for FCC)
  *
  * If CONFIG_ETHER_NONE is defined, then either the ethernet routines
- * must be defined elsewhere (as for the console), or CFG_CMD_NET must
- * be removed from CONFIG_COMMANDS to remove support for networking.
+ * must be defined elsewhere (as for the console), or CONFIG_CMD_NET
+ * must be unset.
  */
 #undef CONFIG_ETHER_ON_SCC             /* Ethernet is not on SCC */
 #define CONFIG_ETHER_ON_FCC            /* Ethernet is on FCC     */
 
 #define CFG_VXWORKS_MAC_PTR 0x4300 /* Pass Ethernet MAC to VxWorks */
 
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL   \
-                               | CFG_CMD_DHCP    \
-                               | CFG_CMD_ECHO    \
-                               | CFG_CMD_I2C     \
-                               | CFG_CMD_IMMAP   \
-                               | CFG_CMD_MII     \
-                               | CFG_CMD_PING    \
-                               | CFG_CMD_DATE    \
-                               | CFG_CMD_DTT     \
-                               | CFG_CMD_EEPROM  \
-                               | CFG_CMD_PCI     \
-                               | CFG_CMD_DIAG    \
-                               )
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_ECHO
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_IMMAP
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DTT
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_DIAG
+
 
 #define CONFIG_ETHADDR         00:10:EC:00:88:65
 #define CONFIG_HAS_ETH1
 #define CONFIG_AUTO_COMPLETE   1
 #define        CONFIG_EXTRA_ENV_SETTINGS       "ethprime=FCC3 ETHERNET"
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #undef CONFIG_KGDB_ON_SMC              /* define if kgdb on SMC */
 #define CONFIG_KGDB_ON_SCC             /* define if kgdb on SCC */
 #undef CONFIG_KGDB_NONE                /* define if kgdb on something else */
 #define CFG_PROMPT_HUSH_PS2    "> "
 #define CFG_LONGHELP                   /* undef to save memory     */
 #define CFG_PROMPT             "ep82xxm=> "    /* Monitor Command Prompt   */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024    /* Console I/O Buffer Size  */
 #else
 #define CFG_CBSIZE             256     /* Console I/O Buffer Size  */
 
 #define        CFG_DIRECT_FLASH_TFTP
 
-#if (CONFIG_COMMANDS & CFG_CMD_JFFS2)
+#if defined(CONFIG_CMD_JFFS2)
 #define CFG_JFFS2_FIRST_BANK   0
 #define CFG_JFFS2_NUM_BANKS    CFG_MAX_FLASH_BANKS
 #define CFG_JFFS2_FIRST_SECTOR  0
 #define CFG_JFFS2_LAST_SECTOR   62
 #define CFG_JFFS2_SORT_FRAGMENTS
 #define CFG_JFFS_CUSTOM_PART
-#endif /* CFG_CMD_JFFS2 */
+#endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_I2C)
+#if defined(CONFIG_CMD_I2C)
 #define CONFIG_HARD_I2C                1       /* To enable I2C support        */
 #define CFG_I2C_SPEED          100000  /* I2C speed                    */
 #define CFG_I2C_SLAVE          0x7F    /* I2C slave address            */
-#endif /* CFG_CMD_I2C */
+#endif
 
 #define CFG_MONITOR_BASE       TEXT_BASE
 #if (CFG_MONITOR_BASE < CFG_FLASH_BASE)
 #define CFG_BOOTMAPSZ          (8 << 20)       /* Initial Memory map for Linux */
 
 #define CFG_CACHELINE_SIZE     32      /* For MPC8260 CPUs */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value */
 #endif
 
index 88c2c7437d0f58d65b74327601993c7874a0d404..66500c21e020f1ecd4b93a3a574845250ba637b0 100644 (file)
 
 #define CONFIG_BAUDRATE                19200
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT|CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
 
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL | CFG_CMD_PING)
+#define CONFIG_CMD_PING
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
 
 #define CONFIG_ETHADDR         00:40:95:36:35:33
 #define CONFIG_NETMASK         255.255.255.0
 #define CONFIG_BOOTCOMMAND     "tftp 100000 uImage"
 /* #define CONFIG_BOOTARGS     "console=ttyS0,19200 initrd=0x100a0040,530K root=/dev/ram keepinitrd" */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   19200           /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2               /* which serial port to use */
 #endif
index b68a2dca09c5652b20b1dc59d51b43ec02591780..e11ce4c715e6690926626d037f1668fb9d4166ed 100644 (file)
 
 #define CONFIG_BAUDRATE                38400
 
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL | CFG_CMD_DHCP)
-#define CONFIG_BOOTP_MASK      CONFIG_BOOTP_DEFAULT
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DHCP
+
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+
 
 #define CONFIG_BOOTDELAY       3
 #define CONFIG_BOOTARGS                "console=ttySA0,38400n8 mtdparts=sa1100-flash:1m@0(zImage),3m@1m(ramdisk.gz),12m@4m(userfs) root=/dev/nfs ip=bootp"
 #define CONFIG_BOOTCOMMAND     "bootp;tftp;bootm"
 #define CFG_AUTOLOAD            "n"             /* No autoload */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   38400           /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2               /* which serial port to use */
 #endif
index a49ed3bae3eba093b5408869924419480e4433be..c2a50c1f473816307f6d660bdaf7ac12ae664fb8 100644 (file)
 /* Boot from Compact flash partition 2 as default */
 #define CONFIG_BOOTCOMMAND     "ide reset;disk 0x81000000 0:2;run addmisc;bootm"
 
-#define CONFIG_COMMANDS ((CONFIG_CMD_DFL | CFG_CMD_IDE | CFG_CMD_DHCP ) & \
- ~(CFG_CMD_ENV | CFG_CMD_FAT | CFG_CMD_FLASH | CFG_CMD_FPGA | \
-   CFG_CMD_MII | CFG_CMD_LOADS | CFG_CMD_LOADB | CFG_CMD_ELF | \
-   CFG_CMD_BDI | CFG_CMD_BEDBUG | CFG_CMD_NFS | CFG_CMD_AUTOSCRIPT ))
 
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_DHCP
+
+#undef CONFIG_CMD_ENV
+#undef CONFIG_CMD_FAT
+#undef CONFIG_CMD_FLASH
+#undef CONFIG_CMD_FPGA
+#undef CONFIG_CMD_MII
+#undef CONFIG_CMD_LOADS
+#undef CONFIG_CMD_LOADB
+#undef CONFIG_CMD_ELF
+#undef CONFIG_CMD_BDI
+#undef CONFIG_CMD_BEDBUG
+#undef CONFIG_CMD_NFS
+#undef CONFIG_CMD_AUTOSCRIPT
+
 
 /*
  * Miscellaneous configurable options
index 4f83b1945d305ac0943c78a4031db34b090d949e..ff5724082d03daee86fb6494773efb2de2317bb0 100644 (file)
  * for FCC)
  *
  * if CONFIG_ETHER_NONE is defined, then either the ethernet routines must be
- * defined elsewhere (as for the console), or CFG_CMD_NET must be removed
- * from CONFIG_COMMANDS to remove support for networking.
+ * defined elsewhere (as for the console), or CONFIG_CMD_NET must be unset.
  */
 
 #undef  CONFIG_ETHER_ON_SCC
 #undef  CONFIG_AUTOBOOT_DELAY_STR
 #define DEBUG_BOOTKEYS      0
 
-/* Add support for a few extra bootp options like:
- *  - File size
- *  - DNS
+/*
+ * BOOTP options
  */
-#define CONFIG_BOOTP_MASK   (CONFIG_BOOTP_DEFAULT | \
-                            CONFIG_BOOTP_BOOTFILESIZE | \
-                            CONFIG_BOOTP_DNS)
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_DNS
 
 /* undef this to save memory */
 #define CFG_LONGHELP
 /* Monitor Command Prompt */
 #define CFG_PROMPT      "=> "
 
-/* What U-Boot subsytems do you want enabled? */
-#define CONFIG_COMMANDS     (((CONFIG_CMD_DFL & ~(CFG_CMD_KGDB))) | \
-                              CFG_CMD_BEDBUG  | \
-                              CFG_CMD_ELF | \
-                              CFG_CMD_ASKENV  | \
-                              CFG_CMD_REGINFO | \
-                              CFG_CMD_IMMAP   | \
-                              CFG_CMD_MII)
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_BEDBUG
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_IMMAP
+#define CONFIG_CMD_MII
+
+#undef CONFIG_CMD_KGDB
+
 
 /* Where do the internal registers live? */
 #define CFG_IMMR        0xf0000000
 #define CONFIG_GW8260       1   /* on an GW8260 Board  */
 #define CONFIG_CPM2            1       /* Has a CPM2 */
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-
 /*
  * Miscellaneous configurable options
  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #  define CFG_CBSIZE        1024    /* Console I/O Buffer Size       */
 #else
 #  define CFG_CBSIZE        256     /* Console I/O Buffer Size       */
  */
 #define CFG_CACHELINE_SIZE  32      /* For MPC8260 CPU */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 # define CFG_CACHELINE_SHIFT    5   /* log base 2 of the above value */
 #endif
 
index 91117bab726242f00eeb9a5253e86dca829bc46b..e3a2ed28034353c4836bd5664452822f0724929e 100644 (file)
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
-#define CONFIG_COMMANDS                CONFIG_CMD_DFL
 
-#define CONFIG_BOOTP_MASK      CONFIG_BOOTP_DEFAULT
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
 
-/*----------------------------------------------------------------------*/
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
 
-/*----------------------------------------------------------------------*/
 
 /*
  * Miscellaneous configurable options
  */
 #define        CFG_LONGHELP                    /* undef to save memory         */
 #define        CFG_PROMPT      "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index 4d813d8be789aa1e7f410b26c4756120bcafd1e5..6c15b4e14c01fbd6271a800704b13db0e869ca92 100644 (file)
 #define BOOTFLAG_COLD          0x01    /* Normal Power-On: Boot from FLASH     */
 #define BOOTFLAG_WARM          0x02    /* Software reboot                      */
 
-#define CFG_CACHELINE_SIZE     32      /* For MPC5xxx CPUs                     */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
-#  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value        */
-#endif
-
 #define CONFIG_BOARD_EARLY_INIT_R
 
 /*
 /* Partitions */
 #define CONFIG_DOS_PARTITION
 
+
 /*
- * Supported commands
+ * BOOTP options
  */
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DISPLAY | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_IDE     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_SNTP    )
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DISPLAY
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_SNTP
+
 
 #define        CONFIG_TIMESTAMP        1       /* Print image info with timestamp */
 
  */
 #define CFG_LONGHELP                   /* undef to save memory     */
 #define CFG_PROMPT             "=> "   /* Monitor Command Prompt   */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024    /* Console I/O Buffer Size  */
 #else
 #define CFG_CBSIZE             256     /* Console I/O Buffer Size  */
 #define CFG_MAXARGS            16      /* max number of command args   */
 #define CFG_BARGSIZE           CFG_CBSIZE      /* Boot Argument Buffer Size    */
 
+#define CFG_CACHELINE_SIZE     32      /* For MPC5xxx CPUs                     */
+#if defined(CONFIG_CMD_KGDB)
+#  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value        */
+#endif
+
 /* Enable an alternate, more extensive memory test */
 #define CFG_ALT_MEMTEST
 
 #define CFG_HZ                 1000    /* decrementer freq: 1 ms ticks */
 
 /*
- * Enable loopw commando. This has only affect, if CFG_CMD_MEM is defined,
- * which is normally part of the default commands (CFV_CMD_DFL)
+ * Enable loopw command.
  */
 #define CONFIG_LOOPW
 
index 8cad98dbd29d9a217f91a7c0d931c3526e5b0070..2f64ec238c652ef3e3862d8aa53ca4aa50a47d43 100644 (file)
@@ -69,8 +69,7 @@
  * for FCC)
  *
  * if CONFIG_ETHER_NONE is defined, then either the ethernet routines must be
- * defined elsewhere (as for the console), or CFG_CMD_NET must be removed
- * from CONFIG_COMMANDS to remove support for networking.
+ * defined elsewhere (as for the console), or CONFIG_CMD_NET must be unset.
  */
 #undef CONFIG_ETHER_ON_SCC             /* define if ether on SCC       */
 #define        CONFIG_ETHER_ON_FCC             /* define if ether on FCC       */
 
 #define CONFIG_LAST_STAGE_INIT
 
-#define CONFIG_COMMANDS                (CFG_CMD_ALL & ~( \
-                                       CFG_CMD_BEDBUG  | \
-                                       CFG_CMD_BMP     | \
-                                       CFG_CMD_DISPLAY | \
-                                       CFG_CMD_DOC     | \
-                                       CFG_CMD_EXT2    | \
-                                       CFG_CMD_FDC     | \
-                                       CFG_CMD_FDOS    | \
-                                       CFG_CMD_FPGA    | \
-                                       CFG_CMD_HWFLOW  | \
-                                       CFG_CMD_IDE     | \
-                                       CFG_CMD_JFFS2   | \
-                                       CFG_CMD_NAND    | \
-                                       CFG_CMD_MMC     | \
-                                       CFG_CMD_PCMCIA  | \
-                                       CFG_CMD_PCI     | \
-                                       CFG_CMD_USB     | \
-                                       CFG_CMD_REISER  | \
-                                       CFG_CMD_SCSI    | \
-                                       CFG_CMD_SPI     | \
-                                       CFG_CMD_UNIVERSE| \
-                                       CFG_CMD_VFD     | \
-                                       CFG_CMD_XIMG    ) )
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_all.h>
+
+#undef CONFIG_CMD_BEDBUG
+#undef CONFIG_CMD_BMP
+#undef CONFIG_CMD_DISPLAY
+#undef CONFIG_CMD_DOC
+#undef CONFIG_CMD_EXT2
+#undef CONFIG_CMD_FDC
+#undef CONFIG_CMD_FDOS
+#undef CONFIG_CMD_FPGA
+#undef CONFIG_CMD_HWFLOW
+#undef CONFIG_CMD_IDE
+#undef CONFIG_CMD_JFFS2
+#undef CONFIG_CMD_NAND
+#undef CONFIG_CMD_MFSL
+#undef CONFIG_CMD_MMC
+#undef CONFIG_CMD_PCMCIA
+#undef CONFIG_CMD_PCI
+#undef CONFIG_CMD_USB
+#undef CONFIG_CMD_REISER
+#undef CONFIG_CMD_SCSI
+#undef CONFIG_CMD_SPI
+#undef CONFIG_CMD_UNIVERSE
+#undef CONFIG_CMD_VFD
+#undef CONFIG_CMD_XIMG
+
 
 #ifdef DEBUG
 #define CONFIG_BOOTDELAY       -1      /* autoboot disabled            */
 #define DEBUG_BOOTKEYS         0
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #undef CONFIG_KGDB_ON_SMC              /* define if kgdb on SMC */
 #define        CONFIG_KGDB_ON_SCC              /* define if kgdb on SCC */
 #undef CONFIG_KGDB_NONE                /* define if kgdb on something else */
  */
 #define        CFG_LONGHELP                    /* undef to save memory         */
 #define        CFG_PROMPT      "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     32      /* For MPC8260 CPU              */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value*/
 #endif
 
index b1dbe2ccb944d392aa001446a0f2d5686663145f..1ab7b27a5d894added363ca0f3b839e5919b9cce 100644 (file)
        "u-boot=/tftpboot/idmr/u-boot.bin\0"                            \
        ""
 
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
 /*
- * Commands' definition
+ * Command line configuration.
  */
-#define CONFIG_COMMANDS                ((CONFIG_CMD_DFL                | \
-                                       CFG_CMD_PING            | \
-                                       CFG_CMD_JFFS2           | \
-                                       CFG_CMD_NET)            & \
-                                       ~(CFG_CMD_LOADS         | \
-                                               CFG_CMD_LOADB))
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_JFFS2
+#define CONFIG_CMD_NET
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+#undef CONFIG_CMD_LOADS
+#undef CONFIG_CMD_LOADB
 
 
 /*
 #define CFG_PROMPT             "=> "
 #define CFG_LONGHELP                           /* undef to save memory */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024            /* Console I/O Buffer Size */
-#else /* !(CONFIG_COMMANDS & CFG_CMD_KGDB) */
+#else
 #define CFG_CBSIZE             256             /* Console I/O Buffer Size */
-#endif /* (CONFIG_COMMANDS & CFG_CMD_KGDB) */
+#endif
 
 #define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16) /* Print Buffer Size */
 #define CFG_MAXARGS            16              /* max number of command args */
                                                "2m(rootfs),"   \
                                                "-(user)";
 
-#if (CONFIG_COMMANDS & CFG_CMD_MII)
+#if defined(CONFIG_CMD_MII)
 #error MII commands don't work on iDMR board and sholud not be enabled.
-#endif /* (CONFIG_COMMANDS & CFG_CMD_MII) */
+#endif
 
 #endif /* _IDMR_H */
index 8b841ff546f6ac39ba6e904b3060ec71929b2536..0e52ffe0a298b0a3432afcff49ad5dd1363e9219 100644 (file)
 
 #define CONFIG_BAUDRATE                9600
 
-#define CONFIG_BOOTP_MASK       (CONFIG_BOOTP_DEFAULT|CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
 
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL | CFG_CMD_JFFS2)
+#define CONFIG_CMD_JFFS2
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
 
 #define CONFIG_BOOTDELAY       3
 #define CONFIG_BOOTARGS        "devfs=mount root=ramfs console=ttyS0,9600"
@@ -77,7 +88,7 @@
 /*#define CONFIG_BOOTFILE      "impa7" */
 #define CONFIG_BOOTCOMMAND     "bootp;bootm"
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400          /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2               /* which serial port to use */
 #endif
index 1c6216be843e89f037e0f373992e77e21730eff8..4caf54efd318cb4cfbc8ebd05b93ed912910b781 100644 (file)
        ""
 #define CONFIG_BOOTCOMMAND     "run flash_self"
 
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_JFFS2   | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_SNTP    )
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_JFFS2
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_SNTP
+
 
 /*
  * Miscellaneous configurable options
index ad3cf06e95039ed7ac6db9766df708192ed09837..0fac28fadd70d128cb799b9d811ad2cec26ef0d0 100644 (file)
 
 #define CONFIG_MISC_INIT_F     1       /* Use misc_init_f()                    */
 
-#define CFG_CACHELINE_SIZE     32      /* For MPC5xxx CPUs                     */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
-#  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value        */
-#endif
-
 /*
  * Serial console configuration
  */
 #define CONFIG_DOS_PARTITION
 #define CONFIG_ISO_PARTITION
 
+
 /*
- * Supported commands
+ * BOOTP options
  */
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_EXT2    | \
-                               CFG_CMD_FAT     | \
-                               CFG_CMD_IDE     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_SNTP    | \
-                               CFG_CMD_USB     )
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_EXT2
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_SNTP
+#define CONFIG_CMD_USB
+
 
 #define        CONFIG_TIMESTAMP        1       /* Print image info with timestamp */
 
  */
 #define CFG_LONGHELP                   /* undef to save memory     */
 #define CFG_PROMPT             "=> "   /* Monitor Command Prompt   */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024    /* Console I/O Buffer Size  */
 #else
 #define CFG_CBSIZE             256     /* Console I/O Buffer Size  */
 #define CFG_MAXARGS            16      /* max number of command args   */
 #define CFG_BARGSIZE           CFG_CBSIZE      /* Boot Argument Buffer Size    */
 
+#define CFG_CACHELINE_SIZE     32      /* For MPC5xxx CPUs                     */
+#if defined(CONFIG_CMD_KGDB)
+#  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value        */
+#endif
+
 /* Enable an alternate, more extensive memory test */
 #define CFG_ALT_MEMTEST
 
 #define CFG_HZ                 1000    /* decrementer freq: 1 ms ticks */
 
 /*
- * Enable loopw commando. This has only affect, if CFG_CMD_MEM is defined,
- * which is normally part of the default commands (CFV_CMD_DFL)
+ * Enable loopw command.
  */
 #define CONFIG_LOOPW
 
index 3cb9ebc454cf413b148a95c1b54aa9dcb0d5e34b..5310e0d428fd50b0adb7890a429d112faa5f097f 100644 (file)
 #define CONFIG_BAUDRATE                19200
 #define CONFIG_MISC_INIT_R     1       /* we have a misc_init_r() function */
 
-#define CONFIG_COMMANDS (CFG_CMD_BDI|CFG_CMD_LOADB|CFG_CMD_IMI|CFG_CMD_FLASH|CFG_CMD_MEMORY|CFG_CMD_NET|CFG_CMD_ENV|CFG_CMD_RUN|CFG_CMD_ASKENV|CFG_CMD_ECHO|CFG_CMD_I2C|CFG_CMD_DHCP|CFG_CMD_CACHE)
-/* CONFIG_CMD_DFL|CFG_CMD_I2C|CFG_CMD_EEPROM|CFG_CMD_NET|CFG_CMD_JFFS2|CFG_CMD_DHCP) */
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any)   */
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_BDI
+#define CONFIG_CMD_CACHE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_ECHO
+#define CONFIG_CMD_ENV
+#define CONFIG_CMD_FLASH
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_IMI
+#define CONFIG_CMD_LOADB
+#define CONFIG_CMD_MEMORY
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_RUN
+
 
 #define CONFIG_BOOTDELAY       3
 /* #define CONFIG_BOOTARGS     "root=/dev/nfs ip=bootp console=ttyS0,19200" */
index 2f6e3993be426c455677ebceef25de3a7728dd89..1452bf2c46769637854edef70c38f786200a7062 100644 (file)
 #define CFG_SERIAL0            0x16000000
 #define CFG_SERIAL1            0x17000000
 
-/*#define CONFIG_COMMANDS      (CFG_CMD_DHCP | CFG_CMD_IMI | CFG_CMD_NET | CFG_CMD_PING | CFG_CMD_BDI | CFG_CMD_PCI) */
 /*#define CONFIG_NET_MULTI */
-/*#define CONFIG_BOOTP_MASK      CONFIG_BOOTP_DEFAULT */
 
-#define CONFIG_COMMANDS (CFG_CMD_IMI | CFG_CMD_BDI | CFG_CMD_MEMORY)
 
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+
+#define CONFIG_CMD_IMI
+#define CONFIG_CMD_BDI
+#define CONFIG_CMD_MEMORY
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
 
 #define CONFIG_BOOTDELAY       2
 #define CONFIG_BOOTARGS                "root=/dev/mtdblock0 mem=32M console=ttyAM0 console=tty"
index 4189f9c995c6d492e75cc5515e1ac27adc6dc955..69310d4dfbc56aaab0f0808c52e61dadbb9e592f 100644 (file)
 #define CFG_SERIAL0            0x16000000
 #define CFG_SERIAL1            0x17000000
 
+
 /*
-#define CONFIG_COMMANDS                (CFG_CMD_DFL | CFG_CMD_PCI)
-*/
-#define CONFIG_COMMANDS                (CFG_CMD_DHCP | CFG_CMD_IMI | CFG_CMD_NET | CFG_CMD_PING | \
-                                CFG_CMD_BDI | CFG_CMD_MEMORY | CFG_CMD_FLASH | CFG_CMD_ENV \
-                               )
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
 
-/* #define CONFIG_BOOTP_MASK   CONFIG_BOOTP_DEFAULT */
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * Command line configuration.
+ */
+#define CONFIG_CMD_BDI
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_ENV
+#define CONFIG_CMD_FLASH
+#define CONFIG_CMD_IMI
+#define CONFIG_CMD_MEMORY
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_PING
+
 
 #if 0
 #define CONFIG_BOOTDELAY       2
index 9f9fdb25e2c86adbc475425097f4b93d5dc16b1e..bc5f9e19bdc3b266ca99e86964da559750ee7c5a 100644 (file)
 
 #define CONFIG_BAUDRATE         115200
 
-#define CONFIG_COMMANDS         (CONFIG_CMD_DFL | CFG_CMD_ELF | CFG_CMD_PCI)
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_PCI
+
 
 #define CONFIG_PCI
 #define CONFIG_NET_MULTI
 #define CONFIG_EEPRO100
-/* This must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-/* These are u-boot generic parameters */
-#include <cmd_confdefs.h>
 
 #define CONFIG_BOOTDELAY        3
 /*#define CONFIG_ETHADDR          08:00:3e:26:0a:5b*/
@@ -71,7 +85,7 @@
 #define CONFIG_BOOTARGS         "root=/dev/mtdblock2 rootfstype=cramfs console=ttyS0,115200"
 #define CONFIG_CMDLINE_TAG
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE    230400          /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX   2               /* which serial port to use */
 #endif
index af4ecf621a38d509244a46d48dfffb498a14fd32..da59230bb6568b5ec04de837f3334c3778a8e2b1 100644 (file)
 #define CONFIG_BAUDRATE         115200
 #define CFG_IXP425_CONSOLE     IXP425_UART1   /* we use UART1 for console */
 
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_NET     | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_PING)
-
-/* This must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-/* These are u-boot generic parameters */
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_PING
+
 
 #define CONFIG_ZERO_BOOTDELAY_CHECK    /* check for keypress on bootdelay==0 */
 #define CONFIG_BOOTDELAY       5       /* autoboot after 5 seconds     */
index 5b97526fc49496559bd6466c75a859051fd6add0..b68c5aa46e57e218b03a73fa6b2f555cff1d609c 100644 (file)
 #define BOOTFLAG_COLD          0x01    /* Normal Power-On: Boot from FLASH  */
 #define BOOTFLAG_WARM          0x02    /* Software reboot           */
 
-#define CFG_CACHELINE_SIZE     32      /* For MPC5xxx CPUs */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
-#  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
-#endif
-
 /*
  * Serial console configuration
  */
@@ -71,7 +66,6 @@
 #define CONFIG_PCI_IO_BUS      0x50000000
 #define CONFIG_PCI_IO_PHYS     CONFIG_PCI_IO_BUS
 #define CONFIG_PCI_IO_SIZE     0x01000000
-#define ADD_PCI_CMD            CFG_CMD_PCI
 #endif
 
 #define CFG_XLB_PIPELINING     1
 
 #define        CONFIG_TIMESTAMP                /* Print image info with timestamp */
 
+
 /*
- * Supported commands
+ * BOOTP options
  */
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_SNTP)
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_SNTP
+
+#if defined(CONFIG_PCI)
+#define CODFIG_CMD_PCI
+#endif
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
 
 /*
  * Autobooting
 #ifdef CFG_HUSH_PARSER
 #define        CFG_PROMPT_HUSH_PS2     "> "
 #endif
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024    /* Console I/O Buffer Size  */
 #else
 #define CFG_CBSIZE             256     /* Console I/O Buffer Size  */
 
 #define CFG_HZ                 1000    /* decrementer freq: 1 ms ticks */
 
+#define CFG_CACHELINE_SIZE     32      /* For MPC5xxx CPUs */
+#if defined(CONFIG_CMD_KGDB)
+#  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
+#endif
+
 /*
  * Various low-level settings
  */
index a7eda0773bc33680348763a29d4dc7030fd333c8..110ad44ee1bc5fc115a6332893fd715bc8e42de1 100644 (file)
 #define CONFIG_LOADS_ECHO      1       /* echo on for serial download  */
 #define CFG_LOADS_BAUD_CHANGE  1       /* allow baudrate change        */
 
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_DIAG    | \
-                               CFG_CMD_DTT     | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_EXT2    | \
-                               CFG_CMD_FAT     | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_NET     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_REGINFO | \
-                               CFG_CMD_SDRAM)
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_DIAG
+#define CONFIG_CMD_DTT
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_EXT2
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_SDRAM
+
 
 #define        CONFIG_IBM_EMAC4_V4     1       /* 440SPe has this EMAC version */
 #define CONFIG_MII             1       /* MII PHY management           */
 #define CFG_LONGHELP                           /* undef to save memory         */
 #define CFG_PROMPT             "=> "           /* Monitor Command Prompt       */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE             256             /* Console I/O Buffer Size      */
  */
 #define CFG_DCACHE_SIZE                8192    /* For AMCC 405 CPUs            */
 #define CFG_CACHELINE_SIZE     32      /* ...                          */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value */
 #endif
 
 #define BOOTFLAG_COLD  0x01            /* Normal Power-On: Boot from FLASH */
 #define BOOTFLAG_WARM  0x02            /* Software reboot */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
index 6590f6f5f0dc641efff675fa0ef04efb200bfbe0..75d9c3b3b46ef52a2c16084c195ead5909162361 100644 (file)
 #define CONFIG_BOOTDELAY       3
 #define CONFIG_ENV_OVERWRITE   1
 
-#define CONFIG_COMMANDS                \
-                      ((CONFIG_CMD_DFL | \
-                       CFG_CMD_I2C | \
-                       CFG_CMD_PING | \
-                       CFG_CMD_DHCP ) & \
-                     ~(CFG_CMD_BDI | \
-                       CFG_CMD_FPGA | \
-                       CFG_CMD_MISC))
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_DHCP
+
+#undef CONFIG_CMD_BDI
+#undef CONFIG_CMD_FPGA
+#undef CONFIG_CMD_MISC
+
 
 #define CONFIG_NR_DRAM_BANKS 1
 #define PHYS_SDRAM 0x20000000
index 61cf70576d779be607a1a82a1969cc94060487ba..569800aa2313c7ca308ef25fd26709749f72eafc 100644 (file)
 
 #undef CONFIG_WATCHDOG
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
 
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 
 #define CONFIG_RTC_DS164x
 
-#define CONFIG_COMMANDS                ( CONFIG_CMD_DFL        | \
-                                 CFG_CMD_ASKENV        | \
-                                 CFG_CMD_CACHE         | \
-                                 CFG_CMD_DATE          | \
-                                 CFG_CMD_DHCP          | \
-                                 CFG_CMD_DIAG          | \
-                                 CFG_CMD_EEPROM        | \
-                                 CFG_CMD_ELF           | \
-                                 CFG_CMD_I2C           | \
-                                 CFG_CMD_JFFS2         | \
-                                 CFG_CMD_NFS           | \
-                                 CFG_CMD_PCI           | \
-                                 CFG_CMD_PING          | \
-                                 CFG_CMD_SDRAM         | \
-                                 CFG_CMD_SNTP)
 
-#define CONFIG_NETCONSOLE
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_CACHE
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_DIAG
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_JFFS2
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_SDRAM
+#define CONFIG_CMD_SNTP
 
-#include <cmd_confdefs.h>
+
+#define CONFIG_NETCONSOLE
 
 #define CFG_LONGHELP
 #define CFG_PROMPT             "=> "
 #define CONFIG_SYS_CLK_FREQ    33333333
 
 #define CFG_CACHELINE_SIZE     32
-#if CONFIG_COMMANDS & CFG_CMD_KGDB
+#if defined(CONFIG_CMD_KGDB)
 #  define CFG_CACHELINE_SHIFT  5
 #endif
 
index a00640bf8e641a50ab3ea710c8b4c38255bc28fd..8f18c9f1b1bfc4ed36f17deeed4728ccad81ed59 100644 (file)
 
 #define CONFIG_BAUDRATE                9600
 
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL)
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
 
 #define CONFIG_BOOTDELAY       3
 #define CONFIG_BOOTARGS        "root=ramfs devfs=mount console=ttySA0,9600"
@@ -73,7 +84,7 @@
 #define CONFIG_BOOTFILE                "elinos-lart"
 #define CONFIG_BOOTCOMMAND     "tftp; bootm"
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400          /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2               /* which serial port to use */
 #endif
index 715ed74eadec5dc7d7c8f98779135718be60b482..2b2d37751e0901d46514f2cc2ad5895d144c846f 100644 (file)
 #define CONFIG_BAUDRATE                19200
 #undef CONFIG_MISC_INIT_R              /* FIXME: misc_init_r() missing     */
 
-#define CONFIG_COMMANDS (CFG_CMD_FLASH|CFG_CMD_MEMORY|CFG_CMD_ENV|CFG_CMD_RUN|CFG_CMD_ASKENV|CFG_CMD_ECHO)
-/* CONFIG_CMD_DFL|CFG_CMD_I2C|CFG_CMD_EEPROM|CFG_CMD_NET|CFG_CMD_JFFS2|CFG_CMD_DHCP) */
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any)   */
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_ECHO
+#define CONFIG_CMD_ENV
+#define CONFIG_CMD_FLASH
+#define CONFIG_CMD_MEMORY
+#define CONFIG_CMD_RUN
+
 
 #define CONFIG_BOOTDELAY       3
 /* #define CONFIG_BOOTARGS     "root=/dev/nfs ip=bootp console=ttyS0,19200" */
old mode 100755 (executable)
new mode 100644 (file)
index 7b6c695..e3fef5e
 
 #define CONFIG_BAUDRATE                115200
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT|CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
 
 /*
- * Supported commands
+ * Command line configuration.
  */
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_FAT     | \
-                               CFG_CMD_MMC     | \
-                               CFG_CMD_NET     | \
-                               CFG_CMD_PING)
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_MMC
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_PING
+
 
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-
 #define CONFIG_BOOTDELAY       5
 
 /*
index d7d0460ef663b0b8b70a1cb7e00b5ad69ecfb070..04148898eaca979f87197467d55cb9ef72df5fa6 100644 (file)
 
 #define        CONFIG_TIMESTAMP        1       /* Print timestamp info for images */
 
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
 #ifndef USE_920T_MMU
-#define CONFIG_COMMANDS ((CONFIG_CMD_DFL | CFG_CMD_PING) & ~(CFG_CMD_CACHE))
+    #define CONFIG_CMD_PING
+    #undef CONFIG_CMD_CACHE
 #else
-#define CONFIG_COMMANDS (CONFIG_CMD_DFL | CFG_CMD_DATE)
+    #define CONFIG_CMD_DATE
 #endif
 
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-
 #define CONFIG_BOOTDELAY       3
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   115200          /* speed to run kgdb serial port */
 /* what's this ? it's not used anywhere */
 #define CONFIG_KGDB_SER_INDEX  1               /* which serial port to use */
index 4002e6849cc25727d5ad55397e74ce7e1b29e26f..11ede968180822bea92f7397e38d895e74009f72 100644 (file)
 
 #define        CONFIG_TIMESTAMP        1       /* Print timestamp info for images */
 
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
 #ifndef USE_920T_MMU
-#define CONFIG_COMMANDS ((CONFIG_CMD_DFL | CFG_CMD_PING) & ~(CFG_CMD_CACHE))
+    #define CONFIG_CMD_PING)
+    #undef CONFIG_CMD_CACHE
 #else
-#define CONFIG_COMMANDS (CONFIG_CMD_DFL | CFG_CMD_DATE)
+    #define CONFIG_CMD_DATE
 #endif
 
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-
 #define CONFIG_BOOTDELAY       3
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   115200          /* speed to run kgdb serial port */
 /* what's this ? it's not used anywhere */
 #define CONFIG_KGDB_SER_INDEX  1               /* which serial port to use */
index cbb59c50eaf3a8c605f51910b8dcd12f8653df36..72aae09d03971a831e037b25441c8b45130f7c9c 100644 (file)
 #define CONFIG_HW_WATCHDOG                     /* watchdog */
 #endif
 
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL          |       \
-                               CFG_CMD_ASKENV          |       \
-                               CFG_CMD_DHCP            |       \
-                               CFG_CMD_ELF             |       \
-                               CFG_CMD_EEPROM          |       \
-                               CFG_CMD_I2C             |       \
-                               CFG_CMD_IRQ             |       \
-                               CFG_CMD_MII             |       \
-                               CFG_CMD_NET             |       \
-                               CFG_CMD_NFS             |       \
-                               CFG_CMD_PCI             |       \
-                               CFG_CMD_PING            |       \
-                               CFG_CMD_REGINFO         |       \
-                               CFG_CMD_SDRAM           |       \
-                               0)
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS */
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_SDRAM
+
 
 /*
  * Miscellaneous configurable options
  */
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT             "=> "   /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024    /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE             256     /* Console I/O Buffer Size      */
  * PCI stuff
  *-----------------------------------------------------------------------
  */
-#if (CONFIG_COMMANDS & CFG_CMD_PCI)
+#if defined(CONFIG_CMD_PCI)
 
 /* General PCI */
 #define CONFIG_PCI                     /* include pci support          */
 #define CFG_PCI_SUBSYS_VENDORID 0x10e8 /* AMCC */
 #define CFG_PCI_SUBSYS_DEVICEID 0x4403 /* whatever */
 
-#endif /* CONFIG_COMMANDS & CFG_CMD_PCI */
+#endif
 
 /*
  * For booting Linux, the board info and command line data
  */
 #define CFG_DCACHE_SIZE                (32<<10) /* For AMCC 440 CPUs                   */
 #define CFG_CACHELINE_SIZE     32      /* ...                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value        */
 #endif
 
 #define BOOTFLAG_COLD  0x01            /* Normal Power-On: Boot from FLASH     */
 #define BOOTFLAG_WARM  0x02            /* Software reboot                      */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
index ad1035b6d63173dda5c1ab3553c9715fb798278d..4adf2542219fbaeb7d4284ef41f28a087c74b0a2 100644 (file)
 
 #define CONFIG_BAUDRATE                115200
 
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL | CFG_CMD_MMC | CFG_CMD_FAT)
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_MMC
+#define CONFIG_CMD_FAT
+
 
 #define CONFIG_BOOTDELAY       3
 #define CONFIG_ETHADDR         08:00:3e:26:0a:5b
@@ -82,7 +96,7 @@
 #define CONFIG_CMDLINE_TAG
 #define CONFIG_TIMESTAMP
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400          /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2               /* which serial port to use */
 #endif
index 9b4c0046ef486068e210d248b3d7360f73a9ef20..8a8270260a36ba2ad80891fd8ce1087bf404ee13 100644 (file)
 
 #define CONFIG_RTC_PCF8563             /* use Philips PCF8563 RTC      */
 
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_BMP
+#define CONFIG_CMD_BSP
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_SNTP
+
 #ifdef CONFIG_POST
-#define CFG_CMD_POST_DIAG CFG_CMD_DIAG
-#else
-#define CFG_CMD_POST_DIAG 0
+#define CONFIG_CMD_DIAG
 #endif
 
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_BMP     | \
-                               CFG_CMD_BSP     | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_FAT     | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_IDE     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_POST_DIAG | \
-                               CFG_CMD_SNTP    )
+
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
 
-/*----------------------------------------------------------------------*/
 
 /*
  * Miscellaneous configurable options
 #define        CFG_PROMPT_HUSH_PS2     "> "
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
  */
 #define CFG_SDRAM_BASE         0x00000000
 #define CFG_FLASH_BASE         0x40000000
-#if defined(DEBUG) || (CONFIG_COMMANDS & CFG_CMD_IDE)
+#if defined(DEBUG) || defined(CONFIG_CMD_IDE)
 #define CFG_MONITOR_LEN                (256 << 10)     /* Reserve 256 kB for Monitor   */
 #else
 #define CFG_MONITOR_LEN                (128 << 10)     /* Reserve 128 kB for Monitor   */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index 1d87c73c7116cc277301050797d0045b4f42f274..ef9ab22b60ad566602cfbdff7935db91cd1e961b 100644 (file)
 /* Comment this out to enable USB 1.1 device */
 #define USB_2_0_DEVICE
 
-#define CMD_USB                        CFG_CMD_USB
-#else
-#define CMD_USB                        0       /* no USB on 440GRx             */
 #endif /* CONFIG_440EPX */
 
 /* Partitions */
 #define CONFIG_DOS_PARTITION
 #define CONFIG_ISO_PARTITION
 
-#define CONFIG_COMMANDS       (CONFIG_CMD_DFL  |       \
-                              CFG_CMD_ASKENV   |       \
-                              CFG_CMD_DATE     |       \
-                              CFG_CMD_DHCP     |       \
-                              CFG_CMD_DIAG     |       \
-                              CFG_CMD_EEPROM   |       \
-                              CFG_CMD_ELF      |       \
-                              CFG_CMD_FAT      |       \
-                              CFG_CMD_I2C      |       \
-                              CFG_CMD_IRQ      |       \
-                              CFG_CMD_MII      |       \
-                              CFG_CMD_NET      |       \
-                              CFG_CMD_NFS      |       \
-                              CFG_CMD_PCI      |       \
-                              CFG_CMD_PING     |       \
-                              CFG_CMD_REGINFO  |       \
-                              CFG_CMD_SDRAM    |       \
-                              CMD_USB)
 
-#define CONFIG_SUPPORT_VFAT
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_DIAG
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_SDRAM
+
+#ifdef CONFIG_440EPX
+#define CONFIG_CMD_USB
+#endif
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
 
 /*-----------------------------------------------------------------------
  * Miscellaneous configurable options
  *----------------------------------------------------------------------*/
+#define CONFIG_SUPPORT_VFAT
+
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT             "=> "   /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024    /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE             256     /* Console I/O Buffer Size      */
  *----------------------------------------------------------------------*/
 #define CFG_DCACHE_SIZE                (32<<10)  /* For AMCC 440 CPUs                  */
 #define CFG_CACHELINE_SIZE     32            /* ...                                */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5             /* log base 2 of the above value  */
 #endif
 
 #define BOOTFLAG_COLD  0x01            /* Normal Power-On: Boot from FLASH     */
 #define BOOTFLAG_WARM  0x02            /* Software reboot                      */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2           /* which serial port to use */
 #endif
index c2324a04c911396e38690d1ad165cc49ca8ef569..744f551c3e88dcbbc79948c8869cd057bc4a8921 100644 (file)
 #define BOOTFLAG_COLD          0x01    /* Normal Power-On: Boot from FLASH     */
 #define BOOTFLAG_WARM          0x02    /* Software reboot                      */
 
-#define CFG_CACHELINE_SIZE     32      /* For MPC5xxx CPUs                     */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
-#  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value        */
-#endif
-
 /*
  * Serial console configuration
  *
 
 /* USB */
 #define CONFIG_USB_OHCI
-#define ADD_USB_CMD            CFG_CMD_USB | CFG_CMD_FAT
 #define CONFIG_USB_STORAGE
 /* automatic software updates (see board/mcc200/auto_update.c) */
 #define CONFIG_AUTO_UPDATE 1
 
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
 /*
- * Supported commands
+ * Command line configuration.
  */
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               ADD_USB_CMD     | \
-                               CFG_CMD_BEDBUG  | \
-                               CFG_CMD_FAT     | \
-                               CFG_CMD_I2C)
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_BEDBUG
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_USB
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
 
 /*
  * Autobooting
  */
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT             "=> "   /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024    /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE             256     /* Console I/O Buffer Size      */
 
 #define CFG_HZ                 1000    /* decrementer freq: 1 ms ticks */
 
+#define CFG_CACHELINE_SIZE     32      /* For MPC5xxx CPUs                     */
+#if defined(CONFIG_CMD_KGDB)
+#  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value        */
+#endif
+
 /*
  * Various low-level settings
  */
index 0c1029426c286cffc7074b3e09e35a533196294d..49919fbafbbf3aac0bd149e7b2cd30c8aedbceaa 100644 (file)
 #define BOOTFLAG_COLD          0x01    /* Normal Power-On: Boot from FLASH  */
 #define BOOTFLAG_WARM          0x02    /* Software reboot           */
 
-#define CFG_CACHELINE_SIZE     32      /* For MPC5xxx CPUs */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
-#  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
-#endif
-
 /*
  * Serial console configuration
  */
 /* USB */
 #if 0
 #define CONFIG_USB_OHCI
-#define ADD_USB_CMD            CFG_CMD_USB | CFG_CMD_FAT
 #define CONFIG_USB_STORAGE
-#else
-#define ADD_USB_CMD            0
 #endif
 
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
 /*
- * Supported commands
+ * Command line configuration.
  */
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL | \
-                                CFG_CMD_EEPROM | \
-                                CFG_CMD_FAT    | \
-                                CFG_CMD_EXT2   | \
-                                CFG_CMD_I2C    | \
-                                CFG_CMD_IDE    | \
-                                CFG_CMD_BSP    | \
-                                CFG_CMD_ELF)
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_EXT2
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_BSP
+#define CONFIG_CMD_ELF
+
 
 #if (TEXT_BASE == 0xFF000000)          /* Boot low with 16 MB Flash */
 #   define CFG_LOWBOOT         1
  */
 #define CFG_LONGHELP                   /* undef to save memory     */
 #define CFG_PROMPT             "=> "   /* Monitor Command Prompt   */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024    /* Console I/O Buffer Size  */
 #else
 #define CFG_CBSIZE             256     /* Console I/O Buffer Size  */
 
 #define CFG_VXWORKS_MAC_PTR    0x00000000      /* Pass Ethernet MAC to VxWorks */
 
+#define CFG_CACHELINE_SIZE     32      /* For MPC5xxx CPUs */
+#if defined(CONFIG_CMD_KGDB)
+#  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
+#endif
+
 /*
  * Various low-level settings
  */
index 6762cd61eae5b50d11a259e592bfa588a90a8d3d..0183041842af27139d5f25a5d2a052a7ee1d25c2 100644 (file)
 #define CONFIG_LOADS_ECHO      1       /* echo on for serial download  */
 #define CFG_LOADS_BAUD_CHANGE  1       /* allow baudrate change        */
 
-#define REMOVE_COMMANDS               (CFG_CMD_FLASH | CFG_CMD_LOADS | CFG_CMD_FAT | \
-                               CFG_CMD_IMLS )
-#define CONFIG_COMMANDS               ((CONFIG_CMD_DFL | CFG_CMD_NET) \
-                               & ~REMOVE_COMMANDS)
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_NET
+
+#undef CONFIG_CMD_FLASH
+#undef CONFIG_CMD_LOADS
+#undef CONFIG_CMD_FAT
+#undef CONFIG_CMD_IMLS
+
 
 /* #define CONFIG_SYS_CLK_FREQ XPAR_CORE_CLOCK_FREQ_HZ */
 /* 300000000 */
index 8b74b7c686db4c6fa854bb1b189b0069af5982a4..831929882ab7cad4fe4d3f9539376a66cb7da69b 100644 (file)
        #define CFG_FLASH_PROTECTION            /* hardware flash protection */
 #endif /* !FLASH */
 
-#ifdef FLASH
-       #ifdef  RAMENV
-       #define CONFIG_COMMANDS (CONFIG__CMD_DFL |\
-                               CFG_CMD_MEMORY |\
-                               CFG_CMD_MISC |\
-                               CFG_CMD_AUTOSCRIPT |\
-                               CFG_CMD_IRQ |\
-                               CFG_CMD_ASKENV |\
-                               CFG_CMD_BDI |\
-                               CFG_CMD_RUN |\
-                               CFG_CMD_LOADS |\
-                               CFG_CMD_LOADB |\
-                               CFG_CMD_IMI |\
-                               CFG_CMD_NET |\
-                               CFG_CMD_CACHE |\
-                               CFG_CMD_FAT |\
-                               CFG_CMD_EXT2 |\
-                               CFG_CMD_JFFS2 |\
-                               CFG_CMD_ECHO |\
-                               CFG_CMD_IMLS |\
-                               CFG_CMD_FLASH |\
-                               CFG_CMD_MFSL |\
-                               CFG_CMD_PING \
-                               )
-       #else   /* !RAMENV */
-       #define CONFIG_COMMANDS (CONFIG__CMD_DFL |\
-                               CFG_CMD_MEMORY |\
-                               CFG_CMD_MISC |\
-                               CFG_CMD_AUTOSCRIPT |\
-                               CFG_CMD_IRQ |\
-                               CFG_CMD_ASKENV |\
-                               CFG_CMD_BDI |\
-                               CFG_CMD_RUN |\
-                               CFG_CMD_LOADS |\
-                               CFG_CMD_LOADB |\
-                               CFG_CMD_IMI |\
-                               CFG_CMD_NET |\
-                               CFG_CMD_CACHE |\
-                               CFG_CMD_IMLS |\
-                               CFG_CMD_FLASH |\
-                               CFG_CMD_PING |\
-                               CFG_CMD_ENV |\
-                               CFG_CMD_FAT |\
-                               CFG_CMD_EXT2 |\
-                               CFG_CMD_JFFS2 |\
-                               CFG_CMD_ECHO |\
-                               CFG_CMD_MFSL |\
-                               CFG_CMD_SAVES \
-                               )
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
 
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_AUTOSCRIPT
+#define CONFIG_CMD_BDI
+#define CONFIG_CMD_CACHE
+#define CONFIG_CMD_EXT2
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_IMI
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_LOADB
+#define CONFIG_CMD_LOADS
+#define CONFIG_CMD_MEMORY
+#define CONFIG_CMD_MISC
+#define CONFIG_CMD_MFSL
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_RUN
+
+#if defined(FLASH)
+       #define CONFIG_CMD_ECHO
+       #define CONFIG_CMD_FLASH
+       #define CONFIG_CMD_IMLS
+       #define CONFIG_CMD_JFFS2
+
+       #if !defined(RAMENV)
+               #define CONFIG_CMD_ENV
+               #define CONFIG_CMD_SAVES
        #endif
+#endif
 
-#else  /* !FLASH */
-       #define CONFIG_COMMANDS (CONFIG__CMD_DFL |\
-                               CFG_CMD_MEMORY |\
-                               CFG_CMD_MISC |\
-                               CFG_CMD_AUTOSCRIPT |\
-                               CFG_CMD_IRQ |\
-                               CFG_CMD_ASKENV |\
-                               CFG_CMD_BDI |\
-                               CFG_CMD_RUN |\
-                               CFG_CMD_LOADS |\
-                               CFG_CMD_FAT |\
-                               CFG_CMD_EXT2 |\
-                               CFG_CMD_LOADB |\
-                               CFG_CMD_IMI |\
-                               CFG_CMD_NET |\
-                               CFG_CMD_CACHE |\
-                               CFG_CMD_MFSL |\
-                               CFG_CMD_PING \
-                               )
-#endif /* !FLASH */
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-
-#if (CONFIG_COMMANDS & CFG_CMD_JFFS2)
+#if defined(CONFIG_CMD_JFFS2)
 /* JFFS2 partitions */
 #define CONFIG_JFFS2_CMDLINE   /* mtdparts command line support */
 #define MTDIDS_DEFAULT         "nor0=ml401-0"
index 20287674faba014da69514eb3879144dccd77b9c..4461bdfd187ad856c2458ec5e5dc79b2b39075d3 100644 (file)
 
 #define CONFIG_BAUDRATE                38400
 
-#define CONFIG_BOOTP_MASK       (CONFIG_BOOTP_DEFAULT|CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
 
-#define CONFIG_COMMANDS                ((CONFIG_CMD_DFL | CFG_CMD_JFFS2))
+#define CONFIG_CMD_JFFS2
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
 
 #define CONFIG_NETMASK          255.255.255.0
 #define CONFIG_IPADDR          192.168.30.2
@@ -81,7 +92,7 @@
 #define CONFIG_BOOTCOMMAND     "bootm 0x10020000 0x100a0000"
 #define CONFIG_BOOTARGS        "console=ttyS0,38400 initrd=0x100a0040,530K root=/dev/ram keepinitrd"
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400          /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2               /* which serial port to use */
 #endif
index e3899a5ab4066da21b7d8b21f12687c83f923697..e0a827fdd71f328be6e6b5a1436a38cecf1dfe46 100644 (file)
 
 
 /*
- * Supported commands
- */
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_REGINFO | \
-                               CFG_CMD_IMMAP   | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_BEDBUG  | \
-                               CFG_CMD_NET     | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_IDE     | \
-                               CFG_CMD_FAT     | \
-                               CFG_CMD_JFFS2   | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_DTT)
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_IMMAP
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_BEDBUG
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_JFFS2
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_DTT
 
 
 /*
index 04f1f240808124f78181b062f8b4fe2dbbf0e1a3..8d6f2613c17434cd87d2f22cd3a5681d8cba623a 100644 (file)
 
 #define CONFIG_BOOTDELAY      3
 
-#ifdef CONFIG_HARD_I2C
-#define CONFIG_COMMANDS                \
-                      ((CONFIG_CMD_DFL | \
-                       CFG_CMD_DATE    | \
-                       CFG_CMD_DHCP    | \
-                       CFG_CMD_EEPROM  | \
-                       CFG_CMD_I2C     | \
-                       CFG_CMD_NFS     | \
-                       CFG_CMD_SNTP    | \
-                       CFG_CMD_MISC))
-#else
-#define CONFIG_COMMANDS                \
-                      ((CONFIG_CMD_DFL | \
-                       CFG_CMD_DHCP    | \
-                       CFG_CMD_NFS     | \
-                       CFG_CMD_SNTP    | \
-                       CFG_CMD_USB      | \
-                       CFG_CMD_CACHE)  & \
-                     ~(CFG_CMD_BDI | \
-                       CFG_CMD_IMI | \
-                       CFG_CMD_AUTOSCRIPT | \
-                       CFG_CMD_FPGA | \
-                       CFG_CMD_MISC | \
-                       CFG_CMD_LOADS ))
+
+#if !defined(CONFIG_HARD_I2C)
 #define CONFIG_TIMESTAMP
 #endif
-#define CFG_LONGHELP
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_SNTP
+
+#if defined(CONFIG_HARD_I2C)
+
+    #define CONFIG_CMD_DATE
+    #define CONFIG_CMD_EEPROM
+    #define CONFIG_CMD_I2C
+    #define CONFIG_CMD_MISC
+
+#else
+
+    #define CONFIG_CMD_USB
+    #define CONFIG_CMD_CACHE
+
+    #undef CONFIG_CMD_AUTOSCRIPT
+    #undef CONFIG_CMD_BDI
+    #undef CONFIG_CMD_FPGA
+    #undef CONFIG_CMD_IMI
+    #undef CONFIG_CMD_LOADS
+    #undef CONFIG_CMD_MISC
+
+#endif
+
+
+#define CFG_LONGHELP
 
 #define CONFIG_NR_DRAM_BANKS   1
 #define PHYS_SDRAM             0x20000000
index 243a3f6c8fc01478cfbd1353046a88c52f51a3ed..f4f33f3e089c5513bb57a8223d780accef0bf688 100644 (file)
 
 #undef CONFIG_WATCHDOG         /* watchdog disabled */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | \
-                               CONFIG_BOOTP_BOOTFILESIZE)
-
-#define CONFIG_COMMANDS (CONFIG_CMD_DFL \
-               | CFG_CMD_ASKENV \
-               | CFG_CMD_CACHE \
-               | CFG_CMD_PCI \
-               | CFG_CMD_I2C \
-               | CFG_CMD_SDRAM \
-               | CFG_CMD_EEPROM \
-               | CFG_CMD_FLASH \
-               | CFG_CMD_ENV \
-               | CFG_CMD_BSP \
-               | CFG_CMD_DHCP \
-               | CFG_CMD_PING \
-               | CFG_CMD_DATE)
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_CACHE
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_SDRAM
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_FLASH
+#define CONFIG_CMD_ENV
+#define CONFIG_CMD_BSP
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_DATE
+
 
 /*set date in u-boot*/
 #define CONFIG_RTC_M48T35A
 #define CFG_LONGHELP           /* undef to save memory */
 #define CFG_PROMPT     "=> "   /* Monitor Command Prompt */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024    /* Console I/O Buffer Size */
 #define CONFIG_KGDB_BAUDRATE   115200  /* speed to run kgdb serial port at */
 #else
 /*-----------------------------------------------------------------------
  * FLASH organization
  */
-#define CFG_MAX_FLASH_BANKS    1/* Flash can be at one of two addresses */
+#define CFG_MAX_FLASH_BANKS    1               /* Flash can be at one of two addresses */
 #define FLASH_BANK_SIZE                0x01000000      /* 16 MB Total */
-#define CFG_FLASH_BANKS_LIST {CFG_FLASH_BASE, CFG_FLASH_BASE2}
+#define CFG_FLASH_BANKS_LIST   { CFG_FLASH_BASE, /* CFG_FLASH_BASE2 */ }
 
 #define CFG_FLASH_CFI_DRIVER
 #define CFG_FLASH_CFI
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     32      /* For all MPC74xx CPUs */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value */
 #endif
 
index 7f3dfd5c987833b2ed533a11abf46846576d3231..5125b21e04f372f7158472604ad10a9627de4a54 100644 (file)
 
 #define CONFIG_BAUDRATE                115200
 
-/***********************************************************
- * Command definition
- ***********************************************************/
 
-#define CONFIG_COMMANDS \
-                       (CONFIG_CMD_DFL  | \
-                       CFG_CMD_CACHE    | \
-                       CFG_CMD_REGINFO  | \
-                       CFG_CMD_ELF)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_CACHE
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_ELF
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
 
 #define CONFIG_BOOTDELAY       3
 #define CONFIG_BOOTARGS                "root=/dev/msdk mem=48M"
 #define CONFIG_BOOTFILE                "mx1ads"
 #define CONFIG_BOOTCOMMAND     "tftp; bootm"
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   115200          /* speed to run kgdb serial port */
                                                /* what's this ? it's not used anywhere */
 #define CONFIG_KGDB_SER_INDEX  1               /* which serial port to use */
index 9816be8dc4fa10d76944ae709f7feb8dc58cf187..d527d098f5774ae43cdf81239bf67d787596d2ba 100644 (file)
 #undef _CONFIG_UART4 /* internal uart 4 */
 #undef CONFIG_SILENT_CONSOLE  /* use this to disable output */
 
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
 /*
- * Definition of u-boot build in commands. Check out CONFIG_CMD_DFL if
- * neccessary in include/cmd_confdefs.h file. (Un)comment for getting
- * functionality or size of u-boot code.
+ * Command line configuration.
  */
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL          \
-                               & ~CFG_CMD_LOADS         \
-                               & ~CFG_CMD_CONSOLE       \
-                               & ~CFG_CMD_AUTOSCRIPT    \
-                               & ~CFG_CMD_NET           \
-                               & ~CFG_CMD_PING          \
-                               & ~CFG_CMD_DHCP          \
-                               | CFG_CMD_JFFS2          \
-                               )
-
-#include <cmd_confdefs.h>
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_JFFS2
+
+#undef CONFIG_CMD_LOADS
+#undef CONFIG_CMD_CONSOLE
+#undef CONFIG_CMD_AUTOSCRIPT
+#undef CONFIG_CMD_NET
+#undef CONFIG_CMD_PING
+#undef CONFIG_CMD_DHCP
+
 
 /*
  * Boot options. Setting delay to -1 stops autostart count down.
  * Right now there is no gain for user, but later on booting kernel might be
  * possible. Consider using XIP kernel running from flash to save RAM
  * footprint.
- * NOTE: Enable CFG_CMD_JFFS2 for JFFS2 support.
+ * NOTE: Enable CONFIG_CMD_JFFS2 for JFFS2 support.
  */
 
 /*
index 697796a11432c0709e80ccea1250054ca8a108aa..33159d315634a23288f7e3df36484236f86f75c8 100644 (file)
 #define MTDIDS_DEFAULT         "nor0=omapflash.0,nand0=omapnand.0"
 #define MTDPARTS_DEFAULT       "mtdparts=omapflash.0:8k@16k(env),8k(r_env),448k@576k(u-boot);omapnand.0:48M(rootfs0),48M(rootfs1),-(data)"
 
-#if 0
-#define CONFIG_COMMANDS                (CFG_CMD_BDI    | \
-                                CFG_CMD_BOOTD  | \
-                                CFG_CMD_DHCP   | \
-                                CFG_CMD_ENV    | \
-                                CFG_CMD_FLASH  | \
-                                CFG_CMD_IMI    | \
-                                CFG_CMD_LOADB  | \
-                                CFG_CMD_NET    | \
-                                CFG_CMD_MEMORY | \
-                                CFG_CMD_PING   | \
-                                CFG_CMD_RUN)
 
-#else
-#define CONFIG_COMMANDS                (CFG_CMD_BDI    | \
-                                CFG_CMD_BOOTD  | \
-                                CFG_CMD_DHCP   | \
-                                CFG_CMD_ENV    | \
-                                CFG_CMD_FLASH  | \
-                                CFG_CMD_NAND   | \
-                                CFG_CMD_IMI    | \
-                                CFG_CMD_JFFS2  | \
-                                CFG_CMD_LOADB  | \
-                                CFG_CMD_NET    | \
-                                CFG_CMD_MEMORY | \
-                                CFG_CMD_PING   | \
-                                CFG_CMD_RUN)
+/*
+ * Command line configuration.
+ */
+
+#define CONFIG_CMD_BDI
+#define CONFIG_CMD_BOOTD
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_ENV
+#define CONFIG_CMD_FLASH
+#define CONFIG_CMD_IMI
+#define CONFIG_CMD_JFFS2
+#define CONFIG_CMD_LOADB
+#define CONFIG_CMD_MEMORY
+#define CONFIG_CMD_NAND
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_RUN
+
 
 #define CONFIG_JFFS2_NAND      1       /* jffs2 on nand support */
-#endif
 
-#define CONFIG_BOOTP_MASK      CONFIG_BOOTP_DEFAULT
-#define CONFIG_LOOPW
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+#define CONFIG_LOOPW
 
 #define CONFIG_BOOTDELAY       3
 #define CONFIG_ZERO_BOOTDELAY_CHECK    /* allow to break in always */
index 0b1541d5c346c86d4c3f64d710cc74344760299e..1d691f9731d22849f5bf39a1f9afdabeab14416a 100644 (file)
 
 #define CONFIG_BAUDRATE                38400
 
-/***********************************************************
- * Command definition
- ***********************************************************/
-#if 0 /* @TODO */
-#define CONFIG_COMMANDS \
-                       (CONFIG_CMD_DFL  | \
-                       CFG_CMD_CACHE    | \
-                       /*CFG_CMD_NAND   |*/ \
-                       /*CFG_CMD_EEPROM |*/ \
-                       /*CFG_CMD_I2C    |*/ \
-                       /*CFG_CMD_USB    |*/ \
-                       CFG_CMD_REGINFO  | \
-                       CFG_CMD_DATE     | \
-                       CFG_CMD_ELF)
-#else
-#define CONFIG_COMMANDS \
-                       (CONFIG_CMD_BDI | \
-                       CFG_CMD_NET | \
-                       CFG_CMD_PING     | \
-                       CFG_CMD_CONSOLE  | \
-                       CFG_CMD_LOADB    | \
-                       CFG_CMD_LOADS    | \
-                       CFG_CMD_MEMORY)
-#endif
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+
+#define CONFIG_CMD_BDI
+#define CONFIG_CMD_CONSOLE
+#define CONFIG_CMD_LOADB
+#define CONFIG_CMD_LOADS
+#define CONFIG_CMD_MEMORY
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_PING
+
 
 #define CONFIG_BOOTDELAY       3
 /*#define CONFIG_BOOTARGS      "root=ramfs devfs=mount console=ttySA0,9600" */
 /*#define CONFIG_BOOTFILE      "elinos-lart" */
 /*#define CONFIG_BOOTCOMMAND   "tftp; bootm" */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   115200          /* speed to run kgdb serial port */
 /* what's this ? it's not used anywhere */
 #define CONFIG_KGDB_SER_INDEX  1               /* which serial port to use */
index 63d0da7d090ae6305a46d6ec5fdf6ee022732434..f1d73e4c5396f1147e637e77d5af67302f611d42 100644 (file)
 #define BOOTFLAG_COLD          0x01    /* Normal Power-On: Boot from FLASH  */
 #define BOOTFLAG_WARM          0x02    /* Software reboot           */
 
-#define CFG_CACHELINE_SIZE     32      /* For MPC5xxx CPUs */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
-#  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
-#endif
-
 /*
  * Serial console configuration
  */
@@ -73,8 +68,6 @@
 #define CFG_RX_ETH_BUFFER      8  /* use 8 rx buffer on eepro100  */
 #define CONFIG_NS8382X         1
 
-#define ADD_PCI_CMD            CFG_CMD_PCI
-
 /* Partitions */
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 
 #define CONFIG_TIMESTAMP       /* Print image info with timestamp */
 
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
 /*
- * Supported commands
+ * Command line configuration.
  */
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_FAT     | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_PING    | \
-                               ADD_PCI_CMD     )
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_PCI
+
 
 #if (TEXT_BASE == 0xFF000000)          /* Boot low with 16 MB Flash */
 #   define CFG_LOWBOOT         1
 #define CFG_LONGHELP                   /* undef to save memory     */
 #define CFG_PROMPT             "=> "   /* Monitor Command Prompt   */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024    /* Console I/O Buffer Size  */
 #else
 #define CFG_CBSIZE             256     /* Console I/O Buffer Size  */
 
 #define CFG_HZ                 1000    /* decrementer freq: 1 ms ticks */
 
+#define CFG_CACHELINE_SIZE     32      /* For MPC5xxx CPUs */
+#if defined(CONFIG_CMD_KGDB)
+#  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
+#endif
+
 /*
  * Various low-level settings
  */
index 68e8cec251cb23b0ac247526e08654fb12c9b6a0..bc2fd33ff5e912748896341400cf96df8f1d2c4c 100644 (file)
 
 #define CONFIG_NETCONSOLE              /* include NetConsole support   */
 
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_DIAG    | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_NET     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_REGINFO | \
-                               CFG_CMD_SDRAM   | \
-                               CFG_CMD_SNTP    )
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_DIAG
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_SDRAM
+#define CONFIG_CMD_SNTP
+
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
  */
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT     "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
  */
 #define CFG_DCACHE_SIZE                32768   /* For AMCC 440 CPUs                    */
 #define CFG_CACHELINE_SIZE     32      /* ...                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value        */
 #endif
 
 #define BOOTFLAG_COLD  0x01            /* Normal Power-On: Boot from FLASH     */
 #define BOOTFLAG_WARM  0x02            /* Software reboot                      */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
index 016d3d8bd020a98d2b5cefe7141dd930aa6a2372..8623ed3cc88d7b6ec3121a288ce9f844f1e99b3e 100644 (file)
 #define CONFIG_BAUDRATE                115200
 #define CFG_BAUDRATE_TABLE     { 9600, 19200, 38400, 57600, 115200 }
 
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL | CFG_CMD_DHCP)
-#define CONFIG_BOOTP_MASK      CONFIG_BOOTP_DEFAULT
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DHCP
+
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+
+
 #include <configs/omap1510.h>
 
 #define CONFIG_BOOTDELAY       3
 #define CONFIG_BOOTCOMMAND     "bootp;tftp;bootm"
 #define CFG_AUTOLOAD           "n"             /* No autoload */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   115200          /* speed to run kgdb serial port */
 /* what's this ? it's not used anywhere */
 #define CONFIG_KGDB_SER_INDEX  1               /* which serial port to use */
index c6ca689a5fe04aee8960e834b43d843c719a3a90..74bba05fe8a2afd67db0bbdb5700e3c4ef207ef9 100644 (file)
 #define CONFIG_BAUDRATE        115200
 #define CFG_BAUDRATE_TABLE     { 9600, 19200, 38400, 57600, 115200 }
 
-#define CONFIG_COMMANDS        (CONFIG_CMD_DFL | CFG_CMD_DHCP)
-#define CONFIG_BOOTP_MASK      CONFIG_BOOTP_DEFAULT
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DHCP
+
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+
+
 #include <configs/omap1510.h>
 
 #define CONFIG_BOOTDELAY       3
 #define CONFIG_BOOTCOMMAND      "bootp;tftp;bootm"
 #define CFG_AUTOLOAD            "n"             /* No autoload */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   115200  /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  1       /* which serial port to use */
 #endif
index f28ede09674c4f149d92a8c3d44bd2171a2eeb7c..734f3543927a4e28dfebdb497ad787d26413b688 100644 (file)
 #define CONFIG_BAUDRATE        115200
 #define CFG_BAUDRATE_TABLE     { 9600, 19200, 38400, 57600, 115200 }
 
-#define CONFIG_COMMANDS        (CONFIG_CMD_DFL | CFG_CMD_DHCP)
-#define CONFIG_BOOTP_MASK      CONFIG_BOOTP_DEFAULT
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DHCP
+
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+
+
 #include <configs/omap1510.h>
 
 #define CONFIG_BOOTDELAY       3
 #define CONFIG_SERVERIP        156.117.97.139  /* current IP of my dev pc */
 #define CONFIG_BOOTFILE        "uImage"        /* file to load */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   115200  /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  1       /* which serial port to use */
 #endif
index 58374616a14afb52f060792504dbe1e0055c49c9..8ae8efeb8171b931c7e79d958670f1feae57ad0a 100644 (file)
 #define CONFIG_BAUDRATE          115200
 #define CFG_BAUDRATE_TABLE       {9600, 19200, 38400, 57600, 115200}
 
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
 #ifdef CFG_NAND_BOOT
-#define CONFIG_COMMANDS          (CONFIG_CMD_DFL | CFG_CMD_DHCP | CFG_CMD_I2C | CFG_CMD_NAND | CFG_CMD_JFFS2)
+    #define CONFIG_CMD_DHCP
+    #define CONFIG_CMD_I2C
+    #define CONFIG_CMD_NAND
+    #define CONFIG_CMD_JFFS2
 #else
-#define CONFIG_COMMANDS          ((CONFIG_CMD_DFL | CFG_CMD_DHCP | CFG_CMD_I2C | CFG_CMD_JFFS2) & ~CFG_CMD_AUTOSCRIPT)
+    #define CONFIG_CMD_DHCP
+    #define CONFIG_CMD_I2C
+    #define CONFIG_CMD_JFFS2
+
+    #undef CONFIG_CMD_AUTOSCRIPT
 #endif
-#define CONFIG_BOOTP_MASK        CONFIG_BOOTP_DEFAULT
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+
 
 /*
  *  Board NAND Info.
index 5db4f52beb68b00da7384618a183bbfcc3f640ce..16ce2f61aec896bb2aa47ba2de5d55fcee539f06 100644 (file)
 #define CONFIG_BAUDRATE        115200
 #define CFG_BAUDRATE_TABLE     { 9600, 19200, 38400, 57600, 115200 }
 
-#define CONFIG_COMMANDS        (CONFIG_CMD_DFL | CFG_CMD_DHCP)
-#define CONFIG_BOOTP_MASK      CONFIG_BOOTP_DEFAULT
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DHCP
+
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+
+
 #include <configs/omap1510.h>
 
 #define CONFIG_BOOTDELAY       3
 #define CONFIG_SERVERIP        156.117.97.139  /* current IP of my dev pc */
 #define CONFIG_BOOTFILE        "uImage"        /* file to load */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   115200  /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  1       /* which serial port to use */
 #endif
index fda55cf06fd249ae24f9d3bd9c4f097800542926..c4d253af45c03bfb8c6b8155127f34a10ddacaaf 100644 (file)
 #define CONFIG_BAUDRATE                   115200
 #define CFG_BAUDRATE_TABLE        { 9600, 19200, 38400, 57600, 115200 }
 
-#define CONFIG_COMMANDS                   (CONFIG_CMD_DFL | CFG_CMD_DHCP)
-#define CONFIG_BOOTP_MASK         CONFIG_BOOTP_DEFAULT
 
 /*
- * This must be included AFTER the definition of CONFIG_COMMANDS (if any)
+ * Command line configuration.
  */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DHCP
+
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+
 
-#include <cmd_confdefs.h>
 #include <configs/omap730.h>
 #include <configs/h2_p2_dbg_board.h>
 
 #define CONFIG_SERVERIP                   192.150.0.100
 #define CONFIG_BOOTFILE                   "uImage"  /* File to load */
 
-#if defined (CONFIG_COMMANDS) && defined (CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE      115200    /* Speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX     1         /* Which serial port to use */
 #endif
index 54462f007cd5d53c04abe4de38a15c79c58cb5f9..8ae38cb27754035d0210373bb1cc9a279d4562da 100644 (file)
 #endif
 
 #define CONFIG_BOOTDELAY       3       /* autoboot after 5 seconds */
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | \
-                                CONFIG_BOOTP_BOOTFILESIZE)
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DIAG    | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_NET     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_REGINFO | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_CACHE   | \
-                               CFG_CMD_SDRAM)
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DIAG
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_CACHE
+#define CONFIG_CMD_SDRAM
+
 
 /*-----------------------------------------------------------------------
  * Miscellaneous configurable options
 
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT             "=> "   /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024    /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE             256     /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     32      /* For all MPC74xx CPUs          */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value */
 #endif
 
index 22f9f84ec23c151837df249e0297b9c5903ec26e..51f19a1456c404130bbc44bcc243cc200bc8d74d 100644 (file)
 
 #define CONFIG_NETCONSOLE              /* include NetConsole support   */
 
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_DIAG    | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_NET     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_REGINFO | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_SNTP    )
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_DIAG
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_SNTP
+
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
  *----------------------------------------------------------------------*/
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT     "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
  */
 #define CFG_DCACHE_SIZE                (32<<10)        /* For AMCC 405 CPUs            */
 #define CFG_CACHELINE_SIZE     32      /* ...                                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value        */
 #endif
 
 #define BOOTFLAG_COLD  0x01            /* Normal Power-On: Boot from FLASH     */
 #define BOOTFLAG_WARM  0x02            /* Software reboot                      */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
index ed1893f574229d8cd09ad0b1a344f3feb0bee1f2..810e0f0462875938afb0585b5efcc7f07dba8892 100644 (file)
 /*---USB -------------------------------------------*/
 #if 0
 #define CONFIG_USB_OHCI
-#define ADD_USB_CMD             CFG_CMD_USB | CFG_CMD_FAT
 #define CONFIG_USB_STORAGE
 #define CONFIG_DOS_PARTITION
-#else
-#define ADD_USB_CMD             0
 #endif
 
 /*---ATA PCMCIA ------------------------------------*/
 #define CFG_ICACHE_SIZE                16384
 #define CFG_CACHELINE_SIZE     32
 
-#define CONFIG_COMMANDS        \
-  (((CONFIG_CMD_DFL | CFG_CMD_DHCP | CFG_CMD_ELF | CFG_CMD_MII | CFG_CMD_PING) & \
- ~(CFG_CMD_ENV | CFG_CMD_FAT | CFG_CMD_FLASH | CFG_CMD_FPGA | CFG_CMD_IDE | \
-   CFG_CMD_LOADS | CFG_CMD_RUN | CFG_CMD_LOADB | CFG_CMD_ELF | \
-   CFG_CMD_BDI | CFG_CMD_BEDBUG)) | ADD_USB_CMD)
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_PING
+
+#undef CONFIG_CMD_ENV
+#undef CONFIG_CMD_FAT
+#undef CONFIG_CMD_FLASH
+#undef CONFIG_CMD_FPGA
+#undef CONFIG_CMD_IDE
+#undef CONFIG_CMD_LOADS
+#undef CONFIG_CMD_RUN
+#undef CONFIG_CMD_LOADB
+#undef CONFIG_CMD_ELF
+#undef CONFIG_CMD_BDI
+#undef CONFIG_CMD_BEDBUG
 
 #endif /* __CONFIG_H */
index 5ee97c12794edf9f47ba8577e635ab1a92f3b93a..8e51d2d3c05bebb5354fe5465dd9f4e4c75500e1 100644 (file)
 #define CONFIG_HW_WATCHDOG                     /* watchdog */
 #endif
 
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_DIAG    | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_EXT2    | \
-                               CFG_CMD_FAT     | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_IDE     | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_NET     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_REGINFO | \
-                               CFG_CMD_REISER  | \
-                               CFG_CMD_SDRAM   | \
-                               CFG_CMD_USB     )
 
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
 
-#define CONFIG_SUPPORT_VFAT
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_DIAG
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_SDRAM
+#define CONFIG_CMD_EXT2
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_USB
+
+
+#define CONFIG_SUPPORT_VFAT
 
 /*
  * Miscellaneous configurable options
  */
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT             "=> "   /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024    /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE             256     /* Console I/O Buffer Size      */
  */
 #define CFG_DCACHE_SIZE                (32<<10) /* For AMCC 440 CPUs                   */
 #define CFG_CACHELINE_SIZE     32      /* ...                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value        */
 #endif
 
 #define BOOTFLAG_COLD  0x01            /* Normal Power-On: Boot from FLASH     */
 #define BOOTFLAG_WARM  0x02            /* Software reboot                      */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
index 73aa3a88259a4d7334d93a7230d157e854cfa71c..e3c884392c7848ab4585edc21329b174927092d3 100644 (file)
  * ---------------------------------------------------------------- */
 #define CFG_SPI_INIT_OFFSET            0xB00
 
-#define CONFIG_COMMANDS                (       CONFIG_CMD_DFL  | \
-                                       CFG_CMD_BSP     | \
-                                       CFG_CMD_DATE    | \
-                                       CFG_CMD_DHCP    | \
-                                       CFG_CMD_EEPROM  | \
-                                       CFG_CMD_NFS     | \
-                                       CFG_CMD_SNTP    )
 
-#define CONFIG_BOOTP_MASK \
-    ((CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE) & ~CONFIG_BOOTP_GATEWAY)
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+#define CONFIG_CMD_BSP
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_SNTP
+
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
 
-/*----------------------------------------------------------------------*/
 
 /*
  * Miscellaneous configurable options
  */
 #define        CFG_LONGHELP                    /* undef to save memory         */
 #define        CFG_PROMPT      "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
index 06c66528784520bafc47abe4cc2eba839e8dfa73..5b5b0efb76acb063054d1c391064903ab4704a3f 100644 (file)
 #define CONFIG_BAUDRATE         115200
 #define CFG_IXP425_CONSOLE     IXP425_UART1   /* we use UART1 for console */
 
-#if defined(CONFIG_SCPU)
-#define CMD_NAND_ADD           0
-#else
-#define CMD_NAND_ADD           CFG_CMD_NAND
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_PING
+
+#if !defined(CONFIG_SCPU)
+#define CONFIG_CMD_NAND
 #endif
 
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_NET     | \
-                               CFG_CMD_MII     | \
-                               CMD_NAND_ADD    | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_PING)
-
-/* This must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-/* These are u-boot generic parameters */
-#include <cmd_confdefs.h>
 
 #define CONFIG_ZERO_BOOTDELAY_CHECK    /* check for keypress on bootdelay==0 */
 #define CONFIG_BOOTDELAY       5       /* autoboot after 5 seconds     */
index 7151a9ec2e2915641301840bbebee9d662c9a690..18d0c879a9ed474ca2580074b78721df76f825cb 100644 (file)
 #define BOOTFLAG_COLD          0x01    /* Normal Power-On: Boot from FLASH  */
 #define BOOTFLAG_WARM          0x02    /* Software reboot           */
 
-#define CFG_CACHELINE_SIZE     32      /* For MPC5xxx CPUs */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
-#  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
-#endif
-
 /*
  * Serial console configuration
  */
 #define CFG_RX_ETH_BUFFER      8       /* use 8 rx buffer on eepro100  */
 #define CONFIG_NS8382X         1
 #endif
-
-#define ADD_PCI_CMD            CFG_CMD_PCI
-
-#else                          /* MPC5100 */
-
-#define ADD_PCI_CMD            0       /* no CFG_CMD_PCI */
-
 #endif
 
 /* Partitions */
 /* USB */
 #if 0
 #define CONFIG_USB_OHCI
-#define ADD_USB_CMD            CFG_CMD_USB | CFG_CMD_FAT
 #define CONFIG_USB_STORAGE
-#else
-#define ADD_USB_CMD            0
 #endif
 
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
 /*
- * Supported commands
+ * Command line configuration.
  */
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL | \
-                                CFG_CMD_EEPROM | \
-                                CFG_CMD_FAT    | \
-                                CFG_CMD_I2C    | \
-                                CFG_CMD_IDE    | \
-                                CFG_CMD_BSP    | \
-                                CFG_CMD_ELF    | \
-                                ADD_PCI_CMD      )
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_BSP
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_IDE
+
+#ifdef CONFIG_MPC5200
+#define CONFIG_CMD_PCI
+#endif
+
 
 #if (TEXT_BASE == 0xFF000000)  /* Boot low with 16 MB Flash */
 #   define CFG_LOWBOOT         1
  */
 #define CFG_LONGHELP           /* undef to save memory     */
 #define CFG_PROMPT             "=> "   /* Monitor Command Prompt   */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024    /* Console I/O Buffer Size  */
 #else
 #define CFG_CBSIZE             256     /* Console I/O Buffer Size  */
 
 #define CFG_VXWORKS_MAC_PTR    0x00000000      /* Pass Ethernet MAC to VxWorks */
 
+#define CFG_CACHELINE_SIZE     32      /* For MPC5xxx CPUs */
+#if defined(CONFIG_CMD_KGDB)
+#  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
+#endif
+
 /*
  * Various low-level settings
  */
index a6c23712b5db83af3a636d30748170ae2d01f8ee..863029d146d8511e100f96f777df16ab742b1dda 100644 (file)
 
 #define CONFIG_BAUDRATE                115200
 
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL & ~CFG_CMD_NET)
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#undef CONFIG_CMD_NET
+
 
 #define CONFIG_BOOTDELAY       3
 #define CONFIG_ETHADDR         08:00:3e:26:0a:5b
@@ -83,7 +96,7 @@
 #define CONFIG_INITRD_TAG
 #define CONFIG_SETUP_MEMORY_TAGS
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400          /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2               /* which serial port to use */
 #endif
index 072b9dd5b460d33d0f9bfc58e1a13b57a7e44441..fe7de7bed0f2bc9417bbf8bd1df2e74ae0fdd51a 100644 (file)
 /*
  * Debug
  *
- * DEBUG                       - Define this is you want extra debug info
- * GTREGREAD                   - Required to build with debug
- * do_bdinfo                   - Required to build with debug
+ * DEBUG               - Define this is you want extra debug info
+ * GTREGREAD           - Required to build with debug
+ * do_bdinfo           - Required to build with debug
  */
 
 #undef DEBUG
-#define        GTREGREAD(x)                    0xFFFFFFFF
+#ifdef DEBUG
+#define        GTREGREAD(x)    0xFFFFFFFF
 #define        do_bdinfo(a,b,c,d)
-
+#endif
 
 /*
  * CPU type
  *
- * CONFIG_7xx                  - We have a 750 or 755 CPU
- * CONFIG_74xx                 - We have a 7400 CPU
- * CONFIG_ALTIVEC              - We have altivec enabled CPU (only 7400)
- * CONFIG_BUS_CLK              - System bus clock in Hz
+ * CONFIG_7xx          - We have a 750 or 755 CPU
+ * CONFIG_74xx         - We have a 7400 CPU
+ * CONFIG_ALTIVEC      - We have altivec enabled CPU (only 7400)
+ * CONFIG_BUS_CLK      - System bus clock in Hz
  */
 
 #define        CONFIG_7xx
 #undef CONFIG_74xx
 #undef CONFIG_ALTIVEC
-#define CONFIG_BUS_CLK                 66000000
+#define CONFIG_BUS_CLK 66000000
 
 
 /*
  * Monitor configuration
  *
- * CONFIG_COMMANDS             - List of command sets to include in shell
+ * List of command sets to include in shell
  *
  * The following command sets have been tested and known to work:
  *
- * CFG_CMD_CACHE               - Cache control commands
- * CFG_CMD_MEMORY              - Memory display, change and test commands
- * CFG_CMD_FLASH               - Erase and program flash
- * CFG_CMD_ENV                 - Environment commands
- * CFG_CMD_RUN                 - Run commands stored in env vars
- * CFG_CMD_ELF                 - Load ELF files
- * CFG_CMD_NET                 - Networking/file download commands
- * CFG_CMD_PING                        - ICMP Echo Request command
- * CFG_CMD_PCI                 - PCI Bus scanning command
+ * CMD_CACHE           - Cache control commands
+ * CMD_MEMORY          - Memory display, change and test commands
+ * CMD_FLASH           - Erase and program flash
+ * CMD_ENV             - Environment commands
+ * CMD_RUN             - Run commands stored in env vars
+ * CMD_ELF             - Load ELF files
+ * CMD_NET             - Networking/file download commands
+ * CMD_PIN             - ICMP Echo Request command
+ * CMD_PCI             - PCI Bus scanning command
  */
 
-#define CONFIG_COMMANDS                ( (CFG_CMD_DFL & ~(CFG_CMD_KGDB)) |     \
-                                                  CFG_CMD_FLASH |      \
-                                                  CFG_CMD_ENV |        \
-                                                  CFG_CMD_RUN |        \
-                                                  CFG_CMD_ELF |        \
-                                                  CFG_CMD_NET |        \
-                                                  CFG_CMD_PING |       \
-                                                  CFG_CMD_PCI)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_FLASH
+#define CONFIG_CMD_ENV
+#define CONFIG_CMD_RUN
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_PCI
+
+#undef CONFIG_CMD_KGDB
 
 
 /*
  * Serial configuration
  *
  * CONFIG_CONS_INDEX           - Serial console port number (COM1)
- * CONFIG_BAUDRATE                     - Serial speed
+ * CONFIG_BAUDRATE             - Serial speed
  */
 
-#define CONFIG_CONS_INDEX              1
-#define CONFIG_BAUDRATE                        9600
+#define CONFIG_CONS_INDEX      1
+#define CONFIG_BAUDRATE                9600
 
 
 /*
  * PCI config
  *
- * CONFIG_PCI                          - Enable PCI bus
- * CONFIG_PCI_PNP                      - Enable Plug & Play support
+ * CONFIG_PCI                  - Enable PCI bus
+ * CONFIG_PCI_PNP              - Enable Plug & Play support
  * CONFIG_PCI_SCAN_SHOW                - Enable display of devices at startup
  */
 
 /*
  * Network config
  *
- * CONFIG_NET_MULTI                    - Support for multiple network interfaces
- * CONFIG_EEPRO100                     - Intel 8255x Ethernet Controller
- * CONFIG_EEPRO100_SROM_WRITE - Enable writing to network card ROM
+ * CONFIG_NET_MULTI            - Support for multiple network interfaces
+ * CONFIG_EEPRO100             - Intel 8255x Ethernet Controller
+ * CONFIG_EEPRO100_SROM_WRITE  - Enable writing to network card ROM
  */
 
 #define        CONFIG_NET_MULTI
  * Boot config
  *
  * CONFIG_BOOTCOMMAND          - Command(s) to execute to auto-boot
- * CONFIG_BOOTDELAY                    - How long to wait before auto-boot (in sec)
+ * CONFIG_BOOTDELAY            - How long to wait before auto-boot (in sec)
  */
 
 #define CONFIG_BOOTCOMMAND             \
  */
 
 
-#include <cmd_confdefs.h>
-
-
 /*
  * Memory map
  *
  * This board runs in a standard CHRP (Map-B) configuration.
  *
- *     Type            Start           End                     Size    Width   Chip Sel
+ *     Type        Start       End         Size    Width   Chip Sel
  *     ----------- ----------- ----------- ------- ------- --------
- *     SDRAM           0x00000000      0x04000000      64MB    64b             SDRAMCS0
- *     User LED's      0x78000000                                              RCS3
- *     UART            0x7C000000                                              RCS2
- *     Mailbox         0xFF000000                                              RCS1
- *     Flash           0xFFC00000      0xFFFFFFFF      4MB     64b             RCS0
+ *     SDRAM       0x00000000  0x04000000  64MB    64b     SDRAMCS0
+ *     User LED's  0x78000000                              RCS3
+ *     UART        0x7C000000                              RCS2
+ *     Mailbox     0xFF000000                              RCS1
+ *     Flash       0xFFC00000  0xFFFFFFFF   4MB    64b     RCS0
  *
  * Flash sectors are laid out as follows.
  *
- *     Sector  Start           End                     Size    Comments
+ *     Sector  Start           End     Size    Comments
  *     ------- ----------- ----------- ------- -----------
- *      0              0xFFC00000      0xFFC3FFFF      256KB
- *   1         0xFFC40000      0xFFC7FFFF      256KB
- *      2              0xFFC80000      0xFFCBFFFF      256KB
- *      3              0xFFCC0000      0xFFCFFFFF      256KB
- *      4              0xFFD00000      0xFFD3FFFF      256KB
- *      5              0xFFD40000      0xFFD7FFFF      256KB
- *      6              0xFFD80000      0xFFDBFFFF      256KB
- *      7              0xFFDC0000      0xFFDFFFFF      256KB
- *   8         0xFFE00000      0xFFE3FFFF      256KB
- *      9              0xFFE40000      0xFFE7FFFF      256KB
- *  10         0xFFE80000      0xFFEBFFFF      256KB
- *  11         0xFFEC0000      0xFFEFFFFF      256KB
- *  12         0xFFF00000      0xFFF3FFFF      256KB   U-Boot code here
- *  13         0xFFF40000      0xFFF7FFFF      256KB
- *  14         0xFFF80000      0xFFFBFFFF      256KB
- *  15         0xFFFC0000      0xFFFDFFFF      128KB
- *  16         0xFFFE0000      0xFFFE7FFF       32KB   U-Boot env vars here
- *  17         0xFFFE8000      0xFFFEFFFF       32KB   U-Boot backup copy of env vars here
- *  18         0xFFFF0000      0xFFFFFFFF       64KB
+ *      0      0xFFC00000  0xFFC3FFFF  256KB
+ *      1      0xFFC40000  0xFFC7FFFF  256KB
+ *      2      0xFFC80000  0xFFCBFFFF  256KB
+ *      3      0xFFCC0000  0xFFCFFFFF  256KB
+ *      4      0xFFD00000  0xFFD3FFFF  256KB
+ *      5      0xFFD40000  0xFFD7FFFF  256KB
+ *      6      0xFFD80000  0xFFDBFFFF  256KB
+ *      7      0xFFDC0000  0xFFDFFFFF  256KB
+ *      8      0xFFE00000  0xFFE3FFFF  256KB
+ *      9      0xFFE40000  0xFFE7FFFF  256KB
+ *     10      0xFFE80000  0xFFEBFFFF  256KB
+ *     11      0xFFEC0000  0xFFEFFFFF  256KB
+ *     12      0xFFF00000  0xFFF3FFFF  256KB   U-Boot code here
+ *     13      0xFFF40000  0xFFF7FFFF  256KB
+ *     14      0xFFF80000  0xFFFBFFFF  256KB
+ *     15      0xFFFC0000  0xFFFDFFFF  128KB
+ *     16      0xFFFE0000  0xFFFE7FFF   32KB   U-Boot env vars here
+ *     17      0xFFFE8000  0xFFFEFFFF   32KB   U-Boot backup copy of env vars here
+ *     18      0xFFFF0000  0xFFFFFFFF   64KB
  */
 
 
 /*
  * SDRAM config - see memory map details above.
  *
- * CFG_SDRAM_BASE                      - Start address of SDRAM, this _must_ be zero!
- * CFG_SDRAM_SIZE                      - Total size of contiguous SDRAM bank(s)
+ * CFG_SDRAM_BASE              - Start address of SDRAM, this _must_ be zero!
+ * CFG_SDRAM_SIZE              - Total size of contiguous SDRAM bank(s)
  */
 
-#define CFG_SDRAM_BASE                 0x00000000
-#define CFG_SDRAM_SIZE                 0x04000000
+#define CFG_SDRAM_BASE         0x00000000
+#define CFG_SDRAM_SIZE         0x04000000
 
 
 /*
  * Flash config - see memory map details above.
  *
- * CFG_FLASH_BASE                      - Start address of flash memory
- * CFG_FLASH_SIZE                      - Total size of contiguous flash mem
+ * CFG_FLASH_BASE              - Start address of flash memory
+ * CFG_FLASH_SIZE              - Total size of contiguous flash mem
  * CFG_FLASH_ERASE_TOUT                - Erase timeout in ms
  * CFG_FLASH_WRITE_TOUT                - Write timeout in ms
  * CFG_MAX_FLASH_BANKS         - Number of banks of flash on board
  * CFG_MAX_FLASH_SECT          - Number of sectors in a bank
  */
 
-#define CFG_FLASH_BASE                 0xFFC00000
-#define CFG_FLASH_SIZE                 0x00400000
+#define CFG_FLASH_BASE         0xFFC00000
+#define CFG_FLASH_SIZE         0x00400000
 #define CFG_FLASH_ERASE_TOUT   250000
 #define CFG_FLASH_WRITE_TOUT   5000
-#define CFG_MAX_FLASH_BANKS            1
-#define CFG_MAX_FLASH_SECT             19
+#define CFG_MAX_FLASH_BANKS    1
+#define CFG_MAX_FLASH_SECT     19
 
 
 /*
  * Monitor config - see memory map details above
  *
- * CFG_MONITOR_BASE                    - Base address of monitor code
- * CFG_MALLOC_LEN                      - Size of malloc pool (128KB)
+ * CFG_MONITOR_BASE            - Base address of monitor code
+ * CFG_MALLOC_LEN              - Size of malloc pool (128KB)
  */
 
-#define CFG_MONITOR_BASE               TEXT_BASE
-#define CFG_MALLOC_LEN                 0x20000
+#define CFG_MONITOR_BASE       TEXT_BASE
+#define CFG_MALLOC_LEN         0x20000
 
 
 /*
  * CFG_PROMPT                  - Prompt string
  */
 
-#define CFG_BARGSIZE                   1024
-#define CFG_BOOTMAPSZ                  0x800000
-#define CFG_CBSIZE                     1024
-#define CFG_LOAD_ADDR                  0x100000
+#define CFG_BARGSIZE           1024
+#define CFG_BOOTMAPSZ          0x800000
+#define CFG_CBSIZE             1024
+#define CFG_LOAD_ADDR          0x100000
 #define CFG_LONGHELP
-#define CFG_MAXARGS                    16
-#define CFG_MEMTEST_START              0x00040000
-#define CFG_MEMTEST_END                        0x00040100
-#define CFG_PBSIZE                     1024
-#define CFG_PROMPT                     "=> "
+#define CFG_MAXARGS            16
+#define CFG_MEMTEST_START      0x00040000
+#define CFG_MEMTEST_END                0x00040100
+#define CFG_PBSIZE             1024
+#define CFG_PROMPT             "=> "
 
 
 /*
  * CFG_ENV_SECT_SIZE           - Size of sector containing env vars (32KB)
  */
 
-#define CFG_ENV_IS_IN_FLASH            1
-#define CFG_ENV_ADDR                   0xFFFE0000
-#define CFG_ENV_SIZE                   0x1000
-#define CFG_ENV_ADDR_REDUND            0xFFFE8000
-#define CFG_ENV_SIZE_REDUND            0x1000
-#define CFG_ENV_SECT_SIZE              0x8000
+#define CFG_ENV_IS_IN_FLASH    1
+#define CFG_ENV_ADDR           0xFFFE0000
+#define CFG_ENV_SIZE           0x1000
+#define CFG_ENV_ADDR_REDUND    0xFFFE8000
+#define CFG_ENV_SIZE_REDUND    0x1000
+#define CFG_ENV_SECT_SIZE      0x8000
 
 
 /*
  * copied to top of RAM by the init code.
  *
  * CFG_INIT_RAM_ADDR           - Address of Init RAM, above exception vect
- * CFG_INIT_RAM_END                    - Size of Init RAM
+ * CFG_INIT_RAM_END            - Size of Init RAM
  * CFG_GBL_DATA_SIZE           - Ammount of RAM to reserve for global data
  * CFG_GBL_DATA_OFFSET         - Start of global data, top of stack
  */
 
-#define CFG_INIT_RAM_ADDR              (CFG_SDRAM_BASE + 0x4000)
-#define CFG_INIT_RAM_END               0x4000
-#define CFG_GBL_DATA_SIZE              128
-#define CFG_GBL_DATA_OFFSET            (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
+#define CFG_INIT_RAM_ADDR      (CFG_SDRAM_BASE + 0x4000)
+#define CFG_INIT_RAM_END       0x4000
+#define CFG_GBL_DATA_SIZE      128
+#define CFG_GBL_DATA_OFFSET    (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
 
 
 /*
  * Cache config
  *
  * CFG_CACHELINE_SIZE          - Size of a cache line (CPU specific)
- * CFG_L2                                      - L2 cache enabled if defined
- * L2_INIT                                     - L2 cache init flags
- * L2_ENABLE                           - L2 cache enable flags
+ * CFG_L2                      - L2 cache enabled if defined
+ * L2_INIT                     - L2 cache init flags
+ * L2_ENABLE                   - L2 cache enable flags
  */
 
-#define CFG_CACHELINE_SIZE             32
+#define CFG_CACHELINE_SIZE     32
 #undef CFG_L2
-#define L2_INIT                                        0
-#define L2_ENABLE                              0
+#define L2_INIT                        0
+#define L2_ENABLE              0
 
 
 /*
  * Clocks config
  *
- * CFG_BUS_HZ                          - Bus clock frequency in Hz
- * CFG_BUS_CLK                         - As above (?)
- * CFG_HZ                                      - Decrementer freq in Hz
+ * CFG_BUS_HZ                  - Bus clock frequency in Hz
+ * CFG_BUS_CLK                 - As above (?)
+ * CFG_HZ                      - Decrementer freq in Hz
  */
 
-#define CFG_BUS_HZ                             CONFIG_BUS_CLK
-#define CFG_BUS_CLK                            CONFIG_BUS_CLK
-#define CFG_HZ                                 1000
+#define CFG_BUS_HZ             CONFIG_BUS_CLK
+#define CFG_BUS_CLK            CONFIG_BUS_CLK
+#define CFG_HZ                 1000
 
 
 /*
  * Serial port config
  *
  * CFG_BAUDRATE_TABLE          - List of valid baud rates
- * CFG_NS16550                         - Include the NS16550 driver
+ * CFG_NS16550                 - Include the NS16550 driver
  * CFG_NS16550_SERIAL          - Include the serial (wrapper) driver
- * CFG_NS16550_CLK                     - Frequency of reference clock
+ * CFG_NS16550_CLK             - Frequency of reference clock
  * CFG_NS16550_REG_SIZE                - 64-bit accesses to 8-bit port
- * CFG_NS16550_COM1                    - Base address of 1st serial port
+ * CFG_NS16550_COM1            - Base address of 1st serial port
  */
 
-#define CFG_BAUDRATE_TABLE             { 9600, 19200, 38400, 57600, 115200 }
+#define CFG_BAUDRATE_TABLE     { 9600, 19200, 38400, 57600, 115200 }
 #define CFG_NS16550
 #define CFG_NS16550_SERIAL
-#define CFG_NS16550_CLK                        3686400
+#define CFG_NS16550_CLK                3686400
 #define CFG_NS16550_REG_SIZE   -8
-#define CFG_NS16550_COM1               0x7C000000
+#define CFG_NS16550_COM1       0x7C000000
 
 
 /*
  * PCI Config - Address Map B (CHRP)
  */
 
-#define CFG_PCI_MEMORY_BUS      0x00000000
-#define CFG_PCI_MEMORY_PHYS     0x00000000
-#define CFG_PCI_MEMORY_SIZE     0x40000000
-#define CFG_PCI_MEM_BUS         0x80000000
-#define CFG_PCI_MEM_PHYS        0x80000000
-#define CFG_PCI_MEM_SIZE        0x7D000000
-#define CFG_ISA_MEM_BUS         0x00000000
-#define CFG_ISA_MEM_PHYS        0xFD000000
-#define CFG_ISA_MEM_SIZE        0x01000000
-#define CFG_PCI_IO_BUS          0x00800000
-#define CFG_PCI_IO_PHYS         0xFE800000
-#define CFG_PCI_IO_SIZE         0x00400000
-#define CFG_ISA_IO_BUS          0x00000000
-#define CFG_ISA_IO_PHYS         0xFE000000
-#define CFG_ISA_IO_SIZE         0x00800000
+#define CFG_PCI_MEMORY_BUS     0x00000000
+#define CFG_PCI_MEMORY_PHYS    0x00000000
+#define CFG_PCI_MEMORY_SIZE    0x40000000
+#define CFG_PCI_MEM_BUS                0x80000000
+#define CFG_PCI_MEM_PHYS       0x80000000
+#define CFG_PCI_MEM_SIZE       0x7D000000
+#define CFG_ISA_MEM_BUS                0x00000000
+#define CFG_ISA_MEM_PHYS       0xFD000000
+#define CFG_ISA_MEM_SIZE       0x01000000
+#define CFG_PCI_IO_BUS         0x00800000
+#define CFG_PCI_IO_PHYS                0xFE800000
+#define CFG_PCI_IO_SIZE                0x00400000
+#define CFG_ISA_IO_BUS         0x00000000
+#define CFG_ISA_IO_PHYS                0xFE000000
+#define CFG_ISA_IO_SIZE                0x00800000
 #define CFG_ISA_IO_BASE_ADDRESS CFG_ISA_IO_PHYS
-#define CFG_ISA_IO              CFG_ISA_IO_PHYS
-#define CFG_60X_PCI_IO_OFFSET   CFG_ISA_IO_PHYS
+#define CFG_ISA_IO             CFG_ISA_IO_PHYS
+#define CFG_60X_PCI_IO_OFFSET  CFG_ISA_IO_PHYS
 
 
 /*
 /*
  * Boot flags
  *
- * BOOTFLAG_COLD                       - Indicates a power-on boot
- * BOOTFLAG_WARM                       - Indicates a software reset
+ * BOOTFLAG_COLD               - Indicates a power-on boot
+ * BOOTFLAG_WARM               - Indicates a software reset
  */
 
-#define BOOTFLAG_COLD                  0x01
-#define BOOTFLAG_WARM                  0x02
+#define BOOTFLAG_COLD          0x01
+#define BOOTFLAG_WARM          0x02
 
 
 #endif /* __CONFIG_H */
index d671dccc19b7b7464c96210728c8d7b6bd7da285..fb5ae99e4ccba4a0274cbfc7ca1cde0ed094d1c3 100644 (file)
  * for FCC)
  *
  * if CONFIG_ETHER_NONE is defined, then either the ethernet routines must be
- * defined elsewhere (as for the console), or CFG_CMD_NET must be removed
- * from CONFIG_COMMANDS to remove support for networking.
+ * defined elsewhere (as for the console), or CONFIG_CMD_NET must be unset.
  */
 
 #undef CONFIG_ETHER_ON_SCC             /* define if ethernet on SCC    */
        "bootm"
 #endif /* CONFIG_BOOT_ROOT_NFS */
 
-/* Add support for a few extra bootp options like:
- *     - File size
- *     - DNS
+
+/*
+ * BOOTP options
  */
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | \
-                                CONFIG_BOOTP_BOOTFILESIZE | \
-                                CONFIG_BOOTP_DNS)
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_DNS
+
 
 /* undef this to save memory */
 #define CFG_LONGHELP
 /* Monitor Command Prompt */
 #define CFG_PROMPT             "=> "
 
-/* What U-Boot subsytems do you want enabled? */
-#define CONFIG_COMMANDS                (((CONFIG_CMD_DFL & ~(CFG_CMD_KGDB))) | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_REGINFO | \
-                               CFG_CMD_MEMTEST | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_IMMAP)
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_MEMTEST
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_IMMAP
+
+#undef CONFIG_CMD_KGDB
 
 
 /* Where do the internal registers live? */
 #define CONFIG_PPMC8260                1       /* on an Wind River PPMC8260 Board  */
 #define CONFIG_CPM2            1       /* Has a CPM2 */
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-
 /*
  * Miscellaneous configurable options
  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #  define CFG_CBSIZE           1024    /* Console I/O Buffer Size           */
 #else
 #  define CFG_CBSIZE           256     /* Console I/O Buffer Size           */
  */
 #define CFG_CACHELINE_SIZE     32      /* For MPC8260 CPU */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 # define CFG_CACHELINE_SHIFT   5       /* log base 2 of the above value */
 #endif
 
index 2ecb7fb2bf73e8607fea9012dd8899d10fe07e39..6eb618ed6d3ca8cb5b4512c335c02942e55194d2 100644 (file)
        ""
 #define CONFIG_BOOTCOMMAND     "run flash_self"
 
-#define CONFIG_COMMANDS        (CONFIG_CMD_DFL | CFG_CMD_ELF)
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ELF
+
 
 #define CFG_SDRAM_BASE         0x80000000
 
index e5e27724e18bc620331be44adc88ae3c027e65c3..0e884fc114c9b8ea3c5fa545885ecc044424103d 100644 (file)
 
 #define CONFIG_BAUDRATE                115200
 
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL | CFG_CMD_MMC | CFG_CMD_FAT | CFG_CMD_DHCP )
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_MMC
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_DHCP
+
 
 #define CONFIG_BOOTDELAY       3
 #define CONFIG_BOOTCOMMAND     "bootm 40000"
 /*                     "protect off"   */
 
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   115200          /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2               /* which serial port to use */
 #endif
index 21ec5acadefd545ffe43fd4501a4b6aeac1d8562..f49e2b0716e146f5ebe9b975fc85825160167ccb 100644 (file)
 #define CFG_NVRAM_SIZE 2048
 
 
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_REGINFO | \
-                               CFG_CMD_SNTP    )
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_SNTP
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
 
 #define CONFIG_AUTOBOOT_KEYED  /* Enable password protection */
 #define CONFIG_AUTOBOOT_PROMPT         "\nEnter password - autoboot in %d sec...\n"
  */
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT     "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
 #endif
 
 /*%%% #define CFG_FLASH_BASE           0xFFF00000 */
-#if defined(DEBUG) || (CONFIG_COMMANDS & CFG_CMD_IDE)
+#if defined(DEBUG) || defined(CONFIG_CMD_IDE)
 #define CFG_MONITOR_LEN                (256 << 10)     /* Reserve 256 kB for Monitor   */
 #else
 #define CFG_MONITOR_LEN                (128 << 10)     /* Reserve 128 kB for Monitor   */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index e1e406bf9b548bf649b55f3d250c20e2d34073a9..0e743bb2e48afed426b5f4000d9158c10b52b0cf 100644 (file)
 #define CFG_ENV_IS_IN_FLASH    1
 #endif
 
-#define CONFIG_COMMANDS         ((CONFIG_CMD_DFL | CFG_CMD_PING | CFG_CMD_NET ) & ~(CFG_CMD_LOADS | CFG_CMD_LOADB))
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_NET
+
+#undef CONFIG_CMD_LOADS
+#undef CONFIG_CMD_LOADB
+
 
 /* Note: We only copy one sectors worth of application code from location
  * 10200000 for speed purposes.  Increase the size if necessary */
@@ -79,7 +96,7 @@
 #define CFG_PROMPT             "u-boot> "
 #define CFG_LONGHELP                           /* undef to save memory         */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE             256             /* Console I/O Buffer Size      */
index b319cf497d3e8e9d1ca231cf3c704bad0c3a4058..2ca60b731ea74ba6aa58bd9418cff4945efddea4 100644 (file)
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_SNTP    )
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_SNTP
+
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
 
 #define        CONFIG_AUTOBOOT_KEYED           /* Enable password protection */
 #define        CONFIG_AUTOBOOT_PROMPT          "\nEnter password - autoboot in %d sec...\n"
  */
 #define        CFG_LONGHELP                    /* undef to save memory         */
 #define        CFG_PROMPT      "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
  */
 #define        CFG_SDRAM_BASE          0x00000000
 #define CFG_FLASH_BASE         (0-flash_info[0].size)  /* Put flash at end     */
-#if defined(DEBUG) || (CONFIG_COMMANDS & CFG_CMD_IDE)
+#if defined(DEBUG) || defined(CONFIG_CMD_IDE)
 #define        CFG_MONITOR_LEN         (256 << 10)     /* Reserve 256 kB for Monitor   */
 #else
 #define        CFG_MONITOR_LEN         (128 << 10)     /* Reserve 128 kB for Monitor   */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index 6c9e392c36b86db744bc9c10bc115df812cb53f0..814082ccc633bd20a4deafdf56514baa51cd37ee 100644 (file)
@@ -64,8 +64,7 @@
  * for FCC)
  *
  * if CONFIG_ETHER_NONE is defined, then either the ethernet routines must be
- * defined elsewhere (as for the console), or CFG_CMD_NET must be removed
- * from CONFIG_COMMANDS to remove support for networking.
+ * defined elsewhere (as for the console), or CONFIG_CMD_NET must be unset.
  */
 #undef CONFIG_ETHER_ON_SCC             /* define if ethernet on SCC    */
 #define        CONFIG_ETHER_ON_FCC             /* define if ethernet on FCC    */
 
 #define CONFIG_BAUDRATE                115200
 
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL & ~CFG_CMD_KGDB)
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#undef CONFIG_CMD_KGDB
+
 
 /* Define this if you want to boot from 0x00000100. If you don't define
  * this, you will need to program the bootloader to 0xfff00000, and
  */
 #define CFG_RSD_BOOT_LOW 1
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-
 #define CONFIG_BOOTDELAY       5
 #define CONFIG_BOOTARGS        "devfs=mount root=ramfs"
 #define CONFIG_ETHADDR         08:00:3e:26:0a:5a
 #define CONFIG_NETMASK          255.255.0.0
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400          /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2               /* which serial port to use */
 #endif
  */
 #define        CFG_LONGHELP                            /* undef to save memory         */
 #define        CFG_PROMPT              "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE              1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE              256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     32      /* For MPC8260 CPU                      */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value        */
 #endif
 
index 97b52fa1ae7940ad00c89dd424853e510a4755ae..c474acd70ec2548ee72973d77527f52ca28942a7 100644 (file)
  * for FCC)
  *
  * if CONFIG_ETHER_NONE is defined, then either the ethernet routines must be
- * defined elsewhere (as for the console), or CFG_CMD_NET must be removed
- * from CONFIG_COMMANDS to remove support for networking.
+ * defined elsewhere (as for the console), or CONFIG_CMD_NET must be unset.
  */
 
 #undef CONFIG_ETHER_ON_SCC
 
 #define CONFIG_BOOTP_RANDOM_DELAY       /* Randomize the BOOTP retry delay */
 
-/* Add support for a few extra bootp options like:
- *     - File size
- *     - DNS (up to 2 servers)
- *      - Send hostname to DHCP server
+/*
+ * BOOTP options
  */
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | \
-                                CONFIG_BOOTP_BOOTFILESIZE | \
-                                CONFIG_BOOTP_DNS | \
-                                CONFIG_BOOTP_DNS2 | \
-                                CONFIG_BOOTP_SEND_HOSTNAME)
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define  CONFIG_BOOTP_DNS
+#define  CONFIG_BOOTP_DNS2
+#define  CONFIG_BOOTP_SEND_HOSTNAME
+
 
 /* undef this to save memory */
 #define CFG_LONGHELP
  */
 #define CONFIG_VERSION_VARIABLE
 
-/* What U-Boot subsytems do you want enabled? */
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_SPI
+#define CONFIG_CMD_SDRAM
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_IMMAP
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_PING
+
+#undef CONFIG_CMD_KGDB
+
 #ifdef CONFIG_ETHER_ON_FCC
-# define CONFIG_COMMANDS       (((CONFIG_CMD_DFL & ~(CFG_CMD_KGDB))) | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_SPI     | \
-                               CFG_CMD_SDRAM   | \
-                               CFG_CMD_REGINFO | \
-                               CFG_CMD_IMMAP   | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_MII     )
-#else
-# define CONFIG_COMMANDS       (((CONFIG_CMD_DFL & ~(CFG_CMD_KGDB))) | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_SPI     | \
-                               CFG_CMD_SDRAM   | \
-                               CFG_CMD_REGINFO | \
-                               CFG_CMD_IMMAP   | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_PING    )
-#endif /* CONFIG_ETHER_ON_FCC */
+#define CONFIG_CMD_MII
+#endif
+
 
 /* Where do the internal registers live? */
 #define CFG_IMMR               0xF0000000
 #define CONFIG_SACSng          1       /* munged for the SACSng */
 #define CONFIG_CPM2            1       /* Has a CPM2 */
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-
-
 /*
  * Miscellaneous configurable options
  */
 #define CFG_TFTP_TIMEOUT_COUNT 5        /* How many timeouts TFTP will allow */
                                        /* before it gives up.               */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #  define CFG_CBSIZE           1024    /* Console I/O Buffer Size           */
 #else
 #  define CFG_CBSIZE           256     /* Console I/O Buffer Size           */
  */
 #define CFG_CACHELINE_SIZE     32      /* For MPC8260 CPU */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 # define CFG_CACHELINE_SHIFT   5       /* log base 2 of the above value */
 #endif
 
index 866f7b042616b5d7c697c4ba246b3267458c5994..b4a063a1d4c6ad3c199b0b41e917dc4e27265aa6 100644 (file)
 
 #define CONFIG_BAUDRATE                115200
 
-/***********************************************************
- * Command definition
- ***********************************************************/
-#define CONFIG_COMMANDS \
-                       (CONFIG_CMD_DFL  | \
-                       CFG_CMD_CACHE    | \
-                       /*CFG_CMD_NAND   |*/ \
-                       /*CFG_CMD_EEPROM |*/ \
-                       /*CFG_CMD_I2C    |*/ \
-                       /*CFG_CMD_USB    |*/ \
-                       CFG_CMD_REGINFO  | \
-                       CFG_CMD_DATE     | \
-                       CFG_CMD_PING     | \
-                       CFG_CMD_DHCP     | \
-                       CFG_CMD_ELF)
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_CACHE
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_REGINFO
+
 
 #define CONFIG_BOOTDELAY       3
 #define CONFIG_BOOTARGS        "console=ttySAC0 root=/dev/nfs nfsroot=192.168.0.1:/friendly-arm/rootfs_netserv ip=192.168.0.69:192.168.0.1:192.168.0.1:255.255.255.0:debian:eth0:off"
 /*#define CONFIG_BOOTFILE      "elinos-lart" */
 #define CONFIG_BOOTCOMMAND     "dhcp; bootm"
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   115200          /* speed to run kgdb serial port */
 /* what's this ? it's not used anywhere */
 #define CONFIG_KGDB_SER_INDEX  1               /* which serial port to use */
 /*-----------------------------------------------------------------------
  * NAND flash settings
  */
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
 #define CFG_MAX_NAND_DEVICE    1       /* Max number of NAND devices           */
 #define SECTORSIZE 512
 
 #define NAND_CTL_CLRCLE(nandptr)
 #define NAND_CTL_SETCLE(nandptr)
 /* #undef CONFIG_MTD_NAND_VERIFY_WRITE */
-#endif /* CONFIG_COMMANDS & CFG_CMD_NAND */
+#endif /* CONFIG_CMD_NAND */
 
 #define CONFIG_SETUP_MEMORY_TAGS
 #define CONFIG_INITRD_TAG
index beff28ab32f51c6d7663ca06d43b05ea9750377c..dc906b15006775d887eaa983aa25ff456f387315 100644 (file)
 
 #define CONFIG_BOOTDELAY       5       /* autoboot after 5 seconds     */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
 
 #define CONFIG_ENV_OVERWRITE
 
-#define CONFIG_COMMANDS        ( CONFIG_CMD_DFL        | \
-                               CFG_CMD_BSP     | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_SDRAM   | \
-                               0 )
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_BSP
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_SDRAM
+
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
 #define CFG_PROMPT_HUSH_PS2    "> "
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
 #define CFG_DCACHE_SIZE                16384   /* For AMCC 405 CPUs, older 405 ppc's   */
                                        /* have only 8kB, 16kB is save here     */
 #define CFG_CACHELINE_SIZE     32      /* ...                                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value        */
 #endif
 
index d891e07b314bda5384229d3074ca6fbc8b829608..0e878f054ffb1889677581ce081a7589423ac91f 100644 (file)
 
 #define CONFIG_BOOTDELAY       5
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
 
 #define CONFIG_ENV_OVERWRITE
 
-#define CONFIG_COMMANDS        ( CONFIG_CMD_DFL | \
-                                 CFG_CMD_BSP    | \
-                                 CFG_CMD_DIAG   | \
-                                 CFG_CMD_ELF    | \
-                                 CFG_CMD_ENV    | \
-                                 CFG_CMD_FLASH  | \
-                                 CFG_CMD_PCI    | \
-                                 CFG_CMD_PING   | \
-                                 CFG_CMD_SDRAM  | \
-                                 0 )
-
-/* This must be included AFTER the definition of CONFIG_COMMANDS (if any)
+
+/*
+ * Command line configuration.
  */
-#include <cmd_confdefs.h>
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_BSP
+#define CONFIG_CMD_DIAG
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_ENV
+#define CONFIG_CMD_FLASH
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_SDRAM
+
 
 /*
  * Miscellaneous configurable options
@@ -340,7 +349,7 @@ typedef unsigned int led_id_t;
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     32
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value        */
 #endif
 
index 9cf0654be10e19555fe74f2d1a055af45b0f57d3..b1d41a6d42b880e831e9c7dbaae782708fdb8cb3 100644 (file)
  * for FCC)
  *
  * if CONFIG_ETHER_NONE is defined, then either the ethernet routines must be
- * defined elsewhere (as for the console), or CFG_CMD_NET must be removed
- * from CONFIG_COMMANDS to remove support for networking.
+ * defined elsewhere (as for the console), or CONFIG_CMD_NET must be unset.
  */
 
 #undef CONFIG_ETHER_ON_SCC
        "bootm"
 #endif /* CONFIG_BOOT_ROOT_NFS */
 
-/* Add support for a few extra bootp options like:
- *     - File size
- *     - DNS (up to 2 servers)
- *     - Send hostname to DHCP server
+/*
+ * BOOTP options
  */
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | \
-                                CONFIG_BOOTP_BOOTFILESIZE | \
-                                CONFIG_BOOTP_DNS  | \
-                                CONFIG_BOOTP_DNS2 | \
-                                CONFIG_BOOTP_SEND_HOSTNAME)
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_DNS
+#define CONFIG_BOOTP_DNS2
+#define CONFIG_BOOTP_SEND_HOSTNAME
+
 
 /* undef this to save memory */
 #define CFG_LONGHELP
  */
 #define CONFIG_VERSION_VARIABLE
 
-/* What U-Boot subsytems do you want enabled? */
-#ifdef CONFIG_ETHER_ON_FCC
-# define CONFIG_COMMANDS       (((CONFIG_CMD_DFL & ~(CFG_CMD_KGDB))) | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_IMMAP   | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_REGINFO | \
-                               CFG_CMD_SDRAM   )
-#else
-# define CONFIG_COMMANDS       (((CONFIG_CMD_DFL & ~(CFG_CMD_KGDB))) | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_IMMAP   | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_REGINFO | \
-                               CFG_CMD_SDRAM   )
-#endif /* CONFIG_ETHER_ON_FCC */
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_IMMAP
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_SDRAM
+
+#undef CONFIG_CMD_KGDB
+
+#if defined(CONFIG_ETHER_ON_FCC)
+    #define CONFIG_CMD_CMD_MII
+#endif
+
 
 #undef CONFIG_WATCHDOG                         /* disable the watchdog */
 
 #define CONFIG_SBC8260         1       /* on an EST SBC8260 Board  */
 #define CONFIG_CPM2            1       /* Has a CPM2 */
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
 
 /*
  * Miscellaneous configurable options
  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #  define CFG_CBSIZE           1024    /* Console I/O Buffer Size           */
 #else
 #  define CFG_CBSIZE           256     /* Console I/O Buffer Size           */
  */
 #define CFG_CACHELINE_SIZE     32      /* For MPC8260 CPU */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 # define CFG_CACHELINE_SHIFT   5       /* log base 2 of the above value */
 #endif
 
index e6e3866a07e0333e9772ee7f2df9d8566e8b1799..1831bef0de11ad91e490437b791bcdbc04be52dd 100644 (file)
 #define CONFIG_I2C_CMD_TREE
 #define CFG_I2C_SPEED          400000  /* I2C speed and slave address */
 #define CFG_I2C_SLAVE          0x7F
-#define CFG_I2C_NOPROBES       {{0,0x69}}      /* Don't probe these addrs */
+#define CFG_I2C_NOPROBES       {0x69}  /* Don't probe these addrs */
 #define CFG_I2C1_OFFSET                0x3000
 #define CFG_I2C2_OFFSET                0x3100
 #define CFG_I2C_OFFSET         CFG_I2C2_OFFSET
 #define CONFIG_LOADS_ECHO      1       /* echo on for serial download */
 #define CFG_LOADS_BAUD_CHANGE  1       /* allow baudrate change */
 
-#if defined(CFG_RAMBOOT)
-#if defined(CONFIG_PCI)
-#define  CONFIG_COMMANDS       ((CONFIG_CMD_DFL        \
-                                | CFG_CMD_PING         \
-                                | CFG_CMD_PCI          \
-                                | CFG_CMD_I2C)         \
-                               &                       \
-                                ~(CFG_CMD_ENV          \
-                                 | CFG_CMD_LOADS))
-#else
-#define  CONFIG_COMMANDS       ((CONFIG_CMD_DFL        \
-                                | CFG_CMD_PING         \
-                                | CFG_CMD_I2C)         \
-                               &                       \
-                                ~(CFG_CMD_ENV          \
-                                 | CFG_CMD_LOADS))
-#endif
-#else
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_PING
+
 #if defined(CONFIG_PCI)
-#define  CONFIG_COMMANDS       (CONFIG_CMD_DFL         \
-                               | CFG_CMD_PCI           \
-                               | CFG_CMD_PING          \
-                               | CFG_CMD_I2C           \
-                               )
-#else
-#define  CONFIG_COMMANDS       (CONFIG_CMD_DFL         \
-                               | CFG_CMD_PING          \
-                               | CFG_CMD_I2C           \
-                               | CFG_CMD_MII           \
-                               )
+    #define CONFG_CMD_PCI
 #endif
+
+#if defined(CFG_RAMBOOT)
+    #undef CONFIG_CMD_ENV
+    #undef CONFIG_CMD_LOADS
 #endif
 
-#include <cmd_confdefs.h>
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled */
 
 #define CFG_LOAD_ADDR  0x2000000       /* default load address */
 #define CFG_PROMPT     "=> "           /* Monitor Command Prompt */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        #define CFG_CBSIZE      1024            /* Console I/O Buffer Size */
 #else
        #define CFG_CBSIZE      256             /* Console I/O Buffer Size */
 /* Cache Configuration */
 #define CFG_DCACHE_SIZE                32768
 #define CFG_CACHELINE_SIZE     32
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /*log base 2 of the above value*/
 #endif
 
 #define BOOTFLAG_COLD  0x01    /* Normal Power-On: Boot from FLASH */
 #define BOOTFLAG_WARM  0x02    /* Software reboot */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed of kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
index 6e4fdb2498e3bb8d8a21082a6b48b1709f0b14c9..defc428819b4a6c98af2b439df6f6bde70c1fdcf 100644 (file)
 #define CONFIG_LOADS_ECHO      1       /* echo on for serial download  */
 #define CFG_LOADS_BAUD_CHANGE  1       /* allow baudrate change        */
 
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_I2C
+
+#if defined(CONFIG_PCI)
+    #define CONFIG_CMD_PCI
+#endif
+
+#if defined(CONFIG_TSEC_ENET) || defined(CONFIG_ETHER_ON_FCC)
+    #define CONFIG_CMD_MII
+#endif
+
 #if defined(CFG_RAMBOOT) || defined(CONFIG_RAM_AS_FLASH)
-  #if defined(CONFIG_PCI)
-    #define  CONFIG_COMMANDS   ((CONFIG_CMD_DFL | CFG_CMD_PCI | \
-                               CFG_CMD_PING | CFG_CMD_I2C) & \
-                                ~(CFG_CMD_ENV | \
-                                 CFG_CMD_LOADS ))
-  #elif (defined(CONFIG_TSEC_ENET) || defined(CONFIG_ETHER_ON_FCC))
-    #define  CONFIG_COMMANDS   ((CONFIG_CMD_DFL | CFG_CMD_MII | \
-                               CFG_CMD_PING | CFG_CMD_I2C) & \
-                               ~(CFG_CMD_ENV))
-  #endif
-#else
-  #if defined(CONFIG_PCI)
-    #define  CONFIG_COMMANDS   (CONFIG_CMD_DFL | CFG_CMD_PCI | \
-                               CFG_CMD_PING | CFG_CMD_I2C)
-  #elif (defined(CONFIG_TSEC_ENET) || defined(CONFIG_ETHER_ON_FCC))
-    #define  CONFIG_COMMANDS   (CONFIG_CMD_DFL | CFG_CMD_MII | \
-                               CFG_CMD_PING | CFG_CMD_I2C)
-  #endif
+    #undef CONFIG_CMD_ENV
+    #undef CONFIG_CMD_LOADS
 #endif
 
-#include <cmd_confdefs.h>
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
  */
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT     "SBC8560=> " /* Monitor Command Prompt  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
   #define CFG_CBSIZE   1024            /* Console I/O Buffer Size      */
 #else
   #define CFG_CBSIZE   256             /* Console I/O Buffer Size      */
 /* Cache Configuration */
 #define CFG_DCACHE_SIZE                32768
 #define CFG_CACHELINE_SIZE     32
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
   #define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
 #endif
 
 #define BOOTFLAG_COLD  0x01            /* Normal Power-On: Boot from FLASH */
 #define BOOTFLAG_WARM  0x02            /* Software reboot              */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
   #define CONFIG_KGDB_BAUDRATE 230400  /* speed to run kgdb serial port */
   #define CONFIG_KGDB_SER_INDEX        2       /* which serial port to use */
 #endif
index e4357b088542a4ea7052c0b8c1b288639bcf223b..cb2253698719ff7f637f42426c2ef42e4d875941 100644 (file)
@@ -68,8 +68,7 @@
  * Define IDE_USES_ISA_EMULATION for slower IDE access in the ISA-IO address range
  * If undefined, IDE access uses a seperat emulation with higher access speed.
  * Consider to inform your Linux IDE driver about the different addresses!
- * IDE_USES_ISA_EMULATION is only used if your CONFIG_COMMANDS macro includes
- * the CFG_CMD_IDE macro!
+ * IDE_USES_ISA_EMULATION is only used if you define CONFIG_CMD_IDE!
  */
 #define IDE_USES_ISA_EMULATION
 
 #define CONFIG_MII 1                   /* add 405GP MII PHY management         */
 #define CONFIG_PHY_ADDR 1      /* the connected Phy defaults to address 1 */
 
-#define CONFIG_COMMANDS          \
-          (CONFIG_CMD_DFL      | \
-                       CFG_CMD_AUTOSCRIPT      | \
-                       CFG_CMD_PCI             | \
-                       CFG_CMD_IRQ             | \
-                       CFG_CMD_NET             | \
-                       CFG_CMD_MII             | \
-                       CFG_CMD_PING            | \
-                       CFG_CMD_NAND            | \
-                       CFG_CMD_JFFS2           | \
-                       CFG_CMD_I2C             | \
-                       CFG_CMD_IDE             | \
-                       CFG_CMD_DATE            | \
-                       CFG_CMD_DHCP            | \
-                       CFG_CMD_CACHE           | \
-                       CFG_CMD_ELF     )
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+
+#define CONFIG_CMD_AUTOSCRIPT
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_NAND
+#define CONFIG_CMD_JFFS2
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_CACHE
+#define CONFIG_CMD_ELF
+
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
  * External peripheral base address
  *-----------------------------------------------------------------------
  */
-#if !(CONFIG_COMMANDS & CFG_CMD_IDE)
+#if !defined(CONFIG_CMD_IDE)
 
 #undef CONFIG_IDE_LED                  /* no led for ide supported     */
 #undef CONFIG_IDE_RESET                /* no reset for ide supported   */
  * IDE/ATA stuff
  *-----------------------------------------------------------------------
  */
-#else /* !(CONFIG_COMMANDS & CFG_CMD_IDE) */
+#else
 #define CONFIG_START_IDE       1       /* check, if use IDE */
 
 #undef CONFIG_IDE_8xx_DIRECT           /* no pcmcia interface required */
 
 #endif /* IDE_USES_ISA_EMULATION */
 
-#endif /* !(CONFIG_COMMANDS & CFG_CMD_IDE) */
+#endif
 
 /*
 #define        CFG_KEY_REG_BASE_ADDR   0xF0100000
@@ -437,7 +447,7 @@ extern unsigned long offsetOfEnvironment;
 
 #define CFG_CACHELINE_SIZE 32
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
  #define CFG_CACHELINE_SHIFT   5       /* log base 2 of the above value        */
 #endif
 
index 8b2ec077bd94e167c40018c3cdc3fc48beeb6faa..8491d97ae421607a70736e694d5f7ff876be6f44 100644 (file)
  */
 #define CONFIG_MALLOC_SIZE     (CFG_ENV_SIZE + 128*1024)
 
-
 #define CONFIG_BAUDRATE                9600
 
-#define CONFIG_COMMANDS         (CONFIG_CMD_DFL | CFG_CMD_PCI | CFG_CMD_JFFS2 | CFG_CMD_IDE | CFG_CMD_NET | CFG_CMD_EEPROM)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_JFFS2
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_EEPROM
 
 #define CONFIG_BOOTDELAY       15
 #define CONFIG_BOOTARGS        "root=/dev/mtdblock0 console=ttyS0,9600"
 /* #define CONFIG_BOOTCOMMAND  "bootm 38000000" */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   115200          /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2               /* which serial port to use */
 #endif
 
-
 /*
  * Miscellaneous configurable options
  */
                                                /* valid baudrates */
 #define CFG_BAUDRATE_TABLE     { 9600, 19200, 38400, 57600, 115200 }
 
-
 /*-----------------------------------------------------------------------
  * Physical Memory Map
  */
 /*-----------------------------------------------------------------------
  * FLASH and environment organization
  */
-
-
 #define CFG_MAX_FLASH_BANKS    3       /* max number of memory banks           */
 #define CFG_MAX_FLASH_SECT     64      /* max number of sectors on one chip    */
 
 #define CONFIG_SPI_EEPROM      /* Support for SPI EEPROMs (AT25128) */
 #define CONFIG_MW_EEPROM       /* Support for MicroWire EEPROMs (AT93LC46) */
 
-
 /* allow to overwrite serial and ethaddr */
 #define CONFIG_ENV_OVERWRITE
 
-
 /* Environment in EEPROM */
 #define CFG_ENV_IS_IN_EEPROM   1
 #define CONFIG_SPI
 #define CONFIG_I8042_KBD
 #define CFG_ISA_IO 0
 
-
 /************************************************************
  * RTC
  ***********************************************************/
index a8e355508b1cb7f85371a08eaa2320147912edc7..c6f7f1526c63170b209069be62bd0bfacbfafad3 100644 (file)
 
 #define CONFIG_BAUDRATE                9600
 
-#define CONFIG_COMMANDS         (CONFIG_CMD_DFL | CFG_CMD_PCI | CFG_CMD_JFFS2 | CFG_CMD_IDE | CFG_CMD_NET | CFG_CMD_PCMCIA | CFG_CMD_EEPROM)
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_JFFS2
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_PCMCIA
+#define CONFIG_CMD_EEPROM
+
 
 #define CONFIG_BOOTDELAY       15
 #define CONFIG_BOOTARGS        "root=/dev/mtdblock1 console=ttyS0,9600 mtdparts=phys:7936k(root),256k(uboot) "
 #define CONFIG_BOOTCOMMAND     "setenv bootargs root=/dev/nfs ip=autoconf console=ttyS0,9600 mtdparts=phys:7808k(root),128k(env),256k(uboot); bootp; bootm"
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   115200          /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2               /* which serial port to use */
 #endif
index a4249c47c6251017f72eb73fec1acfaa384cc92c..d140241bff485a729edb0ecb814b1e995b41ca86 100644 (file)
 
 
 /*
- * Definition of u-boot build in commands. Check out CONFIG_CMD_DFL if
- * neccessary in include/cmd_confdefs.h file. (Un)comment for getting
- * functionality or size of u-boot code.
+ * BOOTP options
  */
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL         \
-                               & ~CFG_CMD_LOADS        \
-                               & ~CFG_CMD_CONSOLE      \
-                               & ~CFG_CMD_AUTOSCRIPT   \
-                               | CFG_CMD_NET           \
-                               | CFG_CMD_PING          \
-                               | CFG_CMD_DHCP          \
-                               )
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_DHCP
+
+#undef CONFIG_CMD_LOADS
+#undef CONFIG_CMD_CONSOLE
+#undef CONFIG_CMD_AUTOSCRIPT
 
-#include <cmd_confdefs.h>
 
 /*
  * Boot options. Setting delay to -1 stops autostart count down.
  * Right now there is no gain for user, but later on booting kernel might be
  * possible. Consider using XIP kernel running from flash to save RAM
  * footprint.
- * NOTE: Enable CFG_CMD_JFFS2 for JFFS2 support.
+ * NOTE: Enable CONFIG_CMD_JFFS2 for JFFS2 support.
  */
 #define CFG_JFFS2_FIRST_BANK           0
 #define CFG_JFFS2_FIRST_SECTOR         5
index 32199929a972cc6c9d2736fd2af451121dccdf73..3f75a441a0d8d9eede36742c8f8b12a6acab963a 100644 (file)
 /* Comment this out to enable USB 1.1 device */
 #define USB_2_0_DEVICE
 
-#define CMD_USB                        CFG_CMD_USB
-#else
-#define CMD_USB                        0       /* no USB on 440GRx             */
 #endif /* CONFIG_440EPX */
 
 /* Partitions */
 #define CONFIG_DOS_PARTITION
 #define CONFIG_ISO_PARTITION
 
-#define CONFIG_COMMANDS       (CONFIG_CMD_DFL  |       \
-                              CFG_CMD_ASKENV   |       \
-                              CFG_CMD_DHCP     |       \
-                              CFG_CMD_DTT      |       \
-                              CFG_CMD_DIAG     |       \
-                              CFG_CMD_EEPROM   |       \
-                              CFG_CMD_ELF      |       \
-                              CFG_CMD_FAT      |       \
-                              CFG_CMD_I2C      |       \
-                              CFG_CMD_IRQ      |       \
-                              CFG_CMD_MII      |       \
-                              CFG_CMD_NAND     |       \
-                              CFG_CMD_NET      |       \
-                              CFG_CMD_NFS      |       \
-                              CFG_CMD_PCI      |       \
-                              CFG_CMD_PING     |       \
-                              CFG_CMD_REGINFO  |       \
-                              CFG_CMD_SDRAM    |       \
-                              CMD_USB)
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_DTT
+#define CONFIG_CMD_DIAG
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_NAND
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_SDRAM
+
+#ifdef CONFIG_440EPX
+#define CONFIG_CMD_USB
+#endif
+
 
 /* POST support */
 #define CONFIG_POST            (CFG_POST_MEMORY   | \
 
 #define CONFIG_SUPPORT_VFAT
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-
 /*-----------------------------------------------------------------------
  * Miscellaneous configurable options
  *----------------------------------------------------------------------*/
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT             "=> "   /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024    /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE             256     /* Console I/O Buffer Size      */
  *----------------------------------------------------------------------*/
 #define CFG_DCACHE_SIZE                (32<<10)  /* For AMCC 440 CPUs                  */
 #define CFG_CACHELINE_SIZE     32            /* ...                                */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5             /* log base 2 of the above value  */
 #endif
 
 #define BOOTFLAG_COLD  0x01            /* Normal Power-On: Boot from FLASH     */
 #define BOOTFLAG_WARM  0x02            /* Software reboot                      */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2           /* which serial port to use */
 #endif
index 572985b051bb3705eacce97043aab5b30d4fe1e0..c1fa53f1a8a5e1bccca3bc7488f08587e95e5df5 100644 (file)
 
 #define CONFIG_BAUDRATE                115200
 
-#if 0 /* XXX - cannot test IDE anyway, so disabled for now - wd */
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL | \
-                                CFG_CMD_PCMCIA | \
-                                CFG_CMD_IDE)
-#endif /* 0 */
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
 
 #define CONFIG_BOOTDELAY       3
 #define CONFIG_BOOTARGS        "root=ramfs devfs=mount console=ttySA0,115200"
 #define CONFIG_NETMASK          255.255.0.0
 #define CONFIG_BOOTCOMMAND     "help"
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400          /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2               /* which serial port to use */
 #endif
index a137f9d7c999cc753b88fec6a23076aa7aca35f0..05f6053727064dc040021b020671f9c968a924d8 100644 (file)
 /* Use s3c2400's RTC */
 #define CONFIG_RTC_S3C24X0     1
 
-#ifndef USE_920T_MMU
-#define CONFIG_COMMANDS_tmp    ((CONFIG_CMD_DFL & ~CFG_CMD_CACHE) | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_SNTP    )
-#else
-#define CONFIG_COMMANDS_tmp    (CONFIG_CMD_DFL | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_SNTP    )
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_SNTP
+
+#if defined(CONFIG_HWFLOW)
+    #define CONFIG_CONFIG_HWFLOW
 #endif
 
-#ifdef CONFIG_HWFLOW
-#define CONFIG_COMMANDS                (CONFIG_COMMANDS_tmp | CFG_CMD_HWFLOW)
-#else
-#define CONFIG_COMMANDS                CONFIG_COMMANDS_tmp
+#if !defined(USE_920T_MMU)
+    #undef CONFIG_CMD_CACHE
 #endif
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
 
 #define CONFIG_BOOTDELAY       3
 #if 0
 #define CONFIG_BOOTCOMMAND     "tftp; bootm"
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   115200          /* speed to run kgdb serial port */
 /* what's this ? it's not used anywhere */
 #define CONFIG_KGDB_SER_INDEX  1               /* which serial port to use */
index 7edec0db43d6ae437c40bd7d96f802460b01c668..ca404ff452a5ec0b7bb12a5130f59761660a2264 100644 (file)
 
 #define CONFIG_BAUDRATE                115200
 
-/***********************************************************
- * Command definition
- ***********************************************************/
-#define CONFIG_COMMANDS \
-                       (CONFIG_CMD_DFL  | \
-                       CFG_CMD_CACHE    | \
-                       /*CFG_CMD_NAND   |*/ \
-                       /*CFG_CMD_EEPROM |*/ \
-                       /*CFG_CMD_I2C    |*/ \
-                       /*CFG_CMD_USB    |*/ \
-                       CFG_CMD_REGINFO  | \
-                       CFG_CMD_DATE     | \
-                       CFG_CMD_ELF)
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_CACHE
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_ELF
+
 
 #define CONFIG_BOOTDELAY       3
 /*#define CONFIG_BOOTARGS      "root=ramfs devfs=mount console=ttySA0,9600" */
 /*#define CONFIG_BOOTFILE      "elinos-lart" */
 /*#define CONFIG_BOOTCOMMAND   "tftp; bootm" */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   115200          /* speed to run kgdb serial port */
 /* what's this ? it's not used anywhere */
 #define CONFIG_KGDB_SER_INDEX  1               /* which serial port to use */
index 185c2d48709b913bc08342e1956ae76f8f79bf6f..ad68c751c89388e67fe6fd584f5f0abc6b32c040 100644 (file)
 #define BOOTFLAG_COLD          0x01    /* Normal Power-On: Boot from FLASH  */
 #define BOOTFLAG_WARM          0x02    /* Software reboot           */
 
-#define CFG_CACHELINE_SIZE     32      /* For MPC5xxx CPUs */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
-#  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
-#endif
-
 /*
  * Serial console configuration
  */
                                 CFG_POST_I2C)
 
 #ifdef CONFIG_POST
-#define CFG_CMD_POST_DIAG CFG_CMD_DIAG
 /* preserve space for the post_word at end of on-chip SRAM */
 #define MPC5XXX_SRAM_POST_SIZE MPC5XXX_SRAM_SIZE-4
-#else
-#define CFG_CMD_POST_DIAG 0
 #endif
 
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
 /*
- * Supported commands
+ * Command line configuration.
  */
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_ECHO    | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_JFFS2   | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_POST_DIAG | \
-                               CFG_CMD_REGINFO | \
-                               CFG_CMD_SNTP    )
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+#include <config_cmd_default.h>
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_ECHO
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_JFFS2
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_SNTP
+
+#ifdef CONFIG_POST
+#define CONFIG_CMD_DIAG
+#endif
+
 
 #define        CONFIG_TIMESTAMP                /* display image timestamps */
 
  */
 #define CFG_LONGHELP                   /* undef to save memory     */
 #define CFG_PROMPT             "=> "   /* Monitor Command Prompt   */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024    /* Console I/O Buffer Size  */
 #else
 #define CFG_CBSIZE             256     /* Console I/O Buffer Size  */
 
 #define CFG_HZ                 1000    /* decrementer freq: 1 ms ticks */
 
+#define CFG_CACHELINE_SIZE     32      /* For MPC5xxx CPUs */
+#if defined(CONFIG_CMD_KGDB)
+#  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
+#endif
+
 /*
- * Enable loopw commando. This has only affect, if CFG_CMD_MEM is defined,
- * which is normally part of the default commands (CFV_CMD_DFL)
+ * Enable loopw command.
  */
 #define CONFIG_LOOPW
 
index 4937638820b94047343f50e799205921f5a27630..fe014eabcbc1c79d476d012b40ae775cdd83e02e 100644 (file)
 #define BOOTFLAG_COLD          0x01    /* Normal Power-On: Boot from FLASH */
 #define BOOTFLAG_WARM          0x02    /* Software reboot      */
 
-#define CFG_CACHELINE_SIZE     32      /* For MPC8220 CPUs */
-
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
-#  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
-#endif
-
 /*
  * Serial console configuration
  */
 #define CONFIG_PCI_CFG_PHYS    CONFIG_PCI_CFG_BUS
 #define CONFIG_PCI_CFG_SIZE    0x01000000
 
+
 /*
- * Supported commands
+ * BOOTP options
  */
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_BOOTD   | \
-                               CFG_CMD_CACHE   | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_DIAG    | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_NET     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_REGINFO | \
-                               CFG_CMD_SDRAM   | \
-                               CFG_CMD_SNTP    | \
-                               0)
-
-/*                     CFG_CMD_MII     | \ */
-/*                            CFG_CMD_USB      | \ */
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_BOOTD
+#define CONFIG_CMD_CACHE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_DIAG
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_SDRAM
+#define CONFIG_CMD_SNTP
+
 
 /*
  * Default Environment
  */
 #define CFG_LONGHELP                       /* undef to save memory     */
 #define CFG_PROMPT             "=> "       /* Monitor Command Prompt   */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024        /* Console I/O Buffer Size  */
 #else
 #define CFG_CBSIZE             256         /* Console I/O Buffer Size  */
 
 #define CFG_HZ                 1000        /* decrementer freq: 1 ms ticks */
 
+#define CFG_CACHELINE_SIZE     32      /* For MPC8220 CPUs */
+#if defined(CONFIG_CMD_KGDB)
+#  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
+#endif
+
 /*
  * Various low-level settings
  */
index 09bbebdce899407d9e390c77092e05682cde7b15..b4ab9ad9726f39fa22ec016c0feb306642492770 100644 (file)
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 #define CONFIG_BZIP2    /* include support for bzip2 compressed images */
 
-#ifndef CONFIG_COMMANDS
-#define CONFIG_COMMANDS        (CONFIG_CMD_DFL   \
-                        | CFG_CMD_ASKENV \
-                        | CFG_CMD_DATE \
-                        | CFG_CMD_ECHO   \
-                        | CFG_CMD_IMMAP  \
-                        | CFG_CMD_JFFS2 \
-                        | CFG_CMD_PING \
-                        | CFG_CMD_DHCP \
-                        | CFG_CMD_I2C \
-                        | CFG_CMD_MII)
-                       /* & ~( CFG_CMD_NET)) */
 
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_ECHO
+#define CONFIG_CMD_IMMAP
+#define CONFIG_CMD_JFFS2
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_MII
 
-#endif /* !CONFIG_COMMANDS */
+#undef CONFIG_CMD_NET
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
 
 /*
  * Miscellaneous configurable options
 #define CFG_HUSH_PARSER
 #define CFG_PROMPT_HUSH_PS2    "> "
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE              1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE              256             /* Console I/O Buffer Size      */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 
-#ifdef CFG_CMD_DATE
+#ifdef CONFIG_CMD_DATE
 # define CONFIG_RTC_DS3231
 # define CFG_I2C_RTC_ADDR      0x68
 #endif
 /*-----------------------------------------------------------------------
  * I2C configuration
  */
-#if (CONFIG_COMMANDS & CFG_CMD_I2C)
+#if defined(CONFIG_CMD_I2C)
 /* enable I2C and select the hardware/software driver */
 #undef CONFIG_HARD_I2C                 /* I2C with hardware support    */
 #define CONFIG_SOFT_I2C                1       /* I2C bit-banged               */
index 9888d1110860cb5461286d52ae9944b958a824b9..4b618f36a8714d0d5005026a457c9212253684b2 100644 (file)
 #define BOOTFLAG_COLD          0x01    /* Normal Power-On: Boot from FLASH  */
 #define BOOTFLAG_WARM          0x02    /* Software reboot           */
 
-#define CFG_CACHELINE_SIZE     32      /* For MPC5xxx CPUs */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
-#  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
-#endif
-
 /*
  * Serial console configuration
  */
 #define CONFIG_NS8382X         1
 #endif /* CONFIG_STK52XX */
 
-#ifdef CONFIG_PCI
-#define ADD_PCI_CMD            CFG_CMD_PCI
-#else
-#define ADD_PCI_CMD            0
-#endif
-
 /*
  * Video console
  */
 #define CFG_CONSOLE_IS_IN_ENV
 #endif
 
-#ifdef CONFIG_VIDEO
-#define ADD_BMP_CMD            CFG_CMD_BMP
-#else
-#define ADD_BMP_CMD            0
-#endif
-
 /* Partitions */
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 /* USB */
 #ifdef CONFIG_STK52XX
 #define CONFIG_USB_OHCI
-#define ADD_USB_CMD            CFG_CMD_USB | CFG_CMD_FAT
 #define CONFIG_USB_STORAGE
-#else
-#define ADD_USB_CMD            0
 #endif
 
 /* POST support */
                                 CFG_POST_I2C)
 
 #ifdef CONFIG_POST
-#define CFG_CMD_POST_DIAG CFG_CMD_DIAG
 /* preserve space for the post_word at end of on-chip SRAM */
 #define MPC5XXX_SRAM_POST_SIZE MPC5XXX_SRAM_SIZE-4
-#else
-#define CFG_CMD_POST_DIAG 0
 #endif
 
-/* IDE */
-#if defined (CONFIG_MINIFAP) || defined (CONFIG_STK52XX)
-#define ADD_IDE_CMD            (CFG_CMD_IDE | CFG_CMD_FAT | CFG_CMD_EXT2)
-#else
-#define ADD_IDE_CMD            0
-#endif
 
 /*
- * Supported commands
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
  */
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               ADD_BMP_CMD     | \
-                               ADD_IDE_CMD     | \
-                               ADD_PCI_CMD     | \
-                               ADD_USB_CMD     | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_ECHO    | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_POST_DIAG | \
-                               CFG_CMD_REGINFO | \
-                               CFG_CMD_SNTP    )
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_ECHO
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_SNTP
+
+#if defined(CONFIG_MINIFAP) || defined(CONFIG_STK52XX)
+    #define CONFIG_CMD_IDE
+    #define CONFIG_CMD_FAT
+    #define CONFIG_CMD_EXT2
+#endif
+
+#ifdef CONFIG_STK52XX
+    #define CONFIG_CMD_USB
+    #define CONFIG_CMD_FAT
+#endif
+
+#ifdef CONFIG_VIDEO
+    #define CONFIG_CMD_BMP
+#endif
+
+#ifdef CONFIG_PCI
+    #define CONFIG_CMD_PCI
+#endif
+
+#ifdef CONFIG_POST
+#define CONFIG_CMD_DIAG
+#endif
+
 
 #define        CONFIG_TIMESTAMP                /* display image timestamps */
 
  */
 #define CFG_LONGHELP                   /* undef to save memory     */
 #define CFG_PROMPT             "=> "   /* Monitor Command Prompt   */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024    /* Console I/O Buffer Size  */
 #else
 #define CFG_CBSIZE             256     /* Console I/O Buffer Size  */
 
 #define CFG_HZ                 1000    /* decrementer freq: 1 ms ticks */
 
+#define CFG_CACHELINE_SIZE     32      /* For MPC5xxx CPUs */
+#if defined(CONFIG_CMD_KGDB)
+#  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
+#endif
+
 /*
- * Enable loopw commando. This has only affect, if CFG_CMD_MEM is defined,
- * which is normally part of the default commands (CFV_CMD_DFL)
+ * Enable loopw command.
  */
 #define CONFIG_LOOPW
 
index 21065b9d05c243e6ffffc018ff75dd384d54fdc8..1f41cf7699e0ac4dac768d677790251c9a518754 100644 (file)
 #define CONFIG_LOADS_ECHO      1       /* echo on for serial download  */
 #define CFG_LOADS_BAUD_CHANGE  1       /* allow baudrate change        */
 
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_I2C
+
 #if defined(CFG_RAMBOOT)
-  #if defined(CONFIG_PCI)
-  #define  CONFIG_COMMANDS     ((CONFIG_CMD_DFL | CFG_CMD_PCI | \
-                               CFG_CMD_PING | CFG_CMD_I2C) & \
-                                ~(CFG_CMD_ENV | \
-                                 CFG_CMD_LOADS ))
-  #elif defined(CONFIG_TSEC_ENET)
-  #define  CONFIG_COMMANDS     ((CONFIG_CMD_DFL | CFG_CMD_PING | \
-                               CFG_CMD_MII | CFG_CMD_I2C ) & \
-                               ~(CFG_CMD_ENV))
-  #elif defined(CONFIG_ETHER_ON_FCC)
-  #define  CONFIG_COMMANDS     ((CONFIG_CMD_DFL | CFG_CMD_MII | \
-                               CFG_CMD_PING | CFG_CMD_I2C) & \
-                               ~(CFG_CMD_ENV))
-  #endif
+    #undef CONFIG_CMD_ENV
+    #undef CONFIG_CMD_LOADS
 #else
-  #if defined(CONFIG_PCI)
-  #define  CONFIG_COMMANDS     (CONFIG_CMD_DFL | CFG_CMD_PCI | \
-                               CFG_CMD_ELF | CFG_CMD_PING | CFG_CMD_I2C)
-  #elif defined(CONFIG_TSEC_ENET)
-  #define  CONFIG_COMMANDS     (CONFIG_CMD_DFL | CFG_CMD_PING | \
-                               CFG_CMD_ELF | CFG_CMD_MII | CFG_CMD_I2C)
-  #elif defined(CONFIG_ETHER_ON_FCC)
-  #define  CONFIG_COMMANDS     (CONFIG_CMD_DFL | CFG_CMD_MII | \
-                               CFG_CMD_ELF | CFG_CMD_PING | CFG_CMD_I2C)
-  #endif
+    #define CONFIG_CMD_ELF
+#endif
+
+#if defined(CONFIG_PCI)
+    #define CONFIG_CMD_PCI
 #endif
-#include <cmd_confdefs.h>
+
+#if defined(CONFIG_TSEC_ENET) || defined(CONFIG_ETHER_ON_FCC)
+    #define CONFIG_CMD_MII
+#endif
+
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
  */
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT     "GPPP=> "       /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
 /* Cache Configuration */
 #define CFG_DCACHE_SIZE                32768
 #define CFG_CACHELINE_SIZE     32
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value */
 #endif
 
 #define BOOTFLAG_COLD  0x01            /* Normal Power-On: Boot from FLASH */
 #define BOOTFLAG_WARM  0x02            /* Software reboot              */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
index 2e527b23ab50b74c0faccec072bd0617b2cfc35b..55e2c8da20dcffc1c5e2aa2bc64c707615675f54 100644 (file)
 
 #define        CONFIG_TIMESTAMP                /* Print image info with ts     */
 
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_I2C
+
+#if defined(CONFIG_PCI)
+    #define CONFIG_CMD_PCI
+#endif
+
+#if defined(CONFIG_TSEC_ENET) || defined(CONFIG_ETHER_ON_FCC)
+    #define CONFIG_CMD_MII
+#endif
+
 #if defined(CFG_RAMBOOT)
-  #if defined(CONFIG_PCI)
-  #define  CONFIG_COMMANDS     ((CONFIG_CMD_DFL | CFG_CMD_PCI | \
-                               CFG_CMD_PING | CFG_CMD_I2C) & \
-                                ~(CFG_CMD_ENV | \
-                                 CFG_CMD_LOADS ))
-  #elif defined(CONFIG_TSEC_ENET)
-  #define  CONFIG_COMMANDS     ((CONFIG_CMD_DFL | CFG_CMD_PING | \
-                               CFG_CMD_MII | CFG_CMD_I2C ) & \
-                               ~(CFG_CMD_ENV))
-  #elif defined(CONFIG_ETHER_ON_FCC)
-  #define  CONFIG_COMMANDS     ((CONFIG_CMD_DFL | CFG_CMD_MII | \
-                               CFG_CMD_PING | CFG_CMD_I2C) & \
-                               ~(CFG_CMD_ENV))
-  #endif
+    #undef CONFIG_CMD_ENV
+    #undef CONFIG_CMD_LOADS
 #else
-  #if defined(CONFIG_PCI)
-  #define  CONFIG_COMMANDS     (CONFIG_CMD_DFL | CFG_CMD_PCI | \
-                               CFG_CMD_ELF | CFG_CMD_PING | CFG_CMD_I2C)
-  #elif defined(CONFIG_TSEC_ENET)
-  #define  CONFIG_COMMANDS     (CONFIG_CMD_DFL | CFG_CMD_PING | \
-                               CFG_CMD_ELF | CFG_CMD_MII | CFG_CMD_I2C)
-  #elif defined(CONFIG_ETHER_ON_FCC)
-  #define  CONFIG_COMMANDS     (CONFIG_CMD_DFL | CFG_CMD_MII | \
-                               CFG_CMD_ELF | CFG_CMD_PING | CFG_CMD_I2C)
-  #endif
+    #define CONFIG_CMD_ELF
 #endif
-#include <cmd_confdefs.h>
+
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
  */
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT     "SSA=> "        /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
 /* Cache Configuration */
 #define CFG_DCACHE_SIZE                32768
 #define CFG_CACHELINE_SIZE     32
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value */
 #endif
 
 #define BOOTFLAG_COLD  0x01            /* Normal Power-On: Boot from FLASH */
 #define BOOTFLAG_WARM  0x02            /* Software reboot              */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
index 614a046105cd616b7469abd2783bc63eded5204b..0dbf4b7feb672bbd617e79030bd86ba67752e7cd 100644 (file)
 #define        CONFIG_STATUS_LED       1       /* Status LED enabled           */
 #define CONFIG_BOARD_SPECIFIC_LED      /* version has board specific leds */
 
-#define CONFIG_BOOTP_MASK              (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE | CONFIG_BOOTP_NISDOMAIN)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_NISDOMAIN
+
 
 #undef CONFIG_MAC_PARTITION
 #undef CONFIG_DOS_PARTITION
 
 #define CONFIG_ENV_OVERWRITE   1       /* allow modification of vendor params */
 
-#define CONFIG_COMMANDS       ( CONFIG_CMD_DFL | \
-                               CFG_CMD_NAND    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_NFS)
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_NAND
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_PING
+
 
 #define CONFIG_BOARD_EARLY_INIT_F      1
 #define CONFIG_MISC_INIT_R
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-
 /*
  * Miscellaneous configurable options
  */
 #define CFG_HUSH_PARSER        1
 #define CFG_PROMPT_HUSH_PS2    "> "
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value */
 #endif
 
index 9661726b2bae709283443479ae6fe1d419b223fa..22c529b690bbf86f23837e248ba9cf8dbc84b6f7 100644 (file)
 #define MICROBLAZE_SYSREG_BASE_ADDR 0xFFFFA000
 #define MICROBLAZE_SYSREG_RECONFIGURE (1 << 0)
 
-#define CONFIG_COMMANDS                (CONFIG__CMD_DFL)
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
 
 #define CFG_UART1_BASE         (0xFFFF2000)
 #define CONFIG_SERIAL_BASE     CFG_UART1_BASE
index 92ee8cb3331f961cdceb467ae582928292ec7f3e..3b90f3ceb1d048a67d99a170d8d5f59544387219 100644 (file)
 
 #undef CONFIG_CAN_DRIVER               /* CAN Driver support disabled  */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
 
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 
 #define        CONFIG_RTC_MPC8xx               /* use internal RTC of MPC8xx   */
 
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_DOC     | \
-/*                             CFG_CMD_IDE     |*/ \
-                               CFG_CMD_DATE    )
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_DOC
+#define CONFIG_CMD_DATE
+
+
 #define CFG_NAND_LEGACY
 
 /*
 #define CFG_PROMPT_HUSH_PS2     "> "
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index d756be7165fd9b6513a3adc454bc77f7076eb02a..baa4fbd312b1b14c410fe5a182ea3c244a32b6ed 100644 (file)
 
 #define CONFIG_NETCONSOLE              /* include NetConsole support   */
 
-/*-----------------------------------------------------------------------
- * Console/Commands/Parser
- *----------------------------------------------------------------------*/
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_DIAG    | \
-                               CFG_CMD_DTT     | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_NET     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_REGINFO)
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_DIAG
+#define CONFIG_CMD_DTT
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_REGINFO
+
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
  *----------------------------------------------------------------------*/
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT             "=> "   /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024    /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE             256     /* Console I/O Buffer Size      */
  *----------------------------------------------------------------------*/
 #define CFG_DCACHE_SIZE                32768   /* For AMCC 440 CPUs                    */
 #define CFG_CACHELINE_SIZE     32      /* ...                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value        */
 #endif
 
 #define BOOTFLAG_COLD  0x01            /* Normal Power-On: Boot from FLASH     */
 #define BOOTFLAG_WARM  0x02            /* Software reboot                      */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
index dac1eb736d8934ad8e6fd8a884465645d5b6e358..a21af219a7ec30af54502237cce7d0847329eacf 100644 (file)
 /*#define CONFIG_BOOTCOMMAND   "run flash_local" */
 #define CONFIG_BOOTCOMMAND     "run netboot"
 
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL | \
-                                CFG_CMD_ASKENV | \
-                                CFG_CMD_DHCP   | \
-                                CFG_CMD_PING   | \
-                                CFG_CMD_PCI    | \
-                                CFG_CMD_ELF    )
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_ELF
+
 
 /*
  * Miscellaneous configurable options
index a2dc8e7bff8936ccb4137679c03f22d7464b070d..52bcbfc158b5895d0d80881f2b7a1c8fa5853696 100644 (file)
 /* Use s3c2400's RTC */
 #define CONFIG_RTC_S3C24X0     1
 
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_BSP
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_SNTP
+#define CONFIG_CMD_USB
+
 #ifdef CONFIG_HWFLOW
-#define CONFIG_COMMANDS_ADD_HWFLOW     CFG_CMD_HWFLOW
-#else
-#define        CONFIG_COMMANDS_ADD_HWFLOW      0
+    #define CONFIG_CMD_HWFLOW
 #endif
 
 #ifdef CONFIG_VFD
-#define CONFIG_COMMANDS_ADD_VFD                CFG_CMD_VFD
-#else
-#define CONFIG_COMMANDS_ADD_VFD                0
+    #define CONFIG_CMD_VFD
 #endif
 
 #ifdef CONFIG_DRIVER_S3C24X0_I2C
-#define CONFIG_COMMANDS_ADD_EEPROM     CFG_CMD_EEPROM
-#define CONFIG_COMMANDS_I2C            CFG_CMD_I2C
-#else
-#define CONFIG_COMMANDS_ADD_EEPROM     0
-#define CONFIG_COMMANDS_I2C            0
+    #define CONFIG_CMD_EEPROM
+    #define CONFIG_CMD_I2C
 #endif
 
 #ifndef USE_920T_MMU
-#define CONFIG_COMMANDS               ((CONFIG_CMD_DFL & ~CFG_CMD_CACHE) | \
-                               CONFIG_COMMANDS_ADD_HWFLOW      | \
-                               CONFIG_COMMANDS_ADD_VFD         | \
-                               CONFIG_COMMANDS_ADD_EEPROM      | \
-                               CONFIG_COMMANDS_I2C             | \
-                               CFG_CMD_BSP                     | \
-                               CFG_CMD_DATE                    | \
-                               CFG_CMD_DHCP                    | \
-                               CFG_CMD_FAT                     | \
-                               CFG_CMD_NFS                     | \
-                               CFG_CMD_SNTP                    | \
-                               CFG_CMD_USB     )
-#else
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL                  | \
-                               CONFIG_COMMANDS_ADD_HWFLOW      | \
-                               CONFIG_COMMANDS_ADD_VFD         | \
-                               CONFIG_COMMANDS_ADD_EEPROM      | \
-                               CONFIG_COMMANDS_I2C             | \
-                               CFG_CMD_BSP                     | \
-                               CFG_CMD_DATE                    | \
-                               CFG_CMD_DHCP                    | \
-                               CFG_CMD_FAT                     | \
-                               CFG_CMD_NFS                     | \
-                               CFG_CMD_SNTP                    | \
-                               CFG_CMD_USB     )
+    #undef CONFIG_CMD_CACHE
 #endif
 
+
 /* moved up */
 #define CFG_HUSH_PARSER                1       /* use "hush" command parser    */
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-
 #define CONFIG_BOOTDELAY       5
 #define CONFIG_ZERO_BOOTDELAY_CHECK    /* allow to break in always */
 #define CONFIG_PREBOOT         "echo;echo *** booting ***;echo"
 #define CONFIG_AUTOBOOT_DELAY_STR      "R"     /* 1st "password"       */
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   115200          /* speed to run kgdb serial port */
 /* what's this ? it's not used anywhere */
 #define CONFIG_KGDB_SER_INDEX  1               /* which serial port to use */
index c4e629ade2bec799d546a509442ca1c004c97582..92148e20543a449df59971f28e3e55a1214c523c 100644 (file)
 
 #undef CONFIG_STATUS_LED                /* no status-led                */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
 
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
                                CFG_POST_SPR )
 #undef  CONFIG_POST
 
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_SNTP
+
 #ifdef CONFIG_POST
-#define CFG_CMD_POST_DIAG       CFG_CMD_DIAG
-#else
-#define CFG_CMD_POST_DIAG      0
+#define CONFIG_CMD_DIAG
 #endif
 
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_FAT     | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_IDE     | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_POST_DIAG | \
-                               CFG_CMD_SNTP    )
 
 #define CONFIG_NETCONSOLE
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-
 /*
  * Miscellaneous configurable options
  */
 #define        CFG_PROMPT_HUSH_PS2     "> "
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE              1024    /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE              256     /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index ff061eecc896d350cf54611134f400bf358d2393..3b471d0a97fb3f7e92152d30cc83b18a94df9f62 100644 (file)
 #define BOOTFLAG_COLD          0x01    /* Normal Power-On: Boot from FLASH     */
 #define BOOTFLAG_WARM          0x02    /* Software reboot                      */
 
-#define CFG_CACHELINE_SIZE     32      /* For MPC5xxx CPUs                     */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
-#  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value        */
-#endif
-
 #define CONFIG_BOARD_EARLY_INIT_R
 
 /*
 /* Partitions */
 #define CONFIG_DOS_PARTITION
 
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
 /*
- * Supported commands
+ * Command line configuration.
  */
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DISPLAY | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_DTT     | \
-                               CFG_CMD_IDE     | \
-                               CFG_CMD_FAT     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_SNTP    )
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DISPLAY
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_DTT
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_SNTP
+
 
 #define        CONFIG_TIMESTAMP        1       /* Print image info with timestamp */
 
  */
 #define CFG_LONGHELP                   /* undef to save memory     */
 #define CFG_PROMPT             "=> "   /* Monitor Command Prompt   */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024    /* Console I/O Buffer Size  */
 #else
 #define CFG_CBSIZE             256     /* Console I/O Buffer Size  */
 
 #define CFG_HZ                 1000    /* decrementer freq: 1 ms ticks */
 
+#define CFG_CACHELINE_SIZE     32      /* For MPC5xxx CPUs                     */
+#if defined(CONFIG_CMD_KGDB)
+#  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value        */
+#endif
+
 /*
- * Enable loopw commando. This has only affect, if CFG_CMD_MEM is defined,
- * which is normally part of the default commands (CFV_CMD_DFL)
+ * Enable loopw command.
  */
 #define CONFIG_LOOPW
 
index e5d4397d2c74c9e4f71b26dcd2c327013dbd0c9a..cd00c49fc224eee40682ca474f3b10b8592835dc 100644 (file)
@@ -86,18 +86,36 @@ protect on ${u-boot_startaddr} ${u-boot_endaddr}"
 
 #define CONFIG_ENV_OVERWRITE
 
-#define CONFIG_COMMANDS                (CFG_CMD_DFL | CFG_CMD_BDI | CFG_CMD_PCI \
-                                                               | CFG_CMD_FLASH | CFG_CMD_MEMORY \
-                                                               | CFG_CMD_ENV | CFG_CMD_CONSOLE \
-                                                               | CFG_CMD_LOADS | CFG_CMD_LOADB \
-                                                               | CFG_CMD_IMI | CFG_CMD_CACHE \
-                                                               | CFG_CMD_REGINFO | CFG_CMD_NET\
-                                                               | CFG_CMD_DHCP | CFG_CMD_I2C \
-                                                               | CFG_CMD_DATE)
-
-/* This must be included AFTER the definition of CONFIG_COMMANDS (if any)
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
  */
-#include <cmd_confdefs.h>
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_BDI
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_FLASH
+#define CONFIG_CMD_MEMORY
+#define CONFIG_CMD_ENV
+#define CONFIG_CMD_CONSOLE
+#define CONFIG_CMD_LOADS
+#define CONFIG_CMD_LOADB
+#define CONFIG_CMD_IMI
+#define CONFIG_CMD_CACHE
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_DATE
 
 
 /*
@@ -403,7 +421,7 @@ protect on ${u-boot_startaddr} ${u-boot_endaddr}"
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     32
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value        */
 #endif
 
index a2e99b59e2a02f7c98bacc1918ad12eed70e793a..04072534810bdb4b6bbd381600e7a781d4c57435 100644 (file)
 
 #define        CONFIG_CAN_DRIVER       1       /* CAN Driver support enabled   */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
 
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 
 #define        CONFIG_RTC_MPC8xx               /* use internal RTC of MPC8xx   */
 
-#define CONFIG_COMMANDS              ( CONFIG_CMD_DFL  | \
-                               CFG_CMD_JFFS2   | \
-                               CFG_CMD_DATE    )
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_JFFS2
+#define CONFIG_CMD_DATE
+
 
 /*
  * JFFS2 partitions
 #define MTDPARTS_DEFAULT       "mtdparts=v37-1:-(jffs2)"
 */
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
-
 /*
  * Miscellaneous configurable options
  */
 #define        CFG_LONGHELP                    /* undef to save memory         */
 #define        CFG_PROMPT      "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index 0b7b19eadab6e9c943317f0b0fc2a21c2c799a26..c0b1a15e6b2b7efe235f9a6fcdcafea32ba92e93 100644 (file)
 #define BOOTFLAG_COLD          0x01    /* Normal Power-On: Boot from FLASH  */
 #define BOOTFLAG_WARM          0x02    /* Software reboot */
 
-#define CFG_CACHELINE_SIZE     32      /* For MPC5xxx CPUs */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
-#  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
-#endif
-
 /*
  * Serial console configuration
  */
 #define CONFIG_USB_CLOCK       0x0001BBBB
 #define CONFIG_USB_CONFIG      0x00001000
 
+
 /*
- * Supported commands
+ * BOOTP options
  */
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL | \
-                                CFG_CMD_FAT    | \
-                                CFG_CMD_I2C    | \
-                                CFG_CMD_IDE    | \
-                                CFG_CMD_PING   | \
-                                CFG_CMD_DHCP   | \
-                                CFG_CMD_DIAG   | \
-                                CFG_CMD_IRQ    | \
-                                CFG_CMD_JFFS2  | \
-                                CFG_CMD_MII    | \
-                                CFG_CMD_SDRAM  | \
-                                CFG_CMD_DATE   | \
-                                CFG_CMD_USB    | \
-                                CFG_CMD_FAT)
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
 
-#define CONFIG_TIMESTAMP               /* Print image info with timestamp */
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_DIAG
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_JFFS2
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_SDRAM
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_USB
+#define CONFIG_CMD_FAT
+
+
+#define CONFIG_TIMESTAMP               /* Print image info with timestamp */
 
 /*
  * Boot low with 16 MB Flash
  */
 #define CFG_LONGHELP                   /* undef to save memory */
 #define CFG_PROMPT             "=> "   /* Monitor Command Prompt */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024    /* Console I/O Buffer Size */
 #else
 #define CFG_CBSIZE             256     /* Console I/O Buffer Size */
 
 #define CFG_HZ                 1000    /* decrementer freq: 1 ms ticks */
 
+#define CFG_CACHELINE_SIZE     32      /* For MPC5xxx CPUs */
+#if defined(CONFIG_CMD_KGDB)
+#  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value */
+#endif
+
 /*
  * Various low-level settings
  */
index 16db43bb938df9c33068c697fcbf589b655e9ead..d2501501276379162b828f4ea402778a52a0ef6f 100644 (file)
 #define CFG_SERIAL0            0x101F1000
 #define CFG_SERIAL1            0x101F2000
 
-#define CONFIG_COMMANDS        (CFG_CMD_DHCP | CFG_CMD_IMI | CFG_CMD_NET | CFG_CMD_PING | CFG_CMD_BDI | CFG_CMD_MEMORY | CFG_CMD_FLASH | CFG_CMD_ENV)
 
-/*#define CONFIG_COMMANDS      (CFG_CMD_IMI | CFG_CMD_BDI | CFG_CMD_MEMORY) */
+/*
+ * Command line configuration.
+ */
+
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_IMI
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_BDI
+#define CONFIG_CMD_MEMORY
+#define CONFIG_CMD_FLASH
+#define CONFIG_CMD_ENV
 
-#define CONFIG_BOOTP_MASK      CONFIG_BOOTP_DEFAULT
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+
 
 #define CONFIG_BOOTDELAY       2
 #define CONFIG_BOOTARGS "root=/dev/nfs mem=128M ip=dhcp netdev=25,0,0xf1010000,0xf1010010,eth0"
index 06d8536ec31dfb927d3dd3fbd9041f7bd7c66df6..561a8bc47b5906ef25b3ca9dfd502e1026236c3b 100644 (file)
 
 #undef CONFIG_CAN_DRIVER               /* CAN Driver support disabled  */
 
-#define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+
 
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 
 #define        CONFIG_RTC_MPC8xx               /* use internal RTC of MPC8xx   */
 
-#ifdef CONFIG_SPLASH_SCREEN
-# define CONFIG_COMMANDS      ( CONFIG_CMD_DFL | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_BMP     | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_IDE     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_SNTP    )
-#else
-# define CONFIG_COMMANDS      ( CONFIG_CMD_DFL | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_IDE     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_SNTP    )
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_SNTP
+
+#if defined(CONFIG_SPLASH_SCREEN)
+    #define CONFIG_CMD_BMP
 #endif
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
 
 /*
  * Miscellaneous configurable options
 #define        CFG_PROMPT_HUSH_PS2     "> "
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE              1024    /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE              256     /* Console I/O Buffer Size      */
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
index 4e97b01aa1a75e59e3ee6a830b42f47f210109e8..7cab31dee4d25e67b0094776a9ed709ac4088a29 100644 (file)
 #define CONFIG_BAUDRATE                115200
 #define CFG_BAUDRATE_TABLE     { 9600, 19200, 38400, 57600, 115200 }
 
-#ifdef VOICEBLUE_SMALL_FLASH
-#define CONFIG_COMMANDS                (CFG_CMD_BDI    |       \
-                                CFG_CMD_LOADB  |       \
-                                CFG_CMD_IMI    |       \
-                                CFG_CMD_FLASH  |       \
-                                CFG_CMD_MEMORY |       \
-                                CFG_CMD_NET    |       \
-                                CFG_CMD_BOOTD  |       \
-                                CFG_CMD_DHCP   |       \
-                                CFG_CMD_PING   |       \
-                                CFG_CMD_RUN)
-#else
-#define CONFIG_COMMANDS                (CFG_CMD_BDI    |       \
-                                CFG_CMD_LOADB  |       \
-                                CFG_CMD_IMI    |       \
-                                CFG_CMD_FLASH  |       \
-                                CFG_CMD_MEMORY |       \
-                                CFG_CMD_NET    |       \
-                                CFG_CMD_ENV    |       \
-                                CFG_CMD_BOOTD  |       \
-                                CFG_CMD_DHCP   |       \
-                                CFG_CMD_PING   |       \
-                                CFG_CMD_RUN    |       \
-                                CFG_CMD_JFFS2)
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_BDI
+#define CONFIG_CMD_LOADB
+#define CONFIG_CMD_IMI
+#define CONFIG_CMD_FLASH
+#define CONFIG_CMD_MEMORY
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_BOOTD
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_RUN
+
+#if !defined(VOICEBLUE_SMALL_FLASH)
+    #define CONFIG_CMD_ENV
+    #define CONFIG_CMD_JFFS2
 #endif
 
-#define CONFIG_BOOTP_MASK      CONFIG_BOOTP_DEFAULT
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+
+
 #define CONFIG_LOOPW
 
 #ifdef VOICEBLUE_SMALL_FLASH
 
 #endif /* VOICEBLUE_SMALL_FLASH */
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
 
 /*
  * Miscellaneous configurable options
index b34dc71d23f3762f38b8de1dc98b27eef1399c4a..180549efad38c8ecb53d269aad6c22beea2c17b5 100644 (file)
 
 #define CONFIG_RTC_DS174x      1       /* use DS1743 RTC in Walnut     */
 
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_DATE    | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_DIAG    | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_NET     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_REGINFO | \
-                               CFG_CMD_SDRAM   | \
-                               CFG_CMD_SNTP    )
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_DIAG
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_SDRAM
+#define CONFIG_CMD_SNTP
+
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
  */
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT     "=> "           /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
 #define CFG_DCACHE_SIZE                16384   /* For AMCC 405 CPUs, older 405 ppc's   */
                                        /* have only 8kB, 16kB is save here     */
 #define CFG_CACHELINE_SIZE     32      /* ...                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value        */
 #endif
 
 #define BOOTFLAG_COLD  0x01            /* Normal Power-On: Boot from FLASH     */
 #define BOOTFLAG_WARM  0x02            /* Software reboot                      */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
index 47251bbb641e25655c4667dd2fd2c59f557f2382..c67b30122761b18183afdef51d5cd916eb409824 100644 (file)
 
 
 /*
- * Definition of u-boot build in commands. Check out CONFIG_CMD_DFL if
- * neccessary in include/cmd_confdefs.h file. (Un)comment for getting
- * functionality or size of u-boot code.
+ * BOOTP options
  */
-#define CONFIG_COMMANDS         (CONFIG_CMD_DFL                \
-                               & ~CFG_CMD_NET          \
-                               & ~CFG_CMD_LOADS        \
-                               & ~CFG_CMD_CONSOLE      \
-                               & ~CFG_CMD_AUTOSCRIPT   \
-/*                             | CFG_CMD_JFFS2 */      \
-                               )
-#include <cmd_confdefs.h>
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#undef CONFIG_CMD_NET
+#undef CONFIG_CMD_LOADS
+#undef CONFIG_CMD_CONSOLE
+#undef CONFIG_CMD_AUTOSCRIPT
+
 
 /*
  * Boot options. Setting delay to -1 stops autostart count down.
  * Right now there is no gain for user, but later on booting kernel might be
  * possible. Consider using XIP kernel running from flash to save RAM
  * footprint.
- * NOTE: Enable CFG_CMD_JFFS2 for JFFS2 support.
+ * NOTE: Enable CONFIG_CMD_JFFS2 for JFFS2 support.
  */
 #define CFG_JFFS2_FIRST_BANK           0
 #define CFG_JFFS2_FIRST_SECTOR         5
index 103976283013a937dcc704bfcf5a7871d09ce662..7418986caacbf4d3767125f493d953cb655dd915 100644 (file)
 
 #define CFG_BAUDRATE_TABLE     { 9600, 19200, 38400, 57600, 115200 } /* valid baudrates */
 
-#define CONFIG_COMMANDS               ((CONFIG_CMD_DFL & ~CFG_CMD_DTT) | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_DIAG    | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_SDRAM   | \
-                               CFG_CMD_SNTP    )
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_DIAG
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_SDRAM
+#define CONFIG_CMD_SNTP
+
+#undef CONFIG_CMD_DTT
+
 
 #define CONFIG_ETHADDR         08:00:3e:26:0a:5b
 #define CONFIG_NETMASK         255.255.255.0
 #define CONFIG_SETUP_MEMORY_TAGS       1
 #define CONFIG_INITRD_TAG              1
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   115200                  /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  1                       /* which serial port to use */
 #endif
index 825bfd14e93bb5e9646880872a002381fe58e1f3..bcd16ec5da026222813766c64ddc02498c6fcb0f 100644 (file)
 
 #define CONFIG_BAUDRATE                115200
 
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL | \
-                                CFG_CMD_ELF    | \
-                                CFG_CMD_EEPROM | \
-                                CFG_CMD_DATE   | \
-                                CFG_CMD_I2C    )
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_I2C
+
 
 #define CONFIG_BOOTDELAY       3
 
index dc702cf44586646c7ec87d82c4033f302e4ec7a0..5733933d616906d697979a36cc71b915402d7114 100644 (file)
 
 /* allow to overwrite serial and ethaddr */
 #define CONFIG_BAUDRATE                        115200
-#define CONFIG_COMMANDS                        (CONFIG_CMD_DFL | CFG_CMD_MMC | CFG_CMD_FAT | CFG_CMD_PING | CFG_CMD_JFFS2)
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_MMC
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_JFFS2
+
 
 #define CONFIG_BOOTDELAY               3
 #define CONFIG_ETHADDR                 FF:FF:FF:FF:FF:FF
index bac31f476b0521a94804c7324986965cda5e2094..b93b3876bc21be514dd324bd1282fe32f3e1f5c2 100644 (file)
 #define        CFG_ENV_IS_NOWHERE      1
 #define        CFG_ENV_SIZE            0x1000
 #define        CFG_ENV_ADDR            (CFG_MONITOR_BASE - CFG_ENV_SIZE)
-#ifndef XILINX_SYSACE_BASEADDR
-#define        CONFIG_COMMANDS (CONFIG__CMD_DFL |\
-                       CFG_CMD_MEMORY |\
-                       CFG_CMD_IRQ |\
-                       CFG_CMD_BDI |\
-                       CFG_CMD_NET |\
-                       CFG_CMD_IMI |\
-                       CFG_CMD_ECHO |\
-                       CFG_CMD_CACHE |\
-                       CFG_CMD_RUN |\
-                       CFG_CMD_AUTOSCRIPT |\
-                       CFG_CMD_ASKENV |\
-                       CFG_CMD_LOADS |\
-                       CFG_CMD_LOADB |\
-                       CFG_CMD_MISC |\
-                       CFG_CMD_MFSL |\
-                       CFG_CMD_PING \
-                       )
-#else
-#define        CONFIG_COMMANDS (CONFIG__CMD_DFL |\
-                       CFG_CMD_MEMORY |\
-                       CFG_CMD_IRQ |\
-                       CFG_CMD_BDI |\
-                       CFG_CMD_NET |\
-                       CFG_CMD_IMI |\
-                       CFG_CMD_ECHO |\
-                       CFG_CMD_CACHE |\
-                       CFG_CMD_RUN |\
-                       CFG_CMD_AUTOSCRIPT |\
-                       CFG_CMD_ASKENV |\
-                       CFG_CMD_LOADS |\
-                       CFG_CMD_LOADB |\
-                       CFG_CMD_MISC |\
-                       CFG_CMD_FAT |\
-                       CFG_CMD_EXT2 |\
-                       CFG_CMD_MFSL |\
-                       CFG_CMD_PING \
-                       )
-#endif
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_MEMORY
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_BDI
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_IMI
+#define CONFIG_CMD_ECHO
+#define CONFIG_CMD_CACHE
+#define CONFIG_CMD_RUN
+#define CONFIG_CMD_AUTOSCRIPT
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_LOADS
+#define CONFIG_CMD_LOADB
+#define CONFIG_CMD_MISC
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_MFSL
+
+#ifdef XILINX_SYSACE_BASEADDR
+#define CONFIG_CMD_EXT2
+#define CONFIG_CMD_FAT
+#endif
 
 /* Miscellaneous configurable options */
 #define        CFG_PROMPT      "U-Boot-mONStR> "
index 3b106efdf51074236baa7a441ed6d08014144adf..dd6d9acdd5de4163f8471289286d07e8fd60f9de 100644 (file)
 /* Comment this out to enable USB 1.1 device */
 #define USB_2_0_DEVICE
 
-#define CMD_USB                        (CFG_CMD_USB | CFG_CMD_FAT | CFG_CMD_EXT2)
-
 #define CONFIG_SUPPORT_VFAT
-#else
-#define CMD_USB                        0       /* no USB on 440GR              */
 #endif /* CONFIG_440EP */
 
 #ifdef DEBUG
 #define CONFIG_HW_WATCHDOG                     /* watchdog */
 #endif
 
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_DIAG    | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_NET     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_REGINFO | \
-                               CFG_CMD_SDRAM   | \
-                               CMD_USB)
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_DIAG
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_SDRAM
+
+#ifdef CONFIG_440EP
+    #define CONFIG_CMD_USB
+    #define CONFIG_CMD_FAT
+    #define CONFIG_CMD_EXT2
+#endif
+
 
 /*
  * Miscellaneous configurable options
  */
 #define CFG_LONGHELP                   /* undef to save memory         */
 #define CFG_PROMPT             "=> "   /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024    /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE             256     /* Console I/O Buffer Size      */
  */
 #define CFG_DCACHE_SIZE                (32<<10) /* For AMCC 440 CPUs                   */
 #define CFG_CACHELINE_SIZE     32      /* ...                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value        */
 #endif
 
 #define BOOTFLAG_COLD  0x01            /* Normal Power-On: Boot from FLASH     */
 #define BOOTFLAG_WARM  0x02            /* Software reboot                      */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
index 1fdcc4b505238ce24e6ff3def0b0cba87eb82a65..9c536fd12da9cd17a5a185a7670d63351c520cbd 100644 (file)
 /* Don't probe these addrs */
 #define CFG_I2C_NOPROBES       {0x50, 0x52, 0x53, 0x54}
 
-/* #if (CONFIG_COMMANDS & CFG_CMD_EEPROM) */
+/* #if defined(CONFIG_CMD_EEPROM) */
 /* #define CFG_I2C_EEPROM_ADDR 0x50 */ /* I2C boot EEPROM              */
 #define CFG_I2C_EEPROM_ADDR_LEN        2       /* Bytes of address             */
 /* #endif */
 #define CONFIG_LOADS_ECHO      1       /* echo on for serial download  */
 #define CFG_LOADS_BAUD_CHANGE  1       /* allow baudrate change        */
 
-#define CONFIG_COMMANDS               (CONFIG_CMD_DFL  | \
-                               CFG_CMD_ASKENV  | \
-                               CFG_CMD_EEPROM  | \
-                               CFG_CMD_DHCP    | \
-                               CFG_CMD_DIAG    | \
-                               CFG_CMD_ELF     | \
-                               CFG_CMD_I2C     | \
-                               CFG_CMD_IRQ     | \
-                               CFG_CMD_MII     | \
-                               CFG_CMD_NET     | \
-                               CFG_CMD_NFS     | \
-                               CFG_CMD_PCI     | \
-                               CFG_CMD_PING    | \
-                               CFG_CMD_REGINFO | \
-                               CFG_CMD_SDRAM   )
-
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_DIAG
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_SDRAM
+
 
 #define        CONFIG_IBM_EMAC4_V4     1
 #define CONFIG_MII             1       /* MII PHY management           */
 #define CFG_LONGHELP                           /* undef to save memory         */
 #define CFG_PROMPT             "=> "           /* Monitor Command Prompt       */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE             1024            /* Console I/O Buffer Size      */
 #else
 #define CFG_CBSIZE             256             /* Console I/O Buffer Size      */
  */
 #define CFG_DCACHE_SIZE                8192    /* For AMCC 405 CPUs            */
 #define CFG_CACHELINE_SIZE     32      /* ...                          */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value */
 #endif
 
 #define BOOTFLAG_COLD  0x01            /* Normal Power-On: Boot from FLASH */
 #define BOOTFLAG_WARM  0x02            /* Software reboot */
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
index 1e8ed7abdfcaf65a746fd3d96260783176dd7e61..517ecb13b7f963cc3856beb9834cb5e300b43345 100644 (file)
 
 #define CONFIG_BAUDRATE                115200
 
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
 #ifdef TURN_ON_ETHERNET
-# define CONFIG_COMMANDS        (CONFIG_CMD_DFL | CFG_CMD_PING)
+    #define CONFIG_CMD_PING
 #else
-# define CONFIG_COMMANDS       ((CONFIG_CMD_DFL \
-                                 | CFG_CMD_ENV \
-                                 | CFG_CMD_NAND) \
-                                & ~(CFG_CMD_NET \
-                                    | CFG_CMD_FLASH \
-                                    | CFG_CMD_IMLS))
+    #define CONFIG_CMD_ENV
+    #define CONFIG_CMD_NAND
+
+    #undef CONFIG_CMD_NET
+    #undef CONFIG_CMD_FLASH
+    #undef CONFIG_CMD_IMLS
 #endif
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
 
 #define CONFIG_BOOTDELAY       -1
 #define CONFIG_ETHADDR         08:00:3e:26:0a:5b
 #define CONFIG_CMDLINE_TAG
 #define CONFIG_TIMESTAMP
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   230400          /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2               /* which serial port to use */
 #endif
index 8f7f61703c6c47519794996d65931018b3216d86..0516da93749be2c00d34ae575259b63eb9243a72 100644 (file)
@@ -23,10 +23,12 @@ void do_reset (void);
 unsigned long simple_strtoul(const char *cp,char **endp,unsigned int base);
 char *getenv (char *name);
 void setenv (char *varname, char *varvalue);
-#if (CONFIG_COMMANDS & CFG_CMD_I2C)
+long simple_strtol(const char *cp,char **endp,unsigned int base);
+int strcmp(const char * cs,const char * ct);
+#if defined(CONFIG_CMD_I2C)
 int i2c_write (uchar, uint, int , uchar* , int);
 int i2c_read (uchar, uint, int , uchar* , int);
-#endif /* CFG_CMD_I2C */
+#endif
 
 void app_startup(char **);
 
@@ -40,7 +42,7 @@ enum {
        XF_MAX
 };
 
-#define XF_VERSION     3
+#define XF_VERSION     4
 
 #if defined(CONFIG_I386)
 extern gd_t *global_data;
index b688583828b1c82f90c9ea4a0a670d0eb7fb03a5..8a4273cce15d040af62b9221c741807104c2c7d0 100644 (file)
@@ -173,10 +173,10 @@ void      lcd_printf      (const char *fmt, ...);
 /************************************************************************/
 /* ** BITMAP DISPLAY SUPPORT                                           */
 /************************************************************************/
-#if (CONFIG_COMMANDS & CFG_CMD_BMP) || defined(CONFIG_SPLASH_SCREEN)
+#if defined(CONFIG_CMD_BMP) || defined(CONFIG_SPLASH_SCREEN)
 # include <bmp_layout.h>
 # include <asm/byteorder.h>
-#endif /* (CONFIG_COMMANDS & CFG_CMD_BMP) || CONFIG_SPLASH_SCREEN */
+#endif
 
 /*
  *  Information about displays we are using. This is for configuring
index 03c992e06aa000d818f2dad42f289c162f7ea24c..a4459c092c2f1a90d6624e1f4e3bec483d659f58 100644 (file)
@@ -26,7 +26,7 @@
  */
 
 
-#if defined(CONFIG_RTC_MK48T59) && (CONFIG_COMMANDS & CFG_CMD_DATE)
+#if defined(CONFIG_RTC_MK48T59) && defined(CONFIG_CMD_DATE)
 
 #define RTC_PORT_ADDR0         CFG_ISA_IO +  0x70
 #define RTC_PORT_ADDR1         RTC_PORT_ADDR0 +  0x1
index 461e03801417aa2c097e9ca03122fa26cbc55519..96719480097f55863ceb50b0e8b79e463c859b52 100644 (file)
@@ -296,7 +296,7 @@ typedef struct icmphdr {
 extern IPaddr_t                NetOurGatewayIP;        /* Our gateway IP addresse      */
 extern IPaddr_t                NetOurSubnetMask;       /* Our subnet mask (0 = unknown)*/
 extern IPaddr_t                NetOurDNSIP;     /* Our Domain Name Server (0 = unknown)*/
-#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_DNS2)
+#if defined(CONFIG_BOOTP_DNS2)
 extern IPaddr_t                NetOurDNS2IP;    /* Our 2nd Domain Name Server (0 = unknown)*/
 #endif
 extern char            NetOurNISDomain[32];    /* Our NIS domain               */
@@ -341,17 +341,17 @@ typedef enum { BOOTP, RARP, ARP, TFTP, DHCP, PING, DNS, NFS, CDP, NETCONS, SNTP
 /* from net/net.c */
 extern char    BootFile[128];                  /* Boot File name               */
 
-#if (CONFIG_COMMANDS & CFG_CMD_PING)
+#if defined(CONFIG_CMD_PING)
 extern IPaddr_t        NetPingIP;                      /* the ip address to ping               */
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_CDP)
+#if defined(CONFIG_CMD_CDP)
 /* when CDP completes these hold the return values */
 extern ushort CDPNativeVLAN;
 extern ushort CDPApplianceVLAN;
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_SNTP)
+#if defined(CONFIG_CMD_SNTP)
 extern IPaddr_t        NetNtpServerIP;                 /* the ip address to NTP        */
 extern int NetTimeOffset;                      /* offset time from UTC         */
 #endif
index 7c9a0e344100ecd31aacbde47281c3aaea36b32a..8e5dacc0df6cac054670e8b2238a485dbd02bd5f 100644 (file)
 #define PCI_MAX_PCI_DEVICES    32
 #define PCI_MAX_PCI_FUNCTIONS  8
 
+#define PCI_DCR                0x54    /* PCIe Device Control Register */
+#define PCI_DSR                0x56    /* PCIe Device Status Register */
+#define PCI_LSR                0x5e    /* PCIe Link Status Register */
+#define PCI_LTSSM      0x404   /* PCIe Link Training, Status State Machine */
+#define  PCI_LTSSM_L0  0x16    /* L0 state */
+
 /* Include the ID list */
 
 #include <pci_ids.h>
index 8f564da9b8ccd982e592112374b6931ae535a0d9..7305805e40c39fd3b16f17a6c67d20da8fa935be 100644 (file)
@@ -31,8 +31,8 @@
  * Allow configuration to select PCMCIA slot,
  * or try to generate a useful default
  */
-#if ( CONFIG_COMMANDS & CFG_CMD_PCMCIA) || \
-    ((CONFIG_COMMANDS & CFG_CMD_IDE) && \
+#if defined(CONFIG_CMD_PCMCIA) || \
+    (defined(CONFIG_CMD_IDE) && \
        (defined(CONFIG_IDE_8xx_PCCARD) || defined(CONFIG_IDE_8xx_DIRECT) ) )
 
 #if !defined(CONFIG_PCMCIA_SLOT_A) && !defined(CONFIG_PCMCIA_SLOT_B)
@@ -306,14 +306,14 @@ typedef struct {
 #define CISTPL_IDE_HAS_INDEX   0x20
 #define CISTPL_IDE_IOIS16      0x40
 
-#endif /* CFG_CMD_PCMCIA || CFG_CMD_IDE && (CONFIG_IDE_8xx_PCCARD || CONFIG_IDE_8xx_DIRECT) */
+#endif
 
 #ifdef CONFIG_8xx
 extern u_int *pcmcia_pgcrx[];
 #define        PCMCIA_PGCRX(slot)      (*pcmcia_pgcrx[slot])
 #endif
 
-#if    (CONFIG_COMMANDS & CFG_CMD_IDE) && defined(CONFIG_IDE_8xx_PCCARD) \
+#if defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_8xx_PCCARD) \
        || defined(CONFIG_PXA_PCMCIA)
 extern int check_ide_device(int slot);
 #endif
diff --git a/include/radeon.h b/include/radeon.h
new file mode 100644 (file)
index 0000000..3d11b05
--- /dev/null
@@ -0,0 +1,1984 @@
+#ifndef _RADEON_H
+#define _RADEON_H
+
+
+#define RADEON_REGSIZE                 0x4000
+
+
+#define MM_INDEX                       0x0000
+#define MM_DATA                                0x0004
+#define BUS_CNTL                       0x0030
+#define HI_STAT                                0x004C
+#define BUS_CNTL1                      0x0034
+#define I2C_CNTL_1                     0x0094
+#define CONFIG_CNTL                    0x00E0
+#define CONFIG_MEMSIZE                 0x00F8
+#define CONFIG_APER_0_BASE             0x0100
+#define CONFIG_APER_1_BASE             0x0104
+#define CONFIG_APER_SIZE               0x0108
+#define CONFIG_REG_1_BASE              0x010C
+#define CONFIG_REG_APER_SIZE           0x0110
+#define PAD_AGPINPUT_DELAY             0x0164
+#define PAD_CTLR_STRENGTH              0x0168
+#define PAD_CTLR_UPDATE                        0x016C
+#define PAD_CTLR_MISC                  0x0aa0
+#define AGP_CNTL                       0x0174
+#define BM_STATUS                      0x0160
+#define CAP0_TRIG_CNTL                 0x0950
+#define CAP1_TRIG_CNTL                 0x09c0
+#define VIPH_CONTROL                   0x0C40
+#define VENDOR_ID                      0x0F00
+#define DEVICE_ID                      0x0F02
+#define COMMAND                                0x0F04
+#define STATUS                         0x0F06
+#define REVISION_ID                    0x0F08
+#define REGPROG_INF                    0x0F09
+#define SUB_CLASS                      0x0F0A
+#define BASE_CODE                      0x0F0B
+#define CACHE_LINE                     0x0F0C
+#define LATENCY                                0x0F0D
+#define HEADER                         0x0F0E
+#define BIST                           0x0F0F
+#define REG_MEM_BASE                   0x0F10
+#define REG_IO_BASE                    0x0F14
+#define REG_REG_BASE                   0x0F18
+#define ADAPTER_ID                     0x0F2C
+#define BIOS_ROM                       0x0F30
+#define CAPABILITIES_PTR               0x0F34
+#define INTERRUPT_LINE                 0x0F3C
+#define INTERRUPT_PIN                  0x0F3D
+#define MIN_GRANT                      0x0F3E
+#define MAX_LATENCY                    0x0F3F
+#define ADAPTER_ID_W                   0x0F4C
+#define PMI_CAP_ID                     0x0F50
+#define PMI_NXT_CAP_PTR                        0x0F51
+#define PMI_PMC_REG                    0x0F52
+#define PM_STATUS                      0x0F54
+#define PMI_DATA                       0x0F57
+#define AGP_CAP_ID                     0x0F58
+#define AGP_STATUS                     0x0F5C
+#define AGP_COMMAND                    0x0F60
+#define AIC_CTRL                       0x01D0
+#define AIC_STAT                       0x01D4
+#define AIC_PT_BASE                    0x01D8
+#define AIC_LO_ADDR                    0x01DC
+#define AIC_HI_ADDR                    0x01E0
+#define AIC_TLB_ADDR                   0x01E4
+#define AIC_TLB_DATA                   0x01E8
+#define DAC_CNTL                       0x0058
+#define DAC_CNTL2                      0x007c
+#define CRTC_GEN_CNTL                  0x0050
+#define MEM_CNTL                       0x0140
+#define MC_CNTL                                0x0140
+#define EXT_MEM_CNTL                   0x0144
+#define MC_TIMING_CNTL                 0x0144
+#define MC_AGP_LOCATION                        0x014C
+#define MEM_IO_CNTL_A0                 0x0178
+#define MEM_REFRESH_CNTL               0x0178
+#define MEM_INIT_LATENCY_TIMER         0x0154
+#define MC_INIT_GFX_LAT_TIMER          0x0154
+#define MEM_SDRAM_MODE_REG             0x0158
+#define AGP_BASE                       0x0170
+#define MEM_IO_CNTL_A1                 0x017C
+#define MC_READ_CNTL_AB                        0x017C
+#define MEM_IO_CNTL_B0                 0x0180
+#define MC_INIT_MISC_LAT_TIMER         0x0180
+#define MEM_IO_CNTL_B1                 0x0184
+#define MC_IOPAD_CNTL                  0x0184
+#define MC_DEBUG                       0x0188
+#define MC_STATUS                      0x0150
+#define MEM_IO_OE_CNTL                 0x018C
+#define MC_CHIP_IO_OE_CNTL_AB          0x018C
+#define MC_FB_LOCATION                 0x0148
+/* #define MC_FB_LOCATION              0x0188 */
+#define HOST_PATH_CNTL                 0x0130
+#define MEM_VGA_WP_SEL                 0x0038
+#define MEM_VGA_RP_SEL                 0x003C
+#define HDP_DEBUG                      0x0138
+#define SW_SEMAPHORE                   0x013C
+#define CRTC2_GEN_CNTL                 0x03f8
+#define CRTC2_DISPLAY_BASE_ADDR                0x033c
+#define SURFACE_CNTL                   0x0B00
+#define SURFACE0_LOWER_BOUND           0x0B04
+#define SURFACE1_LOWER_BOUND           0x0B14
+#define SURFACE2_LOWER_BOUND           0x0B24
+#define SURFACE3_LOWER_BOUND           0x0B34
+#define SURFACE4_LOWER_BOUND           0x0B44
+#define SURFACE5_LOWER_BOUND           0x0B54
+#define SURFACE6_LOWER_BOUND           0x0B64
+#define SURFACE7_LOWER_BOUND           0x0B74
+#define SURFACE0_UPPER_BOUND           0x0B08
+#define SURFACE1_UPPER_BOUND           0x0B18
+#define SURFACE2_UPPER_BOUND           0x0B28
+#define SURFACE3_UPPER_BOUND           0x0B38
+#define SURFACE4_UPPER_BOUND           0x0B48
+#define SURFACE5_UPPER_BOUND           0x0B58
+#define SURFACE6_UPPER_BOUND           0x0B68
+#define SURFACE7_UPPER_BOUND           0x0B78
+#define SURFACE0_INFO                  0x0B0C
+#define SURFACE1_INFO                  0x0B1C
+#define SURFACE2_INFO                  0x0B2C
+#define SURFACE3_INFO                  0x0B3C
+#define SURFACE4_INFO                  0x0B4C
+#define SURFACE5_INFO                  0x0B5C
+#define SURFACE6_INFO                  0x0B6C
+#define SURFACE7_INFO                  0x0B7C
+#define SURFACE_ACCESS_FLAGS           0x0BF8
+#define SURFACE_ACCESS_CLR             0x0BFC
+#define GEN_INT_CNTL                   0x0040
+#define GEN_INT_STATUS                 0x0044
+#define CRTC_EXT_CNTL                  0x0054
+#define RB3D_CNTL                      0x1C3C
+#define WAIT_UNTIL                     0x1720
+#define ISYNC_CNTL                     0x1724
+#define RBBM_GUICNTL                   0x172C
+#define RBBM_STATUS                    0x0E40
+#define RBBM_STATUS_alt_1              0x1740
+#define RBBM_CNTL                      0x00EC
+#define RBBM_CNTL_alt_1                        0x0E44
+#define RBBM_SOFT_RESET                        0x00F0
+#define RBBM_SOFT_RESET_alt_1          0x0E48
+#define NQWAIT_UNTIL                   0x0E50
+#define RBBM_DEBUG                     0x0E6C
+#define RBBM_CMDFIFO_ADDR              0x0E70
+#define RBBM_CMDFIFO_DATAL             0x0E74
+#define RBBM_CMDFIFO_DATAH             0x0E78
+#define RBBM_CMDFIFO_STAT              0x0E7C
+#define CRTC_STATUS                    0x005C
+#define GPIO_VGA_DDC                   0x0060
+#define GPIO_DVI_DDC                   0x0064
+#define GPIO_MONID                     0x0068
+#define GPIO_CRT2_DDC                  0x006c
+#define PALETTE_INDEX                  0x00B0
+#define PALETTE_DATA                   0x00B4
+#define PALETTE_30_DATA                        0x00B8
+#define CRTC_H_TOTAL_DISP              0x0200
+#define CRTC_H_SYNC_STRT_WID           0x0204
+#define CRTC_V_TOTAL_DISP              0x0208
+#define CRTC_V_SYNC_STRT_WID           0x020C
+#define CRTC_VLINE_CRNT_VLINE          0x0210
+#define CRTC_CRNT_FRAME                        0x0214
+#define CRTC_GUI_TRIG_VLINE            0x0218
+#define CRTC_DEBUG                     0x021C
+#define CRTC_OFFSET_RIGHT              0x0220
+#define CRTC_OFFSET                    0x0224
+#define CRTC_OFFSET_CNTL               0x0228
+#define CRTC_PITCH                     0x022C
+#define OVR_CLR                                0x0230
+#define OVR_WID_LEFT_RIGHT             0x0234
+#define OVR_WID_TOP_BOTTOM             0x0238
+#define DISPLAY_BASE_ADDR              0x023C
+#define SNAPSHOT_VH_COUNTS             0x0240
+#define SNAPSHOT_F_COUNT               0x0244
+#define N_VIF_COUNT                    0x0248
+#define SNAPSHOT_VIF_COUNT             0x024C
+#define FP_CRTC_H_TOTAL_DISP           0x0250
+#define FP_CRTC_V_TOTAL_DISP           0x0254
+#define CRT_CRTC_H_SYNC_STRT_WID       0x0258
+#define CRT_CRTC_V_SYNC_STRT_WID       0x025C
+#define CUR_OFFSET                     0x0260
+#define CUR_HORZ_VERT_POSN             0x0264
+#define CUR_HORZ_VERT_OFF              0x0268
+#define CUR_CLR0                       0x026C
+#define CUR_CLR1                       0x0270
+#define FP_HORZ_VERT_ACTIVE            0x0278
+#define CRTC_MORE_CNTL                 0x027C
+#define CRTC_H_CUTOFF_ACTIVE_EN                (1<<4)
+#define CRTC_V_CUTOFF_ACTIVE_EN                (1<<5)
+#define DAC_EXT_CNTL                   0x0280
+#define FP_GEN_CNTL                    0x0284
+#define FP_HORZ_STRETCH                        0x028C
+#define FP_VERT_STRETCH                        0x0290
+#define FP_H_SYNC_STRT_WID             0x02C4
+#define FP_V_SYNC_STRT_WID             0x02C8
+#define AUX_WINDOW_HORZ_CNTL           0x02D8
+#define AUX_WINDOW_VERT_CNTL           0x02DC
+/* #define DDA_CONFIG                  0x02e0 */
+/* #define DDA_ON_OFF                  0x02e4 */
+#define DVI_I2C_CNTL_1                 0x02e4
+#define GRPH_BUFFER_CNTL               0x02F0
+#define GRPH2_BUFFER_CNTL              0x03F0
+#define VGA_BUFFER_CNTL                        0x02F4
+#define OV0_Y_X_START                  0x0400
+#define OV0_Y_X_END                    0x0404
+#define OV0_PIPELINE_CNTL              0x0408
+#define OV0_REG_LOAD_CNTL              0x0410
+#define OV0_SCALE_CNTL                 0x0420
+#define OV0_V_INC                      0x0424
+#define OV0_P1_V_ACCUM_INIT            0x0428
+#define OV0_P23_V_ACCUM_INIT           0x042C
+#define OV0_P1_BLANK_LINES_AT_TOP      0x0430
+#define OV0_P23_BLANK_LINES_AT_TOP     0x0434
+#define OV0_BASE_ADDR                  0x043C
+#define OV0_VID_BUF0_BASE_ADRS         0x0440
+#define OV0_VID_BUF1_BASE_ADRS         0x0444
+#define OV0_VID_BUF2_BASE_ADRS         0x0448
+#define OV0_VID_BUF3_BASE_ADRS         0x044C
+#define OV0_VID_BUF4_BASE_ADRS         0x0450
+#define OV0_VID_BUF5_BASE_ADRS         0x0454
+#define OV0_VID_BUF_PITCH0_VALUE       0x0460
+#define OV0_VID_BUF_PITCH1_VALUE       0x0464
+#define OV0_AUTO_FLIP_CNTRL            0x0470
+#define OV0_DEINTERLACE_PATTERN                0x0474
+#define OV0_SUBMIT_HISTORY             0x0478
+#define OV0_H_INC                      0x0480
+#define OV0_STEP_BY                    0x0484
+#define OV0_P1_H_ACCUM_INIT            0x0488
+#define OV0_P23_H_ACCUM_INIT           0x048C
+#define OV0_P1_X_START_END             0x0494
+#define OV0_P2_X_START_END             0x0498
+#define OV0_P3_X_START_END             0x049C
+#define OV0_FILTER_CNTL                        0x04A0
+#define OV0_FOUR_TAP_COEF_0            0x04B0
+#define OV0_FOUR_TAP_COEF_1            0x04B4
+#define OV0_FOUR_TAP_COEF_2            0x04B8
+#define OV0_FOUR_TAP_COEF_3            0x04BC
+#define OV0_FOUR_TAP_COEF_4            0x04C0
+#define OV0_FLAG_CNTRL                 0x04DC
+#define OV0_SLICE_CNTL                 0x04E0
+#define OV0_VID_KEY_CLR_LOW            0x04E4
+#define OV0_VID_KEY_CLR_HIGH           0x04E8
+#define OV0_GRPH_KEY_CLR_LOW           0x04EC
+#define OV0_GRPH_KEY_CLR_HIGH          0x04F0
+#define OV0_KEY_CNTL                   0x04F4
+#define OV0_TEST                       0x04F8
+#define SUBPIC_CNTL                    0x0540
+#define SUBPIC_DEFCOLCON               0x0544
+#define SUBPIC_Y_X_START               0x054C
+#define SUBPIC_Y_X_END                 0x0550
+#define SUBPIC_V_INC                   0x0554
+#define SUBPIC_H_INC                   0x0558
+#define SUBPIC_BUF0_OFFSET             0x055C
+#define SUBPIC_BUF1_OFFSET             0x0560
+#define SUBPIC_LC0_OFFSET              0x0564
+#define SUBPIC_LC1_OFFSET              0x0568
+#define SUBPIC_PITCH                   0x056C
+#define SUBPIC_BTN_HLI_COLCON          0x0570
+#define SUBPIC_BTN_HLI_Y_X_START       0x0574
+#define SUBPIC_BTN_HLI_Y_X_END         0x0578
+#define SUBPIC_PALETTE_INDEX           0x057C
+#define SUBPIC_PALETTE_DATA            0x0580
+#define SUBPIC_H_ACCUM_INIT            0x0584
+#define SUBPIC_V_ACCUM_INIT            0x0588
+#define DISP_MISC_CNTL                 0x0D00
+#define DAC_MACRO_CNTL                 0x0D04
+#define DISP_PWR_MAN                   0x0D08
+#define DISP_TEST_DEBUG_CNTL           0x0D10
+#define DISP_HW_DEBUG                  0x0D14
+#define DAC_CRC_SIG1                   0x0D18
+#define DAC_CRC_SIG2                   0x0D1C
+#define OV0_LIN_TRANS_A                        0x0D20
+#define OV0_LIN_TRANS_B                        0x0D24
+#define OV0_LIN_TRANS_C                        0x0D28
+#define OV0_LIN_TRANS_D                        0x0D2C
+#define OV0_LIN_TRANS_E                        0x0D30
+#define OV0_LIN_TRANS_F                        0x0D34
+#define OV0_GAMMA_0_F                  0x0D40
+#define OV0_GAMMA_10_1F                        0x0D44
+#define OV0_GAMMA_20_3F                        0x0D48
+#define OV0_GAMMA_40_7F                        0x0D4C
+#define OV0_GAMMA_380_3BF              0x0D50
+#define OV0_GAMMA_3C0_3FF              0x0D54
+#define DISP_MERGE_CNTL                        0x0D60
+#define DISP_OUTPUT_CNTL               0x0D64
+#define DISP_LIN_TRANS_GRPH_A          0x0D80
+#define DISP_LIN_TRANS_GRPH_B          0x0D84
+#define DISP_LIN_TRANS_GRPH_C          0x0D88
+#define DISP_LIN_TRANS_GRPH_D          0x0D8C
+#define DISP_LIN_TRANS_GRPH_E          0x0D90
+#define DISP_LIN_TRANS_GRPH_F          0x0D94
+#define DISP_LIN_TRANS_VID_A           0x0D98
+#define DISP_LIN_TRANS_VID_B           0x0D9C
+#define DISP_LIN_TRANS_VID_C           0x0DA0
+#define DISP_LIN_TRANS_VID_D           0x0DA4
+#define DISP_LIN_TRANS_VID_E           0x0DA8
+#define DISP_LIN_TRANS_VID_F           0x0DAC
+#define RMX_HORZ_FILTER_0TAP_COEF      0x0DB0
+#define RMX_HORZ_FILTER_1TAP_COEF      0x0DB4
+#define RMX_HORZ_FILTER_2TAP_COEF      0x0DB8
+#define RMX_HORZ_PHASE                 0x0DBC
+#define DAC_EMBEDDED_SYNC_CNTL         0x0DC0
+#define DAC_BROAD_PULSE                        0x0DC4
+#define DAC_SKEW_CLKS                  0x0DC8
+#define DAC_INCR                       0x0DCC
+#define DAC_NEG_SYNC_LEVEL             0x0DD0
+#define DAC_POS_SYNC_LEVEL             0x0DD4
+#define DAC_BLANK_LEVEL                        0x0DD8
+#define CLOCK_CNTL_INDEX               0x0008
+#define CLOCK_CNTL_DATA                        0x000C
+#define CP_RB_CNTL                     0x0704
+#define CP_RB_BASE                     0x0700
+#define CP_RB_RPTR_ADDR                        0x070C
+#define CP_RB_RPTR                     0x0710
+#define CP_RB_WPTR                     0x0714
+#define CP_RB_WPTR_DELAY               0x0718
+#define CP_IB_BASE                     0x0738
+#define CP_IB_BUFSZ                    0x073C
+#define SCRATCH_REG0                   0x15E0
+#define GUI_SCRATCH_REG0               0x15E0
+#define SCRATCH_REG1                   0x15E4
+#define GUI_SCRATCH_REG1               0x15E4
+#define SCRATCH_REG2                   0x15E8
+#define GUI_SCRATCH_REG2               0x15E8
+#define SCRATCH_REG3                   0x15EC
+#define GUI_SCRATCH_REG3               0x15EC
+#define SCRATCH_REG4                   0x15F0
+#define GUI_SCRATCH_REG4               0x15F0
+#define SCRATCH_REG5                   0x15F4
+#define GUI_SCRATCH_REG5               0x15F4
+#define SCRATCH_UMSK                   0x0770
+#define SCRATCH_ADDR                   0x0774
+#define DP_BRUSH_FRGD_CLR              0x147C
+#define DP_BRUSH_BKGD_CLR              0x1478
+#define DST_LINE_START                 0x1600
+#define DST_LINE_END                   0x1604
+#define SRC_OFFSET                     0x15AC
+#define SRC_PITCH                      0x15B0
+#define SRC_TILE                       0x1704
+#define SRC_PITCH_OFFSET               0x1428
+#define SRC_X                          0x1414
+#define SRC_Y                          0x1418
+#define SRC_X_Y                                0x1590
+#define SRC_Y_X                                0x1434
+#define DST_Y_X                                0x1438
+#define DST_WIDTH_HEIGHT               0x1598
+#define DST_HEIGHT_WIDTH               0x143c
+#define DST_OFFSET                     0x1404
+#define SRC_CLUT_ADDRESS               0x1780
+#define SRC_CLUT_DATA                  0x1784
+#define SRC_CLUT_DATA_RD               0x1788
+#define HOST_DATA0                     0x17C0
+#define HOST_DATA1                     0x17C4
+#define HOST_DATA2                     0x17C8
+#define HOST_DATA3                     0x17CC
+#define HOST_DATA4                     0x17D0
+#define HOST_DATA5                     0x17D4
+#define HOST_DATA6                     0x17D8
+#define HOST_DATA7                     0x17DC
+#define HOST_DATA_LAST                 0x17E0
+#define DP_SRC_ENDIAN                  0x15D4
+#define DP_SRC_FRGD_CLR                        0x15D8
+#define DP_SRC_BKGD_CLR                        0x15DC
+#define SC_LEFT                                0x1640
+#define SC_RIGHT                       0x1644
+#define SC_TOP                         0x1648
+#define SC_BOTTOM                      0x164C
+#define SRC_SC_RIGHT                   0x1654
+#define SRC_SC_BOTTOM                  0x165C
+#define DP_CNTL                                0x16C0
+#define DP_CNTL_XDIR_YDIR_YMAJOR       0x16D0
+#define DP_DATATYPE                    0x16C4
+#define DP_MIX                         0x16C8
+#define DP_WRITE_MSK                   0x16CC
+#define DP_XOP                         0x17F8
+#define CLR_CMP_CLR_SRC                        0x15C4
+#define CLR_CMP_CLR_DST                        0x15C8
+#define CLR_CMP_CNTL                   0x15C0
+#define CLR_CMP_MSK                    0x15CC
+#define DSTCACHE_MODE                  0x1710
+#define DSTCACHE_CTLSTAT               0x1714
+#define DEFAULT_PITCH_OFFSET           0x16E0
+#define DEFAULT_SC_BOTTOM_RIGHT                0x16E8
+#define DEFAULT_SC_TOP_LEFT            0x16EC
+#define SRC_PITCH_OFFSET               0x1428
+#define DST_PITCH_OFFSET               0x142C
+#define DP_GUI_MASTER_CNTL             0x146C
+#define SC_TOP_LEFT                    0x16EC
+#define SC_BOTTOM_RIGHT                        0x16F0
+#define SRC_SC_BOTTOM_RIGHT            0x16F4
+#define RB2D_DSTCACHE_MODE             0x3428
+#define RB2D_DSTCACHE_CTLSTAT          0x342C
+#define LVDS_GEN_CNTL                  0x02d0
+#define LVDS_PLL_CNTL                  0x02d4
+#define FP2_GEN_CNTL                   0x0288
+#define TMDS_CNTL                      0x0294
+#define TMDS_CRC                       0x02a0
+#define TMDS_TRANSMITTER_CNTL          0x02a4
+#define MPP_TB_CONFIG                  0x01c0
+#define PAMAC0_DLY_CNTL                        0x0a94
+#define PAMAC1_DLY_CNTL                        0x0a98
+#define PAMAC2_DLY_CNTL                        0x0a9c
+#define FW_CNTL                                0x0118
+#define FCP_CNTL                       0x0910
+#define VGA_DDA_ON_OFF                 0x02ec
+#define TV_MASTER_CNTL                 0x0800
+
+/* #define BASE_CODE                   0x0f0b */
+#define BIOS_0_SCRATCH                 0x0010
+#define BIOS_1_SCRATCH                 0x0014
+#define BIOS_2_SCRATCH                 0x0018
+#define BIOS_3_SCRATCH                 0x001c
+#define BIOS_4_SCRATCH                 0x0020
+#define BIOS_5_SCRATCH                 0x0024
+#define BIOS_6_SCRATCH                 0x0028
+#define BIOS_7_SCRATCH                 0x002c
+
+#define HDP_SOFT_RESET                 (1 << 26)
+
+#define TV_DAC_CNTL                    0x088c
+#define GPIOPAD_MASK                   0x0198
+#define GPIOPAD_A                      0x019c
+#define GPIOPAD_EN                     0x01a0
+#define GPIOPAD_Y                      0x01a4
+#define ZV_LCDPAD_MASK                 0x01a8
+#define ZV_LCDPAD_A                    0x01ac
+#define ZV_LCDPAD_EN                   0x01b0
+#define ZV_LCDPAD_Y                    0x01b4
+
+/* PLL Registers */
+#define CLK_PIN_CNTL                   0x0001
+#define PPLL_CNTL                      0x0002
+#define PPLL_REF_DIV                   0x0003
+#define PPLL_DIV_0                     0x0004
+#define PPLL_DIV_1                     0x0005
+#define PPLL_DIV_2                     0x0006
+#define PPLL_DIV_3                     0x0007
+#define VCLK_ECP_CNTL                  0x0008
+#define HTOTAL_CNTL                    0x0009
+#define M_SPLL_REF_FB_DIV              0x000a
+#define AGP_PLL_CNTL                   0x000b
+#define SPLL_CNTL                      0x000c
+#define SCLK_CNTL                      0x000d
+#define MPLL_CNTL                      0x000e
+#define MDLL_CKO                       0x000f
+#define MDLL_RDCKA                     0x0010
+#define MCLK_CNTL                      0x0012
+#define AGP_PLL_CNTL                   0x000b
+#define PLL_TEST_CNTL                  0x0013
+#define CLK_PWRMGT_CNTL                        0x0014
+#define PLL_PWRMGT_CNTL                        0x0015
+#define MCLK_MISC                      0x001f
+#define P2PLL_CNTL                     0x002a
+#define P2PLL_REF_DIV                  0x002b
+#define PIXCLKS_CNTL                   0x002d
+#define SCLK_MORE_CNTL                 0x0035
+
+/* MCLK_CNTL bit constants */
+#define FORCEON_MCLKA                  (1 << 16)
+#define FORCEON_MCLKB                  (1 << 17)
+#define FORCEON_YCLKA                  (1 << 18)
+#define FORCEON_YCLKB                  (1 << 19)
+#define FORCEON_MC                     (1 << 20)
+#define FORCEON_AIC                    (1 << 21)
+
+/* SCLK_CNTL bit constants */
+#define DYN_STOP_LAT_MASK              0x00007ff8
+#define CP_MAX_DYN_STOP_LAT            0x0008
+#define SCLK_FORCEON_MASK              0xffff8000
+
+/* SCLK_MORE_CNTL bit constants */
+#define SCLK_MORE_FORCEON              0x0700
+
+/* BUS_CNTL bit constants */
+#define BUS_DBL_RESYNC                 0x00000001
+#define BUS_MSTR_RESET                 0x00000002
+#define BUS_FLUSH_BUF                  0x00000004
+#define BUS_STOP_REQ_DIS               0x00000008
+#define BUS_ROTATION_DIS               0x00000010
+#define BUS_MASTER_DIS                 0x00000040
+#define BUS_ROM_WRT_EN                 0x00000080
+#define BUS_DIS_ROM                    0x00001000
+#define BUS_PCI_READ_RETRY_EN          0x00002000
+#define BUS_AGP_AD_STEPPING_EN         0x00004000
+#define BUS_PCI_WRT_RETRY_EN           0x00008000
+#define BUS_MSTR_RD_MULT               0x00100000
+#define BUS_MSTR_RD_LINE               0x00200000
+#define BUS_SUSPEND                    0x00400000
+#define LAT_16X                                0x00800000
+#define BUS_RD_DISCARD_EN              0x01000000
+#define BUS_RD_ABORT_EN                        0x02000000
+#define BUS_MSTR_WS                    0x04000000
+#define BUS_PARKING_DIS                        0x08000000
+#define BUS_MSTR_DISCONNECT_EN         0x10000000
+#define BUS_WRT_BURST                  0x20000000
+#define BUS_READ_BURST                 0x40000000
+#define BUS_RDY_READ_DLY               0x80000000
+
+/* PIXCLKS_CNTL */
+#define PIX2CLK_SRC_SEL_MASK           0x03
+#define PIX2CLK_SRC_SEL_CPUCLK         0x00
+#define PIX2CLK_SRC_SEL_PSCANCLK       0x01
+#define PIX2CLK_SRC_SEL_BYTECLK                0x02
+#define PIX2CLK_SRC_SEL_P2PLLCLK       0x03
+#define PIX2CLK_ALWAYS_ONb             (1<<6)
+#define PIX2CLK_DAC_ALWAYS_ONb         (1<<7)
+#define PIXCLK_TV_SRC_SEL              (1 << 8)
+#define PIXCLK_LVDS_ALWAYS_ONb         (1 << 14)
+#define PIXCLK_TMDS_ALWAYS_ONb         (1 << 15)
+
+
+/* CLOCK_CNTL_INDEX bit constants */
+#define PLL_WR_EN                      0x00000080
+
+/* CONFIG_CNTL bit constants */
+#define CFG_VGA_RAM_EN                 0x00000100
+#define CFG_ATI_REV_ID_MASK            (0xf << 16)
+#define CFG_ATI_REV_A11                        (0 << 16)
+#define CFG_ATI_REV_A12                        (1 << 16)
+#define CFG_ATI_REV_A13                        (2 << 16)
+
+/* CRTC_EXT_CNTL bit constants */
+#define VGA_ATI_LINEAR                 0x00000008
+#define VGA_128KAP_PAGING              0x00000010
+#define XCRT_CNT_EN                    (1 << 6)
+#define CRTC_HSYNC_DIS                 (1 << 8)
+#define CRTC_VSYNC_DIS                 (1 << 9)
+#define CRTC_DISPLAY_DIS               (1 << 10)
+#define CRTC_CRT_ON                    (1 << 15)
+
+
+/* DSTCACHE_CTLSTAT bit constants */
+#define RB2D_DC_FLUSH                  (3 << 0)
+#define RB2D_DC_FLUSH_ALL              0xf
+#define RB2D_DC_BUSY                   (1 << 31)
+
+
+/* CRTC_GEN_CNTL bit constants */
+#define CRTC_DBL_SCAN_EN               0x00000001
+#define CRTC_CUR_EN                    0x00010000
+#define CRTC_INTERLACE_EN              (1 << 1)
+#define CRTC_BYPASS_LUT_EN             (1 << 14)
+#define CRTC_EXT_DISP_EN               (1 << 24)
+#define CRTC_EN                                (1 << 25)
+#define CRTC_DISP_REQ_EN_B             (1 << 26)
+
+/* CRTC_STATUS bit constants */
+#define CRTC_VBLANK                    0x00000001
+
+/* CRTC2_GEN_CNTL bit constants */
+#define CRT2_ON                                (1 << 7)
+#define CRTC2_DISPLAY_DIS              (1 << 23)
+#define CRTC2_EN                       (1 << 25)
+#define CRTC2_DISP_REQ_EN_B            (1 << 26)
+
+/* CUR_OFFSET, CUR_HORZ_VERT_POSN, CUR_HORZ_VERT_OFF bit constants */
+#define CUR_LOCK                       0x80000000
+
+/* GPIO bit constants */
+#define GPIO_A_0                       (1 <<  0)
+#define GPIO_A_1                       (1 <<  1)
+#define GPIO_Y_0                       (1 <<  8)
+#define GPIO_Y_1                       (1 <<  9)
+#define GPIO_EN_0                      (1 << 16)
+#define GPIO_EN_1                      (1 << 17)
+#define GPIO_MASK_0                    (1 << 24)
+#define GPIO_MASK_1                    (1 << 25)
+#define VGA_DDC_DATA_OUTPUT            GPIO_A_0
+#define VGA_DDC_CLK_OUTPUT             GPIO_A_1
+#define VGA_DDC_DATA_INPUT             GPIO_Y_0
+#define VGA_DDC_CLK_INPUT              GPIO_Y_1
+#define VGA_DDC_DATA_OUT_EN            GPIO_EN_0
+#define VGA_DDC_CLK_OUT_EN             GPIO_EN_1
+
+
+/* FP bit constants */
+#define FP_CRTC_H_TOTAL_MASK           000003ff
+#define FP_CRTC_H_DISP_MASK            0x01ff0000
+#define FP_CRTC_V_TOTAL_MASK           0x00000fff
+#define FP_CRTC_V_DISP_MASK            0x0fff0000
+#define FP_H_SYNC_STRT_CHAR_MASK       0x00001ff8
+#define FP_H_SYNC_WID_MASK             0x003f0000
+#define FP_V_SYNC_STRT_MASK            0x00000fff
+#define FP_V_SYNC_WID_MASK             0x001f0000
+#define FP_CRTC_H_TOTAL_SHIFT          0x00000000
+#define FP_CRTC_H_DISP_SHIFT           0x00000010
+#define FP_CRTC_V_TOTAL_SHIFT          0x00000000
+#define FP_CRTC_V_DISP_SHIFT           0x00000010
+#define FP_H_SYNC_STRT_CHAR_SHIFT      0x00000003
+#define FP_H_SYNC_WID_SHIFT            0x00000010
+#define FP_V_SYNC_STRT_SHIFT           0x00000000
+#define FP_V_SYNC_WID_SHIFT            0x00000010
+
+/* FP_GEN_CNTL bit constants */
+#define FP_FPON                                (1 << 0)
+#define FP_TMDS_EN                     (1 << 2)
+#define FP_PANEL_FORMAT                        (1 << 3)
+#define FP_EN_TMDS                     (1 << 7)
+#define FP_DETECT_SENSE                        (1 << 8)
+#define R200_FP_SOURCE_SEL_MASK                (3 << 10)
+#define R200_FP_SOURCE_SEL_CRTC1       (0 << 10)
+#define R200_FP_SOURCE_SEL_CRTC2       (1 << 10)
+#define R200_FP_SOURCE_SEL_RMX         (2 << 10)
+#define R200_FP_SOURCE_SEL_TRANS       (3 << 10)
+#define FP_SEL_CRTC1                   (0 << 13)
+#define FP_SEL_CRTC2                   (1 << 13)
+#define FP_USE_VGA_HSYNC               (1 << 14)
+#define FP_CRTC_DONT_SHADOW_HPAR       (1 << 15)
+#define FP_CRTC_DONT_SHADOW_VPAR       (1 << 16)
+#define FP_CRTC_DONT_SHADOW_HEND       (1 << 17)
+#define FP_CRTC_USE_SHADOW_VEND                (1 << 18)
+#define FP_RMX_HVSYNC_CONTROL_EN       (1 << 20)
+#define FP_DFP_SYNC_SEL                        (1 << 21)
+#define FP_CRTC_LOCK_8DOT              (1 << 22)
+#define FP_CRT_SYNC_SEL                        (1 << 23)
+#define FP_USE_SHADOW_EN               (1 << 24)
+#define FP_CRT_SYNC_ALT                        (1 << 26)
+
+/* FP2_GEN_CNTL bit constants */
+#define FP2_BLANK_EN                   (1 <<   1)
+#define FP2_ON                         (1 <<   2)
+#define FP2_PANEL_FORMAT               (1 <<   3)
+#define FP2_SOURCE_SEL_MASK            (3 << 10)
+#define FP2_SOURCE_SEL_CRTC2           (1 << 10)
+#define FP2_SRC_SEL_MASK               (3 << 13)
+#define FP2_SRC_SEL_CRTC2              (1 << 13)
+#define FP2_FP_POL                     (1 << 16)
+#define FP2_LP_POL                     (1 << 17)
+#define FP2_SCK_POL                    (1 << 18)
+#define FP2_LCD_CNTL_MASK              (7 << 19)
+#define FP2_PAD_FLOP_EN                        (1 << 22)
+#define FP2_CRC_EN                     (1 << 23)
+#define FP2_CRC_READ_EN                        (1 << 24)
+#define FP2_DV0_EN                     (1 << 25)
+#define FP2_DV0_RATE_SEL_SDR           (1 << 26)
+
+
+/* LVDS_GEN_CNTL bit constants */
+#define LVDS_ON                                (1 << 0)
+#define LVDS_DISPLAY_DIS               (1 << 1)
+#define LVDS_PANEL_TYPE                        (1 << 2)
+#define LVDS_PANEL_FORMAT              (1 << 3)
+#define LVDS_EN                                (1 << 7)
+#define LVDS_BL_MOD_LEVEL_MASK         0x0000ff00
+#define LVDS_BL_MOD_LEVEL_SHIFT                8
+#define LVDS_BL_MOD_EN                 (1 << 16)
+#define LVDS_DIGON                     (1 << 18)
+#define LVDS_BLON                      (1 << 19)
+#define LVDS_SEL_CRTC2                 (1 << 23)
+#define LVDS_STATE_MASK \
+       (LVDS_ON | LVDS_DISPLAY_DIS | LVDS_BL_MOD_LEVEL_MASK | LVDS_BLON)
+
+/* LVDS_PLL_CNTL bit constatns */
+#define HSYNC_DELAY_SHIFT              0x1c
+#define HSYNC_DELAY_MASK               (0xf << 0x1c)
+
+/* TMDS_TRANSMITTER_CNTL bit constants */
+#define TMDS_PLL_EN                    (1 << 0)
+#define TMDS_PLLRST                    (1 << 1)
+#define TMDS_RAN_PAT_RST               (1 << 7)
+#define TMDS_ICHCSEL                   (1 << 28)
+
+/* FP_HORZ_STRETCH bit constants */
+#define HORZ_STRETCH_RATIO_MASK                0xffff
+#define HORZ_STRETCH_RATIO_MAX         4096
+#define HORZ_PANEL_SIZE                        (0x1ff << 16)
+#define HORZ_PANEL_SHIFT               16
+#define HORZ_STRETCH_PIXREP            (0 << 25)
+#define HORZ_STRETCH_BLEND             (1 << 26)
+#define HORZ_STRETCH_ENABLE            (1 << 25)
+#define HORZ_AUTO_RATIO                        (1 << 27)
+#define HORZ_FP_LOOP_STRETCH           (0x7 << 28)
+#define HORZ_AUTO_RATIO_INC            (1 << 31)
+
+
+/* FP_VERT_STRETCH bit constants */
+#define VERT_STRETCH_RATIO_MASK                0xfff
+#define VERT_STRETCH_RATIO_MAX         4096
+#define VERT_PANEL_SIZE                        (0xfff << 12)
+#define VERT_PANEL_SHIFT               12
+#define VERT_STRETCH_LINREP            (0 << 26)
+#define VERT_STRETCH_BLEND             (1 << 26)
+#define VERT_STRETCH_ENABLE            (1 << 25)
+#define VERT_AUTO_RATIO_EN             (1 << 27)
+#define VERT_FP_LOOP_STRETCH           (0x7 << 28)
+#define VERT_STRETCH_RESERVED          0xf1000000
+
+/* DAC_CNTL bit constants */
+#define DAC_8BIT_EN                    0x00000100
+#define DAC_4BPP_PIX_ORDER             0x00000200
+#define DAC_CRC_EN                     0x00080000
+#define DAC_MASK_ALL                   (0xff << 24)
+#define DAC_PDWN                       (1 << 15)
+#define DAC_EXPAND_MODE                        (1 << 14)
+#define DAC_VGA_ADR_EN                 (1 << 13)
+#define DAC_RANGE_CNTL                 (3 <<  0)
+#define DAC_RANGE_CNTL_MASK            0x03
+#define DAC_BLANKING                   (1 <<  2)
+#define DAC_CMP_EN                     (1 <<  3)
+#define DAC_CMP_OUTPUT                 (1 <<  7)
+
+/* DAC_CNTL2 bit constants */
+#define DAC2_EXPAND_MODE               (1 << 14)
+#define DAC2_CMP_EN                    (1 << 7)
+#define DAC2_PALETTE_ACCESS_CNTL       (1 << 5)
+
+/* DAC_EXT_CNTL bit constants */
+#define DAC_FORCE_BLANK_OFF_EN         (1 << 4)
+#define DAC_FORCE_DATA_EN              (1 << 5)
+#define DAC_FORCE_DATA_SEL_MASK                (3 << 6)
+#define DAC_FORCE_DATA_MASK            0x0003ff00
+#define DAC_FORCE_DATA_SHIFT           8
+
+/* GEN_RESET_CNTL bit constants */
+#define SOFT_RESET_GUI                 0x00000001
+#define SOFT_RESET_VCLK                        0x00000100
+#define SOFT_RESET_PCLK                        0x00000200
+#define SOFT_RESET_ECP                 0x00000400
+#define SOFT_RESET_DISPENG_XCLK                0x00000800
+
+/* MEM_CNTL bit constants */
+#define MEM_CTLR_STATUS_IDLE           0x00000000
+#define MEM_CTLR_STATUS_BUSY           0x00100000
+#define MEM_SEQNCR_STATUS_IDLE         0x00000000
+#define MEM_SEQNCR_STATUS_BUSY         0x00200000
+#define MEM_ARBITER_STATUS_IDLE                0x00000000
+#define MEM_ARBITER_STATUS_BUSY                0x00400000
+#define MEM_REQ_UNLOCK                 0x00000000
+#define MEM_REQ_LOCK                   0x00800000
+#define MEM_NUM_CHANNELS_MASK          0x00000001
+#define MEM_USE_B_CH_ONLY              0x00000002
+#define RV100_MEM_HALF_MODE            0x00000008
+#define R300_MEM_NUM_CHANNELS_MASK     0x00000003
+#define R300_MEM_USE_CD_CH_ONLY                0x00000004
+
+
+/* RBBM_SOFT_RESET bit constants */
+#define SOFT_RESET_CP                  (1 <<  0)
+#define SOFT_RESET_HI                  (1 <<  1)
+#define SOFT_RESET_SE                  (1 <<  2)
+#define SOFT_RESET_RE                  (1 <<  3)
+#define SOFT_RESET_PP                  (1 <<  4)
+#define SOFT_RESET_E2                  (1 <<  5)
+#define SOFT_RESET_RB                  (1 <<  6)
+#define SOFT_RESET_HDP                 (1 <<  7)
+
+/* SURFACE_CNTL bit consants */
+#define SURF_TRANSLATION_DIS           (1 << 8)
+#define NONSURF_AP0_SWP_16BPP          (1 << 20)
+#define NONSURF_AP0_SWP_32BPP          (1 << 21)
+#define NONSURF_AP1_SWP_16BPP          (1 << 22)
+#define NONSURF_AP1_SWP_32BPP          (1 << 23)
+
+/* DEFAULT_SC_BOTTOM_RIGHT bit constants */
+#define DEFAULT_SC_RIGHT_MAX           (0x1fff << 0)
+#define DEFAULT_SC_BOTTOM_MAX          (0x1fff << 16)
+
+/* MM_INDEX bit constants */
+#define MM_APER                                0x80000000
+
+/* CLR_CMP_CNTL bit constants */
+#define COMPARE_SRC_FALSE              0x00000000
+#define COMPARE_SRC_TRUE               0x00000001
+#define COMPARE_SRC_NOT_EQUAL          0x00000004
+#define COMPARE_SRC_EQUAL              0x00000005
+#define COMPARE_SRC_EQUAL_FLIP         0x00000007
+#define COMPARE_DST_FALSE              0x00000000
+#define COMPARE_DST_TRUE               0x00000100
+#define COMPARE_DST_NOT_EQUAL          0x00000400
+#define COMPARE_DST_EQUAL              0x00000500
+#define COMPARE_DESTINATION            0x00000000
+#define COMPARE_SOURCE                 0x01000000
+#define COMPARE_SRC_AND_DST            0x02000000
+
+
+/* DP_CNTL bit constants */
+#define DST_X_RIGHT_TO_LEFT            0x00000000
+#define DST_X_LEFT_TO_RIGHT            0x00000001
+#define DST_Y_BOTTOM_TO_TOP            0x00000000
+#define DST_Y_TOP_TO_BOTTOM            0x00000002
+#define DST_X_MAJOR                    0x00000000
+#define DST_Y_MAJOR                    0x00000004
+#define DST_X_TILE                     0x00000008
+#define DST_Y_TILE                     0x00000010
+#define DST_LAST_PEL                   0x00000020
+#define DST_TRAIL_X_RIGHT_TO_LEFT      0x00000000
+#define DST_TRAIL_X_LEFT_TO_RIGHT      0x00000040
+#define DST_TRAP_FILL_RIGHT_TO_LEFT    0x00000000
+#define DST_TRAP_FILL_LEFT_TO_RIGHT    0x00000080
+#define DST_BRES_SIGN                  0x00000100
+#define DST_HOST_BIG_ENDIAN_EN         0x00000200
+#define DST_POLYLINE_NONLAST           0x00008000
+#define DST_RASTER_STALL               0x00010000
+#define DST_POLY_EDGE                  0x00040000
+
+
+/* DP_CNTL_YDIR_XDIR_YMAJOR bit constants (short version of DP_CNTL) */
+#define DST_X_MAJOR_S                  0x00000000
+#define DST_Y_MAJOR_S                  0x00000001
+#define DST_Y_BOTTOM_TO_TOP_S          0x00000000
+#define DST_Y_TOP_TO_BOTTOM_S          0x00008000
+#define DST_X_RIGHT_TO_LEFT_S          0x00000000
+#define DST_X_LEFT_TO_RIGHT_S          0x80000000
+
+
+/* DP_DATATYPE bit constants */
+#define DST_8BPP                       0x00000002
+#define DST_15BPP                      0x00000003
+#define DST_16BPP                      0x00000004
+#define DST_24BPP                      0x00000005
+#define DST_32BPP                      0x00000006
+#define DST_8BPP_RGB332                        0x00000007
+#define DST_8BPP_Y8                    0x00000008
+#define DST_8BPP_RGB8                  0x00000009
+#define DST_16BPP_VYUY422              0x0000000b
+#define DST_16BPP_YVYU422              0x0000000c
+#define DST_32BPP_AYUV444              0x0000000e
+#define DST_16BPP_ARGB4444             0x0000000f
+#define BRUSH_SOLIDCOLOR               0x00000d00
+#define SRC_MONO                       0x00000000
+#define SRC_MONO_LBKGD                 0x00010000
+#define SRC_DSTCOLOR                   0x00030000
+#define BYTE_ORDER_MSB_TO_LSB          0x00000000
+#define BYTE_ORDER_LSB_TO_MSB          0x40000000
+#define DP_CONVERSION_TEMP             0x80000000
+#define HOST_BIG_ENDIAN_EN             (1 << 29)
+
+
+/* DP_GUI_MASTER_CNTL bit constants */
+#define GMC_SRC_PITCH_OFFSET_DEFAULT   0x00000000
+#define GMC_SRC_PITCH_OFFSET_LEAVE     0x00000001
+#define GMC_DST_PITCH_OFFSET_DEFAULT   0x00000000
+#define GMC_DST_PITCH_OFFSET_LEAVE     0x00000002
+#define GMC_SRC_CLIP_DEFAULT           0x00000000
+#define GMC_SRC_CLIP_LEAVE             0x00000004
+#define GMC_DST_CLIP_DEFAULT           0x00000000
+#define GMC_DST_CLIP_LEAVE             0x00000008
+#define GMC_BRUSH_8x8MONO              0x00000000
+#define GMC_BRUSH_8x8MONO_LBKGD                0x00000010
+#define GMC_BRUSH_8x1MONO              0x00000020
+#define GMC_BRUSH_8x1MONO_LBKGD                0x00000030
+#define GMC_BRUSH_1x8MONO              0x00000040
+#define GMC_BRUSH_1x8MONO_LBKGD                0x00000050
+#define GMC_BRUSH_32x1MONO             0x00000060
+#define GMC_BRUSH_32x1MONO_LBKGD       0x00000070
+#define GMC_BRUSH_32x32MONO            0x00000080
+#define GMC_BRUSH_32x32MONO_LBKGD      0x00000090
+#define GMC_BRUSH_8x8COLOR             0x000000a0
+#define GMC_BRUSH_8x1COLOR             0x000000b0
+#define GMC_BRUSH_1x8COLOR             0x000000c0
+#define GMC_BRUSH_SOLID_COLOR          0x000000d0
+#define GMC_DST_8BPP                   0x00000200
+#define GMC_DST_15BPP                  0x00000300
+#define GMC_DST_16BPP                  0x00000400
+#define GMC_DST_24BPP                  0x00000500
+#define GMC_DST_32BPP                  0x00000600
+#define GMC_DST_8BPP_RGB332            0x00000700
+#define GMC_DST_8BPP_Y8                        0x00000800
+#define GMC_DST_8BPP_RGB8              0x00000900
+#define GMC_DST_16BPP_VYUY422          0x00000b00
+#define GMC_DST_16BPP_YVYU422          0x00000c00
+#define GMC_DST_32BPP_AYUV444          0x00000e00
+#define GMC_DST_16BPP_ARGB4444         0x00000f00
+#define GMC_SRC_MONO                   0x00000000
+#define GMC_SRC_MONO_LBKGD             0x00001000
+#define GMC_SRC_DSTCOLOR               0x00003000
+#define GMC_BYTE_ORDER_MSB_TO_LSB      0x00000000
+#define GMC_BYTE_ORDER_LSB_TO_MSB      0x00004000
+#define GMC_DP_CONVERSION_TEMP_9300    0x00008000
+#define GMC_DP_CONVERSION_TEMP_6500    0x00000000
+#define GMC_DP_SRC_RECT                        0x02000000
+#define GMC_DP_SRC_HOST                        0x03000000
+#define GMC_DP_SRC_HOST_BYTEALIGN      0x04000000
+#define GMC_3D_FCN_EN_CLR              0x00000000
+#define GMC_3D_FCN_EN_SET              0x08000000
+#define GMC_DST_CLR_CMP_FCN_LEAVE      0x00000000
+#define GMC_DST_CLR_CMP_FCN_CLEAR      0x10000000
+#define GMC_AUX_CLIP_LEAVE             0x00000000
+#define GMC_AUX_CLIP_CLEAR             0x20000000
+#define GMC_WRITE_MASK_LEAVE           0x00000000
+#define GMC_WRITE_MASK_SET             0x40000000
+#define GMC_CLR_CMP_CNTL_DIS           (1 << 28)
+#define GMC_SRC_DATATYPE_COLOR         (3 << 12)
+#define ROP3_S                         0x00cc0000
+#define ROP3_SRCCOPY                   0x00cc0000
+#define ROP3_P                         0x00f00000
+#define ROP3_PATCOPY                   0x00f00000
+#define DP_SRC_SOURCE_MASK             (7  << 24)
+#define GMC_BRUSH_NONE                 (15 <<  4)
+#define DP_SRC_SOURCE_MEMORY           (2  << 24)
+#define GMC_BRUSH_SOLIDCOLOR           0x000000d0
+
+/* DP_MIX bit constants */
+#define DP_SRC_RECT                    0x00000200
+#define DP_SRC_HOST                    0x00000300
+#define DP_SRC_HOST_BYTEALIGN          0x00000400
+
+/* MPLL_CNTL bit constants */
+#define MPLL_RESET                     0x00000001
+
+/* MDLL_CKO bit constants */
+#define MCKOA_SLEEP                    0x00000001
+#define MCKOA_RESET                    0x00000002
+#define MCKOA_REF_SKEW_MASK            0x00000700
+#define MCKOA_FB_SKEW_MASK             0x00007000
+
+/* MDLL_RDCKA bit constants */
+#define MRDCKA0_SLEEP                  0x00000001
+#define MRDCKA0_RESET                  0x00000002
+#define MRDCKA1_SLEEP                  0x00010000
+#define MRDCKA1_RESET                  0x00020000
+
+/* VCLK_ECP_CNTL constants */
+#define VCLK_SRC_SEL_MASK              0x03
+#define VCLK_SRC_SEL_CPUCLK            0x00
+#define VCLK_SRC_SEL_PSCANCLK          0x01
+#define VCLK_SRC_SEL_BYTECLK           0x02
+#define VCLK_SRC_SEL_PPLLCLK           0x03
+#define PIXCLK_ALWAYS_ONb              0x00000040
+#define PIXCLK_DAC_ALWAYS_ONb          0x00000080
+
+/* BUS_CNTL1 constants */
+#define BUS_CNTL1_MOBILE_PLATFORM_SEL_MASK     0x0c000000
+#define BUS_CNTL1_MOBILE_PLATFORM_SEL_SHIFT    26
+#define BUS_CNTL1_AGPCLK_VALID                 0x80000000
+
+/* PLL_PWRMGT_CNTL constants */
+#define PLL_PWRMGT_CNTL_SPLL_TURNOFF           0x00000002
+#define PLL_PWRMGT_CNTL_PPLL_TURNOFF           0x00000004
+#define PLL_PWRMGT_CNTL_P2PLL_TURNOFF          0x00000008
+#define PLL_PWRMGT_CNTL_TVPLL_TURNOFF          0x00000010
+#define PLL_PWRMGT_CNTL_MOBILE_SU              0x00010000
+#define PLL_PWRMGT_CNTL_SU_SCLK_USE_BCLK       0x00020000
+#define PLL_PWRMGT_CNTL_SU_MCLK_USE_BCLK       0x00040000
+
+/* TV_DAC_CNTL constants */
+#define TV_DAC_CNTL_BGSLEEP                    0x00000040
+#define TV_DAC_CNTL_DETECT                     0x00000010
+#define TV_DAC_CNTL_BGADJ_MASK                 0x000f0000
+#define TV_DAC_CNTL_DACADJ_MASK                        0x00f00000
+#define TV_DAC_CNTL_BGADJ__SHIFT               16
+#define TV_DAC_CNTL_DACADJ__SHIFT              20
+#define TV_DAC_CNTL_RDACPD                     0x01000000
+#define TV_DAC_CNTL_GDACPD                     0x02000000
+#define TV_DAC_CNTL_BDACPD                     0x04000000
+
+/* DISP_MISC_CNTL constants */
+#define DISP_MISC_CNTL_SOFT_RESET_GRPH_PP      (1 << 0)
+#define DISP_MISC_CNTL_SOFT_RESET_SUBPIC_PP    (1 << 1)
+#define DISP_MISC_CNTL_SOFT_RESET_OV0_PP       (1 << 2)
+#define DISP_MISC_CNTL_SOFT_RESET_GRPH_SCLK    (1 << 4)
+#define DISP_MISC_CNTL_SOFT_RESET_SUBPIC_SCLK  (1 << 5)
+#define DISP_MISC_CNTL_SOFT_RESET_OV0_SCLK     (1 << 6)
+#define DISP_MISC_CNTL_SOFT_RESET_GRPH2_PP     (1 << 12)
+#define DISP_MISC_CNTL_SOFT_RESET_GRPH2_SCLK   (1 << 15)
+#define DISP_MISC_CNTL_SOFT_RESET_LVDS         (1 << 16)
+#define DISP_MISC_CNTL_SOFT_RESET_TMDS         (1 << 17)
+#define DISP_MISC_CNTL_SOFT_RESET_DIG_TMDS     (1 << 18)
+#define DISP_MISC_CNTL_SOFT_RESET_TV           (1 << 19)
+
+/* DISP_PWR_MAN constants */
+#define DISP_PWR_MAN_DISP_PWR_MAN_D3_CRTC_EN   (1 << 0)
+#define DISP_PWR_MAN_DISP2_PWR_MAN_D3_CRTC2_EN (1 << 4)
+#define DISP_PWR_MAN_DISP_D3_RST               (1 << 16)
+#define DISP_PWR_MAN_DISP_D3_REG_RST           (1 << 17)
+#define DISP_PWR_MAN_DISP_D3_GRPH_RST          (1 << 18)
+#define DISP_PWR_MAN_DISP_D3_SUBPIC_RST                (1 << 19)
+#define DISP_PWR_MAN_DISP_D3_OV0_RST           (1 << 20)
+#define DISP_PWR_MAN_DISP_D1D2_GRPH_RST                (1 << 21)
+#define DISP_PWR_MAN_DISP_D1D2_SUBPIC_RST      (1 << 22)
+#define DISP_PWR_MAN_DISP_D1D2_OV0_RST         (1 << 23)
+#define DISP_PWR_MAN_DIG_TMDS_ENABLE_RST       (1 << 24)
+#define DISP_PWR_MAN_TV_ENABLE_RST             (1 << 25)
+#define DISP_PWR_MAN_AUTO_PWRUP_EN             (1 << 26)
+
+/* masks */
+
+#define CONFIG_MEMSIZE_MASK            0x1f000000
+#define MEM_CFG_TYPE                   0x40000000
+#define DST_OFFSET_MASK                        0x003fffff
+#define DST_PITCH_MASK                 0x3fc00000
+#define DEFAULT_TILE_MASK              0xc0000000
+#define PPLL_DIV_SEL_MASK              0x00000300
+#define PPLL_RESET                     0x00000001
+#define PPLL_SLEEP                     0x00000002
+#define PPLL_ATOMIC_UPDATE_EN          0x00010000
+#define PPLL_REF_DIV_MASK              0x000003ff
+#define PPLL_FB3_DIV_MASK              0x000007ff
+#define PPLL_POST3_DIV_MASK            0x00070000
+#define PPLL_ATOMIC_UPDATE_R           0x00008000
+#define PPLL_ATOMIC_UPDATE_W           0x00008000
+#define PPLL_VGA_ATOMIC_UPDATE_EN      0x00020000
+#define R300_PPLL_REF_DIV_ACC_MASK     (0x3ff << 18)
+#define R300_PPLL_REF_DIV_ACC_SHIFT    18
+
+#define GUI_ACTIVE                     0x80000000
+
+
+#define MC_IND_INDEX                   0x01F8
+#define MC_IND_DATA                    0x01FC
+
+/* PAD_CTLR_STRENGTH */
+#define PAD_MANUAL_OVERRIDE            0x80000000
+
+/* pllCLK_PIN_CNTL */
+#define CLK_PIN_CNTL__OSC_EN_MASK                      0x00000001L
+#define CLK_PIN_CNTL__OSC_EN                           0x00000001L
+#define CLK_PIN_CNTL__XTL_LOW_GAIN_MASK                        0x00000004L
+#define CLK_PIN_CNTL__XTL_LOW_GAIN                     0x00000004L
+#define CLK_PIN_CNTL__DONT_USE_XTALIN_MASK             0x00000010L
+#define CLK_PIN_CNTL__DONT_USE_XTALIN                  0x00000010L
+#define CLK_PIN_CNTL__SLOW_CLOCK_SOURCE_MASK           0x00000020L
+#define CLK_PIN_CNTL__SLOW_CLOCK_SOURCE                        0x00000020L
+#define CLK_PIN_CNTL__CG_CLK_TO_OUTPIN_MASK            0x00000800L
+#define CLK_PIN_CNTL__CG_CLK_TO_OUTPIN                 0x00000800L
+#define CLK_PIN_CNTL__CG_COUNT_UP_TO_OUTPIN_MASK       0x00001000L
+#define CLK_PIN_CNTL__CG_COUNT_UP_TO_OUTPIN            0x00001000L
+#define CLK_PIN_CNTL__ACCESS_REGS_IN_SUSPEND_MASK      0x00002000L
+#define CLK_PIN_CNTL__ACCESS_REGS_IN_SUSPEND           0x00002000L
+#define CLK_PIN_CNTL__CG_SPARE_MASK                    0x00004000L
+#define CLK_PIN_CNTL__CG_SPARE                         0x00004000L
+#define CLK_PIN_CNTL__SCLK_DYN_START_CNTL_MASK         0x00008000L
+#define CLK_PIN_CNTL__SCLK_DYN_START_CNTL              0x00008000L
+#define CLK_PIN_CNTL__CP_CLK_RUNNING_MASK              0x00010000L
+#define CLK_PIN_CNTL__CP_CLK_RUNNING                   0x00010000L
+#define CLK_PIN_CNTL__CG_SPARE_RD_MASK                 0x00060000L
+#define CLK_PIN_CNTL__XTALIN_ALWAYS_ONb_MASK           0x00080000L
+#define CLK_PIN_CNTL__XTALIN_ALWAYS_ONb                        0x00080000L
+#define CLK_PIN_CNTL__PWRSEQ_DELAY_MASK                        0xff000000L
+
+/* pllCLK_PWRMGT_CNTL */
+#define CLK_PWRMGT_CNTL__MPLL_PWRMGT_OFF__SHIFT                0x00000000
+#define CLK_PWRMGT_CNTL__SPLL_PWRMGT_OFF__SHIFT                0x00000001
+#define CLK_PWRMGT_CNTL__PPLL_PWRMGT_OFF__SHIFT                0x00000002
+#define CLK_PWRMGT_CNTL__P2PLL_PWRMGT_OFF__SHIFT       0x00000003
+#define CLK_PWRMGT_CNTL__MCLK_TURNOFF__SHIFT           0x00000004
+#define CLK_PWRMGT_CNTL__SCLK_TURNOFF__SHIFT           0x00000005
+#define CLK_PWRMGT_CNTL__PCLK_TURNOFF__SHIFT           0x00000006
+#define CLK_PWRMGT_CNTL__P2CLK_TURNOFF__SHIFT          0x00000007
+#define CLK_PWRMGT_CNTL__MC_CH_MODE__SHIFT             0x00000008
+#define CLK_PWRMGT_CNTL__TEST_MODE__SHIFT              0x00000009
+#define CLK_PWRMGT_CNTL__GLOBAL_PMAN_EN__SHIFT         0x0000000a
+#define CLK_PWRMGT_CNTL__ENGINE_DYNCLK_MODE__SHIFT     0x0000000c
+#define CLK_PWRMGT_CNTL__ACTIVE_HILO_LAT__SHIFT                0x0000000d
+#define CLK_PWRMGT_CNTL__DISP_DYN_STOP_LAT__SHIFT      0x0000000f
+#define CLK_PWRMGT_CNTL__MC_BUSY__SHIFT                        0x00000010
+#define CLK_PWRMGT_CNTL__MC_INT_CNTL__SHIFT            0x00000011
+#define CLK_PWRMGT_CNTL__MC_SWITCH__SHIFT              0x00000012
+#define CLK_PWRMGT_CNTL__DLL_READY__SHIFT              0x00000013
+#define CLK_PWRMGT_CNTL__DISP_PM__SHIFT                        0x00000014
+#define CLK_PWRMGT_CNTL__DYN_STOP_MODE__SHIFT          0x00000015
+#define CLK_PWRMGT_CNTL__CG_NO1_DEBUG__SHIFT           0x00000018
+#define CLK_PWRMGT_CNTL__TVPLL_PWRMGT_OFF__SHIFT       0x0000001e
+#define CLK_PWRMGT_CNTL__TVCLK_TURNOFF__SHIFT          0x0000001f
+
+/* pllP2PLL_CNTL */
+#define P2PLL_CNTL__P2PLL_RESET_MASK                   0x00000001L
+#define P2PLL_CNTL__P2PLL_RESET                                0x00000001L
+#define P2PLL_CNTL__P2PLL_SLEEP_MASK                   0x00000002L
+#define P2PLL_CNTL__P2PLL_SLEEP                                0x00000002L
+#define P2PLL_CNTL__P2PLL_TST_EN_MASK                  0x00000004L
+#define P2PLL_CNTL__P2PLL_TST_EN                       0x00000004L
+#define P2PLL_CNTL__P2PLL_REFCLK_SEL_MASK              0x00000010L
+#define P2PLL_CNTL__P2PLL_REFCLK_SEL                   0x00000010L
+#define P2PLL_CNTL__P2PLL_FBCLK_SEL_MASK               0x00000020L
+#define P2PLL_CNTL__P2PLL_FBCLK_SEL                    0x00000020L
+#define P2PLL_CNTL__P2PLL_TCPOFF_MASK                  0x00000040L
+#define P2PLL_CNTL__P2PLL_TCPOFF                       0x00000040L
+#define P2PLL_CNTL__P2PLL_TVCOMAX_MASK                 0x00000080L
+#define P2PLL_CNTL__P2PLL_TVCOMAX                      0x00000080L
+#define P2PLL_CNTL__P2PLL_PCP_MASK                     0x00000700L
+#define P2PLL_CNTL__P2PLL_PVG_MASK                     0x00003800L
+#define P2PLL_CNTL__P2PLL_PDC_MASK                     0x0000c000L
+#define P2PLL_CNTL__P2PLL_ATOMIC_UPDATE_EN_MASK                0x00010000L
+#define P2PLL_CNTL__P2PLL_ATOMIC_UPDATE_EN             0x00010000L
+#define P2PLL_CNTL__P2PLL_ATOMIC_UPDATE_SYNC_MASK      0x00040000L
+#define P2PLL_CNTL__P2PLL_ATOMIC_UPDATE_SYNC           0x00040000L
+#define P2PLL_CNTL__P2PLL_DISABLE_AUTO_RESET_MASK      0x00080000L
+#define P2PLL_CNTL__P2PLL_DISABLE_AUTO_RESET           0x00080000L
+
+/* pllPIXCLKS_CNTL */
+#define PIXCLKS_CNTL__PIX2CLK_SRC_SEL__SHIFT           0x00000000
+#define PIXCLKS_CNTL__PIX2CLK_INVERT__SHIFT            0x00000004
+#define PIXCLKS_CNTL__PIX2CLK_SRC_INVERT__SHIFT                0x00000005
+#define PIXCLKS_CNTL__PIX2CLK_ALWAYS_ONb__SHIFT                0x00000006
+#define PIXCLKS_CNTL__PIX2CLK_DAC_ALWAYS_ONb__SHIFT    0x00000007
+#define PIXCLKS_CNTL__PIXCLK_TV_SRC_SEL__SHIFT         0x00000008
+#define PIXCLKS_CNTL__PIXCLK_BLEND_ALWAYS_ONb__SHIFT   0x0000000b
+#define PIXCLKS_CNTL__PIXCLK_GV_ALWAYS_ONb__SHIFT      0x0000000c
+#define PIXCLKS_CNTL__PIXCLK_DIG_TMDS_ALWAYS_ONb__SHIFT        0x0000000d
+#define PIXCLKS_CNTL__PIXCLK_LVDS_ALWAYS_ONb__SHIFT    0x0000000e
+#define PIXCLKS_CNTL__PIXCLK_TMDS_ALWAYS_ONb__SHIFT    0x0000000f
+
+
+/* pllPIXCLKS_CNTL */
+#define PIXCLKS_CNTL__PIX2CLK_SRC_SEL_MASK             0x00000003L
+#define PIXCLKS_CNTL__PIX2CLK_INVERT                   0x00000010L
+#define PIXCLKS_CNTL__PIX2CLK_SRC_INVERT               0x00000020L
+#define PIXCLKS_CNTL__PIX2CLK_ALWAYS_ONb               0x00000040L
+#define PIXCLKS_CNTL__PIX2CLK_DAC_ALWAYS_ONb           0x00000080L
+#define PIXCLKS_CNTL__PIXCLK_TV_SRC_SEL                        0x00000100L
+#define PIXCLKS_CNTL__PIXCLK_BLEND_ALWAYS_ONb          0x00000800L
+#define PIXCLKS_CNTL__PIXCLK_GV_ALWAYS_ONb             0x00001000L
+#define PIXCLKS_CNTL__PIXCLK_DIG_TMDS_ALWAYS_ONb       0x00002000L
+#define PIXCLKS_CNTL__PIXCLK_LVDS_ALWAYS_ONb           0x00004000L
+#define PIXCLKS_CNTL__PIXCLK_TMDS_ALWAYS_ONb           0x00008000L
+#define PIXCLKS_CNTL__DISP_TVOUT_PIXCLK_TV_ALWAYS_ONb  (1 << 9)
+#define PIXCLKS_CNTL__R300_DVOCLK_ALWAYS_ONb           (1 << 10)
+#define PIXCLKS_CNTL__R300_PIXCLK_DVO_ALWAYS_ONb       (1 << 13)
+#define PIXCLKS_CNTL__R300_PIXCLK_TRANS_ALWAYS_ONb     (1 << 16)
+#define PIXCLKS_CNTL__R300_PIXCLK_TVO_ALWAYS_ONb       (1 << 17)
+#define PIXCLKS_CNTL__R300_P2G2CLK_ALWAYS_ONb          (1 << 18)
+#define PIXCLKS_CNTL__R300_P2G2CLK_DAC_ALWAYS_ONb      (1 << 19)
+#define PIXCLKS_CNTL__R300_DISP_DAC_PIXCLK_DAC2_BLANK_OFF (1 << 23)
+
+
+/* pllP2PLL_DIV_0 */
+#define P2PLL_DIV_0__P2PLL_FB_DIV_MASK                 0x000007ffL
+#define P2PLL_DIV_0__P2PLL_ATOMIC_UPDATE_W_MASK                0x00008000L
+#define P2PLL_DIV_0__P2PLL_ATOMIC_UPDATE_W             0x00008000L
+#define P2PLL_DIV_0__P2PLL_ATOMIC_UPDATE_R_MASK                0x00008000L
+#define P2PLL_DIV_0__P2PLL_ATOMIC_UPDATE_R             0x00008000L
+#define P2PLL_DIV_0__P2PLL_POST_DIV_MASK               0x00070000L
+
+/* pllSCLK_CNTL */
+#define SCLK_CNTL__SCLK_SRC_SEL_MASK                   0x00000007L
+#define SCLK_CNTL__CP_MAX_DYN_STOP_LAT                 0x00000008L
+#define SCLK_CNTL__HDP_MAX_DYN_STOP_LAT                        0x00000010L
+#define SCLK_CNTL__TV_MAX_DYN_STOP_LAT                 0x00000020L
+#define SCLK_CNTL__E2_MAX_DYN_STOP_LAT                 0x00000040L
+#define SCLK_CNTL__SE_MAX_DYN_STOP_LAT                 0x00000080L
+#define SCLK_CNTL__IDCT_MAX_DYN_STOP_LAT               0x00000100L
+#define SCLK_CNTL__VIP_MAX_DYN_STOP_LAT                        0x00000200L
+#define SCLK_CNTL__RE_MAX_DYN_STOP_LAT                 0x00000400L
+#define SCLK_CNTL__PB_MAX_DYN_STOP_LAT                 0x00000800L
+#define SCLK_CNTL__TAM_MAX_DYN_STOP_LAT                        0x00001000L
+#define SCLK_CNTL__TDM_MAX_DYN_STOP_LAT                        0x00002000L
+#define SCLK_CNTL__RB_MAX_DYN_STOP_LAT                 0x00004000L
+#define SCLK_CNTL__DYN_STOP_LAT_MASK                   0x00007ff8
+#define SCLK_CNTL__FORCE_DISP2                         0x00008000L
+#define SCLK_CNTL__FORCE_CP                            0x00010000L
+#define SCLK_CNTL__FORCE_HDP                           0x00020000L
+#define SCLK_CNTL__FORCE_DISP1                         0x00040000L
+#define SCLK_CNTL__FORCE_TOP                           0x00080000L
+#define SCLK_CNTL__FORCE_E2                            0x00100000L
+#define SCLK_CNTL__FORCE_SE                            0x00200000L
+#define SCLK_CNTL__FORCE_IDCT                          0x00400000L
+#define SCLK_CNTL__FORCE_VIP                           0x00800000L
+#define SCLK_CNTL__FORCE_RE                            0x01000000L
+#define SCLK_CNTL__FORCE_PB                            0x02000000L
+#define SCLK_CNTL__FORCE_TAM                           0x04000000L
+#define SCLK_CNTL__FORCE_TDM                           0x08000000L
+#define SCLK_CNTL__FORCE_RB                            0x10000000L
+#define SCLK_CNTL__FORCE_TV_SCLK                       0x20000000L
+#define SCLK_CNTL__FORCE_SUBPIC                                0x40000000L
+#define SCLK_CNTL__FORCE_OV0                           0x80000000L
+#define SCLK_CNTL__R300_FORCE_VAP                      (1<<21)
+#define SCLK_CNTL__R300_FORCE_SR                       (1<<25)
+#define SCLK_CNTL__R300_FORCE_PX                       (1<<26)
+#define SCLK_CNTL__R300_FORCE_TX                       (1<<27)
+#define SCLK_CNTL__R300_FORCE_US                       (1<<28)
+#define SCLK_CNTL__R300_FORCE_SU                       (1<<30)
+#define SCLK_CNTL__FORCEON_MASK                                0xffff8000L
+
+/* pllSCLK_CNTL2 */
+#define SCLK_CNTL2__R300_TCL_MAX_DYN_STOP_LAT          (1<<10)
+#define SCLK_CNTL2__R300_GA_MAX_DYN_STOP_LAT           (1<<11)
+#define SCLK_CNTL2__R300_CBA_MAX_DYN_STOP_LAT          (1<<12)
+#define SCLK_CNTL2__R300_FORCE_TCL                     (1<<13)
+#define SCLK_CNTL2__R300_FORCE_CBA                     (1<<14)
+#define SCLK_CNTL2__R300_FORCE_GA                      (1<<15)
+
+/* SCLK_MORE_CNTL */
+#define SCLK_MORE_CNTL__DISPREGS_MAX_DYN_STOP_LAT      0x00000001L
+#define SCLK_MORE_CNTL__MC_GUI_MAX_DYN_STOP_LAT                0x00000002L
+#define SCLK_MORE_CNTL__MC_HOST_MAX_DYN_STOP_LAT       0x00000004L
+#define SCLK_MORE_CNTL__FORCE_DISPREGS                 0x00000100L
+#define SCLK_MORE_CNTL__FORCE_MC_GUI                   0x00000200L
+#define SCLK_MORE_CNTL__FORCE_MC_HOST                  0x00000400L
+#define SCLK_MORE_CNTL__STOP_SCLK_EN                   0x00001000L
+#define SCLK_MORE_CNTL__STOP_SCLK_A                    0x00002000L
+#define SCLK_MORE_CNTL__STOP_SCLK_B                    0x00004000L
+#define SCLK_MORE_CNTL__STOP_SCLK_C                    0x00008000L
+#define SCLK_MORE_CNTL__HALF_SPEED_SCLK                        0x00010000L
+#define SCLK_MORE_CNTL__IO_CG_VOLTAGE_DROP             0x00020000L
+#define SCLK_MORE_CNTL__TVFB_SOFT_RESET                        0x00040000L
+#define SCLK_MORE_CNTL__VOLTAGE_DROP_SYNC              0x00080000L
+#define SCLK_MORE_CNTL__IDLE_DELAY_HALF_SCLK           0x00400000L
+#define SCLK_MORE_CNTL__AGP_BUSY_HALF_SCLK             0x00800000L
+#define SCLK_MORE_CNTL__CG_SPARE_RD_C_MASK             0xff000000L
+#define SCLK_MORE_CNTL__FORCEON                                0x00000700L
+
+/* MCLK_CNTL */
+#define MCLK_CNTL__MCLKA_SRC_SEL_MASK                  0x00000007L
+#define MCLK_CNTL__YCLKA_SRC_SEL_MASK                  0x00000070L
+#define MCLK_CNTL__MCLKB_SRC_SEL_MASK                  0x00000700L
+#define MCLK_CNTL__YCLKB_SRC_SEL_MASK                  0x00007000L
+#define MCLK_CNTL__FORCE_MCLKA_MASK                    0x00010000L
+#define MCLK_CNTL__FORCE_MCLKA                         0x00010000L
+#define MCLK_CNTL__FORCE_MCLKB_MASK                    0x00020000L
+#define MCLK_CNTL__FORCE_MCLKB                         0x00020000L
+#define MCLK_CNTL__FORCE_YCLKA_MASK                    0x00040000L
+#define MCLK_CNTL__FORCE_YCLKA                         0x00040000L
+#define MCLK_CNTL__FORCE_YCLKB_MASK                    0x00080000L
+#define MCLK_CNTL__FORCE_YCLKB                         0x00080000L
+#define MCLK_CNTL__FORCE_MC_MASK                       0x00100000L
+#define MCLK_CNTL__FORCE_MC                            0x00100000L
+#define MCLK_CNTL__FORCE_AIC_MASK                      0x00200000L
+#define MCLK_CNTL__FORCE_AIC                           0x00200000L
+#define MCLK_CNTL__MRDCKA0_SOUTSEL_MASK                        0x03000000L
+#define MCLK_CNTL__MRDCKA1_SOUTSEL_MASK                        0x0c000000L
+#define MCLK_CNTL__MRDCKB0_SOUTSEL_MASK                        0x30000000L
+#define MCLK_CNTL__MRDCKB1_SOUTSEL_MASK                        0xc0000000L
+#define MCLK_CNTL__R300_DISABLE_MC_MCLKA               (1 << 21)
+#define MCLK_CNTL__R300_DISABLE_MC_MCLKB               (1 << 21)
+
+/* MCLK_MISC */
+#define MCLK_MISC__SCLK_SOURCED_FROM_MPLL_SEL_MASK     0x00000003L
+#define MCLK_MISC__MCLK_FROM_SPLL_DIV_SEL_MASK         0x00000004L
+#define MCLK_MISC__MCLK_FROM_SPLL_DIV_SEL              0x00000004L
+#define MCLK_MISC__ENABLE_SCLK_FROM_MPLL_MASK          0x00000008L
+#define MCLK_MISC__ENABLE_SCLK_FROM_MPLL               0x00000008L
+#define MCLK_MISC__MPLL_MODEA_MODEC_HW_SEL_EN_MASK     0x00000010L
+#define MCLK_MISC__MPLL_MODEA_MODEC_HW_SEL_EN          0x00000010L
+#define MCLK_MISC__DLL_READY_LAT_MASK                  0x00000100L
+#define MCLK_MISC__DLL_READY_LAT                       0x00000100L
+#define MCLK_MISC__MC_MCLK_MAX_DYN_STOP_LAT_MASK       0x00001000L
+#define MCLK_MISC__MC_MCLK_MAX_DYN_STOP_LAT            0x00001000L
+#define MCLK_MISC__IO_MCLK_MAX_DYN_STOP_LAT_MASK       0x00002000L
+#define MCLK_MISC__IO_MCLK_MAX_DYN_STOP_LAT            0x00002000L
+#define MCLK_MISC__MC_MCLK_DYN_ENABLE_MASK             0x00004000L
+#define MCLK_MISC__MC_MCLK_DYN_ENABLE                  0x00004000L
+#define MCLK_MISC__IO_MCLK_DYN_ENABLE_MASK             0x00008000L
+#define MCLK_MISC__IO_MCLK_DYN_ENABLE                  0x00008000L
+#define MCLK_MISC__CGM_CLK_TO_OUTPIN_MASK              0x00010000L
+#define MCLK_MISC__CGM_CLK_TO_OUTPIN                   0x00010000L
+#define MCLK_MISC__CLK_OR_COUNT_SEL_MASK               0x00020000L
+#define MCLK_MISC__CLK_OR_COUNT_SEL                    0x00020000L
+#define MCLK_MISC__EN_MCLK_TRISTATE_IN_SUSPEND_MASK    0x00040000L
+#define MCLK_MISC__EN_MCLK_TRISTATE_IN_SUSPEND         0x00040000L
+#define MCLK_MISC__CGM_SPARE_RD_MASK                   0x00300000L
+#define MCLK_MISC__CGM_SPARE_A_RD_MASK                 0x00c00000L
+#define MCLK_MISC__TCLK_TO_YCLKB_EN_MASK               0x01000000L
+#define MCLK_MISC__TCLK_TO_YCLKB_EN                    0x01000000L
+#define MCLK_MISC__CGM_SPARE_A_MASK                    0x0e000000L
+
+/* VCLK_ECP_CNTL */
+#define VCLK_ECP_CNTL__VCLK_SRC_SEL_MASK               0x00000003L
+#define VCLK_ECP_CNTL__VCLK_INVERT                     0x00000010L
+#define VCLK_ECP_CNTL__PIXCLK_SRC_INVERT               0x00000020L
+#define VCLK_ECP_CNTL__PIXCLK_ALWAYS_ONb               0x00000040L
+#define VCLK_ECP_CNTL__PIXCLK_DAC_ALWAYS_ONb           0x00000080L
+#define VCLK_ECP_CNTL__ECP_DIV_MASK                    0x00000300L
+#define VCLK_ECP_CNTL__ECP_FORCE_ON                    0x00040000L
+#define VCLK_ECP_CNTL__SUBCLK_FORCE_ON                 0x00080000L
+#define VCLK_ECP_CNTL__R300_DISP_DAC_PIXCLK_DAC_BLANK_OFF  (1<<23)
+
+/* PLL_PWRMGT_CNTL */
+#define PLL_PWRMGT_CNTL__MPLL_TURNOFF_MASK             0x00000001L
+#define PLL_PWRMGT_CNTL__MPLL_TURNOFF                  0x00000001L
+#define PLL_PWRMGT_CNTL__SPLL_TURNOFF_MASK             0x00000002L
+#define PLL_PWRMGT_CNTL__SPLL_TURNOFF                  0x00000002L
+#define PLL_PWRMGT_CNTL__PPLL_TURNOFF_MASK             0x00000004L
+#define PLL_PWRMGT_CNTL__PPLL_TURNOFF                  0x00000004L
+#define PLL_PWRMGT_CNTL__P2PLL_TURNOFF_MASK            0x00000008L
+#define PLL_PWRMGT_CNTL__P2PLL_TURNOFF                 0x00000008L
+#define PLL_PWRMGT_CNTL__TVPLL_TURNOFF_MASK            0x00000010L
+#define PLL_PWRMGT_CNTL__TVPLL_TURNOFF                 0x00000010L
+#define PLL_PWRMGT_CNTL__AGPCLK_DYN_STOP_LAT_MASK      0x000001e0L
+#define PLL_PWRMGT_CNTL__APM_POWER_STATE_MASK          0x00000600L
+#define PLL_PWRMGT_CNTL__APM_PWRSTATE_RD_MASK          0x00001800L
+#define PLL_PWRMGT_CNTL__PM_MODE_SEL_MASK              0x00002000L
+#define PLL_PWRMGT_CNTL__PM_MODE_SEL                   0x00002000L
+#define PLL_PWRMGT_CNTL__EN_PWRSEQ_DONE_COND_MASK      0x00004000L
+#define PLL_PWRMGT_CNTL__EN_PWRSEQ_DONE_COND           0x00004000L
+#define PLL_PWRMGT_CNTL__EN_DISP_PARKED_COND_MASK      0x00008000L
+#define PLL_PWRMGT_CNTL__EN_DISP_PARKED_COND           0x00008000L
+#define PLL_PWRMGT_CNTL__MOBILE_SU_MASK                        0x00010000L
+#define PLL_PWRMGT_CNTL__MOBILE_SU                     0x00010000L
+#define PLL_PWRMGT_CNTL__SU_SCLK_USE_BCLK_MASK         0x00020000L
+#define PLL_PWRMGT_CNTL__SU_SCLK_USE_BCLK              0x00020000L
+#define PLL_PWRMGT_CNTL__SU_MCLK_USE_BCLK_MASK         0x00040000L
+#define PLL_PWRMGT_CNTL__SU_MCLK_USE_BCLK              0x00040000L
+#define PLL_PWRMGT_CNTL__SU_SUSTAIN_DISABLE_MASK       0x00080000L
+#define PLL_PWRMGT_CNTL__SU_SUSTAIN_DISABLE            0x00080000L
+#define PLL_PWRMGT_CNTL__TCL_BYPASS_DISABLE_MASK       0x00100000L
+#define PLL_PWRMGT_CNTL__TCL_BYPASS_DISABLE            0x00100000L
+#define PLL_PWRMGT_CNTL__TCL_CLOCK_CTIVE_RD_MASK       0x00200000L
+#define PLL_PWRMGT_CNTL__TCL_CLOCK_ACTIVE_RD           0x00200000L
+#define PLL_PWRMGT_CNTL__CG_NO2_DEBUG_MASK             0xff000000L
+
+/* CLK_PWRMGT_CNTL */
+#define CLK_PWRMGT_CNTL__MPLL_PWRMGT_OFF_MASK          0x00000001L
+#define CLK_PWRMGT_CNTL__MPLL_PWRMGT_OFF               0x00000001L
+#define CLK_PWRMGT_CNTL__SPLL_PWRMGT_OFF_MASK          0x00000002L
+#define CLK_PWRMGT_CNTL__SPLL_PWRMGT_OFF               0x00000002L
+#define CLK_PWRMGT_CNTL__PPLL_PWRMGT_OFF_MASK          0x00000004L
+#define CLK_PWRMGT_CNTL__PPLL_PWRMGT_OFF               0x00000004L
+#define CLK_PWRMGT_CNTL__P2PLL_PWRMGT_OFF_MASK         0x00000008L
+#define CLK_PWRMGT_CNTL__P2PLL_PWRMGT_OFF              0x00000008L
+#define CLK_PWRMGT_CNTL__MCLK_TURNOFF_MASK             0x00000010L
+#define CLK_PWRMGT_CNTL__MCLK_TURNOFF                  0x00000010L
+#define CLK_PWRMGT_CNTL__SCLK_TURNOFF_MASK             0x00000020L
+#define CLK_PWRMGT_CNTL__SCLK_TURNOFF                  0x00000020L
+#define CLK_PWRMGT_CNTL__PCLK_TURNOFF_MASK             0x00000040L
+#define CLK_PWRMGT_CNTL__PCLK_TURNOFF                  0x00000040L
+#define CLK_PWRMGT_CNTL__P2CLK_TURNOFF_MASK            0x00000080L
+#define CLK_PWRMGT_CNTL__P2CLK_TURNOFF                 0x00000080L
+#define CLK_PWRMGT_CNTL__MC_CH_MODE_MASK               0x00000100L
+#define CLK_PWRMGT_CNTL__MC_CH_MODE                    0x00000100L
+#define CLK_PWRMGT_CNTL__TEST_MODE_MASK                        0x00000200L
+#define CLK_PWRMGT_CNTL__TEST_MODE                     0x00000200L
+#define CLK_PWRMGT_CNTL__GLOBAL_PMAN_EN_MASK           0x00000400L
+#define CLK_PWRMGT_CNTL__GLOBAL_PMAN_EN                        0x00000400L
+#define CLK_PWRMGT_CNTL__ENGINE_DYNCLK_MODE_MASK       0x00001000L
+#define CLK_PWRMGT_CNTL__ENGINE_DYNCLK_MODE            0x00001000L
+#define CLK_PWRMGT_CNTL__ACTIVE_HILO_LAT_MASK          0x00006000L
+#define CLK_PWRMGT_CNTL__DISP_DYN_STOP_LAT_MASK                0x00008000L
+#define CLK_PWRMGT_CNTL__DISP_DYN_STOP_LAT             0x00008000L
+#define CLK_PWRMGT_CNTL__MC_BUSY_MASK                  0x00010000L
+#define CLK_PWRMGT_CNTL__MC_BUSY                       0x00010000L
+#define CLK_PWRMGT_CNTL__MC_INT_CNTL_MASK              0x00020000L
+#define CLK_PWRMGT_CNTL__MC_INT_CNTL                   0x00020000L
+#define CLK_PWRMGT_CNTL__MC_SWITCH_MASK                        0x00040000L
+#define CLK_PWRMGT_CNTL__MC_SWITCH                     0x00040000L
+#define CLK_PWRMGT_CNTL__DLL_READY_MASK                        0x00080000L
+#define CLK_PWRMGT_CNTL__DLL_READY                     0x00080000L
+#define CLK_PWRMGT_CNTL__DISP_PM_MASK                  0x00100000L
+#define CLK_PWRMGT_CNTL__DISP_PM                       0x00100000L
+#define CLK_PWRMGT_CNTL__DYN_STOP_MODE_MASK            0x00e00000L
+#define CLK_PWRMGT_CNTL__CG_NO1_DEBUG_MASK             0x3f000000L
+#define CLK_PWRMGT_CNTL__TVPLL_PWRMGT_OFF_MASK         0x40000000L
+#define CLK_PWRMGT_CNTL__TVPLL_PWRMGT_OFF              0x40000000L
+#define CLK_PWRMGT_CNTL__TVCLK_TURNOFF_MASK            0x80000000L
+#define CLK_PWRMGT_CNTL__TVCLK_TURNOFF                 0x80000000L
+
+/* BUS_CNTL1 */
+#define BUS_CNTL1__PMI_IO_DISABLE_MASK                 0x00000001L
+#define BUS_CNTL1__PMI_IO_DISABLE                      0x00000001L
+#define BUS_CNTL1__PMI_MEM_DISABLE_MASK                        0x00000002L
+#define BUS_CNTL1__PMI_MEM_DISABLE                     0x00000002L
+#define BUS_CNTL1__PMI_BM_DISABLE_MASK                 0x00000004L
+#define BUS_CNTL1__PMI_BM_DISABLE                      0x00000004L
+#define BUS_CNTL1__PMI_INT_DISABLE_MASK                        0x00000008L
+#define BUS_CNTL1__PMI_INT_DISABLE                     0x00000008L
+#define BUS_CNTL1__BUS2_IMMEDIATE_PMI_DISABLE_MASK     0x00000020L
+#define BUS_CNTL1__BUS2_IMMEDIATE_PMI_DISABLE          0x00000020L
+#define BUS_CNTL1__BUS2_VGA_REG_COHERENCY_DIS_MASK     0x00000100L
+#define BUS_CNTL1__BUS2_VGA_REG_COHERENCY_DIS          0x00000100L
+#define BUS_CNTL1__BUS2_VGA_MEM_COHERENCY_DIS_MASK     0x00000200L
+#define BUS_CNTL1__BUS2_VGA_MEM_COHERENCY_DIS          0x00000200L
+#define BUS_CNTL1__BUS2_HDP_REG_COHERENCY_DIS_MASK     0x00000400L
+#define BUS_CNTL1__BUS2_HDP_REG_COHERENCY_DIS          0x00000400L
+#define BUS_CNTL1__BUS2_GUI_INITIATOR_COHERENCY_DIS_MASK 0x00000800L
+#define BUS_CNTL1__BUS2_GUI_INITIATOR_COHERENCY_DIS    0x00000800L
+#define BUS_CNTL1__MOBILE_PLATFORM_SEL_MASK            0x0c000000L
+#define BUS_CNTL1__SEND_SBA_LATENCY_MASK               0x70000000L
+#define BUS_CNTL1__AGPCLK_VALID_MASK                   0x80000000L
+#define BUS_CNTL1__AGPCLK_VALID                                0x80000000L
+
+/* BUS_CNTL1 */
+#define BUS_CNTL1__PMI_IO_DISABLE__SHIFT               0x00000000
+#define BUS_CNTL1__PMI_MEM_DISABLE__SHIFT              0x00000001
+#define BUS_CNTL1__PMI_BM_DISABLE__SHIFT               0x00000002
+#define BUS_CNTL1__PMI_INT_DISABLE__SHIFT              0x00000003
+#define BUS_CNTL1__BUS2_IMMEDIATE_PMI_DISABLE__SHIFT   0x00000005
+#define BUS_CNTL1__BUS2_VGA_REG_COHERENCY_DIS__SHIFT   0x00000008
+#define BUS_CNTL1__BUS2_VGA_MEM_COHERENCY_DIS__SHIFT   0x00000009
+#define BUS_CNTL1__BUS2_HDP_REG_COHERENCY_DIS__SHIFT   0x0000000a
+#define BUS_CNTL1__BUS2_GUI_INITIATOR_COHERENCY_DIS__SHIFT 0x0000000b
+#define BUS_CNTL1__MOBILE_PLATFORM_SEL__SHIFT          0x0000001a
+#define BUS_CNTL1__SEND_SBA_LATENCY__SHIFT             0x0000001c
+#define BUS_CNTL1__AGPCLK_VALID__SHIFT                 0x0000001f
+
+/* CRTC_OFFSET_CNTL */
+#define CRTC_OFFSET_CNTL__CRTC_TILE_LINE_MASK          0x0000000fL
+#define CRTC_OFFSET_CNTL__CRTC_TILE_LINE_RIGHT_MASK    0x000000f0L
+#define CRTC_OFFSET_CNTL__CRTC_TILE_EN_RIGHT_MASK      0x00004000L
+#define CRTC_OFFSET_CNTL__CRTC_TILE_EN_RIGHT           0x00004000L
+#define CRTC_OFFSET_CNTL__CRTC_TILE_EN_MASK            0x00008000L
+#define CRTC_OFFSET_CNTL__CRTC_TILE_EN                 0x00008000L
+#define CRTC_OFFSET_CNTL__CRTC_OFFSET_FLIP_CNTL_MASK   0x00010000L
+#define CRTC_OFFSET_CNTL__CRTC_OFFSET_FLIP_CNTL                0x00010000L
+#define CRTC_OFFSET_CNTL__CRTC_STEREO_OFFSET_EN_MASK   0x00020000L
+#define CRTC_OFFSET_CNTL__CRTC_STEREO_OFFSET_EN                0x00020000L
+#define CRTC_OFFSET_CNTL__CRTC_STEREO_SYNC_EN_MASK     0x000c0000L
+#define CRTC_OFFSET_CNTL__CRTC_STEREO_SYNC_OUT_EN_MASK 0x00100000L
+#define CRTC_OFFSET_CNTL__CRTC_STEREO_SYNC_OUT_EN      0x00100000L
+#define CRTC_OFFSET_CNTL__CRTC_STEREO_SYNC_MASK                0x00200000L
+#define CRTC_OFFSET_CNTL__CRTC_STEREO_SYNC             0x00200000L
+#define CRTC_OFFSET_CNTL__CRTC_GUI_TRIG_OFFSET_LEFT_EN_MASK 0x10000000L
+#define CRTC_OFFSET_CNTL__CRTC_GUI_TRIG_OFFSET_LEFT_EN 0x10000000L
+#define CRTC_OFFSET_CNTL__CRTC_GUI_TRIG_OFFSET_RIGHT_EN_MASK 0x20000000L
+#define CRTC_OFFSET_CNTL__CRTC_GUI_TRIG_OFFSET_RIGHT_EN        0x20000000L
+#define CRTC_OFFSET_CNTL__CRTC_GUI_TRIG_OFFSET_MASK    0x40000000L
+#define CRTC_OFFSET_CNTL__CRTC_GUI_TRIG_OFFSET         0x40000000L
+#define CRTC_OFFSET_CNTL__CRTC_OFFSET_LOCK_MASK                0x80000000L
+#define CRTC_OFFSET_CNTL__CRTC_OFFSET_LOCK             0x80000000L
+
+/* CRTC_GEN_CNTL */
+#define CRTC_GEN_CNTL__CRTC_DBL_SCAN_EN_MASK           0x00000001L
+#define CRTC_GEN_CNTL__CRTC_DBL_SCAN_EN                        0x00000001L
+#define CRTC_GEN_CNTL__CRTC_INTERLACE_EN_MASK          0x00000002L
+#define CRTC_GEN_CNTL__CRTC_INTERLACE_EN               0x00000002L
+#define CRTC_GEN_CNTL__CRTC_C_SYNC_EN_MASK             0x00000010L
+#define CRTC_GEN_CNTL__CRTC_C_SYNC_EN                  0x00000010L
+#define CRTC_GEN_CNTL__CRTC_PIX_WIDTH_MASK             0x00000f00L
+#define CRTC_GEN_CNTL__CRTC_ICON_EN_MASK               0x00008000L
+#define CRTC_GEN_CNTL__CRTC_ICON_EN                    0x00008000L
+#define CRTC_GEN_CNTL__CRTC_CUR_EN_MASK                        0x00010000L
+#define CRTC_GEN_CNTL__CRTC_CUR_EN                     0x00010000L
+#define CRTC_GEN_CNTL__CRTC_VSTAT_MODE_MASK            0x00060000L
+#define CRTC_GEN_CNTL__CRTC_CUR_MODE_MASK              0x00700000L
+#define CRTC_GEN_CNTL__CRTC_EXT_DISP_EN_MASK           0x01000000L
+#define CRTC_GEN_CNTL__CRTC_EXT_DISP_EN                        0x01000000L
+#define CRTC_GEN_CNTL__CRTC_EN_MASK                    0x02000000L
+#define CRTC_GEN_CNTL__CRTC_EN                         0x02000000L
+#define CRTC_GEN_CNTL__CRTC_DISP_REQ_EN_B_MASK         0x04000000L
+#define CRTC_GEN_CNTL__CRTC_DISP_REQ_EN_B              0x04000000L
+
+/* CRTC2_GEN_CNTL */
+#define CRTC2_GEN_CNTL__CRTC2_DBL_SCAN_EN_MASK         0x00000001L
+#define CRTC2_GEN_CNTL__CRTC2_DBL_SCAN_EN              0x00000001L
+#define CRTC2_GEN_CNTL__CRTC2_INTERLACE_EN_MASK                0x00000002L
+#define CRTC2_GEN_CNTL__CRTC2_INTERLACE_EN             0x00000002L
+#define CRTC2_GEN_CNTL__CRTC2_SYNC_TRISTATE_MASK       0x00000010L
+#define CRTC2_GEN_CNTL__CRTC2_SYNC_TRISTATE            0x00000010L
+#define CRTC2_GEN_CNTL__CRTC2_HSYNC_TRISTATE_MASK      0x00000020L
+#define CRTC2_GEN_CNTL__CRTC2_HSYNC_TRISTATE           0x00000020L
+#define CRTC2_GEN_CNTL__CRTC2_VSYNC_TRISTATE_MASK      0x00000040L
+#define CRTC2_GEN_CNTL__CRTC2_VSYNC_TRISTATE           0x00000040L
+#define CRTC2_GEN_CNTL__CRT2_ON_MASK                   0x00000080L
+#define CRTC2_GEN_CNTL__CRT2_ON                                0x00000080L
+#define CRTC2_GEN_CNTL__CRTC2_PIX_WIDTH_MASK           0x00000f00L
+#define CRTC2_GEN_CNTL__CRTC2_ICON_EN_MASK             0x00008000L
+#define CRTC2_GEN_CNTL__CRTC2_ICON_EN                  0x00008000L
+#define CRTC2_GEN_CNTL__CRTC2_CUR_EN_MASK              0x00010000L
+#define CRTC2_GEN_CNTL__CRTC2_CUR_EN                   0x00010000L
+#define CRTC2_GEN_CNTL__CRTC2_CUR_MODE_MASK            0x00700000L
+#define CRTC2_GEN_CNTL__CRTC2_DISPLAY_DIS_MASK         0x00800000L
+#define CRTC2_GEN_CNTL__CRTC2_DISPLAY_DIS              0x00800000L
+#define CRTC2_GEN_CNTL__CRTC2_EN_MASK                  0x02000000L
+#define CRTC2_GEN_CNTL__CRTC2_EN                       0x02000000L
+#define CRTC2_GEN_CNTL__CRTC2_DISP_REQ_EN_B_MASK       0x04000000L
+#define CRTC2_GEN_CNTL__CRTC2_DISP_REQ_EN_B            0x04000000L
+#define CRTC2_GEN_CNTL__CRTC2_C_SYNC_EN_MASK           0x08000000L
+#define CRTC2_GEN_CNTL__CRTC2_C_SYNC_EN                        0x08000000L
+#define CRTC2_GEN_CNTL__CRTC2_HSYNC_DIS_MASK           0x10000000L
+#define CRTC2_GEN_CNTL__CRTC2_HSYNC_DIS                        0x10000000L
+#define CRTC2_GEN_CNTL__CRTC2_VSYNC_DIS_MASK           0x20000000L
+#define CRTC2_GEN_CNTL__CRTC2_VSYNC_DIS                        0x20000000L
+
+/* AGP_CNTL */
+#define AGP_CNTL__MAX_IDLE_CLK_MASK                    0x000000ffL
+#define AGP_CNTL__HOLD_RD_FIFO_MASK                    0x00000100L
+#define AGP_CNTL__HOLD_RD_FIFO                         0x00000100L
+#define AGP_CNTL__HOLD_RQ_FIFO_MASK                    0x00000200L
+#define AGP_CNTL__HOLD_RQ_FIFO                         0x00000200L
+#define AGP_CNTL__EN_2X_STBB_MASK                      0x00000400L
+#define AGP_CNTL__EN_2X_STBB                           0x00000400L
+#define AGP_CNTL__FORCE_FULL_SBA_MASK                  0x00000800L
+#define AGP_CNTL__FORCE_FULL_SBA                       0x00000800L
+#define AGP_CNTL__SBA_DIS_MASK                         0x00001000L
+#define AGP_CNTL__SBA_DIS                              0x00001000L
+#define AGP_CNTL__AGP_REV_ID_MASK                      0x00002000L
+#define AGP_CNTL__AGP_REV_ID                           0x00002000L
+#define AGP_CNTL__REG_CRIPPLE_AGP4X_MASK               0x00004000L
+#define AGP_CNTL__REG_CRIPPLE_AGP4X                    0x00004000L
+#define AGP_CNTL__REG_CRIPPLE_AGP2X4X_MASK             0x00008000L
+#define AGP_CNTL__REG_CRIPPLE_AGP2X4X                  0x00008000L
+#define AGP_CNTL__FORCE_INT_VREF_MASK                  0x00010000L
+#define AGP_CNTL__FORCE_INT_VREF                       0x00010000L
+#define AGP_CNTL__PENDING_SLOTS_VAL_MASK               0x00060000L
+#define AGP_CNTL__PENDING_SLOTS_SEL_MASK               0x00080000L
+#define AGP_CNTL__PENDING_SLOTS_SEL                    0x00080000L
+#define AGP_CNTL__EN_EXTENDED_AD_STB_2X_MASK           0x00100000L
+#define AGP_CNTL__EN_EXTENDED_AD_STB_2X                        0x00100000L
+#define AGP_CNTL__DIS_QUEUED_GNT_FIX_MASK              0x00200000L
+#define AGP_CNTL__DIS_QUEUED_GNT_FIX                   0x00200000L
+#define AGP_CNTL__EN_RDATA2X4X_MULTIRESET_MASK         0x00400000L
+#define AGP_CNTL__EN_RDATA2X4X_MULTIRESET              0x00400000L
+#define AGP_CNTL__EN_RBFCALM_MASK                      0x00800000L
+#define AGP_CNTL__EN_RBFCALM                           0x00800000L
+#define AGP_CNTL__FORCE_EXT_VREF_MASK                  0x01000000L
+#define AGP_CNTL__FORCE_EXT_VREF                       0x01000000L
+#define AGP_CNTL__DIS_RBF_MASK                         0x02000000L
+#define AGP_CNTL__DIS_RBF                              0x02000000L
+#define AGP_CNTL__DELAY_FIRST_SBA_EN_MASK              0x04000000L
+#define AGP_CNTL__DELAY_FIRST_SBA_EN                   0x04000000L
+#define AGP_CNTL__DELAY_FIRST_SBA_VAL_MASK             0x38000000L
+#define AGP_CNTL__AGP_MISC_MASK                                0xc0000000L
+
+/* AGP_CNTL */
+#define AGP_CNTL__MAX_IDLE_CLK__SHIFT                  0x00000000
+#define AGP_CNTL__HOLD_RD_FIFO__SHIFT                  0x00000008
+#define AGP_CNTL__HOLD_RQ_FIFO__SHIFT                  0x00000009
+#define AGP_CNTL__EN_2X_STBB__SHIFT                    0x0000000a
+#define AGP_CNTL__FORCE_FULL_SBA__SHIFT                        0x0000000b
+#define AGP_CNTL__SBA_DIS__SHIFT                       0x0000000c
+#define AGP_CNTL__AGP_REV_ID__SHIFT                    0x0000000d
+#define AGP_CNTL__REG_CRIPPLE_AGP4X__SHIFT             0x0000000e
+#define AGP_CNTL__REG_CRIPPLE_AGP2X4X__SHIFT           0x0000000f
+#define AGP_CNTL__FORCE_INT_VREF__SHIFT                        0x00000010
+#define AGP_CNTL__PENDING_SLOTS_VAL__SHIFT             0x00000011
+#define AGP_CNTL__PENDING_SLOTS_SEL__SHIFT             0x00000013
+#define AGP_CNTL__EN_EXTENDED_AD_STB_2X__SHIFT         0x00000014
+#define AGP_CNTL__DIS_QUEUED_GNT_FIX__SHIFT            0x00000015
+#define AGP_CNTL__EN_RDATA2X4X_MULTIRESET__SHIFT       0x00000016
+#define AGP_CNTL__EN_RBFCALM__SHIFT                    0x00000017
+#define AGP_CNTL__FORCE_EXT_VREF__SHIFT                        0x00000018
+#define AGP_CNTL__DIS_RBF__SHIFT                       0x00000019
+#define AGP_CNTL__DELAY_FIRST_SBA_EN__SHIFT            0x0000001a
+#define AGP_CNTL__DELAY_FIRST_SBA_VAL__SHIFT           0x0000001b
+#define AGP_CNTL__AGP_MISC__SHIFT                      0x0000001e
+
+/* DISP_MISC_CNTL */
+#define DISP_MISC_CNTL__SOFT_RESET_GRPH_PP_MASK                0x00000001L
+#define DISP_MISC_CNTL__SOFT_RESET_GRPH_PP             0x00000001L
+#define DISP_MISC_CNTL__SOFT_RESET_SUBPIC_PP_MASK      0x00000002L
+#define DISP_MISC_CNTL__SOFT_RESET_SUBPIC_PP           0x00000002L
+#define DISP_MISC_CNTL__SOFT_RESET_OV0_PP_MASK         0x00000004L
+#define DISP_MISC_CNTL__SOFT_RESET_OV0_PP              0x00000004L
+#define DISP_MISC_CNTL__SOFT_RESET_GRPH_SCLK_MASK      0x00000010L
+#define DISP_MISC_CNTL__SOFT_RESET_GRPH_SCLK           0x00000010L
+#define DISP_MISC_CNTL__SOFT_RESET_SUBPIC_SCLK_MASK    0x00000020L
+#define DISP_MISC_CNTL__SOFT_RESET_SUBPIC_SCLK         0x00000020L
+#define DISP_MISC_CNTL__SOFT_RESET_OV0_SCLK_MASK       0x00000040L
+#define DISP_MISC_CNTL__SOFT_RESET_OV0_SCLK            0x00000040L
+#define DISP_MISC_CNTL__SYNC_STRENGTH_MASK             0x00000300L
+#define DISP_MISC_CNTL__SYNC_PAD_FLOP_EN_MASK          0x00000400L
+#define DISP_MISC_CNTL__SYNC_PAD_FLOP_EN               0x00000400L
+#define DISP_MISC_CNTL__SOFT_RESET_GRPH2_PP_MASK       0x00001000L
+#define DISP_MISC_CNTL__SOFT_RESET_GRPH2_PP            0x00001000L
+#define DISP_MISC_CNTL__SOFT_RESET_GRPH2_SCLK_MASK     0x00008000L
+#define DISP_MISC_CNTL__SOFT_RESET_GRPH2_SCLK          0x00008000L
+#define DISP_MISC_CNTL__SOFT_RESET_LVDS_MASK           0x00010000L
+#define DISP_MISC_CNTL__SOFT_RESET_LVDS                        0x00010000L
+#define DISP_MISC_CNTL__SOFT_RESET_TMDS_MASK           0x00020000L
+#define DISP_MISC_CNTL__SOFT_RESET_TMDS                        0x00020000L
+#define DISP_MISC_CNTL__SOFT_RESET_DIG_TMDS_MASK       0x00040000L
+#define DISP_MISC_CNTL__SOFT_RESET_DIG_TMDS            0x00040000L
+#define DISP_MISC_CNTL__SOFT_RESET_TV_MASK             0x00080000L
+#define DISP_MISC_CNTL__SOFT_RESET_TV                  0x00080000L
+#define DISP_MISC_CNTL__PALETTE2_MEM_RD_MARGIN_MASK    0x00f00000L
+#define DISP_MISC_CNTL__PALETTE_MEM_RD_MARGIN_MASK     0x0f000000L
+#define DISP_MISC_CNTL__RMX_BUF_MEM_RD_MARGIN_MASK     0xf0000000L
+
+/* DISP_PWR_MAN */
+#define DISP_PWR_MAN__DISP_PWR_MAN_D3_CRTC_EN_MASK     0x00000001L
+#define DISP_PWR_MAN__DISP_PWR_MAN_D3_CRTC_EN          0x00000001L
+#define DISP_PWR_MAN__DISP2_PWR_MAN_D3_CRTC2_EN_MASK   0x00000010L
+#define DISP_PWR_MAN__DISP2_PWR_MAN_D3_CRTC2_EN                0x00000010L
+#define DISP_PWR_MAN__DISP_PWR_MAN_DPMS_MASK           0x00000300L
+#define DISP_PWR_MAN__DISP_D3_RST_MASK                 0x00010000L
+#define DISP_PWR_MAN__DISP_D3_RST                      0x00010000L
+#define DISP_PWR_MAN__DISP_D3_REG_RST_MASK             0x00020000L
+#define DISP_PWR_MAN__DISP_D3_REG_RST                  0x00020000L
+#define DISP_PWR_MAN__DISP_D3_GRPH_RST_MASK            0x00040000L
+#define DISP_PWR_MAN__DISP_D3_GRPH_RST                 0x00040000L
+#define DISP_PWR_MAN__DISP_D3_SUBPIC_RST_MASK          0x00080000L
+#define DISP_PWR_MAN__DISP_D3_SUBPIC_RST               0x00080000L
+#define DISP_PWR_MAN__DISP_D3_OV0_RST_MASK             0x00100000L
+#define DISP_PWR_MAN__DISP_D3_OV0_RST                  0x00100000L
+#define DISP_PWR_MAN__DISP_D1D2_GRPH_RST_MASK          0x00200000L
+#define DISP_PWR_MAN__DISP_D1D2_GRPH_RST               0x00200000L
+#define DISP_PWR_MAN__DISP_D1D2_SUBPIC_RST_MASK                0x00400000L
+#define DISP_PWR_MAN__DISP_D1D2_SUBPIC_RST             0x00400000L
+#define DISP_PWR_MAN__DISP_D1D2_OV0_RST_MASK           0x00800000L
+#define DISP_PWR_MAN__DISP_D1D2_OV0_RST                        0x00800000L
+#define DISP_PWR_MAN__DIG_TMDS_ENABLE_RST_MASK         0x01000000L
+#define DISP_PWR_MAN__DIG_TMDS_ENABLE_RST              0x01000000L
+#define DISP_PWR_MAN__TV_ENABLE_RST_MASK               0x02000000L
+#define DISP_PWR_MAN__TV_ENABLE_RST                    0x02000000L
+#define DISP_PWR_MAN__AUTO_PWRUP_EN_MASK               0x04000000L
+#define DISP_PWR_MAN__AUTO_PWRUP_EN                    0x04000000L
+
+/* MC_IND_INDEX */
+#define MC_IND_INDEX__MC_IND_ADDR_MASK                 0x0000001fL
+#define MC_IND_INDEX__MC_IND_WR_EN_MASK                        0x00000100L
+#define MC_IND_INDEX__MC_IND_WR_EN                     0x00000100L
+
+/* MC_IND_DATA */
+#define MC_IND_DATA__MC_IND_DATA_MASK                  0xffffffffL
+
+/* MC_CHP_IO_CNTL_A1 */
+#define MC_CHP_IO_CNTL_A1__MEM_SLEWN_CKA__SHIFT                0x00000000
+#define MC_CHP_IO_CNTL_A1__MEM_SLEWN_AA__SHIFT         0x00000001
+#define MC_CHP_IO_CNTL_A1__MEM_SLEWN_DQMA__SHIFT       0x00000002
+#define MC_CHP_IO_CNTL_A1__MEM_SLEWN_DQSA__SHIFT       0x00000003
+#define MC_CHP_IO_CNTL_A1__MEM_SLEWP_CKA__SHIFT                0x00000004
+#define MC_CHP_IO_CNTL_A1__MEM_SLEWP_AA__SHIFT         0x00000005
+#define MC_CHP_IO_CNTL_A1__MEM_SLEWP_DQMA__SHIFT       0x00000006
+#define MC_CHP_IO_CNTL_A1__MEM_SLEWP_DQSA__SHIFT       0x00000007
+#define MC_CHP_IO_CNTL_A1__MEM_PREAMP_AA__SHIFT                0x00000008
+#define MC_CHP_IO_CNTL_A1__MEM_PREAMP_DQMA__SHIFT      0x00000009
+#define MC_CHP_IO_CNTL_A1__MEM_PREAMP_DQSA__SHIFT      0x0000000a
+#define MC_CHP_IO_CNTL_A1__MEM_IO_MODEA__SHIFT         0x0000000c
+#define MC_CHP_IO_CNTL_A1__MEM_REC_CKA__SHIFT          0x0000000e
+#define MC_CHP_IO_CNTL_A1__MEM_REC_AA__SHIFT           0x00000010
+#define MC_CHP_IO_CNTL_A1__MEM_REC_DQMA__SHIFT         0x00000012
+#define MC_CHP_IO_CNTL_A1__MEM_REC_DQSA__SHIFT         0x00000014
+#define MC_CHP_IO_CNTL_A1__MEM_SYNC_PHASEA__SHIFT      0x00000016
+#define MC_CHP_IO_CNTL_A1__MEM_SYNC_CENTERA__SHIFT     0x00000017
+#define MC_CHP_IO_CNTL_A1__MEM_SYNC_ENA__SHIFT         0x00000018
+#define MC_CHP_IO_CNTL_A1__MEM_CLK_SELA__SHIFT         0x0000001a
+#define MC_CHP_IO_CNTL_A1__MEM_CLK_INVA__SHIFT         0x0000001c
+#define MC_CHP_IO_CNTL_A1__MEM_DATA_ENIMP_A__SHIFT     0x0000001e
+#define MC_CHP_IO_CNTL_A1__MEM_CNTL_ENIMP_A__SHIFT     0x0000001f
+
+/* MC_CHP_IO_CNTL_B1 */
+#define MC_CHP_IO_CNTL_B1__MEM_SLEWN_CKB__SHIFT                0x00000000
+#define MC_CHP_IO_CNTL_B1__MEM_SLEWN_AB__SHIFT         0x00000001
+#define MC_CHP_IO_CNTL_B1__MEM_SLEWN_DQMB__SHIFT       0x00000002
+#define MC_CHP_IO_CNTL_B1__MEM_SLEWN_DQSB__SHIFT       0x00000003
+#define MC_CHP_IO_CNTL_B1__MEM_SLEWP_CKB__SHIFT                0x00000004
+#define MC_CHP_IO_CNTL_B1__MEM_SLEWP_AB__SHIFT         0x00000005
+#define MC_CHP_IO_CNTL_B1__MEM_SLEWP_DQMB__SHIFT       0x00000006
+#define MC_CHP_IO_CNTL_B1__MEM_SLEWP_DQSB__SHIFT       0x00000007
+#define MC_CHP_IO_CNTL_B1__MEM_PREAMP_AB__SHIFT                0x00000008
+#define MC_CHP_IO_CNTL_B1__MEM_PREAMP_DQMB__SHIFT      0x00000009
+#define MC_CHP_IO_CNTL_B1__MEM_PREAMP_DQSB__SHIFT      0x0000000a
+#define MC_CHP_IO_CNTL_B1__MEM_IO_MODEB__SHIFT         0x0000000c
+#define MC_CHP_IO_CNTL_B1__MEM_REC_CKB__SHIFT          0x0000000e
+#define MC_CHP_IO_CNTL_B1__MEM_REC_AB__SHIFT           0x00000010
+#define MC_CHP_IO_CNTL_B1__MEM_REC_DQMB__SHIFT         0x00000012
+#define MC_CHP_IO_CNTL_B1__MEM_REC_DQSB__SHIFT         0x00000014
+#define MC_CHP_IO_CNTL_B1__MEM_SYNC_PHASEB__SHIFT      0x00000016
+#define MC_CHP_IO_CNTL_B1__MEM_SYNC_CENTERB__SHIFT     0x00000017
+#define MC_CHP_IO_CNTL_B1__MEM_SYNC_ENB__SHIFT         0x00000018
+#define MC_CHP_IO_CNTL_B1__MEM_CLK_SELB__SHIFT         0x0000001a
+#define MC_CHP_IO_CNTL_B1__MEM_CLK_INVB__SHIFT         0x0000001c
+#define MC_CHP_IO_CNTL_B1__MEM_DATA_ENIMP_B__SHIFT     0x0000001e
+#define MC_CHP_IO_CNTL_B1__MEM_CNTL_ENIMP_B__SHIFT     0x0000001f
+
+/* MC_CHP_IO_CNTL_A1 */
+#define MC_CHP_IO_CNTL_A1__MEM_SLEWN_CKA_MASK          0x00000001L
+#define MC_CHP_IO_CNTL_A1__MEM_SLEWN_CKA               0x00000001L
+#define MC_CHP_IO_CNTL_A1__MEM_SLEWN_AA_MASK           0x00000002L
+#define MC_CHP_IO_CNTL_A1__MEM_SLEWN_AA                        0x00000002L
+#define MC_CHP_IO_CNTL_A1__MEM_SLEWN_DQMA_MASK         0x00000004L
+#define MC_CHP_IO_CNTL_A1__MEM_SLEWN_DQMA              0x00000004L
+#define MC_CHP_IO_CNTL_A1__MEM_SLEWN_DQSA_MASK         0x00000008L
+#define MC_CHP_IO_CNTL_A1__MEM_SLEWN_DQSA              0x00000008L
+#define MC_CHP_IO_CNTL_A1__MEM_SLEWP_CKA_MASK          0x00000010L
+#define MC_CHP_IO_CNTL_A1__MEM_SLEWP_CKA               0x00000010L
+#define MC_CHP_IO_CNTL_A1__MEM_SLEWP_AA_MASK           0x00000020L
+#define MC_CHP_IO_CNTL_A1__MEM_SLEWP_AA                        0x00000020L
+#define MC_CHP_IO_CNTL_A1__MEM_SLEWP_DQMA_MASK         0x00000040L
+#define MC_CHP_IO_CNTL_A1__MEM_SLEWP_DQMA              0x00000040L
+#define MC_CHP_IO_CNTL_A1__MEM_SLEWP_DQSA_MASK         0x00000080L
+#define MC_CHP_IO_CNTL_A1__MEM_SLEWP_DQSA              0x00000080L
+#define MC_CHP_IO_CNTL_A1__MEM_PREAMP_AA_MASK          0x00000100L
+#define MC_CHP_IO_CNTL_A1__MEM_PREAMP_AA               0x00000100L
+#define MC_CHP_IO_CNTL_A1__MEM_PREAMP_DQMA_MASK                0x00000200L
+#define MC_CHP_IO_CNTL_A1__MEM_PREAMP_DQMA             0x00000200L
+#define MC_CHP_IO_CNTL_A1__MEM_PREAMP_DQSA_MASK                0x00000400L
+#define MC_CHP_IO_CNTL_A1__MEM_PREAMP_DQSA             0x00000400L
+#define MC_CHP_IO_CNTL_A1__MEM_IO_MODEA_MASK           0x00003000L
+#define MC_CHP_IO_CNTL_A1__MEM_REC_CKA_MASK            0x0000c000L
+#define MC_CHP_IO_CNTL_A1__MEM_REC_AA_MASK             0x00030000L
+#define MC_CHP_IO_CNTL_A1__MEM_REC_DQMA_MASK           0x000c0000L
+#define MC_CHP_IO_CNTL_A1__MEM_REC_DQSA_MASK           0x00300000L
+#define MC_CHP_IO_CNTL_A1__MEM_SYNC_PHASEA_MASK                0x00400000L
+#define MC_CHP_IO_CNTL_A1__MEM_SYNC_PHASEA             0x00400000L
+#define MC_CHP_IO_CNTL_A1__MEM_SYNC_CENTERA_MASK       0x00800000L
+#define MC_CHP_IO_CNTL_A1__MEM_SYNC_CENTERA            0x00800000L
+#define MC_CHP_IO_CNTL_A1__MEM_SYNC_ENA_MASK           0x03000000L
+#define MC_CHP_IO_CNTL_A1__MEM_CLK_SELA_MASK           0x0c000000L
+#define MC_CHP_IO_CNTL_A1__MEM_CLK_INVA_MASK           0x10000000L
+#define MC_CHP_IO_CNTL_A1__MEM_CLK_INVA                        0x10000000L
+#define MC_CHP_IO_CNTL_A1__MEM_DATA_ENIMP_A_MASK       0x40000000L
+#define MC_CHP_IO_CNTL_A1__MEM_DATA_ENIMP_A            0x40000000L
+#define MC_CHP_IO_CNTL_A1__MEM_CNTL_ENIMP_A_MASK       0x80000000L
+#define MC_CHP_IO_CNTL_A1__MEM_CNTL_ENIMP_A            0x80000000L
+
+/* MC_CHP_IO_CNTL_B1 */
+#define MC_CHP_IO_CNTL_B1__MEM_SLEWN_CKB_MASK          0x00000001L
+#define MC_CHP_IO_CNTL_B1__MEM_SLEWN_CKB               0x00000001L
+#define MC_CHP_IO_CNTL_B1__MEM_SLEWN_AB_MASK           0x00000002L
+#define MC_CHP_IO_CNTL_B1__MEM_SLEWN_AB                        0x00000002L
+#define MC_CHP_IO_CNTL_B1__MEM_SLEWN_DQMB_MASK         0x00000004L
+#define MC_CHP_IO_CNTL_B1__MEM_SLEWN_DQMB              0x00000004L
+#define MC_CHP_IO_CNTL_B1__MEM_SLEWN_DQSB_MASK         0x00000008L
+#define MC_CHP_IO_CNTL_B1__MEM_SLEWN_DQSB              0x00000008L
+#define MC_CHP_IO_CNTL_B1__MEM_SLEWP_CKB_MASK          0x00000010L
+#define MC_CHP_IO_CNTL_B1__MEM_SLEWP_CKB               0x00000010L
+#define MC_CHP_IO_CNTL_B1__MEM_SLEWP_AB_MASK           0x00000020L
+#define MC_CHP_IO_CNTL_B1__MEM_SLEWP_AB                        0x00000020L
+#define MC_CHP_IO_CNTL_B1__MEM_SLEWP_DQMB_MASK         0x00000040L
+#define MC_CHP_IO_CNTL_B1__MEM_SLEWP_DQMB              0x00000040L
+#define MC_CHP_IO_CNTL_B1__MEM_SLEWP_DQSB_MASK         0x00000080L
+#define MC_CHP_IO_CNTL_B1__MEM_SLEWP_DQSB              0x00000080L
+#define MC_CHP_IO_CNTL_B1__MEM_PREAMP_AB_MASK          0x00000100L
+#define MC_CHP_IO_CNTL_B1__MEM_PREAMP_AB               0x00000100L
+#define MC_CHP_IO_CNTL_B1__MEM_PREAMP_DQMB_MASK                0x00000200L
+#define MC_CHP_IO_CNTL_B1__MEM_PREAMP_DQMB             0x00000200L
+#define MC_CHP_IO_CNTL_B1__MEM_PREAMP_DQSB_MASK                0x00000400L
+#define MC_CHP_IO_CNTL_B1__MEM_PREAMP_DQSB             0x00000400L
+#define MC_CHP_IO_CNTL_B1__MEM_IO_MODEB_MASK           0x00003000L
+#define MC_CHP_IO_CNTL_B1__MEM_REC_CKB_MASK            0x0000c000L
+#define MC_CHP_IO_CNTL_B1__MEM_REC_AB_MASK             0x00030000L
+#define MC_CHP_IO_CNTL_B1__MEM_REC_DQMB_MASK           0x000c0000L
+#define MC_CHP_IO_CNTL_B1__MEM_REC_DQSB_MASK           0x00300000L
+#define MC_CHP_IO_CNTL_B1__MEM_SYNC_PHASEB_MASK                0x00400000L
+#define MC_CHP_IO_CNTL_B1__MEM_SYNC_PHASEB             0x00400000L
+#define MC_CHP_IO_CNTL_B1__MEM_SYNC_CENTERB_MASK       0x00800000L
+#define MC_CHP_IO_CNTL_B1__MEM_SYNC_CENTERB            0x00800000L
+#define MC_CHP_IO_CNTL_B1__MEM_SYNC_ENB_MASK           0x03000000L
+#define MC_CHP_IO_CNTL_B1__MEM_CLK_SELB_MASK           0x0c000000L
+#define MC_CHP_IO_CNTL_B1__MEM_CLK_INVB_MASK           0x10000000L
+#define MC_CHP_IO_CNTL_B1__MEM_CLK_INVB                        0x10000000L
+#define MC_CHP_IO_CNTL_B1__MEM_DATA_ENIMP_B_MASK       0x40000000L
+#define MC_CHP_IO_CNTL_B1__MEM_DATA_ENIMP_B            0x40000000L
+#define MC_CHP_IO_CNTL_B1__MEM_CNTL_ENIMP_B_MASK       0x80000000L
+#define MC_CHP_IO_CNTL_B1__MEM_CNTL_ENIMP_B            0x80000000L
+
+/* MEM_SDRAM_MODE_REG */
+#define MEM_SDRAM_MODE_REG__MEM_MODE_REG_MASK          0x00007fffL
+#define MEM_SDRAM_MODE_REG__MEM_WR_LATENCY_MASK                0x000f0000L
+#define MEM_SDRAM_MODE_REG__MEM_CAS_LATENCY_MASK       0x00700000L
+#define MEM_SDRAM_MODE_REG__MEM_CMD_LATENCY_MASK       0x00800000L
+#define MEM_SDRAM_MODE_REG__MEM_CMD_LATENCY            0x00800000L
+#define MEM_SDRAM_MODE_REG__MEM_STR_LATENCY_MASK       0x01000000L
+#define MEM_SDRAM_MODE_REG__MEM_STR_LATENCY            0x01000000L
+#define MEM_SDRAM_MODE_REG__MEM_FALL_OUT_CMD_MASK      0x02000000L
+#define MEM_SDRAM_MODE_REG__MEM_FALL_OUT_CMD           0x02000000L
+#define MEM_SDRAM_MODE_REG__MEM_FALL_OUT_DATA_MASK     0x04000000L
+#define MEM_SDRAM_MODE_REG__MEM_FALL_OUT_DATA          0x04000000L
+#define MEM_SDRAM_MODE_REG__MEM_FALL_OUT_STR_MASK      0x08000000L
+#define MEM_SDRAM_MODE_REG__MEM_FALL_OUT_STR           0x08000000L
+#define MEM_SDRAM_MODE_REG__MC_INIT_COMPLETE_MASK      0x10000000L
+#define MEM_SDRAM_MODE_REG__MC_INIT_COMPLETE           0x10000000L
+#define MEM_SDRAM_MODE_REG__MEM_DDR_DLL_MASK           0x20000000L
+#define MEM_SDRAM_MODE_REG__MEM_DDR_DLL                        0x20000000L
+#define MEM_SDRAM_MODE_REG__MEM_CFG_TYPE_MASK          0x40000000L
+#define MEM_SDRAM_MODE_REG__MEM_CFG_TYPE               0x40000000L
+#define MEM_SDRAM_MODE_REG__MEM_SDRAM_RESET_MASK       0x80000000L
+#define MEM_SDRAM_MODE_REG__MEM_SDRAM_RESET            0x80000000L
+
+/* MEM_SDRAM_MODE_REG */
+#define MEM_SDRAM_MODE_REG__MEM_MODE_REG__SHIFT                0x00000000
+#define MEM_SDRAM_MODE_REG__MEM_WR_LATENCY__SHIFT      0x00000010
+#define MEM_SDRAM_MODE_REG__MEM_CAS_LATENCY__SHIFT     0x00000014
+#define MEM_SDRAM_MODE_REG__MEM_CMD_LATENCY__SHIFT     0x00000017
+#define MEM_SDRAM_MODE_REG__MEM_STR_LATENCY__SHIFT     0x00000018
+#define MEM_SDRAM_MODE_REG__MEM_FALL_OUT_CMD__SHIFT    0x00000019
+#define MEM_SDRAM_MODE_REG__MEM_FALL_OUT_DATA__SHIFT   0x0000001a
+#define MEM_SDRAM_MODE_REG__MEM_FALL_OUT_STR__SHIFT    0x0000001b
+#define MEM_SDRAM_MODE_REG__MC_INIT_COMPLETE__SHIFT    0x0000001c
+#define MEM_SDRAM_MODE_REG__MEM_DDR_DLL__SHIFT         0x0000001d
+#define MEM_SDRAM_MODE_REG__MEM_CFG_TYPE__SHIFT                0x0000001e
+#define MEM_SDRAM_MODE_REG__MEM_SDRAM_RESET__SHIFT     0x0000001f
+
+/* MEM_REFRESH_CNTL */
+#define MEM_REFRESH_CNTL__MEM_REFRESH_RATE_MASK                0x000000ffL
+#define MEM_REFRESH_CNTL__MEM_REFRESH_DIS_MASK         0x00000100L
+#define MEM_REFRESH_CNTL__MEM_REFRESH_DIS              0x00000100L
+#define MEM_REFRESH_CNTL__MEM_DYNAMIC_CKE_MASK         0x00000200L
+#define MEM_REFRESH_CNTL__MEM_DYNAMIC_CKE              0x00000200L
+#define MEM_REFRESH_CNTL__MEM_TRFC_MASK                        0x0000f000L
+#define MEM_REFRESH_CNTL__MEM_CLKA0_ENABLE_MASK                0x00010000L
+#define MEM_REFRESH_CNTL__MEM_CLKA0_ENABLE             0x00010000L
+#define MEM_REFRESH_CNTL__MEM_CLKA0b_ENABLE_MASK       0x00020000L
+#define MEM_REFRESH_CNTL__MEM_CLKA0b_ENABLE            0x00020000L
+#define MEM_REFRESH_CNTL__MEM_CLKA1_ENABLE_MASK                0x00040000L
+#define MEM_REFRESH_CNTL__MEM_CLKA1_ENABLE             0x00040000L
+#define MEM_REFRESH_CNTL__MEM_CLKA1b_ENABLE_MASK       0x00080000L
+#define MEM_REFRESH_CNTL__MEM_CLKA1b_ENABLE            0x00080000L
+#define MEM_REFRESH_CNTL__MEM_CLKAFB_ENABLE_MASK       0x00100000L
+#define MEM_REFRESH_CNTL__MEM_CLKAFB_ENABLE            0x00100000L
+#define MEM_REFRESH_CNTL__DLL_FB_SLCT_CKA_MASK         0x00c00000L
+#define MEM_REFRESH_CNTL__MEM_CLKB0_ENABLE_MASK                0x01000000L
+#define MEM_REFRESH_CNTL__MEM_CLKB0_ENABLE             0x01000000L
+#define MEM_REFRESH_CNTL__MEM_CLKB0b_ENABLE_MASK       0x02000000L
+#define MEM_REFRESH_CNTL__MEM_CLKB0b_ENABLE            0x02000000L
+#define MEM_REFRESH_CNTL__MEM_CLKB1_ENABLE_MASK                0x04000000L
+#define MEM_REFRESH_CNTL__MEM_CLKB1_ENABLE             0x04000000L
+#define MEM_REFRESH_CNTL__MEM_CLKB1b_ENABLE_MASK       0x08000000L
+#define MEM_REFRESH_CNTL__MEM_CLKB1b_ENABLE            0x08000000L
+#define MEM_REFRESH_CNTL__MEM_CLKBFB_ENABLE_MASK       0x10000000L
+#define MEM_REFRESH_CNTL__MEM_CLKBFB_ENABLE            0x10000000L
+#define MEM_REFRESH_CNTL__DLL_FB_SLCT_CKB_MASK         0xc0000000L
+
+/* MC_STATUS */
+#define MC_STATUS__MEM_PWRUP_COMPL_A_MASK              0x00000001L
+#define MC_STATUS__MEM_PWRUP_COMPL_A                   0x00000001L
+#define MC_STATUS__MEM_PWRUP_COMPL_B_MASK              0x00000002L
+#define MC_STATUS__MEM_PWRUP_COMPL_B                   0x00000002L
+#define MC_STATUS__MC_IDLE_MASK                                0x00000004L
+#define MC_STATUS__MC_IDLE                             0x00000004L
+#define MC_STATUS__IMP_N_VALUE_R_BACK_MASK             0x00000078L
+#define MC_STATUS__IMP_P_VALUE_R_BACK_MASK             0x00000780L
+#define MC_STATUS__TEST_OUT_R_BACK_MASK                        0x00000800L
+#define MC_STATUS__TEST_OUT_R_BACK                     0x00000800L
+#define MC_STATUS__DUMMY_OUT_R_BACK_MASK               0x00001000L
+#define MC_STATUS__DUMMY_OUT_R_BACK                    0x00001000L
+#define MC_STATUS__IMP_N_VALUE_A_R_BACK_MASK           0x0001e000L
+#define MC_STATUS__IMP_P_VALUE_A_R_BACK_MASK           0x001e0000L
+#define MC_STATUS__IMP_N_VALUE_CK_R_BACK_MASK          0x01e00000L
+#define MC_STATUS__IMP_P_VALUE_CK_R_BACK_MASK          0x1e000000L
+
+/* MDLL_CKO */
+#define MDLL_CKO__MCKOA_SLEEP_MASK                     0x00000001L
+#define MDLL_CKO__MCKOA_SLEEP                          0x00000001L
+#define MDLL_CKO__MCKOA_RESET_MASK                     0x00000002L
+#define MDLL_CKO__MCKOA_RESET                          0x00000002L
+#define MDLL_CKO__MCKOA_RANGE_MASK                     0x0000000cL
+#define MDLL_CKO__ERSTA_SOUTSEL_MASK                   0x00000030L
+#define MDLL_CKO__MCKOA_FB_SEL_MASK                    0x000000c0L
+#define MDLL_CKO__MCKOA_REF_SKEW_MASK                  0x00000700L
+#define MDLL_CKO__MCKOA_FB_SKEW_MASK                   0x00007000L
+#define MDLL_CKO__MCKOA_BP_SEL_MASK                    0x00008000L
+#define MDLL_CKO__MCKOA_BP_SEL                         0x00008000L
+#define MDLL_CKO__MCKOB_SLEEP_MASK                     0x00010000L
+#define MDLL_CKO__MCKOB_SLEEP                          0x00010000L
+#define MDLL_CKO__MCKOB_RESET_MASK                     0x00020000L
+#define MDLL_CKO__MCKOB_RESET                          0x00020000L
+#define MDLL_CKO__MCKOB_RANGE_MASK                     0x000c0000L
+#define MDLL_CKO__ERSTB_SOUTSEL_MASK                   0x00300000L
+#define MDLL_CKO__MCKOB_FB_SEL_MASK                    0x00c00000L
+#define MDLL_CKO__MCKOB_REF_SKEW_MASK                  0x07000000L
+#define MDLL_CKO__MCKOB_FB_SKEW_MASK                   0x70000000L
+#define MDLL_CKO__MCKOB_BP_SEL_MASK                    0x80000000L
+#define MDLL_CKO__MCKOB_BP_SEL                         0x80000000L
+
+/* MDLL_RDCKA */
+#define MDLL_RDCKA__MRDCKA0_SLEEP_MASK                 0x00000001L
+#define MDLL_RDCKA__MRDCKA0_SLEEP                      0x00000001L
+#define MDLL_RDCKA__MRDCKA0_RESET_MASK                 0x00000002L
+#define MDLL_RDCKA__MRDCKA0_RESET                      0x00000002L
+#define MDLL_RDCKA__MRDCKA0_RANGE_MASK                 0x0000000cL
+#define MDLL_RDCKA__MRDCKA0_REF_SEL_MASK               0x00000030L
+#define MDLL_RDCKA__MRDCKA0_FB_SEL_MASK                        0x000000c0L
+#define MDLL_RDCKA__MRDCKA0_REF_SKEW_MASK              0x00000700L
+#define MDLL_RDCKA__MRDCKA0_SINSEL_MASK                        0x00000800L
+#define MDLL_RDCKA__MRDCKA0_SINSEL                     0x00000800L
+#define MDLL_RDCKA__MRDCKA0_FB_SKEW_MASK               0x00007000L
+#define MDLL_RDCKA__MRDCKA0_BP_SEL_MASK                        0x00008000L
+#define MDLL_RDCKA__MRDCKA0_BP_SEL                     0x00008000L
+#define MDLL_RDCKA__MRDCKA1_SLEEP_MASK                 0x00010000L
+#define MDLL_RDCKA__MRDCKA1_SLEEP                      0x00010000L
+#define MDLL_RDCKA__MRDCKA1_RESET_MASK                 0x00020000L
+#define MDLL_RDCKA__MRDCKA1_RESET                      0x00020000L
+#define MDLL_RDCKA__MRDCKA1_RANGE_MASK                 0x000c0000L
+#define MDLL_RDCKA__MRDCKA1_REF_SEL_MASK               0x00300000L
+#define MDLL_RDCKA__MRDCKA1_FB_SEL_MASK                        0x00c00000L
+#define MDLL_RDCKA__MRDCKA1_REF_SKEW_MASK              0x07000000L
+#define MDLL_RDCKA__MRDCKA1_SINSEL_MASK                        0x08000000L
+#define MDLL_RDCKA__MRDCKA1_SINSEL                     0x08000000L
+#define MDLL_RDCKA__MRDCKA1_FB_SKEW_MASK               0x70000000L
+#define MDLL_RDCKA__MRDCKA1_BP_SEL_MASK                        0x80000000L
+#define MDLL_RDCKA__MRDCKA1_BP_SEL                     0x80000000L
+
+/* MDLL_RDCKB */
+#define MDLL_RDCKB__MRDCKB0_SLEEP_MASK                 0x00000001L
+#define MDLL_RDCKB__MRDCKB0_SLEEP                      0x00000001L
+#define MDLL_RDCKB__MRDCKB0_RESET_MASK                 0x00000002L
+#define MDLL_RDCKB__MRDCKB0_RESET                      0x00000002L
+#define MDLL_RDCKB__MRDCKB0_RANGE_MASK                 0x0000000cL
+#define MDLL_RDCKB__MRDCKB0_REF_SEL_MASK               0x00000030L
+#define MDLL_RDCKB__MRDCKB0_FB_SEL_MASK                        0x000000c0L
+#define MDLL_RDCKB__MRDCKB0_REF_SKEW_MASK              0x00000700L
+#define MDLL_RDCKB__MRDCKB0_SINSEL_MASK                        0x00000800L
+#define MDLL_RDCKB__MRDCKB0_SINSEL                     0x00000800L
+#define MDLL_RDCKB__MRDCKB0_FB_SKEW_MASK               0x00007000L
+#define MDLL_RDCKB__MRDCKB0_BP_SEL_MASK                        0x00008000L
+#define MDLL_RDCKB__MRDCKB0_BP_SEL                     0x00008000L
+#define MDLL_RDCKB__MRDCKB1_SLEEP_MASK                 0x00010000L
+#define MDLL_RDCKB__MRDCKB1_SLEEP                      0x00010000L
+#define MDLL_RDCKB__MRDCKB1_RESET_MASK                 0x00020000L
+#define MDLL_RDCKB__MRDCKB1_RESET                      0x00020000L
+#define MDLL_RDCKB__MRDCKB1_RANGE_MASK                 0x000c0000L
+#define MDLL_RDCKB__MRDCKB1_REF_SEL_MASK               0x00300000L
+#define MDLL_RDCKB__MRDCKB1_FB_SEL_MASK                        0x00c00000L
+#define MDLL_RDCKB__MRDCKB1_REF_SKEW_MASK              0x07000000L
+#define MDLL_RDCKB__MRDCKB1_SINSEL_MASK                        0x08000000L
+#define MDLL_RDCKB__MRDCKB1_SINSEL                     0x08000000L
+#define MDLL_RDCKB__MRDCKB1_FB_SKEW_MASK               0x70000000L
+#define MDLL_RDCKB__MRDCKB1_BP_SEL_MASK                        0x80000000L
+#define MDLL_RDCKB__MRDCKB1_BP_SEL                     0x80000000L
+
+#define MDLL_R300_RDCK__MRDCKA_SLEEP                   0x00000001L
+#define MDLL_R300_RDCK__MRDCKA_RESET                   0x00000002L
+#define MDLL_R300_RDCK__MRDCKB_SLEEP                   0x00000004L
+#define MDLL_R300_RDCK__MRDCKB_RESET                   0x00000008L
+#define MDLL_R300_RDCK__MRDCKC_SLEEP                   0x00000010L
+#define MDLL_R300_RDCK__MRDCKC_RESET                   0x00000020L
+#define MDLL_R300_RDCK__MRDCKD_SLEEP                   0x00000040L
+#define MDLL_R300_RDCK__MRDCKD_RESET                   0x00000080L
+
+#define pllCLK_PIN_CNTL                                0x0001
+#define pllPPLL_CNTL                           0x0002
+#define pllPPLL_REF_DIV                                0x0003
+#define pllPPLL_DIV_0                          0x0004
+#define pllPPLL_DIV_1                          0x0005
+#define pllPPLL_DIV_2                          0x0006
+#define pllPPLL_DIV_3                          0x0007
+#define pllVCLK_ECP_CNTL                       0x0008
+#define pllHTOTAL_CNTL                         0x0009
+#define pllM_SPLL_REF_FB_DIV                   0x000A
+#define pllAGP_PLL_CNTL                                0x000B
+#define pllSPLL_CNTL                           0x000C
+#define pllSCLK_CNTL                           0x000D
+#define pllMPLL_CNTL                           0x000E
+#define pllMDLL_CKO                            0x000F
+#define pllMDLL_RDCKA                          0x0010
+#define pllMDLL_RDCKB                          0x0011
+#define pllMCLK_CNTL                           0x0012
+#define pllPLL_TEST_CNTL                       0x0013
+#define pllCLK_PWRMGT_CNTL                     0x0014
+#define pllPLL_PWRMGT_CNTL                     0x0015
+#define pllCG_TEST_MACRO_RW_WRITE              0x0016
+#define pllCG_TEST_MACRO_RW_READ               0x0017
+#define pllCG_TEST_MACRO_RW_DATA               0x0018
+#define pllCG_TEST_MACRO_RW_CNTL               0x0019
+#define pllDISP_TEST_MACRO_RW_WRITE            0x001A
+#define pllDISP_TEST_MACRO_RW_READ             0x001B
+#define pllDISP_TEST_MACRO_RW_DATA             0x001C
+#define pllDISP_TEST_MACRO_RW_CNTL             0x001D
+#define pllSCLK_CNTL2                          0x001E
+#define pllMCLK_MISC                           0x001F
+#define pllTV_PLL_FINE_CNTL                    0x0020
+#define pllTV_PLL_CNTL                         0x0021
+#define pllTV_PLL_CNTL1                                0x0022
+#define pllTV_DTO_INCREMENTS                   0x0023
+#define pllSPLL_AUX_CNTL                       0x0024
+#define pllMPLL_AUX_CNTL                       0x0025
+#define pllP2PLL_CNTL                          0x002A
+#define pllP2PLL_REF_DIV                       0x002B
+#define pllP2PLL_DIV_0                         0x002C
+#define pllPIXCLKS_CNTL                                0x002D
+#define pllHTOTAL2_CNTL                                0x002E
+#define pllSSPLL_CNTL                          0x0030
+#define pllSSPLL_REF_DIV                       0x0031
+#define pllSSPLL_DIV_0                         0x0032
+#define pllSS_INT_CNTL                         0x0033
+#define pllSS_TST_CNTL                         0x0034
+#define pllSCLK_MORE_CNTL                      0x0035
+
+#define ixMC_PERF_CNTL                         0x0000
+#define ixMC_PERF_SEL                          0x0001
+#define ixMC_PERF_REGION_0                     0x0002
+#define ixMC_PERF_REGION_1                     0x0003
+#define ixMC_PERF_COUNT_0                      0x0004
+#define ixMC_PERF_COUNT_1                      0x0005
+#define ixMC_PERF_COUNT_2                      0x0006
+#define ixMC_PERF_COUNT_3                      0x0007
+#define ixMC_PERF_COUNT_MEMCH_A                        0x0008
+#define ixMC_PERF_COUNT_MEMCH_B                        0x0009
+#define ixMC_IMP_CNTL                          0x000A
+#define ixMC_CHP_IO_CNTL_A0                    0x000B
+#define ixMC_CHP_IO_CNTL_A1                    0x000C
+#define ixMC_CHP_IO_CNTL_B0                    0x000D
+#define ixMC_CHP_IO_CNTL_B1                    0x000E
+#define ixMC_IMP_CNTL_0                                0x000F
+#define ixTC_MISMATCH_1                                0x0010
+#define ixTC_MISMATCH_2                                0x0011
+#define ixMC_BIST_CTRL                         0x0012
+#define ixREG_COLLAR_WRITE                     0x0013
+#define ixREG_COLLAR_READ                      0x0014
+#define ixR300_MC_IMP_CNTL                     0x0018
+#define ixR300_MC_CHP_IO_CNTL_A0               0x0019
+#define ixR300_MC_CHP_IO_CNTL_A1               0x001a
+#define ixR300_MC_CHP_IO_CNTL_B0               0x001b
+#define ixR300_MC_CHP_IO_CNTL_B1               0x001c
+#define ixR300_MC_CHP_IO_CNTL_C0               0x001d
+#define ixR300_MC_CHP_IO_CNTL_C1               0x001e
+#define ixR300_MC_CHP_IO_CNTL_D0               0x001f
+#define ixR300_MC_CHP_IO_CNTL_D1               0x0020
+#define ixR300_MC_IMP_CNTL_0                   0x0021
+#define ixR300_MC_ELPIDA_CNTL                  0x0022
+#define ixR300_MC_CHP_IO_OE_CNTL_CD            0x0023
+#define ixR300_MC_READ_CNTL_CD                 0x0024
+#define ixR300_MC_MC_INIT_WR_LAT_TIMER         0x0025
+#define ixR300_MC_DEBUG_CNTL                   0x0026
+#define ixR300_MC_BIST_CNTL_0                  0x0028
+#define ixR300_MC_BIST_CNTL_1                  0x0029
+#define ixR300_MC_BIST_CNTL_2                  0x002a
+#define ixR300_MC_BIST_CNTL_3                  0x002b
+#define ixR300_MC_BIST_CNTL_4                  0x002c
+#define ixR300_MC_BIST_CNTL_5                  0x002d
+#define ixR300_MC_IMP_STATUS                   0x002e
+#define ixR300_MC_DLL_CNTL                     0x002f
+#define NB_TOM                                 0x15C
+
+#endif /* _RADEON_H */
index babc2543ebf34fd81eab1115c4d04c0291615ffd..8f4e19bfcb5bf637452cc944d90a5ae58a965c41 100644 (file)
@@ -54,7 +54,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
 void nand_init (void);
 #endif
 
@@ -296,7 +296,7 @@ void start_armboot (void)
        /* armboot_start is defined in the board-specific linker script */
        mem_malloc_init (_armboot_start - CFG_MALLOC_LEN);
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
        puts ("NAND:  ");
        nand_init();            /* go init the NAND */
 #endif
@@ -378,16 +378,16 @@ void start_armboot (void)
        if ((s = getenv ("loadaddr")) != NULL) {
                load_addr = simple_strtoul (s, NULL, 16);
        }
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
        if ((s = getenv ("bootfile")) != NULL) {
                copy_filename (BootFile, s, sizeof (BootFile));
        }
-#endif /* CFG_CMD_NET */
+#endif
 
 #ifdef BOARD_LATE_INIT
        board_late_init ();
 #endif
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
 #if defined(CONFIG_NET_MULTI)
        puts ("Net:   ");
 #endif
index 265328aa487696a11862aa12ae6e491fd60e64cb..8b9ca38f50cf2bf16b11ccbe8df752c52da747e5 100644 (file)
@@ -328,7 +328,7 @@ void board_init_r(gd_t *new_gd, ulong dest_addr)
        jumptable_init();
        console_init_r();
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
 #if defined(CONFIG_NET_MULTI)
        puts("Net:   ");
 #endif
index 1538da3f29a6f6a0317e9ff7d75d23322baf0161..36a969e7318e2748a4dce752a34ca1ec754e9c6c 100644 (file)
@@ -297,7 +297,7 @@ void board_init_f(ulong bootflag)
        }
 
        checkboard();
-#if defined(CONFIG_RTC_BF533) && (CONFIG_COMMANDS & CFG_CMD_DATE)
+#if defined(CONFIG_RTC_BF533) && defined(CONFIG_CMD_DATE)
        rtc_init();
 #endif
        timer_init();
@@ -391,13 +391,13 @@ void board_init_r(gd_t * id, ulong dest_addr)
        if ((s = getenv("loadaddr")) != NULL) {
                load_addr = simple_strtoul(s, NULL, 16);
        }
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
        if ((s = getenv("bootfile")) != NULL) {
                copy_filename(BootFile, s, sizeof(BootFile));
        }
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
        puts("NAND:  ");
        nand_init();            /* go init the NAND */
 #endif
index 3d99b69296c7e4504126b175a58176581ff57f08..df0dbca346634360c035a19312843e6cf3fbcf16 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #ifndef USE_HOSTCC     /* Shut down "ANSI does not permit..." warnings */
-#include <common.h>    /* to get command definitions like CFG_CMD_JFFS2 */
+#include <common.h>
 #endif
 
 #include "zlib.h"
@@ -171,8 +171,9 @@ uLong ZEXPORT crc32(crc, buf, len)
     return crc ^ 0xffffffffL;
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_JFFS2) || \
-       ((CONFIG_COMMANDS & CFG_CMD_NAND) && !defined(CFG_NAND_LEGACY))
+#if defined(CONFIG_CMD_JFFS2) || \
+       (defined(CONFIG_CMD_NAND) \
+       && !defined(CFG_NAND_LEGACY))
 
 /* No ones complement version. JFFS2 (and other things ?)
  * don't use ones compliment in their CRC calculations.
@@ -195,4 +196,4 @@ uLong ZEXPORT crc32_no_comp(uLong crc, const Bytef *buf, uInt len)
     return crc;
 }
 
-#endif /* CFG_CMD_JFFS2 */
+#endif
index 4175fdb1c49a01c44471fc54ef0d8c96106f36b8..47fbab4ccb4dd9d96a00e5b1bd81d1d3effa69da 100644 (file)
@@ -313,13 +313,13 @@ void start_i386boot (void)
        misc_init_r();
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_PCMCIA) && !(CONFIG_COMMANDS & CFG_CMD_IDE)
+#if defined(CONFIG_CMD_PCMCIA) && !defined(CONFIG_CMD_IDE)
        WATCHDOG_RESET();
        puts ("PCMCIA:");
        pcmcia_init();
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        WATCHDOG_RESET();
        puts("KGDB:  ");
        kgdb_init();
@@ -348,33 +348,33 @@ void start_i386boot (void)
        if ((s = getenv ("loadaddr")) != NULL) {
                load_addr = simple_strtoul (s, NULL, 16);
        }
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
        if ((s = getenv ("bootfile")) != NULL) {
                copy_filename (BootFile, s, sizeof (BootFile));
        }
-#endif /* CFG_CMD_NET */
+#endif
 
        WATCHDOG_RESET();
 
-#if (CONFIG_COMMANDS & CFG_CMD_IDE)
+#if defined(CONFIG_CMD_IDE)
        WATCHDOG_RESET();
        puts("IDE:   ");
        ide_init();
-#endif /* CFG_CMD_IDE */
+#endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_SCSI)
+#if defined(CONFIG_CMD_SCSI)
        WATCHDOG_RESET();
        puts("SCSI:  ");
        scsi_init();
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_DOC)
+#if defined(CONFIG_CMD_DOC)
        WATCHDOG_RESET();
        puts("DOC:   ");
        doc_init();
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
 #if defined(CONFIG_NET_MULTI)
        WATCHDOG_RESET();
        puts("Net:   ");
@@ -382,7 +382,7 @@ void start_i386boot (void)
        eth_initialize(gd->bd);
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET) && (0)
+#if ( defined(CONFIG_CMD_NET)) && (0)
        WATCHDOG_RESET();
 # ifdef DEBUG
        puts ("Reset Ethernet PHY\n");
index 6aaf60991c6608ffc2a243633708249e5d38d1d6..293fd04a4807c9be83a75abf764ae2ca7af22836 100644 (file)
 #include <asm/immap_5272.h>
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_IDE)
+#if defined(CONFIG_CMD_IDE)
 #include <ide.h>
 #endif
-#if (CONFIG_COMMANDS & CFG_CMD_SCSI)
+#if defined(CONFIG_CMD_SCSI)
 #include <scsi.h>
 #endif
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #include <kgdb.h>
 #endif
 #ifdef CONFIG_STATUS_LED
 #include <status_led.h>
 #endif
 #include <net.h>
-#if (CONFIG_COMMANDS & CFG_CMD_BEDBUG)
+#if defined(CONFIG_CMD_BEDBUG)
 #include <cmd_bedbug.h>
 #endif
 #ifdef CFG_ALLOC_DPRAM
@@ -584,7 +584,7 @@ void board_init_r (gd_t *id, ulong dest_addr)
        misc_init_r ();
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        WATCHDOG_RESET ();
        puts ("KGDB:  ");
        kgdb_init ();
@@ -620,27 +620,27 @@ void board_init_r (gd_t *id, ulong dest_addr)
        if ((s = getenv ("loadaddr")) != NULL) {
                load_addr = simple_strtoul (s, NULL, 16);
        }
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
        if ((s = getenv ("bootfile")) != NULL) {
                copy_filename (BootFile, s, sizeof (BootFile));
        }
-#endif /* CFG_CMD_NET */
+#endif
 
        WATCHDOG_RESET ();
 
-#if (CONFIG_COMMANDS & CFG_CMD_DOC)
+#if defined(CONFIG_CMD_DOC)
        WATCHDOG_RESET ();
        puts ("DOC:   ");
        doc_init ();
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
        WATCHDOG_RESET ();
        puts ("NAND:  ");
        nand_init();            /* go init the NAND */
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET) && defined(FEC_ENET)
+#if defined(CONFIG_CMD_NET) && defined(FEC_ENET)
        WATCHDOG_RESET();
        eth_init(bd);
 #endif
@@ -659,7 +659,7 @@ void board_init_r (gd_t *id, ulong dest_addr)
        last_stage_init ();
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_BEDBUG)
+#if defined(CONFIG_CMD_BEDBUG)
        WATCHDOG_RESET ();
        bedbug_init ();
 #endif
index c95125ad33d120b578350f9ba8ea538e3049edac..09d4d943de7566233b4f7aa2654cd8687b4ad5d1 100644 (file)
@@ -40,7 +40,7 @@ extern int gpio_init (void);
 #ifdef CFG_INTC_0
 extern int interrupts_init (void);
 #endif
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
 extern int eth_init (bd_t * bis);
 extern int getenv_IPaddr (char *);
 #endif
@@ -108,7 +108,7 @@ void board_init (void)
        bd_t *bd;
        init_fnc_t **init_fnc_ptr;
        gd = (gd_t *) CFG_GBL_DATA_OFFSET;
-#if (CONFIG_COMMANDS & CFG_CMD_FLASH)
+#if defined(CONFIG_CMD_FLASH)
        ulong flash_size = 0;
 #endif
        asm ("nop");    /* FIXME gd is not initialize - wait */
@@ -130,7 +130,7 @@ void board_init (void)
                }
        }
 
-#if (CONFIG_COMMANDS & CFG_CMD_FLASH)
+#if defined(CONFIG_CMD_FLASH)
        bd->bi_flashstart = CFG_FLASH_BASE;
        if (0 < (flash_size = flash_init ())) {
                bd->bi_flashsize = flash_size;
@@ -143,7 +143,7 @@ void board_init (void)
        }
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
        char *s, *e;
        int i;
        /* board MAC address */
index b7d335641ae957db1a177375f7cc1b9bf0554566..91ccec04df76b04ed20816a212176a2857d8e040 100644 (file)
@@ -399,18 +399,18 @@ void board_init_r (gd_t *id, ulong dest_addr)
        if ((s = getenv ("loadaddr")) != NULL) {
                load_addr = simple_strtoul (s, NULL, 16);
        }
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
        if ((s = getenv ("bootfile")) != NULL) {
                copy_filename (BootFile, s, sizeof (BootFile));
        }
-#endif /* CFG_CMD_NET */
+#endif
 
 #if defined(CONFIG_MISC_INIT_R)
        /* miscellaneous platform dependent initialisations */
        misc_init_r ();
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
 #if defined(CONFIG_NET_MULTI)
        puts ("Net:   ");
 #endif
index 3b1bfeab4a540ca84b3cc11535061bbdec2905c0..325f5c219ced78f352f04b13d13ec30fb820dd3b 100644 (file)
 #ifdef CONFIG_MPC5xxx
 #include <mpc5xxx.h>
 #endif
-#if (CONFIG_COMMANDS & CFG_CMD_IDE)
+#if defined(CONFIG_CMD_IDE)
 #include <ide.h>
 #endif
-#if (CONFIG_COMMANDS & CFG_CMD_SCSI)
+#if defined(CONFIG_CMD_SCSI)
 #include <scsi.h>
 #endif
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #include <kgdb.h>
 #endif
 #ifdef CONFIG_STATUS_LED
@@ -80,14 +80,14 @@ extern int update_flash_size (int flash_size);
 extern void sc3_read_eeprom(void);
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_DOC)
+#if defined(CONFIG_CMD_DOC)
 void doc_init (void);
 #endif
 #if defined(CONFIG_HARD_I2C) || \
     defined(CONFIG_SOFT_I2C)
 #include <i2c.h>
 #endif
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
 void nand_init (void);
 #endif
 
@@ -118,7 +118,7 @@ extern ulong __init_end;
 extern ulong _end;
 ulong monitor_flash_len;
 
-#if (CONFIG_COMMANDS & CFG_CMD_BEDBUG)
+#if defined(CONFIG_CMD_BEDBUG)
 #include <bedbug/type.h>
 #endif
 
@@ -139,10 +139,10 @@ static    ulong   mem_malloc_brk   = 0;
  */
 static void mem_malloc_init (void)
 {
-       ulong dest_addr = CFG_MONITOR_BASE + gd->reloc_off;
-
-       mem_malloc_end = dest_addr;
-       mem_malloc_start = dest_addr - TOTAL_MALLOC_LEN;
+#if !defined(CONFIG_RELOC_FIXUP_WORKS)
+       mem_malloc_end = CFG_MONITOR_BASE + gd->reloc_off;
+#endif
+       mem_malloc_start = mem_malloc_end - TOTAL_MALLOC_LEN;
        mem_malloc_brk = mem_malloc_start;
 
        memset ((void *) mem_malloc_start,
@@ -620,7 +620,13 @@ void board_init_r (gd_t *id, ulong dest_addr)
        bd = gd->bd;
 
        gd->flags |= GD_FLG_RELOC;      /* tell others: relocation done */
+
+#if defined(CONFIG_RELOC_FIXUP_WORKS)
+       gd->reloc_off = 0;
+       mem_malloc_end = dest_addr;
+#else
        gd->reloc_off = dest_addr - CFG_MONITOR_BASE;
+#endif
 
 #ifdef CONFIG_SERIAL_MULTI
        serial_initialize();
@@ -779,7 +785,7 @@ void board_init_r (gd_t *id, ulong dest_addr)
        spi_init_r ();
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
        WATCHDOG_RESET ();
        puts ("NAND:  ");
        nand_init();            /* go init the NAND */
@@ -942,7 +948,7 @@ void board_init_r (gd_t *id, ulong dest_addr)
                hermes_start_lxt980 ((int) bd->bi_ethspeed);
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
        WATCHDOG_RESET ();
        puts ("KGDB:  ");
        kgdb_init ();
@@ -974,27 +980,27 @@ void board_init_r (gd_t *id, ulong dest_addr)
        if ((s = getenv ("loadaddr")) != NULL) {
                load_addr = simple_strtoul (s, NULL, 16);
        }
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
        if ((s = getenv ("bootfile")) != NULL) {
                copy_filename (BootFile, s, sizeof (BootFile));
        }
-#endif /* CFG_CMD_NET */
+#endif
 
        WATCHDOG_RESET ();
 
-#if (CONFIG_COMMANDS & CFG_CMD_SCSI)
+#if defined(CONFIG_CMD_SCSI)
        WATCHDOG_RESET ();
        puts ("SCSI:  ");
        scsi_init ();
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_DOC)
+#if defined(CONFIG_CMD_DOC)
        WATCHDOG_RESET ();
        puts ("DOC:   ");
        doc_init ();
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
 #if defined(CONFIG_NET_MULTI)
        WATCHDOG_RESET ();
        puts ("Net:   ");
@@ -1002,7 +1008,7 @@ void board_init_r (gd_t *id, ulong dest_addr)
        eth_initialize (bd);
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET) && ( \
+#if defined(CONFIG_CMD_NET) && ( \
     defined(CONFIG_CCM)                || \
     defined(CONFIG_ELPT860)    || \
     defined(CONFIG_EP8260)     || \
@@ -1027,13 +1033,14 @@ void board_init_r (gd_t *id, ulong dest_addr)
        post_run (NULL, POST_RAM | post_bootmode_get(0));
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_PCMCIA) && !(CONFIG_COMMANDS & CFG_CMD_IDE)
+#if defined(CONFIG_CMD_PCMCIA) \
+    && !defined(CONFIG_CMD_IDE)
        WATCHDOG_RESET ();
        puts ("PCMCIA:");
        pcmcia_init ();
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_IDE)
+#if defined(CONFIG_CMD_IDE)
        WATCHDOG_RESET ();
 # ifdef        CONFIG_IDE_8xx_PCCARD
        puts ("PCMCIA:");
@@ -1046,7 +1053,7 @@ void board_init_r (gd_t *id, ulong dest_addr)
 #else
        ide_init ();
 #endif
-#endif /* CFG_CMD_IDE */
+#endif
 
 #ifdef CONFIG_LAST_STAGE_INIT
        WATCHDOG_RESET ();
@@ -1058,7 +1065,7 @@ void board_init_r (gd_t *id, ulong dest_addr)
        last_stage_init ();
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_BEDBUG)
+#if defined(CONFIG_CMD_BEDBUG)
        WATCHDOG_RESET ();
        bedbug_init ();
 #endif
index 4c5d79a8d8ae834248d543eb9a19913753029cba..78c2f0c47588103d01b1e77d6834bbbddcc1e8a3 100644 (file)
@@ -1,7 +1,7 @@
 #include <common.h>
 #include <command.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 
 #include <kgdb.h>
 #include <asm/signal.h>
@@ -323,4 +323,4 @@ kgdb_breakpoint(int argc, char *argv[])
            ");
 }
 
-#endif /* CFG_CMD_KGDB */
+#endif
index 1de9a8f2c6aab435182e3e9df23de893978ec9cb..80f53bc8863fd8fca4ec9305a896accdcb6b8cb3 100644 (file)
@@ -31,7 +31,7 @@
 
 #define BOOTP_VENDOR_MAGIC     0x63825363      /* RFC1048 Magic Cookie         */
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
 
 #define TIMEOUT                5               /* Seconds before trying BOOTP again    */
 #ifndef CONFIG_NET_RETRY_COUNT
@@ -53,7 +53,7 @@ int           BootpTry;
 ulong          seed1, seed2;
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_DHCP)
+#if defined(CONFIG_CMD_DHCP)
 dhcp_state_t dhcp_state = INIT;
 unsigned long dhcp_leasetime = 0;
 IPaddr_t NetDHCPServerIP = 0;
@@ -76,12 +76,12 @@ static char *dhcpmsg2str(int type)
 }
 #endif
 
-#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_VENDOREX)
+#if defined(CONFIG_BOOTP_VENDOREX)
 extern u8 *dhcp_vendorex_prep (u8 *e); /*rtn new e after add own opts. */
 extern u8 *dhcp_vendorex_proc (u8 *e); /*rtn next e if mine,else NULL  */
 #endif
 
-#endif /* CFG_CMD_DHCP */
+#endif
 
 static int BootpCheckPkt(uchar *pkt, unsigned dest, unsigned src, unsigned len)
 {
@@ -148,7 +148,7 @@ static int truncate_sz (const char *name, int maxlen, int curlen)
        return (curlen);
 }
 
-#if !(CONFIG_COMMANDS & CFG_CMD_DHCP)
+#if !defined(CONFIG_CMD_DHCP)
 
 static void BootpVendorFieldProcess (u8 * ext)
 {
@@ -181,7 +181,7 @@ static void BootpVendorFieldProcess (u8 * ext)
                if (NetOurDNSIP == 0) {
                        NetCopyIP (&NetOurDNSIP, (IPaddr_t *) (ext + 2));
                }
-#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_DNS2)
+#if defined(CONFIG_BOOTP_DNS2)
                if ((NetOurDNS2IP == 0) && (size > 4)) {
                        NetCopyIP (&NetOurDNS2IP, (IPaddr_t *) (ext + 2 + 4));
                }
@@ -344,7 +344,7 @@ BootpHandler(uchar * pkt, unsigned dest, unsigned src, unsigned len)
                         */
                        NetState = NETLOOP_SUCCESS;
                        return;
-#if (CONFIG_COMMANDS & CFG_CMD_NFS)
+#if defined(CONFIG_CMD_NFS)
                } else if (strcmp(s, "NFS") == 0) {
                        /*
                         * Use NFS to load the bootfile.
@@ -357,7 +357,7 @@ BootpHandler(uchar * pkt, unsigned dest, unsigned src, unsigned len)
 
        TftpStart();
 }
-#endif /* !CFG_CMD_DHCP */
+#endif
 
 /*
  *     Timeout on BOOTP/DHCP request.
@@ -377,16 +377,16 @@ BootpTimeout(void)
 /*
  *     Initialize BOOTP extension fields in the request.
  */
-#if (CONFIG_COMMANDS & CFG_CMD_DHCP)
+#if defined(CONFIG_CMD_DHCP)
 static int DhcpExtended (u8 * e, int message_type, IPaddr_t ServerID, IPaddr_t RequestedIP)
 {
        u8 *start = e;
        u8 *cnt;
 
-#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_VENDOREX)
+#if defined(CONFIG_BOOTP_VENDOREX)
        u8 *x;
 #endif
-#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_SEND_HOSTNAME)
+#if defined(CONFIG_BOOTP_SEND_HOSTNAME)
        char *hostname;
 #endif
 
@@ -425,7 +425,7 @@ static int DhcpExtended (u8 * e, int message_type, IPaddr_t ServerID, IPaddr_t R
                *e++ = tmp >> 8;
                *e++ = tmp & 0xff;
        }
-#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_SEND_HOSTNAME)
+#if defined(CONFIG_BOOTP_SEND_HOSTNAME)
        if ((hostname = getenv ("hostname"))) {
                int hostnamelen = strlen (hostname);
 
@@ -436,7 +436,7 @@ static int DhcpExtended (u8 * e, int message_type, IPaddr_t ServerID, IPaddr_t R
        }
 #endif
 
-#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_VENDOREX)
+#if defined(CONFIG_BOOTP_VENDOREX)
        if ((x = dhcp_vendorex_prep (e)))
                return x - start;
 #endif
@@ -444,39 +444,39 @@ static int DhcpExtended (u8 * e, int message_type, IPaddr_t ServerID, IPaddr_t R
        *e++ = 55;              /* Parameter Request List */
         cnt = e++;             /* Pointer to count of requested items */
        *cnt = 0;
-#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_SUBNETMASK)
+#if defined(CONFIG_BOOTP_SUBNETMASK)
        *e++  = 1;              /* Subnet Mask */
        *cnt += 1;
 #endif
-#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_TIMEOFFSET)
+#if defined(CONFIG_BOOTP_TIMEOFFSET)
        *e++  = 2;
        *cnt += 1;
 #endif
-#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_GATEWAY)
+#if defined(CONFIG_BOOTP_GATEWAY)
        *e++  = 3;              /* Router Option */
        *cnt += 1;
 #endif
-#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_DNS)
+#if defined(CONFIG_BOOTP_DNS)
        *e++  = 6;              /* DNS Server(s) */
        *cnt += 1;
 #endif
-#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_HOSTNAME)
+#if defined(CONFIG_BOOTP_HOSTNAME)
        *e++  = 12;             /* Hostname */
        *cnt += 1;
 #endif
-#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_BOOTFILESIZE)
+#if defined(CONFIG_BOOTP_BOOTFILESIZE)
        *e++  = 13;             /* Boot File Size */
        *cnt += 1;
 #endif
-#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_BOOTPATH)
+#if defined(CONFIG_BOOTP_BOOTPATH)
        *e++  = 17;             /* Boot path */
        *cnt += 1;
 #endif
-#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_NISDOMAIN)
+#if defined(CONFIG_BOOTP_NISDOMAIN)
        *e++  = 40;             /* NIS Domain name request */
        *cnt += 1;
 #endif
-#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_NTPSERVER)
+#if defined(CONFIG_BOOTP_NTPSERVER)
        *e++  = 42;
        *cnt += 1;
 #endif
@@ -491,9 +491,9 @@ static int DhcpExtended (u8 * e, int message_type, IPaddr_t ServerID, IPaddr_t R
        return e - start;
 }
 
-#else  /* CFG_CMD_DHCP */
+#else
 /*
- *     Warning: no field size check - change CONFIG_BOOTP_MASK at your own risk!
+ *     Warning: no field size check - change CONFIG_BOOTP_* at your own risk!
  */
 static int BootpExtended (u8 * e)
 {
@@ -504,7 +504,7 @@ static int BootpExtended (u8 * e)
        *e++ = 83;
        *e++ = 99;
 
-#if (CONFIG_COMMANDS & CFG_CMD_DHCP)
+#if defined(CONFIG_CMD_DHCP)
        *e++ = 53;              /* DHCP Message Type */
        *e++ = 1;
        *e++ = DHCP_DISCOVER;
@@ -513,45 +513,45 @@ static int BootpExtended (u8 * e)
        *e++ = 2;
        *e++ = (576 - 312 + OPT_SIZE) >> 16;
        *e++ = (576 - 312 + OPT_SIZE) & 0xff;
-#endif /* CFG_CMD_DHCP */
+#endif
 
-#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_SUBNETMASK)
+#if defined(CONFIG_BOOTP_SUBNETMASK)
        *e++ = 1;               /* Subnet mask request */
        *e++ = 4;
        e   += 4;
 #endif
 
-#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_GATEWAY)
+#if defined(CONFIG_BOOTP_GATEWAY)
        *e++ = 3;               /* Default gateway request */
        *e++ = 4;
        e   += 4;
 #endif
 
-#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_DNS)
+#if defined(CONFIG_BOOTP_DNS)
        *e++ = 6;               /* Domain Name Server */
        *e++ = 4;
        e   += 4;
 #endif
 
-#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_HOSTNAME)
+#if defined(CONFIG_BOOTP_HOSTNAME)
        *e++ = 12;              /* Host name request */
        *e++ = 32;
        e   += 32;
 #endif
 
-#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_BOOTFILESIZE)
+#if defined(CONFIG_BOOTP_BOOTFILESIZE)
        *e++ = 13;              /* Boot file size */
        *e++ = 2;
        e   += 2;
 #endif
 
-#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_BOOTPATH)
+#if defined(CONFIG_BOOTP_BOOTPATH)
        *e++ = 17;              /* Boot path */
        *e++ = 32;
        e   += 32;
 #endif
 
-#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_NISDOMAIN)
+#if defined(CONFIG_BOOTP_NISDOMAIN)
        *e++ = 40;              /* NIS Domain name request */
        *e++ = 32;
        e   += 32;
@@ -561,7 +561,7 @@ static int BootpExtended (u8 * e)
 
        return e - start;
 }
-#endif /* CFG_CMD_DHCP */
+#endif
 
 void
 BootpRequest (void)
@@ -570,7 +570,7 @@ BootpRequest (void)
        Bootp_t *bp;
        int ext_len, pktlen, iplen;
 
-#if (CONFIG_COMMANDS & CFG_CMD_DHCP)
+#if defined(CONFIG_CMD_DHCP)
        dhcp_state = INIT;
 #endif
 
@@ -678,11 +678,11 @@ BootpRequest (void)
        copy_filename (bp->bp_file, BootFile, sizeof(bp->bp_file));
 
        /* Request additional information from the BOOTP/DHCP server */
-#if (CONFIG_COMMANDS & CFG_CMD_DHCP)
+#if defined(CONFIG_CMD_DHCP)
        ext_len = DhcpExtended((u8 *)bp->bp_vend, DHCP_DISCOVER, 0, 0);
 #else
        ext_len = BootpExtended((u8 *)bp->bp_vend);
-#endif /* CFG_CMD_DHCP */
+#endif
 
        /*
         *      Bootp ID is the lower 4 bytes of our ethernet address
@@ -705,16 +705,16 @@ BootpRequest (void)
        NetSetIP(iphdr, 0xFFFFFFFFL, PORT_BOOTPS, PORT_BOOTPC, iplen);
        NetSetTimeout(SELECT_TIMEOUT * CFG_HZ, BootpTimeout);
 
-#if (CONFIG_COMMANDS & CFG_CMD_DHCP)
+#if defined(CONFIG_CMD_DHCP)
        dhcp_state = SELECTING;
        NetSetHandler(DhcpHandler);
 #else
        NetSetHandler(BootpHandler);
-#endif /* CFG_CMD_DHCP */
+#endif
        NetSendPacket(NetTxPacket, pktlen);
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_DHCP)
+#if defined(CONFIG_CMD_DHCP)
 static void DhcpOptionsProcess (uchar * popt, Bootp_t *bp)
 {
        uchar *end = popt + BOOTP_HDR_SIZE;
@@ -726,7 +726,7 @@ static void DhcpOptionsProcess (uchar * popt, Bootp_t *bp)
                case 1:
                        NetCopyIP (&NetOurSubnetMask, (popt + 2));
                        break;
-#if (CONFIG_COMMANDS & CFG_CMD_SNTP) && (CONFIG_BOOTP_MASK & CONFIG_BOOTP_TIMEOFFSET)
+#if defined(CONFIG_CMD_SNTP) && defined(CONFIG_BOOTP_TIMEOFFSET)
                case 2:         /* Time offset  */
                        NetCopyLong (&NetTimeOffset, (ulong *) (popt + 2));
                        NetTimeOffset = ntohl (NetTimeOffset);
@@ -737,7 +737,7 @@ static void DhcpOptionsProcess (uchar * popt, Bootp_t *bp)
                        break;
                case 6:
                        NetCopyIP (&NetOurDNSIP, (popt + 2));
-#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_DNS2)
+#if defined(CONFIG_BOOTP_DNS2)
                        if (*(popt + 1) > 4) {
                                NetCopyIP (&NetOurDNS2IP, (popt + 2 + 4));
                        }
@@ -755,7 +755,7 @@ static void DhcpOptionsProcess (uchar * popt, Bootp_t *bp)
                        memcpy (&NetOurRootPath, popt + 2, size);
                        NetOurRootPath[size] = 0;
                        break;
-#if (CONFIG_COMMANDS & CFG_CMD_SNTP) && (CONFIG_BOOTP_MASK & CONFIG_BOOTP_NTPSERVER)
+#if defined(CONFIG_CMD_SNTP) && defined(CONFIG_BOOTP_NTPSERVER)
                case 42:        /* NTP server IP */
                        NetCopyIP (&NetNtpServerIP, (popt + 2));
                        break;
@@ -801,7 +801,7 @@ static void DhcpOptionsProcess (uchar * popt, Bootp_t *bp)
                        }
                        break;
                default:
-#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_VENDOREX)
+#if defined(CONFIG_BOOTP_VENDOREX)
                        if (dhcp_vendorex_proc (popt))
                                break;
 #endif
@@ -950,7 +950,7 @@ DhcpHandler(uchar * pkt, unsigned dest, unsigned src, unsigned len)
                                         */
                                        NetState = NETLOOP_SUCCESS;
                                        return;
-#if (CONFIG_COMMANDS & CFG_CMD_NFS)
+#if defined(CONFIG_CMD_NFS)
                                } else if (strcmp(s, "NFS") == 0) {
                                        /*
                                         * Use NFS to load the bootfile.
@@ -975,6 +975,6 @@ void DhcpRequest(void)
 {
        BootpRequest();
 }
-#endif /* CFG_CMD_DHCP */
+#endif
 
-#endif /* CFG_CMD_NET */
+#endif
index 0b3163901e3fd7f2e26e6276cb3ead0ad7c3fb28..ba9826e914cb9aaf2bcb2e14103e846ac9b94690 100644 (file)
@@ -18,7 +18,7 @@
 /*
  *     BOOTP header.
  */
-#if (CONFIG_COMMANDS & CFG_CMD_DHCP)
+#if defined(CONFIG_CMD_DHCP)
 #define OPT_SIZE 312   /* Minimum DHCP Options size per RFC2131 - results in 576 byte pkt */
 #else
 #define OPT_SIZE 64
index 68e2c54b2ea53a8eb1081c26b0f3f38e3466dd50..6576ee405bb19a065a920b8db043d35ee113a8be 100644 (file)
--- a/net/eth.c
+++ b/net/eth.c
@@ -26,7 +26,7 @@
 #include <net.h>
 #include <miiphy.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET) && defined(CONFIG_NET_MULTI)
+#if defined(CONFIG_CMD_NET) && defined(CONFIG_NET_MULTI)
 
 #ifdef CFG_GT_6426x
 extern int gt6426x_eth_initialize(bd_t *bis);
@@ -144,7 +144,7 @@ int eth_initialize(bd_t *bis)
        eth_current = NULL;
 
        show_boot_progress (64);
-#if defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII)
+#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
        miiphy_init();
 #endif
 
@@ -458,7 +458,7 @@ char *eth_get_name (void)
 {
        return (eth_current ? eth_current->name : "unknown");
 }
-#elif (CONFIG_COMMANDS & CFG_CMD_NET) && !defined(CONFIG_NET_MULTI)
+#elif defined(CONFIG_CMD_NET) && !defined(CONFIG_NET_MULTI)
 
 extern int at91rm9200_miiphy_initialize(bd_t *bis);
 extern int emac4xx_miiphy_initialize(bd_t *bis);
@@ -467,7 +467,7 @@ extern int ns7520_miiphy_initialize(bd_t *bis);
 
 int eth_initialize(bd_t *bis)
 {
-#if defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII)
+#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
        miiphy_init();
 #endif
 
index 2ff7bfc09f0bf63ae6ca488df6fabce7f44d32b7..e9d77576419ff1bdd024fc62cf2655bc6941527b 100644 (file)
--- a/net/net.c
+++ b/net/net.c
 #include <status_led.h>
 #include <miiphy.h>
 #endif
-#if (CONFIG_COMMANDS & CFG_CMD_SNTP)
+#if defined(CONFIG_CMD_SNTP)
 #include "sntp.h"
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -110,7 +110,7 @@ DECLARE_GLOBAL_DATA_PTR;
 IPaddr_t       NetOurSubnetMask=0;             /* Our subnet mask (0=unknown)  */
 IPaddr_t       NetOurGatewayIP=0;              /* Our gateways IP address      */
 IPaddr_t       NetOurDNSIP=0;                  /* Our DNS IP address           */
-#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_DNS2)
+#if defined(CONFIG_BOOTP_DNS2)
 IPaddr_t       NetOurDNS2IP=0;                 /* Our 2nd DNS IP address       */
 #endif
 char           NetOurNISDomain[32]={0,};       /* Our NIS domain               */
@@ -133,7 +133,7 @@ uchar               NetBcastAddr[6] =       /* Ethernet bcast address               */
                        { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
 uchar          NetEtherNullAddr[6] =
                        { 0, 0, 0, 0, 0, 0 };
-#if (CONFIG_COMMANDS & CFG_CMD_CDP)
+#if defined(CONFIG_CMD_CDP)
 uchar          NetCDPAddr[6] =         /* Ethernet bcast address               */
                        { 0x01, 0x00, 0x0c, 0xcc, 0xcc, 0xcc };
 #endif
@@ -150,17 +150,17 @@ ushort            NetOurNativeVLAN = 0xFFFF;      /* ditto                        */
 
 char           BootFile[128];          /* Boot File name                       */
 
-#if (CONFIG_COMMANDS & CFG_CMD_PING)
+#if defined(CONFIG_CMD_PING)
 IPaddr_t       NetPingIP;              /* the ip address to ping               */
 
 static void PingStart(void);
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_CDP)
+#if defined(CONFIG_CMD_CDP)
 static void CDPStart(void);
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_SNTP)
+#if defined(CONFIG_CMD_SNTP)
 IPaddr_t       NetNtpServerIP;         /* NTP server IP address                */
 int            NetTimeOffset=0;        /* offset time from UTC                 */
 #endif
@@ -326,13 +326,13 @@ restart:
         */
 
        switch (protocol) {
-#if (CONFIG_COMMANDS & CFG_CMD_NFS)
+#if defined(CONFIG_CMD_NFS)
        case NFS:
 #endif
-#if (CONFIG_COMMANDS & CFG_CMD_PING)
+#if defined(CONFIG_CMD_PING)
        case PING:
 #endif
-#if (CONFIG_COMMANDS & CFG_CMD_SNTP)
+#if defined(CONFIG_CMD_SNTP)
        case SNTP:
 #endif
        case NETCONS:
@@ -344,19 +344,19 @@ restart:
                NetOurNativeVLAN = getenv_VLAN("nvlan");
 
                switch (protocol) {
-#if (CONFIG_COMMANDS & CFG_CMD_NFS)
+#if defined(CONFIG_CMD_NFS)
                case NFS:
 #endif
                case NETCONS:
                case TFTP:
                        NetServerIP = getenv_IPaddr ("serverip");
                        break;
-#if (CONFIG_COMMANDS & CFG_CMD_PING)
+#if defined(CONFIG_CMD_PING)
                case PING:
                        /* nothing */
                        break;
 #endif
-#if (CONFIG_COMMANDS & CFG_CMD_SNTP)
+#if defined(CONFIG_CMD_SNTP)
                case SNTP:
                        /* nothing */
                        break;
@@ -406,7 +406,7 @@ restart:
                        TftpStart();
                        break;
 
-#if (CONFIG_COMMANDS & CFG_CMD_DHCP)
+#if defined(CONFIG_CMD_DHCP)
                case DHCP:
                        /* Start with a clean slate... */
                        BootpTry = 0;
@@ -414,7 +414,7 @@ restart:
                        NetServerIP = getenv_IPaddr ("serverip");
                        DhcpRequest();          /* Basically same as BOOTP */
                        break;
-#endif /* CFG_CMD_DHCP */
+#endif
 
                case BOOTP:
                        BootpTry = 0;
@@ -425,17 +425,17 @@ restart:
                        RarpTry = 0;
                        RarpRequest ();
                        break;
-#if (CONFIG_COMMANDS & CFG_CMD_PING)
+#if defined(CONFIG_CMD_PING)
                case PING:
                        PingStart();
                        break;
 #endif
-#if (CONFIG_COMMANDS & CFG_CMD_NFS)
+#if defined(CONFIG_CMD_NFS)
                case NFS:
                        NfsStart();
                        break;
 #endif
-#if (CONFIG_COMMANDS & CFG_CMD_CDP)
+#if defined(CONFIG_CMD_CDP)
                case CDP:
                        CDPStart();
                        break;
@@ -445,7 +445,7 @@ restart:
                        NcStart();
                        break;
 #endif
-#if (CONFIG_COMMANDS & CFG_CMD_SNTP)
+#if defined(CONFIG_CMD_SNTP)
                case SNTP:
                        SntpStart();
                        break;
@@ -458,7 +458,7 @@ restart:
                break;
        }
 
-#if defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII)
+#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
 #if defined(CFG_FAULT_ECHO_LINK_DOWN) && defined(CONFIG_STATUS_LED) && defined(STATUS_LED_RED)
        /*
         * Echo the inverted link state to the fault LED.
@@ -507,7 +507,7 @@ restart:
                if (timeHandler && ((get_timer(0) - timeStart) > timeDelta)) {
                        thand_f *x;
 
-#if defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII)
+#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
 #  if defined(CFG_FAULT_ECHO_LINK_DOWN) && \
       defined(CONFIG_STATUS_LED) &&       \
       defined(STATUS_LED_RED)
@@ -687,7 +687,7 @@ NetSendUDPPacket(uchar *ether, IPaddr_t dest, int dport, int sport, int len)
        return 0;       /* transmitted */
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_PING)
+#if defined(CONFIG_CMD_PING)
 static ushort PingSeqNo;
 
 int PingSend(void)
@@ -775,9 +775,9 @@ static void PingStart(void)
 
        PingSend();
 }
-#endif /* CFG_CMD_PING */
+#endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_CDP)
+#if defined(CONFIG_CMD_CDP)
 
 #define CDP_DEVICE_ID_TLV              0x0001
 #define CDP_ADDRESS_TLV                        0x0002
@@ -1128,7 +1128,7 @@ static void CDPStart(void)
 
        CDPSendTrigger();
 }
-#endif /* CFG_CMD_CDP */
+#endif
 
 
 void
@@ -1140,7 +1140,7 @@ NetReceive(volatile uchar * inpkt, int len)
        IPaddr_t tmp;
        int     x;
        uchar *pkt;
-#if (CONFIG_COMMANDS & CFG_CMD_CDP)
+#if defined(CONFIG_CMD_CDP)
        int iscdp;
 #endif
        ushort cti = 0, vlanid = VLAN_NONE, myvlanid, mynvlanid;
@@ -1157,7 +1157,7 @@ NetReceive(volatile uchar * inpkt, int len)
        if (len < ETHER_HDR_SIZE)
                return;
 
-#if (CONFIG_COMMANDS & CFG_CMD_CDP)
+#if defined(CONFIG_CMD_CDP)
        /* keep track if packet is CDP */
        iscdp = memcmp(et->et_dest, NetCDPAddr, 6) == 0;
 #endif
@@ -1200,7 +1200,7 @@ NetReceive(volatile uchar * inpkt, int len)
 
                /* if no VLAN active */
                if ((ntohs(NetOurVLAN) & VLAN_IDMASK) == VLAN_NONE
-#if (CONFIG_COMMANDS & CFG_CMD_CDP)
+#if defined(CONFIG_CMD_CDP)
                                && iscdp == 0
 #endif
                                )
@@ -1218,7 +1218,7 @@ NetReceive(volatile uchar * inpkt, int len)
        printf("Receive from protocol 0x%x\n", x);
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_CDP)
+#if defined(CONFIG_CMD_CDP)
        if (iscdp) {
                CDPHandler((uchar *)ip, len);
                return;
@@ -1416,7 +1416,7 @@ NetReceive(volatile uchar * inpkt, int len)
                                print_IPaddr(icmph->un.gateway);
                                putc(' ');
                                return;
-#if (CONFIG_COMMANDS & CFG_CMD_PING)
+#if defined(CONFIG_CMD_PING)
                        case ICMP_ECHO_REPLY:
                                /*
                                 *      IP header OK.  Pass the packet to the current handler.
@@ -1516,7 +1516,7 @@ static int net_check_prereq (proto_t protocol)
 {
        switch (protocol) {
                /* Fall through */
-#if (CONFIG_COMMANDS & CFG_CMD_PING)
+#if defined(CONFIG_CMD_PING)
        case PING:
                if (NetPingIP == 0) {
                        puts ("*** ERROR: ping address not given\n");
@@ -1524,7 +1524,7 @@ static int net_check_prereq (proto_t protocol)
                }
                goto common;
 #endif
-#if (CONFIG_COMMANDS & CFG_CMD_SNTP)
+#if defined(CONFIG_CMD_SNTP)
        case SNTP:
                if (NetNtpServerIP == 0) {
                        puts ("*** ERROR: NTP server address not given\n");
@@ -1532,7 +1532,7 @@ static int net_check_prereq (proto_t protocol)
                }
                goto common;
 #endif
-#if (CONFIG_COMMANDS & CFG_CMD_NFS)
+#if defined(CONFIG_CMD_NFS)
        case NFS:
 #endif
        case NETCONS:
@@ -1541,7 +1541,7 @@ static int net_check_prereq (proto_t protocol)
                        puts ("*** ERROR: `serverip' not set\n");
                        return (1);
                }
-#if (CONFIG_COMMANDS & (CFG_CMD_PING | CFG_CMD_SNTP))
+#if defined(CONFIG_CMD_PING) || defined(CONFIG_CMD_SNTP)
     common:
 #endif
 
@@ -1693,7 +1693,7 @@ void copy_filename (char *dst, char *src, int size)
        *dst = '\0';
 }
 
-#endif /* CFG_CMD_NET */
+#endif
 
 void ip_to_string (IPaddr_t x, char *s)
 {
index de789e1f848d7f14d95f8badbd6976ca9341d136..df2caac48c83ad562767301858387c3b5acc5e3c 100644 (file)
--- a/net/nfs.c
+++ b/net/nfs.c
@@ -31,7 +31,7 @@
 
 /*#define NFS_DEBUG*/
 
-#if ((CONFIG_COMMANDS & CFG_CMD_NET) && (CONFIG_COMMANDS & CFG_CMD_NFS))
+#if defined(CONFIG_CMD_NET) && defined(CONFIG_CMD_NFS)
 
 #define HASHES_PER_LINE 65     /* Number of "loading" hashes per line  */
 #define NFS_TIMEOUT 60
@@ -775,4 +775,4 @@ NfsStart (void)
        NfsSend ();
 }
 
-#endif /* CONFIG_COMMANDS & CFG_CMD_NFS */
+#endif
index 1ba60e803cca4920c0ea0102fab42b60df84064a..21dfa529c9a381934612e12e62da1e9c0ea438f8 100644 (file)
@@ -29,7 +29,7 @@
 #include "rarp.h"
 #include "tftp.h"
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
 
 #define TIMEOUT                5               /* Seconds before trying BOOTP again */
 #ifndef        CONFIG_NET_RETRY_COUNT
@@ -59,7 +59,7 @@ RarpHandler(uchar * dummi0, unsigned dummi1, unsigned dummi2, unsigned dummi3)
                         */
                        NetState = NETLOOP_SUCCESS;
                        return;
-#if (CONFIG_COMMANDS & CFG_CMD_NFS)
+#if defined(CONFIG_CMD_NFS)
                } else if ((s != NULL) && !strcmp(s, "NFS")) {
                        NfsStart();
                        return;
@@ -119,4 +119,4 @@ RarpRequest (void)
        NetSetHandler(RarpHandler);
 }
 
-#endif /* CFG_CMD_NET */
+#endif
index db8c2c279984c6af7a882bde0a90837338b467fc..95e75422c107dcdbd9eb8f25f021c0d21ba77e4a 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "sntp.h"
 
-#if ((CONFIG_COMMANDS & CFG_CMD_NET) && (CONFIG_COMMANDS & CFG_CMD_SNTP))
+#if defined(CONFIG_CMD_NET) && defined(CONFIG_CMD_SNTP)
 
 #define SNTP_TIMEOUT 10
 
@@ -67,7 +67,7 @@ SntpHandler (uchar *pkt, unsigned dest, unsigned src, unsigned len)
        memcpy (&seconds, &rpktp->transmit_timestamp, sizeof(ulong));
 
        to_tm(ntohl(seconds) - 2208988800UL + NetTimeOffset, &tm);
-#if (CONFIG_COMMANDS & CFG_CMD_DATE)
+#if defined(CONFIG_CMD_DATE)
        rtc_set (&tm);
 #endif
        printf ("Date: %4d-%02d-%02d Time: %2d:%02d:%02d\n",
@@ -89,4 +89,4 @@ SntpStart (void)
        SntpSend ();
 }
 
-#endif /* CONFIG_COMMANDS & CFG_CMD_SNTP */
+#endif
index f3a547148386171fe510c930b52e564a348ec89a..d56e30b5b5c28a16a50912d864cba18d86492375 100644 (file)
@@ -12,7 +12,7 @@
 
 #undef ET_DEBUG
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
 
 #define WELL_KNOWN_PORT        69              /* Well known TFTP port #               */
 #define TIMEOUT                5               /* Seconds to timeout for a lost pkt    */
@@ -386,4 +386,4 @@ TftpStart (void)
        TftpSend ();
 }
 
-#endif /* CFG_CMD_NET */
+#endif
index 85bbb56e3960cb51e9e98fe5301399ab1ad2e369..8856bb9b5f84a49387c8b2175ec8548d4dd1b5b4 100644 (file)
@@ -49,7 +49,7 @@
 #include <command.h>
 #include <rtc.h>
 
-#if defined(CONFIG_RTC_BFIN) && (CONFIG_COMMANDS & CFG_CMD_DATE)
+#if defined(CONFIG_RTC_BFIN) && defined(CONFIG_CMD_DATE)
 
 #include <asm/blackfin.h>
 #include <asm/arch/bf5xx_rtc.h>
@@ -140,4 +140,4 @@ void rtc_get(struct rtc_time *tmp)
            MIN_TO_SECS(tm_min) + HRS_TO_SECS(tm_hour) + DAYS_TO_SECS(tm_day);
        to_tm(time_in_sec, tmp);
 }
-#endif                         /* CONFIG_RTC_BFIN && CFG_CMD_DATE */
+#endif
index b5f8c48eb357075d380d063a1cfa214610fc8c22..a83a7235ab619a333b41c3cd74eb63ee0648eb19 100644 (file)
@@ -29,7 +29,7 @@
 #include <command.h>
 #include <rtc.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_DATE) || defined(CONFIG_TIMESTAMP)
+#if defined(CONFIG_CMD_DATE) || defined(CONFIG_TIMESTAMP)
 
 #define FEBRUARY               2
 #define        STARTOFTIME             1970
@@ -153,4 +153,4 @@ mktime (unsigned int year, unsigned int mon,
        )*60 + sec; /* finally seconds */
 }
 
-#endif /* CFG_CMD_DATE */
+#endif
index 8b12893ce28c02edddd9655530362cc9c13cc2f9..84fecf0194036e005584f715c35bba31df2b2595 100644 (file)
@@ -28,7 +28,7 @@
 #include <config.h>
 #include <rtc.h>
 
-#if defined(CONFIG_RTC_DS12887) && (CONFIG_COMMANDS & CFG_CMD_DATE)
+#if defined(CONFIG_RTC_DS12887) && defined(CONFIG_CMD_DATE)
 
 #define RTC_SECONDS                    0x00
 #define RTC_SECONDS_ALARM              0x01
@@ -235,4 +235,4 @@ void rtc_reset (void)
        rtc_write(RTC_CONTROL_B,ctrl_rg);
 }
 
-#endif  /* (CONFIG_RTC_DS12887) && (CONFIG_COMMANDS & CFG_CMD_DATE) */
+#endif
index 98dce899a97f7998b11f58e8c7897ba9f7e0b95a..55af1302d577c250dc974796e72b91de6754e4c7 100644 (file)
@@ -9,7 +9,7 @@
 #include <command.h>
 #include <rtc.h>
 
-#if defined(CONFIG_RTC_DS1302) && (CONFIG_COMMANDS & CFG_CMD_DATE)
+#if defined(CONFIG_RTC_DS1302) && defined(CONFIG_CMD_DATE)
 
 /* GPP Pins */
 #define DATA           0x200
index e01e1ceae97dc5d6ec21e19be5a4132117150747..89e433dabd8894cddece689ebb84c0cd31e33a6d 100644 (file)
@@ -36,7 +36,7 @@
 #include <rtc.h>
 #include <spi.h>
 
-#if defined(CONFIG_RTC_DS1306) && (CONFIG_COMMANDS & CFG_CMD_DATE)
+#if defined(CONFIG_RTC_DS1306) && defined(CONFIG_CMD_DATE)
 
 #define        RTC_SECONDS             0x00
 #define        RTC_MINUTES             0x01
index 3b26a0a327ad7f18169969fc0895debfe5b79408..c882d7989a097ba7a62599d5ad028d1c728c71d8 100644 (file)
@@ -36,7 +36,7 @@
 #include <i2c.h>
 
 #if (defined(CONFIG_RTC_DS1307) || defined(CONFIG_RTC_DS1338) ) && \
-    (CONFIG_COMMANDS & CFG_CMD_DATE)
+    defined(CONFIG_CMD_DATE)
 
 /*---------------------------------------------------------------------*/
 #undef DEBUG_RTC
@@ -201,4 +201,4 @@ static unsigned char bin2bcd (unsigned int n)
        return (((n / 10) << 4) | (n % 10));
 }
 
-#endif /* (CONFIG_RTC_DS1307 || CONFIG_RTC_DS1338) && (CFG_COMMANDS & CFG_CMD_DATE) */
+#endif
index 9f0c8c01ef8c14a09e021ebdf47ca288247321eb..c636ac5948f718879a3bd11ebaa588d24a9dc856 100644 (file)
@@ -32,7 +32,7 @@
 #include <rtc.h>
 #include <i2c.h>
 
-#if defined(CONFIG_RTC_DS1337) && (CONFIG_COMMANDS & CFG_CMD_DATE)
+#if defined(CONFIG_RTC_DS1337) && defined(CONFIG_CMD_DATE)
 
 /*---------------------------------------------------------------------*/
 #undef DEBUG_RTC
@@ -188,4 +188,4 @@ static unsigned char bin2bcd (unsigned int n)
        return (((n / 10) << 4) | (n % 10));
 }
 
-#endif /* CONFIG_RTC_DS1337 && (CFG_COMMANDS & CFG_CMD_DATE) */
+#endif
index 50a996c5cbd7e24266b688630b96401a422d2313..e773dd92615fbc32fd6fcbdca1e7faccd5df96c8 100644 (file)
@@ -35,7 +35,7 @@
 #include <rtc.h>
 #include <i2c.h>
 
-#if (defined(CONFIG_RTC_DS1374)) && (CONFIG_COMMANDS & CFG_CMD_DATE)
+#if (defined(CONFIG_RTC_DS1374)) && defined(CONFIG_CMD_DATE)
 
 /*---------------------------------------------------------------------*/
 #undef DEBUG_RTC
@@ -250,4 +250,4 @@ static void rtc_write_raw (uchar reg, uchar val)
 {
                i2c_reg_write (CFG_I2C_RTC_ADDR, reg, val);
 }
-#endif /* (CONFIG_RTC_DS1374) && (CFG_COMMANDS & CFG_CMD_DATE) */
+#endif
index dd9ea5ef8099c199095ad131c7f41634d5e044b4..4365cfb9813c39ba36faf45c84b88ba1d7e19187 100644 (file)
@@ -37,7 +37,7 @@
 #include <rtc.h>
 
 
-#if defined(CONFIG_RTC_DS1556) && (CONFIG_COMMANDS & CFG_CMD_DATE)
+#if defined(CONFIG_RTC_DS1556) && defined(CONFIG_CMD_DATE)
 
 static uchar rtc_read( unsigned int addr );
 static void  rtc_write( unsigned int addr, uchar val);
@@ -203,4 +203,4 @@ static unsigned char bin2bcd (unsigned int n)
        return (((n / 10) << 4) | (n % 10));
 }
 
-#endif /* CONFIG_RTC_DS1556 && CFG_CMD_DATE */
+#endif
index 3cc76aba00940307a59c9f8bd3f9b9bb04b2da4f..bff22b9a058cdc34c5d63d5e1f91357066ea0bac 100644 (file)
@@ -37,7 +37,7 @@
 #include <rtc.h>
 
 
-#if defined(CONFIG_RTC_DS164x) && (CONFIG_COMMANDS & CFG_CMD_DATE)
+#if defined(CONFIG_RTC_DS164x) && defined(CONFIG_CMD_DATE)
 
 static uchar    rtc_read(unsigned int addr );
 static void     rtc_write(unsigned int addr, uchar val);
@@ -197,4 +197,4 @@ static unsigned char bin2bcd (unsigned int n)
        return (((n / 10) << 4) | (n % 10));
 }
 
-#endif /* CONFIG_RTC_DS164x && CFG_CMD_DATE */
+#endif
index 58b13e9daa18a666add82e404f025bcf7eb128d1..5f85a68170bb002560084b34a3c8949bef812c2f 100644 (file)
@@ -33,7 +33,7 @@
 #include <command.h>
 #include <rtc.h>
 
-#if defined(CONFIG_RTC_DS174x) && (CONFIG_COMMANDS & CFG_CMD_DATE)
+#if defined(CONFIG_RTC_DS174x) && defined(CONFIG_CMD_DATE)
 
 static uchar rtc_read( unsigned int addr );
 static void  rtc_write( unsigned int addr, uchar val);
@@ -199,4 +199,4 @@ static unsigned char bin2bcd (unsigned int n)
        return (((n / 10) << 4) | (n % 10));
 }
 
-#endif /* CONFIG_RTC_MC146818 && CFG_CMD_DATE */
+#endif
index 50aeeb5615d355e84b4014f7d794b74e7f765de1..fe11b869f55ac1aa384864a2ab29a00919639680 100644 (file)
@@ -33,7 +33,7 @@
 #include <rtc.h>
 #include <i2c.h>
 
-#if defined(CONFIG_RTC_DS3231) && (CONFIG_COMMANDS & CFG_CMD_DATE)
+#if defined(CONFIG_RTC_DS3231) && defined(CONFIG_CMD_DATE)
 
 /*---------------------------------------------------------------------*/
 #undef DEBUG_RTC
@@ -190,4 +190,4 @@ static unsigned char bin2bcd (unsigned int n)
        return (((n / 10) << 4) | (n % 10));
 }
 
-#endif /* (CONFIG_RTC_DS3231) && (CONFIG_COMMANDS & CFG_CMD_DATE) */
+#endif
index c725cc9045f868192fd4d1060c538650aecac1f5..81da33a31e1879d0a47c5e7290e12e5be308c37e 100644 (file)
@@ -43,7 +43,7 @@
 #endif
 */
 
-#if defined(CONFIG_RTC_M41T11) && defined(CFG_I2C_RTC_ADDR) && (CONFIG_COMMANDS & CFG_CMD_DATE)
+#if defined(CONFIG_RTC_M41T11) && defined(CFG_I2C_RTC_ADDR) && defined(CONFIG_CMD_DATE)
 
 static unsigned bcd2bin (uchar n)
 {
@@ -199,4 +199,4 @@ int rtc_recall(int addr, unsigned char* data, int size)
        return i2c_read( CFG_I2C_RTC_ADDR, REG_CNT+addr, 1, data, size );
 }
 
-#endif /* CONFIG_RTC_M41T11 && CFG_I2C_RTC_ADDR && CFG_CMD_DATE */
+#endif
index 6c38a538b9f46af638dc39cb883bd8a949dbfe8a..0a0ffa8aac12fd9844037c78e91f947ea790a853 100644 (file)
@@ -33,7 +33,7 @@
 #include <rtc.h>
 #include <config.h>
 
-#if defined(CONFIG_RTC_M48T35A) && (CONFIG_COMMANDS & CFG_CMD_DATE)
+#if defined(CONFIG_RTC_M48T35A) && defined(CONFIG_CMD_DATE)
 
 static uchar rtc_read  (uchar reg);
 static void  rtc_write (uchar reg, uchar val);
@@ -163,4 +163,4 @@ static unsigned char bin2bcd (unsigned int n)
        return (((n / 10) << 4) | (n % 10));
 }
 
-#endif /* CONFIG_RTC_M48T35A && CFG_CMD_DATE */
+#endif
index 73919cd98d0ca3aee0dd8fbd116520ba1e803911..c75a8e04c244b1b1216292ae5de03a8ad2730fcb 100644 (file)
@@ -32,7 +32,7 @@
 #include <rtc.h>
 #include <i2c.h>
 
-#if defined(CONFIG_RTC_MAX6900) && (CONFIG_COMMANDS & CFG_CMD_DATE)
+#if defined(CONFIG_RTC_MAX6900) && defined(CONFIG_CMD_DATE)
 
 #ifndef        CFG_I2C_RTC_ADDR
 #define        CFG_I2C_RTC_ADDR        0x50
@@ -128,4 +128,4 @@ void rtc_reset (void)
 {
 }
 
-#endif /* CONFIG_RTC_MAX6900 && CFG_CMD_DATE */
+#endif
index 20b1b3e77022a6b5d88112e7dcea5da407f816b6..ab377ed73e567d985d6423600cc074cff475e603 100644 (file)
@@ -31,7 +31,7 @@
 #include <command.h>
 #include <rtc.h>
 
-#if defined(CONFIG_RTC_MC146818) && (CONFIG_COMMANDS & CFG_CMD_DATE)
+#if defined(CONFIG_RTC_MC146818) && defined(CONFIG_CMD_DATE)
 
 static uchar rtc_read  (uchar reg);
 static void  rtc_write (uchar reg, uchar val);
@@ -175,4 +175,4 @@ static unsigned char bin2bcd (unsigned int n)
        return (((n / 10) << 4) | (n % 10));
 }
 
-#endif /* CONFIG_RTC_MC146818 && CFG_CMD_DATE */
+#endif
index 64f751f75f385e903ae81d2f82eb967122392822..bacdb5b70bad7516d5cb41f5759b8bc6f317557b 100644 (file)
@@ -131,7 +131,7 @@ void nvram_write(short dest, const void *src, size_t count)
                rtc_write(d++, *s++);
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_DATE)
+#if defined(CONFIG_CMD_DATE)
 
 /* ------------------------------------------------------------------------- */
 
@@ -233,5 +233,5 @@ void rtc_set_watchdog(short multi, short res)
        rtc_write(RTC_WATCHDOG, wd_value);
 }
 
-#endif /* (CONFIG_COMMANDS & CFG_CMD_DATE) */
+#endif
 #endif /* CONFIG_RTC_MK48T59 */
index 2053df153f4cb91e069cb9c09d2b60b2f75ca742..216386aba052efcd48953e71a3b25825f254baa4 100644 (file)
@@ -32,7 +32,7 @@
 #include <command.h>
 #include <rtc.h>
 
-#if defined(CONFIG_RTC_MPC5200) && (CONFIG_COMMANDS & CFG_CMD_DATE)
+#if defined(CONFIG_RTC_MPC5200) && defined(CONFIG_CMD_DATE)
 
 /*****************************************************************************
  * this structure should be defined in mpc5200.h ...
@@ -137,4 +137,4 @@ void rtc_reset (void)
        return; /* nothing to do */
 }
 
-#endif /* CONFIG_RTC_MPC5200 && CFG_CMD_DATE */
+#endif
index 830e56e17c5ff1e6c31c15704aa994c6b663adc0..8d10c0e465e4028bf4fbc4dd2a9f84d3800617e5 100644 (file)
@@ -31,7 +31,7 @@
 #include <command.h>
 #include <rtc.h>
 
-#if defined(CONFIG_RTC_MPC8xx) && (CONFIG_COMMANDS & CFG_CMD_DATE)
+#if defined(CONFIG_RTC_MPC8xx) && defined(CONFIG_CMD_DATE)
 
 /* ------------------------------------------------------------------------- */
 
@@ -70,6 +70,4 @@ void rtc_reset (void)
        return; /* nothing to do */
 }
 
-/* ------------------------------------------------------------------------- */
-
-#endif /* CONFIG_RTC_MPC8xx && CFG_CMD_DATE */
+#endif
index 05ae97eab8e3cba243d261ec7cca16a0d3275b96..2d73d5d7ef965728dc6d4781d951ca0813351ce5 100644 (file)
@@ -32,7 +32,7 @@
 #include <rtc.h>
 #include <i2c.h>
 
-#if defined(CONFIG_RTC_PCF8563) && (CONFIG_COMMANDS & CFG_CMD_DATE)
+#if defined(CONFIG_RTC_PCF8563) && defined(CONFIG_CMD_DATE)
 
 static uchar rtc_read  (uchar reg);
 static void  rtc_write (uchar reg, uchar val);
@@ -141,4 +141,4 @@ static unsigned char bin2bcd (unsigned int n)
        return (((n / 10) << 4) | (n % 10));
 }
 
-#endif /* CONFIG_RTC_PCF8563 && CFG_CMD_DATE */
+#endif
index b56808b8baeac76719f40f6d18de53dde6635f15..3d1346eaa7a4e44113089f5ee90b3b91acd9e1fb 100644 (file)
@@ -34,7 +34,7 @@
 #include <rtc.h>
 #include <i2c.h>
 
-#if defined(CONFIG_RTC_RS5C372A) && (CONFIG_COMMANDS & CFG_CMD_DATE)
+#if defined(CONFIG_RTC_RS5C372A) && defined(CONFIG_CMD_DATE)
 /*
  * Reads are always done starting with register 15, which requires some
  * jumping-through-hoops to access the data correctly.
@@ -299,4 +299,4 @@ bin2bcd (unsigned int n)
 {
        return (((n / 10) << 4) | (n % 10));
 }
-#endif /* defined(CONFIG_RTC_RS5C372A) && (CONFIG_COMMANDS & CFG_CMD_DATE) */
+#endif
index 9e2191e873cc781eac528e91dfe457b55d9c9306..7f8b4fad0dda66489a0828b16110ed9cc533b8e9 100644 (file)
@@ -28,7 +28,7 @@
 #include <common.h>
 #include <command.h>
 
-#if defined(CONFIG_RTC_S3C24X0) && (CONFIG_COMMANDS & CFG_CMD_DATE)
+#if defined(CONFIG_RTC_S3C24X0) && (defined(CONFIG_CMD_DATE))
 
 #if defined(CONFIG_S3C2400)
 #include <s3c2400.h>
@@ -175,6 +175,4 @@ void rtc_reset (void)
        rtc->RTCCON &= ~(0x08|0x01);
 }
 
-/* ------------------------------------------------------------------------- */
-
-#endif /* CONFIG_RTC_S3C24X0 && CFG_CMD_DATE */
+#endif
index c0e57729f7d280e43b9b5beef292c9cab4581d7b..a976e0da610f6f67516498ac01d8e489c74bcfdb 100644 (file)
@@ -28,7 +28,7 @@
 #include <command.h>
 #include <flash.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_FLASH)
+#if defined(CONFIG_CMD_FLASH)
 
 extern flash_info_t flash_info[];      /* info for FLASH chips */
 
@@ -427,4 +427,4 @@ int flash_sect_protect (int p, ulong addr_first, ulong addr_last)
        return rcode;
 }
 
-#endif /* CFG_CMD_FLASH */
+#endif