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

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

?? portmacro.h

?? STM32 FreeRTOS v5.2移植源代碼
?? H
?? 第 1 頁 / 共 2 頁
字號:
/*This file has been prepared for Doxygen automatic documentation generation.*/
/*! \file *********************************************************************
 *
 * \brief FreeRTOS port source for AVR32 UC3.
 *
 * - Compiler:           GNU GCC for AVR32
 * - Supported devices:  All AVR32 devices can be used.
 * - AppNote:
 *
 * \author               Atmel Corporation: http://www.atmel.com \n
 *                       Support and FAQ: http://support.atmel.no/
 *
 *****************************************************************************/

/*
	FreeRTOS.org V5.2.0 - Copyright (C) 2003-2009 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 (version 2) as published
	by the Free Software Foundation and modified by the FreeRTOS exception.

	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 is included to allow you 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.


	***************************************************************************
	*                                                                         *
	* Get the FreeRTOS eBook!  See http://www.FreeRTOS.org/Documentation      *
	*                                                                         *
	* This is a concise, step by step, 'hands on' guide that describes both   *
	* general multitasking concepts and FreeRTOS specifics. It presents and   *
	* explains numerous examples that are written using the FreeRTOS API.     *
	* Full source code for all the examples is provided in an accompanying    *
	* .zip file.                                                              *
	*                                                                         *
	***************************************************************************

	1 tab == 4 spaces!

	Please ensure to read the configuration and relevant port sections of the
	online documentation.

	http://www.FreeRTOS.org - Documentation, latest information, license and
	contact details.

	http://www.SafeRTOS.com - A version that is certified for use in safety
	critical systems.

	http://www.OpenRTOS.com - Commercial support, development, porting,
	licensing and training services.
*/


#ifndef PORTMACRO_H
#define PORTMACRO_H

/*-----------------------------------------------------------
 * Port specific definitions.
 *
 * The settings in this file configure FreeRTOS correctly for the
 * given hardware and compiler.
 *
 * These settings should not be altered.
 *-----------------------------------------------------------
 */
#include <avr32/io.h>
#include "intc.h"
#include "compiler.h"

