[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CAOPDcRyMr2RL+4azAzDeBK0Ja_9zNvWFjBy3Z8XL9BKH_a+A7w@mail.gmail.com>
Date: Mon, 3 Jun 2013 17:52:01 +0200
From: stl <st.lambert02@...il.com>
To: linux-kernel@...r.kernel.org
Subject: Clarifications on PFN_UP macro
Hello,
I need some clarifications concerning the macro
#define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT)
found in "pfn.h"
I suppose that its aim is to give the page frame number of the page
following the page holding the physical adress x, contrary to
PFN_DOWN(x) which give the page frame number of the page holding the
adress x.
Assuming that the first page has the range 0x0000 to 0x0FFF,
the second 0x1000 to 0x1FFF and so on, it seems that there is
an issu with the starting adress of each page, for example:
x = 0x10000 (PFN number 10)
0x10000 + 0xFFF >> 12 = 10, but should be 11 no?
I certainly misunderstood something.
Could someone clarify this point please?
Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists