- Use __writeeflags instead of clc to clear the carry flag.
authorStefan Ginsberg <stefanginsberg@gmail.com>
Mon, 21 Sep 2009 22:08:44 +0000 (22:08 +0000)
committerStefan Ginsberg <stefanginsberg@gmail.com>
Mon, 21 Sep 2009 22:08:44 +0000 (22:08 +0000)
svn path=/trunk/; revision=43108

reactos/boot/freeldr/freeldr/arch/i386/pcrtc.c

index cafd388..b8f2011 100644 (file)
 
 #include <freeldr.h>
 
 
 #include <freeldr.h>
 
-FORCEINLINE
-VOID
-ClearCarryFlag(VOID)
-{
-#if defined(__GNUC__)
-    __asm__ ("clc");
-#elif defined(_MSC_VER)
-    __asm clc;
-#else
-#error
-#endif
-}
-
 #define BCD_INT(bcd) (((bcd & 0xf0) >> 4) * 10 + (bcd &0x0f))
 
 TIMEINFO*
 #define BCD_INT(bcd) (((bcd & 0xf0) >> 4) * 10 + (bcd &0x0f))
 
 TIMEINFO*
@@ -44,7 +31,7 @@ PcGetTime(VOID)
      * in the Compaq Deskpro EP/SB, leave CF unchanged
      * if successful, so CF should be cleared before
      * calling this function. */
      * in the Compaq Deskpro EP/SB, leave CF unchanged
      * if successful, so CF should be cleared before
      * calling this function. */
-    ClearCarryFlag();
+    __writeeflags(__readeflags() & ~EFLAGS_CF);
 
     /* Int 1Ah AH=04h
      * TIME - GET REAL-TIME CLOCK DATE (AT,XT286,PS)
 
     /* Int 1Ah AH=04h
      * TIME - GET REAL-TIME CLOCK DATE (AT,XT286,PS)
@@ -68,7 +55,7 @@ PcGetTime(VOID)
 
     /* Some BIOSes leave CF unchanged if successful,
      * so CF should be cleared before calling this function. */
 
     /* Some BIOSes leave CF unchanged if successful,
      * so CF should be cleared before calling this function. */
-    ClearCarryFlag();
+    __writeeflags(__readeflags() & ~EFLAGS_CF);
 
     /* Int 1Ah AH=02h
      * TIME - GET REAL-TIME CLOCK TIME (AT,XT286,PS)
 
     /* Int 1Ah AH=02h
      * TIME - GET REAL-TIME CLOCK TIME (AT,XT286,PS)