ReactOS  0.4.14-dev-49-gfb4591c
hwapm.c File Reference
#include <freeldr.h>
#include <debug.h>
Include dependency graph for hwapm.c:

Go to the source code of this file.

Functions

 DBG_DEFAULT_CHANNEL (HWDETECT)
 
static BOOLEAN FindApmBios (VOID)
 
VOID DetectApmBios (PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
 

Function Documentation

◆ DBG_DEFAULT_CHANNEL()

DBG_DEFAULT_CHANNEL ( HWDETECT  )

◆ DetectApmBios()

VOID DetectApmBios ( PCONFIGURATION_COMPONENT_DATA  SystemKey,
ULONG BusNumber 
)

Definition at line 57 of file hwapm.c.

58 {
60  PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
61  ULONG Size;
62 
63  Size = sizeof(CM_PARTIAL_RESOURCE_LIST) -
65 
66  if (FindApmBios())
67  {
68  /* Create 'Configuration Data' value */
69  PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
70  memset(PartialResourceList, 0, Size);
71  PartialResourceList->Version = 0;
72  PartialResourceList->Revision = 0;
73  PartialResourceList->Count = 0;
74 
75  /* Create new bus key */
76  FldrCreateComponentKey(SystemKey,
78  MultiFunctionAdapter,
79  0x0,
80  0x0,
81  0xFFFFFFFF,
82  "APM",
83  PartialResourceList,
84  Size,
85  &BiosKey);
86 
87  /* Increment bus number */
88  (*BusNumber)++;
89  }
90 
91  /* FIXME: Add configuration data */
92 }
struct _CM_PARTIAL_RESOURCE_LIST CM_PARTIAL_RESOURCE_LIST
GLint x0
Definition: linetemp.h:95
FORCEINLINE PVOID FrLdrHeapAlloc(SIZE_T MemorySize, ULONG Tag)
Definition: mm.h:163
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
VOID NTAPI FldrCreateComponentKey(IN PCONFIGURATION_COMPONENT_DATA SystemNode, IN CONFIGURATION_CLASS Class, IN CONFIGURATION_TYPE Type, IN IDENTIFIER_FLAG Flags, IN ULONG Key, IN ULONG Affinity, IN PCHAR IdentifierString, IN PCM_PARTIAL_RESOURCE_LIST ResourceList, IN ULONG Size, OUT PCONFIGURATION_COMPONENT_DATA *ComponentKey)
Definition: archwsup.c:147
unsigned int ULONG
Definition: retypes.h:1
static BOOLEAN FindApmBios(VOID)
Definition: hwapm.c:27
#define memset(x, y, z)
Definition: compat.h:39
#define TAG_HW_RESOURCE_LIST
Definition: hardware.h:26

Referenced by PcHwDetect().

◆ FindApmBios()

static BOOLEAN FindApmBios ( VOID  )
static

Definition at line 27 of file hwapm.c.

28 {
29  REGS RegsIn;
30  REGS RegsOut;
31 
32  RegsIn.b.ah = 0x53;
33  RegsIn.b.al = 0x00;
34  RegsIn.w.bx = 0x0000;
35 
36  Int386(0x15, &RegsIn, &RegsOut);
37 
38  if (INT386_SUCCESS(RegsOut))
39  {
40  TRACE("Found APM BIOS\n");
41  TRACE("AH: %x\n", RegsOut.b.ah);
42  TRACE("AL: %x\n", RegsOut.b.al);
43  TRACE("BH: %x\n", RegsOut.b.bh);
44  TRACE("BL: %x\n", RegsOut.b.bl);
45  TRACE("CX: %x\n", RegsOut.w.cx);
46 
47  return TRUE;
48  }
49 
50  TRACE("No APM BIOS found\n");
51 
52  return FALSE;
53 }
#define TRUE
Definition: types.h:120
unsigned short cx
Definition: pcbios.h:101
unsigned char ah
Definition: pcbios.h:120
int __cdecl Int386(int ivec, REGS *in, REGS *out)
#define INT386_SUCCESS(regs)
Definition: pcbios.h:167
#define TRACE(s)
Definition: solgame.cpp:4
unsigned char bl
Definition: pcbios.h:122
BYTEREGS b
Definition: pcbios.h:151
unsigned char al
Definition: pcbios.h:119
unsigned char bh
Definition: pcbios.h:123
unsigned short bx
Definition: pcbios.h:100
Definition: pcbios.h:146
WORDREGS w
Definition: pcbios.h:150

Referenced by DetectApmBios().