[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 | |
---|
[34c4852] | 14 | #ifndef _BSP_H |
---|
| 15 | #define _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> |
---|
[d5bbaa8] | 29 | #include <bsp/irq.h> |
---|
[6128a4a] | 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 | * Simple spin delay in microsecond units for device drivers. |
---|
| 42 | * This is very dependent on the clock speed of the target. |
---|
| 43 | */ |
---|
| 44 | |
---|
[cf282090] | 45 | #define rtems_bsp_delay( _microseconds ) \ |
---|
[752cd8f] | 46 | { \ |
---|
[f0cbd19e] | 47 | uint32_t _counter; \ |
---|
[752cd8f] | 48 | \ |
---|
| 49 | _counter = (_microseconds); \ |
---|
| 50 | \ |
---|
| 51 | asm volatile ( "0: nop;" \ |
---|
| 52 | " mov %0,%0 ;" \ |
---|
| 53 | " loop 0b" : "=c" (_counter) \ |
---|
| 54 | : "0" (_counter) \ |
---|
| 55 | ); \ |
---|
| 56 | \ |
---|
| 57 | } |
---|
| 58 | |
---|
| 59 | /* Constants */ |
---|
| 60 | |
---|
| 61 | #define RAM_START 0 |
---|
| 62 | |
---|
| 63 | /* replaced the earlier EI kludge of 0xfffff */ |
---|
| 64 | |
---|
| 65 | #define RAM_END 0x100000 |
---|
| 66 | |
---|
| 67 | /* I/O addressing */ |
---|
| 68 | |
---|
| 69 | /* |
---|
| 70 | *#define Is_tx_ready( _status ) ( (_status) & 0x20 ) |
---|
| 71 | */ |
---|
| 72 | /* dec 20. try the TE instead of TBE as the check */ |
---|
| 73 | |
---|
| 74 | #define Is_tx_ready( _status ) ( (_status) & 0x40 ) |
---|
| 75 | |
---|
| 76 | #define Is_rx_ready( _status ) ( (_status) & 0x01 ) |
---|
| 77 | |
---|
| 78 | /* Structures */ |
---|
| 79 | |
---|
| 80 | #ifdef F386_INIT |
---|
| 81 | #undef BSP_EXTERN |
---|
| 82 | #define BSP_EXTERN |
---|
| 83 | #else |
---|
| 84 | #undef BSP_EXTERN |
---|
| 85 | #define BSP_EXTERN extern |
---|
| 86 | #endif |
---|
| 87 | |
---|
[d1dbcab9] | 88 | /* |
---|
| 89 | * Device Driver Table Entries |
---|
| 90 | */ |
---|
[6128a4a] | 91 | |
---|
[d1dbcab9] | 92 | /* |
---|
| 93 | * NOTE: Use the standard Console driver entry |
---|
| 94 | */ |
---|
[6128a4a] | 95 | |
---|
[d1dbcab9] | 96 | /* |
---|
| 97 | * NOTE: Use the standard Clock driver entry |
---|
| 98 | */ |
---|
[6128a4a] | 99 | |
---|
[752cd8f] | 100 | /* miscellaneous stuff assumed to exist */ |
---|
| 101 | |
---|
| 102 | extern rtems_configuration_table BSP_Configuration; |
---|
| 103 | |
---|
[ab0df696] | 104 | #define IDT_SIZE 256 |
---|
| 105 | #define GDT_SIZE 8192 |
---|
| 106 | |
---|
| 107 | extern interrupt_gate_descriptor Interrupt_descriptor_table[IDT_SIZE]; |
---|
| 108 | extern segment_descriptors Global_descriptor_table [GDT_SIZE]; |
---|
[752cd8f] | 109 | |
---|
| 110 | BSP_EXTERN unsigned short Idt[3]; /* Interrupt Descriptor Table Address */ |
---|
| 111 | BSP_EXTERN unsigned short Gdt[3]; /* Global Descriptor Table Address */ |
---|
| 112 | BSP_EXTERN unsigned int Idt_base; |
---|
| 113 | BSP_EXTERN unsigned int Gdt_base; |
---|
| 114 | |
---|
| 115 | /* routines */ |
---|
| 116 | |
---|
| 117 | #ifdef __cplusplus |
---|
| 118 | } |
---|
| 119 | #endif |
---|
| 120 | |
---|
| 121 | #endif |
---|
| 122 | /* end of include file */ |
---|