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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? os_core.c

?? uC/OS-II,The Real-Time Kernel, CORE FUNCTIONS, 80x86/80x88 Specific code (LARGE MEMORY MODEL)
?? C
?? 第 1 頁 / 共 5 頁
字號:
/*
*********************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*                                             CORE FUNCTIONS
*
*                          (c) Copyright 1992-2003, Jean J. Labrosse, Weston, FL
*                                           All Rights Reserved
*
* File : OS_CORE.C
* By   : Jean J. Labrosse
*********************************************************************************************************
*/

#ifndef  OS_MASTER_FILE
#define  OS_GLOBALS
#include <ucos_ii.h>
#endif

/*
*********************************************************************************************************
*                              MAPPING TABLE TO MAP BIT POSITION TO BIT MASK
*
* Note: Index into table is desired bit position, 0..7
*       Indexed value corresponds to bit mask
*********************************************************************************************************
*/

INT8U  const  OSMapTbl[8]   = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80};

/*
*********************************************************************************************************
*                                       PRIORITY RESOLUTION TABLE
*
* Note: Index into table is bit pattern to resolve highest priority
*       Indexed value corresponds to highest priority bit position (i.e. 0..7)
*********************************************************************************************************
*/

INT8U  const  OSUnMapTbl[256] = {
    0, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,       /* 0x00 to 0x0F                             */
    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,       /* 0x10 to 0x1F                             */
    5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,       /* 0x20 to 0x2F                             */
    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,       /* 0x30 to 0x3F                             */
    6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,       /* 0x40 to 0x4F                             */
    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,       /* 0x50 to 0x5F                             */
    5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,       /* 0x60 to 0x6F                             */
    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,       /* 0x70 to 0x7F                             */
    7, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,       /* 0x80 to 0x8F                             */
    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,       /* 0x90 to 0x9F                             */
    5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,       /* 0xA0 to 0xAF                             */
    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,       /* 0xB0 to 0xBF                             */
    6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,       /* 0xC0 to 0xCF                             */
    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,       /* 0xD0 to 0xDF                             */
    5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,       /* 0xE0 to 0xEF                             */
    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0        /* 0xF0 to 0xFF                             */
};

/*$PAGE*/
/*
*********************************************************************************************************
*                                       FUNCTION PROTOTYPES
*********************************************************************************************************
*/
static  void  OS_InitEventList(void);
static  void  OS_InitMisc(void);
static  void  OS_InitRdyList(void);
static  void  OS_InitTaskIdle(void);
#if OS_TASK_STAT_EN > 0
static  void  OS_InitTaskStat(void);
#endif
static  void  OS_InitTCBList(void);

/*$PAGE*/
/*
*********************************************************************************************************
*                         GET THE NAME OF A SEMAPHORE, MUTEX, MAILBOX or QUEUE
*
* Description: This function is used to obtain the name assigned to a semaphore, mutex, mailbox or queue.
*
* Arguments  : pevent    is a pointer to the event group.  'pevent' can point either to a semaphore,
*                        a mutex, a mailbox or a queue.  Where this function is concerned, the actual
*                        type is irrelevant.
*
*              pname     is a pointer to an ASCII string that will receive the name of the semaphore,
*                        mutex, mailbox or queue.  The string must be able to hold at least 
*                        OS_EVENT_NAME_SIZE characters.
*
*              err       is a pointer to an error code that can contain one of the following values:
*
*                        OS_NO_ERR                  if the name was copied to 'pname'
*                        OS_ERR_EVENT_TYPE          if 'pevent' is not pointing to the proper event 
*                                                   control block type.
*                        OS_ERR_PNAME_NULL          You passed a NULL pointer for 'pname'
*                        OS_ERR_PEVENT_NULL         if you passed a NULL pointer for 'pevent'
*
* Returns    : The length of the string or 0 if the 'pevent' is a NULL pointer.
*********************************************************************************************************
*/

#if OS_EVENT_NAME_SIZE > 1
INT8U  OSEventNameGet (OS_EVENT *pevent, char *pname, INT8U *err)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif
    INT8U      len;


    OS_ENTER_CRITICAL();
#if OS_ARG_CHK_EN > 0
    if (pevent == (OS_EVENT *)0) {               /* Is 'pevent' a NULL pointer?                        */
        OS_EXIT_CRITICAL();                      /* Yes                                                */
        *err = OS_ERR_PEVENT_NULL;
        return (0);
    }
    if (pname == (char *)0) {                    /* Is 'pname' a NULL pointer?                         */
        OS_EXIT_CRITICAL();                      /* Yes                                                */
        *err = OS_ERR_PNAME_NULL;
        return (0);
    }
