summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1998-08-05 15:15:46 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1998-08-05 15:15:46 +0000
commitab0df696d09f6b53b33345d207f8aead63a6fcab (patch)
treee446f792382e49b1169482837cd842a82fb2350b /c/src/lib/libbsp
parentFixed name of Buffer so this would compile. (diff)
downloadrtems-ab0df696d09f6b53b33345d207f8aead63a6fcab.tar.bz2
Automatic CPU type detection code from Eric Valette <valette@crf.canon.fr>.
Enabled on the pc386.
Diffstat (limited to 'c/src/lib/libbsp')
-rw-r--r--c/src/lib/libbsp/i386/force386/include/bsp.h7
-rw-r--r--c/src/lib/libbsp/i386/force386/startup/setvec.c2
-rw-r--r--c/src/lib/libbsp/i386/i386ex/include/bsp.h7
-rw-r--r--c/src/lib/libbsp/i386/i386ex/startup/setvec.c8
-rw-r--r--c/src/lib/libbsp/i386/pc386/console/console.c6
-rw-r--r--c/src/lib/libbsp/i386/pc386/start/start.s13
-rw-r--r--c/src/lib/libbsp/i386/pc386/startup/bspstart.c6
7 files changed, 27 insertions, 22 deletions
diff --git a/c/src/lib/libbsp/i386/force386/include/bsp.h b/c/src/lib/libbsp/i386/force386/include/bsp.h
index 125e53ec88..63e06e2326 100644
--- a/c/src/lib/libbsp/i386/force386/include/bsp.h
+++ b/c/src/lib/libbsp/i386/force386/include/bsp.h
@@ -146,8 +146,11 @@ extern "C" {
extern rtems_configuration_table BSP_Configuration;
-extern i386_IDT_slot Interrupt_descriptor_table[ 256 ];
-extern i386_GDT_slot Global_descriptor_table[ 8192 ];
+#define IDT_SIZE 256
+#define GDT_SIZE 8192
+
+extern interrupt_gate_descriptor Interrupt_descriptor_table[IDT_SIZE];
+extern segment_descriptors Global_descriptor_table [GDT_SIZE];
BSP_EXTERN unsigned short Idt[3]; /* Interrupt Descriptor Table Address */
BSP_EXTERN unsigned short Gdt[3]; /* Global Descriptor Table Address */
diff --git a/c/src/lib/libbsp/i386/force386/startup/setvec.c b/c/src/lib/libbsp/i386/force386/startup/setvec.c
index 62b9494ab8..eb2cf51e42 100644
--- a/c/src/lib/libbsp/i386/force386/startup/setvec.c
+++ b/c/src/lib/libbsp/i386/force386/startup/setvec.c
@@ -32,7 +32,7 @@ i386_isr_entry set_vector( /* returns old vector */
)
{
i386_isr_entry previous_isr;
- i386_IDT_slot idt;
+ interrupt_gate_descriptor idt;
if ( type )
rtems_interrupt_catch( handler, vector, (rtems_isr_entry *) &previous_isr );
diff --git a/c/src/lib/libbsp/i386/i386ex/include/bsp.h b/c/src/lib/libbsp/i386/i386ex/include/bsp.h
index 896f4e5cc3..9c37d8248e 100644
--- a/c/src/lib/libbsp/i386/i386ex/include/bsp.h
+++ b/c/src/lib/libbsp/i386/i386ex/include/bsp.h
@@ -116,8 +116,11 @@ extern "C" {
extern rtems_configuration_table BSP_Configuration;
-extern i386_IDT_slot Interrupt_descriptor_table[ 256 ];
-extern i386_GDT_slot Global_descriptor_table[ 8192 ];
+#define IDT_SIZE 256
+#define GDT_SIZE 8192
+
+extern interrupt_gate_descriptor Interrupt_descriptor_table[IDT_SIZE];
+extern segment_descriptors Global_descriptor_table [GDT_SIZE];
BSP_EXTERN unsigned short Idt[3]; /* Interrupt Descriptor Table Address */
BSP_EXTERN unsigned short Gdt[3]; /* Global Descriptor Table Address */
diff --git a/c/src/lib/libbsp/i386/i386ex/startup/setvec.c b/c/src/lib/libbsp/i386/i386ex/startup/setvec.c
index 62b9494ab8..9e7a0e758d 100644
--- a/c/src/lib/libbsp/i386/i386ex/startup/setvec.c
+++ b/c/src/lib/libbsp/i386/i386ex/startup/setvec.c
@@ -32,7 +32,7 @@ i386_isr_entry set_vector( /* returns old vector */
)
{
i386_isr_entry previous_isr;
- i386_IDT_slot idt;
+ interrupt_gate_descriptor idt;
if ( type )
rtems_interrupt_catch( handler, vector, (rtems_isr_entry *) &previous_isr );
@@ -45,11 +45,7 @@ i386_isr_entry set_vector( /* returns old vector */
((idt.offset_16_31 << 16) | idt.offset_0_15);
/* build the IDT entry */
- idt.offset_0_15 = ((rtems_unsigned32) handler) & 0xffff;
- idt.segment_selector = get_cs();
- idt.reserved = 0x00;
- idt.p_dpl = 0x8e; /* present, ISR */
- idt.offset_16_31 = ((rtems_unsigned32) handler) >> 16;
+ create_interrupt_gate_descriptor( &idt, handler );
/* install the IDT entry */
Interrupt_descriptor_table[ vector ] = idt;
diff --git a/c/src/lib/libbsp/i386/pc386/console/console.c b/c/src/lib/libbsp/i386/pc386/console/console.c
index c8d9a2c4f4..fb711ef578 100644
--- a/c/src/lib/libbsp/i386/pc386/console/console.c
+++ b/c/src/lib/libbsp/i386/pc386/console/console.c
@@ -232,7 +232,11 @@ console_initialize(rtems_device_major_number major,
printk("Initialized console on port COM2 9600-8-N-1\n\n");
}
}
-
+#define DISPLAY_CPU_INFO
+#ifdef DISPLAY_CPU_INFO
+ printCpuInfo();
+#endif
+
return RTEMS_SUCCESSFUL;
} /* console_initialize */
diff --git a/c/src/lib/libbsp/i386/pc386/start/start.s b/c/src/lib/libbsp/i386/pc386/start/start.s
index 36fad8153c..5ff92f3134 100644
--- a/c/src/lib/libbsp/i386/pc386/start/start.s
+++ b/c/src/lib/libbsp/i386/pc386/start/start.s
@@ -64,6 +64,8 @@ BEGIN_CODE
EXTERN (_return_to_monitor)
EXTERN (_IBMPC_initVideo)
EXTERN (debugPollingGetChar)
+ EXTERN (checkCPUtypeSetCr0)
+
/*
* In case this crashes on your machine and this is not due
@@ -87,8 +89,8 @@ speakl: jmp speakl # and SPIN!!!
nop
cli # DISABLE INTERRUPTS!!!
-#ifdef DEBUG_EARLY_START
cld
+#ifdef DEBUG_EARLY_START
/*
* Must get video attribute to have a working printk.
* Note that the following code assume we already have
@@ -149,14 +151,9 @@ SYM (zero_bss):
stosl # clear a long in the bss
/*---------------------------------------------------------------------+
-| Initialize the i387.
-|
-| Using the NO WAIT form of the instruction insures that if it is not
-| present the board will not lock up or get an exception.
+| Check CPU type. Enable Cache and init coprocessor if needed.
+---------------------------------------------------------------------*/
-
- fninit # MUST USE NO-WAIT FORM
-
+ call checkCPUtypeSetCr0
/*---------------------------------------------------------------------+
| Transfer control to User's Board Support Package
+---------------------------------------------------------------------*/
diff --git a/c/src/lib/libbsp/i386/pc386/startup/bspstart.c b/c/src/lib/libbsp/i386/pc386/startup/bspstart.c
index 744808b3be..24303b36a7 100644
--- a/c/src/lib/libbsp/i386/pc386/startup/bspstart.c
+++ b/c/src/lib/libbsp/i386/pc386/startup/bspstart.c
@@ -37,7 +37,8 @@
#include <bsp.h>
#include <libcsupport.h>
#include <rtems/libio.h>
-
+#include <libcpu/cpuModel.h>
+
/*-------------------------------------------------------------------------+
| Global Variables
+--------------------------------------------------------------------------*/
@@ -58,6 +59,7 @@ extern rtems_configuration_table Configuration;
rtems_cpu_table Cpu_table; /* CPU configuration table. */
char *rtems_progname; /* Program name - from main(). */
+extern void debugPollingGetChar();
/*-------------------------------------------------------------------------+
| External Prototypes
@@ -130,7 +132,7 @@ void bsp_start( void )
console_reserve_resources(&BSP_Configuration);
/*
- * Init trems_interrupt_management
+ * Init rtems_interrupt_management
*/
rtems_irq_mngt_init();