WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH][XEN] Use gnttab_clear_flag() to clear flags

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH][XEN] Use gnttab_clear_flag() to clear flags
From: Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
Date: Sun, 13 Aug 2006 12:50:07 -0400
Delivery-date: Sun, 13 Aug 2006 09:50:19 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
We also add #define to catch offenders early.

Signed-off-by: Jimi Xenidis <jimix@xxxxxxxxxxxxxx>

---

diff -r 5f92043a3ab1 xen/common/grant_table.c
--- a/xen/common/grant_table.c  Sun Aug 13 12:00:38 2006 -0400
+++ b/xen/common/grant_table.c  Sun Aug 13 12:46:53 2006 -0400
@@ -32,6 +32,13 @@
 #include <xen/guest_access.h>
 #include <acm/acm_hooks.h>
 
+/*
+ * This file uses a special method for clearing bit in the flags called:
+ *    gnttab_clear_flag()
+ * We redefine clear_bit() here to catch offenders early.
+ */
+#define clear_bit(flags, ptr) please_use_gnttab_clear_flag();
+
 /* The first to members of a grant entry are updated as a combined
  * pair.  The following union allows that to happen in an endian
  * neutral fashion. */
@@ -738,10 +745,10 @@ __release_grant_for_copy(
         act->pin -= GNTPIN_hstw_inc;
 
     if ( !(act->pin & GNTPIN_hstw_mask) && !readonly )
-        clear_bit(_GTF_writing, &sha->flags);
+        gnttab_clear_flag(_GTF_writing, &sha->flags);
 
     if ( !act->pin )
-        clear_bit(_GTF_reading, &sha->flags);
+        gnttab_clear_flag(_GTF_reading, &sha->flags);
     spin_unlock(&rd->grant_table->lock);
 }

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH][XEN] Use gnttab_clear_flag() to clear flags, Jimi Xenidis <=