[BACK]Return to locore.S CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / arch / i386 / i386

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sys/arch/i386/i386/locore.S between version 1.106.2.1 and 1.107

version 1.106.2.1, 2014/05/18 17:45:12 version 1.107, 2013/10/23 20:18:50
Line 139  __KERNEL_RCSID(0, "$NetBSD$");
Line 139  __KERNEL_RCSID(0, "$NetBSD$");
 #include "opt_vm86.h"  #include "opt_vm86.h"
 #include "opt_xen.h"  #include "opt_xen.h"
   
   #include "npx.h"
 #include "assym.h"  #include "assym.h"
 #include "lapic.h"  #include "lapic.h"
 #include "ioapic.h"  #include "ioapic.h"
Line 697  try586: /* Use the `cpuid' instruction. 
Line 698  try586: /* Use the `cpuid' instruction. 
          * 2. Enable paging and the rest of it.           * 2. Enable paging and the rest of it.
          */           */
         movl    %cr0,%eax               # get control word          movl    %cr0,%eax               # get control word
                                         # enable paging & NPX                                          # enable paging & NPX emulation
         orl     $(CR0_PE|CR0_PG|CR0_NE|CR0_TS|CR0_MP|CR0_WP|CR0_AM),%eax          orl     $(CR0_PE|CR0_PG|CR0_NE|CR0_TS|CR0_EM|CR0_MP|CR0_WP|CR0_AM),%eax
         movl    %eax,%cr0               # and page NOW!          movl    %eax,%cr0               # and page NOW!
   
         pushl   $begin                  # jump to high mem          pushl   $begin                  # jump to high mem
Line 727  begin:
Line 728  begin:
         /* Set up bootstrap stack. */          /* Set up bootstrap stack. */
         leal    (PROC0_STK_OFF+KERNBASE)(%esi),%eax          leal    (PROC0_STK_OFF+KERNBASE)(%esi),%eax
         movl    %eax,_C_LABEL(lwp0uarea)          movl    %eax,_C_LABEL(lwp0uarea)
         leal    (USPACE-FRAMESIZE)(%eax),%esp          leal    (KSTACK_SIZE-FRAMESIZE)(%eax),%esp
         movl    %esi,PCB_CR3(%eax)      # pcb->pcb_cr3          movl    %esi,(KSTACK_SIZE+PCB_CR3)(%eax)        # pcb->pcb_cr3
         xorl    %ebp,%ebp               # mark end of frames          xorl    %ebp,%ebp               # mark end of frames
   
 #if defined(MULTIBOOT)  #if defined(MULTIBOOT)
Line 825  begin:
Line 826  begin:
         movl    %esi, _C_LABEL(lwp0uarea)          movl    %esi, _C_LABEL(lwp0uarea)
   
         /* Set up bootstrap stack. */          /* Set up bootstrap stack. */
         leal    (USPACE-FRAMESIZE)(%eax),%esp          leal    (KSTACK_SIZE-FRAMESIZE)(%eax),%esp
         xorl    %ebp,%ebp               # mark end of frames          xorl    %ebp,%ebp               # mark end of frames
   
         addl    $USPACE, %esi          addl    $USPACE, %esi
Line 880  END(lgdt_finish)
Line 881  END(lgdt_finish)
  *   *
  * This is a trampoline function pushed onto the stack of a newly created   * This is a trampoline function pushed onto the stack of a newly created
  * process in order to do some additional setup.  The trampoline is entered by   * process in order to do some additional setup.  The trampoline is entered by
  * cpu_switchto()ing to the process, so we abuse the callee-saved   * cpu_switch()ing to the process, so we abuse the callee-saved registers used
  * registers used by cpu_switchto() to store the information about the   * by cpu_switch() to store the information about the stub to call.
  * stub to call.  
  * NOTE: This function does not have a normal calling sequence!   * NOTE: This function does not have a normal calling sequence!
  */   */
 NENTRY(lwp_trampoline)  NENTRY(lwp_trampoline)
Line 1077  ENTRY(cpu_switchto)
Line 1077  ENTRY(cpu_switchto)
         call    _C_LABEL(i386_tls_switch)          call    _C_LABEL(i386_tls_switch)
         addl    $4,%esp          addl    $4,%esp
 #else /* !XEN */  #else /* !XEN */
         movl    $IPL_HIGH,CPUVAR(ILEVEL)          movl    PCB_CR0(%ebx),%ecx
         movl    PCB_CR0(%ebx),%ecx              /* has CR0_TS clear */  
         movl    %cr0,%edx          movl    %cr0,%edx
   
         /*  
          * If our floating point registers are on a different CPU,  
          * set CR0_TS so we'll trap rather than reuse bogus state.  
          */  
         cmpl    CPUVAR(FPCURLWP),%edi  
         je      3f  
         orl     $CR0_TS,%ecx  
   
         /* Reloading CR0 is very expensive - avoid if possible. */          /* Reloading CR0 is very expensive - avoid if possible. */
 3:      cmpl    %edx,%ecx          cmpl    %edx,%ecx
         je      4f          je      4f
         movl    %ecx,%cr0          movl    %ecx,%cr0
 #endif /* !XEN */  #endif /* !XEN */
Line 1287  IDTVEC(svr4_fasttrap)
Line 1278  IDTVEC(svr4_fasttrap)
         cli          cli
         jmp     2b          jmp     2b
   
   #if NNPX > 0
   /*
    * Special interrupt handlers.  Someday intr0-intr15 will be used to count
    * interrupts.  We'll still need a special exception 16 handler.  The busy
    * latch stuff in probintr() can be moved to npxprobe().
    */
   
   /*
    * void probeintr(void)
    */
   NENTRY(probeintr)
           ss
           incl    _C_LABEL(npx_intrs_while_probing)
           pushl   %eax
           movb    $0x20,%al       # EOI (asm in strings loses cpp features)
           outb    %al,$0xa0       # IO_ICU2
           outb    %al,$0x20       # IO_ICU1
           movb    $0,%al
           outb    %al,$0xf0       # clear BUSY# latch
           popl    %eax
           iret
   END(probeintr)
   
   /*
    * void probetrap(void)
    */
   NENTRY(probetrap)
           ss
           incl    _C_LABEL(npx_traps_while_probing)
           fnclex
           iret
   END(probetrap)
   
 /*  /*
  * int npx586bug1(int a, int b)   * int npx586bug1(int a, int b)
  * Used when checking for the FDIV bug on first generations pentiums.  
  * Anything 120MHz or above is fine.  
  */   */
 NENTRY(npx586bug1)  NENTRY(npx586bug1)
         fildl   4(%esp)         # x          fildl   4(%esp)         # x
Line 1304  NENTRY(npx586bug1)
Line 1326  NENTRY(npx586bug1)
         popl    %eax          popl    %eax
         ret          ret
 END(npx586bug1)  END(npx586bug1)
   #endif /* NNPX > 0 */
   
 /*  /*
  * void sse2_idlezero_page(void *pg)   * void sse2_idlezero_page(void *pg)

Legend:
Removed from v.1.106.2.1  
changed lines
  Added in v.1.107

CVSweb <webmaster@jp.NetBSD.org>