Skip to content

Commit

Permalink
Split out pl330 dma interface header
Browse files Browse the repository at this point in the history
  • Loading branch information
coolstar committed Nov 28, 2023
1 parent 412d314 commit 106f3b5
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 100 deletions.
2 changes: 1 addition & 1 deletion drivers/audio/csaudiork3x/Source/Main/Main.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
<PreprocessorDefinitions>%(PreprocessorDefinitions);_USE_WAVERT_;_USE_IPortClsRuntimePower;_NEW_DELETE_OPERATORS_;POOL_ZERO_DOWN_LEVEL_SUPPORT</PreprocessorDefinitions>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\Utilities;.</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\Filters;.</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\Inc;.</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\Inc;..\..\..\..\include;.</AdditionalIncludeDirectories>
<ExceptionHandling>
</ExceptionHandling>
</ClCompile>
Expand Down
3 changes: 1 addition & 2 deletions drivers/audio/csaudiork3x/Source/Utilities/Utilities.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
</ResourceCompile>
<ClCompile>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH);..;.</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\Inc;.</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\Inc;..\..\..\..\include;.</AdditionalIncludeDirectories>
<PreprocessorDefinitions>%(PreprocessorDefinitions);_USE_WAVERT_;_NEW_DELETE_OPERATORS_</PreprocessorDefinitions>
<ExceptionHandling>
</ExceptionHandling>
Expand Down Expand Up @@ -83,7 +83,6 @@
</ItemGroup>
<ItemGroup>
<ClInclude Include="adsp.h" />
<ClInclude Include="pl330dma.h" />
<ClInclude Include="rk3x.h" />
<ClInclude Include="hw.h" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion drivers/audio/csaudiork3x/Source/Utilities/hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ typedef struct CSAUDIOARG {

#if USERKHW
#include "rk3x.h"
#include "pl330dma.h"
#include <pl330dma.h>

union baseaddr {
PVOID Base;
Expand Down
94 changes: 1 addition & 93 deletions drivers/dma/pl330dma/driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#include "bitops.h"
#include "pl330.h"
#include <pl330dma.h>

//
// String definitions
Expand All @@ -30,99 +31,6 @@

#define SYMBOLIC_NAME_PREFIX L"\\DosDevices\\%hs"

typedef
void
(*PDMA_NOTIFICATION_CALLBACK)(
PVOID context
);

typedef
HANDLE
(*PGET_HANDLE)(
IN PVOID Context,
IN int Idx
);

typedef
BOOLEAN
(*PFREE_HANDLE)(
IN PVOID Context,
IN HANDLE Handle
);

typedef
VOID
(*PSTOP_DMA)(
IN PVOID Context,
IN HANDLE Handle
);

typedef
VOID
(*PGET_THREAD_REGISTERS)(
IN PVOID Context,
IN HANDLE Handle,
OUT UINT32* cpc,
OUT UINT32* sa,
OUT UINT32* da
);

typedef
NTSTATUS
(*PSUBMIT_AUDIO_DMA) (
IN PVOID Context,
IN HANDLE Handle,
IN BOOLEAN fromDevice,
IN UINT32 srcAddr,
IN UINT32 dstAddr,
IN UINT32 len,
IN UINT32 periodLen
);

typedef
NTSTATUS
(*PSUBMIT_DMA) (
IN PVOID Context,
IN HANDLE Handle,
IN BOOLEAN fromDevice,
IN PMDL pMDL,
IN UINT32 dstAddr
);

typedef
NTSTATUS
(*PREGISTER_NOTIFICATION_CALLBACK)(
IN PVOID Context,
IN HANDLE Handle,
IN PDEVICE_OBJECT Fdo,
IN PDMA_NOTIFICATION_CALLBACK NotificationCallback,
IN PVOID CallbackContext
);

typedef
NTSTATUS
(*PUNREGISTER_NOTIFICATION_CALLBACK)(
IN PVOID Context,
IN HANDLE Handle,
IN PDMA_NOTIFICATION_CALLBACK NotificationCallback,
IN PVOID CallbackContext
);

DEFINE_GUID(GUID_PL330DMA_INTERFACE_STANDARD,
0xdb4b9e2c, 0x7fc6, 0x11ee, 0x95, 0x37, 0x00, 0x15, 0x5d, 0x45, 0x35, 0x74);

typedef struct _PL330DMA_INTERFACE_STANDARD {
INTERFACE InterfaceHeader;
PGET_HANDLE GetChannel;
PFREE_HANDLE FreeChannel;
PSTOP_DMA StopDMA;
PGET_THREAD_REGISTERS GetThreadRegisters;
PSUBMIT_AUDIO_DMA SubmitAudioDMA;
PSUBMIT_DMA SubmitDMA; //reserved for future use
PREGISTER_NOTIFICATION_CALLBACK RegisterNotificationCallback;
PUNREGISTER_NOTIFICATION_CALLBACK UnregisterNotificationCallback;
} PL330DMA_INTERFACE_STANDARD, * PPL330DMA_INTERFACE_STANDARD;

typedef struct _PL330DMA_CONFIG {
#define DMAC_MODE_NS (1 << 0)
UINT32 Mode;
Expand Down
4 changes: 2 additions & 2 deletions drivers/dma/pl330dma/pl330.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<WppScanConfigurationData Condition="'%(ClCompile. ScanConfigurationData)' == ''">trace.h</WppScanConfigurationData>
<WppKernelMode>true</WppKernelMode>
<TreatWarningAsError>false</TreatWarningAsError>
<AdditionalIncludeDirectories>$(SPB_INC_PATH)\$(SPB_VERSION_MAJOR).$(SPB_VERSION_MINOR);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Inf>
<TimeStamp>1.0.0</TimeStamp>
Expand All @@ -75,7 +75,7 @@
<WppScanConfigurationData Condition="'%(ClCompile. ScanConfigurationData)' == ''">trace.h</WppScanConfigurationData>
<WppKernelMode>true</WppKernelMode>
<TreatWarningAsError>false</TreatWarningAsError>
<AdditionalIncludeDirectories>$(SPB_INC_PATH)\$(SPB_VERSION_MAJOR).$(SPB_VERSION_MINOR);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Inf>
<TimeStamp>1.0.0</TimeStamp>
Expand Down
12 changes: 12 additions & 0 deletions drivers/dma/pl330dma/pl330.vcxproj.Filters
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@
<ClCompile Include="dmacontroller.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="insn.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="threads.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="pl330.rc">
Expand All @@ -46,5 +52,11 @@
<ClInclude Include="pl330.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="bitops.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="opcodes.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#ifndef _PL330DMA_INTERFACE_H
#define _PL330DMA_INTERFACE_H

typedef
void
(*PDMA_NOTIFICATION_CALLBACK)(
Expand Down Expand Up @@ -89,4 +92,5 @@ typedef struct _PL330DMA_INTERFACE_STANDARD {
PSUBMIT_DMA SubmitDMA; //reserved for future use
PREGISTER_NOTIFICATION_CALLBACK RegisterNotificationCallback;
PUNREGISTER_NOTIFICATION_CALLBACK UnregisterNotificationCallback;
} PL330DMA_INTERFACE_STANDARD, * PPL330DMA_INTERFACE_STANDARD;
} PL330DMA_INTERFACE_STANDARD, * PPL330DMA_INTERFACE_STANDARD;
#endif

0 comments on commit 106f3b5

Please sign in to comment.