SCMGR.H
上传用户:super_houu
上传日期:2008-09-21
资源大小:4099k
文件大小:4k
- /****************************************************************************************
- * Copyright (c) 2002 ZORAN Corporation, All Rights Reserved
- * THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF ZORAN CORPORATION
- *
- * File: $Workfile: SCMGR.H $
- *
- * Description:
- * ============
- *
- *
- * Log:
- * ====
- * $Revision: 4 $
- * Last Modified by $Author: Leonh $ at $Modtime: 11/19/03 12:58p $
- ****************************************************************************************
- * Updates:
- ****************************************************************************************
- * $Log: /I76/I76_Common/I76_Reference/Playcore/ScPad/SCMGR.H $
- *
- * 4 11/20/03 1:54p Leonh
- * remove the useless code
- *
- * 3 10/23/03 11:41a Leslie
- * add the function for read raw data
- *
- * 2 03-07-09 10:23 Leonh
- * cache enable
- *
- * 8 23/05/02 14:09 Ettim
- * Adding support for an absolute 32 bit address on the scratch pad.
- *
- * 7 23/04/02 9:36 Nirm
- * - Added dependency in "Config.h".
- *
- * 6 4/03/02 18:11 Nirm
- * Move static allocations to ScPadAlloc.h.
- *
- * 5 3/03/02 15:01 Nirm
- * - Code cleanup;
- * - Enhanced efficiency.
- *
- * 4 9/01/02 9:26 Nirm
- * Corrected Include-Paths.
- *
- * 3 9/01/02 9:26 Nirm
- * Corrected Include-Paths.
- *
- * 2 25/12/01 18:09 Atai
- * Ambigious pointer resolved by parenthesis
- ****************************************************************************************/
- #include "Config.h" // Global Configuration - do not remove!
- #ifndef __SCMGR_H_
- #define __SCMGR_H_
- #include "IncludeSysDefs.h"
- #include "PlaycoreScPadScPadAlloc.h"
- /////////////////////////////////////////////////////////////////////////////
- // Structures and Types
- typedef union ScContainer_TAG {
- DWORD dwDWORD;
- WORD wWORD[2];
- BYTE ucBYTE[4];
- } Sc_cont;
- /////////////////////////////////////////////////////////////////////////////
- // Constants and Macros
- #define BYTE_PER_CONTAINER sizeof(Sc_cont)
- #define CONTAINER_NORM(n) ((n) >> 2) // Divide by BYTE_PER_CONTAINER
- #define CONTAINER_MOD(n) ((n) & 0x03)
- #define CONTAINER_COUNT(n) ((n + (BYTE_PER_CONTAINER-1)) / BYTE_PER_CONTAINER)
- #define NULL_HANDLE 0xFFFF
- /////////////////////////////////////////////////////////////////////////////
- // Scratch-Pad Interface
- BOOL sc_Init(WORD i_InitVal);
- UINT16 sc_Read(WORD i_hAddress, WORD i_uContainersCnt, Sc_cont *o_pDestBuff);
- UINT16 sc_Read32(UINT32 i_hAddress, WORD i_uContainersCnt, Sc_cont *o_pDestBuff);
- UINT16 sc_Write(WORD i_hAddress, WORD i_uContainersCnt, const Sc_cont *i_pSourceBuff);
- UINT16 sc_Write32(UINT32 i_hAddress, WORD i_uContainersCnt, const Sc_cont *i_pSourceBuff);
- WORD sc_Malloc(UINT16 i_uContainersCnt);
- BOOL sc_Free(WORD i_hAddress, UINT16 i_uContainersCnt);
- BOOL sc_CopyFromDisc(DWORD i_dwStartLBN, DWORD i_dwOffset, WORD i_uBytesCnt,
- WORD i_hDestinationAddress);
- BOOL sc_CopyFromDisc32(DWORD i_dwStartLBN, DWORD i_dwOffset, WORD i_uBytesCnt,
- DWORD i_hDestinationAddress);
- void sc_GetBytes(WORD i_hSourceAddress, WORD i_cbOffset, WORD i_cbSize, BYTE *o_pDestBuff);
- void sc_GetBytes32(UINT32 i_hSourceAddress, WORD i_cbOffset, WORD i_cbSize, BYTE *o_pDestBuff);
- void sc_SetBytes(WORD i_hDestinationAddress, WORD i_cbOffset, WORD i_cbSize, const BYTE *i_pSrcBuff);
- void sc_SetBytes32(UINT32 i_hDestinationAddress, WORD i_cbOffset, WORD i_cbSize, const BYTE *i_pSrcBuff);
- #ifdef _DEBUG
- void sc_PrintStatus(void);
- #endif //_DEBUG
- #endif // __SCMGR_H_