summaryrefslogtreecommitdiffstats
path: root/src/kernel/exception.C
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/exception.C')
-rw-r--r--src/kernel/exception.C20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/kernel/exception.C b/src/kernel/exception.C
index 128708032..47c235fe8 100644
--- a/src/kernel/exception.C
+++ b/src/kernel/exception.C
@@ -20,6 +20,7 @@
// Origin: 30
//
// IBM_PROLOG_END
+#include <assert.h>
#include <kernel/types.h>
#include <kernel/console.H>
#include <kernel/task.H>
@@ -160,3 +161,22 @@ namespace ExceptionHandles
}
}
+
+extern "C"
+void kernel_execute_fp_unavail()
+{
+ task_t* t = TaskManager::getCurrentTask();
+
+ if (t->fp_context)
+ {
+ printk("Error: FP unavailable while task has FP-context.\n");
+ kassert(t->fp_context == NULL);
+ }
+ else
+ {
+ // Enable FP by creating a FP context.
+ // Context switch code will handle the rest.
+ t->fp_context = new context_fp_t;
+ memset(t->fp_context, '\0', sizeof(context_fp_t));
+ }
+}
OpenPOWER on IntegriCloud