diff options
| author | Patrick Williams <iawillia@us.ibm.com> | 2011-09-06 21:39:37 -0500 |
|---|---|---|
| committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2011-09-12 10:43:43 -0500 |
| commit | 0c57368b19b2c47d8c3d6495d4fa166663c9c2ea (patch) | |
| tree | 65f00729c135cddd4b9eb70e7114522fb31155f3 /src/kernel/exception.C | |
| parent | 2900cb906ec96134dba7c57c23b18e98cec215a7 (diff) | |
| download | talos-hostboot-0c57368b19b2c47d8c3d6495d4fa166663c9c2ea.tar.gz talos-hostboot-0c57368b19b2c47d8c3d6495d4fa166663c9c2ea.zip | |
FP Denormalization support.
Change-Id: I529e6f072993c0dd0a638fe7e53bcc871e6a928c
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/326
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 | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/kernel/exception.C b/src/kernel/exception.C index 47c235fe8..0cd192c77 100644 --- a/src/kernel/exception.C +++ b/src/kernel/exception.C @@ -27,6 +27,7 @@ #include <kernel/taskmgr.H> #include <arch/ppc.H> #include <kernel/vmmmgr.H> +#include <kernel/cpuid.H> namespace Systemcalls { void TaskEnd(task_t*); } namespace ExceptionHandles @@ -180,3 +181,35 @@ void kernel_execute_fp_unavail() memset(t->fp_context, '\0', sizeof(context_fp_t)); } } + +const uint64_t EXCEPTION_HSRR1_SOFTPATCH_MASK = 0x0000000000100000; +const uint64_t EXCEPTION_HSRR1_SOFTPATCH_DENORM = 0x0000000000100000; + +extern "C" void p7_softpatch_denorm_assist(context_fp_t*); + +extern "C" +void kernel_execute_softpatch() +{ + task_t* t = TaskManager::getCurrentTask(); + + if ((getHSRR1() & EXCEPTION_HSRR1_SOFTPATCH_MASK) == + EXCEPTION_HSRR1_SOFTPATCH_DENORM) + { + if (t->fp_context == NULL) + { + printk("Error: Task took Denorm-assist without FP active.\n"); + kassert(t->fp_context != NULL); + } + + switch (CpuID::getCpuType()) + { + case CORE_POWER7: + case CORE_POWER7_PLUS: + case CORE_POWER8_SALERNO: // @TODO: Verify same procedure. + case CORE_POWER8_VENICE: // @TODO: Verify same procedure. + case CORE_UNKNOWN: + p7_softpatch_denorm_assist(t->fp_context); + break; + } + } +} |