#endif
    switch (pevent->OSEventType) {
        case OS_EVENT_TYPE_SEM:
        case OS_EVENT_TYPE_MUTEX:
        case OS_EVENT_TYPE_MBOX:
        case OS_EVENT_TYPE_Q:
             break;

        default:
             OS_EXIT_CRITICAL();
             *err = OS_ERR_EVENT_TYPE;
             return (0);
    }
    len  = OS_StrCopy(pname, pevent->OSEventName);    /* Copy name from OS_EVENT                       */
    OS_EXIT_CRITICAL();
    *err = OS_NO_ERR;
    return (len);
}
#endif

/*$PAGE*/
/*
*********************************************************************************************************
*                         ASSIGN A NAME TO A SEMAPHORE, MUTEX, MAILBOX or QUEUE
*
* Description: This function assigns a name to a semaphore, mutex, mailbox or queue.
*
* Arguments  : pevent    is a pointer to the event group.  'pevent' can point either to a semaphore,
*                        a mutex, a mailbox or a queue.  Where this function is concerned, it doesn't
*                        matter the actual type.
*
*              pname     is a pointer to an ASCII string that will be used as the name of the semaphore,
*                        mutex, mailbox or queue.  The string must be able to hold at least 
*                        OS_EVENT_NAME_SIZE characters.
*
*              err       is a pointer to an error code that can contain one of the following values:
*
*                        OS_NO_ERR                  if the requested task is resumed
*                        OS_ERR_EVENT_TYPE          if 'pevent' is not pointing to the proper event 
*                                                   control block type.
*                        OS_ERR_PNAME_NULL          You passed a NULL pointer for 'pname'
*                        OS_ERR_PEVENT_NULL         if you passed a NULL pointer for 'pevent'
*
* Returns    : None
*********************************************************************************************************
*/

#if OS_EVENT_NAME_SIZE > 1
void  OSEventNameSet (OS_EVENT *pevent, char *pname, INT8U *err)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif
    INT8U      len;


    OS_ENTER_CRITICAL();
#if OS_ARG_CHK_EN > 0
    if (pevent == (OS_EVENT *)0) {               /* Is 'pevent' a NULL pointer?                        */
        OS_EXIT_CRITICAL();                      /* Yes                                                */
        *err = OS_ERR_PEVENT_NULL;
        return;
    }
    if (pname == (char *)0) {                    /* Is 'pname' a NULL pointer?                         */
        OS_EXIT_CRITICAL();                      /* Yes                                                */
        *err = OS_ERR_PNAME_NULL;
        return;
    }
#endif
    switch (pevent->OSEventType) {
        case OS_EVENT_TYPE_SEM:
        case OS_EVENT_TYPE_MUTEX:
        case OS_EVENT_TYPE_MBOX:
        case OS_EVENT_TYPE_Q:
             break;

        default:
             OS_EXIT_CRITICAL();
             *err = OS_ERR_EVENT_TYPE;
             return;
    }
    len = OS_StrLen(pname);                           /* Can we fit the string in the storage area?    */
    if (len > (OS_EVENT_NAME_SIZE - 1)) {             /* No                                            */
        OS_EXIT_CRITICAL();
        *err = OS_ERR_EVENT_NAME_TOO_LONG;
        return;
    } 
    (void)OS_StrCopy(pevent->OSEventName, pname);     /* Yes, copy name to the event control block     */
    OS_EXIT_CRITICAL();
    *err = OS_NO_ERR;
}
#endif

/*$PAGE*/
/*
*********************************************************************************************************
*                                             INITIALIZATION
*
* Description: This function is used to initialize the internals of uC/OS-II and MUST be called prior to
*              creating any uC/OS-II object and, prior to calling OSStart().
*
* Arguments  : none
*
* Returns    : none
*********************************************************************************************************
*/

