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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [freertos-6.1.1/] [Source/] [portable/] [GCC/] [OpenRISC/] [portmacro.h] - Blame information for rev 675

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 572 jeremybenn
/*
2
    FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd.
3
 
4
    ***************************************************************************
5
    *                                                                         *
6
    * If you are:                                                             *
7
    *                                                                         *
8
    *    + New to FreeRTOS,                                                   *
9
    *    + Wanting to learn FreeRTOS or multitasking in general quickly       *
10
    *    + Looking for basic training,                                        *
11
    *    + Wanting to improve your FreeRTOS skills and productivity           *
12
    *                                                                         *
13
    * then take a look at the FreeRTOS books - available as PDF or paperback  *
14
    *                                                                         *
15
    *        "Using the FreeRTOS Real Time Kernel - a Practical Guide"        *
16
    *                  http://www.FreeRTOS.org/Documentation                  *
17
    *                                                                         *
18
    * A pdf reference manual is also available.  Both are usually delivered   *
19
    * to your inbox within 20 minutes to two hours when purchased between 8am *
20
    * and 8pm GMT (although please allow up to 24 hours in case of            *
21
    * exceptional circumstances).  Thank you for your support!                *
22
    *                                                                         *
23
    ***************************************************************************
24
 
25
    This file is part of the FreeRTOS distribution.
26
 
27
    FreeRTOS is free software; you can redistribute it and/or modify it under
28
    the terms of the GNU General Public License (version 2) as published by the
29
    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.
30
    ***NOTE*** The exception to the GPL is included to allow you to distribute
31
    a combined work that includes FreeRTOS without being obliged to provide the
32
    source code for proprietary components outside of the FreeRTOS kernel.
33
    FreeRTOS is distributed in the hope that it will be useful, but WITHOUT
34
    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
35
    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
36
    more details. You should have received a copy of the GNU General Public
37
    License and the FreeRTOS license exception along with FreeRTOS; if not it
38
    can be viewed here: http://www.freertos.org/a00114.html and also obtained
39
    by writing to Richard Barry, contact details for whom are available on the
40
    FreeRTOS WEB site.
41
 
42
    1 tab == 4 spaces!
43
 
44
    http://www.FreeRTOS.org - Documentation, latest information, license and
45
    contact details.
46
 
47
    http://www.SafeRTOS.com - A version that is certified for use in safety
48
    critical systems.
49
 
50
    http://www.OpenRTOS.com - Commercial support, development, porting,
51
    licensing and training services.
52
*/
53
#ifndef PORTMACRO_H
54
#define PORTMACRO_H
55
 
56
#ifdef __cplusplus
57
extern "C" {
58
#endif
59
 
60
//-----------------------------------------------------------
61
// Port specific definitions
62
//-----------------------------------------------------------
63
// Type definitions.
64
#define portCHAR        char
65
#define portFLOAT       float
66
#define portDOUBLE      double
67
#define portLONG        long
68
#define portSHORT       short
69
#define portSTACK_TYPE  unsigned portLONG
70
#define portBASE_TYPE   long
71
#define portTickType    unsigned portLONG
72
#define portMAX_DELAY   (portTickType)0xffffffff
73
 
74
#if( configUSE_16_BIT_TICKS == 1 )
75
        #effor "configUSE_16_BIT_TICKS must be 0"
76
#endif
77
 
78
/*-----------------------------------------------------------*/
79
#define portSTACK_GROWTH                        -1
80
#define portTICK_RATE_MS                        ( (portTickType) 1000 / configTICK_RATE_HZ )
81
#define portBYTE_ALIGNMENT                      4
82
#define portCRITICAL_NESTING_IN_TCB             1
83
#define portINSTRUCTION_SIZE                    ( ( portSTACK_TYPE ) 4 )
84
#define portNO_CRITICAL_SECTION_NESTING ( ( portSTACK_TYPE ) 0 )
85
 
86 664 filepang
#define portYIELD_FROM_ISR()                    portYIELD()
87 675 filepang
#define portYIELD()             \
88
        __asm__ __volatile__ (  "l.nop       \n\t"  \
89
                                                        "l.sys 0x0FCC\n\t"  \
90
                                                        "l.nop       \n\t"  \
91
        );
92 572 jeremybenn
#define portNOP()               __asm__ __volatile__ ( "l.nop" )
93
 
94
 
95 675 filepang
/*-----------------------------------------------------------*/
96
#define portDISABLE_INTERRUPTS()        { extern inline void vPortDisableInterrupts( void ); vPortDisableInterrupts(); }
97
#define portENABLE_INTERRUPTS()         { extern inline void vPortEnableInterrupts( void );  vPortEnableInterrupts();  }
98 572 jeremybenn
 
99 675 filepang
#define portENTER_CRITICAL()            { extern void vTaskEnterCritical( void ); vTaskEnterCritical();  }
100
#define portEXIT_CRITICAL()                     { extern void vTaskExitCritical( void );  vTaskExitCritical();   }
101 572 jeremybenn
/*-----------------------------------------------------------*/
102
 
103
/* Task function macros as described on the FreeRTOS.org WEB site. */
104
#define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void *pvParameters )
105
#define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void *pvParameters )
106
 
107 675 filepang
/*
108
        Context layout
109
        0x00    r9
110
        0x04    r2
111
        0x08    r3
112
        0x0C    r4
113
        0x10    r5
114
        0x14    r6
115
        0x18    r7
116
        0x1C    r8
117
        0x20    r10
118
        0x24    r11
119
        0x28    r12
120
        0x2C    r13
121
        0x30    r14
122
        0x34    r15
123
        0x38    r16
124
        0x3C    r17
125
        0x40    r18
126
        0x44    r19
127
        0x48    r20
128
        0x4C    r21
129
        0x50    r22
130
        0x54    r23
131
        0x58    r24
132
        0x5C    r25
133
        0x60    r26
134
        0x64    r27
135
        0x68    r28
136
        0x6C    r29
137
        0x70    r30
138
        0x74    r31
139
        0x78    ESR
140
        0x7C    EPCR
141
*/
142 572 jeremybenn
 
143 675 filepang
#define REDZONE_SIZE            (128)
144
#define CONTEXT_SIZE            (128)
145
#define STACKFRAME_SIZE         (CONTEXT_SIZE + REDZONE_SIZE)
146
 
147 664 filepang
#ifdef __cplusplus
148
}
149
#endif
150
 
151 572 jeremybenn
#endif /* PORTMACRO_H */

powered by: WebSVN 2.1.0

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