[ros-diffs] [ekohl] 48866: [HAL] Implement HalStopProfileInterrupt and add required RTC register and flag definitions.

ekohl at svn.reactos.org ekohl at svn.reactos.org
Sat Sep 25 07:22:40 UTC 2010


Author: ekohl
Date: Sat Sep 25 07:22:40 2010
New Revision: 48866

URL: http://svn.reactos.org/svn/reactos?rev=48866&view=rev
Log:
[HAL]
Implement HalStopProfileInterrupt and add required RTC register and flag definitions.

Modified:
    trunk/reactos/hal/halx86/generic/cmos.c
    trunk/reactos/hal/halx86/generic/profil.c
    trunk/reactos/hal/halx86/include/halp.h

Modified: trunk/reactos/hal/halx86/generic/cmos.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/cmos.c?rev=48866&r1=48865&r2=48866&view=diff
==============================================================================
--- trunk/reactos/hal/halx86/generic/cmos.c [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/generic/cmos.c [iso-8859-1] Sat Sep 25 07:22:40 2010
@@ -19,8 +19,8 @@
 
 /* PRIVATE FUNCTIONS *********************************************************/
 
-FORCEINLINE
 UCHAR
+NTAPI
 HalpReadCmos(IN UCHAR Reg)
 {
     /* Select the register */
@@ -30,8 +30,8 @@
     return READ_PORT_UCHAR(CMOS_DATA_PORT);
 }
 
-FORCEINLINE
 VOID
+NTAPI
 HalpWriteCmos(IN UCHAR Reg,
               IN UCHAR Value)
 {

Modified: trunk/reactos/hal/halx86/generic/profil.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/profil.c?rev=48866&r1=48865&r2=48866&view=diff
==============================================================================
--- trunk/reactos/hal/halx86/generic/profil.c [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/generic/profil.c [iso-8859-1] Sat Sep 25 07:22:40 2010
@@ -4,6 +4,7 @@
  * FILE:            hal/halx86/generic/profil.c
  * PURPOSE:         System Profiling
  * PROGRAMMERS:     Alex Ionescu (alex.ionescu at reactos.org)
+ *                  Eric Kohl
  */
 
 /* INCLUDES ******************************************************************/
@@ -15,14 +16,28 @@
 /* FUNCTIONS *****************************************************************/
 
 /*
- * @unimplemented
+ * @implemented
  */
 VOID
 NTAPI
 HalStopProfileInterrupt(IN KPROFILE_SOURCE ProfileSource)
 {
-    UNIMPLEMENTED;
-    return;
+    UCHAR StatusB;
+
+    /* Acquire the CMOS lock */
+    HalpAcquireSystemHardwareSpinLock();
+
+    /* Read Status Register B */
+    StatusB = HalpReadCmos(RTC_REGISTER_B);
+
+    /* Disable periodic interrupts */
+    StatusB = StatusB & ~RTC_REG_B_PI;
+
+    /* Write new value into Status Register B */
+    HalpWriteCmos(RTC_REGISTER_B, StatusB);
+
+    /* Release the CMOS lock */
+    HalpReleaseCmosSpinLock();
 }
 
 /*

Modified: trunk/reactos/hal/halx86/include/halp.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/include/halp.h?rev=48866&r1=48865&r2=48866&view=diff
==============================================================================
--- trunk/reactos/hal/halx86/include/halp.h [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/include/halp.h [iso-8859-1] Sat Sep 25 07:22:40 2010
@@ -48,8 +48,11 @@
 #define CMOS_CONTROL_PORT       (PUCHAR)0x70
 #define CMOS_DATA_PORT          (PUCHAR)0x71
 #define RTC_REGISTER_A          0x0A
+#define   RTC_REG_A_UIP         0x80
 #define RTC_REGISTER_B          0x0B
-#define RTC_REG_A_UIP           0x80
+#define   RTC_REG_B_PI          0x40
+#define RTC_REGISTER_C          0x0C
+#define RTC_REGISTER_D          0x0D
 #define RTC_REGISTER_CENTURY    0x32
 
 /* Usage flags */
@@ -683,12 +686,25 @@
 );
 
 //
-// CMOS initialization
+// CMOS Routines
 //
 VOID
 NTAPI
 HalpInitializeCmos(
     VOID
+);
+
+UCHAR
+NTAPI
+HalpReadCmos(
+    IN UCHAR Reg
+);
+
+VOID
+NTAPI
+HalpWriteCmos(
+    IN UCHAR Reg,
+    IN UCHAR Value
 );
 
 //




More information about the Ros-diffs mailing list