File indexing completed on 2025-05-11 08:24:45
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036 #ifdef HAVE_CONFIG_H
0037 #include "config.h"
0038 #endif
0039
0040 #include <rtems/sysinit.h>
0041 #include <rtems/score/memory.h>
0042 #include <rtems/score/thread.h>
0043
0044 #include <tmacros.h>
0045
0046 const char rtems_test_name[] = "SP 54";
0047
0048 static void *Init( uintptr_t ignored )
0049 {
0050 rtems_status_code status;
0051 rtems_task_priority pri;
0052 rtems_id id;
0053 const rtems_api_configuration_table *config;
0054
0055 puts( "Init - use valid id of API class with no objects" );
0056 status = rtems_task_set_priority(
0057 rtems_build_id(0x2,0x1,0x01,0x0001) ,
0058 RTEMS_CURRENT_PRIORITY,
0059 &pri
0060 );
0061 fatal_directive_status( status, RTEMS_INVALID_ID, "rtems_task_set_priority" );
0062
0063 puts( "Init - lookup name within API class with no objects" );
0064 status = rtems_task_ident(
0065 rtems_build_id( 0, 0, 0x12, 0x3456) ,
0066 RTEMS_SEARCH_ALL_NODES,
0067 &id
0068 );
0069 fatal_directive_status( status, RTEMS_INVALID_NAME, "rtems_task_ident" );
0070
0071 rtems_test_assert( rtems_configuration_get_do_zero_of_workspace() );
0072
0073 config = rtems_configuration_get_rtems_api_configuration();
0074 rtems_test_assert( config->number_of_initialization_tasks == 0 );
0075 rtems_test_assert( config->User_initialization_tasks_table == NULL );
0076
0077 TEST_END();
0078 rtems_test_exit(0);
0079 }
0080
0081 static void check_dirty_memory( void )
0082 {
0083 unsigned char *p;
0084
0085 TEST_BEGIN();
0086
0087 p = _Memory_Allocate( _Memory_Get(), sizeof( *p ), RTEMS_ALIGNOF( *p ) );
0088 rtems_test_assert( p != NULL );
0089 rtems_test_assert( *p == 0xcf );
0090
0091 p = (unsigned char *) _Thread_Information.Objects.initial_objects;
0092 rtems_test_assert( *p == 0xcf );
0093 }
0094
0095 RTEMS_SYSINIT_ITEM(
0096 check_dirty_memory,
0097 RTEMS_SYSINIT_DIRTY_MEMORY,
0098 RTEMS_SYSINIT_ORDER_LAST
0099 );
0100
0101 static void check_zero_workspace_automatically( void )
0102 {
0103 unsigned char *p;
0104
0105 p = _Memory_Allocate( _Memory_Get(), sizeof( *p ), RTEMS_ALIGNOF( *p ) );
0106 rtems_test_assert( p != NULL );
0107 rtems_test_assert( *p == 0 );
0108
0109 p = (unsigned char *) _Thread_Information.Objects.initial_objects;
0110 rtems_test_assert( *p == 0 );
0111 }
0112
0113 RTEMS_SYSINIT_ITEM(
0114 check_zero_workspace_automatically,
0115 RTEMS_SYSINIT_ZERO_MEMORY,
0116 RTEMS_SYSINIT_ORDER_LAST
0117 );
0118
0119
0120
0121 #define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER
0122 #define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
0123
0124
0125
0126
0127
0128 #define CONFIGURE_IDLE_TASK_BODY Init
0129 #define CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION
0130
0131 #define CONFIGURE_DIRTY_MEMORY
0132
0133
0134
0135
0136 #define CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY
0137
0138 #define CONFIGURE_INIT
0139 #include <rtems/confdefs.h>
0140
0141