]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Source/portable/GCC/MicroBlazeV8/portmacro.h
Update version number to 8.1.2 after moving the defaulting of configUSE_PORT_OPTIMISE...
[freertos] / FreeRTOS / Source / portable / GCC / MicroBlazeV8 / portmacro.h
index f33d0f1958083734635680d07179b792949524cf..528d45e2da365cd72701ce40f2d01d1c79f6d617 100644 (file)
@@ -1,67 +1,66 @@
 /*\r
-    FreeRTOS V7.1.1 - Copyright (C) 2012 Real Time Engineers Ltd.\r
-       \r
+    FreeRTOS V8.1.2 - Copyright (C) 2014 Real Time Engineers Ltd.\r
+    All rights reserved\r
+\r
+    VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
 \r
     ***************************************************************************\r
      *                                                                       *\r
-     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
-     *    Complete, revised, and edited pdf reference manuals are also       *\r
-     *    available.                                                         *\r
-     *                                                                       *\r
-     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
-     *    ensuring you get running as quickly as possible and with an        *\r
-     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
-     *    the FreeRTOS project to continue with its mission of providing     *\r
-     *    professional grade, cross platform, de facto standard solutions    *\r
-     *    for microcontrollers - completely free of charge!                  *\r
+     *    FreeRTOS provides completely free yet professionally developed,    *\r
+     *    robust, strictly quality controlled, supported, and cross          *\r
+     *    platform software that has become a de facto standard.             *\r
      *                                                                       *\r
-     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
+     *    Help yourself get started quickly and support the FreeRTOS         *\r
+     *    project by purchasing a FreeRTOS tutorial book, reference          *\r
+     *    manual, or both from: http://www.FreeRTOS.org/Documentation        *\r
      *                                                                       *\r
-     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
+     *    Thank you!                                                         *\r
      *                                                                       *\r
     ***************************************************************************\r
 \r
-\r
     This file is part of the FreeRTOS distribution.\r
 \r
     FreeRTOS is free software; you can redistribute it and/or modify it under\r
     the terms of the GNU General Public License (version 2) as published by the\r
-    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
-    >>>NOTE<<< The modification to the GPL is included to allow you to\r
-    distribute a combined work that includes FreeRTOS without being obliged to\r
-    provide the source code for proprietary components outside of the FreeRTOS\r
-    kernel.  FreeRTOS is distributed in the hope that it will be useful, but\r
-    WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
-    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for\r
-    more details. You should have received a copy of the GNU General Public\r
-    License and the FreeRTOS license exception along with FreeRTOS; if not it\r
-    can be viewed here: http://www.freertos.org/a00114.html and also obtained\r
-    by writing to Richard Barry, contact details for whom are available on the\r
-    FreeRTOS WEB site.\r
+    Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.\r
+\r
+    >>!   NOTE: The modification to the GPL is included to allow you to     !<<\r
+    >>!   distribute a combined work that includes FreeRTOS without being   !<<\r
+    >>!   obliged to provide the source code for proprietary components     !<<\r
+    >>!   outside of the FreeRTOS kernel.                                   !<<\r
+\r
+    FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
+    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
+    FOR A PARTICULAR PURPOSE.  Full license text is available from the following\r
+    link: http://www.freertos.org/a00114.html\r
 \r
     1 tab == 4 spaces!\r
-    \r
+\r
     ***************************************************************************\r
      *                                                                       *\r
      *    Having a problem?  Start by reading the FAQ "My application does   *\r
-     *    not run, what could be wrong?                                      *\r
+     *    not run, what could be wrong?"                                     *\r
      *                                                                       *\r
      *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
      *                                                                       *\r
     ***************************************************************************\r
 \r
-    \r
-    http://www.FreeRTOS.org - Documentation, training, latest information, \r
-    license and contact details.\r
-    \r
+    http://www.FreeRTOS.org - Documentation, books, training, latest versions,\r
+    license and Real Time Engineers Ltd. contact details.\r
+\r
     http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
-    including FreeRTOS+Trace - an indispensable productivity tool.\r
+    including FreeRTOS+Trace - an indispensable productivity tool, a DOS\r
+    compatible FAT file system, and our tiny thread aware UDP/IP stack.\r
+\r
+    http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High\r
+    Integrity Systems to sell under the OpenRTOS brand.  Low cost OpenRTOS\r
+    licenses offer ticketed support, indemnification and middleware.\r
 \r
-    Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell \r
-    the code with commercial support, indemnification, and middleware, under \r
-    the OpenRTOS brand: http://www.OpenRTOS.com.  High Integrity Systems also\r
-    provide a safety engineered and independently SIL3 certified version under \r
-    the SafeRTOS brand: http://www.SafeRTOS.com.\r
+    http://www.SafeRTOS.com - High Integrity Systems also provide a safety\r
+    engineered and independently SIL3 certified version for use in safety and\r
+    mission critical applications that require provable dependability.\r
+\r
+    1 tab == 4 spaces!\r
 */\r
 \r
 #ifndef PORTMACRO_H\r
