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

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

?? os_cpu_c.c

?? ucos 的內存管理機制探究
?? C
字號:
/*
*********************************************************************************************************
*                                               uC/OS-II
*                                         The Real-Time Kernel
*
*                         (c) Copyright 1992-2002, 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"

/*
*********************************************************************************************************
*                                       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_CPU_HOOKS_EN > 0 && 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_CPU_HOOKS_EN > 0 && OS_VERSION > 203
void  OSInitHookEnd (void)
{
}
#endif

/*$PAGE*/
/*
*********************************************************************************************************
*                                          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.
*********************************************************************************************************
*/
#if OS_CPU_HOOKS_EN > 0 
void  OSTaskCreateHook (OS_TCB *ptcb)
{
    ptcb = ptcb;                       /* Prevent compiler warning                                     */
}
#endif


/*
*********************************************************************************************************
*                                           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.
*********************************************************************************************************
*/
#if OS_CPU_HOOKS_EN > 0 
void  OSTaskDelHook (OS_TCB *ptcb)
{
    ptcb = ptcb;                       /* Prevent compiler warning                                     */
}
#endif

/*
*********************************************************************************************************
*                                             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_CPU_HOOKS_EN > 0 && OS_VERSION >= 251
void  OSTaskIdleHook (void)
{
}
#endif

/*
*********************************************************************************************************
*                                           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
*********************************************************************************************************
*/

#if OS_CPU_HOOKS_EN > 0 
void  OSTaskStatHook (void)
{
}
#endif

/*$PAGE*/
/*
*********************************************************************************************************
*                                        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 'pseudo-register' 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.
*********************************************************************************************************
*/

/*$PAGE*/
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*/
/*
*********************************************************************************************************
*                                           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).
*********************************************************************************************************
*/
#if OS_CPU_HOOKS_EN > 0 
void  OSTaskSwHook (void)
{
}
#endif

