1 | /* |
---|
2 | * This include file definitions related to an Intel i386ex board. |
---|
3 | * |
---|
4 | * COPYRIGHT (c) 1989-1999. |
---|
5 | * On-Line Applications Research Corporation (OAR). |
---|
6 | * |
---|
7 | * The license and distribution terms for this file may be |
---|
8 | * found in the file LICENSE in this distribution or at |
---|
9 | * http://www.rtems.com/license/LICENSE. |
---|
10 | * |
---|
11 | * $Id$ |
---|
12 | */ |
---|
13 | |
---|
14 | #ifndef _BSP_H |
---|
15 | #define _BSP_H |
---|
16 | |
---|
17 | #ifdef __cplusplus |
---|
18 | extern "C" { |
---|
19 | #endif |
---|
20 | |
---|
21 | #include <bspopts.h> |
---|
22 | |
---|
23 | #include <rtems.h> |
---|
24 | #include <rtems/iosupp.h> |
---|
25 | #include <rtems/console.h> |
---|
26 | #include <rtems/clockdrv.h> |
---|
27 | #include <rtems/bspIo.h> |
---|
28 | #include <libcpu/cpu.h> |
---|
29 | #include <bsp/irq.h> |
---|
30 | |
---|
31 | /* |
---|
32 | * Simple spin delay in microsecond units for device drivers. |
---|
33 | * This is very dependent on the clock speed of the target. |
---|
34 | */ |
---|
35 | |
---|
36 | #define rtems_bsp_delay( _microseconds ) \ |
---|
37 | { \ |
---|
38 | uint32_t _counter; \ |
---|
39 | \ |
---|
40 | _counter = (_microseconds); \ |
---|
41 | \ |
---|
42 | asm volatile ( "0: nop;" \ |
---|
43 | " mov %0,%0 ;" \ |
---|
44 | " loop 0b" : "=c" (_counter) \ |
---|
45 | : "0" (_counter) \ |
---|
46 | ); \ |
---|
47 | \ |
---|
48 | } |
---|
49 | |
---|
50 | /* Constants */ |
---|
51 | |
---|
52 | #define RAM_START 0 |
---|
53 | |
---|
54 | /* replaced the earlier EI kludge of 0xfffff */ |
---|
55 | |
---|
56 | #define RAM_END 0x100000 |
---|
57 | |
---|
58 | /* I/O addressing */ |
---|
59 | |
---|
60 | /* |
---|
61 | *#define Is_tx_ready( _status ) ( (_status) & 0x20 ) |
---|
62 | */ |
---|
63 | /* dec 20. try the TE instead of TBE as the check */ |
---|
64 | |
---|
65 | #define Is_tx_ready( _status ) ( (_status) & 0x40 ) |
---|
66 | |
---|
67 | #define Is_rx_ready( _status ) ( (_status) & 0x01 ) |
---|
68 | |
---|
69 | /* Structures */ |
---|
70 | |
---|
71 | #ifdef F386_INIT |
---|
72 | #undef BSP_EXTERN |
---|
73 | #define BSP_EXTERN |
---|
74 | #else |
---|
75 | #undef BSP_EXTERN |
---|
76 | #define BSP_EXTERN extern |
---|
77 | #endif |
---|
78 | |
---|
79 | /* |
---|
80 | * Device Driver Table Entries |
---|
81 | */ |
---|
82 | |
---|
83 | /* |
---|
84 | * NOTE: Use the standard Console driver entry |
---|
85 | */ |
---|
86 | |
---|
87 | /* |
---|
88 | * NOTE: Use the standard Clock driver entry |
---|
89 | */ |
---|
90 | |
---|
91 | /* miscellaneous stuff assumed to exist */ |
---|
92 | |
---|
93 | extern rtems_configuration_table BSP_Configuration; |
---|
94 | |
---|
95 | #define IDT_SIZE 256 |
---|
96 | #define GDT_SIZE 8192 |
---|
97 | |
---|
98 | extern interrupt_gate_descriptor Interrupt_descriptor_table[IDT_SIZE]; |
---|
99 | extern segment_descriptors Global_descriptor_table [GDT_SIZE]; |
---|
100 | |
---|
101 | BSP_EXTERN unsigned short Idt[3]; /* Interrupt Descriptor Table Address */ |
---|
102 | BSP_EXTERN unsigned short Gdt[3]; /* Global Descriptor Table Address */ |
---|
103 | BSP_EXTERN unsigned int Idt_base; |
---|
104 | BSP_EXTERN unsigned int Gdt_base; |
---|
105 | |
---|
106 | /* routines */ |
---|
107 | |
---|
108 | #ifdef __cplusplus |
---|
109 | } |
---|
110 | #endif |
---|
111 | |
---|
112 | #endif |
---|