Changeset 13962


Ignore:
Timestamp:
Jul 15, 2010, 12:24:29 AM (9 years ago)
Author:
gb
Message:

arm-arch.lisp: artist's conception of fake-stack-frame.
arm-backend.lisp: require armenv, nxenv. WITH-FAKE-STACK-FRAME.
arm-vinsns.lisp: fix u32->integer.
arm-utils.lisp: LAP for other gc-trap functions.
arm-thread-utils.lisp: start to sketch out fake-stack-frame stuff, no TSP on ARM.
l1-io.lisp: no TSP on ARM.
l1-lisp-threads.lisp: no TSP on ARM.
arm-backtrace.lisp: fake-stack-frame stuff.
backtrace: no *fake-stack-frames* list on ARM.
edit-callers.lisp: ARM changes.
nfcomp.lisp: in FASL-SCAN-DISPATCH, don't assume that TYPECODE returns target::FULLTAG-CONS (which may not be the same as TARGET::TAG-LIST.)
arm-asmutils.s: flush_cache_lines is Linux-specific.
area.h: larger pure spaces on ARM; small static space on all platforms.
arm-exceptions.h: different magic number in is_write_fault.
arm-gc.c: purify() mostly working.
arm-subprims.s: fix comment
platform-linuxarm.h, xarmfasload.lisp: map more memory at higher address on ARM linux.

