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

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

?? pc.c

?? 任務一 任務管理 任務二 優先級天花板 任務三 哲學家就餐 任務四 消息隊列 任務五 時鐘中斷
?? 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高清视频免费看| 一本大道久久a久久综合婷婷| 欧美日本免费一区二区三区| 中文字幕av资源一区| 石原莉奈一区二区三区在线观看| 成人丝袜高跟foot| 欧美成人a∨高清免费观看| 亚洲国产一区二区在线播放| 成人免费高清视频| 亚洲精品一区二区在线观看| 亚洲成av人**亚洲成av**| aaa欧美色吧激情视频| 久久婷婷综合激情| 久久99最新地址| 日韩午夜精品电影| 日韩制服丝袜先锋影音| 欧美午夜精品理论片a级按摩| 日本一区二区电影| 国产99久久久精品| 国产欧美日本一区二区三区| 麻豆91在线看| 精品国产免费一区二区三区四区| 天堂精品中文字幕在线| 欧美日韩1区2区| 午夜久久电影网| 欧美丰满高潮xxxx喷水动漫| 亚洲国产精品久久人人爱| 色综合欧美在线视频区| 一区二区三区四区在线免费观看| 色偷偷成人一区二区三区91| 国产精品国产三级国产有无不卡| 成人黄色在线网站| 国产精品视频yy9299一区| 成人永久aaa| 中文字幕在线不卡一区 | 精一区二区三区| 91精品国产91久久综合桃花| 日韩电影在线看| 日韩一区二区精品葵司在线| 日av在线不卡| 精品对白一区国产伦| 国产精品亚洲视频| 中文字幕在线观看不卡视频| 色伊人久久综合中文字幕| 亚洲一区二区三区四区在线观看| 8v天堂国产在线一区二区| 蜜桃传媒麻豆第一区在线观看| 亚洲精品一区在线观看| 国产.欧美.日韩| 亚洲三级免费观看| 91精品国产综合久久国产大片 | 福利视频网站一区二区三区| 国产女人18毛片水真多成人如厕| av午夜一区麻豆| 亚洲国产一区二区视频| 欧美成人性战久久| 暴力调教一区二区三区| 日韩综合在线视频| 国产精品视频在线看| 欧美日韩mp4| 懂色av一区二区三区免费看| 亚洲综合一二三区| 精品播放一区二区| 日本丶国产丶欧美色综合| 秋霞午夜鲁丝一区二区老狼| 中文av一区二区| 884aa四虎影成人精品一区| 国产成人免费网站| 性做久久久久久| 日本一区二区三区在线不卡| 在线免费观看视频一区| 国产精品综合av一区二区国产馆| 亚洲精品成a人| 久久久久久亚洲综合| 欧美亚洲日本一区| 大尺度一区二区| 日韩高清一区在线| 伊人一区二区三区| 国产亚洲综合av| 欧美一区二区三区影视| av综合在线播放| 国产精品18久久久久| 视频一区中文字幕国产| 国产精品成人免费在线| xnxx国产精品| 欧美裸体一区二区三区| 色综合色狠狠天天综合色| 国产精品一区二区在线看| 午夜精品久久久久久久久久久 | 91精品国产色综合久久久蜜香臀| 成人性色生活片| 狠狠色综合播放一区二区| 午夜视频一区二区三区| 亚洲精品一二三| 中文字幕中文字幕中文字幕亚洲无线| 制服视频三区第一页精品| 欧洲激情一区二区| 91免费国产在线观看| 成人性生交大片| 成人免费视频播放| 福利一区在线观看| 国内精品伊人久久久久av影院| 午夜精品久久久| 婷婷综合久久一区二区三区| 亚洲国产成人va在线观看天堂| 亚洲欧洲国产专区| 亚洲人亚洲人成电影网站色| 国产精品天干天干在观线| 国产精品视频线看| 亚洲天堂免费看| 日韩一区在线免费观看| 亚洲少妇屁股交4| 日韩理论片中文av| 一区二区欧美精品| 一区二区成人在线视频| 亚洲一区二区五区| 亚洲成av人片| 美女一区二区在线观看| 久久电影网站中文字幕 | 日韩成人伦理电影在线观看| 亚洲福利一二三区| 日韩综合小视频| 久久成人av少妇免费| 国产一区二区三区久久悠悠色av| 国产精品一卡二卡在线观看| 国产成人精品亚洲午夜麻豆| 成人爱爱电影网址| 91福利视频久久久久| 欧美日韩国产小视频在线观看| 欧美日韩精品综合在线| 欧美一级黄色片| 久久久影视传媒| 亚洲精品国产成人久久av盗摄| 香蕉久久夜色精品国产使用方法| 免费美女久久99| 国产a区久久久| 欧美日韩三级在线| 精品不卡在线视频| 亚洲精品久久久蜜桃| 日日摸夜夜添夜夜添国产精品| 久久er99精品| 91一区二区在线| 欧美日韩国产高清一区二区三区 | 亚洲国产色一区| 日本欧美在线看| 成人h动漫精品一区二区| 欧美在线一区二区| 欧美成人一区二区三区片免费 | 美脚の诱脚舐め脚责91| 成人国产精品视频| 欧美高清视频www夜色资源网| xf在线a精品一区二区视频网站| 亚洲精品欧美激情| 国产一区二区在线免费观看| 91在线国产福利| 欧美成人bangbros| 亚洲一区二区三区四区五区中文| 国内成人精品2018免费看| 色婷婷国产精品久久包臀| 久久新电视剧免费观看| 亚洲国产精品人人做人人爽| 丁香婷婷综合五月| 91精品视频网| 亚洲精品午夜久久久| 国产一区二区三区免费播放| 欧美日韩国产精选| 亚洲丝袜精品丝袜在线| 久久99国产精品麻豆| 欧美日本乱大交xxxxx| 日韩码欧中文字| 国产99精品国产| 欧美成人精精品一区二区频| 亚洲午夜激情网站| 91片在线免费观看| 国产日本亚洲高清| 久久99国产精品久久| 欧美精品久久一区| 亚洲影院免费观看| 色婷婷久久久久swag精品| 国产欧美精品一区| 国产一区高清在线| 日韩免费观看2025年上映的电影| 依依成人综合视频| 91九色02白丝porn| 亚洲天堂精品在线观看| 丁香天五香天堂综合| 久久久91精品国产一区二区精品| 奇米影视一区二区三区| 欧美裸体bbwbbwbbw| 五月天丁香久久| 欧美剧情电影在线观看完整版免费励志电影| 亚洲欧洲性图库| 色综合天天综合色综合av| 国产精品国产三级国产aⅴ入口| 丰满亚洲少妇av| 国产精品国产三级国产| 波多野结衣中文一区| 中文字幕在线不卡一区| 色综合久久中文综合久久97|