ReactOS 0.4.15-dev-7693-gd0e2924
profil.c File Reference
#include <hal.h>
#include <debug.h>
Include dependency graph for profil.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

VOID NTAPI HalStopProfileInterrupt (IN KPROFILE_SOURCE ProfileSource)
 
VOID NTAPI HalStartProfileInterrupt (IN KPROFILE_SOURCE ProfileSource)
 
ULONG_PTR NTAPI HalSetProfileInterval (IN ULONG_PTR Interval)
 

Variables

BOOLEAN HalpProfilingStopped = TRUE
 
UCHAR HalpProfileRate = 8
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 13 of file profil.c.

Function Documentation

◆ HalSetProfileInterval()

ULONG_PTR NTAPI HalSetProfileInterval ( IN ULONG_PTR  Interval)

Definition at line 87 of file profil.c.

88{
89 ULONG_PTR CurrentValue, NextValue;
90 UCHAR i;
91
92 /* Normalize interval. 122100 ns is the smallest supported */
93 Interval &= ~(1 << 31);
94 if (Interval < 1221)
95 Interval = 1221;
96
97 /* Highest rate value of 15 means 500 ms */
98 CurrentValue = 5000000;
99 for (i = 15; ; i--)
100 {
101 NextValue = (CurrentValue + 1) / 2;
102 if (Interval > CurrentValue - NextValue / 2)
103 break;
104 CurrentValue = NextValue;
105 }
106
107 /* Interval as needed by RTC */
109
110 /* Reset the */
112 {
114 }
115
116 return CurrentValue;
117}
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
VOID NTAPI HalStartProfileInterrupt(IN KPROFILE_SOURCE ProfileSource)
Definition: profil.c:57
UCHAR HalpProfileRate
Definition: profil.c:19
BOOLEAN HalpProfilingStopped
Definition: profil.c:18
DWORD Interval
Definition: netstat.c:30
uint32_t ULONG_PTR
Definition: typedefs.h:65
unsigned char UCHAR
Definition: xmlstorage.h:181

◆ HalStartProfileInterrupt()

VOID NTAPI HalStartProfileInterrupt ( IN KPROFILE_SOURCE  ProfileSource)

Definition at line 57 of file profil.c.

58{
59 UCHAR StatusA, StatusB;
60
61 UNREFERENCED_PARAMETER(ProfileSource);
62
64
65 /* Acquire the CMOS lock */
67
68 /* Set the interval in Status Register A */
70 StatusA = (StatusA & 0xF0) | HalpProfileRate;
72
73 /* Enable periodic interrupts in Status Register B */
75 StatusB = StatusB | RTC_REG_B_PI;
77
78 /* Release the CMOS lock */
80}
#define FALSE
Definition: types.h:117
VOID NTAPI HalpReleaseCmosSpinLock(VOID)
Definition: spinlock.c:243
VOID NTAPI HalpAcquireCmosSpinLock(VOID)
Definition: spinlock.c:226
VOID NTAPI HalpWriteCmos(_In_ UCHAR Reg, _In_ UCHAR Value)
Definition: cmos.c:132
UCHAR NTAPI HalpReadCmos(_In_ UCHAR Reg)
Definition: cmos.c:123
#define RTC_REG_B_PI
Definition: halhw.h:16
#define RTC_REGISTER_B
Definition: halhw.h:15
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define RTC_REGISTER_A
Definition: xboxrtc.c:21

◆ HalStopProfileInterrupt()

VOID NTAPI HalStopProfileInterrupt ( IN KPROFILE_SOURCE  ProfileSource)

Definition at line 28 of file profil.c.

29{
30 UCHAR StatusB;
31
32 UNREFERENCED_PARAMETER(ProfileSource);
33
34 /* Acquire the CMOS lock */
36
37 /* Read Status Register B */
39
40 /* Disable periodic interrupts */
41 StatusB = StatusB & ~RTC_REG_B_PI;
42
43 /* Write new value into Status Register B */
45
47
48 /* Release the CMOS lock */
50}
#define TRUE
Definition: types.h:120

Variable Documentation

◆ HalpProfileRate

UCHAR HalpProfileRate = 8

Definition at line 19 of file profil.c.

Referenced by HalSetProfileInterval(), and HalStartProfileInterrupt().

◆ HalpProfilingStopped

BOOLEAN HalpProfilingStopped = TRUE