亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
国产亚洲精品bt天堂精选| 亚洲五码中文字幕| 亚洲综合999| 韩国精品主播一区二区在线观看| 日本精品一区二区三区高清| 中文字幕乱码日本亚洲一区二区| 亚洲国产精品久久人人爱| 国产成人在线视频网站| 日韩精品一区二区在线观看| 亚洲男人电影天堂| 成人av电影在线播放| 精品国免费一区二区三区| 亚洲一区二区偷拍精品| 99久久精品免费看国产| 久久色在线视频| 狂野欧美性猛交blacked| 欧美三级中文字幕在线观看| 亚洲欧美自拍偷拍色图| 国产成人日日夜夜| 久久综合丝袜日本网| 卡一卡二国产精品 | 国产成人精品一区二| 日韩一区二区精品| 蜜桃av一区二区在线观看| 在线观看视频一区| 亚洲自拍另类综合| 精品视频在线看| 亚洲一级二级在线| 欧美视频在线一区二区三区| 亚洲综合在线观看视频| 色综合久久综合| 亚洲综合在线电影| 精品视频在线视频| 男女男精品视频网| 欧美电影影音先锋| 蜜臀av性久久久久蜜臀av麻豆 | 亚洲va韩国va欧美va| 久久久精品综合| 国产精品一级片| 国产精品私人影院| 99re亚洲国产精品| 日韩毛片一二三区| 91蝌蚪porny九色| 一区二区国产盗摄色噜噜| 欧美日本精品一区二区三区| 日韩av一区二区三区| 精品久久久久久无| 激情图片小说一区| 国产女人aaa级久久久级| 成人h精品动漫一区二区三区| 国产精品久久毛片a| 色综合久久精品| 日韩电影在线免费观看| 久久久91精品国产一区二区三区| 成人高清免费观看| 国产精品免费丝袜| 欧美精品久久一区二区三区| 精品中文字幕一区二区| 国产精品理伦片| 欧美精品自拍偷拍| 国产91精品一区二区麻豆网站| 最新日韩在线视频| 欧美一级黄色大片| 色综合欧美在线| 免费在线视频一区| 亚洲欧洲成人精品av97| 欧美日韩国产a| 成人激情小说乱人伦| 亚洲成人自拍网| 国产亚洲精品免费| 91麻豆精品国产91久久久资源速度 | 国产欧美日韩综合精品一区二区 | 国产成人精品免费看| 一区二区三区精品在线| 2020国产成人综合网| 欧美性受xxxx| 国产91在线观看丝袜| 日本v片在线高清不卡在线观看| 国产精品色哟哟网站| 日韩一区二区三区在线| 97久久久精品综合88久久| 久久99日本精品| 亚洲va在线va天堂| 日韩理论片中文av| 久久精品男人天堂av| 欧美日韩高清一区| 一本色道久久综合亚洲精品按摩| 精品一区二区三区久久| 午夜成人免费电影| 亚洲精品中文字幕乱码三区| 久久久久久久久久久久电影 | 国产精品视频第一区| 日韩欧美的一区| 欧美日韩精品高清| 在线亚洲+欧美+日本专区| 成人一二三区视频| 国产精品夜夜嗨| 国产原创一区二区| 另类中文字幕网| 舔着乳尖日韩一区| 亚洲成人一二三| 毛片不卡一区二区| 日韩精品久久理论片| 亚洲在线免费播放| 亚洲狼人国产精品| 自拍偷拍国产精品| 国产精品美女久久久久久| 国产欧美日韩亚州综合| 欧美成人一区二区| 精品国产乱子伦一区| 91精品国产综合久久精品麻豆| 欧美亚洲另类激情小说| 91国偷自产一区二区开放时间| 色综合视频在线观看| 色婷婷亚洲精品| 欧美中文字幕一二三区视频| 色哟哟国产精品| 欧美日韩色一区| 制服丝袜亚洲精品中文字幕| 欧美高清一级片在线| 91精品国产福利| 欧美精品一区二区三区一线天视频| 日韩久久免费av| 久久久五月婷婷| 国产精品不卡一区| 一区二区三区国产| 日韩精品亚洲专区| 狠狠色综合日日| 本田岬高潮一区二区三区| 97se亚洲国产综合在线| 91国内精品野花午夜精品 | 91麻豆视频网站| 欧美日韩aaa| 日韩一区二区在线观看视频| 精品国产一区二区三区忘忧草| 久久久久久久久久电影| 国产精品成人免费| 香港成人在线视频| 久久爱www久久做| 91免费看视频| 91麻豆精品国产91| 国产女人aaa级久久久级| 亚洲精品成人在线| 麻豆国产一区二区| 波多野结衣欧美| 51久久夜色精品国产麻豆| 国产亚洲欧美日韩在线一区| 亚洲日本在线看| 青草国产精品久久久久久| 国产成人午夜99999| 欧美午夜在线观看| 久久久久青草大香线综合精品| 亚洲色大成网站www久久九九| 午夜精品成人在线视频| 丁香六月久久综合狠狠色| 欧美视频完全免费看| 久久久久国产免费免费| 午夜精品影院在线观看| 成人午夜视频网站| 日韩一级视频免费观看在线| 国产精品免费久久| 久久99久久99小草精品免视看| 91麻豆国产福利在线观看| 精品sm在线观看| 午夜欧美视频在线观看| 不卡一区二区中文字幕| 日韩欧美亚洲国产另类| 一区二区三区影院| 岛国精品一区二区| 日韩免费观看高清完整版在线观看| 中文字幕日韩av资源站| 国模娜娜一区二区三区| 欧美视频在线一区二区三区| 久久影视一区二区| 中文字幕在线一区免费| 中文字幕免费不卡在线| 亚洲激情第一区| 色妹子一区二区| 亚洲欧美日韩一区二区三区在线观看| 亚洲午夜久久久久久久久电影网| 国产一区二区三区免费看| 欧美日韩高清不卡| 久久理论电影网| 成人小视频免费在线观看| 欧美激情综合网| 成人av动漫在线| k8久久久一区二区三区| 国产91精品欧美| 久久天堂av综合合色蜜桃网| 亚洲第一精品在线| 欧美三级日本三级少妇99| 亚洲视频网在线直播| 成人黄色小视频| 中文字幕欧美区| 波多野结衣中文一区| 中文字幕欧美激情| youjizz久久| 亚洲情趣在线观看| 一本色道**综合亚洲精品蜜桃冫| 中文字幕中文乱码欧美一区二区|