@@ -76,7 +75,7 @@ extern "C" {
 #include <xparameters.h>\r
 \r
 /*-----------------------------------------------------------\r
- * Port specific definitions.  \r
+ * Port specific definitions.\r
  *\r
  * The settings in this file configure FreeRTOS correctly for the\r
  * given hardware and compiler.\r
@@ -91,17 +90,21 @@ extern "C" {
 #define portDOUBLE             double\r
 #define portLONG               long\r
 #define portSHORT              short\r
-#define portSTACK_TYPE unsigned long\r
+#define portSTACK_TYPE uint32_t\r
 #define portBASE_TYPE  long\r
 \r
+typedef portSTACK_TYPE StackType_t;\r
+typedef long BaseType_t;\r
+typedef unsigned long UBaseType_t;\r
+\r
 #if( configUSE_16_BIT_TICKS == 1 )\r
-       typedef unsigned portSHORT portTickType;\r
-       #define portMAX_DELAY ( portTickType ) 0xffff\r
+       typedef uint16_t TickType_t;\r
+       #define portMAX_DELAY ( TickType_t ) 0xffff\r
 #else\r
-       typedef unsigned portLONG portTickType;\r
-       #define portMAX_DELAY ( portTickType ) 0xffffffff\r
+       typedef uint32_t TickType_t;\r
+       #define portMAX_DELAY ( TickType_t ) 0xffffffffUL\r
 #endif\r
-/*-----------------------------------------------------------*/        \r
+/*-----------------------------------------------------------*/\r
 \r
 /* Interrupt control macros and functions. */\r
 void microblaze_disable_interrupts( void );\r
@@ -115,13 +118,13 @@ void microblaze_enable_interrupts( void );
 void vPortEnterCritical( void );\r
 void vPortExitCritical( void );\r
 #define portENTER_CRITICAL()           {                                                                                                                               \\r
-                                                                               extern volatile unsigned portBASE_TYPE uxCriticalNesting;       \\r
+                                                                               extern volatile UBaseType_t uxCriticalNesting;  \\r
                                                                                microblaze_disable_interrupts();                                                        \\r
                                                                                uxCriticalNesting++;                                                                            \\r
                                                                        }\r
 \r
 #define portEXIT_CRITICAL()                    {                                                                                                                               \\r
-                                                                               extern volatile unsigned portBASE_TYPE uxCriticalNesting;       \\r
+                                                                               extern volatile UBaseType_t uxCriticalNesting;  \\r
                                                                                /* Interrupts are disabled, so we can */                                        \\r
                                                                                /* access the variable directly. */                                                     \\r
                                                                                uxCriticalNesting--;                                                                            \\r
@@ -145,14 +148,14 @@ then checks this flag, and calls vTaskSwitchContext() before restoring a task
 context, if the flag is not false.  This is done to prevent multiple calls to\r
 vTaskSwitchContext() being made from a single interrupt, as a single interrupt\r
 can result in multiple peripherals being serviced. */\r
-extern volatile unsigned long ulTaskSwitchRequested;\r
+extern volatile uint32_t ulTaskSwitchRequested;\r
 #define portYIELD_FROM_ISR( x ) if( x != pdFALSE ) ulTaskSwitchRequested = 1\r
 /*-----------------------------------------------------------*/\r
 \r
 /* Hardware specifics. */\r
 #define portBYTE_ALIGNMENT                     4\r
 #define portSTACK_GROWTH                       ( -1 )\r
-#define portTICK_RATE_MS                       ( ( portTickType ) 1000 / configTICK_RATE_HZ )\r
+#define portTICK_PERIOD_MS                     ( ( TickType_t ) 1000 / configTICK_RATE_HZ )\r
 #define portNOP()                                      asm volatile ( "NOP" )\r
 /*-----------------------------------------------------------*/\r
 \r
