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

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

?? portisr.c

?? 最新版FreeRTOS, 包擴多種開發平臺的移植
?? C
字號:
/*
	FreeRTOS.org V4.1.1 - copyright (C) 2003-2006 Richard Barry.

	This file is part of the FreeRTOS.org distribution.

	FreeRTOS.org is free software; you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation; either version 2 of the License, or
	(at your option) any later version.

	FreeRTOS.org is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with FreeRTOS.org; if not, write to the Free Software
	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

	A special exception to the GPL can be applied should you wish to distribute
	a combined work that includes FreeRTOS.org, without being obliged to provide
	the source code for any proprietary components.  See the licensing section 
	of http://www.FreeRTOS.org for full details of how and when the exception
	can be applied.

	***************************************************************************
	See http://www.FreeRTOS.org for documentation, latest information, license 
	and contact details.  Please ensure to read the configuration and relevant 
	port sections of the online documentation.
	***************************************************************************
*/


/*-----------------------------------------------------------
 * Components that can be compiled to either ARM or THUMB mode are
 * contained in port.c  The ISR routines, which can only be compiled
 * to ARM mode, are contained in this file.
 *----------------------------------------------------------*/

/*
	Changes from V3.2.4

	+ The assembler statements are now included in a single asm block rather
	  than each line having its own asm block.
*/

/* Scheduler includes. */
#include "FreeRTOS.h"
#include "task.h"

#include "AT91SAM7X256.h"

/* Constants required to handle interrupts. */
#define portTIMER_MATCH_ISR_BIT		( ( unsigned portCHAR ) 0x01 )
#define portCLEAR_VIC_INTERRUPT		( ( unsigned portLONG ) 0 )

/* Constants required to handle critical sections. */
#define portNO_CRITICAL_NESTING		( ( unsigned portLONG ) 0 )
volatile unsigned portLONG ulCriticalNesting = 9999UL;

/*-----------------------------------------------------------*/

/* ISR to handle manual context switches (from a call to taskYIELD()). */
void vPortYieldProcessor( void ) __attribute__((interrupt("SWI"), naked));

/* 
 * The scheduler can only be started from ARM mode, hence the inclusion of this
 * function here.
 */
void vPortISRStartFirstTask( void );
/*-----------------------------------------------------------*/

void vPortISRStartFirstTask( void )
{
	/* Simply start the scheduler.  This is included here as it can only be
	called from ARM mode. */
	portRESTORE_CONTEXT();
}
/*-----------------------------------------------------------*/

/*
 * Called by portYIELD() or taskYIELD() to manually force a context switch.
 *
 * When a context switch is performed from the task level the saved task 
 * context is made to look as if it occurred from within the tick ISR.  This
 * way the same restore context function can be used when restoring the context
 * saved from the ISR or that saved from a call to vPortYieldProcessor.
 */
void vPortYieldProcessor( void )
{
	/* Within an IRQ ISR the link register has an offset from the true return 
	address, but an SWI ISR does not.  Add the offset manually so the same 
	ISR return code can be used in both cases. */
	asm volatile ( "ADD		LR, LR, #4" );

	/* Perform the context switch.  First save the context of the current task. */
	portSAVE_CONTEXT();

	/* Find the highest priority task that is ready to run. */
	vTaskSwitchContext();

	/* Restore the context of the new task. */
	portRESTORE_CONTEXT();	
}
/*-----------------------------------------------------------*/

/* 
 * The ISR used for the scheduler tick depends on whether the cooperative or
 * the preemptive scheduler is being used.
 */

#if configUSE_PREEMPTION == 0

	/* The cooperative scheduler requires a normal IRQ service routine to 
	simply increment the system tick. */
	void vNonPreemptiveTick( void ) __attribute__ ((interrupt ("IRQ")));
	void vNonPreemptiveTick( void )
	{		
		unsigned portLONG ulDummy;
		
		/* Increment the tick count - which may wake some tasks but as the
		preemptive scheduler is not being used any woken task is not given
		processor time no matter what its priority. */
		vTaskIncrementTick();
		
		/* Clear the PIT interrupt. */
		ulDummy = AT91C_BASE_PITC->PITC_PIVR;
		
		/* End the interrupt in the AIC. */
		AT91C_BASE_AIC->AIC_EOICR = ulDummy;
	}

#else

	/* The preemptive scheduler is defined as "naked" as the full context is
	saved on entry as part of the context switch. */
	void vPreemptiveTick( void ) __attribute__((naked));
	void vPreemptiveTick( void )
	{
		/* Save the context of the current task. */
		portSAVE_CONTEXT();			

		/* Increment the tick count - this may wake a task. */
		vTaskIncrementTick();

		/* Find the highest priority task that is ready to run. */
		vTaskSwitchContext();
		
		/* End the interrupt in the AIC. */
		AT91C_BASE_AIC->AIC_EOICR = AT91C_BASE_PITC->PITC_PIVR;;
		
		portRESTORE_CONTEXT();
	}

#endif
/*-----------------------------------------------------------*/

