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

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

?? os_cpu_c.c

?? uC/OS_II 操作系統的源代碼
?? C
字號:
/*
*********************************************************************************************************
*                                               uC/OS-II
*                                         The Real-Time Kernel
*
*                         (c) Copyright 1992-2001, Jean J. Labrosse, Weston, FL
*                                          All Rights Reserved
*
*
*                                       80x86/80x88 Specific code
*                                          LARGE MEMORY MODEL
*
*                                          Borland C/C++ V4.51
*
* File         : OS_CPU_C.C
* By           : Jean J. Labrosse
*********************************************************************************************************
*/

#define  OS_CPU_GLOBALS
#include "includes.h"

/*
*********************************************************************************************************
*                                        INITIALIZE A TASK'S STACK
*
* Description: This function is called by either OSTaskCreate() or OSTaskCreateExt() to initialize the
*              stack frame of the task being created.  This function is highly processor specific.
*
* Arguments  : task          is a pointer to the task code
*
*              pdata         is a pointer to a user supplied data area that will be passed to the task
*                            when the task first executes.
*
*              ptos          is a pointer to the top of stack.  It is assumed that 'ptos' points to
*                            a 'free' entry on the task stack.  If OS_STK_GROWTH is set to 1 then 
*                            'ptos' will contain the HIGHEST valid address of the stack.  Similarly, if
*                            OS_STK_GROWTH is set to 0, the 'ptos' will contains the LOWEST valid address
*                            of the stack.
*
*              opt           specifies options that can be used to alter the behavior of OSTaskStkInit().
*                            (see uCOS_II.H for OS_TASK_OPT_???).
*
* Returns    : Always returns the location of the new top-of-stack' once the processor registers have
*              been placed on the stack in the proper order.
*
* Note(s)    : Interrupts are enabled when your task starts executing. You can change this by setting the
*              PSW to 0x0002 instead.  In this case, interrupts would be disabled upon task startup.  The
*              application code would be responsible for enabling interrupts at the beginning of the task
*              code.  You will need to modify OSTaskIdle() and OSTaskStat() so that they enable 
*              interrupts.  Failure to do this will make your system crash!
*********************************************************************************************************
*/

OS_STK *OSTaskStkInit (void (*task)(void *pd), void *pdata, OS_STK *ptos, INT16U opt)
{
    INT16U *stk;


    opt    = opt;                           /* 'opt' is not used, prevent warning                      */
    stk    = (INT16U *)ptos;                /* Load stack pointer                                      */
    *stk-- = (INT16U)FP_SEG(pdata);         /* Simulate call to function with argument                 */
    *stk-- = (INT16U)FP_OFF(pdata);         
    *stk-- = (INT16U)FP_SEG(task);
    *stk-- = (INT16U)FP_OFF(task);
    *stk-- = (INT16U)0x0202;                /* SW = Interrupts enabled                                 */
    *stk-- = (INT16U)FP_SEG(task);          /* Put pointer to task   on top of stack                   */
    *stk-- = (INT16U)FP_OFF(task);
    *stk-- = (INT16U)0xAAAA;                /* AX = 0xAAAA                                             */
    *stk-- = (INT16U)0xCCCC;                /* CX = 0xCCCC                                             */
    *stk-- = (INT16U)0xDDDD;                /* DX = 0xDDDD                                             */
    *stk-- = (INT16U)0xBBBB;                /* BX = 0xBBBB                                             */
    *stk-- = (INT16U)0x0000;                /* SP = 0x0000                                             */
    *stk-- = (INT16U)0x1111;                /* BP = 0x1111                                             */
    *stk-- = (INT16U)0x2222;                /* SI = 0x2222                                             */
    *stk-- = (INT16U)0x3333;                /* DI = 0x3333                                             */
    *stk-- = (INT16U)0x4444;                /* ES = 0x4444                                             */
    *stk   = _DS;                           /* DS = Current value of DS                                */
    return ((OS_STK *)stk);
}

