OpenCores
URL https://opencores.org/ocsvn/openfire2/openfire2/trunk

Subversion Repositories openfire2

[/] [openfire2/] [trunk/] [sw/] [freertos/] [portmacro.h] - Blame information for rev 4

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 toni32
/*
2
        FreeRTOS.org V4.2.0 - Copyright (C) 2003-2007 Richard Barry.
3
 
4
        This file is part of the FreeRTOS.org distribution.
5
 
6
        FreeRTOS.org is free software; you can redistribute it and/or modify
7
        it under the terms of the GNU General Public License as published by
8
        the Free Software Foundation; either version 2 of the License, or
9
        (at your option) any later version.
10
 
11
        FreeRTOS.org is distributed in the hope that it will be useful,
12
        but WITHOUT ANY WARRANTY; without even the implied warranty of
13
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
        GNU General Public License for more details.
15
 
16
        You should have received a copy of the GNU General Public License
17
        along with FreeRTOS.org; if not, write to the Free Software
18
        Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19
 
20
        A special exception to the GPL can be applied should you wish to distribute
21
        a combined work that includes FreeRTOS.org, without being obliged to provide
22
        the source code for any proprietary components.  See the licensing section
23
        of http://www.FreeRTOS.org for full details of how and when the exception
24
        can be applied.
25
 
26
        ***************************************************************************
27
        See http://www.FreeRTOS.org for documentation, latest information, license
28
        and contact details.  Please ensure to read the configuration and relevant
29
        port sections of the online documentation.
30
        ***************************************************************************
31
*/
32
 
33
#ifndef PORTMACRO_H
34
#define PORTMACRO_H
35
 
36
/*-----------------------------------------------------------
37
 * Port specific definitions.
38
 *
39
 * The settings in this file configure FreeRTOS correctly for the
40
 * given hardware and compiler.
41
 *
42
 * These settings should not be altered.
43
 *-----------------------------------------------------------
44
 */
45
 
46
/* Type definitions. */
47
#define portCHAR                char
48
#define portFLOAT               float
49
#define portDOUBLE              double
50
#define portLONG                long
51
#define portSHORT               short
52
#define portSTACK_TYPE          unsigned portLONG
53
#define portBASE_TYPE           portLONG
54
 
55
#if( configUSE_16_BIT_TICKS == 1 )
56
        typedef unsigned portSHORT portTickType;
57
        #define portMAX_DELAY ( portTickType ) 0xffff
58
#else
59
        typedef unsigned portLONG portTickType;
60
        #define portMAX_DELAY ( portTickType ) 0xffffffff
61
#endif
62
/*-----------------------------------------------------------*/
63
 
64
/* Interrupt control macros. */
65
void openfire_disable_interrupts(void);
66
void openfire_enable_interrupts(void);
67
 
68
#define portDISABLE_INTERRUPTS()        openfire_disable_interrupts()
69
#define portENABLE_INTERRUPTS()         openfire_enable_interrupts()
70
 
71
/*-----------------------------------------------------------*/
72
 
73
/* Critical section macros. */
74
void vPortEnterCritical( void );
75
void vPortExitCritical( void );
76
#define portENTER_CRITICAL()                                            \
77
{                                                                       \
78
  extern unsigned portBASE_TYPE uxCriticalNesting;                      \
79
  portDISABLE_INTERRUPTS();                                             \
80
  uxCriticalNesting++;                                                  \
81
}
82
 
83
#define portEXIT_CRITICAL()                                             \
84
{                                                                       \
85
  extern unsigned portBASE_TYPE uxCriticalNesting;                      \
86
  /* Interrupts are disabled, so we can */                              \
87
  /* access the variable directly. */                                   \
88
  uxCriticalNesting--;                                                  \
89
  if( uxCriticalNesting == 0 )                                           \
90
  {                                                                     \
91
    /* The nesting has unwound and we                                   \
92
       can enable interrupts again. */                                  \
93
    portENABLE_INTERRUPTS();                                            \
94
  }                                                                     \
95
}
96
 
97
/*-----------------------------------------------------------*/
98
 
99
/* Task utilities. */
100
void vPortYield( void );
101
#define portYIELD()                             vPortYield()
102
 
103
void vTaskSwitchContext();
104
#define portYIELD_FROM_ISR()                    vTaskSwitchContext()
105
/*-----------------------------------------------------------*/
106
 
107
/* Hardware specifics. */
108
#define portBYTE_ALIGNMENT                      4
109
#define portSTACK_GROWTH                        ( -1 )
110
#define portTICK_RATE_MS                        ( ( portTickType ) 1000 / configTICK_RATE_HZ )          
111
#define portNOP()                               asm volatile ( "nop" )
112
/*-----------------------------------------------------------*/
113
 
114
/* Task function macros as described on the FreeRTOS.org WEB site. */
115
#define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void *pvParameters )
116
#define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void *pvParameters )
117
 
118
#endif /* PORTMACRO_H */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.