summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1998-09-21 00:24:51 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1998-09-21 00:24:51 +0000
commitc610a1f300b410fb58a9af21884000fcabc9aa02 (patch)
tree5e2455eda5b1802310723c166dafb640a15094f1
parentUpdate from Erik Ivanenko <erik.ivanenko@utoronto.ca> to bring the (diff)
downloadrtems-c610a1f300b410fb58a9af21884000fcabc9aa02.tar.bz2
Update from Eric Valette <valette@crf.canon.fr>:
Here are patches that bring 980911 back to what I think is a correct version of raw IDT management as well as a correct initialisation of video console and rtems managed interrupts.
-rw-r--r--c/src/lib/libbsp/i386/pc386/start/start16.s4
-rw-r--r--c/src/lib/libbsp/i386/pc386/startup/bspstart.c9
-rw-r--r--c/src/lib/libbsp/i386/shared/io/bspIo.h1
-rw-r--r--c/src/lib/libbsp/i386/shared/irq/irq_init.c18
4 files changed, 16 insertions, 16 deletions
diff --git a/c/src/lib/libbsp/i386/pc386/start/start16.s b/c/src/lib/libbsp/i386/pc386/start/start16.s
index 778c0dd597..d09430e0af 100644
--- a/c/src/lib/libbsp/i386/pc386/start/start16.s
+++ b/c/src/lib/libbsp/i386/pc386/start/start16.s
@@ -92,10 +92,8 @@ _start16:
#else
ljmp $PROT_CODE_SEG, $1f # flush prefetch queue, and reload %cs
#endif
-1:
-
.code32
-
+1:
/*---------------------------------------------------------------------+
| load the other segment registers
+---------------------------------------------------------------------*/
diff --git a/c/src/lib/libbsp/i386/pc386/startup/bspstart.c b/c/src/lib/libbsp/i386/pc386/startup/bspstart.c
index 7927ef2c0b..5d6635d13b 100644
--- a/c/src/lib/libbsp/i386/pc386/startup/bspstart.c
+++ b/c/src/lib/libbsp/i386/pc386/startup/bspstart.c
@@ -1,6 +1,4 @@
/*-------------------------------------------------------------------------+
-| bspstart.c v1.1 - PC386 BSP - 1997/08/07
-+--------------------------------------------------------------------------+
| This file contains the PC386 BSP startup package. It includes application,
| board, and monitor specific initialization and configuration. The generic CPU
| dependent initialization has been performed before this routine is invoked.
@@ -38,12 +36,12 @@
#include <libcsupport.h>
#include <rtems/libio.h>
#include <libcpu/cpuModel.h>
+#include <pc386uart.h>
/*-------------------------------------------------------------------------+
| Global Variables
+--------------------------------------------------------------------------*/
extern rtems_unsigned32 _end; /* End of BSS. Defined in 'linkcmds'. */
-
/*
* Size of heap if it is 0 it will be dynamically defined by memory size,
* otherwise the value should be changed by binary patch
@@ -75,6 +73,7 @@ extern void _exit(int); /* define in exit.c */
void bsp_libc_init( void *, unsigned32, int );
void bsp_postdriver_hook(void);
extern void rtems_irq_mngt_init();
+extern void _IBMPC_initVideo(void);
/*-------------------------------------------------------------------------+
| Function: bsp_pretasking_hook
@@ -151,6 +150,10 @@ void bsp_start( void )
* Calibrate variable for 1ms-loop (see timer.c)
*/
Calibrate_loop_1ms();
+ /*
+ * Initialize printk channel
+ */
+ _IBMPC_initVideo();
rtemsFreeMemStart = (rtems_unsigned32)&_end + _stack_size;
/* set the value of start of free memory. */
diff --git a/c/src/lib/libbsp/i386/shared/io/bspIo.h b/c/src/lib/libbsp/i386/shared/io/bspIo.h
index e9dc6f4bfb..0ff070c4c5 100644
--- a/c/src/lib/libbsp/i386/shared/io/bspIo.h
+++ b/c/src/lib/libbsp/i386/shared/io/bspIo.h
@@ -26,7 +26,6 @@ typedef char (*BSP_polling_getchar_function_type) (void);
extern BSP_output_char_function_type BSP_output_char;
extern BSP_polling_getchar_function_type BSP_poll_char;
-extern void BSP_emergency_output_init(void);
/*
* All the function declared as extern after this comment
* are available for each ix86 BSP by compiling and linking
diff --git a/c/src/lib/libbsp/i386/shared/irq/irq_init.c b/c/src/lib/libbsp/i386/shared/irq/irq_init.c
index 3521bdd510..4199d30488 100644
--- a/c/src/lib/libbsp/i386/shared/irq/irq_init.c
+++ b/c/src/lib/libbsp/i386/shared/irq/irq_init.c
@@ -119,16 +119,18 @@ void rtems_irq_mngt_init()
unsigned limit;
unsigned int level;
-
i386_get_info_from_IDTR (&idt_entry_tbl, &limit);
-
+ /* Convert limit into number of entries */
+ limit = (limit + 1) / sizeof(interrupt_gate_descriptor);
+
_CPU_ISR_Disable(level);
/*
* Init the complete IDT vector table with defaultRawIrq value
*/
- for (i = 0; i < IDT_SIZE; i++) {
- idtHdl[i] = defaultRawIrq;
+ for (i = 0; i < limit; i++) {
+ idtHdl[i] = defaultRawIrq;
+ idtHdl[i].idtIndex = i;
}
raw_initial_config.idtSize = IDT_SIZE;
raw_initial_config.defaultRawEntry = defaultRawIrq;
@@ -138,7 +140,6 @@ void rtems_irq_mngt_init()
/*
* put something here that will show the failure...
*/
- BSP_emergency_output_init();
printk("Unable to initialize IDT!!! System locked\n");
while (1);
}
@@ -159,7 +160,8 @@ void rtems_irq_mngt_init()
* re-init the rtemsIrq table
*/
for (i = 0; i < PC_386_IRQ_LINES_NUMBER; i++) {
- rtemsIrq[i] = defaultIrq;
+ rtemsIrq[i] = defaultIrq;
+ rtemsIrq[i].name = i;
}
/*
* Init initial Interrupt management config
@@ -169,11 +171,11 @@ void rtems_irq_mngt_init()
initial_config.irqHdlTbl = rtemsIrq;
initial_config.irqBase = PC386_ASM_IRQ_VECTOR_BASE;
initial_config.irqPrioTbl = irqPrioTable;
+
if (!pc386_rtems_irq_mngt_set(&initial_config)) {
/*
* put something here that will show the failure...
*/
- BSP_emergency_output_init();
printk("Unable to initialize RTEMS interrupt Management!!! System locked\n");
while (1);
}
@@ -188,8 +190,6 @@ void rtems_irq_mngt_init()
*/
unsigned tmp;
- BSP_emergency_output_init();
-
printk("idt_entry_tbl = %x Interrupt_descriptor_table addr = %x\n",
idt_entry_tbl, &Interrupt_descriptor_table);
tmp = (unsigned) get_hdl_from_vector (PC386_ASM_IRQ_VECTOR_BASE + PC_386_PERIODIC_TIMER);