ReactOS  0.4.13-dev-687-g023794c
halp.h File Reference
Include dependency graph for halp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _IDTUsageFlags
 
struct  IDTUsage
 

Macros

#define PRIMARY_VECTOR_BASE   0x00
 
#define IDT_REGISTERED   0x01
 
#define IDT_LATCHED   0x02
 
#define IDT_INTERNAL   0x11
 
#define IDT_DEVICE   0x21
 

Typedefs

typedef struct _IDTUsageFlags IDTUsageFlags
 

Functions

VOID NTAPI HalpRegisterVector (IN UCHAR Flags, IN ULONG BusVector, IN ULONG SystemVector, IN KIRQL Irql)
 
VOID NTAPI HalpEnableInterruptHandler (IN UCHAR Flags, IN ULONG BusVector, IN ULONG SystemVector, IN KIRQL Irql, IN PVOID Handler, IN KINTERRUPT_MODE Mode)
 
VOID HalpInitPhase0 (PLOADER_PARAMETER_BLOCK LoaderBlock)
 
VOID HalpInitPhase1 (VOID)
 
VOID HalpInitializeInterrupts (VOID)
 
VOID HalpInitializeClock (VOID)
 
VOID HalpClockInterrupt (VOID)
 
VOID HalpProfileInterrupt (VOID)
 

Variables

ULONG HalpCurrentTimeIncrement
 
ULONG HalpNextTimeIncrement
 
ULONG HalpNextIntervalCount
 

Macro Definition Documentation

◆ IDT_DEVICE

#define IDT_DEVICE   0x21

Definition at line 22 of file halp.h.

◆ IDT_INTERNAL

#define IDT_INTERNAL   0x11

Definition at line 21 of file halp.h.

◆ IDT_LATCHED

#define IDT_LATCHED   0x02

Definition at line 20 of file halp.h.

◆ IDT_REGISTERED

#define IDT_REGISTERED   0x01

Definition at line 19 of file halp.h.

◆ PRIMARY_VECTOR_BASE

#define PRIMARY_VECTOR_BASE   0x00

Definition at line 16 of file halp.h.

Typedef Documentation

◆ IDTUsageFlags

Function Documentation

◆ HalpClockInterrupt()

VOID HalpClockInterrupt ( VOID  )

Definition at line 30 of file timer.c.

31 {
32  /* Clear the interrupt */
35 
36  /* FIXME: Update HAL Perf counters */
37 
38  /* FIXME: Check if someone changed the clockrate */
39 
40  /* Call the kernel */
43  CLOCK2_LEVEL);
44 }
#define KeGetCurrentIrql()
Definition: env_spec_w32.h:706
NTKERNELAPI VOID NTAPI WRITE_REGISTER_ULONG(IN PULONG Register, IN ULONG Value)
VOID FASTCALL KeUpdateSystemTime(IN PKTRAP_FRAME TrapFrame, IN ULONG Increment, IN KIRQL OldIrql)
Definition: time.c:64
#define TIMER0_INT_CLEAR
Definition: sp804.h:18
#define CLOCK2_LEVEL
Definition: env_spec_w32.h:700
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
ULONG HalpCurrentTimeIncrement
Definition: timer.c:25
#define KeGetCurrentThread
Definition: hal.h:44

◆ HalpEnableInterruptHandler()

VOID NTAPI HalpEnableInterruptHandler ( IN UCHAR  Flags,
IN ULONG  BusVector,
IN ULONG  SystemVector,
IN KIRQL  Irql,
IN PVOID  Handler,
IN KINTERRUPT_MODE  Mode 
)

Definition at line 49 of file usage.c.

55 {
56  /* Register the routine */
58 }
static const BYTE InterruptRoutine[]
Definition: device.c:34
struct _KIPCR * PKIPCR
_Out_ PKIRQL Irql
Definition: csq.h:179
#define KeGetPcr()
Definition: ke.h:25
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn BOOLEAN Physical UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER Handler
Definition: acpixf.h:656

◆ HalpInitializeClock()

VOID HalpInitializeClock ( VOID  )

Definition at line 54 of file timer.c.

55 {
56  PKIPCR Pcr = (PKIPCR)KeGetPcr();
57  ULONG ClockInterval;
58  SP804_CONTROL_REGISTER ControlRegister;
59 
60  /* Setup the clock and profile interrupt */
62 
63  /*
64  * Configure the interval to 10ms
65  * (INTERVAL (10ms) * TIMCLKfreq (1MHz))
66  * --------------------------------------- == 10^4
67  * (TIMCLKENXdiv (1) * PRESCALEdiv (1))
68  */
69  ClockInterval = 0x2710;
70 
71  /* Configure the timer */
72  ControlRegister.AsUlong = 0;
73  ControlRegister.Wide = TRUE;
74  ControlRegister.Periodic = TRUE;
75  ControlRegister.Interrupt = TRUE;
76  ControlRegister.Enabled = TRUE;
77 
78  /* Enable the timer */
79  WRITE_REGISTER_ULONG(TIMER0_LOAD, ClockInterval);
81 }
VOID HalpStallInterrupt(VOID)
Definition: timer.c:47
NTKERNELAPI VOID NTAPI WRITE_REGISTER_ULONG(IN PULONG Register, IN ULONG Value)
#define TRUE
Definition: types.h:120
#define TIMER0_LOAD
Definition: sp804.h:15
struct _KIPCR * PKIPCR
#define KeGetPcr()
Definition: ke.h:25
#define CLOCK2_LEVEL
Definition: env_spec_w32.h:700
#define TIMER0_CONTROL
Definition: sp804.h:17
unsigned int ULONG
Definition: retypes.h:1
PKINTERRUPT_ROUTINE InterruptRoutine[MAXIMUM_VECTOR]
Definition: ketypes.h:510