void  OSInit (void)
{
#if OS_VERSION >= 204
    OSInitHookBegin();                                           /* Call port specific initialization code   */
#endif

    OS_InitMisc();                                               /* Initialize miscellaneous variables       */

    OS_InitRdyList();                                            /* Initialize the Ready List                */

    OS_InitTCBList();                                            /* Initialize the free list of OS_TCBs      */

    OS_InitEventList();                                          /* Initialize the free list of OS_EVENTs    */

#if (OS_VERSION >= 251) && (OS_FLAG_EN > 0) && (OS_MAX_FLAGS > 0)
    OS_FlagInit();                                               /* Initialize the event flag structures     */
#endif

#if (OS_MEM_EN > 0) && (OS_MAX_MEM_PART > 0)
    OS_MemInit();                                                /* Initialize the memory manager            */
#endif

#if (OS_Q_EN > 0) && (OS_MAX_QS > 0)
    OS_QInit();                                                  /* Initialize the message queue structures  */
#endif

    OS_InitTaskIdle();                                           /* Create the Idle Task                     */
#if OS_TASK_STAT_EN > 0
    OS_InitTaskStat();                                           /* Create the Statistic Task                */
#endif

#if OS_VERSION >= 204
    OSInitHookEnd();                                             /* Call port specific init. code            */
#endif

#if OS_VERSION >= 270 && OS_DEBUG_EN > 0
//    _OSDebugInit();   SOME ERRORS HERE ;-}}}} COMMENTED by JAMES ;-]]]]]
#endif
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                              ENTER ISR
*
* Description: This function is used to notify uC/OS-II that you are about to service an interrupt
*              service routine (ISR).  This allows uC/OS-II to keep track of interrupt nesting and thus
*              only perform rescheduling at the last nested ISR.
*
* Arguments  : none
*
* Returns    : none
*
* Notes      : 1) This function should be called ith interrupts already disabled
*              2) Your ISR can directly increment OSIntNesting without calling this function because
*                 OSIntNesting has been declared 'global'.  
*              3) You MUST still call OSIntExit() even though you increment OSIntNesting directly.
*              4) You MUST invoke OSIntEnter() and OSIntExit() in pair.  In other words, for every call
*                 to OSIntEnter() at the beginning of the ISR you MUST have a call to OSIntExit() at the
*                 end of the ISR.
*              5) You are allowed to nest interrupts up to 255 levels deep.
*              6) I removed the OS_ENTER_CRITICAL() and OS_EXIT_CRITICAL() around the increment because
*                 OSIntEnter() is always called with interrupts disabled.
*********************************************************************************************************
*/

