--- np2/i386c/ia32/cpu_io.c 2004/02/04 13:24:35 1.2 +++ np2/i386c/ia32/cpu_io.c 2004/02/20 16:09:04 1.4 @@ -1,4 +1,4 @@ -/* $Id: cpu_io.c,v 1.2 2004/02/04 13:24:35 monaka Exp $ */ +/* $Id: cpu_io.c,v 1.4 2004/02/20 16:09:04 monaka Exp $ */ /* * Copyright (c) 2003 NONAKA Kimihiro @@ -34,36 +34,37 @@ static void -check_io(WORD port, int len) +check_io(UINT port, UINT len) { - WORD off; - BYTE bit; - BYTE map; + UINT off; + UINT8 bit; + UINT8 map; - /* そもそも I/O 許可マップが無い場合 */ if (CPU_STAT_IOLIMIT == 0) { + VERBOSE(("check_io: CPU_STAT_IOLIMIT == 0 (port = %04x, len = %d)", port, len)); EXCEPTION(GP_EXCEPTION, 0); } off = port / 8; bit = 1 << (port % 8); for (; len > 0; ++off, bit = 0x01) { - /* I/O 許可マップはビット単位なので */ - if (off * 8 >= CPU_STAT_IOLIMIT) { + if (off >= CPU_STAT_IOLIMIT) { + VERBOSE(("check_io: off(%08x) >= CPU_STAT_IOLIMIT(%08x) (port = %04x, len = %d)", off, CPU_STAT_IOLIMIT, port, len)); EXCEPTION(GP_EXCEPTION, 0); } map = cpu_kmemoryread(CPU_STAT_IOADDR + off); for (; (len > 0) && (bit != 0x00); bit <<= 1, --len) { if (map & bit) { + VERBOSE(("check_io: (bitmap(0x%02x) & bit(0x%02x)) != 0 (port = %04x, len = %d)", map, bit, port, len)); EXCEPTION(GP_EXCEPTION, 0); } } } } -BYTE -cpu_in(WORD port) +UINT8 +cpu_in(UINT port) { if (CPU_STAT_PM && (CPU_STAT_VM86 || (CPU_STAT_CPL > CPU_STAT_IOPL))) { @@ -72,8 +73,8 @@ cpu_in(WORD port) return iocore_inp8(port); } -WORD -cpu_in_w(WORD port) +UINT16 +cpu_in_w(UINT port) { if (CPU_STAT_PM && (CPU_STAT_VM86 || (CPU_STAT_CPL > CPU_STAT_IOPL))) { @@ -82,8 +83,8 @@ cpu_in_w(WORD port) return iocore_inp16(port); } -DWORD -cpu_in_d(WORD port) +UINT32 +cpu_in_d(UINT port) { if (CPU_STAT_PM && (CPU_STAT_VM86 || (CPU_STAT_CPL > CPU_STAT_IOPL))) { @@ -93,7 +94,7 @@ cpu_in_d(WORD port) } void -cpu_out(WORD port, BYTE data) +cpu_out(UINT port, UINT8 data) { if (CPU_STAT_PM && (CPU_STAT_VM86 || (CPU_STAT_CPL > CPU_STAT_IOPL))) { @@ -103,7 +104,7 @@ cpu_out(WORD port, BYTE data) } void -cpu_out_w(WORD port, WORD data) +cpu_out_w(UINT port, UINT16 data) { if (CPU_STAT_PM && (CPU_STAT_VM86 || (CPU_STAT_CPL > CPU_STAT_IOPL))) { @@ -113,7 +114,7 @@ cpu_out_w(WORD port, WORD data) } void -cpu_out_d(WORD port, DWORD data) +cpu_out_d(UINT port, UINT32 data) { if (CPU_STAT_PM && (CPU_STAT_VM86 || (CPU_STAT_CPL > CPU_STAT_IOPL))) {