📄 ssf.h
字号:
/** * \file * SSF (Security Support Functions) internal definitions. * * \version $Revision$ $State$ * * \date $Date$ * * \author $Author$ * * \par Last changed by: * $Author$ * *****************************************************************************//* * Copyright 2002 ADVANCED MICRO DEVICES, INC. All Rights Reserved. * * This software and any related documentation (the "Materials") are the * confidential proprietary information of AMD. Unless otherwise provided * in an agreement specifically licensing the Materials, the Materials are * provided in confidence and may not to be used, distributed, modified, or * reproduced in whole or in part by any means. * * LIMITATION OF LIABILITY: THE MATERIALS ARE PROVIDED "AS IS" WITHOUT ANY * EXPRESS OR IMPLIED WARRANTY OF ANY KIND, INCLUDING BUT NOT LIMITED TO * WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, TITLE, FITNESS FOR ANY * PARTICULAR PURPOSE, OR WARRANTIES ARISING FORM CONDUCT, COURSE OF * DEALING, OR USAGE OF TRADE. IN NO EVENT SHALL AMD OR ITS LICENSORS BE * LIABLE FOR ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, * DAMAGES FOR LOSS OF PROFITS, BUSINESS INTERRUPTION, OR LOSS OF * INFORMATION) ARISING OUT OF THE USE OF OR INABILITY TO USE THE * MATERIALS, EVEN IF AMD HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH * DAMAGES. BECAUSE SOME JURISDICTIONS PROHIBIT THE EXCLUSION OR * LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES, THE * ABOVE LIMITATION MAY NOT APPLY TO YOU. * * AMD does not assume any responsibility for any errors which may appear * in the Materials nor any responsibility to support or update the * Materials. AMD retains the right to modify the Materials at any time, * without notice, and is not obligated to provide such modified Materials * to you. * * NO SUPPORT OBLIGATION: AMD is not obligated to furnish, support, or make * any further information, software, technical information, know-how, or * show-how available to you. * *****************************************************************************/#ifndef SFS_H#define SFS_H#include "sec.h"#include "ssfif.h"/****************************************************************************** Constants*****************************************************************************//* we need the internal memory managment - KiOsMem functions * run out of ressources */#define USE_SEC_MEMORY_MGMT (1)#define SEC_MEM_SIZE (1024*8)#define SEC_MEM_ENTRIES (48)#define SEC_MEM_MAGIC (0x3E303630)#define IS_SSF_INIT() (ssfContext.magic == SSF_MAGIC)/****************************************************************************** Types*****************************************************************************/typedef struct sec_memory_memdesc_tag { void *pData; Int16 Len; Int16 Used; /* Int32 Len; Boolean Used; */} sec_memory_memdesc_t;typedef struct sec_memory_pool_tag { Int32 magic; sec_memory_memdesc_t MemDesc[SEC_MEM_ENTRIES]; Int8 MemData[SEC_MEM_SIZE]; SignedInt32 TotalUsedSize;} sec_memory_pool_t;typedef struct SsfContext_tag { Int32 magic; sec_memory_pool_t *pMemPool;#ifdef HSS_ENA_NVRAM Int8 *pSnvBuffer; Int32 snvBufferSize;#endif /*HSS_ENA_NVRAM */ Int8 *pSpsBuffer; Int32 spsBufferSize;} SsfContext_t;/****************************************************************************** Macros*****************************************************************************//****************************************************************************** Classes*****************************************************************************//****************************************************************************** Data*****************************************************************************/#ifdef __cplusplusextern "C" {#endif#ifdef __cplusplus} /* extern "C" */#endif/****************************************************************************** Functions*****************************************************************************/#ifdef __cplusplusextern "C" {#endif SsfSuccess_t SsfUtilMemoryInit(Int8 * pBuffer, Int32 Size); void SsfUtilGetMemoryStatus(SignedInt32 * pUsedSize, SignedInt32 * pPoolEnd, SignedInt32 * pHandleEnd); void SsfUtilGetMemoryStatus(SignedInt32 * pUsedSize, SignedInt32 * pPoolEnd, SignedInt32 * pHandleEnd); void *SsfUtilMemoryMalloc(size_t size); void *SsfUtilMemoryRealloc(void *ptr, size_t sizenew); void SsfUtilMemoryFree(void *ptr); sec_memory_memdesc_t *SsfUtilMemoryGetFreeEntry(size_t size); size_t SsfUtilMemoryGetMemSize(void *ptr);#ifdef __cplusplus} /* extern "C" */#endif/****************************************************************************** Inline Functions*****************************************************************************/#endif /* #ifndef SFS_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -