This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "uClibc-ng - small C library for embedded systems".
The branch, master has been updated
via b6b726d407d1ac6c0789247a98b4e5cae7ac991f (commit)
from d752724d4dce488a38f464a52f367e585da71075 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit b6b726d407d1ac6c0789247a98b4e5cae7ac991f
Author: Waldemar Brodkorb <wbx(a)openadk.org>
Date: Sat Oct 17 11:17:07 2015 +0200
lm32: add new architecture
Add support for FPGA systems from Lattice Semiconductor
http://www.latticesemi.com
Merge
https://github.com/m-labs/uclibc-lm32.git
-----------------------------------------------------------------------
Summary of changes:
Rules.mak | 2 +
extra/Configs/Config.in | 8 +++
extra/Configs/{Config.nios2 => Config.lm32} | 6 +-
extra/Configs/defconfigs/lm32 | 1 +
libc/sysdeps/linux/{alpha => lm32}/Makefile | 0
.../{Makefile.in => linux/lm32/Makefile.arch} | 3 +-
libc/sysdeps/linux/lm32/__longjmp.S | 40 +++++++++++++
libc/sysdeps/linux/{i960 => lm32}/bits/endian.h | 4 +-
.../linux/{microblaze => lm32}/bits/fcntl.h | 9 +--
libc/sysdeps/linux/lm32/bits/kernel_stat.h | 50 +++++++++++++++++
libc/sysdeps/linux/lm32/bits/kernel_types.h | 37 ++++++++++++
libc/sysdeps/linux/lm32/bits/setjmp.h | 24 ++++++++
libc/sysdeps/linux/{or1k => lm32}/bits/stackinfo.h | 4 +-
libc/sysdeps/linux/lm32/bits/syscalls.h | 59 ++++++++++++++++++++
.../{v850 => lm32}/bits/uClibc_arch_features.h | 4 +-
.../linux/{common => lm32}/bits/uClibc_page.h | 8 +--
libc/sysdeps/linux/{h8300 => lm32}/bits/wordsize.h | 0
libc/sysdeps/linux/lm32/clone.S | 52 +++++++++++++++++
libc/sysdeps/linux/lm32/crt1.S | 21 +++++++
libc/sysdeps/linux/lm32/crti.S | 17 ++++++
libc/sysdeps/linux/lm32/crtn.S | 11 ++++
libc/sysdeps/linux/lm32/setjmp.S | 53 ++++++++++++++++++
.../linux/{microblaze => lm32}/sys/procfs.h | 24 ++------
.../linux/{microblaze => lm32}/sys/ucontext.h | 7 ++-
libc/sysdeps/linux/{powerpc => lm32}/sys/user.h | 5 +-
libc/sysdeps/linux/lm32/vfork.S | 42 ++++++++++++++
26 files changed, 446 insertions(+), 45 deletions(-)
copy extra/Configs/{Config.nios2 => Config.lm32} (86%)
create mode 100644 extra/Configs/defconfigs/lm32
copy libc/sysdeps/linux/{alpha => lm32}/Makefile (100%)
copy libc/sysdeps/{Makefile.in => linux/lm32/Makefile.arch} (75%)
create mode 100644 libc/sysdeps/linux/lm32/__longjmp.S
copy libc/sysdeps/linux/{i960 => lm32}/bits/endian.h (92%)
copy libc/sysdeps/linux/{microblaze => lm32}/bits/fcntl.h (96%)
create mode 100644 libc/sysdeps/linux/lm32/bits/kernel_stat.h
create mode 100644 libc/sysdeps/linux/lm32/bits/kernel_types.h
create mode 100644 libc/sysdeps/linux/lm32/bits/setjmp.h
copy libc/sysdeps/linux/{or1k => lm32}/bits/stackinfo.h (91%)
create mode 100644 libc/sysdeps/linux/lm32/bits/syscalls.h
copy libc/sysdeps/linux/{v850 => lm32}/bits/uClibc_arch_features.h (91%)
copy libc/sysdeps/linux/{common => lm32}/bits/uClibc_page.h (76%)
copy libc/sysdeps/linux/{h8300 => lm32}/bits/wordsize.h (100%)
create mode 100644 libc/sysdeps/linux/lm32/clone.S
create mode 100644 libc/sysdeps/linux/lm32/crt1.S
create mode 100644 libc/sysdeps/linux/lm32/crti.S
create mode 100644 libc/sysdeps/linux/lm32/crtn.S
create mode 100644 libc/sysdeps/linux/lm32/setjmp.S
copy libc/sysdeps/linux/{microblaze => lm32}/sys/procfs.h (85%)
copy libc/sysdeps/linux/{microblaze => lm32}/sys/ucontext.h (86%)
copy libc/sysdeps/linux/{powerpc => lm32}/sys/user.h (89%)
create mode 100644 libc/sysdeps/linux/lm32/vfork.S
diff --git a/Rules.mak b/Rules.mak
index f0abd3b..f26d6cf 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -299,6 +299,7 @@ CPU_CFLAGS-y += $(CFLAG_-fmerge-all-constants)
LDADD_LIBFLOAT=
ifeq ($(UCLIBC_HAS_SOFT_FLOAT),y)
ifneq ($(TARGET_ARCH),bfin)
+ifneq ($(TARGET_ARCH),lm32)
ifneq ($(TARGET_ARCH),nios2)
ifneq ($(TARGET_ARCH),sh)
ifneq ($(TARGET_ARCH),c6x)
@@ -310,6 +311,7 @@ endif
endif
endif
endif
+endif
$(eval $(call check-gcc-var,-std=gnu99))
CPU_CFLAGS-y += $(CFLAG_-std=gnu99)
diff --git a/extra/Configs/Config.in b/extra/Configs/Config.in
index d22d1e7..48ce506 100644
--- a/extra/Configs/Config.in
+++ b/extra/Configs/Config.in
@@ -27,6 +27,7 @@ choice
default TARGET_i386 if DESIRED_TARGET_ARCH = "i386"
default TARGET_i960 if DESIRED_TARGET_ARCH = "i960"
default TARGET_ia64 if DESIRED_TARGET_ARCH = "ia64"
+ default TARGET_lm32 if DESIRED_TARGET_ARCH = "lm32"
default TARGET_m68k if DESIRED_TARGET_ARCH = "m68k"
default TARGET_metag if DESIRED_TARGET_ARCH = "metag"
default TARGET_microblaze if DESIRED_TARGET_ARCH = "microblaze"
@@ -83,6 +84,9 @@ config TARGET_i960
config TARGET_ia64
bool "ia64"
+config TARGET_lm32
+ bool "lm32"
+
config TARGET_m68k
bool "m68k"
@@ -168,6 +172,10 @@ if TARGET_ia64
source "extra/Configs/Config.ia64"
endif
+if TARGET_lm32
+source "extra/Configs/Config.lm32"
+endif
+
if TARGET_m68k
source "extra/Configs/Config.m68k"
endif
diff --git a/extra/Configs/Config.nios2 b/extra/Configs/Config.lm32
similarity index 86%
copy from extra/Configs/Config.nios2
copy to extra/Configs/Config.lm32
index 8bb8aca..8077267 100644
--- a/extra/Configs/Config.nios2
+++ b/extra/Configs/Config.lm32
@@ -5,13 +5,13 @@
config TARGET_ARCH
string
- default "nios2"
+ default "lm32"
config FORCE_OPTIONS_FOR_ARCH
bool
default y
- select ARCH_LITTLE_ENDIAN
+ select ARCH_BIG_ENDIAN
select ARCH_HAS_NO_MMU
select ARCH_HAS_NO_LDSO
- select ARCH_HAS_DEPRECATED_SYSCALLS
select HAVE_NO_PIC
+ select ARCH_HAS_DEPRECATED_SYSCALLS
diff --git a/extra/Configs/defconfigs/lm32 b/extra/Configs/defconfigs/lm32
new file mode 100644
index 0000000..63fb19d
--- /dev/null
+++ b/extra/Configs/defconfigs/lm32
@@ -0,0 +1 @@
+TARGET_lm32=y
diff --git a/libc/sysdeps/linux/alpha/Makefile b/libc/sysdeps/linux/lm32/Makefile
similarity index 100%
copy from libc/sysdeps/linux/alpha/Makefile
copy to libc/sysdeps/linux/lm32/Makefile
diff --git a/libc/sysdeps/Makefile.in b/libc/sysdeps/linux/lm32/Makefile.arch
similarity index 75%
copy from libc/sysdeps/Makefile.in
copy to libc/sysdeps/linux/lm32/Makefile.arch
index 686cb72..eed9e7b 100644
--- a/libc/sysdeps/Makefile.in
+++ b/libc/sysdeps/linux/lm32/Makefile.arch
@@ -5,4 +5,5 @@
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
-include $(top_srcdir)libc/sysdeps/linux/Makefile.in
+CSRC :=
+SSRC := clone.S setjmp.S __longjmp.S vfork.S
diff --git a/libc/sysdeps/linux/lm32/__longjmp.S b/libc/sysdeps/linux/lm32/__longjmp.S
new file mode 100644
index 0000000..cbb55f0
--- /dev/null
+++ b/libc/sysdeps/linux/lm32/__longjmp.S
@@ -0,0 +1,40 @@
+#define _SETJMP_H
+#define _ASM
+#include <bits/setjmp.h>
+
+#include <libc-symbols.h>
+
+.text
+.global C_SYMBOL_NAME(__longjmp)
+.type C_SYMBOL_NAME(__longjmp),@function
+.align 4
+
+C_SYMBOL_NAME(__longjmp):
+ /* load registers relative from r5 (arg0) */
+ lw r11, (r1+0)
+ lw r12, (r1+4)
+ lw r13, (r1+8)
+ lw r14, (r1+12)
+ lw r15, (r1+16)
+ lw r16, (r1+20)
+ lw r17, (r1+24)
+ lw r18, (r1+28)
+ lw r19, (r1+32)
+ lw r20, (r1+36)
+ lw r21, (r1+40)
+ lw r22, (r1+44)
+ lw r23, (r1+48)
+ lw r24, (r1+52)
+ lw r25, (r1+56)
+ lw gp, (r1+60)
+ lw fp, (r1+64)
+ lw sp, (r1+68)
+ lw ra, (r1+72)
+
+ mv r1, r2 /* copy val */
+ bne r1, r0, 1f
+ mvi r1, 1 /* val was zero, set it to 1 */
+1:
+ ret
+
+libc_hidden_def(__longjmp)
diff --git a/libc/sysdeps/linux/i960/bits/endian.h
b/libc/sysdeps/linux/lm32/bits/endian.h
similarity index 92%
copy from libc/sysdeps/linux/i960/bits/endian.h
copy to libc/sysdeps/linux/lm32/bits/endian.h
index e2b1316..1acee18 100644
--- a/libc/sysdeps/linux/i960/bits/endian.h
+++ b/libc/sysdeps/linux/lm32/bits/endian.h
@@ -10,6 +10,4 @@
# error "Never use <bits/endian.h> directly; include <endian.h>
instead."
#endif
-#define __BYTE_ORDER __LITTLE_ENDIAN
-
-
+#define __BYTE_ORDER __BIG_ENDIAN
diff --git a/libc/sysdeps/linux/microblaze/bits/fcntl.h
b/libc/sysdeps/linux/lm32/bits/fcntl.h
similarity index 96%
copy from libc/sysdeps/linux/microblaze/bits/fcntl.h
copy to libc/sysdeps/linux/lm32/bits/fcntl.h
index e7651e8..44e8f3f 100644
--- a/libc/sysdeps/linux/microblaze/bits/fcntl.h
+++ b/libc/sysdeps/linux/lm32/bits/fcntl.h
@@ -13,8 +13,9 @@
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
#ifndef _FCNTL_H
# error "Never use <bits/fcntl.h> directly; include <fcntl.h>
instead."
@@ -98,8 +99,8 @@
# define F_NOTIFY 1026 /* Request notfications on a directory. */
# define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
close-on-exit set on new fd. */
-# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */
-# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */
+# define F_SETPIPE_SZ 1031 /* Set of pipe page size array */
+# define F_GETPIPE_SZ 1032 /* Get of pipe page size array */
#endif
/* For F_[GET|SET]FL. */
diff --git a/libc/sysdeps/linux/lm32/bits/kernel_stat.h
b/libc/sysdeps/linux/lm32/bits/kernel_stat.h
new file mode 100644
index 0000000..c998b56
--- /dev/null
+++ b/libc/sysdeps/linux/lm32/bits/kernel_stat.h
@@ -0,0 +1,50 @@
+#ifndef _BITS_STAT_STRUCT_H
+#define _BITS_STAT_STRUCT_H
+
+#ifndef _LIBC
+#error bits/kernel_stat.h is for internal uClibc use only!
+#endif
+
+struct kernel_stat
+{
+ unsigned long st_dev; /* Device. */
+ unsigned long st_ino; /* File serial number. */
+ unsigned int st_mode; /* File mode. */
+ unsigned int st_nlink; /* Link count. */
+ unsigned int st_uid; /* User ID of the file's owner. */
+ unsigned int st_gid; /* Group ID of the file's group. */
+ unsigned long st_rdev; /* Device number, if device. */
+ unsigned long __pad1;
+ long st_size; /* Size of file, in bytes. */
+ int st_blksize; /* Optimal block size for I/O. */
+ int __pad2;
+ long st_blocks; /* Number 512-byte blocks allocated. */
+ struct timespec st_atim; /* Time of last access. */
+ struct timespec st_mtim; /* Time of last modification. */
+ struct timespec st_ctim; /* Time of last status change. */
+ unsigned int __unused4;
+ unsigned int __unused5;
+};
+
+struct kernel_stat64
+{
+ unsigned long long st_dev; /* Device. */
+ unsigned long long st_ino; /* File serial number. */
+ unsigned int st_mode; /* File mode. */
+ unsigned int st_nlink; /* Link count. */
+ unsigned int st_uid; /* User ID of the file's owner. */
+ unsigned int st_gid; /* Group ID of the file's group. */
+ unsigned long long st_rdev; /* Device number, if device. */
+ unsigned long long __pad1;
+ long long st_size; /* Size of file, in bytes. */
+ int st_blksize; /* Optimal block size for I/O. */
+ int __pad2;
+ long long st_blocks; /* Number 512-byte blocks allocated. */
+ struct timespec st_atim; /* Time of last access. */
+ struct timespec st_mtim; /* Time of last modification. */
+ struct timespec st_ctim; /* Time of last status change. */
+ unsigned int __unused4;
+ unsigned int __unused5;
+};
+
+#endif /* _BITS_STAT_STRUCT_H */
diff --git a/libc/sysdeps/linux/lm32/bits/kernel_types.h
b/libc/sysdeps/linux/lm32/bits/kernel_types.h
new file mode 100644
index 0000000..2c3c6df
--- /dev/null
+++ b/libc/sysdeps/linux/lm32/bits/kernel_types.h
@@ -0,0 +1,37 @@
+#ifndef __ASM_GENERIC_POSIX_TYPES_H
+#define __ASM_GENERIC_POSIX_TYPES_H
+
+typedef unsigned long __kernel_ino_t;
+typedef unsigned int __kernel_mode_t;
+typedef unsigned long __kernel_nlink_t;
+typedef long __kernel_off_t;
+typedef int __kernel_pid_t;
+typedef int __kernel_ipc_pid_t;
+typedef unsigned int __kernel_uid_t;
+typedef unsigned int __kernel_gid_t;
+typedef unsigned int __kernel_size_t;
+typedef int __kernel_ssize_t;
+typedef int __kernel_ptrdiff_t;
+typedef long __kernel_time_t;
+typedef long __kernel_suseconds_t;
+typedef long __kernel_clock_t;
+typedef int __kernel_timer_t;
+typedef int __kernel_clockid_t;
+typedef int __kernel_daddr_t;
+typedef char * __kernel_caddr_t;
+typedef unsigned short __kernel_uid16_t;
+typedef unsigned short __kernel_gid16_t;
+typedef __kernel_uid_t __kernel_uid32_t;
+typedef __kernel_gid_t __kernel_gid32_t;
+
+typedef __kernel_uid_t __kernel_old_uid_t;
+typedef __kernel_gid_t __kernel_old_gid_t;
+typedef unsigned int __kernel_old_dev_t;
+
+typedef long long __kernel_loff_t;
+
+typedef struct {
+ int val[2];
+} __kernel_fsid_t;
+
+#endif /* __ASM_GENERIC_POSIX_TYPES_H */
diff --git a/libc/sysdeps/linux/lm32/bits/setjmp.h
b/libc/sysdeps/linux/lm32/bits/setjmp.h
new file mode 100644
index 0000000..6798083
--- /dev/null
+++ b/libc/sysdeps/linux/lm32/bits/setjmp.h
@@ -0,0 +1,24 @@
+#ifndef _BITS_SETJMP_H
+#define _BITS_SETJMP_H 1
+
+#if !defined _SETJMP_H && !defined _PTHREAD_H
+# error "Never include <bits/setjmp.h> directly; use <setjmp.h>
instead."
+#endif
+
+#ifndef _ASM
+typedef struct
+ {
+ int __regs[15]; /* callee-saved registers r11-r25 */
+ void *__gp; /* global pointer */
+ void *__fp; /* frame pointer */
+ void *__sp; /* stack pointer */
+ void *__ra; /* return address */
+ } __jmp_buf[1];
+#endif
+
+/* Test if longjmp to JMPBUF would unwind the frame
+ containing a local variable at ADDRESS. */
+#define _JMPBUF_UNWINDS(jmpbuf, address) \
+ ((void *) (address) < (void *) (jmpbuf)[0].__sp)
+
+#endif
diff --git a/libc/sysdeps/linux/or1k/bits/stackinfo.h
b/libc/sysdeps/linux/lm32/bits/stackinfo.h
similarity index 91%
copy from libc/sysdeps/linux/or1k/bits/stackinfo.h
copy to libc/sysdeps/linux/lm32/bits/stackinfo.h
index 12d46a0..695616e 100644
--- a/libc/sysdeps/linux/or1k/bits/stackinfo.h
+++ b/libc/sysdeps/linux/lm32/bits/stackinfo.h
@@ -17,12 +17,12 @@
02111-1307 USA. */
/* This file contains a bit of information about the stack allocation
- of the processor. */
+ of the processor. Since there is no general truth we can't say
+ anything here. */
#ifndef _STACKINFO_H
#define _STACKINFO_H 1
-/* On or1k the stack grows down. */
#define _STACK_GROWS_DOWN 1
#endif /* stackinfo.h */
diff --git a/libc/sysdeps/linux/lm32/bits/syscalls.h
b/libc/sysdeps/linux/lm32/bits/syscalls.h
new file mode 100644
index 0000000..2956954
--- /dev/null
+++ b/libc/sysdeps/linux/lm32/bits/syscalls.h
@@ -0,0 +1,59 @@
+#ifndef _BITS_SYSCALLS_H
+#define _BITS_SYSCALLS_H
+#ifndef _SYSCALL_H
+# error "Never use <bits/syscalls.h> directly; include <sys/syscall.h>
instead."
+#endif
+
+
+#ifndef __ASSEMBLER__
+
+#define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \
+ ({ \
+ LOAD_ARGS_##nr (args); \
+ register int __ret __asm__("r1"); \
+ register int _scno __asm__("r8") = name; \
+ __asm__ __volatile__("scall" \
+ : "=r" (__ret) \
+ : "r"(_scno) ASM_ARGS_##nr \
+ : __SYSCALL_CLOBBERS ); \
+ __ret; \
+ })
+
+/* original port had ret >= -125 ?! */
+#define LOAD_ARGS_0() do { } while(0)
+#define ASM_ARGS_0
+#define LOAD_ARGS_1(a1) \
+ int _a1 = (int)(a1); \
+ LOAD_ARGS_0(); \
+ register int __a1 __asm__("r1") = _a1
+#define ASM_ARGS_1 ASM_ARGS_0, "0"(__a1)
+#define LOAD_ARGS_2(a1, a2) \
+ int _a2 = (int)(a2); \
+ LOAD_ARGS_1(a1); \
+ register int __a2 __asm__("r2") = _a2
+#define ASM_ARGS_2 ASM_ARGS_1, "r"(__a2)
+#define LOAD_ARGS_3(a1, a2, a3) \
+ int _a3 = (int)(a3); \
+ LOAD_ARGS_2(a1, a2); \
+ register int __a3 __asm__("r3") = _a3
+#define ASM_ARGS_3 ASM_ARGS_2, "r"(__a3)
+#define LOAD_ARGS_4(a1, a2, a3, a4) \
+ int _a4 = (int)(a4); \
+ LOAD_ARGS_3(a1, a2, a3); \
+ register int __a4 __asm__("r4") = _a4
+#define ASM_ARGS_4 ASM_ARGS_3, "r"(__a4)
+#define LOAD_ARGS_5(a1, a2, a3, a4, a5) \
+ int _a5 = (int)(a5); \
+ LOAD_ARGS_4(a1, a2, a3, a4); \
+ register int __a5 __asm__("r5") = _a5
+#define ASM_ARGS_5 ASM_ARGS_4, "r"(__a5)
+#define LOAD_ARGS_6(a1, a2, a3, a4, a5, a6) \
+ int _a6 = (int)(a6); \
+ LOAD_ARGS_5(a1, a2, a3, a4, a5); \
+ register int __a6 __asm__("r6") = _a6
+#define ASM_ARGS_6 ASM_ARGS_5, "r"(__a6)
+
+#define __SYSCALL_CLOBBERS
+
+#endif /* __ASSEMBLER__ */
+#endif /* _BITS_SYSCALLS_H */
diff --git a/libc/sysdeps/linux/v850/bits/uClibc_arch_features.h
b/libc/sysdeps/linux/lm32/bits/uClibc_arch_features.h
similarity index 91%
copy from libc/sysdeps/linux/v850/bits/uClibc_arch_features.h
copy to libc/sysdeps/linux/lm32/bits/uClibc_arch_features.h
index b76b861..4bab547 100644
--- a/libc/sysdeps/linux/v850/bits/uClibc_arch_features.h
+++ b/libc/sysdeps/linux/lm32/bits/uClibc_arch_features.h
@@ -12,8 +12,8 @@
/* can your target use syscall6() for mmap ? */
#define __UCLIBC_MMAP_HAS_6_ARGS__
-/* does your target align 64bit values in register pairs ? (32bit arches only) */
-#undef __UCLIBC_SYSCALL_ALIGN_64BIT__
+/* does your target use syscall4() for truncate64 ? (32bit arches only) */
+#undef __UCLIBC_TRUNCATE64_HAS_4_ARGS__
/* does your target have a broken create_module() ? */
#undef __UCLIBC_BROKEN_CREATE_MODULE__
diff --git a/libc/sysdeps/linux/common/bits/uClibc_page.h
b/libc/sysdeps/linux/lm32/bits/uClibc_page.h
similarity index 76%
copy from libc/sysdeps/linux/common/bits/uClibc_page.h
copy to libc/sysdeps/linux/lm32/bits/uClibc_page.h
index d1f9262..a2d7ea2 100644
--- a/libc/sysdeps/linux/common/bits/uClibc_page.h
+++ b/libc/sysdeps/linux/lm32/bits/uClibc_page.h
@@ -11,16 +11,14 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with the GNU C Library; see the file COPYING.LIB. If
- * not, see <http://www.gnu.org/licenses/>.
+ * License along with the GNU C Library; if not, write to the Free
+ * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * 02111-1307 USA.
*/
-/* Supply an architecture specific value for PAGE_SIZE and friends. */
-
#ifndef _UCLIBC_PAGE_H
#define _UCLIBC_PAGE_H
-/* PAGE_SHIFT determines the page size -- in this case 4096 */
#define PAGE_SHIFT 12
#define PAGE_SIZE (1UL << PAGE_SHIFT)
#define PAGE_MASK (~(PAGE_SIZE-1))
diff --git a/libc/sysdeps/linux/h8300/bits/wordsize.h
b/libc/sysdeps/linux/lm32/bits/wordsize.h
similarity index 100%
copy from libc/sysdeps/linux/h8300/bits/wordsize.h
copy to libc/sysdeps/linux/lm32/bits/wordsize.h
diff --git a/libc/sysdeps/linux/lm32/clone.S b/libc/sysdeps/linux/lm32/clone.S
new file mode 100644
index 0000000..adc8b1a
--- /dev/null
+++ b/libc/sysdeps/linux/lm32/clone.S
@@ -0,0 +1,52 @@
+#include <features.h>
+#include <sys/syscall.h>
+#define _ERRNO_H 1
+#include <bits/errno.h>
+
+#ifdef __NR_clone
+
+.text
+.global clone
+.type clone,@function
+.align 4
+
+clone:
+ be r1, r0, 2f
+ be r2, r0, 2f
+
+ mvi r8, __NR_clone
+ scall
+
+ mvi r3, -4095
+ bgeu r1, r3, 1f
+
+ be r1, r0, __thread_start
+
+ ret
+
+__thread_start:
+ mvi fp, 0
+ call r2
+
+ calli HIDDEN_JUMPTARGET(_exit)
+
+ /* Stop the unstoppable. */
+9:
+ bi 9b
+
+2:
+ mvi r1, -EINVAL
+1:
+ addi sp, sp, -8
+ sw (sp+4), ra
+ sw (sp+8), r1
+ calli __errno_location
+ lw r2, (sp+8)
+ lw ra, (sp+4)
+ sub r2, r0, r2
+ sw (r1+0), r2
+ mvi r1, -1
+ addi sp, sp, 8
+ ret
+
+#endif /* __NR_clone */
diff --git a/libc/sysdeps/linux/lm32/crt1.S b/libc/sysdeps/linux/lm32/crt1.S
new file mode 100644
index 0000000..661a159
--- /dev/null
+++ b/libc/sysdeps/linux/lm32/crt1.S
@@ -0,0 +1,21 @@
+.text
+.globl _start
+.type _start,@function
+.type main,@function
+.type __uClibc_main,@function
+
+_start:
+ mvi fp, 0 /* clear fp */
+ mvhi r1, hi(main) /* main */
+ ori r1, r1, lo(main)
+ lw r2, (sp+0) /* argc */
+ addi r3, sp, 4 /* argv */
+ mvhi r4, hi(_init) /* app_init */
+ ori r4, r4, lo(_init)
+ mvhi r5, hi(_fini) /* app_fini */
+ ori r5, r5, lo(_fini)
+ mvi r6, 0 /* rtld_fini */
+ mv r7, sp /* stack_end */
+
+ calli __uClibc_main
+
diff --git a/libc/sysdeps/linux/lm32/crti.S b/libc/sysdeps/linux/lm32/crti.S
new file mode 100644
index 0000000..8ceb15b
--- /dev/null
+++ b/libc/sysdeps/linux/lm32/crti.S
@@ -0,0 +1,17 @@
+.section .init
+.global _init
+.type _init,@function
+.align 4
+
+_init:
+ addi sp, sp, -4
+ sw (sp+4), ra
+
+.section .fini
+.global _fini
+.type _fini,@function
+.align 4
+
+_fini:
+ addi sp, sp, -4
+ sw (sp+4), ra
diff --git a/libc/sysdeps/linux/lm32/crtn.S b/libc/sysdeps/linux/lm32/crtn.S
new file mode 100644
index 0000000..93643ac
--- /dev/null
+++ b/libc/sysdeps/linux/lm32/crtn.S
@@ -0,0 +1,11 @@
+.section .init
+
+ lw ra, (sp+4)
+ addi sp, sp, 4
+ ret
+
+.section .fini
+
+ lw ra, (sp+4)
+ addi sp, sp, 4
+ ret
diff --git a/libc/sysdeps/linux/lm32/setjmp.S b/libc/sysdeps/linux/lm32/setjmp.S
new file mode 100644
index 0000000..6badd80
--- /dev/null
+++ b/libc/sysdeps/linux/lm32/setjmp.S
@@ -0,0 +1,53 @@
+#define _SETJMP_H
+#define _ASM
+#include <bits/setjmp.h>
+
+#include <libc-symbols.h>
+
+.text
+.global C_SYMBOL_NAME(setjmp)
+.type C_SYMBOL_NAME(setjmp),@function
+.align 4
+
+C_SYMBOL_NAME(setjmp):
+ mvi r2, 1 /* save the signal mask */
+ bi C_SYMBOL_NAME(__sigsetjmp)
+
+.text
+.global C_SYMBOL_NAME(_setjmp)
+.type C_SYMBOL_NAME(_setjmp),@function
+.align 4
+
+C_SYMBOL_NAME(_setjmp):
+ mvi r2, 0 /* don't save the signal mask */
+ bi C_SYMBOL_NAME(__sigsetjmp)
+
+.text
+.global C_SYMBOL_NAME(__sigsetjmp)
+.type C_SYMBOL_NAME(__sigsetjmp),@function
+.align 4
+
+C_SYMBOL_NAME(__sigsetjmp):
+ /* save registers relative to r1 (arg0) */
+ sw (r1+0), r11
+ sw (r1+4), r12
+ sw (r1+8), r13
+ sw (r1+12), r14
+ sw (r1+16), r15
+ sw (r1+20), r16
+ sw (r1+24), r17
+ sw (r1+28), r18
+ sw (r1+32), r19
+ sw (r1+36), r20
+ sw (r1+40), r21
+ sw (r1+44), r22
+ sw (r1+48), r23
+ sw (r1+52), r24
+ sw (r1+56), r25
+ sw (r1+60), gp
+ sw (r1+64), fp
+ sw (r1+68), sp
+ sw (r1+72), ra
+
+ /* make a tail call to __sigjmp_save; it takes the same args */
+ bi C_SYMBOL_NAME(__sigjmp_save)
diff --git a/libc/sysdeps/linux/microblaze/sys/procfs.h
b/libc/sysdeps/linux/lm32/sys/procfs.h
similarity index 85%
copy from libc/sysdeps/linux/microblaze/sys/procfs.h
copy to libc/sysdeps/linux/lm32/sys/procfs.h
index eca7828..c545fe7 100644
--- a/libc/sysdeps/linux/microblaze/sys/procfs.h
+++ b/libc/sysdeps/linux/lm32/sys/procfs.h
@@ -12,8 +12,9 @@
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
#ifndef _SYS_PROCFS_H
#define _SYS_PROCFS_H 1
@@ -38,24 +39,7 @@
typedef unsigned long elf_greg_t;
#endif
-/* This is exactly the same as `struct pt_regs' in the kernel. */
-struct elf_gregset
-{
- elf_greg_t gpr[32]; /* General purpose registers. */
-
- elf_greg_t pc; /* program counter */
- elf_greg_t psw; /* program status word */
- elf_greg_t ear; /* Exception address register */
- elf_greg_t esr; /* Excep[tion Status Register */
- elf_greg_t fsr; /* FPU Status register */
-
- elf_greg_t kernel_mode; /* 1 if in `kernel mode', 0 if user mode */
- elf_greg_t single_step; /* 1 if in single step mode */
-};
-
-#ifndef ELF_NGREG
-#define ELF_NGREG (sizeof (struct elf_gregset) / sizeof(elf_greg_t))
-#endif
+#define ELF_NGREG 32
#ifndef ELF_GREGSET_T
#define ELF_GREGSET_T
diff --git a/libc/sysdeps/linux/microblaze/sys/ucontext.h
b/libc/sysdeps/linux/lm32/sys/ucontext.h
similarity index 86%
copy from libc/sysdeps/linux/microblaze/sys/ucontext.h
copy to libc/sysdeps/linux/lm32/sys/ucontext.h
index 7c5e303..366158f 100644
--- a/libc/sysdeps/linux/microblaze/sys/ucontext.h
+++ b/libc/sysdeps/linux/lm32/sys/ucontext.h
@@ -12,8 +12,9 @@
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
#ifndef _SYS_UCONTEXT_H
#define _SYS_UCONTEXT_H 1
@@ -30,7 +31,7 @@ typedef struct sigcontext mcontext_t;
/* Userlevel context. */
typedef struct ucontext
{
- unsigned long int uc_flags;
+ unsigned long uc_flags;
struct ucontext *uc_link;
stack_t uc_stack;
mcontext_t uc_mcontext;
diff --git a/libc/sysdeps/linux/powerpc/sys/user.h b/libc/sysdeps/linux/lm32/sys/user.h
similarity index 89%
copy from libc/sysdeps/linux/powerpc/sys/user.h
copy to libc/sysdeps/linux/lm32/sys/user.h
index 5fa3745..e8a8aaa 100644
--- a/libc/sysdeps/linux/powerpc/sys/user.h
+++ b/libc/sysdeps/linux/lm32/sys/user.h
@@ -12,8 +12,9 @@
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
#ifndef _SYS_USER_H
diff --git a/libc/sysdeps/linux/lm32/vfork.S b/libc/sysdeps/linux/lm32/vfork.S
new file mode 100644
index 0000000..f651ba6
--- /dev/null
+++ b/libc/sysdeps/linux/lm32/vfork.S
@@ -0,0 +1,42 @@
+#include <features.h>
+
+#define _ERRNO_H
+#include <bits/errno.h>
+#include <asm/unistd.h>
+#define _SIGNAL_H
+#include <bits/signum.h>
+
+#define CLONE_VM 0x00000100 /* set if VM shared between processes */
+#define CLONE_VFORK 0x00004000 /* set if the parent wants the child to */
+
+.text
+.global __vfork
+.hidden __vfork
+.type __vfork,%function
+.align 4
+
+__vfork:
+ mvi r2, 0
+ mvi r3, CLONE_VFORK | CLONE_VM | SIGCHLD
+ mvi r8, __NR_clone
+ scall
+
+ mvi r2, -4096
+ bgeu r2, r1, 1f
+
+ addi sp, sp, -8
+ sw (sp+4), ra
+ sw (sp+8), r1
+ calli __errno_location
+ lw r2, (sp+8)
+ lw ra, (sp+4)
+ sub r2, r0, r2
+ sw (r1+0), r2
+ addi sp, sp, 8
+ mvi r1, -1
+1:
+ ret
+
+.size __vfork,.-__vfork
+weak_alias(__vfork,vfork)
+libc_hidden_weak(vfork)
hooks/post-receive
--
uClibc-ng - small C library for embedded systems