This is the mail archive of the
libc-ports@sources.redhat.com
mailing list for the libc-ports project.
[PATCH] Remove PAGE_SIZE et al from sys/user.h
- From: Andrew Stubbs <ams at codesourcery dot com>
- To: "libc-ports at sourceware dot org" <libc-ports at sourceware dot org>
- Date: Fri, 13 Dec 2013 13:14:57 +0000
- Subject: [PATCH] Remove PAGE_SIZE et al from sys/user.h
- Authentication-results: sourceware.org; auth=none
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
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)