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

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

?? os_cpu_c.c

?? uc/osII2.51官方源代碼,想要學(xué)習(xí)這個(gè)操作系統(tǒng)的可以仔細(xì)看看
?? C
字號(hào):
/*
*********************************************************************************************************
*                                               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

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品久久久久久亚洲毛片| 国产成人免费视| 欧美日韩免费视频| 一区二区日韩av| 555夜色666亚洲国产免| 秋霞午夜av一区二区三区| 欧美一区二区三区免费观看视频| 日本美女视频一区二区| 亚洲精品一线二线三线| 国产a久久麻豆| 综合av第一页| 91精品国产免费| 精品亚洲成av人在线观看| 久久久久久电影| 99精品1区2区| 天堂久久一区二区三区| 日韩欧美资源站| 成人黄色免费短视频| 亚洲国产另类av| 久久久久久影视| 色婷婷一区二区三区四区| 婷婷久久综合九色国产成人 | 91免费版在线看| 午夜激情一区二区| 国产婷婷色一区二区三区四区| 91蝌蚪porny成人天涯| 日韩国产一二三区| 国产精品久久久久影院| 欧美另类久久久品| 成人久久视频在线观看| 五月婷婷激情综合| 日韩一区在线免费观看| 777精品伊人久久久久大香线蕉| 国产成人一区二区精品非洲| 亚洲黄色片在线观看| 精品久久久久香蕉网| 色88888久久久久久影院野外| 日本vs亚洲vs韩国一区三区| 欧美国产乱子伦 | 26uuu精品一区二区| 色婷婷综合久久久久中文| 久久国产精品72免费观看| 亚洲综合图片区| 中文字幕乱码一区二区免费| 欧美精品在线一区二区| 91麻豆自制传媒国产之光| 精品亚洲免费视频| 午夜精品久久一牛影视| 亚洲美女免费视频| 国产精品人人做人人爽人人添| 欧美一卡2卡3卡4卡| 欧美中文字幕亚洲一区二区va在线| 国产美女精品一区二区三区| 亚洲成人自拍网| 亚洲免费观看高清在线观看| 久久久久久**毛片大全| 欧美一区二区三区的| 欧美日韩一区二区三区在线 | 综合网在线视频| 国产亚洲一区字幕| 欧美mv日韩mv国产网站app| 欧美色图免费看| 色噜噜久久综合| av不卡在线播放| 成人av资源网站| 高清在线观看日韩| 国产成人精品免费网站| 精品在线播放免费| 久久国产精品无码网站| 蜜桃视频在线观看一区| 日韩电影在线看| 男人的j进女人的j一区| 奇米888四色在线精品| 日本系列欧美系列| 日韩成人一级片| 日本不卡高清视频| 蜜桃视频第一区免费观看| 日韩va亚洲va欧美va久久| 亚洲成a人v欧美综合天堂下载| 亚洲一区在线观看视频| 亚洲成人综合视频| 另类小说视频一区二区| 韩国精品主播一区二区在线观看 | 国产亚洲一区字幕| 国产精品色哟哟| 亚洲视频一区二区在线观看| 中文字幕亚洲区| 亚洲精品欧美综合四区| 亚洲自拍偷拍图区| 青青青伊人色综合久久| 国内成+人亚洲+欧美+综合在线| 国产一区二区调教| 成人精品一区二区三区四区| 成人av网站在线观看| 91网站最新网址| 欧美影院一区二区| 日韩一级欧美一级| 久久久久久久久久久久久夜| 中文字幕精品一区| 亚洲一区二区中文在线| 日本视频一区二区三区| 国产乱码精品一品二品| 一本色道亚洲精品aⅴ| 欧美日韩视频在线观看一区二区三区 | 欧美夫妻性生活| 精品噜噜噜噜久久久久久久久试看| 2023国产精品自拍| 伊人开心综合网| 久久国产麻豆精品| 色综合天天天天做夜夜夜夜做| 欧美日韩一区二区在线观看视频| 精品福利在线导航| 亚洲精品高清视频在线观看| 久久精品72免费观看| 91麻豆国产自产在线观看| 欧美精品久久久久久久久老牛影院| 精品成人一区二区| 亚洲午夜视频在线观看| 国产九色精品成人porny| 91传媒视频在线播放| 久久这里只有精品视频网| 一区二区在线观看视频在线观看| 老司机午夜精品| 在线免费观看不卡av| 久久精品一区二区三区不卡| 夜夜精品浪潮av一区二区三区| 国产精品一区二区免费不卡| 欧美性猛交一区二区三区精品| 久久久久高清精品| 日韩精品视频网| 日本高清不卡一区| 国产拍欧美日韩视频二区| 亚洲成人1区2区| av一二三不卡影片| 久久综合九色综合久久久精品综合| 亚洲午夜久久久久久久久电影网 | 成人黄色免费短视频| 欧美成人一区二区三区片免费| 亚洲精选视频在线| a级精品国产片在线观看| 精品国产乱码久久久久久浪潮 | 国产精品主播直播| 欧美一区二区三区在线观看 | 色狠狠一区二区三区香蕉| 久久精品一区二区三区不卡牛牛 | 波多野结衣中文字幕一区| 欧美成人欧美edvon| 午夜婷婷国产麻豆精品| 日本道免费精品一区二区三区| 欧美国产禁国产网站cc| 国产乱色国产精品免费视频| 欧美二区乱c少妇| 午夜欧美在线一二页| 欧美视频你懂的| 亚洲影视资源网| 91久久香蕉国产日韩欧美9色| 国产精品无码永久免费888| 国产成人8x视频一区二区| 26uuu国产电影一区二区| 国产在线国偷精品产拍免费yy| 日韩欧美一卡二卡| 免费看日韩精品| 欧美va亚洲va香蕉在线| 美女视频一区在线观看| 日韩欧美亚洲一区二区| 日本午夜精品视频在线观看| 欧美一区二区视频观看视频| 免费成人av在线| 久久欧美一区二区| 国产成人午夜精品影院观看视频| 久久久久国产免费免费| 国产成人精品免费看| 国产精品女上位| 色女孩综合影院| 亚洲高清免费在线| 欧美一级黄色大片| 国产毛片精品一区| 亚洲国产高清不卡| 在线亚洲高清视频| 视频一区二区三区中文字幕| 91精品国产91热久久久做人人| 美女任你摸久久| 国产色婷婷亚洲99精品小说| 成人精品免费看| 一区二区三区中文在线| 欧美久久高跟鞋激| 国产在线日韩欧美| 亚洲人成亚洲人成在线观看图片| 色婷婷狠狠综合| 毛片基地黄久久久久久天堂| 久久蜜桃一区二区| 91麻豆国产自产在线观看| 日韩成人一级片| 国产精品久久久一区麻豆最新章节| 91在线看国产| 日本欧美韩国一区三区| 亚洲国产精华液网站w| 欧美日韩aaaaaa| 成人永久aaa| 污片在线观看一区二区|