mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-19 09:38:32 -04:00
Add in the CORTEX_A53_64-bit_UltraScale_MPSoC demo application (a demo has been included in the Xilinx SDK download for some time already).
Update a few demo application files to work with 64-bit data types.
This commit is contained in:
parent
51560d9a96
commit
5690221c5c
360 changed files with 206264 additions and 53 deletions
|
@ -187,8 +187,8 @@ static void prvChangeRelativePriorities( void );
|
|||
* Local pseudo random number seed and return functions. Used to avoid calls
|
||||
* to the standard library.
|
||||
*/
|
||||
static uint32_t prvRand( void );
|
||||
static void prvSRand( uint32_t ulSeed );
|
||||
static size_t prvRand( void );
|
||||
static void prvSRand( size_t uxSeed );
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
@ -223,7 +223,7 @@ expected. */
|
|||
static volatile uint32_t ulISRTxValue = queuesetINITIAL_ISR_TX_VALUE;
|
||||
|
||||
/* Used by the pseudo random number generator. */
|
||||
static uint32_t ulNextRand = 0;
|
||||
static size_t uxNextRand = 0;
|
||||
|
||||
/* The task handles are stored so their priorities can be changed. */
|
||||
TaskHandle_t xQueueSetSendingTask, xQueueSetReceivingTask;
|
||||
|
@ -295,24 +295,25 @@ BaseType_t xReturn = pdPASS, x;
|
|||
|
||||
static void prvQueueSetSendingTask( void *pvParameters )
|
||||
{
|
||||
uint32_t ulTaskTxValue = 0, ulQueueToWriteTo;
|
||||
uint32_t ulTaskTxValue = 0;
|
||||
size_t uxQueueToWriteTo;
|
||||
QueueHandle_t xQueueInUse;
|
||||
|
||||
/* Remove compiler warning about the unused parameter. */
|
||||
( void ) pvParameters;
|
||||
|
||||
/* Seed mini pseudo random number generator. */
|
||||
prvSRand( ( uint32_t ) &ulTaskTxValue );
|
||||
prvSRand( ( size_t ) &ulTaskTxValue );
|
||||
|
||||
for( ;; )
|
||||
{
|
||||
/* Generate the index for the queue to which a value is to be sent. */
|
||||
ulQueueToWriteTo = prvRand() % queuesetNUM_QUEUES_IN_SET;
|
||||
xQueueInUse = xQueues[ ulQueueToWriteTo ];
|
||||
uxQueueToWriteTo = prvRand() % queuesetNUM_QUEUES_IN_SET;
|
||||
xQueueInUse = xQueues[ uxQueueToWriteTo ];
|
||||
|
||||
/* Note which index is being written to to ensure all the queues are
|
||||
used. */
|
||||
( ulQueueUsedCounter[ ulQueueToWriteTo ] )++;
|
||||
( ulQueueUsedCounter[ uxQueueToWriteTo ] )++;
|
||||
|
||||
/* Send to the queue to unblock the task that is waiting for data to
|
||||
arrive on a queue within the queue set to which this queue belongs. */
|
||||
|
@ -719,15 +720,15 @@ uint32_t ulValueToSend = 0;
|
|||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static uint32_t prvRand( void )
|
||||
static size_t prvRand( void )
|
||||
{
|
||||
ulNextRand = ( ulNextRand * 1103515245UL ) + 12345UL;
|
||||
return ( ulNextRand / 65536UL ) % 32768UL;
|
||||
uxNextRand = ( uxNextRand * ( size_t ) 1103515245 ) + ( size_t ) 12345;
|
||||
return ( uxNextRand / ( size_t ) 65536 ) % ( size_t ) 32768;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static void prvSRand( uint32_t ulSeed )
|
||||
static void prvSRand( size_t uxSeed )
|
||||
{
|
||||
ulNextRand = ulSeed;
|
||||
uxNextRand = uxSeed;
|
||||
}
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
#include "TaskNotify.h"
|
||||
|
||||
#define notifyTASK_PRIORITY ( tskIDLE_PRIORITY )
|
||||
|
||||
#define notifyUINT32_MAX ( ( uint32_t ) 0xffffffff )
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/*
|
||||
|
@ -128,7 +128,7 @@ static uint32_t ulTimerNotificationsReceived = 0UL, ulTimerNotificationsSent = 0
|
|||
static TimerHandle_t xTimer = NULL;
|
||||
|
||||
/* Used by the pseudo random number generating function. */
|
||||
static uint32_t ulNextRand = 0;
|
||||
static size_t uxNextRand = 0;
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
@ -139,7 +139,7 @@ void vStartTaskNotifyTask( void )
|
|||
xTaskCreate( prvNotifiedTask, "Notified", configMINIMAL_STACK_SIZE, NULL, notifyTASK_PRIORITY, &xTaskToNotify );
|
||||
|
||||
/* Pseudo seed the random number generator. */
|
||||
ulNextRand = ( uint32_t ) prvRand;
|
||||
uxNextRand = ( size_t ) prvRand;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
@ -155,7 +155,7 @@ const uint32_t ulBit0 = 0x01UL, ulBit1 = 0x02UL;
|
|||
/* -------------------------------------------------------------------------
|
||||
Check blocking when there are no notifications. */
|
||||
xTimeOnEntering = xTaskGetTickCount();
|
||||
xReturned = xTaskNotifyWait( ULONG_MAX, 0, &ulNotifiedValue, xTicksToWait );
|
||||
xReturned = xTaskNotifyWait( notifyUINT32_MAX, 0, &ulNotifiedValue, xTicksToWait );
|
||||
|
||||
/* Should have blocked for the entire block time. */
|
||||
if( ( xTaskGetTickCount() - xTimeOnEntering ) < xTicksToWait )
|
||||
|
@ -183,7 +183,7 @@ const uint32_t ulBit0 = 0x01UL, ulBit1 = 0x02UL;
|
|||
|
||||
/* The task should now have a notification pending, and so not time out. */
|
||||
xTimeOnEntering = xTaskGetTickCount();
|
||||
xReturned = xTaskNotifyWait( ULONG_MAX, 0, &ulNotifiedValue, xTicksToWait );
|
||||
xReturned = xTaskNotifyWait( notifyUINT32_MAX, 0, &ulNotifiedValue, xTicksToWait );
|
||||
|
||||
if( ( xTaskGetTickCount() - xTimeOnEntering ) >= xTicksToWait )
|
||||
{
|
||||
|
@ -215,7 +215,7 @@ const uint32_t ulBit0 = 0x01UL, ulBit1 = 0x02UL;
|
|||
|
||||
/* Waiting for the notification should now return immediately so a block
|
||||
time of zero is used. */
|
||||
xReturned = xTaskNotifyWait( ULONG_MAX, 0, &ulNotifiedValue, 0 );
|
||||
xReturned = xTaskNotifyWait( notifyUINT32_MAX, 0, &ulNotifiedValue, 0 );
|
||||
|
||||
configASSERT( xReturned == pdPASS );
|
||||
configASSERT( ulNotifiedValue == ulFirstNotifiedConst );
|
||||
|
@ -233,7 +233,7 @@ const uint32_t ulBit0 = 0x01UL, ulBit1 = 0x02UL;
|
|||
configASSERT( xReturned == pdPASS );
|
||||
xReturned = xTaskNotify( xTaskToNotify, ulSecondNotifiedValueConst, eSetValueWithOverwrite );
|
||||
configASSERT( xReturned == pdPASS );
|
||||
xReturned = xTaskNotifyWait( ULONG_MAX, 0, &ulNotifiedValue, 0 );
|
||||
xReturned = xTaskNotifyWait( notifyUINT32_MAX, 0, &ulNotifiedValue, 0 );
|
||||
configASSERT( xReturned == pdPASS );
|
||||
configASSERT( ulNotifiedValue == ulSecondNotifiedValueConst );
|
||||
|
||||
|
@ -246,7 +246,7 @@ const uint32_t ulBit0 = 0x01UL, ulBit1 = 0x02UL;
|
|||
remain at ulSecondNotifiedConst. */
|
||||
xReturned = xTaskNotify( xTaskToNotify, ulFirstNotifiedConst, eNoAction );
|
||||
configASSERT( xReturned == pdPASS );
|
||||
xReturned = xTaskNotifyWait( ULONG_MAX, 0, &ulNotifiedValue, 0 );
|
||||
xReturned = xTaskNotifyWait( notifyUINT32_MAX, 0, &ulNotifiedValue, 0 );
|
||||
configASSERT( ulNotifiedValue == ulSecondNotifiedValueConst );
|
||||
|
||||
|
||||
|
@ -262,7 +262,7 @@ const uint32_t ulBit0 = 0x01UL, ulBit1 = 0x02UL;
|
|||
configASSERT( xReturned == pdPASS );
|
||||
}
|
||||
|
||||
xReturned = xTaskNotifyWait( ULONG_MAX, 0, &ulNotifiedValue, 0 );
|
||||
xReturned = xTaskNotifyWait( notifyUINT32_MAX, 0, &ulNotifiedValue, 0 );
|
||||
configASSERT( xReturned == pdPASS );
|
||||
configASSERT( ulNotifiedValue == ( ulSecondNotifiedValueConst + ulMaxLoops ) );
|
||||
|
||||
|
@ -282,7 +282,7 @@ const uint32_t ulBit0 = 0x01UL, ulBit1 = 0x02UL;
|
|||
ulLoop = 0;
|
||||
|
||||
/* Start with all bits clear. */
|
||||
xTaskNotifyWait( ULONG_MAX, 0, &ulNotifiedValue, 0 );
|
||||
xTaskNotifyWait( notifyUINT32_MAX, 0, &ulNotifiedValue, 0 );
|
||||
|
||||
do
|
||||
{
|
||||
|
@ -300,7 +300,7 @@ const uint32_t ulBit0 = 0x01UL, ulBit1 = 0x02UL;
|
|||
/* Use the next bit on the next iteration around this loop. */
|
||||
ulNotifyingValue <<= 1UL;
|
||||
|
||||
} while ( ulNotifiedValue != ULONG_MAX );
|
||||
} while ( ulNotifiedValue != notifyUINT32_MAX );
|
||||
|
||||
/* As a 32-bit value was used the loop should have executed 32 times before
|
||||
all the bits were set. */
|
||||
|
@ -320,15 +320,15 @@ const uint32_t ulBit0 = 0x01UL, ulBit1 = 0x02UL;
|
|||
configASSERT( xReturned == pdFAIL );
|
||||
|
||||
/* Notify the task with no action so as not to update the bits even though
|
||||
ULONG_MAX is used as the notification value. */
|
||||
xTaskNotify( xTaskToNotify, ULONG_MAX, eNoAction );
|
||||
notifyUINT32_MAX is used as the notification value. */
|
||||
xTaskNotify( xTaskToNotify, notifyUINT32_MAX, eNoAction );
|
||||
|
||||
/* Reading back the value should should find bit 0 is clear, as this was
|
||||
cleared on entry, but bit 1 is not clear as it will not have been cleared on
|
||||
exit as no notification was received. */
|
||||
xReturned = xTaskNotifyWait( 0x00UL, 0x00UL, &ulNotifiedValue, 0 );
|
||||
configASSERT( xReturned == pdPASS );
|
||||
configASSERT( ulNotifiedValue == ( ULONG_MAX & ~ulBit0 ) );
|
||||
configASSERT( ulNotifiedValue == ( notifyUINT32_MAX & ~ulBit0 ) );
|
||||
|
||||
|
||||
|
||||
|
@ -343,25 +343,25 @@ const uint32_t ulBit0 = 0x01UL, ulBit1 = 0x02UL;
|
|||
/* However as the bit is cleared on exit, after the returned notification
|
||||
value is set, the returned notification value should not have the bit
|
||||
cleared... */
|
||||
configASSERT( ulNotifiedValue == ( ULONG_MAX & ~ulBit0 ) );
|
||||
configASSERT( ulNotifiedValue == ( notifyUINT32_MAX & ~ulBit0 ) );
|
||||
|
||||
/* ...but reading the value back again should find that the bit was indeed
|
||||
cleared internally. The returned value should be pdFAIL however as nothing
|
||||
has notified the task in the mean time. */
|
||||
xReturned = xTaskNotifyWait( 0x00, 0x00, &ulNotifiedValue, 0 );
|
||||
configASSERT( xReturned == pdFAIL );
|
||||
configASSERT( ulNotifiedValue == ( ULONG_MAX & ~( ulBit0 | ulBit1 ) ) );
|
||||
configASSERT( ulNotifiedValue == ( notifyUINT32_MAX & ~( ulBit0 | ulBit1 ) ) );
|
||||
|
||||
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------------
|
||||
Now try querying the previous value while notifying a task. */
|
||||
Now try querying the previus value while notifying a task. */
|
||||
xTaskNotifyAndQuery( xTaskToNotify, 0x00, eSetBits, &ulPreviousValue );
|
||||
configASSERT( ulNotifiedValue == ( ULONG_MAX & ~( ulBit0 | ulBit1 ) ) );
|
||||
configASSERT( ulNotifiedValue == ( notifyUINT32_MAX & ~( ulBit0 | ulBit1 ) ) );
|
||||
|
||||
/* Clear all bits. */
|
||||
xTaskNotifyWait( 0x00, ULONG_MAX, &ulNotifiedValue, 0 );
|
||||
xTaskNotifyWait( 0x00, notifyUINT32_MAX, &ulNotifiedValue, 0 );
|
||||
xTaskNotifyAndQuery( xTaskToNotify, 0x00, eSetBits, &ulPreviousValue );
|
||||
configASSERT( ulPreviousValue == 0 );
|
||||
|
||||
|
@ -380,7 +380,7 @@ const uint32_t ulBit0 = 0x01UL, ulBit1 = 0x02UL;
|
|||
|
||||
/* -------------------------------------------------------------------------
|
||||
Clear the previous notifications. */
|
||||
xTaskNotifyWait( ULONG_MAX, 0, &ulNotifiedValue, 0 );
|
||||
xTaskNotifyWait( notifyUINT32_MAX, 0, &ulNotifiedValue, 0 );
|
||||
|
||||
/* The task should not have any notifications pending, so an attempt to clear
|
||||
the notification state should fail. */
|
||||
|
@ -402,7 +402,7 @@ const uint32_t ulBit0 = 0x01UL, ulBit1 = 0x02UL;
|
|||
ulNotifyCycleCount++;
|
||||
|
||||
/* Leave all bits cleared. */
|
||||
xTaskNotifyWait( ULONG_MAX, 0, NULL, 0 );
|
||||
xTaskNotifyWait( notifyUINT32_MAX, 0, NULL, 0 );
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
@ -594,10 +594,10 @@ const uint32_t ulMaxSendReceiveDeviation = 5UL;
|
|||
|
||||
static UBaseType_t prvRand( void )
|
||||
{
|
||||
const uint32_t ulMultiplier = 0x015a4e35UL, ulIncrement = 1UL;
|
||||
const size_t uxMultiplier = ( size_t ) 0x015a4e35, uxIncrement = ( size_t ) 1;
|
||||
|
||||
/* Utility function to generate a pseudo random number. */
|
||||
ulNextRand = ( ulMultiplier * ulNextRand ) + ulIncrement;
|
||||
return( ( ulNextRand >> 16UL ) & 0x7fffUL );
|
||||
uxNextRand = ( uxMultiplier * uxNextRand ) + uxIncrement;
|
||||
return( ( uxNextRand >> 16 ) & ( ( size_t ) 0x7fff ) );
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
|
|
@ -1044,12 +1044,12 @@ static TickType_t uxTick = ( TickType_t ) -1;
|
|||
|
||||
static void prvAutoReloadTimerCallback( TimerHandle_t pxExpiredTimer )
|
||||
{
|
||||
uint32_t ulTimerID;
|
||||
size_t uxTimerID;
|
||||
|
||||
ulTimerID = ( uint32_t ) pvTimerGetTimerID( pxExpiredTimer );
|
||||
if( ulTimerID <= ( configTIMER_QUEUE_LENGTH + 1 ) )
|
||||
uxTimerID = ( size_t ) pvTimerGetTimerID( pxExpiredTimer );
|
||||
if( uxTimerID <= ( configTIMER_QUEUE_LENGTH + 1 ) )
|
||||
{
|
||||
( ucAutoReloadTimerCounters[ ulTimerID ] )++;
|
||||
( ucAutoReloadTimerCounters[ uxTimerID ] )++;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1065,19 +1065,19 @@ static void prvOneShotTimerCallback( TimerHandle_t pxExpiredTimer )
|
|||
/* A count is kept of the number of times this callback function is executed.
|
||||
The count is stored as the timer's ID. This is only done to test the
|
||||
vTimerSetTimerID() function. */
|
||||
static uint32_t ulCallCount = 0;
|
||||
uint32_t ulLastCallCount;
|
||||
static size_t uxCallCount = 0;
|
||||
size_t uxLastCallCount;
|
||||
|
||||
/* Obtain the timer's ID, which should be a count of the number of times
|
||||
this callback function has been executed. */
|
||||
ulLastCallCount = ( uint32_t ) pvTimerGetTimerID( pxExpiredTimer );
|
||||
configASSERT( ulLastCallCount == ulCallCount );
|
||||
uxLastCallCount = ( size_t ) pvTimerGetTimerID( pxExpiredTimer );
|
||||
configASSERT( uxLastCallCount == uxCallCount );
|
||||
|
||||
/* Increment the call count, then save it back as the timer's ID. This is
|
||||
only done to test the vTimerSetTimerID() API function. */
|
||||
ulLastCallCount++;
|
||||
vTimerSetTimerID( pxExpiredTimer, ( void * ) ulLastCallCount );
|
||||
ulCallCount++;
|
||||
uxLastCallCount++;
|
||||
vTimerSetTimerID( pxExpiredTimer, ( void * ) uxLastCallCount );
|
||||
uxCallCount++;
|
||||
|
||||
ucOneShotTimerCounter++;
|
||||
}
|
||||
|
|
|
@ -148,7 +148,7 @@ static portTASK_FUNCTION_PROTO( vQueueSendWhenSuspendedTask, pvParameters );
|
|||
|
||||
/* Demo task specific constants. */
|
||||
#define priSTACK_SIZE ( configMINIMAL_STACK_SIZE )
|
||||
#define priSLEEP_TIME ( ( TickType_t ) 128 / portTICK_PERIOD_MS )
|
||||
#define priSLEEP_TIME pdMS_TO_TICKS( 128 )
|
||||
#define priLOOPS ( 5 )
|
||||
#define priMAX_COUNT ( ( uint32_t ) 0xff )
|
||||
#define priNO_BLOCK ( ( TickType_t ) 0 )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue