⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 platform.h

📁 PNX系列设备驱动 PNX系列设备驱动
💻 H
字号:
/*---------------------------------------------------------------------------- 
COPYRIGHT (c) 1997 by Philips Semiconductors

THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY ONLY BE USED AND COPIED IN 
ACCORDANCE WITH THE TERMS AND CONDITIONS OF SUCH A LICENSE AND WITH THE 
INCLUSION OF THE THIS COPY RIGHT NOTICE. THIS SOFTWARE OR ANY OTHER COPIES 
OF THIS SOFTWARE MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER
PERSON. THE OWNERSHIP AND TITLE OF THIS SOFTWARE IS NOT TRANSFERRED. 

THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT ANY PRIOR NOTICE
AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY Philips Semiconductor. 

PHILIPS ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF THIS SOFTWARE
ON PLATFORMS OTHER THAN THE ONE ON WHICH THIS SOFTWARE IS FURNISHED.
----------------------------------------------------------------------------*/
/*
	HISTORY
	970703	Tilakraj Roy	Created
*/

/*----------------------------------------------------------------------------
          SYSTEM INCLUDE FILES
----------------------------------------------------------------------------*/
#include "basedef.h"
#include "vxstd.h"

/*----------------------------------------------------------------------------
          DRIVER SPECIFIC INCLUDE FILES
----------------------------------------------------------------------------*/
#include "tmtypes.h"
#include "tmmanapi.h"

#define CTL_CODE( DeviceType, Function, Method, Access ) (                 \
    ((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method) \
)
#define METHOD_BUFFERED                 0
#define METHOD_IN_DIRECT                1
#define METHOD_OUT_DIRECT               2
#define METHOD_NEITHER                  3

#define FILE_DEVICE_UNKNOWN             0x00000022
#define FILE_ANY_ACCESS                 0

#define	DevFunc2BYTE(Device, Function)(char)( ( ( (char)(Device) << 3 ) & 0xf8 ) | ( (char)(Function) & 0x7 ) )

#define		constTMMANPCIRegisters			0x10

#define		UNKNOWN_BOARD	0
#define		TM_BOARD		1
#define		DEC_BOARD		2
// End of additions by NM

// required by the hal for bit settings
#define constTMManBIU_CTL_SE    0x0001
#define constTMManBIU_CTL_BO    0x0002
#define constTMManBIU_CTL_IE    0x0100
#define constTMManBIU_CTL_HE    0x0200
#define constTMManBIU_CTL_CR    0x0400
#define constTMManBIU_CTL_SR    0x0800


#define	constTMManDC_LOCK_CTL_MASK	0x00000060
#define	constTMManDC_LOCK_CTL_POSITION	5	/* LEFT SHIFT POSITIONS */

#define	constTMManDC_LOCK_CTL_HEN	0x0	/* HOLE ENABLE */
#define	constTMManDC_LOCK_CTL_HDS	0x1	/* HOLE DISABLE */
#define	constTMManDC_LOCK_CTL_PDS	0x2 /* PCI DSIABLE */
#define	constTMManDC_LOCK_CTL_RES	0x3	/* RESERVED */

//#define	constTMManHostTraceBufferSize	2048

typedef struct tagDebugObject
{
    UInt32  DBGLevelBitmap;
    UInt32  DBGType;
	UInt8	DBGBuffer[constTMManStringLength];
	UInt8	TraceBufferData[constTMManHostTraceBufferSize]; /*HARDCODED */
	UInt8*	TraceBuffer;
	UInt32	TracePosition;
	UInt32	TraceLength;
	Bool	TraceWrapped;
}	DebugObject;


typedef struct tagClientDeviceObject
{
	PVOID			Device;
	PUCHAR			SDRAMAddrUser;
	PUCHAR			MMIOAddrUser;
	// this is pagelocked memory accessible to the host and the target
	PUCHAR			MemoryAddrUser; 

	UInt32			SDRAMHandleUser;
	UInt32			MMIOHandleUser;
	// this is pagelocked memory accessible to the host and the target
	UInt32			MemoryHandleUser; 

}	ClientDeviceObject;

typedef struct tagPageLockBufferDescription
{
	PVOID		IORequestPacket;
}	PageLockBufferDescription;

typedef struct tagClientObject
{
    PVOID				Process;
	PVOID				PhysicalMemoryObject;
	ULONG				DeviceCount;
	ClientDeviceObject	Device[1];
}	ClientObject;

