]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/mini-os.git/commitdiff
minios: setup fpu and sse in mini-os
authorMatthew Fioravante <matthew.fioravante@jhuapl.edu>
Mon, 8 Oct 2012 13:36:31 +0000 (14:36 +0100)
committerMatthew Fioravante <matthew.fioravante@jhuapl.edu>
Mon, 8 Oct 2012 13:36:31 +0000 (14:36 +0100)
This patch adds floating point and sse support to mini-os by
initializing the floating point unit and the see unit during
domain boot up.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyons.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
arch/x86/setup.c

index 923901e595f0526bf858bcdbb581b0422f6e481f..54046d37bc3e1d0e6f86c091ca417a2592b1ee3e 100644 (file)
@@ -74,9 +74,28 @@ shared_info_t *map_shared_info(unsigned long pa)
        return (shared_info_t *)shared_info;
 }
 
+static inline void fpu_init(void) {
+       asm volatile("fninit");
+}
+
+#ifdef __SSE__
+static inline void sse_init(void) {
+       unsigned long status = 0x1f80;
+       asm volatile("ldmxcsr %0" : : "m" (status));
+}
+#else
+#define sse_init()
+#endif
+
 void
 arch_init(start_info_t *si)
 {
+       /*Initialize floating point unit */
+        fpu_init();
+
+        /* Initialize SSE */
+        sse_init();
+
        /* Copy the start_info struct to a globally-accessible area. */
        /* WARN: don't do printk before here, it uses information from
           shared_info. Use xprintk instead. */
@@ -99,6 +118,7 @@ arch_init(start_info_t *si)
                (unsigned long)failsafe_callback, 0);
 #endif
 
+
 }
 
 void