[PATCH v2 1/3] i386/smp: Define CPU_Interrupt_frame as non-void struct

Amaan Cheval amaan.cheval at gmail.com
Tue Mar 13 16:14:13 UTC 2018


This change, excluding the #error directive, lets us make progress towards
compiling i386 targets with --enable-smp.

The #error directive needs to be there since the CPU_Interrupt_frame is used by
the SMP context switching code, and this placeholder struct, if used, would only
lead to more subtle bugs and errors. With the directive, the SMP context
switching code can be improved separately.

Updates #3331
---
 cpukit/score/cpu/i386/include/rtems/score/cpu.h | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/cpukit/score/cpu/i386/include/rtems/score/cpu.h b/cpukit/score/cpu/i386/include/rtems/score/cpu.h
index f78149c24b..364bba765a 100644
--- a/cpukit/score/cpu/i386/include/rtems/score/cpu.h
+++ b/cpukit/score/cpu/i386/include/rtems/score/cpu.h
@@ -271,12 +271,26 @@ typedef void (*cpuExcHandlerType) (CPU_Exception_frame*);
 extern cpuExcHandlerType _currentExcHandler;
 extern void rtems_exception_init_mngt(void);
 
+#ifdef RTEMS_SMP
+  /* Throw compile-time error to indicate incomplete support */
+  #error "i386 targets do not support SMP.\
+ See: https://devel.rtems.org/ticket/3335"
+
+  /*
+   * This size must match the size of the CPU_Interrupt_frame, which must be
+   * used in the SMP context switch code, which is incomplete at the moment.
+   */
+  #define CPU_INTERRUPT_FRAME_SIZE 4
+#endif
+
 /*
  * This port does not pass any frame info to the
  * interrupt handler.
  */
 
-typedef void CPU_Interrupt_frame;
+typedef struct {
+  uint32_t todo_replace_with_apt_registers;
+} CPU_Interrupt_frame;
 
 typedef enum {
   I386_EXCEPTION_DIVIDE_BY_ZERO      = 0,
-- 
2.13.0




More information about the devel mailing list