diff -ruNa uClibc-0.9.15/.cvsignore uClibc-0.9.15_new/.cvsignore --- uClibc-0.9.15/.cvsignore 2001-11-18 09:52:58.000000000 +0800 +++ uClibc-0.9.15_new/.cvsignore 1970-01-01 08:00:00.000000000 +0800 @@ -1,11 +0,0 @@ -libc.a -libcrt0.o -uClibc.so* -libuClibc.so* -uClibc_config.h -uClibc-0* -libuClibc-0* -lib -Config -_install -build-stamp diff -ruNa uClibc-0.9.15/extra/Configs/Config.mipsel uClibc-0.9.15_new/extra/Configs/Config.mipsel --- uClibc-0.9.15/extra/Configs/Config.mipsel 2002-08-26 06:04:42.000000000 +0800 +++ uClibc-0.9.15_new/extra/Configs/Config.mipsel 2002-12-09 08:57:26.000000000 +0800 @@ -45,6 +45,9 @@ # production builds. DODEBUG = false +# zxl for GVDVD +ARCH_CFLAGS= -mips1 -mcpu=r3000 -msoft-float + # Compiler warnings you want to see WARNINGS = -Wall @@ -92,8 +95,8 @@ # for all memory allocations. This makes it very fast. It is also pretty # smart about reusing already allocated memory, and minimizing memory wastage. # Because this uses brk() it will not work on uClinux MMU-less systems. -#MALLOC = malloc -MALLOC = malloc-930716 +MALLOC = malloc +#MALLOC = malloc-930716 # If you want large file support (greater then 2 GiB) turn this on. # Do not enable this unless your kernel provides large file support. diff -ruNa uClibc-0.9.15/libc/stdlib/malloc/malloc.h uClibc-0.9.15_new/libc/stdlib/malloc/malloc.h --- uClibc-0.9.15/libc/stdlib/malloc/malloc.h 2002-08-19 16:43:30.000000000 +0800 +++ uClibc-0.9.15_new/libc/stdlib/malloc/malloc.h 2002-12-25 21:10:34.000000000 +0800 @@ -121,6 +121,7 @@ /* Define MALLOC_DEBUGGING to cause malloc to emit debugging info to stderr. */ +////#define MALLOC_DEBUGGING #ifdef MALLOC_DEBUGGING #include #define MALLOC_DEBUG(fmt, args...) fprintf (stderr, fmt , ##args) diff -ruNa uClibc-0.9.15/libc/sysdeps/linux/common/syscalls.c uClibc-0.9.15_new/libc/sysdeps/linux/common/syscalls.c --- uClibc-0.9.15/libc/sysdeps/linux/common/syscalls.c 2002-08-21 08:54:51.000000000 +0800 +++ uClibc-0.9.15_new/libc/sysdeps/linux/common/syscalls.c 2002-12-27 20:37:42.000000000 +0800 @@ -44,8 +44,8 @@ //#define __NR_fork 2 #ifdef L___libc_fork #include +#if 0 # ifdef __UCLIBC_HAS_MMU__ -#define __NR___libc_fork __NR_fork _syscall0(pid_t, __libc_fork); weak_alias (__libc_fork, fork) # else @@ -56,6 +56,7 @@ } # endif #endif +#endif //#define __NR_read 3 #ifdef L___libc_read diff -ruNa uClibc-0.9.15/libc/sysdeps/linux/mips/crt0.S uClibc-0.9.15_new/libc/sysdeps/linux/mips/crt0.S --- uClibc-0.9.15/libc/sysdeps/linux/mips/crt0.S 2002-06-05 00:07:56.000000000 +0800 +++ uClibc-0.9.15_new/libc/sysdeps/linux/mips/crt0.S 2002-12-28 19:35:03.000000000 +0800 @@ -31,6 +31,11 @@ sll a2, a2, 2 add a2, a2, a1 /* Ok, now run uClibc's main() -- shouldn't return */ +#if 1 + lui t0, 0xffff + or t0, 0xfff8 + and $29, $29, t0 +#endif jal __uClibc_main hlt: b hlt /* Crash if somehow it does return. */ diff -ruNa uClibc-0.9.15/libc/sysdeps/linux/mips/fork.S uClibc-0.9.15_new/libc/sysdeps/linux/mips/fork.S --- uClibc-0.9.15/libc/sysdeps/linux/mips/fork.S 2002-08-09 21:41:25.000000000 +0800 +++ uClibc-0.9.15_new/libc/sysdeps/linux/mips/fork.S 2002-12-27 20:07:44.000000000 +0800 @@ -61,5 +61,9 @@ #undef ALIGN #define ALIGN 2 #define _SYSCALL0(type,name) SYSCALL__(name) +#if 1 /* zxl for vfork */ + .global vfork +vfork: +#endif _SYSCALL0(pid_t, fork); diff -ruNa uClibc-0.9.15/libc/sysdeps/linux/mips/__longjmp.c uClibc-0.9.15_new/libc/sysdeps/linux/mips/__longjmp.c --- uClibc-0.9.15/libc/sysdeps/linux/mips/__longjmp.c 2002-02-04 21:51:21.000000000 +0800 +++ uClibc-0.9.15_new/libc/sysdeps/linux/mips/__longjmp.c 2002-12-09 04:57:34.000000000 +0800 @@ -36,7 +36,7 @@ Without this it saves $a1 in a register which gets clobbered along the way. */ register int val asm ("a1"); - +#if 0 /* Pull back the floating point callee-saved registers. */ asm volatile ("l.d $f20, %0" : : "m" (env[0].__fpregs[0])); asm volatile ("l.d $f22, %0" : : "m" (env[0].__fpregs[1])); @@ -44,11 +44,13 @@ asm volatile ("l.d $f26, %0" : : "m" (env[0].__fpregs[3])); asm volatile ("l.d $f28, %0" : : "m" (env[0].__fpregs[4])); asm volatile ("l.d $f30, %0" : : "m" (env[0].__fpregs[5])); +#endif /* Get and reconstruct the floating point csr. */ asm volatile ("lw $2, %0" : : "m" (env[0].__fpc_csr)); +#if 0 asm volatile ("ctc1 $2, $31"); - +#endif /* Get the GP. */ asm volatile ("lw $gp, %0" : : "m" (env[0].__gp)); diff -ruNa uClibc-0.9.15/libc/sysdeps/linux/mips/Makefile uClibc-0.9.15_new/libc/sysdeps/linux/mips/Makefile --- uClibc-0.9.15/libc/sysdeps/linux/mips/Makefile 2002-08-09 21:54:32.000000000 +0800 +++ uClibc-0.9.15_new/libc/sysdeps/linux/mips/Makefile 2003-01-09 18:43:38.000000000 +0800 @@ -33,7 +33,7 @@ SSRC=bsd-_setjmp.S bsd-setjmp.S setjmp.S clone.S fork.S __uClibc_syscall.S SOBJS=$(patsubst %.S,%.o, $(SSRC)) -CSRC=__longjmp.c brk.c vfork.c setjmp_aux.c _mmap.c pipe.c __syscall_error.c +CSRC=__longjmp.c brk.c vfork.c setjmp_aux.c _mmap.c pipe.c __syscall_error.c sysmips.c COBJS=$(patsubst %.c,%.o, $(CSRC)) OBJS=$(SOBJS) $(MOBJ) $(COBJS) diff -ruNa uClibc-0.9.15/libc/sysdeps/linux/mips/setjmp_aux.c uClibc-0.9.15_new/libc/sysdeps/linux/mips/setjmp_aux.c --- uClibc-0.9.15/libc/sysdeps/linux/mips/setjmp_aux.c 2002-07-23 01:10:20.000000000 +0800 +++ uClibc-0.9.15_new/libc/sysdeps/linux/mips/setjmp_aux.c 2002-12-09 04:57:56.000000000 +0800 @@ -29,6 +29,8 @@ int __sigsetjmp_aux (jmp_buf env, int savemask, int sp, int fp) { + /* remove float for DVD720, zxl 2002-12-09 */ +#if 0 /* Store the floating point callee-saved registers... */ asm volatile ("s.d $f20, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[0])); asm volatile ("s.d $f22, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[1])); @@ -36,7 +38,7 @@ asm volatile ("s.d $f26, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[3])); asm volatile ("s.d $f28, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[4])); asm volatile ("s.d $f30, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[5])); - +#endif /* .. and the PC; */ asm volatile ("sw $31, %0" : : "m" (env[0].__jmpbuf[0].__pc)); @@ -48,7 +50,6 @@ /* .. and the GP; */ asm volatile ("sw $gp, %0" : : "m" (env[0].__jmpbuf[0].__gp)); - /* .. and the callee-saved registers; */ asm volatile ("sw $16, %0" : : "m" (env[0].__jmpbuf[0].__regs[0])); asm volatile ("sw $17, %0" : : "m" (env[0].__jmpbuf[0].__regs[1])); @@ -58,9 +59,10 @@ asm volatile ("sw $21, %0" : : "m" (env[0].__jmpbuf[0].__regs[5])); asm volatile ("sw $22, %0" : : "m" (env[0].__jmpbuf[0].__regs[6])); asm volatile ("sw $23, %0" : : "m" (env[0].__jmpbuf[0].__regs[7])); - +#if 0 /* .. and finally get and reconstruct the floating point csr. */ asm ("cfc1 %0, $31" : "=r" (env[0].__jmpbuf[0].__fpc_csr)); +#endif /* Save the signal mask if requested. */ return __sigjmp_save (env, savemask); diff -ruNa uClibc-0.9.15/libc/sysdeps/linux/mips/sysmips.c uClibc-0.9.15_new/libc/sysdeps/linux/mips/sysmips.c --- uClibc-0.9.15/libc/sysdeps/linux/mips/sysmips.c 1970-01-01 08:00:00.000000000 +0800 +++ uClibc-0.9.15_new/libc/sysdeps/linux/mips/sysmips.c 2003-01-09 18:45:20.000000000 +0800 @@ -0,0 +1,7 @@ +/* Use new style mmap for mips */ +#include +#include +#include +#include + +_syscall4 (int, sysmips, int, cmd, int, arg1, int, arg2, int, arg3); diff -ruNa uClibc-0.9.15/libc/sysdeps/linux/mips/vfork.c uClibc-0.9.15_new/libc/sysdeps/linux/mips/vfork.c --- uClibc-0.9.15/libc/sysdeps/linux/mips/vfork.c 2002-02-17 04:16:20.000000000 +0800 +++ uClibc-0.9.15_new/libc/sysdeps/linux/mips/vfork.c 2002-12-27 20:07:01.000000000 +0800 @@ -22,6 +22,7 @@ /* If we don't have vfork, fork is close enough. */ +#if 0 /* by zxl, vfork cannot use stack */ __pid_t __vfork __P ((void)) { @@ -29,3 +30,4 @@ } weak_alias (__vfork, vfork) +#endif diff -ruNa uClibc-0.9.15/libpthread/linuxthreads/sysdeps/mips/pt-machine.h uClibc-0.9.15_new/libpthread/linuxthreads/sysdeps/mips/pt-machine.h --- uClibc-0.9.15/libpthread/linuxthreads/sysdeps/mips/pt-machine.h 2002-02-20 17:18:48.000000000 +0800 +++ uClibc-0.9.15_new/libpthread/linuxthreads/sysdeps/mips/pt-machine.h 2003-01-09 18:45:57.000000000 +0800 @@ -26,10 +26,27 @@ yet correctly. There is however a better solution for R3000 uniprocessor machines possible. */ + #ifndef PT_EI # define PT_EI extern inline #endif +//qiulm +////#ifdef MIPS_ISA1 +#if 1 +#define MIPS_ATOMIC_SET 2001 /* atomically set variable */ + +/* Spinlock implementation; required. */ +PT_EI long int +testandset (int *spinlock) +{ + int ret; + sysmips(MIPS_ATOMIC_SET,spinlock,&ret,0); + return ret; +} + +#else + /* Spinlock implementation; required. */ PT_EI long int @@ -88,3 +105,5 @@ return ret; } + +#endif \ No newline at end of file