[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.1.2.7 and 1.1.2.8

version 1.1.2.7, 2002/12/31 01:03:47 version 1.1.2.8, 2003/01/03 23:02:59
Line 2020  ENTRY(cpu_switchto)
Line 2020  ENTRY(cpu_switchto)
         jmp     switch_resume          jmp     switch_resume
   
 /*  /*
  * void switch_exit(struct lwp *l);   * void switch_exit(struct lwp *l, void (*exit)(struct lwp *));
  * Switch to the appropriate idle context (lwp0's if uniprocessor; the cpu's   * Switch to the appropriate idle context (lwp0's if uniprocessor; the cpu's
  * if multiprocessor) and deallocate the address space and kernel stack for p.   * if multiprocessor) and deallocate the address space and kernel stack for p.
  * Then jump into cpu_switch(), as if we were in the idle proc all along.   * Then jump into cpu_switch(), as if we were in the idle proc all along.
Line 2033  ENTRY(cpu_switchto)
Line 2033  ENTRY(cpu_switchto)
 /* LINTSTUB: Func: void switch_exit(struct lwp *l) */  /* LINTSTUB: Func: void switch_exit(struct lwp *l) */
 ENTRY(switch_exit)  ENTRY(switch_exit)
         movl    4(%esp),%edi            # old process          movl    4(%esp),%edi            # old process
           movl    8(%esp),%eax            # exit func
 #ifndef MULTIPROCESSOR  #ifndef MULTIPROCESSOR
         movl    $_C_LABEL(lwp0),%ebx          movl    $_C_LABEL(lwp0),%ebx
         movl    L_ADDR(%ebx),%esi          movl    L_ADDR(%ebx),%esi
Line 2051  ENTRY(switch_exit)
Line 2052  ENTRY(switch_exit)
         movl    PCB_ESP(%esi),%esp          movl    PCB_ESP(%esi),%esp
         movl    PCB_EBP(%esi),%ebp          movl    PCB_EBP(%esi),%ebp
   
         /* Load TSS info. */          /* Save exit func. */
 #ifdef MULTIPROCESSOR          pushl   %eax
         movl    CPUVAR(GDT),%eax  
 #else  
         /* Load TSS info. */  
         movl    _C_LABEL(gdt),%eax  
 #endif  
   
         /* Switch address space. */  
         movl    PCB_CR3(%esi),%ecx  
         movl    %ecx,%cr3  
   
         /* Switch TSS. */  
         andl    $~0x0200,4-SEL_KPL(%eax,%edx,1)  
         ltr     %dx  
   
         /* We're always in the kernel, so we don't need the LDT. */  
   
         /* Restore cr0 (including FPU state). */  
         movl    PCB_CR0(%esi),%ecx  
         movl    %ecx,%cr0  
   
         /* Record new pcb. */  
         SET_CURPCB(%esi)  
   
         /* Interrupts are okay again. */  
         sti  
   
         /*  
          * Schedule the dead process's vmspace and stack to be freed.  
          */  
         pushl   %edi                    /* exit2(l) */  
         call    _C_LABEL(exit2)  
         addl    $4,%esp  
   
         /* Jump into cpu_switch() with the right state. */  
         xorl    %esi,%esi  
         movl    %esi,CPUVAR(CURLWP)  
         jmp     idle_start  
   
 /*  
  * switch_lwp_exit(struct lwp *l);  
  * Switch to the appropriate idle context (lwp0's if uniprocessor; the cpu's  
  * if multiprocessor) and deallocate the kernel stack for l.  
  * Then jump into cpu_switch(), as if we were in the idle proc all along.  
  */  
 #ifndef MULTIPROCESSOR  
         .globl  _C_LABEL(lwp0)  
 #endif  
         .globl  _C_LABEL(uvmspace_free),_C_LABEL(kernel_map)  
         .globl  _C_LABEL(uvm_km_free),_C_LABEL(tss_free)  
 /* LINTSTUB: Func: void switch_lwp_exit(struct lwp *l) */  
 ENTRY(switch_lwp_exit)  
         movl    4(%esp),%edi            # old process  
 #ifndef MULTIPROCESSOR  
         movl    $_C_LABEL(lwp0),%ebx  
         movl    L_ADDR(%ebx),%esi  
         movl    L_MD_TSS_SEL(%ebx),%edx  
 #else  
         movl    CPUVAR(IDLE_PCB),%esi  
         movl    CPUVAR(IDLE_TSS_SEL),%edx  
 #endif  
         /* In case we fault... */  
         movl    $0,CPUVAR(CURLWP)  
   
         /* Restore the idle context. */  
         cli  
   
         /* Restore stack pointers. */  
         movl    PCB_ESP(%esi),%esp  
         movl    PCB_EBP(%esi),%ebp  
   
         /* Load TSS info. */          /* Load TSS info. */
 #ifdef MULTIPROCESSOR  #ifdef MULTIPROCESSOR
Line 2154  ENTRY(switch_lwp_exit)
Line 2086  ENTRY(switch_lwp_exit)
         /*          /*
          * Schedule the dead process's vmspace and stack to be freed.           * Schedule the dead process's vmspace and stack to be freed.
          */           */
         pushl   %edi                    /* lwp_exit2(l) */          movl    0(%esp),%eax            /* %eax = exit func */
         call    _C_LABEL(lwp_exit2)          movl    %edi,0(%esp)            /* {lwp_}exit2(l) */
           call    *%eax
         addl    $4,%esp          addl    $4,%esp
   
         /* Jump into cpu_switch() with the right state. */          /* Jump into cpu_switch() with the right state. */

Legend:
Removed from v.1.1.2.7  
changed lines
  Added in v.1.1.2.8

CVSweb <webmaster@jp.NetBSD.org>