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

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

?? os_cpu_c.c

?? UCOSII在mcs12dg128上的移植
?? 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 "..\Sources\UCOS2\CONFIG_UCOS\INCLUDES.h"
#include "..\sources\application\Include.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.  
*           
**********************************************************************************************************************
*/

OS_STK *OSTaskStkInit (void (*task)(void *pd), void *p_arg, OS_STK *ptos, INT16U opt)
{
    INT16U *wstk;
    INT8U  *bstk;
 
    opt     = opt;                           /* 'opt' is not used, prevent warning                     */
    wstk    = (INT16U *)ptos;                /* Load stack pointer                                     */
    *--wstk = (INT16U)p_arg;                 /* Simulate call to function with argument                */
    *--wstk = (INT16U)(((INT32U)task) >> 8); /* Return address.  Format: PCH:PCL:PPAGE (cut out PPage) */
    *--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 = (0xC0);                        /* CCR Register (Disable STOP instruction and XIRQ)       */
    *--bstk = (INT8U)task;                   /* Save the PPAGE register                                */
    return ((OS_STK *)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) 
{
__asm 
	{
    tpa                         // copy the value of CCR to the register A
    staa   os_cpu_sr 
    sei                                // Disable interrupts
	}

}

void OSCPURestoreSR(OS_CPU_SR os_cpu_sr) 
{
__asm 
	{
    ldaa os_cpu_sr

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩三级视频中文字幕| 99re亚洲国产精品| 国产精品欧美久久久久一区二区| 欧美性生交片4| 色综合久久99| 成人动漫一区二区在线| 国产一区二区三区蝌蚪| 日日欢夜夜爽一区| 视频一区欧美精品| 色老综合老女人久久久| 欧美性猛交xxxxxx富婆| 中文一区二区在线观看| 国产精品美女www爽爽爽| 男人操女人的视频在线观看欧美| 日韩精品91亚洲二区在线观看| 成人一区二区三区视频在线观看| 盗摄精品av一区二区三区| 日韩精品中文字幕一区二区三区 | 一区二区三区色| 日韩美女啊v在线免费观看| 国产精品久久777777| 一区二区三区四区av| 成人黄色国产精品网站大全在线免费观看| 亚洲视频在线一区| 国产一区福利在线| 日韩精品一区二区三区四区| 亚洲18影院在线观看| 免费欧美高清视频| 在线91免费看| 久久久久九九视频| 国产精品福利av| 国产精品资源网| 欧美日韩一区二区三区视频| 日韩一区二区免费电影| 日韩成人dvd| 99久久伊人网影院| 欧美日韩午夜影院| 亚洲一区中文在线| 国产成人亚洲综合a∨猫咪| 色综合久久九月婷婷色综合| 亚洲欧美日韩国产中文在线| 久久99国产精品麻豆| 99视频超级精品| 亚洲欧美经典视频| 欧美日韩国产三级| 自拍偷拍国产精品| 色激情天天射综合网| 亚洲专区一二三| 欧美精品乱码久久久久久| 国产精品美女视频| 色老汉一区二区三区| 丝袜诱惑制服诱惑色一区在线观看 | 亚洲五码中文字幕| 成人午夜在线视频| 亚洲欧美日韩一区二区 | 一区二区欧美在线观看| 欧美日韩国产a| 狠狠色综合播放一区二区| 欧美日韩美女一区二区| 久久成人免费日本黄色| 欧美三级三级三级| 韩日欧美一区二区三区| 日韩美女视频一区二区| 欧美丰满美乳xxx高潮www| 国产伦精品一区二区三区视频青涩 | 久久久亚洲精品一区二区三区| 成人性视频网站| 亚洲一区二区影院| 欧美精品一区二区三区在线播放| 国产日本一区二区| 国内精品久久久久影院一蜜桃| 国产女人水真多18毛片18精品视频| 一本色道综合亚洲| 国产在线国偷精品免费看| 亚洲六月丁香色婷婷综合久久 | 久久久久国产精品厨房| 在线免费观看一区| 亚洲人午夜精品天堂一二香蕉| 精品视频一区三区九区| 国产一区二区三区在线观看精品 | 久久精品欧美日韩精品| 狠狠色狠狠色合久久伊人| 一区二区三区四区亚洲| 欧美成人三级在线| 美美哒免费高清在线观看视频一区二区| 欧美人动与zoxxxx乱| 成人午夜在线播放| 免费成人在线播放| 亚洲国产wwwccc36天堂| 国产精品美女一区二区在线观看| 欧美一区二区免费| 国产麻豆成人精品| 日本不卡一区二区三区高清视频| 亚洲欧洲精品一区二区三区 | 亚洲精品免费播放| 欧美激情一区二区三区全黄| 日韩精品中文字幕在线一区| 欧美三级日韩三级| 色婷婷精品久久二区二区蜜臂av | 欧美电影在线免费观看| 91蜜桃在线观看| 午夜伊人狠狠久久| 欧美精品第1页| 色94色欧美sute亚洲线路二| 国产盗摄女厕一区二区三区| 日韩av中文字幕一区二区三区| 亚洲激情五月婷婷| 亚洲视频图片小说| 中文字幕一区在线观看视频| 日韩午夜精品视频| 日韩欧美一区二区久久婷婷| 欧美日韩电影在线| 4438x成人网最大色成网站| 欧美三级电影在线看| 色猫猫国产区一区二在线视频| 成人毛片老司机大片| 豆国产96在线|亚洲| 亚洲一区二区影院| 亚洲成人中文在线| 亚洲1区2区3区4区| 日本欧美在线观看| 蜜桃精品视频在线观看| 老司机精品视频一区二区三区| 日韩国产欧美在线观看| 久久机这里只有精品| 国产成人综合网| av在线不卡免费看| 欧洲精品一区二区三区在线观看| 欧美丝袜丝交足nylons图片| 欧美人体做爰大胆视频| 精品国产百合女同互慰| 久久久精品中文字幕麻豆发布| 亚洲国产精品精华液ab| 亚洲精品伦理在线| 日韩成人伦理电影在线观看| 久久 天天综合| 高清久久久久久| 欧美影院一区二区| 欧美mv和日韩mv国产网站| 国产欧美一区二区精品久导航| 亚洲乱码国产乱码精品精可以看| 日韩精品国产欧美| 国内精品不卡在线| 91网站最新地址| 欧美精品vⅰdeose4hd| 久久九九久久九九| 一区二区三区在线视频观看58| 日韩精品欧美精品| av在线不卡网| 日韩精品一区二区三区在线| 亚洲欧洲日韩一区二区三区| 五月天亚洲婷婷| 不卡的电影网站| 日韩亚洲欧美综合| 亚洲图片激情小说| 麻豆精品一区二区三区| 色综合久久久久综合99| 精品理论电影在线观看| 亚洲免费观看高清| 国产一区在线观看麻豆| 欧美在线一二三| 中文字幕精品一区二区三区精品| 偷窥国产亚洲免费视频 | 狠狠狠色丁香婷婷综合激情| 色婷婷综合五月| 久久视频一区二区| 国产免费久久精品| 日韩高清不卡一区| 99国产精品国产精品毛片| 日韩欧美123| 亚洲午夜一区二区| 99免费精品在线| 国产色婷婷亚洲99精品小说| 免费不卡在线视频| 欧美亚洲国产bt| 亚洲欧洲精品一区二区三区不卡| 精品一区二区成人精品| 欧美欧美欧美欧美首页| 亚洲欧美另类久久久精品2019| 国产大陆a不卡| 欧美变态口味重另类| 日韩制服丝袜先锋影音| 欧美日精品一区视频| 亚洲精品视频免费观看| 国产suv精品一区二区6| 久久久99久久精品欧美| 久久99在线观看| 日韩精品在线一区| 日韩电影在线免费| 9191成人精品久久| 亚洲成人免费在线观看| 欧美午夜精品久久久久久孕妇 | 久久综合五月天婷婷伊人| 日韩高清在线一区| 欧美一区二区私人影院日本| 午夜激情综合网| 欧美精品久久99| 毛片av一区二区| 精品国产一区二区三区四区四| 日本不卡视频一二三区|