亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
国产成人aaa| 91精品久久久久久久91蜜桃| 欧美午夜理伦三级在线观看| 精品国产露脸精彩对白| 亚洲精品一二三| 丁香五精品蜜臀久久久久99网站| 欧美性色综合网| 国产精品久久久久桃色tv| 日日摸夜夜添夜夜添国产精品| aaa亚洲精品| 久久综合久久综合亚洲| 日日夜夜免费精品| 色丁香久综合在线久综合在线观看| 亚洲精品一区二区三区蜜桃下载| 亚洲va欧美va人人爽| 99re热这里只有精品免费视频| 欧美sm美女调教| 免费日本视频一区| 91传媒视频在线播放| 国产精品久久精品日日| 国产一区在线观看视频| 日韩精品自拍偷拍| 日韩高清不卡一区二区| 欧美日韩视频第一区| 一区二区三区四区在线| 99视频精品免费视频| 国产精品午夜春色av| 国产 欧美在线| 久久精品一区二区三区av| 国产一区二区三区美女| 精品国产亚洲在线| 精品一区二区在线观看| 精品国内二区三区| 国产一区二区毛片| 国产三级一区二区| 成人黄色软件下载| 中文字幕一区二区日韩精品绯色| 成人国产视频在线观看| 国产精品久久一卡二卡| 国产成人精品一区二| 欧美激情在线看| 成人免费毛片嘿嘿连载视频| 综合电影一区二区三区| 在线观看亚洲a| 日韩av不卡在线观看| 91精品国产欧美一区二区18| 麻豆91精品91久久久的内涵| 精品国产一区二区三区不卡 | 国产精品资源网| 国产片一区二区三区| 懂色av中文字幕一区二区三区| 国产精品乱码妇女bbbb| 一本色道久久综合亚洲aⅴ蜜桃| 亚洲国产日韩a在线播放| 91精品国产综合久久蜜臀| 久久成人18免费观看| 国产片一区二区三区| 色婷婷国产精品| 免费高清视频精品| 国产精品三级久久久久三级| 在线一区二区三区四区| 免费成人av在线| 国产精品久久久99| 在线播放亚洲一区| 懂色中文一区二区在线播放| 亚洲黄色在线视频| 精品国产伦一区二区三区观看方式 | 亚洲国产美女搞黄色| 欧美成人r级一区二区三区| 国产不卡高清在线观看视频| 亚洲一区在线电影| 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 高清成人在线观看| 亚洲高清不卡在线| 中文字幕av资源一区| 精品视频在线免费观看| 国产999精品久久久久久| 亚洲国产cao| 欧美国产日产图区| 欧美一区二区三区啪啪| 91在线国产观看| 黄色精品一二区| 午夜欧美2019年伦理 | 欧美一级黄色片| 色综合咪咪久久| 韩国一区二区视频| 丝袜美腿亚洲色图| 一区二区三区欧美亚洲| 欧美激情综合五月色丁香| 精品黑人一区二区三区久久 | 色噜噜夜夜夜综合网| 国产成人亚洲综合色影视 | 香港成人在线视频| 亚洲欧美精品午睡沙发| 国产片一区二区| 久久久国产精品麻豆| 欧美成人精品1314www| 在线91免费看| 欧美日韩国产bt| eeuss鲁一区二区三区| 韩国av一区二区三区四区| 午夜精品久久久久久久蜜桃app| 欧美一区二区人人喊爽| 91麻豆免费视频| 国产在线麻豆精品观看| 一区二区三区国产| 一区二区国产盗摄色噜噜| 国产亚洲欧美色| 精品国产一区二区国模嫣然| 日韩一区二区视频在线观看| 在线观看免费一区| www.色精品| 国产激情一区二区三区| 久久精品av麻豆的观看方式| 亚洲视频中文字幕| 日本一区二区三区电影| 欧美成人一级视频| 3atv在线一区二区三区| 在线一区二区三区做爰视频网站| 国产精品亚洲第一| 国产99久久久国产精品免费看| 久久国产精品一区二区| 免费高清不卡av| 蜜桃久久精品一区二区| 免费一级片91| 日韩1区2区日韩1区2区| 五月天中文字幕一区二区| 亚洲午夜精品久久久久久久久| 午夜精品视频一区| 免费成人你懂的| 激情综合五月婷婷| 精品一区二区三区免费| 久草在线在线精品观看| 国产盗摄女厕一区二区三区| 国产一区二区久久| 国产福利一区在线| 国产成人一区在线| 国产91露脸合集magnet| 盗摄精品av一区二区三区| 在线影院国内精品| 欧美片网站yy| 日韩免费电影网站| 精品精品国产高清a毛片牛牛 | 欧美精品九九99久久| 欧美福利一区二区| 日韩欧美国产午夜精品| 26uuu欧美| 中文在线免费一区三区高中清不卡| 亚洲欧美激情视频在线观看一区二区三区| 国产精品乱码人人做人人爱| 亚洲欧洲精品成人久久奇米网| 一区二区三区日韩精品| 奇米精品一区二区三区四区| 日本成人在线看| 一本久久a久久精品亚洲| 欧美午夜精品一区二区蜜桃| 欧美一级理论片| 欧美激情资源网| 国产精品久久久久久亚洲毛片 | 国产精品乱码一区二区三区软件 | 成人av在线影院| 成av人片一区二区| 日韩欧美久久久| 亚洲视频你懂的| 免费不卡在线观看| 国产成a人亚洲| 色欧美88888久久久久久影院| 欧美成人在线直播| 1024精品合集| 久久精品国产亚洲高清剧情介绍 | 菠萝蜜视频在线观看一区| 欧美日韩国产大片| 国产三级欧美三级日产三级99| 五月婷婷久久综合| 色婷婷综合中文久久一本| 久久久精品综合| 极品瑜伽女神91| 538在线一区二区精品国产| 亚洲狠狠丁香婷婷综合久久久| 国产成人精品网址| 日韩精品综合一本久道在线视频| 亚洲一区二区三区在线播放| av不卡在线观看| 日韩亚洲电影在线| 亚洲国产精品人人做人人爽| 精品一二三四在线| 欧美日韩国产系列| 国产精品久久久久7777按摩| 美女免费视频一区二区| 欧美午夜精品久久久久久超碰| 欧美一卡2卡三卡4卡5免费| 亚洲另类中文字| www..com久久爱| 欧美激情中文不卡| 成人精品国产一区二区4080| 精品少妇一区二区三区日产乱码| 亚洲国产wwwccc36天堂| 91福利国产精品| 婷婷一区二区三区| 在线观看欧美黄色|