亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? aal5_sar.c

?? MPC860SAR源代碼
?? C
?? 第 1 頁 / 共 4 頁
字號:
*  Frames_to_xmit = pattern. 
*
* PARAMETERS: none
*
*  RETURNS: none
*
*-----------------------------------------------------------------------------*/

void  InitBuffers()

{

   UWORD i; 

   UBYTE *ptr_rcv, *ptr_xmit;

   /*-----------------------------------------------------*/
   /* Initialize the Receive and Transmit Buffer pointers */
   /*-----------------------------------------------------*/

   Received_frames = (UBYTE *)RX_BUFF_ADDR;
   Frames_to_xmit = (UBYTE *)TX_BUFF_ADDR; 
   Raw_cells = (UBYTE *)RAW_CELL_RX_BUFF_ADDR;

   ptr_rcv = (UBYTE *)Received_frames;
   ptr_xmit = (UBYTE *)Frames_to_xmit;

   /*******************************************/
   /* Initialize the Receive Buffers with     */ 
   /* zero (clear the buffers).               */ 
   /*******************************************/

   memset(ptr_rcv, 0, FRAME_LENGTH*NUM_FRAMES);

   /*******************************************/
   /* Initialize the Transmit Buffers with    */ 
   /* the transmit pattern.                   */ 
   /*******************************************/

   for(i = 0; i < NUM_FRAMES; i++)
      {
        memset(ptr_xmit, i+1, FRAME_LENGTH);
        ptr_xmit += FRAME_LENGTH;
      }

   /*******************************************/
   /* Initialize the raw cell Receive buffers */ 
   /*******************************************/

   ptr_rcv = (UBYTE *)Raw_cells;
   memset(ptr_rcv, 0, NUM_RAW_CELL_BUFFS*RAW_CELL_BUFF_SIZE);

} /* end of InitBuffers */



/*-----------------------------------------------------------------------------
*
* FUNCTION NAME:  SCC_init
*                  
*
* DESCRIPTION:
*
*  SCCx AAL5 ATM Initialization Routine.
*                 
* EXTERNAL EFFECT:
*
*  Parameter RAM and various registers on the 860 including interrupt related
*  registers and port registers. This function, when complete,
*
* PARAMETERS: None
*
* RETURNS: None 
*
*----------------------------------------------------------------------------*/

void SCC_init()

