?? tmmanlib.h
字號:
/*
(c) Philips Semiconductors - TriMedia Product Group 1997
TriMedia Manager Interprocessor Communicaiton Library Interface
FILE TMManLib.h
Author : T.Roy (Tilakraj.Roychoudhury@sv.sc.philips.com)
*/
#ifndef _TMMANLIB_H_
#define _TMMANLIB_H_
#include "tmtypes.h"
#include "tmmanerr.h"
/*
TYPES
*/
/*
Every Object Object has an associated FOURCC ID
Primarily used for debugging
*/
#ifndef tmmanOBJECTID
#define tmmanOBJECTID( ch0, ch1, ch2, ch3 ) ( (UInt32)(UInt8)(ch0) | ( (UInt32)(UInt8)(ch1) << 8 ) | ( (UInt32)(UInt8)(ch2) << 16 ) | ( (UInt32)(UInt8)(ch3) << 24 ) )
#endif
#define constTMMANHostToTargetIRQ 28 /* IRQ 28 */
#define constTMMANTargetToHostIRQ 0 /* PCI INT#A */
#define constDebugMagic "XXXXXXX:cjp:da:fd:gfp:lcf:rj:troy:wcs:yc:zcw\0"
#define constDebugTMManMagic "XXXXXXXX.Roychoudhury@sv.sc.philips.com\0"
#define constDebugMagicSize 0x40 /* maximum 64 characterrs */
#define constTMManDebugTypeNULL 0
#define constTMManDebugTypeTrace 1
#define constTMManDebugTypeOutput 2
#define constTMManDebugTypeCOM 3
#define constTMManDebugTypeLPT 4
#define constTMManTargetTraceBufferSize 0x1000
#define constTMManTargetTraceLeveBitmap 0x00000001
#define constTMManTargetTraceType constTMManDebugTypeNULL
#define constTMManHostTraceBufferSize 0x1000
#define constTMManHostTraceLeveBitmap 0x00000001
#define constTMManHostTraceType constTMManDebugTypeNULL
#define constTMManNameSpaceObjectInvalid 0
#define constTMManNameSpaceObjectVIntr 1
#define constTMManNameSpaceObjectChannel 2
#define constTMManNameSpaceObjectEvent 3
#define constTMManNameSpaceObjectMemory 4
#define constTMManNameSpaceObjectSGBuffer 5
#define constTMManNameSpaceObjectDebug 6
#define constTMManNameSpaceObjectMessage 7
#define constTMMANOEMIoctlBase (0x8000)
#define constTMMANPageLockedMemoryBase (0x80080000)
#define constTMMANPageLockedMemorySize (0x18000)
#define constTMMANTM1000VendorID 0x1131
#define constTMMANTM1000DeviceID 0x5400
#define constTMMANTM2000VendorID 0x1131
#define constTMMANTM2000DeviceID 0x5401
#define constTMMANTM1300VendorID 0x1131
#define constTMMANTM1300DeviceID 0x5402
#define constTMMANDECBridgeVendorID 0x1011
#define constTMMANDECBridgeDeviceID 0x0046
#define constTMMANSystemBaseAddress (0x10000000)
#define constTMMANSDRAMBaseAddress (0x01000000)
#define constTMMANMMIOBaseAddress (0xef000000)
/*
DATA STRUCTURES
*/
typedef struct tagTMManSharedStruct
{
volatile UInt32 HostKernelMajorVersion;
volatile UInt32 HostKernelMinorVersion;
volatile UInt32 TargetKernelMajorVersion;
volatile UInt32 TargetKernelMinorVersion;
volatile UInt32 ChannelShared;
volatile UInt32 VIntrShared;
volatile UInt32 EventShared;
volatile UInt32 DebugShared;
volatile UInt32 MemoryShared;
volatile UInt32 MemoryBlock;
volatile UInt32 NameSpaceShared;
volatile UInt32 SGBufferShared;
volatile UInt32 HalShared;
volatile UInt32 Reserved1;
volatile UInt32 Reserved2;
volatile UInt32 TargetTraceBufferSize;
volatile UInt32 TargetTraceLeveBitmap;
volatile UInt32 TargetTraceType;
volatile UInt32 DebuggingHi;
volatile UInt32 DebuggingLo;
volatile UInt32 TMManMailboxCount;
volatile UInt32 TMManChannelCount;
volatile UInt32 TMManVIntrCount;
volatile UInt32 TMManMessageCount;
volatile UInt32 TMManEventCount;
volatile UInt32 TMManStreamCount;
volatile UInt32 TMManNameSpaceCount;
volatile UInt32 TMManMemoryCount;
volatile UInt32 TMManMemorySize;
volatile UInt32 TMManSGBufferCount;
volatile UInt32 SpeculativeLoadFix;
volatile UInt32 PCIInterruptNumber;
volatile UInt32 MMIOInterruptNumber;
volatile UInt32 TMDeviceVendorID;
volatile UInt32 TMSubsystemID;
volatile UInt32 TMClassRevisionID;
volatile UInt32 BridgeDeviceVendorID;
volatile UInt32 BridgeSubsystemID;
volatile UInt32 BridgeClassRevisionID;
volatile UInt32 Reserved[16];
} TMManSharedStruct;
typedef struct tagGenericObject
{
UInt32 FourCCID;
Pointer SelfRef;
} GenericObject;
typedef struct tagObjectList
{
UInt32 Count;
UInt32 FreeCount;
Pointer *Objects;
} ObjectList;
typedef struct tagchannelManagerParameters
{
UInt32 ChannelCount;
UInt32 MailboxCount;
UInt32 PacketSize;
Pointer SharedData;
UInt32 HalHandle;
UInt32 VIntrManagerHandle;
UInt32 NameSpaceManagerHandle;
} channelManagerParameters;
typedef void ( * ChannelHandler )(
UInt32 ChannelHandle,
Pointer Packet,
Pointer Context );
UInt32 channelSharedDataSize (
UInt32 MailboxCount,
UInt32 PacketSize );
TMStatus channelManagerCreate (
channelManagerParameters* Parameters,
UInt32* ChannelManagerPointer );
TMStatus channelCreate(
UInt32 ChannelManagerHandle,
Int8* Name,
Pointer Handler,
Pointer Context,
UInt32* ChannelHandlePointer );
TMStatus channelSend(
UInt32 ChannelHandle,
Pointer Packet );
TMStatus channelDestroy (
UInt32 ChannelHandle);
TMStatus channelManagerReset (
UInt32 ChannelManagerHandle );
TMStatus channelManagerDestroy (
UInt32 ChannelManagerHandle );
/*
INTERRUPT MODULE
*/
typedef struct tagvintrManagerParameters
{
UInt32 HalHandle;
UInt32 VIntrCount;
Pointer SharedData;
} vintrManagerParameters;
typedef void ( * VInterruptHandler )(
Pointer Context );
UInt32 vintrSharedDataSize (
UInt32 InterruptCount );
TMStatus vintrManagerCreate (
vintrManagerParameters* Parameters,
UInt32* VIntrManagerHandle );
TMStatus vintrManagerDestroy (
UInt32 vintrManagerHandle );
TMStatus vintrCreate (
UInt32 VIntrManagerHandle,
UInt32 VIntrNumber,
VInterruptHandler Handler,
Pointer Context,
UInt32 *VIntrHandlePointer);
TMStatus vintrDestroy (
UInt32 VIntrHandle );
TMStatus vintrGenerateInterrupt (
UInt32 VIntrHandle );
TMStatus vintrManagerReset (
UInt32 VIntrHandle );
/*
HAL FUNCTIONS
*/
typedef struct tagHalControl
{
UInt32 HostInterruptSpinLock;
UInt32 TargetInterruptSpinLock;
UInt32 H2TIntReq;
UInt32 T2TIntReq;
UInt32 H2TIntAck;
UInt32 T2HIntAck;
UInt32 HostPeakTime;
UInt32 TargetPeakTime;
UInt32 HostReserved1;
UInt32 TargetReserved1;
UInt32 HostReserved2;
UInt32 TargetReserved2;
} HalControl;
typedef void ( * HalInterruptHandler )(
Pointer Context );
TMStatus halCreate (
Pointer Paramters,
UInt32* HalHandlePointer );
TMStatus halDestroy (
UInt32 HalHandle );
TMStatus halGetMMIOInfo (
UInt32 HalHandle,
Pointer *MMIOPhysical,
Pointer *MMIOKernelMapped,
UInt32 *MMIOSize );
TMStatus halGetSDRAMInfo (
UInt32 HalHandle,
Pointer *SDRAMPhysical,
Pointer *SDRAMKernelMapped,
UInt32 *SDRAMSize );
TMStatus halGetTMPCIInfo (
UInt32 HalHandle,
UInt32* DeviceVendorID,
UInt32* SubsystemID,
UInt32* ClassRevisionID );
TMStatus halGetBridgePCIInfo (
UInt32 HalHandle,
UInt32* DeviceVendorID,
UInt32* SubsystemID,
UInt32* ClassRevisionID );
TMStatus halInstallHandler (
UInt32 HalHandle,
HalInterruptHandler Handler,
Pointer Context );
TMStatus halRemoveHandler (
UInt32 HalHandle );
TMStatus halDisableIRQ (
UInt32 HalHandle );
TMStatus halEnableIRQ (
UInt32 HalHandle );
TMStatus halGenerateInterrupt (
UInt32 HalHandle );
TMStatus halAcknowledgeInterrupt (
UInt32 HalHandle );
TMStatus halStartDSP (
UInt32 HalHandle );
TMStatus halStopDSP (
UInt32 HalHandle );
TMStatus halResetDSP (
UInt32 HalHandle );
TMStatus halSwapEndianess (
UInt32 HalHandle,
Bool SwapEnable );
TMStatus halGetEndianess (
UInt32 HalHandle,
Bool* SwapEnablePtr );
TMStatus halReset (
UInt32 HalHandle );
TMStatus halSetPeerVersion (
UInt32 HalHandle,
UInt32 MajorVersion,
UInt32 MinorVersion );
TMStatus halGetPeerVersion (
UInt32 HalHandle,
UInt32* MajorVersion,
UInt32* MinorVersion );
void halCopyback(
Pointer CacheBlock,
UInt32 BlockCount );
/* Endianess Swapping Functions */
UInt32 halAccess32(
UInt32 HalHandle,
UInt32 volatile Value );
UInt16 halAccess16 (
UInt32 HalHandle,
UInt16 volatile Value );
void halAccessEnable (
UInt32 HalHandle );
void halAccessDisable (
UInt32 HalHandle );
UInt32 halTranslateTargetPhysicalAddress (
UInt32 HalHandle,
UInt32 PhysicalAddress );
/*
MESSAGE FUNCTIONS
*/
typedef struct tagmessageManagerParameters
{
UInt32 MessageCount;
UInt32 PacketSize;
UInt32 HalHandle;
UInt32 ChannelManagerHandle;
UInt32 NameSpaceManagerHandle;
} messageManagerParameters;
TMStatus messageManagerCreate (
messageManagerParameters* Parameters,
UInt32* MessageManagerHandlePointer );
TMStatus messageManagerReset (
UInt32 MessageManagerHandle );
TMStatus messageManagerDestroy (
UInt32 MessageManagerHandle );
TMStatus messageManagerDestroyMessageByClient (
UInt32 MessageManagerHandle,
UInt32 ClientHandle );
TMStatus messageCreate (
UInt32 MessageManagerHandle,
Pointer ListHead,
Int8* Name,
UInt32 SynchronizationHandle,
UInt32 SynchronizationFlags,
UInt32* MessageHandlePointer );
TMStatus messageSend(
UInt32 MessageHandle,
Pointer Data );
TMStatus messageReceive (
UInt32 MessageHandle,
Pointer Data );
TMStatus messageBlock (
UInt32 MessageHandle );
TMStatus messageDestroy (
UInt32 MessageHandle );
/*
EVENT FUNCTIONS
*/
typedef struct tageventManagerParameters
{
UInt32 EventCount;
UInt32 VIntrManagerHandle;
UInt32 HalHandle;
Pointer SharedData;
UInt32 NameSpaceManagerHandle;
} eventManagerParameters;
UInt32 eventSharedDataSize (
UInt32 EventCount );
TMStatus eventManagerCreate (
eventManagerParameters* Parameters,
UInt32* EventManagerHandlePointer );
TMStatus eventCreate (
UInt32 EventManagerHandle,
Pointer ListHead,
Int8* Name,
UInt32 SynchronizationHandle,
UInt32 SynchronizationFlags,
UInt32* EventHandlePointer );
TMStatus eventSignal (
UInt32 EventHandle );
TMStatus eventDestroy (
UInt32 EventHandle );
TMStatus eventManagerReset (
UInt32 EventManagerHandle );
TMStatus eventManagerDestroy (
UInt32 EventManagerHandle );
TMStatus eventManagerDestroyEventByClient (
UInt32 EventManagerHandle,
UInt32 ClientHandle );
/*
MEMORY FUNCTIONS
*/
typedef struct tagmemoryManagerParameters
{
UInt32 MemoryCount;
UInt32 MemorySize;
Pointer MemoryBlock;
Pointer SharedData;
UInt32 HalHandle;
UInt32 NameSpaceManagerHandle;
} memoryManagerParameters;
UInt32 memorySharedDataSize (
UInt32 MemoryCount );
TMStatus memoryManagerReset (
UInt32 MemoryManagerHandle );
TMStatus memoryManagerCreate (
memoryManagerParameters* Parameters,
UInt32* MemoryManagerHandlePointer );
TMStatus memoryManagerDestroy (
UInt32 MemoryManagerHandle );
TMStatus memoryManagerDestroyMemoryByClient (
UInt32 MemoryManagerHandle,
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -