Changeset 506bfc8 in rtems


Ignore:
Timestamp:
Jun 21, 2016, 11:30:15 AM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
a33bfb6
Parents:
ede1a41
git-author:
Sebastian Huber <sebastian.huber@…> (06/21/16 11:30:15)
git-committer:
Sebastian Huber <sebastian.huber@…> (06/22/16 05:29:26)
Message:

Move printer initialization to separate header

The RTEMS print user need to know nothing about a particular printer
implementation. In particular get rid of the <stdio.h> include which
would be visible via <rtems.h>.

Files:
1 added
26 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/shared/src/irq-info.c

    rede1a41 r506bfc8  
    2222#include <inttypes.h>
    2323
    24 #include <rtems/print.h>
     24#include <rtems/printer.h>
    2525
    2626#include <bsp/irq-generic.h>
  • c/src/lib/libbsp/shared/src/irq-shell.c

    rede1a41 r506bfc8  
    2222#include <stdio.h>
    2323
     24#include <rtems/printer.h>
    2425#include <rtems/shell.h>
    2526
  • cpukit/Makefile.am

    rede1a41 r506bfc8  
    9999include_rtems_HEADERS += include/rtems/bspIo.h
    100100include_rtems_HEADERS += include/rtems/print.h
     101include_rtems_HEADERS += include/rtems/printer.h
    101102include_rtems_HEADERS += include/rtems/userenv.h
    102103include_rtems_HEADERS += include/rtems/fs.h
  • cpukit/include/rtems/print.h

    rede1a41 r506bfc8  
    2222
    2323#include <stdarg.h>
    24 #include <stdio.h>
    2524
    2625#ifdef __cplusplus
     
    2827#endif
    2928
     29typedef struct rtems_printer rtems_printer;
     30
    3031/**
    31  * @defgroup RTEMS Print Support
     32 * @defgroup RTEMSPrintSupport RTEMS Print Support
    3233 *
    3334 * This module contains all methods and support related to providing the user
    3435 * with an interface to the kernel level print support.
    3536 */
    36 
    37 /**
    38  * Type definition for function which can be plugged in to certain reporting
    39  * routines to redirect the output.
    40  *
    41  * Use the RTEMS Print interface to call these functions. Do not directly use
    42  * them.
    43  *
    44  * If the user provides their own printer, then they may redirect those reports
    45  * as they see fit.
    46  */
    47 typedef int (*rtems_print_printer)(void *, const char *format, va_list ap);
    48 
    49 /**
    50  * Type definition for the printer structure used to access the kernel print
    51  * support.
    52  */
    53 typedef struct rtems_printer {
    54   void                *context;
    55   rtems_print_printer  printer;
    56 } rtems_printer;
    57 
    58 /**
    59  * @brief check if the printer is valid.
    60  *
    61  * @param[in] printer Pointer to the printer structure.
    62  *
    63  * @return true The printer is valid else false is returned.
    64  */
    65 static inline bool rtems_print_printer_valid(const rtems_printer *printer)
    66 {
    67   return printer != NULL && printer->printer != NULL;
    68 }
    6937
    7038/**
     
    9664                         va_list              ap);
    9765
    98 /**
    99  * @brief Intiialise the rtems_printer struct to empty.
    100  *
    101  * An empty printer prints nothing. You can use this to implement an enable and
    102  * disable type print implementation.
    103  *
    104  * @param[in] printer Pointer to the printer structure.
    105  */
    106 static inline void rtems_print_printer_empty(rtems_printer *printer)
    107 {
    108   printer->context = NULL;
    109   printer->printer = NULL;
    110 }
    111 
    112 /**
    113  * @brief Intiialise the rtems_printer struct to printk
    114  *
    115  * The printer will output to the kernel printk support.
    116  *
    117  * @param[in] printer Pointer to the printer structure.
    118  */
    119 void rtems_print_printer_printk(rtems_printer *printer);
    120 
    121 /**
    122  * @brief Intiialise the rtems_printer struct to printf
    123  *
    124  * The printer will output to the libc printf support.
    125  *
    126  * @param[in] printer Pointer to the printer structure.
    127  */
    128 extern void rtems_print_printer_printf(rtems_printer *printer);
    129 
    130 /**
    131  * @brief Intiialise the rtems_printer struct to a fprintf device.
    132  *
    133  * The printer will output to the libc fprintf file provided.
    134  *
    135  * @param[in] printer Pointer to the printer structure.
    136  */
    137 extern void rtems_print_printer_fprintf(rtems_printer *printer, FILE *file);
    138 
    139 /**@}*/
     66/** @} */
    14067
    14168#ifdef __cplusplus
     
    14370#endif
    14471
    145 #endif
     72#endif /* _RTEMS_PRINT_H */
  • cpukit/libcsupport/src/print_fprintf.c

    rede1a41 r506bfc8  
    1919#endif
    2020
    21 #include <rtems/print.h>
    22 
    23 #include <stdio.h>
     21#include <rtems/printer.h>
    2422
    2523static int rtems_fprintf_plugin(void *context, const char *fmt, va_list ap)
  • cpukit/libcsupport/src/print_printf.c

    rede1a41 r506bfc8  
    1919#endif
    2020
    21 #include <rtems/print.h>
    22 
    23 #include <stdio.h>
     21#include <rtems/printer.h>
    2422
    2523int rtems_vprintf(
  • cpukit/libcsupport/src/printf_plugin.c

    rede1a41 r506bfc8  
    2424#endif
    2525
    26 #include <rtems/print.h>
    27 
    28 #include <stdio.h>
     26#include <rtems/printer.h>
    2927
    3028static int rtems_printf_plugin(void *context, const char *format, va_list ap)
  • cpukit/libcsupport/src/printk_plugin.c

    rede1a41 r506bfc8  
    1919#endif
    2020
    21 #include <rtems/print.h>
     21#include <rtems/printer.h>
    2222#include <rtems/bspIo.h>
    2323
  • cpukit/libdl/rap.c

    rede1a41 r506bfc8  
    2020#endif
    2121
     22#include <stdarg.h>
    2223#include <stdlib.h>
    2324#include <stdio.h>
  • cpukit/libmisc/cpuuse/cpuusagereport.c

    rede1a41 r506bfc8  
    2626
    2727#include <rtems/cpuuse.h>
     28#include <rtems/printer.h>
    2829#include <rtems/score/objectimpl.h>
    2930#include <rtems/score/threadimpl.h>
  • cpukit/libmisc/cpuuse/cpuusagetop.c

    rede1a41 r506bfc8  
    3333
    3434#include <rtems/cpuuse.h>
     35#include <rtems/printer.h>
    3536#include <rtems/malloc.h>
    3637#include <rtems/score/objectimpl.h>
  • cpukit/libmisc/fb/mw_print.c

    rede1a41 r506bfc8  
    2222
    2323#include <rtems/mw_uid.h>
     24#include <rtems/printer.h>
    2425
    2526static const char *uid_buttons(
  • cpukit/libmisc/shell/main_blkstats.c

    rede1a41 r506bfc8  
    1818
    1919#include <rtems/blkdev.h>
     20#include <rtems/printer.h>
    2021#include <rtems/shellconfig.h>
    2122
  • cpukit/libmisc/shell/main_cpuinfo.c

    rede1a41 r506bfc8  
    2020#include <rtems/shellconfig.h>
    2121#include <rtems/cpuuse.h>
     22#include <rtems/printer.h>
    2223
    2324static int rtems_shell_main_cpuinfo(int argc, char **argv)
  • cpukit/libmisc/shell/main_cpuuse.c

    rede1a41 r506bfc8  
    1919#include <rtems.h>
    2020#include <rtems/cpuuse.h>
     21#include <rtems/printer.h>
    2122#include <rtems/shell.h>
    2223#include "internal.h"
  • cpukit/libmisc/shell/main_perioduse.c

    rede1a41 r506bfc8  
    1818
    1919#include <rtems.h>
     20#include <rtems/printer.h>
    2021#include <rtems/shell.h>
    2122#include "internal.h"
  • cpukit/libmisc/shell/main_profreport.c

    rede1a41 r506bfc8  
    2020
    2121#include <rtems/profiling.h>
     22#include <rtems/printer.h>
    2223#include <rtems/shell.h>
    2324#include <rtems/shellconfig.h>
  • cpukit/libmisc/shell/main_stackuse.c

    rede1a41 r506bfc8  
    1717
    1818#include <rtems.h>
     19#include <rtems/printer.h>
    1920#include <rtems/stackchk.h>
    2021#include <rtems/shell.h>
  • cpukit/libmisc/shell/main_top.c

    rede1a41 r506bfc8  
    1919#include <rtems.h>
    2020#include <rtems/cpuuse.h>
     21#include <rtems/printer.h>
    2122#include <rtems/shell.h>
    2223#include "internal.h"
  • cpukit/libmisc/stackchk/check.c

    rede1a41 r506bfc8  
    4141
    4242#include <rtems/bspIo.h>
     43#include <rtems/printer.h>
    4344#include <rtems/stackchk.h>
    4445#include <rtems/score/percpu.h>
  • cpukit/libmisc/testsupport/test.h

    rede1a41 r506bfc8  
    1717
    1818#include <rtems.h>
    19 #include <rtems/print.h>
     19#include <rtems/printer.h>
    2020#include <rtems/score/atomic.h>
    2121#include <rtems/score/smpbarrier.h>
  • cpukit/mghttpd/mongoose.c

    rede1a41 r506bfc8  
    55215521}
    55225522#ifdef __rtems__
    5523 #include <rtems/print.h>
     5523#include <rtems/printer.h>
    55245524
    55255525static int mg_printer_plugin(void *context, const char *fmt, va_list ap) {
  • cpukit/preinstall.am

    rede1a41 r506bfc8  
    229229PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/print.h
    230230
     231$(PROJECT_INCLUDE)/rtems/printer.h: include/rtems/printer.h $(PROJECT_INCLUDE)/rtems/$(dirstamp)
     232        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/printer.h
     233PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/printer.h
     234
    231235$(PROJECT_INCLUDE)/rtems/userenv.h: include/rtems/userenv.h $(PROJECT_INCLUDE)/rtems/$(dirstamp)
    232236        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/userenv.h
  • cpukit/rtems/src/ratemonreportstatistics.c

    rede1a41 r506bfc8  
    2121#include <rtems/rtems/ratemonimpl.h>
    2222#include <rtems/rtems/object.h>
    23 #include <rtems/print.h>
     23#include <rtems/printer.h>
    2424
    2525#include <inttypes.h>
  • cpukit/score/src/cpusetprintsupport.c

    rede1a41 r506bfc8  
    2424#include <ctype.h>
    2525#include <inttypes.h>
    26 #include <rtems/print.h>
     26#include <rtems/printer.h>
    2727#include <rtems/score/cpusetimpl.h>
    2828
     
    5050    rtems_printf(printer ,"%s: ", description);
    5151    for(i=0; i<_NCPUWORDS; i++)
    52       rtems_printf(printer ,"%x", cpuset->__bits[i]);
     52      rtems_printf(printer ,"%" PRIx32 "", cpuset->__bits[i]);
    5353    rtems_printf(printer ,"\n");
    5454  }
  • testsuites/samples/hello/init.c

    rede1a41 r506bfc8  
    1212#endif
    1313
     14#include <rtems/printer.h>
    1415#include <rtems/test.h>
    1516
Note: See TracChangeset for help on using the changeset viewer.