/*$PAGE*/
/*
*********************************************************************************************************
*                        INITIALIZE A TASK'S STACK FOR FLOATING POINT EMULATION
*
* Description: This function MUST be called BEFORE calling either OSTaskCreate() or OSTaskCreateExt() in
*              order to initialize the task's stack to allow the task to use the Borland floating-point 
*              emulation.  The returned pointer MUST be used in the task creation call.
*
*              Ex.:   OS_STK TaskStk[1000];
*
*
*                     void main (void)
*                     {
*                         OS_STK *ptos;
*                         OS_STK *pbos;
*                         INT32U  size;
*
*
*                         OSInit();
*                         .
*                         .
*                         ptos  = &TaskStk[999];
*                         pbos  = &TaskStk[0];
*                         psize = 1000;
*                         OSTaskStkInit_FPE_x86(&ptos, &pbos, &size);
*                         OSTaskCreate(Task, (void *)0, ptos, 10);
*                         .
*                         .
*                         OSStart();
*                     }
*
* Arguments  : pptos         is the pointer to the task's top-of-stack pointer which would be passed to 
*                            OSTaskCreate() or OSTaskCreateExt().
*
*              ppbos         is the pointer to the new bottom of stack pointer which would be passed to
*                            OSTaskCreateExt().
*
*              psize         is a pointer to the size of the stack (in number of stack elements).  You 
*                            MUST allocate sufficient stack space to leave at least 384 bytes for the 
*                            floating-point emulation.
*
* Returns    : The new size of the stack once memory is allocated to the floating-point emulation.
*
* Note(s)    : 1) _SS  is a Borland 'pseudoregister' and returns the contents of the Stack Segment (SS)
*              2) The pointer to the top-of-stack (pptos) will be modified so that it points to the new
*                 top-of-stack.
*              3) The pointer to the bottom-of-stack (ppbos) will be modified so that it points to the new
*                 bottom-of-stack.
*              4) The new size of the stack is adjusted to reflect the fact that memory was reserved on
*                 the stack for the floating-point emulation.
*********************************************************************************************************
*/

void  OSTaskStkInit_FPE_x86 (OS_STK **pptos, OS_STK **ppbos, INT32U *psize)
{
    INT32U   lin_tos;                                 /* 'Linear' version of top-of-stack    address   */
    INT32U   lin_bos;                                 /* 'Linear' version of bottom-of-stack address   */
    INT16U   seg;
    INT16U   off;
    INT32U   bytes;


    seg      = FP_SEG(*pptos);                        /* Decompose top-of-stack pointer into seg:off   */
    off      = FP_OFF(*pptos);
    lin_tos  = ((INT32U)seg << 4) + (INT32U)off;      /* Convert seg:off to linear address             */
    bytes    = *psize * sizeof(OS_STK);               /* Determine how many bytes for the stack        */
    lin_bos  = (lin_tos - bytes + 15) & 0xFFFFFFF0L;  /* Ensure paragraph alignment for BOS            */
    
    seg      = (INT16U)(lin_bos >> 4);                /* Get new 'normalized' segment                  */
    *ppbos   = (OS_STK *)MK_FP(seg, 0x0000);          /* Create 'normalized' BOS pointer               */
    memcpy(*ppbos, MK_FP(_SS, 0), 384);               /* Copy FP emulation memory to task's stack      */
    bytes    = bytes - 16;                            /* Loose 16 bytes because of alignment           */
    *pptos   = (OS_STK *)MK_FP(seg, (INT16U)bytes);   /* Determine new top-of-stack                    */
    *ppbos   = (OS_STK *)MK_FP(seg, 384);             /* Determine new bottom-of-stack                 */
    bytes    = bytes - 384;
    *psize   = bytes / sizeof(OS_STK);                /* Determine new stack size                      */
}

/*$PAGE*/
#if OS_CPU_HOOKS_EN
/*
*********************************************************************************************************
*                                       OS INITIALIZATION HOOK
*                                            (BEGINNING)
*
* Description: This function is called by OSInit() at the beginning of OSInit().
*
* Arguments  : none
*
* Note(s)    : 1) Interrupts should be disabled during this call.
*********************************************************************************************************
*/
#if OS_VERSION > 203
void OSInitHookBegin (void)
{
}
#endif

/*
*********************************************************************************************************
*                                       OS INITIALIZATION HOOK
*                                               (END)
*
* Description: This function is called by OSInit() at the end of OSInit().
*
* Arguments  : none
*
* Note(s)    : 1) Interrupts should be disabled during this call.
*********************************************************************************************************
*/
#if OS_VERSION > 203
void OSInitHookEnd (void)
{
}
#endif


/*
*********************************************************************************************************
*                                          TASK CREATION HOOK
*
* Description: This function is called when a task is created.
*
* Arguments  : ptcb   is a pointer to the task control block of the task being created.
*
* Note(s)    : 1) Interrupts are disabled during this call.
*********************************************************************************************************
*/
void OSTaskCreateHook (OS_TCB *ptcb)
{
    ptcb = ptcb;                       /* Prevent compiler warning                                     */
}


