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

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

?? os_cpu_c.c

?? 這是利用RTOS去實現機械系統
?? 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)
{ 
    tickISR();
}
#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产最新精品免费| 亚洲一区二区三区三| 精品一区二区三区av| 日韩欧美一区二区免费| 韩国一区二区三区| 中文字幕不卡的av| 色综合婷婷久久| 天天影视网天天综合色在线播放| 欧美三级日韩在线| 久久精品国产亚洲aⅴ| 久久久久久久久蜜桃| 99久久国产综合精品色伊| 亚洲另类一区二区| 69堂成人精品免费视频| 国产乱国产乱300精品| 中文字幕人成不卡一区| 欧美日韩精品系列| 国产一区二区不卡| 悠悠色在线精品| 日韩免费性生活视频播放| 国产乱码精品一品二品| 亚洲精选一二三| 欧美一级高清片在线观看| 国产精品一卡二| 亚洲综合久久久久| 精品动漫一区二区三区在线观看| 国产99久久久国产精品潘金| 一区二区三区四区在线| 精品sm在线观看| 91丨九色丨国产丨porny| 日本va欧美va精品| 中文字幕中文字幕一区| 91麻豆精品国产91久久久使用方法| 国产精品18久久久| 亚欧色一区w666天堂| 日本一区二区三区在线观看| 欧美性生交片4| 国产永久精品大片wwwapp | 678五月天丁香亚洲综合网| 久草这里只有精品视频| 亚洲精品国产一区二区三区四区在线 | 香蕉久久夜色精品国产使用方法 | 欧美岛国在线观看| 91看片淫黄大片一级| 国产制服丝袜一区| 亚洲成人手机在线| 一区在线中文字幕| 精品日韩欧美一区二区| 精品视频免费看| 菠萝蜜视频在线观看一区| 毛片基地黄久久久久久天堂| 亚洲午夜av在线| 国产精品成人一区二区艾草 | 日韩欧美一级特黄在线播放| 在线精品视频一区二区| 国产成人午夜精品影院观看视频 | 欧美日韩三级视频| 成人精品一区二区三区中文字幕| 日韩国产高清影视| 一级精品视频在线观看宜春院 | 极品美女销魂一区二区三区| 亚洲国产日韩av| 玉米视频成人免费看| 国产欧美日韩视频在线观看| 26uuu久久综合| 日韩三区在线观看| 67194成人在线观看| 欧美色欧美亚洲另类二区| 99国产精品久久久| 成人国产亚洲欧美成人综合网| 国产麻豆91精品| 国产一区二区免费视频| 黄色日韩三级电影| 狠狠色综合播放一区二区| 在线观看网站黄不卡| 成人av影视在线观看| av午夜精品一区二区三区| 99国产精品99久久久久久| eeuss影院一区二区三区| 成人一区二区三区视频在线观看| 国产成人夜色高潮福利影视| 国产精品一区二区男女羞羞无遮挡 | 激情五月婷婷综合网| 久久er99精品| 国产毛片一区二区| 成人手机电影网| 99国产精品国产精品久久| 色偷偷88欧美精品久久久| 99精品视频在线播放观看| 一本到一区二区三区| 在线视频你懂得一区| 欧美精品第一页| 91精品国产全国免费观看| 日韩精品一区二区三区中文精品| 精品少妇一区二区三区免费观看 | 国产精品乱码一区二区三区软件| 国产喷白浆一区二区三区| 国产精品美女视频| 亚洲日本欧美天堂| 亚洲mv大片欧洲mv大片精品| 天堂久久久久va久久久久| 精品亚洲aⅴ乱码一区二区三区| 国产一区二区看久久| 色综合网站在线| 欧美一级精品大片| 欧美国产一区在线| 亚洲午夜精品在线| 久久国产精品99精品国产| 成人黄色在线视频| 欧美日韩精品一区二区天天拍小说| 欧美大黄免费观看| 中文字幕一区二区三区在线播放| 亚洲一区二区视频在线| 另类专区欧美蜜桃臀第一页| 成人精品视频一区二区三区| 在线欧美日韩精品| 精品福利一区二区三区| 一区二区三区四区不卡视频| 麻豆国产精品视频| 91在线高清观看| 日韩欧美你懂的| 伊人性伊人情综合网| 国内精品国产成人| 欧美日韩中文字幕一区二区| 精品久久久久久久久久久久久久久久久 | 国产女人18水真多18精品一级做| 一区二区三区欧美视频| 久久国产剧场电影| 在线观看日韩电影| 久久精品国内一区二区三区| 99re成人精品视频| 日韩女同互慰一区二区| 一区二区三区中文字幕精品精品| 久久99久久99| 欧美区在线观看| ...xxx性欧美| 国产在线精品不卡| 欧美人狂配大交3d怪物一区 | 中文字幕字幕中文在线中不卡视频| 五月天中文字幕一区二区| av综合在线播放| 国产亚洲婷婷免费| 日韩影院在线观看| 91丝袜高跟美女视频| 日本一区二区三区高清不卡| 美脚の诱脚舐め脚责91 | 国产精品成人一区二区三区夜夜夜| 美女mm1313爽爽久久久蜜臀| 欧美日韩日本视频| 亚洲女人的天堂| 成人激情免费网站| 久久久午夜电影| 精品一区二区三区在线播放| 欧美人与z0zoxxxx视频| 亚洲国产日韩综合久久精品| 91色porny在线视频| 国产精品美女一区二区| 成人一道本在线| 国产视频在线观看一区二区三区 | 欧美日韩一级二级| 亚洲精品国久久99热| 91蜜桃免费观看视频| 一区免费观看视频| av色综合久久天堂av综合| 国产精品国产三级国产aⅴ无密码| 国产久卡久卡久卡久卡视频精品| 精品入口麻豆88视频| 久久99国产精品久久| 精品国产一区二区精华| 激情另类小说区图片区视频区| 精品福利一二区| 国产一区二区三区免费| 国产午夜精品福利| 成人午夜电影小说| 亚洲素人一区二区| 91亚洲大成网污www| 一区二区三区不卡视频| 欧美日韩在线播| 日本女人一区二区三区| 日韩欧美黄色影院| 国产一区二区电影| 欧美国产国产综合| 色综合色狠狠综合色| 亚洲va国产天堂va久久en| 欧美伦理视频网站| 精品一区二区在线观看| 国产欧美va欧美不卡在线| 91视视频在线观看入口直接观看www| 国产精品成人免费精品自在线观看| 一本大道久久a久久综合| 水野朝阳av一区二区三区| 91麻豆精品国产91| 国产一区二区主播在线| 国产精品久久毛片av大全日韩| 色哟哟一区二区三区| 男男gaygay亚洲| 国产精品电影一区二区三区| 欧美视频三区在线播放| 激情深爱一区二区| 亚洲品质自拍视频网站|