Changeset 8579


Ignore:
Timestamp:
Feb 25, 2008, 11:07:20 AM (12 years ago)
Author:
gb
Message:

tcr-level suspend/resume/interrupt: trap into the kernel, don't call into
it. This (mostly) has to do with a Leopard bug workaround and this
commit only implements the PPC side of things. x8664-related changes
and new images coming "soon", for some value of "soon".

Location:
trunk/source
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-0/PPC/ppc-misc.lisp

    r8247 r8579  
    981981  (blr))
    982982
     983(defppclapfunction %%tcr-interrupt ((target arg_z))
     984  (check-nargs 1)
     985  (uuo_interr arch::error-interrupt rzero)
     986  (box-fixnum arg_z imm0)
     987  (blr))
     988
     989(defppclapfunction %suspend-tcr ((target arg_z))
     990  (check-nargs 1)
     991  (uuo_interr arch::error-suspend rzero)
     992  (eq0->boolean arg_z imm0 imm1)
     993  (blr))
     994
     995(defppclapfunction %suspend-other-threads ()
     996  (check-nargs 0)
     997  (uuo_interr arch::error-suspend-all rzero)
     998  (li arg_z nil)
     999  (blr))
     1000
     1001(defppclapfunction %resume-tcr ((target arg_z))
     1002  (check-nargs 1)
     1003  (uuo_interr arch::error-resume rzero)
     1004  (eq0->boolean arg_z imm0 imm1)
     1005  (blr))
     1006
     1007(defppclapfunction %resume-other-threads ()
     1008  (check-nargs 0)
     1009  (uuo_interr arch::error-resume-all rzero)
     1010  (li arg_z nil)
     1011  (blr))
     1012
    9831013(defppclapfunction %atomic-pop-static-cons ()
    9841014  (li imm0 (+ target::nil-value (target::kernel-global static-conses)))
  • trunk/source/level-0/l0-misc.lisp

    r7925 r8579  
    508508;;; to do otherwise.  The caller really needs to hold the heap-segment
    509509;;; lock; this grabs the tcr queue lock as well.
    510 (defun %suspend-other-threads ()
    511   (ff-call (%kernel-import target::kernel-import-suspend-other-threads)
    512            :void))
    513 
    514 (defun %resume-other-threads ()
    515   (ff-call (%kernel-import target::kernel-import-resume-other-threads)
    516            :void))
     510
    517511
    518512(defparameter *spin-lock-tries* 1)
     
    772766 
    773767 
    774 (defun %suspend-tcr (tcr)
    775   (with-macptrs (tcrp)
    776     (%setf-macptr-to-object tcrp tcr)
    777     (not (zerop (the fixnum
    778                   (ff-call (%kernel-import target::kernel-import-suspend-tcr)
    779                            :address tcrp
    780                            :unsigned-fullword))))))
    781 
    782 (defun %resume-tcr (tcr)
    783   (with-macptrs (tcrp)
    784     (%setf-macptr-to-object tcrp tcr)
    785     (not (zerop (the fixnum
    786                   (ff-call (%kernel-import target::kernel-import-resume-tcr)
    787                            :address tcrp
    788                            :unsigned-fullword))))))
     768
    789769
    790770
  • trunk/source/level-1/l1-lisp-threads.lisp

    r8167 r8579  
    344344  ;; When a thread dies, it should try to clear its interrupt-pending
    345345  ;; flag.
    346   (or (not (eql 0 (%fixnum-ref tcr target::tcr.interrupt-pending)))
    347       (with-macptrs (tcrp)
    348         (%setf-macptr-to-object tcrp tcr)
    349         (ff-call
    350          (%kernel-import target::kernel-import-raise-thread-interrupt)
    351          :address tcrp
    352          :signed-fullword))))
     346  (if (eql 0 (%fixnum-ref tcr target::tcr.interrupt-pending))
     347    (%%tcr-interrupt tcr)
     348    0))
    353349
    354350
  • trunk/source/lisp-kernel/errors.s

    r7624 r8579  
    2525error_excised_function_call = 6
    2626error_too_many_values = 7
    27 error_propagate_suspend = 10   
     27error_propagate_suspend = 10
     28error_interrupt = 11
     29error_suspend = 12
     30error_suspend_all = 13
     31error_resume = 14
     32error_resume_all = 15                                   
    2833error_cant_call = 17
    2934       
  • trunk/source/lisp-kernel/lisp-errors.h

    r7624 r8579  
    2828#define error_too_many_values 7
    2929#define error_propagate_suspend 10
     30#define error_interrupt 11
     31#define error_suspend 12
     32#define error_suspend_all 13
     33#define error_resume 14
     34#define error_resume_all 15                                     
    3035#define error_cant_call 17
    3136
  • trunk/source/lisp-kernel/ppc-exceptions.c

    r8543 r8579  
    13361336
    13371337  case UUO_INTERR:
    1338     if (errnum == error_propagate_suspend) {
     1338    {
     1339      TCR * target = (TCR *)xpGPR(xp,arg_z);
    13391340      status = 0;
    1340     } else {
    1341       status = handle_error(xp, errnum, rb, 0,  where);
     1341      switch (errnum) {
     1342      case error_propagate_suspend:
     1343        break;
     1344      case error_interrupt:
     1345        xpGPR(xp,imm0) = (LispObj) raise_thread_interrupt(target);
     1346        break;
     1347      case error_suspend:
     1348        xpGPR(xp,imm0) = (LispObj) lisp_suspend_tcr(target);
     1349        break;
     1350      case error_suspend_all:
     1351        lisp_suspend_other_threads();
     1352        break;
     1353      case error_resume:
     1354        xpGPR(xp,imm0) = (LispObj) lisp_suspend_tcr(target);
     1355        break;
     1356      case error_resume_all:
     1357        lisp_resume_other_threads();
     1358        break;
     1359      default:
     1360        status = handle_error(xp, errnum, rb, 0,  where);
     1361        break;
     1362      }
    13421363    }
    13431364    break;
Note: See TracChangeset for help on using the changeset viewer.