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

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

?? pc.c

?? ucosii小實驗任務3 哲學家就餐
?? C
?? 第 1 頁 / 共 2 頁
字號:
    
    PC_VectSet(VECT_DOS_CHAIN, PC_TickISR);                /* Store MS-DOS's tick to chain             */
    
    setjmp(PC_JumpBuf);                                    /* Capture where we are in DOS              */
    if (PC_ExitFlag == TRUE) {                             /* See if we are exiting back to DOS        */
        OS_ENTER_CRITICAL();
        PC_SetTickRate(18);                                /* Restore tick rate to 18.2 Hz             */
        OS_EXIT_CRITICAL();
        PC_VectSet(VECT_TICK, PC_TickISR);                 /* Restore DOS's tick vector                */
        PC_DispClrScr(DISP_FGND_WHITE + DISP_BGND_BLACK);  /* Clear the display                        */
        exit(0);                                           /* Return to DOS                            */
    }
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                       ELAPSED TIME INITIALIZATION
*
* Description : This function initialize the elapsed time module by determining how long the START and
*               STOP functions take to execute.  In other words, this function calibrates this module
*               to account for the processing time of the START and STOP functions.
*
* Arguments   : None.
*
* Returns     : None.
*********************************************************************************************************
*/
void PC_ElapsedInit(void)
{
    PC_ElapsedOverhead = 0;
    PC_ElapsedStart();
    PC_ElapsedOverhead = PC_ElapsedStop();
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                         INITIALIZE PC'S TIMER #2
*
* Description : This function initialize the PC's Timer #2 to be used to measure the time between events.
*               Timer #2 will be running when the function returns.
*
* Arguments   : None.
*
* Returns     : None.
*********************************************************************************************************
*/
void PC_ElapsedStart(void)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif    
    INT8U      data;


    OS_ENTER_CRITICAL();
    data  = (INT8U)inp(0x61);                              /* Disable timer #2                         */
    data &= 0xFE;
    outp(0x61, data);
    outp(TICK_T0_8254_CWR,  TICK_T0_8254_CTR2_MODE0);      /* Program timer #2 for Mode 0              */
    outp(TICK_T0_8254_CTR2, 0xFF);
    outp(TICK_T0_8254_CTR2, 0xFF);
    data |= 0x01;                                          /* Start the timer                          */
    outp(0x61, data);
    OS_EXIT_CRITICAL();
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                 STOP THE PC'S TIMER #2 AND GET ELAPSED TIME
*
* Description : This function stops the PC's Timer #2, obtains the elapsed counts from when it was
*               started and converts the elapsed counts to micro-seconds.
*
* Arguments   : None.
*
* Returns     : The number of micro-seconds since the timer was last started.
*
* Notes       : - The returned time accounts for the processing time of the START and STOP functions.
*               - 54926 represents 54926S-16 or, 0.838097 which is used to convert timer counts to
*                 micro-seconds.  The clock source for the PC's timer #2 is 1.19318 MHz (or 0.838097 uS)
*********************************************************************************************************
*/
INT16U PC_ElapsedStop(void)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif    
    INT8U      data;
    INT8U      low;
    INT8U      high;
    INT16U     cnts;


    OS_ENTER_CRITICAL();
    data  = (INT8U)inp(0x61);                                    /* Disable the timer                  */
    data &= 0xFE;
    outp(0x61, data);
    outp(TICK_T0_8254_CWR, TICK_T0_8254_CTR2_LATCH);             /* Latch the timer value              */
    low  = inp(TICK_T0_8254_CTR2);
    high = inp(TICK_T0_8254_CTR2);
    cnts = (INT16U)0xFFFF - (((INT16U)high << 8) + (INT16U)low); /* Compute time it took for operation */
    OS_EXIT_CRITICAL();
    return ((INT16U)((INT32U)cnts * 54926L >> 16) - PC_ElapsedOverhead);
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                       GET THE CURRENT DATE AND TIME
*
* Description: This function obtains the current date and time from the PC.
*
* Arguments  : s     is a pointer to where the ASCII string of the current date and time will be stored.
*                    You must allocate at least 21 bytes (includes the NUL) of storage in the return 
*                    string.  The date and time will be formatted as follows:
*
*                        "YYYY-MM-DD  HH:MM:SS"
*
* Returns    : none
*********************************************************************************************************
*/
void PC_GetDateTime (char *s)
{
    struct time now;
    struct date today;


    gettime(&now);
    getdate(&today);
    sprintf(s, "%04d-%02d-%02d  %02d:%02d:%02d",
               today.da_year,
               today.da_mon,
               today.da_day,
               now.ti_hour,
               now.ti_min,
               now.ti_sec);
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                        CHECK AND GET KEYBOARD KEY
*
* Description: This function checks to see if a key has been pressed at the keyboard and returns TRUE if
*              so.  Also, if a key is pressed, the key is read and copied where the argument is pointing
*              to.
*
* Arguments  : c     is a pointer to where the read key will be stored.
*
* Returns    : TRUE  if a key was pressed
*              FALSE otherwise
*********************************************************************************************************
*/
BOOLEAN PC_GetKey (INT16S *c)
{
    if (kbhit()) {                                         /* See if a key has been pressed            */
        *c = (INT16S)getch();                              /* Get key pressed                          */
        return (TRUE);
    } else {
        *c = 0x00;                                         /* No key pressed                           */
        return (FALSE);
    }
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                      SET THE PC'S TICK FREQUENCY
*
* Description: This function is called to change the tick rate of a PC.
*
* Arguments  : freq      is the desired frequency of the ticker (in Hz)
*
* Returns    : none
*
* Notes      : 1) The magic number 2386360 is actually twice the input frequency of the 8254 chip which
*                 is always 1.193180 MHz.
*              2) The equation computes the counts needed to load into the 8254.  The strange equation
*                 is actually used to round the number using integer arithmetic.  This is equivalent to
*                 the floating point equation:
*
*                             1193180.0 Hz
*                     count = ------------ + 0.5
*                                 freq
*********************************************************************************************************
*/
void PC_SetTickRate (INT16U freq)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif    
    INT16U     count;


    if (freq == 18) {                            /* See if we need to restore the DOS frequency        */
        count = 0;
    } else if (freq > 0) {                        
                                                 /* Compute 8254 counts for desired frequency and ...  */
                                                 /* ... round to nearest count                         */
        count = (INT16U)(((INT32U)2386360L / freq + 1) >> 1); 
    } else {
        count = 0;
    }
    OS_ENTER_CRITICAL();
    outp(TICK_T0_8254_CWR,  TICK_T0_8254_CTR0_MODE3); /* Load the 8254 with desired frequency          */  
    outp(TICK_T0_8254_CTR0, count & 0xFF);            /* Low  byte                                     */
    outp(TICK_T0_8254_CTR0, (count >> 8) & 0xFF);     /* High byte                                     */
    OS_EXIT_CRITICAL();
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                        OBTAIN INTERRUPT VECTOR
*
* Description: This function reads the pointer stored at the specified vector.
*
* Arguments  : vect  is the desired interrupt vector number, a number between 0 and 255.
*
* Returns    : The address of the Interrupt handler stored at the desired vector location.
*********************************************************************************************************
*/
void *PC_VectGet (INT8U vect)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif    
    INT16U    *pvect;
    INT16U     off;
    INT16U     seg;
    
    
    pvect = (INT16U *)MK_FP(0x0000, vect * 4);        /* Point into IVT at desired vector location     */
    OS_ENTER_CRITICAL();
    off   = *pvect++;                                 /* Obtain the vector's OFFSET                    */
    seg   = *pvect;                                   /* Obtain the vector's SEGMENT                   */
    OS_EXIT_CRITICAL();
    return (MK_FP(seg, off));
}

