uClibc patches for sh-2
Paul Mundt
lethal at linux-sh.org
Mon Oct 16 07:39:46 PDT 2006
On Mon, Oct 16, 2006 at 02:31:07PM +0100, Mark Shinwell wrote:
> I have developed the attached patch that permits uClibc to work
> correctly with sh-2 processors. (Paul, this requires Sato-san's kernel
> patches.)
>
I'm still not entirely convinced that it's worthwhile to have separate
trapa bases for SH-2{A,} and everyone else, but changing SH-3/4 again is
going to be much more problematic than simply having the SH-2{A,} ABI
different. On the other hand, we have little gaurantee that future trapa
encodings won't simply be trampled for other exception slots again, we're
probably going to have to start versioning the ABI at some point rather
than having the kernel trying to trap and fix up all of the bases.
Sato-san's patches missed the 2.6.19 merge window, but they're already in
my 2.6.20 queue.
> I'd like to obtain some feedback as to whether a patch like this is going
> to be acceptable. If it is, then I will test it on the uClibc trunk --
> although it might be best to wait until the kernel patches mentioned above
> are merged into the main tree. Currently, the patch has been thoroughly
> tested with a previous version of uClibc, and does indeed work correctly
> there.
>
The parts that simply change the trapa base are fairly negligible, and
those can be merged in to uClibc before the kernel catches up, as it's
not going to have any adverse effects there. These bits I don't mind
merging, however:
> --- Rules.mak (revision 16216)
> +++ Rules.mak (working copy)
> @@ -345,9 +345,11 @@ ifeq ($(UCLIBC_HAS_SOFT_FLOAT),y)
> # soft float encodings.
> ifneq ($(TARGET_ARCH),nios)
> ifneq ($(TARGET_ARCH),nios2)
> +ifneq ($(CONFIG_SH2),y)
> CFLAGS += -msoft-float
> endif
> endif
> +endif
This is not really limited to SH-2, unless you know of some -msoft-float
patches for the other targets that I'm unaware of.
This also looks like something we need a seperate config option for,
rather than having the architecture list start piling up...
> Index: libc/sysdeps/linux/sh/crt1.S
> ===================================================================
> --- libc/sysdeps/linux/sh/crt1.S (revision 16216)
> +++ libc/sysdeps/linux/sh/crt1.S (working copy)
> @@ -49,6 +49,11 @@ _start:
> mov r15, r6
>
> /* Push the fini func onto the stack */
> +#ifdef __ARCH_HAS_NO_MMU__
> + /* ucLinux doesn't seem to provide a valid loader finalization
> + function pointer. */
> + mov #0, r4
> +#endif
> mov.l r4, at -r15
> mov.l L_fini,r0
> mov.l r0, at -r15
Can you explain this change in more detail?
> Index: libc/sysdeps/linux/sh/mmap.c
> ===================================================================
> --- libc/sysdeps/linux/sh/mmap.c (revision 16216)
> +++ libc/sysdeps/linux/sh/mmap.c (working copy)
> @@ -26,9 +26,7 @@
> libc_hidden_proto(mmap)
>
> #ifdef HIOS
> -# define __SH_SYSCALL6_TRAPA "0x2E"
> -#else
> -# define __SH_SYSCALL6_TRAPA "0x15"
> +# define __SH_SYSCALL6_TRAPA 0x2E
> #endif
>
> #include <sys/syscall.h>
Why?
Beyond that, there's not too much of issue in these particular patches,
so we can merge them for 0.9.29 if that's the extent of the changes you
require.
More information about the uClibc
mailing list