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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? portisr.c

?? FreeRTOSV3.2.0 經(jīng)典嵌入式操作系統(tǒng)
?? C
字號:
/*
	FreeRTOS V3.2.0 - Copyright (C) 2003 - 2005 Richard Barry.

	This file is part of the FreeRTOS distribution.

	FreeRTOS 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 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; 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, 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 V2.5.2
		
	+ The critical section management functions have been changed.  These no
	  longer modify the stack and are safe to use at all optimisation levels.
	  The functions are now also the same for both ARM and THUMB modes.

	Changes from V2.6.0

	+ Removed the 'static' from the definition of vNonPreemptiveTick() to 
	  allow the demo to link when using the cooperative scheduler.
*/


/* Scheduler includes. */
#include "FreeRTOS.h"
#include "task.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 )
	{		
		vTaskIncrementTick();
		T0_IR = portTIMER_MATCH_ISR_BIT;
		VICVectAddr = portCLEAR_VIC_INTERRUPT;
	}

#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 interrupted task. */
		portSAVE_CONTEXT();	

		/* Increment the RTOS tick count, then look for the highest priority 
		task that is ready to run. */
		vTaskIncrementTick();
		vTaskSwitchContext();

		/* Ready for the next interrupt. */
		T0_IR = portTIMER_MATCH_ISR_BIT;
		VICVectAddr = portCLEAR_VIC_INTERRUPT;
		
		/* Restore the context of the new task. */
		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.
 */
#ifdef THUMB_INTERWORK

	void vPortDisableInterruptsFromThumb( void ) __attribute__ ((naked));
	void vPortEnableInterruptsFromThumb( void ) __attribute__ ((naked));

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

#endif /* THUMB_INTERWORK */