@@ -168,53 +171,53 @@ typedef struct PORT_REGISTER_DUMP
 {\r
        /* The following structure members hold the values of the MicroBlaze\r
        registers at the time the exception was raised. */\r
-       unsigned long ulR1_SP;\r
-       unsigned long ulR2_small_data_area;\r
-       unsigned long ulR3;\r
-       unsigned long ulR4;\r
-       unsigned long ulR5;\r
-       unsigned long ulR6;\r
-       unsigned long ulR7;\r
-       unsigned long ulR8;\r
-       unsigned long ulR9;\r
-       unsigned long ulR10;\r
-       unsigned long ulR11;\r
-       unsigned long ulR12;\r
-       unsigned long ulR13_read_write_small_data_area;\r
-       unsigned long ulR14_return_address_from_interrupt;\r
-       unsigned long ulR15_return_address_from_subroutine;\r
-       unsigned long ulR16_return_address_from_trap;\r
-       unsigned long ulR17_return_address_from_exceptions; /* The exception entry code will copy the BTR into R17 if the exception occurred in the delay slot of a branch instruction. */\r
-       unsigned long ulR18;\r
-       unsigned long ulR19;\r
-       unsigned long ulR20;\r
-       unsigned long ulR21;\r
-       unsigned long ulR22;\r
-       unsigned long ulR23;\r
-       unsigned long ulR24;\r
-       unsigned long ulR25;\r
-       unsigned long ulR26;\r
-       unsigned long ulR27;\r
-       unsigned long ulR28;\r
-       unsigned long ulR29;\r
-       unsigned long ulR30;\r
-       unsigned long ulR31;\r
-       unsigned long ulPC;\r
-       unsigned long ulESR;\r
-       unsigned long ulMSR;\r
-       unsigned long ulEAR;\r
-       unsigned long ulFSR;\r
-       unsigned long ulEDR;\r
+       uint32_t ulR1_SP;\r
+       uint32_t ulR2_small_data_area;\r
+       uint32_t ulR3;\r
+       uint32_t ulR4;\r
+       uint32_t ulR5;\r
+       uint32_t ulR6;\r
+       uint32_t ulR7;\r
+       uint32_t ulR8;\r
+       uint32_t ulR9;\r
+       uint32_t ulR10;\r
+       uint32_t ulR11;\r
+       uint32_t ulR12;\r
+       uint32_t ulR13_read_write_small_data_area;\r
+       uint32_t ulR14_return_address_from_interrupt;\r
+       uint32_t ulR15_return_address_from_subroutine;\r
+       uint32_t ulR16_return_address_from_trap;\r
+       uint32_t ulR17_return_address_from_exceptions; /* The exception entry code will copy the BTR into R17 if the exception occurred in the delay slot of a branch instruction. */\r
+       uint32_t ulR18;\r
+       uint32_t ulR19;\r
+       uint32_t ulR20;\r
+       uint32_t ulR21;\r
+       uint32_t ulR22;\r
+       uint32_t ulR23;\r
+       uint32_t ulR24;\r
+       uint32_t ulR25;\r
+       uint32_t ulR26;\r
+       uint32_t ulR27;\r
+       uint32_t ulR28;\r
+       uint32_t ulR29;\r
+       uint32_t ulR30;\r
+       uint32_t ulR31;\r
+       uint32_t ulPC;\r
+       uint32_t ulESR;\r
+       uint32_t ulMSR;\r
+       uint32_t ulEAR;\r
+       uint32_t ulFSR;\r
+       uint32_t ulEDR;\r
 \r
        /* A human readable description of the exception cause.  The strings used\r
        are the same as the #define constant names found in the\r
        microblaze_exceptions_i.h header file */\r
-       signed char *pcExceptionCause;\r
+       int8_t *pcExceptionCause;\r
 \r
        /* The human readable name of the task that was running at the time the\r
        exception occurred.  This is the name that was given to the task when the\r
        task was created using the FreeRTOS xTaskCreate() API function. */\r
-       signed char *pcCurrentTaskName;\r
+       int8_t *pcCurrentTaskName;\r
 \r
        /* The handle of the task that was running a the time the exception\r
        occurred. */\r
@@ -224,15 +227,15 @@ typedef struct PORT_REGISTER_DUMP
 \r
 \r
 /*\r
- * Installs pxHandler as the interrupt handler for the peripheral specified by \r
+ * Installs pxHandler as the interrupt handler for the peripheral specified by\r
  * the ucInterruptID parameter.\r
  *\r
  * ucInterruptID:\r
- * \r
+ *\r
  * The ID of the peripheral that will have pxHandler assigned as its interrupt\r
- * handler.  Peripheral IDs are defined in the xparameters.h header file, which \r
- * is itself part of the BSP project.  For example, in the official demo \r
- * application for this port, xparameters.h defines the following IDs for the \r
+ * handler.  Peripheral IDs are defined in the xparameters.h header file, which\r
+ * is itself part of the BSP project.  For example, in the official demo\r
+ * application for this port, xparameters.h defines the following IDs for the\r
  * four possible interrupt sources:\r
  *\r
  * XPAR_INTC_0_UARTLITE_1_VEC_ID  -  for the UARTlite peripheral.\r
@@ -242,7 +245,7 @@ typedef struct PORT_REGISTER_DUMP
  *\r
  *\r
  * pxHandler:\r
- * \r
+ *\r
  * A pointer to the interrupt handler function itself.  This must be a void\r
  * function that takes a (void *) parameter.\r
  *\r
@@ -254,23 +257,23 @@ typedef struct PORT_REGISTER_DUMP
  * the peripheral instance variable, so it can be accessed from inside the\r
  * handler function.\r
  *\r
- * \r
+ *\r
  * pdPASS is returned if the function executes successfully.  Any other value\r
  * being returned indicates that the function did not execute correctly.\r
  */\r
-portBASE_TYPE xPortInstallInterruptHandler( unsigned char ucInterruptID, XInterruptHandler pxHandler, void *pvCallBackRef );\r
+BaseType_t xPortInstallInterruptHandler( uint8_t ucInterruptID, XInterruptHandler pxHandler, void *pvCallBackRef );\r
 \r
 \r
 /*\r
- * Enables the interrupt, within the interrupt controller, for the peripheral \r
+ * Enables the interrupt, within the interrupt controller, for the peripheral\r
  * specified by the ucInterruptID parameter.\r
  *\r
  * ucInterruptID:\r
- * \r
+ *\r
  * The ID of the peripheral that will have its interrupt enabled in the\r
- * interrupt controller.  Peripheral IDs are defined in the xparameters.h header \r
- * file, which is itself part of the BSP project.  For example, in the official \r
- * demo application for this port, xparameters.h defines the following IDs for \r
+ * interrupt controller.  Peripheral IDs are defined in the xparameters.h header\r
+ * file, which is itself part of the BSP project.  For example, in the official\r
+ * demo application for this port, xparameters.h defines the following IDs for\r
  * the four possible interrupt sources:\r
  *\r
  * XPAR_INTC_0_UARTLITE_1_VEC_ID  -  for the UARTlite peripheral.\r
@@ -279,18 +282,18 @@ portBASE_TYPE xPortInstallInterruptHandler( unsigned char ucInterruptID, XInterr
  * XPAR_INTC_0_GPIO_1_VEC_ID      -  for the button inputs.\r
  *\r
  */\r
-void vPortEnableInterrupt( unsigned char ucInterruptID );\r
+void vPortEnableInterrupt( uint8_t ucInterruptID );\r
 \r
 /*\r
- * Disables the interrupt, within the interrupt controller, for the peripheral \r
+ * Disables the interrupt, within the interrupt controller, for the peripheral\r
  * specified by the ucInterruptID parameter.\r
  *\r
  * ucInterruptID:\r
- * \r
+ *\r
  * The ID of the peripheral that will have its interrupt disabled in the\r
- * interrupt controller.  Peripheral IDs are defined in the xparameters.h header \r
- * file, which is itself part of the BSP project.  For example, in the official \r
- * demo application for this port, xparameters.h defines the following IDs for \r
+ * interrupt controller.  Peripheral IDs are defined in the xparameters.h header\r
+ * file, which is itself part of the BSP project.  For example, in the official\r
+ * demo application for this port, xparameters.h defines the following IDs for\r
  * the four possible interrupt sources:\r
  *\r
  * XPAR_INTC_0_UARTLITE_1_VEC_ID  -  for the UARTlite peripheral.\r
@@ -299,49 +302,49 @@ void vPortEnableInterrupt( unsigned char ucInterruptID );
  * XPAR_INTC_0_GPIO_1_VEC_ID      -  for the button inputs.\r
  *\r
  */\r
-void vPortDisableInterrupt( unsigned char ucInterruptID );\r
+void vPortDisableInterrupt( uint8_t ucInterruptID );\r
 \r
 /*\r
  * This is an application defined callback function used to install the tick\r
- * interrupt handler.  It is provided as an application callback because the \r
- * kernel will run on lots of different MicroBlaze and FPGA configurations - not \r
- * all of which will have the same timer peripherals defined or available.  This \r
- * example uses the AXI Timer 0.  If that is available on your hardware platform \r
- * then this example callback implementation should not require modification.  \r
- * The name of the interrupt handler that should be installed is vPortTickISR(), \r
+ * interrupt handler.  It is provided as an application callback because the\r
+ * kernel will run on lots of different MicroBlaze and FPGA configurations - not\r
+ * all of which will have the same timer peripherals defined or available.  This\r
+ * example uses the AXI Timer 0.  If that is available on your hardware platform\r
+ * then this example callback implementation should not require modification.\r
+ * The name of the interrupt handler that should be installed is vPortTickISR(),\r
  * which the function below declares as an extern.\r
- */ \r
+ */\r
 void vApplicationSetupTimerInterrupt( void );\r
 \r
-/* \r
+/*\r
  * This is an application defined callback function used to clear whichever\r
  * interrupt was installed by the the vApplicationSetupTimerInterrupt() callback\r
- * function - in this case the interrupt generated by the AXI timer.  It is \r
- * provided as an application callback because the kernel will run on lots of \r
- * different MicroBlaze and FPGA configurations - not all of which will have the \r
- * same timer peripherals defined or available.  This example uses the AXI Timer 0.  \r
- * If that is available on your hardware platform then this example callback \r
+ * function - in this case the interrupt generated by the AXI timer.  It is\r
+ * provided as an application callback because the kernel will run on lots of\r
+ * different MicroBlaze and FPGA configurations - not all of which will have the\r
+ * same timer peripherals defined or available.  This example uses the AXI Timer 0.\r
+ * If that is available on your hardware platform then this example callback\r
  * implementation should not require modification provided the example definition\r
- * of vApplicationSetupTimerInterrupt() is also not modified. \r
+ * of vApplicationSetupTimerInterrupt() is also not modified.\r
  */\r
 void vApplicationClearTimerInterrupt( void );\r
 \r
 /*\r
  * vPortExceptionsInstallHandlers() is only available when the MicroBlaze\r
- * is configured to include exception functionality, and \r
+ * is configured to include exception functionality, and\r
  * configINSTALL_EXCEPTION_HANDLERS is set to 1 in FreeRTOSConfig.h.\r
  *\r
  * vPortExceptionsInstallHandlers() installs the FreeRTOS exception handler\r
- * for every possible exception cause.  \r
+ * for every possible exception cause.\r
  *\r
  * vPortExceptionsInstallHandlers() can be called explicitly from application\r
  * code.  After that is done, the default FreeRTOS exception handler that will\r
- * have been installed can be replaced for any specific exception cause by using \r
+ * have been installed can be replaced for any specific exception cause by using\r
  * the standard Xilinx library function microblaze_register_exception_handler().\r
  *\r
- * If vPortExceptionsInstallHandlers() is not called explicitly by the \r
+ * If vPortExceptionsInstallHandlers() is not called explicitly by the\r
  * application, it will be called automatically by the kernel the first time\r
- * xPortInstallInterruptHandler() is called.  At that time, any exception \r
+ * xPortInstallInterruptHandler() is called.  At that time, any exception\r
  * handlers that may have already been installed will be replaced.\r
  *\r
  * See the description of vApplicationExceptionRegisterDump() for information\r
@@ -350,16 +353,16 @@ void vApplicationClearTimerInterrupt( void );
 void vPortExceptionsInstallHandlers( void );\r
 \r
 /*\r
- * The FreeRTOS exception handler fills an xPortRegisterDump structure (defined \r
- * in portmacro.h) with the MicroBlaze context, as it was at the time the \r
+ * The FreeRTOS exception handler fills an xPortRegisterDump structure (defined\r
+ * in portmacro.h) with the MicroBlaze context, as it was at the time the\r
  * exception occurred.  The exception handler then calls\r
  * vApplicationExceptionRegisterDump(), passing in the completed\r
  * xPortRegisterDump structure as its parameter.\r
  *\r
  * The FreeRTOS kernel provides its own implementation of\r
- * vApplicationExceptionRegisterDump(), but the kernel provided implementation \r
- * is declared as being 'weak'.  The weak definition allows the application \r
- * writer to provide their own implementation, should they wish to use the \r
+ * vApplicationExceptionRegisterDump(), but the kernel provided implementation\r
+ * is declared as being 'weak'.  The weak definition allows the application\r
+ * writer to provide their own implementation, should they wish to use the\r
  * register dump information.  For example, an implementation could be provided\r
  * that wrote the register dump data to a display, or a UART port.\r
  */\r