File indexing completed on 2025-05-11 08:23:41
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047 #ifndef LIBBSP_I386_PC386_BSP_H
0048 #define LIBBSP_I386_PC386_BSP_H
0049
0050
0051
0052
0053
0054
0055 #ifndef ASM
0056
0057 #include <bspopts.h>
0058 #include <bsp/default-initial-extension.h>
0059 #include <bsp/tblsizes.h>
0060
0061 #include <rtems.h>
0062 #include <rtems/score/cpu.h>
0063 #include <rtems/bspIo.h>
0064
0065 #ifdef __cplusplus
0066 extern "C" {
0067 #endif
0068
0069
0070
0071 #define BSP_HAS_FRAME_BUFFER 1
0072
0073
0074
0075
0076 struct rtems_bsdnet_ifconfig;
0077
0078
0079
0080
0081
0082
0083 extern void
0084 BSP_runtime_console_select(int *pPrintkPort, int *pConsolePort);
0085
0086 extern int rtems_ne_driver_attach(struct rtems_bsdnet_ifconfig *, int);
0087 #define BSP_NE2000_NETWORK_DRIVER_NAME "ne1"
0088 #define BSP_NE2000_NETWORK_DRIVER_ATTACH rtems_ne_driver_attach
0089
0090 extern int rtems_wd_driver_attach(struct rtems_bsdnet_ifconfig *, int);
0091 #define BSP_WD8003_NETWORK_DRIVER_NAME "wd1"
0092 #define BSP_WD8003_NETWORK_DRIVER_ATTACH rtems_wd_driver_attach
0093
0094 extern int rtems_dec21140_driver_attach(struct rtems_bsdnet_ifconfig *, int);
0095 #define BSP_DEC21140_NETWORK_DRIVER_NAME "dc1"
0096 #define BSP_DEC21140_NETWORK_DRIVER_ATTACH rtems_dec21140_driver_attach
0097
0098 extern int rtems_3c509_driver_attach(struct rtems_bsdnet_ifconfig *config);
0099 #define BSP_3C509_NETWORK_DRIVER_NAME "3c1"
0100 #define BSP_3C509_NETWORK_DRIVER_ATTACH rtems_3c509_driver_attach
0101
0102 #ifndef RTEMS_BSP_NETWORK_DRIVER_NAME
0103 #define RTEMS_BSP_NETWORK_DRIVER_NAME BSP_DEC21140_NETWORK_DRIVER_NAME
0104 #endif
0105
0106 #ifndef RTEMS_BSP_NETWORK_DRIVER_ATTACH
0107 #define RTEMS_BSP_NETWORK_DRIVER_ATTACH BSP_DEC21140_NETWORK_DRIVER_ATTACH
0108 #endif
0109
0110
0111
0112
0113
0114
0115
0116
0117 #define IO_TIMER1 0x40
0118
0119 #define TIMER_CNTR0 (IO_TIMER1 + 0)
0120 #define TIMER_CNTR1 (IO_TIMER1 + 1)
0121 #define TIMER_CNTR2 (IO_TIMER1 + 2)
0122 #define TIMER_MODE (IO_TIMER1 + 3)
0123 #define TIMER_SEL0 0x00
0124 #define TIMER_SEL1 0x40
0125 #define TIMER_SEL2 0x80
0126 #define TIMER_INTTC 0x00
0127 #define TIMER_ONESHOT 0x02
0128 #define TIMER_RATEGEN 0x04
0129 #define TIMER_SQWAVE 0x06
0130 #define TIMER_SWSTROBE 0x08
0131 #define TIMER_HWSTROBE 0x0a
0132 #define TIMER_LATCH 0x00
0133 #define TIMER_LSB 0x10
0134 #define TIMER_MSB 0x20
0135 #define TIMER_16BIT 0x30
0136 #define TIMER_BCD 0x01
0137 #define TIMER_RD_BACK 0xc0
0138
0139 #define RB_NOT_COUNT 0x40
0140 #define RB_NOT_STATUS 0x20
0141 #define RB_COUNT_0 0x02
0142 #define RB_COUNT_1 0x04
0143 #define RB_COUNT_2 0x08
0144 #define RB_OUTPUT 0x80
0145
0146 #define TIMER_TICK 1193182
0147
0148 #if defined( RTEMS_SMP )
0149 extern ISR_lock_Control rtems_i386_i8254_access_lock;
0150 #endif
0151
0152
0153
0154
0155
0156
0157
0158 #define BSP_CONSOLE_VGA 0
0159 #define BSP_CONSOLE_COM1 1
0160 #define BSP_CONSOLE_COM2 2
0161
0162
0163
0164
0165 #define US_TO_TICK(us) (((us)*105+44)/88)
0166 #define TICK_TO_US(tk) (((tk)*88+52)/105)
0167
0168
0169
0170
0171 extern interrupt_gate_descriptor Interrupt_descriptor_table[IDT_SIZE];
0172 extern segment_descriptors _Global_descriptor_table [GDT_SIZE];
0173
0174
0175
0176
0177 void _IBMPC_initVideo(void);
0178 void _IBMPC_outch (char);
0179 char _IBMPC_inch (void);
0180 char _IBMPC_inch_sleep (void);
0181 int BSP_wait_polled_input(void);
0182 int rtems_kbpoll( void );
0183 int getch( void );
0184 void add_to_queue( unsigned short b );
0185
0186 void Wait_X_ms(unsigned int timeToWait);
0187 void Calibrate_loop_1ms(void);
0188
0189 void rtems_irq_mngt_init(void);
0190
0191 void Clock_driver_install_handler(void);
0192 void Clock_driver_support_initialize_hardware(void);
0193
0194 void *bsp_idle_thread( uintptr_t ignored );
0195 #define BSP_IDLE_TASK_BODY bsp_idle_thread
0196
0197 void kbd_reset_setup(char *str, int *ints);
0198 size_t read_aux(char * buffer, size_t count);
0199
0200 bool bsp_get_serial_mouse_device(
0201 const char **name,
0202 const char **type
0203 );
0204
0205 void register_leds(
0206 int console,
0207 unsigned int led,
0208 unsigned int *addr,
0209 unsigned int mask
0210 );
0211
0212
0213 #define BSP_CONSOLE_PORT_CONSOLE (-1)
0214 #define BSP_CONSOLE_PORT_COM1 (BSP_UART_COM1)
0215 #define BSP_CONSOLE_PORT_COM2 (BSP_UART_COM2)
0216
0217
0218
0219
0220 const char* bsp_cmdline(void);
0221 const char* bsp_cmdline_arg(const char* arg);
0222
0223 #if BSP_ENABLE_IDE
0224
0225
0226
0227 void bsp_ide_cmdline_init(void);
0228
0229
0230
0231
0232 #define RTEMS_BSP_HAS_IDE_DRIVER
0233 #endif
0234
0235
0236 void init_remote_gdb( void );
0237 void i386_stub_glue_init(int uart);
0238 void i386_stub_glue_init_breakin(void);
0239 int i386_stub_glue_uart(void);
0240 void breakpoint(void);
0241
0242
0243
0244
0245 typedef __FILE FILE;
0246 uint32_t BSP_irq_count_dump(FILE *f);
0247
0248
0249
0250
0251
0252 void raw_idt_notify(void);
0253 void C_dispatch_isr(int vector);
0254
0255 #ifdef RTEMS_SMP
0256
0257 int imps_probe(void);
0258 void ipi_install_irq(void);
0259 int send_ipi(unsigned int dst, unsigned int v);
0260 #endif
0261
0262 #ifdef __cplusplus
0263 }
0264 #endif
0265
0266 #endif
0267
0268
0269
0270 #endif