diff --git a/drivers/wdm/audio/CMakeLists.txt b/drivers/wdm/audio/CMakeLists.txt index 0547233be8e..3f48a92eeff 100644 --- a/drivers/wdm/audio/CMakeLists.txt +++ b/drivers/wdm/audio/CMakeLists.txt @@ -3,6 +3,6 @@ add_subdirectory(backpln) add_subdirectory(drivers) add_subdirectory(drm) add_subdirectory(filters) -add_subdirectory(hdaudbus) +add_subdirectory(hdaudbus_new) add_subdirectory(legacy) add_subdirectory(sysaudio) diff --git a/drivers/wdm/audio/hdaudbus_new/CMakeLists.txt b/drivers/wdm/audio/hdaudbus_new/CMakeLists.txt new file mode 100644 index 00000000000..61e2485042a --- /dev/null +++ b/drivers/wdm/audio/hdaudbus_new/CMakeLists.txt @@ -0,0 +1,24 @@ + +remove_definitions(-D_WIN32_WINNT=0x502) + +list(APPEND SOURCE + adsp.cpp + buspdo.cpp + fdo.cpp + hdac_controller.cpp + hdac_stream.cpp + hdaudio.cpp + nhlt.cpp + sgpc.cpp + sklhdaudbus.cpp + sof-tplg.cpp) + +add_library(hdaudbus MODULE ${SOURCE}) +set_module_type(hdaudbus kmdfdriver) +if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang") + target_compile_options(hdaudbus PRIVATE -Wno-write-strings) +endif() +target_link_libraries(hdaudbus ntoskrnl_vista libcntpr ${PSEH_LIB}) +add_importlibs(hdaudbus wdfldr ntoskrnl hal) +add_cd_file(TARGET hdaudbus DESTINATION reactos/system32/drivers FOR all) +add_driver_inf(hdaudbus hdaudbus.inf) diff --git a/drivers/wdm/audio/hdaudbus_new/driver.h b/drivers/wdm/audio/hdaudbus_new/driver.h index b025c3d07c5..3b8782d636c 100644 --- a/drivers/wdm/audio/hdaudbus_new/driver.h +++ b/drivers/wdm/audio/hdaudbus_new/driver.h @@ -23,7 +23,7 @@ extern "C" { #include #include -#include +#include "wdf.h" #include #include #include @@ -36,7 +36,11 @@ extern "C" { #include "hdac_stream.h" #include "hda_verbs.h" +#ifdef __REACTOS__ +#define DRIVERNAME "hdaudbus.sys: " +#else #define DRIVERNAME "sklhdaudbus.sys: " +#endif #define SKLHDAUDBUS_POOL_TAG 'SADH' #define VEN_INTEL 0x8086 @@ -47,6 +51,12 @@ extern "C" { #include "regfuncs.h" +#ifdef __REACTOS__ +#define MAXUINT64 ((UINT64)UINT64_MAX) +#define MAXULONG64 ((ULONG64)ULONG64_MAX) +#define MAXULONG32 ((ULONG32)ULONG_MAX) +#endif + NTSTATUS HDA_WaitForTransfer( PFDO_CONTEXT fdoCtx, UINT16 codecAddr, diff --git a/drivers/wdm/audio/hdaudbus_new/sklhdaudbus.cpp b/drivers/wdm/audio/hdaudbus_new/sklhdaudbus.cpp index fb069092112..405eafb4565 100644 --- a/drivers/wdm/audio/hdaudbus_new/sklhdaudbus.cpp +++ b/drivers/wdm/audio/hdaudbus_new/sklhdaudbus.cpp @@ -40,7 +40,10 @@ __in PUNICODE_STRING RegistryPath // Default to NonPagedPoolNx for non paged pool allocations where supported. // +#ifndef __REACTOS__ + // FIXME: disabled for now, since it's unimplemented in ReactOS ExInitializeDriverRuntime(DrvRtPoolNxOptIn); +#endif WDF_DRIVER_CONFIG_INIT(&config, SklHdAudBusEvtDeviceAdd); diff --git a/drivers/wdm/audio/hdaudbus_new/sof-tplg.h b/drivers/wdm/audio/hdaudbus_new/sof-tplg.h index 6fd6a66ca27..87dc3d97bbd 100644 --- a/drivers/wdm/audio/hdaudbus_new/sof-tplg.h +++ b/drivers/wdm/audio/hdaudbus_new/sof-tplg.h @@ -1,5 +1,11 @@ #define SOFTPLG_MAGIC '$SOF' +#ifdef __REACTOS__ +// Downgrade unsupported NT6.2+ features. +#define NonPagedPoolNx NonPagedPool +#define NonPagedPoolNxCacheAligned NonPagedPoolCacheAligned +#endif + typedef struct _SOF_TPLG { UINT32 magic; UINT32 length;