|
|
|
|
|
|
|
|
|
|
xen-ppc-devel
Re: [XenPPC] [RFC] fix stupid grant table flags
I don't think you definition of clear_entry_flag will work, see below
On Jun 21, 2006, at 2:49 PM, Hollis Blanchard wrote:
diff -r ab08d443113d xen/include/asm-ppc/grant_table.h
--- a/xen/include/asm-ppc/grant_table.h Wed Jun 21 13:36:49 2006 -0500
+++ b/xen/include/asm-ppc/grant_table.h Wed Jun 21 13:42:23 2006 -0500
@@ -6,4 +6,6 @@
#define mark_dirty(d, f) ((void )0)
#include "../asm-x86/grant_table.h"
+#define clear_entry_flag(nr, flags) clear_bit((nr), (int *)(flags));
1) clear_bit takes an 'unsigned long *' so this should have cause a
warning
2) bitops are designed to find the ulong array element (nr /
BITS_PER_LONG) then set the bit like (1 << (nr % BITS_PER_LONG)) so
that the word feels like 'C' order.
So I think the definition should be:
static inline void clear_entry_flag(unsigned long nr, volatile
uint16_t *addr) {
volatile unsigned long *laddr;
unsigned long lnr;
#ifdef SAFETY_DANCE
BUG_ON((ulong)addr % sizeof (ulong));
#endif
lnr = (BITS_PER_LONG - (sizeof (*addr) * 8)) + nr;
laddr = (volatile unsigned long *)addr;
clear_bit(lnr, laddr);
}
You could macro-tize this, but why.
-JX
_______________________________________________
Xen-ppc-devel mailing list
Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ppc-devel
|
|
|
|
|