[PATCH] sh: Retrieve SHMLBA value from auxiliary vector

Carmelo AMOROSO carmelo.amoroso at st.com
Mon Nov 29 12:24:02 UTC 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 10/27/2010 10:08 PM, Bernhard Reutner-Fischer wrote:
> On Tue, Sep 21, 2010 at 01:09:27PM +0200, Carmelo AMOROSO wrote:
>  >Due to aliasing issue on SH-4 and SH-3 7705 the SHMLBA was set to be
>  >4 * pagesize, that is misleading for those SH core variants that are not
>  >affected by this issue.
>  >
>  >Starting from kernel 2.6.25-rc1 for SH cpu, the L1D cache shape info
>  >is passed to the user space through the auxiliary vector.From the cache shape
>  >it is possible to decode the dcache way size and compute accurately the value
>  >for shared memory alignment constraint SHMLBA.
>  >
>  >Within the dynamic linker, we don't need to access to the extra entries of the
>  >auxvect, we do this only into __uClibc_main for those architectures that define
>  >to have extra entries. When initialising the auxvt, the cache shape is read and
>  >decoded, through an arch specific macro DL_PLATFORM_AUXV.
>  >
>  >Signed-off-by: Salvatore Cro <salvatore.cro at st.com>
>  >Signed-off-by: Carmelo Amoroso <carmelo.amoroso at st.com>
>  >---
>  > Makefile.in | 4 +-
>  > include/auxvect.h | 18 ++++++++
>  > ldso/ldso/dl-startup.c | 5 +-
>  > libc/misc/elf/Makefile.in | 4 ++
>  > libc/misc/elf/dl-support.c | 23 ++++++++++
>  > libc/misc/internals/__uClibc_main.c | 30 ++++++------
>  > libc/sysdeps/linux/common/bits/auxvect.h | 5 ++
>  > libc/sysdeps/linux/common/bits/kernel-features.h | 5 ++-
>  > libc/sysdeps/linux/sh/Makefile.arch | 7 +++
>  > libc/sysdeps/linux/sh/bits/auxvect.h | 6 +++
>  > libc/sysdeps/linux/sh/bits/shm.h | 12 +++++
>  > libc/sysdeps/linux/sh/dl-support.c | 52 ++++++++++++++++++++++
>  > test/Makefile | 1 +
>  > 13 files changed, 153 insertions(+), 19 deletions(-)
>  > create mode 100644 include/auxvect.h
>  > create mode 100644 libc/sysdeps/linux/common/bits/auxvect.h
>  > create mode 100644 libc/sysdeps/linux/sh/bits/auxvect.h
>  > create mode 100644 libc/sysdeps/linux/sh/dl-support.c
>  >
>  >diff --git a/Makefile.in b/Makefile.in
>  >index 348bc0c..cedd99b 100644
>  >--- a/Makefile.in
>  >+++ b/Makefile.in
>  >@@ -219,7 +219,9 @@ HEADERS_RM- := \
>  > tls.h \
>  > rpc/des_crypt.h \
>  > rpc/key_prot.h \
>  >- rpc/rpc_des.h
>  >+ rpc/rpc_des.h \
>  >+ auxvect.h \
>  >+ bits/auxvect.h \
>  > HEADERS_RM-$(UCLIBC_HAS_UTMPX) += \
>  > bits/utmpx.h \
>  > utmpx.h
>  >diff --git a/include/auxvect.h b/include/auxvect.h
>  >new file mode 100644
>  >index 0000000..5e54a1b
>  >--- /dev/null
>  >+++ b/include/auxvect.h
>  >@@ -0,0 +1,18 @@
>  >+#include <bits/auxvect.h>
>  >+
>  >+/* Check for any broken settings, default value are fine anyway */
>

Hi Bernhard,
thanks for feedback (and fixing a lot of English errors :-P )
.....
[SNIP]
 ....
>  >diff --git a/libc/misc/elf/Makefile.in b/libc/misc/elf/Makefile.in
>  >index 1b4bd8b..e803894 100644
>  >--- a/libc/misc/elf/Makefile.in
>  >+++ b/libc/misc/elf/Makefile.in
>  >@@ -10,6 +10,10 @@ libc_a_CSRC = dl-support.c dl-core.c dl-iterate-phdr.c
>  > CFLAGS-dl-iterate-phdr.c=-D_GNU_SOURCE 
> -I$(top_srcdir)ldso/ldso/$(TARGET_ARCH) -I$(top_srcdir)ldso/include
>  > CFLAGS-dl-core.c=-I$(top_srcdir)ldso/ldso/$(TARGET_ARCH) 
> -I$(top_srcdir)ldso/include
>  >
>  >+ifeq ($(TARGET_ARCH),sh)
>  >+libc_a_CSRC := $(filter-out dl-support.c,$(libc_a_CSRC))
>  >+endif
> 
> I don't like that conceptionally.

I understand...

> Don't we already prefer arch-specific impls over the common ones, even
> in misc/elf?
> 
I don't thin so... I'll check and propose a new patch.

>  >+
>  > MISC_ELF_OUT:=$(top_builddir)libc/misc/elf
>  > MISC_ELF_OBJ:=$(patsubst %.c,$(MISC_ELF_OUT)/%.o,$(libc_a_CSRC))
>  >
> 
> []
> 
>  >diff --git a/libc/sysdeps/linux/common/bits/auxvect.h 
> b/libc/sysdeps/linux/common/bits/auxvect.h
>  >new file mode 100644
>  >index 0000000..b027e69
>  >--- /dev/null
>  >+++ b/libc/sysdeps/linux/common/bits/auxvect.h
>  >@@ -0,0 +1,5 @@
>  >+#include <elf.h>
>  >+
>  >+/* Minimum number of AT entries from auxiliar vector */
>  >+#define AT_BASE_NUM (AT_EGID + 1)
>  >+#define AT_ARCH_EXTRAS 0
> 
> missing copyright info.
> 

ok

>  >diff --git a/test/Makefile b/test/Makefile
>  >index 857ac8a..e416e12 100644
>  >--- a/test/Makefile
>  >+++ b/test/Makefile
>  >@@ -42,6 +42,7 @@ ifeq ($(HAS_NO_THREADS),y)
>  > DIRS := $(filter-out pthread,$(DIRS))
>  > endif
>  >
>  >+DIRS := $(filter-out math,$(DIRS))
> 
> unrelated.
> 

my apologies... garbage in my commit :(

Cheers,
Carmelo


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkzzm2IACgkQoRq/3BrK1s+BNACg1dJ6LsUzAajabB8u9ZzL4UNP
UiwAn1+Cttbvsz8+lb+p5LlQZrwR/kNi
=nvbT
-----END PGP SIGNATURE-----


More information about the uClibc mailing list