/*
*********************************************************************************************************
*                                           OSTCBInit() HOOK
*
* Description: This function is called by OS_TCBInit() 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_CPU_HOOKS_EN > 0 && 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.
*********************************************************************************************************
*/
#if OS_CPU_HOOKS_EN > 0 
void  OSTimeTickHook (void)
{
}
#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
五月天中文字幕一区二区| 91精品国产一区二区三区| 成人av中文字幕| 色天天综合色天天久久| 538prom精品视频线放| 国产视频一区在线观看| 亚洲一二三四区不卡| 国产一区二区三区在线看麻豆| 成人性生交大片免费看中文网站| 欧美一区二区三区白人| 狠狠色丁香久久婷婷综| 欧美日韩精品久久久| 亚洲色图第一区| 国产精品一区二区在线播放 | 色哟哟一区二区在线观看| 亚洲精品中文在线| 国产成人av影院| 精品久久久网站| 视频一区二区中文字幕| 91麻豆6部合集magnet| 欧美韩国日本综合| 国产麻豆9l精品三级站| 中文字幕一区二区三区不卡在线| 大美女一区二区三区| 亚洲人成电影网站色mp4| 成人精品视频一区二区三区| 亚洲综合图片区| 精品国产人成亚洲区| 美女视频第一区二区三区免费观看网站| 91福利在线观看| 亚洲精品欧美激情| 日韩精品在线一区二区| 精品一区二区三区不卡| 2021国产精品久久精品| 国精产品一区一区三区mba桃花| 日韩一区在线免费观看| 91精品一区二区三区久久久久久| 高清日韩电视剧大全免费| 久久精品一级爱片| 欧美日韩国产综合久久| 高清免费成人av| 毛片av一区二区| 一区二区久久久久久| 欧美日韩国产综合一区二区三区 | 欧美一区二区三区四区五区| 成人午夜在线免费| 美女视频黄 久久| 亚洲综合男人的天堂| 中文字幕乱码一区二区免费| 国产精品久久久久婷婷| 日韩精品视频网| 精品国产免费视频| 成人av在线电影| 一区二区三区免费| 日韩一区二区在线观看| 亚洲小说欧美激情另类| 成人精品鲁一区一区二区| 亚洲免费观看高清完整版在线| 欧美日韩一区高清| 亚洲免费观看高清完整| 欧美日韩三级一区| 国产一区二区中文字幕| 亚洲精品久久久久久国产精华液| 欧美日韩一区成人| 国产精品99久久久| 亚洲精品日日夜夜| 日韩欧美中文一区二区| 99这里只有精品| 国产精品毛片a∨一区二区三区| 国产一区欧美日韩| 亚洲免费视频成人| 精品日韩一区二区三区免费视频| 成人激情免费网站| 婷婷综合另类小说色区| 欧美激情在线看| 777午夜精品免费视频| 国产.精品.日韩.另类.中文.在线.播放| 亚洲激情校园春色| 国产亚洲精品免费| 51午夜精品国产| 色偷偷一区二区三区| 国产一区二区三区免费观看| 亚洲一区二区三区不卡国产欧美| 久久在线观看免费| 欧美日韩黄视频| 99国产精品一区| 一区二区视频在线| 国产免费成人在线视频| www.亚洲精品| 紧缚奴在线一区二区三区| 一区av在线播放| 国产精品五月天| 日韩美女天天操| 欧美日本在线播放| 91久久精品网| 成人小视频免费在线观看| 久久电影网站中文字幕| 久久久久一区二区三区四区| 成人中文字幕合集| 精品无人码麻豆乱码1区2区 | 中文字幕制服丝袜一区二区三区 | 日韩天堂在线观看| 欧美色综合网站| 麻豆一区二区三| 天堂av在线一区| 亚洲一区在线电影| 亚洲美女屁股眼交| 亚洲图片另类小说| 中文字幕一区二区三区在线播放 | 国产中文字幕精品| 日韩av网站免费在线| 欧美极品美女视频| 精品乱人伦一区二区三区| 欧美一区二区黄| 7777精品伊人久久久大香线蕉最新版| 欧美中文字幕不卡| 国产一区二区久久| 国产精品一区二区久激情瑜伽| 精品一区二区国语对白| 国产中文一区二区三区| 国产成人亚洲精品青草天美| 国产精品一区二区免费不卡| 国产丶欧美丶日本不卡视频| 国产精品白丝jk黑袜喷水| 大桥未久av一区二区三区中文| 成人午夜电影小说| 91视频国产资源| 欧美在线播放高清精品| 欧美色视频在线| 欧美一级专区免费大片| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 日韩精品午夜视频| 裸体健美xxxx欧美裸体表演| 国产原创一区二区三区| 成人晚上爱看视频| 色综合欧美在线视频区| 欧美日韩国产综合草草| 精品福利一二区| 国产精品麻豆99久久久久久| 一区二区三区小说| 男女性色大片免费观看一区二区| 亚洲三级久久久| 五月婷婷另类国产| 亚洲精品自拍动漫在线| 久久激五月天综合精品| 欧美日韩国产高清一区二区 | 91在线播放网址| 国产亚洲女人久久久久毛片| 日本网站在线观看一区二区三区 | 欧美一区二区三区视频免费| 日韩美女精品在线| 成人高清在线视频| 国产亚洲欧美色| 国产精品综合av一区二区国产馆| 欧美顶级少妇做爰| 国产色产综合产在线视频| 久久99国产精品久久99| 中文在线免费一区三区高中清不卡| 天堂精品中文字幕在线| 欧美午夜精品久久久| 亚洲老司机在线| 91视视频在线观看入口直接观看www | 日韩在线一区二区三区| 欧美性猛片aaaaaaa做受| 亚洲精品国产精品乱码不99 | 欧美在线一二三四区| 亚洲男人天堂av网| 91免费看`日韩一区二区| 成人欧美一区二区三区黑人麻豆| 成人av在线播放网站| 中文字幕在线视频一区| proumb性欧美在线观看| 成人欧美一区二区三区在线播放| 99r国产精品| 一区二区三区小说| 欧美日韩综合不卡| 日韩精品色哟哟| 日韩午夜激情电影| 国产综合色在线| 国产精品麻豆网站| 色香蕉久久蜜桃| 丝袜美腿高跟呻吟高潮一区| 欧美一区二区三区影视| 国产麻豆视频一区二区| 国产蜜臀av在线一区二区三区| 97成人超碰视| 亚洲国产欧美另类丝袜| 欧美一级在线免费| 国产成人精品免费在线| 亚洲三级视频在线观看| 欧美精品一二三| 国内外成人在线| 中文字幕一区二区三区蜜月| 欧美午夜精品电影| 久久精品国产成人一区二区三区| 国产亚洲制服色| 欧美性受xxxx黑人xyx性爽| 青娱乐精品视频在线| 日本一区二区三区免费乱视频| 色婷婷亚洲一区二区三区|