Changeset 11376


Ignore:
Timestamp:
Nov 17, 2008, 3:06:10 AM (11 years ago)
Author:
gb
Message:

On FreeBSD, whether or not we can write to rcontext depends on whether
or not the 32-bit lisp is running on a 64-bit kernel, so check
'rcontext_readonly' and skip loading rcontext from the tcr if it's
non-zero. (On a 32-bit kernel, %fs can get clobbered sometimes.)

Location:
trunk/source/lisp-kernel
Files:
2 edited

Legend:

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

    r11370 r11376  
    42634263        __(push %ebp)
    42644264        __(box_fixnum(%eax,%esi))       /* put callback index in arg_y */
    4265         __ifndef([FREEBSD])
    4266          __(ref_global(get_tcr,%eax))
    4267          __(subl $12,%esp)              /* alignment */
    4268          __(push $1)                    /* stack now 16-byte aligned */
    4269          __(call *%eax)
    4270          __(addl $16,%esp)              /* discard arg, alignment words */
    4271          /* linear TCR addr now in %eax */
    4272          __(movw tcr.ldt_selector(%eax), %rcontext_reg)
    4273         __endif
     4265        __(cmpb $0,C(rcontext_readonly))
     4266        __(jne 0f)
     4267        __(ref_global(get_tcr,%eax))
     4268        __(subl $12,%esp)               /* alignment */
     4269        __(push $1)                     /* stack now 16-byte aligned */
     4270        __(call *%eax)
     4271        __(addl $16,%esp)               /* discard arg, alignment words */
     4272        /* linear TCR addr now in %eax */
     4273        __(movw tcr.ldt_selector(%eax), %rcontext_reg)
     42740:     
    42744275
    42754276        /* ebp is 16-byte aligned, and we've pushed 4 words.  Make
  • trunk/source/lisp-kernel/x86-subprims32.s

    r11370 r11376  
    7575        __(push %ebx)
    7676        __(mov 8(%ebp), %ebx)   /* get tcr */
    77         __ifndef([FREEBSD])
    78          __(movw tcr.ldt_selector(%ebx), %rcontext_reg)
    79         __endif
     77        __(cmpb $0,C(rcontext_readonly))
     78        __(jne 0f)
     79        __(movw tcr.ldt_selector(%ebx), %rcontext_reg)
     800:             
    8081        __(movl 8(%ebp),%eax)
    8182        __(cmpl rcontext(tcr.linear),%eax)
    82         __(je 0f)
     83        __(je 1f)
    8384        __(hlt)
    84 0:             
     851:             
    8586        .if c_stack_16_byte_aligned
    8687        __(sub $12, %esp)       /* stack now 16-byte aligned */
Note: See TracChangeset for help on using the changeset viewer.