PERFORCE change 97312 for review

Kip Macy kmacy at FreeBSD.org
Wed May 17 00:15:24 UTC 2006


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

Change 97312 by kmacy at kmacy_storage:sun4v_rwbuf on 2006/05/17 00:14:24

	remove unused lock functions

Affected files ...

.. //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/tte_hash.c#28 edit

Differences ...

==== //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/tte_hash.c#28 (text+ko) ====

@@ -122,6 +122,10 @@
 static struct vm_object thzone_obj;
 static int tte_hash_count = 0, tte_hash_max = 0;
 
+extern uint64_t hash_bucket_lock(tte_hash_field_t fields);
+
+extern void hash_bucket_unlock(tte_hash_field_t fields, uint64_t s);
+
 static tte_hash_t
 get_tte_hash(void)
 {
@@ -142,44 +146,7 @@
 	uma_zfree(thzone, th);
 }
 
-#if 0
-static uint64_t
-hash_bucket_lock(tte_hash_field_t fields) 
-{
-	uint64_t data;
-	int s;
-	s = intr_disable();
 
-	data = fields[0].tte.data & ~VTD_LOCK;
-	while (atomic_cmpset_long(&fields[0].tte.data, data, data | VTD_LOCK))
-		data = fields[0].tte.data & ~VTD_LOCK;
-
-	membar(Sync);
-	return (uint64_t)s;
-		
-}
-
-static void
-hash_bucket_unlock(tte_hash_field_t fields, uint64_t s) 
-{
-
-	membar(StoreStore|LoadStore);
-#ifdef DEBUG
-	if ((fields[0].tte.data & VTD_LOCK) == 0)
-		panic("trying to unlock bucket that isn't locked");
-#endif
-
-	fields[0].tte.data &= ~VTD_LOCK;
-	membar(Sync);
-	intr_restore(s);
-}
-
-#else 
-extern uint64_t hash_bucket_lock(tte_hash_field_t fields);
-
-extern void hash_bucket_unlock(tte_hash_field_t fields, uint64_t s);
-
-#endif
 void 
 tte_hash_init(void)
 {


More information about the p4-projects mailing list