source: rtems/c/src/lib/libbsp/i386/pc386/include/bsp.h @ af2abc9e

4.104.114.84.9
Last change on this file since af2abc9e was af2abc9e, checked in by Joel Sherrill <joel.sherrill@…>, on Sep 4, 2003 at 6:51:23 PM

2003-09-04 Joel Sherrill <joel@…>

  • clock/ckinit.c, clock/rtc.c, console/console.c, console/inch.c, console/outch.c, ide/ide.c, include/bsp.h, include/crt.h, ne2000/ne2000.c, start/start.S, startup/bspstart.c, startup/exit.c, startup/ldsegs.S, startup/linkcmds, timer/timer.c, timer/timerisr.S: URL for license changed.
  • Property mode set to 100644
File size: 9.4 KB
Line 
1/*-------------------------------------------------------------------------+
2| bsp.h v1.1 - PC386 BSP - 1997/08/07
3+--------------------------------------------------------------------------+
4| This include file contains definitions related to the PC386 BSP.
5+--------------------------------------------------------------------------+
6| (C) Copyright 1997 -
7| - NavIST Group - Real-Time Distributed Systems and Industrial Automation
8|
9| http://pandora.ist.utl.pt
10|
11| Instituto Superior Tecnico * Lisboa * PORTUGAL
12+--------------------------------------------------------------------------+
13| Modified by Eric Valette the 20/05/98 in order to add definitions used
14| to enhance video putchar capabilities.
15|
16| Copyright (C) 1998  valette@crf.canon.fr
17|
18| Canon Centre Recherche France.
19|
20+--------------------------------------------------------------------------+
21| Disclaimer:
22|
23| This file is provided "AS IS" without warranty of any kind, either
24| expressed or implied.
25+--------------------------------------------------------------------------+
26| This code is based on:
27|   bsp.h,v 1.5 1995/12/19 20:07:30 joel Exp - go32 BSP
28| With the following copyright notice:
29| **************************************************************************
30| *  COPYRIGHT (c) 1989-1999.
31| *  On-Line Applications Research Corporation (OAR).
32| *
33| *  The license and distribution terms for this file may be
34| *  found in found in the file LICENSE in this distribution or at
35| *  http://www.rtems.com/license/LICENSE.
36| **************************************************************************
37|
38|  $Id$
39+--------------------------------------------------------------------------*/
40
41
42#ifndef __BSP_H_
43#define __BSP_H_
44
45#ifdef __cplusplus
46extern "C" {
47#endif
48
49#include <bspopts.h>
50
51#include <rtems.h>
52#include <iosupp.h>
53#include <console.h>
54#include <clockdrv.h>
55#include <libcpu/cpu.h>
56#include <rtems/bspIo.h>
57 
58/*
59 *  confdefs.h overrides for this BSP:
60 *   - number of termios serial ports
61 *   - Interrupt stack space is not minimum if defined.
62 */
63
64#define CONFIGURE_NUMBER_OF_TERMIOS_PORTS 1
65
66#if STACK_MINIMUM_SIZE < (4 * 1024)
67#define CONFIGURE_INTERRUPT_STACK_MEMORY  (4 * 1024)
68#else
69#define CONFIGURE_INTERRUPT_STACK_MEMORY STACK_MINIMUM_SIZE
70#endif
71
72/*
73 * Network driver configuration
74 */
75
76struct rtems_bsdnet_ifconfig;
77
78extern int rtems_ne_driver_attach(struct rtems_bsdnet_ifconfig *, int);
79#define BSP_NE2000_NETWORK_DRIVER_NAME      "ne1"
80#define BSP_NE2000_NETWORK_DRIVER_ATTACH    rtems_ne_driver_attach
81
82extern int rtems_wd_driver_attach(struct rtems_bsdnet_ifconfig *, int);
83#define BSP_WD8003_NETWORK_DRIVER_NAME      "wd1"
84#define BSP_WD8003_NETWORK_DRIVER_ATTACH    rtems_wd_driver_attach
85
86extern int rtems_dec21140_driver_attach(struct rtems_bsdnet_ifconfig *, int);
87#define BSP_DEC21140_NETWORK_DRIVER_NAME    "dc1"
88#define BSP_DEC21140_NETWORK_DRIVER_ATTACH  rtems_dec21140_driver_attach
89
90#ifndef RTEMS_BSP_NETWORK_DRIVER_NAME
91#define RTEMS_BSP_NETWORK_DRIVER_NAME   BSP_DEC21140_NETWORK_DRIVER_NAME
92#endif
93
94#ifndef RTEMS_BSP_NETWORK_DRIVER_ATTACH
95#define RTEMS_BSP_NETWORK_DRIVER_ATTACH BSP_DEC21140_NETWORK_DRIVER_ATTACH
96#endif
97
98/*-------------------------------------------------------------------------+
99| Constants
100+--------------------------------------------------------------------------*/
101#define BSP_LIBIO_MAX_FDS 20             /* Number of libio files we want.    */
102
103/*-------------------------------------------------------------------------+
104| Video (console) related constants.
105+--------------------------------------------------------------------------*/
106
107#include <crt.h> 
108 
109/*-------------------------------------------------------------------------+
110| Constants relating to the 8254 (or 8253) programmable interval timers.
111+--------------------------------------------------------------------------*/
112#define IO_TIMER1      0x40
113                  /* Port address of the control port and timer channels */
114#define TIMER_CNTR0    (IO_TIMER1 + 0) /* timer 0 counter port           */
115#define TIMER_CNTR1    (IO_TIMER1 + 1) /* timer 1 counter port           */
116#define TIMER_CNTR2    (IO_TIMER1 + 2) /* timer 2 counter port           */
117#define TIMER_MODE     (IO_TIMER1 + 3) /* timer mode port                */
118#define TIMER_SEL0     0x00            /* select counter 0               */
119#define TIMER_SEL1     0x40            /* select counter 1               */
120#define TIMER_SEL2     0x80            /* select counter 2               */
121#define TIMER_INTTC    0x00            /* mode 0, intr on terminal cnt   */
122#define TIMER_ONESHOT  0x02            /* mode 1, one shot               */
123#define TIMER_RATEGEN  0x04            /* mode 2, rate generator         */
124#define TIMER_SQWAVE   0x06            /* mode 3, square wave            */
125#define TIMER_SWSTROBE 0x08            /* mode 4, s/w triggered strobe   */
126#define TIMER_HWSTROBE 0x0a            /* mode 5, h/w triggered strobe   */
127#define TIMER_LATCH    0x00            /* latch counter for reading      */
128#define TIMER_LSB      0x10            /* r/w counter LSB                */
129#define TIMER_MSB      0x20            /* r/w counter MSB                */
130#define TIMER_16BIT    0x30            /* r/w counter 16 bits, LSB first */
131#define TIMER_BCD      0x01            /* count in BCD                   */
132#define TIMER_RD_BACK  0xc0            /* Read Back Command              */
133                /* READ BACK command layout in the Command Register      */
134#define RB_NOT_COUNT    0x40           /* Don't select counter latch     */
135#define RB_NOT_STATUS   0x20           /* Don't select status latch      */
136#define RB_COUNT_0      0x02           /* Counter 0 latch                */
137#define RB_COUNT_1      0x04           /* Counter 1 latch                */
138#define RB_COUNT_2      0x08           /* Counter 2 latch                */
139#define RB_OUTPUT       0x80           /* Output of the counter is 1     */
140
141#define TIMER_TICK     1193182  /* The internal tick rate in ticks per second */
142
143/*-------------------------------------------------------------------------+
144| Define the time limits for RTEMS Test Suite test durations. Long test and
145| short test duration limits are provided. These values are in seconds and
146| need to be converted to ticks for the application.
147+--------------------------------------------------------------------------*/
148#define MAX_LONG_TEST_DURATION       300  /* 5 minutes = 300 seconds */
149#define MAX_SHORT_TEST_DURATION      3    /* 3 seconds */
150
151/*-------------------------------------------------------------------------+
152| Macros
153+--------------------------------------------------------------------------*/
154/*-------------------------------------------------------------------------+
155| Define the interrupt mechanism for Time Test 27.
156| NOTE: Use a software interrupt for the i386 family.
157+--------------------------------------------------------------------------*/
158#define MUST_WAIT_FOR_INTERRUPT 0
159#define Install_tm27_vector(handler) \
160{ \
161  rtems_isr_entry dummy; \
162  rtems_interrupt_catch(handler, 0x90, &dummy); \
163}
164#define Cause_tm27_intr() asm volatile("int $0x90" : :);
165#define Clear_tm27_intr()
166#define Lower_tm27_intr()
167
168/* does anyone need this? if so, report it so we can rename this macro */
169#if 0
170/*-------------------------------------------------------------------------+
171| Simple spin delay in microsecond units for device drivers.
172| This is very dependent on the clock speed of the target.
173+--------------------------------------------------------------------------*/
174#define rtems_bsp_delay(_microseconds) \
175{ \
176  rtems_unsigned32 _cnt = _microseconds; \
177  asm volatile ("0: nop; mov %0,%0; loop 0b" : "=c"(_cnt) : "0"(_cnt)); \
178}
179#endif
180
181/*-------------------------------------------------------------------------+
182| Convert microseconds to ticks and ticks to microseconds.
183+--------------------------------------------------------------------------*/
184#define US_TO_TICK(us) (((us)*105+44)/88)
185#define TICK_TO_US(tk) (((tk)*88+52)/105)
186
187/*-------------------------------------------------------------------------+
188| External Variables.
189+--------------------------------------------------------------------------*/
190#define IDT_SIZE 256
191#define GDT_SIZE 3
192
193extern interrupt_gate_descriptor Interrupt_descriptor_table[IDT_SIZE];
194extern segment_descriptors Global_descriptor_table   [GDT_SIZE];
195 
196extern rtems_configuration_table BSP_Configuration;
197                                    /* User provided BSP configuration table. */
198extern rtems_unsigned32          rtemsFreeMemStart;
199  /* Address of start of free memory - should be used when creating new
200     partitions or regions and updated afterwards. */
201
202/*-------------------------------------------------------------------------+
203| Function Prototypes.
204+--------------------------------------------------------------------------*/
205void          _IBMPC_initVideo(void);    /* from 'outch.c'  */
206void          _IBMPC_outch    (char);    /* from 'outch.c'  */
207char          _IBMPC_inch     (void);    /* from 'inch.c'   */ 
208char          _IBMPC_inch_sleep (void);  /* from 'inch.c'   */ 
209
210void rtemsReboot(void);                  /* from 'exit.c'   */
211
212void Wait_X_ms(unsigned int timeToWait); /* from 'timer.c'  */
213
214
215/* Definitions for BSPConsolePort */
216#define BSP_CONSOLE_PORT_CONSOLE (-1)
217#define BSP_CONSOLE_PORT_COM1    (BSP_UART_COM1)
218#define BSP_CONSOLE_PORT_COM2    (BSP_UART_COM2)
219
220/*
221 * indicate, that BSP has IDE driver
222 */
223#define RTEMS_BSP_HAS_IDE_DRIVER
224
225/* GDB stub stuff */
226void i386_stub_glue_init(int uart);
227void i386_stub_glue_init_breakin(void);
228void set_debug_traps(void);
229void breakpoint(void);
230
231#ifdef __cplusplus
232}
233#endif
234
235#endif /* __BSP_H_ */
236/* end of include file */
237
238
239
240
241
242
Note: See TracBrowser for help on using the repository browser.