summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/i386
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1998-08-21 16:39:52 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1998-08-21 16:39:52 +0000
commiteb562f2c860061868e4ea1a821a84147b694dd07 (patch)
tree4273d9ac092dab0e00e065a365595a2b30fcc95f /c/src/lib/libbsp/i386
parentSpacing changes (diff)
downloadrtems-eb562f2c860061868e4ea1a821a84147b694dd07.tar.bz2
Patch from Eric Valette <valette@crf.canon.fr>:
Here is a patch that enables to catch exception and get message before crashing RTEMS :) It should be generic to any Intel port although enabled only for pc386 BSP... [Joel] I fixed the bug I introduced in irq_asm.s...
Diffstat (limited to 'c/src/lib/libbsp/i386')
-rw-r--r--c/src/lib/libbsp/i386/pc386/Makefile.in6
-rw-r--r--c/src/lib/libbsp/i386/pc386/start/start16.s12
-rw-r--r--c/src/lib/libbsp/i386/pc386/startup/bspstart.c7
-rw-r--r--c/src/lib/libbsp/i386/pc386/wrapup/Makefile.in6
-rw-r--r--c/src/lib/libbsp/i386/shared/irq/irq.c23
-rw-r--r--c/src/lib/libbsp/i386/shared/irq/irq_asm.s5
6 files changed, 41 insertions, 18 deletions
diff --git a/c/src/lib/libbsp/i386/pc386/Makefile.in b/c/src/lib/libbsp/i386/pc386/Makefile.in
index 4862454e13..f30692edfc 100644
--- a/c/src/lib/libbsp/i386/pc386/Makefile.in
+++ b/c/src/lib/libbsp/i386/pc386/Makefile.in
@@ -11,9 +11,9 @@ PROJECT_ROOT = @PROJECT_ROOT@
include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
include $(RTEMS_ROOT)/make/directory.cfg
-# We only build the Network library if HAS_NETWORKING was defined
-NETWORK_yes_V = network
-NETWORK = $(NETWORK_$(HAS_NETWORKING)_V)
+# # We only build the Network library if HAS_NETWORKING was defined
+# NETWORK_yes_V = network
+# NETWORK = $(NETWORK_$(HAS_NETWORKING)_V)
# wrapup is the one that actually builds and installs the library
# from the individual .rel files built in other directories
diff --git a/c/src/lib/libbsp/i386/pc386/start/start16.s b/c/src/lib/libbsp/i386/pc386/start/start16.s
index c10a658718..778c0dd597 100644
--- a/c/src/lib/libbsp/i386/pc386/start/start16.s
+++ b/c/src/lib/libbsp/i386/pc386/start/start16.s
@@ -33,7 +33,7 @@
.set HDROFF, 0x24 # offset into bin2boot header of start32 addr
.set STACKOFF, 0x200-0x10 # offset to load into %esp, from start of image
-
+/* #define NEW_GAS*/
/*----------------------------------------------------------------------------+
| CODE section
+----------------------------------------------------------------------------*/
@@ -78,14 +78,20 @@ _start16:
/*---------------------------------------------------------------------+
| Bare PC machines boot in real mode! We have to turn protected mode on.
+---------------------------------------------------------------------*/
-
+#ifdef NEW_GAS
+ data32
+ addr32
+#endif
lgdt gdtptr - start16 # load Global Descriptor Table
-
movl %cr0, %eax
orl $CR0_PE, %eax
movl %eax, %cr0 # turn on protected mode
+#ifdef NEW_GAS
+ ljmpl $PROT_CODE_SEG, $1f # flush prefetch queue, and reload %cs
+#else
ljmp $PROT_CODE_SEG, $1f # flush prefetch queue, and reload %cs
+#endif
1:
.code32
diff --git a/c/src/lib/libbsp/i386/pc386/startup/bspstart.c b/c/src/lib/libbsp/i386/pc386/startup/bspstart.c
index 13e8610c42..7ebcc60685 100644
--- a/c/src/lib/libbsp/i386/pc386/startup/bspstart.c
+++ b/c/src/lib/libbsp/i386/pc386/startup/bspstart.c
@@ -173,10 +173,13 @@ void bsp_start( void )
console_reserve_resources(&BSP_Configuration);
/*
- * Init rtems_interrupt_management
+ * Init rtems interrupt management
*/
rtems_irq_mngt_init();
-
+ /*
+ * Init rtems exceptions management
+ */
+ rtems_exception_init_mngt();
/*
* The following information is very useful when debugging.
*/
diff --git a/c/src/lib/libbsp/i386/pc386/wrapup/Makefile.in b/c/src/lib/libbsp/i386/pc386/wrapup/Makefile.in
index 70515fdb8e..c8672490d7 100644
--- a/c/src/lib/libbsp/i386/pc386/wrapup/Makefile.in
+++ b/c/src/lib/libbsp/i386/pc386/wrapup/Makefile.in
@@ -8,9 +8,9 @@ VPATH = @srcdir@
RTEMS_ROOT = @top_srcdir@
PROJECT_ROOT = @PROJECT_ROOT@
-# We only build the Network library if HAS_NETWORKING was defined
-NETWORK_yes_V = network
-NETWORK = $(NETWORK_$(HAS_NETWORKING)_V)
+# # We only build the Network library if HAS_NETWORKING was defined
+# NETWORK_yes_V = network
+# NETWORK = $(NETWORK_$(HAS_NETWORKING)_V)
BSP_PIECES=startup clock console timer pc386dev $(NETWORK)
GENERIC_PIECES=
diff --git a/c/src/lib/libbsp/i386/shared/irq/irq.c b/c/src/lib/libbsp/i386/shared/irq/irq.c
index 356112076f..9dea372e0f 100644
--- a/c/src/lib/libbsp/i386/shared/irq/irq.c
+++ b/c/src/lib/libbsp/i386/shared/irq/irq.c
@@ -14,7 +14,9 @@
#include <bsp.h>
#include <irq.h>
-
+#include <rtems/score/thread.h>
+#include <rtems/score/apiext.h>
+
/*
* pointer to the mask representing the additionnal irq vectors
* that must be disabled when a particular entry is activated.
@@ -360,11 +362,18 @@ int pc386_rtems_irq_mngt_get(rtems_irq_global_settings** config)
void _ThreadProcessSignalsFromIrq (CPU_Exception_frame* ctx)
{
/*
- * If I understand the _Thread_Dispatch routine correctly
- * I do not see how this routine can be called given the
- * actual code. I plan to use this so far unused feature
- * to implement remote debugger ptrace("attach", ...)
- * command.
+ * Process pending signals that have not already been
+ * processed by _Thread_Displatch. This happens quite
+ * unfrequently : the ISR must have posted an action
+ * to the current running thread.
+ */
+ if ( _Thread_Do_post_task_switch_extension ||
+ _Thread_Executing->do_post_task_switch_extension ) {
+ _Thread_Executing->do_post_task_switch_extension = FALSE;
+ _API_extensions_Run_postswitch();
+ }
+ /*
+ * I plan to process other thread related events here.
+ * This will include DEBUG session requsted from keyboard...
*/
- printk(" _ThreadProcessSignalsFromIrq called! mail valette@crf.canon.fr\n");
}
diff --git a/c/src/lib/libbsp/i386/shared/irq/irq_asm.s b/c/src/lib/libbsp/i386/shared/irq/irq_asm.s
index a3954d0961..4be08ed992 100644
--- a/c/src/lib/libbsp/i386/shared/irq/irq_asm.s
+++ b/c/src/lib/libbsp/i386/shared/irq/irq_asm.s
@@ -14,6 +14,8 @@
#include "asm.h"
#include <irq_asm.h>
+ BEGIN_CODE
+
SYM (_ISR_Handler):
/*
* Before this was point is reached the vectors unique
@@ -243,3 +245,6 @@ SYM (default_raw_idt_handler):
popa
iret
+END_CODE
+
+END