{
   UHWORD mask1;
   UWORD mask2;
   UWORD i = 0; 
       
   /*---------------------------------------------*/
   /* Configure Port A to enable TXDx & RXDx (i.e.*/
   /* transmit and receive data pins for SCCx.    */
   /*---------------------------------------------*/

   /* Enable RX & TX pins in PORT A */
   mask1 = 0x3; 
   IMMR->pio_padir &=  ~(mask1 << (2*SCC_num)); 
   IMMR->pio_papar |=  (mask1 << (2*SCC_num));

   /*---------------------------------------------*/
   /* Enable ATM functionality and RX & TX pins   */
   /* via PORT D.                                 */
   /*---------------------------------------------*/
   IMMR->pio_pdpar |=  0x8000;

   /*---------------------------------------------*/
   /* Make sure Port C is initialized to 0        */
   /*---------------------------------------------*/

   IMMR->pio_pcdir =  0;
   IMMR->pio_pcpar =  0;
   IMMR->pio_pcso  =  0;
   IMMR->pio_pcint  =  0;
 
   /*----------------------------------------------------------*/
   /* Enable Baud rate generator and the BRG Clock Prescaler   */
   /* Divide by 16 option.  At 24 Mhz, which is the assumed    */ 
   /* ADS operating frequency, the baud rate is 24 Mhz/16, or  */
   /* 1.5 Mbps.                                                */
   /*                                                          */
   /* NOTE:  The baud rate must be greater or equal to the     */
   /* rate at which the APC schedules cells. APC Overrun ex-   */
   /* ceptions will result if the BRG is lower than the APC    */
   /* rate.                                                    */
   /*----------------------------------------------------------*/

   IMMR->brgc4 = 0x00010001;    

   /*---------------------------------------------------------*/
   /* Initialize the SI Clock Route Register (SICR).          */
   /*                                                         */
   /* - Configure BRG4 as SCCx's transmit and receive clock   */
   /*   source. 					      */
   /*---------------------------------------------------------*/

   mask2 = 0xFF; 
   IMMR->si_sicr &= ~(mask2 << (8*SCC_num)); 

   mask2 = 0x1B; 
   IMMR->si_sicr |= (mask2 << (8*SCC_num));

   /********************************************************/
   /* SCCx (ATM Protocol) Parameter RAM Initialization     */
   /********************************************************/

   /*----------------------------------------*/
   /* Set SRFCR,STFCR -- Rx,Tx Function Code */
   /*----------------------------------------*/

   IMMR->PRAM[SCC_num].sar.srfcr = 0x18; /* Normal Operation and Motorola 
                                          byte ordering (i.e. Big Endian) */

   IMMR->PRAM[SCC_num].sar.stfcr = 0x18; /* Motorola byte ordering, Normal
                                          access */

   /*---------------------------------------------*/
   /* Set STSTATE,SRSTATE -- Rx,Tx control/state  */
   /*---------------------------------------------*/

   IMMR->PRAM[SCC_num].sar.ststate = 0x02; /* Configure a max of 32 channels 
                                          and serial mode operation       */

   IMMR->PRAM[SCC_num].sar.srstate = 0x02; /* Configure a max of 32 channels 
                                          and serial mode operation       */


   /*-------------------------------------------------*/
   /* Initialize the MRBLR and SMRBLR.  MRBLR must be */ 
   /* initialized to zero and SMRBLR is initialized   */
   /* to the size of the receive buffer.              */ 
   /*                                                 */
   /* SMRBLR must be a multiple of 48 bytes.          */
   /*-------------------------------------------------*/

   IMMR->PRAM[SCC_num].sar.mrblr = 0;

   IMMR->PRAM[SCC_num].sar.smrblr = ((NUM_FRAMES * FRAME_LENGTH)%48) ? 
                                    ((((NUM_FRAMES * FRAME_LENGTH)/48) +1)
                                     * 48) : NUM_FRAMES * FRAME_LENGTH; 

   /*------------------------------------------------------*/
   /* Initialize the receive and transmit state parameters.*/
   /* The 1st byte must equal that of SRFCR and STFCR res- */
   /* pectively and the remaining 3 bytes must be zero.    */
   /*------------------------------------------------------*/

   IMMR->PRAM[SCC_num].sar.rstate = ((UWORD)
               (IMMR->PRAM[SCC_num].sar.srfcr)) << 24; 

   IMMR->PRAM[SCC_num].sar.tstate = ((UWORD)
               (IMMR->PRAM[SCC_num].sar.stfcr)) << 24; 

   /*------------------------------------------------------*/
   /* Set the Receive and Transmit Buffer Descriptors Base */
   /* address.  Note that the SAR BDs reside in external   */
   /* memory.                                              */
   /*------------------------------------------------------*/

   IMMR->PRAM[SCC_num].sar.tbdbase = TBD_ADDR; 
   IMMR->PRAM[SCC_num].sar.rbdbase = RBD_ADDR;

   /*--------------------------------------------------------------------*/
   /* Configure the start of the receive/transmit connection table. This */
   /* is actually the "offset" from dual port RAM where the connection   */
   /* table begins.                                                      */ 
   /*--------------------------------------------------------------------*/
  
   IMMR->PRAM[SCC_num].sar.ctbase = CT_BASE_OFFSET;
   IMMR->PRAM[SCC_num].sar.t_cnt  = 0; 

   /*-----------------------------------------------------------------*/
   /* Initialize the lookup table parameters.                         */
   /*-----------------------------------------------------------------*/

   /* Initialize cell header mask */ 
   IMMR->PRAM[SCC_num].sar.lookup.hmask = 0x0FFFFFF0;/* Use only VPI/VCI when */
					            /* looking up an entry   */ 

   /* Initalize Address Match table base (offset from DPR) */ 
   IMMR->PRAM[SCC_num].sar.lookup.ambase = AM_BASE_OFFSET; 

   /* Initalize Address Match table end address (offset from DPR) */ 
   IMMR->PRAM[SCC_num].sar.lookup.amend = AM_END_OFFSET; 

   /* Initalize pointer to the channel Address pointer table (this table */
   /* points to the corresponding RCT entry.                             */ 
   IMMR->PRAM[SCC_num].sar.lookup.apbase = AP_BASE_OFFSET; 

   /*----------------------------------------------------------*/
   /* Initialize Transmit Queue pointers                       */
   /*----------------------------------------------------------*/

   /* xmit queue offset from DPR */ 	
   IMMR->PRAM[SCC_num].sar.tqbase = XMIT_Q_BASE_OFFSET;

   /* xmit queue APC pointer must be initialized to the value of tqbase */ 
   IMMR->PRAM[SCC_num].sar.tqaptr = IMMR->PRAM[SCC_num].sar.tqbase;  

   /* xmit queue transmitter pointer must be initialized to tqbase */ 
   IMMR->PRAM[SCC_num].sar.tqtptr = IMMR->PRAM[SCC_num].sar.tqbase;  

   /* end of queue offset (DPR)  */
   IMMR->PRAM[SCC_num].sar.tqend  = XMIT_Q_END_OFFSET;

   /*-----------------------------------------------------*/
   /* Initialize GSMR_H for ATM transmit/receive.  Note   */
   /* that MRBLR must be set to zero for ATM operation.   */
   /*                                                     */
   /* SET: TRX, TTX, CDP, CTSP, CDS, CTSS bits            */
   /*-----------------------------------------------------*/
      
   IMMR->scc_regs[SCC_num].scc_gsmr_h |= 0x00001F80;

   /* Disable cell payload scrambling and HEC coset rules */
   /* in the Protocol Specific Mode Register.             */

   IMMR->scc_regs[SCC_num].scc_psmr = 0x0;

   /*-------------------------------------------------------------------*/
   /* Reset GSMR_L.                                                     */
   /*-------------------------------------------------------------------*/

   IMMR->scc_regs[SCC_num].scc_gsmr_l = 0;  

   /*-----------------------------------------*/
   /* Clear SCCE Register by writing all 1's. */
   /*-----------------------------------------*/

   IMMR->scc_regs[SCC_num].scc_scce = ALL_ONES;


   /*-------------------------------------------------------*/
   /* Enable SCCx Interrupts to the CP Interrupt Controller */ 
   /*-------------------------------------------------------*/

   mask2 = CIMR_SCC1; 
   IMMR->cpmi_cimr = (mask2 >> (1*SCC_num));

   /*-----------------------------------------------*/
   /* Set Appropriate Interrupt Level Bit in SIMASK */
   /*-----------------------------------------------*/

   switch(INTERRUPT_LEVEL) 
   
   {
      case 0: 

         IMMR->siu_simask = SIMASK_LVM0; 
         break;

      case 1: 

         IMMR->siu_simask = SIMASK_LVM1; 
         break;

      case 2: 

         IMMR->siu_simask = SIMASK_LVM2; 
         break;

      case 3: 

         IMMR->siu_simask = SIMASK_LVM3; 
         break;

      case 4: 
   
         IMMR->siu_simask = SIMASK_LVM4; 
         break;

      case 5: 
   
         IMMR->siu_simask = SIMASK_LVM5; 
         break;

      case 6: 

         IMMR->siu_simask = SIMASK_LVM6; 
         break;

      case 7: 
         
         IMMR->siu_simask = SIMASK_LVM7; 
         break;

      default: 
   
         break; /* Bad value */

   } /* end switch */


   /*-----------------------------------------------------------------*/
   /* Write SCCM to Enable Interrupts. All valid interrupts are       */
   /* enabled.                                                        */
   /*-----------------------------------------------------------------*/

   IMMR->scc_regs[SCC_num].scc_sccm = 0x1C3F; 

   /*----------------------------------------------------------------*/
   /* Write CICR to Configure SCCx Interrupt Priority Settings:      */
   /*                                                                */
   /*    SCC Priorities                                              */
   /*    SCC2 - Highest Priority                                     */
   /*    IRL0-IRL2 (Interrupt Request Level) = Constant set by user  */
   /*    HP0-HP4 (Highest Priority) = Original Priority              */
   /*    IEN = Enable CPM Interrupts                                 */
   /*----------------------------------------------------------------*/

   IMMR->cpmi_cicr = 0xE49F80 | (INTERRUPT_LEVEL << 13);

                                          
   /*-----------------------------------------*/
   /* Enable External Interrupts at CPU level */
   /*-----------------------------------------*/

   #ifdef MetaWare

      _ASM(" mtspr  80, 0 ");    /* Enable EE Bit in MSR */

   #else

      #ifdef Diab

         asm(" mtspr  80, 0 ");     /* Enable EE Bit in MSR */

      #endif

   #endif

} /* end SCC_init() */


