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

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

?? os_cpu_c.c

?? uCOSII V2.80 FOR arm IAR4.10 編譯器
?? C
字號:
/*
*********************************************************************************************************
*                                               uC/OS-II
*                                         The Real-Time Kernel
*
*                        (c) Copyright 1992-1998, Jean J. Labrosse, Plantation, FL
*                                          All Rights Reserved
*                        (c) Copyright ARM Limited 1999.  All rights reserved.
*
*                                          ARM Specific code
*
*
* File : OS_CPU_C.C
*********************************************************************************************************
*/

#define  OS_CPU_GLOBALS
#include "ucos_ii.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)    : 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!
*********************************************************************************************************
*/

#if 0
void OSStartHighRdy (void)
{
	OS_STK*	pstk;	//R4
	int	temp=0;		//R5
	OSTaskSwHook();
	pstk=OSTCBHighRdy->OSTCBStkPtr;
	asm("MOV	R5,SP");
	asm("LDMIA	SP!{R4}");
	asm("MOV	SP,R4");
 
    OSRunning = TRUE;
 
    //Restore all processor registers from the  task's stack;     
 
    //Execute a return from interrupt instruction;                           
 
}
 
void OSCtxSw(void)
 
{
 
    保存處理器寄存器;
 
    將當前任務的堆棧指針保存到當前任務的OS_TCB中:
 
        OSTCBCur->OSTCBStkPtr = Stack pointer;
 
    調用用戶定義的OSTaskSwHook();
 
    OSTCBCur  = OSTCBHighRdy;
 
    OSPrioCur = OSPrioHighRdy;
 
    得到需要恢復的任務的堆棧指針:
 
        Stack pointer = OSTCBHighRdy->OSTCBStkPtr;
 
    將所有處理器寄存器從新任務的堆棧中恢復出來;
 
    執行中斷返回指令;
 
}
 


void OSIntCtxSw(void)
 
{ 
	OSIntExit();

	OSIntCtxSw()過程中壓入堆棧的多余內容;

	將當前任務堆棧指針保存到當前任務的OS_TCB中:

	OSTCBCur->OSTCBStkPtr = 堆棧指針;

	調用用戶定義的OSTaskSwHook();

	OSTCBCur  = OSTCBHighRdy;

	OSPrioCur = OSPrioHighRdy;

	得到需要恢復的任務的堆棧指針:

	堆棧指針 = OSTCBHighRdy->OSTCBStkPtr;

	將所有處理器寄存器從新任務的堆棧中恢復出來;

	執行中斷返回指令;
 
}
 
void OSTickISR(void)
 
{
 
   保存處理器寄存器;
 
   調用OSIntEnter()或者直接將 OSIntNesting加1;
 
 
 
   調用OSTimeTick();
 
 
 
   調用OSIntExit();
 
   恢復處理器寄存器;
 
   執行中斷返回指令;
 
}
#endif

OS_STK       *OSTaskStkInit(void (*task)(void *p_arg), void *p_arg, OS_STK *ptos, INT16U opt)
//void *OSTaskStkInit (void (*task)(void *pd), void *pdata, void *ptos, INT16U opt)
{
	//unsigned int *stk;
	OS_STK* stk;

	opt    = opt;                           /* 'opt' is not used, prevent warning                      */
	stk    = (unsigned int *)ptos;          /* Load stack pointer                                      */

	/* build a context for the new task */
	//*--stk = (unsigned int) task;       /* pc */
	*stk = (unsigned int) task;       /* pc */	//the ptos is the empty stack 
	*--stk = (unsigned int) task;       /* lr */

	*--stk = 0;                         /* r12 */
	*--stk = 0;                         /* r11 */
	*--stk = 0;                         /* r10 */
	*--stk = 0;                         /* r9 */
	*--stk = 0;                         /* r8 */
	*--stk = 0;                         /* r7 */
	*--stk = 0;                         /* r6 */
	*--stk = 0;                         /* r5 */
	*--stk = 0;                         /* r4 */
	*--stk = 0;                         /* r3 */
	*--stk = 0;                         /* r2 */
	*--stk = 0;                         /* r1 */
	*--stk = (unsigned int) p_arg;      /* r0 */
	//*--stk = (SYS32MODE|0x0);			/* cpsr  IRQ, FIQ disable*/
	*--stk = (SYS32MODE|0x0);			/* spsr  IRQ, FIQ disable */


	return ((OS_STK*)stk);
}

