[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-merge] Re: synch_bitops.h



One question that comes to mind, is that in a para-virtualized environment does CONFIG_SMP cost you anything?
On PPC and the IBM hypervisor we have found that is does not.

On Jan 6, 2006, at 11:06 AM, Jan Beulich wrote:

So AFAIK synch_bitops.h is equivilent to bitops.h with #defined
CONFIG_SMP

Can't we use this somehow to reduce the amount of repeated code?

Sure, this would be possible. But would anyone like the to be added
conditionals

Not conditional but some CPP majik.
hmm, not a fan of clutter, but maybe some CPP magik?

this is what we have for powerpc:
#ifdef CONFIG_SMP
#include <asm/bitops.h>

#define synch_change_bit(a,b) change_bit(a,(unsigned long *)b)
#define synch_clear_bit(a,b) clear_bit(a,(unsigned long *)b)
#define synch_cmpxchg(a,b) cmpxchg(a,(unsigned long *)b)
#define synch_const_test_bit(a,b) const_test_bit(a,(unsigned long *)b)
#define synch_set_bit(a,b) set_bit(a,(unsigned long *)b)
#define synch_test_and_set_bit(a,b) test_and_set_bit(a,(unsigned long *)b) #define synch_test_and_change_bit(a,b) test_and_change_bit(a, (unsigned long *)b) #define synch_test_and_clear_bit(a,b) test_and_clear_bit(a,(unsigned long *)b)
#define synch_test_bit(a,b) test_bit(a,(unsigned long *)b)
#define synch_var_test_bit(a,b) var_test_bit(a,(unsigned long *)b)

#else
#error "this only works for CONFIG_SMP"
#endif

now for the !CONFIG_SMP one could easily imagine some CPP majik to solve that.

-JX
--
"I got an idea, an idea so smart my head would explode if I even
began to know what I was talking about." -- Peter Griffin (Family Guy)




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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.