Changeset 657


Ignore:
Timestamp:
Mar 17, 2004, 7:26:08 AM (21 years ago)
Author:
Gary Byers
Message:

LLGPL. Fix some dynamic-binding stuff; ad-hoc scheme for bogus-thing check
in (some) other threads.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/level-1/l1-lisp-threads.lisp

    r602 r657  
    1 ;;;-*- Mode: Lisp; Package: CCL -*-
     1;;; -*- Mode: LISP; Package: CCL -*-
    22;;;
    33;;;   Copyright (C) 1994-2001 Digitool, Inc
    4 ;;;   This file is part of Opensourced MCL.
     4;;;   This file is part of OpenMCL. 
    55;;;
    6 ;;;   Opensourced MCL is free software; you can redistribute it and/or
    7 ;;;   modify it under the terms of the GNU Lesser General Public
    8 ;;;   License as published by the Free Software Foundation; either
    9 ;;;   version 2.1 of the License, or (at your option) any later version.
     6;;;   OpenMCL is licensed under the terms of the Lisp Lesser GNU Public
     7;;;   License , known as the LLGPL and distributed with OpenMCL as the
     8;;;   file "LICENSE".  The LLGPL consists of a preamble and the LGPL,
     9;;;   which is distributed with OpenMCL as the file "LGPL".  Where these
     10;;;   conflict, the preamble takes precedence. 
    1011;;;
    11 ;;;   Opensourced MCL is distributed in the hope that it will be useful,
    12 ;;;   but WITHOUT ANY WARRANTY; without even the implied warranty of
    13 ;;;   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    14 ;;;   Lesser General Public License for more details.
     12;;;   OpenMCL is referenced in the preamble as the "LIBRARY."
    1513;;;
    16 ;;;   You should have received a copy of the GNU Lesser General Public
    17 ;;;   License along with this library; if not, write to the Free Software
    18 ;;;   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    19 ;;;
     14;;;   The LLGPL is also available online at
     15;;;   http://opensource.franz.com/preamble.html
    2016
    2117;; l1-lisp-threads.lisp
    2218
    23 (cl:in-package "CCL")
     19(in-package "CCL")
    2420
    2521(defvar *bind-io-control-vars-per-process* nil
     
    736732  (when (fake-stack-frame-p p)
    737733    (setq p (%fake-stack-frame.sp p)))
    738   (ldb (byte 32 0)  (ash p ppc32::fixnumshift)))
     734  (ldb (byte #+ppc32-target 32 #+ppc64-target 64 0)  (ash p target::fixnumshift)))
    739735
    740736; This returns the current head of the db-link chain.
     
    742738  (%fixnum-ref tcr ppc32::tcr.db-link))
    743739
    744 (defun previous-db-link (db-link start &optional (tcr (%current-tcr)))
     740(defun previous-db-link (db-link start )
    745741  (declare (fixnum db-link start))
    746   (if (eq tcr (%current-tcr))
    747     (let ((prev nil))
    748       (loop
    749         (when (or (eql db-link start) (eql 0 start))
    750           (return prev))
    751         (setq prev start
    752               start (%fixnum-ref start 0))))
    753     (let ((prev (%fixnum-ref db-link)))
    754       (unless (eql prev 0) prev))))
     742  (let ((prev nil))
     743    (loop
     744      (when (or (eql db-link start) (eql 0 start))
     745        (return prev))
     746      (setq prev start
     747            start (%fixnum-ref start 0)))))
    755748
    756749(defun count-db-links-in-frame (vsp parent-vsp &optional (tcr (%current-tcr)))
     
    759752        (count 0)
    760753        (first nil)
    761         (last nil)
    762         (current? (eq tcr (%current-tcr))))
     754        (last nil))
    763755    (declare (fixnum db count))
    764756    (loop
    765757      (cond ((eql db 0)
    766              (unless current?
    767                (rotatef first last))
    768758             (return (values count (or first 0) (or last 0))))
    769759            ((and (>= db vsp) (< db parent-vsp))
     
    819809             (< object high))))))
    820810
     811(defparameter *aux-tsp-ranges* ())
     812(defparameter *aux-vsp-ranges* ())
     813(defun object-in-range-p (object range)
     814  (declare (fixnum object))
     815  (when range
     816    (destructuring-bind (active . high) range
     817      (declare (fixnum active high))
     818      (and (< active object)
     819           (< object high)))))
     820
     821(defun object-in-some-range (object ranges)
     822  (dolist (r ranges)
     823    (when (object-in-range-p object r)
     824      (return t))))
     825
     826
    821827(defun on-any-tsp-stack (object)
    822   (or (%on-tsp-stack (%current-tcr) object)))
     828  (or (%on-tsp-stack (%current-tcr) object)
     829      (object-in-some-range object *aux-tsp-ranges*)))
    823830
    824831(defun on-any-vstack (idx)
    825   (or (%ptr-to-vstack-p (%current-tcr) idx)))
     832  (or (%ptr-to-vstack-p (%current-tcr) idx)
     833      (object-in-some-range idx *aux-vsp-ranges*)))
    826834
    827835; This MUST return either T or NIL.
     
    958966            (setq db-link-p t
    959967                  arg-vsp last-db
    960                   last-db (previous-db-link last-db first-db tcr)
     968                  last-db (previous-db-link last-db first-db)
    961969                  phys-cell (+ phys-cell 2))
    962970            (setq db-link-p nil))
     
    965973              (return
    966974               (if db-link-p
    967                  ;; Really ought to find the next binding if not the
    968                  ;; current tcr, but noone has complained about this
    969                  ;; bug before, so why fix it?
    970975                 (values (+ 2 arg-vsp)
    971976                         :saved-special
Note: See TracChangeset for help on using the changeset viewer.