/*$PAGE*/
#if OS_CPU_HOOKS_EN
/*
*********************************************************************************************************
*                                          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.
*********************************************************************************************************
*/
void OSTaskCreateHook (OS_TCB *ptcb)
{
    ptcb = ptcb;                       /* Prevent compiler warning                                     */
}


/*
*********************************************************************************************************
*                                           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.
*********************************************************************************************************
*/
void OSTaskDelHook (OS_TCB *ptcb)
{
    ptcb = ptcb;                       /* Prevent compiler warning                                     */
}

/*
*********************************************************************************************************
*                                           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).
*********************************************************************************************************
*/
void OSTaskSwHook (void)
{
}

/*
*********************************************************************************************************
*                                           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
*********************************************************************************************************
*/
void OSTaskStatHook (void)
{
}

/*
*********************************************************************************************************
*                                               TICK HOOK
*
* Description: This function is called every tick.
*
* Arguments  : none
*
* Note(s)    : 1) Interrupts may or may not be ENABLED during this call.
*********************************************************************************************************
*/

void OSTimeTickHook (void)
{
}

#if OS_VERSION >= 204
void OSInitHookBegin(void)
{
	
}

void OSInitHookEnd(void)
{
	
}
#endif

#if OS_VERSION >= 204
void OSTCBInitHook(OS_TCB *ptcb)
{
	
}
#endif

#if OS_VERSION >= 251
void OSTaskIdleHook(void)
{
	
}
#endif

#endif	//HOOK EN

#if 0
#define BUILD_DATE "Date: " __DATE__ "\n"

/*
 * Initialize an ARM Target board
 */
void
 ARMTargetInit(void)
{
    /* ---- Tell the world who we are ---------------------------------- */
    uHALr_printf("uCOS-II Running on a") ;
#if defined(EBSA285)
    uHALr_printf("n EBSA-285 (21285 evaluation board)\n") ;
#elif defined(BRUTUS) 
    uHALr_printf(" Brutus (SA-1100 verification platform)\n") ;
#elif defined(INTEGRATOR) 
    uHALr_printf("n Integrator board\n") ;
#elif defined(PROSPECTOR) 
    uHALr_printf(" Prospector board\n") ;
#elif defined(SAMSUNG)
	uHALr_printf(" SAMSUNG board\n");
#else
    uHALr_printf("n unknown ARM board\n") ;
#endif
    uHALr_printf(uHAL_VERSION_STRING); 
    uHALr_printf("\n") ;
    uHALr_printf(BUILD_DATE);
    uHALr_printf("\n") ;

#ifdef DEBUG
    uHALr_printf("Initialising target\n");
#endif

    /* ---- disable the MMU        ------------------------------------- */
    uHALr_ResetMMU();

    /* ---- disable interrupts (IRQs) --------------------------------- */
    ARMDisableInt();

    /* ---- soft vectors ---------------------------------------------- */
#ifdef DEBUG
    uHALr_printf("Setting up soft vectors\n");
#endif
    /* Define pre & post-process routines for Interrupt */
    uHALir_DefineIRQ((void *)IrqStart, (void *)IrqFinish, (void *) 0);
    uHALr_InitInterrupts();

#ifdef DEBUG
    uHALr_printf("Timer init\n");
#endif
    uHALr_InitTimers();

#ifdef DEBUG
    uHALr_printf("targetInit() complete\n");
#endif
}                               /* targetInit */