typedef struct  tagGlobalObject
{
	ULONG			MaximumDevices;
	ULONG			DeviceCount;
    PVOID			DeviceList[constTMMANMaximumDeviceCount];

	ULONG			MaximumClients;
	ULONG			ClientCount;
    PVOID			ClientList[constTMMANMaximumClientCount];


	DebugObject		Debug;

    ULONG			BitFlags;

    ULONG			RegistryHandle;

	ULONG			XlatedAddress;

	/* settings read from the registry */
	ULONG			TargetTraceBufferSize;
	ULONG			TargetTraceLeveBitmap;
	ULONG			TargetTraceType;
	ULONG			MemorySize;
	ULONG			MailboxCount;
	ULONG			ChannelCount;
	ULONG			VIntrCount;
	ULONG			MessageCount;
	ULONG			EventCount;
	ULONG			StreamCount;
	ULONG			NameSpaceCount;
	ULONG			MemoryCount;
	ULONG			SGBufferCount;
	ULONG			SpeculativeLoadFix;
	ULONG			PCIInterruptNumber;
	ULONG			MMIOInterruptNumber;
	ULONG			MapSDRAM;

}   GlobalObject;

typedef struct taghalParameters
{
    ULONG				TMDeviceVendorID;
	ULONG				TMSubsystemID;
	ULONG				TMClassRevisionID;

    ULONG				BridgeDeviceVendorID;
    ULONG				BridgeSubsystemID;
	ULONG				BridgeClassRevisionID;

    ULONG				BusNumber;
    ULONG				DeviceNumber;
	ULONG				FunctionNumber;
	ULONG				DevNode;

	ULONG				DSPNumber;

    ULONG				PCIIrq;
    ULONG				TMIrq;

    ULONG		        InterruptVector;

    PHYSICAL_ADDRESS    MMIOAddrPhysical;
    ULONG               MMIOLength;

    PHYSICAL_ADDRESS    SDRAMAddrPhysical;
    ULONG               SDRAMLength;


	Pointer				SharedData;

	ULONG				SpeculativeLoadFix;

	ULONG				SystemBaseAddress;
	ULONG				MMIOBaseAddress;
	ULONG				SDRAMBaseAddress;

	ULONG				PCIRegisters[constTMMANPCIRegisters];


}	halParameters;

typedef struct tagTMManDeviceObject
{
	/* generic part */
	// user set Flags - for storing device specific information
	UInt32	Flags;

	// handle to the CRT Object
	// just stored here by tmman32 for later retrieval
	// not interpreted in kernel mode.
	UInt32	CRunTimeHandle;

	// current state of the DSP
	// LOADED, RESET, RUNNING, DEAD, DEFUNCT
	UInt32	Status; 

	UInt32	DSPNumber;
	DEVNODE	DevNode;

	// why is this here
	UInt8*	SharedMapped;

	TMManSharedStruct*		SharedData;

	// handle to all the component objects
	UInt32	HalHandle;
	UInt32	ChannelManagerHandle;
	UInt32	VIntrManagerHandle;
	UInt32	EventManagerHandle;
	UInt32	MessageManagerHandle;
	UInt32	MemoryManagerHandle;
	UInt32	SGBufferManagerHandle;
	UInt32	NameSpaceManagerHandle;

	Pointer	HalSharedData;
	Pointer	MemorySharedData;
	Pointer	NameSpaceSharedData;
	UInt32	ChannelSharedData;
	UInt32	VIntrSharedData;
	UInt32	EventSharedData;
	
	UInt32	SGBufferSharedData;

	UInt32	SharedDataHandle;

	

	Pointer	MemoryBlock;
	UInt32	MemoryBlockSize;

	// physical addresses needed by the loader for relocation
	PHYSICAL_ADDRESS	HalSharedAddress;
	PHYSICAL_ADDRESS	EventSharedAddress;
	PHYSICAL_ADDRESS	ChannelSharedAddress;
	PHYSICAL_ADDRESS	VIntrSharedAddress;
	PHYSICAL_ADDRESS	DebugSharedAddress;
	PHYSICAL_ADDRESS	MemorySharedAddress;
	PHYSICAL_ADDRESS	MemoryBlockAddress;
	PHYSICAL_ADDRESS	NameSpaceSharedAddress;
	PHYSICAL_ADDRESS	SGBufferSharedAddress;
	PHYSICAL_ADDRESS	TMManSharedAddress;

	// hardware initialization parameters
	//halParameters	HalParameters;

    DWORD RegistryHandle;

}	TMManDeviceObject;

extern GlobalObject *TMManGlobal;



Pointer	sectionMapPhysicalAddress ( 
	UInt32 Address, 
	UInt32 Length,
	UInt32 *SectionHandlePointer );

void	sectionUnmapPhysicalAddress ( 
	Pointer UserModeVirtualAddress, 
	UInt32 SectionHandle );

#define		InterlockedIncrement(Addend)	((*(Addend) = *(Addend) + 1 ))

#define 	InterlockedDecrement(Addend)	((*(Addend) = *(Addend) - 1 ))

BOOLEAN	halMapSDRAM ( UInt32 HalHandle );
BOOLEAN	halUnmapSDRAM ( UInt32 HalHandle );

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -