source: rtems/c/src/lib/libbsp/i386/ts_386ex/include/bsp.h @ 5c7f274

4.104.114.84.95
Last change on this file since 5c7f274 was 34c4852, checked in by Ralf Corsepius <ralf.corsepius@…>, on 05/26/05 at 05:36:48

2005-05-26 Ralf Corsepius <ralf.corsepius@…>

  • include/bsp.h: New header guard.
  • Property mode set to 100644
File size: 4.3 KB
Line 
1/*
2 *  This include file definitions related to an Intel i386ex board.
3 *
4 *  COPYRIGHT (c) 1989-1999.
5 *  On-Line Applications Research Corporation (OAR).
6 *
7 *  The license and distribution terms for this file may be
8 *  found in the file LICENSE in this distribution or at
9 *  http://www.rtems.com/license/LICENSE.
10 *
11 *  $Id$
12 */
13
14#ifndef _BSP_H
15#define _BSP_H
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
21#include <bspopts.h>
22
23#include <rtems.h>
24#include <rtems/iosupp.h>
25#include <rtems/console.h>
26#include <rtems/clockdrv.h>
27#include <rtems/bspIo.h>
28#include <libcpu/cpu.h>
29#include <bsp/irq.h>
30
31/*
32 *  confdefs.h overrides for this BSP:
33 *   - termios serial ports (defaults to 1)
34 *   - Interrupt stack space is not minimum if defined.
35 */
36
37/* #define CONFIGURE_NUMBER_OF_TERMIOS_PORTS 2 */
38#define CONFIGURE_INTERRUPT_STACK_MEMORY  (8 * 1024)
39
40/*
41 * Network driver configuration
42 */
43
44struct rtems_bsdnet_ifconfig;
45extern int rtems_ne_driver_attach (struct rtems_bsdnet_ifconfig *config);
46
47extern void Wait_X_ms (unsigned);
48
49#define RTEMS_BSP_NETWORK_DRIVER_NAME         "ne1"
50#define RTEMS_BSP_NETWORK_DRIVER_ATTACH       rtems_ne_driver_attach
51
52#define NE2000_BYTE_TRANSFERS
53
54/*
55 * Constants relating to the 8254 (or 8253) programmable interval timers.
56 */
57
58#define TIMER_CONFIG   0xF834
59#define IO_TIMER1      0xF040
60
61  /* Port address of the control port and timer channels */
62
63#define TIMER_CNTR0    (IO_TIMER1 + 0) /* timer 0 counter port           */
64#define TIMER_CNTR1    (IO_TIMER1 + 1) /* timer 1 counter port           */
65#define TIMER_CNTR2    (IO_TIMER1 + 2) /* timer 2 counter port           */
66#define TIMER_MODE     (IO_TIMER1 + 3) /* timer mode port                */
67#define TIMER_SEL0     0x00            /* select counter 0               */
68#define TIMER_SEL1     0x40            /* select counter 1               */
69#define TIMER_SEL2     0x80            /* select counter 2               */
70#define TIMER_INTTC    0x00            /* mode 0, intr on terminal cnt   */
71#define TIMER_ONESHOT  0x02            /* mode 1, one shot               */
72#define TIMER_RATEGEN  0x04            /* mode 2, rate generator         */
73#define TIMER_SQWAVE   0x06            /* mode 3, square wave            */
74#define TIMER_SWSTROBE 0x08            /* mode 4, s/w triggered strobe   */
75#define TIMER_HWSTROBE 0x0a            /* mode 5, h/w triggered strobe   */
76#define TIMER_LATCH    0x00            /* latch counter for reading      */
77#define TIMER_LSB      0x10            /* r/w counter LSB                */
78#define TIMER_MSB      0x20            /* r/w counter MSB                */
79#define TIMER_16BIT    0x30            /* r/w counter 16 bits, LSB first */
80#define TIMER_BCD      0x01            /* count in BCD                   */
81
82/*
83 *  Simple spin delay in microsecond units for device drivers.
84 *  This is very dependent on the clock speed of the target.
85 */
86
87#define rtems_bsp_delay( _microseconds ) \
88  { \
89    uint32_t         _counter; \
90    \
91    _counter = (_microseconds); \
92    \
93    asm volatile ( "0: nop;" \
94                   " mov %0,%0 ;" \
95                   " loop 0b" : "=c" (_counter) \
96                              : "0"  (_counter) \
97                 ); \
98    \
99  }
100
101/* Constants */
102
103#define RAM_START 0
104
105/* replaced the earlier EI kludge of 0xfffff */
106
107#define RAM_END   0x200000
108
109/* I/O addressing */
110
111/*
112 *#define Is_tx_ready( _status ) ( (_status) & 0x20 )
113 */
114/* dec 20. try the TE instead of TBE as the check */
115
116#define Is_tx_ready( _status ) ( (_status) & 0x40 )
117
118#define Is_rx_ready( _status ) ( (_status) & 0x01 )
119
120/* Structures */
121
122#ifdef F386_INIT
123#undef BSP_EXTERN
124#define BSP_EXTERN
125#else
126#undef BSP_EXTERN
127#define BSP_EXTERN extern
128#endif
129
130/*
131 *  Device Driver Table Entries
132 */
133
134/*
135 * NOTE: Use the standard Console driver entry
136 */
137
138/*
139 * NOTE: Use the standard Clock driver entry
140 */
141
142/* miscellaneous stuff assumed to exist */
143
144extern rtems_configuration_table BSP_Configuration;
145
146#define IDT_SIZE 256
147#define GDT_SIZE 3
148
149extern interrupt_gate_descriptor Interrupt_descriptor_table[IDT_SIZE];
150extern segment_descriptors Global_descriptor_table   [GDT_SIZE];
151
152BSP_EXTERN unsigned short Idt[3];  /* Interrupt Descriptor Table Address */
153BSP_EXTERN unsigned short Gdt[3];  /* Global Descriptor Table Address */
154BSP_EXTERN unsigned int   Idt_base;
155BSP_EXTERN unsigned int   Gdt_base;
156
157/* routines */
158
159#ifdef __cplusplus
160}
161#endif
162
163#endif
164/* end of include file */
Note: See TracBrowser for help on using the repository browser.