ReactOS 0.4.16-dev-2491-g3dc6630
usage.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS HAL
3 * LICENSE: GPL - See COPYING in the top level directory
4 * PURPOSE: HAL Resource Report Routines
5 * PROGRAMMERS: Stefan Ginsberg (stefan.ginsberg@reactos.org)
6 */
7
8/* INCLUDES *******************************************************************/
9
10#include <hal.h>
11
12/* GLOBALS ********************************************************************/
13
20
21#if defined(SARCH_XBOX)
22// No COM port IRQ mapping
23#elif defined(SARCH_PC98)
25{
26 {0x30, 4},
27 {0x238, 5},
28 {0, 0}
29};
30#else // Standard BIOS-based PC (AT-compatible)
32{
33 {0x3F8, 4},
34 {0x2F8, 3},
35 {0x3E8, 4},
36 {0x2E8, 3},
37 {0, 0}
38};
39#endif
40
42{
44 {
45 /* Default to COM2; changed to KdComPortInUse at runtime */
46 {0x2F8, 0x8},
47 {0, 0}
48 }
49};
50
52{
54 {
55#if defined(SARCH_PC98)
56 /* PIC 1 */
57 {0x00, 1},
58 {0x02, 1},
59 /* PIC 2 */
60 {0x08, 1},
61 {0x0A, 1},
62 /* DMA */
63 {0x01, 1},
64 {0x03, 1},
65 {0x05, 1},
66 {0x07, 1},
67 {0x09, 1},
68 {0x0B, 1},
69 {0x0D, 1},
70 {0x0F, 1},
71 {0x11, 1},
72 {0x13, 1},
73 {0x15, 1},
74 {0x17, 1},
75 {0x19, 1},
76 {0x1B, 1},
77 {0x1D, 1},
78 {0x1F, 1},
79 {0x21, 1},
80 {0x23, 1},
81 {0x25, 1},
82 {0x27, 1},
83 {0x29, 1},
84 {0x2B, 1},
85 {0x2D, 1},
86 {0xE05, 1},
87 {0xE07, 1},
88 {0xE09, 1},
89 {0xE0B, 1},
90 /* RTC */
91 {0x20, 1},
92 {0x22, 1},
93 {0x128, 1},
94 /* System Control */
95 {0x33, 1},
96 {0x37, 1},
97 /* PIT */
98 {0x71, 1},
99 {0x73, 1},
100 {0x75, 1},
101 {0x77, 1},
102 {0x3FD9,1},
103 {0x3FDB,1},
104 {0x3FDD,1},
105 {0x3FDF,1},
106 /* x87 Coprocessor */
107 {0xF8, 8},
108#else
109 {0x00, 0x20}, /* DMA 1 */
110 {0xC0, 0x20}, /* DMA 2 */
111 {0x80, 0x10}, /* DMA EPAR */
112 {0x20, 0x2}, /* PIC 1 */
113 {0xA0, 0x2}, /* PIC 2 */
114 {0x40, 0x4}, /* PIT 1 */
115 {0x48, 0x4}, /* PIT 2 */
116 {0x92, 0x1}, /* System Control Port A */
117 {0x70, 0x2}, /* CMOS */
118 {0xF0, 0x10}, /* x87 Coprocessor */
119#endif
120 {0xCF8, 0x8}, /* PCI 0 */
121 {0, 0}
122 }
123};
124
125/* FUNCTIONS ******************************************************************/
126
127#ifndef _MINIHAL_
128CODE_SEG("INIT")
129VOID
130NTAPI
132 OUT PULONG Scale,
134{
135 /* Sorting depends on resource type */
136 switch (Descriptor->Type)
137 {
139
140 /* Interrupt goes by level */
141 *Scale = 0;
142 Value->QuadPart = (LONGLONG)Descriptor->u.Interrupt.Level;
143 break;
144
146
147 /* Port goes by port address */
148 *Scale = 1;
149 *Value = Descriptor->u.Port.Start;
150 break;
151
153
154 /* Memory goes by base address */
155 *Scale = 2;
156 *Value = Descriptor->u.Memory.Start;
157 break;
158
159 default:
160
161 /* Anything else */
162 *Scale = 4;
163 Value->QuadPart = 0LL;
164 break;
165 }
166}
167
168CODE_SEG("INIT")
169VOID
170NTAPI
173 IN PCM_PARTIAL_RESOURCE_DESCRIPTOR TranslatedDescriptor)
174{
175 /* Exclusive interrupt entry */
176 RawDescriptor->Type = CmResourceTypeInterrupt;
177 RawDescriptor->ShareDisposition = CmResourceShareDriverExclusive;
178
179 /* Check the interrupt type */
181 {
182 /* Latched */
183 RawDescriptor->Flags = CM_RESOURCE_INTERRUPT_LATCHED;
184 }
185 else
186 {
187 /* Level */
188 RawDescriptor->Flags = CM_RESOURCE_INTERRUPT_LEVEL_SENSITIVE;
189 }
190
191 /* Get vector and level from IDT usage */
192 RawDescriptor->u.Interrupt.Vector = HalpIDTUsage[Entry].BusReleativeVector;
193 RawDescriptor->u.Interrupt.Level = HalpIDTUsage[Entry].BusReleativeVector;
194
195 /* Affinity is all the CPUs */
196 RawDescriptor->u.Interrupt.Affinity = HalpActiveProcessors;
197
198 /* The translated copy is identical */
199 RtlCopyMemory(TranslatedDescriptor, RawDescriptor, sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR));
200
201 /* But the vector and IRQL must be set correctly */
202 TranslatedDescriptor->u.Interrupt.Vector = Entry;
203 TranslatedDescriptor->u.Interrupt.Level = HalpIDTUsage[Entry].Irql;
204}
205
206CODE_SEG("INIT")
207VOID
208NTAPI
210 IN PADDRESS_USAGE CurrentAddress,
211 IN ULONG Element,
213 IN PCM_PARTIAL_RESOURCE_DESCRIPTOR TranslatedDescriptor)
214{
216
217 /* Set the type and make it exclusive */
218 RawDescriptor->Type = CurrentAddress->Type;
219 RawDescriptor->ShareDisposition = CmResourceShareDriverExclusive;
220
221 /* Check what this is */
222 if (RawDescriptor->Type == CmResourceTypePort)
223 {
224 /* Write out port data */
225 AddressSpace = 1;
226 RawDescriptor->Flags = CM_RESOURCE_PORT_IO;
227 RawDescriptor->u.Port.Start.HighPart = 0;
228 RawDescriptor->u.Port.Start.LowPart = CurrentAddress->Element[Element].Start;
229 RawDescriptor->u.Port.Length = CurrentAddress->Element[Element].Length;
230
231 /* Determine if 16-bit port addresses are allowed */
232 RawDescriptor->Flags |= HalpIs16BitPortDecodeSupported();
233 }
234 else
235 {
236 /* Write out memory data */
237 AddressSpace = 0;
238 RawDescriptor->Flags = (CurrentAddress->Flags & IDT_READ_ONLY) ?
241 RawDescriptor->u.Memory.Start.HighPart = 0;
242 RawDescriptor->u.Memory.Start.LowPart = CurrentAddress->Element[Element].Start;
243 RawDescriptor->u.Memory.Length = CurrentAddress->Element[Element].Length;
244 }
245
246 /* Make an identical copy to begin with */
247 RtlCopyMemory(TranslatedDescriptor, RawDescriptor, sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR));
248
249 /* Check what this is */
250 if (RawDescriptor->Type == CmResourceTypePort)
251 {
252 /* Translate the port */
254 0,
255 RawDescriptor->u.Port.Start,
257 &TranslatedDescriptor->u.Port.Start);
258
259 /* If it turns out this is memory once translated, flag it */
260 if (AddressSpace == 0) TranslatedDescriptor->Flags = CM_RESOURCE_PORT_MEMORY;
261
262 }
263 else
264 {
265 /* Translate the memory */
267 0,
268 RawDescriptor->u.Memory.Start,
270 &TranslatedDescriptor->u.Memory.Start);
271 }
272}
273
274CODE_SEG("INIT")
275VOID
276NTAPI
279{
280 PCM_RESOURCE_LIST RawList, TranslatedList;
281 PCM_FULL_RESOURCE_DESCRIPTOR RawFull, TranslatedFull;
282 PCM_PARTIAL_RESOURCE_DESCRIPTOR CurrentRaw, CurrentTranslated, SortedRaw, SortedTranslated;
283 CM_PARTIAL_RESOURCE_DESCRIPTOR RawPartial, TranslatedPartial;
284 PCM_PARTIAL_RESOURCE_LIST RawPartialList = NULL, TranslatedPartialList = NULL;
286 ULONG i, j, k, ListSize, Count, Element, CurrentScale, SortScale, ReportType, FlagMatch;
287 ADDRESS_USAGE *CurrentAddress;
288 LARGE_INTEGER CurrentSortValue, SortValue;
289
290 DbgPrint("%wZ detected\n", HalName);
291
292 /* Check if KD is using a COM port */
293 if (KdComPortInUse)
294 {
295 /* Enter it into the I/O space */
299
300#if defined(SARCH_XBOX)
301 /*
302 * Do not claim interrupt resources for the KD COM port.
303 * The actual COM port lacks SERIRQ, IRQ 4 is hardwired to the NIC.
304 */
305#else
306 /* Use the debug port table if we have one */
308
309 /* Check if we're using ACPI */
311 {
312 /* No, so use our local table */
314 for (i = 0, Port = HalpComPortIrqMapping[i][0];
315 Port;
316 i++, Port = HalpComPortIrqMapping[i][0])
317 {
318 /* Is this the port we want? */
320 {
321 /* Register it */
326 HIGH_LEVEL);
327 }
328 }
329 }
330#endif
331 }
332
333 /* On non-ACPI systems, we need to build an address map */
335
336 /* Allocate the master raw and translated lists */
338 TranslatedList = ExAllocatePoolWithTag(NonPagedPool, PAGE_SIZE * 2, TAG_HAL);
339 if (!(RawList) || !(TranslatedList))
340 {
341 /* Bugcheck the system */
342 KeBugCheckEx(HAL_MEMORY_ALLOCATION,
343 4 * PAGE_SIZE,
344 1,
345 (ULONG_PTR)__FILE__,
346 __LINE__);
347 }
348
349 /* Zero out the lists */
350 RtlZeroMemory(RawList, PAGE_SIZE * 2);
351 RtlZeroMemory(TranslatedList, PAGE_SIZE * 2);
352
353 /* Set the interface type to begin with */
355
356 /* Loop all IDT entries that are not IRQs */
357 for (i = 0; i < PRIMARY_VECTOR_BASE; i++)
358 {
359 /* Check if the IDT isn't owned */
361 {
362 /* Then register it for internal usage */
365 }
366 }
367
368 /* Our full raw descriptors start here */
369 RawFull = RawList->List;
370
371 /* Keep track of the current partial raw and translated descriptors */
372 CurrentRaw = (PCM_PARTIAL_RESOURCE_DESCRIPTOR)RawList->List;
373 CurrentTranslated = (PCM_PARTIAL_RESOURCE_DESCRIPTOR)TranslatedList->List;
374
375 /* Do two passes */
376 for (ReportType = 0; ReportType < 2; ReportType++)
377 {
378 /* Pass 0 is for device usage */
379 if (ReportType == 0)
380 {
381 FlagMatch = IDT_DEVICE & ~IDT_REGISTERED;
383 }
384 else
385 {
386 /* Past 1 is for internal HAL usage */
387 FlagMatch = IDT_INTERNAL & ~IDT_REGISTERED;
389 }
390
391 /* Reset loop variables */
392 i = Element = 0;
393
394 /* Start looping our address uage list and interrupts */
395 CurrentAddress = HalpAddressUsageList;
396 while (TRUE)
397 {
398 /* Check for valid vector number */
399 if (i <= MAXIMUM_IDTVECTOR)
400 {
401 /* Check if this entry should be parsed */
402 if ((HalpIDTUsageFlags[i].Flags & FlagMatch))
403 {
404 /* Parse it */
405 HalpBuildPartialFromIdt(i, &RawPartial, &TranslatedPartial);
406 i++;
407 }
408 else
409 {
410 /* Skip this entry */
411 i++;
412 continue;
413 }
414 }
415 else
416 {
417 /* This is an address instead */
418 if (!CurrentAddress) break;
419
420 /* Check if the address should be reported */
421 if (!(CurrentAddress->Flags & FlagMatch) ||
422 !(CurrentAddress->Element[Element].Length))
423 {
424 /* Nope, skip it */
425 Element = 0;
426 CurrentAddress = CurrentAddress->Next;
427 continue;
428 }
429
430 /* Otherwise, parse the entry */
432 CurrentAddress,
433 Element,
434 &RawPartial,
435 &TranslatedPartial);
436 Element++;
437 }
438
439 /* Check for interface change */
440 if (RawFull->InterfaceType != Interface)
441 {
442 /* We need to add another full descriptor */
443 RawList->Count++;
444 TranslatedList->Count++;
445
446 /* The full descriptor follows wherever we were */
447 RawFull = (PCM_FULL_RESOURCE_DESCRIPTOR)CurrentRaw;
448 TranslatedFull = (PCM_FULL_RESOURCE_DESCRIPTOR)CurrentTranslated;
449
450 /* And it is of this new interface type */
451 RawFull->InterfaceType = Interface;
452 TranslatedFull->InterfaceType = Interface;
453
454 /* And its partial descriptors begin here */
455 RawPartialList = &RawFull->PartialResourceList;
456 TranslatedPartialList = &TranslatedFull->PartialResourceList;
457
458 /* And our next full descriptor should follow here */
459 CurrentRaw = RawFull->PartialResourceList.PartialDescriptors;
460 CurrentTranslated = TranslatedFull->PartialResourceList.PartialDescriptors;
461 }
462
463 /* We have written a new partial descriptor */
464 RawPartialList->Count++;
465 TranslatedPartialList->Count++;
466
467 /* Copy our local descriptors into the actual list */
468 RtlCopyMemory(CurrentRaw, &RawPartial, sizeof(RawPartial));
469 RtlCopyMemory(CurrentTranslated, &TranslatedPartial, sizeof(TranslatedPartial));
470
471 /* Move to the next partial descriptor */
472 CurrentRaw++;
473 CurrentTranslated++;
474 }
475 }
476
477 /* Get the final list of the size for the kernel call later */
478 ListSize = (ULONG)((ULONG_PTR)CurrentRaw - (ULONG_PTR)RawList);
479
480 /* Now reset back to the first full descriptor */
481 RawFull = RawList->List;
482 TranslatedFull = TranslatedList->List;
483
484 /* And loop all the full descriptors */
485 for (i = 0; i < RawList->Count; i++)
486 {
487 /* Get the first partial descriptor in this list */
488 CurrentRaw = RawFull->PartialResourceList.PartialDescriptors;
489 CurrentTranslated = TranslatedFull->PartialResourceList.PartialDescriptors;
490
491 /* Get the count of partials in this list */
493
494 /* Loop all the partials in this list */
495 for (j = 0; j < Count; j++)
496 {
497 /* Get the sort value at this point */
498 HalpGetResourceSortValue(CurrentRaw, &CurrentScale, &CurrentSortValue);
499
500 /* Save the current sort pointer */
501 SortedRaw = CurrentRaw;
502 SortedTranslated = CurrentTranslated;
503
504 /* Loop all descriptors starting from this one */
505 for (k = j; k < Count; k++)
506 {
507 /* Get the sort value at the sort point */
508 HalpGetResourceSortValue(SortedRaw, &SortScale, &SortValue);
509
510 /* Check if a swap needs to occur */
511 if ((SortScale < CurrentScale) ||
512 ((SortScale == CurrentScale) &&
513 (SortValue.QuadPart <= CurrentSortValue.QuadPart)))
514 {
515 /* Swap raw partial with the sort location partial */
516 RtlCopyMemory(&RawPartial, CurrentRaw, sizeof(RawPartial));
517 RtlCopyMemory(CurrentRaw, SortedRaw, sizeof(RawPartial));
518 RtlCopyMemory(SortedRaw, &RawPartial, sizeof(RawPartial));
519
520 /* Swap translated partial in the same way */
521 RtlCopyMemory(&TranslatedPartial, CurrentTranslated, sizeof(TranslatedPartial));
522 RtlCopyMemory(CurrentTranslated, SortedTranslated, sizeof(TranslatedPartial));
523 RtlCopyMemory(SortedTranslated, &TranslatedPartial, sizeof(TranslatedPartial));
524
525 /* Update the sort value at this point */
526 HalpGetResourceSortValue(CurrentRaw, &CurrentScale, &CurrentSortValue);
527 }
528
529 /* The sort location has been updated */
530 SortedRaw++;
531 SortedTranslated++;
532 }
533
534 /* Move to the next partial */
535 CurrentRaw++;
536 CurrentTranslated++;
537 }
538
539 /* Move to the next full descriptor */
540 RawFull = (PCM_FULL_RESOURCE_DESCRIPTOR)CurrentRaw;
541 TranslatedFull = (PCM_FULL_RESOURCE_DESCRIPTOR)CurrentTranslated;
542 }
543
544 /* Mark this is an ACPI system, if it is */
546
547 /* Tell the kernel about all this */
549 RawList,
550 TranslatedList,
551 ListSize);
552
553 /* Free our lists */
554 ExFreePool(RawList);
555 ExFreePool(TranslatedList);
556
557 /* Get the machine's serial number */
559}
560#endif /* !_MINIHAL_ */
561
562CODE_SEG("INIT")
563VOID
564NTAPI
566 IN ULONG BusVector,
567 IN ULONG SystemVector,
568 IN KIRQL Irql)
569{
570 /* Save the vector flags */
571 HalpIDTUsageFlags[SystemVector].Flags = Flags;
572
573 /* Save the vector data */
574 HalpIDTUsage[SystemVector].Irql = Irql;
575 HalpIDTUsage[SystemVector].BusReleativeVector = (UCHAR)BusVector;
576}
577
578#ifndef _MINIHAL_
579CODE_SEG("INIT")
580VOID
581NTAPI
583 IN ULONG BusVector,
584 IN ULONG SystemVector,
585 IN KIRQL Irql,
588{
589 /* Set the IDT_LATCHED flag for latched interrupts */
590 if (Mode == Latched) Flags |= IDT_LATCHED;
591
592 /* Register the vector */
593 HalpRegisterVector(Flags, BusVector, SystemVector, Irql);
594
595 /* Connect the interrupt */
596 KeRegisterInterruptHandler(SystemVector, Handler);
597
598 /* Enable the interrupt */
599 HalEnableSystemInterrupt(SystemVector, Irql, Mode);
600}
601
602CODE_SEG("INIT")
603VOID
604NTAPI
606{
608 UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\CrashControl");
613 KEY_VALUE_PARTIAL_INFORMATION KeyValueInformation;
614
615 /* Set default */
616 HalpNMIDumpFlag = 0;
617
618 /* Initialize attributes */
620 &KeyName,
622 NULL,
623 NULL);
624
625 /* Open crash key */
626 Status = ZwOpenKey(&Handle, KEY_READ, &ObjectAttributes);
627 if (NT_SUCCESS(Status))
628 {
629 /* Query key value */
630 RtlInitUnicodeString(&ValueName, L"NMICrashDump");
631 Status = ZwQueryValueKey(Handle,
632 &ValueName,
634 &KeyValueInformation,
635 sizeof(KeyValueInformation),
636 &ResultLength);
637 if (NT_SUCCESS(Status))
638 {
639 /* Check for valid data */
641 {
642 /* Read the flag */
643 HalpNMIDumpFlag = KeyValueInformation.Data[0];
644 }
645 }
646
647 /* We're done */
649 }
650}
651#endif /* !_MINIHAL_ */
652
653/* EOF */
#define CODE_SEG(...)
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
unsigned char BOOLEAN
Definition: actypes.h:127
LONG NTSTATUS
Definition: precomp.h:26
DECLSPEC_NORETURN VOID NTAPI KeBugCheckEx(IN ULONG BugCheckCode, IN ULONG_PTR BugCheckParameter1, IN ULONG_PTR BugCheckParameter2, IN ULONG_PTR BugCheckParameter3, IN ULONG_PTR BugCheckParameter4)
Definition: debug.c:485
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:36
_Out_ PKIRQL Irql
Definition: csq.h:179
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
#define RTL_CONSTANT_STRING(s)
Definition: combase.c:35
#define L(x)
Definition: resources.c:13
#define ULONG_PTR
Definition: config.h:101
#define PtrToUlong(u)
Definition: config.h:107
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
UCHAR KIRQL
Definition: env_spec_w32.h:591
#define HIGH_LEVEL
Definition: env_spec_w32.h:703
#define PAGE_SIZE
Definition: env_spec_w32.h:49
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
#define NonPagedPool
Definition: env_spec_w32.h:307
ULONG Handle
Definition: gdb_input.c:15
Status
Definition: gdiplustypes.h:25
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
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 GLint GLint j
Definition: glfuncs.h:250
BOOLEAN NTAPI HalTranslateBusAddress(IN INTERFACE_TYPE InterfaceType, IN ULONG BusNumber, IN PHYSICAL_ADDRESS BusAddress, IN OUT PULONG AddressSpace, OUT PPHYSICAL_ADDRESS TranslatedAddress)
Definition: bus.c:140
BOOLEAN NTAPI HalEnableSystemInterrupt(IN ULONG Vector, IN KIRQL Irql, IN KINTERRUPT_MODE InterruptMode)
Definition: pic.c:295
KAFFINITY HalpActiveProcessors
Definition: processor.c:17
VOID NTAPI HalpRegisterVector(IN UCHAR Flags, IN ULONG BusVector, IN ULONG SystemVector, IN KIRQL Irql)
Definition: usage.c:34
PUCHAR KdComPortInUse
Definition: usage.c:17
VOID NTAPI HalpReportResourceUsage(IN PUNICODE_STRING HalName, IN INTERFACE_TYPE InterfaceType)
Definition: usage.c:26
IDTUsageFlags HalpIDTUsageFlags[256]
Definition: usage.c:19
IDTUsage HalpIDTUsage[256]
Definition: usage.c:20
VOID NTAPI HalpEnableInterruptHandler(IN UCHAR Flags, IN ULONG BusVector, IN ULONG SystemVector, IN KIRQL Irql, IN PVOID Handler, IN KINTERRUPT_MODE Mode)
Definition: usage.c:49
#define DbgPrint
Definition: hal.h:12
NTSTATUS NTAPI HalpMarkAcpiHal(VOID)
Definition: misc.c:57
VOID NTAPI HalpReportSerialNumber(VOID)
Definition: misc.c:26
BOOLEAN HalpGetInfoFromACPI
Definition: usage.c:14
VOID NTAPI HalpBuildPartialFromIdt(IN ULONG Entry, IN PCM_PARTIAL_RESOURCE_DESCRIPTOR RawDescriptor, IN PCM_PARTIAL_RESOURCE_DESCRIPTOR TranslatedDescriptor)
Definition: usage.c:171
BOOLEAN HalpNMIDumpFlag
Definition: usage.c:15
USHORT HalpComPortIrqMapping[][2]
Definition: usage.c:31
VOID NTAPI HalpBuildPartialFromAddress(IN INTERFACE_TYPE Interface, IN PADDRESS_USAGE CurrentAddress, IN ULONG Element, IN PCM_PARTIAL_RESOURCE_DESCRIPTOR RawDescriptor, IN PCM_PARTIAL_RESOURCE_DESCRIPTOR TranslatedDescriptor)
Definition: usage.c:209
ADDRESS_USAGE HalpComIoSpace
Definition: usage.c:41
VOID NTAPI HalpGetResourceSortValue(IN PCM_PARTIAL_RESOURCE_DESCRIPTOR Descriptor, OUT PULONG Scale, OUT PLARGE_INTEGER Value)
Definition: usage.c:131
PADDRESS_USAGE HalpAddressUsageList
Definition: usage.c:17
ADDRESS_USAGE HalpDefaultIoSpace
Definition: usage.c:51
VOID NTAPI HalpGetNMICrashFlag(VOID)
Definition: usage.c:605
#define TAG_HAL
Definition: hal.h:61
ULONG NTAPI HalpIs16BitPortDecodeSupported(VOID)
Definition: halacpi.c:1012
VOID NTAPI HalpBuildAddressMap(VOID)
Definition: halacpi.c:995
PWCHAR HalName
Definition: halacpi.c:45
BOOLEAN NTAPI HalpGetDebugPortTable(VOID)
Definition: halacpi.c:1003
#define IDT_LATCHED
Definition: halp.h:20
#define PRIMARY_VECTOR_BASE
Definition: halp.h:16
#define IDT_REGISTERED
Definition: halp.h:19
#define IDT_INTERNAL
Definition: halp.h:21
#define IDT_DEVICE
Definition: halp.h:22
#define IDT_READ_ONLY
Definition: halp.h:60
CPPORT Port[4]
Definition: headless.c:38
_In_ ULONG Mode
Definition: hubbusif.h:303
NTSTATUS NTAPI IoReportHalResourceUsage(_In_ PUNICODE_STRING HalName, _In_ PCM_RESOURCE_LIST RawResourceList, _In_ PCM_RESOURCE_LIST TranslatedResourceList, _In_ ULONG ResourceListSize)
Reports hardware resources of the HAL in the \Registry\Machine\Hardware\ResourceMap tree.
Definition: iorsrce.c:1321
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
int k
Definition: mpi.c:3369
#define MAXIMUM_IDTVECTOR
Definition: ketypes.h:346
#define CM_RESOURCE_PORT_MEMORY
Definition: cmtypes.h:108
#define CM_RESOURCE_PORT_IO
Definition: cmtypes.h:109
#define CM_RESOURCE_MEMORY_READ_ONLY
Definition: cmtypes.h:122
#define CM_RESOURCE_MEMORY_READ_WRITE
Definition: cmtypes.h:121
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
int Count
Definition: noreturn.cpp:7
@ KeyValuePartialInformation
Definition: nt_native.h:1185
#define KEY_READ
Definition: nt_native.h:1026
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
FORCEINLINE VOID KeRegisterInterruptHandler(IN ULONG Vector, IN PVOID Handler)
Definition: ke.h:303
unsigned short USHORT
Definition: pedump.c:61
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
struct _CM_FULL_RESOURCE_DESCRIPTOR * PCM_FULL_RESOURCE_DESCRIPTOR
#define CmResourceTypeMemory
Definition: restypes.h:106
#define CM_RESOURCE_INTERRUPT_LEVEL_SENSITIVE
Definition: restypes.h:116
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR * PCM_PARTIAL_RESOURCE_DESCRIPTOR
@ InterfaceTypeUndefined
Definition: restypes.h:120
@ Internal
Definition: restypes.h:121
enum _INTERFACE_TYPE INTERFACE_TYPE
#define CmResourceTypePort
Definition: restypes.h:104
#define CM_RESOURCE_INTERRUPT_LATCHED
Definition: restypes.h:117
#define CmResourceTypeInterrupt
Definition: restypes.h:105
@ Latched
Definition: miniport.h:81
enum _KINTERRUPT_MODE KINTERRUPT_MODE
base of all file and directory entries
Definition: entries.h:83
Definition: halp.h:30
UCHAR BusReleativeVector
Definition: halp.h:32
KIRQL Irql
Definition: halp.h:31
CM_PARTIAL_RESOURCE_LIST PartialResourceList
Definition: restypes.h:144
INTERFACE_TYPE InterfaceType
Definition: restypes.h:142
CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1]
Definition: restypes.h:100
CM_FULL_RESOURCE_DESCRIPTOR List[1]
Definition: restypes.h:149
struct _HalAddressUsage * Next
Definition: halp.h:202
UCHAR Flags
Definition: halp.h:204
struct _HalAddressUsage::@1636 Element[]
UCHAR Flags
Definition: halp.h:26
#define LL
Definition: tui.h:166
uint32_t * PULONG
Definition: typedefs.h:59
int64_t LONGLONG
Definition: typedefs.h:68
#define NTAPI
Definition: typedefs.h:36
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define IN
Definition: typedefs.h:39
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
LONGLONG QuadPart
Definition: typedefs.h:114
struct _LARGE_INTEGER::@2480 u
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG _Out_ PULONG ResultLength
Definition: wdfdevice.h:3782
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
Definition: wdfdevice.h:2705
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE Interface
Definition: wdffdo.h:465
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID InterfaceType
Definition: wdffdo.h:463
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
Definition: wdfregistry.h:243
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
Definition: wdfresource.h:342
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
@ CmResourceShareDriverExclusive
Definition: cmtypes.h:242
_In_ ULONG _In_ PHYSICAL_ADDRESS _Inout_ PULONG AddressSpace
Definition: iofuncs.h:2274
unsigned char UCHAR
Definition: xmlstorage.h:181