source: rtems/c/src/lib/libbsp/i386/go32/include/bsp.h @ 637df35

4.104.114.84.95
Last change on this file since 637df35 was 637df35, checked in by Joel Sherrill <joel.sherrill@…>, on 07/12/95 at 19:47:25

Ada95, gnat, go32

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