source: rtems/bsps/i386/pc386/include/bsp.h @ be3d7d75

5
Last change on this file since be3d7d75 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: 9.4 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup i386_pc386
5 *
6 * @brief Global BSP definitions.
7 */
8
9/*-------------------------------------------------------------------------+
10| bsp.h v1.1 - PC386 BSP - 1997/08/07
11+--------------------------------------------------------------------------+
12| This include file contains definitions related to the PC386 BSP.
13+--------------------------------------------------------------------------+
14| (C) Copyright 1997 -
15| - NavIST Group - Real-Time Distributed Systems and Industrial Automation
16|
17| http://pandora.ist.utl.pt
18|
19| Instituto Superior Tecnico * Lisboa * PORTUGAL
20+--------------------------------------------------------------------------+
21| Modified by Eric Valette the 20/05/98 in order to add definitions used
22| to enhance video putchar capabilities.
23|
24| Copyright (C) 1998  valette@crf.canon.fr
25|
26| Canon Centre Recherche France.
27|
28+--------------------------------------------------------------------------+
29| Disclaimer:
30|
31| This file is provided "AS IS" without warranty of any kind, either
32| expressed or implied.
33+--------------------------------------------------------------------------+
34| This code is based on:
35|   bsp.h,v 1.5 1995/12/19 20:07:30 joel Exp - go32 BSP
36| With the following copyright notice:
37| **************************************************************************
38| *  COPYRIGHT (c) 1989-1999.
39| *  On-Line Applications Research Corporation (OAR).
40| *
41| *  The license and distribution terms for this file may be
42| *  found in the file LICENSE in this distribution or at
43| *  http://www.rtems.org/license/LICENSE.
44| **************************************************************************
45+--------------------------------------------------------------------------*/
46
47#ifndef LIBBSP_I386_PC386_BSP_H
48#define LIBBSP_I386_PC386_BSP_H
49
50#ifndef ASM
51
52#include <bspopts.h>
53#include <bsp/default-initial-extension.h>
54#include <bsp/tblsizes.h>
55
56#include <rtems.h>
57#include <rtems/score/cpu.h>
58#include <rtems/bspIo.h>
59
60#ifdef __cplusplus
61extern "C" {
62#endif
63
64/**
65 * @degroup pc386_i386 PC386 Support
66 *
67 * @ingroup bsp_i386
68 *
69 * @brief PC386 support.
70 */
71
72#define BSP_HAS_FRAME_BUFFER 1
73
74/*
75 * Network driver configuration
76 */
77struct rtems_bsdnet_ifconfig;
78
79/* app. may provide a routine (called _very_ early) to tell us
80 * which ports to use for printk / console. BSP provides a default
81 * implementation (weak alias) which does nothing (use BSP default
82 * ports).
83 */
84extern void
85BSP_runtime_console_select(int *pPrintkPort, int *pConsolePort);
86
87extern int rtems_ne_driver_attach(struct rtems_bsdnet_ifconfig *, int);
88#define BSP_NE2000_NETWORK_DRIVER_NAME      "ne1"
89#define BSP_NE2000_NETWORK_DRIVER_ATTACH    rtems_ne_driver_attach
90
91extern int rtems_wd_driver_attach(struct rtems_bsdnet_ifconfig *, int);
92#define BSP_WD8003_NETWORK_DRIVER_NAME      "wd1"
93#define BSP_WD8003_NETWORK_DRIVER_ATTACH    rtems_wd_driver_attach
94
95extern int rtems_dec21140_driver_attach(struct rtems_bsdnet_ifconfig *, int);
96#define BSP_DEC21140_NETWORK_DRIVER_NAME    "dc1"
97#define BSP_DEC21140_NETWORK_DRIVER_ATTACH  rtems_dec21140_driver_attach
98
99extern int rtems_3c509_driver_attach(struct rtems_bsdnet_ifconfig *config);
100#define BSP_3C509_NETWORK_DRIVER_NAME    "3c1"
101#define BSP_3C509_NETWORK_DRIVER_ATTACH  rtems_3c509_driver_attach
102
103#ifndef RTEMS_BSP_NETWORK_DRIVER_NAME
104#define RTEMS_BSP_NETWORK_DRIVER_NAME   BSP_DEC21140_NETWORK_DRIVER_NAME
105#endif
106
107#ifndef RTEMS_BSP_NETWORK_DRIVER_ATTACH
108#define RTEMS_BSP_NETWORK_DRIVER_ATTACH BSP_DEC21140_NETWORK_DRIVER_ATTACH
109#endif
110
111/*-------------------------------------------------------------------------+
112| Constants
113+--------------------------------------------------------------------------*/
114
115/*-------------------------------------------------------------------------+
116| Constants relating to the 8254 (or 8253) programmable interval timers.
117+--------------------------------------------------------------------------*/
118#define IO_TIMER1      0x40
119                  /* Port address of the control port and timer channels */
120#define TIMER_CNTR0    (IO_TIMER1 + 0) /* timer 0 counter port           */
121#define TIMER_CNTR1    (IO_TIMER1 + 1) /* timer 1 counter port           */
122#define TIMER_CNTR2    (IO_TIMER1 + 2) /* timer 2 counter port           */
123#define TIMER_MODE     (IO_TIMER1 + 3) /* timer mode port                */
124#define TIMER_SEL0     0x00            /* select counter 0               */
125#define TIMER_SEL1     0x40            /* select counter 1               */
126#define TIMER_SEL2     0x80            /* select counter 2               */
127#define TIMER_INTTC    0x00            /* mode 0, intr on terminal cnt   */
128#define TIMER_ONESHOT  0x02            /* mode 1, one shot               */
129#define TIMER_RATEGEN  0x04            /* mode 2, rate generator         */
130#define TIMER_SQWAVE   0x06            /* mode 3, square wave            */
131#define TIMER_SWSTROBE 0x08            /* mode 4, s/w triggered strobe   */
132#define TIMER_HWSTROBE 0x0a            /* mode 5, h/w triggered strobe   */
133#define TIMER_LATCH    0x00            /* latch counter for reading      */
134#define TIMER_LSB      0x10            /* r/w counter LSB                */
135#define TIMER_MSB      0x20            /* r/w counter MSB                */
136#define TIMER_16BIT    0x30            /* r/w counter 16 bits, LSB first */
137#define TIMER_BCD      0x01            /* count in BCD                   */
138#define TIMER_RD_BACK  0xc0            /* Read Back Command              */
139                /* READ BACK command layout in the Command Register      */
140#define RB_NOT_COUNT    0x40           /* Don't select counter latch     */
141#define RB_NOT_STATUS   0x20           /* Don't select status latch      */
142#define RB_COUNT_0      0x02           /* Counter 0 latch                */
143#define RB_COUNT_1      0x04           /* Counter 1 latch                */
144#define RB_COUNT_2      0x08           /* Counter 2 latch                */
145#define RB_OUTPUT       0x80           /* Output of the counter is 1     */
146
147#define TIMER_TICK     1193182  /* The internal tick rate in ticks per second */
148
149#if defined( RTEMS_SMP )
150  extern ISR_lock_Control rtems_i386_i8254_access_lock;
151#endif
152
153
154/*-------------------------------------------------------------------------+
155| Console Defines
156|      WARNING: These Values MUST match the order in
157|               Console_Configuration_Ports
158+--------------------------------------------------------------------------*/
159#define    BSP_CONSOLE_VGA            0
160#define    BSP_CONSOLE_COM1           1
161#define    BSP_CONSOLE_COM2           2
162
163/*-------------------------------------------------------------------------+
164| Convert microseconds to ticks and ticks to microseconds.
165+--------------------------------------------------------------------------*/
166#define US_TO_TICK(us) (((us)*105+44)/88)
167#define TICK_TO_US(tk) (((tk)*88+52)/105)
168
169/*-------------------------------------------------------------------------+
170| External Variables.
171+--------------------------------------------------------------------------*/
172extern interrupt_gate_descriptor Interrupt_descriptor_table[IDT_SIZE];
173extern segment_descriptors _Global_descriptor_table   [GDT_SIZE];
174
175/*-------------------------------------------------------------------------+
176| Function Prototypes.
177+--------------------------------------------------------------------------*/
178void          _IBMPC_initVideo(void);    /* from 'outch.c'  */
179void          _IBMPC_outch    (char);    /* from 'outch.c'  */
180char          _IBMPC_inch     (void);    /* from 'inch.c'   */
181char          _IBMPC_inch_sleep (void);  /* from 'inch.c'   */
182int           BSP_wait_polled_input(void); /* from 'inch.c' */
183int           rtems_kbpoll( void );      /* from 'inch.c' */
184int           getch( void );             /* from 'inch.c' */
185void           add_to_queue( unsigned short b ); /* from 'inch.c' */
186
187void Wait_X_ms(unsigned int timeToWait); /* from 'timer.c'  */
188void Calibrate_loop_1ms(void);           /* from 'timer.c'  */
189
190void rtems_irq_mngt_init(void);          /* from 'irq_init.c' */
191
192void Clock_driver_install_handler(void);             /* from 'ckinit.c'  */
193void Clock_driver_support_initialize_hardware(void); /* from 'ckinit.c'  */
194
195void *bsp_idle_thread( uintptr_t ignored );
196#define BSP_IDLE_TASK_BODY bsp_idle_thread
197
198void kbd_reset_setup(char *str, int *ints);   /* from 'pc_keyb.c' */
199size_t read_aux(char * buffer, size_t count); /* from 'ps2_mouse.c'  */
200
201bool bsp_get_serial_mouse_device(             /* from 'serial_mouse.c' */
202  const char **name,
203  const char **type
204);
205
206void register_leds(                           /* from 'keyboard.c' */
207  int console,
208  unsigned int led,
209  unsigned int *addr,
210  unsigned int mask
211);
212
213/* Definitions for BSPConsolePort */
214#define BSP_CONSOLE_PORT_CONSOLE (-1)
215#define BSP_CONSOLE_PORT_COM1    (BSP_UART_COM1)
216#define BSP_CONSOLE_PORT_COM2    (BSP_UART_COM2)
217
218/*
219 * Command line.
220 */
221const char* bsp_cmdline(void);
222const char* bsp_cmdline_arg(const char* arg);
223
224#if BSP_ENABLE_IDE
225/*
226 * IDE command line parsing.
227 */
228void bsp_ide_cmdline_init(void);
229
230/*
231 * indicate, that BSP has IDE driver
232 */
233#define RTEMS_BSP_HAS_IDE_DRIVER
234#endif
235
236/* GDB stub stuff */
237void init_remote_gdb( void );
238void i386_stub_glue_init(int uart);
239void i386_stub_glue_init_breakin(void);
240int i386_stub_glue_uart(void);
241void breakpoint(void);
242
243#define BSP_MAXIMUM_DEVICES 6
244
245/*
246 * Debug helper methods
247 */
248typedef __FILE FILE;
249uint32_t BSP_irq_count_dump(FILE *f);
250
251/*
252 * Prototypes just called from .S files. This lets the .S file include
253 * bsp.h just to establish the dependency.
254 */
255void raw_idt_notify(void);
256void C_dispatch_isr(int vector);
257
258#ifdef __cplusplus
259}
260#endif
261
262#endif /* !ASM */
263
264#endif /* _BSP_H */
Note: See TracBrowser for help on using the repository browser.