Commit 2b798134 authored by Johannes Wiesboeck's avatar Johannes Wiesboeck Committed by Oliver Horst
Browse files

[chg] Simplified Syscall table through macro usage.

parent 92994332
#include <freertos/FreeRTOSConfig.h>
#include <freertos+/stdlib/syscalls.h>
#define ENTRY_SIZE 4
#define SYSCALL_TABLE_ENTRY(name) \
.org (syscall_table + ENTRY_SIZE*SYS_##name) ;\
b name ;
.global syscall_table
syscall_table:
#if( ( configUSE_MUTEXES == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) )
.org (syscall_table + 0*ENTRY_SIZE)
b xQueueGenericSend
#endif
.org (syscall_table + 1*ENTRY_SIZE)
b xQueuePeek
.org (syscall_table + 2*ENTRY_SIZE)
b xQueuePeekFromISR
.org (syscall_table + 3*ENTRY_SIZE)
b xQueueReceive
.org (syscall_table + 4*ENTRY_SIZE)
b uxQueueMessagesWaiting
.org (syscall_table + 5*ENTRY_SIZE)
b uxQueueSpacesAvailable
.org (syscall_table + 6*ENTRY_SIZE)
b vQueueDelete
.org (syscall_table + 7*ENTRY_SIZE)
b xQueueGenericSendFromISR
.org (syscall_table + 8*ENTRY_SIZE)
b xQueueGiveFromISR
.org (syscall_table + 9*ENTRY_SIZE)
b xQueueReceiveFromISR
.org (syscall_table + 10*ENTRY_SIZE)
b xQueueIsQueueEmptyFromISR
.org (syscall_table + 11*ENTRY_SIZE)
b xQueueIsQueueFullFromISR
.org (syscall_table + 12*ENTRY_SIZE)
b uxQueueMessagesWaitingFromISR
.org (syscall_table + 13*ENTRY_SIZE)
b xQueueCreateMutex
SYSCALL_TABLE_ENTRY(xQueueGenericSend)
#endif
SYSCALL_TABLE_ENTRY(xQueuePeek)
SYSCALL_TABLE_ENTRY(xQueuePeekFromISR)
SYSCALL_TABLE_ENTRY(xQueueReceive)
SYSCALL_TABLE_ENTRY(uxQueueMessagesWaiting)
SYSCALL_TABLE_ENTRY(uxQueueSpacesAvailable)
SYSCALL_TABLE_ENTRY(vQueueDelete)
SYSCALL_TABLE_ENTRY(xQueueGenericSendFromISR)
SYSCALL_TABLE_ENTRY(xQueueGiveFromISR)
SYSCALL_TABLE_ENTRY(xQueueReceiveFromISR)
SYSCALL_TABLE_ENTRY(xQueueIsQueueEmptyFromISR)
SYSCALL_TABLE_ENTRY(xQueueIsQueueFullFromISR)
SYSCALL_TABLE_ENTRY(uxQueueMessagesWaitingFromISR)
SYSCALL_TABLE_ENTRY(xQueueCreateMutex)
#if( ( configUSE_MUTEXES == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) )
.org (syscall_table + 14*ENTRY_SIZE)
b xQueueCreateMutexStatic
SYSCALL_TABLE_ENTRY(xQueueCreateMutexStatic)
#endif
.org (syscall_table + 15*ENTRY_SIZE)
b xQueueCreateCountingSemaphore
SYSCALL_TABLE_ENTRY(xQueueCreateCountingSemaphore)
#if( ( configUSE_COUNTING_SEMAPHORES == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) )
.org (syscall_table + 16*ENTRY_SIZE)
b xQueueCreateCountingSemaphoreStatic
SYSCALL_TABLE_ENTRY(xQueueCreateCountingSemaphoreStatic)
#endif
.org (syscall_table + 17*ENTRY_SIZE)
b xQueueSemaphoreTake
SYSCALL_TABLE_ENTRY(xQueueSemaphoreTake)
#if ( ( configUSE_MUTEXES == 1 ) && ( INCLUDE_xSemaphoreGetMutexHolder == 1 ) )
.org (syscall_table + 18*ENTRY_SIZE)
b xQueueGetMutexHolder
SYSCALL_TABLE_ENTRY(xQueueGetMutexHolder)
#endif
#if ( ( configUSE_MUTEXES == 1 ) && ( INCLUDE_xSemaphoreGetMutexHolder == 1 ) )
.org (syscall_table + 19*ENTRY_SIZE)
b xQueueGetMutexHolderFromISR
#endif
.org (syscall_table + 20*ENTRY_SIZE)
b xQueueTakeMutexRecursive
.org (syscall_table + 21*ENTRY_SIZE)
b xQueueGiveMutexRecursive
.org (syscall_table + 22*ENTRY_SIZE)
b vQueueAddToRegistry
.org (syscall_table + 23*ENTRY_SIZE)
b vQueueUnregisterQueue
.org (syscall_table + 24*ENTRY_SIZE)
b pcQueueGetName
.org (syscall_table + 25*ENTRY_SIZE)
b xQueueGenericCreate
SYSCALL_TABLE_ENTRY(xQueueGetMutexHolderFromISR)
#endif
SYSCALL_TABLE_ENTRY(xQueueTakeMutexRecursive)
SYSCALL_TABLE_ENTRY(xQueueGiveMutexRecursive)
SYSCALL_TABLE_ENTRY(vQueueAddToRegistry)
SYSCALL_TABLE_ENTRY(vQueueUnregisterQueue)
SYSCALL_TABLE_ENTRY(pcQueueGetName)
SYSCALL_TABLE_ENTRY(xQueueGenericCreate)
#if( configSUPPORT_STATIC_ALLOCATION == 1 )
.org (syscall_table + 26*ENTRY_SIZE)
b xQueueGenericCreateStatic
#endif
.org (syscall_table + 27*ENTRY_SIZE)
b xQueueCreateSet
.org (syscall_table + 28*ENTRY_SIZE)
b xQueueAddToSet
.org (syscall_table + 29*ENTRY_SIZE)
b xQueueRemoveFromSet
.org (syscall_table + 30*ENTRY_SIZE)
b xQueueSelectFromSet
.org (syscall_table + 31*ENTRY_SIZE)
b xQueueSelectFromSetFromISR
.org (syscall_table + 32*ENTRY_SIZE)
b vQueueWaitForMessageRestricted
.org (syscall_table + 33*ENTRY_SIZE)
b xQueueGenericReset
SYSCALL_TABLE_ENTRY(xQueueGenericCreateStatic)
#endif
SYSCALL_TABLE_ENTRY(xQueueCreateSet)
SYSCALL_TABLE_ENTRY(xQueueAddToSet)
SYSCALL_TABLE_ENTRY(xQueueRemoveFromSet)
SYSCALL_TABLE_ENTRY(xQueueSelectFromSet)
SYSCALL_TABLE_ENTRY(xQueueSelectFromSetFromISR)
SYSCALL_TABLE_ENTRY(vQueueWaitForMessageRestricted)
SYSCALL_TABLE_ENTRY(xQueueGenericReset)
#if ( configUSE_TRACE_FACILITY == 1 )
.org (syscall_table + 34*ENTRY_SIZE)
b vQueueSetQueueNumber
.org (syscall_table + 35*ENTRY_SIZE)
b uxQueueGetQueueNumber
.org (syscall_table + 36*ENTRY_SIZE)
b ucQueueGetQueueType
SYSCALL_TABLE_ENTRY(vQueueSetQueueNumber)
SYSCALL_TABLE_ENTRY(uxQueueGetQueueNumber)
SYSCALL_TABLE_ENTRY(ucQueueGetQueueType)
#endif
#if( configUSE_TICKLESS_IDLE != 0 )
.org (syscall_table + 37*ENTRY_SIZE)
b eTaskConfirmSleepModeStatus
#endif
.org (syscall_table + 38*ENTRY_SIZE)
b eTaskGetState
.org (syscall_table + 39*ENTRY_SIZE)
b pcTaskGetName
.org (syscall_table + 40*ENTRY_SIZE)
b pvTaskGetThreadLocalStoragePointer
.org (syscall_table + 41*ENTRY_SIZE)
b pvTaskIncrementMutexHeldCount
.org (syscall_table + 42*ENTRY_SIZE)
b ulTaskNotifyTake
.org (syscall_table + 43*ENTRY_SIZE)
b uxTaskGetNumberOfTasks
SYSCALL_TABLE_ENTRY(eTaskConfirmSleepModeStatus)
#endif
SYSCALL_TABLE_ENTRY(eTaskGetState)
SYSCALL_TABLE_ENTRY(pcTaskGetName)
SYSCALL_TABLE_ENTRY(pvTaskGetThreadLocalStoragePointer)
SYSCALL_TABLE_ENTRY(pvTaskIncrementMutexHeldCount)
SYSCALL_TABLE_ENTRY(ulTaskNotifyTake)
SYSCALL_TABLE_ENTRY(uxTaskGetNumberOfTasks)
#if ( INCLUDE_uxTaskGetStackHighWaterMark == 1 )
.org (syscall_table + 44*ENTRY_SIZE)
b uxTaskGetStackHighWaterMark
SYSCALL_TABLE_ENTRY(uxTaskGetStackHighWaterMark)
#endif
#if ( configUSE_TRACE_FACILITY == 1 )
.org (syscall_table + 45*ENTRY_SIZE)
b uxTaskGetSystemState
SYSCALL_TABLE_ENTRY(uxTaskGetSystemState)
#endif
#if ( configUSE_TRACE_FACILITY == 1 )
.org (syscall_table + 46*ENTRY_SIZE)
b uxTaskGetTaskNumber
SYSCALL_TABLE_ENTRY(uxTaskGetTaskNumber)
#endif
.org (syscall_table + 47*ENTRY_SIZE)
b uxTaskPriorityGet
.org (syscall_table + 48*ENTRY_SIZE)
b uxTaskPriorityGetFromISR
.org (syscall_table + 49*ENTRY_SIZE)
b uxTaskResetEventItemValue
SYSCALL_TABLE_ENTRY(uxTaskPriorityGet)
SYSCALL_TABLE_ENTRY(uxTaskPriorityGetFromISR)
SYSCALL_TABLE_ENTRY(uxTaskResetEventItemValue)
#if ( portUSING_MPU_WRAPPERS == 1 )
.org (syscall_table + 50*ENTRY_SIZE)
b vTaskAllocateMPURegions
SYSCALL_TABLE_ENTRY(vTaskAllocateMPURegions)
#endif
.org (syscall_table + 51*ENTRY_SIZE)
b vTaskDelay
.org (syscall_table + 52*ENTRY_SIZE)
b vTaskDelayUntil
.org (syscall_table + 53*ENTRY_SIZE)
b vTaskDelete
.org (syscall_table + 54*ENTRY_SIZE)
b vTaskEndScheduler
SYSCALL_TABLE_ENTRY(vTaskDelay)
SYSCALL_TABLE_ENTRY(vTaskDelayUntil)
SYSCALL_TABLE_ENTRY(vTaskDelete)
SYSCALL_TABLE_ENTRY(vTaskEndScheduler)
#if( configUSE_TRACE_FACILITY == 1 )
.org (syscall_table + 55*ENTRY_SIZE)
b vTaskGetInfo
SYSCALL_TABLE_ENTRY(vTaskGetInfo)
#endif
#if ( ( configGENERATE_RUN_TIME_STATS == 1 ) && ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
.org (syscall_table + 56*ENTRY_SIZE)
b vTaskGetRunTimeStats
SYSCALL_TABLE_ENTRY(vTaskGetRunTimeStats)
#endif
#if ( ( configUSE_TRACE_FACILITY == 1 ) && ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
.org (syscall_table + 57*ENTRY_SIZE)
b vTaskList
#endif
.org (syscall_table + 58*ENTRY_SIZE)
b vTaskMissedYield
.org (syscall_table + 59*ENTRY_SIZE)
b vTaskNotifyGiveFromISR
.org (syscall_table + 60*ENTRY_SIZE)
b vTaskPlaceOnEventList
.org (syscall_table + 61*ENTRY_SIZE)
b vTaskPlaceOnEventListRestricted
.org (syscall_table + 62*ENTRY_SIZE)
b vTaskPlaceOnUnorderedEventList
.org (syscall_table + 63*ENTRY_SIZE)
b vTaskPriorityDisinheritAfterTimeout
.org (syscall_table + 64*ENTRY_SIZE)
b vTaskPrioritySet
.org (syscall_table + 65*ENTRY_SIZE)
b vTaskRemoveFromUnorderedEventList
.org (syscall_table + 66*ENTRY_SIZE)
b vTaskResume
SYSCALL_TABLE_ENTRY(vTaskList)
#endif
SYSCALL_TABLE_ENTRY(vTaskMissedYield)
SYSCALL_TABLE_ENTRY(vTaskNotifyGiveFromISR)
SYSCALL_TABLE_ENTRY(vTaskPlaceOnEventList)
SYSCALL_TABLE_ENTRY(vTaskPlaceOnEventListRestricted)
SYSCALL_TABLE_ENTRY(vTaskPlaceOnUnorderedEventList)
SYSCALL_TABLE_ENTRY(vTaskPriorityDisinheritAfterTimeout)
SYSCALL_TABLE_ENTRY(vTaskPrioritySet)
SYSCALL_TABLE_ENTRY(vTaskRemoveFromUnorderedEventList)
SYSCALL_TABLE_ENTRY(vTaskResume)
#if ( configUSE_APPLICATION_TASK_TAG == 1 )
.org (syscall_table + 67*ENTRY_SIZE)
b vTaskSetApplicationTaskTag
SYSCALL_TABLE_ENTRY(vTaskSetApplicationTaskTag)
#endif
#if ( configUSE_TRACE_FACILITY == 1 )
.org (syscall_table + 68*ENTRY_SIZE)
b vTaskSetTaskNumber
SYSCALL_TABLE_ENTRY(vTaskSetTaskNumber)
#endif
.org (syscall_table + 69*ENTRY_SIZE)
b vTaskSetThreadLocalStoragePointer
.org (syscall_table + 70*ENTRY_SIZE)
b vTaskSetTimeOutState
.org (syscall_table + 71*ENTRY_SIZE)
b vTaskStartScheduler
SYSCALL_TABLE_ENTRY(vTaskSetThreadLocalStoragePointer)
SYSCALL_TABLE_ENTRY(vTaskSetTimeOutState)
SYSCALL_TABLE_ENTRY(vTaskStartScheduler)
#if ( configUSE_TICKLESS_IDLE != 0 )
.org (syscall_table + 72*ENTRY_SIZE)
b vTaskStepTick
SYSCALL_TABLE_ENTRY(vTaskStepTick)
#endif
.org (syscall_table + 73*ENTRY_SIZE)
b vTaskSuspend
.org (syscall_table + 74*ENTRY_SIZE)
b vTaskSuspendAll
.org (syscall_table + 75*ENTRY_SIZE)
b vTaskSwitchContext
SYSCALL_TABLE_ENTRY(vTaskSuspend)
SYSCALL_TABLE_ENTRY(vTaskSuspendAll)
SYSCALL_TABLE_ENTRY(vTaskSwitchContext)
#if ( INCLUDE_xTaskAbortDelay == 1 )
.org (syscall_table + 76*ENTRY_SIZE)
b xTaskAbortDelay
SYSCALL_TABLE_ENTRY(xTaskAbortDelay)
#endif
#if ( configUSE_APPLICATION_TASK_TAG == 1 )
.org (syscall_table + 77*ENTRY_SIZE)
b xTaskCallApplicationTaskHook
SYSCALL_TABLE_ENTRY(xTaskCallApplicationTaskHook)
#endif
.org (syscall_table + 78*ENTRY_SIZE)
b xTaskCheckForTimeOut
.org (syscall_table + 79*ENTRY_SIZE)
b xTaskCreate
SYSCALL_TABLE_ENTRY(xTaskCheckForTimeOut)
SYSCALL_TABLE_ENTRY(xTaskCreate)
#if( ( portUSING_MPU_WRAPPERS == 1 ) && ( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 ) )
.org (syscall_table + 80*ENTRY_SIZE)
b xTaskCreateRestricted
SYSCALL_TABLE_ENTRY(xTaskCreateRestricted)
#endif
#if( ( portUSING_MPU_WRAPPERS == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) )
.org (syscall_table + 81*ENTRY_SIZE)
b xTaskCreateRestrictedStatic
SYSCALL_TABLE_ENTRY(xTaskCreateRestrictedStatic)
#endif
#if( configSUPPORT_STATIC_ALLOCATION == 1 )
.org (syscall_table + 82*ENTRY_SIZE)
b xTaskCreateStatic
SYSCALL_TABLE_ENTRY(xTaskCreateStatic)
#endif
.org (syscall_table + 83*ENTRY_SIZE)
b xTaskGenericNotify
.org (syscall_table + 84*ENTRY_SIZE)
b xTaskGenericNotifyFromISR
SYSCALL_TABLE_ENTRY(xTaskGenericNotify)
SYSCALL_TABLE_ENTRY(xTaskGenericNotifyFromISR)
#if ( configUSE_APPLICATION_TASK_TAG == 1 )
.org (syscall_table + 85*ENTRY_SIZE)
b xTaskGetApplicationTaskTag
SYSCALL_TABLE_ENTRY(xTaskGetApplicationTaskTag)
#endif
.org (syscall_table + 86*ENTRY_SIZE)
b xTaskGetCurrentTaskHandle
SYSCALL_TABLE_ENTRY(xTaskGetCurrentTaskHandle)
#if ( INCLUDE_xTaskGetHandle == 1 )
.org (syscall_table + 87*ENTRY_SIZE)
b xTaskGetHandle
SYSCALL_TABLE_ENTRY(xTaskGetHandle)
#endif
#if ( INCLUDE_xTaskGetIdleTaskHandle == 1 )
.org (syscall_table + 88*ENTRY_SIZE)
b xTaskGetIdleTaskHandle
#endif
.org (syscall_table + 89*ENTRY_SIZE)
b xTaskGetSchedulerState
.org (syscall_table + 90*ENTRY_SIZE)
b xTaskGetTickCount
.org (syscall_table + 91*ENTRY_SIZE)
b xTaskGetTickCountFromISR
.org (syscall_table + 92*ENTRY_SIZE)
b xTaskIncrementTick
.org (syscall_table + 93*ENTRY_SIZE)
b xTaskNotifyWait
.org (syscall_table + 94*ENTRY_SIZE)
b xTaskPriorityDisinherit
.org (syscall_table + 95*ENTRY_SIZE)
b xTaskPriorityInherit
.org (syscall_table + 96*ENTRY_SIZE)
b xTaskRemoveFromEventList
.org (syscall_table + 97*ENTRY_SIZE)
b xTaskResumeAll
.org (syscall_table + 98*ENTRY_SIZE)
b xTaskResumeFromISR
.org (syscall_table + 99*ENTRY_SIZE)
b hal_uart_getchar
.org (syscall_table + 100*ENTRY_SIZE)
b hal_uart_putchar
SYSCALL_TABLE_ENTRY(xTaskGetIdleTaskHandle)
#endif
SYSCALL_TABLE_ENTRY(xTaskGetSchedulerState)
SYSCALL_TABLE_ENTRY(xTaskGetTickCount)
SYSCALL_TABLE_ENTRY(xTaskGetTickCountFromISR)
SYSCALL_TABLE_ENTRY(xTaskIncrementTick)
SYSCALL_TABLE_ENTRY(xTaskNotifyWait)
SYSCALL_TABLE_ENTRY(xTaskPriorityDisinherit)
SYSCALL_TABLE_ENTRY(xTaskPriorityInherit)
SYSCALL_TABLE_ENTRY(xTaskRemoveFromEventList)
SYSCALL_TABLE_ENTRY(xTaskResumeAll)
SYSCALL_TABLE_ENTRY(xTaskResumeFromISR)
SYSCALL_TABLE_ENTRY(hal_uart_getchar)
SYSCALL_TABLE_ENTRY(hal_uart_putchar)
SYSCALL_TABLE_ENTRY(uxHalGetCpuId)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment