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/kernel/system/do_abort.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 /* The kernel call implemented in this file:
    2  *   m_type:    SYS_ABORT
    3  *
    4  * The parameters for this kernel call are:
    5  *    m1_i1:    ABRT_HOW        (how to abort, possibly fetch monitor params)   
    6  *    m1_i2:    ABRT_MON_PROC   (proc nr to get monitor params from)    
    7  *    m1_i3:    ABRT_MON_LEN    (length of monitor params)
    8  *    m1_p1:    ABRT_MON_ADDR   (virtual address of params)     
    9  */
   10 
   11 #include "../system.h"
   12 #include <unistd.h>
   13 
   14 #if USE_ABORT
   15 
   16 /*===========================================================================*
   17  *                              do_abort                                     *
   18  *===========================================================================*/
   19 PUBLIC int do_abort(m_ptr)
   20 message *m_ptr;                 /* pointer to request message */
   21 {
   22 /* Handle sys_abort. MINIX is unable to continue. This can originate e.g.
   23  * in the PM (normal abort or panic) or TTY (after CTRL-ALT-DEL).
   24  */
   25   int how = m_ptr->ABRT_HOW;
   26   int proc_nr;
   27   int length;
   28   phys_bytes src_phys;
   29 
   30   /* See if the monitor is to run the specified instructions. */
   31   if (how == RBT_MONITOR) {
   32 
   33       proc_nr = m_ptr->ABRT_MON_PROC;
   34       if (! isokprocn(proc_nr)) return(EINVAL);
   35       length = m_ptr->ABRT_MON_LEN + 1;
   36       if (length > kinfo.params_size) return(E2BIG);
   37       src_phys = numap_local(proc_nr,(vir_bytes)m_ptr->ABRT_MON_ADDR,length);
   38       if (! src_phys) return(EFAULT);
   39 
   40       /* Parameters seem ok, copy them and prepare shutting down. */
   41       phys_copy(src_phys, kinfo.params_base, (phys_bytes) length);
   42   }
   43 
   44   /* Now prepare to shutdown MINIX. */
   45   prepare_shutdown(how);
   46   return(OK);                           /* pro-forma (really EDISASTER) */
   47 }
   48 
   49 #endif /* USE_ABORT */
   50 

Cache object: 5df87466f5b29aa8bd43de16868c8dde


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