◆ HalpInitializeInterrupts()

VOID HalpInitializeInterrupts ( VOID  )

Definition at line 93 of file pic.c.

94 {
95  PKIPCR Pcr = (PKIPCR)KeGetPcr();
96 
97  /* Fill out the IRQL mappings */
98  RtlCopyMemory(Pcr->IrqlTable, HalpIrqlTable, sizeof(Pcr->IrqlTable));
99  RtlCopyMemory(Pcr->IrqlMask, HalpMaskTable, sizeof(Pcr->IrqlMask));
100 }
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
struct _KIPCR * PKIPCR
#define KeGetPcr()
Definition: ke.h:25
UCHAR HalpMaskTable[HIGH_LEVEL+1]
Definition: pic.c:55
UCHAR IrqlMask[32]
Definition: ketypes.h:545
ULONG HalpIrqlTable[HIGH_LEVEL+1]
Definition: pic.c:19
UCHAR IrqlTable[9]
Definition: ketypes.h:546

Referenced by HalInitSystem().

◆ HalpInitPhase0()

VOID HalpInitPhase0 ( PLOADER_PARAMETER_BLOCK  LoaderBlock)

Definition at line 31 of file halinit_mp.c.

33 {
34  static BOOLEAN MPSInitialized = FALSE;
35 
36 
37  /* Only initialize MP system once. Once called the first time,
38  each subsequent call is part of the initialization sequence
39  for an application processor. */
40 
41  DPRINT("HalpInitPhase0()\n");
42 
43 
44  if (MPSInitialized)
45  {
46  ASSERT(FALSE);
47  }
48 
49  MPSInitialized = TRUE;
50 
51  if (!HaliFindSmpConfig())
52  {
53  ASSERT(FALSE);
54  }
55 
56  /* store the kernel base for later use */
57  KernelBase = (ULONG_PTR)CONTAINING_RECORD(LoaderBlock->LoadOrderListHead.Flink, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks)->DllBase;
58 
59 }
#define TRUE
Definition: types.h:120
unsigned char BOOLEAN
void DPRINT(...)
Definition: polytest.cpp:61
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
BOOLEAN HaliFindSmpConfig(VOID)
Definition: mpconfig.c:605
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
ULONG_PTR KernelBase
Definition: halinit_mp.c:21
Definition: btrfs_drv.h:1831
LIST_ENTRY LoadOrderListHead
Definition: arc.h:493
#define ULONG_PTR
Definition: config.h:101

Referenced by HalInitSystem().

◆ HalpInitPhase1()

VOID HalpInitPhase1 ( VOID  )

Definition at line 26 of file halinit_up.c.

27 {
28 
29 }

Referenced by HalInitSystem().

◆ HalpProfileInterrupt()

VOID HalpProfileInterrupt ( VOID  )

Referenced by HalInitSystem(), and HalpInitPhase1().

◆ HalpRegisterVector()

VOID NTAPI HalpRegisterVector ( IN UCHAR  Flags,
IN ULONG  BusVector,
IN ULONG  SystemVector,
IN KIRQL  Irql 
)

Definition at line 34 of file usage.c.

38 {
39  /* Save the vector flags */
40  HalpIDTUsageFlags[SystemVector].Flags = Flags;
41 
42  /* Save the vector data */
43  HalpIDTUsage[SystemVector].Irql = Irql;
44  HalpIDTUsage[SystemVector].BusReleativeVector = BusVector;
45 }
IDTUsage HalpIDTUsage[256]
Definition: usage.c:20
IDTUsageFlags HalpIDTUsageFlags[256]
Definition: usage.c:19
_Out_ PKIRQL Irql
Definition: csq.h:179
UCHAR BusReleativeVector
Definition: halp.h:32
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
UCHAR Flags
Definition: halp.h:26
KIRQL Irql
Definition: halp.h:31

Variable Documentation

◆ HalpCurrentTimeIncrement

ULONG HalpCurrentTimeIncrement

◆ HalpNextIntervalCount

ULONG HalpNextIntervalCount

Definition at line 25 of file timer.c.

Referenced by HalInitSystem().

◆ HalpNextTimeIncrement

ULONG HalpNextTimeIncrement

Definition at line 25 of file timer.c.

Referenced by HalInitSystem().