/*
*********************************************************************************************************
*                                        INSTALL INTERRUPT VECTOR
*
* Description: This function sets an interrupt vector in the interrupt vector table.
*
* Arguments  : vect  is the desired interrupt vector number, a number between 0 and 255.
*              isr   is a pointer to a function to execute when the interrupt or exception occurs.
*
* Returns    : none
*********************************************************************************************************
*/
void PC_VectSet (INT8U vect, void (*isr)(void))
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif    
    INT16U    *pvect;
    
    
    pvect    = (INT16U *)MK_FP(0x0000, vect * 4);     /* Point into IVT at desired vector location     */
    OS_ENTER_CRITICAL();
    *pvect++ = (INT16U)FP_OFF(isr);                   /* Store ISR offset                              */
    *pvect   = (INT16U)FP_SEG(isr);                   /* Store ISR segment                             */
    OS_EXIT_CRITICAL();
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91免费版在线| 日本一区二区成人| 国产综合色在线| 久久久国产精华| 成人aa视频在线观看| 一区二区三区四区不卡视频| 欧美日韩视频在线一区二区| 免费成人在线影院| 国产日韩v精品一区二区| 91亚洲精品久久久蜜桃网站| 亚洲国产日产av| 精品剧情v国产在线观看在线| 国产99一区视频免费| 亚洲欧洲日本在线| 欧美乱妇15p| 国产一区不卡在线| 综合久久给合久久狠狠狠97色 | 99久久精品99国产精品| 亚洲综合精品自拍| 日韩一区二区三区免费看| 国产精品888| 亚洲综合免费观看高清完整版在线| 91精品国产免费| 国产成人免费视频网站 | 亚洲成人自拍偷拍| 精品国一区二区三区| 91丨九色porny丨蝌蚪| 午夜精品福利久久久| 久久精品一区二区三区av| 色哟哟一区二区在线观看| 免费av网站大全久久| 国产精品午夜春色av| 欧美日韩国产免费| 国产盗摄一区二区三区| 亚洲妇熟xx妇色黄| 久久久久高清精品| 欧美色综合影院| 国产精品911| 午夜精品久久久久久久久久久 | 精品成人一区二区三区| av亚洲精华国产精华精| 日产欧产美韩系列久久99| 中文字幕乱码亚洲精品一区| 欧美日本一区二区三区四区 | 欧美日韩不卡一区二区| 高清不卡在线观看av| 天天操天天干天天综合网| 欧美国产精品一区二区| 日韩一区二区三区在线视频| 91免费版pro下载短视频| 久久69国产一区二区蜜臀| 一区二区久久久久久| 国产欧美一区二区精品性色 | 欧美日韩在线播放三区| 国产九九视频一区二区三区| 亚洲亚洲精品在线观看| 中文字幕av一区 二区| 欧美一区二区视频在线观看| av综合在线播放| 精彩视频一区二区| 首页欧美精品中文字幕| 17c精品麻豆一区二区免费| 精品成人一区二区| 欧美日韩精品系列| a亚洲天堂av| 国产a久久麻豆| 久久99久久久欧美国产| 亚洲成在人线在线播放| 亚洲特黄一级片| 国产日韩欧美a| 精品国产乱码91久久久久久网站| 欧美日韩免费不卡视频一区二区三区| 成人sese在线| 国产精品小仙女| 久99久精品视频免费观看| 香蕉加勒比综合久久| 伊人开心综合网| 成人欧美一区二区三区| 国产日韩欧美在线一区| 精品99999| 欧美一区二区三区四区久久| 色视频欧美一区二区三区| 不卡的av在线| 高清不卡一二三区| 国产电影精品久久禁18| 国产在线播放一区二区三区 | 日韩成人一区二区三区在线观看| 一区二区三区精品在线| 亚洲区小说区图片区qvod| 欧美韩国日本综合| 国产三级精品在线| 久久精品视频网| 久久综合视频网| 欧美成人精精品一区二区频| 欧美一级在线免费| 5566中文字幕一区二区电影| 欧美日韩精品二区第二页| 欧美羞羞免费网站| 欧美影片第一页| 欧美色中文字幕| 欧美精品久久一区二区三区| 欧美日韩免费观看一区二区三区| 欧洲精品中文字幕| 在线观看www91| 欧美偷拍一区二区| 欧美视频自拍偷拍| 欧美日韩亚洲国产综合| 欧美肥大bbwbbw高潮| 欧美高清视频www夜色资源网| 欧美日韩久久一区二区| 欧美精品丝袜久久久中文字幕| 欧美另类变人与禽xxxxx| 在线成人av网站| 亚洲黄一区二区三区| 亚洲欧美日韩国产一区二区三区| 日本一区二区在线不卡| 亚洲欧美综合在线精品| 亚洲男人的天堂一区二区 | 国产精品不卡一区| 1000部国产精品成人观看| 亚洲免费av观看| 亚洲一区二区视频在线观看| 午夜成人在线视频| 美女看a上一区| 国产剧情一区二区三区| www.亚洲精品| 色av一区二区| 欧美日韩视频在线第一区| 欧美一级高清片| 久久综合给合久久狠狠狠97色69| 久久精品人人做人人综合| 1024亚洲合集| 五月天国产精品| 寂寞少妇一区二区三区| 不卡的av网站| 欧美色成人综合| 欧美精品一区男女天堂| 亚洲欧洲日韩av| 亚洲成人动漫一区| 国产综合色视频| 91免费视频大全| 欧美一级精品在线| 国产日韩欧美精品综合| 亚洲综合另类小说| 另类小说欧美激情| 成人av先锋影音| 欧美日韩成人在线| 久久精品在这里| 亚洲一区二区三区视频在线播放 | 亚洲精品日韩一| 免费人成精品欧美精品| 成人综合在线网站| 欧美日韩高清一区二区三区| 久久亚洲一区二区三区四区| 亚洲精品视频在线观看网站| 蜜臀91精品一区二区三区| www.亚洲精品| 欧美一区二区久久| 国产精品青草久久| 天堂在线一区二区| 懂色中文一区二区在线播放| 欧美日本韩国一区二区三区视频| 久久久久久久久久电影| 一二三区精品视频| 国内精品不卡在线| 91福利社在线观看| 久久精品夜夜夜夜久久| 亚洲成人综合网站| 成人综合婷婷国产精品久久免费| 欧美美女一区二区| 中文字幕乱码日本亚洲一区二区| 视频一区视频二区中文字幕| 成人一级片在线观看| 欧美一区中文字幕| 亚洲欧洲精品成人久久奇米网| 婷婷开心久久网| 99国产精品久久久久| 日韩精品一区二| 一区二区三区日韩欧美| 国产精品主播直播| 欧美日韩国产一二三| 自拍偷自拍亚洲精品播放| 久久se精品一区精品二区| 欧美在线播放高清精品| 欧美韩国日本一区| 久久se这里有精品| 欧美日韩在线播| 日韩毛片在线免费观看| 国产乱码精品一区二区三区av| 欧美日韩国产免费一区二区| 综合久久国产九一剧情麻豆| 国产一区二区三区最好精华液| 欧美日韩中文国产| 国产精品不卡视频| 国产精品99久久久久| 欧美刺激脚交jootjob| 午夜免费欧美电影| 91视频在线观看| 欧美极品xxx| 国产一区在线精品|