Author: jgardou
Date: Mon Nov 21 12:04:16 2011
New Revision: 54470

URL: http://svn.reactos.org/svn/reactos?rev=54470&view=rev
Log:
[HALx86]
- fix various compiler warnings (msvc)
- fix a bug, where only the last IO map entry would be saved

Modified:
    trunk/reactos/hal/halx86/generic/beep.c
    trunk/reactos/hal/halx86/generic/bios.c
    trunk/reactos/hal/halx86/generic/memory.c
    trunk/reactos/hal/halx86/generic/usage.c
    trunk/reactos/hal/halx86/up/pic.c

Modified: trunk/reactos/hal/halx86/generic/beep.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/beep.c?rev=54470&r1=54469&r2=54470&view=diff
==============================================================================
--- trunk/reactos/hal/halx86/generic/beep.c [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/generic/beep.c [iso-8859-1] Mon Nov 21 12:04:16 
2011
@@ -91,7 +91,7 @@
             // Next we write the reload value for channel 2
             //
             __outbyte(TIMER_CHANNEL2_DATA_PORT, Divider & 0xFF);
-            __outbyte(TIMER_CHANNEL2_DATA_PORT, Divider >> 8);
+            __outbyte(TIMER_CHANNEL2_DATA_PORT, (Divider >> 8) & 0xFF);
 
             //
             // Reconnect the speaker to the timer and re-enable the output pin

Modified: trunk/reactos/hal/halx86/generic/bios.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/bios.c?rev=54470&r1=54469&r2=54470&view=diff
==============================================================================
--- trunk/reactos/hal/halx86/generic/bios.c [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/generic/bios.c [iso-8859-1] Mon Nov 21 12:04:16 
2011
@@ -394,8 +394,9 @@
             // Save it
             //
             ASSERT(j < 32);
-            HalpSavedIoMapData[j][0] = i;
+            HalpSavedIoMapData[j][0] = (UCHAR)i;
             HalpSavedIoMapData[j][1] = *Entry;
+            j++;
         }
 
         //
@@ -656,7 +657,7 @@
     // invalid op-code handler.
     //
     IdtPte = HalAddressToPte(((PKIPCR)KeGetPcr())->IDT);
-    RestoreWriteProtection = IdtPte->Write;
+    RestoreWriteProtection = IdtPte->Write != 0;
     IdtPte->Write = 1;
 
     //

Modified: trunk/reactos/hal/halx86/generic/memory.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/memory.c?rev=54470&r1=54469&r2=54470&view=diff
==============================================================================
--- trunk/reactos/hal/halx86/generic/memory.c [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/generic/memory.c [iso-8859-1] Mon Nov 21 12:04:16 
2011
@@ -190,7 +190,7 @@
     {
         /* Fill out the PTE */
         PointerPte = HalAddressToPte(BaseAddress);
-        PointerPte->PageFrameNumber = PhysicalAddress.QuadPart >> PAGE_SHIFT;
+        PointerPte->PageFrameNumber = (ULONG_PTR)PhysicalAddress.QuadPart >> 
PAGE_SHIFT;
         PointerPte->Valid = 1;
         PointerPte->Write = 1;
 

Modified: trunk/reactos/hal/halx86/generic/usage.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/usage.c?rev=54470&r1=54469&r2=54470&view=diff
==============================================================================
--- trunk/reactos/hal/halx86/generic/usage.c [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/generic/usage.c [iso-8859-1] Mon Nov 21 12:04:16 
2011
@@ -288,7 +288,7 @@
         {
             /* Then register it for internal usage */
             HalpIDTUsageFlags[i].Flags = IDT_INTERNAL;
-            HalpIDTUsage[i].BusReleativeVector = i;
+            HalpIDTUsage[i].BusReleativeVector = (UCHAR)i;
         }
     }
     
@@ -499,7 +499,7 @@
 
     /* Save the vector data */
     HalpIDTUsage[SystemVector].Irql  = Irql;
-    HalpIDTUsage[SystemVector].BusReleativeVector = BusVector;
+    HalpIDTUsage[SystemVector].BusReleativeVector = (UCHAR)BusVector;
 }
 
 #ifndef _MINIHAL_

Modified: trunk/reactos/hal/halx86/up/pic.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/up/pic.c?rev=54470&r1=54469&r2=54470&view=diff
==============================================================================
--- trunk/reactos/hal/halx86/up/pic.c [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/up/pic.c [iso-8859-1] Mon Nov 21 12:04:16 2011
@@ -678,7 +678,7 @@
             if (PendingIrql > DISPATCH_LEVEL)
             {
                 /* Set new PIC mask */
-                Mask.Both = Pcr->IDR;
+                Mask.Both = Pcr->IDR & 0xFFFF;
                 __outbyte(PIC1_DATA_PORT, Mask.Master);
                 __outbyte(PIC2_DATA_PORT, Mask.Slave);
 
@@ -761,7 +761,7 @@
         if (PendingIrql > DISPATCH_LEVEL)
         {
             /* Set new PIC mask */
-            Mask.Both = Pcr->IDR;
+            Mask.Both = Pcr->IDR & 0xFFFF;
             __outbyte(PIC1_DATA_PORT, Mask.Master);
             __outbyte(PIC2_DATA_PORT, Mask.Slave);
 
@@ -815,7 +815,7 @@
         if (Irq > 8)
         {
             /* Send the EOI for the IRQ */
-            __outbyte(PIC2_CONTROL_PORT, Ocw2.Bits | (Irq - 8));
+            __outbyte(PIC2_CONTROL_PORT, Ocw2.Bits | ((Irq - 8) & 0xFF));
     
             /* Send the EOI for IRQ2 on the master because this was cascaded */
             __outbyte(PIC1_CONTROL_PORT, Ocw2.Bits | 2);
@@ -823,7 +823,7 @@
         else
         {
             /* Send the EOI for the IRQ */
-            __outbyte(PIC1_CONTROL_PORT, Ocw2.Bits | Irq);
+            __outbyte(PIC1_CONTROL_PORT, Ocw2.Bits | (Irq &0xFF));
         }
     
         /* Enable interrupts and return success */
@@ -835,7 +835,7 @@
     Pcr->IRR |= (1 << (Irq + 4));
     
     /* Set new PIC mask to real IRQL level, since the optimization is lost now 
*/
-    Mask.Both = KiI8259MaskTable[CurrentIrql] | Pcr->IDR;
+    Mask.Both = (KiI8259MaskTable[CurrentIrql] | Pcr->IDR) & 0xFFFF;
     __outbyte(PIC1_DATA_PORT, Mask.Master);
     __outbyte(PIC2_DATA_PORT, Mask.Slave);
     
@@ -941,7 +941,7 @@
     PKPCR Pcr = KeGetPcr();
 
     /* Update the PIC */
-    Mask.Both = KiI8259MaskTable[Irql] | Pcr->IDR;
+    Mask.Both = (KiI8259MaskTable[Irql] | Pcr->IDR) & 0xFFFF;
     __outbyte(PIC1_DATA_PORT, Mask.Master);
     __outbyte(PIC2_DATA_PORT, Mask.Slave);
     
@@ -959,7 +959,7 @@
     if (Irq > 8)
     {
         /* Send the EOI for the IRQ */
-        __outbyte(PIC2_CONTROL_PORT, Ocw2.Bits | (Irq - 8));
+        __outbyte(PIC2_CONTROL_PORT, Ocw2.Bits | ((Irq - 8) & 0xFF));
 
         /* Send the EOI for IRQ2 on the master because this was cascaded */
         __outbyte(PIC1_CONTROL_PORT, Ocw2.Bits | 2);
@@ -967,7 +967,7 @@
     else
     {
         /* Send the EOI for the IRQ */
-        __outbyte(PIC1_CONTROL_PORT, Ocw2.Bits | Irq);
+        __outbyte(PIC1_CONTROL_PORT, Ocw2.Bits | (Irq & 0xFF));
     }
 
     /* Check if this interrupt should be allowed to happen */
@@ -1129,7 +1129,7 @@
     Pcr->IDR &= ~(1 << Irq);
 
     /* Set new PIC mask */
-    PicMask.Both = KiI8259MaskTable[Pcr->Irql] | Pcr->IDR;
+    PicMask.Both = (KiI8259MaskTable[Pcr->Irql] | Pcr->IDR) & 0xFFFF;
     __outbyte(PIC1_DATA_PORT, PicMask.Master);
     __outbyte(PIC2_DATA_PORT, PicMask.Slave);
     
@@ -1219,7 +1219,7 @@
             if (PendingIrql > DISPATCH_LEVEL)
             {
                 /* Set new PIC mask */
-                Mask.Both = Pcr->IDR;
+                Mask.Both = Pcr->IDR & 0xFFFF;
                 __outbyte(PIC1_DATA_PORT, Mask.Master);
                 __outbyte(PIC2_DATA_PORT, Mask.Slave);
                 
@@ -1371,7 +1371,7 @@
         if (PendingIrql > DISPATCH_LEVEL)
         {
             /* Set new PIC mask */
-            Mask.Both = Pcr->IDR;
+            Mask.Both = Pcr->IDR & 0xFFFF;
             __outbyte(PIC1_DATA_PORT, Mask.Master);
             __outbyte(PIC2_DATA_PORT, Mask.Slave);
             


Reply via email to