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

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

?? portmacro.h

?? FreeRTOS V4.2.1,增加了AVR32 UC3 和 LPC2368 的支持
?? H
?? 第 1 頁 / 共 2 頁
字號:
/*This file has been prepared for Doxygen automatic documentation generation.*/
/*! \file *********************************************************************
 *
 * \brief FreeRTOS port header 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 email: avr32@atmel.com
 *
 *****************************************************************************/

/*
	FreeRTOS.org V4.2.1 - Copyright (C) 2003-2007 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.

	Also see http://www.SafeRTOS.com for an IEC 61508 compliant version along
	with commercial development and support options.
	***************************************************************************
*/


#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"


/* 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 by Newlib 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 */	\
  /* 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!!! */										\
  __asm__ __volatile__ (																			\
    "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) */						\

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一级免费观看| 亚洲一线二线三线视频| 自拍偷拍亚洲欧美日韩| 日韩精品亚洲一区| 99国产一区二区三精品乱码| 日韩欧美的一区二区| 亚洲激情自拍视频| 国产成人在线视频网站| 欧美一区二区三区小说| 亚洲另类一区二区| 粉嫩av一区二区三区在线播放| 欧美日韩免费一区二区三区视频| 国产精品拍天天在线| 激情欧美日韩一区二区| 欧美福利视频一区| 亚洲一区二区av在线| 99久久精品费精品国产一区二区| 日韩欧美你懂的| 日本一道高清亚洲日美韩| 91成人网在线| 亚洲色图在线看| 成人性生交大片免费看视频在线| 精品国产乱码久久久久久蜜臀| 午夜视频一区在线观看| 在线观看免费一区| 亚洲乱码国产乱码精品精小说| 99在线精品一区二区三区| 中文一区一区三区高中清不卡| 精品一二三四在线| 久久日韩粉嫩一区二区三区| 激情综合网激情| 久久久久久免费毛片精品| 国产一区高清在线| 久久色.com| 国产电影一区在线| 久久九九久久九九| 国产伦精一区二区三区| 久久婷婷国产综合精品青草 | 欧美专区亚洲专区| 亚洲男同性视频| 91电影在线观看| 亚洲一区二区三区视频在线| 欧美精选午夜久久久乱码6080| 亚洲高清不卡在线| 日韩欧美一二三| 国产乱子轮精品视频| 国产精品日韩精品欧美在线| 成人综合在线观看| 一区二区三区欧美亚洲| 在线精品视频免费播放| 日本欧美一区二区三区乱码| 久久先锋影音av鲁色资源| 成人免费电影视频| 亚洲五月六月丁香激情| 日韩欧美国产不卡| 国产乱妇无码大片在线观看| 国产女主播一区| 欧美在线短视频| 91极品视觉盛宴| 日韩精品电影一区亚洲| 久久久久99精品国产片| 色成年激情久久综合| 日韩一区精品视频| 亚洲国产电影在线观看| 欧美亚洲动漫精品| 精品一区二区三区在线观看国产| 国产欧美va欧美不卡在线| 在线免费观看成人短视频| 免费不卡在线视频| 国产精品久线在线观看| 欧美日韩一区久久| 粉嫩嫩av羞羞动漫久久久| 亚洲电影中文字幕在线观看| 久久久蜜桃精品| 欧美日韩日日骚| 成人影视亚洲图片在线| 男人的天堂久久精品| 亚洲欧美经典视频| 欧美一区二区三级| 色婷婷av一区二区三区之一色屋| 免费观看成人av| 亚洲精品国产a久久久久久| 日韩欧美一级二级三级| 欧美中文字幕一区二区三区亚洲| 国产麻豆一精品一av一免费| 视频一区视频二区中文| 《视频一区视频二区| 久久综合色鬼综合色| 欧美日韩久久一区二区| 99久久精品情趣| 国产91精品免费| 精品一区二区av| 蜜桃视频一区二区三区| 亚洲妇熟xx妇色黄| 亚洲精品乱码久久久久久黑人| 久久久综合视频| 精品国产一区二区三区四区四| 欧美视频完全免费看| 色综合色狠狠综合色| 波多野结衣视频一区| 高清av一区二区| 国产精品乡下勾搭老头1| 久热成人在线视频| 男男成人高潮片免费网站| 亚洲国产精品一区二区www在线| 亚洲女与黑人做爰| 亚洲人成精品久久久久| 中文字幕亚洲成人| 国产精品免费久久久久| 欧美韩日一区二区三区| 久久久不卡网国产精品一区| 2020国产精品| 久久久久国产一区二区三区四区| 欧美精品一区二区在线播放| 日韩精品自拍偷拍| 久久亚洲春色中文字幕久久久| 欧美不卡一区二区| 久久综合狠狠综合| 国产色产综合产在线视频| 国产日韩v精品一区二区| 欧美韩日一区二区三区| 国产精品久久久久一区| 亚洲欧洲综合另类| 亚洲综合色丁香婷婷六月图片| 亚洲一区二区高清| 日韩高清不卡一区| 欧美老女人在线| 7777精品伊人久久久大香线蕉的 | 综合久久久久久| 亚洲人成网站色在线观看| 亚洲国产毛片aaaaa无费看 | 欧美午夜精品一区| 欧美高清精品3d| 久久伊人中文字幕| 亚洲三级在线免费观看| 亚洲一区二区三区中文字幕在线| 日日噜噜夜夜狠狠视频欧美人 | 日韩欧美国产wwwww| 久久精品欧美日韩| 亚洲男人电影天堂| 日本欧美一区二区| 成人一区二区三区| 欧美色老头old∨ideo| 欧美成人aa大片| 亚洲欧美激情一区二区| 日韩黄色一级片| 成人午夜碰碰视频| 欧美乱妇20p| 欧美激情在线一区二区三区| 亚洲自拍与偷拍| 国产福利一区在线| 欧美日韩在线播放三区| 久久久精品免费免费| 亚洲国产一区二区三区| 国产美女精品一区二区三区| 在线视频国内自拍亚洲视频| 欧美电影免费观看高清完整版在| 国产精品国产自产拍高清av王其 | 国产精品女上位| 视频一区国产视频| 成人久久18免费网站麻豆 | 一区二区三区欧美视频| 久久狠狠亚洲综合| 在线观看日韩电影| 国产欧美日韩中文久久| 日日夜夜精品视频天天综合网| 国产成人精品一区二| 91精品国产综合久久小美女| 亚洲色图一区二区| 国产一区二区毛片| 51精品视频一区二区三区| 亚洲三级在线免费观看| 国产黄色精品视频| 欧美日高清视频| 一区二区三区日韩精品| 成人18视频在线播放| 久久先锋资源网| 久久国产精品99精品国产| 欧美日产在线观看| 一区二区三区高清| 91女人视频在线观看| 国产日韩欧美电影| 国产精品资源在线观看| 欧美一三区三区四区免费在线看| 亚洲品质自拍视频| 99热99精品| 中文字幕亚洲欧美在线不卡| 成人激情综合网站| 国产性天天综合网| 91国产免费看| 亚洲欧美色图小说| 91女厕偷拍女厕偷拍高清| 国产精品国产a| 成人avav在线| 日韩一区在线看| www.欧美日韩国产在线| 国产精品美女久久久久久2018| 国产成a人亚洲| 26uuu亚洲综合色欧美| 极品瑜伽女神91|