/* start the ARM target running */
void
 ARMTargetStart(void)
{
#ifdef DEBUG
    uHALr_printf("Starting target\n") ;
#endif

    /* request the system timer */
    if (uHALr_RequestSystemTimer(
                                 (void *) OSTimeTick,
                                 (const unsigned char *)"uCOS-II") <= 0)
        uHALr_printf("Timer/IRQ busy\n");

    /* Start system timer & enable the interrupt. */
    uHALr_InstallSystemTimer();
}

extern void IRQContextSwap(void);   /* post DispatchIRQ processing (the _real_ one) */

/* just 'notice' that we need to change context */
int need_to_swap_context = 0 ;
void OSIntCtxSw(void) {
    need_to_swap_context = 1;
}

/* This is what uCOS does at the start of an IRQ */
void IrqStart(void)
{
    /* increment nesting counter */
    OSIntNesting++;
}

/* This is what uCOS does at the end of an IRQ */
void *IrqFinish(void)
{
    OSIntExit() ;
    if (need_to_swap_context) {
//        need_to_swap_context = 0 ;
        return ((void *)IRQContextSwap) ;
    } else {
        return (void *)0;
    }
}
#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久精品免费网站| 亚洲动漫第一页| 国产一区二区三区免费播放| 欧美一区二区三区免费| 丝袜美腿亚洲综合| 欧美电影免费观看高清完整版在 | 日韩一区二区视频| 蜜桃av一区二区三区电影| 精品99999| 成人一级片网址| 亚洲乱码国产乱码精品精98午夜| 欧洲精品视频在线观看| 亚洲第一福利一区| 日韩欧美国产综合一区 | 久久尤物电影视频在线观看| 国产一区二区在线免费观看| 国产精品久久99| 色综合久久中文综合久久牛| 亚洲成人动漫av| wwww国产精品欧美| 99热99精品| 日韩不卡在线观看日韩不卡视频| 久久综合久久综合九色| 99免费精品在线观看| 日韩影院精彩在线| 欧美韩国一区二区| 欧美日韩精品系列| 国产成人综合网站| 亚洲成人精品影院| 国产日韩亚洲欧美综合| 欧亚一区二区三区| 国产成人av影院| 亚洲观看高清完整版在线观看| 日韩欧美一二三| 91成人看片片| 丁香婷婷深情五月亚洲| 久久99国产精品免费网站| 国产在线播精品第三| 国产精品久久久久久久蜜臀| 亚洲一区二区三区视频在线播放 | 国产日韩欧美麻豆| 亚洲色大成网站www久久九九| 成人午夜av在线| 色婷婷国产精品综合在线观看| 日韩精品一区二区三区三区免费| 成人a级免费电影| 美女脱光内衣内裤视频久久网站| 国产精品国产a| 久久综合久久99| 欧美一区二区三区白人 | 国内国产精品久久| 亚洲一区二区三区在线| 国产欧美一区二区精品忘忧草| 欧美日韩国产bt| 91久久免费观看| 国产老妇另类xxxxx| 免费在线观看日韩欧美| 亚洲国产成人av网| 中文字幕一区在线观看| 久久久久久久久伊人| 在线播放/欧美激情| 欧美色视频在线观看| 91在线免费播放| 北岛玲一区二区三区四区| 狠狠色2019综合网| 免费xxxx性欧美18vr| 视频在线在亚洲| 午夜日韩在线电影| 亚洲成国产人片在线观看| 亚洲精品国产一区二区精华液 | 色综合天天天天做夜夜夜夜做| 国产精品一卡二卡| 国产精品自在在线| 国产一区二区主播在线| 国产原创一区二区| 久久国产综合精品| 久久91精品久久久久久秒播| 美国av一区二区| 日韩成人一区二区| 免费成人小视频| 九色porny丨国产精品| 久久99久久精品| 韩国一区二区三区| 国产一区二区电影| 懂色av一区二区三区蜜臀| 成人性生交大片免费看在线播放| 国产91对白在线观看九色| 国产精品一区不卡| 99国产精品久久久久| 91.麻豆视频| 日韩精品中文字幕在线一区| 国产免费成人在线视频| 日韩美一区二区三区| 欧美日韩一区 二区 三区 久久精品| 丁香啪啪综合成人亚洲小说 | 精品蜜桃在线看| 91美女片黄在线观看91美女| 成人激情文学综合网| 色嗨嗨av一区二区三区| 亚洲国产欧美在线| 日韩电影在线看| 国产精品一区二区久久不卡 | 色吧成人激情小说| 精品视频999| 精品理论电影在线观看| 国产蜜臀av在线一区二区三区| 亚洲久本草在线中文字幕| 偷拍一区二区三区四区| 国产乱码精品一区二区三区五月婷 | 在线观看视频一区二区欧美日韩| 欧美色电影在线| 久久久久久电影| 亚洲自拍偷拍图区| 蜜臀av一区二区在线免费观看| 高清国产一区二区| 欧美日韩在线播放三区| 久久久亚洲精华液精华液精华液| 亚洲欧美影音先锋| 免费人成在线不卡| av在线不卡电影| 日韩欧美一级二级三级| 亚洲精品中文在线观看| 久久精品国产免费| 日本二三区不卡| 久久夜色精品国产欧美乱极品| 一区二区三区中文字幕在线观看| 麻豆久久一区二区| 一本色道综合亚洲| 久久亚区不卡日本| 亚洲18色成人| 99v久久综合狠狠综合久久| 精品剧情在线观看| 亚洲国产欧美另类丝袜| 成人精品视频一区二区三区| 在线综合亚洲欧美在线视频| 亚洲欧美激情一区二区| 国内成人精品2018免费看| 欧美性做爰猛烈叫床潮| 中文字幕一区av| 激情综合网激情| 欧美一区二区在线不卡| 亚洲激情在线播放| 成人一级片在线观看| 精品欧美一区二区在线观看| 日韩在线一区二区三区| 色哟哟国产精品| 国产欧美中文在线| 精品中文字幕一区二区小辣椒| 国产精品青草久久| 欧美一区二区福利在线| 一区二区三区av电影| 色偷偷久久一区二区三区| 日本一区二区三级电影在线观看| 麻豆专区一区二区三区四区五区| 91麻豆精品国产91久久久久久久久 | 欧美成人性战久久| 亚洲色大成网站www久久九九| 国产一区91精品张津瑜| 欧美一级免费大片| 亚洲一卡二卡三卡四卡 | 亚洲已满18点击进入久久| 91视频国产观看| 亚洲乱码中文字幕| 99国产精品国产精品久久| 国产精品久99| 99re热视频精品| 亚洲人快播电影网| 成人国产在线观看| 中文字幕中文字幕一区| 丁香啪啪综合成人亚洲小说| 欧美国产精品专区| 成人毛片老司机大片| 国产精品久久久久天堂| www.成人网.com| 亚洲欧洲精品一区二区三区不卡 | 色婷婷久久久亚洲一区二区三区| 亚洲图片欧美激情| 日本高清无吗v一区| 亚洲精品久久7777| 欧美男同性恋视频网站| 日本一区中文字幕| 日韩精品资源二区在线| 国产一区在线观看视频| 国产精品免费视频网站| 色哟哟日韩精品| 五月天一区二区| 欧美www视频| 丁香另类激情小说| 亚洲美女在线一区| 欧美日韩国产中文| 精品无码三级在线观看视频 | 亚洲欧洲av在线| 91国偷自产一区二区三区成为亚洲经典 | 国产精品女人毛片| 色老汉av一区二区三区| 婷婷综合另类小说色区| 精品国产青草久久久久福利| 国产成a人亚洲精| 5566中文字幕一区二区电影| 色吧成人激情小说|