svn commit: r209345 - in projects/ppc64: . bin/sh
cddl/contrib/opensolaris/lib/libdtrace/common etc etc/namedb
etc/periodic/daily gnu/lib/csu lib/csu/i386-elf lib/libc
lib/libc/mips lib/libc/mips/g...
Nathan Whitehorn
nwhitehorn at FreeBSD.org
Sat Jun 19 17:21:49 UTC 2010
Author: nwhitehorn
Date: Sat Jun 19 17:21:48 2010
New Revision: 209345
URL: http://svn.freebsd.org/changeset/base/209345
Log:
IFC @ 209344. This reduces diffs on this branch to actually only ppc64.
Added:
projects/ppc64/lib/libc/mips/gen/_ctx_start.S
- copied unchanged from r209344, head/lib/libc/mips/gen/_ctx_start.S
projects/ppc64/share/man/man7/c99.7
- copied unchanged from r209344, head/share/man/man7/c99.7
projects/ppc64/sys/mips/include/tlb.h
- copied unchanged from r209344, head/sys/mips/include/tlb.h
projects/ppc64/sys/mips/mips/tlb.c
- copied unchanged from r209344, head/sys/mips/mips/tlb.c
Modified:
projects/ppc64/Makefile.inc1
projects/ppc64/bin/sh/parser.c
projects/ppc64/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l
projects/ppc64/etc/Makefile
projects/ppc64/etc/login.conf
projects/ppc64/etc/namedb/named.root
projects/ppc64/etc/periodic/daily/Makefile
projects/ppc64/gnu/lib/csu/Makefile
projects/ppc64/lib/csu/i386-elf/crt1_s.S
projects/ppc64/lib/libc/Makefile
projects/ppc64/lib/libc/mips/Makefile.inc
projects/ppc64/lib/libc/mips/SYS.h
projects/ppc64/lib/libc/mips/Symbol.map
projects/ppc64/lib/libc/mips/gen/Makefile.inc
projects/ppc64/lib/libc/mips/gen/_setjmp.S
projects/ppc64/lib/libc/mips/gen/makecontext.c
projects/ppc64/lib/libc/mips/gen/setjmp.S
projects/ppc64/lib/libc/mips/gen/sigsetjmp.S
projects/ppc64/lib/libc/mips/string/bcmp.S
projects/ppc64/lib/libc/mips/string/bcopy.S
projects/ppc64/lib/libc/mips/string/bzero.S
projects/ppc64/lib/libc/mips/string/ffs.S
projects/ppc64/lib/libc/mips/string/index.S
projects/ppc64/lib/libc/mips/string/rindex.S
projects/ppc64/lib/libc/mips/string/strcmp.S
projects/ppc64/lib/libc/mips/string/strlen.S
projects/ppc64/lib/libc/mips/sys/Makefile.inc
projects/ppc64/lib/libc/mips/sys/Ovfork.S
projects/ppc64/lib/libc/mips/sys/brk.S
projects/ppc64/lib/libc/mips/sys/cerror.S
projects/ppc64/lib/libc/mips/sys/exect.S
projects/ppc64/lib/libc/mips/sys/fork.S
projects/ppc64/lib/libc/mips/sys/pipe.S
projects/ppc64/lib/libc/mips/sys/ptrace.S
projects/ppc64/lib/libc/mips/sys/sbrk.S
projects/ppc64/lib/libkvm/kvm_proc.c
projects/ppc64/libexec/rtld-elf/mips/rtld_start.S
projects/ppc64/release/scripts/ports-install.sh
projects/ppc64/sbin/ping6/ping6.c
projects/ppc64/share/man/man7/Makefile
projects/ppc64/sys/amd64/amd64/apic_vector.S
projects/ppc64/sys/amd64/amd64/mp_machdep.c
projects/ppc64/sys/amd64/conf/NOTES
projects/ppc64/sys/amd64/ia32/ia32_signal.c
projects/ppc64/sys/amd64/include/smp.h
projects/ppc64/sys/arm/arm/nexus.c
projects/ppc64/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
projects/ppc64/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
projects/ppc64/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
projects/ppc64/sys/conf/NOTES
projects/ppc64/sys/conf/files.mips
projects/ppc64/sys/conf/options.amd64
projects/ppc64/sys/dev/acpica/acpi_cpu.c
projects/ppc64/sys/dev/agp/agp_nvidia.c
projects/ppc64/sys/dev/ata/chipsets/ata-serverworks.c
projects/ppc64/sys/dev/cxgb/ulp/tom/cxgb_vm.c
projects/ppc64/sys/dev/e1000/if_em.c
projects/ppc64/sys/dev/e1000/if_igb.c
projects/ppc64/sys/dev/e1000/if_igb.h
projects/ppc64/sys/dev/e1000/if_lem.c
projects/ppc64/sys/dev/hptiop/hptiop.c
projects/ppc64/sys/dev/hptmv/entry.c
projects/ppc64/sys/dev/twa/tw_cl_misc.c
projects/ppc64/sys/fs/nwfs/nwfs_io.c
projects/ppc64/sys/fs/smbfs/smbfs_io.c
projects/ppc64/sys/i386/conf/NOTES
projects/ppc64/sys/i386/i386/mp_machdep.c
projects/ppc64/sys/kern/kern_conf.c
projects/ppc64/sys/kern/subr_lock.c
projects/ppc64/sys/kern/subr_trap.c
projects/ppc64/sys/kern/subr_unit.c
projects/ppc64/sys/kern/vfs_subr.c
projects/ppc64/sys/mips/atheros/ar71xx_wdog.c
projects/ppc64/sys/mips/include/cpu.h
projects/ppc64/sys/mips/include/pmap.h
projects/ppc64/sys/mips/include/pte.h
projects/ppc64/sys/mips/mips/cpu.c
projects/ppc64/sys/mips/mips/machdep.c
projects/ppc64/sys/mips/mips/mp_machdep.c
projects/ppc64/sys/mips/mips/pmap.c
projects/ppc64/sys/mips/mips/trap.c
projects/ppc64/sys/mips/rmi/board.c
projects/ppc64/sys/mips/rmi/board.h
projects/ppc64/sys/mips/rmi/dev/xlr/rge.c
projects/ppc64/sys/netinet/sctp.h
projects/ppc64/sys/netinet/sctp_usrreq.c
projects/ppc64/sys/netinet/sctputil.c
projects/ppc64/sys/powerpc/mpc85xx/atpic.c
projects/ppc64/sys/powerpc/ofw/ofw_pcibus.c
projects/ppc64/sys/powerpc/powerpc/openpic.c
projects/ppc64/sys/sparc64/ebus/ebus.c
projects/ppc64/sys/sun4v/sun4v/hv_pci.c
projects/ppc64/sys/sys/conf.h
projects/ppc64/sys/sys/pcpu.h
projects/ppc64/sys/x86/cpufreq/est.c
projects/ppc64/tools/build/mk/OptionalObsoleteFiles.inc
projects/ppc64/tools/tools/tinybsd/conf/default/TINYBSD
projects/ppc64/tools/tools/tinybsd/conf/vpn/TINYBSD
projects/ppc64/usr.bin/c99/c99.1
projects/ppc64/usr.bin/systat/vmstat.c
projects/ppc64/usr.bin/ypwhich/ypwhich.c
projects/ppc64/usr.sbin/cpucontrol/amd.c
projects/ppc64/usr.sbin/cpucontrol/intel.c
projects/ppc64/usr.sbin/mptutil/mptutil.8
projects/ppc64/usr.sbin/powerd/powerd.c
projects/ppc64/usr.sbin/sysinstall/devices.c
projects/ppc64/usr.sbin/sysinstall/disks.c
projects/ppc64/usr.sbin/sysinstall/label.c
projects/ppc64/usr.sbin/timed/timed/measure.c
Directory Properties:
projects/ppc64/ (props changed)
projects/ppc64/cddl/contrib/opensolaris/ (props changed)
projects/ppc64/contrib/ee/ (props changed)
projects/ppc64/contrib/expat/ (props changed)
projects/ppc64/contrib/file/ (props changed)
projects/ppc64/contrib/gdb/ (props changed)
projects/ppc64/contrib/gnu-sort/ (props changed)
projects/ppc64/contrib/groff/ (props changed)
projects/ppc64/contrib/less/ (props changed)
projects/ppc64/contrib/libpcap/ (props changed)
projects/ppc64/contrib/ncurses/ (props changed)
projects/ppc64/contrib/one-true-awk/ (props changed)
projects/ppc64/contrib/openbsm/ (props changed)
projects/ppc64/contrib/openpam/ (props changed)
projects/ppc64/contrib/pf/ (props changed)
projects/ppc64/contrib/tcpdump/ (props changed)
projects/ppc64/contrib/tcsh/ (props changed)
projects/ppc64/contrib/tzcode/stdtime/ (props changed)
projects/ppc64/contrib/tzcode/zic/ (props changed)
projects/ppc64/contrib/tzdata/ (props changed)
projects/ppc64/contrib/wpa/ (props changed)
projects/ppc64/lib/libutil/ (props changed)
projects/ppc64/lib/libz/ (props changed)
projects/ppc64/sbin/ (props changed)
projects/ppc64/sbin/ipfw/ (props changed)
projects/ppc64/share/mk/bsd.arch.inc.mk (props changed)
projects/ppc64/sys/ (props changed)
projects/ppc64/sys/amd64/include/xen/ (props changed)
projects/ppc64/sys/arm/conf/SHEEVAPLUG (props changed)
projects/ppc64/sys/cddl/contrib/opensolaris/ (props changed)
projects/ppc64/sys/contrib/dev/acpica/ (props changed)
projects/ppc64/sys/contrib/x86emu/ (props changed)
projects/ppc64/sys/dev/xen/xenpci/ (props changed)
projects/ppc64/usr.bin/csup/ (props changed)
projects/ppc64/usr.bin/procstat/ (props changed)
Modified: projects/ppc64/Makefile.inc1
==============================================================================
--- projects/ppc64/Makefile.inc1 Sat Jun 19 17:04:01 2010 (r209344)
+++ projects/ppc64/Makefile.inc1 Sat Jun 19 17:21:48 2010 (r209345)
@@ -1472,8 +1472,8 @@ _xi-links:
DTBOUTPUTPATH= ${KRNLOBJDIR}/${KERNCONF}/
.if !defined(FDT_DTS_FILE) || empty(FDT_DTS_FILE)
-FDT_DTS_FILE!= grep "^makeoptions[[:space:]]\+FDT_DTS_FILE" \
- ${KERNCONFDIR}/${KERNCONF} 2> /dev/null | cut -d= -f2
+FDT_DTS_FILE!= awk '/^makeoptions[[:space:]]+FDT_DTS_FILE/ {FS="=|[ \t]+"; print $$3}' \
+ ${KERNCONFDIR}/${KERNCONF}
.endif
.endif
Modified: projects/ppc64/bin/sh/parser.c
==============================================================================
--- projects/ppc64/bin/sh/parser.c Sat Jun 19 17:04:01 2010 (r209344)
+++ projects/ppc64/bin/sh/parser.c Sat Jun 19 17:21:48 2010 (r209345)
@@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$");
#include <stdlib.h>
#include <unistd.h>
+#include <stdio.h>
#include "shell.h"
#include "parser.h"
Modified: projects/ppc64/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l
==============================================================================
--- projects/ppc64/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l Sat Jun 19 17:04:01 2010 (r209344)
+++ projects/ppc64/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l Sat Jun 19 17:21:48 2010 (r209345)
@@ -45,7 +45,7 @@
#undef input
#undef unput
#else
-/*
+/*
* Define YY_INPUT for flex since input() can't be re-defined.
*/
#define YY_INPUT(buf,result,max_size) \
@@ -60,6 +60,15 @@
buf[n] = *yypcb->pcb_strptr++; \
result = n; \
}
+/*
+ * Do not EOF let tokens to be put back. This does not work with flex.
+ * On the other hand, leaving current buffer in same state it was when
+ * last EOF was received guarantees that input() will keep returning EOF
+ * for all subsequent invocations, which is the effect desired.
+ */
+#undef unput
+#define unput(c) \
+ if (c != EOF) yyunput( c, yytext_ptr )
#endif
static int id_or_type(const char *);
@@ -811,8 +820,7 @@ id_or_type(const char *s)
longjmp(yypcb->pcb_jmpbuf, EDT_NOMEM);
}
- if (c0 != EOF)
- unput(c0);
+ unput(c0);
return (ttok);
}
Modified: projects/ppc64/etc/Makefile
==============================================================================
--- projects/ppc64/etc/Makefile Sat Jun 19 17:04:01 2010 (r209344)
+++ projects/ppc64/etc/Makefile Sat Jun 19 17:21:48 2010 (r209345)
@@ -253,11 +253,13 @@ distribution:
${DESTDIR}/var/crash
cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
${FREEBSD} ${DESTDIR}/
+.if ${MK_BOOT} != "no"
.if exists(${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints)
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints \
${DESTDIR}/boot/device.hints
.endif
+.endif
distrib-dirs:
mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.root.dist -p ${DESTDIR}/
Modified: projects/ppc64/etc/login.conf
==============================================================================
--- projects/ppc64/etc/login.conf Sat Jun 19 17:04:01 2010 (r209344)
+++ projects/ppc64/etc/login.conf Sat Jun 19 17:21:48 2010 (r209345)
@@ -228,7 +228,7 @@ russian|Russian Users Accounts:\
#
#
##
-## The dialer class should be used for a dialup PPP/SLIP accounts
+## The dialer class should be used for a dialup PPP account
## Welcome messages/news suppressed
##
#dialer:\
@@ -247,7 +247,7 @@ russian|Russian Users Accounts:\
#
#
##
-## Site full-time 24/7 PPP/SLIP connections
+## Site full-time 24/7 PPP connection
## - no time accounting, restricted to access via dialin lines
##
#site:\
@@ -306,11 +306,6 @@ russian|Russian Users Accounts:\
# :tc=subscriber:
#
#
-#subslip|SLIP Subscriber Accounts:\
-# :tc=dialer:\
-# :tc=subscriber:
-#
-#
#subshell|Shell Subscriber Accounts:\
# :tc=subscriber:
#
Modified: projects/ppc64/etc/namedb/named.root
==============================================================================
--- projects/ppc64/etc/namedb/named.root Sat Jun 19 17:04:01 2010 (r209344)
+++ projects/ppc64/etc/namedb/named.root Sat Jun 19 17:21:48 2010 (r209345)
@@ -13,8 +13,8 @@
; on server FTP.INTERNIC.NET
; -OR- RS.INTERNIC.NET
;
-; last update: Dec 12, 2008
-; related version of root zone: 2008121200
+; last update: Jun 17, 2010
+; related version of root zone: 2010061700
;
; formerly NS.INTERNIC.NET
;
@@ -63,6 +63,7 @@ H.ROOT-SERVERS.NET. 3600000 AA
;
. 3600000 NS I.ROOT-SERVERS.NET.
I.ROOT-SERVERS.NET. 3600000 A 192.36.148.17
+I.ROOT-SERVERS.NET. 3600000 AAAA 2001:7FE::53
;
; OPERATED BY VERISIGN, INC.
;
Modified: projects/ppc64/etc/periodic/daily/Makefile
==============================================================================
--- projects/ppc64/etc/periodic/daily/Makefile Sat Jun 19 17:04:01 2010 (r209344)
+++ projects/ppc64/etc/periodic/daily/Makefile Sat Jun 19 17:21:48 2010 (r209345)
@@ -8,7 +8,6 @@ FILES= 100.clean-disks \
200.backup-passwd \
330.news \
400.status-disks \
- 404.status-zfs \
405.status-ata-raid \
406.status-gmirror \
407.status-graid3 \
@@ -53,4 +52,9 @@ FILES+= 150.clean-hoststat \
500.queuerun
.endif
+.if ${MK_ZFS} != "no"
+FILES+= 404.status-zfs \
+ 800.scrub-zfs
+.endif
+
.include <bsd.prog.mk>
Modified: projects/ppc64/gnu/lib/csu/Makefile
==============================================================================
--- projects/ppc64/gnu/lib/csu/Makefile Sat Jun 19 17:04:01 2010 (r209344)
+++ projects/ppc64/gnu/lib/csu/Makefile Sat Jun 19 17:21:48 2010 (r209345)
@@ -17,7 +17,8 @@ CSTD?= gnu89
CFLAGS+= -DIN_GCC -DHAVE_LD_EH_FRAME_HDR -DDT_CONFIG -D__GLIBC__=3
CFLAGS+= -finhibit-size-directive -fno-inline-functions \
-fno-exceptions -fno-zero-initialized-in-bss \
- -fno-zero-initialized-in-bss -fno-toplevel-reorder
+ -fno-zero-initialized-in-bss -fno-toplevel-reorder \
+ -fno-asynchronous-unwind-tables -fno-omit-frame-pointer
CFLAGS+= -I${GCCLIB}/include -I${GCCDIR}/config -I${GCCDIR} -I. \
-I${CCDIR}/cc_tools
CRTS_CFLAGS= -DCRTSTUFFS_O -DSHARED ${PICFLAG}
Modified: projects/ppc64/lib/csu/i386-elf/crt1_s.S
==============================================================================
--- projects/ppc64/lib/csu/i386-elf/crt1_s.S Sat Jun 19 17:04:01 2010 (r209344)
+++ projects/ppc64/lib/csu/i386-elf/crt1_s.S Sat Jun 19 17:21:48 2010 (r209345)
@@ -30,15 +30,22 @@
.align 4
.globl _start
.type _start, @function
-_start: xorl %ebp,%ebp
+_start:
+ .cfi_startproc
+ xorl %ebp,%ebp
pushl %ebp
+ .cfi_def_cfa_offset 4
movl %esp,%ebp
+ .cfi_offset %ebp,-8
+ .cfi_def_cfa_register %ebp
andl $0xfffffff0,%esp # align stack
leal 8(%ebp),%eax
pushl %eax # argv
pushl 4(%ebp) # argc
pushl %edx # rtld cleanup
call _start1
+ int3
+ .cfi_endproc
.size _start, . - _start
.ident "$FreeBSD$"
Modified: projects/ppc64/lib/libc/Makefile
==============================================================================
--- projects/ppc64/lib/libc/Makefile Sat Jun 19 17:04:01 2010 (r209344)
+++ projects/ppc64/lib/libc/Makefile Sat Jun 19 17:21:48 2010 (r209345)
@@ -52,7 +52,12 @@ NOASM=
.if ${MACHINE_ARCH} != "amd64" && \
${MACHINE_ARCH} != "ia64" && \
${MACHINE_ARCH} != "powerpc64" && \
- ${MACHINE_ARCH} != "sparc64"
+ ${MACHINE_ARCH} != "sparc64" && \
+ ${MACHINE_ARCH} != "mips"
+.include "${.CURDIR}/quad/Makefile.inc"
+.endif
+.if ${MACHINE_ARCH} == "mips" && \
+ (!defined(TARGET_ABI) || ${TARGET_ABI} == "o32")
.include "${.CURDIR}/quad/Makefile.inc"
.endif
.include "${.CURDIR}/regex/Makefile.inc"
Modified: projects/ppc64/lib/libc/mips/Makefile.inc
==============================================================================
--- projects/ppc64/lib/libc/mips/Makefile.inc Sat Jun 19 17:04:01 2010 (r209344)
+++ projects/ppc64/lib/libc/mips/Makefile.inc Sat Jun 19 17:21:48 2010 (r209345)
@@ -1,8 +1,6 @@
# $NetBSD: Makefile.inc,v 1.7 2005/09/17 11:49:39 tsutsui Exp $
# $FreeBSD$
-SOFTFLOAT_BITS=32
-
CFLAGS+=-DSOFTFLOAT
MDSRCS+= machdep_ldisd.c
Modified: projects/ppc64/lib/libc/mips/SYS.h
==============================================================================
--- projects/ppc64/lib/libc/mips/SYS.h Sat Jun 19 17:04:01 2010 (r209344)
+++ projects/ppc64/lib/libc/mips/SYS.h Sat Jun 19 17:21:48 2010 (r209345)
@@ -1,4 +1,4 @@
-/* $NetBSD: SYS.h,v 1.18 2003/10/29 12:28:33 pooka Exp $ */
+/* $NetBSD: SYS.h,v 1.19 2009/12/14 01:07:41 matt Exp $ */
/* $FreeBSD$ */
/*-
@@ -79,14 +79,22 @@
*/
#ifdef __ABICALLS__
.abicalls
-# define PIC_PROLOGUE(x,sr) .set noreorder; .cpload sr; .set reorder
-# define PIC_CALL(l,sr) la sr, _C_LABEL(l); jr sr
+# if defined(__mips_o32) || defined(__mips_o64)
+# define PIC_PROLOGUE(x) SETUP_GP
+# define PIC_TAILCALL(l) PTR_LA t9, _C_LABEL(l); jr t9
+# define PIC_RETURN() j ra
+# else
+# define PIC_PROLOGUE(x) SETUP_GP64(t3, x)
+# define PIC_TAILCALL(l) PTR_LA t9, _C_LABEL(l); RESTORE_GP64; jr t9
+# define PIC_RETURN() RESTORE_GP64; j ra
+# endif
#else
-# define PIC_PROLOGUE(x,sr)
-# define PIC_CALL(l,sr) j _C_LABEL(l)
-#endif
+# define PIC_PROLOGUE(x)
+# define PIC_TAILCALL(l) j _C_LABEL(l)
+# define PIC_RETURN()
+#endif /* __ABICALLS__ */
-# define SYSTRAP(x) li v0, SYS_ ## x; syscall;
+# define SYSTRAP(x) li v0,SYS_ ## x; syscall;
/*
* Do a syscall that cannot fail (sync, get{p,u,g,eu,eg)id)
@@ -106,7 +114,7 @@
*/
#define PSEUDO_NOERROR(x) \
LEAF(__sys_ ## x); \
- .weak _C_LABEL(x); \
+ .weak _C_LABEL(x); \
_C_LABEL(x) = _C_LABEL(__CONCAT(__sys_,x)); \
.weak _C_LABEL(__CONCAT(_,x)); \
_C_LABEL(__CONCAT(_,x)) = _C_LABEL(__CONCAT(__sys_,x)); \
@@ -116,14 +124,14 @@ LEAF(__sys_ ## x); \
#define PSEUDO(x) \
LEAF(__sys_ ## x); \
- .weak _C_LABEL(x); \
+ .weak _C_LABEL(x); \
_C_LABEL(x) = _C_LABEL(__CONCAT(__sys_,x)); \
.weak _C_LABEL(__CONCAT(_,x)); \
_C_LABEL(__CONCAT(_,x)) = _C_LABEL(__CONCAT(__sys_,x)); \
- PIC_PROLOGUE(x,t9); \
+ PIC_PROLOGUE(__sys_ ## x); \
SYSTRAP(x); \
bne a3,zero,err; \
- j ra; \
+ PIC_RETURN(); \
err: \
- PIC_CALL(__cerror,t9); \
- END(__sys_ ## x)
+ PIC_TAILCALL(__cerror); \
+END(__sys_ ## x)
Modified: projects/ppc64/lib/libc/mips/Symbol.map
==============================================================================
--- projects/ppc64/lib/libc/mips/Symbol.map Sat Jun 19 17:04:01 2010 (r209344)
+++ projects/ppc64/lib/libc/mips/Symbol.map Sat Jun 19 17:21:48 2010 (r209345)
@@ -24,13 +24,9 @@ FBSD_1.0 {
sigsetjmp;
siglongjmp;
htonl;
- __htonl;
htons;
- __htons;
ntohl;
- __ntohl;
ntohs;
- __ntohs;
vfork;
brk;
cerror; /* XXX - Should this be .cerror (see sys/cerror.S)? */
Modified: projects/ppc64/lib/libc/mips/gen/Makefile.inc
==============================================================================
--- projects/ppc64/lib/libc/mips/gen/Makefile.inc Sat Jun 19 17:04:01 2010 (r209344)
+++ projects/ppc64/lib/libc/mips/gen/Makefile.inc Sat Jun 19 17:21:48 2010 (r209345)
@@ -6,4 +6,4 @@ SRCS+= infinity.c fabs.c ldexp.c modf.c
# SRCS+= flt_rounds.c fpgetmask.c fpgetround.c fpgetsticky.c fpsetmask.c \
# fpsetround.c fpsetsticky.c
-SRCS+= _set_tp.c _setjmp.S makecontext.c setjmp.S signalcontext.c sigsetjmp.S
+SRCS+= _ctx_start.S _set_tp.c _setjmp.S makecontext.c setjmp.S signalcontext.c sigsetjmp.S
Copied: projects/ppc64/lib/libc/mips/gen/_ctx_start.S (from r209344, head/lib/libc/mips/gen/_ctx_start.S)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/ppc64/lib/libc/mips/gen/_ctx_start.S Sat Jun 19 17:21:48 2010 (r209345, copy of r209344, head/lib/libc/mips/gen/_ctx_start.S)
@@ -0,0 +1,41 @@
+/*-
+ * Copyright (c) 2010 Juli Mallett.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD$");
+
+/*
+ * XXX gp?
+ */
+ENTRY(_ctx_start)
+ jalr t9
+
+ move a0, s0
+ PTR_LA t9, _ctx_done
+ jalr t9
+
+ break 0
+END(_ctx_start)
Modified: projects/ppc64/lib/libc/mips/gen/_setjmp.S
==============================================================================
--- projects/ppc64/lib/libc/mips/gen/_setjmp.S Sat Jun 19 17:04:01 2010 (r209344)
+++ projects/ppc64/lib/libc/mips/gen/_setjmp.S Sat Jun 19 17:21:48 2010 (r209345)
@@ -1,4 +1,4 @@
-/* $NetBSD: _setjmp.S,v 1.20 2005/10/07 17:16:40 tsutsui Exp $ */
+/* $NetBSD: _setjmp.S,v 1.20.34.5 2010/02/03 23:46:47 matt Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -36,14 +36,15 @@
__FBSDID("$FreeBSD$");
#include <machine/regnum.h>
-#if defined(LIBC_SCCS) && !defined(lint)
- ASMSTR("from: @(#)_setjmp.s 8.1 (Berkeley) 6/4/93")
- ASMSTR("$NetBSD: _setjmp.S,v 1.20 2005/10/07 17:16:40 tsutsui Exp $")
-#endif /* LIBC_SCCS and not lint */
+#include "SYS.h"
-#ifdef __ABICALLS__
- .abicalls
+#if defined(LIBC_SCCS) && !defined(lint)
+#if 0
+ RCSID("from: @(#)_setjmp.s 8.1 (Berkeley) 6/4/93")
+#else
+ RCSID("$NetBSD: _setjmp.S,v 1.20.34.5 2010/02/03 23:46:47 matt Exp $")
#endif
+#endif /* LIBC_SCCS and not lint */
/*
* C library -- _setjmp, _longjmp
@@ -56,62 +57,70 @@ __FBSDID("$FreeBSD$");
* The previous signal state is NOT restored.
*/
+ .set noreorder
LEAF(_setjmp)
-#ifdef __ABICALLS__
- .set noreorder
- .cpload t9
- subu sp, sp, CALLFRAME_SIZ # allocate stack frame
- .cprestore 16
+ REG_PROLOGUE
+ REG_LI v0, _JB_MAGIC__SETJMP
+ REG_S v0, (_JB_MAGIC * SZREG)(a0)
+ REG_S ra, (_JB_REG_RA * SZREG)(a0)
+ REG_S s0, (_JB_REG_S0 * SZREG)(a0)
+ REG_S s1, (_JB_REG_S1 * SZREG)(a0)
+ REG_S s2, (_JB_REG_S2 * SZREG)(a0)
+ REG_S s3, (_JB_REG_S3 * SZREG)(a0)
+ REG_S s4, (_JB_REG_S4 * SZREG)(a0)
+ REG_S s5, (_JB_REG_S5 * SZREG)(a0)
+ REG_S s6, (_JB_REG_S6 * SZREG)(a0)
+ REG_S s7, (_JB_REG_S7 * SZREG)(a0)
+ REG_S s8, (_JB_REG_S8 * SZREG)(a0)
+#if defined(__mips_n32) || defined(__mips_n64)
+ REG_S gp, (_JB_REG_GP * SZREG)(a0) # newabi gp is callee-saved
#endif
- li v0, _JB_MAGIC__SETJMP
- sw v0, (_JB_MAGIC * SZREG)(a0)
- sw ra, (_JB_REG_RA * SZREG)(a0)
- sw s0, (_JB_REG_S0 * SZREG)(a0)
- sw s1, (_JB_REG_S1 * SZREG)(a0)
- sw s2, (_JB_REG_S2 * SZREG)(a0)
- sw s3, (_JB_REG_S3 * SZREG)(a0)
- sw s4, (_JB_REG_S4 * SZREG)(a0)
- sw s5, (_JB_REG_S5 * SZREG)(a0)
- sw s6, (_JB_REG_S6 * SZREG)(a0)
- sw s7, (_JB_REG_S7 * SZREG)(a0)
- sw s8, (_JB_REG_S8 * SZREG)(a0)
-#ifdef __ABICALLS__
- addu sp, sp, CALLFRAME_SIZ # un-allocate the stack frame
-#endif
- sw sp, (_JB_REG_SP * SZREG)(a0)
+ REG_S sp, (_JB_REG_SP * SZREG)(a0)
+ REG_EPILOGUE
+
j ra
move v0, zero
END(_setjmp)
LEAF(_longjmp)
-#ifdef __ABICALLS__
- .set noreorder
- .cpload t9
- subu sp, sp, CALLFRAME_SIZ # allocate stack frame
- .cprestore 16
-#endif
- lw v0, (_JB_MAGIC * SZREG)(a0)
- lw ra, (_JB_REG_RA * SZREG)(a0)
- li t0, _JB_MAGIC__SETJMP
- bne v0, t0, botch # jump if error
- lw s0, (_JB_REG_S0 * SZREG)(a0)
- lw s1, (_JB_REG_S1 * SZREG)(a0)
- lw s2, (_JB_REG_S2 * SZREG)(a0)
- lw s3, (_JB_REG_S3 * SZREG)(a0)
- lw s4, (_JB_REG_S4 * SZREG)(a0)
- lw s5, (_JB_REG_S5 * SZREG)(a0)
- lw s6, (_JB_REG_S6 * SZREG)(a0)
- lw s7, (_JB_REG_S7 * SZREG)(a0)
- lw sp, (_JB_REG_SP * SZREG)(a0)
- lw s8, (_JB_REG_S8 * SZREG)(a0)
+ PIC_PROLOGUE(_longjmp)
+ PTR_SUBU sp, sp, CALLFRAME_SIZ
+ SAVE_GP(CALLFRAME_GP)
+
+ REG_PROLOGUE
+ REG_L v0, (_JB_MAGIC * SZREG)(a0) # get magic number
+ REG_L ra, (_JB_REG_RA * SZREG)(a0)
+ REG_LI t0, _JB_MAGIC__SETJMP
+ bne v0, t0, botch # jump if error
+ PTR_ADDU sp, sp, CALLFRAME_SIZ # does not matter, sanity
+ REG_L s0, (_JB_REG_S0 * SZREG)(a0)
+ REG_L s1, (_JB_REG_S1 * SZREG)(a0)
+ REG_L s2, (_JB_REG_S2 * SZREG)(a0)
+ REG_L s3, (_JB_REG_S3 * SZREG)(a0)
+ REG_L s4, (_JB_REG_S4 * SZREG)(a0)
+ REG_L s5, (_JB_REG_S5 * SZREG)(a0)
+ REG_L s6, (_JB_REG_S6 * SZREG)(a0)
+ REG_L s7, (_JB_REG_S7 * SZREG)(a0)
+#if defined(__mips_n32) || defined(__mips_n64)
+ REG_L gp, (_JB_REG_GP * SZREG)(a0)
+#endif
+ REG_L sp, (_JB_REG_SP * SZREG)(a0)
+ REG_L s8, (_JB_REG_S8 * SZREG)(a0)
+ REG_EPILOGUE
+ move v0, a1 # get return value in 1st arg
j ra
- move v0, a1
+ nop
botch:
- jal _C_LABEL(longjmperror)
- nop
- jal _C_LABEL(abort)
+ /*
+ * We know we aren't returning so we don't care about restoring
+ * our caller's GP.
+ */
+ PTR_LA t9, _C_LABEL(longjmperror)
+ jalr t9
nop
+
+ PIC_TAILCALL(abort)
END(_longjmp)
Modified: projects/ppc64/lib/libc/mips/gen/makecontext.c
==============================================================================
--- projects/ppc64/lib/libc/mips/gen/makecontext.c Sat Jun 19 17:04:01 2010 (r209344)
+++ projects/ppc64/lib/libc/mips/gen/makecontext.c Sat Jun 19 17:21:48 2010 (r209345)
@@ -1,4 +1,4 @@
-/* $NetBSD: makecontext.c,v 1.3 2003/01/19 08:53:36 matt Exp $ */
+/* $NetBSD: makecontext.c,v 1.5 2009/12/14 01:07:42 matt Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -15,13 +15,6 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
@@ -39,48 +32,92 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: makecontext.c,v 1.3 2003/01/19 08:53:36 matt Exp $");
+__RCSID("$NetBSD: makecontext.c,v 1.5 2009/12/14 01:07:42 matt Exp $");
#endif
-#include <sys/types.h>
-#include <ucontext.h>
+#include <sys/param.h>
+#include <machine/regnum.h>
+
#include <stdarg.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <ucontext.h>
+
+__weak_reference(__makecontext, makecontext);
+
+void _ctx_done(ucontext_t *);
+void _ctx_start(void);
void
-makecontext(ucontext_t *ucp, void (*func)(void), int argc, ...)
+__makecontext(ucontext_t *ucp, void (*func)(void), int argc, ...)
{
- /* XXXMIPS: Implement me */
-#if 0
- __greg_t *gr = ucp->uc_mcontext.__gregs;
- uintptr_t *sp;
+ mcontext_t *mc;
+ register_t *sp;
int i;
va_list ap;
- void __resumecontext(void);
+ /*
+ * XXX/juli
+ * We need an mc_len or mc_flags like other architectures
+ * so that we can mark a context as invalid. Store it in
+ * mc->mc_regs[ZERO] perhaps?
+ */
+ if (argc < 0 || argc > 6 || ucp == NULL ||
+ ucp->uc_stack.ss_sp == NULL ||
+ ucp->uc_stack.ss_size < MINSIGSTKSZ)
+ return;
+ mc = &ucp->uc_mcontext;
- /* LINTED uintptr_t is safe */
- sp = (uintptr_t *)
+ sp = (register_t *)
((uintptr_t)ucp->uc_stack.ss_sp + ucp->uc_stack.ss_size);
- /* LINTED uintptr_t is safe */
+#if defined(__mips_o32) || defined(__mips_o64)
sp -= (argc >= 4 ? argc : 4); /* Make room for >=4 arguments. */
- sp = (uintptr_t *)
- ((uintptr_t)sp & ~0x7); /* Align on double-word boundary. */
+ sp = (register_t *)
+ ((uintptr_t)sp & ~0x7); /* Align on double-word boundary. */
+#elif defined(__mips_n32) || defined(__mips_n64)
+ sp -= (argc > 8 ? argc - 8 : 0); /* Make room for > 8 arguments. */
+ sp = (register_t *)
+ ((uintptr_t)sp & ~0xf); /* Align on quad-word boundary. */
+#endif
- gr[_REG_SP] = (__greg_t)sp;
- gr[_REG_RA] = (__greg_t)__resumecontext;
- gr[_REG_T9] = (__greg_t)func; /* required for .abicalls */
- gr[_REG_EPC] = (__greg_t)func;
+ mc->mc_regs[SP] = (intptr_t)sp;
+ mc->mc_regs[S0] = (intptr_t)ucp;
+ mc->mc_regs[T9] = (intptr_t)func;
+ mc->mc_pc = (intptr_t)_ctx_start;
/* Construct argument list. */
va_start(ap, argc);
+#if defined(__mips_o32) || defined(__mips_o64)
/* Up to the first four arguments are passed in $a0-3. */
for (i = 0; i < argc && i < 4; i++)
- /* LINTED uintptr_t is safe */
- gr[_REG_A0 + i] = va_arg(ap, uintptr_t);
+ /* LINTED register_t is safe */
+ mc->mc_regs[A0 + i] = va_arg(ap, register_t);
+ /* Pass remaining arguments on the stack above the $a0-3 gap. */
+ sp += i;
+#endif
+#if defined(__mips_n32) || defined(__mips_n64)
+ /* Up to the first 8 arguments are passed in $a0-7. */
+ for (i = 0; i < argc && i < 8; i++)
+ /* LINTED register_t is safe */
+ mc->mc_regs[A0 + i] = va_arg(ap, register_t);
/* Pass remaining arguments on the stack above the $a0-3 gap. */
- for (sp += 4; i < argc; i++)
+#endif
+ /* Pass remaining arguments on the stack above the $a0-3 gap. */
+ for (; i < argc; i++)
/* LINTED uintptr_t is safe */
- *sp++ = va_arg(ap, uintptr_t);
+ *sp++ = va_arg(ap, register_t);
va_end(ap);
-#endif
+}
+
+void
+_ctx_done(ucontext_t *ucp)
+{
+
+ if (ucp->uc_link == NULL)
+ exit(0);
+ else {
+ setcontext((const ucontext_t *)ucp->uc_link);
+ abort();
+ }
}
Modified: projects/ppc64/lib/libc/mips/gen/setjmp.S
==============================================================================
--- projects/ppc64/lib/libc/mips/gen/setjmp.S Sat Jun 19 17:04:01 2010 (r209344)
+++ projects/ppc64/lib/libc/mips/gen/setjmp.S Sat Jun 19 17:21:48 2010 (r209345)
@@ -41,6 +41,8 @@ __FBSDID("$FreeBSD$");
ASMSTR("$NetBSD: setjmp.S,v 1.17 2005/09/17 11:49:39 tsutsui Exp $")
#endif /* LIBC_SCCS and not lint */
+#include "SYS.h"
+
#ifdef __ABICALLS__
.abicalls
#endif
@@ -61,100 +63,102 @@ __FBSDID("$FreeBSD$");
NESTED(setjmp, SETJMP_FRAME_SIZE, ra)
.mask 0x80000000, (CALLFRAME_RA - CALLFRAME_SIZ)
- .set noreorder
-#ifdef __ABICALLS__
- .cpload t9
-#endif
- subu sp, sp, SETJMP_FRAME_SIZE # allocate stack frame
-#ifdef __ABICALLS__
- .cprestore 16
-#endif
- sw ra, CALLFRAME_RA(sp) # save RA
- sw a0, CALLFRAME_SIZ(sp) # store env
+ SETUP_GP
+ PTR_SUBU sp, sp, SETJMP_FRAME_SIZE # allocate stack frame
+ SAVE_GP(CALLFRAME_GP)
+ SETUP_GP64(CALLFRAME_GP, setjmp)
+
+ REG_S ra, CALLFRAME_RA(sp) # save RA
+ REG_S a0, CALLFRAME_SIZ(sp) # store env
/* Get the signal mask. */
- addu a2, a0, _JB_SIGMASK * SZREG # &oenv
+ PTR_ADDU a2, a0, _JB_SIGMASK * SZREG # &oenv
li a0, 1 # SIG_SETBLOCK
move a1, zero # &env == 0
- la t9, _C_LABEL(sigprocmask) # get current signal mask
- jal t9
- nop
+ PTR_LA t9, _C_LABEL(sigprocmask) # get current signal mask
+ jalr t9
- lw a0, CALLFRAME_SIZ(sp) # restore env pointer
- lw ra, CALLFRAME_RA(sp) # restore RA
- addu sp, sp, SETJMP_FRAME_SIZE # pop stack frame
-
- li v0, _JB_MAGIC_SETJMP
- sw v0, (_JB_MAGIC * SZREG)(a0)
- sw ra, (_JB_REG_RA * SZREG)(a0)
- sw s0, (_JB_REG_S0 * SZREG)(a0)
- sw s1, (_JB_REG_S1 * SZREG)(a0)
- sw s2, (_JB_REG_S2 * SZREG)(a0)
- sw s3, (_JB_REG_S3 * SZREG)(a0)
- sw s4, (_JB_REG_S4 * SZREG)(a0)
- sw s5, (_JB_REG_S5 * SZREG)(a0)
- sw s6, (_JB_REG_S6 * SZREG)(a0)
- sw s7, (_JB_REG_S7 * SZREG)(a0)
- sw sp, (_JB_REG_SP * SZREG)(a0)
- sw s8, (_JB_REG_S8 * SZREG)(a0)
+ RESTORE_GP64
+ REG_L a0, CALLFRAME_SIZ(sp) # restore env pointer
+ REG_L ra, CALLFRAME_RA(sp) # restore RA
+ PTR_ADDU sp, sp, SETJMP_FRAME_SIZE # pop stack frame
+
+ REG_LI v0, _JB_MAGIC_SETJMP
+ REG_S v0, (_JB_MAGIC * SZREG)(a0)
+ REG_S ra, (_JB_REG_RA * SZREG)(a0)
+ REG_S s0, (_JB_REG_S0 * SZREG)(a0)
+ REG_S s1, (_JB_REG_S1 * SZREG)(a0)
+ REG_S s2, (_JB_REG_S2 * SZREG)(a0)
+ REG_S s3, (_JB_REG_S3 * SZREG)(a0)
+ REG_S s4, (_JB_REG_S4 * SZREG)(a0)
+ REG_S s5, (_JB_REG_S5 * SZREG)(a0)
+ REG_S s6, (_JB_REG_S6 * SZREG)(a0)
+ REG_S s7, (_JB_REG_S7 * SZREG)(a0)
+ REG_S sp, (_JB_REG_SP * SZREG)(a0)
+ REG_S s8, (_JB_REG_S8 * SZREG)(a0)
+#if defined(__mips_n32) || defined(__mips_n64)
+ REG_S gp, (_JB_REG_GP * SZREG)(a0)
+#endif
move v0, zero
- j ra
+ jr ra
END(setjmp)
#define LONGJMP_FRAME_SIZE (CALLFRAME_SIZ + (SZREG * 2))
NESTED(longjmp, LONGJMP_FRAME_SIZE, ra)
.mask 0x80000000, (CALLFRAME_RA - CALLFRAME_SIZ)
- .set noreorder
-#ifdef __ABICALLS__
- .cpload t9
-#endif
- subu sp, sp, LONGJMP_FRAME_SIZE # allocate stack frame
-#ifdef __ABICALLS__
- .cprestore 16
-#endif
- sw ra, CALLFRAME_RA(sp) # save RA
- lw v0, (_JB_MAGIC * SZREG)(a0)
- li t0, _JB_MAGIC_SETJMP
+ PIC_PROLOGUE(longjmp)
+ PTR_SUBU sp, sp, LONGJMP_FRAME_SIZE # allocate stack frame
+ SAVE_GP(CALLFRAME_GP)
+
+ REG_S ra, CALLFRAME_RA(sp) # save RA
+ REG_L v0, (_JB_MAGIC * SZREG)(a0)
+ REG_LI t0, _JB_MAGIC_SETJMP
bne v0, t0, botch # jump if error
nop
- sw a0, CALLFRAME_SIZ(sp) # save env
- sw a1, (CALLFRAME_SIZ + SZREG)(sp) # save return value
+ REG_S a0, CALLFRAME_SIZ(sp) # save env
+ REG_S a1, (CALLFRAME_SIZ + SZREG)(sp) # save return value
# set sigmask
- addu a1, a0, _JB_SIGMASK * SZREG # &set
+ PTR_ADDU a1, a0, _JB_SIGMASK * SZREG # &set
move a2, zero # &oset == NULL
li a0, 3 # SIG_SETMASK
- la t9,_C_LABEL(sigprocmask) # set current signal mask
+ PTR_LA t9,_C_LABEL(sigprocmask) # set current signal mask
jal t9
nop
- lw a0, CALLFRAME_SIZ(sp) # restore env
- lw a1, (CALLFRAME_SIZ + SZREG)(sp) # restore return value
+ REG_L a0, CALLFRAME_SIZ(sp) # restore env
+ REG_L a1, (CALLFRAME_SIZ + SZREG)(sp) # restore return value
+
+ REG_L ra, (_JB_REG_RA * SZREG)(a0)
+ REG_L s0, (_JB_REG_S0 * SZREG)(a0)
+ REG_L s1, (_JB_REG_S1 * SZREG)(a0)
+ REG_L s2, (_JB_REG_S2 * SZREG)(a0)
+ REG_L s3, (_JB_REG_S3 * SZREG)(a0)
+ REG_L s4, (_JB_REG_S4 * SZREG)(a0)
+ REG_L s5, (_JB_REG_S5 * SZREG)(a0)
+ REG_L s6, (_JB_REG_S6 * SZREG)(a0)
+ REG_L s7, (_JB_REG_S7 * SZREG)(a0)
+ REG_L sp, (_JB_REG_SP * SZREG)(a0)
+ REG_L s8, (_JB_REG_S8 * SZREG)(a0)
+#if defined(__mips_n32) || defined(__mips_n64)
+ REG_L gp, (_JB_REG_GP * SZREG)(a0)
+#endif
- lw ra, (_JB_REG_RA * SZREG)(a0)
- lw s0, (_JB_REG_S0 * SZREG)(a0)
- lw s1, (_JB_REG_S1 * SZREG)(a0)
- lw s2, (_JB_REG_S2 * SZREG)(a0)
- lw s3, (_JB_REG_S3 * SZREG)(a0)
- lw s4, (_JB_REG_S4 * SZREG)(a0)
- lw s5, (_JB_REG_S5 * SZREG)(a0)
- lw s6, (_JB_REG_S6 * SZREG)(a0)
- lw s7, (_JB_REG_S7 * SZREG)(a0)
- lw sp, (_JB_REG_SP * SZREG)(a0)
- lw s8, (_JB_REG_S8 * SZREG)(a0)
move v0, a1
j ra
nop
botch:
- la t9, _C_LABEL(longjmperror)
- jal t9
+ /*
+ * We know we aren't returning so we don't care about restoring
+ * our caller's GP.
+ */
+ PTR_LA t9, _C_LABEL(longjmperror)
+ jalr t9
nop
- la t9, _C_LABEL(abort)
- jal t9
- nop
+ PIC_TAILCALL(abort)
END(longjmp)
Modified: projects/ppc64/lib/libc/mips/gen/sigsetjmp.S
==============================================================================
--- projects/ppc64/lib/libc/mips/gen/sigsetjmp.S Sat Jun 19 17:04:01 2010 (r209344)
+++ projects/ppc64/lib/libc/mips/gen/sigsetjmp.S Sat Jun 19 17:21:48 2010 (r209345)
@@ -40,6 +40,8 @@ __FBSDID("$FreeBSD$");
ASMSTR("$NetBSD: sigsetjmp.S,v 1.8 2005/09/17 11:49:39 tsutsui Exp $")
#endif /* LIBC_SCCS and not lint */
+#include "SYS.h"
+
#ifdef __ABICALLS__
.abicalls
#endif
@@ -57,30 +59,19 @@ __FBSDID("$FreeBSD$");
*/
LEAF(sigsetjmp)
-#ifdef __ABICALLS__
- .set noreorder
- .cpload t9
- .set reorder
-#endif
+ PIC_PROLOGUE(sigsetjmp)
+
bne a1, 0x0, 1f # do saving of signal mask?
- la t9, _setjmp
- jr t9
+ PIC_TAILCALL(_setjmp)
-1: la t9, setjmp
- jr t9
+1: PIC_TAILCALL(setjmp)
END(sigsetjmp)
LEAF(siglongjmp)
-#ifdef __ABICALLS__
- .set noreorder
- .cpload t9
- .set reorder
-#endif
- lw t0, (_JB_MAGIC * SZREG)(a0)
- li t1, _JB_MAGIC__SETJMP
+ PIC_PROLOGUE(siglongjmp)
+ REG_L t0, (_JB_MAGIC * SZREG)(a0)
+ REG_LI t1, _JB_MAGIC__SETJMP
bne t0, t1, 1f # setjmp or _setjmp magic?
- la t9, _longjmp
- jr t9
-1: la t9, longjmp
- jr t9
+ PIC_TAILCALL(_longjmp)
+1: PIC_TAILCALL(longjmp)
END(siglongjmp)
Modified: projects/ppc64/lib/libc/mips/string/bcmp.S
==============================================================================
--- projects/ppc64/lib/libc/mips/string/bcmp.S Sat Jun 19 17:04:01 2010 (r209344)
+++ projects/ppc64/lib/libc/mips/string/bcmp.S Sat Jun 19 17:21:48 2010 (r209345)
@@ -1,4 +1,4 @@
-/* $NetBSD: bcmp.S,v 1.8 2003/08/07 16:42:16 agc Exp $ */
+/* $NetBSD: bcmp.S,v 1.9 2009/12/14 01:07:42 matt Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -35,9 +35,15 @@
#include <machine/asm.h>
__FBSDID("$FreeBSD$");
+#define _LOCORE /* XXX not really, just assembly-code source */
+#include <machine/endian.h> /* LWLO/LWHI, SWLO/SWHI */
+
#if defined(LIBC_SCCS) && !defined(lint)
+#if 0
ASMSTR("from: @(#)bcmp.s 8.1 (Berkeley) 6/4/93")
- ASMSTR("$NetBSD: bcmp.S,v 1.8 2003/08/07 16:42:16 agc Exp $")
+#else
+ ASMSTR("$NetBSD: bcmp.S,v 1.9 2009/12/14 01:07:42 matt Exp $")
+#endif
#endif /* LIBC_SCCS and not lint */
#ifdef __ABICALLS__
@@ -49,86 +55,76 @@ __FBSDID("$FreeBSD$");
LEAF(bcmp)
.set noreorder
- blt a2, 16, small # is it worth any trouble?
- xor v0, a0, a1 # compare low two bits of addresses
- and v0, v0, 3
- subu a3, zero, a1 # compute # bytes to word align address
- bne v0, zero, unaligned # not possible to align addresses
- and a3, a3, 3
-
- beq a3, zero, 1f
- subu a2, a2, a3 # subtract from remaining count
- move v0, v1 # init v0,v1 so unmodified bytes match
-#ifdef __MIPSEB__
- lwl v0, 0(a0) # read 1, 2, or 3 bytes
- lwl v1, 0(a1)
-#else
- lwr v0, 0(a0) # read 1, 2, or 3 bytes
- lwr v1, 0(a1)
-#endif
- addu a1, a1, a3
- bne v0, v1, nomatch
- addu a0, a0, a3
+ blt a2, 16, small # is it worth any trouble?
+ xor v0, a0, a1 # compare low two bits of addresses
+ and v0, v0, 3
+ PTR_SUBU a3, zero, a1 # compute # bytes to word align address
+ bne v0, zero, unaligned # not possible to align addresses
+ and a3, a3, 3
+
+ beq a3, zero, 1f
+ PTR_SUBU a2, a2, a3 # subtract from remaining count
+ move v0, v1 # init v0,v1 so unmodified bytes match
+ LWHI v0, 0(a0) # read 1, 2, or 3 bytes
+ LWHI v1, 0(a1)
+ PTR_ADDU a1, a1, a3
+ bne v0, v1, nomatch
+ PTR_ADDU a0, a0, a3
1:
- and a3, a2, ~3 # compute number of whole words left
- subu a2, a2, a3 # which has to be >= (16-3) & ~3
- addu a3, a3, a0 # compute ending address
+ and a3, a2, ~3 # compute number of whole words left
+ PTR_SUBU a2, a2, a3 # which has to be >= (16-3) & ~3
+ PTR_ADDU a3, a3, a0 # compute ending address
2:
- lw v0, 0(a0) # compare words
- lw v1, 0(a1)
- addu a0, a0, 4
- bne v0, v1, nomatch
- addu a1, a1, 4
- bne a0, a3, 2b
+ lw v0, 0(a0) # compare words
+ lw v1, 0(a1)
+ PTR_ADDU a0, a0, 4
+ bne v0, v1, nomatch
+ PTR_ADDU a1, a1, 4
+ bne a0, a3, 2b
nop
- b small # finish remainder
+ b small # finish remainder
nop
unaligned:
- beq a3, zero, 2f
- subu a2, a2, a3 # subtract from remaining count
- addu a3, a3, a0 # compute ending address
+ beq a3, zero, 2f
+ PTR_SUBU a2, a2, a3 # subtract from remaining count
+ PTR_ADDU a3, a3, a0 # compute ending address
1:
- lbu v0, 0(a0) # compare bytes until a1 word aligned
- lbu v1, 0(a1)
- addu a0, a0, 1
- bne v0, v1, nomatch
- addu a1, a1, 1
- bne a0, a3, 1b
+ lbu v0, 0(a0) # compare bytes until a1 word aligned
+ lbu v1, 0(a1)
+ PTR_ADDU a0, a0, 1
+ bne v0, v1, nomatch
+ PTR_ADDU a1, a1, 1
+ bne a0, a3, 1b
nop
2:
- and a3, a2, ~3 # compute number of whole words left
- subu a2, a2, a3 # which has to be >= (16-3) & ~3
- addu a3, a3, a0 # compute ending address
+ and a3, a2, ~3 # compute number of whole words left
+ PTR_SUBU a2, a2, a3 # which has to be >= (16-3) & ~3
+ PTR_ADDU a3, a3, a0 # compute ending address
3:
-#ifdef __MIPSEB__
- lwl v0, 0(a0) # compare words a0 unaligned, a1 aligned
- lwr v0, 3(a0)
-#else
- lwr v0, 0(a0) # compare words a0 unaligned, a1 aligned
- lwl v0, 3(a0)
-#endif
- lw v1, 0(a1)
- addu a0, a0, 4
- bne v0, v1, nomatch
- addu a1, a1, 4
- bne a0, a3, 3b
+ LWHI v0, 0(a0) # compare words a0 unaligned, a1 aligned
+ LWLO v0, 3(a0)
+ lw v1, 0(a1)
+ PTR_ADDU a0, a0, 4
+ bne v0, v1, nomatch
+ PTR_ADDU a1, a1, 4
+ bne a0, a3, 3b
nop
small:
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
More information about the svn-src-projects
mailing list