/*-----------------------------------------------------------------------------
*
* FUNCTION NAME: InterruptInit
*
*
* DESCRIPTION:
*
*     Copy Interrupt Handler code from its current address to the specified 
*     PowerPC Interrupt Vector.
*
* EXTERNAL EFFECTS:
*
* PARAMETERS:  
*
*     interrupt_vector -- address to which interrupt code should be copied
*     interrupt_code   -- current address of interrupt code
*
* RETURNS: NONE
*
*-----------------------------------------------------------------------------*/

void InterruptInit(UWORD *interrupt_vector,
                   UWORD interrupt_code[])

{

   UHWORD index;
   UWORD *instruction;
   UWORD *next_vector;


   next_vector = (interrupt_vector + VECTOR_BLOCK_LEN); /* next vector entry */

   for(instruction = interrupt_vector, index = 0; instruction < next_vector;
       instruction++, index++)
      
      *instruction = interrupt_code[index];

} /* end InterruptInit */


/*-----------------------------------------------------------------------------
*
* FUNCTION NAME: BDRxError
*
* DESCRIPTION:
*
*     Return TRUE if Buffer Descriptor Status bd_cstatus indicates Receive 
*     Error; Return FALSE otherwise note Receive Errors are as follows:
*
*     0x80: HEC Error 
*     0x10: Received Frame was aborted 
*     0x2: Overrun (OV)
*     0x1: CRC Error 
*
* EXTERNAL EFFECTS: None
*
* PARAMETERS:  
*
*     bd_cstatus
*
* RETURNS: TRUE if there was an error and FALSE if there wasn't
*
*-----------------------------------------------------------------------------*/