void  OSIntEnter (void)
{
    if (OSRunning == TRUE) {
        if (OSIntNesting < 255u) {
            OSIntNesting++;                      /* Increment ISR nesting level                        */
        }

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一区有码在线| 99久久综合精品| 免费在线欧美视频| 亚洲sss视频在线视频| 依依成人综合视频| 亚洲嫩草精品久久| 亚洲乱码国产乱码精品精的特点| 国产精品美女久久久久久久久久久 | 亚洲黄色av一区| 中文字幕综合网| 亚洲猫色日本管| 亚洲一二三区不卡| 视频在线观看91| 激情综合一区二区三区| 国产福利不卡视频| 成人动漫在线一区| 色94色欧美sute亚洲线路一久| 欧美日韩一卡二卡三卡| 亚洲成人福利片| 三级不卡在线观看| 国产在线精品一区二区| 成人午夜免费av| 在线观看91视频| 欧美一区二区在线免费播放| 精品免费一区二区三区| 亚洲国产精品t66y| 亚洲一区二区三区不卡国产欧美 | 91论坛在线播放| 欧美日韩精品电影| 精品久久一区二区三区| 国产精品视频九色porn| 亚洲成a天堂v人片| 国产一区二区在线视频| 99国产精品久久久久久久久久 | 色狠狠av一区二区三区| 91精品国产高清一区二区三区| 久久久影院官网| 亚洲综合丝袜美腿| 国内一区二区在线| 色系网站成人免费| 日韩精品一区二区三区视频播放| 中文字幕免费在线观看视频一区| 一区二区在线观看免费视频播放| 日韩成人精品视频| 99久久精品免费看国产免费软件| 欧美精品在欧美一区二区少妇| 久久久美女毛片| 亚洲午夜久久久| 国产一区二区三区不卡在线观看| 91福利国产精品| 国产偷v国产偷v亚洲高清| 亚洲韩国一区二区三区| 国产精品91xxx| 51精品国自产在线| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 精品国产成人系列| 亚洲日本在线视频观看| 久久精品国内一区二区三区| 一本色道久久综合亚洲精品按摩| 亚洲精品在线网站| 视频一区视频二区在线观看| 91一区一区三区| 久久影院午夜片一区| 亚洲国产精品欧美一二99| 成人短视频下载| 久久亚洲综合av| 日韩激情视频在线观看| 91啪九色porn原创视频在线观看| 精品粉嫩aⅴ一区二区三区四区| 一区二区三区高清| www.在线成人| 久久久午夜精品| 麻豆一区二区三| 欧美日韩小视频| 亚洲资源在线观看| 99久久er热在这里只有精品66| 2023国产精华国产精品| 免费观看在线综合| 6080yy午夜一二三区久久| 亚洲私人黄色宅男| 99v久久综合狠狠综合久久| 久久久久久一二三区| 久久国产精品第一页| 91精品国产免费| 水野朝阳av一区二区三区| 欧美色综合天天久久综合精品| 国产精品久久久久久久久久免费看| 国产精品一级片在线观看| 精品欧美久久久| 久草这里只有精品视频| 欧美一级夜夜爽| 免费观看日韩电影| 精品少妇一区二区三区视频免付费 | 欧美日韩中文字幕一区二区| 亚洲欧洲综合另类| 色综合天天综合在线视频| 亚洲天堂av老司机| 色综合一区二区| 一区二区三区欧美视频| 在线观看91视频| 午夜影院在线观看欧美| 欧美日韩激情在线| 日本亚洲电影天堂| 欧美成人video| 国内久久精品视频| 国产亚洲欧美色| 国产成人精品网址| 国产精品美女久久久久aⅴ | 欧美性淫爽ww久久久久无| 亚洲精品伦理在线| 欧美日韩免费高清一区色橹橹| 亚洲一区在线观看免费| 欧美日韩免费观看一区三区| 日本欧美在线观看| 欧美变态凌虐bdsm| 国产·精品毛片| 中文字幕一区二区视频| 欧美伊人精品成人久久综合97| 香蕉乱码成人久久天堂爱免费| 制服丝袜国产精品| 国产一区三区三区| 中文字幕一区在线| 欧美老女人在线| 激情综合网av| 中文字幕一区二区三区精华液 | 欧美日韩精品免费观看视频| 麻豆国产欧美一区二区三区| 国产亚洲精品久| 色哟哟国产精品| 日本不卡一二三区黄网| 国产片一区二区三区| 一本久久a久久精品亚洲| 亚洲成av人在线观看| 欧美va亚洲va在线观看蝴蝶网| 成人在线综合网| 一区二区三区电影在线播| 日韩一区二区视频| www.综合网.com| 日本欧美一区二区三区| 亚洲国产精品激情在线观看 | 中文字幕一区二区三区不卡| 欧美中文字幕不卡| 国产揄拍国内精品对白| 综合分类小说区另类春色亚洲小说欧美| 在线观看中文字幕不卡| 韩国精品在线观看| 亚洲黄色录像片| 国产日韩欧美一区二区三区乱码| 色婷婷狠狠综合| 国产一区二三区| 偷偷要91色婷婷| 国产精品国产三级国产aⅴ原创| 欧美丰满嫩嫩电影| 国产成人av资源| 日韩国产精品大片| 亚洲色图制服诱惑| 久久久久久久久久久久久女国产乱| 日本道在线观看一区二区| 精品制服美女久久| 性感美女久久精品| 亚洲视频中文字幕| xnxx国产精品| 欧美二区三区91| 91蝌蚪porny| 国产一区二区福利| 日韩精品国产欧美| 一区二区三区免费看视频| 久久综合狠狠综合久久激情| 69久久夜色精品国产69蝌蚪网| 成人av资源在线观看| 精品一区二区三区视频| 日韩精品高清不卡| 伊人夜夜躁av伊人久久| 欧美激情一区二区三区不卡 | 一区二区三区91| 国产精品久久久久久久午夜片| 精品国产免费视频| 欧美日韩国产小视频| 91影院在线观看| 大尺度一区二区| 精品一区二区三区不卡| 天天av天天翘天天综合网| 亚洲精品日韩综合观看成人91| 欧美国产97人人爽人人喊| 精品99一区二区三区| 欧美一区二区三区系列电影| 欧美主播一区二区三区美女| 91玉足脚交白嫩脚丫在线播放| 福利一区福利二区| 国产精品小仙女| 国产麻豆精品一区二区| 蜜桃精品视频在线观看| 日本不卡免费在线视频| 日韩电影在线看| 午夜精品久久久久久| 亚洲午夜精品网| 亚洲一本大道在线| 香蕉成人伊视频在线观看| 亚洲成人三级小说| 天堂在线一区二区|