ReactOS  0.4.13-dev-257-gfabbd7c
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 58 of file hwapm.c.

59 {
61  PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
62  ULONG Size;
63 
64  Size = sizeof(CM_PARTIAL_RESOURCE_LIST) -
66 
67  if (FindApmBios())
68  {
69  /* Create 'Configuration Data' value */
70  PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
71  memset(PartialResourceList, 0, Size);
72  PartialResourceList->Version = 0;
73  PartialResourceList->Revision = 0;
74  PartialResourceList->Count = 0;
75 
76  /* Create new bus key */
77  FldrCreateComponentKey(SystemKey,
79  MultiFunctionAdapter,
80  0x0,
81  0x0,
82  0xFFFFFFFF,
83  "APM",
84  PartialResourceList,
85  Size,
86  &BiosKey);
87 
88  /* Increment bus number */
89  (*BusNumber)++;
90  }
91 
92  /* FIXME: Add configuration data */
93 }
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:28
#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 28 of file hwapm.c.

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

Referenced by DetectApmBios().