source: rtems/c/src/lib/libbsp/i386/i386ex/include/bsp.h @ 752cd8f

4.104.114.84.95
Last change on this file since 752cd8f was 752cd8f, checked in by Joel Sherrill <joel.sherrill@…>, on 10/15/96 at 20:57:04

initial version from Erik

  • Property mode set to 100644
File size: 3.2 KB
RevLine 
[752cd8f]1/*  bsp.h
2 *
3 *  This include file definitions related to the Force CPU-386 board.
4 *
5 *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
6 *  On-Line Applications Research Corporation (OAR).
7 *  All rights assigned to U.S. Government, 1994.
8 *
9 *  This material may be reproduced by or for the U.S. Government pursuant
10 *  to the copyright license under the clause at DFARS 252.227-7013.  This
11 *  notice must appear in all copies of this file and its derivatives.
12 *
13 *  $Id$
14 */
15
16#ifndef __FORCE386_h
17#define __FORCE386_h
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23#include <rtems.h>
24#include <iosupp.h>
25
26/*
27 *  Define the time limits for RTEMS Test Suite test durations.
28 *  Long test and short test duration limits are provided.  These
29 *  values are in seconds and need to be converted to ticks for the
30 *  application.
31 *
32 */
33
34#define MAX_LONG_TEST_DURATION       300 /* 5 minutes = 300 seconds */
35#define MAX_SHORT_TEST_DURATION      3   /* 3 seconds */
36
37/*
38 *  Define the interrupt mechanism for Time Test 27
39 *
40 *  NOTE: Use a software interrupt for the i386.
41 */
42
43#define MUST_WAIT_FOR_INTERRUTPT 0
44
45#define Install_tm27_vector( handler ) set_vector( (handler), 0x90, 1 )
46
47#define Cause_tm27_intr()              asm volatile( "int $0x90" : : );
48
49#define Clear_tm27_intr()
50
51#define Lower_tm27_intr()
52
53/*
54 *  Simple spin delay in microsecond units for device drivers.
55 *  This is very dependent on the clock speed of the target.
56 */
57
58#define delay( _microseconds ) \
59  { \
60    rtems_unsigned32 _counter; \
61    \
62    _counter = (_microseconds); \
63    \
64    asm volatile ( "0: nop;" \
65                   " mov %0,%0 ;" \
66                   " loop 0b" : "=c" (_counter) \
67                              : "0"  (_counter) \
68                 ); \
69    \
70  }
71
72/* Constants */
73
74#define RAM_START 0
75
76/* replaced the earlier EI kludge of 0xfffff */
77
78#define RAM_END   0x100000
79
80/* I/O addressing */
81
82/*
83 *#define Is_tx_ready( _status ) ( (_status) & 0x20 )
84 */
85/* dec 20. try the TE instead of TBE as the check */
86
87#define Is_tx_ready( _status ) ( (_status) & 0x40 )
88
89
90#define Is_rx_ready( _status ) ( (_status) & 0x01 )
91
92/* Timer constants: WE DON'T use THESE */
93
94#define IERA   0x106     /* Interrupt Enable Register A */
95#define IMRA   0x112     /* Interrupt Mask Register A */
96#define TACR   0x118     /* Timer A Control Register */
97#define TADR   0x11e     /* Timer A Data Register */
98
99#define IERB   0x108     /* Interrupt Enable Register B */
100#define TBCR   0x11a     /* Timer B Control Register */
101#define TBDR   0x120     /* Timer B Data Register */
102
103/* Structures */
104
105#ifdef F386_INIT
106#undef BSP_EXTERN
107#define BSP_EXTERN
108#else
109#undef BSP_EXTERN
110#define BSP_EXTERN extern
111#endif
112
113/* miscellaneous stuff assumed to exist */
114
115extern rtems_configuration_table BSP_Configuration;
116
117extern i386_IDT_slot Interrupt_descriptor_table[ 256 ];
118extern i386_GDT_slot Global_descriptor_table[ 8192 ];
119
120BSP_EXTERN unsigned short Idt[3];  /* Interrupt Descriptor Table Address */
121BSP_EXTERN unsigned short Gdt[3];  /* Global Descriptor Table Address */
122BSP_EXTERN unsigned int   Idt_base;
123BSP_EXTERN unsigned int   Gdt_base;
124
125/* routines */
126
127i386_isr_entry set_vector(
128  rtems_isr_entry     handler,
129  rtems_vector_number vector,
130  int                 type
131);
132
133#ifdef __cplusplus
134}
135#endif
136
137#endif
138/* end of include file */
Note: See TracBrowser for help on using the repository browser.