Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Thiemo Seufer <ths@networkno.de>
To: Daniel Laird <danieljlaird@hotmail.com>
Cc: linux-mips@linux-mips.org
Subject: Re: PAGE_ALIGN + PAGE_SHIFT from userspace
Date: Mon, 18 Dec 2006 12:47:00 +0000	[thread overview]
Message-ID: <20061218124659.GA17301@networkno.de> (raw)
In-Reply-To: <7925460.post@talk.nabble.com>

Daniel Laird wrote:
> 
> Hi All,
> 
> I was using linux 2.6.17.13 on my MIPS and it was all going well.  I am just
> porting to 2.6.19 and am having a couple of issues.
> 
> My first issue is that i used to mmap a buffer from user space.  I used to
> use a PAGE_ALIGN macro when doing this:
> /** to align the pointer to the (next) page boundary */
> #define PAGE_ALIGN(addr)	(((addr) + PAGE_SIZE - 1) & PAGE_MASK)
> 
> this worked as PAGE_SIZE and PAGE_MASK were available in page.h.

It didn't work reliably since the pagesize is a kernel configuration option.

> This have now been moved inside the #ifdef KERNEL guard in the header file. 
> Meaning these are no longer available.
> 
> Are these available somewhere else?
> Should I be doing something different to mmap?

Use the libc's sysconf(_SC_PAGESIZE) function.


Thiemo

  reply	other threads:[~2006-12-18 13:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-18  9:04 PAGE_ALIGN + PAGE_SHIFT from userspace Daniel Laird
2006-12-18 12:47 ` Thiemo Seufer [this message]
2006-12-19  8:18   ` Daniel Laird

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061218124659.GA17301@networkno.de \
    --to=ths@networkno.de \
    --cc=danieljlaird@hotmail.com \
    --cc=linux-mips@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox