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_int86.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_INT86
    3  *
    4  * The parameters for this kernel call are:
    5  *    m1_p1:    INT86_REG86     
    6  */
    7 
    8 #include "../system.h"
    9 #include <minix/type.h>
   10 #include <ibm/int86.h>
   11 
   12 struct reg86u reg86;
   13 
   14 /*===========================================================================*
   15  *                              do_int86                                             *
   16  *===========================================================================*/
   17 PUBLIC int do_int86(m_ptr)
   18 register message *m_ptr;        /* pointer to request message */
   19 {
   20   int caller;
   21   vir_bytes caller_vir;
   22   phys_bytes caller_phys, kernel_phys;
   23 
   24   caller = (int) m_ptr->m_source; 
   25   caller_vir = (vir_bytes) m_ptr->INT86_REG86;
   26   caller_phys = umap_local(proc_addr(caller), D, caller_vir, sizeof(reg86));
   27   if (0 == caller_phys) return(EFAULT);
   28   kernel_phys = vir2phys(&reg86);
   29   phys_copy(caller_phys, kernel_phys, (phys_bytes) sizeof(reg86));
   30 
   31   level0(int86);
   32 
   33   /* Copy results back to the caller */
   34   phys_copy(kernel_phys, caller_phys, (phys_bytes) sizeof(reg86));
   35 
   36   /* The BIOS call eats interrupts. Call get_randomness to generate some
   37    * entropy. Normally, get_randomness is called from an interrupt handler.
   38    * Figuring out the exact source is too complicated. CLOCK_IRQ is normally
   39    * not very random.
   40    */
   41   lock(0, "do_int86");
   42   get_randomness(CLOCK_IRQ);
   43   unlock(0);
   44 
   45   return(OK);
   46 }

Cache object: 915a8b93a508e25d96b1429736679777


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