source: rtems/c/src/lib/libbsp/sparc/shared/include/cons.h @ fd9fb21

5
Last change on this file since fd9fb21 was fd9fb21, checked in by Martin Aberg <maberg@…>, on 02/01/17 at 15:48:51

leon, cons: drvmgr cons interface uses new TERMIOS

LEON driver manager console driver interface (cons) and the APBUART cons driver
(apbuart_cons) have been updated for recent TERMIOS interface changes. The
legacy callback API is not used anymore and deprecated functions are
eliminated.

This new implementation is based on RTEMS BSP and Device Driver Development
Guide, chapter named "Console Driver".

  • Functions marked as deprecated (rtems_termios_open() and rtems_termios_close()) have been updated with the present-day versions.
  • The legacy "callback" interface is replaced with the "handler" interface.
  • Implementation is inspired by the documentation example, the non-driver manager driver for APBUART (apbuart_termios).
  • Polled, interrupt and task mode is supported.
  • Property mode set to 100644
File size: 1020 bytes
Line 
1/*  Console driver interface to UART drivers
2 *
3 *  - First console device that has System Console flag set will be
4 *    system console.
5 *  - If none of the registered console devices has system console set,
6 *    the first is registered device is used, unless it has
7 *
8 *  COPYRIGHT (c) 2010.
9 *  Cobham Gaisler AB.
10 *
11 *  The license and distribution terms for this file may be
12 *  found in the file LICENSE in this distribution or at
13 *  http://www.rtems.org/license/LICENSE.
14 */
15
16#ifndef __CONS_H__
17#define __CONS_H__
18
19#include <rtems/termiostypes.h>
20
21struct console_dev;
22
23#define CONSOLE_FLAG_SYSCON      0x01
24
25struct console_dev {
26        rtems_termios_device_context base;
27        /* Set to CONSOLE_FLAG_SYSCON if this UART should be system console and/or
28         * debug console.
29         */
30        int flags;
31        char *fsname; /* File system prefix */
32        const rtems_termios_device_handler *handler;
33};
34
35extern void console_dev_register(struct console_dev *dev);
36#if 0
37extern void console_dev_unregister(struct console_dev *dev);
38#endif
39
40#endif
Note: See TracBrowser for help on using the repository browser.