[rtems commit] i386/smp: Define CPU_Interrupt_frame as non-void struct

Joel Sherrill joel at rtems.org
Fri Mar 16 16:02:11 UTC 2018

Module:    rtems
Branch:    master
Commit:    e9fb313376b59bd8aa987ce6614db2753e8b28ca
Changeset: http://git.rtems.org/rtems/commit/?id=e9fb313376b59bd8aa987ce6614db2753e8b28ca

Author:    Amaan Cheval <amaan.cheval at gmail.com>
Date:      Tue Mar 13 22:02:13 2018 +0530

i386/smp: Define CPU_Interrupt_frame as non-void struct

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 f009a17..311a781 100644
--- a/cpukit/score/cpu/i386/include/rtems/score/cpu.h
+++ b/cpukit/score/cpu/i386/include/rtems/score/cpu.h
@@ -274,12 +274,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.
+   */
  * 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 {

More information about the vc mailing list