diff options
| author | Patrick Williams <iawillia@us.ibm.com> | 2011-09-02 23:23:23 -0500 |
|---|---|---|
| committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2011-09-12 10:43:19 -0500 |
| commit | 2900cb906ec96134dba7c57c23b18e98cec215a7 (patch) | |
| tree | f14f5a2d502d6a7e2626e50d91164437da5be5cd /src/kernel/exception.C | |
| parent | 5365f3466347fbc5a05643df4d3302bf6bb89d94 (diff) | |
| download | talos-hostboot-2900cb906ec96134dba7c57c23b18e98cec215a7.tar.gz talos-hostboot-2900cb906ec96134dba7c57c23b18e98cec215a7.zip | |
Floating point support.
Change-Id: I859cac1c01bf631d12223702d68813b45339b65f
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/295
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/kernel/exception.C')
| -rw-r--r-- | src/kernel/exception.C | 20 |
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)); + } +} |

