Changeset 10248


Ignore:
Timestamp:
Jul 30, 2008, 5:15:36 PM (11 years ago)
Author:
rme
Message:

Update .SPunbind_interrupt_level to check for pending suspend request.

Preserve EFLAGS across ffcall/syscall. The idea here is to support a
future scheme that uses DF as a flag to denote whether temp1/edx is
boxed or unboxed.

Try to ensure that esp/ebp are lisp's whenever tcr->valence is in
TCR_STATE_LISP.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/x86-spentry32.s

    r10092 r10248  
    10251025        __(movl $TCR_STATE_FOREIGN,rcontext(tcr.valence))
    10261026        __(movl rcontext(tcr.foreign_sp),%esp)
     1027        /* preserve state of direction flag */
     1028        __(pushfl)
     1029        __(popl rcontext(tcr.save_eflags))
    10271030        __(emms)
    10281031        __(pop %ebp)            /* backlink */
     
    10441047        __(clr %fn)
    10451048        __(pxor %fpzero,%fpzero)
     1049        __(pushl rcontext(tcr.save_eflags))
     1050        __(popfl)
    10461051        __(movl rcontext(tcr.save_vsp),%esp)
    10471052        __(movl rcontext(tcr.save_ebp),%ebp)
     
    10721077        __(movl $TCR_STATE_FOREIGN,rcontext(tcr.valence))
    10731078        __(movl rcontext(tcr.foreign_sp),%esp)
     1079        /* preserve state of direction flag */
     1080        __(pushfl)
     1081        __(popl rcontext(tcr.save_eflags))
    10741082        __(emms)
    10751083        __(pop %ebp)            /* backlink */
     
    10951103        __(clr %fn)
    10961104        __(pxor %fpzero,%fpzero)
     1105        __(pushl rcontext(tcr.save_eflags))
     1106        __(popf)
    10971107        __(movl rcontext(tcr.save_vsp),%esp)
    10981108        __(movl rcontext(tcr.save_ebp),%ebp)
     
    35623572/* non-negative, check for pending interrupts. */
    35633573_spentry(unbind_interrupt_level)
     3574        __(btl $TCR_FLAG_BIT_PENDING_SUSPEND,rcontext(tcr.flags))
    35643575        __(movl rcontext(tcr.tlb_pointer),%arg_y)
    35653576        __(movl INTERRUPT_LEVEL_BINDING_INDEX(%arg_y),%imm0)
    3566         __(test %imm0,%imm0)
     3577        __(jc 5f)
     35780:      __(test %imm0,%imm0)
    35673579        __(movl rcontext(tcr.db_link),%imm0)
    35683580        __(movl binding.val(%imm0),%temp0)
     
    35703582        __(movl %temp0,INTERRUPT_LEVEL_BINDING_INDEX(%arg_y))
    35713583        __(movl %imm0,rcontext(tcr.db_link))
    3572         __(js 1f)
    3573 0:      __(repret)
    3574 1:      __(test %temp0,%temp0)
    3575         __(js 0b)
    3576         __(check_pending_enabled_interrupt(2f))
     3584        __(js 3f)
    357735852:      __(repret)
     35863:      __(test %temp0,%temp0)
     3587        __(js 2b)
     3588        __(check_pending_enabled_interrupt(4f))
     35894:      __(repret)
     35905:       /* Missed a suspend request; force suspend now if we're restoring
     3591          interrupt level to -1 or greater */
     3592        __(cmpl $-2<<fixnumshift,%imm0)
     3593        __(jne 0b)
     3594        __(movl rcontext(tcr.db_link),%temp0)
     3595        __(movl binding.val(%temp0),%temp0)
     3596        __(cmpl %imm0,%temp0)
     3597        __(je 0b)
     3598        __(movl $-1<<fixnumshift,INTERRUPT_LEVEL_BINDING_INDEX(%arg_y))
     3599        __(suspend_now())
     3600        __(jmp 0b)
    35783601_endsubp(unbind_interrupt_level)
    35793602
     
    40154038        __(movl $TCR_STATE_FOREIGN,rcontext(tcr.valence))
    40164039        __(movl rcontext(tcr.foreign_sp),%esp)
     4040        /* preserve state of direction flag */
     4041        __(pushfl)
     4042        __(popl rcontext(tcr.save_eflags))
    40174043        __(stmxcsr rcontext(tcr.lisp_mxcsr))
    40184044        __(emms)
     
    40384064        __(stmxcsr rcontext(tcr.ffi_exception))
    40394065        __endif
     4066        __(pushl rcontext(tcr.save_eflags))
     4067        __(popfl)
    40404068        __(movl rcontext(tcr.save_vsp),%esp)
    40414069        __(movl rcontext(tcr.save_ebp),%ebp)
     
    41564184        __(movl %esp,rcontext(tcr.save_vsp))
    41574185        __(movl %ebp,rcontext(tcr.save_ebp))
     4186        __(movl $TCR_STATE_FOREIGN,rcontext(tcr.valence))
    41584187        __(movl rcontext(tcr.foreign_sp),%esp)
    41594188        __(stmxcsr rcontext(tcr.lisp_mxcsr))
    4160         __(movl $TCR_STATE_FOREIGN,rcontext(tcr.valence))
    41614189        __(emms)
    41624190        __(pop rcontext(tcr.foreign_sp))
Note: See TracChangeset for help on using the changeset viewer.