source: rtems/c/src/lib/libbsp/i386/go32/include/bsp.h @ 4ca27cf

4.104.114.84.95
Last change on this file since 4ca27cf was 4ca27cf, checked in by Joel Sherrill <joel.sherrill@…>, on 07/18/95 at 21:19:53

committing for rtems-3.2.01 snapshot

  • Property mode set to 100644
File size: 4.4 KB
Line 
1/*  bsp.h
2 *
3 *  This include file definitions related to the ibm386 (go32) 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 __IBMPC_h
17#define __IBMPC_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/*
39 *  Define the interrupt mechanism for Time Test 27
40 *
41 *  NOTE: Use a software interrupt for the i386.
42 */
43#define MUST_WAIT_FOR_INTERRUTPT 0
44#define Install_tm27_vector( handler ) set_vector( (handler), 0x90, 1 )
45#define Cause_tm27_intr()              asm volatile( "int $0x90" : : );
46#define Clear_tm27_intr()
47#define Lower_tm27_intr()
48
49
50/*
51 *  Simple spin delay in microsecond units for device drivers.
52 *  This is very dependent on the clock speed of the target.
53 */
54
55#define delay( _microseconds )  { \
56    rtems_unsigned32 _cnt = (_microseconds); \
57    asm volatile ("0: nop; mov %0,%0; loop 0b" : "=c"(_cnt) : "0"(_cnt) ); \
58}
59
60
61/* Constants */
62
63/* Assume color console */
64#define COLOR           1
65#if COLOR
66# define        GDC_REG_PORT    0x3d4
67# define        GDC_VAL_PORT    0x3d5
68# define        TVRAM           ((unsigned short *)0xb8000L)
69#else
70# define        GDC_REG_PORT    0x3b4
71# define        GDC_VAL_PORT    0x3b5
72# define        TVRAM           ((unsigned short *)0xb0000L)
73#endif
74
75/* White character attribute--works for MGA and CGA */
76#define WHITE   0x07
77
78/* Ports for PC keyboard */
79#define KBD_CTL 0x61
80#define KBD_DATA 0x60
81#define KBD_STATUS 0x64
82
83/* Constants relating to the 8254 (or 8253) programmable interval timers */
84 /*     Port address of the control port and timer channels */
85/*
86 * Macros for specifying values to be written into a mode register.
87 */
88#define IO_TIMER1       0x40
89#define TIMER_CNTR0     (IO_TIMER1 + 0) /* timer 0 counter port */
90#define TIMER_CNTR1     (IO_TIMER1 + 1) /* timer 1 counter port */
91#define TIMER_CNTR2     (IO_TIMER1 + 2) /* timer 2 counter port */
92#define TIMER_MODE      (IO_TIMER1 + 3) /* timer mode port */
93#define         TIMER_SEL0      0x00    /* select counter 0 */
94#define         TIMER_SEL1      0x40    /* select counter 1 */
95#define         TIMER_SEL2      0x80    /* select counter 2 */
96#define         TIMER_INTTC     0x00    /* mode 0, intr on terminal cnt */
97#define         TIMER_ONESHOT   0x02    /* mode 1, one shot */
98#define         TIMER_RATEGEN   0x04    /* mode 2, rate generator */
99#define         TIMER_SQWAVE    0x06    /* mode 3, square wave */
100#define         TIMER_SWSTROBE  0x08    /* mode 4, s/w triggered strobe */
101#define         TIMER_HWSTROBE  0x0a    /* mode 5, h/w triggered strobe */
102#define         TIMER_LATCH     0x00    /* latch counter for reading */
103#define         TIMER_LSB       0x10    /* r/w counter LSB */
104#define         TIMER_MSB       0x20    /* r/w counter MSB */
105#define         TIMER_16BIT     0x30    /* r/w counter 16 bits, LSB first */
106#define         TIMER_BCD       0x01    /* count in BCD */
107
108/*      The internal tick rate in ticks per second */
109#define         TIMER_TICK      1193182
110#define         US_TO_TICK(us)  (((us)*105+44)/88)
111#define         TICK_TO_US(tk)  (((tk)*88+52)/105)
112
113/* Structures */
114
115#ifdef IBMPC_INIT
116#undef BSP_EXTERN
117#define BSP_EXTERN
118#else
119#undef BSP_EXTERN
120#define BSP_EXTERN extern
121#endif
122
123/* functions */
124
125int _IBMPC_chrdy( char * ch );
126int _IBMPC_inch( void );
127void _IBMPC_outch( unsigned char );
128
129/* miscellaneous stuff assumed to exist */
130
131extern rtems_configuration_table BSP_Configuration;
132
133#if 0
134extern i386_IDT_slot Interrupt_descriptor_table[ 256 ];
135extern i386_GDT_slot Global_descriptor_table[ 8192 ];
136BSP_EXTERN unsigned short Idt[3];  /* Interrupt Descriptor Table Address */
137BSP_EXTERN unsigned short Gdt[3];  /* Global Descriptor Table Address */
138BSP_EXTERN unsigned int   Idt_base;
139BSP_EXTERN unsigned int   Gdt_base;
140#endif
141
142/* routines */
143
144i386_isr_entry set_vector(
145  rtems_isr_entry     handler,
146  rtems_vector_number vector,
147  int                 type
148);
149
150#ifdef __cplusplus
151}
152#endif
153
154#endif
155/* end of include file */
156
Note: See TracBrowser for help on using the repository browser.