Location:
branches/arm
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • branches/arm/compiler/ARM/arm-arch.lisp

    r13948 r13962  
    13831383(defconstant *function-initial-entrypoint* (ash *arm-subprims-base* (- arm::fixnumshift)))
    13841384
    1385  
     1385;;; These are always stack-allocated, "near" where the missing lisp frame
     1386;;; that they represent would be.
     1387
     1388(define-storage-layout fake-stack-frame 0
     1389  header
     1390  type                                  ; 'arm::fake-stack-frame
     1391  sp
     1392  next-sp
     1393  fn
     1394  lr
     1395  vsp
     1396  xp)
     1397
     1398
     1399
    13861400(provide "ARM-ARCH")
  • branches/arm/compiler/ARM/arm-backend.lisp

    r13897 r13962  
    1717
    1818(in-package "CCL")
     19
     20(eval-when (:compile-toplevel :load-toplevel :execute)
     21  (require "NXENV")
     22  (require "ARMENV"))
    1923
    2024(next-nx-defops)
     
    314318(pushnew *arm-backend* *known-backends* :key #'backend-name)
    315319
     320
     321(defmacro with-fake-stack-frame ((var sp next-sp fn lr vsp xp) &body body)
     322  `(let* ((,var (ccl::%istruct 'arm::fake-stack-frame ,sp ,next-sp ,fn ,lr ,vsp ,xp)))
     323    (declare (dynamic-extent ,var) (ignorable ,var))
     324    ,@body))
     325
    316326(require "ARM-VINSNS")
    317327
  • branches/arm/compiler/ARM/arm-vinsns.lisp

    r13955 r13962  
    21832183  (cmp src (:$ 0))
    21842184  (mov temp (:$ arm::subtag-bignum))
    2185   (movgt size (:$ (- (* 2 arm::dnode-size) arm::fulltag-misc)))
    2186   (orrgt temp temp (:$ (ash 2 arm::num-subtag-bits)))
    2187   (movlt size (:$ (- (* 1 arm::dnode-size) arm::fulltag-misc)))
    2188   (orrlt temp temp (:$ (ash 1 arm::num-subtag-bits)))
     2185  (movgt size (:$ (- (* 1 arm::dnode-size) arm::fulltag-misc)))
     2186  (orrgt temp temp (:$ (ash 1 arm::num-subtag-bits)))
     2187  (movlt size (:$ (- (* 2 arm::dnode-size) arm::fulltag-misc)))
     2188  (orrlt temp temp (:$ (ash 2 arm::num-subtag-bits)))
    21892189  (sub allocptr allocptr size)
    21902190  (ldr result (:@ rcontext (:$ arm::tcr.save-allocbase)))
  • branches/arm/level-0/ARM/arm-utils.lisp

    r13927 r13962  
    332332  (ba .SPnvalret))
    333333
    334 #+notyet                                ;trap encoding
    335 (progn
    336 
    337334
    338335
     
    343340of sense to be turning the EGC on and off from multiple threads ..."
    344341  (check-nargs 1)
    345   (subi imm1 arg nil)
    346   (li imm0 arch::gc-trap-function-egc-control)
    347   (trlgei allocptr 0)
     342  (sub imm1 arg 'nil)
     343  (mov imm0 (:$ arch::gc-trap-function-egc-control))
     344  (uuo-gc-trap (:? al))
    348345  (bx lr))
    349346
     
    354351                                   (e2size arg_z))
    355352  (check-nargs 3)
    356   (li imm0 arch::gc-trap-function-configure-egc)
    357   (trlgei allocptr 0)
     353  (mov imm0 (:$ arch::gc-trap-function-configure-egc))
     354  (uuo-gc-trap (:? al))
    358355  (bx lr))
    359356
    360357(defarmlapfunction purify ()
    361   (li imm0 arch::gc-trap-function-purify)
    362   (trlgei allocptr 0)
    363   (li arg_z nil)
     358  (mov imm0 (:$ arch::gc-trap-function-purify))
     359  (uuo-gc-trap (:? al))
     360  (mov arg_z 'nil)
    364361  (bx lr))
    365362
    366363
    367364(defarmlapfunction impurify ()
    368   (li imm0 arch::gc-trap-function-impurify)
    369   (trlgei allocptr 0)
    370   (li arg_z nil)
     365  (mov imm0 (:$ arch::gc-trap-function-impurify))
     366  (uuo-gc-trap (:? al))
     367  (mov arg_z 'nil)
    371368  (bx lr))
    372369
     
    375372of free space to leave in the heap after full GC."
    376373  (check-nargs 0)
    377   (li imm0 arch::gc-trap-function-get-lisp-heap-threshold)
    378   (trlgei allocptr 0)
    379   #+arm32-target
    380   (ba .SPmakeu32)
    381   #+arm64-target
    382   (ba .SPmakeu64))
     374  (mov imm0 (:$ arch::gc-trap-function-get-lisp-heap-threshold))
     375  (uuo-gc-trap (:? al))
     376  (ba .SPmakeu32))
    383377
    384378(defarmlapfunction set-lisp-heap-gc-threshold ((new arg_z))
     
    388382be somewhat larger than what was specified)."
    389383  (check-nargs 1)
    390   (mflr loc-pc)
    391   #+arm32-target
    392   (bla .SPgetu32)
    393   #+arm64-target
    394   (bla .SPgetu64)
    395   (mtlr loc-pc)
     384  (build-lisp-frame)
     385  (bl .SPgetu32)
    396386  (mov imm1 imm0)
    397   (li imm0 arch::gc-trap-function-set-lisp-heap-threshold)
    398   (trlgei allocptr 0)
    399   #+arm32-target
    400   (ba .SPmakeu32)
    401   #+arm64-target
    402   (ba .SPmakeu64))
     387  (mov imm0 (:$ arch::gc-trap-function-set-lisp-heap-threshold))
     388  (uuo-gc-trap (:? al))
     389  (restore-lisp-frame imm1)
     390  (ba .SPmakeu32))
    403391
    404392
     
    406394  "Try to grow or shrink lisp's heap space, so that the free space is(approximately) equal to the current heap threshold. Return NIL"
    407395  (check-nargs 0)
    408   (li imm0 arch::gc-trap-function-use-lisp-heap-threshold)
    409   (trlgei allocptr 0)
    410   (li arg_z nil)
     396  (mov imm0 (:$ arch::gc-trap-function-use-lisp-heap-threshold))
     397  (uuo-gc-trap (:? al))
     398  (mov arg_z 'nil)
    411399  (bx lr))
    412400
     
    415403  "Do a full GC, then consider all heap-allocated objects which survive to be non-relocatable."
    416404  (check-nargs 0)
    417   (li imm0 arch::gc-trap-function-freeze)
    418   (trlgei allocptr 0)
    419   #+64-bit-target
    420   (ba .SPmakeu64)
    421   #+32-bit-target
     405  (mov imm0 (:$ arch::gc-trap-function-freeze))
     406  (uuo-gc-trap (:? al))
    422407  (ba .SPmakeu32))
    423408
     
    425410  "Like FREEZE, but don't GC first."
    426411  (check-nargs 0)
    427   (li imm0 arch::gc-trap-function-flash-freeze)
    428   (trlgei allocptr 0)
    429   #+64-bit-target
    430   (ba .SPmakeu64)
    431   #+32-bit-target
     412  (mov imm0 (:$ arch::gc-trap-function-flash-freeze))
     413  (uuo-gc-trap (:? al))
    432414  (ba .SPmakeu32))
    433415
     
    444426(defarmlapfunction %ensure-static-conses ()
    445427  (check-nargs 0)
    446   (li imm0 arch::gc-trap-function-ensure-static-conses)
    447   (trlgei allocptr 0)
    448   (li arg_z nil)
    449   (bx lr))
    450 )
     428  (mov imm0 (:$ arch::gc-trap-function-ensure-static-conses))
     429  (uuo-gc-trap (:? al))
     430  (mov arg_z 'nil)
     431  (bx lr))
     432
    451433
    452434;;; offset is a fixnum, one of the arm::kernel-import-xxx constants.
  • branches/arm/level-1/arm-threads-utils.lisp

    r13918 r13962  
    1919(defun %frame-backlink (p &optional context)
    2020  (cond ((fake-stack-frame-p p)
    21          (%fake-stack-frame.next-sp p))
     21         (%fixnum-ref p arm::fake-stack-frame.next-sp))
    2222        ((fixnump p) (%%frame-backlink p))
    2323        (t (error "~s is not a valid stack frame" p))))
     
    3131
    3232(defun fake-stack-frame-p (x)
    33   nil)
     33  (and (typep x 'fixnum)
     34       (evenp x)
     35       (eql (%fixnum-ref-natural x)
     36            (logior (ash (ash (- arm::fake-stack-frame.size arm::node-size)
     37                              (- arm::word-shift))
     38                         arm::num-subtag-bits)
     39                    arm::subtag-istruct))
     40       (eq (%fixnum-ref-natural x arm::node-size)
     41           'arm::fake-stack-frame)))
     42
    3443
    3544(defun bottom-of-stack-p (p context)
     
    92101                              (on-any-vstack x))
    93102                             (t
    94                               (on-any-tsp-stack x)))
     103                              (on-any-csp-stack x)))
    95104                           (%heap-ivector-p x)))))))))
    96105
  • branches/arm/level-1/l1-io.lisp

    r13067 r13962  
    16001600(defun %macptr-allocation-string (macptr)
    16011601  (if (or (on-any-csp-stack macptr)
     1602          #-arm-target
    16021603          (on-any-tsp-stack macptr))
    16031604    "[stack-allocated]"
  • branches/arm/level-1/l1-lisp-threads.lisp

    r13889 r13962  
    703703      (return t))))
    704704
    705 
     705#-arm-target
    706706(defun on-any-tsp-stack (object)
    707707  (or (%on-tsp-stack (%current-tcr) object)
     
    720720  (and (consp x)
    721721       (not (null (or (on-any-vstack x)
    722                       (on-any-tsp-stack x))))))
     722                      #-arm-target
     723                      (on-any-tsp-stack x)
     724                      #+arm-target
     725                      (on-any-csp-stack x))))))
    723726
    724727
  • branches/arm/lib/arm-backtrace.lisp

    r13922 r13962  
    5151(defun index->address (p)
    5252  (when (fake-stack-frame-p p)
    53     (setq p (%fake-stack-frame.sp p)))
     53    (setq p (%fixnum-ref p arm::fake-stack-frame.sp)))
    5454  (ldb (byte  32 0)  (ash p arm::fixnumshift)))
    5555
     
    114114(defun %frame-savevsp (p)
    115115  (if (fake-stack-frame-p p)
    116     (%fake-stack-frame.vsp p)
     116    (%fixnum-ref p arm::fake-stack-frame.vsp)
    117117    (%%frame-savevsp p)))
  • branches/arm/lib/backtrace.lisp

    r13910 r13962  
    4242                        nil       ;; condition - not used
    4343                        frame-ptr ;; current
    44                         #+(or ppc-target arm-target) *fake-stack-frames*
    45                         #+x86-target frame-ptr
     44                        #+ppc-target *fake-stack-frames*
     45                        #+(or x86-target arm-target) frame-ptr
    4646                        (%fixnum-ref tcr target::tcr.db-link)
    4747                        0         ;; break level - not used
  • branches/arm/lib/edit-callers.lisp

    r13779 r13962  
    226226(defun %map-lfimms (function-object f)
    227227  (let* ((lfv (function-to-function-vector function-object))
    228          (n (- (uvsize lfv) #+arm-target 3 #-arm-target 2)))
     228         (n (- (uvsize lfv) 2)))
    229229    (declare (fixnum n))
    230230    #+ppc-target
     
    238238    #+arm-target
    239239    (do* ((i 2 (1+ i)))
    240          ((= i n))
     240         ((>= i n))
    241241      (declare (fixnum i))
    242       (funcall f (%svref lfv i)))
     242      (funcall f (uvref lfv i)))
    243243    ))
    244244         
  • branches/arm/lib/nfcomp.lisp

    r13912 r13962  
    12071207        (#.target::tag-fixnum
    12081208         (fasl-scan-fixnum exp))
    1209         (#.target::fulltag-cons (fasl-scan-list exp))
     1209        (#.target::tag-list (fasl-scan-list exp))
    12101210        #+ppc32-target
    12111211        (#.ppc32::tag-imm)
  • branches/arm/lisp-kernel/area.h

    r13789 r13962  
    154154#else
    155155#ifdef ARM
    156 #define PURESPACE_RESERVE (8<<20)
    157 #define PURESPACE_SIZE (4<<20)
     156#define PURESPACE_RESERVE (64<<20)
     157#define PURESPACE_SIZE (32<<20)
    158158#else
    159159#define PURESPACE_RESERVE (128<<20) /* MB */
     
    162162#endif
    163163
    164 #define STATIC_RESERVE heap_segment_size
     164#define STATIC_RESERVE (1<<12)
    165165
    166166
  • branches/arm/lisp-kernel/arm-asmutils.s

    r13958 r13962  
    2424/* Force data from r0 to r1 into the icache */       
    2525_exportfn(C(flush_cache_lines))
     26        __ifdef(`LINUX')
    2627        __(mov r2,#0)           /* options.  Pass as 0 until we know better */
    2728        __(mov r12,r7)          /* preserve r7 ;  r12 saved by syscall */
     
    3031        __(svc #0)
    3132        __(mov r7,r12)
     33        __endif
    3234        __(bx lr)
    3335
  • branches/arm/lisp-kernel/arm-exceptions.c

    r13958 r13962  
    816816  /* Based on experiments with a small sample size; need to R TFM. */
    817817  return ((xp->uc_mcontext.trap_no == 0xe) &&
    818           (xp->uc_mcontext.error_code == 0x817));
     818          (xp->uc_mcontext.error_code == 0x81f));
    819819#endif
    820820}
  • branches/arm/lisp-kernel/arm-gc.c

    r13948 r13962  
    16681668        }
    16691669        start++;
    1670         copy_ivector_reference(start, low, high, to);
     1670        if (header_subtag(header) == subtag_function) {
     1671          LispObj entrypt = *start;
     1672          if ((entrypt > (LispObj)low) &&
     1673              (entrypt < (LispObj)high) &&
     1674              (fulltag_of(entrypt) == fulltag_odd_fixnum)) {
     1675            *start = untag(entrypt) + fulltag_misc;
     1676            copy_ivector_reference(start, low, high, to);
     1677            *start = untag(*start)+fulltag_odd_fixnum;
     1678          } else {
     1679            copy_ivector_reference(start, low, high, to);
     1680          }
     1681        } else {
     1682          copy_ivector_reference(start, low, high, to);
     1683        }
    16711684        start++;
    16721685      }
  • branches/arm/lisp-kernel/arm-subprims.s

    r13893 r13962  
    5454
    5555
    56 /* This gets called with R3 pointing to the current TCR. */
    57 /* r4 is 0 if we want to start the whole thing rolling, */
     56/* This gets called with R0 pointing to the current TCR. */
     57/* r1 is 0 if we want to start the whole thing rolling, */
    5858/* non-zero if we want to reset the current process */
    5959/* by throwing to toplevel */
  • branches/arm/lisp-kernel/platform-linuxarm.h

    r13948 r13962  
    2626
    2727
    28 #define MAXIMUM_MAPPABLE_MEMORY (256<<20) /* uh, no */
    29 #define IMAGE_BASE_ADDRESS 0x04001000
     28#define MAXIMUM_MAPPABLE_MEMORY (5<<28)
     29#define IMAGE_BASE_ADDRESS 0x50000000
    3030
    3131#include "lisptypes.h"
  • branches/arm/xdump/xarmfasload.lisp

    r13948 r13962  
    8787   :subdirs '("ccl:level-0;ARM;")
    8888   :compiler-target-name :linuxarm
    89    :image-base-address (+ (- arm::nil-value arm::fulltag-nil) (ash 1 12))
     89   :image-base-address #x50000000
    9090   :nil-relative-symbols arm::*arm-nil-relative-symbols*
    9191   :static-space-init-function 'arm-initialize-static-space
    92    :purespace-reserve (ash 8 20)
     92   :purespace-reserve (ash 64 20)
    9393   :static-space-address (- (- arm::nil-value arm::fulltag-nil) (ash 1 12))
    9494))
Note: See TracChangeset for help on using the changeset viewer.