/*
 * The interrupt management utilities can only be called from ARM mode.  When
 * THUMB_INTERWORK is defined the utilities are defined as functions here to
 * ensure a switch to ARM mode.  When THUMB_INTERWORK is not defined then
 * the utilities are defined as macros in portmacro.h - as per other ports.
 */
void vPortDisableInterruptsFromThumb( void ) __attribute__ ((naked));
void vPortEnableInterruptsFromThumb( void ) __attribute__ ((naked));

void vPortDisableInterruptsFromThumb( void )
{
	asm volatile ( 
		"STMDB	SP!, {R0}		\n\t"	/* Push R0.									*/
		"MRS	R0, CPSR		\n\t"	/* Get CPSR.								*/
		"ORR	R0, R0, #0xC0	\n\t"	/* Disable IRQ, FIQ.						*/
		"MSR	CPSR, R0		\n\t"	/* Write back modified value.				*/
		"LDMIA	SP!, {R0}		\n\t"	/* Pop R0.									*/
		"BX		R14" );					/* Return back to thumb.					*/
}
		
void vPortEnableInterruptsFromThumb( void )
{
	asm volatile ( 
		"STMDB	SP!, {R0}		\n\t"	/* Push R0.									*/	
		"MRS	R0, CPSR		\n\t"	/* Get CPSR.								*/	
		"BIC	R0, R0, #0xC0	\n\t"	/* Enable IRQ, FIQ.							*/	
		"MSR	CPSR, R0		\n\t"	/* Write back modified value.				*/	
		"LDMIA	SP!, {R0}		\n\t"	/* Pop R0.									*/
		"BX		R14" );					/* Return back to thumb.					*/
}


/* The code generated by the GCC compiler uses the stack in different ways at
different optimisation levels.  The interrupt flags can therefore not always
be saved to the stack.  Instead the critical section nesting level is stored
in a variable, which is then saved as part of the stack context. */
void vPortEnterCritical( void )
{
	/* Disable interrupts as per portDISABLE_INTERRUPTS(); 							*/
	asm volatile ( 
		"STMDB	SP!, {R0}			\n\t"	/* Push R0.								*/
		"MRS	R0, CPSR			\n\t"	/* Get CPSR.							*/
		"ORR	R0, R0, #0xC0		\n\t"	/* Disable IRQ, FIQ.					*/
		"MSR	CPSR, R0			\n\t"	/* Write back modified value.			*/
		"LDMIA	SP!, {R0}" );				/* Pop R0.								*/

	/* Now interrupts are disabled ulCriticalNesting can be accessed 
	directly.  Increment ulCriticalNesting to keep a count of how many times
	portENTER_CRITICAL() has been called. */
	ulCriticalNesting++;
}

