Author: aandrejevic
Date: Thu Oct 23 11:44:07 2014
New Revision: 64917

URL: http://svn.reactos.org/svn/reactos?rev=64917&view=rev
Log:
[FAST486][NTVDM]
Arch, I/O port numbers should always be stored in USHORT variables!


Modified:
    trunk/reactos/include/reactos/libs/fast486/fast486.h
    trunk/reactos/lib/fast486/fast486.c
    trunk/reactos/subsystems/ntvdm/emulator.c
    trunk/reactos/subsystems/ntvdm/hardware/cmos.c
    trunk/reactos/subsystems/ntvdm/hardware/pic.c
    trunk/reactos/subsystems/ntvdm/hardware/ps2.c
    trunk/reactos/subsystems/ntvdm/hardware/timer.c
    trunk/reactos/subsystems/ntvdm/hardware/vga.c
    trunk/reactos/subsystems/ntvdm/io.c
    trunk/reactos/subsystems/ntvdm/io.h

Modified: trunk/reactos/include/reactos/libs/fast486/fast486.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/libs/fast486/fast486.h?rev=64917&r1=64916&r2=64917&view=diff
==============================================================================
--- trunk/reactos/include/reactos/libs/fast486/fast486.h        [iso-8859-1] 
(original)
+++ trunk/reactos/include/reactos/libs/fast486/fast486.h        [iso-8859-1] 
Thu Oct 23 11:44:07 2014
@@ -190,7 +190,7 @@
 (NTAPI *FAST486_IO_READ_PROC)
 (
     PFAST486_STATE State,
-    ULONG Port,
+    USHORT Port,
     PVOID Buffer,
     ULONG DataCount,
     UCHAR DataSize
@@ -201,7 +201,7 @@
 (NTAPI *FAST486_IO_WRITE_PROC)
 (
     PFAST486_STATE State,
-    ULONG Port,
+    USHORT Port,
     PVOID Buffer,
     ULONG DataCount,
     UCHAR DataSize

Modified: trunk/reactos/lib/fast486/fast486.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/fast486.c?rev=64917&r1=64916&r2=64917&view=diff
==============================================================================
--- trunk/reactos/lib/fast486/fast486.c [iso-8859-1] (original)
+++ trunk/reactos/lib/fast486/fast486.c [iso-8859-1] Thu Oct 23 11:44:07 2014
@@ -149,7 +149,7 @@
 
 static VOID
 NTAPI
-Fast486IoReadCallback(PFAST486_STATE State, ULONG Port, PVOID Buffer, ULONG 
DataCount, UCHAR DataSize)
+Fast486IoReadCallback(PFAST486_STATE State, USHORT Port, PVOID Buffer, ULONG 
DataCount, UCHAR DataSize)
 {
     UNREFERENCED_PARAMETER(State);
     UNREFERENCED_PARAMETER(Port);
@@ -160,7 +160,7 @@
 
 static VOID
 NTAPI
-Fast486IoWriteCallback(PFAST486_STATE State, ULONG Port, PVOID Buffer, ULONG 
DataCount, UCHAR DataSize)
+Fast486IoWriteCallback(PFAST486_STATE State, USHORT Port, PVOID Buffer, ULONG 
DataCount, UCHAR DataSize)
 {
     UNREFERENCED_PARAMETER(State);
     UNREFERENCED_PARAMETER(Port);

Modified: trunk/reactos/subsystems/ntvdm/emulator.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/emulator.c?rev=64917&r1=64916&r2=64917&view=diff
==============================================================================
--- trunk/reactos/subsystems/ntvdm/emulator.c   [iso-8859-1] (original)
+++ trunk/reactos/subsystems/ntvdm/emulator.c   [iso-8859-1] Thu Oct 23 
11:44:07 2014
@@ -273,12 +273,12 @@
     DebugBreak();
 }
 
-static BYTE WINAPI Port61hRead(ULONG Port)
+static BYTE WINAPI Port61hRead(USHORT Port)
 {
     return Port61hState;
 }
 
-static VOID WINAPI Port61hWrite(ULONG Port, BYTE Data)
+static VOID WINAPI Port61hWrite(USHORT Port, BYTE Data)
 {
     // BOOLEAN SpeakerStateChange = FALSE;
     BYTE OldPort61hState = Port61hState;

Modified: trunk/reactos/subsystems/ntvdm/hardware/cmos.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/hardware/cmos.c?rev=64917&r1=64916&r2=64917&view=diff
==============================================================================
--- trunk/reactos/subsystems/ntvdm/hardware/cmos.c      [iso-8859-1] (original)
+++ trunk/reactos/subsystems/ntvdm/hardware/cmos.c      [iso-8859-1] Thu Oct 23 
11:44:07 2014
@@ -342,13 +342,13 @@
     SelectedRegister = CMOS_REG_STATUS_D;
 }
 
-BYTE WINAPI CmosReadPort(ULONG Port)
+BYTE WINAPI CmosReadPort(USHORT Port)
 {
     ASSERT(Port == CMOS_DATA_PORT);
     return CmosReadData();
 }
 
-VOID WINAPI CmosWritePort(ULONG Port, BYTE Data)
+VOID WINAPI CmosWritePort(USHORT Port, BYTE Data)
 {
     if (Port == CMOS_ADDRESS_PORT)
         CmosWriteAddress(Data);

Modified: trunk/reactos/subsystems/ntvdm/hardware/pic.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/hardware/pic.c?rev=64917&r1=64916&r2=64917&view=diff
==============================================================================
--- trunk/reactos/subsystems/ntvdm/hardware/pic.c       [iso-8859-1] (original)
+++ trunk/reactos/subsystems/ntvdm/hardware/pic.c       [iso-8859-1] Thu Oct 23 
11:44:07 2014
@@ -154,7 +154,7 @@
     Pic->Initialization = FALSE;
 }
 
-static BYTE WINAPI PicReadPort(ULONG Port)
+static BYTE WINAPI PicReadPort(USHORT Port)
 {
     switch (Port)
     {
@@ -174,7 +174,7 @@
     return 0;
 }
 
-static VOID WINAPI PicWritePort(ULONG Port, BYTE Data)
+static VOID WINAPI PicWritePort(USHORT Port, BYTE Data)
 {
     switch (Port)
     {

Modified: trunk/reactos/subsystems/ntvdm/hardware/ps2.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/hardware/ps2.c?rev=64917&r1=64916&r2=64917&view=diff
==============================================================================
--- trunk/reactos/subsystems/ntvdm/hardware/ps2.c       [iso-8859-1] (original)
+++ trunk/reactos/subsystems/ntvdm/hardware/ps2.c       [iso-8859-1] Thu Oct 23 
11:44:07 2014
@@ -59,7 +59,7 @@
     if (Port->DeviceCommand) Port->DeviceCommand(Port->Param, Command);
 }
 
-static BYTE WINAPI PS2ReadPort(ULONG Port)
+static BYTE WINAPI PS2ReadPort(USHORT Port)
 {
     if (Port == PS2_CONTROL_PORT)
     {
@@ -87,7 +87,7 @@
     return 0;
 }
 
-static VOID WINAPI PS2WritePort(ULONG Port, BYTE Data)
+static VOID WINAPI PS2WritePort(USHORT Port, BYTE Data)
 {
     if (Port == PS2_CONTROL_PORT)
     {

Modified: trunk/reactos/subsystems/ntvdm/hardware/timer.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/hardware/timer.c?rev=64917&r1=64916&r2=64917&view=diff
==============================================================================
--- trunk/reactos/subsystems/ntvdm/hardware/timer.c     [iso-8859-1] (original)
+++ trunk/reactos/subsystems/ntvdm/hardware/timer.c     [iso-8859-1] Thu Oct 23 
11:44:07 2014
@@ -275,7 +275,7 @@
     }
 }
 
-static BYTE WINAPI PitReadPort(ULONG Port)
+static BYTE WINAPI PitReadPort(USHORT Port)
 {
     switch (Port)
     {
@@ -290,7 +290,7 @@
     return 0;
 }
 
-static VOID WINAPI PitWritePort(ULONG Port, BYTE Data)
+static VOID WINAPI PitWritePort(USHORT Port, BYTE Data)
 {
     switch (Port)
     {

Modified: trunk/reactos/subsystems/ntvdm/hardware/vga.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/hardware/vga.c?rev=64917&r1=64916&r2=64917&view=diff
==============================================================================
--- trunk/reactos/subsystems/ntvdm/hardware/vga.c       [iso-8859-1] (original)
+++ trunk/reactos/subsystems/ntvdm/hardware/vga.c       [iso-8859-1] Thu Oct 23 
11:44:07 2014
@@ -1462,7 +1462,7 @@
     CursorMoved = FALSE;
 }
 
-static BYTE WINAPI VgaReadPort(ULONG Port)
+static BYTE WINAPI VgaReadPort(USHORT Port)
 {
     DPRINT("VgaReadPort: Port 0x%X\n", Port);
 
@@ -1554,7 +1554,7 @@
     return 0;
 }
 
-static VOID WINAPI VgaWritePort(ULONG Port, BYTE Data)
+static VOID WINAPI VgaWritePort(USHORT Port, BYTE Data)
 {
     DPRINT("VgaWritePort: Port 0x%X, Data 0x%02X\n", Port, Data);
 

Modified: trunk/reactos/subsystems/ntvdm/io.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/io.c?rev=64917&r1=64916&r2=64917&view=diff
==============================================================================
--- trunk/reactos/subsystems/ntvdm/io.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/ntvdm/io.c [iso-8859-1] Thu Oct 23 11:44:07 2014
@@ -58,7 +58,7 @@
 /* PUBLIC FUNCTIONS 
***********************************************************/
 
 UCHAR
-IOReadB(ULONG Port)
+IOReadB(USHORT Port)
 {
     if (IoPortProc[Port].hVdd == INVALID_HANDLE_VALUE &&
         IoPortProc[Port].IoHandlers.InB)
@@ -82,7 +82,7 @@
 }
 
 VOID
-IOReadStrB(ULONG  Port,
+IOReadStrB(USHORT  Port,
            PUCHAR Buffer,
            ULONG  Count)
 {
@@ -105,7 +105,7 @@
 }
 
 VOID
-IOWriteB(ULONG Port,
+IOWriteB(USHORT Port,
          UCHAR Buffer)
 {
     if (IoPortProc[Port].hVdd == INVALID_HANDLE_VALUE &&
@@ -127,7 +127,7 @@
 }
 
 VOID
-IOWriteStrB(ULONG  Port,
+IOWriteStrB(USHORT  Port,
             PUCHAR Buffer,
             ULONG  Count)
 {
@@ -150,7 +150,7 @@
 }
 
 USHORT
-IOReadW(ULONG Port)
+IOReadW(USHORT Port)
 {
     if (IoPortProc[Port].hVdd == INVALID_HANDLE_VALUE &&
         IoPortProc[Port].IoHandlers.InW)
@@ -177,7 +177,7 @@
 }
 
 VOID
-IOReadStrW(ULONG   Port,
+IOReadStrW(USHORT   Port,
            PUSHORT Buffer,
            ULONG   Count)
 {
@@ -200,7 +200,7 @@
 }
 
 VOID
-IOWriteW(ULONG  Port,
+IOWriteW(USHORT  Port,
          USHORT Buffer)
 {
     if (IoPortProc[Port].hVdd == INVALID_HANDLE_VALUE &&
@@ -223,7 +223,7 @@
 }
 
 VOID
-IOWriteStrW(ULONG   Port,
+IOWriteStrW(USHORT   Port,
             PUSHORT Buffer,
             ULONG   Count)
 {
@@ -246,7 +246,7 @@
 }
 
 ULONG
-IOReadD(ULONG Port)
+IOReadD(USHORT Port)
 {
     if (IoPortProc[Port].hVdd == INVALID_HANDLE_VALUE &&
         IoPortProc[Port].IoHandlers.InD)
@@ -265,7 +265,7 @@
 }
 
 VOID
-IOReadStrD(ULONG  Port,
+IOReadStrD(USHORT  Port,
            PULONG Buffer,
            ULONG  Count)
 {
@@ -281,7 +281,7 @@
 }
 
 VOID
-IOWriteD(ULONG Port,
+IOWriteD(USHORT Port,
          ULONG Buffer)
 {
     if (IoPortProc[Port].hVdd == INVALID_HANDLE_VALUE &&
@@ -298,7 +298,7 @@
 }
 
 VOID
-IOWriteStrD(ULONG  Port,
+IOWriteStrD(USHORT  Port,
             PULONG Buffer,
             ULONG  Count)
 {
@@ -314,7 +314,7 @@
 }
 
 
-VOID RegisterIoPort(ULONG Port,
+VOID RegisterIoPort(USHORT Port,
                     EMULATOR_INB_PROC  InHandler,
                     EMULATOR_OUTB_PROC OutHandler)
 {
@@ -332,7 +332,7 @@
     IoPortProc[Port].hVdd = INVALID_HANDLE_VALUE;
 }
 
-VOID UnregisterIoPort(ULONG Port)
+VOID UnregisterIoPort(USHORT Port)
 {
     /*
      * Put automagically all the fields to zero:
@@ -344,7 +344,7 @@
 
 VOID WINAPI
 EmulatorReadIo(PFAST486_STATE State,
-               ULONG Port,
+               USHORT Port,
                PVOID Buffer,
                ULONG DataCount,
                UCHAR DataSize)
@@ -419,7 +419,7 @@
 
 VOID WINAPI
 EmulatorWriteIo(PFAST486_STATE State,
-                ULONG Port,
+                USHORT Port,
                 PVOID Buffer,
                 ULONG DataCount,
                 UCHAR DataSize)

Modified: trunk/reactos/subsystems/ntvdm/io.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/io.h?rev=64917&r1=64916&r2=64917&view=diff
==============================================================================
--- trunk/reactos/subsystems/ntvdm/io.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/ntvdm/io.h [iso-8859-1] Thu Oct 23 11:44:07 2014
@@ -16,79 +16,79 @@
 
 /* FUNCTIONS 
******************************************************************/
 
-typedef UCHAR  (WINAPI *EMULATOR_INB_PROC)(ULONG Port);
-typedef USHORT (WINAPI *EMULATOR_INW_PROC)(ULONG Port);
-typedef ULONG  (WINAPI *EMULATOR_IND_PROC)(ULONG Port);
+typedef UCHAR  (WINAPI *EMULATOR_INB_PROC)(USHORT Port);
+typedef USHORT (WINAPI *EMULATOR_INW_PROC)(USHORT Port);
+typedef ULONG  (WINAPI *EMULATOR_IND_PROC)(USHORT Port);
 
-typedef VOID (WINAPI *EMULATOR_INSB_PROC)(ULONG Port, PUCHAR  Buffer, ULONG 
Count);
-typedef VOID (WINAPI *EMULATOR_INSW_PROC)(ULONG Port, PUSHORT Buffer, ULONG 
Count);
-typedef VOID (WINAPI *EMULATOR_INSD_PROC)(ULONG Port, PULONG  Buffer, ULONG 
Count);
+typedef VOID (WINAPI *EMULATOR_INSB_PROC)(USHORT Port, PUCHAR  Buffer, ULONG 
Count);
+typedef VOID (WINAPI *EMULATOR_INSW_PROC)(USHORT Port, PUSHORT Buffer, ULONG 
Count);
+typedef VOID (WINAPI *EMULATOR_INSD_PROC)(USHORT Port, PULONG  Buffer, ULONG 
Count);
 
-typedef VOID (WINAPI *EMULATOR_OUTB_PROC)(ULONG Port, UCHAR  Data);
-typedef VOID (WINAPI *EMULATOR_OUTW_PROC)(ULONG Port, USHORT Data);
-typedef VOID (WINAPI *EMULATOR_OUTD_PROC)(ULONG Port, ULONG  Data);
+typedef VOID (WINAPI *EMULATOR_OUTB_PROC)(USHORT Port, UCHAR  Data);
+typedef VOID (WINAPI *EMULATOR_OUTW_PROC)(USHORT Port, USHORT Data);
+typedef VOID (WINAPI *EMULATOR_OUTD_PROC)(USHORT Port, ULONG  Data);
 
-typedef VOID (WINAPI *EMULATOR_OUTSB_PROC)(ULONG Port, PUCHAR  Buffer, ULONG 
Count);
-typedef VOID (WINAPI *EMULATOR_OUTSW_PROC)(ULONG Port, PUSHORT Buffer, ULONG 
Count);
-typedef VOID (WINAPI *EMULATOR_OUTSD_PROC)(ULONG Port, PULONG  Buffer, ULONG 
Count);
+typedef VOID (WINAPI *EMULATOR_OUTSB_PROC)(USHORT Port, PUCHAR  Buffer, ULONG 
Count);
+typedef VOID (WINAPI *EMULATOR_OUTSW_PROC)(USHORT Port, PUSHORT Buffer, ULONG 
Count);
+typedef VOID (WINAPI *EMULATOR_OUTSD_PROC)(USHORT Port, PULONG  Buffer, ULONG 
Count);
 
 
 UCHAR
-IOReadB(ULONG Port);
+IOReadB(USHORT Port);
 VOID
-IOReadStrB(ULONG  Port,
+IOReadStrB(USHORT  Port,
            PUCHAR Buffer,
            ULONG  Count);
 
 VOID
-IOWriteB(ULONG Port,
+IOWriteB(USHORT Port,
          UCHAR Buffer);
 VOID
-IOWriteStrB(ULONG  Port,
+IOWriteStrB(USHORT  Port,
             PUCHAR Buffer,
             ULONG  Count);
 
 USHORT
-IOReadW(ULONG Port);
+IOReadW(USHORT Port);
 VOID
-IOReadStrW(ULONG   Port,
+IOReadStrW(USHORT   Port,
            PUSHORT Buffer,
            ULONG   Count);
 
 VOID
-IOWriteW(ULONG  Port,
+IOWriteW(USHORT  Port,
          USHORT Buffer);
 VOID
-IOWriteStrW(ULONG   Port,
+IOWriteStrW(USHORT   Port,
             PUSHORT Buffer,
             ULONG   Count);
 
 ULONG
-IOReadD(ULONG Port);
+IOReadD(USHORT Port);
 VOID
-IOReadStrD(ULONG  Port,
+IOReadStrD(USHORT  Port,
            PULONG Buffer,
            ULONG  Count);
 
 VOID
-IOWriteD(ULONG Port,
+IOWriteD(USHORT Port,
          ULONG Buffer);
 VOID
-IOWriteStrD(ULONG  Port,
+IOWriteStrD(USHORT  Port,
             PULONG Buffer,
             ULONG  Count);
 
 
-VOID RegisterIoPort(ULONG Port,
+VOID RegisterIoPort(USHORT Port,
                     EMULATOR_INB_PROC  InHandler,
                     EMULATOR_OUTB_PROC OutHandler);
 
-VOID UnregisterIoPort(ULONG Port);
+VOID UnregisterIoPort(USHORT Port);
 
 VOID WINAPI EmulatorReadIo
 (
     PFAST486_STATE State,
-    ULONG Port,
+    USHORT Port,
     PVOID Buffer,
     ULONG DataCount,
     UCHAR DataSize
@@ -97,7 +97,7 @@
 VOID WINAPI EmulatorWriteIo
 (
     PFAST486_STATE State,
-    ULONG Port,
+    USHORT Port,
     PVOID Buffer,
     ULONG DataCount,
     UCHAR DataSize


Reply via email to