[rtems commit] i386: prepare for paravirtualized interrupts

Gedare Bloom gedare at rtems.org
Thu Mar 3 21:43:04 UTC 2016


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

Author:    Gedare Bloom <gedare at rtems.org>
Date:      Fri Jan  8 16:54:20 2016 -0500

i386: prepare for paravirtualized interrupts

---

 c/src/lib/libbsp/i386/pc386/startup/bsp_fatal_halt.c | 5 ++---
 cpukit/score/cpu/i386/cpu.c                          | 4 ++++
 cpukit/score/cpu/i386/rtems/score/cpu.h              | 7 +++++++
 cpukit/score/cpu/i386/rtems/score/interrupts.h       | 9 ++++++++-
 4 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/c/src/lib/libbsp/i386/pc386/startup/bsp_fatal_halt.c b/c/src/lib/libbsp/i386/pc386/startup/bsp_fatal_halt.c
index c9830f6..efc93a0 100644
--- a/c/src/lib/libbsp/i386/pc386/startup/bsp_fatal_halt.c
+++ b/c/src/lib/libbsp/i386/pc386/startup/bsp_fatal_halt.c
@@ -11,10 +11,9 @@
 
 void _CPU_Fatal_halt(uint32_t source, uint32_t error)
 {
-  uint32_t _error_lvalue = ( _error );
   __asm__ volatile (
          "cli ; movl %0,%%eax ; hlt"
-         : "=r" ((_error_lvalue))
-         : "0" ((_error_lvalue))
+         : "=r" ((error))
+         : "0" ((error))
   );
 }
diff --git a/cpukit/score/cpu/i386/cpu.c b/cpukit/score/cpu/i386/cpu.c
index 17aa990..f0bbad4 100644
--- a/cpukit/score/cpu/i386/cpu.c
+++ b/cpukit/score/cpu/i386/cpu.c
@@ -115,7 +115,11 @@ uint32_t   _CPU_ISR_Get_level( void )
 {
   uint32_t   level;
 
+#if !defined(RTEMS_PARAVIRT)
   i386_get_interrupt_level( level );
+#else
+  level = i386_get_interrupt_level();
+#endif
 
   return level;
 }
diff --git a/cpukit/score/cpu/i386/rtems/score/cpu.h b/cpukit/score/cpu/i386/rtems/score/cpu.h
index 84a8c97..ce703ae 100644
--- a/cpukit/score/cpu/i386/rtems/score/cpu.h
+++ b/cpukit/score/cpu/i386/rtems/score/cpu.h
@@ -395,6 +395,7 @@ extern Context_Control_fp _CPU_Null_fp_context;
  *     + set a particular level
  */
 
+#if !defined(RTEMS_PARAVIRT)
 #define _CPU_ISR_Disable( _level ) i386_disable_interrupts( _level )
 
 #define _CPU_ISR_Enable( _level )  i386_enable_interrupts( _level )
@@ -406,6 +407,12 @@ extern Context_Control_fp _CPU_Null_fp_context;
     if ( _new_level ) __asm__ volatile ( "cli" ); \
     else              __asm__ volatile ( "sti" ); \
   }
+#else
+#define _CPU_ISR_Disable( _level ) _level = i386_disable_interrupts( )
+#define _CPU_ISR_Enable( _level ) i386_enable_interrupts( _level )
+#define _CPU_ISR_Flash( _level ) i386_flash_interrupts( _level )
+#define _CPU_ISR_Set_level( _new_level ) i386_set_interrupt_level( _new_level)
+#endif
 
 uint32_t   _CPU_ISR_Get_level( void );
 
diff --git a/cpukit/score/cpu/i386/rtems/score/interrupts.h b/cpukit/score/cpu/i386/rtems/score/interrupts.h
index 9cf0c99..3a7971c 100644
--- a/cpukit/score/cpu/i386/rtems/score/interrupts.h
+++ b/cpukit/score/cpu/i386/rtems/score/interrupts.h
@@ -33,7 +33,7 @@ typedef int  (*rtems_raw_irq_is_enabled)	(const struct __rtems_raw_irq_connect_d
  * 
  */
 /**@{**/
-
+#if !defined(RTEMS_PARAVIRT)
 #define i386_disable_interrupts( _level ) \
   { \
     __asm__ volatile ( "pushf ; \
@@ -71,6 +71,13 @@ typedef int  (*rtems_raw_irq_is_enabled)	(const struct __rtems_raw_irq_connect_d
     \
     _level = (_eflags & EFLAGS_INTR_ENABLE) ? 0 : 1; \
   } while (0)
+#else
+uint32_t i386_disable_interrupts( void );
+void i386_enable_interrupts(uint32_t level);
+void i386_flash_interrupts(uint32_t level);
+void i386_set_interrupt_level(uint32_t new_level);
+uint32_t i386_get_interrupt_level( void );
+#endif /* PARAVIRT */
 
 /** @} */
 



More information about the vc mailing list