The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/alphapc/fptrap.c

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 #include        "u.h"
    2 #include        "../port/lib.h"
    3 #include        "mem.h"
    4 #include        "dat.h"
    5 #include        "fns.h"
    6 #include        "ureg.h"
    7 #include        "io.h"
    8 #include        "../port/error.h"
    9 
   10 char *fpcause[] =
   11 {
   12         "invalid operation",
   13         "division by zero",
   14         "overflow",
   15         "underflow",
   16         "inexact operation",
   17         "integer overflow",
   18 };
   19 char    *fpexcname(Ureg*, ulong, char*);
   20 
   21 void
   22 fptrap(Ureg *ur)
   23 {
   24         char buf[ERRMAX];
   25         int i;
   26         ulong reason;
   27 
   28         ur->pc &= ~2;
   29         reason = (ulong)ur->a0;
   30         for (i = 1; i < 6; i++)
   31                 if (reason & (1<<i)) {
   32                         sprint(buf, "fp: %s", fpcause[i-1]);
   33                         goto found;
   34                 }
   35         sprint(buf, "fp: code 0x%lux", reason);
   36 
   37 found:
   38         fataltrap(ur, buf);
   39 }
   40 
   41 char*
   42 fpexcname(Ureg *ur, ulong fcr31, char *buf)
   43 {
   44         USED(ur, fcr31, buf);
   45         return buf;
   46 }

Cache object: 8ba970de263bf8b08acbf3df4da43a7f


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.