public inbox for libc-ports@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Stubbs <ams@codesourcery.com>
To: "libc-ports@sourceware.org" <libc-ports@sourceware.org>
Subject: [PATCH] Remove PAGE_SIZE et al from sys/user.h
Date: Fri, 13 Dec 2013 13:15:00 -0000	[thread overview]
Message-ID: <52AB0851.1020909@codesourcery.com> (raw)

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

The attached patch removes the constant definitions of PAGE_SIZE, 
PAGE_SHIFT, and PAGE_MASK, from sys/user.h on architectures that allow 
configurable page sizes.

Additionally, it also removes NBPG, UPAGES, HOST_TEXT_START_ADDR, 
HOST_DATA_START_ADDR, and HOST_STACK_END_ADDR, partly because they are 
defined in terms of PAGE_SIZE, but also because these are only needed 
for trad-core support, and these architecture don't use that anyway.

This has been discussed previously here:

https://sourceware.org/ml/libc-ports/2013-11/msg00028.html

And on bugzilla here:

https://sourceware.org/bugzilla/show_bug.cgi?id=16191

Finally, I've adjusted tst-limits.c so that its PAGE_SIZE test is 
applied to the definitions remaining in other architecture's user.h.

OK?

Andrew


[-- Attachment #2: glibc-bugzilla-16191.patch --]
[-- Type: text/x-patch, Size: 2691 bytes --]

2013-12-12  Andrew Stubbs  <ams@codesourcery.com>

	* stdlib/tst-limits.c: Include sys/user.h.

	ports/
	* sysdeps/unix/sysv/linux/ia64/sys/user.h (NBPG, UPAGES,
	HOST_TEXT_START_ADDR, HOST_DATA_START_ADDR, HOST_STACK_END_ADDR):
	Delete macro definitions.
	* sysdeps/unix/sysv/linux/microblaze/sys/user.h (PAGE_SHIFT,
	PAGE_SIZE, PAGE_MASK, NBPG, UPAGES, HOST_TEXT_START_ADDR,
	HOST_STACK_END_ADDR): Delete macro definitions.
	* sysdeps/unix/sysv/linux/mips/sys/user.h (PAGE_SHIFT, PAGE_SIZE,
	PAGE_MASK, NBPG, UPAGES, HOST_TEXT_START_ADDR, HOST_DATA_START_ADDR,
	HOST_STACK_END_ADDR): Delete macro definitions.


diff --git a/ports/sysdeps/unix/sysv/linux/ia64/sys/user.h b/ports/sysdeps/unix/sysv/linux/ia64/sys/user.h
index 535079a..b703102 100644
--- a/ports/sysdeps/unix/sysv/linux/ia64/sys/user.h
+++ b/ports/sysdeps/unix/sysv/linux/ia64/sys/user.h
@@ -44,10 +44,4 @@ struct user
   char u_comm[32];				/* User command name.  */
 };
 
-#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 */
diff --git a/ports/sysdeps/unix/sysv/linux/microblaze/sys/user.h b/ports/sysdeps/unix/sysv/linux/microblaze/sys/user.h
index a633042..69ab0c6 100644
--- a/ports/sysdeps/unix/sysv/linux/microblaze/sys/user.h
+++ b/ports/sysdeps/unix/sysv/linux/microblaze/sys/user.h
@@ -66,12 +66,4 @@ struct user
   int				u_debugreg [8];
 };
 
-# 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_STACK_END_ADDR	(u.start_stack + u.u_ssize * NBPG)
-
 #endif	/* _SYS_USER_H */
diff --git a/ports/sysdeps/unix/sysv/linux/mips/sys/user.h b/ports/sysdeps/unix/sysv/linux/mips/sys/user.h
index 37fc568..918b14f 100644
--- a/ports/sysdeps/unix/sysv/linux/mips/sys/user.h
+++ b/ports/sysdeps/unix/sysv/linux/mips/sys/user.h
@@ -206,13 +206,4 @@ struct user {
 
 #endif
 
-#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 */
diff --git a/stdlib/tst-limits.c b/stdlib/tst-limits.c
index 265b9db..96fb25e 100644
--- a/stdlib/tst-limits.c
+++ b/stdlib/tst-limits.c
@@ -5,6 +5,8 @@
 #include <inttypes.h>
 #include <stdio.h>
 
+/* For PAGE_SIZE.  */
+#include <sys/user.h>
 
 static long long int
 bitval (int bits)


             reply	other threads:[~2013-12-13 13:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-13 13:15 Andrew Stubbs [this message]
2013-12-13 15:43 ` Andreas Schwab
2013-12-16 18:23 ` Joseph S. Myers
2013-12-16 20:59 ` Roland McGrath

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=52AB0851.1020909@codesourcery.com \
    --to=ams@codesourcery.com \
    --cc=libc-ports@sourceware.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).