UHWORD BDRxError(UHWORD bd_cstatus)

{
   
   if (bd_cstatus & BD_RX_ERROR)
      
      return TRUE;

   else

      return FALSE;

} /* end BDRxError */

/*-----------------------------------------------------------------------------
*
* FUNCTION NAME: LastBD
*

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91精品国产91久久久久久最新毛片 | 国产精品色婷婷| 亚洲人吸女人奶水| 蜜臀av在线播放一区二区三区| 波多野结衣91| 精品国产一区二区三区忘忧草 | 一级精品视频在线观看宜春院 | 久久精品国产久精国产爱| 91丨porny丨在线| 久久久久久久久久久久久夜| 视频一区视频二区中文字幕| 色综合久久久久| 欧美国产精品劲爆| 久久精品国产久精国产爱| 精品污污网站免费看| 亚洲欧洲另类国产综合| 国产成人精品亚洲午夜麻豆| 精品日韩一区二区| 热久久久久久久| 欧美三级三级三级| 亚洲综合在线电影| 成人午夜精品在线| 国产欧美日韩三区| 国产剧情一区在线| 精品久久久影院| 麻豆精品国产传媒mv男同| 欧美片网站yy| 日韩av在线发布| 欧美日韩国产综合一区二区三区| 一区二区三区丝袜| 欧美中文一区二区三区| 亚洲激情在线播放| 日本韩国欧美三级| 亚洲一区二区成人在线观看| 在线看不卡av| 午夜精品福利在线| 欧美精品国产精品| 日韩1区2区日韩1区2区| 欧美一区二区三区在线电影| 久久成人羞羞网站| 久久日韩粉嫩一区二区三区 | 免费成人在线观看视频| 欧美精品aⅴ在线视频| 视频在线在亚洲| 日韩欧美一区在线观看| 精品一区二区三区的国产在线播放 | 中文字幕一区二区三区蜜月| 99久久婷婷国产综合精品电影 | 亚洲视频狠狠干| 91福利国产精品| 三级精品在线观看| 日韩精品一区二区三区视频在线观看 | 视频一区二区欧美| 日韩欧美一二区| 国产91精品一区二区| 亚洲三级免费电影| 欧美精品 国产精品| 麻豆成人综合网| 国产精品网曝门| 欧美日韩三级在线| 久久精品av麻豆的观看方式| 中文字幕av一区二区三区高| 欧美日韩在线播| 国产精品一品二品| 一区二区在线看| 精品国产乱码久久久久久浪潮| 99r国产精品| 蜜桃免费网站一区二区三区| 亚洲欧美怡红院| 欧美一级夜夜爽| 99re6这里只有精品视频在线观看| 亚州成人在线电影| 日本一区二区三区视频视频| 欧美日韩在线三级| www.激情成人| 久久精品国产精品亚洲综合| 亚洲精品久久久蜜桃| 欧美大胆人体bbbb| 在线欧美一区二区| 粉嫩aⅴ一区二区三区四区五区 | 一区二区三区中文在线| 精品国内二区三区| 欧美影视一区在线| 国产成人av在线影院| 日韩精品成人一区二区在线| 亚洲欧美偷拍另类a∨色屁股| 精品人在线二区三区| 欧美性猛交一区二区三区精品| 国产河南妇女毛片精品久久久 | 精品国产精品一区二区夜夜嗨| 91免费视频观看| 国产成人h网站| 狠狠色狠狠色综合| 日韩精品国产欧美| 亚洲黄色性网站| 国产精品精品国产色婷婷| 精品国产成人系列| 91精品国产黑色紧身裤美女| 91福利精品第一导航| av不卡一区二区三区| 成人动漫在线一区| 国产乱对白刺激视频不卡| 美女爽到高潮91| 天天操天天干天天综合网| 亚洲狠狠丁香婷婷综合久久久| 国产精品久久久久桃色tv| 久久久99久久精品欧美| 精品国产区一区| 欧美成人乱码一区二区三区| 欧美一区二区在线观看| 欧美欧美午夜aⅴ在线观看| 欧美日韩视频在线一区二区| 欧美人与禽zozo性伦| 欧美日韩在线播放三区| 欧美日韩一区在线观看| 欧美日韩精品高清| 欧美精品视频www在线观看| 欧美日韩精品久久久| 欧美精品色一区二区三区| 8x8x8国产精品| 欧美一级日韩一级| www国产精品av| 久久伊99综合婷婷久久伊| 国产日韩综合av| 中文字幕av一区二区三区| 亚洲欧美偷拍三级| 亚洲综合在线观看视频| 日韩精品电影一区亚洲| 韩国在线一区二区| 国产乱码精品一品二品| av激情综合网| 欧美写真视频网站| 337p亚洲精品色噜噜噜| 精品日韩一区二区三区| 欧美国产日本韩| 亚洲综合一区二区精品导航| 久久国产尿小便嘘嘘尿| 国产精品 欧美精品| 色综合久久中文综合久久牛| 欧美挠脚心视频网站| 精品国产1区2区3区| 国产精品久久久久久久午夜片| 亚洲一区av在线| 久久99国内精品| 91在线一区二区三区| 欧美日韩日日夜夜| 久久免费国产精品| 亚洲裸体xxx| 麻豆成人久久精品二区三区红 | 不卡av免费在线观看| 欧美在线不卡视频| 91精品综合久久久久久| 国产欧美日本一区视频| 亚洲大片在线观看| 国产麻豆精品在线观看| 日本久久一区二区| 精品久久国产字幕高潮| 亚洲视频香蕉人妖| 国产资源在线一区| 91久久奴性调教| 国产肉丝袜一区二区| 日韩成人精品在线| 色综合久久中文字幕综合网| 久久免费电影网| 热久久免费视频| 欧美在线短视频| 国产精品三级电影| 美女免费视频一区| 91丨九色丨蝌蚪富婆spa| 久久久久久久久久久黄色| 五月激情综合网| 一本久道中文字幕精品亚洲嫩| 久久久亚洲高清| 午夜视频一区在线观看| 97精品久久久久中文字幕| 欧美精品一区二区三区蜜臀 | 亚洲主播在线观看| 国产不卡免费视频| 日韩欧美二区三区| 亚洲成人综合视频| 99精品一区二区| 中文字幕免费观看一区| 久久国产精品72免费观看| 欧美久久久影院| 一区二区三区 在线观看视频| 成人手机在线视频| 久久久一区二区三区捆绑**| 久久成人免费网| 日韩欧美一区二区免费| 奇米一区二区三区av| 欧美人与禽zozo性伦| 亚洲国产精品精华液网站| 99re热这里只有精品视频| 欧美国产日本韩| zzijzzij亚洲日本少妇熟睡| 中文字幕av一区二区三区免费看| 大白屁股一区二区视频| 国产日产欧美一区| 成人一区二区三区视频| 欧美韩日一区二区三区四区|