* [PATCH] Remove PAGE_SIZE et al from sys/user.h
@ 2013-12-13 13:15 Andrew Stubbs
2013-12-13 15:43 ` Andreas Schwab
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Andrew Stubbs @ 2013-12-13 13:15 UTC (permalink / raw)
To: libc-ports
[-- 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)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Remove PAGE_SIZE et al from sys/user.h
2013-12-13 13:15 [PATCH] Remove PAGE_SIZE et al from sys/user.h Andrew Stubbs
@ 2013-12-13 15:43 ` Andreas Schwab
2013-12-16 18:23 ` Joseph S. Myers
2013-12-16 20:59 ` Roland McGrath
2 siblings, 0 replies; 4+ messages in thread
From: Andreas Schwab @ 2013-12-13 15:43 UTC (permalink / raw)
To: Andrew Stubbs; +Cc: libc-ports
Andrew Stubbs <ams@codesourcery.com> writes:
> 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>
This has no place in stdlib.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Remove PAGE_SIZE et al from sys/user.h
2013-12-13 13:15 [PATCH] Remove PAGE_SIZE et al from sys/user.h Andrew Stubbs
2013-12-13 15:43 ` Andreas Schwab
@ 2013-12-16 18:23 ` Joseph S. Myers
2013-12-16 20:59 ` Roland McGrath
2 siblings, 0 replies; 4+ messages in thread
From: Joseph S. Myers @ 2013-12-16 18:23 UTC (permalink / raw)
To: Andrew Stubbs; +Cc: libc-ports
On Fri, 13 Dec 2013, Andrew Stubbs wrote:
> 2013-12-12 Andrew Stubbs <ams@codesourcery.com>
>
[BZ #16191]
(in each ChangeLog file getting an entry from this change)
> ports/
There are separate ChangeLogs for each architecture.
The MIPS changes are OK, but of course only list the bug in the list of
fixed bugs in NEWS, and close it, once the fixes for *all* architectures
are checked in (and keep pinging the fixes for other architectures as
needed until then, remembering to CC architecture maintainers if needed).
--
Joseph S. Myers
joseph@codesourcery.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Remove PAGE_SIZE et al from sys/user.h
2013-12-13 13:15 [PATCH] Remove PAGE_SIZE et al from sys/user.h Andrew Stubbs
2013-12-13 15:43 ` Andreas Schwab
2013-12-16 18:23 ` Joseph S. Myers
@ 2013-12-16 20:59 ` Roland McGrath
2 siblings, 0 replies; 4+ messages in thread
From: Roland McGrath @ 2013-12-16 20:59 UTC (permalink / raw)
To: Andrew Stubbs; +Cc: libc-ports
This is a user-visible API change, and so needs a BZ# by policy.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-12-16 20:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-13 13:15 [PATCH] Remove PAGE_SIZE et al from sys/user.h Andrew Stubbs
2013-12-13 15:43 ` Andreas Schwab
2013-12-16 18:23 ` Joseph S. Myers
2013-12-16 20:59 ` Roland McGrath
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).