Changeset bbf6253 in rtems


Ignore:
Timestamp:
Oct 9, 2009, 1:43:36 PM (10 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, master
Children:
031b57c
Parents:
4ee2c53
Message:

2009-10-09 Sebastian Huber <Sebastian.Huber@…>

  • sp40/init.c, sp40/sp40.doc, sp40/sp40.scn: New test cases.
  • spintrcritical09/init.c, spintrcritical10/init.c, spintrcritical11/init.c: Fixed potentially infinite loops.
Location:
testsuites/sptests
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • testsuites/sptests/ChangeLog

    r4ee2c53 rbbf6253  
     12009-10-09      Sebastian Huber <Sebastian.Huber@embedded-brains.de>
     2
     3        * sp40/init.c, sp40/sp40.doc, sp40/sp40.scn: New test cases.
     4
    152009-10-04      Sebastian Huber <Sebastian.Huber@embedded-brains.de>
    26
    3         * sptests/spintrcritical09/init.c, sptests/spintrcritical10/init.c,
    4         sptests/spintrcritical11/init.c: Fixed potentially infinite loops.
     7        * spintrcritical09/init.c, spintrcritical10/init.c,
     8        spintrcritical11/init.c: Fixed potentially infinite loops.
    59        * sp20/system.h: Increased micro seconds per tick in order to be more
    610        independent of the console output speed.
  • testsuites/sptests/sp40/init.c

    r4ee2c53 rbbf6253  
    44 *  COPYRIGHT (c) 1989-2007.
    55 *  On-Line Applications Research Corporation (OAR).
     6 *
     7 *  Copyright (c) 2009 embedded brains GmbH.
    68 *
    79 *  The license and distribution terms for this file may be
     
    1214 */
    1315
     16#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
     17
    1418#include <tmacros.h>
    1519
    16 rtems_device_driver test_open(
     20static rtems_device_driver test_open(
    1721     rtems_device_major_number  minor,
    1822     rtems_device_minor_number  major,
     
    2024)
    2125{
     26  return RTEMS_IO_ERROR;
    2227}
    2328
    24 rtems_driver_address_table test_driver = {
    25   NULL,                               /* initialization procedure */
    26   test_open,                          /* open request procedure */
    27   NULL,                               /* close request procedure */
    28   NULL,                               /* read request procedure */
    29   NULL,                               /* write request procedure */
    30   NULL,                               /* special functions procedure */
     29static rtems_driver_address_table test_driver = {
     30  .initialization_entry = NULL,
     31  .open_entry = test_open,
     32  .close_entry = NULL,
     33  .read_entry = NULL,
     34  .write_entry = NULL,
     35  .control_entry = NULL
    3136};
     37
     38#define test_interrupt_context_enter( level ) \
     39  do { \
     40    _Thread_Disable_dispatch(); \
     41    rtems_interrupt_disable( level ); \
     42    ++_ISR_Nest_level; \
     43  } while (0)
     44
     45#define test_interrupt_context_leave( level ) \
     46  do { \
     47    --_ISR_Nest_level; \
     48    rtems_interrupt_enable( level ); \
     49    _Thread_Enable_dispatch(); \
     50  } while (0)
     51
    3252rtems_task Init(
    3353  rtems_task_argument argument
     
    3757  rtems_device_major_number registered;
    3858  rtems_device_major_number registered_not;
     59  rtems_device_major_number invalid_major = _IO_Number_of_drivers + 1;
     60  rtems_interrupt_level level;
    3961
    4062  puts( "\n\n*** TEST 40 ***" );
     
    5981
    6082  puts( "Init - rtems_io_register_driver - used slot" );
    61   sc = rtems_io_register_driver( registered, &test_driver, &registered );
     83  sc = rtems_io_register_driver( registered, &test_driver, &registered_not );
    6284  fatal_directive_status(
    6385    sc,
     
    6688  );
    6789
     90  puts( "Init - rtems_io_unregister_driver - used slot" );
     91  sc = rtems_io_unregister_driver( registered );
     92  directive_failed( sc, "rtems_io_unregister_driver" );
     93
     94  puts( "Init - rtems_io_register_driver - free slot" );
     95  sc = rtems_io_register_driver( registered, &test_driver, &registered );
     96  directive_failed( sc, "rtems_io_register_driver" );
     97
     98  puts( "Init - rtems_io_register_driver - called from interrupt context" );
     99  test_interrupt_context_enter( level );
     100  sc = rtems_io_register_driver( 0, NULL, NULL );
     101  test_interrupt_context_leave( level );
     102  fatal_directive_status(
     103    sc,
     104    RTEMS_CALLED_FROM_ISR,
     105    "rtems_io_register_driver"
     106  );
     107
     108  puts( "Init - rtems_io_register_driver - invalid registered major pointer" );
     109  sc = rtems_io_register_driver( 0, NULL, NULL );
     110  fatal_directive_status(
     111    sc,
     112    RTEMS_INVALID_ADDRESS,
     113    "rtems_io_register_driver"
     114  );
     115
     116  puts( "Init - rtems_io_register_driver - invalid driver table pointer" );
     117  sc = rtems_io_register_driver( 0, NULL, &registered );
     118  fatal_directive_status(
     119    sc,
     120    RTEMS_INVALID_ADDRESS,
     121    "rtems_io_register_driver"
     122  );
     123
     124  puts( "Init - rtems_io_register_driver - invalid empty driver table" );
     125  test_driver.open_entry = NULL;
     126  sc = rtems_io_register_driver( 0, &test_driver, &registered );
     127  test_driver.open_entry = test_open;
     128  fatal_directive_status(
     129    sc,
     130    RTEMS_INVALID_ADDRESS,
     131    "rtems_io_register_driver"
     132  );
     133
     134  puts( "Init - rtems_io_register_driver - invalid major" );
     135  sc = rtems_io_register_driver( invalid_major, &test_driver, &registered );
     136  fatal_directive_status(
     137    sc,
     138    RTEMS_INVALID_NUMBER,
     139    "rtems_io_register_driver"
     140  );
     141
     142  puts( "Init - rtems_io_unregister_driver - called from interrupt context" );
     143  test_interrupt_context_enter( level );
     144  sc = rtems_io_unregister_driver( 0 );
     145  test_interrupt_context_leave( level );
     146  fatal_directive_status(
     147    sc,
     148    RTEMS_CALLED_FROM_ISR,
     149    "rtems_io_unregister_driver"
     150  );
     151
     152  puts( "Init - rtems_io_unregister_driver - invalid major number" );
     153  sc = rtems_io_unregister_driver( invalid_major );
     154  fatal_directive_status(
     155    sc,
     156    RTEMS_UNSATISFIED,
     157    "rtems_io_unregister_driver"
     158  );
     159
    68160  puts( "*** END OF TEST 40 ***" );
    69161  rtems_test_exit( 0 );
    70162}
    71 
    72 
    73 /* functions */
    74 
    75 rtems_task Init(
    76   rtems_task_argument argument
    77 );
    78163
    79164/* configuration information */
  • testsuites/sptests/sp40/sp40.scn

    r4ee2c53 rbbf6253  
    33Init - Major slot returned = 2
    44Init - rtems_io_register_driver - init == NULL, open != NULL OK
    5 Init - Major slot returned = 0
     5Init - Major slot returned = 3
    66Init - rtems_io_register_driver - used slot
     7Init - rtems_io_unregister_driver - used slot
     8Init - rtems_io_register_driver - free slot
     9Init - rtems_io_register_driver - called from interrupt context
     10Init - rtems_io_register_driver - invalid registered major pointer
     11Init - rtems_io_register_driver - invalid driver table pointer
     12Init - rtems_io_register_driver - invalid empty driver table
     13Init - rtems_io_register_driver - invalid major
     14Init - rtems_io_unregister_driver - called from interrupt context
     15Init - rtems_io_unregister_driver - invalid major number
    716*** END OF TEST 40 ***
Note: See TracChangeset for help on using the changeset viewer.