-#include "IOKit/IOLocks.h"
-#undef super
-#define super IOEventSource
-OSDefineMetaClassAndStructors(IOPMPowerStateQueue, IOEventSource);
-
-#ifndef __ppc__ /* ppc does this right and doesn't need these routines */
-static
-void * OSDequeueAtomic(void * volatile * inList, SInt32 inOffset)
-{
- /* The _pointer_ is volatile, not the listhead itself */
- void * volatile oldListHead;
- void * volatile newListHead;
-
- do {
- oldListHead = *inList;
- if (oldListHead == NULL) {
- break;
- }
-
- newListHead = *(void * volatile *) (((char *) oldListHead) + inOffset);
- } while (! OSCompareAndSwap((UInt32)oldListHead,
- (UInt32)newListHead, (volatile UInt32 *)inList));
- return oldListHead;
-}
-
-static
-void OSEnqueueAtomic(void * volatile * inList, void * inNewLink, SInt32 inOffset)
-{
- /* The _pointer_ is volatile, not the listhead itself */
- void * volatile oldListHead;
- void * volatile newListHead = inNewLink;
- void * volatile * newLinkNextPtr = (void * volatile *) (((char *) inNewLink) + inOffset);
-
- do {
- oldListHead = *inList;
- *newLinkNextPtr = oldListHead;
- } while (! OSCompareAndSwap((UInt32)oldListHead, (UInt32)newListHead,
- (volatile UInt32 *)inList));
-}
-#endif /* ! __ppc__ */