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

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

?? os_core.c

?? 基于44B0的uCOS程序
?? 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
* Version : V2.76
*********************************************************************************************************
*/

#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_EN && (OS_EVENT_NAME_SIZE > 1)
INT8U  OSEventNameGet (OS_EVENT *pevent, char *pname, INT8U *err)
{
    INT8U      len;
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;



    cpu_sr = 0;                                  /* Prevent compiler warning                           */
#endif    
    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_EN && (OS_EVENT_NAME_SIZE > 1)
void  OSEventNameSet (OS_EVENT *pevent, char *pname, INT8U *err)
{
    INT8U      len;
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;



    cpu_sr = 0;                                  /* Prevent compiler warning                           */
#endif    
    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();
#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.
*********************************************************************************************************
*/

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人在线视频一区二区| 日本女优在线视频一区二区| 成人免费av在线| 国产精品免费视频一区| www.色精品| 亚洲国产精品综合小说图片区| 欧美亚洲禁片免费| 日韩国产一区二| 日韩精品一区二区三区三区免费| 久久99精品久久久| 中文乱码免费一区二区| 91在线观看高清| 偷拍一区二区三区| 精品久久人人做人人爰| 国产成人精品网址| 一区二区在线观看不卡| 欧美日韩国产免费一区二区| 美女视频黄 久久| 国产精品久久久久久久久免费相片| 91一区一区三区| 日本午夜一区二区| 中文字幕第一页久久| 在线一区二区三区| 九九精品视频在线看| 国产精品成人一区二区艾草| 欧美午夜宅男影院| 国产成人一级电影| 午夜精品久久久久久久久久| 亚洲精品在线网站| 91黄色免费看| 国产成人在线观看免费网站| 亚洲一区二区三区中文字幕| 精品久久久久久综合日本欧美| 成人av网站免费观看| 奇米777欧美一区二区| 中文一区在线播放| 日韩一区二区精品在线观看| 91麻豆免费看片| 国产综合色产在线精品| 亚洲国产精品久久人人爱| 久久夜色精品国产噜噜av| 在线观看www91| 国产一区二区三区久久悠悠色av| 亚洲最色的网站| 国产免费久久精品| 欧美刺激脚交jootjob| 在线观看精品一区| 成人一区二区三区| 久久69国产一区二区蜜臀| 亚洲国产日韩精品| 亚洲视频在线一区二区| 精品国产免费一区二区三区四区 | 日一区二区三区| 国产精品久久久久影院亚瑟| 精品国产一区二区三区久久久蜜月| 欧美偷拍一区二区| 色狠狠色噜噜噜综合网| 成人免费福利片| 国产精品亚洲综合一区在线观看| 免费精品视频在线| 日韩精品亚洲一区| 亚洲超丰满肉感bbw| 一区二区三区欧美激情| 国产精品成人午夜| 中文字幕精品综合| 国产欧美精品一区二区色综合朱莉| 欧美一区二区免费观在线| 欧美三级电影精品| 欧美视频在线一区| 欧美艳星brazzers| 欧美吻胸吃奶大尺度电影| 色一情一伦一子一伦一区| 91免费观看国产| 99精品国产热久久91蜜凸| voyeur盗摄精品| 99视频精品免费视频| 成人精品视频一区二区三区 | a级精品国产片在线观看| 狠狠网亚洲精品| 精品中文字幕一区二区小辣椒| 同产精品九九九| 男女性色大片免费观看一区二区 | 久久精工是国产品牌吗| 久久99精品国产.久久久久 | 成人午夜激情片| 丰满亚洲少妇av| jlzzjlzz欧美大全| 日本久久一区二区三区| 欧美日韩精品二区第二页| 欧美高清dvd| 欧美精品一区二区久久婷婷| 久久综合色之久久综合| 国产欧美精品一区aⅴ影院| 国产精品久久久久久久久免费丝袜 | 亚洲综合一区二区精品导航| 亚洲综合在线观看视频| 午夜国产精品一区| 裸体歌舞表演一区二区| 国产剧情一区二区| 91在线云播放| 欧美日韩国产在线观看| 日韩欧美国产一区二区在线播放 | 日韩一区二区麻豆国产| 久久久不卡网国产精品二区| 亚洲欧洲另类国产综合| 亚洲在线观看免费| 久久99精品久久久久久久久久久久 | 蜜桃91丨九色丨蝌蚪91桃色| 国产老女人精品毛片久久| 91麻豆国产自产在线观看| 欧美夫妻性生活| 久久精品一区蜜桃臀影院| 亚洲欧洲综合另类| 青青国产91久久久久久| 成人av资源网站| 欧美日本一区二区三区四区| 久久综合九色综合久久久精品综合| 国产精品免费人成网站| 五月激情六月综合| 成人一区在线观看| 91精品婷婷国产综合久久竹菊| 久久精品欧美日韩| 亚洲一二三四在线观看| 国产一区二区三区电影在线观看| 99国产精品久久| 精品久久久久久综合日本欧美| 亚洲精品日韩综合观看成人91| 蜜臀av一区二区在线观看| 99国产精品99久久久久久| 日韩精品一区二| 亚洲午夜精品在线| 粗大黑人巨茎大战欧美成人| 亚洲欧美另类久久久精品| 亚洲国产日韩在线一区模特| 国产精品一卡二| 久久久精品天堂| 91香蕉视频污| 日韩国产在线一| 国产亚洲一区字幕| 色综合久久综合| 麻豆精品国产传媒mv男同| 精品国产99国产精品| 成人黄色在线视频| 亚洲与欧洲av电影| 成人avav影音| 成人久久18免费网站麻豆| 欧美日韩国产综合草草| 亚洲蜜臀av乱码久久精品| 国产福利91精品| 日韩免费高清电影| 天天综合色天天综合色h| 97久久人人超碰| 国产欧美日韩不卡免费| 欧美一级日韩免费不卡| 色综合天天综合网天天狠天天| 色噜噜狠狠成人中文综合| 中文字幕+乱码+中文字幕一区| 极品少妇xxxx精品少妇偷拍| 日韩欧美区一区二| 日本伊人午夜精品| 7777精品伊人久久久大香线蕉| 一区二区三区在线播| 一本到不卡免费一区二区| 国产精品久久夜| 99久久伊人精品| 亚洲天堂av老司机| 99精品1区2区| 一区二区三区在线观看视频| 91免费国产在线| 一区二区三区日本| 欧美日韩一区二区三区免费看 | 不卡av在线免费观看| 日本一区二区三区国色天香| 国产乱码精品一区二区三| 国产午夜亚洲精品理论片色戒 | 日本二三区不卡| 亚洲精品久久久久久国产精华液| 色哟哟在线观看一区二区三区| 亚洲美女精品一区| 欧美性色黄大片| 欧美aaaaaa午夜精品| 亚洲精品在线电影| 成人av在线资源网站| 亚洲久本草在线中文字幕| 欧美午夜精品久久久久久孕妇| 亚洲成人精品一区| 91精品福利在线一区二区三区| 久久99精品久久久| 国产精品妹子av| 在线看日韩精品电影| 午夜影视日本亚洲欧洲精品| 日韩一卡二卡三卡| 精品一区免费av| 亚洲天堂免费看| 91精品欧美综合在线观看最新| 国内精品久久久久影院色| 国产精品视频你懂的| 欧美日韩精品是欧美日韩精品| 国产在线精品免费| 亚洲免费观看高清|