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

📄 sscr_getbuf.c

📁 使用CCS信息DSP编程,适用于6713B的启动程序。
💻 C
字号:
/*
 *  Copyright 2003 by Texas Instruments Incorporated.
 *  All rights reserved. Property of Texas Instruments Incorporated.
 *  Restricted rights to use, duplicate or disclose this code are
 *  granted through contract.
 *  
 */
/* "@(#) ReferenceFrameworks 2.20.00.08 07-18-03 (swat-f02)" */
/*
 *  ======== sscr_getbuf.c ========
 *  SSCR's file for getting the size and address of the scratch buffers.
 */

#pragma CODE_SECTION(SSCR_getBuf, ".text:sscr_getBuf")

#include <std.h>

#include <hwi.h>

#include <sscr.h>
#include <utl.h>


/*
 *  ======== SSCR_getBuf ========
 *  This function returns the pointer to and the size of the scratch buffer 
 *  for the specified bucket. It does not allocate memory.
 */
Ptr SSCR_getBuf(Uns scrBucketIndex, Uns *scrSize)
{   
    Uns intrState;            // Used to disable interrupts
    Ptr tmpBuffer;
    
    /* Make sure valid parameters */
    UTL_assert(scrSize != NULL);
    UTL_assert(scrBucketIndex < _SSCR_bucketCnt);    
    
    /* 
     *  Temporarily disable interrupts. This is to prevent a very unlikely race
     *  condition, in which multiple SSCR_deleteBuf()'s, SSCR_createBuf()'s or
     *  SSCR_getBuf()'s are called.
     */
    intrState = HWI_disable();

    *scrSize  = _SSCR_bucketList[scrBucketIndex].size;
    tmpBuffer = _SSCR_bucketList[scrBucketIndex].buffer;

    /* Restore interrupt state */
    HWI_restore( intrState );

    return (tmpBuffer);
}


⌨️ 快捷键说明

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