/*
*********************************************************************************************************
*                                           TASK DELETION HOOK
*
* Description: This function is called when a task is deleted.
*
* Arguments  : ptcb   is a pointer to the task control block of the task being deleted.
*
* Note(s)    : 1) Interrupts are disabled during this call.
*********************************************************************************************************
*/
void OSTaskDelHook (OS_TCB *ptcb)
{
    ptcb = ptcb;                       /* Prevent compiler warning                                     */
}

/*
*********************************************************************************************************
*                                           TASK SWITCH HOOK
*
* Description: This function is called when a task switch is performed.  This allows you to perform other
*              operations during a context switch.
*
* Arguments  : none
*
* Note(s)    : 1) Interrupts are disabled during this call.
*              2) It is assumed that the global pointer 'OSTCBHighRdy' points to the TCB of the task that
*                 will be 'switched in' (i.e. the highest priority task) and, 'OSTCBCur' points to the 
*                 task being switched out (i.e. the preempted task).
*********************************************************************************************************
*/
void OSTaskSwHook (void)
{
}

/*
*********************************************************************************************************
*                                           STATISTIC TASK HOOK
*
* Description: This function is called every second by uC/OS-II's statistics task.  This allows your 
*              application to add functionality to the statistics task.
*
* Arguments  : none
*********************************************************************************************************
*/
void OSTaskStatHook (void)
{
}

/*
*********************************************************************************************************
*                                           OSTCBInit() HOOK
*
* Description: This function is called by OSTCBInit() after setting up most of the TCB.
*
* Arguments  : ptcb    is a pointer to the TCB of the task being created.
*
* Note(s)    : 1) Interrupts may or may not be ENABLED during this call.
*********************************************************************************************************
*/
#if OS_VERSION > 203
void OSTCBInitHook (OS_TCB *ptcb)
{
    ptcb = ptcb;                                           /* Prevent Compiler warning                 */
}
#endif


/*
*********************************************************************************************************
*                                               TICK HOOK
*
* Description: This function is called every tick.
*
* Arguments  : none
*
* Note(s)    : 1) Interrupts may or may not be ENABLED during this call.
*********************************************************************************************************
*/
void OSTimeTickHook (void)
{
}


