Changeset 4980


Ignore:
Timestamp:
Aug 20, 2006, 10:51:47 PM (18 years ago)
Author:
Gary Byers
Message:

DARWIN_GS_HACK hacks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/lisp-kernel/x86-asmutils64.s

    r4940 r4980  
    142142_exportfn(C(put_vector_registers))
    143143_endfn                         
    144                        
     144       
     145       
     146        __ifdef([DARWIN_GS_HACK])
     147/* Check (in and ugly, non-portale way) to see if %gs is addressing
     148   threads data.  If it was, return 0; otherwise, assume that it's
     149   addressing a lisp tcr and set %gs to point to the tcr's tcr.osid,
     150   then return 1. */
     151       
     152thread_signature = 0x54485244 /* 'THRD' */
     153       
     154_exportfn(C(ensure_gs_pthread))
     155        __(cmpl $thread_signature,%gs:0)
     156        __(movl $0,%eax)
     157        __(je 9f)
     158        __(movq %gs:tcr.osid,%rdi)
     159        __(movl $0x3000003,%eax)
     160        __(syscall)
     161        __(movl $1,%eax)
     1629:      __(ret)
     163_endfn
     164
     165        /* Ensure that %gs addresses the linear address in %rdi */
     166        /* This incidentally returns the segment selector .*/
     167_exportfn(C(set_gs_address))
     168        __(movl $0x3000003,%eax)
     169        __(syscall)
     170        __(ret)
     171_endfn
     172        __endif         
    145173        _endfile
Note: See TracChangeset for help on using the changeset viewer.