[d1dbcab9] | 1 | /* |
---|
| 2 | * This include file definitions related to an Intel i386ex board. |
---|
[752cd8f] | 3 | * |
---|
[08311cc3] | 4 | * COPYRIGHT (c) 1989-1999. |
---|
[752cd8f] | 5 | * On-Line Applications Research Corporation (OAR). |
---|
| 6 | * |
---|
[98e4ebf5] | 7 | * The license and distribution terms for this file may be |
---|
| 8 | * found in the file LICENSE in this distribution or at |
---|
[6ff7e2c] | 9 | * http://www.rtems.com/license/LICENSE. |
---|
[752cd8f] | 10 | * |
---|
| 11 | * $Id$ |
---|
| 12 | */ |
---|
| 13 | |
---|
[b22feedc] | 14 | #ifndef __I386EX_BSP_h |
---|
| 15 | #define __I386EX_BSP_h |
---|
[752cd8f] | 16 | |
---|
| 17 | #ifdef __cplusplus |
---|
| 18 | extern "C" { |
---|
| 19 | #endif |
---|
| 20 | |
---|
[cac4c75] | 21 | #include <bspopts.h> |
---|
| 22 | |
---|
[752cd8f] | 23 | #include <rtems.h> |
---|
[8529cf6] | 24 | #include <rtems/iosupp.h> |
---|
| 25 | #include <rtems/console.h> |
---|
| 26 | #include <rtems/clockdrv.h> |
---|
[45805cc] | 27 | #include <rtems/bspIo.h> |
---|
[b7d8cb7] | 28 | #include <libcpu/cpu.h> |
---|
[bd8c8b2a] | 29 | #include <irq.h> |
---|
| 30 | |
---|
[df49c60] | 31 | /* |
---|
| 32 | * confdefs.h overrides for this BSP: |
---|
| 33 | * - number of termios serial ports (defaults to 1) |
---|
| 34 | * - Interrupt stack space is not minimum if defined. |
---|
| 35 | */ |
---|
| 36 | |
---|
| 37 | /* #define CONFIGURE_NUMBER_OF_TERMIOS_PORTS 2 */ |
---|
| 38 | #define CONFIGURE_INTERRUPT_STACK_MEMORY (8 * 1024) |
---|
| 39 | |
---|
[752cd8f] | 40 | /* |
---|
| 41 | * Define the time limits for RTEMS Test Suite test durations. |
---|
| 42 | * Long test and short test duration limits are provided. These |
---|
| 43 | * values are in seconds and need to be converted to ticks for the |
---|
| 44 | * application. |
---|
| 45 | * |
---|
| 46 | */ |
---|
| 47 | |
---|
| 48 | #define MAX_LONG_TEST_DURATION 300 /* 5 minutes = 300 seconds */ |
---|
| 49 | #define MAX_SHORT_TEST_DURATION 3 /* 3 seconds */ |
---|
| 50 | |
---|
| 51 | /* |
---|
| 52 | * Define the interrupt mechanism for Time Test 27 |
---|
| 53 | * |
---|
| 54 | * NOTE: Use a software interrupt for the i386. |
---|
| 55 | */ |
---|
| 56 | |
---|
| 57 | #define MUST_WAIT_FOR_INTERRUTPT 0 |
---|
| 58 | |
---|
| 59 | |
---|
[04bc5d9] | 60 | #define Install_tm27_vector(handler) \ |
---|
| 61 | { \ |
---|
| 62 | rtems_isr_entry dummy; \ |
---|
| 63 | rtems_interrupt_catch(handler, 0x90, &dummy); \ |
---|
| 64 | } |
---|
[752cd8f] | 65 | #define Cause_tm27_intr() asm volatile( "int $0x90" : : ); |
---|
| 66 | |
---|
| 67 | #define Clear_tm27_intr() |
---|
| 68 | |
---|
| 69 | #define Lower_tm27_intr() |
---|
| 70 | |
---|
| 71 | /* |
---|
| 72 | * Simple spin delay in microsecond units for device drivers. |
---|
| 73 | * This is very dependent on the clock speed of the target. |
---|
| 74 | */ |
---|
| 75 | |
---|
[cf282090] | 76 | #define rtems_bsp_delay( _microseconds ) \ |
---|
[752cd8f] | 77 | { \ |
---|
[f0cbd19e] | 78 | uint32_t _counter; \ |
---|
[752cd8f] | 79 | \ |
---|
| 80 | _counter = (_microseconds); \ |
---|
| 81 | \ |
---|
| 82 | asm volatile ( "0: nop;" \ |
---|
| 83 | " mov %0,%0 ;" \ |
---|
| 84 | " loop 0b" : "=c" (_counter) \ |
---|
| 85 | : "0" (_counter) \ |
---|
| 86 | ); \ |
---|
| 87 | \ |
---|
| 88 | } |
---|
| 89 | |
---|
| 90 | /* Constants */ |
---|
| 91 | |
---|
| 92 | #define RAM_START 0 |
---|
| 93 | |
---|
| 94 | /* replaced the earlier EI kludge of 0xfffff */ |
---|
| 95 | |
---|
| 96 | #define RAM_END 0x100000 |
---|
| 97 | |
---|
| 98 | /* I/O addressing */ |
---|
| 99 | |
---|
| 100 | /* |
---|
| 101 | *#define Is_tx_ready( _status ) ( (_status) & 0x20 ) |
---|
| 102 | */ |
---|
| 103 | /* dec 20. try the TE instead of TBE as the check */ |
---|
| 104 | |
---|
| 105 | #define Is_tx_ready( _status ) ( (_status) & 0x40 ) |
---|
| 106 | |
---|
| 107 | |
---|
| 108 | #define Is_rx_ready( _status ) ( (_status) & 0x01 ) |
---|
| 109 | |
---|
| 110 | /* Structures */ |
---|
| 111 | |
---|
| 112 | #ifdef F386_INIT |
---|
| 113 | #undef BSP_EXTERN |
---|
| 114 | #define BSP_EXTERN |
---|
| 115 | #else |
---|
| 116 | #undef BSP_EXTERN |
---|
| 117 | #define BSP_EXTERN extern |
---|
| 118 | #endif |
---|
| 119 | |
---|
[d1dbcab9] | 120 | /* |
---|
| 121 | * Device Driver Table Entries |
---|
| 122 | */ |
---|
| 123 | |
---|
| 124 | /* |
---|
| 125 | * NOTE: Use the standard Console driver entry |
---|
| 126 | */ |
---|
| 127 | |
---|
| 128 | /* |
---|
| 129 | * NOTE: Use the standard Clock driver entry |
---|
| 130 | */ |
---|
| 131 | |
---|
[752cd8f] | 132 | /* miscellaneous stuff assumed to exist */ |
---|
| 133 | |
---|
| 134 | extern rtems_configuration_table BSP_Configuration; |
---|
| 135 | |
---|
[ab0df696] | 136 | #define IDT_SIZE 256 |
---|
| 137 | #define GDT_SIZE 8192 |
---|
| 138 | |
---|
| 139 | extern interrupt_gate_descriptor Interrupt_descriptor_table[IDT_SIZE]; |
---|
| 140 | extern segment_descriptors Global_descriptor_table [GDT_SIZE]; |
---|
[752cd8f] | 141 | |
---|
| 142 | BSP_EXTERN unsigned short Idt[3]; /* Interrupt Descriptor Table Address */ |
---|
| 143 | BSP_EXTERN unsigned short Gdt[3]; /* Global Descriptor Table Address */ |
---|
| 144 | BSP_EXTERN unsigned int Idt_base; |
---|
| 145 | BSP_EXTERN unsigned int Gdt_base; |
---|
| 146 | |
---|
| 147 | /* routines */ |
---|
| 148 | |
---|
| 149 | #ifdef __cplusplus |
---|
| 150 | } |
---|
| 151 | #endif |
---|
| 152 | |
---|
| 153 | #endif |
---|
| 154 | /* end of include file */ |
---|