/* 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}" );		/* Push R0.								*/
	asm volatile ( "MRS		R0, CPSR" );		/* Get CPSR.							*/
	asm volatile ( "ORR		R0, R0, #0xC0" );	/* Disable IRQ, FIQ.					*/
	asm volatile ( "MSR		CPSR, R0" );		/* Write back modified value.			*/
	asm volatile ( "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}" );		/* Push R0.						*/	
			asm volatile ( "MRS		R0, CPSR" );		/* Get CPSR.					*/	
			asm volatile ( "BIC		R0, R0, #0xC0" );	/* Enable IRQ, FIQ.				*/	
			asm volatile ( "MSR		CPSR, R0" );		/* Write back modified value.	*/	
			asm volatile ( "LDMIA	SP!, {R0}" );		/* Pop R0.						*/
		}
	}
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲大片一区二区三区| 国产精品国模大尺度视频| 欧洲国产伦久久久久久久| 色噜噜久久综合| 欧美精品色综合| 久久久久青草大香线综合精品| 久久久国产午夜精品| 亚洲自拍另类综合| 国产曰批免费观看久久久| 91免费观看视频在线| 日韩精品一区二区三区在线观看| 国产精品你懂的在线欣赏| 丝袜亚洲精品中文字幕一区| 成人a级免费电影| 欧美一区二区三区小说| 亚洲伦理在线精品| 国产高清成人在线| 91麻豆精品国产91久久久久 | 国产精品免费视频观看| 日本美女一区二区三区视频| 99国产精品久久久久久久久久久| 日韩精品中文字幕一区| 亚洲国产另类av| 91在线观看地址| ...中文天堂在线一区| 国产91丝袜在线18| 国产视频一区二区在线| 久草精品在线观看| 日韩欧美电影在线| 欧美bbbbb| 欧美xxxxxxxx| 99精品欧美一区二区三区小说 | 国产片一区二区三区| 国内一区二区视频| 精品捆绑美女sm三区| 精东粉嫩av免费一区二区三区| 91麻豆精品国产91久久久资源速度 | 欧美xfplay| 国产一二精品视频| 欧美电影免费观看高清完整版在线观看| 亚洲午夜精品在线| 在线不卡免费av| 美女mm1313爽爽久久久蜜臀| 日韩欧美三级在线| 丁香激情综合五月| 亚洲欧美日韩系列| 日韩视频一区在线观看| 国产在线精品视频| 亚洲人成7777| 日韩免费观看高清完整版在线观看| 国产中文一区二区三区| 国产精品电影一区二区| 91.xcao| 不卡的电影网站| 奇米精品一区二区三区在线观看 | 亚洲mv在线观看| 久久久精品天堂| 欧美日韩黄色影视| 波波电影院一区二区三区| 丝袜诱惑制服诱惑色一区在线观看 | 日韩欧美国产1| 99久久国产综合精品色伊| 天天综合色天天| 国产精品久久午夜夜伦鲁鲁| 欧美videossexotv100| 精品视频1区2区| 国产精品夜夜嗨| 免费看黄色91| 亚洲.国产.中文慕字在线| 国产精品久久久久久久久免费桃花| 制服丝袜av成人在线看| 欧美丝袜丝交足nylons| 91在线精品一区二区三区| 成人免费看视频| 国产黄色精品网站| 国产精品小仙女| 美女视频免费一区| 另类成人小视频在线| 天堂蜜桃91精品| 日本欧美加勒比视频| 日本欧美一区二区| 久久精品国产精品亚洲红杏| 麻豆免费精品视频| 国产美女精品人人做人人爽 | 这里只有精品免费| 久久先锋影音av鲁色资源| 久久美女高清视频| 欧美激情中文不卡| 亚洲综合色成人| 亚洲影视在线播放| 麻豆91精品91久久久的内涵| 久久99精品国产麻豆不卡| 国产乱码一区二区三区| 成a人片国产精品| 欧美妇女性影城| 久久综合久久久久88| 亚洲精品免费一二三区| 免费成人在线影院| 99精品欧美一区二区三区综合在线| 欧美午夜免费电影| 国产无人区一区二区三区| 亚洲一区二区三区中文字幕在线| 久久精品99国产精品| 91黄色免费观看| 国产日韩欧美一区二区三区乱码| 亚洲三级电影全部在线观看高清| 青青草成人在线观看| 91丨porny丨在线| 日韩欧美一区二区在线视频| 国产精品九色蝌蚪自拍| 美女一区二区视频| 欧美三级在线看| 亚洲欧洲99久久| 风间由美中文字幕在线看视频国产欧美| 成+人+亚洲+综合天堂| 亚洲综合激情另类小说区| 日本韩国精品在线| 久久久久国产精品人| 国产美女精品一区二区三区| 亚洲欧洲一区二区三区| 国产东北露脸精品视频| 久久久久国色av免费看影院| 精品制服美女丁香| 精品成人私密视频| 久久国产欧美日韩精品| 日韩一区二区高清| 狠狠色狠狠色综合系列| 久久精品亚洲乱码伦伦中文| 久久99精品久久久| 国产欧美日韩三级| 99热99精品| 亚洲妇熟xx妇色黄| 日韩欧美高清dvd碟片| 国产一区视频在线看| 中文字幕国产一区| 欧美羞羞免费网站| 日韩成人精品视频| 久久久久久久久久久电影| 成人一区二区三区中文字幕| 最新日韩在线视频| 91精品国产入口| 懂色av中文字幕一区二区三区| 中文字幕一区二区在线观看| 在线免费不卡电影| 日韩精品一二区| 中文字幕制服丝袜成人av| 欧美日韩免费视频| 成人免费电影视频| 日韩电影在线观看一区| 国产精品久久久久久久久搜平片| 欧美日本在线视频| 91在线云播放| 国产精品一区二区不卡| 天天av天天翘天天综合网色鬼国产| 久久久久久夜精品精品免费| 欧美午夜精品一区| 91免费视频大全| 粉嫩13p一区二区三区| 精品影视av免费| 日韩国产高清影视| 亚洲高清中文字幕| 亚洲精品成人精品456| 国产精品美女久久久久久久久| 精品国产一区二区三区久久久蜜月| 欧美在线影院一区二区| 91麻豆精品视频| 色婷婷综合久色| 一本到三区不卡视频| 99re这里只有精品视频首页| 国产成人精品亚洲777人妖 | 欧美视频日韩视频在线观看| 91片黄在线观看| 91麻豆国产在线观看| 日本韩国精品在线| 欧美三级乱人伦电影| 欧美日韩国产在线播放网站| 精品视频在线免费观看| 欧美日韩另类一区| 在线综合+亚洲+欧美中文字幕| 7878成人国产在线观看| 日韩欧美国产一区二区三区| 欧美精品一区二区在线观看| 欧美国产精品一区二区三区| 中文字幕制服丝袜一区二区三区| 亚洲三级免费观看| 免费av网站大全久久| 国产91精品在线观看| 欧美乱妇23p| 国产欧美一区二区精品性色超碰| 国产精品麻豆欧美日韩ww| 亚洲国产cao| av男人天堂一区| 欧美一区二区三区播放老司机| 欧美精品一区二区三区久久久| 亚洲日本丝袜连裤袜办公室| 麻豆高清免费国产一区| 欧美日韩一区中文字幕| 国产日韩欧美a| 毛片av一区二区三区| 在线亚洲一区二区|