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

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

?? os_cpu_c.c

?? ucos-II 在 mc9s12dp256的移植 codewarrior(freescale)
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*
*********************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*
*                          (c) Copyright 1992-2003, Jean J. Labrosse, Weston, FL
*                                           All Rights Reserved
*                                      MC9S12DP256 Specific code
*                                       (MetroWerks C/C++ V4.2)
*
*
* File         : OS_CPU_C.C
* By   : Jean J. Labrosse
* Ported to MC9S12DP256 by Abderrahmane Assal
*********************************************************************************************************
*/

#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)    : 1) XIRQ interrupts are disabled when your task starts executing. You can change this by 
*                 clearing BIT6 in the CCR.
*              2) The STOP instruction is disabled when your task starts executing.  You can change this
*                 by clearing BIT7 in the CCR.
*              3) The other interrupts (i.e. maskable interrupts) are enabled when your task starts
*                 executing.  You can change this by setting BIT4 in the CCR.
*              4) You can change pass the above options in the 'opt' argument.  You MUST only use the
*                 upper 8 bits of 'opt' because the lower bits are reserved by uC/OS-II.  If you make
*                 changes to the code below, you will need to ensure that it doesn't affect the behaviour
*                 of OSTaskIdle() and OSTaskStat().
*              5) Registers are initialized to make them easy to differentiate with a debugger.
*              6) Tasks do not have to be in NON-PAGED memory.That is why I added an extra byte in every task's 
*				  stack to save the PPAGE register that locate the memory page where the task is located. If a 
*                 context switch occurs, the proper page will be saved/restored by uC/OS-II.  This done automatically
*                 by the hardware provided that we add the option -CpPPAGE=0x30 as a compiler argument.  
*           
**********************************************************************************************************************
*/

void *OSTaskStkInit (void (*task)(void *pd), void *pdata, void *ptos, INT16U opt)
{
    INT16U *wstk;
    INT8U  *bstk;
	INT8U regPage;						/* regPage is used to save the PAGE register                   */
    INT16U *OffsetAddress;
    opt     = opt;                     /* 'opt' is not used, prevent warning                           */
    wstk    = (INT16U *)ptos;          /* Load stack pointer                                           */
    *--wstk = (INT16U)pdata;           /* Simulate call to function with argument                      */
	OffsetAddress = (INT16U*)&task;
	regPage = (INT8U)task;
    *--wstk = (INT16U)*OffsetAddress;
    *--wstk = (INT16U)*OffsetAddress;            /* Put pointer to task   on top of stack                        */

    *--wstk = (INT16U)0x2222;          /* Y Register                                                   */
    *--wstk = (INT16U)0x1111;          /* X Register                                                   */
    *--wstk = (INT16U)0xBBAA;          /* D Register                                                   */
    bstk    = (INT8U *)wstk;           /* Convert WORD ptr to BYTE ptr to set CCR                      */
    *--bstk = 0x80;                    /* CCR Register (Disable STOP instruction)                      */
    #if defined( __BANKED__) || defined(__LARGE__)
    *--bstk = regPage;  			   /* Save the PPAGE register in case of banked memory model (see note 6)      */                   
    #endif                  
            return ((void *)bstk);             /* Return pointer to new top-of-stack                           */
}

/*$PAGE*/

