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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? os_cpu_c.c

?? UCOSII在mcs12dg128上的移植
?? C
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
/*
*********************************************************************************************************
*                                                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

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久国产三级精品| 成人精品在线视频观看| 亚洲一区二区不卡免费| 一区二区在线观看av| 亚洲色图欧洲色图| 一区二区三区中文在线观看| 成人免费在线视频| 亚洲欧洲性图库| 一区二区三区在线观看欧美| 亚洲午夜在线电影| 石原莉奈在线亚洲三区| 日韩二区三区四区| 久久99精品久久久久| 韩国女主播成人在线| 国内精品在线播放| 成人爱爱电影网址| 91久久精品一区二区三区| 在线观看一区日韩| 欧美一级在线免费| 久久久五月婷婷| 国产精品久久久久精k8| 一片黄亚洲嫩模| 图片区日韩欧美亚洲| 久久丁香综合五月国产三级网站| 国产自产高清不卡| 不卡一区在线观看| 欧美日韩国产另类一区| 欧美mv和日韩mv国产网站| 国产欧美日韩卡一| 一区二区三区四区乱视频| 日韩激情av在线| 国产又黄又大久久| 99久久久无码国产精品| 欧美日本一区二区三区| 精品国产99国产精品| 亚洲欧美自拍偷拍| 午夜精品一区二区三区电影天堂| 韩国视频一区二区| 91碰在线视频| 日韩一区二区电影| 中文字幕日本乱码精品影院| 午夜国产不卡在线观看视频| 国产精品99久久不卡二区| 91麻豆福利精品推荐| 日韩一区二区三区电影| 国产精品视频在线看| 成人黄色片在线观看| 欧美男男青年gay1069videost| 欧美精品一区二区蜜臀亚洲| 亚洲精品高清在线观看| 久久99精品国产麻豆婷婷| 99精品热视频| 精品乱码亚洲一区二区不卡| 亚洲男人天堂一区| 国产精品一卡二| 91福利国产成人精品照片| 精品入口麻豆88视频| 亚洲欧美国产三级| 国产精品1区二区.| 91精品国产欧美日韩| 日韩理论片一区二区| 国产一区二区三区不卡在线观看 | 精品制服美女丁香| 91色综合久久久久婷婷| 久久午夜老司机| 日韩成人免费电影| 日本道精品一区二区三区| 国产女同性恋一区二区| 久久国产剧场电影| 欧美三级一区二区| 亚洲色图视频网站| 高清免费成人av| 欧美精品一区二区三区久久久 | 99国产欧美另类久久久精品| 精品久久久久99| 日本成人在线视频网站| 欧美影院一区二区三区| 最新日韩av在线| 国产91露脸合集magnet | 亚洲毛片av在线| 国产a精品视频| 久久先锋资源网| 日韩中文字幕一区二区三区| 欧美在线|欧美| 亚洲欧美一区二区三区极速播放| 国产在线播放一区二区三区| 日韩一区二区三区在线观看| 亚洲成人av电影| 欧美又粗又大又爽| 一区二区在线观看免费 | 中文字幕欧美激情| 狂野欧美性猛交blacked| 欧美福利视频一区| 午夜精品久久一牛影视| 欧美日韩另类一区| 亚洲一区二区三区在线| 欧美影视一区在线| 亚洲一区二区视频在线| 欧美三级资源在线| 性久久久久久久久| 7878成人国产在线观看| 午夜精品久久久久久久99樱桃 | 高清视频一区二区| 国产精品看片你懂得| 国产成人夜色高潮福利影视| 国产日产欧美一区二区视频| 国产91丝袜在线播放0| 国产精品无遮挡| 91老师片黄在线观看| 亚洲欧美区自拍先锋| 欧美综合亚洲图片综合区| 亚洲电影一级黄| 日韩一区二区精品葵司在线 | 日韩精品一区二区三区四区| 激情偷乱视频一区二区三区| 久久久久久电影| 99热在这里有精品免费| 亚洲另类春色国产| 欧美久久久影院| 国模一区二区三区白浆| 国产精品欧美一级免费| 日本电影欧美片| 日本大胆欧美人术艺术动态| 久久网站最新地址| www.av精品| 亚洲综合在线第一页| 欧美日韩精品欧美日韩精品| 九一九一国产精品| 国产欧美一区二区三区在线看蜜臀| eeuss鲁片一区二区三区在线看| 亚洲精品免费在线| 91精品国产入口| 懂色av一区二区在线播放| 亚洲黄色小说网站| 日韩免费观看2025年上映的电影| 国产成人在线视频播放| 亚洲最新视频在线观看| 精品国产免费久久| gogo大胆日本视频一区| 日韩黄色片在线观看| 国产日韩av一区二区| 欧美网站大全在线观看| 美腿丝袜亚洲三区| 国产精品久久久久久福利一牛影视 | 一区二区久久久久久| 欧美一区二区在线播放| 成人性生交大片| 性做久久久久久免费观看欧美| 久久久久久免费毛片精品| 色天使久久综合网天天| 国内一区二区在线| 亚洲国产综合色| 久久久精品国产免大香伊| 欧美亚洲国产一卡| 国产精品1024| 视频一区视频二区中文| 国产精品久久99| 精品日产卡一卡二卡麻豆| 国产欧美综合在线观看第十页| 欧美在线观看视频在线| 国产ts人妖一区二区| 亚洲成a天堂v人片| 国产精品对白交换视频| 日韩欧美一区二区三区在线| 91传媒视频在线播放| 国产黄色精品网站| 免费人成精品欧美精品| 亚洲激情第一区| 中文欧美字幕免费| 日韩欧美精品三级| 欧洲生活片亚洲生活在线观看| 国产传媒久久文化传媒| 日韩av在线发布| 一区二区三区电影在线播| 国产目拍亚洲精品99久久精品| 日韩欧美激情一区| 欧美日韩综合一区| 91蝌蚪porny九色| 成人永久aaa| 狠狠色丁香婷婷综合久久片| 日韩av一二三| 五月天激情综合| 一区二区三区四区在线免费观看 | 国产精品系列在线| 久久―日本道色综合久久| 这里只有精品视频在线观看| 91电影在线观看| 91啪在线观看| 99久久久久久| 成人一道本在线| 国产mv日韩mv欧美| 国产精品69毛片高清亚洲| 毛片基地黄久久久久久天堂| 丝瓜av网站精品一区二区| 亚洲福利视频一区二区| 夜夜嗨av一区二区三区网页 | 久久精工是国产品牌吗| 日本亚洲三级在线| 日韩1区2区3区| 人人精品人人爱|