void vPortExitCritical( void )
{
	if( ulCriticalNesting > portNO_CRITICAL_NESTING )
	{
		/* Decrement the nesting count as we are leaving a critical section. */
		ulCriticalNesting--;

		/* If the nesting level has reached zero then interrupts should be
		re-enabled. */
		if( ulCriticalNesting == portNO_CRITICAL_NESTING )
		{
			/* Enable interrupts as per portEXIT_CRITICAL().					*/
			asm volatile ( 
				"STMDB	SP!, {R0}		\n\t"	/* Push R0.						*/	
				"MRS	R0, CPSR		\n\t"	/* Get CPSR.					*/	
				"BIC	R0, R0, #0xC0	\n\t"	/* Enable IRQ, FIQ.				*/	
				"MSR	CPSR, R0		\n\t"	/* Write back modified value.	*/	
				"LDMIA	SP!, {R0}" );			/* Pop R0.						*/
		}
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品久久一区二区三区| 成人久久视频在线观看| 亚洲欧洲成人精品av97| 337p粉嫩大胆噜噜噜噜噜91av| 91激情五月电影| 91一区二区在线| 国产精品一区二区无线| 美腿丝袜亚洲色图| 丝袜亚洲另类欧美| 国产精品久久久久久一区二区三区 | 亚洲图片欧美综合| 亚洲欧洲精品一区二区三区 | 国产主播一区二区三区| 日韩在线观看一区二区| 亚洲一区二区三区自拍| 亚洲精品中文字幕乱码三区| 国产精品传媒视频| 亚洲欧洲成人自拍| 国产精品区一区二区三区| 久久亚洲精品小早川怜子| 久久九九久精品国产免费直播| 欧美一区二区在线播放| 日韩免费电影一区| 欧美哺乳videos| 精品少妇一区二区三区免费观看| 欧美午夜精品久久久久久超碰 | 欧美三级电影在线观看| 制服丝袜日韩国产| 国产三级一区二区三区| 亚洲卡通欧美制服中文| 久久福利资源站| 91在线观看一区二区| 欧美午夜精品一区二区蜜桃| 久久综合久久综合亚洲| 亚洲男人电影天堂| 经典一区二区三区| 在线欧美日韩国产| 精品久久国产字幕高潮| 亚洲裸体xxx| 精品一区二区免费视频| 91福利精品第一导航| 欧美不卡123| 亚欧色一区w666天堂| 国产精品一区二区不卡| 制服丝袜亚洲网站| 亚洲欧美日韩小说| 国产激情视频一区二区三区欧美| 91激情五月电影| 日本一区二区不卡视频| 久久精品国产99| 精品视频一区三区九区| 国产精品高清亚洲| 久久爱www久久做| 欧美专区亚洲专区| 中文字幕一区二区在线观看| 精品一区二区三区香蕉蜜桃 | 国产精品美女久久久久aⅴ国产馆| 肉色丝袜一区二区| 91视频com| 国产精品网站导航| 国产一区美女在线| 日韩欧美资源站| 日本sm残虐另类| 欧美精品久久一区| 亚洲国产aⅴ天堂久久| 欧美中文字幕一区| 一区二区三区在线观看欧美| 99久久精品费精品国产一区二区 | av电影天堂一区二区在线| 精品日韩欧美在线| 精品午夜久久福利影院| 精品精品国产高清a毛片牛牛 | 精品国精品国产| 久草在线在线精品观看| 日韩一二三区不卡| 久久激情五月婷婷| 日韩美女一区二区三区| 蜜臀av性久久久久蜜臀aⅴ四虎| 91精品国产综合久久久蜜臀图片| 亚洲一区二区三区四区五区黄| 色综合久久精品| 亚洲精品免费一二三区| 色8久久人人97超碰香蕉987| 亚洲电影一区二区| 3d成人动漫网站| 国产乱码字幕精品高清av| 国产欧美综合在线观看第十页 | 亚洲精品欧美综合四区| 欧美婷婷六月丁香综合色| 亚洲国产日韩一区二区| 日韩欧美电影一二三| 精品一区二区免费| 亚洲欧洲性图库| 欧美色老头old∨ideo| 日韩精品一二区| 久久精品一区二区三区不卡牛牛| 成人一区在线观看| 亚洲香肠在线观看| 日韩精品一区二| 99re成人精品视频| 日韩中文字幕1| 久久精品亚洲麻豆av一区二区| 国产精品888| 一区二区三区日韩欧美精品| 日韩一区二区免费在线观看| 懂色av一区二区三区免费看| 一区二区三区.www| 26uuu国产在线精品一区二区| 丁香天五香天堂综合| 一区二区三区在线视频播放| 欧美大片拔萝卜| 一本大道久久a久久综合婷婷| 日本欧美一区二区| 中文字幕第一区二区| 欧美日产在线观看| 欧美性色综合网| 激情综合网激情| 午夜精品久久久久久久99水蜜桃| 欧美精品一区二区蜜臀亚洲| 色哟哟欧美精品| 国产一区二区三区观看| 樱花草国产18久久久久| 国产日韩欧美一区二区三区综合| 欧美午夜精品一区二区蜜桃 | 综合久久一区二区三区| 日韩欧美资源站| 91国在线观看| 成人avav在线| 国产麻豆91精品| 日韩精品久久久久久| 亚洲精品高清在线观看| 中文字幕欧美三区| 精品理论电影在线观看| 欧美日韩一区不卡| 91麻豆自制传媒国产之光| 国产成a人无v码亚洲福利| 久久精品国产**网站演员| 亚洲一二三区不卡| 中文字幕视频一区二区三区久| 久久青草国产手机看片福利盒子 | 欧美日韩三级视频| 波多野结衣精品在线| 国产精品18久久久久久久久| 蜜桃免费网站一区二区三区| 日韩成人免费看| 日韩和欧美的一区| 日日夜夜免费精品视频| 午夜激情久久久| 天堂午夜影视日韩欧美一区二区| 一区二区免费在线| 一卡二卡欧美日韩| 亚洲国产欧美日韩另类综合| 亚洲国产视频直播| 亚洲一二三专区| 婷婷一区二区三区| 视频一区中文字幕| 另类小说综合欧美亚洲| 精品系列免费在线观看| 国产精品99久久久| 99精品视频一区二区三区| 一本大道久久精品懂色aⅴ| 91福利国产精品| 欧美日本国产视频| 欧美一卡二卡三卡| 久久久久国产精品厨房| 国产精品视频免费| 亚洲一区二区三区免费视频| 日韩精品免费视频人成| 裸体健美xxxx欧美裸体表演| 国产精品自在欧美一区| 成人av午夜影院| 日本韩国欧美在线| 日韩色视频在线观看| 国产欧美精品日韩区二区麻豆天美| 国产欧美日韩一区二区三区在线观看| 欧美国产精品一区二区三区| 亚洲欧美激情在线| 日韩二区在线观看| 国产成a人亚洲| 91福利在线观看| 久久久久99精品国产片| 亚洲美女在线一区| 麻豆91精品视频| 色天天综合色天天久久| 日韩欧美一区二区视频| 国产精品国产精品国产专区不蜜| 首页国产欧美久久| 国产v日产∨综合v精品视频| 欧美系列亚洲系列| 国产欧美日韩在线观看| 香蕉成人啪国产精品视频综合网| 国产原创一区二区| 在线欧美日韩国产| 国产免费观看久久| 奇米影视7777精品一区二区| 91在线播放网址| 欧美精品一区二区在线播放| 亚洲精品高清在线| 懂色av噜噜一区二区三区av| 欧美一区二区视频在线观看 |