PERFORCE change 93945 for review

John Baldwin jhb at FreeBSD.org
Fri Mar 24 20:43:58 UTC 2006


http://perforce.freebsd.org/chv.cgi?CH=93945

Change 93945 by jhb at jhb_twclab on 2006/03/24 20:43:26

	The volatile cast didn't work on amd64 for some reason (gcc bug?).
	Just make the td_state member of struct thread volatile.

Affected files ...

.. //depot/projects/smpng/sys/kern/kern_mutex.c#120 edit
.. //depot/projects/smpng/sys/sys/proc.h#168 edit

Differences ...

==== //depot/projects/smpng/sys/kern/kern_mutex.c#120 (text+ko) ====

@@ -551,14 +551,8 @@
 		if (m != &Giant && TD_IS_RUNNING(owner)) {
 #endif
 			turnstile_release(&m->mtx_object);
-
-			/*
-			 * Inline expansion of TD_IS_RUNNING(owner) to
-			 * force volatile.
-			 */
 			while (mtx_rawowner(m) == owner &&
-			    (volatile enum _td_state)owner->td_state ==
-			    TDS_RUNNING) {
+			    TD_IS_RUNNING(owner)) {
 				cpu_spinwait();
 			}
 			continue;

==== //depot/projects/smpng/sys/sys/proc.h#168 (text+ko) ====

@@ -311,7 +311,7 @@
  * or already have been set in the allocator, constructor, etc.
  */
 	struct pcb	*td_pcb;	/* (k) Kernel VA of pcb and kstack. */
-	enum _td_state {
+	volatile enum {
 		TDS_INACTIVE = 0x0,
 		TDS_INHIBITED,
 		TDS_CAN_RUN,


More information about the p4-projects mailing list