ReactOS 0.4.16-dev-2293-g4d8327b
nhlt.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  NHLTQueryRevision { NHLTRev1 = 1 }
 
enum  NHLTQuery { NHLTSupportQuery = 0 , NHLTMemoryAddress }
 

Functions

NTSTATUS NHLTCheckSupported (_In_ WDFDEVICE FxDevice)
 
NTSTATUS NHLTQueryTableAddress (_In_ WDFDEVICE FxDevice, UINT64 *nhltAddr, UINT64 *nhltSz)
 

Enumeration Type Documentation

◆ NHLTQuery

Enumerator
NHLTSupportQuery 
NHLTMemoryAddress 

Definition at line 5 of file nhlt.h.

5 {
8};
@ NHLTSupportQuery
Definition: nhlt.h:6
@ NHLTMemoryAddress
Definition: nhlt.h:7

◆ NHLTQueryRevision

Enumerator
NHLTRev1 

Definition at line 1 of file nhlt.h.

1 {
2 NHLTRev1 = 1
3};
@ NHLTRev1
Definition: nhlt.h:2

Function Documentation

◆ NHLTCheckSupported()

NTSTATUS NHLTCheckSupported ( _In_ WDFDEVICE  FxDevice)

Definition at line 146 of file nhlt.cpp.

146 {
147 WDFMEMORY outputBufferMemory;
148 NTSTATUS status = NHLTQuery(FxDevice, NHLTRev1, NHLTSupportQuery, &outputBufferMemory);
149 if (!NT_SUCCESS(status)) {
150 return status;
151 }
152 if (!outputBufferMemory) {
153 return STATUS_NO_MEMORY;
154 }
155
156 PACPI_EVAL_OUTPUT_BUFFER outputBuffer = (PACPI_EVAL_OUTPUT_BUFFER)WdfMemoryGetBuffer(outputBufferMemory, NULL);
157 if (outputBuffer->Count < 1) {
159 goto end;
160 }
161
162 {
163 PACPI_METHOD_ARGUMENT argument = outputBuffer->Argument;
164
165 UCHAR supportedQueries = argument->Data[0];
166
167 if ((supportedQueries & 0x3) == 0) {
169 }
170 }
171
172end:
173 if (outputBufferMemory != NULL) {
174 WdfObjectDelete(outputBufferMemory);
175 outputBufferMemory = NULL;
176 }
177 return status;
178}
ACPI_METHOD_ARGUMENT UNALIGNED * PACPI_METHOD_ARGUMENT
Definition: acpiioct.h:80
ACPI_EVAL_OUTPUT_BUFFER UNALIGNED * PACPI_EVAL_OUTPUT_BUFFER
Definition: acpiioct.h:99
LONG NTSTATUS
Definition: precomp.h:26
#define STATUS_NO_MEMORY
Definition: d3dkmdt.h:51
#define STATUS_NOT_SUPPORTED
Definition: d3dkmdt.h:48
#define NULL
Definition: types.h:112
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
GLuint GLuint end
Definition: gl.h:1545
NHLTQuery
Definition: nhlt.h:5
#define STATUS_INVALID_DEVICE_OBJECT_PARAMETER
Definition: ntstatus.h:1043
Definition: ps.c:97
unsigned char UCHAR
Definition: xmlstorage.h:181

Referenced by Fdo_EvtDevicePrepareHardware().

◆ NHLTQueryTableAddress()

NTSTATUS NHLTQueryTableAddress ( _In_ WDFDEVICE  FxDevice,
UINT64 nhltAddr,
UINT64 nhltSz 
)

Definition at line 182 of file nhlt.cpp.

182 {
183 WDFMEMORY outputBufferMemory;
185 if (!NT_SUCCESS(status)) {
186 return status;
187 }
188 if (!outputBufferMemory) {
189 return STATUS_NO_MEMORY;
190 }
191
192 PACPI_EVAL_OUTPUT_BUFFER outputBuffer = (PACPI_EVAL_OUTPUT_BUFFER)WdfMemoryGetBuffer(outputBufferMemory, NULL);
193 if (outputBuffer->Count < 1) {
195 goto end;
196 }
197
198 {
199 PACPI_METHOD_ARGUMENT argument = outputBuffer->Argument;
200
201 UINT8* res = argument->Data;
202 UINT32 sz = argument->DataLength;
203
204 *nhltAddr = 0;
205 *nhltSz = 0;
206 parseACPI(res, 0, sz, nhltAddr, nhltSz);
207 }
208
209 if (nhltAddr == 0 || nhltSz == 0) {
211 }
212
213end:
214 if (outputBufferMemory != NULL) {
215 WdfObjectDelete(outputBufferMemory);
216 outputBufferMemory = NULL;
217 }
218 return status;
219}
unsigned char UINT8
Definition: actypes.h:128
GLuint res
Definition: glext.h:9613
void parseACPI(UINT8 *res, UINT32 offset, UINT32 sz, UINT64 *nhltAddr, UINT64 *nhltSz)
Definition: nhlt.cpp:264
uint32_t UINT32
Definition: typedefs.h:59
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132

Referenced by Fdo_EvtDevicePrepareHardware().