Changeset 10623


Ignore:
Timestamp:
Sep 8, 2008, 4:06:21 AM (11 years ago)
Author:
gb
Message:

Use a different set of conventions (the label
egc_store_node_conditional_test and the state of cr0[eq]) to determine
whether or not a store_node_conditional has completed.

If pc_luser_xp interrupts/completes set_hash_key, ensure that it
stores arg_z. (Was storing 0, which, if it ever happened, was
obviously the wrong thing to do.)

Location:
trunk/source/lisp-kernel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/ppc-exceptions.c

    r10385 r10623  
    18321832  egc_write_barrier_end,
    18331833  egc_store_node_conditional,
     1834  egc_store_node_conditional_test,
    18341835  egc_set_hash_key,
    18351836  egc_gvset,
     
    18581859
    18591860    if (program_counter >= &egc_store_node_conditional) {
    1860       if ((program_counter == &egc_store_node_conditional) || ! (xpCCR(xp) & 0x20000000)) {
    1861         /* The conditional store either hasn't been attempted yet, or
    1862            has failed.  No need to adjust the PC, or do memoization. */
    1863         return;
     1861      if ((program_counter < &egc_store_node_conditional_test) ||
     1862          ((program_counter == &egc_store_node_conditional_test) &&
     1863           (! (xpCCR(xp) & 0x20000000)))) {
     1864        /* The conditional store either hasn't been attempted yet, or
     1865           has failed.  No need to adjust the PC, or do memoization. */
     1866        return;
    18641867      }
    1865       val = xpGPR(xp,arg_z);
    18661868      ea = (LispObj*)(xpGPR(xp,arg_x) + xpGPR(xp,imm4));
    18671869      xpGPR(xp,arg_z) = t_value;
     
    18691871    } else if (program_counter >= &egc_set_hash_key) {
    18701872      root = xpGPR(xp,arg_x);
     1873      val = xpGPR(xp,arg_z);
    18711874      ea = (LispObj *) (root+xpGPR(xp,arg_y)+misc_data_offset);
    18721875      need_memoize_root = true;
  • trunk/source/lisp-kernel/ppc-spentry.s

    r8476 r10623  
    606606        __(blr)
    607607       
    608 /* This is a little trickier: the first instruction clears the EQ bit in CR0; */
    609 /* the only way that it can get set is if the conditional store succeeds.   */
    610 /* So: */
    611 /*   a) if we're interrupted on the first instruction, or if we're  */
    612 /*      interrupted on a subsequent instruction but CR0[EQ] is clear, the  */
    613 /*      condtional store hasn't succeeded yet.  We don't have to adjust the  */
    614 /*      PC in this case; when the thread's resumed, the conditional store */
    615 /*      will be (re-)attempted and will eventually either succeed or fail. */
    616 /*   b) if the CR0[EQ] bit is set (on some instruction other than the first), */
    617 /*      the handler can decide if/how to handle memoization.  The handler */
    618 /*      should set the PC to the LR, and set arg_z to T. */
     608/*
     609   Interrupt handling (in pc_luser_xp()) notes:
     610   If we are in this function and before the test which follows the
     611   conditional (at egc_store_node_conditional), or at that test
     612   and cr0[eq] is clear, pc_luser_xp() should just let this continue
     613   (we either haven't done the store conditional yet, or got a
     614   possibly transient failure.)  If we're at that test and the
     615   cr0[EQ] bit is set, then the conditional store succeeded and
     616   we have to atomically memoize the possible intergenerational
     617   reference.  Note that the local labels 4 and 5 are at or beyond
     618  'egc_write_barrier_end'
     619
     620   N.B: it's not possible to really understand what's going on just
     621   by the state of the cr0[eq] bit.  A transient failure in the
     622   conditional stores that handle memoization might clear cr0[eq]
     623   without having completed the memoization.
     624*/
    619625
    620626        .globl C(egc_store_node_conditional)
     
    630636        __(bne cr1,3f)
    631637        __(strcx(arg_z,arg_x,imm4))
     638        .globl C(egc_store_node_conditional_test)
     639C(egc_store_node_conditional_test):     
    632640        __(bne 1b)
    633641        __(isync)
     
    651659        __(isync)
    652660        __(b 5f)
     661C(egc_write_barrier_end):
    6536623:      __(li imm0,RESERVATION_DISCHARGE)
    654663        __(strcx(rzero,0,imm0))
    655 C(egc_write_barrier_end):
    6566644:      __(li arg_z,nil_value)
    657665        __(blr)
Note: See TracChangeset for help on using the changeset viewer.