[Openmcl-cvs-notifications] r10623 - in /trunk/source/lisp-kernel: ppc-exceptions.c ppc-spentry.s
gb at clozure.com
gb at clozure.com
Mon Sep 8 00:06:21 EDT 2008
Author: gb
Date: Mon Sep 8 00:06:21 2008
New Revision: 10623
Log:
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.)
Modified:
trunk/source/lisp-kernel/ppc-exceptions.c
trunk/source/lisp-kernel/ppc-spentry.s
Modified: trunk/source/lisp-kernel/ppc-exceptions.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/lisp-kernel/ppc-exceptions.c (original)
+++ trunk/source/lisp-kernel/ppc-exceptions.c Mon Sep 8 00:06:21 2008
@@ -1831,6 +1831,7 @@
egc_write_barrier_start,
egc_write_barrier_end, =
egc_store_node_conditional, =
+ egc_store_node_conditional_test,
egc_set_hash_key,
egc_gvset,
egc_rplaca,
@@ -1857,17 +1858,19 @@
Boolean need_store =3D true, need_check_memo =3D true, need_memoize_ro=
ot =3D false;
=
if (program_counter >=3D &egc_store_node_conditional) {
- if ((program_counter =3D=3D &egc_store_node_conditional) || ! (xpCCR=
(xp) & 0x20000000)) {
- /* The conditional store either hasn't been attempted yet, or
- has failed. No need to adjust the PC, or do memoization. */
- return;
+ if ((program_counter < &egc_store_node_conditional_test) ||
+ ((program_counter =3D=3D &egc_store_node_conditional_test) &&
+ (! (xpCCR(xp) & 0x20000000)))) {
+ /* The conditional store either hasn't been attempted yet, or
+ has failed. No need to adjust the PC, or do memoization. */
+ return;
}
- val =3D xpGPR(xp,arg_z);
ea =3D (LispObj*)(xpGPR(xp,arg_x) + xpGPR(xp,imm4));
xpGPR(xp,arg_z) =3D t_value;
need_store =3D false;
} else if (program_counter >=3D &egc_set_hash_key) {
root =3D xpGPR(xp,arg_x);
+ val =3D xpGPR(xp,arg_z);
ea =3D (LispObj *) (root+xpGPR(xp,arg_y)+misc_data_offset);
need_memoize_root =3D true;
} else if (program_counter >=3D &egc_gvset) {
Modified: trunk/source/lisp-kernel/ppc-spentry.s
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/lisp-kernel/ppc-spentry.s (original)
+++ trunk/source/lisp-kernel/ppc-spentry.s Mon Sep 8 00:06:21 2008
@@ -605,17 +605,23 @@
__(isync)
__(blr)
=
-/* This is a little trickier: the first instruction clears the EQ bit in C=
R0; */
-/* the only way that it can get set is if the conditional store succeeds. =
*/
-/* So: */
-/* a) if we're interrupted on the first instruction, or if we're */
-/* interrupted on a subsequent instruction but CR0[EQ] is clear, the =
*/
-/* condtional store hasn't succeeded yet. We don't have to adjust th=
e */
-/* PC in this case; when the thread's resumed, the conditional store =
*/
-/* will be (re-)attempted and will eventually either succeed or fail.=
*/
-/* b) if the CR0[EQ] bit is set (on some instruction other than the firs=
t), */
-/* the handler can decide if/how to handle memoization. The handler =
*/
-/* should set the PC to the LR, and set arg_z to T. */
+/*
+ Interrupt handling (in pc_luser_xp()) notes: =
+ If we are in this function and before the test which follows the
+ conditional (at egc_store_node_conditional), or at that test
+ and cr0[eq] is clear, pc_luser_xp() should just let this continue
+ (we either haven't done the store conditional yet, or got a
+ possibly transient failure.) If we're at that test and the
+ cr0[EQ] bit is set, then the conditional store succeeded and
+ we have to atomically memoize the possible intergenerational
+ reference. Note that the local labels 4 and 5 are at or beyond
+ 'egc_write_barrier_end'
+
+ N.B: it's not possible to really understand what's going on just
+ by the state of the cr0[eq] bit. A transient failure in the
+ conditional stores that handle memoization might clear cr0[eq]
+ without having completed the memoization.
+*/
=
.globl C(egc_store_node_conditional)
.globl C(egc_write_barrier_end)
@@ -629,6 +635,8 @@
__(cmpr(cr1,temp1,arg_y))
__(bne cr1,3f)
__(strcx(arg_z,arg_x,imm4))
+ .globl C(egc_store_node_conditional_test)
+C(egc_store_node_conditional_test): =
__(bne 1b)
__(isync)
__(add imm0,imm4,arg_x)
@@ -650,9 +658,9 @@
__(bne- 2b)
__(isync)
__(b 5f)
+C(egc_write_barrier_end):
3: __(li imm0,RESERVATION_DISCHARGE)
__(strcx(rzero,0,imm0))
-C(egc_write_barrier_end):
4: __(li arg_z,nil_value)
__(blr)
5: __(li arg_z,t_value)
More information about the Openmcl-cvs-notifications
mailing list