On 02/25/2015 05:35 AM, Jan Beulich wrote:
On 24.02.15 at 20:11, <boris.ostrov...@oracle.com> wrote:
@@ -121,10 +123,12 @@ struct npfec {
#define _MEMF_exact_node 4
#define MEMF_exact_node (1U<<_MEMF_exact_node)
#define _MEMF_node 8
-#define MEMF_node(n) ((((n)+1)&0xff)<<_MEMF_node)
+#define MEMF_node(n) ((((n)+1) & MEMF_node_mask) << _MEMF_node)
#define _MEMF_bits 24
#define MEMF_bits(n) ((n)<<_MEMF_bits)
+#define MEMF2NODE(memflags) (MASK_EXTR(memflags, MEMF_node_mask) - 1)
As this is being used just once, I don't really see a need for it to be
exposed globally. Perhaps do away with the macro, but at the very
least confine it to page_alloc.c.
I intentionally put it here: we have macro to encode ('put', so to
speak) nodeID in memflags in this file (by adding one to it) and so I
felt that we don't need to expose this encoding outside of this file by
providing a "get" macro.
-boris
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel