This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
[PATCH] Add ABI mandated AT_ entries, prepare powerpc/dl-sysdep.c for new kernels
- To: libc-alpha at sources dot redhat dot com
- Subject: [PATCH] Add ABI mandated AT_ entries, prepare powerpc/dl-sysdep.c for new kernels
- From: Franz Sirl <Franz dot Sirl-kernel at lauterbach dot com>
- Date: Wed, 11 Apr 2001 00:59:33 +0200
Hi,
this patch adds the PPC ABI mandated AT_[DIU]CACHEBSIZE and an additional
AT_IGNOREPPC which will be used by newer kernels to compatibly move to the
standard AUXV setup.
A patch actually setting cache variables and adjusting some mem* routines
with it will follow later.
kernel-features.h needs a finalizing patch too as soon as the kernel patch
reaches an official kernel.
Tested on both standard and fixed kernels.
Franz.
* elf/elf.h (AT_DCACHEBSIZE, AT_ICACHEBSIZE, AT_UCACHEBSIZE,
AT_IGNOREPPC): New defines.
* sysdeps/generic/dl-sysdep.c (_dl_show_auxv): Print them.
* sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_STD_AUXV):
Define for newer powerpc kernels.
* sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c: Use the standard
DL_FIND_ARG_COMPONENTS if __ASSUME_STD_AUXV is defined.
Index: elf/elf.h
===================================================================
RCS file: /cvs/glibc/libc/elf/elf.h,v
retrieving revision 1.94
diff -u -p -r1.94 elf.h
--- elf/elf.h 2001/04/09 04:03:56 1.94
+++ elf/elf.h 2001/04/10 20:37:06
@@ -893,6 +893,15 @@ typedef struct
performed by the kernel. */
#define AT_FPUCW 18 /* Used FPU control word. */
+/* Cache block sizes. */
+#define AT_DCACHEBSIZE 19 /* Data cache block size. */
+#define AT_ICACHEBSIZE 20 /* Instruction cache block size. */
+#define AT_UCACHEBSIZE 21 /* Unified cache block size. */
+
+/* A special ignored value for PPC, used by the kernel to control the
+ interpretation of the AUXV. Must be > 16. */
+#define AT_IGNOREPPC 22 /* Entry should be ignored */
+
/* Note section contents. Each entry in the note section begins with
a header of a fixed form. */
Index: sysdeps/generic/dl-sysdep.c
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/generic/dl-sysdep.c,v
retrieving revision 1.62
diff -u -p -r1.62 dl-sysdep.c
--- sysdeps/generic/dl-sysdep.c 2001/02/28 06:22:18 1.62
+++ sysdeps/generic/dl-sysdep.c 2001/04/10 20:37:36
@@ -227,27 +227,30 @@ _dl_show_auxv (void)
{
static const struct
{
- const char label[16];
+ const char label[20];
enum { dec, hex, str } form;
} auxvars[] =
{
- [AT_EXECFD - 2] = { "AT_EXECFD: ", dec },
- [AT_PHDR - 2] = { "AT_PHDR: 0x", hex },
- [AT_PHENT - 2] = { "AT_PHENT: ", dec },
- [AT_PHNUM - 2] = { "AT_PHNUM: ", dec },
- [AT_PAGESZ - 2] = { "AT_PAGESZ: ", dec },
- [AT_BASE - 2] = { "AT_BASE: 0x", hex },
- [AT_FLAGS - 2] = { "AT_FLAGS: 0x", hex },
- [AT_ENTRY - 2] = { "AT_ENTRY: 0x", hex },
- [AT_NOTELF - 2] = { "AT_NOTELF: ", hex },
- [AT_UID - 2] = { "AT_UID: ", dec },
- [AT_EUID - 2] = { "AT_EUID: ", dec },
- [AT_GID - 2] = { "AT_GID: ", dec },
- [AT_EGID - 2] = { "AT_EGID: ", dec },
- [AT_PLATFORM - 2] = { "AT_PLATFORM: ", str },
- [AT_HWCAP - 2] = { "AT_HWCAP: ", hex },
- [AT_CLKTCK - 2] = { "AT_CLKTCK: ", dec },
- [AT_FPUCW - 2] = { "AT_FPUCW: ", hex }
+ [AT_EXECFD - 2] = { "AT_EXECFD: ", dec },
+ [AT_PHDR - 2] = { "AT_PHDR: 0x", hex },
+ [AT_PHENT - 2] = { "AT_PHENT: ", dec },
+ [AT_PHNUM - 2] = { "AT_PHNUM: ", dec },
+ [AT_PAGESZ - 2] = { "AT_PAGESZ: ", dec },
+ [AT_BASE - 2] = { "AT_BASE: 0x", hex },
+ [AT_FLAGS - 2] = { "AT_FLAGS: 0x", hex },
+ [AT_ENTRY - 2] = { "AT_ENTRY: 0x", hex },
+ [AT_NOTELF - 2] = { "AT_NOTELF: ", hex },
+ [AT_UID - 2] = { "AT_UID: ", dec },
+ [AT_EUID - 2] = { "AT_EUID: ", dec },
+ [AT_GID - 2] = { "AT_GID: ", dec },
+ [AT_EGID - 2] = { "AT_EGID: ", dec },
+ [AT_PLATFORM - 2] = { "AT_PLATFORM: ", str },
+ [AT_HWCAP - 2] = { "AT_HWCAP: ", hex },
+ [AT_CLKTCK - 2] = { "AT_CLKTCK: ", dec },
+ [AT_FPUCW - 2] = { "AT_FPUCW: ", hex },
+ [AT_DCACHEBSIZE - 2] = { "AT_DCACHEBSIZE: 0x", hex },
+ [AT_ICACHEBSIZE - 2] = { "AT_ICACHEBSIZE: 0x", hex },
+ [AT_UCACHEBSIZE - 2] = { "AT_UCACHEBSIZE: 0x", hex }
};
unsigned int idx = (unsigned int) (av->a_type - 2);
Index: sysdeps/unix/sysv/linux/kernel-features.h
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/kernel-features.h,v
retrieving revision 1.22
diff -u -p -r1.22 kernel-features.h
--- sysdeps/unix/sysv/linux/kernel-features.h 2001/01/19 05:15:42 1.22
+++ sysdeps/unix/sysv/linux/kernel-features.h 2001/04/10 20:37:45
@@ -163,3 +163,8 @@
#if __LINUX_KERNEL_VERSION >= 132097
# define __ASSUME_AT_PAGESIZE 1
#endif
+
+/* Starting with 2.4.? kernels PPC passes the AUXV in the standard way. */
+#if __LINUX_KERNEL_VERSION >= (132096+99) && defined __powerpc__
+# define __ASSUME_STD_AUXV 1
+#endif
Index: sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c,v
retrieving revision 1.14
diff -u -p -r1.14 dl-sysdep.c
--- sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c 1998/12/31 18:17:19 1.14
+++ sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c 2001/04/10 20:37:46
@@ -18,6 +18,11 @@
Boston, MA 02111-1307, USA. */
+#include "config.h"
+#include "kernel-features.h"
+
+#ifndef __ASSUME_STD_AUXV
+
/* The PowerPC's auxiliary argument block gets aligned to a 16-byte
boundary. This is history and impossible to change compatibly. */
@@ -45,6 +50,6 @@
_tmp = (char **)_test; \
(auxp) = (ElfW(auxv_t) *) _tmp; \
} while (0)
-
+#endif
#include <sysdeps/unix/sysv/linux/dl-sysdep.c>