Skip to content

Commit bc35474

Browse files
[HDAUDBUS_NEW] Enable building the driver
- Add CMakeLists.txt. - Fix GCC and MSVC builds. CORE-15350, CORE-18776
1 parent 47e0ac4 commit bc35474

File tree

5 files changed

+45
-2
lines changed

5 files changed

+45
-2
lines changed

drivers/wdm/audio/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ add_subdirectory(backpln)
33
add_subdirectory(drivers)
44
add_subdirectory(drm)
55
add_subdirectory(filters)
6-
add_subdirectory(hdaudbus)
6+
add_subdirectory(hdaudbus_new)
77
add_subdirectory(legacy)
88
add_subdirectory(sysaudio)
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
2+
remove_definitions(-D_WIN32_WINNT=0x502)
3+
4+
list(APPEND SOURCE
5+
adsp.cpp
6+
buspdo.cpp
7+
fdo.cpp
8+
hdac_controller.cpp
9+
hdac_stream.cpp
10+
hdaudio.cpp
11+
nhlt.cpp
12+
sgpc.cpp
13+
sklhdaudbus.cpp
14+
sof-tplg.cpp)
15+
16+
add_library(hdaudbus MODULE ${SOURCE})
17+
set_module_type(hdaudbus kmdfdriver)
18+
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
19+
target_compile_options(hdaudbus PRIVATE -Wno-write-strings)
20+
endif()
21+
target_link_libraries(hdaudbus ntoskrnl_vista libcntpr ${PSEH_LIB})
22+
add_importlibs(hdaudbus wdfldr ntoskrnl hal)
23+
add_cd_file(TARGET hdaudbus DESTINATION reactos/system32/drivers FOR all)
24+
add_driver_inf(hdaudbus hdaudbus.inf)

drivers/wdm/audio/hdaudbus_new/driver.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ extern "C" {
2323

2424
#include <wdm.h>
2525
#include <wdmguid.h>
26-
#include <wdf.h>
26+
#include "wdf.h"
2727
#include <ntintsafe.h>
2828
#include <ntstrsafe.h>
2929
#include <hdaudio.h>
@@ -36,7 +36,11 @@ extern "C" {
3636
#include "hdac_stream.h"
3737
#include "hda_verbs.h"
3838

39+
#ifdef __REACTOS__
40+
#define DRIVERNAME "hdaudbus.sys: "
41+
#else
3942
#define DRIVERNAME "sklhdaudbus.sys: "
43+
#endif
4044
#define SKLHDAUDBUS_POOL_TAG 'SADH'
4145

4246
#define VEN_INTEL 0x8086
@@ -47,6 +51,12 @@ extern "C" {
4751

4852
#include "regfuncs.h"
4953

54+
#ifdef __REACTOS__
55+
#define MAXUINT64 ((UINT64)UINT64_MAX)
56+
#define MAXULONG64 ((ULONG64)ULONG64_MAX)
57+
#define MAXULONG32 ((ULONG32)ULONG_MAX)
58+
#endif
59+
5060
NTSTATUS HDA_WaitForTransfer(
5161
PFDO_CONTEXT fdoCtx,
5262
UINT16 codecAddr,

drivers/wdm/audio/hdaudbus_new/sklhdaudbus.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ __in PUNICODE_STRING RegistryPath
4040
// Default to NonPagedPoolNx for non paged pool allocations where supported.
4141
//
4242

43+
#ifndef __REACTOS__
44+
// FIXME: disabled for now, since it's unimplemented in ReactOS
4345
ExInitializeDriverRuntime(DrvRtPoolNxOptIn);
46+
#endif
4447

4548
WDF_DRIVER_CONFIG_INIT(&config, SklHdAudBusEvtDeviceAdd);
4649

drivers/wdm/audio/hdaudbus_new/sof-tplg.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
#define SOFTPLG_MAGIC '$SOF'
22

3+
#ifdef __REACTOS__
4+
// Downgrade unsupported NT6.2+ features.
5+
#define NonPagedPoolNx NonPagedPool
6+
#define NonPagedPoolNxCacheAligned NonPagedPoolCacheAligned
7+
#endif
8+
39
typedef struct _SOF_TPLG {
410
UINT32 magic;
511
UINT32 length;

0 commit comments

Comments
 (0)