/*
*********************************************************************************************************
*                                             IDLE TASK HOOK
*
* Description: This function is called by the idle task.  This hook has been added to allow you to do  
*              such things as STOP the CPU to conserve power.
*
* Arguments  : none
*
* Note(s)    : 1) Interrupts are enabled during this call.
*********************************************************************************************************
*/
#if OS_VERSION >= 251
void OSTaskIdleHook (void)
{
}
#endif
#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区视频免费在线观看| 久久精品国产99| 日本最新不卡在线| 99精品久久久久久| 久久日韩精品一区二区五区| 亚洲精品欧美激情| 成人久久视频在线观看| 精品欧美一区二区久久| 精一区二区三区| 在线观看国产一区二区| 亚洲国产高清在线| 国产又黄又大久久| 欧美一级欧美三级在线观看| 亚洲综合在线五月| 99久久婷婷国产| 久久久一区二区| 久久99久久久久久久久久久| 欧美精品亚洲一区二区在线播放| 17c精品麻豆一区二区免费| 国产美女视频91| 日韩精品一区二区三区中文不卡| 亚洲电影欧美电影有声小说| 91色在线porny| 国产精品传媒入口麻豆| 成人a免费在线看| 国产亚洲自拍一区| 国产91丝袜在线观看| 久久久久一区二区三区四区| 韩国欧美一区二区| 欧美精品一区二区三区久久久| 日韩av一级电影| 欧美电影免费观看高清完整版| 亚洲一区二区三区免费视频| 欧美日韩在线三级| 亚洲成av人片一区二区梦乃| 欧美日免费三级在线| 三级一区在线视频先锋| 欧美精品在线一区二区| 蜜桃久久av一区| 一区二区三区在线视频观看| 91美女福利视频| 一区二区三区免费在线观看| 欧美性欧美巨大黑白大战| 亚洲妇熟xx妇色黄| 欧美一区中文字幕| 国产精品996| 国产精品久久久久久久久免费樱桃 | 日韩精品电影在线| 日韩一区二区麻豆国产| 国产一区欧美二区| 成人欧美一区二区三区黑人麻豆| 91在线云播放| 天天亚洲美女在线视频| 欧美精品一区二区三区一线天视频 | 国产一区二区视频在线| 亚洲国产经典视频| 欧美性猛片aaaaaaa做受| 老司机一区二区| 欧美国产一区二区在线观看| 91久久精品一区二区| 老司机免费视频一区二区| 中文在线一区二区| 欧美日韩精品久久久| 国产乱子伦一区二区三区国色天香| 国产精品国产三级国产普通话蜜臀 | 亚洲美女屁股眼交| 亚洲激情欧美激情| 日韩三级电影网址| 99久久精品国产观看| 日韩激情av在线| 国产欧美va欧美不卡在线| 欧美性感一类影片在线播放| 国产伦精品一区二区三区免费迷 | 91亚洲大成网污www| 免费亚洲电影在线| 中文字幕欧美一| 制服丝袜中文字幕亚洲| 99视频精品在线| 久久99精品久久久久久动态图| 中文字幕一区二区三区在线不卡| 欧美一区二区啪啪| 91麻豆自制传媒国产之光| 精品一区二区三区久久| 亚洲成人免费观看| 中文字幕视频一区| 久久精品一二三| 欧美一级欧美三级在线观看| 欧美在线观看一区| www.亚洲色图| 国产激情精品久久久第一区二区| 五月婷婷色综合| 亚洲激情综合网| 国产女人18毛片水真多成人如厕 | www久久久久| 欧美日韩高清影院| 色香色香欲天天天影视综合网| 美脚の诱脚舐め脚责91 | 亚洲精品一区二区三区精华液| 在线观看亚洲专区| 91蜜桃在线免费视频| 国产成人精品亚洲午夜麻豆| 久久99热99| 韩国精品主播一区二区在线观看 | 亚洲美女视频在线观看| 国产精品嫩草99a| 久久久99久久| 久久奇米777| 精品福利一区二区三区| 日韩欧美一区电影| 日韩一区二区麻豆国产| 欧美一区二区在线不卡| 欧美精品久久99| 欧美人牲a欧美精品| 欧美男同性恋视频网站| 欧美日韩国产综合视频在线观看| 欧美性受xxxx| 欧美久久久久久蜜桃| 51精品久久久久久久蜜臀| 欧美精品久久一区二区三区 | 国产98色在线|日韩| 国产91精品一区二区麻豆亚洲| 韩国女主播一区二区三区| 国产精品一二三四区| 丰满岳乱妇一区二区三区| 成人av一区二区三区| 91在线小视频| 欧美专区亚洲专区| 欧美一区二区精品久久911| 日韩精品一区二区三区中文不卡| 亚洲精品一区二区三区精华液 | 亚洲精品成人天堂一二三| 一区2区3区在线看| 日本系列欧美系列| 精品一区二区三区免费| 成人av在线播放网站| 一本久久精品一区二区| 欧美精品一二三| 国产午夜三级一区二区三| 国产精品天美传媒| 一区二区三区四区亚洲| 奇米精品一区二区三区在线观看| 麻豆极品一区二区三区| 成人午夜短视频| 欧美视频完全免费看| 日韩精品一区二区三区视频在线观看| 日韩精品一区二区三区视频| 国产精品免费免费| 亚洲高清免费在线| 国产ts人妖一区二区| 色婷婷综合视频在线观看| 欧美一区二区视频观看视频| 欧美激情一区在线| 午夜精品久久久久久久蜜桃app| 狠狠色2019综合网| 色嗨嗨av一区二区三区| 欧美精品一区二区三区蜜桃视频| 18欧美乱大交hd1984| 老司机午夜精品99久久| 91麻豆文化传媒在线观看| 日韩精品中午字幕| 亚洲免费观看高清完整版在线 | 99视频超级精品| 69久久夜色精品国产69蝌蚪网| 欧美激情资源网| 免费成人美女在线观看.| 欧美一级电影网站| 亚洲啪啪综合av一区二区三区| 精品亚洲aⅴ乱码一区二区三区| 99国产精品一区| 久久久久久久久久久黄色| 亚洲成人动漫一区| 91亚洲永久精品| 欧美国产乱子伦| 精品一二线国产| 777亚洲妇女| 亚洲成人动漫在线免费观看| 成人白浆超碰人人人人| 久久亚洲综合色| 奇米888四色在线精品| 欧美网站一区二区| 亚洲精品少妇30p| 99精品欧美一区二区蜜桃免费 | 国产精品1区二区.| 欧美一级淫片007| 丝袜美腿高跟呻吟高潮一区| 91一区二区三区在线播放| 国产欧美日韩激情| 国产一区二区在线影院| 在线综合视频播放| 日日欢夜夜爽一区| 欧美日韩国产成人在线免费| 一区二区三区四区精品在线视频| 成人激情免费电影网址| 国产欧美日韩另类视频免费观看| 久久国产精品99久久久久久老狼| 欧美日本国产一区| 日本网站在线观看一区二区三区| 欧美性色综合网| 天天做天天摸天天爽国产一区 | 99精品国产99久久久久久白柏|