[PATCH] virtualization layer interface added to score/i386/, added to makefile and fixed the includes

Philipp Eppelt philipp.eppelt at mailbox.tu-dresden.de
Wed Nov 27 18:01:33 UTC 2013


---
 cpukit/score/cpu/i386/Makefile.am                  |  1 +
 cpukit/score/cpu/i386/cpu.c                        |  2 +-
 cpukit/score/cpu/i386/preinstall.am                |  4 ++
 cpukit/score/cpu/i386/rtems/score/cpu.h            |  4 +-
 cpukit/score/cpu/i386/rtems/score/interrupts.h     |  2 +-
 .../cpu/i386/rtems/score/virtualizationlayercpu.h  | 84 ++++++++++++++++++++++
 6 files changed, 93 insertions(+), 4 deletions(-)
 create mode 100644 cpukit/score/cpu/i386/rtems/score/virtualizationlayercpu.h

diff --git a/cpukit/score/cpu/i386/Makefile.am b/cpukit/score/cpu/i386/Makefile.am
index e35a81c..8f196c5 100644
--- a/cpukit/score/cpu/i386/Makefile.am
+++ b/cpukit/score/cpu/i386/Makefile.am
@@ -12,6 +12,7 @@ include_rtems_score_HEADERS += rtems/score/registers.h
 include_rtems_score_HEADERS += rtems/score/idtr.h
 include_rtems_score_HEADERS += rtems/score/cpuatomic.h
 include_rtems_score_HEADERS += rtems/score/cpusmplock.h
+include_rtems_score_HEADERS += rtems/score/virtualizationlayercpu.h
 
 noinst_LIBRARIES = libscorecpu.a
 libscorecpu_a_SOURCES = cpu.c cpu_asm.S
diff --git a/cpukit/score/cpu/i386/cpu.c b/cpukit/score/cpu/i386/cpu.c
index 0a6139f..78dc2c0 100644
--- a/cpukit/score/cpu/i386/cpu.c
+++ b/cpukit/score/cpu/i386/cpu.c
@@ -100,7 +100,7 @@ uint32_t   _CPU_ISR_Get_level( void )
 
 #if defined(RTEMS_PARAVIRT)
   
-#include <virtualizationlayercpu.h>
+#include <rtems/score/virtualizationlayercpu.h>
   
 void *_CPU_Thread_Idle_body( uintptr_t ignored )
 {
diff --git a/cpukit/score/cpu/i386/preinstall.am b/cpukit/score/cpu/i386/preinstall.am
index f9faf87..363e1fb 100644
--- a/cpukit/score/cpu/i386/preinstall.am
+++ b/cpukit/score/cpu/i386/preinstall.am
@@ -59,3 +59,7 @@ $(PROJECT_INCLUDE)/rtems/score/cpusmplock.h: rtems/score/cpusmplock.h $(PROJECT_
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/cpusmplock.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/cpusmplock.h
 
+$(PROJECT_INCLUDE)/rtems/score/virtualizationlayercpu.h: rtems/score/virtualizationlayercpu.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/virtualizationlayercpu.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/virtualizationlayercpu.h
+
diff --git a/cpukit/score/cpu/i386/rtems/score/cpu.h b/cpukit/score/cpu/i386/rtems/score/cpu.h
index a8c2ed3..a843150 100644
--- a/cpukit/score/cpu/i386/rtems/score/cpu.h
+++ b/cpukit/score/cpu/i386/rtems/score/cpu.h
@@ -377,7 +377,7 @@ SCORE_EXTERN Context_Control_fp  _CPU_Null_fp_context;
 #define _CPU_ISR_Flash( _level )   i386_flash_interrupts( _level )
 
 #if defined(RTEMS_PARAVIRT)
-  #include <virtualizationlayercpu.h>
+  #include <rtems/score/virtualizationlayercpu.h>
 
   #define _CPU_ISR_Set_level( _new_level ) \
     { \
@@ -512,7 +512,7 @@ uint32_t   _CPU_ISR_Get_level( void );
 
 #if defined(RTEMS_PARAVIRT)
 
-  #include <virtualizationlayercpu.h>
+  #include <rtems/score/virtualizationlayercpu.h>
   
   #define _CPU_Fatal_halt( _error ) \
   { \
diff --git a/cpukit/score/cpu/i386/rtems/score/interrupts.h b/cpukit/score/cpu/i386/rtems/score/interrupts.h
index 1bc9391..8d47ea5 100644
--- a/cpukit/score/cpu/i386/rtems/score/interrupts.h
+++ b/cpukit/score/cpu/i386/rtems/score/interrupts.h
@@ -34,7 +34,7 @@ typedef int  (*rtems_raw_irq_is_enabled)	(const struct __rtems_raw_irq_connect_d
  */
 /**@{**/
 #if defined(RTEMS_PARAVIRT)
-  #include <virtualizationlayercpu.h>
+  #include <rtems/score/virtualizationlayercpu.h>
 
 #define i386_disable_interrupts( _level ) \
   { \
diff --git a/cpukit/score/cpu/i386/rtems/score/virtualizationlayercpu.h b/cpukit/score/cpu/i386/rtems/score/virtualizationlayercpu.h
new file mode 100644
index 0000000..526f8d1
--- /dev/null
+++ b/cpukit/score/cpu/i386/rtems/score/virtualizationlayercpu.h
@@ -0,0 +1,84 @@
+/* Author:    Philipp Eppelt - philipp.eppelt at mailbox.tu-dresden.de
+ *
+ * COPYRIGHT (c) 2013 Philipp Eppelt.
+ *
+ * Purpose:   CPU part of the virtualization layer.
+ * Licencse:  see RTEMS License.
+ */
+
+
+#ifndef RTEMS_VIRT_LAYER_CPU_H
+#define RTEMS_VIRT_LAYER_CPU_H
+
+#ifndef ASM
+
+/* Interrupts */
+
+/**
+ * \brief Requests an interrupt vector.
+ */
+int
+_CPU_Virtual_Irq_request( int vector );
+
+/**
+ * \brief Releases an interrupt vector.
+ */
+void
+_CPU_Virtual_Irq_detach( int vector );
+
+/**
+ * \brief Enables interrupt delivery or sets it to the specified level.
+ * 
+ * Use this function in collaboration with _CPU_Virtual_Interrupts_disable and
+ * use its returned _level as argument to this function to assure proper
+ * behaviour.
+ */
+void
+_CPU_Virtual_Interrupts_enable( int _level );
+
+/**
+ * \brief Disables interrupt delivery and returns the previous level.
+ *
+ */
+void
+_CPU_Virtual_Interrupts_disable( int _level );
+
+/**
+ * \brief Enables and directly disables interrupt delivery.
+ */
+void 
+_CPU_Virtual_Interrupts_flash( int _level );
+
+/**
+ * \brief Requests the current interrupt level.
+ */
+int
+_CPU_Virtual_Interrupts_get_level( int _level );
+
+
+void
+_CPU_Virtual_Interrupts_open(void);
+void
+_CPU_Virtual_Interrupts_close( void );
+
+/* Idle Thread */
+
+/**
+ * \brief Lowest priority thread, doing nothing, never returns;
+ */
+
+void
+_CPU_Virtual_idle_thread( void );
+
+
+/* Error handling */
+
+/**
+ * \brief Handlers execution errors.
+ */
+void
+_CPU_Virtual_exec_stop_error( int _error );
+
+#endif /* ASM */
+
+#endif /* RTEMS_VIRT_LAYER_CPU_H */
-- 
1.8.1.4




More information about the devel mailing list