gcc-3.4.patch
Date: Fri Oct  8 12:49:28 CDT 2004
Author: Jeremy Kerr
Title: Allow k42 to be built with gcc 3.4. 
Status: Committed

Index: kitch-linux/lib/emu/semctl.C
===================================================================
RCS file: /u/kitchawa/cvsroot/kitch-linux/lib/emu/semctl.C,v
retrieving revision 1.14
diff -u -r1.14 semctl.C
--- kitch-linux/lib/emu/semctl.C	4 Oct 2004 17:54:36 -0000	1.14
+++ kitch-linux/lib/emu/semctl.C	8 Oct 2004 17:34:18 -0000
@@ -41,7 +41,7 @@
 #undef semctl
     int ret = 0;
     SysStatus rc = 0;
-    union semun *arg;
+    union semun arg;
     va_list ap;
 
 
@@ -49,7 +49,7 @@
 
     // get the optional variables
     va_start (ap, cmd);
-    arg = &va_arg(ap, union semun);
+    arg = va_arg(ap, union semun);
     va_end(ap);
 
     switch (cmd) {
@@ -62,21 +62,21 @@
 	   we copy in and out from the parameter argument.  For
 	   the other commands glibc makes only one type of call
 	   without the IPC_64 flag */
-	rc = StubSysVSemaphores::SemControlIPC(semid, cmd&~IPC_64, arg->buf);
+	rc = StubSysVSemaphores::SemControlIPC(semid, cmd&~IPC_64, arg.buf);
 	break;
     case IPC_RMID:
         rc = StubSysVSemaphores::SemControlRMID(semid);
         break;
     case SEM_STAT|IPC_64:
-	rc = StubSysVSemaphores::SemControlInfo(semid, cmd&~IPC_64, arg->__buf);
+	rc = StubSysVSemaphores::SemControlInfo(semid, cmd&~IPC_64, arg.__buf);
 	break;
     case IPC_INFO:
     case SEM_INFO:
-	rc = StubSysVSemaphores::SemControlInfo(semid, cmd, arg->__buf);
+	rc = StubSysVSemaphores::SemControlInfo(semid, cmd, arg.__buf);
 	break;
 
     case SETVAL:
-	rc = StubSysVSemaphores::SemControlSetVal(semid, semnum, arg->val);
+	rc = StubSysVSemaphores::SemControlSetVal(semid, semnum, arg.val);
 	break;
 
     case GETVAL:
@@ -97,7 +97,7 @@
 
         {
           uval cnt = buf.sem_nsems;
-          rc = StubSysVSemaphores::SemControlArray(semid, cmd, cnt, arg->array);
+          rc = StubSysVSemaphores::SemControlArray(semid, cmd, cnt, arg.array);
         }
 	break;
 
Index: lib/libc/cobj/BaseObj.H
===================================================================
RCS file: /u/kitchawa/cvsroot/kitch-core/lib/libc/cobj/BaseObj.H,v
retrieving revision 1.53
diff -u -r1.53 BaseObj.H
--- lib/libc/cobj/BaseObj.H	31 Dec 2002 19:37:30 -0000	1.53
+++ lib/libc/cobj/BaseObj.H	8 Oct 2004 17:34:18 -0000
@@ -230,7 +230,7 @@
     _TYPE_IMPL(cls,pcls,clsname,signature,)
 
 #define TYPE_IMPL_TEMPLATE(cls,pcls,clsname,signature) \
-    TypeID cls<clsname>::__typeid=0;					     \
+    template<> TypeID cls<clsname>::__typeid=0;				     \
     _TYPE_IMPL(cls <T> ,pcls,clsname cls,signature, template <class T>)
 
 #define _TYPE_IMPL_X(xcls, mcls, prefix) \
Index: lib/libc/cobj/Factory.H
===================================================================
RCS file: /u/kitchawa/cvsroot/kitch-core/lib/libc/cobj/Factory.H,v
retrieving revision 1.1
diff -u -r1.1 Factory.H
--- lib/libc/cobj/Factory.H	16 Aug 2004 22:00:29 -0000	1.1
+++ lib/libc/cobj/Factory.H	8 Oct 2004 17:42:52 -0000
@@ -115,7 +115,8 @@
     };
 
 /* these macros are used to provide a declaration for the static members,
- * the second version adds the typename qualifier, for a templated class */
+ * the second version adds the typename qualifier, needed for a templated
+ * class */
 #define DECLARE_FACTORY_CLASSINIT(FACTORY)                              \
     /* static */ void                                                   \
     FACTORY::ClassInit(VPNum vp)                                        \
@@ -125,6 +126,16 @@
         }                                                               \
     }
 
+#define DECLARE_TEMPLATE_FACTORY_CLASSINIT(FACTORY)                     \
+    /* static */ void                                                   \
+    FACTORY::ClassInit(VPNum vp)                                        \
+    {                                                                   \
+        if (vp == 0) {                                                  \
+            theFactoryRef = (typename FACTORY##Ref)                     \
+                (new Root())->getRef();                                 \
+        }                                                               \
+    }
+
 #define DECLARE_FACTORY_UPDATE(FACTORY)                                 \
     /* static */ SysStatus                                              \
     FACTORY::Update(CORef factoryRef)                                   \
@@ -144,7 +155,7 @@
     template TEMPLATES                                                  \
     typename FACTORY##Ref FACTORY::theFactoryRef(NULL);                 \
     template TEMPLATES                                                  \
-    DECLARE_FACTORY_CLASSINIT(FACTORY)                                  \
+    DECLARE_TEMPLATE_FACTORY_CLASSINIT(FACTORY)                         \
     template TEMPLATES                                                  \
     DECLARE_FACTORY_UPDATE(FACTORY)
 
Index: lib/libc/cobj/missHandlingtest.C
===================================================================
RCS file: /u/kitchawa/cvsroot/kitch-core/lib/libc/cobj/missHandlingtest.C,v
retrieving revision 1.37
diff -u -r1.37 missHandlingtest.C
--- lib/libc/cobj/missHandlingtest.C	11 Jul 2004 21:59:24 -0000	1.37
+++ lib/libc/cobj/missHandlingtest.C	8 Oct 2004 17:34:18 -0000
@@ -1221,8 +1221,8 @@
 };
 
 //TEMPLATEDHASHTABLE(TestHashData,AllocGlobal,TestHashData,AllocGlobal)
-template DHashTable<TestHashData,AllocGlobal>;
-template MasterDHashTable<TestHashData,TestHashData,AllocGlobal,
+template class DHashTable<TestHashData,AllocGlobal>;
+template class MasterDHashTable<TestHashData,TestHashData,AllocGlobal,
     AllocGlobal>;
 
 void
Index: lib/libc/fslib/ServerFileBlock.C
===================================================================
RCS file: /u/kitchawa/cvsroot/kitch-core/lib/libc/fslib/ServerFileBlock.C,v
retrieving revision 1.50
diff -u -r1.50 ServerFileBlock.C
--- lib/libc/fslib/ServerFileBlock.C	5 Oct 2004 21:28:18 -0000	1.50
+++ lib/libc/fslib/ServerFileBlock.C	8 Oct 2004 17:34:18 -0000
@@ -585,5 +585,5 @@
 
 #include <stub/StubFRPA.H>
 #include <stub/StubFRVA.H>
-template ServerFileBlock<StubFRPA>;
-template ServerFileBlock<StubFRVA>;
+template class ServerFileBlock<StubFRPA>;
+template class ServerFileBlock<StubFRVA>;
Index: lib/libc/fslib/virtfs/ServerFileVirtFS.C
===================================================================
RCS file: /u/kitchawa/cvsroot/kitch-core/lib/libc/fslib/virtfs/ServerFileVirtFS.C,v
retrieving revision 1.19
diff -u -r1.19 ServerFileVirtFS.C
--- lib/libc/fslib/virtfs/ServerFileVirtFS.C	2 Oct 2004 19:57:54 -0000	1.19
+++ lib/libc/fslib/virtfs/ServerFileVirtFS.C	8 Oct 2004 17:34:18 -0000
@@ -355,6 +355,6 @@
     return rc;
 }
 
-template ServerFileVirtFSTmp<StubVirtFile>;
-template ServerFileVirtFSTmp<VirtFile>;
-template ServerFileVirtFSTmp<VirtFSFile>;
+template class ServerFileVirtFSTmp<StubVirtFile>;
+template class ServerFileVirtFSTmp<VirtFile>;
+template class ServerFileVirtFSTmp<VirtFSFile>;
Index: lib/libc/io/MemTrans.H
===================================================================
RCS file: /u/kitchawa/cvsroot/kitch-core/lib/libc/io/MemTrans.H,v
retrieving revision 1.21
diff -u -r1.21 MemTrans.H
--- lib/libc/io/MemTrans.H	10 Oct 2002 13:08:17 -0000	1.21
+++ lib/libc/io/MemTrans.H	8 Oct 2004 17:34:18 -0000
@@ -56,6 +56,41 @@
 
     struct ControlRing;
 
+    // Describes memory area of another process which is
+    // associated with this object
+    struct ClientData {
+	DEFINE_GLOBALPADDED_NEW(ClientData);
+	ClientData(ProcessID id):remoteFR(StubObj::UNINITIALIZED),
+				 remoteBase(0),
+				 pid(id),
+				 remoteMT(StubObj::UNINITIALIZED) {
+	    /* empty body */
+	}
+
+	StubFR remoteFR;
+	uval remoteBase;	//Addr where remoteFR mapping exists
+	uval remoteSize;
+	ControlRing *controlRing;
+	ProcessID pid;
+	ObjectHandle givenOH;	//The OH used by the client to get to this obj.
+	StubMemTrans remoteMT;
+	void init(ObjectHandle FR, ObjectHandle MT, uval base, uval size);
+	virtual ~ClientData() { /* empty body */ };
+    };
+    struct ControlRing : public AutoList{
+	DEFINE_NOOP_NEW(ControlRing);
+	FairBLock readLock;
+	FairBLock writeLock;
+	ClientData *cd;
+	uval remote;
+	volatile uval32 localHead;
+	volatile uval32 remoteTail;
+	uval32 size;
+	uval32 lowMark;
+	uval32 highMark;
+	volatile uval data[0];
+    };
+
     // Object for receiving notifications of ring events
     struct MTEvents {
 	DEFINE_GLOBAL_NEW(MTEvents);
@@ -96,49 +131,13 @@
 			   uval size,  MTEvents *handler);
 
 #ifndef _IN_STUBGEN
-    struct ControlRing;
 
-    // Describes memory area of another process which is
-    // associated with this object
-    struct ClientData {
-	DEFINE_GLOBALPADDED_NEW(ClientData);
-	ClientData(ProcessID id):remoteFR(StubObj::UNINITIALIZED),
-				 remoteBase(0),
-				 pid(id),
-				 remoteMT(StubObj::UNINITIALIZED) {
-	    /* empty body */
-	}
-
-	StubFR remoteFR;
-	uval remoteBase;	//Addr where remoteFR mapping exists
-	uval remoteSize;
-	ControlRing *controlRing;
-	ProcessID pid;
-	ObjectHandle givenOH;	//The OH used by the client to get to this obj.
-	StubMemTrans remoteMT;
-	void init(ObjectHandle FR, ObjectHandle MT, uval base, uval size);
-	virtual ~ClientData() { /* empty body */ };
-    };
     static ClientData* clnt(XHandle xhandle);
 
 
-    struct ControlRing : public AutoList{
-	DEFINE_NOOP_NEW(ControlRing);
-	FairBLock readLock;
-	FairBLock writeLock;
-	ClientData *cd;
-	uval remote;
-	volatile uval32 localHead;
-	volatile uval32 remoteTail;
-	uval32 size;
-	uval32 lowMark;
-	uval32 highMark;
-	volatile uval data[0];
-    };
 #else /* #ifndef _IN_STUBGEN */
     struct ControlRing;
 #endif /* #ifndef _IN_STUBGEN */