/*
*********************************************************************************************************
*                                       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)
{
asm stop;
}
#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

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



/********************************************************************************************************
;                                  SAVE THE CCR AND DISABLE INTERRUPTS
;                                                  &
;                                              RESTORE CCR
;
; Description : These function implements OS_CRITICAL_METHOD #3 
;
; Arguments   : The function prototypes for the two functions are:
;               1) OS_CPU_SR  OSCPUSaveSR(void)
;                             where OS_CPU_SR is the contents of the CCR register prior to disabling
;                             interrupts.
;               2) void       OSCPURestoreSR(OS_CPU_SR os_cpu_sr);
;                             'os_cpu_sr' the the value of the CCR to restore.
;
; Note(s)     : 1) It's assumed that the compiler uses the B register to pass a single 8-bit argument
;                  to and from an assembly language function.
;********************************************************************************************************/
void OSCPUSaveSR(OS_CPU_SR os_cpu_sr) 
{

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美影视一区在线| 欧美日韩激情一区二区| 色欧美片视频在线观看 | 日韩午夜激情电影| 日韩欧美123| 亚洲国产成人自拍| 亚洲va天堂va国产va久| 亚洲综合偷拍欧美一区色| 老司机免费视频一区二区三区| 丰满亚洲少妇av| 欧美精品 日韩| 中文字幕亚洲一区二区av在线| 亚洲va国产va欧美va观看| 日本va欧美va精品发布| 不卡的av电影| 日韩欧美另类在线| 亚洲精品精品亚洲| 国产九色sp调教91| 欧美三级日韩三级| 国产精品二三区| 久久99国产乱子伦精品免费| 91网站最新地址| 久久精品一区二区三区不卡 | 欧美一区二区黄色| 国产精品久久久久久亚洲伦| 免费欧美高清视频| 欧美亚一区二区| 国产精品视频一区二区三区不卡| 免费高清成人在线| 欧美性色欧美a在线播放| 国产欧美日韩三级| 蜜桃视频第一区免费观看| 91麻豆国产香蕉久久精品| 欧美国产日韩在线观看| 国产一区欧美二区| 精品盗摄一区二区三区| 一区二区三区影院| 色综合色狠狠综合色| 日本一区二区成人在线| 国产一区999| 欧美精品一区二区三区在线播放| 午夜av区久久| 欧美少妇bbb| 亚洲va欧美va人人爽| 欧美专区日韩专区| 国产精品色在线观看| 国产成人av电影免费在线观看| 91精品国产欧美一区二区18| 污片在线观看一区二区| 欧美日本在线播放| 天天爽夜夜爽夜夜爽精品视频| 色婷婷久久99综合精品jk白丝| 亚洲人成网站在线| 91在线观看污| 一区二区三区91| 欧美性猛交一区二区三区精品| 亚洲制服丝袜在线| 欧美日韩久久久一区| 亚洲在线成人精品| 欧美日韩国产一区二区三区地区| 性做久久久久久免费观看| 欧美日韩高清在线| 久久国产尿小便嘘嘘尿| 欧美一级欧美一级在线播放| 免费视频最近日韩| 精品成人私密视频| 成人免费视频一区二区| 亚洲欧美精品午睡沙发| 在线精品国精品国产尤物884a| 亚洲午夜精品久久久久久久久| 欧美人xxxx| 激情丁香综合五月| 综合电影一区二区三区 | 精品1区2区3区| 亚洲国产精品久久久久秋霞影院| 6080国产精品一区二区| 久久成人免费电影| 日本一区二区久久| 欧美在线三级电影| 秋霞午夜鲁丝一区二区老狼| 国产丝袜欧美中文另类| 91免费看片在线观看| 日产欧产美韩系列久久99| 中文字幕免费观看一区| 成人精品鲁一区一区二区| 亚洲一区二区高清| 欧美精品一区二区三区蜜桃视频| 99视频热这里只有精品免费| 亚洲欧美综合另类在线卡通| 欧美丰满少妇xxxxx高潮对白| 国产在线观看一区二区| 椎名由奈av一区二区三区| 欧美乱妇15p| jlzzjlzz欧美大全| 另类小说欧美激情| 一区二区三区在线观看国产 | 成人丝袜高跟foot| 午夜精品久久久久影视| 亚洲国产成人在线| 日韩一区二区高清| 91色视频在线| 精品动漫一区二区三区在线观看| 日本视频中文字幕一区二区三区| 一区二区三区精品视频在线| 欧美极品aⅴ影院| 久久综合色综合88| 精品国产伦理网| 精品美女一区二区三区| 制服丝袜亚洲精品中文字幕| 欧美精品一二三区| 7777精品伊人久久久大香线蕉经典版下载 | 日本不卡的三区四区五区| 亚洲第一主播视频| 婷婷丁香激情综合| 日产国产高清一区二区三区 | 3d动漫精品啪啪一区二区竹菊| 在线观看日韩高清av| 色综合视频在线观看| 欧美性受xxxx| 8v天堂国产在线一区二区| 欧美精品 国产精品| 欧美一区二区三区视频免费| 91精品国产色综合久久| 日韩亚洲欧美中文三级| 欧美成人性战久久| 国产亚洲精品bt天堂精选| 国产精品欧美经典| 亚洲少妇最新在线视频| 亚洲一区二区三区四区在线观看 | 欧美日韩电影一区| 日韩一区二区三区观看| 久久综合九色欧美综合狠狠| 国产欧美日韩中文久久| 亚洲六月丁香色婷婷综合久久 | 韩国欧美国产1区| 成人污污视频在线观看| 色www精品视频在线观看| 欧美日韩成人高清| 久久久国产精华| 亚洲免费在线看| 日本在线不卡视频一二三区| 国产中文字幕一区| 99视频一区二区| 91精品国产综合久久精品性色 | 欧美一级片免费看| 日本一区二区视频在线| 亚洲影视在线播放| 狠狠色狠狠色综合| 一本色道久久综合狠狠躁的推荐| 欧美日本乱大交xxxxx| 久久综合狠狠综合久久综合88| 国产精品久久久久久久久免费桃花| 亚洲国产精品一区二区www| 国产精品主播直播| 欧美日韩国产首页| 国产精品情趣视频| 日韩av一区二区在线影视| 国产69精品久久777的优势| 欧美性三三影院| 国产精品拍天天在线| 蜜乳av一区二区| 色综合天天性综合| 欧美精品一区二区三区一线天视频 | 亚洲国产精品尤物yw在线观看| 极品销魂美女一区二区三区| 在线视频中文字幕一区二区| 久久久久久久电影| 日本在线播放一区二区三区| 91无套直看片红桃| 久久九九国产精品| 日韩av电影天堂| 91国产成人在线| 1024成人网| 国产精品888| 精品久久久三级丝袜| 午夜视黄欧洲亚洲| 91麻豆免费在线观看| 亚洲国产经典视频| 国内精品伊人久久久久av一坑| 欧美视频完全免费看| 中文字幕一区二区三区在线播放| 狠狠色狠狠色综合| 欧美一区二区三区公司| 亚洲国产精品一区二区www| av成人动漫在线观看| 国产亚洲va综合人人澡精品| 加勒比av一区二区| 欧美一区三区四区| 日韩精品成人一区二区三区| 欧美色成人综合| 亚洲国产日产av| 欧美视频在线观看一区二区| 亚洲美女屁股眼交| 色综合一区二区| 亚洲欧美激情一区二区| 色婷婷国产精品综合在线观看| 中文成人综合网| 99精品欧美一区二区蜜桃免费 | 日本亚洲免费观看| 欧美精品一二三四|