Changeset 5480


Ignore:
Timestamp:
Nov 5, 2006, 6:40:36 AM (18 years ago)
Author:
Gary Byers
Message:

Some platforms (the L-word) generate ppc64 functions whose addresses
are not 0 mod 8, so (a) make MACPTR->FIXNUM return NIL if an address
isn't representable as a fixnum and (b) make FOREIGN-SYMBOL-ENTRY
return an address if it can't return a fixnum on PPC (really just
affects PPC64.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/level-0/l0-cfm-support.lisp

    r4991 r5480  
    452452
    453453
    454 ;;; An "entry" is a fixnum (the low 2 bits are clear) which represents
    455 ;;; a 32-bit, word-aligned address.  This should probably only be used
    456 ;;; for function entrypoints, since it treats a return value of 0 as
    457 ;;; invalid.
     454;;; An "entry" can be fixnum (the low 2 bits are clear) which represents
     455;;; a (32-bit word)-aligned address.  That convention covers all
     456;;; function addresses on ppc32 and works for addresses that are
     457;;; 0 mod 8 on PPC64, but can't work for things that're byte-aligned
     458;;; (x8664 and other non-RISC platforms.)
     459;;; For PPC64, we may have to cons up a macptr if people use broken
     460;;; linkers.  (There are usually cache advantages to aligning ppc
     461;;; function addresses on at least a 16-byte boundary, but some
     462;;; linkers don't quite get the concept ...)
    458463
    459464(defun foreign-symbol-entry (name &optional (handle *rtld-default*))
     
    469474                             :address))
    470475      (unless (%null-ptr-p addr)        ; No function can have address 0
    471         (macptr->fixnum addr)))
     476        (or (macptr->fixnum addr) (%inc-ptr addr 0))))
    472477    #+x8664-target
    473478    (let* ((addr (ff-call (%kernel-import target::kernel-import-FindSymbol)
Note: See TracChangeset for help on using the changeset viewer.