- protected:
 
     // Information about our local memory area
     uval localBase;
Index: lib/libc/io/PathName.C
===================================================================
RCS file: /u/kitchawa/cvsroot/kitch-core/lib/libc/io/PathName.C,v
retrieving revision 1.55
diff -u -r1.55 PathName.C
--- lib/libc/io/PathName.C	13 Nov 2003 19:12:18 -0000	1.55
+++ lib/libc/io/PathName.C	8 Oct 2004 17:34:18 -0000
@@ -560,9 +560,9 @@
 }
 
 // specific instantiations
-template PathNameDynamic<AllocLocalStrict>;
-template PathNameDynamic<AllocGlobal>;
-template PathNameDynamic<AllocGlobalPadded>;
-template PathNameDynamic<AllocPinnedLocalStrict>;
-template PathNameDynamic<AllocPinnedGlobal>;
-template PathNameDynamic<AllocPinnedGlobalPadded>;
+template class PathNameDynamic<AllocLocalStrict>;
+template class PathNameDynamic<AllocGlobal>;
+template class PathNameDynamic<AllocGlobalPadded>;
+template class PathNameDynamic<AllocPinnedLocalStrict>;
+template class PathNameDynamic<AllocPinnedGlobal>;
+template class PathNameDynamic<AllocPinnedGlobalPadded>;
Index: lib/libc/misc/BitVec.H
===================================================================
RCS file: /u/kitchawa/cvsroot/kitch-core/lib/libc/misc/BitVec.H,v
retrieving revision 1.5
diff -u -r1.5 BitVec.H
--- lib/libc/misc/BitVec.H	12 Oct 2001 20:22:20 -0000	1.5
+++ lib/libc/misc/BitVec.H	8 Oct 2004 17:34:18 -0000
@@ -151,7 +151,7 @@
 	return setSize();
     }
 
-    uval applyMask(const BitVec &mask)
+    void applyMask(const BitVec &mask)
     {
 	for(int i=0; i < NUM_BIT_ELEMENTS(NUMBITS,BITS_PER_ELEMENT); i++ ) {
 	    _elements[i] &= mask._elements[i];
Index: lib/libc/misc/DHashTable.H
===================================================================
RCS file: /u/kitchawa/cvsroot/kitch-core/lib/libc/misc/DHashTable.H,v
retrieving revision 1.16
diff -u -r1.16 DHashTable.H
--- lib/libc/misc/DHashTable.H	3 Dec 2003 18:52:48 -0000	1.16
+++ lib/libc/misc/DHashTable.H	8 Oct 2004 17:34:18 -0000
@@ -184,7 +184,7 @@
 		    e->unlock();
 		    goto retry;
 		}
-		rtnVal = FOUND;
+		rtnVal = DHashTableBase::FOUND;
 	    } else {
 		AllocHashEntry *ne = new AllocHashEntry;
 		ne->init();
@@ -324,7 +324,7 @@
 #ifndef NDEBUG
 //	err_printf("R");
 #endif /* #ifndef NDEBUG */
-	if (requestCount.stop() < 0) return -1;
+	if (this->requestCount.stop() < 0) return -1;
 #ifndef NDEBUG
 	tassert(newLogFactor != 0, ;);
 //	if (newLogFactor > 0) err_printf("+"); else err_printf("-");
@@ -355,7 +355,7 @@
 	}
 	delete[] oldBuckets;
         reSizing=0;
-	requestCount.restart();
+	this->requestCount.restart();
 	return 0;
     }
 
@@ -416,7 +416,7 @@
 
         //FIXME: not sure this is right but to be on the safe side
 //        err_printf("T:");
