From 9b11307b07431bac96f8c8e4367a3747942d5751 Mon Sep 17 00:00:00 2001 From: blogic Date: Sat, 2 Jun 2007 00:46:02 +0000 Subject: add initial support for the crisarchitecture used on foxboards to openwrt git-svn-id: svn://svn.openwrt.org/openwrt/trunk@7439 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- toolchain/uClibc/patches/200-cris-syscall6.patch | 34 ++++++++++++++++++++++++ toolchain/uClibc/patches/230-cris-pagesize.patch | 24 +++++++++++++++++ toolchain/uClibc/patches/240-cris-crt0.patch | 31 +++++++++++++++++++++ 3 files changed, 89 insertions(+) create mode 100644 toolchain/uClibc/patches/200-cris-syscall6.patch create mode 100644 toolchain/uClibc/patches/230-cris-pagesize.patch create mode 100644 toolchain/uClibc/patches/240-cris-crt0.patch (limited to 'toolchain/uClibc/patches') diff --git a/toolchain/uClibc/patches/200-cris-syscall6.patch b/toolchain/uClibc/patches/200-cris-syscall6.patch new file mode 100644 index 000000000..8ecbab5c3 --- /dev/null +++ b/toolchain/uClibc/patches/200-cris-syscall6.patch @@ -0,0 +1,34 @@ +diff -urN uClibc-0.9.28.2.orig/libc/sysdeps/linux/cris/bits/syscalls.h uClibc-0.9.28.2/libc/sysdeps/linux/cris/bits/syscalls.h +--- uClibc-0.9.28.2.orig/libc/sysdeps/linux/cris/bits/syscalls.h 2007-05-15 19:45:43.000000000 +0200 ++++ uClibc-0.9.28.2/libc/sysdeps/linux/cris/bits/syscalls.h 2007-05-15 19:47:20.000000000 +0200 +@@ -62,6 +62,30 @@ + return (type) (INLINE_SYSCALL(name, 5, arg1, arg2, arg3, arg4, arg5)); \ + } + ++#define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \ ++ type5,arg5,type6,arg6) \ ++type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5,type6 arg6) \ ++{ \ ++ register long __a __asm__ ("r10") = (long) arg1; \ ++ register long __b __asm__ ("r11") = (long) arg2; \ ++ register long __c __asm__ ("r12") = (long) arg3; \ ++ register long __d __asm__ ("r13") = (long) arg4; \ ++ register long __n_ __asm__ ("r9") = (__NR_##name); \ ++ __asm__ __volatile__ (".ifnc %0%1%3%4%5,$r10$r9$r11$r12$r13\n\t" \ ++ ".err\n\t" \ ++ ".endif\n\t" \ ++ "move %6,$mof\n\tmove %7,$srp\n\t" \ ++ "break 13" \ ++ : "=r" (__a) \ ++ : "r" (__n_), "0" (__a), "r" (__b), \ ++ "r" (__c), "r" (__d), "g" (arg5), "g" (arg6)\ ++ : "srp"); \ ++ if (__a >= 0) \ ++ return (type) __a; \ ++ __set_errno ( -__a); \ ++ return (type) -1; \ ++} ++ + #undef INLINE_SYSCALL + #define INLINE_SYSCALL(name, nr, args...) \ + ({ \ diff --git a/toolchain/uClibc/patches/230-cris-pagesize.patch b/toolchain/uClibc/patches/230-cris-pagesize.patch new file mode 100644 index 000000000..419617b44 --- /dev/null +++ b/toolchain/uClibc/patches/230-cris-pagesize.patch @@ -0,0 +1,24 @@ +diff -urN uClibc-0.9.28.2.orig/ldso/include/dl-syscall.h uClibc-0.9.28.2/ldso/include/dl-syscall.h +--- uClibc-0.9.28.2.orig/ldso/include/dl-syscall.h 2007-05-22 20:39:28.000000000 +0200 ++++ uClibc-0.9.28.2/ldso/include/dl-syscall.h 2007-05-22 20:41:30.000000000 +0200 +@@ -155,8 +155,9 @@ + static inline void * _dl_mmap(void * addr, unsigned long size, int prot, + int flags, int fd, unsigned long offset) + { +- if (offset & ((1 << MMAP2_PAGE_SHIFT) - 1)) ++ if (offset & ((1 << MMAP2_PAGE_SHIFT) - 1)){ + return MAP_FAILED; ++ } + return __syscall_mmap2(addr, size, prot, flags, + fd, (off_t) (offset >> MMAP2_PAGE_SHIFT)); + } +diff -urN uClibc-0.9.28.2.orig/libc/sysdeps/linux/cris/bits/uClibc_page.h uClibc-0.9.28.2/libc/sysdeps/linux/cris/bits/uClibc_page.h +--- uClibc-0.9.28.2.orig/libc/sysdeps/linux/cris/bits/uClibc_page.h 2007-05-22 20:39:28.000000000 +0200 ++++ uClibc-0.9.28.2/libc/sysdeps/linux/cris/bits/uClibc_page.h 2007-05-22 20:42:25.000000000 +0200 +@@ -24,5 +24,5 @@ + #define PAGE_SHIFT 13 + #define PAGE_SIZE (1UL << PAGE_SHIFT) + #define PAGE_MASK (~(PAGE_SIZE-1)) +- ++#define MMAP2_PAGE_SHIFT PAGE_SHIFT + #endif /* _UCLIBC_PAGE_H */ diff --git a/toolchain/uClibc/patches/240-cris-crt0.patch b/toolchain/uClibc/patches/240-cris-crt0.patch new file mode 100644 index 000000000..d0fa7f3b7 --- /dev/null +++ b/toolchain/uClibc/patches/240-cris-crt0.patch @@ -0,0 +1,31 @@ +diff -urN uClibc-0.9.28.2.orig/libc/sysdeps/linux/cris/crt0.c uClibc-0.9.28.2/libc/sysdeps/linux/cris/crt0.c +--- uClibc-0.9.28.2.orig/libc/sysdeps/linux/cris/crt0.c 2007-05-18 00:27:56.000000000 +0200 ++++ uClibc-0.9.28.2/libc/sysdeps/linux/cris/crt0.c 2007-05-18 00:32:08.000000000 +0200 +@@ -31,11 +31,10 @@ + + #include + +-extern void __uClibc_main(int argc, char **argv, char **envp) +- __attribute__ ((__noreturn__)); +-extern void __uClibc_start_main(int argc, char **argv, char **envp, +- void (*app_init)(void), void (*app_fini)(void)) +- __attribute__ ((__noreturn__)); ++extern void __uClibc_main(int (*main)(int, char **, char **), int argc, ++ char **argv, void (*app_init)(void), void (*app_fini)(void), ++ void (*rtld_fini)(void), void *stack_end) __attribute__ ((__noreturn__)); ++ + extern void weak_function _init(void); + extern void weak_function _fini(void); + +@@ -64,10 +63,5 @@ + */ + --environ; + +-#if defined L_crt0 || ! defined __UCLIBC_CTOR_DTOR__ +- /* Leave control to the libc */ +- __uClibc_main(argc, argv, environ); +-#else +- __uClibc_start_main(argc, argv, environ, _init, _fini); +-#endif ++ __uClibc_main(__mainp, argc, argv, 0, 0, 0, 0); + } -- cgit v1.2.3