Changeset 337a186 in rtems


Ignore:
Timestamp:
Feb 21, 2018, 11:40:18 AM (15 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
ff281a6f
Parents:
4899759
git-author:
Sebastian Huber <sebastian.huber@…> (02/21/18 11:40:18)
git-committer:
Sebastian Huber <sebastian.huber@…> (03/06/18 11:32:09)
Message:

Add a simple task console driver

Close #3320.

Files:
3 added
8 edited

Legend:

Unmodified
Added
Removed
  • cpukit/include/rtems/confdefs.h

    r4899759 r337a186  
    15301530 { NULL, NULL, NULL, NULL, NULL, NULL }
    15311531
    1532 #if defined(CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER) && \
    1533   defined(CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER)
    1534 #error "CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER and CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER are mutually exclusive"
     1532#if (defined(CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER) && \
     1533    defined(CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER)) || \
     1534  (defined(CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER) && \
     1535    defined(CONFIGURE_APPLICATION_NEEDS_SIMPLE_TASK_CONSOLE_DRIVER)) || \
     1536  (defined(CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER) && \
     1537    defined(CONFIGURE_APPLICATION_NEEDS_SIMPLE_TASK_CONSOLE_DRIVER))
     1538#error "CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER, CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER, and CONFIGURE_APPLICATION_NEEDS_SIMPLE_TASK_CONSOLE_DRIVER are mutually exclusive"
    15351539#endif
    15361540
     
    15451549    RTEMS_SYSINIT_ITEM(
    15461550      _Console_simple_Initialize,
     1551      RTEMS_SYSINIT_DEVICE_DRIVERS,
     1552      RTEMS_SYSINIT_ORDER_SECOND
     1553    );
     1554  #endif
     1555#endif
     1556
     1557#ifdef CONFIGURE_APPLICATION_NEEDS_SIMPLE_TASK_CONSOLE_DRIVER
     1558  #include <rtems/console.h>
     1559
     1560  #ifdef CONFIGURE_INIT
     1561    RTEMS_SYSINIT_ITEM(
     1562      _Console_simple_task_Initialize,
    15471563      RTEMS_SYSINIT_DEVICE_DRIVERS,
    15481564      RTEMS_SYSINIT_ORDER_SECOND
  • cpukit/include/rtems/console.h

    r4899759 r337a186  
    151151 * @brief Initializes a simple console device.
    152152 *
    153  * This device writes via rtems_putc() and reads via getchark().  The Termios
    154  * framework is not used.  There is no support to change device settings, e.g.
    155  * baud, stop bits, parity, etc.
     153 * See CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER documentation in the
     154 * "RTEMS Classic API Guide".
    156155 */
    157156void _Console_simple_Initialize( void );
     157
     158/**
     159 * @brief Initializes a simple task console device.
     160 *
     161 * See CONFIGURE_APPLICATION_NEEDS_SIMPLE_TASK_CONSOLE_DRIVER documentation in
     162 * the "RTEMS Classic API Guide".
     163 */
     164void _Console_simple_task_Initialize( void );
    158165
    159166#ifdef __cplusplus
  • cpukit/libcsupport/Makefile.am

    r4899759 r337a186  
    117117    $(ERROR_C_FILES) $(ASSOCIATION_C_FILES)
    118118libcsupport_a_SOURCES += src/consolesimple.c
     119libcsupport_a_SOURCES += src/consolesimpleread.c
     120libcsupport_a_SOURCES += src/consolesimpletask.c
    119121libcsupport_a_SOURCES += src/printertask.c
    120122libcsupport_a_SOURCES += src/printerfprintfputc.c
  • cpukit/libcsupport/src/consolesimple.c

    r4899759 r337a186  
    1717#include <rtems/imfs.h>
    1818
    19 static ssize_t _Console_simple_Read(
    20   rtems_libio_t *iop,
    21   void          *buffer,
    22   size_t         count
    23 )
    24 {
    25   char    *buf;
    26   ssize_t  i;
    27   ssize_t  n;
    28 
    29   buf = buffer;
    30   n = (ssize_t) count;
    31 
    32   for ( i = 0; i < n; ++i ) {
    33     int c;
    34 
    35     do {
    36       c = getchark();
    37     } while (c == -1);
    38 
    39     buf[ i ] = (char) c;
    40   }
    41 
    42   return n;
    43 }
     19#include "consolesimple.h"
    4420
    4521static ssize_t _Console_simple_Write(
  • testsuites/ada/sptests/sp20/config.h

    r4899759 r337a186  
    1414/* configuration information */
    1515
    16 #define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER
     16#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_TASK_CONSOLE_DRIVER
    1717#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
    1818
    19 #define CONFIGURE_MAXIMUM_TASKS               7
     19#define CONFIGURE_MAXIMUM_TASKS               8
    2020
    2121#define ADA_TEST_NAME "ADA SP 20"
  • testsuites/ada/support/init.c

    r4899759 r337a186  
    6565void ada_test_end(void)
    6666{
     67  fsync(STDOUT_FILENO);
    6768  rtems_test_end(rtems_test_name);
    6869}
  • testsuites/sptests/sp20/init.c

    r4899759 r337a186  
    2929const char rtems_test_name[] = "SP 20";
    3030
    31 #define BUFFER_COUNT 16
    32 
    33 #define BUFFER_SIZE 512
    34 
    35 static rtems_printer_task_context printer_task;
    36 
    37 static long buffers[ BUFFER_COUNT ][ BUFFER_SIZE / sizeof(long) ];
    38 
    3931void end_of_test( void )
    4032{
    4133  TEST_END();
    42   rtems_printer_task_drain( &printer_task );
     34  fsync(STDOUT_FILENO);
    4335  rtems_test_exit( 0 );
    4436}
     
    5244  rtems_status_code status;
    5345
    54   rtems_printer_task_set_priority( &printer_task, 254 );
    55   rtems_printer_task_set_file_descriptor( &printer_task, 1 );
    56   rtems_printer_task_set_buffer_table( &printer_task, &buffers[ 0 ][ 0 ] );
    57   rtems_printer_task_set_buffer_count( &printer_task, BUFFER_COUNT );
    58   rtems_printer_task_set_buffer_size( &printer_task, BUFFER_SIZE );
    59   error = rtems_print_printer_task( &rtems_test_printer, &printer_task );
    60   rtems_test_assert( error == 0 );
    61 
     46  rtems_print_printer_fprintf(&rtems_test_printer, stdout);
    6247  TEST_BEGIN();
    6348
  • testsuites/sptests/sp20/system.h

    r4899759 r337a186  
    3434/* configuration information */
    3535
    36 #define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER
     36#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_TASK_CONSOLE_DRIVER
    3737#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
    3838
Note: See TracChangeset for help on using the changeset viewer.