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/faultalpha.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        "../port/error.h"
    8 
    9 /*
   10  *  find out fault address and type of access.
   11  *  Call common fault handler.
   12  */
   13 void
   14 faultalpha(Ureg *ur)
   15 {
   16         ulong addr, cause;
   17         int read, user;
   18         char buf[ERRMAX];
   19         uvlong x;
   20 
   21         x = ur->a0&0xffffffff80000000LL;
   22         if (x != 0LL && x != 0xffffffff80000000LL)
   23                 iprint("faultalpha bad addr %llux pc %llux\n", ur->a0, ur->pc);
   24 
   25         addr = (ulong)ur->a0;
   26         cause = (ulong)ur->a2;
   27         addr &= ~(BY2PG-1);
   28         read = (cause !=1);
   29         user = (ulong)ur->status&UMODE;
   30 
   31 /*      print("fault %s pc=0x%lux addr=0x%lux 0x%lux\n",
   32                 read? (cause != 0) ? "ifetch" : "read" : "write", (ulong)ur->pc, addr, (ulong)ur->a1); /**/
   33 
   34         if(fault(addr, read) == 0)
   35                 return;
   36 
   37         if(user){
   38                 sprint(buf, "sys: trap: fault %s addr=0x%lux",
   39                         read? (cause != 0) ? "ifetch" : "read" : "write", (ulong)ur->a0);
   40                 postnote(up, 1, buf, NDebug);
   41                 return;
   42         }
   43 
   44         iprint("kernel %s vaddr=0x%lux\n", read? (cause != 0) ? "ifetch" : "read" : "write", (ulong)ur->a0);
   45         if(0)
   46                 mmudump();
   47         dumpregs(ur);
   48         _dumpstack(ur);
   49         exit(1);
   50 }
   51 
   52 /*
   53  * called in sysfile.c
   54  */
   55 void
   56 evenaddr(ulong addr)
   57 {
   58         if(addr & 3){
   59                 postnote(up, 1, "sys: odd address", NDebug);
   60                 error(Ebadarg);
   61         }
   62 }

Cache object: b562dbce41b4f28b42a1b4441dfb38b8


[ 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.