public inbox for
 help / color / mirror / Atom feed
From: Andrew Pinski <>
To: Andrew Stubbs <>
Cc: "" <>
Subject: Re: [PATCH] PAGE_SIZE definition for MIPS XLP
Date: Tue, 19 Nov 2013 03:28:00 -0000	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

[-- Attachment #1: Type: text/plain, Size: 1749 bytes --]

On Mon, Nov 18, 2013 at 4:29 AM, Andrew Stubbs <> wrote:
> MIPS' sys/user.h currently has a constant definition for PAGE_SIZE, and the
> other related settings. This is not appropriate for XLP (and other MIPS?)
> where the actual page size is a kernel configuration option.

The whole Octeon series of MIPS64 processors also supports other
PAGE_SIZEs.  Also the generic MIPS glibc should support other page
sizes too.

> Apart from the general principle of not having incorrect definitions, the
> actual problem that needs to be solved is in
> sysdeps/unix/sysv/linux/ifaddrs.c in which PAGE_SIZE is used by preference
> as an optimization. Most of the other possible use cases prefer to call
> __getpagesize or use sysconf, and so are unaffected.
> Clearly, keeping the constant definition is desirable on at least some MIPS
> variants, in order to keep the optimization, but not for XLP.

No it is not desirable if you want a generic glibc which works on all MIPS64.

> The attached patch makes the definition conditional, rather than removing it
> completely. It's not clear to me whether the HOST_* definitions are
> similarly affected, but other platforms that do not define PAGE_SIZE also
> choose not to define those, so I've extended the ifndef similarly.
> I this OK to commit? Should it be solved a different way?

I think my attached patch is better way of fixing this issue which
just deletes them rather than special casing them.

Andrew Pinski

> Testcase tst-limits does check PAGE_SIZE matches, if defined, but not in
> this case because that test case does not include sys/user.h. Should I
> create a new test case for this, or include that header in the existing
> test?
> Thanks
> Andrew

[-- Attachment #2: removepagesize.diff.txt --]
[-- Type: text/plain, Size: 1019 bytes --]

commit 20364b09f52a6cb93188752b825b65fbad82e4d7
Author: Andrew Pinski <>
Date:   Wed Jul 11 19:28:58 2012 -0700

    [PATCH 12/19] 2012-07-11  Andrew Pinski  <>
    	Bug #2964
    	* ports/sysdeps/unix/sysv/linux/mips/sys/user.h (PAGE_SHIFT): Delete.
    	(PAGE_SIZE): Delete.
    	(PAGE_MASK): Delete.
    	(NBPG): Delete.
    	(HOST_STACK_END_ADDR): Delete.

diff --git a/ports/sysdeps/unix/sysv/linux/mips/sys/user.h b/ports/sysdeps/unix/sysv/linux/mips/sys/user.h
index 950cad7..6e83b80 100644
--- a/ports/sysdeps/unix/sysv/linux/mips/sys/user.h
+++ b/ports/sysdeps/unix/sysv/linux/mips/sys/user.h
@@ -206,13 +206,8 @@ struct user {
-#define PAGE_SHIFT		12
-#define PAGE_SIZE		(1UL << PAGE_SHIFT)
-#define PAGE_MASK		(~(PAGE_SIZE-1))
-#define NBPG			PAGE_SIZE
 #define UPAGES			1
 #define HOST_TEXT_START_ADDR	(u.start_code)
 #define HOST_DATA_START_ADDR	(u.start_data)
-#define HOST_STACK_END_ADDR	(u.start_stack + u.u_ssize * NBPG)
 #endif	/* _SYS_USER_H */

  parent reply	other threads:[~2013-11-19  2:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-18 12:51 Andrew Stubbs
2013-11-18 13:42 ` Andreas Schwab
2013-11-19 20:56   ` Maciej W. Rozycki
2013-11-18 13:45 ` Joseph S. Myers
2013-11-18 18:21 ` Joseph S. Myers
2013-11-19  3:28 ` Andrew Pinski [this message]
2013-11-19 14:57   ` Joseph S. Myers
2013-11-19 20:19     ` Andrew Stubbs
2013-11-20 19:57   ` Maciej W. Rozycki

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:

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

  git send-email \
    --in-reply-to='' \ \ \ \

* 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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).