ReactOS 0.4.15-dev-7906-g1b85a5f
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 */
44}
#define WRITE_REGISTER_ULONG(r, v)
Definition: arm.h:27
#define CLOCK2_LEVEL
Definition: env_spec_w32.h:700
#define KeGetCurrentIrql()
Definition: env_spec_w32.h:706
VOID FASTCALL KeUpdateSystemTime(IN PKTRAP_FRAME TrapFrame, IN ULONG Increment, IN KIRQL OldIrql)
Definition: time.c:64
ULONG HalpCurrentTimeIncrement
Definition: timer.c:25
#define KeGetCurrentThread
Definition: hal.h:55
#define ASSERT(a)
Definition: mode.c:44
#define TIMER0_INT_CLEAR
Definition: sp804.h:18

◆ 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 */
57 KeGetPcr()->InterruptRoutine[Irql] = Handler;
58}
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn UINT32 *TableIdx 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:672
_Out_ PKIRQL Irql
Definition: csq.h:179
#define KeGetPcr()
Definition: ketypes.h:81

◆ HalpInitializeClock()

VOID HalpInitializeClock ( VOID  )

Definition at line 54 of file timer.c.

55{
56 PKPCR Pcr = KeGetPcr();
57 ULONG ClockInterval;
58 SP804_CONTROL_REGISTER ControlRegister;
59
60 /* Setup the clock and profile interrupt */
61 Pcr->InterruptRoutine[CLOCK2_LEVEL] = HalpStallInterrupt;
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}
#define TRUE
Definition: types.h:120
VOID HalpStallInterrupt(VOID)
Definition: timer.c:47
#define TIMER0_CONTROL
Definition: sp804.h:17
#define TIMER0_LOAD
Definition: sp804.h:15
Definition: ke.h:294
uint32_t ULONG
Definition: typedefs.h:59

Referenced by HalInitSystem().

◆ HalpInitializeInterrupts()

VOID HalpInitializeInterrupts ( VOID  )

Definition at line 93 of file pic.c.

94{
95 PKPCR Pcr = 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}
ULONG HalpIrqlTable[HIGH_LEVEL+1]
Definition: pic.c:19
UCHAR HalpMaskTable[HIGH_LEVEL+1]
Definition: pic.c:55
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263

Referenced by HalInitSystem().

◆ HalpInitPhase0()

VOID HalpInitPhase0 ( PLOADER_PARAMETER_BLOCK  LoaderBlock)

Definition at line 30 of file halinit_mp.c.

32{
33 static BOOLEAN MPSInitialized = FALSE;
34
35
36 /* Only initialize MP system once. Once called the first time,
37 each subsequent call is part of the initialization sequence
38 for an application processor. */
39
40 DPRINT("HalpInitPhase0()\n");
41
42
43 if (MPSInitialized)
44 {
46 }
47
48 MPSInitialized = TRUE;
49
50 if (!HaliFindSmpConfig())
51 {
53 }
54
55 /* store the kernel base for later use */
56 KernelBase = (ULONG_PTR)CONTAINING_RECORD(LoaderBlock->LoadOrderListHead.Flink, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks)->DllBase;
57
58}
unsigned char BOOLEAN
#define FALSE
Definition: types.h:117
#define ULONG_PTR
Definition: config.h:101
BOOLEAN HaliFindSmpConfig(VOID)
Definition: mpconfig.c:605
ULONG_PTR KernelBase
Definition: halinit_mp.c:20
#define DPRINT
Definition: sndvol32.h:71
Definition: btrfs_drv.h:1876
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
LIST_ENTRY LoadOrderListHead
Definition: arc.h:540
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

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}
IDTUsageFlags HalpIDTUsageFlags[256]
Definition: usage.c:19
IDTUsage HalpIDTUsage[256]
Definition: usage.c:20
UCHAR BusReleativeVector
Definition: halp.h:32
KIRQL Irql
Definition: halp.h:31
UCHAR Flags
Definition: halp.h:26
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170

Variable Documentation

◆ HalpCurrentTimeIncrement

ULONG HalpCurrentTimeIncrement
extern

Definition at line 25 of file timer.c.

Referenced by HalInitSystem(), HalpClockInterrupt(), and HalpInitializeClock().

◆ HalpNextIntervalCount

ULONG HalpNextIntervalCount

Definition at line 59 of file halp.h.

◆ HalpNextTimeIncrement

ULONG HalpNextTimeIncrement

Definition at line 59 of file halp.h.