Changeset d5154d0f in rtems for c/src/ada-tests


Ignore:
Timestamp:
Dec 23, 2015, 8:44:02 PM (6 years ago)
Author:
Aun-Ali Zaidi <admin@…>
Branches:
5, master
Children:
2268ee6
Parents:
a48b7c44
git-author:
Aun-Ali Zaidi <admin@…> (12/23/15 20:44:02)
git-committer:
Joel Sherrill <joel.sherrill@…> (12/24/15 22:52:34)
Message:

api: Remove deprecated Notepads

Notepads where a feature of RTEMS' tasks that simply functioned in
the same way as POSIX keys or threaded local storage (TLS). They were
introduced well before per task variables, which are also deprecated,
and were barely used in favor of their POSIX alternatives.

In addition to their scarce usage, Notepads took up unnecessary memory.
For each task:

  • 16 32-bit integers were allocated.
  • A total of 64 bytes per task per thread.

This is especially critical in low memory and safety-critical applications.

They are also defined as uint32_t, and therefore are not guaranteed to
hold a pointer.

Lastly, they are not portable solutions for SMP and uniprocessor systems,
like POSIX keys and TLS.

updates #2493.

Location:
c/src/ada-tests
Files:
12 deleted
13 edited

Legend:

Unmodified
Added
Removed
  • c/src/ada-tests/ada_mvscn

    ra48b7c44 rd5154d0f  
    1212./sptests/sp19/sp19.scn
    1313./sptests/sp09/sp09.scn
    14 ./sptests/sp07/sp07.scn
    1514./sptests/sp12/sp12.scn
    1615./sptests/sp14/sp14.scn
  • c/src/ada-tests/configure.ac

    ra48b7c44 rd5154d0f  
    118118mptests/mp01/node1/Makefile
    119119mptests/mp01/node2/Makefile
    120 mptests/mp02/Makefile
    121 mptests/mp02/node1/Makefile
    122 mptests/mp02/node2/Makefile
    123120mptests/mp03/Makefile
    124121mptests/mp03/node1/Makefile
  • c/src/ada-tests/mptests/Makefile.am

    ra48b7c44 rd5154d0f  
    11SUBDIRS =
    22SUBDIRS += mp01
    3 SUBDIRS += mp02
    43SUBDIRS += mp03
    54SUBDIRS += mp04
  • c/src/ada-tests/sptests/sp07/ada_sp07.scn

    ra48b7c44 rd5154d0f  
    99TASKS_START - TA4  - started.
    1010TASKS_RESTART - TA3  - restarted.
    11 INIT - task_set_note - set TA1's NOTEPAD_8 to TA1's initial priority:  4
    12 INIT - task_set_note - set TA2's NOTEPAD_8 to TA2's initial priority:  4
    1311<pause>
    1412TA1 - task_set_priority - get initial priority of self:  4
    15 TA1 - task_get_note - get NOTEPAD_8 - current priority:  4
    16 TA1 - task_set_note - set TA2's NOTEPAD_8:  3
    1713TA1 - task_set_priority - set TA2's priority:  3
    18 TA2 - task_get_note - get NOTEPAD_8 - current priority:  3
    19 TA2 - task_set_note - set TA1's NOTEPAD_8:  2
    2014TA2 - task_set_priority - set TA1's priority:  2
    21 TA1 - task_get_note - get NOTEPAD_8 - current priority:  2
    22 TA1 - task_set_note - set TA2's NOTEPAD_8:  1
    2315TA1 - task_set_priority - set TA2's priority:  1
    24 TA2 - task_get_note - get NOTEPAD_8 - current priority:  1
    2516TA2 - task_suspend - suspend TA1
    2617TA2 - task_set_priority - set priority of TA1 ( blocked )
  • c/src/ada-tests/sptests/sp07/sptest.adb

    ra48b7c44 rd5154d0f  
    230230      Flush_Task_Event_Log;
    231231
    232       RTEMS.TASKS.SET_NOTE( SPTEST.TASK_ID( 1 ), 8, 4, STATUS );
    233       TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_NOTE OF TA1" );
    234       TEXT_IO.PUT( "INIT - task_set_note - set TA1's NOTEPAD_8" );
    235       TEXT_IO.PUT_LINE( " to TA1's initial priority:  4" );
    236      
    237       RTEMS.TASKS.SET_NOTE( SPTEST.TASK_ID( 2 ), 8, 4, STATUS );
    238       TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_NOTE OF TA2" );
    239       TEXT_IO.PUT( "INIT - task_set_note - set TA2's NOTEPAD_8" );
    240       TEXT_IO.PUT_LINE( " to TA2's initial priority:  4" );
    241 
    242232      RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS );
    243233      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
     
    273263
    274264      loop
    275 
    276          RTEMS.TASKS.GET_NOTE( RTEMS.SELF, 8, THE_PRIORITY, STATUS );
    277          TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_GET_NOTE" );
    278          TEXT_IO.PUT( "TA1 - task_get_note - ");
    279          TEXT_IO.PUT( "get NOTEPAD_8 - current priority: " );
    280          UNSIGNED32_IO.PUT( THE_PRIORITY, BASE => 10, WIDTH => 2 );
    281          TEXT_IO.NEW_LINE;
    282265
    283266         THE_PRIORITY := THE_PRIORITY - 1;
     
    305288
    306289         end if;
    307 
    308          TEXT_IO.PUT( "TA1 - task_set_note - set TA2's NOTEPAD_8: " );
    309          UNSIGNED32_IO.PUT( THE_PRIORITY, BASE => 10, WIDTH => 2 );
    310          TEXT_IO.NEW_LINE;
    311          RTEMS.TASKS.SET_NOTE(
    312             SPTEST.TASK_ID( 2 ),
    313             8,
    314             THE_PRIORITY,
    315             STATUS
    316          );
    317          TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_NOTE" );
    318290
    319291         TEXT_IO.PUT("TA1 - task_set_priority - set TA2's priority: ");
     
    347319      loop
    348320
    349          RTEMS.TASKS.GET_NOTE( RTEMS.SELF, 8, THE_PRIORITY, STATUS );
    350          TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_GET_NOTE" );
    351          TEXT_IO.PUT( "TA2 - task_get_note - ");
    352          TEXT_IO.PUT( "get NOTEPAD_8 - current priority: " );
    353          UNSIGNED32_IO.PUT( THE_PRIORITY, BASE => 10, WIDTH => 2 );
    354          TEXT_IO.NEW_LINE;
    355 
    356321         THE_PRIORITY := THE_PRIORITY - 1;
    357322
     
    387352
    388353         else
    389 
    390             TEXT_IO.PUT( "TA2 - task_set_note - set TA1's NOTEPAD_8: " );
    391             UNSIGNED32_IO.PUT( THE_PRIORITY, BASE => 10, WIDTH => 2 );
    392             TEXT_IO.NEW_LINE;
    393             RTEMS.TASKS.SET_NOTE(
    394                SPTEST.TASK_ID( 1 ),
    395                8,
    396                THE_PRIORITY,
    397                STATUS
    398             );
    399             TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_NOTE" );
    400354
    401355            TEXT_IO.PUT( "TA2 - task_set_priority - ");
  • c/src/ada-tests/sptests/sp09/ada_sp09.scn

    ra48b7c44 rd5154d0f  
    33INIT - task_restart - INCORRECT_STATE
    44TA1 - task_delete - INVALID_ID
    5 TA1 - task_get_note - INVALID_NUMBER
    6 TA1 - task_get_note - INVALID_ID
    75TA1 - task_ident - current task SUCCESSFUL
    86TA1 - task_ident - global INVALID_NAME
     
    1412TA1 - task_set_priority - INVALID_PRIORITY
    1513TA1 - task_set_priority - INVALID_ID
    16 TA1 - task_set_note - INVALID_NUMBER
    17 TA1 - task_set_note - INVALID_ID
    1814TA1 - task_start - INVALID_ID
    1915TA1 - task_start - INCORRECT_STATE
  • c/src/ada-tests/sptests/sp09/sptest.adb

    ra48b7c44 rd5154d0f  
    149149   procedure SCREEN_1
    150150   is
    151       NOTEPAD_VALUE     : RTEMS.UNSIGNED32 := 0;
    152151      SELF_ID           : RTEMS.ID;
    153152      PREVIOUS_PRIORITY : RTEMS.TASKS.PRIORITY;
     
    162161      );
    163162      TEXT_IO.PUT_LINE( "TA1 - task_delete - INVALID_ID" );
    164 
    165       begin
    166         RTEMS.TASKS.GET_NOTE( RTEMS.SELF,
    167                              RTEMS.NOTEPAD_INDEX'LAST + 10,
    168                              NOTEPAD_VALUE,
    169                              STATUS
    170         );
    171         TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
    172            STATUS,
    173            RTEMS.INVALID_NUMBER,
    174            "TASK_GET_NOTE WITH ILLEGAL NOTEPAD"
    175         );
    176         TEXT_IO.PUT_LINE( "TA1 - task_get_note - INVALID_NUMBER" );
    177       exception
    178          when others =>
    179             TEXT_IO.PUT_LINE(
    180                "TA1 - task_get_note - INVALID_NUMBER -- constraint error"
    181             );
    182       end;
    183 
    184       RTEMS.TASKS.GET_NOTE(
    185          100,
    186          RTEMS.NOTEPAD_INDEX'LAST,
    187          NOTEPAD_VALUE,
    188          STATUS
    189       );
    190       TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
    191          STATUS,
    192          RTEMS.INVALID_ID,
    193          "TASK_GET_NOTE WITH ILLEGAL ID"
    194       );
    195       TEXT_IO.PUT_LINE( "TA1 - task_get_note - INVALID_ID" );
    196163
    197164      RTEMS.TASKS.IDENT(
     
    295262      );
    296263      TEXT_IO.PUT_LINE( "TA1 - task_set_priority - INVALID_ID" );
    297 
    298       begin
    299          RTEMS.TASKS.SET_NOTE( RTEMS.SELF,
    300                               RTEMS.NOTEPAD_INDEX'LAST + 10,
    301                               NOTEPAD_VALUE,
    302                               STATUS
    303          );
    304          TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
    305             STATUS,
    306             RTEMS.INVALID_NUMBER,
    307             "TASK_SET_NOTE WITH ILLEGAL NOTEPAD"
    308          );
    309          TEXT_IO.PUT_LINE( "TA1 - task_set_note - INVALID_NUMBER" );
    310       exception
    311          when others =>
    312             TEXT_IO.PUT_LINE(
    313                "TA1 - task_set_note - INVALID_NUMBER -- constraint error"
    314             );
    315       end;
    316 
    317       RTEMS.TASKS.SET_NOTE(
    318          100,
    319          RTEMS.NOTEPAD_INDEX'LAST,
    320          NOTEPAD_VALUE,
    321          STATUS
    322       );
    323       TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
    324          STATUS,
    325          RTEMS.INVALID_ID,
    326          "TASK_SET_NOTE WITH ILLEGAL ID"
    327       );
    328       TEXT_IO.PUT_LINE( "TA1 - task_set_note - INVALID_ID" );
    329264
    330265      RTEMS.TASKS.START( 100, SPTEST.TASK_1'ACCESS, 0, STATUS );
  • c/src/ada-tests/support/init.c

    ra48b7c44 rd5154d0f  
    4848)
    4949{
    50   return tcb->Object.id; /* Only for sp04 and sp07 */
     50  return tcb->Object.id; /* Only for sp04 */
    5151}
    5252
  • c/src/ada-tests/tmtests/tm08/tmtest.adb

    ra48b7c44 rd5154d0f  
    100100      OLD_PRIORITY : RTEMS.TASKS.PRIORITY;
    101101      OLD_MODE     : RTEMS.MODE;
    102       OLD_NOTE     : RTEMS.NOTEPAD_INDEX;
    103102      TIME         : RTEMS.TIME_OF_DAY;
    104103      STATUS       : RTEMS.STATUS_CODES;
     
    234233      );
    235234
    236       TIMER_DRIVER.INITIALIZE;
    237          for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
    238          loop
    239             RTEMS.TASKS.SET_NOTE(
    240                TMTEST.TASK_ID,
    241                8,
    242                10,
    243                STATUS
    244             );
    245          end loop;
    246       TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
    247       TIME_TEST_SUPPORT.PUT_TIME(
    248          "TASK_SET_NOTE ",
    249          TMTEST.END_TIME,
    250          TIME_TEST_SUPPORT.OPERATION_COUNT,
    251          OVERHEAD,
    252          RTEMS_CALLING_OVERHEAD.TASK_SET_NOTE
    253       );
    254 
    255       TIMER_DRIVER.INITIALIZE;
    256          for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
    257          loop
    258             RTEMS.TASKS.GET_NOTE(
    259                TMTEST.TASK_ID,
    260                8,
    261                OLD_NOTE,
    262                STATUS
    263             );
    264          end loop;
    265       TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
    266       TIME_TEST_SUPPORT.PUT_TIME(
    267          "TASK_GET_NOTE ",
    268          TMTEST.END_TIME,
    269          TIME_TEST_SUPPORT.OPERATION_COUNT,
    270          OVERHEAD,
    271          RTEMS_CALLING_OVERHEAD.TASK_GET_NOTE
    272       );
    273 
    274235      TIME := (1988, 1, 1, 0, 0, 0, 0 );
    275236
  • c/src/ada-tests/tmtests/tm08/tmtest.ads

    ra48b7c44 rd5154d0f  
    7070--    + TASK_MODE which does require a reschedule
    7171--    + TASK_MODE which causes a preemption *** TEST_TASK1 executes
    72 --    + TASK_SET_NOTE
    73 --    + TASK_GET_NOTE
    7472--    + CLOCK_SET
    7573--    + CLOCK_GET
  • c/src/ada-tests/tmtests/tmoverhd/dummy_rtems.adb

    ra48b7c44 rd5154d0f  
    151151   end TASK_MODE;
    152152
    153    procedure TASK_GET_NOTE (
    154       ID      : in     RTEMS.ID;
    155       NOTEPAD : in     RTEMS.NOTEPAD_INDEX;
    156       NOTE    :    out RTEMS.UNSIGNED32;
    157       RESULT  :    out RTEMS.STATUS_CODES
    158    ) is
    159       pragma Unreferenced(ID);
    160       pragma Unreferenced(NOTEPAD);
    161    begin
    162 
    163       NOTE := 0;
    164       RESULT := RTEMS.SUCCESSFUL;
    165 
    166    end TASK_GET_NOTE;
    167 
    168    procedure TASK_SET_NOTE (
    169       ID      : in     RTEMS.ID;
    170       NOTEPAD : in     RTEMS.NOTEPAD_INDEX;
    171       NOTE    : in     RTEMS.UNSIGNED32;
    172       RESULT  :    out RTEMS.STATUS_CODES
    173    ) is
    174       pragma Unreferenced(ID);
    175       pragma Unreferenced(NOTEPAD);
    176       pragma Unreferenced(NOTE);
    177    begin
    178 
    179       RESULT := RTEMS.SUCCESSFUL;
    180 
    181    end TASK_SET_NOTE;
    182 
    183153   procedure TASK_WAKE_WHEN (
    184154      TIME_BUFFER : in     RTEMS.TIME_OF_DAY;
  • c/src/ada-tests/tmtests/tmoverhd/dummy_rtems.ads

    ra48b7c44 rd5154d0f  
    8888   );
    8989
    90    procedure TASK_GET_NOTE (
    91       ID      : in     RTEMS.ID;
    92       NOTEPAD : in     RTEMS.NOTEPAD_INDEX;
    93       NOTE    :    out RTEMS.UNSIGNED32;
    94       RESULT  :    out RTEMS.STATUS_CODES
    95    );
    96 
    97    procedure TASK_SET_NOTE (
    98       ID      : in     RTEMS.ID;
    99       NOTEPAD : in     RTEMS.NOTEPAD_INDEX;
    100       NOTE    : in     RTEMS.UNSIGNED32;
    101       RESULT  :    out RTEMS.STATUS_CODES
    102    );
    103 
    10490   procedure TASK_WAKE_WHEN (
    10591      TIME_BUFFER : in     RTEMS.TIME_OF_DAY;
  • c/src/ada-tests/tmtests/tmoverhd/tmtest.adb

    ra48b7c44 rd5154d0f  
    131131      MASK           : RTEMS.MODE;
    132132      OUT_MODE       : RTEMS.MODE;
    133       NOTE           : RTEMS.UNSIGNED32;
    134133      TIME           : RTEMS.TIME_OF_DAY;
    135134      TIMEOUT        : RTEMS.INTERVAL;
     
    332331      );
    333332
    334 -- TASK_GET_NOTE
    335 
    336       TIMER_DRIVER.INITIALIZE;
    337          for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
    338          loop
    339             DUMMY_RTEMS.TASK_GET_NOTE( ID, 1, NOTE, STATUS );
    340          end loop;
    341       TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
    342 
    343       TIME_TEST_SUPPORT.PUT_TIME(
    344          "TASK_GET_NOTE",
    345          TMTEST.END_TIME,
    346          TIME_TEST_SUPPORT.OPERATION_COUNT,
    347          OVERHEAD,
    348          0
    349       );
    350 
    351 -- TASK_SET_NOTE
    352 
    353       TIMER_DRIVER.INITIALIZE;
    354          for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT
    355          loop
    356             DUMMY_RTEMS.TASK_SET_NOTE( ID, 1, NOTE, STATUS );
    357          end loop;
    358       TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER;
    359 
    360       TIME_TEST_SUPPORT.PUT_TIME(
    361          "TASK_SET_NOTE",
    362          TMTEST.END_TIME,
    363          TIME_TEST_SUPPORT.OPERATION_COUNT,
    364          OVERHEAD,
    365          0
    366       );
    367 
    368333-- TASK_WAKE_WHEN
    369334
Note: See TracChangeset for help on using the changeset viewer.