-        requestCount.shutdown();
+        this->requestCount.shutdown();
         if (buckets) {       
             numBuckets = 1 << log2numBuckets;
             for(uval i=0; i<numBuckets; i++) {
@@ -439,17 +439,17 @@
 
     DATA * lockedFind(uval key) {
 	DHashEntry *e;
-	requestCount.enter();
+	this->requestCount.enter();
         e=countedLockedFind(key);
-	requestCount.leave();
+	this->requestCount.leave();
 	return e->getData();
     }
 
     DATA * findAndLock(uval key) {
 	DHashEntry *e;
-	requestCount.enter();
-	e = countedFindAndLock(key);
-	requestCount.leave();
+	this->requestCount.enter();
+	e = this->countedFindAndLock(key);
+	this->requestCount.leave();
 	if (e) {
 	    return e->getData();
 	} else {
@@ -458,7 +458,7 @@
     }
 
     void print() {
-	requestCount.enter();
+	this->requestCount.enter();
 	err_printf("HashTable: log2numBuckets=%ld numValues=%ld:\n",
 		   log2numBuckets, numValues);
 	for (uval i=0; i<((uval)(1 << log2numBuckets)); i++) {
@@ -467,7 +467,7 @@
 		buckets[i].print();
 	    }
 	}
-	requestCount.leave();
+	this->requestCount.leave();
     }
     DHashTable(uval numEntries,uval minEntries) :
 	DHashTableBase(numEntries,minEntries) {
@@ -500,9 +500,9 @@
 					 uval noResize=0) {
 	DHashEntry *e;
 	HashBucket *b;
-	requestCount.enter();
+	this->requestCount.enter();
     retry:
-	b=findBucket(key);
+	b=this->findBucket(key);
 	e=b->find(key);
 	if (e) {
 	    // Local Hit (Maybe)
@@ -510,9 +510,9 @@
 	    if (e->match(key)) {
 		// FIXME:  We can now probably dec ref count here as we
 		//         are seperately allocating enteries
-		requestCount.leave();
+		this->requestCount.leave();
 		*ld = e->getData();
-		return FOUND;    // confirm hit
+		return DHashTableBase::FOUND;    // confirm hit
 	    } else {
 		// OOPS something changed e is nolonger what we wanted unlock
 		// and retry
@@ -521,7 +521,7 @@
 	    }
 	} else {
 	    // Local Miss
-	    requestCount.leave();
+	    this->requestCount.leave();
 	    // Must try Global table
 	    // cast is necessary to account for possible difference in
 	    // allocation type of master and local entry
@@ -530,17 +530,17 @@
 	    DHashTableBase::AllocateStatus mStat=
 		masterDHashTable->findOrAllocateAndLock(key,&md);
 
-	    requestCount.enter();
-	    b=findBucket(key);
+	    this->requestCount.enter();
+	    b=this->findBucket(key);
 	    DHashTableBase::AllocateStatus lStat=
 		b->findOrAllocateAndLock(key,&e);
-	    requestCount.leave();
+	    this->requestCount.leave();
 
-	    if (lStat == ALLOCATED) {
-		FetchAndAdd(&numValues,1);
+	    if (lStat == this->ALLOCATED) {
+		FetchAndAdd(&this->numValues,1);
 		md->replicateToLocal(Scheduler::GetVP(), e->getData());
 		if (!noResize) {
-		    (void)checkResize();
+		    (void)this->checkResize();
 		}
 		tassert(e->match(key), ;);
 	    }
@@ -552,43 +552,43 @@
 
     void emptyData(LDATA *ld, DHashTableBase::OpArg emptyArg) {
 	ld->setEmpty(emptyArg);
-	FetchAndAdd(&numValues,-1);
+	FetchAndAdd(&this->numValues,-1);
     }
 
     DHashTableBase::OpStatus doOp(uval key, LOP lo, DHashTableBase::OpArg oa, 
 				  DHashTableBase::OpDirective od) {
-	requestCount.enter();
+	this->requestCount.enter();
 	HashBucket *b;
 	DHashEntry *le;
         LDATA *ld;
 	DHashTableBase::OpStatus stat;
 
-	if (od == LOCKONEATATIME) {
-	    le = countedFindAndLock(key);
+	if (od == DHashTableBase::LOCKONEATATIME) {
+	    le = this->countedFindAndLock(key);
 	} else {
-	    b = findBucket(key);
+	    b = this->findBucket(key);
 	    le = b->find(key);
 	}
 	if (le == 0) {
-	    requestCount.leave();
+	    this->requestCount.leave();
 	    tassert(0, ;);
-	    return FAILURE;
+	    return DHashTableBase::FAILURE;
 	}
 	ld=le->getData();
-	if ((ld->*lo)(oa) == FAILURE) {
-	    stat = FAILURE;
+	if ((ld->*lo)(oa) == DHashTableBase::FAILURE) {
+	    stat = DHashTableBase::FAILURE;
 	} else {
-	    stat = SUCCESS;
+	    stat = DHashTableBase::SUCCESS;
 	}
 
-	if (od == LOCKONEATATIME) le->unlock();
+	if (od == DHashTableBase::LOCKONEATATIME) le->unlock();
 
-	requestCount.leave();
+	this->requestCount.leave();
 	return stat;
     }
 
-    LocalDHashTable(uval numEntries=INITNUMENTRIES,
-                    uval minEntries=INITNUMENTRIES) :
+    LocalDHashTable(uval numEntries=DHashTableBase::INITNUMENTRIES,
+                    uval minEntries=DHashTableBase::INITNUMENTRIES) :
 	DHashTable<LDATA,LALLOC>(numEntries,minEntries) { masterDHashTable=0; }
 };
 
@@ -629,13 +629,13 @@
 					      DHashTableBase::OpArg oa,
 					      DHashTableBase::OpDirective od) {
 	LocalDHashTable<LDATA,MDATA,LALLOC,MALLOC> *lt;
-	DHashTableBase::OpStatus stat = SUCCESS;
+	DHashTableBase::OpStatus stat = DHashTableBase::SUCCESS;
 	for (VPNum vp = md->firstReplica(); vp != Scheduler::VPLimit;
 	     vp = md->nextReplica(vp)) {
 	    lt = localTables[vp];
 	    tassert(lt!=0, err_printf("huh no ltable on vp=%ld\n",vp));
-	    if (lt->doOp(key,lo,oa,od) == FAILURE) {
-		stat = FAILURE;
+	    if (lt->doOp(key,lo,oa,od) == DHashTableBase::FAILURE) {
+		stat = DHashTableBase::FAILURE;
 	    }
 	}
 	return stat;
@@ -674,16 +674,16 @@
 	DHashEntry *e;
 	HashBucket *b;
 
-	requestCount.enter();
-	b=findBucket(key);
+	this->requestCount.enter();
+	b=this->findBucket(key);
 	DHashTableBase::AllocateStatus aStat = b->findOrAllocateAndLock(key, 
 									&e);
-	requestCount.leave();
+	this->requestCount.leave();
 
-	if (aStat == ALLOCATED) {
-	    FetchAndAdd(&numValues,1);
+	if (aStat == DHashTableBase::ALLOCATED) {
+	    FetchAndAdd(&this->numValues,1);
 	    if (!noResize) {
-		(void)checkResize();
+		(void)this->checkResize();
 	    }
 	    tassert(e->match(key), ;);
 	}
@@ -692,11 +692,11 @@
     }
 
     void addReference() {
-        requestCount.enter();
+        this->requestCount.enter();
     }
 
     void removeReference() {
-        requestCount.leave();
+        this->requestCount.leave();
         //FIXME:  ideally we should probably check for resize here
         //        but due to our desire to keep deallocations local
         //        we don't.  Better think about this in general.
@@ -709,10 +709,10 @@
 	DHashEntry *me;
 
 	if (curr == 0) {
-	    me = getFirst();
+	    me = this->getFirst();
 	} else {
 	    me = (DHashEntry *)curr;
-	    me = getNext(me);
+	    me = this->getNext(me);
 	}
 
 	for ( ; me != 0; me = getNext(me)) {
@@ -738,10 +738,10 @@
 	DHashEntry *me;
 
 	if (curr == 0) {
-	    me = getFirst();
+	    me = this->getFirst();
 	} else {
 	    me = (DHashEntry *)curr;
-	    me = getNext(me);
+	    me = this->getNext(me);
 	}
 
 	for ( ; me != 0; me = getNext(me)) {
@@ -797,7 +797,7 @@
 
     void emptyData(MDATA *md, DHashTableBase::OpArg emptyArg) {
         md->setEmpty(emptyArg);
-    	FetchAndAdd(&numValues,-1);
+    	FetchAndAdd(&this->numValues,-1);
     }
 
 
@@ -818,12 +818,12 @@
 
     // Assumes the md is locked but replicas are not.
     SysStatus startEmpty(MDATA *md, EmptyContinuation *ec) {
-	requestCount.enter();
+	this->requestCount.enter();
 	tassert(md!=0, ;);
 	tassert(md->isLocked(), ;);
 	if (md->isEmpty()) {
 	    tassert(0, err_printf("hmmm does this really make sense\n"));
-	    requestCount.leave();
+	    this->requestCount.leave();
 	    return -1;
 	}
 	buildEmptyContinuation(md, ec);
@@ -834,17 +834,17 @@
 	DHashEntry *me;
         MDATA *md;
 
-	requestCount.enter();
-	me = countedFindAndLock(key);
+	this->requestCount.enter();
+	me = this->countedFindAndLock(key);
 	if (me == 0) {
-	    requestCount.leave();
+	    this->requestCount.leave();
 	    return -1;
 	}
 	md=me->getData();
 
 	if (md->isEmpty()) {
 	    md->unlock();
-	    requestCount.leave();
+	    this->requestCount.leave();
 	    return -1;
 	}
 	buildEmptyContinuation(md, ec);
@@ -885,7 +885,7 @@
 	emptyData(md, emptyArg);
 
 	md->unlock();
-	requestCount.leave();
+	this->requestCount.leave();
 
 	return 0;
     }
@@ -919,53 +919,59 @@
     DHashTableBase::OpStatus doOp(uval key, MOP mo, LOP lo, 
 				  DHashTableBase::OpArg oa,
 				  LDATA *keepThisLeLocked=0,
-				  DHashTableBase::OpDirective od=LOCKALL) {
-	requestCount.enter();
+				  DHashTableBase::OpDirective od
+				      =DHashTableBase::LOCKALL) {
+	this->requestCount.enter();
 	  DHashEntry *me;
           MDATA *md;
-	  DHashTableBase::OpStatus stat = SUCCESS;
+	  DHashTableBase::OpStatus stat = DHashTableBase::SUCCESS;
 
-	  me = countedFindAndLock(key);
+	  me = this->countedFindAndLock(key);
 	  if (me == 0) {
-	      requestCount.leave();
-	      return FAILURE;
+	      this->requestCount.leave();
+	      return DHashTableBase::FAILURE;
   	  }
 	  md=me->getData();
-	  if (od == LOCKALL) lockAllReplicas(md);
-	    if (mo!=0 && (md->*mo)(oa) == FAILURE) {
-	        stat = FAILURE;
+	  if (od == DHashTableBase::LOCKALL) lockAllReplicas(md);
+	    if (mo!=0 && (md->*mo)(oa) == DHashTableBase::FAILURE) {
+	        stat = DHashTableBase::FAILURE;
 	    } else {
-	        if (lockedDoLocalOPs(key, md, lo, oa, od) == FAILURE) {
-		    stat = LOCALFAILURE;
+	        if (lockedDoLocalOPs(key, md, lo, oa, od) ==
+                    DHashTableBase::FAILURE) {
+		        stat = DHashTableBase::LOCALFAILURE;
 	        }
 	    }
-	  if (od == LOCKALL) unlockAllReplicas(md,keepThisLeLocked);
+	  if (od == DHashTableBase::LOCKALL) {
+	      unlockAllReplicas(md,keepThisLeLocked);
+	  }
 	  me->unlock();
-	requestCount.leave();
+	this->requestCount.leave();
 	return stat;
     }
 
-    DHashTableBase::OpStatus doOp(MDATA *md, LOP lo, DHashTableBase::OpArg oa, 
-				  DHashTableBase::OpDirective od=LOCKALL) {
-	requestCount.enter();
-	DHashTableBase::OpStatus stat = SUCCESS;
+    DHashTableBase::OpStatus doOp(MDATA *md, LOP lo, DHashTableBase::OpArg oa,
+				  DHashTableBase::OpDirective od
+				      =DHashTableBase::LOCKALL) {
+	this->requestCount.enter();
+	DHashTableBase::OpStatus stat = DHashTableBase::SUCCESS;
 
 	  tassert(md!=NULL, ;);
 
-	  if (od == LOCKALL) lockAllReplicas(md);
-             if (lockedDoLocalOPs(md->getKey(), md, lo, oa, od) == FAILURE) {
-		    stat = LOCALFAILURE;
+	  if (od == DHashTableBase::LOCKALL) lockAllReplicas(md);
+             if (lockedDoLocalOPs(md->getKey(), md, lo, oa, od) ==
+                     DHashTableBase::FAILURE) {
+		    stat = DHashTableBase::LOCALFAILURE;
 	        }
-	  if (od == LOCKALL) unlockAllReplicas(md);
-	requestCount.leave();
+	  if (od == DHashTableBase::LOCKALL) unlockAllReplicas(md);
+	this->requestCount.leave();
 	return stat;
     }
 
     void doOPAll(MOP mo, LOP lo, DHashTableBase::OpArg oa) {
 	MDATA *md;
 
-	requestCount.enter();
-	for (DHashEntry *me = getFirst();
+	this->requestCount.enter();
+	for (DHashEntry *me = this->getFirst();
 	     me != 0;
 	     me = getNext(me)) {
   	    me->lock();
@@ -976,20 +982,21 @@
 	      md=me->getData();
 	      lockAllReplicas(md);
 
-	        if (mo!=0 && (md->*mo)(oa) == FAILURE) {
+	        if (mo!=0 && (md->*mo)(oa) == DHashTableBase::FAILURE) {
 		    me->unlock();
 		    continue;
 	        }
 
-	        (void)lockedDoLocalOPs(md->getKey(), md, lo, oa, LOCKNONE);
+	        (void)lockedDoLocalOPs(md->getKey(), md, lo, oa,
+                                   DHashTableBase::LOCKNONE);
 	      unlockAllReplicas(md,0);
 	    me->unlock();
 	}
-	requestCount.leave();
+	this->requestCount.leave();
     }
 
-    MasterDHashTable(uval numEntries=INITNUMENTRIES,
-                     uval minEntries=INITNUMENTRIES) :
+    MasterDHashTable(uval numEntries=DHashTableBase::INITNUMENTRIES,
+                     uval minEntries=DHashTableBase::INITNUMENTRIES) :
 	    DHashTable<MDATA,MALLOC>(numEntries,minEntries) {
 	for (VPNum vp = 0; vp < Scheduler::VPLimit; vp++) {
 	    localTables[vp] = 0;
@@ -999,8 +1006,8 @@
 
 
 #define TEMPLATEDHASHTABLE(MD,MA,LD,LA)                           \
-template DHashTable<MD,MA>;                                       \
-template DHashTable<LD,LA>;                                       \
+template class DHashTable<MD,MA>;                                 \
+template class DHashTable<LD,LA>;                                 \
 template class MasterDHashTable<MD,LD,MA,LA>;                     \
 template class LocalDHashTable<LD,MD,LA,MA>;
 
Index: lib/libc/misc/HashSimple.C
===================================================================
RCS file: /u/kitchawa/cvsroot/kitch-core/lib/libc/misc/HashSimple.C,v
retrieving revision 1.13
diff -u -r1.13 HashSimple.C
--- lib/libc/misc/HashSimple.C	16 Mar 2003 16:33:02 -0000	1.13
+++ lib/libc/misc/HashSimple.C	8 Oct 2004 17:34:18 -0000
@@ -497,11 +497,11 @@
 }
 
 
-template HashSimpleBase<AllocGlobalPadded, LOG_PAGE_SIZE>;
-template HashSimpleBase<AllocGlobal, 0>;
-template HashSimpleLockedBase<AllocGlobal, 0>;
-template HashSimpleBase<AllocPinnedGlobal, LOG_PAGE_SIZE>;
-template HashSimpleLockedBase<AllocPinnedGlobal, LOG_PAGE_SIZE>;
-template HashSimpleBase<AllocGlobal, 4>;
-template HashSimpleBase<AllocGlobal, LOG_PAGE_SIZE>;
-template HashSimple<uval, uval, AllocGlobal, 4>;
+template class HashSimpleBase<AllocGlobalPadded, LOG_PAGE_SIZE>;
+template class HashSimpleBase<AllocGlobal, 0>;
+template class HashSimpleLockedBase<AllocGlobal, 0>;
+template class HashSimpleBase<AllocPinnedGlobal, LOG_PAGE_SIZE>;
+template class HashSimpleLockedBase<AllocPinnedGlobal, LOG_PAGE_SIZE>;
+template class HashSimpleBase<AllocGlobal, 4>;
+template class HashSimpleBase<AllocGlobal, LOG_PAGE_SIZE>;
+template class HashSimple<uval, uval, AllocGlobal, 4>;
Index: lib/libc/misc/ListSimple.C
===================================================================
RCS file: /u/kitchawa/cvsroot/kitch-core/lib/libc/misc/ListSimple.C,v
retrieving revision 1.22
diff -u -r1.22 ListSimple.C
--- lib/libc/misc/ListSimple.C	14 Aug 2001 20:46:27 -0000	1.22
+++ lib/libc/misc/ListSimple.C	8 Oct 2004 17:34:18 -0000
@@ -190,9 +190,9 @@
 }
 
 // specific instantiations
-template ListSimpleBase<AllocLocalStrict>;
-template ListSimpleBase<AllocGlobal>;
-template ListSimpleBase<AllocGlobalPadded>;
-template ListSimpleBase<AllocPinnedLocalStrict>;
-template ListSimpleBase<AllocPinnedGlobal>;
-template ListSimpleBase<AllocPinnedGlobalPadded>;
+template class ListSimpleBase<AllocLocalStrict>;
+template class ListSimpleBase<AllocGlobal>;
+template class ListSimpleBase<AllocGlobalPadded>;
+template class ListSimpleBase<AllocPinnedLocalStrict>;
+template class ListSimpleBase<AllocPinnedGlobal>;
+template class ListSimpleBase<AllocPinnedGlobalPadded>;
Index: lib/libc/misc/ListSimpleKey.C
===================================================================
RCS file: /u/kitchawa/cvsroot/kitch-core/lib/libc/misc/ListSimpleKey.C,v
retrieving revision 1.16
diff -u -r1.16 ListSimpleKey.C
--- lib/libc/misc/ListSimpleKey.C	7 Jun 2001 15:19:30 -0000	1.16
+++ lib/libc/misc/ListSimpleKey.C	8 Oct 2004 17:34:18 -0000
@@ -212,25 +212,25 @@
 ListSimpleKeyLockedBase<ALLOC>::getHead(uval &key, uval &datum)
 {
     AutoLock<BLock> al(&lock);	// locks now, unlocks on return
-    if(head) {
-	key   = head->key;
-	datum = head->datum;
+    if(this->head) {
+	key   = this->head->key;
+	datum = this->head->datum;
 	return 1;
     }
     return 0;
 }
 
 // specific instantiations
-template ListSimpleKeyBase<AllocLocalStrict>;
-template ListSimpleKeyBase<AllocGlobal>;
-template ListSimpleKeyBase<AllocGlobalPadded>;
-template ListSimpleKeyBase<AllocPinnedLocalStrict>;
-template ListSimpleKeyBase<AllocPinnedGlobal>;
-template ListSimpleKeyBase<AllocPinnedGlobalPadded>;
+template class ListSimpleKeyBase<AllocLocalStrict>;
+template class ListSimpleKeyBase<AllocGlobal>;
+template class ListSimpleKeyBase<AllocGlobalPadded>;
+template class ListSimpleKeyBase<AllocPinnedLocalStrict>;
+template class ListSimpleKeyBase<AllocPinnedGlobal>;
+template class ListSimpleKeyBase<AllocPinnedGlobalPadded>;
 
-template ListSimpleKeyLockedBase<AllocLocalStrict>;
-template ListSimpleKeyLockedBase<AllocGlobal>;
-template ListSimpleKeyLockedBase<AllocGlobalPadded>;
-template ListSimpleKeyLockedBase<AllocPinnedLocalStrict>;
-template ListSimpleKeyLockedBase<AllocPinnedGlobal>;
-template ListSimpleKeyLockedBase<AllocPinnedGlobalPadded>;
+template class ListSimpleKeyLockedBase<AllocLocalStrict>;
+template class ListSimpleKeyLockedBase<AllocGlobal>;
+template class ListSimpleKeyLockedBase<AllocGlobalPadded>;
+template class ListSimpleKeyLockedBase<AllocPinnedLocalStrict>;
+template class ListSimpleKeyLockedBase<AllocPinnedGlobal>;
+template class ListSimpleKeyLockedBase<AllocPinnedGlobalPadded>;
Index: lib/libc/misc/ListSimpleLocked.H
===================================================================
RCS file: /u/kitchawa/cvsroot/kitch-core/lib/libc/misc/ListSimpleLocked.H,v
retrieving revision 1.23
diff -u -r1.23 ListSimpleLocked.H
--- lib/libc/misc/ListSimpleLocked.H	16 Aug 2004 16:55:31 -0000	1.23
+++ lib/libc/misc/ListSimpleLocked.H	8 Oct 2004 17:34:18 -0000
@@ -91,8 +91,8 @@
 {
     int rc = 0;
     lock.acquire();
-    if (head) {
-	datum = head->datum;
+    if (this->head) {
+	datum = this->head->datum;
 	rc = 1;
     }
     lock.release();
@@ -113,7 +113,7 @@
     void releaseLock()		{ lock.release(); }
 
     // true if list is empty
-    uval isEmpty() { if (head) return 0; return 1; }
+    uval isEmpty() { if (this->head) return 0; return 1; }
 };
 
 template<class T, class ALLOC> class ListSimpleLocked :
Index: lib/libc/misc/SSACSimplePartitionedArray.C
===================================================================
RCS file: /u/kitchawa/cvsroot/kitch-core/lib/libc/misc/SSACSimplePartitionedArray.C,v
retrieving revision 1.11
diff -u -r1.11 SSACSimplePartitionedArray.C
--- lib/libc/misc/SSACSimplePartitionedArray.C	11 Jul 2002 17:13:02 -0000	1.11
+++ lib/libc/misc/SSACSimplePartitionedArray.C	8 Oct 2004 17:34:18 -0000
@@ -341,7 +341,7 @@
 	    hashq->rollover();
 	}
 	ce->setLastUsed(hashq->count);
-	if (type == GETLOCKED) {
+	if (type == this->GETLOCKED) {
 	    ce->setBusy();
 	}
 	hashq->lock.release();
@@ -375,7 +375,7 @@
 	    hashq->rollover();
 	}
 	ce->setLastUsed(hashq->count);
-	if (type == GETLOCKED) {
+	if (type == SSAC<CACHEENTRY,CACHEID,MYCO>::GETLOCKED) {
 	    ce->setBusy();
 	}
 	hashq->lock.release();
@@ -424,7 +424,7 @@
     //         the cache entries on the que identified
 
     // Do real work of updating the cache entry and unlocking it.
-    if (flag == KEEP) {
+    if (flag == SSAC<CACHEENTRY,CACHEID,MYCO>::KEEP) {
     	ce->setLastUsed(hashq->count);
     } else {
 	ce->setLastUsed(0);
Index: lib/libc/misc/SSACSimplePartitionedArray.H
===================================================================
RCS file: /u/kitchawa/cvsroot/kitch-core/lib/libc/misc/SSACSimplePartitionedArray.H,v
retrieving revision 1.12
diff -u -r1.12 SSACSimplePartitionedArray.H
--- lib/libc/misc/SSACSimplePartitionedArray.H	11 Jul 2002 17:13:02 -0000	1.12
+++ lib/libc/misc/SSACSimplePartitionedArray.H	8 Oct 2004 17:34:18 -0000
@@ -86,7 +86,7 @@
 	void rollover();
 	HashQueues();
 	~HashQueues();
-	DEFINE_LOCALSTRICT_NEW(SSACSimplePartitionedArray::HashQueues);
+	DEFINE_LOCALSTRICT_NEW(typename SSACSimplePartitionedArray::HashQueues);
     } *hashqs;
 
     struct hashqInitMsg { struct HashQueues *hq; uval nentries; };
@@ -122,17 +122,19 @@
 			       const uval assoc);
 
     SysStatus get(MYCO *myco, const CACHEID &id, CACHEENTRY* &ce,
-		  const Gettype &type=GETUNLOCKED);
+		  const Gettype &type
+		      =(SSAC<CACHEENTRY,CACHEID,MYCO>::GETUNLOCKED));
 
     SysStatus insertPageDesc(MYCO *myco, const CACHEID &id,
 			     CACHEENTRY* &ce);
 
     SysStatus getAndLock(MYCO *myco, const CACHEID &id, CACHEENTRY* &ce) {
-	return get(myco, id,ce,GETLOCKED);
+	return get(myco, id,ce,SSAC<CACHEENTRY,CACHEID,MYCO>::GETLOCKED);
     }
 
     SysStatus putbackAndUnlock(MYCO *myco, CACHEENTRY* ce,
-			       const Putflag &flag=KEEP);
+			       const Putflag &flag
+			           =(SSAC<CACHEENTRY,CACHEID,MYCO>::KEEP));
 
 #if 0
     SysStatus flush(MYCO *myco);
Index: lib/libc/scheduler/arch/powerpc/DispatcherDefaultAsm.S
===================================================================
RCS file: /u/kitchawa/cvsroot/kitch-core/lib/libc/scheduler/arch/powerpc/DispatcherDefaultAsm.S,v
retrieving revision 1.129
diff -u -r1.129 DispatcherDefaultAsm.S
--- lib/libc/scheduler/arch/powerpc/DispatcherDefaultAsm.S	16 Sep 2004 21:05:19 -0000	1.129
+++ lib/libc/scheduler/arch/powerpc/DispatcherDefaultAsm.S	8 Oct 2004 17:34:19 -0000
@@ -1302,7 +1302,7 @@
  * r3-r8 contain the system call arguments.  r9 and r10 are available.
  */
 CODE_ENTRY(DispatcherDefault_SVCEntry)
-#define SVC_STK_SIZE (-STK_FLOOR+STK_SIZE+(3*8)) // interrupt frame /w 3 slots
+#define SVC_STK_SIZE (STK_SIZE-STK_FLOOR+(3*8)) // interrupt frame /w 3 slots
 	LOAD_FPSCR(r12,f0)
 	ld	r10,DD_sandboxShepherd(r12)	// r10 = shepherd
 	cmpldi	r10,0				// if (shepherd is NULL)
Index: lib/libc/sync/RecLock.H
===================================================================
RCS file: /u/kitchawa/cvsroot/kitch-core/lib/libc/sync/RecLock.H,v
retrieving revision 1.4
diff -u -r1.4 RecLock.H
--- lib/libc/sync/RecLock.H	5 Oct 2001 21:48:22 -0000	1.4
+++ lib/libc/sync/RecLock.H	8 Oct 2004 17:34:19 -0000
@@ -58,7 +58,7 @@
 	if (Scheduler::GetCurThreadPtr() == _owner) {
 	    return 1;
 	}
-	return writerLock.tryAcquire();
+	return this->writerLock.tryAcquire();
     }
 };
 
@@ -106,7 +106,7 @@
 	    ++count;
 	    return 1;
 	}
-	return writerLock.tryAcquire();
+	return this->writerLock.tryAcquire();
     }
 };
 
Index: lib/libc/sys/ProcessSet.C
===================================================================
RCS file: /u/kitchawa/cvsroot/kitch-core/lib/libc/sys/ProcessSet.C,v
retrieving revision 1.14
diff -u -r1.14 ProcessSet.C
--- lib/libc/sys/ProcessSet.C	13 May 2002 23:45:24 -0000	1.14
+++ lib/libc/sys/ProcessSet.C	8 Oct 2004 17:34:19 -0000
@@ -17,9 +17,9 @@
 #include "ProcessSet.H"
 #include <misc/HashNonBlocking.I>
 
-template HashSNBBase<AllocGlobal,0, ProcessSet::defNumPid>;
-template HashNonBlockingBase<AllocGlobal,
+template class HashSNBBase<AllocGlobal,0, ProcessSet::defNumPid>;
+template class HashNonBlockingBase<AllocGlobal,
     HashSNBBase<AllocGlobal, 0, ProcessSet::defNumPid>::
     HashSNBNode, ProcessSet::defNumPid>;
-template HashSimpleNonBlocking<ProcessID,
+template class HashSimpleNonBlocking<ProcessID,
     BaseProcessRef, AllocGlobal, 0, ProcessSet::defNumPid>;
Index: lib/libc/usr/arch/powerpc/ProgExecArch.C
===================================================================
RCS file: /u/kitchawa/cvsroot/kitch-core/lib/libc/usr/arch/powerpc/ProgExecArch.C,v
retrieving revision 1.7
diff -u -r1.7 ProgExecArch.C
--- lib/libc/usr/arch/powerpc/ProgExecArch.C	8 Jul 2004 17:15:33 -0000	1.7
+++ lib/libc/usr/arch/powerpc/ProgExecArch.C	8 Oct 2004 17:34:19 -0000
@@ -41,8 +41,8 @@
 {
     EXECTYPE exectype;
     memTop -= (2 * sizeof(WORDTYPE));
-    ((WORDTYPE *) memTop)[0] = WORDTYPE(type);
-    ((WORDTYPE *) memTop)[1] = WORDTYPE(val);
+    ((WORDTYPE *) memTop)[0] = (WORDTYPE)(type);
+    ((WORDTYPE *) memTop)[1] = (WORDTYPE)(val);
 }
 
 template<typename EXECTYPE>
@@ -333,7 +333,7 @@
 
     stackTopLocal -= sizeof(WORDTYPE);
     stackTop -= sizeof(WORDTYPE);
-    *(WORDTYPE*)stackTopLocal = WORDTYPE(argcChild-1); //store argc on stack
+    *(WORDTYPE*)stackTopLocal = (WORDTYPE)(argcChild-1); //store argc on stack
     info->argc = argcChild-1;
 
     __stackTopLocal = stackTopLocal;
Index: lib/lk/Memory.C
===================================================================
RCS file: /u/kitchawa/cvsroot/kitch-core/lib/lk/Memory.C,v
retrieving revision 1.20
diff -u -r1.20 Memory.C
--- lib/lk/Memory.C	5 Jun 2004 19:39:33 -0000	1.20
+++ lib/lk/Memory.C	8 Oct 2004 17:34:19 -0000
@@ -279,4 +279,4 @@
 } // extern "C"
 
 #include <misc/HashNonBlocking.I>
-template HashNonBlockingBase<AllocPinnedGlobalPadded, MemoryHashNode, 2>;
+template class HashNonBlockingBase<AllocPinnedGlobalPadded, MemoryHashNode, 2>;
Index: os/boot/arch/powerpc/main.c
===================================================================
RCS file: /u/kitchawa/cvsroot/kitch-core/os/boot/arch/powerpc/main.c,v
retrieving revision 1.93
diff -u -r1.93 main.c
--- os/boot/arch/powerpc/main.c	13 Jul 2004 20:50:35 -0000	1.93
+++ os/boot/arch/powerpc/main.c	8 Oct 2004 17:34:19 -0000
@@ -1788,8 +1788,13 @@
 	PF_W = (1 << 1),
 	PF_R = (1 << 2),
 	PF_ALL = (PF_X | PF_W | PF_R),
-	PT_LOAD = 1
     };
+
+    enum {
+	PT_LOAD = 1,
+	PT_GNU_STACK = 0x60000000 + 0x474e551
+    };
+
     struct elf64_hdr *e64 = (struct elf64_hdr *)(uval32)kernStartAddr;
     struct elf64_phdr *phdr;
     int i;
@@ -1805,8 +1810,9 @@
     phdr = (struct elf64_phdr *)(uval32)((uval)e64 + e64->e_phoff);
 
     // We know that the order is text, data that includes bss
-    if (e64->e_phnum > 2) {
-	b1printf("ERROR: to many ELF segments",(uval64) e64->e_phnum);
+    // Increased to 3: new toolchains add a zero-size GNU_STACK section
+    if (e64->e_phnum > 3) {
+	b1printf("ERROR: too many ELF segments: ",(uval64) e64->e_phnum);
 	return 0;
     }
 
@@ -1847,6 +1853,11 @@
 		    return 0;
 		}
 	    }
+	} else if (phdr[i].p_type == PT_GNU_STACK) {
+	    /* We have a GNU_STACK segment - if we want to implement NX pages,
+	     * turn on here */
+	    bprintf("Found a GNU_STACK segment");
+	    
 	}
     }
     return 1;
Index: os/kernel/mem/FCMCommon.C
===================================================================
RCS file: /u/kitchawa/cvsroot/kitch-core/os/kernel/mem/FCMCommon.C,v
retrieving revision 1.121
diff -u -r1.121 FCMCommon.C
--- os/kernel/mem/FCMCommon.C	11 Jul 2004 21:59:27 -0000	1.121
+++ os/kernel/mem/FCMCommon.C	8 Oct 2004 17:34:19 -0000
@@ -1051,10 +1051,12 @@
 }
 
 //template instantiation
-template FCMCommon<PageSet<AllocGlobal>,AllocGlobal>;
-template FCMCommon<PageSet<AllocPinnedGlobal>,AllocPinnedGlobal>;
-template FCMCommon<PageSet<AllocPinnedGlobalPadded>,AllocPinnedGlobalPadded>;
-template FCMCommon<PageList<AllocGlobal>,AllocGlobal>;
-template FCMCommon<PageList<AllocPinnedGlobal>,AllocPinnedGlobal>;
-template FCMCommon<PageList<AllocPinnedGlobalPadded>,AllocPinnedGlobalPadded>;
-template FCMCommon<PageSetDense,AllocGlobal>;
+template class FCMCommon<PageSet<AllocGlobal>,AllocGlobal>;
+template class FCMCommon<PageSet<AllocPinnedGlobal>,AllocPinnedGlobal>;
+template class FCMCommon<PageSet<AllocPinnedGlobalPadded>,
+			 AllocPinnedGlobalPadded>;
+template class FCMCommon<PageList<AllocGlobal>,AllocGlobal>;
+template class FCMCommon<PageList<AllocPinnedGlobal>,AllocPinnedGlobal>;
+template class FCMCommon<PageList<AllocPinnedGlobalPadded>,
+			 AllocPinnedGlobalPadded>;
+template class FCMCommon<PageSetDense,AllocGlobal>;
Index: os/kernel/mem/FCMCommonMultiRep.C
===================================================================
RCS file: /u/kitchawa/cvsroot/kitch-core/os/kernel/mem/FCMCommonMultiRep.C,v
retrieving revision 1.14
diff -u -r1.14 FCMCommonMultiRep.C
--- os/kernel/mem/FCMCommonMultiRep.C	23 Jan 2004 19:50:27 -0000	1.14
+++ os/kernel/mem/FCMCommonMultiRep.C	8 Oct 2004 17:34:19 -0000
@@ -208,9 +208,11 @@
 }
 
 //template instantiation
-template FCMCommonMultiRep<CObjRootMultiRep,AllocGlobalPadded,AllocLocalStrict>;
-template FCMCommonMultiRep<CObjRootMultiRepPinned,
-                           AllocPinnedGlobalPadded,AllocPinnedLocalStrict>;
+template class FCMCommonMultiRep<CObjRootMultiRep, AllocGlobalPadded,
+				 AllocLocalStrict>;
+template class FCMCommonMultiRep<CObjRootMultiRepPinned,
+				 AllocPinnedGlobalPadded,
+				 AllocPinnedLocalStrict>;
 
 TEMPLATEDHASHTABLE(MasterPageDescData,AllocGlobalPadded,
 		   LocalPageDescData,AllocLocalStrict)
Index: os/kernel/mem/FCMCommonMultiRepRoot.C
===================================================================
RCS file: /u/kitchawa/cvsroot/kitch-core/os/kernel/mem/FCMCommonMultiRepRoot.C,v
retrieving revision 1.35
diff -u -r1.35 FCMCommonMultiRepRoot.C
--- os/kernel/mem/FCMCommonMultiRepRoot.C	11 Jul 2004 21:59:27 -0000	1.35
+++ os/kernel/mem/FCMCommonMultiRepRoot.C	8 Oct 2004 17:34:19 -0000
@@ -204,9 +204,9 @@
     if (priv && uninitPM(pmRef)) {
 	//err_printf("attachRegion: switching from pm %lx to %lx\n",
 	//   uninitPM(pmRef) ? pmRef : 0, newPM);
-	if (!uninitPM(pmRef)) DREF(pmRef)->detachFCM((FCMRef)getRef());
+	if (!uninitPM(pmRef)) DREF(pmRef)->detachFCM((FCMRef)this->getRef());
 	pmRef = newPM;
-	DREF(pmRef)->attachFCM((FCMRef)getRef());
+	DREF(pmRef)->attachFCM((FCMRef)this->getRef());
     }
 
     if(AccessMode::isExecute(accessMode) && !mappedExecutable) {
@@ -215,7 +215,7 @@
 	mappedExecutable = 1;
     }
     
-    TraceOSMemFCMCOMAtchReg((uval)regRef, (uval64)getRef());
+    TraceOSMemFCMCOMAtchReg((uval)regRef, (uval64)this->getRef());
 
     return rc;
 }
@@ -256,12 +256,12 @@
 
     _ASSERT_HELD(lock);
 
-    TraceOSMemFCMCommonMultiRepDestroy((uval)getRef());
+    TraceOSMemFCMCommonMultiRepDestroy((uval)this->getRef());
     tassert(referenceCount == 0,
 	    err_printf("destroy while referenceCount non zero\n"));
 
     {   // remove all ObjRefs to this object
-	SysStatus rc=exported.close();
+	SysStatus rc=this->exported.close();
 	// most likely cause is that another destroy is in progress
 	// in which case we return success
 	if (_FAILURE(rc)) return _SCLSCD(rc)==1?0:rc;
@@ -296,7 +296,7 @@
     if (!uninitPM(pmRef)) {
 	PMRef tmpref = pmRef;
 	pmRef = uninitPM();		// mark in case other activity ongoing
-	DREF(tmpref)->detachFCM((FCMRef)getRef());
+	DREF(tmpref)->detachFCM((FCMRef)this->getRef());
     }
 
     // now destroy lists and seghats
@@ -311,7 +311,8 @@
     }
 
     // now schedule FCM for freeing
-    DREFGOBJ(TheCOSMgrRef)->destroyCO((CORef)getRef(), (COSMissHandler *)this);
+    DREFGOBJ(TheCOSMgrRef)->destroyCO((CORef)this->getRef(),
+		    (COSMissHandler *)this);
 
     return 0;
 }
@@ -399,7 +400,8 @@
 	    if (pageSize == PAGE_SIZE) {
 		ffl.freeFrame(vaddr);
 	    } else {
-		DREF(pmRef)->deallocPages(FCMRef(getRef()), vaddr, pageSize);
+		DREF(pmRef)->deallocPages(FCMRef(this->getRef()), vaddr,
+			pageSize);
 	    }
             // Remove Page descriptor
             LocalPageDescData::EmptyArg emptyArg = { 0, // doNotify
@@ -428,7 +430,7 @@
     // reference to the hash table.  But should probably check this.
     if (ffl.isNotEmpty()) {
         SysStatus rc;
-	rc = DREF(pmRef)->deallocListOfPages((FCMRef)getRef(), &ffl);
+	rc = DREF(pmRef)->deallocListOfPages((FCMRef)this->getRef(), &ffl);
 	tassert(_SUCCESS(rc), err_printf("dealloc list failed\n"));
     }
 
@@ -478,10 +480,10 @@
 	    //       getRef(), !uninitPM(pmRef) ? pmRef : 0, newpm);
 	    //printRegionList();
 	    if (!uninitPM(pmRef)) {
-		DREF(pmRef)->detachFCM((FCMRef)getRef());
+		DREF(pmRef)->detachFCM((FCMRef)this->getRef());
 	    }
 	    pmRef = newpm;
-	    DREF(pmRef)->attachFCM((FCMRef)getRef());
+	    DREF(pmRef)->attachFCM((FCMRef)this->getRef());
 	}
     }
 
@@ -537,7 +539,7 @@
 		       (void*)oldframeVmapsRaddr,
 		       pageSize);
 		rc = DREF(pmRef)->deallocPages(
-		    (FCMRef)getRef(), oldframeVmapsRaddr, pageSize);
+		    (FCMRef)this->getRef(), oldframeVmapsRaddr, pageSize);
 		md->setPAddr(paddr);
 		masterDHashTable.doOp(md, &LocalPageDescData::doSetPAddr,
 				      (DHashTableBase::OpArg)paddr,
@@ -884,8 +886,8 @@
 }
 
 #endif
