source: rtems/bsps/include/libchip/ns16550.h @ 9964895

5
Last change on this file since 9964895 was 2afb22b, checked in by Chris Johns <chrisj@…>, on 12/23/17 at 07:18:56

Remove make preinstall

A speciality of the RTEMS build system was the make preinstall step. It
copied header files from arbitrary locations into the build tree. The
header files were included via the -Bsome/build/tree/path GCC command
line option.

This has at least seven problems:

  • The make preinstall step itself needs time and disk space.
  • Errors in header files show up in the build tree copy. This makes it hard for editors to open the right file to fix the error.
  • There is no clear relationship between source and build tree header files. This makes an audit of the build process difficult.
  • The visibility of all header files in the build tree makes it difficult to enforce API barriers. For example it is discouraged to use BSP-specifics in the cpukit.
  • An introduction of a new build system is difficult.
  • Include paths specified by the -B option are system headers. This may suppress warnings.
  • The parallel build had sporadic failures on some hosts.

This patch removes the make preinstall step. All installed header
files are moved to dedicated include directories in the source tree.
Let @RTEMS_CPU@ be the target architecture, e.g. arm, powerpc, sparc,
etc. Let @RTEMS_BSP_FAMILIY@ be a BSP family base directory, e.g.
erc32, imx, qoriq, etc.

The new cpukit include directories are:

  • cpukit/include
  • cpukit/score/cpu/@RTEMS_CPU@/include
  • cpukit/libnetworking

The new BSP include directories are:

  • bsps/include
  • bsps/@RTEMS_CPU@/include
  • bsps/@RTEMS_CPU@/@RTEMS_BSP_FAMILIY@/include

There are build tree include directories for generated files.

The include directory order favours the most general header file, e.g.
it is not possible to override general header files via the include path
order.

The "bootstrap -p" option was removed. The new "bootstrap -H" option
should be used to regenerate the "headers.am" files.

Update #3254.

  • Property mode set to 100644
File size: 2.6 KB
Line 
1/**
2 *  @file
3 * 
4 */
5
6/*
7 *  COPYRIGHT (c) 1998 by Radstone Technology
8 *
9 *  THIS FILE IS PROVIDED TO YOU, THE USER, "AS IS", WITHOUT WARRANTY OF ANY
10 *  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
11 *  IMPLIED WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK
12 *  AS TO THE QUALITY AND PERFORMANCE OF ALL CODE IN THIS FILE IS WITH YOU.
13 *
14 *  You are hereby granted permission to use, copy, modify, and distribute
15 *  this file, provided that this notice, plus the above copyright notice
16 *  and disclaimer, appears in all copies. Radstone Technology will provide
17 *  no support for this code.
18 *
19 *  COPYRIGHT (c) 1989-2012.
20 *  On-Line Applications Research Corporation (OAR).
21 *
22 *  The license and distribution terms for this file may be
23 *  found in the file LICENSE in this distribution or at
24 *  http://www.rtems.org/license/LICENSE.
25 */
26
27#ifndef _NS16550_H_
28#define _NS16550_H_
29
30#include <rtems/termiostypes.h>
31#include <libchip/serial.h>
32
33#ifdef __cplusplus
34extern "C" {
35#endif
36
37/*
38 * Driver function table
39 */
40
41extern const console_fns ns16550_fns;
42extern const console_fns ns16550_fns_polled;
43
44/*
45 * Flow control function tables
46 */
47
48extern const console_flow ns16550_flow_RTSCTS;
49extern const console_flow ns16550_flow_DTRCTS;
50
51/*
52 *  Helpers for printk
53 */
54void ns16550_outch_polled(console_tbl *c, char out);
55int ns16550_inch_polled(console_tbl *c);
56
57/* Alternative NS16550 driver using the Termios device context */
58
59typedef uint8_t (*ns16550_get_reg)(uintptr_t port, uint8_t reg);
60
61typedef void (*ns16550_set_reg)(uintptr_t port, uint8_t reg, uint8_t value);
62
63typedef struct {
64  rtems_termios_device_context base;
65  ns16550_get_reg get_reg;
66  ns16550_set_reg set_reg;
67  uintptr_t port;
68  rtems_vector_number irq;
69  uint32_t clock;
70  uint32_t initial_baud;
71  bool has_fractional_divider_register;
72  uint8_t modem_control;
73  uint8_t line_control;
74  uint32_t baud_divisor;
75  size_t out_total;
76  size_t out_remaining;
77  size_t out_current;
78  const char *out_buf;
79  rtems_termios_tty *tty;
80} ns16550_context;
81
82extern const rtems_termios_device_handler ns16550_handler_interrupt;
83extern const rtems_termios_device_handler ns16550_handler_polled;
84extern const rtems_termios_device_handler ns16550_handler_task;
85
86extern const rtems_termios_device_flow ns16550_flow_rtscts;
87extern const rtems_termios_device_flow ns16550_flow_dtrcts;
88
89void ns16550_polled_putchar(rtems_termios_device_context *base, char out);
90
91int ns16550_polled_getchar(rtems_termios_device_context *base);
92
93bool ns16550_probe(rtems_termios_device_context *base);
94
95#ifdef __cplusplus
96}
97#endif
98
99#endif /* _NS16550_H_ */
Note: See TracBrowser for help on using the repository browser.