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

Last change on this file since 09b6a093 was 09b6a093, checked in by Joel Sherrill <joel.sherrill@…>, on 05/24/00 at 17:06:54

Significantly lowered the default memory requirements:

  • CONFIGURE_RTEMS_INIT_TASKS_TABLE was 10 now 0
  • CONFIGURE_POSIX_INIT_THREAD_TABLE was 10 now 0
  • CONFIGURE_ITRON_INIT_TASK_TABLE was 10 now 0
  • CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS was 20 now 3
  • added CONFIGURE_NUMBER_OF_TERMIOS_PORTS and defaulted to 1
  • added CONFIGURE_TERMIOS_DISABLED defaulted to "enabled"
  • miniIMFS is now the default

Added configuration error checks that:

+ Ensure > 0 tasks/threads are configured
+ Ensure at least one inititalization task/thread is defined

bsp.h now defines these so BSP specific requirements
are accounted for.

+ CONFIGURE_NUMBER_OF_TERMIOS_PORTS
+ CONFIGURE_INTERRUPT_STACK_MEMORY

console_reserve_resources and rtems_termios_reserve_resources
are no longer required and considered obsolete. Calls to
rtems_termios_reserve_resources have been eliminated although
the routine is still there and the body "if 0'ed".

We are very close to having NO reason to modify the
configuration tables in the BSP. Be warned that eventually
we would like to see the need for BSP_Configuration
eliminated!

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