-template FCMCommonMultiRepRoot<CObjRootMultiRep,AllocGlobalPadded,
+template class FCMCommonMultiRepRoot<CObjRootMultiRep,AllocGlobalPadded,
                                AllocLocalStrict>;
-template FCMCommonMultiRepRoot<CObjRootMultiRepPinned,
+template class FCMCommonMultiRepRoot<CObjRootMultiRepPinned,
                                AllocPinnedGlobalPadded,AllocPinnedLocalStrict>;
 
Index: os/kernel/mem/FCMFixed.C
===================================================================
RCS file: /u/kitchawa/cvsroot/kitch-core/os/kernel/mem/FCMFixed.C,v
retrieving revision 1.36
diff -u -r1.36 FCMFixed.C
--- os/kernel/mem/FCMFixed.C	8 Jul 2004 17:15:36 -0000	1.36
+++ os/kernel/mem/FCMFixed.C	8 Oct 2004 17:34:19 -0000
@@ -48,11 +48,11 @@
 FCMFixed<ALLOC>::getPage(uval fileOffset, void *&dataPtr,
 		  PageFaultNotification */*fn*/)
 {
-    lock.acquire();
+    this->lock.acquire();
 
-    PageDesc *pg = findPage(fileOffset);
+    PageDesc *pg = this->findPage(fileOffset);
     if (!pg) {
-	lock.release();
+	this->lock.release();
 	return _SERROR(1114, 0, ENOMEM);
     }
     tassert(1, err_printf(" should use offset %ld\n", fileOffset));
@@ -66,7 +66,7 @@
 {
     tassertMsg(dirty==0, "NYI");
     // currently there is only a lock on the whole stinker
-    lock.release();
+    this->lock.release();
     return 0;
 }
 
@@ -83,13 +83,13 @@
     setPFBit(fcmFixed);
     ScopeTime timer(MapPageTimer);
 
-    AutoLock<LockType> al(&lock); // locks now, unlocks on return
+    AutoLock<LockType> al(&this->lock); // locks now, unlocks on return
 
-    if (firstAccessOnPP) updateRegionPPSet(reg);
+    if (firstAccessOnPP) this->updateRegionPPSet(reg);
 
     offset += vaddr - regionVaddr;
 
-    PageDesc *pg = findPage(offset);
+    PageDesc *pg = this->findPage(offset);
     if (!pg) {
 	return _SERROR(1115, 0, ENOMEM);
     } else {
@@ -98,7 +98,7 @@
     }
     tassert(1, err_printf(" should use offset %ld\n", offset));
 
-    rc = mapPageInHAT(vaddr, pfinfo, access, vp, hat, reg, pg, offset);
+    rc = this->mapPageInHAT(vaddr, pfinfo, access, vp, hat, reg, pg, offset);
 
     return rc;
 }
