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

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

?? hal_atapi.c

?? STi5518機頂盒ATAPI源代碼!絕對超值!
?? C
?? 第 1 頁 / 共 3 頁
字號:
/************************************************************************Source file name : hal_atapi.cDescription: HAL Layer implementation of the ATA/ATAPI driver              for the 5512/18 ATA Host InterfaceCOPYRIGHT (C) STMicroelectronics  2000************************************************************************//*Includes-------------------------------------------------------------*/#include <stdio.h>#include <string.h>#include "stsys.h"#include "stlite.h"#include "statapi.h"#include "hal_atapi.h"#include "ata.h"#if defined(ATAPI_GPDMA)#if defined(HDDI_5514_CUT_3)#error Use of GPDMA with 5514 cut 3 HDDI is not supported.#endif#include "stgpdma.h"#endif#include "sttbx.h"/*---------------HW specific ---------------------------*/#define     ATA_HRD_RST_ASSERT      0x0#define     ATA_HRD_RST_DEASSERT    0x1#ifdef BMDMA_ENABLE/* BMDMA details */#define     BLOCK_MOVE_INT_LEVEL    6#define     BLOCK_MOVE_INTERRUPT    15#define     BMDMA_SrcAddress        0x20026000#define     BMDMA_DestAddress       0x20026004#define     BMDMA_Count             0x20026008#define     BMDMA_IntEn             0x2002600C#define     BMDMA_Status            0x20026010#define     BMDMA_IntAck            0x20026014#endif/*Exported macros    ----------------*//*Private Types--------------------------------------------------------*/BOOL    Verbose = FALSE;BOOL    Trace = FALSE;U32 intcount = 0;U32 inttrace[15];/*Private Constants----------------------------------------------------*/static   STATAPI_PioTiming_t  CurrentPioTiming;static   STATAPI_DmaTiming_t  CurrentDmaTiming;static const STATAPI_Capability_t CurrentCapabilities =                             { STATAPI_EMI_PIO4,                              1 << STATAPI_PIO_MODE_4,                              (1 << STATAPI_DMA_UDMA_MODE_4) |                               (1 << STATAPI_DMA_UDMA_MODE_2) |                               (1 << STATAPI_DMA_UDMA_MODE_0) |                               (1 << STATAPI_DMA_MWDMA_MODE_0) |                              (1 << STATAPI_DMA_MWDMA_MODE_2)                            };#if defined (ST_5512) static const U32 RegsMasks[12]={ (aCS1 | nCS0 | aDA2 | aDA1 | nDA0),                                 (nCS1 | aCS0 | nDA2 | nDA1 | nDA0),                                 (nCS1 | aCS0 | nDA2 | nDA1 | aDA0),                                 (nCS1 | aCS0 | nDA2 | nDA1 | aDA0),                                 (nCS1 | aCS0 | nDA2 | aDA1 | nDA0),                                 (nCS1 | aCS0 | nDA2 | aDA1 | aDA0),                                 (nCS1 | aCS0 | aDA2 | nDA1 | nDA0),                                 (nCS1 | aCS0 | aDA2 | nDA1 | aDA0),                                 (nCS1 | aCS0 | aDA2 | aDA1 | nDA0),                                 (nCS1 | aCS0 | aDA2 | aDA1 | aDA0),                                 (nCS1 | aCS0 | aDA2 | aDA1 | aDA0),                                 (aCS1 | nCS0 | aDA2 | aDA1 | nDA0)                                };#elif defined (ST_5508) | defined (ST_5518) static const U32 RegsMasks[12]={(0x1c0000),                                (0x200000),                                (0x220000),                                (0x220000),                                (0x240000),                                (0x260000),                                (0x280000),                                (0x2a0000),                                (0x2c0000),                                (0x2e0000),                                (0x2e0000),                                (0x1c0000)                                };  #elif defined(ST_5514)/* Not actually masks in this case; offsets from base address for the * relevant registers  */static const U32 RegsMasks[12]={ (0x38),                                 (0x40),                                 (0x44),                                 (0x44),                                 (0x48),                                 (0x4c),                                 (0x50),                                 (0x54),                                 (0x58),                                 (0x5c),                                 (0x5c),                                 (0x38)                               };#endif                                                        /*Private Variables----------------------------------------------------*/static hal_Handle_t         *The_HalHandle_p;/* Need to know what mode we should be in */static STATAPI_DmaMode_t    CurrentDmaMode;static STATAPI_PioMode_t    CurrentPioMode;#ifdef ST_5514/* Simplifies switch in DmaDataBlock */static BOOL                 DMAIsUDMA = FALSE;#endif/*Private Macros-------------------------------------------------------*//*Private functions prototypes-----------------------------------------*/static void ata_InterruptHandler (void);void SetPIOTiming(volatile U32 *Base, STATAPI_PioTiming_t *Timing);#ifdef BMDMA_ENABLEstatic void ata_BlockMoveIntHandler (void);#endif/*Functions------------------------------------------------------------*//************************************************************************Name: hal_InitDescription:     This function initializes the structures needed to manage the silicon    Basically it allocates the hal handle and installs the interrupt handlerParameters:************************************************************************/BOOL hal_Init (const STATAPI_InitParams_t *params_p, hal_Handle_t **HalHndl_p){#if defined(ATAPI_GPDMA)    STGPDMA_OpenParams_t GPDMA_Open;    ST_ErrorCode_t error = ST_NO_ERROR;#endif     /* Allocate handle */    *HalHndl_p = (hal_Handle_t*) memory_allocate (params_p->DriverPartition,sizeof (hal_Handle_t));    if(*HalHndl_p == NULL)         return TRUE;    /*We keep our internal-hal handle copy, for future checking*/    The_HalHandle_p = *HalHndl_p;        (*HalHndl_p)->BaseAddress = params_p->BaseAddress;      (*HalHndl_p)->HWResetAddress = params_p->HW_ResetAddress;      (*HalHndl_p)->InterruptNumber = params_p->InterruptNumber;      (*HalHndl_p)->InterruptLevel =  params_p->InterruptLevel;      (*HalHndl_p)->DriverPartition = params_p->DriverPartition;    #ifdef BMDMA_ENABLE    /* create interrupt semaphore */    semaphore_init_fifo_timeout(&(*HalHndl_p)->BMDMA_IntSemaphore, 0);    /* install the interrupt handler */    if (interrupt_install(BLOCK_MOVE_INTERRUPT,                          BLOCK_MOVE_INT_LEVEL,                          (void(*)(void*))ata_BlockMoveIntHandler,                          NULL) != 0)    {        /* Error: clean and exit */        semaphore_delete(&(*HalHndl_p)->BMDMA_IntSemaphore);        memory_deallocate((*HalHndl_p)->DriverPartition,*HalHndl_p);         return TRUE;                      }    interrupt_enable (BLOCK_MOVE_INT_LEVEL);#endif    #if ATAPI_USING_INTERRUPTS    /* create interrupt semaphore */    semaphore_init_fifo_timeout(&(*HalHndl_p)->InterruptSemaphore,0);    /* install the interrupt handler */    if (interrupt_install((*HalHndl_p)->InterruptNumber,                          (*HalHndl_p)->InterruptLevel,                          (void(*)(void*))ata_InterruptHandler,                          NULL) != 0)    {        /* Error: clean and exit */        semaphore_delete(&(*HalHndl_p)->InterruptSemaphore);        memory_deallocate((*HalHndl_p)->DriverPartition,*HalHndl_p);         *HalHndl_p = NULL;        return TRUE;                      }    /* Enable interrupts in the host */     interrupt_enable ((*HalHndl_p)->InterruptLevel);#endif#if defined(ATAPI_GPDMA)   error = STGPDMA_Open(params_p->GPDMADeviceName, &GPDMA_Open,                         &(*HalHndl_p)->GPDMAHandle);   if (error != ST_NO_ERROR)   {       /* Clean and exit. I don't really feel we can disable that        * entire interrupt level, we don't know what else is there.        */       interrupt_uninstall((*HalHndl_p)->InterruptNumber,                             (*HalHndl_p)->InterruptLevel);       semaphore_delete(&(*HalHndl_p)->InterruptSemaphore);       memory_deallocate((*HalHndl_p)->DriverPartition, *HalHndl_p);        *HalHndl_p = NULL;       return TRUE;                     }#endif      return FALSE;} /* hal_Init*//************************************************************************Name: hal_TermDescription:     This function deallocates all the variables created by the init functionParameters:     HalHdl      pointer to the main structure************************************************************************/BOOL hal_Term (hal_Handle_t *HalHndl_p){#ifdef BMDMA_ENABLE    /* Delete interrupt semaphore*/    semaphore_delete(&(HalHndl_p->BMDMA_IntSemaphore));    /* uninstall the interrupt handler*/    if (interrupt_uninstall (BLOCK_MOVE_INTERRUPT, BLOCK_MOVE_INT_LEVEL) != 0)    {              return TRUE;                      }#endif      #if ATAPI_USING_INTERRUPTS    /*Delete interrupt semaphore*/    semaphore_delete(&HalHndl_p->InterruptSemaphore);      /*unistall the int. handler*/    if (interrupt_uninstall (HalHndl_p->InterruptNumber,                              HalHndl_p->InterruptLevel) != 0)    {        return TRUE;    }#endif#if defined(ATAPI_GPDMA)    /* If we get an error, what can we do? */    STGPDMA_Close(HalHndl_p->GPDMAHandle);#endif          /* Deallocate handle */    memory_deallocate (HalHndl_p->DriverPartition, HalHndl_p);    The_HalHandle_p = NULL;      return FALSE;  }/*end hal_Term*//************************************************************************Name: hal_RegOutByteDescription:     This function works as interface to the ATA registers of the device,     allowing the user to write data in these registers.    No bus acquisition procedure is done. User must manage this Parameters:     HalHndl     Handle of the HAL (for the base address)    regNo       register number    data        data value to write to register*********************************************************************/void hal_RegOutByte (hal_Handle_t *HalHndl_p, ATA_Register_t regNo, U8 data){       DU8     *addr;        addr = (DU8 *)((U32)HalHndl_p->BaseAddress | RegsMasks[regNo]) ;    *addr = data;}/************************************************************************ Name: hal_RegInByteDescription:    This function works as interface to the ATA registers of the device,     allowing the user to read data in these registers. No bus acquisition    procedure is done. User must manage this Parameters:     HalHndl     Handle of the HAL (for the base address)    regNo       register number************************************************************************/U8 hal_RegInByte (hal_Handle_t *HalHndl_p, ATA_Register_t regNo){       DU8     *addr;    addr = (DU8 *)((U32)HalHndl_p->BaseAddress | RegsMasks[regNo]);    return (U8)(*addr);}/************************************************************************Name: hal_RegOutWordDescription:     This function works as an interface to the device's ATA DATA register     allowing the user to  WRITE data in this register. No bus acquisition    procedure is done. User must manage this Parameters:     HalHndl     Handle of the HAL (for the base address)    data        data value to write to register*********************************************************************/void hal_RegOutWord (hal_Handle_t *HalHndl_p, U16 data){       DU16    *addr;    addr = (DU16 *)((U32)HalHndl_p->BaseAddress | RegsMasks[ATA_REG_DATA]) ;    *addr = data;}/************************************************************************Name: hal_RegInWordDescription:     This function works as interface to the device's ATA DATA register allowing    the user to  READ data in these registers. No bus acquisition procedure is    done. User must manage this Parameters:     HalHndl     Handle of the HAL (for the base address)************************************************************************/U16 hal_RegInWord (hal_Handle_t *HalHndl_p){       DU16    *addr;    addr = (DU16 *)((U32)HalHndl_p->BaseAddress | RegsMasks[ATA_REG_DATA]);    return (U16)(*addr);}/************************************************************************Name: hal_GetCapabilites    Description:     This function returns the capabilities of the current host hardware    interface.Parameters:     HalHndl         Handle of the HAL (for the base address)    Capabilites     pointer to a previously allocated structure to fill with                     the return valuesReturns:      FALSE       All OK    TRUE        Something wrong                  ************************************************************************/BOOL hal_GetCapabilities (hal_Handle_t *HalHndl_p,                          STATAPI_Capability_t *Capabilities){    /* Checking the handle and the output parameter */    if ((HalHndl_p == The_HalHandle_p) && (Capabilities != NULL))    {        Capabilities->SupportedPioModes = CurrentCapabilities.SupportedPioModes;        Capabilities->SupportedDmaModes = CurrentCapabilities.SupportedDmaModes;        Capabilities->DeviceType = CurrentCapabilities.DeviceType;    }    else    {        return TRUE;    }    return FALSE;}/************************************************************************Name: hal_EnableIntsDescription:     Enable interrupts in the device Parameters:    HalHndl     Handle of the HAL (for the base address)************************************************************************/void hal_EnableInts (hal_Handle_t *HalHndl_p){    /* Clear nIEN bit */    hal_RegOutByte (HalHndl_p, ATA_REG_CONTROL, nIEN_CLEARED);}/************************************************************************Name:hal_DisableIntsDescription:     Disable interrupts in the device Parameters:    HalHndl     Handle of the HAL (for the base address)************************************************************************/void hal_DisableInts (hal_Handle_t *HalHndl_p){    /* Set nIEN bit */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一级二级三级| 一区av在线播放| 亚洲丝袜制服诱惑| 久久疯狂做爰流白浆xx| 91尤物视频在线观看| 欧美成人性战久久| 亚洲影院久久精品| 成人av资源网站| 国产亚洲精品精华液| 日本中文一区二区三区| 91黄色小视频| 欧美国产成人在线| 经典三级视频一区| 日韩欧美国产一区二区三区 | 日日夜夜免费精品| 91免费看视频| 国产精品拍天天在线| 精彩视频一区二区三区| 欧美精品一二三四| 亚洲一区二区三区不卡国产欧美| 99re亚洲国产精品| 日本一区二区视频在线观看| 韩国av一区二区三区| 欧美电影精品一区二区| 麻豆一区二区99久久久久| 欧美美女一区二区三区| 亚洲国产精品尤物yw在线观看| 色婷婷久久综合| 日韩一区在线看| 成人免费视频一区二区| 欧美经典三级视频一区二区三区| 国产一区二区日韩精品| 久久久久成人黄色影片| 国产一区久久久| 国产三级精品三级在线专区| 国产成人激情av| 国产亚洲一区字幕| av动漫一区二区| 一区二区三区精品在线观看| 欧美婷婷六月丁香综合色| 亚洲一区二区三区视频在线播放| 欧美日韩一区二区三区四区| 亚洲福利一二三区| 欧美一区二区三区免费视频 | 处破女av一区二区| 中文字幕在线观看不卡视频| av一区二区不卡| 亚洲一区在线观看免费观看电影高清| 欧美婷婷六月丁香综合色| 图片区日韩欧美亚洲| 精品国产乱码久久久久久图片 | 捆绑调教一区二区三区| 久久噜噜亚洲综合| av激情亚洲男人天堂| 亚洲综合男人的天堂| 日韩欧美在线123| 成人国产免费视频| 亚洲成人资源网| 日韩一区二区三区电影 | 亚洲欧洲99久久| 欧美日韩久久一区| 国产福利一区二区| 亚洲大片精品永久免费| 久久综合视频网| 日本久久一区二区三区| 麻豆成人久久精品二区三区红 | 日本伊人色综合网| 久久久国际精品| 欧洲中文字幕精品| 国产精品白丝av| 五月天中文字幕一区二区| 久久精品视频一区二区三区| 欧美性猛交xxxxxx富婆| 国产精品自产自拍| 亚洲18女电影在线观看| 国产精品妹子av| 欧美不卡一二三| 欧美一a一片一级一片| 精品制服美女丁香| 亚洲成人久久影院| 国产精品国产馆在线真实露脸| 正在播放一区二区| 99精品在线免费| 精品一区二区在线观看| 亚洲精品成人a在线观看| 久久一留热品黄| 欧美精品日韩一本| 一本大道久久a久久精二百 | 中文成人av在线| 欧美一区二区久久| 欧美曰成人黄网| 成人美女视频在线看| 国内成+人亚洲+欧美+综合在线| 亚洲一区二区三区在线看| 国产精品色哟哟| 久久久蜜桃精品| 日韩精品一区二区三区在线| 欧美午夜精品免费| 色诱视频网站一区| 成人av网站在线| 丰满放荡岳乱妇91ww| 九色综合狠狠综合久久| 蜜臂av日日欢夜夜爽一区| 亚洲丰满少妇videoshd| 亚洲精品乱码久久久久久黑人 | 色呦呦一区二区三区| 国产成人精品一区二| 精品一区二区三区日韩| 老汉av免费一区二区三区| 日韩av在线播放中文字幕| 亚洲大片一区二区三区| 亚洲国产精品嫩草影院| 午夜精品123| 一区二区不卡在线播放| 亚洲成人手机在线| 午夜精品一区二区三区免费视频 | 亚洲国产成人tv| 亚洲男帅同性gay1069| 国产精品麻豆网站| 亚洲老司机在线| 一区二区三区成人在线视频| 一区二区三区在线视频观看58| 亚洲自拍偷拍网站| 天堂久久一区二区三区| 蜜臀精品久久久久久蜜臀 | 精品国产3级a| 久久免费电影网| 中文字幕一区二区三区四区| 亚洲乱码中文字幕综合| 亚洲午夜电影在线| 久久99精品国产.久久久久| 国产一区二区女| 成人av电影观看| 欧美视频你懂的| 日韩女优av电影| 亚洲国产成人私人影院tom| 亚洲人成网站影音先锋播放| 亚洲综合免费观看高清完整版 | 欧美videossexotv100| 久久久精品国产免大香伊| 国产精品久久久久久久久免费樱桃 | 国产成人精品三级麻豆| 色综合一个色综合亚洲| 欧美一级黄色片| 欧美精品一区二区精品网| 中文字幕精品三区| 亚洲黄色小说网站| 日本不卡视频一二三区| 国产很黄免费观看久久| 日本道在线观看一区二区| 日韩精品中午字幕| 中文字幕精品一区| 青青草国产成人99久久| 成人涩涩免费视频| 日韩一级完整毛片| 亚洲欧美另类久久久精品2019| 日韩精品欧美精品| 波多野结衣一区二区三区| 91精品国产色综合久久| 国产精品久久久一本精品| 日韩影院精彩在线| 91啪亚洲精品| 精品国产乱码久久久久久浪潮| 亚洲三级在线观看| 国产精品资源网站| 欧美二区在线观看| 亚洲人精品午夜| 国产成人综合亚洲91猫咪| 欧美精品久久久久久久多人混战| 中文字幕欧美激情| 精油按摩中文字幕久久| 欧美人妖巨大在线| 一区二区三区日韩欧美精品| 国产精品系列在线观看| 日韩欧美一级精品久久| 亚洲国产美国国产综合一区二区| 成人综合在线观看| 久久精品视频网| 韩国在线一区二区| 欧美一区在线视频| 亚洲一区二区三区中文字幕| 99精品热视频| 国产精品国产三级国产有无不卡| 国产一区二区主播在线| 日韩亚洲电影在线| 免费成人你懂的| 91精品国产综合久久久久久久久久| 亚洲欧美一区二区三区极速播放| 粉嫩蜜臀av国产精品网站| 26uuu亚洲综合色| 六月丁香婷婷色狠狠久久| 日韩视频一区二区三区| 午夜精品久久一牛影视| 欧美性生活久久| 一二三四区精品视频| 欧美亚洲一区二区在线| 亚洲综合网站在线观看| 在线观看视频一区二区欧美日韩| 亚洲人成伊人成综合网小说| 91麻豆精品一区二区三区|