#ifdef __cplusplus
extern "C" {
#endif


/* Type definitions. */
#define portCHAR        char
#define portFLOAT       float
#define portDOUBLE      double
#define portLONG        long
#define portSHORT       short
#define portSTACK_TYPE  unsigned portLONG
#define portBASE_TYPE   portLONG

#define TASK_DELAY_MS(x)   ( (x)        /portTICK_RATE_MS )
#define TASK_DELAY_S(x)    ( (x)*1000   /portTICK_RATE_MS )
#define TASK_DELAY_MIN(x)  ( (x)*60*1000/portTICK_RATE_MS )

#define configTICK_TC_IRQ             ATPASTE2(AVR32_TC_IRQ, configTICK_TC_CHANNEL)

#if( configUSE_16_BIT_TICKS == 1 )
	typedef unsigned portSHORT portTickType;
	#define portMAX_DELAY ( portTickType ) 0xffff
#else
	typedef unsigned portLONG portTickType;
	#define portMAX_DELAY ( portTickType ) 0xffffffff
#endif
/*-----------------------------------------------------------*/

/* Architecture specifics. */
#define portSTACK_GROWTH      ( -1 )
#define portTICK_RATE_MS      ( ( portTickType ) 1000 / configTICK_RATE_HZ )
#define portBYTE_ALIGNMENT    4
#define portNOP()             {__asm__ __volatile__ ("nop");}
/*-----------------------------------------------------------*/


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

/* INTC-specific. */
#define DISABLE_ALL_EXCEPTIONS()    Disable_global_exception()
#define ENABLE_ALL_EXCEPTIONS()     Enable_global_exception()

#define DISABLE_ALL_INTERRUPTS()    Disable_global_interrupt()
#define ENABLE_ALL_INTERRUPTS()     Enable_global_interrupt()

#define DISABLE_INT_LEVEL(int_lev)  Disable_interrupt_level(int_lev)
#define ENABLE_INT_LEVEL(int_lev)   Enable_interrupt_level(int_lev)


/*
 * Debug trace.
 * Activated if and only if configDBG is nonzero.
 * Prints a formatted string to stdout.
 * The current source file name and line number are output with a colon before
 * the formatted string.
 * A carriage return and a linefeed are appended to the output.
 * stdout is redirected to the USART configured by configDBG_USART.
 * The parameters are the same as for the standard printf function.
 * There is no return value.
 * SHALL NOT BE CALLED FROM WITHIN AN INTERRUPT as fputs and printf use malloc,
 * which is interrupt-unsafe with the current __malloc_lock and __malloc_unlock.
 */
#if configDBG
#define portDBG_TRACE(...) \
{\
  fputs(__FILE__ ":" ASTRINGZ(__LINE__) ": ", stdout);\
  printf(__VA_ARGS__);\
  fputs("\r\n", stdout);\
}
#else
#define portDBG_TRACE(...)
#endif


/* Critical section management. */
#define portDISABLE_INTERRUPTS()  DISABLE_ALL_INTERRUPTS()
#define portENABLE_INTERRUPTS()   ENABLE_ALL_INTERRUPTS()


extern void vPortEnterCritical( void );
extern void vPortExitCritical( void );

#define portENTER_CRITICAL()      vPortEnterCritical();
#define portEXIT_CRITICAL()       vPortExitCritical();


/* Added as there is no such function in FreeRTOS. */
extern void *pvPortRealloc( void *pv, size_t xSize );
/*-----------------------------------------------------------*/


/*=============================================================================================*/

/*
 * Restore Context for cases other than INTi.
 */
#define portRESTORE_CONTEXT()															\
{																						\
  extern volatile unsigned portLONG ulCriticalNesting;									\
  extern volatile void *volatile pxCurrentTCB;											\
																						\
  __asm__ __volatile__ (																\
    /* Set SP to point to new stack */													\
    "mov     r8, LO(%[pxCurrentTCB])													\n\t"\
    "orh     r8, HI(%[pxCurrentTCB])													\n\t"\
    "ld.w    r0, r8[0]																	\n\t"\
    "ld.w    sp, r0[0]																	\n\t"\
																						\
    /* Restore ulCriticalNesting variable */											\
    "ld.w    r0, sp++																	\n\t"\
    "mov     r8, LO(%[ulCriticalNesting])												\n\t"\
    "orh     r8, HI(%[ulCriticalNesting])												\n\t"\
    "st.w    r8[0], r0																	\n\t"\
																						\
    /* Restore R0..R7 */																\
    "ldm     sp++, r0-r7																\n\t"\
    /* R0-R7 should not be used below this line */										\
    /* Skip PC and SR (will do it at the end) */										\
    "sub     sp, -2*4																	\n\t"\
    /* Restore R8..R12 and LR */														\
    "ldm     sp++, r8-r12, lr															\n\t"\
    /* Restore SR */																	\
    "ld.w    r0, sp[-8*4]\n\t" /* R0 is modified, is restored later. */					\
    "mtsr    %[SR], r0																	\n\t"\
    /* Restore r0 */																	\
    "ld.w    r0, sp[-9*4]																\n\t"\
    /* Restore PC */																	\
    "ld.w    pc, sp[-7*4]" /* Get PC from stack - PC is the 7th register saved */		\
    :																					\
    : [ulCriticalNesting] "i" (&ulCriticalNesting),										\
      [pxCurrentTCB] "i" (&pxCurrentTCB),												\
      [SR] "i" (AVR32_SR)																\
  );																					\
}


/*
 * portSAVE_CONTEXT_INT() and portRESTORE_CONTEXT_INT(): for INT0..3 exceptions.
 * portSAVE_CONTEXT_SCALL() and portRESTORE_CONTEXT_SCALL(): for the scall exception.
 *
 * Had to make different versions because registers saved on the system stack
 * are not the same between INT0..3 exceptions and the scall exception.
 */

// Task context stack layout:
  // R8  (*)
  // R9  (*)
  // R10 (*)
  // R11 (*)
  // R12 (*)
  // R14/LR (*)
  // R15/PC (*)
  // SR (*)
  // R0
  // R1
  // R2
  // R3
  // R4
  // R5
  // R6
  // R7
  // ulCriticalNesting
// (*) automatically done for INT0..INT3, but not for SCALL

/*
 * The ISR used for the scheduler tick depends on whether the cooperative or
 * the preemptive scheduler is being used.
 */
#if configUSE_PREEMPTION == 0

/*
 * portSAVE_CONTEXT_OS_INT() for OS Tick exception.
 */
#define portSAVE_CONTEXT_OS_INT()														\
{																						\
  /* Save R0..R7 */																		\
  __asm__ __volatile__ ("stm     --sp, r0-r7");											\
																						\
  /* With the cooperative scheduler, as there is no context switch by interrupt, */		\
  /* there is also no context save. */													\
}

/*
 * portRESTORE_CONTEXT_OS_INT() for Tick exception.
 */
#define portRESTORE_CONTEXT_OS_INT()													\
{																						\
  __asm__ __volatile__ (																\
    /* Restore R0..R7 */																\
    "ldm     sp++, r0-r7\n\t"															\
																						\
    /* With the cooperative scheduler, as there is no context switch by interrupt, */	\
    /* there is also no context restore. */												\
    "rete"																				\
  );																					\
}

#else

/*
 * portSAVE_CONTEXT_OS_INT() for OS Tick exception.
 */
#define portSAVE_CONTEXT_OS_INT()																	\
{																									\
  extern volatile unsigned portLONG ulCriticalNesting;												\
  extern volatile void *volatile pxCurrentTCB;														\
																									\
  /* When we come here */																			\
  /* Registers R8..R12, LR, PC and SR had already been pushed to system stack */					\
																									\
  __asm__ __volatile__ (																			\
    /* Save R0..R7 */																				\
    "stm     --sp, r0-r7																			\n\t"\
																									\
    /* Save ulCriticalNesting variable  - R0 is overwritten */										\
    "mov     r8, LO(%[ulCriticalNesting])\n\t"														\
    "orh     r8, HI(%[ulCriticalNesting])\n\t"														\
    "ld.w    r0, r8[0]																				\n\t"\
    "st.w    --sp, r0																				\n\t"\
																									\
    /* Check if INT0 or higher were being handled (case where the OS tick interrupted another */	\
    /* interrupt handler (which was of a higher priority level but decided to lower its priority */	\
    /* level and allow other lower interrupt level to occur). */									\
    /* In this case we don't want to do a task switch because we don't know what the stack */		\
    /* currently looks like (we don't know what the interrupted interrupt handler was doing). */	\
    /* Saving SP in pxCurrentTCB and then later restoring it (thinking restoring the task) */		\
    /* will just be restoring the interrupt handler, no way!!! */									\
    /* So, since we won't do a vTaskSwitchContext(), it's of no use to save SP. */					\
    "ld.w    r0, sp[9*4]\n\t" /* Read SR in stack */												\
    "bfextu  r0, r0, 22, 3\n\t" /* Extract the mode bits to R0. */									\
    "cp.w    r0, 1\n\t" /* Compare the mode bits with supervisor mode(b'001) */						\
    "brhi    LABEL_INT_SKIP_SAVE_CONTEXT_%[LINE]													\n\t"\
																									\
    /* Store SP in the first member of the structure pointed to by pxCurrentTCB */					\
    /* NOTE: we don't enter a critical section here because all interrupt handlers */				\
    /* MUST perform a SAVE_CONTEXT/RESTORE_CONTEXT in the same way as */							\
    /* portSAVE_CONTEXT_OS_INT/port_RESTORE_CONTEXT_OS_INT if they call OS functions. */			\
    /* => all interrupt handlers must use portENTER_SWITCHING_ISR/portEXIT_SWITCHING_ISR. */		\
    "mov     r8, LO(%[pxCurrentTCB])\n\t"															\
    "orh     r8, HI(%[pxCurrentTCB])\n\t"															\
    "ld.w    r0, r8[0]\n\t"																			\
    "st.w    r0[0], sp\n"																			\
																									\
    "LABEL_INT_SKIP_SAVE_CONTEXT_%[LINE]:"															\
    :																								\
    : [ulCriticalNesting] "i" (&ulCriticalNesting),													\
      [pxCurrentTCB] "i" (&pxCurrentTCB),															\
      [LINE] "i" (__LINE__)																			\
  );																								\
}

/*
 * portRESTORE_CONTEXT_OS_INT() for Tick exception.
 */
#define portRESTORE_CONTEXT_OS_INT()																\
{																									\
  extern volatile unsigned portLONG ulCriticalNesting;												\
  extern volatile void *volatile pxCurrentTCB;														\
																									\
  /* Check if INT0 or higher were being handled (case where the OS tick interrupted another */		\
  /* interrupt handler (which was of a higher priority level but decided to lower its priority */	\

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一区二区三区电影在线观看 | 亚洲色图.com| 欧美精品一区二区三区高清aⅴ| 日韩免费观看高清完整版在线观看| 日韩视频一区在线观看| 日韩视频免费观看高清在线视频| 久久一留热品黄| 中文字幕一区二区三| 亚洲成av人影院| 国产一区二区三区在线观看免费视频 | 国精产品一区一区三区mba桃花| 国产成人av一区| 欧美美女一区二区在线观看| 久久先锋资源网| 亚洲视频小说图片| 久久综合综合久久综合| 国产91精品一区二区| 欧美日韩一区视频| 日韩欧美在线网站| 欧美高清视频一二三区| 亚洲国产精品黑人久久久| 性欧美大战久久久久久久久| 欧美日韩中文字幕精品| 久久精品人人做人人综合| 樱花草国产18久久久久| 国产精品一区二区视频| 欧美日韩国产三级| 国产精品全国免费观看高清| 天堂成人免费av电影一区| 成人毛片在线观看| 久久免费午夜影院| 亚洲va韩国va欧美va精品| 99久久99久久免费精品蜜臀| 精品成人a区在线观看| 一区二区三区四区中文字幕| 午夜精品一区在线观看| 色乱码一区二区三区88| 中文字幕高清不卡| 国产一区二区主播在线| 欧美一级黄色片| 日韩精品一区第一页| 91传媒视频在线播放| 中文字幕一区二区三| 成人免费黄色在线| 久久亚洲精华国产精华液| 麻豆精品国产91久久久久久 | 国产一区不卡在线| 日韩午夜激情视频| 青青草精品视频| 精品视频在线免费看| 亚洲一区二区三区爽爽爽爽爽 | 亚洲高清在线视频| 日本高清不卡一区| 亚洲免费在线电影| 一本久久a久久免费精品不卡| 国产精品久久久久三级| 国产成人aaa| 国产女同互慰高潮91漫画| 粉嫩av一区二区三区| 国产精品久久毛片av大全日韩| 处破女av一区二区| 亚洲丝袜制服诱惑| 欧美日韩综合在线免费观看| 亚洲综合丁香婷婷六月香| 色婷婷香蕉在线一区二区| 亚洲综合小说图片| www.亚洲色图| 国产精品电影一区二区三区| 91免费视频观看| 亚洲一区二区三区四区五区中文 | 2023国产精品视频| 国产综合色视频| 日韩一区二区在线看| 在线观看区一区二| 久久精品国产精品青草| 久久伊人中文字幕| 不卡一区中文字幕| 一区二区不卡在线播放 | 国产精品中文字幕一区二区三区| 精品国产免费一区二区三区四区 | 精品综合久久久久久8888| 欧美人狂配大交3d怪物一区| 久久99精品久久久久久国产越南 | 国产精品青草久久| 欧美性感一类影片在线播放| 蜜桃久久精品一区二区| 中文字幕av一区二区三区| 日本道精品一区二区三区| 青青青爽久久午夜综合久久午夜| 天天综合网天天综合色| 日韩视频一区在线观看| 成人av在线播放网站| 午夜精品福利一区二区三区蜜桃| 精品国产髙清在线看国产毛片| 成人午夜精品一区二区三区| 亚洲一区二区四区蜜桃| 久久嫩草精品久久久久| 欧美在线看片a免费观看| 国内久久精品视频| 91麻豆国产福利在线观看| 日本午夜一区二区| 亚洲第一激情av| 亚洲免费视频中文字幕| 国产精品久久久久久一区二区三区 | 69久久夜色精品国产69蝌蚪网| 99精品热视频| 成人av网站免费| 国产不卡视频在线观看| 国产精品一卡二卡在线观看| 麻豆精品视频在线观看视频| 日韩电影免费一区| 天天操天天干天天综合网| 一区二区三区高清| 一区二区三国产精华液| 亚洲精品视频在线观看免费| 亚洲欧美日韩电影| 亚洲欧美国产三级| 亚洲黄色录像片| 一区二区三区欧美日| 夜夜精品视频一区二区| 一区二区三区精品在线| 亚洲午夜日本在线观看| 午夜视频在线观看一区| 日韩精品1区2区3区| 欧洲人成人精品| 欧美日韩精品高清| 欧美一区二区三区四区五区| 日韩手机在线导航| 国产午夜精品一区二区三区嫩草| 欧美极品少妇xxxxⅹ高跟鞋| 中文字幕在线一区| 亚洲综合在线视频| 日韩成人一区二区三区在线观看| 麻豆视频观看网址久久| 国产精品一区二区无线| 91丝袜高跟美女视频| 欧美三级电影网站| 日韩欧美一二三| 国产精品卡一卡二| 亚洲国产毛片aaaaa无费看| 日本sm残虐另类| 懂色av中文一区二区三区| 色av成人天堂桃色av| 制服.丝袜.亚洲.另类.中文| 久久一夜天堂av一区二区三区| 国产精品入口麻豆原神| 亚洲电影视频在线| 国产毛片一区二区| 在线看日韩精品电影| 精品国产1区二区| 亚洲女同女同女同女同女同69| 日韩电影在线观看网站| 国产91综合一区在线观看| 在线观看一区二区视频| 精品电影一区二区| 亚洲图片一区二区| 日韩欧美一卡二卡| 亚洲欧洲精品一区二区精品久久久| 亚洲成人一二三| 成人综合婷婷国产精品久久| 精品视频免费在线| 国产欧美日韩综合精品一区二区| 夜夜嗨av一区二区三区中文字幕 | 国产91精品免费| 欧美日韩国产另类不卡| 中文字幕成人网| 麻豆视频一区二区| 欧美无乱码久久久免费午夜一区 | 欧美电影在哪看比较好| 国产女人18毛片水真多成人如厕 | 777色狠狠一区二区三区| 国产精品国产精品国产专区不片 | 欧美一区二区三区免费观看视频 | 日日夜夜一区二区| 粉嫩欧美一区二区三区高清影视| 欧美日韩免费电影| 中文字幕亚洲欧美在线不卡| 久久精品国产亚洲aⅴ| 欧美中文字幕久久 | 久久久美女艺术照精彩视频福利播放| 自拍视频在线观看一区二区| 精品一二三四区| 欧美美女bb生活片| 亚洲一区在线观看免费观看电影高清| 成人午夜视频免费看| 欧美tk—视频vk| 男男视频亚洲欧美| 宅男噜噜噜66一区二区66| 亚洲一区二区偷拍精品| 99久久免费视频.com| 久久精品亚洲乱码伦伦中文 | 亚洲午夜影视影院在线观看| jizzjizzjizz欧美| 国产精品无人区| 国产成人免费在线视频| 欧美大肚乱孕交hd孕妇| 美女精品自拍一二三四| 51午夜精品国产| 日韩国产在线观看一区| 69p69国产精品|