@@ -117,22 +117,23 @@
     uval        found;
 
     // check before locking to avoid callback deadlock on destruction
-    if (beingDestroyed) return 0;
+    if (this->beingDestroyed) return 0;
 
-    lock.acquire();
+    this->lock.acquire();
 
-    found = regionList.remove(regRef, rinfo);
+    found = this->regionList.remove(regRef, rinfo);
     if (!found) {
 	// assume race on destruction call
-	tassert(beingDestroyed,err_printf("no region; no destruction race\n"));
-	lock.release();
+	tassert(this->beingDestroyed,
+		err_printf("no region; no destruction race\n"));
+	this->lock.release();
 	return 0;
     }
-    if (regionList.isEmpty()) {
-	lock.release();
-	destroy();
+    if (this->regionList.isEmpty()) {
+	this->lock.release();
+	this->destroy();
     } else {
-	lock.release();
+	this->lock.release();
 	updatePM(rinfo->pm);
     }
     delete rinfo;
@@ -143,12 +144,12 @@
 SysStatus
 FCMFixed<ALLOC>::establishPage(uval offset, uval virtAddr, uval length)
 {
-    AutoLock<LockType> al(&lock); // locks now, unlocks on return
+    AutoLock<LockType> al(&this->lock); // locks now, unlocks on return
     uval paddr;
     uval endAddr = virtAddr+length;
-    for (;virtAddr<endAddr;virtAddr+=pageSize) {
+    for (;virtAddr<endAddr;virtAddr+=this->pageSize) {
 	paddr = PageAllocatorKernPinned::virtToReal(virtAddr);
-	addPage(offset, paddr, pageSize);
+	addPage(offset, paddr, this->pageSize);
     }
     return 0;
 }
@@ -157,19 +158,19 @@
 SysStatus
 FCMFixed<ALLOC>::removeEstablishedPage(uval offset, uval paddr)
 {
-    AutoLock<LockType> al(&lock); // locks now, unlocks on return
+    AutoLock<LockType> al(&this->lock); // locks now, unlocks on return
     PageDesc *pg;
 
-    pg = findPage(offset);
+    pg = this->findPage(offset);
     if (paddr != pg->paddr) {
 	tassertWrn( 0, "error page doesn't match\n");
 	return _SERROR(1284, 0, EFAULT);
     }
 
-    unmapPage(pg);
+    this->unmapPage(pg);
 
     // note we will need syncronization on page to ensure not re-mapped
-    pageList.remove(offset);
+    this->pageList.remove(offset);
     return 0;
 }
 
@@ -177,15 +178,15 @@
 SysStatus
 FCMFixed<ALLOC>::establishPagePhysical(uval offset, uval paddr, uval length)
 {
-    AutoLock<LockType> al(&lock); // locks now, unlocks on return
+    AutoLock<LockType> al(&this->lock); // locks now, unlocks on return
     uval endAddr = paddr+length;
-    for (;paddr<endAddr;paddr+=pageSize) {
-	addPage(offset, paddr, pageSize);
+    for (;paddr<endAddr;paddr+=this->pageSize) {
+	addPage(offset, paddr, this->pageSize);
     }
     return 0;
 }
 
 //instantiate templates
 
-template FCMFixed<AllocGlobal>;
-template FCMFixed<AllocPinnedGlobalPadded>;
+template class FCMFixed<AllocGlobal>;
+template class FCMFixed<AllocPinnedGlobalPadded>;
Index: os/kernel/mem/FCMLTransTable.C
===================================================================
RCS file: /u/kitchawa/cvsroot/kitch-core/os/kernel/mem/FCMLTransTable.C,v
retrieving revision 1.8
diff -u -r1.8 FCMLTransTable.C
--- os/kernel/mem/FCMLTransTable.C	3 Oct 2004 02:28:08 -0000	1.8
+++ os/kernel/mem/FCMLTransTable.C	8 Oct 2004 17:34:19 -0000
@@ -63,7 +63,7 @@
 FCMLTransTable<ALLOC>::init(FRRef myFR, uval dObj)
 {
     defaultObject = dObj;
-    frRef = myFR;
+    this->frRef = myFR;
 }
 
 template <class ALLOC>
@@ -73,7 +73,7 @@
     uval *start;
     uval *vaddrPtr = (uval *)PAGE_ROUND_DOWN(vaddr);
     for (start=(uval *)virtAddr;
-         (uval)start<(virtAddr + pageSize);
+         (uval)start<(virtAddr + this->pageSize);
          start+=2,vaddrPtr+=2) {
         *start=(uval)(vaddrPtr+1);
         *(start+1)=defaultObject;
@@ -102,11 +102,11 @@
      * Note that caller can't round down since caller may not know
      * the FCM pageSize.
      */
-    vaddr &= -pageSize;
+    vaddr &= -this->pageSize;
 
-    if (firstAccessOnPP) updateRegionPPSet(reg);
+    if (firstAccessOnPP) this->updateRegionPPSet(reg);
 
-    lock.acquire();
+    this->lock.acquire();
 
     offset += vaddr - regionVaddr;
 
@@ -114,17 +114,17 @@
 //               "vp=%ld)\n", offset, regionVaddr, regionSize, vaddr, vp);
 
 //    breakpoint();
-    PageDesc *pg = findPage(offset);
+    PageDesc *pg = this->findPage(offset);
 
     if (!pg) {
 	// allocate a new page
 	uval virtAddr;
-	lock.release();
-	rc = DREF(pmRef)->allocPages(getRef(), virtAddr, pageSize, 
-				     0 /* non pageable */);
+	this->lock.release();
+	rc = DREF(this->pmRef)->allocPages(this->getRef(), virtAddr,
+		this->pageSize, 0 /* non pageable */);
 	tassert(_SUCCESS(rc), err_printf("woops\n"));
-	lock.acquire();
-	if ((pg = findPage(offset)) != 0) {
+	this->lock.acquire();
+	if ((pg = this->findPage(offset)) != 0) {
 	    // added in our absence
 	    unneededFrameAddr = virtAddr;
 	    paddr = pg->paddr;
@@ -133,7 +133,7 @@
 	    paddr = PageAllocatorKernPinned::virtToReal(virtAddr);
 	    TraceOSMemFCMPrimMapPage(vaddr, offset, paddr,
 		      (uval64)this);
-	    pg = addPage(offset, paddr, pageSize);
+	    pg = this->addPage(offset, paddr, this->pageSize);
             pg->cacheSynced = PageDesc::SET;
             pg->dirty = PageDesc::SET;
             initPage(virtAddr,vaddr);
@@ -144,19 +144,20 @@
     }
     tassert(1, err_printf(" should use offset %ld\n", offset));
 
-    rc = mapPageInHAT(vaddr, pfinfo, access, vp, hat, reg, pg, offset);
+    rc = this->mapPageInHAT(vaddr, pfinfo, access, vp, hat, reg, pg, offset);
 
-    lock.release();
+    this->lock.release();
 
     /*
      * do the free not holding a lock for safety sake
      */
     if (unneededFrameAddr != 0) {
-	DREF(pmRef)->deallocPages(getRef(), unneededFrameAddr, pageSize);
+	DREF(this->pmRef)->deallocPages(this->getRef(), unneededFrameAddr,
+					this->pageSize);
     }
 
     return rc;
 }
 
-template FCMLTransTable<AllocGlobal>;
-template FCMLTransTable<AllocPinnedGlobal>;
+template class FCMLTransTable<AllocGlobal>;
+template class FCMLTransTable<AllocPinnedGlobal>;
Index: os/kernel/mem/FCMPartitionedTrivial.C
===================================================================
RCS file: /u/kitchawa/cvsroot/kitch-core/os/kernel/mem/FCMPartitionedTrivial.C,v
retrieving revision 1.21
diff -u -r1.21 FCMPartitionedTrivial.C
--- os/kernel/mem/FCMPartitionedTrivial.C	3 Oct 2004 02:28:08 -0000	1.21
+++ os/kernel/mem/FCMPartitionedTrivial.C	8 Oct 2004 17:34:19 -0000
@@ -23,9 +23,9 @@
 #include "mem/PageCopy.H"
 #include "mem/PerfStats.H"
 
-template FCMCacheEntry<FCMCacheId>;
-template SSAC<FCMCacheEntry<FCMCacheId>, FCMCacheId, FCMPartitionedTrivial>;
-template SSACSimplePartitionedArray<FCMCacheEntry<FCMCacheId>, FCMCacheId,
+template class FCMCacheEntry<FCMCacheId>;
+template class SSAC<FCMCacheEntry<FCMCacheId>, FCMCacheId, FCMPartitionedTrivial>;
+template class SSACSimplePartitionedArray<FCMCacheEntry<FCMCacheId>, FCMCacheId,
                                     FCMPartitionedTrivial>;
 
 
Index: os/kernel/mem/FCMPrimitive.C
===================================================================
RCS file: /u/kitchawa/cvsroot/kitch-core/os/kernel/mem/FCMPrimitive.C,v
retrieving revision 1.68
diff -u -r1.68 FCMPrimitive.C
--- os/kernel/mem/FCMPrimitive.C	3 Oct 2004 02:28:08 -0000	1.68
+++ os/kernel/mem/FCMPrimitive.C	8 Oct 2004 17:34:19 -0000
@@ -52,25 +52,27 @@
     SysStatus rc;
     uval paddr;
 
-    lock.acquire();
+    this->lock.acquire();
 
-    PageDesc *pg = findPage(fileOffset);
+    PageDesc *pg = this->findPage(fileOffset);
     if (!pg) {
 	// allocate a new page
 	uval virtAddr;
-	lock.release();
-	rc = DREF(pmRef)->allocPages(getRef(), virtAddr, pageSize, pageable);
+	this->lock.release();
+	rc = DREF(this->pmRef)->allocPages(this->getRef(), virtAddr,
+		this->pageSize, this->pageable);
 	tassert(_SUCCESS(rc), err_printf("woops\n"));
-	lock.acquire();
-	if ((pg = findPage(fileOffset)) != 0) {
+	this->lock.acquire();
+	if ((pg = this->findPage(fileOffset)) != 0) {
 	    // added in our absence
-	    DREF(pmRef)->deallocPages(getRef(), virtAddr, pageSize);
+	    DREF(this->pmRef)->deallocPages(this->getRef(), virtAddr,
+		    this->pageSize);
 	    paddr = pg->paddr;
 	    TraceOSMemFCMPrimFoundPage(fileOffset, paddr);
 	} else {
 	    paddr = PageAllocatorKernPinned::virtToReal(virtAddr);
 	    TraceOSMemFCMPrimGetPage(fileOffset, paddr);
-	    pg = addPage(fileOffset, paddr, pageSize);
+	    pg = this->addPage(fileOffset, paddr, this->pageSize);
 	}
     } else {
 	paddr = pg->paddr;
@@ -87,7 +89,7 @@
 {
     tassertMsg(dirty==0, "NYI");
     // currently there is only a lock on the whole stinker
-    lock.release();
+    this->lock.release();
     return 0;
 }
 
@@ -115,27 +117,28 @@
      * Note that caller can't round down since caller may not know
      * the FCM pageSize.
      */
-    vaddr &= -pageSize;
+    vaddr &= -this->pageSize;
 
-    if (firstAccessOnPP) updateRegionPPSet(reg);
+    if (firstAccessOnPP) this->updateRegionPPSet(reg);
 
-    lock.acquire();
+    this->lock.acquire();
 
     offset += vaddr - regionVaddr;
 
     //err_printf("FCMPrimitive::mapPage(o %lx, h %lx)\n", offset, hat);
 
     MLSStatistics::StartTimer(4);
-    PageDesc *pg = findPage(offset);
+    PageDesc *pg = this->findPage(offset);
     MLSStatistics::DoneTimer(4);
     if (!pg) {
 	// allocate a new page
 	uval virtAddr;
-	lock.release();
-	rc = DREF(pmRef)->allocPages(getRef(), virtAddr, pageSize, pageable);
+	this->lock.release();
+	rc = DREF(this->pmRef)->allocPages(this->getRef(), virtAddr,
+		this->pageSize, this->pageable);
 	tassert(_SUCCESS(rc), err_printf("woops\n"));
-	lock.acquire();
-	if ((pg = findPage(offset)) != 0) {
+	this->lock.acquire();
+	if ((pg = this->findPage(offset)) != 0) {
 	    // added in our absence
 	    unneededFrameAddr = virtAddr;
 	    paddr = pg->paddr;
@@ -144,7 +147,7 @@
 	    paddr = PageAllocatorKernPinned::virtToReal(virtAddr);
 	    TraceOSMemFCMPrimMapPage(vaddr, offset, paddr,
 		      (uval64)this);
-	    pg = addPage(offset, paddr, pageSize);
+	    pg = this->addPage(offset, paddr, this->pageSize);
             pg->cacheSynced = PageDesc::SET;
             pg->dirty = PageDesc::SET;
 	}
@@ -155,16 +158,17 @@
     tassert(1, err_printf(" should use offset %ld\n", offset));
 
     MLSStatistics::StartTimer(5);
-    rc = mapPageInHAT(vaddr, pfinfo, access, vp, hat, reg, pg, offset);
+    rc = this->mapPageInHAT(vaddr, pfinfo, access, vp, hat, reg, pg, offset);
     MLSStatistics::DoneTimer(5);
 
-    lock.release();
+    this->lock.release();
 
     /*
      * do the free not holding a lock for safety sake
      */
     if (unneededFrameAddr != 0) {
-	DREF(pmRef)->deallocPages(getRef(), unneededFrameAddr, pageSize);
+	DREF(this->pmRef)->deallocPages(this->getRef(), unneededFrameAddr,
+		this->pageSize);
     }
 
     return rc;
@@ -186,22 +190,23 @@
     RegionInfo *rinfo;
 
     // check before locking to avoid callback deadlock on destruction
-    if (beingDestroyed) return 0;
+    if (this->beingDestroyed) return 0;
 
-    lock.acquire();
+    this->lock.acquire();
 
-    found = regionList.remove(regRef, rinfo);
+    found = this->regionList.remove(regRef, rinfo);
     if (!found) {
 	// assume race on destruction call
-	tassert(beingDestroyed,err_printf("no region; no destruction race\n"));
-	lock.release();
+	tassert(this->beingDestroyed,
+		err_printf("no region; no destruction race\n"));
+	this->lock.release();
 	return 0;
     }
-    if (regionList.isEmpty()) {
-	lock.release();
-	notInUse();
+    if (this->regionList.isEmpty()) {
+	this->lock.release();
+	this->notInUse();
     } else {
-	lock.release();
+	this->lock.release();
 	updatePM(rinfo->pm);
     }
     delete rinfo;
@@ -210,8 +215,8 @@
 
 //instantiate templates
 
-template FCMPrimitive<PageList<AllocGlobal>,AllocGlobal>;
-template FCMPrimitive<PageList<AllocPinnedGlobal>,AllocPinnedGlobal>;
-template FCMPrimitive<PageSet<AllocGlobal>,AllocGlobal>;
-template FCMPrimitive<PageSet<AllocPinnedGlobal>,AllocPinnedGlobal>;
-template FCMPrimitive<PageSetDense,AllocGlobal>;
+template class FCMPrimitive<PageList<AllocGlobal>,AllocGlobal>;
+template class FCMPrimitive<PageList<AllocPinnedGlobal>,AllocPinnedGlobal>;
+template class FCMPrimitive<PageSet<AllocGlobal>,AllocGlobal>;
+template class FCMPrimitive<PageSet<AllocPinnedGlobal>,AllocPinnedGlobal>;
+template class FCMPrimitive<PageSetDense,AllocGlobal>;
Index: os/kernel/mem/FCMSharedTrivial.C
===================================================================
RCS file: /u/kitchawa/cvsroot/kitch-core/os/kernel/mem/FCMSharedTrivial.C,v
retrieving revision 1.13
diff -u -r1.13 FCMSharedTrivial.C
--- os/kernel/mem/FCMSharedTrivial.C	3 Oct 2004 02:28:08 -0000	1.13
+++ os/kernel/mem/FCMSharedTrivial.C	8 Oct 2004 17:34:19 -0000
@@ -132,7 +132,7 @@
     return 0;
 }
 
-template FCMSharedTrivial<PageList<AllocGlobal>,AllocGlobal>;
-template FCMSharedTrivial<PageList<AllocPinnedGlobal>,AllocPinnedGlobal>;
-template FCMSharedTrivial<PageList<AllocPinnedGlobalPadded>,
+template class FCMSharedTrivial<PageList<AllocGlobal>,AllocGlobal>;
+template class FCMSharedTrivial<PageList<AllocPinnedGlobal>,AllocPinnedGlobal>;
+template class FCMSharedTrivial<PageList<AllocPinnedGlobalPadded>,
                           AllocPinnedGlobalPadded>;
Index: os/kernel/mem/HATDefault.C
===================================================================
RCS file: /u/kitchawa/cvsroot/kitch-core/os/kernel/mem/HATDefault.C,v
retrieving revision 1.67
diff -u -r1.67 HATDefault.C
--- os/kernel/mem/HATDefault.C	22 Sep 2004 20:17:34 -0000	1.67
+++ os/kernel/mem/HATDefault.C	8 Oct 2004 17:34:19 -0000
@@ -641,5 +641,5 @@
     return DREF(shr)->privateSegment();
 }
 
-template HATDefaultBase<AllocGlobalPadded>;
-template HATDefaultBase<AllocPinnedGlobalPadded>;
+template class HATDefaultBase<AllocGlobalPadded>;
+template class HATDefaultBase<AllocPinnedGlobalPadded>;
Index: os/kernel/mem/PageAllocatorKernPinned.C
===================================================================
RCS file: /u/kitchawa/cvsroot/kitch-core/os/kernel/mem/PageAllocatorKernPinned.C,v
retrieving revision 1.67
diff -u -r1.67 PageAllocatorKernPinned.C
--- os/kernel/mem/PageAllocatorKernPinned.C	3 Oct 2004 02:28:09 -0000	1.67
+++ os/kernel/mem/PageAllocatorKernPinned.C	8 Oct 2004 17:34:20 -0000
@@ -703,4 +703,4 @@
 #endif /* #ifdef marcdebug */
 
 #include <misc/HashNonBlocking.I>
-template HashNonBlockingBase<AllocForMDH, Element, 128>;
+template class HashNonBlockingBase<AllocForMDH, Element, 128>;
Index: os/kernel/mem/PageList.C
===================================================================
RCS file: /u/kitchawa/cvsroot/kitch-core/os/kernel/mem/PageList.C,v
retrieving revision 1.36
diff -u -r1.36 PageList.C
--- os/kernel/mem/PageList.C	8 Jul 2004 17:15:37 -0000	1.36
+++ os/kernel/mem/PageList.C	8 Oct 2004 17:34:20 -0000
@@ -278,7 +278,7 @@
 }
 
 //template instantiation
-template PageList<AllocGlobal>;
-template PageList<AllocGlobalPadded>;
-template PageList<AllocPinnedGlobal>;
-template PageList<AllocPinnedGlobalPadded>;
+template class PageList<AllocGlobal>;
+template class PageList<AllocGlobalPadded>;
+template class PageList<AllocPinnedGlobal>;
+template class PageList<AllocPinnedGlobalPadded>;
Index: os/kernel/mem/PageSet.C
===================================================================
RCS file: /u/kitchawa/cvsroot/kitch-core/os/kernel/mem/PageSet.C,v
retrieving revision 1.6
diff -u -r1.6 PageSet.C
--- os/kernel/mem/PageSet.C	8 Jul 2004 17:15:37 -0000	1.6
+++ os/kernel/mem/PageSet.C	8 Oct 2004 17:34:20 -0000
@@ -371,7 +371,7 @@
 }
 
 //template instantiation
-template PageSet<AllocGlobal>;
-template PageSet<AllocGlobalPadded>;
-template PageSet<AllocPinnedGlobal>;
-template PageSet<AllocPinnedGlobalPadded>;
+template class PageSet<AllocGlobal>;
+template class PageSet<AllocGlobalPadded>;
+template class PageSet<AllocPinnedGlobal>;
+template class PageSet<AllocPinnedGlobalPadded>;
Index: os/kernel/mem/RegionDefault.C
===================================================================
RCS file: /u/kitchawa/cvsroot/kitch-core/os/kernel/mem/RegionDefault.C,v
retrieving revision 1.154
diff -u -r1.154 RegionDefault.C
--- os/kernel/mem/RegionDefault.C	8 Jul 2004 17:15:37 -0000	1.154
+++ os/kernel/mem/RegionDefault.C	8 Oct 2004 17:34:20 -0000
@@ -602,7 +602,7 @@
 /* static */ SysStatus
 RegionDefault::CheckCaller(
     XHandle target, ProcessID callerPID, ProcessRef& pref,
-    ObjectHandle frOH, AccessMode::mode& accessreq,
+    ObjectHandle frOH, AccessMode::mode accessreq,
     FRRef& frRef, uval& writable)
 {
     uval mrights;
Index: os/kernel/mem/RegionDefault.H
===================================================================
RCS file: /u/kitchawa/cvsroot/kitch-core/os/kernel/mem/RegionDefault.H,v
retrieving revision 1.97
diff -u -r1.97 RegionDefault.H
--- os/kernel/mem/RegionDefault.H	29 Jun 2004 18:28:52 -0000	1.97
+++ os/kernel/mem/RegionDefault.H	8 Oct 2004 17:34:20 -0000
@@ -130,7 +130,7 @@
 
     static SysStatus CheckCaller(
 	XHandle target, ProcessID callerPID, ProcessRef& pref,
-	ObjectHandle frOH, AccessMode::mode& accessreq,
+	ObjectHandle frOH, AccessMode::mode accessreq,
 	FRRef& frRef, uval& writable);
     
 #ifndef _IN_STUBGEN
Index: os/kernel/mem/RegionList.C
===================================================================
RCS file: /u/kitchawa/cvsroot/kitch-core/os/kernel/mem/RegionList.C,v
retrieving revision 1.69
diff -u -r1.69 RegionList.C
--- os/kernel/mem/RegionList.C	20 Aug 2004 19:30:37 -0000	1.69
+++ os/kernel/mem/RegionList.C	8 Oct 2004 17:34:20 -0000
@@ -786,6 +786,6 @@
 
 
 //template instantiate
-template RegionList<AllocPinnedGlobalPadded>;
-template RegionList<AllocGlobalPadded>;
-template RegionList<AllocGlobal>;
+template class RegionList<AllocPinnedGlobalPadded>;
+template class RegionList<AllocGlobalPadded>;
+template class RegionList<AllocGlobal>;
Index: os/kernel/proc/ProcessShared.C
===================================================================
RCS file: /u/kitchawa/cvsroot/kitch-core/os/kernel/proc/ProcessShared.C,v
retrieving revision 1.84
diff -u -r1.84 ProcessShared.C
--- os/kernel/proc/ProcessShared.C	16 Aug 2004 22:00:30 -0000	1.84
+++ os/kernel/proc/ProcessShared.C	8 Oct 2004 17:34:20 -0000
@@ -148,7 +148,7 @@
     newProcess->updatedFlagDoNotDestroy = false;
 
     // Enter Process into the Translation Table
-    new ProcessShared<ALLOC>::Root(newProcess);
+    new typename ProcessShared<ALLOC>::Root(newProcess);
     outPref = (ProcessRef)newProcess->getRef();
 
     DREF(h)->attachProcess(outPref);
@@ -174,7 +174,7 @@
 {
     ProcessShared* newProcess = new ProcessShared();
     newProcess->factoryRef = (FactoryRef)getRef();
-    root = new ProcessShared<ALLOC>::Root(newProcess, (RepRef)ref,
+    root = new typename ProcessShared<ALLOC>::Root(newProcess, (RepRef)ref,
                                           CObjRoot::skipInstall);
     registerInstance(ref); /* FIXME: check return value */
     return 0;
@@ -209,7 +209,7 @@
     newProcess->updatedFlagDoNotDestroy = false;
 
     // Enter Process into the Translation Table
-    new ProcessShared<ALLOC>::Root(newProcess);
+    new typename ProcessShared<ALLOC>::Root(newProcess);
     outPref = (ProcessRef)newProcess->getRef();
 
     DREF(h)->attachProcess(outPref);
@@ -483,8 +483,8 @@
 /*virtual*/ SysStatus
 ProcessShared<ALLOC>::testUserIPC(ObjectHandle oh)
 {
-    ProcessShared<ALLOC>::ObjectHandleHolder *ohHolder =
-	new ProcessShared<ALLOC>::ObjectHandleHolder;
+    typename ProcessShared<ALLOC>::ObjectHandleHolder *ohHolder =
+	new typename ProcessShared<ALLOC>::ObjectHandleHolder;
     ohHolder->oh = oh;
     cprintf("testUserIPC: creating thread to call user.\n");
     Scheduler::ScheduleFunction(
@@ -517,5 +517,5 @@
 }
 
 //template instantiate
-template ProcessShared<AllocPinnedGlobalPadded>;
-template ProcessShared<AllocGlobalPadded>;
+template class ProcessShared<AllocPinnedGlobalPadded>;
+template class ProcessShared<AllocGlobalPadded>;
Index: os/kernel/trace/traceCtr.H
===================================================================
RCS file: /u/kitchawa/cvsroot/kitch-core/os/kernel/trace/traceCtr.H,v
retrieving revision 1.12
diff -u -r1.12 traceCtr.H
--- os/kernel/trace/traceCtr.H	13 Jan 2003 19:23:32 -0000	1.12
+++ os/kernel/trace/traceCtr.H	8 Oct 2004 17:34:20 -0000
@@ -131,7 +131,7 @@
 public:
     // TODO: in the constructor add trace event with the this ptr
     void acquire(void) {
-	if (!tryAcquire()) {
+	if (!this->tryAcquire()) {
 	    TraceAutoCount tac(CTRIDX);
 	    // TODO: could add trace event with (this, CTRIDX)
 	    Lock_Class::acquire();
Index: os/servers/k42Ramfs/FileSystemK42RamFS.C
===================================================================
RCS file: /u/kitchawa/cvsroot/kitch-core/os/servers/k42Ramfs/FileSystemK42RamFS.C,v
retrieving revision 1.42
diff -u -r1.42 FileSystemK42RamFS.C
--- os/servers/k42Ramfs/FileSystemK42RamFS.C	5 Oct 2004 21:28:20 -0000	1.42
+++ os/servers/k42Ramfs/FileSystemK42RamFS.C	8 Oct 2004 17:34:20 -0000
@@ -640,7 +640,7 @@
 	return 0;
     }
 
-    while ((curr = instances.next(curr, (ObjRef)fsref))) {
+    while ((curr = instances.next(curr, (ObjRef&)fsref))) {
 	rc = DREF(fsref)->printStats();
 	tassertWrn(_SUCCESS(rc), "error on printStats call\n");
     }
Index: os/servers/nfs/FileSystemNFS.C
===================================================================
RCS file: /u/kitchawa/cvsroot/kitch-core/os/servers/nfs/FileSystemNFS.C,v
retrieving revision 1.157
diff -u -r1.157 FileSystemNFS.C
--- os/servers/nfs/FileSystemNFS.C	5 Oct 2004 21:28:21 -0000	1.157
+++ os/servers/nfs/FileSystemNFS.C	8 Oct 2004 17:34:20 -0000
@@ -1545,7 +1545,7 @@
     SysStatus rc;
     void *curr = NULL;
     FileSystemNFSRef fsref = NULL;
-    while ((curr = instances.next(curr, (ObjRef)fsref))) {
+    while ((curr = instances.next(curr, (ObjRef&)fsref))) {
 	rc = DREF(fsref)->printStats();
 	_IF_FAILURE_RET(rc);
     }
Index: tools/build/shared/stubgen/scripts/genprog.awk
===================================================================
RCS file: /u/kitchawa/cvsroot/kitch-core/tools/build/shared/stubgen/scripts/genprog.awk,v
retrieving revision 1.84
diff -u -r1.84 genprog.awk
--- tools/build/shared/stubgen/scripts/genprog.awk	11 Jul 2004 21:59:30 -0000	1.84
+++ tools/build/shared/stubgen/scripts/genprog.awk	8 Oct 2004 17:34:20 -0000
@@ -176,10 +176,10 @@
 {
   printf("TYPE_IMPL(%s,%s,%s,1);\n\n",mclass,meta_parent,nclass)          > XF;
   printf("TYPE_IMPL_X(%s,%s);\n\n",xclass, mclass)			  > XF;
-  printf("COVTableEntry *%s::theVTBL = NULL;\n",mclass)                   > XF;
-  printf("COVTableEntry *%s::theMVTBL = NULL;\n",mclass)                  > XF;
+  printf("template<> COVTableEntry *%s::theVTBL = NULL;\n",mclass)        > XF;
+  printf("template<> COVTableEntry *%s::theMVTBL = NULL;\n",mclass)       > XF;
 
-  printf("char %s::static_buf[sizeof(%s)]\n",mclass,mclass)		  > XF;
+  printf("template<> char %s::static_buf[sizeof(%s)]\n",mclass,mclass)		  > XF;
   printf("\t__attribute__((aligned(sizeof(uval))));\n")			  > XF;
 
   printf("\n")                                 > XF;
@@ -699,9 +699,9 @@
     }
     printf(";\n")                                                         > XF;
     printf("  if (((SysTypes::PID_FROM_COMMID(callerID) == ")             > XF;
-    printf(                                     "__matchPID) &&\n")       > XF;
-    printf("                    ((rights & __mrights) == rights)) ||\n")  > XF;
-    printf("        ((rights & __urights) == rights))\n")                 > XF;
+    printf(                                     "this->__matchPID) &&\n")       > XF;
+    printf("                    ((rights & this->__mrights) == rights)) ||\n")  > XF;
+    printf("        ((rights & this->__urights) == rights))\n")                 > XF;
   }
   printf("  {\n")                                                         > XF;
 
@@ -845,7 +845,7 @@
 #-----------------------------------
 
   if (functype == "V")
-    printf("    __ppc_rc = DREF((%s**)__iobj)->%s( ",iclass,funcn)        > XF;
+    printf("    __ppc_rc = DREF((%s**)this->__iobj)->%s( ",iclass,funcn)  > XF;
   else
     printf("    __ppc_rc = %s::%s( ",iclass,funcn)                        > XF;
 
@@ -853,7 +853,7 @@
     if (j == calleridx) {
       printf("SysTypes::PID_FROM_COMMID(callerID)")                       > XF;
     } else if (j == xhandleidx) {
-      printf("getXHandle()")                                              > XF;
+      printf("this->getXHandle()")                                        > XF;
     } else {
       if (inoutspec[j] == 0)
 	printf("%s__inargs.%s",aref[j],nameset[j])                        > XF;
@@ -916,8 +916,8 @@
     printf(              "\\n\",\n")                                      > XF;
     printf("            DREFGOBJ(TheProcessRef)->getPID(),\n")            > XF;
     printf("            SysTypes::PID_FROM_COMMID(callerID),")            > XF;
-    printf(              "__matchPID,\n")                                 > XF;
-    printf("            rights,__mrights,__urights);\n")                  > XF;
+    printf(              "this->__matchPID,\n")                           > XF;
+    printf("            rights,this->__mrights,this->__urights);\n")      > XF;
 
 ##just for debugging
     if (hasoutargs == 1) {
Index: tools/build/shared/stubgen/scripts/gentmp.awk
===================================================================
RCS file: /u/kitchawa/cvsroot/kitch-core/tools/build/shared/stubgen/scripts/gentmp.awk,v
retrieving revision 1.14
diff -u -r1.14 gentmp.awk
--- tools/build/shared/stubgen/scripts/gentmp.awk	11 Jul 2004 21:59:30 -0000	1.14
+++ tools/build/shared/stubgen/scripts/gentmp.awk	8 Oct 2004 17:34:20 -0000
@@ -172,10 +172,10 @@
 {
   printf("TYPE_IMPL_TEMPLATE(%s,%s,INSTNAME,1);\n\n",TMclass,Mclass) > XF;
   printf("TYPE_IMPL_X_TEMPLATE(%s,%s);\n\n",xclass, mclass)		  > XF;
-  printf("COVTableEntry *%s<INSTNAME>::theVTBL = NULL;\n",TMclass)        > XF;
-  printf("COVTableEntry *%s<INSTNAME>::theMVTBL = NULL;\n",TMclass)       > XF;
+  printf("template<> COVTableEntry *%s<INSTNAME>::theVTBL = NULL;\n",TMclass)  > XF;
+  printf("template<> COVTableEntry *%s<INSTNAME>::theMVTBL = NULL;\n",TMclass) > XF;
 
-  printf("char %s<INSTNAME>::static_buf[sizeof(%s<INSTNAME>)]\n",TMclass,TMclass)		  > XF;
+  printf("template<> char %s<INSTNAME>::static_buf[sizeof(%s<INSTNAME>)]\n",TMclass,TMclass)		  > XF;
   printf("\t__attribute__((aligned(sizeof(uval))));\n")			  > XF;
 
   printf("\n")								  > XF;
@@ -532,9 +532,9 @@
     }
     printf(";\n")                                                         > XF;
     printf("  if (((SysTypes::PID_FROM_COMMID(callerID) == ")             > XF;
-    printf(                                     "__matchPID) &&\n")       > XF;
-    printf("                    ((rights & __mrights) == rights)) ||\n")  > XF;
-    printf("        ((rights & __urights) == rights))\n")                 > XF;
+    printf(                                     "this->__matchPID) &&\n")       > XF;
+    printf("                    ((rights & this->__mrights) == rights)) ||\n")  > XF;
+    printf("        ((rights & this->__urights) == rights))\n")           > XF;
   }
   printf("  {\n")                                                         > XF;
 
@@ -678,7 +678,7 @@
 #-----------------------------------
 
   if (functype == "V")
-    printf("    __ppc_rc = DREF((%s**)__iobj)->%s( ",iclass,funcn)        > XF;
+    printf("    __ppc_rc = DREF((%s**)this->__iobj)->%s( ",iclass,funcn)  > XF;
   else
     printf("    __ppc_rc = %s::%s( ",iclass,funcn)                        > XF;
 
@@ -686,7 +686,7 @@
     if (j == calleridx) {
       printf("SysTypes::PID_FROM_COMMID(callerID)")                       > XF;
     } else if (j == xhandleidx) {
-      printf("getXHandle()")                                              > XF;
+      printf("this->getXHandle()")                                        > XF;
     } else {
       if (inoutspec[j] == 0)
 	printf("%s__inargs.%s",aref[j],nameset[j])                        > XF;
@@ -749,8 +749,8 @@
     printf(              "\\n\",\n")                                      > XF;
     printf("            DREFGOBJ(TheProcessRef)->getPID(),\n")            > XF;
     printf("            SysTypes::PID_FROM_COMMID(callerID),")            > XF;
-    printf(              "__matchPID,\n")                                 > XF;
-    printf("            rights,__mrights,__urights);\n")                  > XF;
+    printf(              "this->__matchPID,\n")                           > XF;
+    printf("            rights,this->__mrights,this->__urights);\n")      > XF;
 
 ##just for debugging
     if (hasoutargs == 1) {
