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

4.104.114.84.95
Last change on this file since dc6763c8 was dc6763c8, checked in by Joel Sherrill <joel.sherrill@…>, on 10/06/98 at 13:02:51

Patch from Emmanuel Raguet <raguet@…> to add networking
information to this file to be more like the gen68360.

  • Property mode set to 100644
File size: 7.9 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-1998.
31| *  On-Line Applications Research Corporation (OAR).
32| *  Copyright assigned to U.S. Government, 1994.
33| *
34| *  The license and distribution terms for this file may be
35| *  found in found in the file LICENSE in this distribution or at
36| *  http://www.OARcorp.com/rtems/license.html.
37| **************************************************************************
38|
39|  $Id$
40+--------------------------------------------------------------------------*/
41
42
43#ifndef __BSP_H_
44#define __BSP_H_
45
46#ifdef __cplusplus
47extern "C" {
48#endif
49
50#include <rtems.h>
51#include <iosupp.h>
52#include <console.h>
53#include <clockdrv.h>
54#include <libcpu/cpu.h>
55#include <bspIo.h>
56 
57/*
58 * Network driver configuration
59 */
60
61struct rtems_bsdnet_ifconfig;
62extern int rtems_wd_driver_attach (struct rtems_bsdnet_ifconfig *config);
63
64#define RTEMS_BSP_NETWORK_DRIVER_NAME "wd1"
65#define RTEMS_BSP_NETWORK_DRIVER_ATTACH       rtems_wd_driver_attach
66
67/*-------------------------------------------------------------------------+
68| Constants
69+--------------------------------------------------------------------------*/
70#define BSP_LIBIO_MAX_FDS 20             /* Number of libio files we want.    */
71
72/*-------------------------------------------------------------------------+
73| Video (console) related constants.
74+--------------------------------------------------------------------------*/
75
76#include <crt.h> 
77 
78/*-------------------------------------------------------------------------+
79| Constants relating to the 8254 (or 8253) programmable interval timers.
80+--------------------------------------------------------------------------*/
81#define IO_TIMER1      0x40
82                  /* Port address of the control port and timer channels */
83#define TIMER_CNTR0    (IO_TIMER1 + 0) /* timer 0 counter port           */
84#define TIMER_CNTR1    (IO_TIMER1 + 1) /* timer 1 counter port           */
85#define TIMER_CNTR2    (IO_TIMER1 + 2) /* timer 2 counter port           */
86#define TIMER_MODE     (IO_TIMER1 + 3) /* timer mode port                */
87#define TIMER_SEL0     0x00            /* select counter 0               */
88#define TIMER_SEL1     0x40            /* select counter 1               */
89#define TIMER_SEL2     0x80            /* select counter 2               */
90#define TIMER_INTTC    0x00            /* mode 0, intr on terminal cnt   */
91#define TIMER_ONESHOT  0x02            /* mode 1, one shot               */
92#define TIMER_RATEGEN  0x04            /* mode 2, rate generator         */
93#define TIMER_SQWAVE   0x06            /* mode 3, square wave            */
94#define TIMER_SWSTROBE 0x08            /* mode 4, s/w triggered strobe   */
95#define TIMER_HWSTROBE 0x0a            /* mode 5, h/w triggered strobe   */
96#define TIMER_LATCH    0x00            /* latch counter for reading      */
97#define TIMER_LSB      0x10            /* r/w counter LSB                */
98#define TIMER_MSB      0x20            /* r/w counter MSB                */
99#define TIMER_16BIT    0x30            /* r/w counter 16 bits, LSB first */
100#define TIMER_BCD      0x01            /* count in BCD                   */
101
102#define TIMER_TICK     1193182  /* The internal tick rate in ticks per second */
103
104/*-------------------------------------------------------------------------+
105| Define the time limits for RTEMS Test Suite test durations. Long test and
106| short test duration limits are provided. These values are in seconds and
107| need to be converted to ticks for the application.
108+--------------------------------------------------------------------------*/
109#define MAX_LONG_TEST_DURATION       300  /* 5 minutes = 300 seconds */
110#define MAX_SHORT_TEST_DURATION      3    /* 3 seconds */
111
112/*-------------------------------------------------------------------------+
113| Macros
114+--------------------------------------------------------------------------*/
115/*-------------------------------------------------------------------------+
116| Define the interrupt mechanism for Time Test 27.
117| NOTE: Use a software interrupt for the i386 family.
118+--------------------------------------------------------------------------*/
119#define MUST_WAIT_FOR_INTERRUPT 0
120#define Install_tm27_vector(handler) \
121{ \
122  rtems_isr_entry dummy; \
123  rtems_interrupt_catch(handler, 0x90, &dummy); \
124}
125#define Cause_tm27_intr() asm volatile("int $0x90" : :);
126#define Clear_tm27_intr()
127#define Lower_tm27_intr()
128
129/*-------------------------------------------------------------------------+
130| Simple spin delay in microsecond units for device drivers.
131| This is very dependent on the clock speed of the target.
132+--------------------------------------------------------------------------*/
133#define delay(_microseconds) \
134{ \
135  rtems_unsigned32 _cnt = _microseconds; \
136  asm volatile ("0: nop; mov %0,%0; loop 0b" : "=c"(_cnt) : "0"(_cnt)); \
137}
138
139/*-------------------------------------------------------------------------+
140| Convert microseconds to ticks and ticks to microseconds.
141+--------------------------------------------------------------------------*/
142#define US_TO_TICK(us) (((us)*105+44)/88)
143#define TICK_TO_US(tk) (((tk)*88+52)/105)
144
145/*-------------------------------------------------------------------------+
146| External Variables.
147+--------------------------------------------------------------------------*/
148#define IDT_SIZE 256
149#define GDT_SIZE 3
150
151extern interrupt_gate_descriptor Interrupt_descriptor_table[IDT_SIZE];
152extern segment_descriptors Global_descriptor_table   [GDT_SIZE];
153 
154extern rtems_configuration_table BSP_Configuration;
155                                    /* User provided BSP configuration table. */
156extern rtems_unsigned32          rtemsFreeMemStart;
157  /* Address of start of free memory - should be used when creating new
158     partitions or regions and updated afterwards. */
159
160/*-------------------------------------------------------------------------+
161| Function Prototypes.
162+--------------------------------------------------------------------------*/
163void          _IBMPC_initVideo(void);    /* from 'outch.c'  */
164void          _IBMPC_outch    (char);    /* from 'outch.c'  */
165rtems_boolean _IBMPC_chrdy    (char *);  /* from 'inch.c'   */
166char          _IBMPC_inch     (void);    /* from 'inch.c'   */
167char          _IBMPC_inch_sleep (void);  /* from 'inch.c'   */
168
169void printk(char *fmt, ...);             /* from 'printk.c' */
170
171void rtemsReboot(void);                  /* from 'exit.c'   */
172
173/* Definitions for BSPConsolePort */
174#define BSP_CONSOLE_PORT_CONSOLE (-1)
175#define BSP_CONSOLE_PORT_COM1    (BSP_UART_COM1)
176#define BSP_CONSOLE_PORT_COM2    (BSP_UART_COM2)
177
178/* GDB stub stuff */
179void i386_stub_glue_init(int uart);
180void i386_stub_glue_init_breakin(void);
181void set_debug_traps(void);
182void breakpoint(void);
183
184#ifdef __cplusplus
185}
186#endif
187
188#endif /* __BSP_H_ */
189/* end of include file */
190
191
192
193
194
195
Note: See TracBrowser for help on using the repository browser.