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

📄 systemserviceslocal.h

📁 摩托罗拉Motolola公司网络处理器C3的示范代码.实现了ATM的AAL2层交换功能.想了解网络处理器的可以
💻 H
字号:
/* *  systemServicesLocal.h * *  This file contains the PDU services macros written for AAL2 application *  and need to be moved to the system services directory in future. *//* *  Copyright (c) 2000, 2001, 2002 C-Port Corporation, a Motorola Company  *  All Rights Reserved * *  The information contained in this file is C-Port Corporation confidential and proprietary. *  Any reproduction, use or disclosure, in whole or in part, of this *  program, including any attempt to obtain a human-readable version of this *  program, without the express, prior written consent of C-Port *  Corporation or Motorola Incorporated is strictly prohibited. */#ifndef SYSTEM_SERVICES_LOCAL#define SYSTEM_SERVICES_LOCAL#define IS_EXTRACT_SPACE_BUSY()        (pduHandle->rxStatus.rxStatus_Flags >= 0)#define IS_MERGE_SPACE_BUSY()          (pduHandle->txStatus.txStatus_Flags >= 0)/********************************************************************* *  Function      : pduFromDmemToTxSDP  * *  Description   : This function DMAs *                  Length number of bytes starting from the *                  byte address as specified in the offset *                  parameter and the Line *                  Address. The offset need not *                  start a non 16 byte *                  aligned boundary. * *  Parameters    : LineAddress  IN Line Address *                  offset       IN Byte Address *                  Length       IN Length in Bytes  *  Returns        : none * *  Traceability  : TRACEABILITY  * ********************************************************************/#define pduFromDmemToTxSDP(pduHandle, LineAddress, Length) \{ \   int32u addr = (int32u)LineAddress ;\\   /* Wait for the TxCB to be available */ \    KS_RTWAIT(pduHandle->txCB.txCB_Ctl); \   /* \    * Initialize the Btag, PoolId and offset of TxCB \    * to zeros. \    pduHandle->txCB.txCB_Btag = 0; \    pduHandle->txCB.txCB_Pool = 0; \    */ \    pduHandle->txCB.txCB_Offset = 0; \   /* \    * Initialize the DMA to point to \    * LineAddress, which is 64 byte aligned. \    */ \    pduHandle->txCB.txCB_DMA = BS_ADDR(addr); \    pduHandle->txCB.txCB_SDP = BS_ADDR(addr); \   /* \    * Initialize the TxCB_CTL to clear eop,  \    * SET own<1> and own<0> and the length field \    */ \    pduHandle->txCB.txCB_Ctl = Length | BIT(RxCB_AVAIL) | BIT(TxCB_OWN1) | BIT(TxCB_OWN0);  \}/***************************************************************** *  Function      : pduFromRxSDPToDmem * *  Description   : This function is used for copying payload  *                  from RxSDP to DMEM. * *  Parameters    : Pdu Handle, *                  DMEM location to write data to. * *  Returns       : None. * *  Traceability  : None. * *****************************************************************/# define pduFromRxSDPToDmem(pduHandle, dMemAddr) \{ \    int32u dmaAddr = (int32u) dMemAddr; \ \    /* Confirm that rxCB is available */ \    KS_RTWAIT(pduHandle->rxCB.rxCB_Ctl.word); \ \    /* Set offset to desired offset in MC Buffer \     * set DMA line address to start of buffer in DMEM \     */ \    pduHandle->rxCB.rxCB_Offset = 0; \    pduHandle->rxCB.rxCB_DMA    = dmaAddr; \    pduHandle->rxCB.rxCB_SDP    = BS_ADDR(dmaAddr); \ \    /* Only set RC related fields, not SDP related fields of rxCB_Ctl \     * Note that the SDP and DMA addresses need not be reset if the \     * next frame is to be received aligned - the hardware will automatically \     * align these two addresses to the 128 byte boundary that they \     * were initialized to. \     */ \    pduHandle->rxCB.rxCB_Ctl.word = BIT(RxCB_AVAIL); \                                                     /* Length=0 \                                                      * Avail=1 (No DRAM DMA) \                                                      * DBE=0 (single buffer) \                                                      * Own0=0 (SDP owns) \                                                      */ \} #endif

⌨️ 快捷键说明

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