Changeset 8350


Ignore:
Timestamp:
Jan 28, 2008, 11:22:34 PM (17 years ago)
Author:
R. Matthew Emerson
Message:

nthrow1value, unbind_to, unbind_interrupt_level.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ia32/lisp-kernel/x86-spentry32.s

    r8260 r8350  
    577577       
    578578_spentry(nthrow1value)
    579         __(int $3)
     579        __(movb $1,%rcontext:tcr.unwinding)
     580local_label(_nthrow1v_nextframe):
     581        __(subl $fixnumone,%imm0)
     582        __(js local_label(_nthrow1v_done))
     583        __(movd %imm0,%mm0)
     584        __(movl %rcontext:tcr.catch_top,%temp1)
     585        __(movl catch_frame.link(%temp1),%imm0)
     586        __(movl %imm0,%rcontext:tcr.catch_top)
     587        __(movl catch_frame.db_link(%temp1),%imm0)
     588        __(cmpl %imm0,%rcontext:tcr.db_link)
     589        __(jz local_label(_nthrow1v_dont_unbind))
     590        __(push %temp1)
     591        __(push %temp0)
     592        __(push %arg_z)
     593        __(push [$]local_label(_nthrow1v_back_from_unbind))
     594        __(jmp _SPunbind_to)
     595__(tra(local_label(_nthrow1v_back_from_unbind)))
     596        __(pop %arg_z)
     597        __(pop %temp0)
     598        __(pop %temp1)
     599local_label(_nthrow1v_dont_unbind):
     600        __(cmpb $unbound_marker,catch_frame.catch_tag(%temp1))
     601        __(je local_label(_nthrow1v_do_unwind))
     602/* A catch frame.  If the last one, restore context from there. */
     603        __(movd %mm0,%imm0)
     604        __(test %imm0,%imm0)    /* last catch frame? */
     605        __(jne local_label(_nthrow1v_skip))
     606        __(movl catch_frame.xframe(%temp1),%arg_y)
     607        __(movl %arg_y,%rcontext:tcr.xframe)
     608        __(movl catch_frame.esp(%temp1),%esp)
     609        __(movl catch_frame.ebp(%temp1),%ebp)
     610        __(movd catch_frame.foreign_sp(%temp1),%stack_temp)
     611        __(movd %stack_temp,%rcontext:tcr.foreign_sp)
     612local_label(_nthrow1v_skip):
     613        __(movl -(tsp_frame.fixed_overhead+fulltag_misc)(%temp1),%imm0)
     614        __(movl %imm0,%rcontext:tcr.save_tsp)
     615        __(movl %imm0,%rcontext:tcr.next_tsp)
     616        __(movd %mm0,%imm0)
     617        __(jmp local_label(_nthrow1v_nextframe))
     618local_label(_nthrow1v_do_unwind):
     619/* This is harder, but not as hard (not as much BLTing) as the */
     620/* multiple-value case. */
     621        __(movl catch_frame.xframe(%temp1),%arg_y)
     622        __(movl %arg_y,%rcontext:tcr.xframe)
     623        __(movl catch_frame.ebp(%temp1),%ebp)
     624        __(movl catch_frame.esp(%temp1),%esp)
     625        __(movd catch_frame.foreign_sp(%temp1),%stack_temp)
     626        __(movd %stack_temp,%rcontext:tcr.foreign_sp)
     627        /* Discard the catch frame so we can build a temp frame. */
     628        __(movl -(tsp_frame.fixed_overhead+fulltag_misc)(%temp1),%imm0)
     629        __(movl %imm0,%rcontext:tcr.save_tsp)
     630        __(movl %imm0,%rcontext:tcr.next_tsp)
     631        __(movl catch_frame.pc(%temp1),%xfn) /* xfn is temp1 */
     632        __(TSP_Alloc_Fixed((3*node_size),%imm0))
     633        __(addl $tsp_frame.fixed_overhead,%imm0)
     634        __(movl %ra0,(%imm0))
     635        __(movd %mm0,node_size*1(%imm0))
     636        __(movl %arg_z,node_size*2(%imm0))
     637/* Ready to call cleanup code.  Set up tra, jmp to %xfn. */
     638        __(push $local_label(_nthrow1v_called_cleanup))
     639        __(movb $0,%rcontext:tcr.unwinding)
     640        __(jmp *%xfn)
     641__(tra(local_label(_nthrow1v_called_cleanup)))
     642        __(movb $1,%rcontext:tcr.unwinding)
     643        __(movl %rcontext:tcr.save_tsp,%imm0)
     644        __(movl tsp_frame.data_offset+(0*node_size)(%imm0),%ra0)
     645        __(movd tsp_frame.data_offset+(1*node_size)(%imm0),%mm0)
     646        __(movl tsp_frame.data_offset+(2*node_size)(%imm0),%arg_z)
     647        __(movl (%imm0),%imm0)
     648        __(movl %imm0,%rcontext:tcr.save_tsp)
     649        __(movl %imm0,%rcontext:tcr.next_tsp)
     650        __(movd %mm0,%imm0)
     651        __(jmp local_label(_nthrow1v_nextframe))
     652local_label(_nthrow1v_done):
     653        __(movb $0,%rcontext:tcr.unwinding)
     654        __(check_pending_interrupt(%imm0))
     655local_label(_nthrow1v_return):
     656        __(jmp *%ra0)
    580657_endsubp(nthrow1value)
    581658
     
    10251102        __(int $3)
    10261103_endsubp(makeu64)
    1027        
     1104
     1105/* on entry: arg_z = symbol.  On exit, arg_z = value (possibly */
     1106/* unbound_marker), arg_y = symbol */
    10281107_spentry(specref)
    10291108        __(int $3)
     
    10471126       
    10481127_spentry(specrefcheck)
    1049         __(movl %rcontext:tcr.tlb_pointer,%temp1)
    10501128        __(mov %arg_z,%arg_y)
    10511129        __(movl symbol.binding_index(%arg_z),%imm0)
    10521130        __(cmp %rcontext:tcr.tlb_limit,%imm0)
    10531131        __(jae 7f)
     1132        __(movl %rcontext:tcr.tlb_pointer,%temp1)
    10541133        __(movl (%temp1,%imm0),%arg_z)
    10551134        __(cmpb $no_thread_local_binding_marker,%arg_z_b)
     
    10821161_endsubp(mvpasssym)
    10831162
     1163/* */
    10841164_spentry(unbind)
    10851165        __(int $3)
     
    10911171
    10921172_spentry(unbind_to)
    1093         __(int $3)
     1173        __(movl %rcontext:tcr.db_link,%temp0)
     1174        __(movl %rcontext:tcr.tlb_pointer,%arg_z)
     11751:
     1176        __(movl binding.sym(%temp0),%temp1)
     1177        __(movl binding.val(%temp0),%arg_y)
     1178        __(movl binding.link(%temp0),%temp0)
     1179        __(movl %arg_y,(%arg_z,%temp1))
     1180        __(cmpl %temp0,%imm0)
     1181        __(jne 1b)
     1182        __(movl %temp0,%rcontext:tcr.db_link)
     1183        __(ret)
    10941184_endsubp(unbind_to)
    10951185
     
    11271217_endsubp(bind_interrupt_level)
    11281218
     1219/* Unbind CCL::*INTERRUPT-LEVEL*.  If the value changes from negative to */
     1220/* non-negative, check for pending interrupts. */
    11291221_spentry(unbind_interrupt_level)
    1130         __(int $3)
     1222        __(movl %rcontext:tcr.tlb_pointer,%arg_y)
     1223        __(movl INTERRUPT_LEVEL_BINDING_INDEX(%arg_y),%imm0)
     1224        __(test %imm0,%imm0)
     1225        __(movl %rcontext:tcr.db_link,%imm0)
     1226        __(movl binding.val(%imm0),%temp0)
     1227        __(movl binding.link(%imm0),%imm0)
     1228        __(movl %temp0,INTERRUPT_LEVEL_BINDING_INDEX(%arg_y))
     1229        __(movl %imm0,%rcontext:tcr.db_link)
     1230        __(js,pn 1f)
     12310:      __(repret)
     12321:      __(test %temp0,%temp0)
     1233        __(js 0b)
     1234        __(check_pending_enabled_interrupt(2f))
     12352:      __(repret)
    11311236_endsubp(unbind_interrupt_level)
    11321237
Note: See TracChangeset for help on using the changeset viewer.