[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.25 and 1.29

version 1.25, 2004/03/26 19:05:33 version 1.29, 2004/08/05 15:25:29
Line 524  try586: /* Use the `cpuid' instruction. 
Line 524  try586: /* Use the `cpuid' instruction. 
   
         /*          /*
          * Calculate the size of the kernel page table directory, and           * Calculate the size of the kernel page table directory, and
          * how many entries it will have.           * how many entries it will have.  Adjust nkpde to the actual
            * kernel size automatically.  Account for the bootstrap tables,
            * round up, and add an extra 4MB.
          */           */
           leal    TABLESIZE+NBPD+PDOFSET(%edi),%eax
           shrl    $PDSHIFT,%eax
         movl    RELOC(nkpde),%ecx               # get nkpde          movl    RELOC(nkpde),%ecx               # get nkpde
         cmpl    $NKPTP_MIN,%ecx                 # larger than min?          cmpl    %ecx,%eax
           jb      1f
           movl    %eax,%ecx
   1:      cmpl    $NKPTP_MIN,%ecx                 # larger than min?
         jge     1f          jge     1f
         movl    $NKPTP_MIN,%ecx                 # set at min          movl    $NKPTP_MIN,%ecx                 # set at min
         jmp     2f          jmp     2f
 1:      cmpl    $NKPTP_MAX,%ecx                 # larger than max?  1:      cmpl    $NKPTP_MAX,%ecx                 # larger than max?
         jle     2f          jle     2f
         movl    $NKPTP_MAX,%ecx          movl    $NKPTP_MAX,%ecx
 2:  2:      movl    %ecx,RELOC(nkpde)
   
         /* Clear memory for bootstrap tables. */          /* Clear memory for bootstrap tables. */
         shll    $PGSHIFT,%ecx          shll    $PGSHIFT,%ecx
Line 1775  ENTRY(cpu_switch)
Line 1782  ENTRY(cpu_switch)
         movl    PCB_EBP(%edi),%ebp          movl    PCB_EBP(%edi),%ebp
   
         /* Switch TSS. Reset "task busy" flag before loading. */          /* Switch TSS. Reset "task busy" flag before loading. */
           movl    %cr3,%eax
           movl    %eax,PCB_CR3(%edi)
 #ifdef MULTIPROCESSOR  #ifdef MULTIPROCESSOR
         movl    CPUVAR(GDT),%eax          movl    CPUVAR(GDT),%eax
 #else  #else
Line 1925  switch_exited:
Line 1934  switch_exited:
         jnz     switch_restored          jnz     switch_restored
 #endif  #endif
   
           /* Switch TSS. Reset "task busy" flag before loading. */
           movl    %cr3,%eax
           movl    %eax,PCB_CR3(%esi) /* XXX should be done by pmap_activate? */
 #ifdef MULTIPROCESSOR  #ifdef MULTIPROCESSOR
         movl    CPUVAR(GDT),%eax          movl    CPUVAR(GDT),%eax
 #else  #else
Line 1933  switch_exited:
Line 1945  switch_exited:
 #endif  #endif
         movl    L_MD_TSS_SEL(%edi),%edx          movl    L_MD_TSS_SEL(%edi),%edx
   
         /* Switch TSS. Reset "task busy" flag before loading. */  
         andl    $~0x0200,4(%eax,%edx, 1)          andl    $~0x0200,4(%eax,%edx, 1)
         ltr     %dx          ltr     %dx
   
Line 1979  switch_return:
Line 1990  switch_return:
 #if defined(MULTIPROCESSOR) || defined(LOCKDEBUG)  #if defined(MULTIPROCESSOR) || defined(LOCKDEBUG)
         call    _C_LABEL(sched_unlock_idle)          call    _C_LABEL(sched_unlock_idle)
 #endif  #endif
           cmpl    $0,CPUVAR(IPENDING)
           jz      3f
         pushl   $IPL_NONE               # spl0()          pushl   $IPL_NONE               # spl0()
         call    _C_LABEL(Xspllower)     # process pending interrupts          call    _C_LABEL(Xspllower)     # process pending interrupts
         addl    $4,%esp          addl    $4,%esp
   3:
         movl    $IPL_HIGH,CPUVAR(ILEVEL)        # splhigh()          movl    $IPL_HIGH,CPUVAR(ILEVEL)        # splhigh()
   
         movl    %ebx,%eax          movl    %ebx,%eax
Line 2078  ENTRY(cpu_exit)
Line 2092  ENTRY(cpu_exit)
         movl    PCB_ESP(%esi),%esp          movl    PCB_ESP(%esi),%esp
         movl    PCB_EBP(%esi),%ebp          movl    PCB_EBP(%esi),%ebp
   
         /* Load TSS info. */          /* Switch TSS. Reset "task busy" flag before loading. */
           movl    %cr3,%eax
           movl    %eax,PCB_CR3(%esi)
 #ifdef MULTIPROCESSOR  #ifdef MULTIPROCESSOR
         movl    CPUVAR(GDT),%eax          movl    CPUVAR(GDT),%eax
 #else  #else
Line 2086  ENTRY(cpu_exit)
Line 2102  ENTRY(cpu_exit)
         movl    _C_LABEL(gdt),%eax          movl    _C_LABEL(gdt),%eax
 #endif  #endif
   
         /* Switch TSS. */  
         andl    $~0x0200,4-SEL_KPL(%eax,%edx,1)          andl    $~0x0200,4-SEL_KPL(%eax,%edx,1)
         ltr     %dx          ltr     %dx
   
Line 2173  syscall1:
Line 2188  syscall1:
         pushl   %esp          pushl   %esp
         call    *P_MD_SYSCALL(%edx)     # get pointer to syscall() function          call    *P_MD_SYSCALL(%edx)     # get pointer to syscall() function
         addl    $4,%esp          addl    $4,%esp
 syscall_checkast:  .Lsyscall_checkast:
         /* Check for ASTs on exit to user mode. */          /* Check for ASTs on exit to user mode. */
         cli          cli
         CHECK_ASTPENDING(%eax)          CHECK_ASTPENDING(%eax)
Line 2185  syscall_checkast:
Line 2200  syscall_checkast:
         pushl   %esp          pushl   %esp
         call    _C_LABEL(trap)          call    _C_LABEL(trap)
         addl    $4,%esp          addl    $4,%esp
         jmp     syscall_checkast        /* re-check ASTs */          jmp     .Lsyscall_checkast      /* re-check ASTs */
 1:      CHECK_DEFERRED_SWITCH(%eax)  1:      CHECK_DEFERRED_SWITCH(%eax)
         jnz     9f          jnz     9f
 #ifndef DIAGNOSTIC  #ifndef DIAGNOSTIC
Line 2209  syscall_checkast:
Line 2224  syscall_checkast:
 #endif /* DIAGNOSTIC */  #endif /* DIAGNOSTIC */
 9:      sti  9:      sti
         call    _C_LABEL(pmap_load)          call    _C_LABEL(pmap_load)
         jmp     syscall_checkast        /* re-check ASTs */          jmp     .Lsyscall_checkast      /* re-check ASTs */
   
 #if NNPX > 0  #if NNPX > 0
 /*  /*

Legend:
Removed from v.1.25  
changed lines
  Added in v.1.29

CVSweb <webmaster@jp.NetBSD.org>