123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223 |
- #ifndef PORTABLE_H
- #define PORTABLE_H
- #include "deprecated_definitions.h"
- #ifndef portENTER_CRITICAL
- #include "portmacro.h"
- #endif
- #if portBYTE_ALIGNMENT == 32
- #define portBYTE_ALIGNMENT_MASK ( 0x001f )
- #elif portBYTE_ALIGNMENT == 16
- #define portBYTE_ALIGNMENT_MASK ( 0x000f )
- #elif portBYTE_ALIGNMENT == 8
- #define portBYTE_ALIGNMENT_MASK ( 0x0007 )
- #elif portBYTE_ALIGNMENT == 4
- #define portBYTE_ALIGNMENT_MASK ( 0x0003 )
- #elif portBYTE_ALIGNMENT == 2
- #define portBYTE_ALIGNMENT_MASK ( 0x0001 )
- #elif portBYTE_ALIGNMENT == 1
- #define portBYTE_ALIGNMENT_MASK ( 0x0000 )
- #else
- #error "Invalid portBYTE_ALIGNMENT definition"
- #endif
- #ifndef portUSING_MPU_WRAPPERS
- #define portUSING_MPU_WRAPPERS 0
- #endif
- #ifndef portNUM_CONFIGURABLE_REGIONS
- #define portNUM_CONFIGURABLE_REGIONS 1
- #endif
- #ifndef portHAS_STACK_OVERFLOW_CHECKING
- #define portHAS_STACK_OVERFLOW_CHECKING 0
- #endif
- #ifndef portARCH_NAME
- #define portARCH_NAME NULL
- #endif
- #ifndef configSTACK_ALLOCATION_FROM_SEPARATE_HEAP
-
- #define configSTACK_ALLOCATION_FROM_SEPARATE_HEAP 0
- #endif
- #ifdef __cplusplus
- extern "C" {
- #endif
- #include "mpu_wrappers.h"
- #if ( portUSING_MPU_WRAPPERS == 1 )
- #if ( portHAS_STACK_OVERFLOW_CHECKING == 1 )
- StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
- StackType_t * pxEndOfStack,
- TaskFunction_t pxCode,
- void * pvParameters,
- BaseType_t xRunPrivileged ) PRIVILEGED_FUNCTION;
- #else
- StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
- TaskFunction_t pxCode,
- void * pvParameters,
- BaseType_t xRunPrivileged ) PRIVILEGED_FUNCTION;
- #endif
- #else
- #if ( portHAS_STACK_OVERFLOW_CHECKING == 1 )
- StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
- StackType_t * pxEndOfStack,
- TaskFunction_t pxCode,
- void * pvParameters ) PRIVILEGED_FUNCTION;
- #else
- StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
- TaskFunction_t pxCode,
- void * pvParameters ) PRIVILEGED_FUNCTION;
- #endif
- #endif
- typedef struct HeapRegion
- {
- uint8_t * pucStartAddress;
- size_t xSizeInBytes;
- } HeapRegion_t;
- typedef struct xHeapStats
- {
- size_t xAvailableHeapSpaceInBytes;
- size_t xSizeOfLargestFreeBlockInBytes;
- size_t xSizeOfSmallestFreeBlockInBytes;
- size_t xNumberOfFreeBlocks;
- size_t xMinimumEverFreeBytesRemaining;
- size_t xNumberOfSuccessfulAllocations;
- size_t xNumberOfSuccessfulFrees;
- } HeapStats_t;
- void vPortDefineHeapRegions( const HeapRegion_t * const pxHeapRegions ) PRIVILEGED_FUNCTION;
- void vPortGetHeapStats( HeapStats_t * pxHeapStats );
- void * pvPortMalloc( size_t xSize ) PRIVILEGED_FUNCTION;
- void vPortFree( void * pv ) PRIVILEGED_FUNCTION;
- void vPortInitialiseBlocks( void ) PRIVILEGED_FUNCTION;
- size_t xPortGetFreeHeapSize( void ) PRIVILEGED_FUNCTION;
- size_t xPortGetMinimumEverFreeHeapSize( void ) PRIVILEGED_FUNCTION;
- #if( configSTACK_ALLOCATION_FROM_SEPARATE_HEAP == 1 )
- void *pvPortMallocStack( size_t xSize ) PRIVILEGED_FUNCTION;
- void vPortFreeStack( void *pv ) PRIVILEGED_FUNCTION;
- #else
- #define pvPortMallocStack pvPortMalloc
- #define vPortFreeStack vPortFree
- #endif
- BaseType_t xPortStartScheduler( void ) PRIVILEGED_FUNCTION;
- void vPortEndScheduler( void ) PRIVILEGED_FUNCTION;
- #if ( portUSING_MPU_WRAPPERS == 1 )
- struct xMEMORY_REGION;
- void vPortStoreTaskMPUSettings( xMPU_SETTINGS * xMPUSettings,
- const struct xMEMORY_REGION * const xRegions,
- StackType_t * pxBottomOfStack,
- uint32_t ulStackDepth ) PRIVILEGED_FUNCTION;
- #endif
- #ifdef __cplusplus
- }
- #endif
- #endif
|