Remove ia64.
This includes: o All directories named *ia64* o All files named *ia64* o All ia64-specific code guarded by __ia64__ o All ia64-specific makefile logic o Mention of ia64 in comments and documentation This excludes: o Everything under contrib/ o Everything under crypto/ o sys/xen/interface o sys/sys/elf_common.h Discussed at: BSDcan
This commit is contained in:
parent
43f783bfcf
commit
9f28abd980
@ -230,9 +230,6 @@ prepare_elf32(dtrace_hdl_t *dtp, const dof_hdr_t *dof, dof_elf32_t *dep)
|
||||
#if defined(__arm__)
|
||||
/* XXX */
|
||||
printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__);
|
||||
#elif defined(__ia64__)
|
||||
/* XXX */
|
||||
printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__);
|
||||
#elif defined(__i386) || defined(__amd64)
|
||||
rel->r_offset = s->dofs_offset +
|
||||
dofr[j].dofr_offset;
|
||||
@ -424,8 +421,6 @@ prepare_elf64(dtrace_hdl_t *dtp, const dof_hdr_t *dof, dof_elf64_t *dep)
|
||||
#ifdef DOODAD
|
||||
#if defined(__arm__)
|
||||
/* XXX */
|
||||
#elif defined(__ia64__)
|
||||
/* XXX */
|
||||
#elif defined(__mips__)
|
||||
/* XXX */
|
||||
#elif defined(__powerpc__)
|
||||
@ -535,8 +530,6 @@ dump_elf32(dtrace_hdl_t *dtp, const dof_hdr_t *dof, int fd)
|
||||
elf_file.ehdr.e_type = ET_REL;
|
||||
#if defined(__arm__)
|
||||
elf_file.ehdr.e_machine = EM_ARM;
|
||||
#elif defined(__ia64__)
|
||||
elf_file.ehdr.e_machine = EM_IA_64;
|
||||
#elif defined(__mips__)
|
||||
elf_file.ehdr.e_machine = EM_MIPS;
|
||||
#elif defined(__powerpc__)
|
||||
@ -683,8 +676,6 @@ dump_elf64(dtrace_hdl_t *dtp, const dof_hdr_t *dof, int fd)
|
||||
elf_file.ehdr.e_type = ET_REL;
|
||||
#if defined(__arm__)
|
||||
elf_file.ehdr.e_machine = EM_ARM;
|
||||
#elif defined(__ia64__)
|
||||
elf_file.ehdr.e_machine = EM_IA_64;
|
||||
#elif defined(__mips__)
|
||||
elf_file.ehdr.e_machine = EM_MIPS;
|
||||
#elif defined(__powerpc__)
|
||||
@ -814,15 +805,6 @@ dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, GElf_Rela *rela,
|
||||
printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__);
|
||||
return (0);
|
||||
}
|
||||
#elif defined(__ia64__)
|
||||
/* XXX */
|
||||
static int
|
||||
dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, GElf_Rela *rela,
|
||||
uint32_t *off)
|
||||
{
|
||||
printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__);
|
||||
return (0);
|
||||
}
|
||||
#elif defined(__mips__)
|
||||
/* XXX */
|
||||
static int
|
||||
@ -1235,9 +1217,7 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *eprobesp)
|
||||
|
||||
if (dtp->dt_oflags & DTRACE_O_LP64) {
|
||||
eclass = ELFCLASS64;
|
||||
#if defined(__ia64__)
|
||||
emachine1 = emachine2 = EM_IA_64;
|
||||
#elif defined(__mips__)
|
||||
#if defined(__mips__)
|
||||
emachine1 = emachine2 = EM_MIPS;
|
||||
#elif defined(__powerpc__)
|
||||
emachine1 = emachine2 = EM_PPC64;
|
||||
@ -1258,7 +1238,7 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *eprobesp)
|
||||
#elif defined(__sparc)
|
||||
emachine1 = EM_SPARC;
|
||||
emachine2 = EM_SPARC32PLUS;
|
||||
#elif defined(__i386) || defined(__amd64) || defined(__ia64__)
|
||||
#elif defined(__i386) || defined(__amd64)
|
||||
emachine1 = emachine2 = EM_386;
|
||||
#endif
|
||||
symsize = sizeof (Elf32_Sym);
|
||||
|
@ -14,7 +14,7 @@
|
||||
.if exists(${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH}/opensolaris_atomic.S)
|
||||
.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH}
|
||||
ATOMIC_SRCS= opensolaris_atomic.S
|
||||
.if ${MACHINE_ARCH} != "ia64" && ${MACHINE_ARCH} != "sparc64"
|
||||
.if ${MACHINE_ARCH} != "sparc64"
|
||||
ACFLAGS+= -Wa,--noexecstack
|
||||
.endif
|
||||
.else
|
||||
|
@ -1,49 +0,0 @@
|
||||
#
|
||||
# $FreeBSD$
|
||||
# @(#)ttys 5.1 (Berkeley) 4/17/89
|
||||
#
|
||||
# This file specifies various information about terminals on the system.
|
||||
# It is used by several different programs. Common entries for the
|
||||
# various columns include:
|
||||
#
|
||||
# name The name of the terminal device.
|
||||
#
|
||||
# getty The program to start running on the terminal. Typically a
|
||||
# getty program, as the name implies. Other common entries
|
||||
# include none, when no getty is needed, and xdm, to start the
|
||||
# X Window System.
|
||||
#
|
||||
# type The initial terminal type for this port. For hardwired
|
||||
# terminal lines, this will contain the type of terminal used.
|
||||
# For virtual consoles, the correct type is typically xterm.
|
||||
# Other common values include dialup for incoming modem ports, and
|
||||
# unknown when the terminal type cannot be predetermined.
|
||||
#
|
||||
# status Must be on or off. If on, init will run the getty program on
|
||||
# the specified port. If the word "secure" appears, this tty
|
||||
# allows root login.
|
||||
#
|
||||
# name getty type status comments
|
||||
#
|
||||
# If console is marked "insecure", then init will ask for the root password
|
||||
# when going to single-user mode.
|
||||
console none unknown off secure
|
||||
#
|
||||
ttyv0 "/usr/libexec/getty Pc" xterm off secure
|
||||
# Virtual terminals
|
||||
ttyv1 "/usr/libexec/getty Pc" xterm off secure
|
||||
ttyv2 "/usr/libexec/getty Pc" xterm off secure
|
||||
ttyv3 "/usr/libexec/getty Pc" xterm off secure
|
||||
ttyv4 "/usr/libexec/getty Pc" xterm off secure
|
||||
ttyv5 "/usr/libexec/getty Pc" xterm off secure
|
||||
ttyv6 "/usr/libexec/getty Pc" xterm off secure
|
||||
ttyv7 "/usr/libexec/getty Pc" xterm off secure
|
||||
ttyv8 "/usr/local/bin/xdm -nodaemon" xterm off secure
|
||||
# Serial terminals. The 'dialup' keyword identifies dialin lines to login,
|
||||
# fingerd etc.
|
||||
ttyu0 "/usr/libexec/getty 3wire" vt100 on secure
|
||||
ttyu1 "/usr/libexec/getty 3wire" vt100 on secure
|
||||
ttyu2 "/usr/libexec/getty std.9600" dialup off secure
|
||||
ttyu3 "/usr/libexec/getty std.9600" dialup off secure
|
||||
# Dumb console
|
||||
dcons "/usr/libexec/getty std.9600" vt100 off secure
|
@ -28,13 +28,6 @@ MKDEP= -DCRT_BEGIN
|
||||
CFLAGS+= -DTARGET_ARM_EABI
|
||||
.endif
|
||||
|
||||
.if ${MACHINE_CPUARCH} == "ia64"
|
||||
BEGINSRC= crtbegin.asm
|
||||
ENDSRC= crtend.asm
|
||||
CFLAGS+= -x assembler-with-cpp # Ugly hack
|
||||
CFLAGS+= -include osreldate.h
|
||||
.undef SRCS # hack for 'make depend'
|
||||
.endif
|
||||
.if ${MACHINE_CPUARCH} == "powerpc"
|
||||
TGTOBJS= crtsavres.o
|
||||
SRCS+= crtsavres.asm
|
||||
|
@ -137,17 +137,6 @@ LIB2FUNCS_EXTRA+= fixdfdi.c fixunssfsi.c
|
||||
.endif
|
||||
.endif
|
||||
|
||||
.if ${TARGET_CPUARCH} == "ia64"
|
||||
# from config/ia64/t-ia64
|
||||
LIB1ASMSRC = lib1funcs.asm
|
||||
LIB1ASMFUNCS = __divxf3 __divdf3 __divsf3 \
|
||||
__divdi3 __moddi3 __udivdi3 __umoddi3 \
|
||||
__divsi3 __modsi3 __udivsi3 __umodsi3 __save_stack_nonlocal \
|
||||
__nonlocal_goto __restore_stack_nonlocal __trampoline \
|
||||
_fixtfdi _fixunstfdi _floatditf
|
||||
LIB2ADDEH = unwind-ia64.c unwind-sjlj.c unwind-c.c
|
||||
.endif
|
||||
|
||||
.if ${TARGET_ARCH} == "powerpc"
|
||||
# from config/rs6000/t-ppccomm
|
||||
LIB2FUNCS_EXTRA = tramp.asm
|
||||
|
@ -1,3 +0,0 @@
|
||||
/* $FreeBSD$ */
|
||||
|
||||
#include "tc-ia64.h"
|
@ -5,10 +5,6 @@
|
||||
|
||||
.PATH: ${SRCDIR}/ld
|
||||
|
||||
.if ${TARGET_ARCH} == "ia64"
|
||||
CFLAGS+= -O1
|
||||
.endif
|
||||
|
||||
PROG= ld
|
||||
SCRIPTDIR= /usr/libdata/ldscripts
|
||||
SRCS+= ldcref.c \
|
||||
|
@ -1,24 +0,0 @@
|
||||
# $FreeBSD$
|
||||
|
||||
NATIVE_EMULATION= elf64_ia64_fbsd
|
||||
|
||||
SRCS+= e${NATIVE_EMULATION}.c
|
||||
CLEANFILES+= e${NATIVE_EMULATION}.c
|
||||
e${NATIVE_EMULATION}.c: ${.CURDIR}/${NATIVE_EMULATION}.sh emultempl/elf32.em \
|
||||
scripttempl/elf.sc genscripts.sh stringify.sed
|
||||
sh ${.CURDIR}/genscripts.sh ${SRCDIR}/ld ${LIBSEARCHPATH} \
|
||||
${TOOLS_PREFIX}/usr \
|
||||
${HOST} ${TARGET_TUPLE} ${TARGET_TUPLE} \
|
||||
${NATIVE_EMULATION} "" no ${NATIVE_EMULATION} ${TARGET_TUPLE} \
|
||||
${.CURDIR}/${NATIVE_EMULATION}.sh
|
||||
|
||||
#XXX EMS+= eelf64_ia64
|
||||
|
||||
SRCS+= eelf64_ia64.c
|
||||
CLEANFILES+= eelf64_ia64.c
|
||||
eelf64_ia64.c: emulparams/elf64_ia64.sh emultempl/elf32.em \
|
||||
scripttempl/elf.sc genscripts.sh stringify.sed
|
||||
sh ${.CURDIR}/genscripts.sh ${SRCDIR}/ld ${LIBSEARCHPATH} \
|
||||
${TOOLS_PREFIX}/usr \
|
||||
${HOST} ${TARGET_TUPLE} ${TARGET_TUPLE} \
|
||||
elf64_ia64 "" no elf64_ia64 ${TARGET_TUPLE}
|
@ -1,8 +0,0 @@
|
||||
# $FreeBSD$
|
||||
. ${srcdir}/emulparams/elf64_ia64.sh
|
||||
TEXT_START_ADDR="0x0000000100000000"
|
||||
unset DATA_ADDR
|
||||
unset SMALL_DATA_CTOR
|
||||
unset SMALL_DATA_DTOR
|
||||
. ${srcdir}/emulparams/elf_fbsd.sh
|
||||
OUTPUT_FORMAT="elf64-ia64-freebsd"
|
@ -42,7 +42,7 @@ SRCS+= archive.c \
|
||||
targets.c \
|
||||
targmatch.h \
|
||||
tekhex.c
|
||||
.if (${TARGET_ARCH} == "ia64" || ${TARGET_ARCH} == "sparc64")
|
||||
.if ${TARGET_ARCH} == "sparc64"
|
||||
WARNS?= 2
|
||||
.endif
|
||||
CFLAGS+= -D_GNU_SOURCE
|
||||
|
@ -1,35 +0,0 @@
|
||||
# $FreeBSD$
|
||||
|
||||
DEFAULT_VECTOR= bfd_elf64_ia64_freebsd_vec
|
||||
|
||||
SRCS+= cofflink.c \
|
||||
cpu-ia64.c \
|
||||
efi-app-ia64.c \
|
||||
elf32.c \
|
||||
elf32-gen.c \
|
||||
elf32-target.h \
|
||||
elf64.c \
|
||||
elf64-gen.c \
|
||||
elf64-ia64.c \
|
||||
elf64-target.h \
|
||||
elflink.c \
|
||||
pepigen.c \
|
||||
pex64igen.c
|
||||
|
||||
VECS+= ${DEFAULT_VECTOR} \
|
||||
bfd_efi_app_ia64_vec \
|
||||
bfd_elf64_ia64_little_vec \
|
||||
bfd_elf64_ia64_big_vec \
|
||||
bfd_elf64_little_generic_vec bfd_elf64_big_generic_vec \
|
||||
bfd_elf32_little_generic_vec bfd_elf32_big_generic_vec
|
||||
|
||||
CLEANFILES+= elf64-ia64.c pepigen.c pex64igen.c
|
||||
|
||||
elf64-ia64.c: elfxx-ia64.c
|
||||
sed -e s/NN/64/g ${.ALLSRC} > ${.TARGET}
|
||||
|
||||
pepigen.c: peXXigen.c
|
||||
sed -e s/XX/pep/g ${.ALLSRC} > ${.TARGET}
|
||||
|
||||
pex64igen.c: peXXigen.c
|
||||
sed -e s/XX/pex64/g ${.ALLSRC} > ${.TARGET}
|
@ -85,7 +85,7 @@ extern "C" {
|
||||
#define BFD_HOST_64BIT_LONG 0
|
||||
#define BFD_HOST_64_BIT long long
|
||||
#define BFD_HOST_U_64_BIT unsigned long long
|
||||
#elif defined(__alpha__) || defined(__sparc64__) || defined(__amd64__) || defined(__ia64__)
|
||||
#elif defined(__alpha__) || defined(__sparc64__) || defined(__amd64__)
|
||||
#define BFD_HOST_64BIT_LONG 1
|
||||
#define BFD_HOST_64_BIT long
|
||||
#define BFD_HOST_U_64_BIT unsigned long
|
||||
|
@ -1,4 +0,0 @@
|
||||
# $FreeBSD$
|
||||
|
||||
SRCS+= ia64-dis.c ia64-opc.c
|
||||
CFLAGS+= -DARCH_ia64
|
@ -11,9 +11,6 @@ TARGET_CPUARCH=${MACHINE_CPUARCH}
|
||||
TARGET_ARCH?= ${MACHINE_ARCH}
|
||||
GCC_CPU=${TARGET_CPUARCH:C/amd64/i386/:C/powerpc/rs6000/:C/sparc64/sparc/}
|
||||
|
||||
.if ${TARGET_ARCH} == "ia64"
|
||||
TARGET_CPU_DEFAULT= MASK_GNU_AS|MASK_GNU_LD
|
||||
.endif
|
||||
.if ${TARGET_ARCH} == "sparc64"
|
||||
TARGET_CPU_DEFAULT= TARGET_CPU_ultrasparc
|
||||
.endif
|
||||
|
@ -12,8 +12,6 @@ INCSDIR=${INCLUDEDIR}/gcc/${GCCVER}
|
||||
INCS= ammintrin.h emmintrin.h mmintrin.h mm3dnow.h pmmintrin.h \
|
||||
tmmintrin.h xmmintrin.h mm_malloc.h
|
||||
INCS+= wmmintrin.h __wmmintrin_aes.h __wmmintrin_pclmul.h
|
||||
.elif ${TARGET_ARCH} == "ia64"
|
||||
INCS= ia64intrin.h
|
||||
.elif ${TARGET_ARCH} == "arm"
|
||||
INCS= mmintrin.h
|
||||
.elif ${TARGET_ARCH} == "powerpc" || ${TARGET_ARCH} == "powerpc64"
|
||||
|
@ -1,14 +0,0 @@
|
||||
# $FreeBSD$
|
||||
|
||||
.if !defined(GDB_CROSS_DEBUGGER)
|
||||
LIBSRCS+= fbsd-proc.c fbsd-threads.c gcore.c
|
||||
LIBSRCS+= ia64-fbsd-nat.c
|
||||
.endif
|
||||
LIBSRCS+= solib.c solib-svr4.c
|
||||
LIBSRCS+= ia64-fbsd-tdep.c ia64-tdep.c
|
||||
|
||||
nm.h:
|
||||
echo '#include "ia64/nm-fbsd.h"' > ${.TARGET}
|
||||
|
||||
tm.h:
|
||||
echo '#include "ia64/tm-fbsd.h"' > ${.TARGET}
|
@ -1,550 +0,0 @@
|
||||
/* $FreeBSD$ */
|
||||
|
||||
/* config.h. Generated automatically by configure. */
|
||||
/* config.in. Generated automatically from configure.in by autoheader. */
|
||||
|
||||
/* Define if on AIX 3.
|
||||
System headers sometimes define this.
|
||||
We just want to avoid a redefinition error message. */
|
||||
#ifndef _ALL_SOURCE
|
||||
/* #undef _ALL_SOURCE */
|
||||
#endif
|
||||
|
||||
/* Define if using alloca.c. */
|
||||
/* #undef C_ALLOCA */
|
||||
|
||||
/* Define to empty if the keyword does not work. */
|
||||
/* #undef const */
|
||||
|
||||
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
|
||||
This function is required for alloca.c support on those systems. */
|
||||
/* #undef CRAY_STACKSEG_END */
|
||||
|
||||
/* Define if you have alloca, as a function or macro. */
|
||||
#define HAVE_ALLOCA 1
|
||||
|
||||
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
|
||||
/* #undef HAVE_ALLOCA_H */
|
||||
|
||||
/* Define if the `long double' type works. */
|
||||
#define HAVE_LONG_DOUBLE 1
|
||||
|
||||
/* Define if you have a working `mmap' system call. */
|
||||
#define HAVE_MMAP 1
|
||||
|
||||
/* Define if you have <vfork.h>. */
|
||||
/* #undef HAVE_VFORK_H */
|
||||
|
||||
/* Define as __inline if that's what the C compiler calls it. */
|
||||
/* #undef inline */
|
||||
|
||||
/* Define to `long' if <sys/types.h> doesn't define. */
|
||||
/* #undef off_t */
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
/* #undef pid_t */
|
||||
|
||||
/* Define if you need to in order for stat and other things to work. */
|
||||
/* #undef _POSIX_SOURCE */
|
||||
|
||||
/* Define as the return type of signal handlers (int or void). */
|
||||
#define RETSIGTYPE void
|
||||
|
||||
/* Define if the `setpgrp' function takes no argument. */
|
||||
/* #undef SETPGRP_VOID */
|
||||
|
||||
/* Define to `unsigned' if <sys/types.h> doesn't define. */
|
||||
/* #undef size_t */
|
||||
|
||||
/* If using the C implementation of alloca, define if you know the
|
||||
direction of stack growth for your system; otherwise it will be
|
||||
automatically deduced at run-time.
|
||||
STACK_DIRECTION > 0 => grows toward higher addresses
|
||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||
STACK_DIRECTION = 0 => direction of growth unknown
|
||||
*/
|
||||
/* #undef STACK_DIRECTION */
|
||||
|
||||
/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
|
||||
/* #undef STAT_MACROS_BROKEN */
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* Define vfork as fork if vfork does not work. */
|
||||
/* #undef vfork */
|
||||
|
||||
/* Enable GNU extensions on systems that have them. */
|
||||
#ifndef _GNU_SOURCE
|
||||
# define _GNU_SOURCE 1
|
||||
#endif
|
||||
|
||||
/* Define if your struct reg has r_fs. */
|
||||
/* #undef HAVE_STRUCT_REG_R_FS */
|
||||
|
||||
/* Define if your struct stat has st_blocks. */
|
||||
#define HAVE_STRUCT_STAT_ST_BLOCKS 1
|
||||
|
||||
/* Define if your struct reg has r_gs. */
|
||||
/* #undef HAVE_STRUCT_REG_R_GS */
|
||||
|
||||
/* Define if <link.h> exists and defines struct link_map which has
|
||||
members with an ``l_'' prefix. (For Solaris, SVR4, and
|
||||
SVR4-like systems.) */
|
||||
#define HAVE_STRUCT_LINK_MAP_WITH_L_MEMBERS 1
|
||||
|
||||
/* Define if <link.h> exists and defines struct link_map which has
|
||||
members with an ``lm_'' prefix. (For SunOS.) */
|
||||
/* #undef HAVE_STRUCT_LINK_MAP_WITH_LM_MEMBERS */
|
||||
|
||||
/* Define if <link.h> exists and defines a struct so_map which has
|
||||
members with an ``som_'' prefix. (Found on older *BSD systems.) */
|
||||
/* #undef HAVE_STRUCT_SO_MAP_WITH_SOM_MEMBERS */
|
||||
|
||||
/* Define if <sys/link.h> has struct link_map32 */
|
||||
/* #undef HAVE_STRUCT_LINK_MAP32 */
|
||||
|
||||
/* Define if <sys/link.h> has link_map32 (solaris sparc-64 target) */
|
||||
/* #undef _SYSCALL32 */
|
||||
|
||||
/* Define if the prfpregset_t type is broken. */
|
||||
/* #undef PRFPREGSET_T_BROKEN */
|
||||
|
||||
/* Define if you want to use new multi-fd /proc interface
|
||||
(replaces HAVE_MULTIPLE_PROC_FDS as well as other macros). */
|
||||
/* #undef NEW_PROC_API */
|
||||
|
||||
/* Define if ioctl argument PIOCSET is available. */
|
||||
/* #undef HAVE_PROCFS_PIOCSET */
|
||||
|
||||
/* Define if the `long long' type works. */
|
||||
#define CC_HAS_LONG_LONG 1
|
||||
|
||||
/* Define if the "ll" format works to print long long ints. */
|
||||
#define PRINTF_HAS_LONG_LONG 1
|
||||
|
||||
/* Define if the "%Lg" format works to print long doubles. */
|
||||
#define PRINTF_HAS_LONG_DOUBLE 1
|
||||
|
||||
/* Define if the "%Lg" format works to scan long doubles. */
|
||||
#define SCANF_HAS_LONG_DOUBLE 1
|
||||
|
||||
/* Define if using Solaris thread debugging. */
|
||||
/* #undef HAVE_THREAD_DB_LIB */
|
||||
|
||||
/* Define on a GNU/Linux system to work around problems in sys/procfs.h. */
|
||||
/* #undef START_INFERIOR_TRAPS_EXPECTED */
|
||||
/* #undef sys_quotactl */
|
||||
|
||||
/* Define if you have HPUX threads */
|
||||
/* #undef HAVE_HPUX_THREAD_SUPPORT */
|
||||
|
||||
/* Define if <proc_service.h> on solaris uses int instead of
|
||||
size_t, and assorted other type changes. */
|
||||
/* #undef PROC_SERVICE_IS_OLD */
|
||||
|
||||
/* Define if the simulator is being linked in. */
|
||||
#define WITH_SIM 1
|
||||
|
||||
/* Set to true if the save_state_t structure is present */
|
||||
/* #undef HAVE_STRUCT_SAVE_STATE_T */
|
||||
|
||||
/* Set to true if the save_state_t structure has the ss_wide member */
|
||||
/* #undef HAVE_STRUCT_MEMBER_SS_WIDE */
|
||||
|
||||
/* Define if <sys/ptrace.h> defines the PTRACE_GETREGS request. */
|
||||
/* #undef HAVE_PTRACE_GETREGS */
|
||||
|
||||
/* Define if <sys/ptrace.h> defines the PTRACE_GETFPXREGS request. */
|
||||
/* #undef HAVE_PTRACE_GETFPXREGS */
|
||||
|
||||
/* Define if <sys/ptrace.h> defines the PT_GETDBREGS request. */
|
||||
#define HAVE_PT_GETDBREGS 1
|
||||
|
||||
/* Define if <sys/ptrace.h> defines the PT_GETXMMREGS request. */
|
||||
/* #undef HAVE_PT_GETXMMREGS */
|
||||
|
||||
/* Define if libunwind library is being used. */
|
||||
/* #undef HAVE_LIBUNWIND */
|
||||
|
||||
/* hostfile */
|
||||
/* #undef GDB_XM_FILE */
|
||||
|
||||
/* targetfile */
|
||||
#define GDB_TM_FILE config/ia64/tm-fbsd.h
|
||||
|
||||
/* nativefile */
|
||||
#ifndef CROSS_DEBUGGER
|
||||
#define GDB_NM_FILE config/ia64/nm-fbsd.h
|
||||
#endif
|
||||
|
||||
/* Define to 1 so <sys/proc.h> gets a definition of anon_hdl. Works
|
||||
around a <sys/proc.h> problem on IRIX 5. */
|
||||
#ifndef _KMEMUSER
|
||||
/* #undef _KMEMUSER */
|
||||
#endif
|
||||
|
||||
/* Define if you have the __argz_count function. */
|
||||
/* #undef HAVE___ARGZ_COUNT */
|
||||
|
||||
/* Define if you have the __argz_next function. */
|
||||
/* #undef HAVE___ARGZ_NEXT */
|
||||
|
||||
/* Define if you have the __argz_stringify function. */
|
||||
/* #undef HAVE___ARGZ_STRINGIFY */
|
||||
|
||||
/* Define if you have the _mcleanup function. */
|
||||
#define HAVE__MCLEANUP 1
|
||||
|
||||
/* Define if you have the canonicalize_file_name function. */
|
||||
/* #undef HAVE_CANONICALIZE_FILE_NAME */
|
||||
|
||||
/* Define if you have the dcgettext function. */
|
||||
/* #undef HAVE_DCGETTEXT */
|
||||
|
||||
/* Define if you have the getcwd function. */
|
||||
#define HAVE_GETCWD 1
|
||||
|
||||
/* Define if you have the getpagesize function. */
|
||||
#define HAVE_GETPAGESIZE 1
|
||||
|
||||
/* Define if you have the monstartup function. */
|
||||
#define HAVE_MONSTARTUP 1
|
||||
|
||||
/* Define if you have the munmap function. */
|
||||
#define HAVE_MUNMAP 1
|
||||
|
||||
/* Define if you have the poll function. */
|
||||
#define HAVE_POLL 1
|
||||
|
||||
/* Define if you have the pread64 function. */
|
||||
/* #undef HAVE_PREAD64 */
|
||||
|
||||
/* Define if you have the putenv function. */
|
||||
#define HAVE_PUTENV 1
|
||||
|
||||
/* Define if you have the realpath function. */
|
||||
#define HAVE_REALPATH 1
|
||||
|
||||
/* Define if you have the sbrk function. */
|
||||
#define HAVE_SBRK 1
|
||||
|
||||
/* Define if you have the setenv function. */
|
||||
#define HAVE_SETENV 1
|
||||
|
||||
/* Define if you have the setlocale function. */
|
||||
#define HAVE_SETLOCALE 1
|
||||
|
||||
/* Define if you have the setpgid function. */
|
||||
#define HAVE_SETPGID 1
|
||||
|
||||
/* Define if you have the setpgrp function. */
|
||||
#define HAVE_SETPGRP 1
|
||||
|
||||
/* Define if you have the sigaction function. */
|
||||
#define HAVE_SIGACTION 1
|
||||
|
||||
/* Define if you have the sigprocmask function. */
|
||||
#define HAVE_SIGPROCMASK 1
|
||||
|
||||
/* Define if you have the sigsetmask function. */
|
||||
#define HAVE_SIGSETMASK 1
|
||||
|
||||
/* Define if you have the socketpair function. */
|
||||
#define HAVE_SOCKETPAIR 1
|
||||
|
||||
/* Define if you have the stpcpy function. */
|
||||
#define HAVE_STPCPY 1
|
||||
|
||||
/* Define if you have the strcasecmp function. */
|
||||
#define HAVE_STRCASECMP 1
|
||||
|
||||
/* Define if you have the strchr function. */
|
||||
#define HAVE_STRCHR 1
|
||||
|
||||
/* Define if you have the syscall function. */
|
||||
#define HAVE_SYSCALL 1
|
||||
|
||||
/* Define if you have the <argz.h> header file. */
|
||||
/* #undef HAVE_ARGZ_H */
|
||||
|
||||
/* Define if you have the <ctype.h> header file. */
|
||||
#define HAVE_CTYPE_H 1
|
||||
|
||||
/* Define if you have the <curses.h> header file. */
|
||||
#define HAVE_CURSES_H 1
|
||||
|
||||
/* Define if you have the <dirent.h> header file. */
|
||||
#define HAVE_DIRENT_H 1
|
||||
|
||||
/* Define if you have the <libunwind-ia64.h> header file. */
|
||||
/* #undef HAVE_LIBUNWIND_IA64_H */
|
||||
|
||||
/* Define if you have the <libunwind.h> header file. */
|
||||
/* #undef HAVE_LIBUNWIND_H */
|
||||
|
||||
/* Define if you have the <limits.h> header file. */
|
||||
#define HAVE_LIMITS_H 1
|
||||
|
||||
/* Define if you have the <link.h> header file. */
|
||||
#define HAVE_LINK_H 1
|
||||
|
||||
/* Define if you have the <locale.h> header file. */
|
||||
#define HAVE_LOCALE_H 1
|
||||
|
||||
/* Define if you have the <machine/reg.h> header file. */
|
||||
#define HAVE_MACHINE_REG_H 1
|
||||
|
||||
/* Define if you have the <malloc.h> header file. */
|
||||
/* #undef HAVE_MALLOC_H */
|
||||
|
||||
/* Define if you have the <memory.h> header file. */
|
||||
#define HAVE_MEMORY_H 1
|
||||
|
||||
/* Define if you have the <ncurses.h> header file. */
|
||||
#define HAVE_NCURSES_H 1
|
||||
|
||||
/* Define if you have the <ndir.h> header file. */
|
||||
/* #undef HAVE_NDIR_H */
|
||||
|
||||
/* Define if you have the <nl_types.h> header file. */
|
||||
#define HAVE_NL_TYPES_H 1
|
||||
|
||||
/* Define if you have the <nlist.h> header file. */
|
||||
#define HAVE_NLIST_H 1
|
||||
|
||||
/* Define if you have the <poll.h> header file. */
|
||||
#define HAVE_POLL_H 1
|
||||
|
||||
/* Define if you have the <proc_service.h> header file. */
|
||||
/* #undef HAVE_PROC_SERVICE_H */
|
||||
|
||||
/* Define if you have the <ptrace.h> header file. */
|
||||
/* #undef HAVE_PTRACE_H */
|
||||
|
||||
/* Define if you have the <sgtty.h> header file. */
|
||||
#define HAVE_SGTTY_H 1
|
||||
|
||||
/* Define if you have the <stddef.h> header file. */
|
||||
#define HAVE_STDDEF_H 1
|
||||
|
||||
/* Define if you have the <stdint.h> header file. */
|
||||
#define HAVE_STDINT_H 1
|
||||
|
||||
/* Define if you have the <stdlib.h> header file. */
|
||||
#define HAVE_STDLIB_H 1
|
||||
|
||||
/* Define if you have the <string.h> header file. */
|
||||
#define HAVE_STRING_H 1
|
||||
|
||||
/* Define if you have the <strings.h> header file. */
|
||||
#define HAVE_STRINGS_H 1
|
||||
|
||||
/* Define if you have the <sys/debugreg.h> header file. */
|
||||
/* #undef HAVE_SYS_DEBUGREG_H */
|
||||
|
||||
/* Define if you have the <sys/dir.h> header file. */
|
||||
/* #undef HAVE_SYS_DIR_H */
|
||||
|
||||
/* Define if you have the <sys/fault.h> header file. */
|
||||
/* #undef HAVE_SYS_FAULT_H */
|
||||
|
||||
/* Define if you have the <sys/file.h> header file. */
|
||||
#define HAVE_SYS_FILE_H 1
|
||||
|
||||
/* Define if you have the <sys/filio.h> header file. */
|
||||
#define HAVE_SYS_FILIO_H 1
|
||||
|
||||
/* Define if you have the <sys/ioctl.h> header file. */
|
||||
#define HAVE_SYS_IOCTL_H 1
|
||||
|
||||
/* Define if you have the <sys/ndir.h> header file. */
|
||||
/* #undef HAVE_SYS_NDIR_H */
|
||||
|
||||
/* Define if you have the <sys/param.h> header file. */
|
||||
#define HAVE_SYS_PARAM_H 1
|
||||
|
||||
/* Define if you have the <sys/poll.h> header file. */
|
||||
#define HAVE_SYS_POLL_H 1
|
||||
|
||||
/* Define if you have the <sys/proc.h> header file. */
|
||||
#define HAVE_SYS_PROC_H 1
|
||||
|
||||
/* Define if you have the <sys/procfs.h> header file. */
|
||||
#define HAVE_SYS_PROCFS_H 1
|
||||
|
||||
/* Define if you have the <sys/ptrace.h> header file. */
|
||||
#define HAVE_SYS_PTRACE_H 1
|
||||
|
||||
/* Define if you have the <sys/reg.h> header file. */
|
||||
/* #undef HAVE_SYS_REG_H */
|
||||
|
||||
/* Define if you have the <sys/select.h> header file. */
|
||||
#define HAVE_SYS_SELECT_H 1
|
||||
|
||||
/* Define if you have the <sys/syscall.h> header file. */
|
||||
#define HAVE_SYS_SYSCALL_H 1
|
||||
|
||||
/* Define if you have the <sys/user.h> header file. */
|
||||
#define HAVE_SYS_USER_H 1
|
||||
|
||||
/* Define if you have the <sys/wait.h> header file. */
|
||||
#define HAVE_SYS_WAIT_H 1
|
||||
|
||||
/* Define if you have the <term.h> header file. */
|
||||
#define HAVE_TERM_H 1
|
||||
|
||||
/* Define if you have the <termio.h> header file. */
|
||||
/* #undef HAVE_TERMIO_H */
|
||||
|
||||
/* Define if you have the <termios.h> header file. */
|
||||
#define HAVE_TERMIOS_H 1
|
||||
|
||||
/* Define if you have the <thread_db.h> header file. */
|
||||
/* #undef HAVE_THREAD_DB_H */
|
||||
|
||||
/* Define if you have the <time.h> header file. */
|
||||
#define HAVE_TIME_H 1
|
||||
|
||||
/* Define if you have the <unistd.h> header file. */
|
||||
#define HAVE_UNISTD_H 1
|
||||
|
||||
/* Define if you have the <values.h> header file. */
|
||||
/* #undef HAVE_VALUES_H */
|
||||
|
||||
/* Define if you have the <wait.h> header file. */
|
||||
/* #undef HAVE_WAIT_H */
|
||||
|
||||
/* Define if you have the dl library (-ldl). */
|
||||
/* #undef HAVE_LIBDL */
|
||||
|
||||
/* Define if you have the m library (-lm). */
|
||||
#define HAVE_LIBM 1
|
||||
|
||||
/* Define if you have the w library (-lw). */
|
||||
/* #undef HAVE_LIBW */
|
||||
|
||||
/* Define if you have the stpcpy function */
|
||||
#define HAVE_STPCPY 1
|
||||
|
||||
/* Define if your locale.h file contains LC_MESSAGES. */
|
||||
#define HAVE_LC_MESSAGES 1
|
||||
|
||||
/* Define to 1 if NLS is requested */
|
||||
/* #undef ENABLE_NLS */
|
||||
|
||||
/* Define as 1 if you have gettext and don't want to use GNU gettext. */
|
||||
/* #undef HAVE_GETTEXT */
|
||||
|
||||
/* Name of this package. */
|
||||
#define PACKAGE "gdb"
|
||||
|
||||
/* Define to BFD's default architecture. */
|
||||
#define DEFAULT_BFD_ARCH bfd_ia64_arch
|
||||
|
||||
/* Define to BFD's default target vector. */
|
||||
#define DEFAULT_BFD_VEC bfd_elf64_ia64_little_vec
|
||||
|
||||
/* Define to 1 if your system has the _etext variable. */
|
||||
#define HAVE__ETEXT 1
|
||||
|
||||
/* Define to 1 to avoid a clash between <widec.h> and <wchar.h> on
|
||||
Solaris 2.[78] when using GCC. */
|
||||
/* #undef _MSE_INT_H */
|
||||
|
||||
/* Define to 1 if we found this declaration otherwise define to 0. */
|
||||
#define HAVE_DECL_GETOPT 0
|
||||
|
||||
/* Define if sigsetjmp is available. */
|
||||
#define HAVE_SIGSETJMP 1
|
||||
|
||||
/* Define to 1 if the regex included in libiberty should be used. */
|
||||
#define USE_INCLUDED_REGEX 1
|
||||
|
||||
/* Define to 1 if your system has struct reg in <machine/reg.h>. */
|
||||
#define HAVE_STRUCT_REG 1
|
||||
|
||||
/* Define if <stdint.h> provides the uintptr_t type. */
|
||||
#define HAVE_UINTPTR_T 1
|
||||
|
||||
/* Define if malloc is not declared in system header files. */
|
||||
/* #undef NEED_DECLARATION_MALLOC */
|
||||
|
||||
/* Define if realloc is not declared in system header files. */
|
||||
/* #undef NEED_DECLARATION_REALLOC */
|
||||
|
||||
/* Define if free is not declared in system header files. */
|
||||
/* #undef NEED_DECLARATION_FREE */
|
||||
|
||||
/* Define if strerror is not declared in system header files. */
|
||||
/* #undef NEED_DECLARATION_STRERROR */
|
||||
|
||||
/* Define if strdup is not declared in system header files. */
|
||||
/* #undef NEED_DECLARATION_STRDUP */
|
||||
|
||||
/* Define if strstr is not declared in system header files. */
|
||||
/* #undef NEED_DECLARATION_STRSTR */
|
||||
|
||||
/* Define if canonicalize_file_name is not declared in system header files. */
|
||||
#define NEED_DECLARATION_CANONICALIZE_FILE_NAME 1
|
||||
|
||||
/* Define if <sys/procfs.h> has pstatus_t. */
|
||||
/* #undef HAVE_PSTATUS_T */
|
||||
|
||||
/* Define if <sys/procfs.h> has prrun_t. */
|
||||
/* #undef HAVE_PRRUN_T */
|
||||
|
||||
/* Define if <sys/procfs.h> has gregset_t. */
|
||||
#define HAVE_GREGSET_T 1
|
||||
|
||||
/* Define if <sys/procfs.h> has fpregset_t. */
|
||||
#define HAVE_FPREGSET_T 1
|
||||
|
||||
/* Define if <sys/procfs.h> has prgregset_t. */
|
||||
#define HAVE_PRGREGSET_T 1
|
||||
|
||||
/* Define if <sys/procfs.h> has prfpregset_t. */
|
||||
#define HAVE_PRFPREGSET_T 1
|
||||
|
||||
/* Define if <sys/procfs.h> has prgregset32_t. */
|
||||
/* #undef HAVE_PRGREGSET32_T */
|
||||
|
||||
/* Define if <sys/procfs.h> has prfpregset32_t. */
|
||||
/* #undef HAVE_PRFPREGSET32_T */
|
||||
|
||||
/* Define if <sys/procfs.h> has lwpid_t. */
|
||||
#define HAVE_LWPID_T 1
|
||||
|
||||
/* Define if <sys/procfs.h> has psaddr_t. */
|
||||
#define HAVE_PSADDR_T 1
|
||||
|
||||
/* Define if <sys/procfs.h> has prsysent_t. */
|
||||
/* #undef HAVE_PRSYSENT_T */
|
||||
|
||||
/* Define if <sys/procfs.h> has pr_sigset_t. */
|
||||
/* #undef HAVE_PR_SIGSET_T */
|
||||
|
||||
/* Define if <sys/procfs.h> has pr_sigaction64_t. */
|
||||
/* #undef HAVE_PR_SIGACTION64_T */
|
||||
|
||||
/* Define if <sys/procfs.h> has pr_siginfo64_t. */
|
||||
/* #undef HAVE_PR_SIGINFO64_T */
|
||||
|
||||
/* Define if <thread_db.h> has the TD_NOTALLOC error code. */
|
||||
/* #undef THREAD_DB_HAS_TD_NOTALLOC */
|
||||
|
||||
/* Define if we can use the tkill syscall. */
|
||||
/* #undef HAVE_TKILL_SYSCALL */
|
||||
|
||||
/* Define to the default OS ABI for this configuration. */
|
||||
/* #undef GDB_OSABI_DEFAULT */
|
||||
|
||||
/* Define to be a string naming the default host character set. */
|
||||
#define GDB_DEFAULT_HOST_CHARSET "ISO-8859-1"
|
||||
|
||||
/* Define if you have the iconv() function. */
|
||||
/* #undef HAVE_ICONV */
|
||||
|
||||
/* Define as const if the declaration of iconv() needs const. */
|
||||
/* #undef ICONV_CONST */
|
||||
|
@ -1,230 +0,0 @@
|
||||
/* $FreeBSD$ */
|
||||
|
||||
/* Do not modify this file. */
|
||||
/* It is created automatically by the Makefile. */
|
||||
#include "defs.h" /* For initialize_file_ftype. */
|
||||
#include "call-cmds.h" /* For initialize_all_files. */
|
||||
extern initialize_file_ftype _initialize_gdbtypes;
|
||||
extern initialize_file_ftype _initialize_corelow;
|
||||
extern initialize_file_ftype _initialize_ia64_fbsd_tdep;
|
||||
extern initialize_file_ftype _initialize_ia64_tdep;
|
||||
extern initialize_file_ftype _initialize_solib;
|
||||
extern initialize_file_ftype _initialize_svr4_solib;
|
||||
extern initialize_file_ftype _initialize_ser_hardwire;
|
||||
extern initialize_file_ftype _initialize_ser_pipe;
|
||||
extern initialize_file_ftype _initialize_ser_tcp;
|
||||
extern initialize_file_ftype _initialize_fbsd_proc;
|
||||
extern initialize_file_ftype _initialize_gcore;
|
||||
extern initialize_file_ftype _initialize_thread_db;
|
||||
extern initialize_file_ftype _initialize_ia64_fbsd_nat;
|
||||
extern initialize_file_ftype _initialize_kernel_u_addr;
|
||||
extern initialize_file_ftype _initialize_infptrace;
|
||||
extern initialize_file_ftype _initialize_inftarg;
|
||||
extern initialize_file_ftype _initialize_remote;
|
||||
extern initialize_file_ftype _initialize_dcache;
|
||||
extern initialize_file_ftype _initialize_sr_support;
|
||||
extern initialize_file_ftype _initialize_tracepoint;
|
||||
extern initialize_file_ftype _initialize_ax_gdb;
|
||||
extern initialize_file_ftype _initialize_annotate;
|
||||
extern initialize_file_ftype _initialize_auxv;
|
||||
extern initialize_file_ftype _initialize_breakpoint;
|
||||
extern initialize_file_ftype _initialize_regcache;
|
||||
extern initialize_file_ftype _initialize_charset;
|
||||
extern initialize_file_ftype _initialize_dummy_frame;
|
||||
extern initialize_file_ftype _initialize_source;
|
||||
extern initialize_file_ftype _initialize_values;
|
||||
extern initialize_file_ftype _initialize_valops;
|
||||
extern initialize_file_ftype _initialize_valarith;
|
||||
extern initialize_file_ftype _initialize_valprint;
|
||||
extern initialize_file_ftype _initialize_printcmd;
|
||||
extern initialize_file_ftype _initialize_symtab;
|
||||
extern initialize_file_ftype _initialize_symfile;
|
||||
extern initialize_file_ftype _initialize_symmisc;
|
||||
extern initialize_file_ftype _initialize_infcall;
|
||||
extern initialize_file_ftype _initialize_infcmd;
|
||||
extern initialize_file_ftype _initialize_infrun;
|
||||
extern initialize_file_ftype _initialize_stack;
|
||||
extern initialize_file_ftype _initialize_thread;
|
||||
extern initialize_file_ftype _initialize_interpreter;
|
||||
extern initialize_file_ftype _initialize_macrocmd;
|
||||
extern initialize_file_ftype _initialize_gdbarch;
|
||||
extern initialize_file_ftype _initialize_gdbarch_utils;
|
||||
extern initialize_file_ftype _initialize_gdb_osabi;
|
||||
extern initialize_file_ftype _initialize_copying;
|
||||
extern initialize_file_ftype _initialize_mem;
|
||||
extern initialize_file_ftype _initialize_parse;
|
||||
extern initialize_file_ftype _initialize_language;
|
||||
extern initialize_file_ftype _initialize_frame_reg;
|
||||
extern initialize_file_ftype _initialize_signals;
|
||||
extern initialize_file_ftype _initialize_kod;
|
||||
extern initialize_file_ftype _initialize_gdb_events;
|
||||
extern initialize_file_ftype _initialize_exec;
|
||||
extern initialize_file_ftype _initialize_maint_cmds;
|
||||
extern initialize_file_ftype _initialize_demangler;
|
||||
extern initialize_file_ftype _initialize_dbxread;
|
||||
extern initialize_file_ftype _initialize_coffread;
|
||||
extern initialize_file_ftype _initialize_elfread;
|
||||
extern initialize_file_ftype _initialize_mipsread;
|
||||
extern initialize_file_ftype _initialize_stabsread;
|
||||
extern initialize_file_ftype _initialize_core;
|
||||
extern initialize_file_ftype _initialize_dwarf2_frame;
|
||||
extern initialize_file_ftype _initialize_c_language;
|
||||
extern initialize_file_ftype _initialize_f_language;
|
||||
extern initialize_file_ftype _initialize_objc_language;
|
||||
extern initialize_file_ftype _initialize_ui_out;
|
||||
extern initialize_file_ftype _initialize_cli_out;
|
||||
extern initialize_file_ftype _initialize_varobj;
|
||||
extern initialize_file_ftype _initialize_java_language;
|
||||
extern initialize_file_ftype _initialize_m2_language;
|
||||
extern initialize_file_ftype _initialize_pascal_language;
|
||||
extern initialize_file_ftype _initialize_pascal_valprint;
|
||||
extern initialize_file_ftype _initialize_scheme_language;
|
||||
extern initialize_file_ftype _initialize_complaints;
|
||||
extern initialize_file_ftype _initialize_typeprint;
|
||||
extern initialize_file_ftype _initialize_cp_valprint;
|
||||
extern initialize_file_ftype _initialize_f_valprint;
|
||||
extern initialize_file_ftype _initialize_nlmread;
|
||||
extern initialize_file_ftype _initialize_serial;
|
||||
extern initialize_file_ftype _initialize_mdebugread;
|
||||
extern initialize_file_ftype _initialize_user_regs;
|
||||
extern initialize_file_ftype _initialize_frame;
|
||||
extern initialize_file_ftype _initialize_frame_unwind;
|
||||
extern initialize_file_ftype _initialize_frame_base;
|
||||
extern initialize_file_ftype _initialize_gnu_v2_abi;
|
||||
extern initialize_file_ftype _initialize_gnu_v3_abi;
|
||||
extern initialize_file_ftype _initialize_hpacc_abi;
|
||||
extern initialize_file_ftype _initialize_cp_abi;
|
||||
extern initialize_file_ftype _initialize_cp_support;
|
||||
extern initialize_file_ftype _initialize_cp_namespace;
|
||||
extern initialize_file_ftype _initialize_reggroup;
|
||||
extern initialize_file_ftype _initialize_inflow;
|
||||
extern initialize_file_ftype _initialize_cli_dump;
|
||||
extern initialize_file_ftype _initialize_cli_logging;
|
||||
extern initialize_file_ftype _initialize_cli_interp;
|
||||
extern initialize_file_ftype _initialize_mi_out;
|
||||
extern initialize_file_ftype _initialize_mi_cmds;
|
||||
extern initialize_file_ftype _initialize_mi_cmd_env;
|
||||
extern initialize_file_ftype _initialize_mi_interp;
|
||||
extern initialize_file_ftype _initialize_mi_main;
|
||||
extern initialize_file_ftype _initialize_tui_hooks;
|
||||
extern initialize_file_ftype _initialize_tui_interp;
|
||||
extern initialize_file_ftype _initialize_tui_layout;
|
||||
extern initialize_file_ftype _initialize_tui_out;
|
||||
extern initialize_file_ftype _initialize_tui_regs;
|
||||
extern initialize_file_ftype _initialize_tui_stack;
|
||||
extern initialize_file_ftype _initialize_tui_win;
|
||||
void
|
||||
initialize_all_files (void)
|
||||
{
|
||||
_initialize_gdbtypes ();
|
||||
_initialize_corelow ();
|
||||
_initialize_ia64_fbsd_tdep ();
|
||||
_initialize_ia64_tdep ();
|
||||
_initialize_solib ();
|
||||
_initialize_svr4_solib ();
|
||||
_initialize_ser_hardwire ();
|
||||
_initialize_ser_pipe ();
|
||||
_initialize_ser_tcp ();
|
||||
#ifndef CROSS_DEBUGGER
|
||||
_initialize_fbsd_proc ();
|
||||
_initialize_gcore ();
|
||||
_initialize_thread_db ();
|
||||
_initialize_ia64_fbsd_nat ();
|
||||
_initialize_kernel_u_addr ();
|
||||
_initialize_infptrace ();
|
||||
_initialize_inftarg ();
|
||||
#endif
|
||||
_initialize_remote ();
|
||||
_initialize_dcache ();
|
||||
_initialize_sr_support ();
|
||||
_initialize_tracepoint ();
|
||||
_initialize_ax_gdb ();
|
||||
_initialize_annotate ();
|
||||
_initialize_auxv ();
|
||||
_initialize_breakpoint ();
|
||||
_initialize_regcache ();
|
||||
_initialize_charset ();
|
||||
_initialize_dummy_frame ();
|
||||
_initialize_source ();
|
||||
_initialize_values ();
|
||||
_initialize_valops ();
|
||||
_initialize_valarith ();
|
||||
_initialize_valprint ();
|
||||
_initialize_printcmd ();
|
||||
_initialize_symtab ();
|
||||
_initialize_symfile ();
|
||||
_initialize_symmisc ();
|
||||
_initialize_infcall ();
|
||||
_initialize_infcmd ();
|
||||
_initialize_infrun ();
|
||||
_initialize_stack ();
|
||||
_initialize_thread ();
|
||||
_initialize_interpreter ();
|
||||
_initialize_macrocmd ();
|
||||
_initialize_gdbarch ();
|
||||
_initialize_gdbarch_utils ();
|
||||
_initialize_gdb_osabi ();
|
||||
_initialize_copying ();
|
||||
_initialize_mem ();
|
||||
_initialize_parse ();
|
||||
_initialize_language ();
|
||||
_initialize_frame_reg ();
|
||||
_initialize_signals ();
|
||||
_initialize_kod ();
|
||||
_initialize_gdb_events ();
|
||||
_initialize_exec ();
|
||||
_initialize_maint_cmds ();
|
||||
_initialize_demangler ();
|
||||
_initialize_dbxread ();
|
||||
_initialize_coffread ();
|
||||
_initialize_elfread ();
|
||||
_initialize_mipsread ();
|
||||
_initialize_stabsread ();
|
||||
_initialize_core ();
|
||||
_initialize_dwarf2_frame ();
|
||||
_initialize_c_language ();
|
||||
_initialize_f_language ();
|
||||
_initialize_objc_language ();
|
||||
_initialize_ui_out ();
|
||||
_initialize_cli_out ();
|
||||
_initialize_varobj ();
|
||||
_initialize_java_language ();
|
||||
_initialize_m2_language ();
|
||||
_initialize_pascal_language ();
|
||||
_initialize_pascal_valprint ();
|
||||
_initialize_scheme_language ();
|
||||
_initialize_complaints ();
|
||||
_initialize_typeprint ();
|
||||
_initialize_cp_valprint ();
|
||||
_initialize_f_valprint ();
|
||||
_initialize_nlmread ();
|
||||
_initialize_serial ();
|
||||
_initialize_mdebugread ();
|
||||
_initialize_user_regs ();
|
||||
_initialize_frame ();
|
||||
_initialize_frame_unwind ();
|
||||
_initialize_frame_base ();
|
||||
_initialize_gnu_v2_abi ();
|
||||
_initialize_gnu_v3_abi ();
|
||||
_initialize_hpacc_abi ();
|
||||
_initialize_cp_abi ();
|
||||
_initialize_cp_support ();
|
||||
_initialize_cp_namespace ();
|
||||
_initialize_reggroup ();
|
||||
_initialize_inflow ();
|
||||
_initialize_cli_dump ();
|
||||
_initialize_cli_logging ();
|
||||
_initialize_cli_interp ();
|
||||
_initialize_mi_out ();
|
||||
_initialize_mi_cmds ();
|
||||
_initialize_mi_cmd_env ();
|
||||
_initialize_mi_interp ();
|
||||
_initialize_mi_main ();
|
||||
_initialize_tui_hooks ();
|
||||
_initialize_tui_interp ();
|
||||
_initialize_tui_layout ();
|
||||
_initialize_tui_out ();
|
||||
_initialize_tui_regs ();
|
||||
_initialize_tui_stack ();
|
||||
_initialize_tui_win ();
|
||||
}
|
@ -1,338 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2004 Marcel Moolenaar
|
||||
* 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 AUTHORS ``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 AUTHORS 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 <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/types.h>
|
||||
#ifdef CROSS_DEBUGGER
|
||||
#include <sys/ia64/include/_regset.h>
|
||||
#include <sys/ia64/include/frame.h>
|
||||
#include <sys/ia64/include/md_var.h>
|
||||
#include <sys/ia64/include/pcb.h>
|
||||
#else
|
||||
#include <machine/frame.h>
|
||||
#include <machine/md_var.h>
|
||||
#include <machine/pcb.h>
|
||||
#endif
|
||||
#include <err.h>
|
||||
#include <kvm.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <defs.h>
|
||||
#include <target.h>
|
||||
#include <gdbthread.h>
|
||||
#include <inferior.h>
|
||||
#include <regcache.h>
|
||||
#include <frame-unwind.h>
|
||||
#include <ia64-tdep.h>
|
||||
|
||||
#include "kgdb.h"
|
||||
|
||||
CORE_ADDR
|
||||
kgdb_trgt_core_pcb(u_int cpuid)
|
||||
{
|
||||
CORE_ADDR addr;
|
||||
char *expr;
|
||||
|
||||
asprintf(&expr, "&cpuid_to_pcpu[%d]->pc_md.pcb", cpuid);
|
||||
addr = kgdb_parse(expr);
|
||||
free(expr);
|
||||
return (addr);
|
||||
}
|
||||
|
||||
void
|
||||
kgdb_trgt_fetch_registers(int regno __unused)
|
||||
{
|
||||
struct kthr *kt;
|
||||
struct pcb pcb;
|
||||
uint64_t r;
|
||||
|
||||
kt = kgdb_thr_lookup_tid(ptid_get_pid(inferior_ptid));
|
||||
if (kt == NULL)
|
||||
return;
|
||||
if (kvm_read(kvm, kt->pcb, &pcb, sizeof(pcb)) != sizeof(pcb)) {
|
||||
warnx("kvm_read: %s", kvm_geterr(kvm));
|
||||
memset(&pcb, 0, sizeof(pcb));
|
||||
}
|
||||
|
||||
/* Registers 0-127: general registers. */
|
||||
supply_register(IA64_GR1_REGNUM, (char *)&pcb.pcb_special.gp);
|
||||
supply_register(IA64_GR4_REGNUM, (char *)&pcb.pcb_preserved.gr4);
|
||||
supply_register(IA64_GR5_REGNUM, (char *)&pcb.pcb_preserved.gr5);
|
||||
supply_register(IA64_GR6_REGNUM, (char *)&pcb.pcb_preserved.gr6);
|
||||
supply_register(IA64_GR7_REGNUM, (char *)&pcb.pcb_preserved.gr7);
|
||||
supply_register(IA64_GR12_REGNUM, (char *)&pcb.pcb_special.sp);
|
||||
supply_register(IA64_GR12_REGNUM+1, (char *)&pcb.pcb_special.tp);
|
||||
|
||||
/* Registers 128-255: floating-point registers. */
|
||||
supply_register(IA64_FR2_REGNUM, (char *)&pcb.pcb_preserved_fp.fr2);
|
||||
supply_register(IA64_FR2_REGNUM+1, (char *)&pcb.pcb_preserved_fp.fr3);
|
||||
supply_register(IA64_FR2_REGNUM+2, (char *)&pcb.pcb_preserved_fp.fr4);
|
||||
supply_register(IA64_FR2_REGNUM+3, (char *)&pcb.pcb_preserved_fp.fr5);
|
||||
supply_register(IA64_FR16_REGNUM, (char *)&pcb.pcb_preserved_fp.fr16);
|
||||
supply_register(IA64_FR16_REGNUM+1, (char*)&pcb.pcb_preserved_fp.fr17);
|
||||
supply_register(IA64_FR16_REGNUM+2, (char*)&pcb.pcb_preserved_fp.fr18);
|
||||
supply_register(IA64_FR16_REGNUM+3, (char*)&pcb.pcb_preserved_fp.fr19);
|
||||
supply_register(IA64_FR16_REGNUM+4, (char*)&pcb.pcb_preserved_fp.fr20);
|
||||
supply_register(IA64_FR16_REGNUM+5, (char*)&pcb.pcb_preserved_fp.fr21);
|
||||
supply_register(IA64_FR16_REGNUM+6, (char*)&pcb.pcb_preserved_fp.fr22);
|
||||
supply_register(IA64_FR16_REGNUM+7, (char*)&pcb.pcb_preserved_fp.fr23);
|
||||
supply_register(IA64_FR16_REGNUM+8, (char*)&pcb.pcb_preserved_fp.fr24);
|
||||
supply_register(IA64_FR16_REGNUM+9, (char*)&pcb.pcb_preserved_fp.fr25);
|
||||
supply_register(IA64_FR16_REGNUM+10,(char*)&pcb.pcb_preserved_fp.fr26);
|
||||
supply_register(IA64_FR16_REGNUM+11,(char*)&pcb.pcb_preserved_fp.fr27);
|
||||
supply_register(IA64_FR16_REGNUM+12,(char*)&pcb.pcb_preserved_fp.fr28);
|
||||
supply_register(IA64_FR16_REGNUM+13,(char*)&pcb.pcb_preserved_fp.fr29);
|
||||
supply_register(IA64_FR16_REGNUM+14,(char*)&pcb.pcb_preserved_fp.fr30);
|
||||
supply_register(IA64_FR16_REGNUM+15,(char*)&pcb.pcb_preserved_fp.fr31);
|
||||
|
||||
/* Registers 320-327: branch registers. */
|
||||
if (pcb.pcb_special.__spare == ~0UL)
|
||||
supply_register(IA64_BR0_REGNUM, (char *)&pcb.pcb_special.rp);
|
||||
supply_register(IA64_BR1_REGNUM, (char *)&pcb.pcb_preserved.br1);
|
||||
supply_register(IA64_BR2_REGNUM, (char *)&pcb.pcb_preserved.br2);
|
||||
supply_register(IA64_BR3_REGNUM, (char *)&pcb.pcb_preserved.br3);
|
||||
supply_register(IA64_BR4_REGNUM, (char *)&pcb.pcb_preserved.br4);
|
||||
supply_register(IA64_BR5_REGNUM, (char *)&pcb.pcb_preserved.br5);
|
||||
|
||||
/* Registers 328-333: misc. other registers. */
|
||||
supply_register(IA64_PR_REGNUM, (char *)&pcb.pcb_special.pr);
|
||||
if (pcb.pcb_special.__spare == ~0UL) {
|
||||
r = pcb.pcb_special.iip + ((pcb.pcb_special.psr >> 41) & 3);
|
||||
supply_register(IA64_IP_REGNUM, (char *)&r);
|
||||
supply_register(IA64_CFM_REGNUM, (char *)&pcb.pcb_special.cfm);
|
||||
} else {
|
||||
supply_register(IA64_IP_REGNUM, (char *)&pcb.pcb_special.rp);
|
||||
supply_register(IA64_CFM_REGNUM, (char *)&pcb.pcb_special.pfs);
|
||||
}
|
||||
|
||||
/* Registers 334-461: application registers. */
|
||||
supply_register(IA64_RSC_REGNUM, (char *)&pcb.pcb_special.rsc);
|
||||
r = pcb.pcb_special.bspstore;
|
||||
if (pcb.pcb_special.__spare == ~0UL)
|
||||
r += pcb.pcb_special.ndirty;
|
||||
else
|
||||
r = ia64_bsp_adjust(r, IA64_CFM_SOF(pcb.pcb_special.pfs) -
|
||||
IA64_CFM_SOL(pcb.pcb_special.pfs));
|
||||
supply_register(IA64_BSP_REGNUM, (char *)&r);
|
||||
supply_register(IA64_BSPSTORE_REGNUM, (char *)&r);
|
||||
supply_register(IA64_RNAT_REGNUM, (char *)&pcb.pcb_special.rnat);
|
||||
supply_register(IA64_UNAT_REGNUM, (char *)&pcb.pcb_special.unat);
|
||||
supply_register(IA64_FPSR_REGNUM, (char *)&pcb.pcb_special.fpsr);
|
||||
if (pcb.pcb_special.__spare == ~0UL)
|
||||
supply_register(IA64_PFS_REGNUM, (char *)&pcb.pcb_special.pfs);
|
||||
supply_register(IA64_LC_REGNUM, (char *)&pcb.pcb_preserved.lc);
|
||||
}
|
||||
|
||||
void
|
||||
kgdb_trgt_store_registers(int regno __unused)
|
||||
{
|
||||
fprintf_unfiltered(gdb_stderr, "XXX: %s\n", __func__);
|
||||
}
|
||||
|
||||
void
|
||||
kgdb_trgt_new_objfile(struct objfile *objfile)
|
||||
{
|
||||
}
|
||||
|
||||
struct kgdb_frame_cache {
|
||||
CORE_ADDR bsp;
|
||||
CORE_ADDR ip;
|
||||
CORE_ADDR sp;
|
||||
CORE_ADDR saved_bsp;
|
||||
};
|
||||
|
||||
#define SPECIAL(x) offsetof(struct trapframe, tf_special) \
|
||||
+ offsetof(struct _special, x)
|
||||
#define SCRATCH(x) offsetof(struct trapframe, tf_scratch) \
|
||||
+ offsetof(struct _caller_saved, x)
|
||||
#define SCRATCH_FP(x) offsetof(struct trapframe, tf_scratch_fp) \
|
||||
+ offsetof(struct _caller_saved_fp, x)
|
||||
|
||||
static int kgdb_trgt_frame_ofs_gr[32] = {
|
||||
-1, /* gr0 */
|
||||
SPECIAL(gp),
|
||||
SCRATCH(gr2), SCRATCH(gr3),
|
||||
-1, -1, -1, -1, /* gr4-gr7 */
|
||||
SCRATCH(gr8), SCRATCH(gr9), SCRATCH(gr10), SCRATCH(gr11),
|
||||
SPECIAL(sp), SPECIAL(tp),
|
||||
SCRATCH(gr14), SCRATCH(gr15), SCRATCH(gr16), SCRATCH(gr17),
|
||||
SCRATCH(gr18), SCRATCH(gr19), SCRATCH(gr20), SCRATCH(gr21),
|
||||
SCRATCH(gr22), SCRATCH(gr23), SCRATCH(gr24), SCRATCH(gr25),
|
||||
SCRATCH(gr26), SCRATCH(gr27), SCRATCH(gr28), SCRATCH(gr29),
|
||||
SCRATCH(gr30), SCRATCH(gr31)
|
||||
};
|
||||
|
||||
static int kgdb_trgt_frame_ofs_fr[32] = {
|
||||
-1, /* fr0: constant 0.0 */
|
||||
-1, /* fr1: constant 1.0 */
|
||||
-1, -1, -1, -1, /* fr2-fr5 */
|
||||
SCRATCH_FP(fr6), SCRATCH_FP(fr7), SCRATCH_FP(fr8), SCRATCH_FP(fr9),
|
||||
SCRATCH_FP(fr10), SCRATCH_FP(fr11), SCRATCH_FP(fr12), SCRATCH_FP(fr13),
|
||||
SCRATCH_FP(fr14), SCRATCH_FP(fr15)
|
||||
};
|
||||
|
||||
static int kgdb_trgt_frame_ofs_br[8] = {
|
||||
SPECIAL(rp),
|
||||
-1, -1, -1, -1, -1, /* br1-br5 */
|
||||
SCRATCH(br6), SCRATCH(br7)
|
||||
};
|
||||
|
||||
static int kgdb_trgt_frame_ofs_ar[49] = {
|
||||
/* ar0-ar15 */
|
||||
SPECIAL(rsc),
|
||||
-1, /* ar.bsp */
|
||||
SPECIAL(bspstore), SPECIAL(rnat),
|
||||
-1, -1, -1, -1, -1, /* ar20-ar24 */
|
||||
SCRATCH(csd), SCRATCH(ssd),
|
||||
-1, -1, -1, -1, -1, /* ar27-ar31 */
|
||||
SCRATCH(ccv),
|
||||
-1, -1, -1, /* ar33-ar35 */
|
||||
SPECIAL(unat),
|
||||
-1, -1, -1, /* ar37-ar39 */
|
||||
SPECIAL(fpsr),
|
||||
-1, -1, -1, -1, -1, -1, -1, /* ar41-ar47 */
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, /* ar48-ar55 */
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, /* ar56-ar63 */
|
||||
SPECIAL(pfs)
|
||||
};
|
||||
|
||||
static struct kgdb_frame_cache *
|
||||
kgdb_trgt_frame_cache(struct frame_info *next_frame, void **this_cache)
|
||||
{
|
||||
char buf[MAX_REGISTER_SIZE];
|
||||
struct kgdb_frame_cache *cache;
|
||||
|
||||
cache = *this_cache;
|
||||
if (cache == NULL) {
|
||||
cache = FRAME_OBSTACK_ZALLOC(struct kgdb_frame_cache);
|
||||
*this_cache = cache;
|
||||
frame_unwind_register(next_frame, IA64_BSP_REGNUM, buf);
|
||||
cache->bsp = extract_unsigned_integer(buf,
|
||||
register_size(current_gdbarch, IA64_BSP_REGNUM));
|
||||
cache->ip = frame_func_unwind(next_frame);
|
||||
frame_unwind_register(next_frame, SP_REGNUM, buf);
|
||||
cache->sp = extract_unsigned_integer(buf,
|
||||
register_size(current_gdbarch, SP_REGNUM));
|
||||
}
|
||||
return (cache);
|
||||
}
|
||||
|
||||
static void
|
||||
kgdb_trgt_trapframe_this_id(struct frame_info *next_frame, void **this_cache,
|
||||
struct frame_id *this_id)
|
||||
{
|
||||
struct kgdb_frame_cache *cache;
|
||||
|
||||
cache = kgdb_trgt_frame_cache(next_frame, this_cache);
|
||||
*this_id = frame_id_build_special(cache->sp, cache->ip, cache->bsp);
|
||||
}
|
||||
|
||||
static void
|
||||
kgdb_trgt_trapframe_prev_register(struct frame_info *next_frame,
|
||||
void **this_cache, int regnum, int *optimizedp, enum lval_type *lvalp,
|
||||
CORE_ADDR *addrp, int *realnump, void *valuep)
|
||||
{
|
||||
char buf[MAX_REGISTER_SIZE];
|
||||
char dummy_valuep[MAX_REGISTER_SIZE];
|
||||
struct kgdb_frame_cache *cache;
|
||||
CORE_ADDR bsp;
|
||||
int ofs, regsz;
|
||||
|
||||
regsz = register_size(current_gdbarch, regnum);
|
||||
|
||||
if (valuep == NULL)
|
||||
valuep = dummy_valuep;
|
||||
memset(valuep, 0, regsz);
|
||||
*optimizedp = 0;
|
||||
*addrp = 0;
|
||||
*lvalp = not_lval;
|
||||
*realnump = -1;
|
||||
|
||||
cache = kgdb_trgt_frame_cache(next_frame, this_cache);
|
||||
|
||||
if (regnum == IA64_BSP_REGNUM) {
|
||||
if (cache->saved_bsp == 0) {
|
||||
target_read_memory(cache->sp + 16 + SPECIAL(bspstore),
|
||||
buf, regsz);
|
||||
bsp = extract_unsigned_integer(buf, regsz);
|
||||
target_read_memory(cache->sp + 16 + SPECIAL(ndirty),
|
||||
buf, regsz);
|
||||
bsp += extract_unsigned_integer(buf, regsz);
|
||||
cache->saved_bsp = bsp;
|
||||
}
|
||||
store_unsigned_integer(valuep, regsz, cache->saved_bsp);
|
||||
return;
|
||||
}
|
||||
if (regnum == IA64_PR_REGNUM)
|
||||
ofs = SPECIAL(pr);
|
||||
else if (regnum == IA64_IP_REGNUM)
|
||||
ofs = SPECIAL(iip);
|
||||
else if (regnum == IA64_PSR_REGNUM)
|
||||
ofs = SPECIAL(psr);
|
||||
else if (regnum == IA64_CFM_REGNUM)
|
||||
ofs = SPECIAL(cfm);
|
||||
else if (regnum >= IA64_GR0_REGNUM && regnum <= IA64_GR31_REGNUM)
|
||||
ofs = kgdb_trgt_frame_ofs_gr[regnum - IA64_GR0_REGNUM];
|
||||
else if (regnum >= IA64_FR0_REGNUM && regnum <= IA64_FR15_REGNUM)
|
||||
ofs = kgdb_trgt_frame_ofs_fr[regnum - IA64_FR0_REGNUM];
|
||||
else if (regnum >= IA64_BR0_REGNUM && regnum <= IA64_BR7_REGNUM)
|
||||
ofs = kgdb_trgt_frame_ofs_br[regnum - IA64_BR0_REGNUM];
|
||||
else if (regnum >= IA64_RSC_REGNUM && regnum <= IA64_PFS_REGNUM)
|
||||
ofs = kgdb_trgt_frame_ofs_ar[regnum - IA64_RSC_REGNUM];
|
||||
else
|
||||
ofs = -1;
|
||||
if (ofs == -1)
|
||||
return;
|
||||
|
||||
*addrp = cache->sp + 16 + ofs;
|
||||
*lvalp = lval_memory;
|
||||
target_read_memory(*addrp, valuep, regsz);
|
||||
}
|
||||
|
||||
static const struct frame_unwind kgdb_trgt_trapframe_unwind = {
|
||||
UNKNOWN_FRAME,
|
||||
&kgdb_trgt_trapframe_this_id,
|
||||
&kgdb_trgt_trapframe_prev_register
|
||||
};
|
||||
|
||||
const struct frame_unwind *
|
||||
kgdb_trgt_trapframe_sniffer(struct frame_info *next_frame)
|
||||
{
|
||||
char *pname;
|
||||
CORE_ADDR ip;
|
||||
|
||||
ip = frame_func_unwind(next_frame);
|
||||
pname = NULL;
|
||||
find_pc_partial_function(ip, &pname, NULL, NULL);
|
||||
if (pname == NULL)
|
||||
return (NULL);
|
||||
if (strncmp(pname, "ivt_", 4) == 0)
|
||||
return (&kgdb_trgt_trapframe_unwind);
|
||||
/* printf("%s: %lx =%s\n", __func__, ip, pname); */
|
||||
return (NULL);
|
||||
}
|
@ -44,7 +44,6 @@ SUBDIR= ${SUBDIR_ORDERED} \
|
||||
libdevstat \
|
||||
libdwarf \
|
||||
libedit \
|
||||
${_libefi} \
|
||||
libexecinfo \
|
||||
libexpat \
|
||||
libfetch \
|
||||
@ -237,11 +236,6 @@ _librtld_db= librtld_db
|
||||
_libvmmapi= libvmmapi
|
||||
.endif
|
||||
|
||||
.if ${MACHINE_CPUARCH} == "ia64"
|
||||
_libefi= libefi
|
||||
_libsmb= libsmb
|
||||
.endif
|
||||
|
||||
.if ${MACHINE_CPUARCH} == "mips"
|
||||
_libproc= libproc
|
||||
_librtld_db= librtld_db
|
||||
|
@ -1,2 +0,0 @@
|
||||
/* $FreeBSD$ */
|
||||
#include "IA64GenAsmWriter.inc.h"
|
@ -1,2 +0,0 @@
|
||||
/* $FreeBSD$ */
|
||||
#include "IA64GenDAGISel.inc.h"
|
@ -1,2 +0,0 @@
|
||||
/* $FreeBSD$ */
|
||||
#include "IA64GenInstrInfo.inc.h"
|
@ -1,2 +0,0 @@
|
||||
/* $FreeBSD$ */
|
||||
#include "IA64GenRegisterInfo.inc.h"
|
@ -1,62 +0,0 @@
|
||||
# $FreeBSD$
|
||||
|
||||
.PATH: ${.CURDIR}/../common
|
||||
|
||||
SRCS= crti.S crtn.S
|
||||
OBJS= ${SRCS:N*.h:R:S/$/.o/g}
|
||||
OBJS+= crt1.o gcrt1.o Scrt1.o
|
||||
|
||||
all: ${OBJS}
|
||||
|
||||
CLEANFILES= ${OBJS}
|
||||
CLEANFILES+= crt1_.o gcrt1_.o Scrt1_.o
|
||||
CLEANFILES+= crtbrand.o gcrtbrand.o Scrtbrand.o
|
||||
CLEANFILES+= crtbrand.s gcrtbrand.s Scrtbrand.s
|
||||
|
||||
crt1_.o: crt1.S
|
||||
${CC} ${CFLAGS} -c -o ${.TARGET} ${.ALLSRC}
|
||||
|
||||
# See the comment in lib/csu/common/crtbrand.c for the reason crtbrand.c is not
|
||||
# directly compiled to .o files.
|
||||
|
||||
crtbrand.s: crtbrand.c
|
||||
${CC} ${CFLAGS} -S -o ${.TARGET} ${.ALLSRC}
|
||||
sed -i "" -e '/\.note\.ABI-tag/s/progbits/note/' ${.TARGET}
|
||||
|
||||
crtbrand.o: crtbrand.s
|
||||
${CC} ${ACFLAGS} -c -o ${.TARGET} crtbrand.s
|
||||
|
||||
crt1.o: crt1_.o crtbrand.o
|
||||
${LD} ${LDFLAGS} -r -o ${.TARGET} crt1_.o crtbrand.o
|
||||
|
||||
gcrt1_.o: crt1.S
|
||||
${CC} ${CFLAGS} -DGCRT -c -o ${.TARGET} ${.ALLSRC}
|
||||
|
||||
gcrtbrand.s: crtbrand.c
|
||||
${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${.ALLSRC}
|
||||
sed -i "" -e '/\.note\.ABI-tag/s/progbits/note/' ${.TARGET}
|
||||
|
||||
gcrtbrand.o: gcrtbrand.s
|
||||
${CC} ${ACFLAGS} -c -o ${.TARGET} gcrtbrand.s
|
||||
|
||||
gcrt1.o: gcrt1_.o gcrtbrand.o
|
||||
${LD} ${LDFLAGS} -r -o ${.TARGET} ${.ALLSRC}
|
||||
|
||||
Scrt1_.o: crt1.S
|
||||
${CC} ${CFLAGS} -fPIC -DPIC -c -o ${.TARGET} ${.ALLSRC}
|
||||
|
||||
Scrtbrand.s: crtbrand.c
|
||||
${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.ALLSRC}
|
||||
sed -i "" -e '/\.note\.ABI-tag/s/progbits/note/' ${.TARGET}
|
||||
|
||||
Scrtbrand.o: Scrtbrand.s
|
||||
${CC} ${ACFLAGS} -c -o ${.TARGET} Scrtbrand.s
|
||||
|
||||
Scrt1.o: Scrt1_.o Scrtbrand.o
|
||||
${LD} ${LDFLAGS} -r -o ${.TARGET} ${.ALLSRC}
|
||||
|
||||
realinstall:
|
||||
${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
|
||||
${OBJS} ${DESTDIR}${LIBDIR}
|
||||
|
||||
.include <bsd.lib.mk>
|
@ -1,197 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Marcel Moolenaar
|
||||
* 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 ``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 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$");
|
||||
|
||||
.text
|
||||
|
||||
/*
|
||||
* void _start(char **ap, struct ps_strings *, void (*cleanup)(void));
|
||||
*/
|
||||
#define AP in0
|
||||
#define CLEANUP in2
|
||||
|
||||
#define GP loc0
|
||||
#define ARGC loc1
|
||||
#define ARGV loc2
|
||||
#define ENVP loc3
|
||||
|
||||
.global _start
|
||||
.type _start, @function
|
||||
.proc _start
|
||||
_start:
|
||||
.prologue
|
||||
.save rp, r0
|
||||
.body
|
||||
{ .mlx
|
||||
alloc r14=ar.pfs,3,4,3,0
|
||||
movl r15=@gprel(1f)
|
||||
}
|
||||
1:
|
||||
{ .mmi
|
||||
ld4 ARGC=[AP]
|
||||
adds ARGV=8,AP
|
||||
mov r16=ip
|
||||
;;
|
||||
}
|
||||
{ .mmi
|
||||
sub gp=r16,r15
|
||||
sub GP=r16,r15
|
||||
shladd r14=ARGC,3,AP
|
||||
;;
|
||||
}
|
||||
{ .mii
|
||||
addl r15=@ltoff(environ),gp
|
||||
cmp4.ge p6,p7=0,ARGC
|
||||
adds ENVP=16,r14
|
||||
;;
|
||||
}
|
||||
{ .mmi
|
||||
ld8 r14=[r15]
|
||||
(p7) ld8 r15=[ARGV]
|
||||
addl r16=@gprel(__progname),gp
|
||||
;;
|
||||
}
|
||||
{ .mib
|
||||
st8 [r14]=ENVP
|
||||
(p7) cmp.eq p6,p0=0,r15
|
||||
(p6) br.dpnt .L1
|
||||
;;
|
||||
}
|
||||
/* Normalize __progname. */
|
||||
{ .mmi
|
||||
st8 [r16]=r15
|
||||
ld1 r14=[r15],1
|
||||
nop 0
|
||||
;;
|
||||
}
|
||||
.L0:
|
||||
{ .mib
|
||||
cmp4.eq p7,p0=0,r14
|
||||
cmp4.eq p6,p0=0x2f,r14
|
||||
(p7) br.dptk .L1
|
||||
;;
|
||||
}
|
||||
{ .mmb
|
||||
(p6) st8 [r16]=r15
|
||||
ld1 r14=[r15],1
|
||||
br.dptk.many .L0
|
||||
}
|
||||
.L1:
|
||||
{ .mib
|
||||
cmp.ne p7,p0=0,CLEANUP
|
||||
mov out0=CLEANUP
|
||||
(p7) br.call.sptk b0=atexit
|
||||
;;
|
||||
}
|
||||
{ .mfb
|
||||
mov gp=GP
|
||||
nop 0
|
||||
br.call.sptk b0=_init_tls
|
||||
}
|
||||
#ifdef GCRT
|
||||
{ .mmi
|
||||
mov gp=GP
|
||||
;;
|
||||
addl r14=@ltoff(@fptr(_mcleanup)),gp
|
||||
nop 0
|
||||
;;
|
||||
}
|
||||
{ .mfb
|
||||
ld8 out0=[r14]
|
||||
nop 0
|
||||
br.call.sptk b0=atexit
|
||||
;;
|
||||
}
|
||||
#endif
|
||||
{ .mmi
|
||||
mov gp=GP
|
||||
;;
|
||||
addl r14=@ltoff(@fptr(_fini)),gp
|
||||
nop 0
|
||||
;;
|
||||
}
|
||||
{ .mfb
|
||||
ld8 out0=[r14]
|
||||
nop 0
|
||||
br.call.sptk b0=atexit
|
||||
;;
|
||||
}
|
||||
#ifdef GCRT
|
||||
{ .mmi
|
||||
mov gp=GP
|
||||
;;
|
||||
addl r14=@ltoff(eprol),gp
|
||||
addl r15=@ltoff(etext),gp
|
||||
;;
|
||||
}
|
||||
{ .mmb
|
||||
ld8 out0=[r14]
|
||||
ld8 out1=[r15]
|
||||
br.call.sptk b0=monstartup
|
||||
;;
|
||||
}
|
||||
#endif
|
||||
{ .mfb
|
||||
mov gp=GP
|
||||
nop 0
|
||||
br.call.sptk b0=_init
|
||||
;;
|
||||
}
|
||||
{ .mmi
|
||||
mov gp=GP
|
||||
mov out0=ARGC
|
||||
mov out1=ARGV
|
||||
}
|
||||
{ .mfb
|
||||
mov out2=ENVP
|
||||
nop 0
|
||||
br.call.sptk b0=main
|
||||
;;
|
||||
}
|
||||
{ .mib
|
||||
mov gp=GP
|
||||
mov out0=r8
|
||||
br.call.sptk b0=exit
|
||||
;;
|
||||
}
|
||||
.endp _start
|
||||
|
||||
#ifdef GCRT
|
||||
eprol:
|
||||
#endif
|
||||
|
||||
.rodata
|
||||
.empty: stringz ""
|
||||
|
||||
.sdata
|
||||
.global __progname
|
||||
.size __progname,8
|
||||
.type __progname,@object
|
||||
__progname: data8 .empty
|
||||
|
||||
.common environ,8,8
|
@ -1,60 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 2001 Peter Wemm <peter@FreeBSD.org>
|
||||
* 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.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#include <machine/asm.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
/*
|
||||
* This file (and its companion crtn.S) form the terminators of the
|
||||
* .init and .fini sections.
|
||||
*/
|
||||
.file "crti.S"
|
||||
|
||||
.section .init,"ax",@progbits
|
||||
.global _init#
|
||||
.proc _init#
|
||||
_init:
|
||||
.regstk 0,2,0,0
|
||||
.prologue 12,loc0
|
||||
.save ar.pfs,loc1
|
||||
alloc loc1=ar.pfs,0,2,0,0
|
||||
mov loc0=b0 /* Save return addr */
|
||||
.body
|
||||
.endp _init#
|
||||
|
||||
.section .fini,"ax",@progbits
|
||||
.global _fini#
|
||||
.proc _fini#
|
||||
_fini:
|
||||
.regstk 0,2,0,0
|
||||
.prologue 12,loc0
|
||||
.save ar.pfs,loc1
|
||||
alloc loc1=ar.pfs,0,2,0,0
|
||||
mov loc0=b0 /* Save return addr */
|
||||
.body
|
||||
.endp _fini#
|
@ -1,44 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 2001 Peter Wemm <peter@FreeBSD.org>
|
||||
* 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.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#include <machine/asm.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
.file "crtn.S"
|
||||
|
||||
.section .init,"ax",@progbits
|
||||
.regstk 0,2,0,0
|
||||
mov b0=loc0 /* Recover return addr */
|
||||
mov ar.pfs=loc1
|
||||
br.ret.sptk.many b0
|
||||
|
||||
.section .fini,"ax",@progbits
|
||||
.regstk 0,2,0,0
|
||||
mov b0=loc0 /* Recover return addr */
|
||||
mov ar.pfs=loc1
|
||||
br.ret.sptk.many b0
|
@ -41,7 +41,7 @@ SHARED_CFLAGS+= -DHAVE_ICONV=1 -DHAVE_ICONV_H=1 -DICONV_CONST=const
|
||||
.endif
|
||||
|
||||
.if ${MACHINE_ARCH:Marm*} != "" || ${MACHINE_ARCH:Mmips*} != "" || \
|
||||
${MACHINE_ARCH:Msparc64*} != "" || ${MACHINE_ARCH:Mia64*} != ""
|
||||
${MACHINE_ARCH:Msparc64*} != ""
|
||||
NO_WCAST_ALIGN= yes
|
||||
.if ${MACHINE_ARCH:M*64*} == ""
|
||||
CFLAGS+= -DPPMD_32BIT
|
||||
|
@ -80,7 +80,6 @@ NOASM=
|
||||
.include "${LIBC_SRCTOP}/nls/Makefile.inc"
|
||||
.include "${LIBC_SRCTOP}/posix1e/Makefile.inc"
|
||||
.if ${LIBC_ARCH} != "amd64" && \
|
||||
${LIBC_ARCH} != "ia64" && \
|
||||
${LIBC_ARCH} != "powerpc64" && \
|
||||
${LIBC_ARCH} != "sparc64" && \
|
||||
${MACHINE_ARCH:Mmipsn32*} == "" && \
|
||||
|
@ -62,7 +62,7 @@ void _rtld_free_tls(void *tls, size_t tcbsize, size_t tcbalign);
|
||||
void *__libc_allocate_tls(void *oldtls, size_t tcbsize, size_t tcbalign);
|
||||
void __libc_free_tls(void *tls, size_t tcbsize, size_t tcbalign);
|
||||
|
||||
#if defined(__ia64__) || defined(__amd64__)
|
||||
#if defined(__amd64__)
|
||||
#define TLS_TCB_ALIGN 16
|
||||
#elif defined(__powerpc__) || defined(__i386__) || defined(__arm__) || \
|
||||
defined(__sparc64__) || defined(__mips__)
|
||||
@ -71,8 +71,7 @@ void __libc_free_tls(void *tls, size_t tcbsize, size_t tcbalign);
|
||||
#error TLS_TCB_ALIGN undefined for target architecture
|
||||
#endif
|
||||
|
||||
#if defined(__arm__) || defined(__ia64__) || defined(__mips__) || \
|
||||
defined(__powerpc__)
|
||||
#if defined(__arm__) || defined(__mips__) || defined(__powerpc__)
|
||||
#define TLS_VARIANT_I
|
||||
#endif
|
||||
#if defined(__i386__) || defined(__amd64__) || defined(__sparc64__)
|
||||
|
@ -1,9 +0,0 @@
|
||||
# $FreeBSD$
|
||||
#
|
||||
# Machine dependent definitions for the ia64 architecture.
|
||||
#
|
||||
|
||||
# Long double is 80 bits
|
||||
GDTOASRCS+=strtorx.c
|
||||
MDSRCS+=machdep_ldisx.c
|
||||
SYM_MAPS+=${LIBC_SRCTOP}/ia64/Symbol.map
|
@ -1,63 +0,0 @@
|
||||
/* $NetBSD: SYS.h,v 1.5 1997/05/02 18:15:15 kleink Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Author: Chris G. Demetriou
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and
|
||||
* its documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation.
|
||||
*
|
||||
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
|
||||
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
|
||||
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
|
||||
*
|
||||
* Carnegie Mellon requests users of this software to return to
|
||||
*
|
||||
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
|
||||
* School of Computer Science
|
||||
* Carnegie Mellon University
|
||||
* Pittsburgh PA 15213-3890
|
||||
*
|
||||
* any improvements or extensions that they make and grant Carnegie the
|
||||
* rights to redistribute these changes.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#include <machine/asm.h>
|
||||
#include <sys/syscall.h>
|
||||
|
||||
#define CALLSYS_ERROR(name) \
|
||||
CALLSYS_NOERROR(name); \
|
||||
cmp.ne p6,p0=r0,r10; \
|
||||
(p6) br.cond.sptk.few .cerror
|
||||
|
||||
|
||||
#define SYSCALL(name) \
|
||||
ENTRY(__sys_ ## name,0); /* XXX # of args? */ \
|
||||
WEAK_ALIAS(name, __sys_ ## name); \
|
||||
WEAK_ALIAS(_ ## name, __sys_ ## name); \
|
||||
CALLSYS_ERROR(name)
|
||||
|
||||
#define SYSCALL_NOERROR(name) \
|
||||
ENTRY(__sys_ ## name,0); /* XXX # of args? */ \
|
||||
WEAK_ALIAS(name, __sys_ ## name); \
|
||||
WEAK_ALIAS(_ ## name, __sys_ ## name); \
|
||||
CALLSYS_NOERROR(name)
|
||||
|
||||
#define RSYSCALL(name) \
|
||||
SYSCALL(name); \
|
||||
br.ret.sptk.few rp; \
|
||||
END(__sys_ ## name)
|
||||
|
||||
#define PSEUDO(name) \
|
||||
ENTRY(__sys_ ## name,0); /* XXX # of args? */ \
|
||||
WEAK_ALIAS(_ ## name, __sys_ ## name); \
|
||||
CALLSYS_ERROR(name); \
|
||||
br.ret.sptk.few rp; \
|
||||
END(__sys_ ## name);
|
@ -1,71 +0,0 @@
|
||||
/*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
/*
|
||||
* This only needs to contain symbols that are not listed in
|
||||
* symbol maps from other parts of libc (i.e., not found in
|
||||
* stdlib/Symbol.map, string/Symbol.map, sys/Symbol.map, ...).
|
||||
*/
|
||||
FBSD_1.0 {
|
||||
/* PSEUDO syscalls */
|
||||
_exit;
|
||||
|
||||
mcount;
|
||||
_setjmp;
|
||||
_longjmp;
|
||||
fabs;
|
||||
__flt_rounds;
|
||||
fpgetmask;
|
||||
fpgetround;
|
||||
fpsetmask;
|
||||
fpsetround;
|
||||
__infinity;
|
||||
__nan;
|
||||
makecontext;
|
||||
setjmp;
|
||||
longjmp;
|
||||
sigsetjmp;
|
||||
siglongjmp;
|
||||
htonl;
|
||||
htons;
|
||||
ntohl;
|
||||
ntohs;
|
||||
vfork;
|
||||
brk;
|
||||
exect;
|
||||
sbrk;
|
||||
};
|
||||
|
||||
FBSDprivate_1.0 {
|
||||
/* PSEUDO syscalls */
|
||||
__sys_getlogin;
|
||||
_getlogin;
|
||||
__sys_exit;
|
||||
|
||||
_set_tp;
|
||||
__divdf3;
|
||||
__divdi3;
|
||||
__divsf3;
|
||||
__divsi3;
|
||||
__moddi3;
|
||||
__modsi3;
|
||||
__udivdi3;
|
||||
__udivsi3;
|
||||
__umoddi3;
|
||||
__umodsi3;
|
||||
_mcount;
|
||||
___longjmp;
|
||||
__makecontext;
|
||||
__longjmp;
|
||||
signalcontext;
|
||||
__signalcontext;
|
||||
__siglongjmp;
|
||||
_Unwind_FindTableEntry;
|
||||
__sys_vfork;
|
||||
_vfork;
|
||||
_end;
|
||||
minbrk;
|
||||
.cerror;
|
||||
curbrk;
|
||||
};
|
@ -1,82 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 2003 Mike Barcroft <mike@FreeBSD.org>
|
||||
* Copyright (c) 2002, 2003 David Schultz <das@FreeBSD.ORG>
|
||||
* 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.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#include <sys/endian.h>
|
||||
|
||||
union IEEEl2bits {
|
||||
long double e;
|
||||
struct {
|
||||
#if _BYTE_ORDER == _LITTLE_ENDIAN
|
||||
unsigned int manl :32;
|
||||
unsigned int manh :32;
|
||||
unsigned int exp :15;
|
||||
unsigned int sign :1;
|
||||
unsigned long junk :48;
|
||||
#else /* _BIG_ENDIAN */
|
||||
unsigned long junk :48;
|
||||
unsigned int sign :1;
|
||||
unsigned int exp :15;
|
||||
unsigned int manh :32;
|
||||
unsigned int manl :32;
|
||||
#endif
|
||||
} bits;
|
||||
struct {
|
||||
#if _BYTE_ORDER == _LITTLE_ENDIAN
|
||||
unsigned long man :64;
|
||||
unsigned int expsign :16;
|
||||
unsigned long junk :48;
|
||||
#else /* _BIG_ENDIAN */
|
||||
unsigned long junk :48;
|
||||
unsigned int expsign :16;
|
||||
unsigned long man :64;
|
||||
#endif
|
||||
} xbits;
|
||||
};
|
||||
|
||||
#if _BYTE_ORDER == _LITTLE_ENDIAN
|
||||
#define LDBL_NBIT 0x80000000
|
||||
#define mask_nbit_l(u) ((u).bits.manh &= ~LDBL_NBIT)
|
||||
#else /* _BIG_ENDIAN */
|
||||
/*
|
||||
* XXX This doesn't look right. Very few machines have a different
|
||||
* endianness for integers and floating-point, and in nextafterl()
|
||||
* we assume that none do. If you have an environment for testing
|
||||
* this, please let me know. --das
|
||||
*/
|
||||
#define LDBL_NBIT 0x80
|
||||
#define mask_nbit_l(u) ((u).bits.manh &= ~LDBL_NBIT)
|
||||
#endif
|
||||
|
||||
#define LDBL_MANH_SIZE 32
|
||||
#define LDBL_MANL_SIZE 32
|
||||
|
||||
#define LDBL_TO_ARRAY32(u, a) do { \
|
||||
(a)[0] = (uint32_t)(u).bits.manl; \
|
||||
(a)[1] = (uint32_t)(u).bits.manh; \
|
||||
} while (0)
|
@ -1,37 +0,0 @@
|
||||
/*
|
||||
* MD header for contrib/gdtoa
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
/*
|
||||
* NOTE: The definitions in this file must be correct or strtod(3) and
|
||||
* floating point formats in printf(3) will break! The file can be
|
||||
* generated by running contrib/gdtoa/arithchk.c on the target
|
||||
* architecture. See contrib/gdtoa/gdtoaimp.h for details.
|
||||
*/
|
||||
|
||||
#include <machine/endian.h>
|
||||
|
||||
#if _BYTE_ORDER == _LITTLE_ENDIAN
|
||||
|
||||
#define IEEE_8087
|
||||
#define Arith_Kind_ASL 1
|
||||
#define Long int
|
||||
#define Intcast (int)(long)
|
||||
#define Double_Align
|
||||
#define X64_bit_pointers
|
||||
|
||||
#else /* _BYTE_ORDER == _LITTLE_ENDIAN */
|
||||
|
||||
#define IEEE_MC68k
|
||||
#define Arith_Kind_ASL 2
|
||||
#define Long int
|
||||
#define Intcast (int)(long)
|
||||
#define Double_Align
|
||||
#define X64_bit_pointers
|
||||
#ifdef gcc_bug /* XXX Why does arithchk report sudden underflow here? */
|
||||
#define Sudden_Underflow
|
||||
#endif
|
||||
|
||||
#endif
|
@ -1,21 +0,0 @@
|
||||
/*
|
||||
* MD header for contrib/gdtoa
|
||||
*
|
||||
* This file can be generated by compiling and running contrib/gdtoa/qnan.c
|
||||
* on the target architecture after arith.h has been generated.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#define f_QNAN 0x7fc00000
|
||||
#define d_QNAN0 0x0
|
||||
#define d_QNAN1 0x7ff80000
|
||||
#define ld_QNAN0 0x0
|
||||
#define ld_QNAN1 0xc0000000
|
||||
#define ld_QNAN2 0x7fff
|
||||
#define ld_QNAN3 0x0
|
||||
#define ldus_QNAN0 0x0
|
||||
#define ldus_QNAN1 0x0
|
||||
#define ldus_QNAN2 0x0
|
||||
#define ldus_QNAN3 0xc000
|
||||
#define ldus_QNAN4 0x7fff
|
@ -1,11 +0,0 @@
|
||||
# $FreeBSD$
|
||||
|
||||
SRCS+= __divdf3.S __divdi3.S __divsf3.S __divsi3.S __moddi3.S __modsi3.S \
|
||||
__udivdi3.S __udivsi3.S __umoddi3.S __umodsi3.S _mcount.S _set_tp.c \
|
||||
_setjmp.S fabs.S flt_rounds.c fpgetmask.c fpgetround.c fpsetmask.c \
|
||||
fpsetround.c getcontextx.c infinity.c ldexp.c makecontext.c setjmp.S \
|
||||
signalcontext.c sigsetjmp.S
|
||||
|
||||
# The following may go away if function _Unwind_FindTableEntry()
|
||||
# will be part of GCC.
|
||||
SRCS+= unwind.c
|
@ -1,142 +0,0 @@
|
||||
//
|
||||
// Copyright (c) 2000, Intel Corporation
|
||||
// All rights reserved.
|
||||
//
|
||||
// Contributed 2/15/2000 by Marius Cornea, John Harrison, Cristina Iordache,
|
||||
// Ted Kubaska, Bob Norin, and Shane Story of the Computational Software Lab,
|
||||
// Intel Corporation.
|
||||
//
|
||||
// WARRANTY DISCLAIMER
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 INTEL OR ITS
|
||||
// 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.
|
||||
//
|
||||
// Intel Corporation is the author of this code, and requests that all
|
||||
// problem reports or change requests be submitted to it directly at
|
||||
// http://developer.intel.com/opensource.
|
||||
//
|
||||
|
||||
#include <machine/asm.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
.section .text
|
||||
|
||||
ENTRY(__divdf3, 0)
|
||||
{ .mfi
|
||||
// a is in f8
|
||||
// b is in f9
|
||||
|
||||
// predicate registers used: p6
|
||||
// floating-point registers used: f6, f7, f8, f9, f10, f11
|
||||
|
||||
// load a, the first argument, in f6
|
||||
nop.m 0
|
||||
mov f6=f8
|
||||
nop.i 0
|
||||
} { .mfi
|
||||
// load b, the second argument, in f7
|
||||
nop.m 0
|
||||
mov f7=f9
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
|
||||
// BEGIN DOUBLE PRECISION LATENCY-OPTIMIZED DIVIDE ALGORITHM
|
||||
|
||||
nop.m 0
|
||||
// Step (1)
|
||||
// y0 = 1 / b in f8
|
||||
frcpa.s0 f8,p6=f6,f7
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (2)
|
||||
// q0 = a * y0 in f9
|
||||
(p6) fma.s1 f9=f6,f8,f0
|
||||
nop.i 0
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (3)
|
||||
// e0 = 1 - b * y0 in f10
|
||||
(p6) fnma.s1 f10=f7,f8,f1
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (4)
|
||||
// q1 = q0 + e0 * q0 in f9
|
||||
(p6) fma.s1 f9=f10,f9,f9
|
||||
nop.i 0
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (5)
|
||||
// e1 = e0 * e0 in f11
|
||||
(p6) fma.s1 f11=f10,f10,f0
|
||||
nop.i 0
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (6)
|
||||
// y1 = y0 + e0 * y0 in f8
|
||||
(p6) fma.s1 f8=f10,f8,f8
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (7)
|
||||
// q2 = q1 + e1 * q1 in f9
|
||||
(p6) fma.s1 f9=f11,f9,f9
|
||||
nop.i 0
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (8)
|
||||
// e2 = e1 * e1 in f10
|
||||
(p6) fma.s1 f10=f11,f11,f0
|
||||
nop.i 0
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (9)
|
||||
// y2 = y1 + e1 * y1 in f8
|
||||
(p6) fma.s1 f8=f11,f8,f8
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (10)
|
||||
// q3 = q2 + e2 * q2 in f9
|
||||
(p6) fma.d.s1 f9=f10,f9,f9
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (11)
|
||||
// y3 = y2 + e2 * y2 in f8
|
||||
(p6) fma.s1 f8=f10,f8,f8
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (12)
|
||||
// r0 = a - b * q3 in f6
|
||||
(p6) fnma.d.s1 f6=f7,f9,f6
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (13)
|
||||
// q4 = q3 + r0 * y3 in f8
|
||||
(p6) fma.d.s0 f8=f6,f8,f9
|
||||
nop.i 0;;
|
||||
|
||||
// END DOUBLE PRECISION LATENCY-OPTIMIZED DIVIDE ALGORITHM
|
||||
|
||||
} { .mib
|
||||
nop.m 0
|
||||
nop.i 0
|
||||
// return
|
||||
br.ret.sptk b0;;
|
||||
}
|
||||
|
||||
END(__divdf3)
|
||||
|
@ -1,143 +0,0 @@
|
||||
.file "__divdi3.s"
|
||||
|
||||
//
|
||||
// Copyright (c) 2000, Intel Corporation
|
||||
// All rights reserved.
|
||||
//
|
||||
// Contributed 2/15/2000 by Marius Cornea, John Harrison, Cristina Iordache,
|
||||
// Ted Kubaska, Bob Norin, and Shane Story of the Computational Software Lab,
|
||||
// Intel Corporation.
|
||||
//
|
||||
// WARRANTY DISCLAIMER
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 INTEL OR ITS
|
||||
// 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.
|
||||
//
|
||||
// Intel Corporation is the author of this code, and requests that all
|
||||
// problem reports or change requests be submitted to it directly at
|
||||
// http://developer.intel.com/opensource.
|
||||
//
|
||||
|
||||
#include <machine/asm.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
.section .text
|
||||
.proc __divdi3#
|
||||
.align 32
|
||||
.global __divdi3#
|
||||
.align 32
|
||||
|
||||
// 64-bit signed integer divide
|
||||
|
||||
__divdi3:
|
||||
|
||||
{ .mii
|
||||
alloc r31=ar.pfs,2,0,0,0
|
||||
nop.i 0
|
||||
nop.i 0;;
|
||||
} { .mmi
|
||||
|
||||
// 64-BIT SIGNED INTEGER DIVIDE BEGINS HERE
|
||||
|
||||
setf.sig f8=r32
|
||||
setf.sig f9=r33
|
||||
nop.i 0;;
|
||||
} { .mfb
|
||||
nop.m 0
|
||||
fcvt.xf f6=f8
|
||||
nop.b 0
|
||||
} { .mfb
|
||||
nop.m 0
|
||||
fcvt.xf f7=f9
|
||||
nop.b 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (1)
|
||||
// y0 = 1 / b in f8
|
||||
frcpa.s1 f8,p6=f6,f7
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (2)
|
||||
// e0 = 1 - b * y0 in f9
|
||||
(p6) fnma.s1 f9=f7,f8,f1
|
||||
nop.i 0
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (3)
|
||||
// q0 = a * y0 in f10
|
||||
(p6) fma.s1 f10=f6,f8,f0
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (4)
|
||||
// e1 = e0 * e0 in f11
|
||||
(p6) fma.s1 f11=f9,f9,f0
|
||||
nop.i 0
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (5)
|
||||
// q1 = q0 + e0 * q0 in f10
|
||||
(p6) fma.s1 f10=f9,f10,f10
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (6)
|
||||
// y1 = y0 + e0 * y0 in f8
|
||||
(p6) fma.s1 f8=f9,f8,f8
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (7)
|
||||
// q2 = q1 + e1 * q1 in f9
|
||||
(p6) fma.s1 f9=f11,f10,f10
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (8)
|
||||
// y2 = y1 + e1 * y1 in f8
|
||||
(p6) fma.s1 f8=f11,f8,f8
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (9)
|
||||
// r2 = a - b * q2 in f10
|
||||
(p6) fnma.s1 f10=f7,f9,f6
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (10)
|
||||
// q3 = q2 + r2 * y2 in f8
|
||||
(p6) fma.s1 f8=f10,f8,f9
|
||||
nop.i 0;;
|
||||
} { .mfb
|
||||
nop.m 0
|
||||
// Step (11)
|
||||
// q = trunc (q3)
|
||||
fcvt.fx.trunc.s1 f8=f8
|
||||
nop.b 0;;
|
||||
} { .mmi
|
||||
// quotient will be in r8 (if b != 0)
|
||||
getf.sig r8=f8
|
||||
nop.m 0
|
||||
nop.i 0;;
|
||||
}
|
||||
|
||||
// 64-BIT SIGNED INTEGER DIVIDE ENDS HERE
|
||||
|
||||
{ .mmb
|
||||
nop.m 0
|
||||
nop.m 0
|
||||
br.ret.sptk b0;;
|
||||
}
|
||||
|
||||
.endp __divdi3
|
@ -1,116 +0,0 @@
|
||||
//
|
||||
// Copyright (c) 2000, Intel Corporation
|
||||
// All rights reserved.
|
||||
//
|
||||
// Contributed 2/15/2000 by Marius Cornea, John Harrison, Cristina Iordache,
|
||||
// Ted Kubaska, Bob Norin, and Shane Story of the Computational Software Lab,
|
||||
// Intel Corporation.
|
||||
//
|
||||
// WARRANTY DISCLAIMER
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 INTEL OR ITS
|
||||
// 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.
|
||||
//
|
||||
// Intel Corporation is the author of this code, and requests that all
|
||||
// problem reports or change requests be submitted to it directly at
|
||||
// http://developer.intel.com/opensource.
|
||||
//
|
||||
|
||||
#include <machine/asm.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
ENTRY(__divsf3, 0)
|
||||
{ .mfi
|
||||
// a is in f8
|
||||
// b is in f9
|
||||
|
||||
// general registers used: r31, r32, r33, r34
|
||||
// predicate registers used: p6
|
||||
// floating-point registers used: f6, f7, f8
|
||||
|
||||
nop.m 0
|
||||
// load a, the first argument, in f6
|
||||
mov f6=f8
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// load b, the second argument, in f7
|
||||
mov f7=f9
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
|
||||
// BEGIN SINGLE PRECISION LATENCY-OPTIMIZED DIVIDE ALGORITHM
|
||||
|
||||
nop.m 0
|
||||
// Step (1)
|
||||
// y0 = 1 / b in f8
|
||||
frcpa.s0 f8,p6=f6,f7
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (2)
|
||||
// q0 = a * y0 in f6
|
||||
(p6) fma.s1 f6=f6,f8,f0
|
||||
nop.i 0
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (3)
|
||||
// e0 = 1 - b * y0 in f7
|
||||
(p6) fnma.s1 f7=f7,f8,f1
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (4)
|
||||
// q1 = q0 + e0 * q0 in f6
|
||||
(p6) fma.s1 f6=f7,f6,f6
|
||||
nop.i 0
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (5)
|
||||
// e1 = e0 * e0 in f7
|
||||
(p6) fma.s1 f7=f7,f7,f0
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (6)
|
||||
// q2 = q1 + e1 * q1 in f6
|
||||
(p6) fma.s1 f6=f7,f6,f6
|
||||
nop.i 0
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (7)
|
||||
// e2 = e1 * e1 in f7
|
||||
(p6) fma.s1 f7=f7,f7,f0
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (8)
|
||||
// q3 = q2 + e2 * q2 in f6
|
||||
(p6) fma.d.s1 f6=f7,f6,f6
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (9)
|
||||
// q3' = q3 in f8
|
||||
(p6) fma.s.s0 f8=f6,f1,f0
|
||||
nop.i 0;;
|
||||
|
||||
// END SINGLE PRECISION LATENCY-OPTIMIZED DIVIDE ALGORITHM
|
||||
|
||||
} { .mmb
|
||||
nop.m 0
|
||||
nop.m 0
|
||||
// return
|
||||
br.ret.sptk b0;;
|
||||
}
|
||||
|
||||
END(__divsf3)
|
@ -1,125 +0,0 @@
|
||||
.file "__divsi3.s"
|
||||
|
||||
//
|
||||
// Copyright (c) 2000, Intel Corporation
|
||||
// All rights reserved.
|
||||
//
|
||||
// Contributed 2/15/2000 by Marius Cornea, John Harrison, Cristina Iordache,
|
||||
// Ted Kubaska, Bob Norin, and Shane Story of the Computational Software Lab,
|
||||
// Intel Corporation.
|
||||
//
|
||||
// WARRANTY DISCLAIMER
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 INTEL OR ITS
|
||||
// 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.
|
||||
//
|
||||
// Intel Corporation is the author of this code, and requests that all
|
||||
// problem reports or change requests be submitted to it directly at
|
||||
// http://developer.intel.com/opensource.
|
||||
//
|
||||
|
||||
#include <machine/asm.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
.section .text
|
||||
|
||||
// 32-bit signed integer divide
|
||||
|
||||
.proc __divsi3#
|
||||
.align 32
|
||||
.global __divsi3#
|
||||
.align 32
|
||||
|
||||
__divsi3:
|
||||
|
||||
{ .mii
|
||||
alloc r31=ar.pfs,2,0,0,0
|
||||
nop.i 0
|
||||
nop.i 0;;
|
||||
} { .mii
|
||||
nop.m 0
|
||||
|
||||
// 32-BIT SIGNED INTEGER DIVIDE BEGINS HERE
|
||||
|
||||
// general register used:
|
||||
// r32 - 32-bit signed integer dividend
|
||||
// r33 - 32-bit signed integer divisor
|
||||
// r8 - 32-bit signed integer result
|
||||
// r2 - scratch register
|
||||
// floating-point registers used: f6, f7, f8, f9
|
||||
// predicate registers used: p6
|
||||
|
||||
sxt4 r32=r32
|
||||
sxt4 r33=r33;;
|
||||
} { .mmb
|
||||
setf.sig f6=r32
|
||||
setf.sig f7=r33
|
||||
nop.b 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
fcvt.xf f6=f6
|
||||
nop.i 0
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
fcvt.xf f7=f7
|
||||
mov r2 = 0x0ffdd;;
|
||||
} { .mfi
|
||||
setf.exp f9 = r2
|
||||
// (1) y0
|
||||
frcpa.s1 f8,p6=f6,f7
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// (2) q0 = a * y0
|
||||
(p6) fma.s1 f6=f6,f8,f0
|
||||
nop.i 0
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// (3) e0 = 1 - b * y0
|
||||
(p6) fnma.s1 f7=f7,f8,f1
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// (4) q1 = q0 + e0 * q0
|
||||
(p6) fma.s1 f6=f7,f6,f6
|
||||
nop.i 0
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// (5) e1 = e0 * e0 + 2^-34
|
||||
(p6) fma.s1 f7=f7,f7,f9
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// (6) q2 = q1 + e1 * q1
|
||||
(p6) fma.s1 f8=f7,f6,f6
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// (7) q = trunc(q2)
|
||||
fcvt.fx.trunc.s1 f8=f8
|
||||
nop.i 0;;
|
||||
} { .mmi
|
||||
// quotient will be in the least significant 32 bits of r8 (if b != 0)
|
||||
getf.sig r8=f8
|
||||
nop.m 0
|
||||
nop.i 0;;
|
||||
}
|
||||
|
||||
// 32-BIT SIGNED INTEGER DIVIDE ENDS HERE
|
||||
|
||||
{ .mmb
|
||||
nop.m 0
|
||||
nop.m 0
|
||||
br.ret.sptk b0;;
|
||||
}
|
||||
|
||||
.endp __divsi3
|
@ -1,160 +0,0 @@
|
||||
.file "__moddi3.s"
|
||||
|
||||
//
|
||||
// Copyright (c) 2000, Intel Corporation
|
||||
// All rights reserved.
|
||||
//
|
||||
// Contributed 2/15/2000 by Marius Cornea, John Harrison, Cristina Iordache,
|
||||
// Ted Kubaska, Bob Norin, and Shane Story of the Computational Software Lab,
|
||||
// Intel Corporation.
|
||||
//
|
||||
// WARRANTY DISCLAIMER
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 INTEL OR ITS
|
||||
// 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.
|
||||
//
|
||||
// Intel Corporation is the author of this code, and requests that all
|
||||
// problem reports or change requests be submitted to it directly at
|
||||
// http://developer.intel.com/opensource.
|
||||
//
|
||||
|
||||
#include <machine/asm.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
.section .text
|
||||
|
||||
// 64-bit signed integer remainder
|
||||
|
||||
.proc __moddi3#
|
||||
.align 32
|
||||
.global __moddi3#
|
||||
.align 32
|
||||
|
||||
__moddi3:
|
||||
|
||||
{ .mii
|
||||
alloc r31=ar.pfs,3,0,0,0
|
||||
nop.i 0
|
||||
nop.i 0
|
||||
} { .mmb
|
||||
|
||||
// 64-BIT SIGNED INTEGER REMAINDER BEGINS HERE
|
||||
|
||||
// general register used:
|
||||
// r32 - 64-bit signed integer dividend
|
||||
// r33 - 64-bit signed integer divisor
|
||||
// r8 - 64-bit signed integer result
|
||||
// r2 - scratch register
|
||||
// floating-point registers used: f6, f7, f8, f9, f10, f11, f12
|
||||
// predicate registers used: p6
|
||||
|
||||
setf.sig f12=r32 // holds an in integer form
|
||||
setf.sig f7=r33
|
||||
nop.b 0
|
||||
} { .mlx
|
||||
nop.m 0
|
||||
//movl r2=0x8000000000000000;;
|
||||
movl r2=0xffffffffffffffff;;
|
||||
} { .mfi
|
||||
// get the 2's complement of b
|
||||
sub r33=r0,r33
|
||||
fcvt.xf f6=f12
|
||||
nop.i 0
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
fcvt.xf f7=f7
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (1)
|
||||
// y0 = 1 / b in f8
|
||||
frcpa.s1 f8,p6=f6,f7
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (2)
|
||||
// q0 = a * y0 in f10
|
||||
(p6) fma.s1 f10=f6,f8,f0
|
||||
nop.i 0
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (3)
|
||||
// e0 = 1 - b * y0 in f9
|
||||
(p6) fnma.s1 f9=f7,f8,f1
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (4)
|
||||
// q1 = q0 + e0 * q0 in f10
|
||||
(p6) fma.s1 f10=f9,f10,f10
|
||||
nop.i 0
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (5)
|
||||
// e1 = e0 * e0 in f11
|
||||
(p6) fma.s1 f11=f9,f9,f0
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (6)
|
||||
// y1 = y0 + e0 * y0 in f8
|
||||
(p6) fma.s1 f8=f9,f8,f8
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (7)
|
||||
// q2 = q1 + e1 * q1 in f9
|
||||
(p6) fma.s1 f9=f11,f10,f10
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (8)
|
||||
// y2 = y1 + e1 * y1 in f8
|
||||
(p6) fma.s1 f8=f11,f8,f8
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (9)
|
||||
// r2 = a - b * q2 in f10
|
||||
(p6) fnma.s1 f10=f7,f9,f6
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
setf.sig f7=r33
|
||||
// Step (10)
|
||||
// q3 = q2 + r2 * y2 in f8
|
||||
(p6) fma.s1 f8=f10,f8,f9
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// (11) q = trunc(q3)
|
||||
fcvt.fx.trunc.s1 f8=f8
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// (12) r = a + (-b) * q
|
||||
xma.l f8=f8,f7,f12
|
||||
nop.i 0;;
|
||||
} { .mib
|
||||
getf.sig r8=f8
|
||||
nop.i 0
|
||||
nop.b 0
|
||||
}
|
||||
|
||||
// 64-BIT SIGNED INTEGER REMAINDER ENDS HERE
|
||||
|
||||
{ .mib
|
||||
nop.m 0
|
||||
nop.i 0
|
||||
br.ret.sptk b0;;
|
||||
}
|
||||
|
||||
.endp __moddi3
|
@ -1,132 +0,0 @@
|
||||
.file "__modsi3.s"
|
||||
|
||||
//
|
||||
// Copyright (c) 2000, Intel Corporation
|
||||
// All rights reserved.
|
||||
//
|
||||
// Contributed 2/15/2000 by Marius Cornea, John Harrison, Cristina Iordache,
|
||||
// Ted Kubaska, Bob Norin, and Shane Story of the Computational Software Lab,
|
||||
// Intel Corporation.
|
||||
//
|
||||
// WARRANTY DISCLAIMER
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 INTEL OR ITS
|
||||
// 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.
|
||||
//
|
||||
// Intel Corporation is the author of this code, and requests that all
|
||||
// problem reports or change requests be submitted to it directly at
|
||||
// http://developer.intel.com/opensource.
|
||||
//
|
||||
|
||||
#include <machine/asm.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
.section .text
|
||||
|
||||
// 32-bit signed integer remainder
|
||||
|
||||
.proc __modsi3#
|
||||
.align 32
|
||||
.global __modsi3#
|
||||
.align 32
|
||||
|
||||
__modsi3:
|
||||
|
||||
{ .mii
|
||||
alloc r31=ar.pfs,2,0,0,0
|
||||
nop.i 0
|
||||
nop.i 0;;
|
||||
} { .mii
|
||||
nop.m 0
|
||||
|
||||
// 32-BIT SIGNED INTEGER REMAINDER BEGINS HERE
|
||||
|
||||
// general register used:
|
||||
// r32 - 32-bit signed integer dividend
|
||||
// r33 - 32-bit signed integer divisor
|
||||
// r8 - 32-bit signed integer result
|
||||
// r2 - scratch register
|
||||
// floating-point registers used: f6, f7, f8, f9, f10, f11
|
||||
// predicate registers used: p6
|
||||
|
||||
sxt4 r32=r32
|
||||
sxt4 r33=r33;;
|
||||
} { .mmb
|
||||
setf.sig f11=r32
|
||||
setf.sig f7=r33
|
||||
nop.b 0;;
|
||||
} { .mfi
|
||||
// get 2's complement of b
|
||||
sub r33=r0,r33
|
||||
fcvt.xf f6=f11
|
||||
nop.i 0
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
fcvt.xf f7=f7
|
||||
mov r2 = 0x0ffdd;;
|
||||
} { .mfi
|
||||
setf.exp f9 = r2
|
||||
// (1) y0
|
||||
frcpa.s1 f8,p6=f6,f7
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// (2) q0 = a * y0
|
||||
(p6) fma.s1 f10=f6,f8,f0
|
||||
nop.i 0
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// (3) e0 = 1 - b * y0
|
||||
(p6) fnma.s1 f8=f7,f8,f1
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
// 2's complement of b
|
||||
setf.sig f7=r33
|
||||
// (4) q1 = q0 + e0 * q0
|
||||
(p6) fma.s1 f10=f8,f10,f10
|
||||
nop.i 0
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// (5) e1 = e0 * e0 + 2^-34
|
||||
(p6) fma.s1 f8=f8,f8,f9
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// (6) q2 = q1 + e1 * q1
|
||||
(p6) fma.s1 f8=f8,f10,f10
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// (7) q = trunc(q2)
|
||||
fcvt.fx.trunc.s1 f8=f8
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// (8) r = a + (-b) * q
|
||||
xma.l f8=f8,f7,f11
|
||||
nop.i 0;;
|
||||
} { .mmi
|
||||
// remainder will be in the least significant 32 bits of r8 (if b != 0)
|
||||
getf.sig r8=f8
|
||||
nop.m 0
|
||||
nop.i 0;;
|
||||
}
|
||||
|
||||
// 32-BIT SIGNED INTEGER REMAINDER ENDS HERE
|
||||
|
||||
{ .mmb
|
||||
nop.m 0
|
||||
nop.m 0
|
||||
br.ret.sptk b0;;
|
||||
}
|
||||
|
||||
.endp __modsi3
|
@ -1,144 +0,0 @@
|
||||
.file "__udivdi3.s"
|
||||
|
||||
//
|
||||
// Copyright (c) 2000, Intel Corporation
|
||||
// All rights reserved.
|
||||
//
|
||||
// Contributed 2/15/2000 by Marius Cornea, John Harrison, Cristina Iordache,
|
||||
// Ted Kubaska, Bob Norin, and Shane Story of the Computational Software Lab,
|
||||
// Intel Corporation.
|
||||
//
|
||||
// WARRANTY DISCLAIMER
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 INTEL OR ITS
|
||||
// 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.
|
||||
//
|
||||
// Intel Corporation is the author of this code, and requests that all
|
||||
// problem reports or change requests be submitted to it directly at
|
||||
// http://developer.intel.com/opensource.
|
||||
//
|
||||
|
||||
#include <machine/asm.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
.section .text
|
||||
.proc __udivdi3#
|
||||
.align 32
|
||||
.global __udivdi3#
|
||||
.align 32
|
||||
|
||||
// 64-bit unsigned integer divide
|
||||
|
||||
__udivdi3:
|
||||
|
||||
{ .mii
|
||||
alloc r31=ar.pfs,2,0,0,0
|
||||
nop.i 0
|
||||
nop.i 0;;
|
||||
}
|
||||
|
||||
{ .mmi
|
||||
|
||||
// 64-BIT UNSIGNED INTEGER DIVIDE BEGINS HERE
|
||||
|
||||
setf.sig f8=r32
|
||||
setf.sig f9=r33
|
||||
nop.i 0;;
|
||||
} { .mfb
|
||||
nop.m 0
|
||||
fma.s1 f6=f8,f1,f0
|
||||
nop.b 0
|
||||
} { .mfb
|
||||
nop.m 0
|
||||
fma.s1 f7=f9,f1,f0
|
||||
nop.b 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (1)
|
||||
// y0 = 1 / b in f8
|
||||
frcpa.s1 f8,p6=f6,f7
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (2)
|
||||
// e0 = 1 - b * y0 in f9
|
||||
(p6) fnma.s1 f9=f7,f8,f1
|
||||
nop.i 0
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (3)
|
||||
// q0 = a * y0 in f10
|
||||
(p6) fma.s1 f10=f6,f8,f0
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (4)
|
||||
// e1 = e0 * e0 in f11
|
||||
(p6) fma.s1 f11=f9,f9,f0
|
||||
nop.i 0
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (5)
|
||||
// q1 = q0 + e0 * q0 in f10
|
||||
(p6) fma.s1 f10=f9,f10,f10
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (6)
|
||||
// y1 = y0 + e0 * y0 in f8
|
||||
(p6) fma.s1 f8=f9,f8,f8
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (7)
|
||||
// q2 = q1 + e1 * q1 in f9
|
||||
(p6) fma.s1 f9=f11,f10,f10
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (8)
|
||||
// y2 = y1 + e1 * y1 in f8
|
||||
(p6) fma.s1 f8=f11,f8,f8
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (9)
|
||||
// r2 = a - b * q2 in f10
|
||||
(p6) fnma.s1 f10=f7,f9,f6
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (10)
|
||||
// q3 = q2 + r2 * y2 in f8
|
||||
(p6) fma.s1 f8=f10,f8,f9
|
||||
nop.i 0;;
|
||||
} { .mfb
|
||||
nop.m 0
|
||||
// (11) q = trunc(q3)
|
||||
fcvt.fxu.trunc.s1 f8=f8
|
||||
nop.b 0;;
|
||||
} { .mmi
|
||||
// quotient will be in r8 (if b != 0)
|
||||
getf.sig r8=f8
|
||||
nop.m 0
|
||||
nop.i 0;;
|
||||
}
|
||||
|
||||
// 64-BIT UNSIGNED INTEGER DIVIDE ENDS HERE
|
||||
|
||||
{ .mmb
|
||||
nop.m 0
|
||||
nop.m 0
|
||||
br.ret.sptk b0;;
|
||||
}
|
||||
|
||||
.endp __udivdi3
|
@ -1,125 +0,0 @@
|
||||
.file "__udivsi3.s"
|
||||
|
||||
//
|
||||
// Copyright (c) 2000, Intel Corporation
|
||||
// All rights reserved.
|
||||
//
|
||||
// Contributed 2/15/2000 by Marius Cornea, John Harrison, Cristina Iordache,
|
||||
// Ted Kubaska, Bob Norin, and Shane Story of the Computational Software Lab,
|
||||
// Intel Corporation.
|
||||
//
|
||||
// WARRANTY DISCLAIMER
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 INTEL OR ITS
|
||||
// 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.
|
||||
//
|
||||
// Intel Corporation is the author of this code, and requests that all
|
||||
// problem reports or change requests be submitted to it directly at
|
||||
// http://developer.intel.com/opensource.
|
||||
//
|
||||
|
||||
#include <machine/asm.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
.section .text
|
||||
|
||||
// 32-bit unsigned integer divide
|
||||
|
||||
.proc __udivsi3#
|
||||
.align 32
|
||||
.global __udivsi3#
|
||||
.align 32
|
||||
|
||||
__udivsi3:
|
||||
|
||||
{ .mii
|
||||
alloc r31=ar.pfs,2,0,0,0
|
||||
nop.i 0
|
||||
nop.i 0;;
|
||||
} { .mii
|
||||
nop.m 0
|
||||
|
||||
// 32-BIT UNSIGNED INTEGER DIVIDE BEGINS HERE
|
||||
|
||||
// general register used:
|
||||
// r32 - 32-bit unsigned integer dividend
|
||||
// r33 - 32-bit unsigned integer divisor
|
||||
// r8 - 32-bit unsigned integer result
|
||||
// r2 - scratch register
|
||||
// floating-point registers used: f6, f7, f8, f9
|
||||
// predicate registers used: p6
|
||||
|
||||
zxt4 r32=r32
|
||||
zxt4 r33=r33;;
|
||||
} { .mmb
|
||||
setf.sig f6=r32
|
||||
setf.sig f7=r33
|
||||
nop.b 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
fcvt.xf f6=f6
|
||||
nop.i 0
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
fcvt.xf f7=f7
|
||||
mov r2 = 0x0ffdd;;
|
||||
} { .mfi
|
||||
setf.exp f9 = r2
|
||||
// (1) y0
|
||||
frcpa.s1 f8,p6=f6,f7
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// (2) q0 = a * y0
|
||||
(p6) fma.s1 f6=f6,f8,f0
|
||||
nop.i 0
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// (3) e0 = 1 - b * y0
|
||||
(p6) fnma.s1 f7=f7,f8,f1
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// (4) q1 = q0 + e0 * q0
|
||||
(p6) fma.s1 f6=f7,f6,f6
|
||||
nop.i 0
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// (5) e1 = e0 * e0 + 2^-34
|
||||
(p6) fma.s1 f7=f7,f7,f9
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// (6) q2 = q1 + e1 * q1
|
||||
(p6) fma.s1 f8=f7,f6,f6
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// (7) q = trunc(q2)
|
||||
fcvt.fxu.trunc.s1 f8=f8
|
||||
nop.i 0;;
|
||||
} { .mmi
|
||||
// quotient will be in the least significant 32 bits of r8 (if b != 0)
|
||||
getf.sig r8=f8
|
||||
nop.m 0
|
||||
nop.i 0;;
|
||||
}
|
||||
|
||||
// 32-BIT UNSIGNED INTEGER DIVIDE ENDS HERE
|
||||
|
||||
{ .mmb
|
||||
nop.m 0
|
||||
nop.m 0
|
||||
br.ret.sptk b0;;
|
||||
}
|
||||
|
||||
.endp __udivsi3
|
@ -1,156 +0,0 @@
|
||||
.file "__umoddi3.s"
|
||||
|
||||
//
|
||||
// Copyright (c) 2000, Intel Corporation
|
||||
// All rights reserved.
|
||||
//
|
||||
// Contributed 2/15/2000 by Marius Cornea, John Harrison, Cristina Iordache,
|
||||
// Ted Kubaska, Bob Norin, and Shane Story of the Computational Software Lab,
|
||||
// Intel Corporation.
|
||||
//
|
||||
// WARRANTY DISCLAIMER
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 INTEL OR ITS
|
||||
// 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.
|
||||
//
|
||||
// Intel Corporation is the author of this code, and requests that all
|
||||
// problem reports or change requests be submitted to it directly at
|
||||
// http://developer.intel.com/opensource.
|
||||
//
|
||||
|
||||
#include <machine/asm.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
.section .text
|
||||
|
||||
// 64-bit unsigned integer remainder
|
||||
|
||||
.proc __umoddi3#
|
||||
.align 32
|
||||
.global __umoddi3#
|
||||
.align 32
|
||||
|
||||
__umoddi3:
|
||||
|
||||
{ .mii
|
||||
alloc r31=ar.pfs,3,0,0,0
|
||||
nop.i 0
|
||||
nop.i 0
|
||||
} { .mmb
|
||||
|
||||
// 64-BIT UNSIGNED INTEGER REMAINDER BEGINS HERE
|
||||
|
||||
// general register used:
|
||||
// r32 - 64-bit unsigned integer dividend
|
||||
// r33 - 64-bit unsigned integer divisor
|
||||
// r8 - 64-bit unsigned integer result
|
||||
// floating-point registers used: f6, f7, f8, f9, f10, f11, f12
|
||||
// predicate registers used: p6
|
||||
|
||||
setf.sig f12=r32 // holds an in integer form
|
||||
setf.sig f7=r33
|
||||
nop.b 0;;
|
||||
} { .mfi
|
||||
// get 2's complement of b
|
||||
sub r33=r0,r33
|
||||
fcvt.xuf.s1 f6=f12
|
||||
nop.i 0
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
fcvt.xuf.s1 f7=f7
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (1)
|
||||
// y0 = 1 / b in f8
|
||||
frcpa.s1 f8,p6=f6,f7
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (2)
|
||||
// q0 = a * y0 in f10
|
||||
(p6) fma.s1 f10=f6,f8,f0
|
||||
nop.i 0
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (3)
|
||||
// e0 = 1 - b * y0 in f9
|
||||
(p6) fnma.s1 f9=f7,f8,f1
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (4)
|
||||
// q1 = q0 + e0 * q0 in f10
|
||||
(p6) fma.s1 f10=f9,f10,f10
|
||||
nop.i 0
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (5)
|
||||
// e1 = e0 * e0 in f11
|
||||
(p6) fma.s1 f11=f9,f9,f0
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (6)
|
||||
// y1 = y0 + e0 * y0 in f8
|
||||
(p6) fma.s1 f8=f9,f8,f8
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (7)
|
||||
// q2 = q1 + e1 * q1 in f9
|
||||
(p6) fma.s1 f9=f11,f10,f10
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (8)
|
||||
// y2 = y1 + e1 * y1 in f8
|
||||
(p6) fma.s1 f8=f11,f8,f8
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// Step (9)
|
||||
// r2 = a - b * q2 in f10
|
||||
(p6) fnma.s1 f10=f7,f9,f6
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
// f7=-b
|
||||
setf.sig f7=r33
|
||||
// Step (10)
|
||||
// q3 = q2 + r2 * y2 in f8
|
||||
(p6) fma.s1 f8=f10,f8,f9
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// (11) q = trunc(q3)
|
||||
fcvt.fxu.trunc.s1 f8=f8
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// (12) r = a + (-b) * q
|
||||
xma.l f8=f8,f7,f12
|
||||
nop.i 0;;
|
||||
} { .mib
|
||||
getf.sig r8=f8
|
||||
nop.i 0
|
||||
nop.b 0
|
||||
}
|
||||
|
||||
// 64-BIT UNSIGNED INTEGER REMAINDER ENDS HERE
|
||||
|
||||
{ .mib
|
||||
nop.m 0
|
||||
nop.i 0
|
||||
br.ret.sptk b0;;
|
||||
}
|
||||
|
||||
.endp __umoddi3
|
@ -1,132 +0,0 @@
|
||||
.file "__umodsi3.s"
|
||||
|
||||
//
|
||||
// Copyright (c) 2000, Intel Corporation
|
||||
// All rights reserved.
|
||||
//
|
||||
// Contributed 2/15/2000 by Marius Cornea, John Harrison, Cristina Iordache,
|
||||
// Ted Kubaska, Bob Norin, and Shane Story of the Computational Software Lab,
|
||||
// Intel Corporation.
|
||||
//
|
||||
// WARRANTY DISCLAIMER
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 INTEL OR ITS
|
||||
// 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.
|
||||
//
|
||||
// Intel Corporation is the author of this code, and requests that all
|
||||
// problem reports or change requests be submitted to it directly at
|
||||
// http://developer.intel.com/opensource.
|
||||
//
|
||||
|
||||
#include <machine/asm.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
.section .text
|
||||
|
||||
// 32-bit unsigned integer remainder
|
||||
|
||||
.proc __umodsi3#
|
||||
.align 32
|
||||
.global __umodsi3#
|
||||
.align 32
|
||||
|
||||
__umodsi3:
|
||||
|
||||
{ .mii
|
||||
alloc r31=ar.pfs,2,0,0,0
|
||||
nop.i 0
|
||||
nop.i 0;;
|
||||
} { .mii
|
||||
nop.m 0
|
||||
|
||||
// 32-BIT UNSIGNED INTEGER REMAINDER BEGINS HERE
|
||||
|
||||
// general register used:
|
||||
// r32 - 32-bit unsigned integer dividend
|
||||
// r33 - 32-bit unsigned integer divisor
|
||||
// r8 - 32-bit unsigned integer result
|
||||
// r2 - scratch register
|
||||
// floating-point registers used: f6, f7, f8, f9, f10, f11
|
||||
// predicate registers used: p6
|
||||
|
||||
zxt4 r32=r32
|
||||
zxt4 r33=r33;;
|
||||
} { .mmb
|
||||
setf.sig f11=r32
|
||||
setf.sig f7=r33
|
||||
nop.b 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
fcvt.xf f6=f11
|
||||
nop.i 0
|
||||
} { .mfi
|
||||
// get 2's complement of b
|
||||
sub r33=r0,r33
|
||||
fcvt.xf f7=f7
|
||||
mov r2 = 0x0ffdd;;
|
||||
} { .mfi
|
||||
setf.exp f9 = r2
|
||||
// (1) y0
|
||||
frcpa.s1 f8,p6=f6,f7
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// (2) q0 = a * y0
|
||||
(p6) fma.s1 f10=f6,f8,f0
|
||||
nop.i 0
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// (3) e0 = 1 - b * y0
|
||||
(p6) fnma.s1 f8=f7,f8,f1
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// (4) q1 = q0 + e0 * q0
|
||||
(p6) fma.s1 f10=f8,f10,f10
|
||||
nop.i 0
|
||||
} { .mfi
|
||||
// get 2's complement of b
|
||||
setf.sig f7=r33
|
||||
// (5) e1 = e0 * e0 + 2^-34
|
||||
(p6) fma.s1 f8=f8,f8,f9
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// (6) q2 = q1 + e1 * q1
|
||||
(p6) fma.s1 f8=f8,f10,f10
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// (7) q = trunc(q2)
|
||||
fcvt.fxu.trunc.s1 f8=f8
|
||||
nop.i 0;;
|
||||
} { .mfi
|
||||
nop.m 0
|
||||
// (8) r = a + (-b) * q
|
||||
xma.l f8=f8,f7,f11
|
||||
nop.i 0;;
|
||||
} { .mmi
|
||||
// remainder will be in the least significant 32 bits of r8 (if b != 0)
|
||||
getf.sig r8=f8
|
||||
nop.m 0
|
||||
nop.i 0;;
|
||||
}
|
||||
|
||||
// 32-BIT UNSIGNED INTEGER REMAINDER ENDS HERE
|
||||
|
||||
{ .mmb
|
||||
nop.m 0
|
||||
nop.m 0
|
||||
br.ret.sptk b0;;
|
||||
}
|
||||
|
||||
.endp __umodsi3
|
@ -1,75 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2004 Marcel Moolenaar
|
||||
* 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 ``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 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$");
|
||||
|
||||
.text
|
||||
|
||||
/*
|
||||
* Important registers:
|
||||
* r8 structure return address
|
||||
* r15 static link (nested routines)
|
||||
* rp our return address
|
||||
* in0 caller's ar.pfs
|
||||
* in1 caller's gp
|
||||
* in2 caller's rp
|
||||
* in3 GOT entry
|
||||
* ar.pfs our pfs
|
||||
*/
|
||||
ENTRY_NOPROFILE(_mcount, 4)
|
||||
alloc loc0 = ar.pfs, 4, 4, 2, 0
|
||||
mov loc1 = r8
|
||||
mov loc2 = rp
|
||||
mov loc3 = r15
|
||||
;;
|
||||
mov out0 = in2
|
||||
mov out1 = rp
|
||||
br.call.sptk rp = __mcount
|
||||
;;
|
||||
1:
|
||||
mov gp = in1
|
||||
mov r14 = ip
|
||||
mov b7 = loc2
|
||||
;;
|
||||
add r14 = 2f - 1b, r14
|
||||
mov ar.pfs = loc0
|
||||
mov rp = in2
|
||||
;;
|
||||
mov r15 = loc3
|
||||
mov b7 = r14
|
||||
mov b6 = loc2
|
||||
mov r8 = loc1
|
||||
mov r14 = in0
|
||||
br.ret.sptk b7
|
||||
;;
|
||||
2:
|
||||
mov ar.pfs = r14
|
||||
br.sptk b6
|
||||
;;
|
||||
END(_mcount)
|
||||
|
||||
WEAK_ALIAS(mcount, _mcount)
|
@ -1,34 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 2004 Doug Rabson
|
||||
* 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.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
void
|
||||
_set_tp(void *tpval)
|
||||
{
|
||||
|
||||
__asm __volatile("mov r13 = %0" :: "r"(tpval));
|
||||
}
|
@ -1,310 +0,0 @@
|
||||
//
|
||||
// Copyright (c) 1999, 2000
|
||||
// Intel Corporation.
|
||||
// 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.
|
||||
//
|
||||
// 3. All advertising materials mentioning features or use of this software
|
||||
// must display the following acknowledgement:
|
||||
//
|
||||
// This product includes software developed by Intel Corporation and
|
||||
// its contributors.
|
||||
//
|
||||
// 4. Neither the name of Intel Corporation or its contributors may be
|
||||
// used to endorse or promote products derived from this software
|
||||
// without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION 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 INTEL CORPORATION 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.
|
||||
//
|
||||
//
|
||||
|
||||
//
|
||||
// Module Name:
|
||||
//
|
||||
// setjmp.s
|
||||
//
|
||||
// Abstract:
|
||||
//
|
||||
// Contains an implementation of setjmp and longjmp for the
|
||||
// IA-64 architecture.
|
||||
|
||||
.file "setjmp.s"
|
||||
|
||||
#include <machine/asm.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#define LOCORE
|
||||
#include <machine/setjmp.h>
|
||||
|
||||
// int _setjmp(struct jmp_buffer *)
|
||||
//
|
||||
// Setup a non-local goto.
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
// SetJump stores the current register set in the area pointed to
|
||||
// by "save". It returns zero. Subsequent calls to "LongJump" will
|
||||
// restore the registers and return non-zero to the same location.
|
||||
//
|
||||
// On entry, r32 contains the pointer to the jmp_buffer
|
||||
//
|
||||
|
||||
ENTRY(_setjmp, 1)
|
||||
add r10 = J_PREDS, r32 // skip Unats & pfs save area
|
||||
add r11 = J_BSP, r32
|
||||
//
|
||||
// save immediate context
|
||||
//
|
||||
mov r2 = ar.bsp // save backing store pointer
|
||||
mov r3 = pr // save predicates
|
||||
flushrs
|
||||
;;
|
||||
//
|
||||
// save user Unat register
|
||||
//
|
||||
mov r16 = ar.lc // save loop count register
|
||||
mov r14 = ar.unat // save user Unat register
|
||||
|
||||
st8 [r10] = r3, J_LC-J_PREDS
|
||||
st8 [r11] = r2, J_R4-J_BSP
|
||||
;;
|
||||
st8 [r10] = r16, J_R5-J_LC
|
||||
st8 [r32] = r14, J_NATS // Note: Unat at the
|
||||
// beginning of the save area
|
||||
mov r15 = ar.pfs
|
||||
;;
|
||||
//
|
||||
// save preserved general registers & NaT's
|
||||
//
|
||||
.mem.offset 0,0
|
||||
st8.spill [r11] = r4, J_R6-J_R4
|
||||
.mem.offset 8,0
|
||||
st8.spill [r10] = r5, J_R7-J_R5
|
||||
;;
|
||||
.mem.offset 16,0
|
||||
st8.spill [r11] = r6, J_SP-J_R6
|
||||
.mem.offset 24,0
|
||||
st8.spill [r10] = r7, J_F3-J_R7
|
||||
;;
|
||||
st8.spill [r11] = sp, J_F2-J_SP
|
||||
mov r16 = ar.rsc
|
||||
;;
|
||||
//
|
||||
// save spilled Unat and pfs registers
|
||||
//
|
||||
mov r2 = ar.unat // save Unat register after spill
|
||||
mov ar.rsc = r0
|
||||
;;
|
||||
st8 [r32] = r2, J_PFS-J_NATS // save unat for spilled regs
|
||||
mov r17 = ar.rnat
|
||||
;;
|
||||
st8 [r32] = r15, J_RNAT-J_PFS // save pfs
|
||||
mov ar.rsc = r16
|
||||
//
|
||||
// save floating registers
|
||||
//
|
||||
stf.spill [r11] = f2, J_F4-J_F2
|
||||
stf.spill [r10] = f3, J_F5-J_F3
|
||||
;;
|
||||
stf.spill [r11] = f4, J_F16-J_F4
|
||||
stf.spill [r10] = f5, J_F17-J_F5
|
||||
;;
|
||||
stf.spill [r11] = f16, J_F18-J_F16
|
||||
stf.spill [r10] = f17, J_F19-J_F17
|
||||
;;
|
||||
stf.spill [r11] = f18, J_F20-J_F18
|
||||
stf.spill [r10] = f19, J_F21-J_F19
|
||||
;;
|
||||
stf.spill [r11] = f20, J_F22-J_F20
|
||||
stf.spill [r10] = f21, J_F23-J_F21
|
||||
;;
|
||||
stf.spill [r11] = f22, J_F24-J_F22
|
||||
stf.spill [r10] = f23, J_F25-J_F23
|
||||
;;
|
||||
stf.spill [r11] = f24, J_F26-J_F24
|
||||
stf.spill [r10] = f25, J_F27-J_F25
|
||||
;;
|
||||
stf.spill [r11] = f26, J_F28-J_F26
|
||||
stf.spill [r10] = f27, J_F29-J_F27
|
||||
;;
|
||||
stf.spill [r11] = f28, J_F30-J_F28
|
||||
stf.spill [r10] = f29, J_F31-J_F29
|
||||
;;
|
||||
stf.spill [r11] = f30, J_FPSR-J_F30
|
||||
stf.spill [r10] = f31, J_B0-J_F31 // size of f31 + fpsr
|
||||
;;
|
||||
st8 [r32] = r17
|
||||
//
|
||||
// save FPSR register & branch registers
|
||||
//
|
||||
mov r2 = ar.fpsr // save fpsr register
|
||||
mov r3 = b0
|
||||
;;
|
||||
st8 [r11] = r2, J_B1-J_FPSR
|
||||
st8 [r10] = r3, J_B2-J_B0
|
||||
mov r2 = b1
|
||||
mov r3 = b2
|
||||
;;
|
||||
st8 [r11] = r2, J_B3-J_B1
|
||||
st8 [r10] = r3, J_B4-J_B2
|
||||
mov r2 = b3
|
||||
mov r3 = b4
|
||||
;;
|
||||
st8 [r11] = r2, J_B5-J_B3
|
||||
st8 [r10] = r3
|
||||
mov r2 = b5
|
||||
;;
|
||||
st8 [r11] = r2
|
||||
;;
|
||||
//
|
||||
// return
|
||||
//
|
||||
mov r8 = r0 // return 0 from setjmp
|
||||
mov ar.unat = r14 // restore unat
|
||||
br.ret.sptk b0
|
||||
|
||||
END(_setjmp)
|
||||
|
||||
|
||||
//
|
||||
// void _longjmp(struct jmp_buffer *, int val)
|
||||
//
|
||||
// Perform a non-local goto.
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
// LongJump initializes the register set to the values saved by a
|
||||
// previous 'SetJump' and jumps to the return location saved by that
|
||||
// 'SetJump'. This has the effect of unwinding the stack and returning
|
||||
// for a second time to the 'SetJump'.
|
||||
//
|
||||
|
||||
WEAK_ALIAS(_longjmp,___longjmp)
|
||||
ENTRY(___longjmp, 2)
|
||||
mov r14 = ar.rsc // get user RSC conf
|
||||
mov r8 = r33 // return value
|
||||
add r10 = J_PFS, r32 // get address of pfs
|
||||
;;
|
||||
mov ar.rsc = r0
|
||||
add r11 = J_NATS, r32
|
||||
add r17 = J_RNAT, r32
|
||||
;;
|
||||
ld8 r15 = [r10], J_BSP-J_PFS // get pfs
|
||||
ld8 r2 = [r11], J_LC-J_NATS // get unat for spilled regs
|
||||
mov r31 = r32
|
||||
;;
|
||||
loadrs
|
||||
mov ar.unat = r2
|
||||
cmp.eq p6,p0=0,r8 // Return value 0?
|
||||
;;
|
||||
ld8 r16 = [r10], J_PREDS-J_BSP // get backing store pointer
|
||||
ld8 r17 = [r17] // ar.rnat
|
||||
mov ar.pfs = r15
|
||||
;;
|
||||
mov ar.bspstore = r16
|
||||
(p6) add r8 = 1, r0
|
||||
;;
|
||||
mov ar.rnat = r17
|
||||
mov ar.rsc = r14 // restore RSC conf
|
||||
|
||||
ld8 r3 = [r11], J_R4-J_LC // get lc register
|
||||
ld8 r2 = [r10], J_R5-J_PREDS // get predicates
|
||||
;;
|
||||
mov pr = r2, -1
|
||||
mov ar.lc = r3
|
||||
//
|
||||
// restore preserved general registers & NaT's
|
||||
//
|
||||
ld8.fill r4 = [r11], J_R6-J_R4
|
||||
;;
|
||||
ld8.fill r5 = [r10], J_R7-J_R5
|
||||
ld8.fill r6 = [r11], J_SP-J_R6
|
||||
;;
|
||||
ld8.fill r7 = [r10], J_F2-J_R7
|
||||
ld8.fill sp = [r11], J_F3-J_SP
|
||||
;;
|
||||
//
|
||||
// restore floating registers
|
||||
//
|
||||
ldf.fill f2 = [r10], J_F4-J_F2
|
||||
ldf.fill f3 = [r11], J_F5-J_F3
|
||||
;;
|
||||
ldf.fill f4 = [r10], J_F16-J_F4
|
||||
ldf.fill f5 = [r11], J_F17-J_F5
|
||||
;;
|
||||
ldf.fill f16 = [r10], J_F18-J_F16
|
||||
ldf.fill f17 = [r11], J_F19-J_F17
|
||||
;;
|
||||
ldf.fill f18 = [r10], J_F20-J_F18
|
||||
ldf.fill f19 = [r11], J_F21-J_F19
|
||||
;;
|
||||
ldf.fill f20 = [r10], J_F22-J_F20
|
||||
ldf.fill f21 = [r11], J_F23-J_F21
|
||||
;;
|
||||
ldf.fill f22 = [r10], J_F24-J_F22
|
||||
ldf.fill f23 = [r11], J_F25-J_F23
|
||||
;;
|
||||
ldf.fill f24 = [r10], J_F26-J_F24
|
||||
ldf.fill f25 = [r11], J_F27-J_F25
|
||||
;;
|
||||
ldf.fill f26 = [r10], J_F28-J_F26
|
||||
ldf.fill f27 = [r11], J_F29-J_F27
|
||||
;;
|
||||
ldf.fill f28 = [r10], J_F30-J_F28
|
||||
ldf.fill f29 = [r11], J_F31-J_F29
|
||||
;;
|
||||
ldf.fill f30 = [r10], J_FPSR-J_F30
|
||||
ldf.fill f31 = [r11], J_B0-J_F31 ;;
|
||||
|
||||
//
|
||||
// restore branch registers and fpsr
|
||||
//
|
||||
ld8 r16 = [r10], J_B1-J_FPSR // get fpsr
|
||||
ld8 r17 = [r11], J_B2-J_B0 // get return pointer
|
||||
;;
|
||||
mov ar.fpsr = r16
|
||||
mov b0 = r17
|
||||
ld8 r2 = [r10], J_B3-J_B1
|
||||
ld8 r3 = [r11], J_B4-J_B2
|
||||
;;
|
||||
mov b1 = r2
|
||||
mov b2 = r3
|
||||
ld8 r2 = [r10], J_B5-J_B3
|
||||
ld8 r3 = [r11]
|
||||
;;
|
||||
mov b3 = r2
|
||||
mov b4 = r3
|
||||
ld8 r2 = [r10]
|
||||
ld8 r21 = [r31] // get user unat
|
||||
;;
|
||||
mov b5 = r2
|
||||
mov ar.unat = r21
|
||||
|
||||
//
|
||||
// invalidate ALAT
|
||||
//
|
||||
invala ;;
|
||||
|
||||
br.ret.sptk b0
|
||||
|
||||
END(___longjmp)
|
@ -1,33 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 2000 Doug Rabson
|
||||
* 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$");
|
||||
|
||||
ENTRY(fabs, 1)
|
||||
fabs fret0=farg0
|
||||
br.ret.sptk.few rp
|
||||
END(fabs)
|
@ -1,25 +0,0 @@
|
||||
/*
|
||||
* Written by J.T. Conklin, Apr 10, 1995
|
||||
* Public domain.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <float.h>
|
||||
|
||||
static const int map[] = {
|
||||
1, /* round to nearest */
|
||||
3, /* round to zero */
|
||||
2, /* round to negative infinity */
|
||||
0 /* round to positive infinity */
|
||||
};
|
||||
|
||||
int
|
||||
__flt_rounds(void)
|
||||
{
|
||||
int x;
|
||||
|
||||
__asm("mov %0=ar.fpsr" : "=r" (x));
|
||||
return (map[(x >> 10) & 0x03]);
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 2001 Doug Rabson
|
||||
* 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 <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <ieeefp.h>
|
||||
|
||||
fp_except_t
|
||||
fpgetmask(void)
|
||||
{
|
||||
u_int64_t fpsr;
|
||||
|
||||
__asm __volatile("mov %0=ar.fpsr" : "=r" (fpsr));
|
||||
return (~fpsr & 0x3d);
|
||||
}
|
@ -1,39 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Marcel Moolenaar
|
||||
* 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 ``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 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.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <ieeefp.h>
|
||||
|
||||
fp_rnd_t
|
||||
fpgetround(void)
|
||||
{
|
||||
uint64_t fpsr;
|
||||
|
||||
__asm __volatile("mov %0=ar.fpsr" : "=r"(fpsr));
|
||||
return ((fp_rnd_t)((fpsr >> 10) & 3));
|
||||
}
|
@ -1,44 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 2001 Doug Rabson
|
||||
* 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 <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <ieeefp.h>
|
||||
|
||||
fp_except_t
|
||||
fpsetmask(fp_except_t mask)
|
||||
{
|
||||
u_int64_t fpsr;
|
||||
u_int64_t oldmask;
|
||||
|
||||
__asm __volatile("mov %0=ar.fpsr" : "=r" (fpsr));
|
||||
oldmask = ~fpsr & 0x3d;
|
||||
fpsr = (fpsr & ~0x3d) | (~mask & 0x3d);
|
||||
__asm __volatile("mov ar.fpsr=%0" :: "r" (fpsr));
|
||||
return (oldmask);
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Marcel Moolenaar
|
||||
* 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 ``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 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.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <ieeefp.h>
|
||||
|
||||
fp_rnd_t
|
||||
fpsetround(fp_rnd_t rnd)
|
||||
{
|
||||
uint64_t fpsr;
|
||||
fp_rnd_t prev;
|
||||
|
||||
__asm __volatile("mov %0=ar.fpsr" : "=r"(fpsr));
|
||||
prev = (fp_rnd_t)((fpsr >> 10) & 3);
|
||||
fpsr = (fpsr & ~0xC00ULL) | ((unsigned int)rnd << 10);
|
||||
__asm __volatile("mov ar.fpsr=%0" :: "r"(fpsr));
|
||||
return (prev);
|
||||
}
|
@ -1,76 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2011 Konstantin Belousov <kib@FreeBSD.org>
|
||||
* 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 ``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 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 <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/ucontext.h>
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int
|
||||
__getcontextx_size(void)
|
||||
{
|
||||
|
||||
return (sizeof(ucontext_t));
|
||||
}
|
||||
|
||||
int
|
||||
__fillcontextx2(char *ctx)
|
||||
{
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
__fillcontextx(char *ctx)
|
||||
{
|
||||
ucontext_t *ucp;
|
||||
|
||||
ucp = (ucontext_t *)ctx;
|
||||
return (getcontext(ucp));
|
||||
}
|
||||
|
||||
__weak_reference(__getcontextx, getcontextx);
|
||||
|
||||
ucontext_t *
|
||||
__getcontextx(void)
|
||||
{
|
||||
char *ctx;
|
||||
int error;
|
||||
|
||||
ctx = malloc(__getcontextx_size());
|
||||
if (ctx == NULL)
|
||||
return (NULL);
|
||||
if (__fillcontextx(ctx) == -1) {
|
||||
error = errno;
|
||||
free(ctx);
|
||||
errno = error;
|
||||
return (NULL);
|
||||
}
|
||||
return ((ucontext_t *)ctx);
|
||||
}
|
@ -1,48 +0,0 @@
|
||||
/* $NetBSD: infinity.c,v 1.1 1995/02/10 17:50:23 cgd Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Author: Chris G. Demetriou
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and
|
||||
* its documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation.
|
||||
*
|
||||
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
|
||||
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
|
||||
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
|
||||
*
|
||||
* Carnegie Mellon requests users of this software to return to
|
||||
*
|
||||
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
|
||||
* School of Computer Science
|
||||
* Carnegie Mellon University
|
||||
* Pittsburgh PA 15213-3890
|
||||
*
|
||||
* any improvements or extensions that they make and grant Carnegie the
|
||||
* rights to redistribute these changes.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/endian.h>
|
||||
#include <math.h>
|
||||
|
||||
/* bytes for +Infinity on an ia64 (IEEE double format) */
|
||||
#if _BYTE_ORDER == _LITTLE_ENDIAN
|
||||
const union __infinity_un __infinity = { { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f } };
|
||||
#else /* _BIG_ENDIAN */
|
||||
const union __infinity_un __infinity = { { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 } };
|
||||
#endif
|
||||
|
||||
/* bytes for NaN */
|
||||
#if _BYTE_ORDER == _LITTLE_ENDIAN
|
||||
const union __nan_un __nan = { { 0, 0, 0xc0, 0xff } };
|
||||
#else /* _BIG_ENDIAN */
|
||||
const union __nan_un __nan = { { 0xff, 0xc0, 0, 0 } };
|
||||
#endif
|
@ -1,123 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Marcel Moolenaar
|
||||
* 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 ``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 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 <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/ucontext.h>
|
||||
#include <machine/fpu.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
struct fdesc {
|
||||
uint64_t ip;
|
||||
uint64_t gp;
|
||||
};
|
||||
|
||||
typedef void (*func_t)(uint64_t, uint64_t, uint64_t, uint64_t, uint64_t,
|
||||
uint64_t, uint64_t, uint64_t);
|
||||
|
||||
static __inline uint64_t *
|
||||
spill(uint64_t *bsp, uint64_t arg)
|
||||
{
|
||||
*bsp++ = arg;
|
||||
if (((intptr_t)bsp & 0x1ff) == 0x1f8)
|
||||
*bsp++ = 0;
|
||||
return (bsp);
|
||||
}
|
||||
|
||||
static void
|
||||
ctx_wrapper(ucontext_t *ucp, func_t func, uint64_t *args)
|
||||
{
|
||||
|
||||
(*func)(args[0], args[1], args[2], args[3], args[4], args[5], args[6],
|
||||
args[7]);
|
||||
if (ucp->uc_link == NULL)
|
||||
exit(0);
|
||||
setcontext((const ucontext_t *)ucp->uc_link);
|
||||
/* should never get here */
|
||||
abort();
|
||||
/* NOTREACHED */
|
||||
}
|
||||
|
||||
__weak_reference(__makecontext, makecontext);
|
||||
|
||||
void
|
||||
__makecontext(ucontext_t *ucp, void (*func)(void), int argc, ...)
|
||||
{
|
||||
uint64_t *args, *bsp;
|
||||
va_list ap;
|
||||
int i;
|
||||
|
||||
/*
|
||||
* Drop the ball completely if something's not right. We only
|
||||
* support general registers as arguments and not more than 8
|
||||
* of them. Things get hairy if we need to support FP registers
|
||||
* (alignment issues) or more than 8 arguments (stack based).
|
||||
*/
|
||||
if (argc < 0 || argc > 8 || ucp == NULL ||
|
||||
ucp->uc_stack.ss_sp == NULL || (ucp->uc_stack.ss_size & 15) ||
|
||||
((intptr_t)ucp->uc_stack.ss_sp & 15) ||
|
||||
ucp->uc_stack.ss_size < MINSIGSTKSZ)
|
||||
abort();
|
||||
|
||||
/*
|
||||
* Copy the arguments of function 'func' onto the (memory) stack.
|
||||
* Always take up space for 8 arguments.
|
||||
*/
|
||||
va_start(ap, argc);
|
||||
args = (uint64_t*)(ucp->uc_stack.ss_sp + ucp->uc_stack.ss_size) - 8;
|
||||
i = 0;
|
||||
while (i < argc)
|
||||
args[i++] = va_arg(ap, uint64_t);
|
||||
while (i < 8)
|
||||
args[i++] = 0;
|
||||
va_end(ap);
|
||||
|
||||
/*
|
||||
* Push (spill) the arguments of the context wrapper onto the register
|
||||
* stack. They get loaded by the RSE on a context switch.
|
||||
*/
|
||||
bsp = (uint64_t*)ucp->uc_stack.ss_sp;
|
||||
bsp = spill(bsp, (intptr_t)ucp);
|
||||
bsp = spill(bsp, (intptr_t)func);
|
||||
bsp = spill(bsp, (intptr_t)args);
|
||||
|
||||
/*
|
||||
* Setup the MD portion of the context.
|
||||
*/
|
||||
memset(&ucp->uc_mcontext, 0, sizeof(ucp->uc_mcontext));
|
||||
ucp->uc_mcontext.mc_special.sp = (intptr_t)args - 16;
|
||||
ucp->uc_mcontext.mc_special.bspstore = (intptr_t)bsp;
|
||||
ucp->uc_mcontext.mc_special.pfs = (3 << 7) | 3;
|
||||
ucp->uc_mcontext.mc_special.rsc = 0xf;
|
||||
ucp->uc_mcontext.mc_special.rp = ((struct fdesc*)ctx_wrapper)->ip;
|
||||
ucp->uc_mcontext.mc_special.gp = ((struct fdesc*)ctx_wrapper)->gp;
|
||||
ucp->uc_mcontext.mc_special.fpsr = IA64_FPSR_DEFAULT;
|
||||
}
|
@ -1,82 +0,0 @@
|
||||
/* $NetBSD: setjmp.S,v 1.3 1997/12/05 02:06:27 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Author: Chris G. Demetriou
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and
|
||||
* its documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation.
|
||||
*
|
||||
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
|
||||
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
|
||||
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
|
||||
*
|
||||
* Carnegie Mellon requests users of this software to return to
|
||||
*
|
||||
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
|
||||
* School of Computer Science
|
||||
* Carnegie Mellon University
|
||||
* Pittsburgh PA 15213-3890
|
||||
*
|
||||
* any improvements or extensions that they make and grant Carnegie the
|
||||
* rights to redistribute these changes.
|
||||
*/
|
||||
|
||||
#include <machine/asm.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#define LOCORE
|
||||
#include <machine/setjmp.h>
|
||||
|
||||
/*
|
||||
* C library -- setjmp, longjmp
|
||||
*
|
||||
* longjmp(a,v)
|
||||
* will generate a "return(v)" from
|
||||
* the last call to
|
||||
* setjmp(a)
|
||||
* by restoring registers from the stack,
|
||||
* and the previous signal state.
|
||||
*/
|
||||
|
||||
ENTRY(setjmp, 1)
|
||||
alloc loc0=ar.pfs,1,2,3,0
|
||||
mov loc1=rp
|
||||
;;
|
||||
mov out0=1 // how = SIG_BLOCK
|
||||
mov out1=0 // set = NULL
|
||||
add out2=J_SIGSET,in0 // oset = &jb[J_SIGSET]
|
||||
br.call.sptk.few rp=__sys_sigprocmask
|
||||
;;
|
||||
mov rp=loc1
|
||||
mov r14=loc0
|
||||
;;
|
||||
alloc r15=ar.pfs,1,0,0,0 // drop register frame
|
||||
;;
|
||||
mov ar.pfs=r14 // restore ar.pfs
|
||||
br.sptk.many _setjmp // finish saving state
|
||||
END(setjmp)
|
||||
|
||||
WEAK_ALIAS(longjmp,__longjmp)
|
||||
ENTRY(__longjmp, 2)
|
||||
alloc loc0=ar.pfs,2,2,3,0
|
||||
mov loc1=rp
|
||||
;;
|
||||
mov out0=3 // how = SIG_SETMASK
|
||||
add out1=J_SIGSET,in0 // set = &jb[J_SIGSET]
|
||||
mov out2=0 // oset = NULL
|
||||
br.call.sptk.few rp=__sys_sigprocmask
|
||||
;;
|
||||
mov rp=loc1
|
||||
mov r14=loc0
|
||||
;;
|
||||
alloc r15=ar.pfs,2,0,0,0 // drop register frame
|
||||
;;
|
||||
mov ar.pfs=r14 // restore ar.pfs
|
||||
br.sptk.many _longjmp // finish restoring state
|
||||
END(__longjmp)
|
@ -1,123 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Marcel Moolenaar
|
||||
* 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 ``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 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 <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/ucontext.h>
|
||||
#include <machine/fpu.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
|
||||
struct fdesc {
|
||||
uint64_t ip;
|
||||
uint64_t gp;
|
||||
};
|
||||
|
||||
typedef void (*handler_t)(uint64_t, uint64_t, uint64_t);
|
||||
|
||||
static __inline uint64_t *
|
||||
spill(uint64_t *bsp, uint64_t arg)
|
||||
{
|
||||
*bsp++ = arg;
|
||||
if (((intptr_t)bsp & 0x1ff) == 0x1f8)
|
||||
*bsp++ = 0;
|
||||
return (bsp);
|
||||
}
|
||||
|
||||
static void
|
||||
ctx_wrapper(ucontext_t *ucp, handler_t func, uint64_t *args)
|
||||
{
|
||||
|
||||
(*func)(args[0], args[1], args[2]);
|
||||
if (ucp->uc_link == NULL)
|
||||
exit(0);
|
||||
setcontext((const ucontext_t *)ucp->uc_link);
|
||||
/* should never get here */
|
||||
abort();
|
||||
/* NOTREACHED */
|
||||
}
|
||||
|
||||
__weak_reference(__signalcontext, signalcontext);
|
||||
|
||||
int
|
||||
__signalcontext(ucontext_t *ucp, int sig, __sighandler_t *func)
|
||||
{
|
||||
uint64_t *args, *bsp;
|
||||
siginfo_t *sig_si;
|
||||
ucontext_t *sig_uc;
|
||||
uint64_t sp;
|
||||
|
||||
/* Bail out if we don't have a valid ucontext pointer. */
|
||||
if (ucp == NULL)
|
||||
abort();
|
||||
|
||||
/*
|
||||
* Build a signal frame and copy the arguments of signal handler
|
||||
* 'func' onto the (memory) stack. We only need 3 arguments, but
|
||||
* we create room for 4 so that we are 16-byte aligned.
|
||||
*/
|
||||
sp = (ucp->uc_mcontext.mc_special.sp - sizeof(ucontext_t)) & ~15UL;
|
||||
sig_uc = (ucontext_t*)sp;
|
||||
bcopy(ucp, sig_uc, sizeof(*sig_uc));
|
||||
sp = (sp - sizeof(siginfo_t)) & ~15UL;
|
||||
sig_si = (siginfo_t*)sp;
|
||||
bzero(sig_si, sizeof(*sig_si));
|
||||
sig_si->si_signo = sig;
|
||||
sp -= 4 * sizeof(uint64_t);
|
||||
args = (uint64_t*)sp;
|
||||
args[0] = sig;
|
||||
args[1] = (intptr_t)sig_si;
|
||||
args[2] = (intptr_t)sig_uc;
|
||||
|
||||
/*
|
||||
* Push (spill) the arguments of the context wrapper onto the register
|
||||
* stack. They get loaded by the RSE on a context switch.
|
||||
*/
|
||||
bsp = (uint64_t*)ucp->uc_mcontext.mc_special.bspstore;
|
||||
bsp = spill(bsp, (intptr_t)ucp);
|
||||
bsp = spill(bsp, (intptr_t)func);
|
||||
bsp = spill(bsp, (intptr_t)args);
|
||||
|
||||
/*
|
||||
* Setup the ucontext of the signal handler.
|
||||
*/
|
||||
memset(&ucp->uc_mcontext, 0, sizeof(ucp->uc_mcontext));
|
||||
ucp->uc_link = sig_uc;
|
||||
sigdelset(&ucp->uc_sigmask, sig);
|
||||
ucp->uc_mcontext.mc_special.sp = (intptr_t)args - 16;
|
||||
ucp->uc_mcontext.mc_special.bspstore = (intptr_t)bsp;
|
||||
ucp->uc_mcontext.mc_special.pfs = (3 << 7) | 3;
|
||||
ucp->uc_mcontext.mc_special.rsc = 0xf;
|
||||
ucp->uc_mcontext.mc_special.rp = ((struct fdesc*)ctx_wrapper)->ip;
|
||||
ucp->uc_mcontext.mc_special.gp = ((struct fdesc*)ctx_wrapper)->gp;
|
||||
ucp->uc_mcontext.mc_special.fpsr = IA64_FPSR_DEFAULT;
|
||||
return (0);
|
||||
}
|
@ -1,66 +0,0 @@
|
||||
/* $NetBSD: sigsetjmp.S,v 1.2 1996/10/17 03:08:07 cgd Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Author: Chris G. Demetriou
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and
|
||||
* its documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation.
|
||||
*
|
||||
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
|
||||
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
|
||||
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
|
||||
*
|
||||
* Carnegie Mellon requests users of this software to return to
|
||||
*
|
||||
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
|
||||
* School of Computer Science
|
||||
* Carnegie Mellon University
|
||||
* Pittsburgh PA 15213-3890
|
||||
*
|
||||
* any improvements or extensions that they make and grant Carnegie the
|
||||
* rights to redistribute these changes.
|
||||
*/
|
||||
|
||||
#include <machine/asm.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#define LOCORE
|
||||
#include <machine/setjmp.h>
|
||||
|
||||
/*
|
||||
* C library -- sigsetjmp, siglongjmp
|
||||
*
|
||||
* siglongjmp(a,v)
|
||||
* will generate a "return(v)" from
|
||||
* the last call to
|
||||
* sigsetjmp(a, mask)
|
||||
* by restoring registers from the stack.
|
||||
* If `mask' is non-zero, the previous signal
|
||||
* state will be restored.
|
||||
*/
|
||||
|
||||
ENTRY(sigsetjmp, 2)
|
||||
add r14=J_SIGMASK,in0 // place to save mask
|
||||
cmp.ne p6,p7=0,in1 // save signal state?
|
||||
;;
|
||||
st8 [r14]=in1 // save mask value
|
||||
(p6) br.cond.dptk.many setjmp
|
||||
(p7) br.cond.dpnt.many _setjmp
|
||||
END(sigsetjmp)
|
||||
|
||||
WEAK_ALIAS(siglongjmp,__siglongjmp)
|
||||
ENTRY(__siglongjmp, 2)
|
||||
add r14=J_SIGMASK,in0 // address of mask value
|
||||
;;
|
||||
ld8 r14=[r14]
|
||||
;;
|
||||
cmp.ne p6,p7=0,r14 // did we save signals?
|
||||
(p6) br.cond.dptk.many longjmp
|
||||
(p7) br.cond.dpnt.many _longjmp
|
||||
END(__siglongjmp)
|
@ -1,129 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2002 Marcel Moolenaar
|
||||
* 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 ``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 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.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <dlfcn.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <machine/elf.h>
|
||||
|
||||
#ifndef PT_IA_64_UNWIND
|
||||
#define PT_IA_64_UNWIND 0x70000001
|
||||
#endif
|
||||
|
||||
#define SANITY 0
|
||||
|
||||
struct ia64_unwind_entry
|
||||
{
|
||||
Elf64_Addr start;
|
||||
Elf64_Addr end;
|
||||
Elf64_Addr descr;
|
||||
};
|
||||
|
||||
struct ia64_unwind_entry *
|
||||
_Unwind_FindTableEntry(const void *pc, unsigned long *pseg, unsigned long *pgp)
|
||||
{
|
||||
Dl_info info;
|
||||
Elf_Dyn *dyn;
|
||||
Elf_Ehdr *ehdr;
|
||||
Elf_Phdr *phdr;
|
||||
char *p, *p_top;
|
||||
struct ia64_unwind_entry *unw, *res;
|
||||
register unsigned long gp __asm__("gp"); /* XXX assumes gcc */
|
||||
unsigned long reloc, vaddr;
|
||||
size_t l, m, r;
|
||||
|
||||
if (!dladdr(pc, &info))
|
||||
return NULL;
|
||||
|
||||
ehdr = (Elf_Ehdr*)info.dli_fbase;
|
||||
|
||||
#if SANITY
|
||||
assert(IS_ELF(*ehdr));
|
||||
assert(ehdr->e_ident[EI_CLASS] == ELFCLASS64);
|
||||
assert(ehdr->e_ident[EI_DATA] == ELFDATA2LSB);
|
||||
assert(ehdr->e_machine == EM_IA_64);
|
||||
#endif
|
||||
|
||||
reloc = (ehdr->e_type == ET_DYN) ? (uintptr_t)info.dli_fbase : 0;
|
||||
*pgp = gp;
|
||||
*pseg = 0UL;
|
||||
res = NULL;
|
||||
|
||||
p = (char*)info.dli_fbase + ehdr->e_phoff;
|
||||
p_top = p + ehdr->e_phnum * ehdr->e_phentsize;
|
||||
while (p < p_top) {
|
||||
phdr = (Elf_Phdr*)p;
|
||||
vaddr = phdr->p_vaddr + reloc;
|
||||
|
||||
switch (phdr->p_type) {
|
||||
case PT_DYNAMIC:
|
||||
dyn = (Elf_Dyn*)vaddr;
|
||||
while (dyn->d_tag != DT_NULL) {
|
||||
if (dyn->d_tag == DT_PLTGOT) {
|
||||
*pgp = dyn->d_un.d_ptr + reloc;
|
||||
break;
|
||||
}
|
||||
dyn++;
|
||||
}
|
||||
break;
|
||||
case PT_LOAD:
|
||||
if (pc >= (void*)vaddr &&
|
||||
pc < (void*)(vaddr + phdr->p_memsz))
|
||||
*pseg = vaddr;
|
||||
break;
|
||||
case PT_IA_64_UNWIND:
|
||||
#if SANITY
|
||||
assert(*pseg != 0UL);
|
||||
assert(res == NULL);
|
||||
#endif
|
||||
unw = (struct ia64_unwind_entry*)vaddr;
|
||||
l = 0;
|
||||
r = phdr->p_memsz / sizeof(struct ia64_unwind_entry);
|
||||
while (l < r) {
|
||||
m = (l + r) >> 1;
|
||||
res = unw + m;
|
||||
if (pc < (void*)(res->start + *pseg))
|
||||
r = m;
|
||||
else if (pc >= (void*)(res->end + *pseg))
|
||||
l = m + 1;
|
||||
else
|
||||
break; /* found */
|
||||
}
|
||||
if (l >= r)
|
||||
res = NULL;
|
||||
break;
|
||||
}
|
||||
|
||||
p += ehdr->e_phentsize;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
# $FreeBSD$
|
||||
|
||||
MDSRCS+= bcopy.S bzero.S ffs.S memcpy.S memmove.S
|
@ -1,95 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 2000 Doug Rabson
|
||||
* 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$");
|
||||
|
||||
/*
|
||||
* Not the fastest bcopy in the world.
|
||||
*/
|
||||
ENTRY(bcopy, 3)
|
||||
|
||||
cmp.le p6,p0=in2,r0 // bail if len <= 0
|
||||
(p6) br.ret.spnt.few rp
|
||||
|
||||
sub r14=in1,in0 ;; // check for overlap
|
||||
cmp.ltu p6,p0=r14,in2 // dst-src < len
|
||||
(p6) br.cond.spnt.few 5f
|
||||
|
||||
extr.u r14=in0,0,3 // src & 7
|
||||
extr.u r15=in1,0,3 ;; // dst & 7
|
||||
cmp.eq p6,p0=r14,r15 // different alignment?
|
||||
(p6) br.cond.spnt.few 2f // branch if same alignment
|
||||
|
||||
1: ld1 r14=[in0],1 ;; // copy bytewise
|
||||
st1 [in1]=r14,1
|
||||
add in2=-1,in2 ;; // len--
|
||||
cmp.ne p6,p0=r0,in2
|
||||
(p6) br.cond.dptk.few 1b // loop
|
||||
br.ret.sptk.few rp // done
|
||||
|
||||
2: cmp.eq p6,p0=r14,r0 // aligned?
|
||||
(p6) br.cond.sptk.few 4f
|
||||
|
||||
3: ld1 r14=[in0],1 ;; // copy bytewise
|
||||
st1 [in1]=r14,1
|
||||
extr.u r15=in0,0,3 // src & 7
|
||||
add in2=-1,in2 ;; // len--
|
||||
cmp.eq p6,p0=r0,in2 // done?
|
||||
cmp.eq p7,p0=r0,r15 ;; // aligned now?
|
||||
(p6) br.ret.spnt.few rp // return if done
|
||||
(p7) br.cond.spnt.few 4f // go to main copy
|
||||
br.cond.sptk.few 3b // more bytes to copy
|
||||
|
||||
// At this point, in2 is non-zero
|
||||
|
||||
4: mov r14=8 ;;
|
||||
cmp.ltu p6,p0=in2,r14 ;; // len < 8?
|
||||
(p6) br.cond.spnt.few 1b // byte copy the end
|
||||
ld8 r15=[in0],8 ;; // copy word
|
||||
st8 [in1]=r15,8
|
||||
add in2=-8,in2 ;; // len -= 8
|
||||
cmp.ne p6,p0=r0,in2 // done?
|
||||
(p6) br.cond.spnt.few 4b // again
|
||||
|
||||
br.ret.sptk.few rp // return
|
||||
|
||||
// Don't bother optimising overlap case
|
||||
|
||||
5: add in0=in0,in2
|
||||
add in1=in1,in2 ;;
|
||||
add in0=-1,in0
|
||||
add in1=-1,in1 ;;
|
||||
|
||||
6: ld1 r14=[in0],-1 ;;
|
||||
st1 [in1]=r14,-1
|
||||
add in2=-1,in2 ;;
|
||||
cmp.ne p6,p0=r0,in2
|
||||
(p6) br.cond.spnt.few 6b
|
||||
|
||||
br.ret.sptk.few rp
|
||||
|
||||
END(bcopy)
|
@ -1,81 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 2000 Doug Rabson
|
||||
* 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$");
|
||||
|
||||
ENTRY(bzero, 2)
|
||||
|
||||
cmp.le p6,p0=in1,r0 // bail if len <= 0
|
||||
(p6) br.ret.spnt.few rp
|
||||
;;
|
||||
mov r14=ar.lc // save ar.lc
|
||||
|
||||
cmp.ltu p6,p0=17,in1 // check for small
|
||||
(p6) br.dptk.few 3f
|
||||
|
||||
1: add r15=-1,in1 ;;
|
||||
mov ar.lc=r15 ;;
|
||||
2: st1 [in0]=r0,1 // zero one byte
|
||||
br.cloop.sptk.few 2b // loop
|
||||
|
||||
;;
|
||||
mov ar.lc=r14 // done
|
||||
br.ret.sptk.few rp
|
||||
|
||||
// Zero up to 8byte alignment
|
||||
|
||||
3: tbit.nz p6,p0=in0,0 ;;
|
||||
(p6) st1 [in0]=r0,1
|
||||
(p6) add in1=-1,in1 ;;
|
||||
|
||||
tbit.nz p6,p0=in0,1 ;;
|
||||
(p6) st2 [in0]=r0,2
|
||||
(p6) add in1=-2,in1 ;;
|
||||
|
||||
tbit.nz p6,p0=in0,2 ;;
|
||||
(p6) st4 [in0]=r0,4
|
||||
(p6) add in1=-4,in1
|
||||
|
||||
;;
|
||||
shr.u r15=in1,3 // word count
|
||||
extr.u in1=in1,0,3 ;; // trailing bytes
|
||||
cmp.eq p6,p0=r15,r0 // check for zero
|
||||
cmp.ne p7,p0=in1,r0
|
||||
(p6) br.dpnt.few 1b // zero last bytes
|
||||
|
||||
add r15=-1,r15 ;;
|
||||
mov ar.lc=r15 ;;
|
||||
4: st8 [in0]=r0,8
|
||||
br.cloop.sptk.few 4b
|
||||
|
||||
(p7) br.dpnt.few 1b // zero last bytes
|
||||
|
||||
;;
|
||||
mov ar.lc=r14 // done
|
||||
br.ret.sptk.few rp
|
||||
|
||||
END(bzero)
|
@ -1,99 +0,0 @@
|
||||
/* $NetBSD: ffs.S,v 1.3 1996/10/17 03:08:13 cgd Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1995 Christopher G. Demetriou
|
||||
* 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.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by Christopher G. Demetriou
|
||||
* for the NetBSD Project.
|
||||
* 4. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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$");
|
||||
|
||||
ENTRY(ffs, 1)
|
||||
sxt4 r14=in0 ;;
|
||||
cmp.eq p6,p0=r14,r0
|
||||
(p6) br.dpnt.few Lallzero
|
||||
|
||||
/*
|
||||
* Initialize return value (ret0), and set up r15 so that it
|
||||
* contains the mask with only the lowest bit set.
|
||||
*/
|
||||
sub r15=r0,r14
|
||||
mov ret0=1 ;;
|
||||
and r15=r14,r15 ;;
|
||||
|
||||
extr.u r16=r15,0,8 ;;
|
||||
cmp.ne p6,p0=r0,r16
|
||||
(p6) br.dptk.few Ldo8
|
||||
|
||||
/*
|
||||
* If lower 16 bits empty, add 16 to result and use upper 16.
|
||||
*/
|
||||
extr.u r16=r15,0,16 ;;
|
||||
cmp.ne p6,p0=r0,r16
|
||||
(p6) br.dptk.few Ldo16
|
||||
extr.u r15=r15,16,16
|
||||
add ret0=16,ret0 ;;
|
||||
|
||||
Ldo16:
|
||||
/*
|
||||
* If lower 8 bits empty, add 8 to result and use upper 8.
|
||||
*/
|
||||
extr.u r16=r15,0,8 ;;
|
||||
cmp.ne p6,p0=r0,r16
|
||||
(p6) br.dptk.few Ldo8
|
||||
extr.u r15=r15,8,24
|
||||
add ret0=8,ret0 ;;
|
||||
|
||||
Ldo8:
|
||||
and r16=0x0f,r15 /* lower 4 of 8 empty? */
|
||||
and r17=0x33,r15 /* lower 2 of each 4 empty? */
|
||||
and r18=0x55,r15 ;; /* lower 1 of each 2 empty? */
|
||||
cmp.ne p6,p0=r16,r0
|
||||
cmp.ne p7,p0=r17,r0
|
||||
cmp.ne p8,p0=r18,r0
|
||||
|
||||
/* If lower 4 bits empty, add 4 to result. */
|
||||
(p6) br.dptk.few Ldo4
|
||||
add ret0=4,ret0 ;;
|
||||
|
||||
Ldo4: /* If lower 2 bits of each 4 empty, add 2 to result. */
|
||||
(p7) br.dptk.few Ldo2
|
||||
add ret0=2,ret0 ;;
|
||||
|
||||
Ldo2: /* If lower bit of each 2 empty, add 1 to result. */
|
||||
(p8) br.dptk.few Ldone
|
||||
add ret0=1,ret0
|
||||
|
||||
Ldone:
|
||||
br.ret.sptk.few rp
|
||||
|
||||
Lallzero:
|
||||
mov ret0=0
|
||||
br.ret.sptk.few rp
|
||||
END(ffs)
|
@ -1,36 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 2000 Doug Rabson
|
||||
* 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$");
|
||||
|
||||
ENTRY(memcpy,3)
|
||||
mov r8 = in0
|
||||
mov in0 = in1
|
||||
;;
|
||||
mov in1 = r8
|
||||
br.sptk.few bcopy
|
||||
END(memcpy)
|
@ -1,36 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 2000 Doug Rabson
|
||||
* 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$");
|
||||
|
||||
ENTRY(memmove,3)
|
||||
mov r8 = in0
|
||||
mov in0 = in1
|
||||
;;
|
||||
mov in1 = r8
|
||||
br.sptk.few bcopy
|
||||
END(memmove)
|
@ -1,14 +0,0 @@
|
||||
# $FreeBSD$
|
||||
|
||||
SRCS+= __vdso_gettc.c
|
||||
|
||||
MDASM+= Ovfork.S brk.S cerror.S exect.S fork.S getcontext.S pipe.S ptrace.S \
|
||||
sbrk.S setlogin.S sigreturn.S swapcontext.S
|
||||
|
||||
# Don't generate default code for these syscalls:
|
||||
NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o vfork.o yield.o
|
||||
|
||||
PSEUDO= _getlogin.o _exit.o
|
||||
.if ${MK_SYSCALL_COMPAT} != "no"
|
||||
PSEUDO+= _pread.o _pwrite.o _lseek.o _mmap.o _ftruncate.o _truncate.o
|
||||
.endif
|
@ -1,37 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 2000 Doug Rabson
|
||||
* 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$");
|
||||
|
||||
#include "SYS.h"
|
||||
|
||||
SYSCALL(vfork)
|
||||
cmp.ne p7,p0=ret1,r0 /* ret1!=0 for child */
|
||||
;;
|
||||
(p7) mov ret0=r0
|
||||
br.ret.sptk.few rp
|
||||
END(__sys_vfork)
|
@ -1,48 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 2013 Konstantin Belousov <kib@FreeBSD.org>
|
||||
*
|
||||
* 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 <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/vdso.h>
|
||||
#include <errno.h>
|
||||
|
||||
#pragma weak __vdso_gettc
|
||||
u_int
|
||||
__vdso_gettc(const struct vdso_timehands *th)
|
||||
{
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
#pragma weak __vdso_gettimekeep
|
||||
int
|
||||
__vdso_gettimekeep(struct vdso_timekeep **tk)
|
||||
{
|
||||
|
||||
return (ENOSYS);
|
||||
}
|
@ -1,57 +0,0 @@
|
||||
/* $NetBSD: brk.S,v 1.4 1996/10/17 03:08:15 cgd Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Author: Chris G. Demetriou
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and
|
||||
* its documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation.
|
||||
*
|
||||
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
|
||||
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
|
||||
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
|
||||
*
|
||||
* Carnegie Mellon requests users of this software to return to
|
||||
*
|
||||
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
|
||||
* School of Computer Science
|
||||
* Carnegie Mellon University
|
||||
* Pittsburgh PA 15213-3890
|
||||
*
|
||||
* any improvements or extensions that they make and grant Carnegie the
|
||||
* rights to redistribute these changes.
|
||||
*/
|
||||
|
||||
#include <machine/asm.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include "SYS.h"
|
||||
|
||||
.globl _end
|
||||
IMPORT(curbrk, 8)
|
||||
|
||||
.data
|
||||
EXPORT(minbrk)
|
||||
.quad _end
|
||||
|
||||
.text
|
||||
ENTRY(brk, 1)
|
||||
add r14=@ltoff(minbrk),gp ;;
|
||||
ld8 r14=[r14] ;;
|
||||
ld8 r14=[r14] ;;
|
||||
cmp.ltu p6,p0=r32,r14 ;;
|
||||
(p6) mov r32=r14 ;;
|
||||
st8 [sp]=r32
|
||||
CALLSYS_ERROR(break)
|
||||
ld8 r15=[sp]
|
||||
add r14=@ltoff(curbrk),gp ;;
|
||||
ld8 r14=[r14] ;;
|
||||
st8 [r14]=r15
|
||||
mov ret0=0
|
||||
br.ret.sptk.few rp
|
||||
END(brk)
|
@ -1,46 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 2000 Doug Rabson
|
||||
* 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$");
|
||||
|
||||
|
||||
ENTRY(.cerror, 0)
|
||||
alloc loc0=ar.pfs,0,3,1,0
|
||||
;;
|
||||
mov loc1=rp
|
||||
mov loc2=ret0
|
||||
mov out0=ret0
|
||||
;;
|
||||
br.call.sptk.few rp=__error
|
||||
st4 [ret0]=loc2
|
||||
;;
|
||||
mov ret0=-1
|
||||
mov ar.pfs=loc0
|
||||
mov rp=loc1
|
||||
;;
|
||||
br.ret.sptk.few rp
|
||||
END(.cerror)
|
@ -1,38 +0,0 @@
|
||||
/* $NetBSD: exect.S,v 1.2 1996/10/17 03:08:18 cgd Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Author: Chris G. Demetriou
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and
|
||||
* its documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation.
|
||||
*
|
||||
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
|
||||
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
|
||||
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
|
||||
*
|
||||
* Carnegie Mellon requests users of this software to return to
|
||||
*
|
||||
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
|
||||
* School of Computer Science
|
||||
* Carnegie Mellon University
|
||||
* Pittsburgh PA 15213-3890
|
||||
*
|
||||
* any improvements or extensions that they make and grant Carnegie the
|
||||
* rights to redistribute these changes.
|
||||
*/
|
||||
|
||||
#include <machine/asm.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include "SYS.h"
|
||||
|
||||
ENTRY(exect, 3)
|
||||
CALLSYS_ERROR(execve)
|
||||
br.ret.sptk.few rp
|
||||
END(exect)
|
@ -1,37 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 2000 Doug Rabson
|
||||
* 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$");
|
||||
|
||||
#include "SYS.h"
|
||||
|
||||
SYSCALL(fork)
|
||||
cmp.ne p7,p0=ret1,r0 /* ret1!=0 for child */
|
||||
;;
|
||||
(p7) mov ret0=r0
|
||||
br.ret.sptk.few rp
|
||||
END(__sys_fork)
|
@ -1,39 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Marcel Moolenaar
|
||||
* 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 ``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 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$");
|
||||
|
||||
#include "SYS.h"
|
||||
|
||||
ENTRY(__sys_getcontext,2)
|
||||
WEAK_ALIAS(getcontext, __sys_getcontext)
|
||||
WEAK_ALIAS(_getcontext, __sys_getcontext)
|
||||
flushrs
|
||||
;;
|
||||
CALLSYS_ERROR(getcontext)
|
||||
br.ret.sptk.few rp
|
||||
END(__sys_getcontext)
|
@ -1,47 +0,0 @@
|
||||
/* $NetBSD: pipe.S,v 1.1 1995/02/10 17:50:35 cgd Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Author: Chris G. Demetriou
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and
|
||||
* its documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation.
|
||||
*
|
||||
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
|
||||
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
|
||||
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
|
||||
*
|
||||
* Carnegie Mellon requests users of this software to return to
|
||||
*
|
||||
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
|
||||
* School of Computer Science
|
||||
* Carnegie Mellon University
|
||||
* Pittsburgh PA 15213-3890
|
||||
*
|
||||
* any improvements or extensions that they make and grant Carnegie the
|
||||
* rights to redistribute these changes.
|
||||
*/
|
||||
|
||||
#include <machine/asm.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include "SYS.h"
|
||||
|
||||
ENTRY(__sys_pipe, 1)
|
||||
WEAK_ALIAS(pipe, __sys_pipe)
|
||||
WEAK_ALIAS(_pipe, __sys_pipe)
|
||||
st8 [sp]=r32
|
||||
CALLSYS_ERROR(pipe)
|
||||
ld8 r14=[sp]
|
||||
;;
|
||||
st4 [r14]=ret0,4
|
||||
;;
|
||||
st4 [r14]=ret1
|
||||
mov ret0=0
|
||||
br.ret.sptk.few rp
|
||||
END(__sys_pipe)
|
@ -1,41 +0,0 @@
|
||||
/* $NetBSD: ptrace.S,v 1.4 1996/11/08 00:51:24 cgd Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Author: Chris G. Demetriou
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and
|
||||
* its documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation.
|
||||
*
|
||||
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
|
||||
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
|
||||
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
|
||||
*
|
||||
* Carnegie Mellon requests users of this software to return to
|
||||
*
|
||||
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
|
||||
* School of Computer Science
|
||||
* Carnegie Mellon University
|
||||
* Pittsburgh PA 15213-3890
|
||||
*
|
||||
* any improvements or extensions that they make and grant Carnegie the
|
||||
* rights to redistribute these changes.
|
||||
*/
|
||||
|
||||
#include <machine/asm.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include "SYS.h"
|
||||
|
||||
ENTRY(ptrace, 4)
|
||||
add r14=@ltoff(errno),gp ;;
|
||||
ld8 r14=[r14] ;;
|
||||
st4 [r14]=r0
|
||||
CALLSYS_ERROR(ptrace)
|
||||
br.ret.sptk.few rp
|
||||
END(ptrace)
|
@ -1,63 +0,0 @@
|
||||
/* $NetBSD: sbrk.S,v 1.4 1996/10/17 03:08:20 cgd Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Author: Chris G. Demetriou
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and
|
||||
* its documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation.
|
||||
*
|
||||
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
|
||||
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
|
||||
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
|
||||
*
|
||||
* Carnegie Mellon requests users of this software to return to
|
||||
*
|
||||
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
|
||||
* School of Computer Science
|
||||
* Carnegie Mellon University
|
||||
* Pittsburgh PA 15213-3890
|
||||
*
|
||||
* any improvements or extensions that they make and grant Carnegie the
|
||||
* rights to redistribute these changes.
|
||||
*/
|
||||
|
||||
#include <machine/asm.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include "SYS.h"
|
||||
|
||||
.globl _end
|
||||
|
||||
.data
|
||||
EXPORT(curbrk)
|
||||
.quad _end
|
||||
|
||||
.text
|
||||
ENTRY(sbrk, 1)
|
||||
add r14 = @ltoff(curbrk), gp
|
||||
;;
|
||||
ld8 r14 = [r14]
|
||||
cmp.eq p6, p0 = r32, r0
|
||||
;;
|
||||
ld8 ret0 = [r14]
|
||||
(p6) br.ret.sptk.few rp
|
||||
;;
|
||||
add r32 = ret0, r32
|
||||
;;
|
||||
st8 [sp] = r32
|
||||
CALLSYS_ERROR(break)
|
||||
ld8 r15 = [sp]
|
||||
add r14 = @ltoff(curbrk), gp
|
||||
;;
|
||||
ld8 r14 = [r14]
|
||||
;;
|
||||
ld8 ret0 = [r14]
|
||||
st8 [r14] = r15
|
||||
br.ret.sptk.few rp
|
||||
END(sbrk)
|
@ -1,42 +0,0 @@
|
||||
/* $NetBSD: setlogin.S,v 1.1 1995/02/10 17:50:39 cgd Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Author: Chris G. Demetriou
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and
|
||||
* its documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation.
|
||||
*
|
||||
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
|
||||
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
|
||||
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
|
||||
*
|
||||
* Carnegie Mellon requests users of this software to return to
|
||||
*
|
||||
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
|
||||
* School of Computer Science
|
||||
* Carnegie Mellon University
|
||||
* Pittsburgh PA 15213-3890
|
||||
*
|
||||
* any improvements or extensions that they make and grant Carnegie the
|
||||
* rights to redistribute these changes.
|
||||
*/
|
||||
|
||||
#include <machine/asm.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include "SYS.h"
|
||||
|
||||
IMPORT(_logname_valid, 4) /* in getlogin() */
|
||||
|
||||
SYSCALL(setlogin)
|
||||
add r14=@ltoff(_logname_valid),gp ;;
|
||||
ld8 r14=[r14] ;;
|
||||
st4 [r14]=r0 /* clear it */
|
||||
br.ret.sptk.few rp
|
||||
END(__sys_setlogin)
|
@ -1,41 +0,0 @@
|
||||
/* $NetBSD: sigreturn.S,v 1.1 1995/02/10 17:50:42 cgd Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Author: Chris G. Demetriou
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and
|
||||
* its documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation.
|
||||
*
|
||||
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
|
||||
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
|
||||
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
|
||||
*
|
||||
* Carnegie Mellon requests users of this software to return to
|
||||
*
|
||||
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
|
||||
* School of Computer Science
|
||||
* Carnegie Mellon University
|
||||
* Pittsburgh PA 15213-3890
|
||||
*
|
||||
* any improvements or extensions that they make and grant Carnegie the
|
||||
* rights to redistribute these changes.
|
||||
*/
|
||||
|
||||
#include <machine/asm.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include "SYS.h"
|
||||
|
||||
/*
|
||||
* We must preserve the state of the registers as the user has set them up.
|
||||
* However, that doesn't involve any special work on the ia64.
|
||||
* (XXX PROFILING)
|
||||
*/
|
||||
|
||||
RSYSCALL(sigreturn)
|
@ -1,39 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Marcel Moolenaar
|
||||
* 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 ``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 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$");
|
||||
|
||||
#include "SYS.h"
|
||||
|
||||
ENTRY(__sys_swapcontext,2)
|
||||
WEAK_ALIAS(swapcontext, __sys_swapcontext)
|
||||
WEAK_ALIAS(_swapcontext, __sys_swapcontext)
|
||||
flushrs
|
||||
;;
|
||||
CALLSYS_ERROR(swapcontext)
|
||||
br.ret.sptk.few rp
|
||||
END(__sys_swapcontext)
|
@ -18,9 +18,6 @@
|
||||
#define Double_Align
|
||||
#else
|
||||
/* TODO: Generate these values on a LE machine */
|
||||
/* Current values were stolen from ia64 except the
|
||||
* Xpointer define.
|
||||
*/
|
||||
#define IEEE_8087
|
||||
#define Arith_Kind_ASL 1
|
||||
#define Long int
|
||||
|
@ -63,7 +63,7 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#if defined(__m68k__) || defined(__sparc__) || defined(__i386__) || \
|
||||
defined(__mips__) || defined(__ns32k__) || defined(__alpha__) || \
|
||||
defined(__arm__) || defined(__ppc__) || defined(__ia64__) || \
|
||||
defined(__arm__) || defined(__ppc__) || \
|
||||
defined(__arm26__) || defined(__sparc64__) || defined(__amd64__)
|
||||
#include <machine/endian.h>
|
||||
#define IEEEFP
|
||||
|
@ -81,7 +81,7 @@ struct vmstate {
|
||||
/*
|
||||
* Map the ELF headers into the process' address space. We do this in two
|
||||
* steps: first the ELF header itself and using that information the whole
|
||||
* set of headers. (Taken from kvm_ia64.c)
|
||||
* set of headers.
|
||||
*/
|
||||
static int
|
||||
_kvm_maphdrs(kvm_t *kd, size_t sz)
|
||||
@ -105,7 +105,6 @@ _kvm_maphdrs(kvm_t *kd, size_t sz)
|
||||
|
||||
/*
|
||||
* Translate a physical memory address to a file-offset in the crash-dump.
|
||||
* (Taken from kvm_ia64.c)
|
||||
*/
|
||||
static size_t
|
||||
_kvm_pa2off(kvm_t *kd, uint64_t pa, off_t *ofs)
|
||||
|
@ -87,7 +87,7 @@ struct vmstate {
|
||||
/*
|
||||
* Map the ELF headers into the process' address space. We do this in two
|
||||
* steps: first the ELF header itself and using that information the whole
|
||||
* set of headers. (Taken from kvm_ia64.c)
|
||||
* set of headers.
|
||||
*/
|
||||
static int
|
||||
_kvm_maphdrs(kvm_t *kd, size_t sz)
|
||||
@ -111,7 +111,6 @@ _kvm_maphdrs(kvm_t *kd, size_t sz)
|
||||
|
||||
/*
|
||||
* Translate a physical memory address to a file-offset in the crash-dump.
|
||||
* (Taken from kvm_ia64.c)
|
||||
*/
|
||||
static size_t
|
||||
_kvm_pa2off(kvm_t *kd, uint64_t pa, off_t *ofs)
|
||||
|
@ -1,375 +0,0 @@
|
||||
/* $FreeBSD$ */
|
||||
/* $NetBSD: kvm_alpha.c,v 1.7.2.1 1997/11/02 20:34:26 mellon Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Author: Chris G. Demetriou
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and
|
||||
* its documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation.
|
||||
*
|
||||
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
|
||||
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
|
||||
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
|
||||
*
|
||||
* Carnegie Mellon requests users of this software to return to
|
||||
*
|
||||
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
|
||||
* School of Computer Science
|
||||
* Carnegie Mellon University
|
||||
* Pittsburgh PA 15213-3890
|
||||
*
|
||||
* any improvements or extensions that they make and grant Carnegie the
|
||||
* rights to redistribute these changes.
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/elf64.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
#ifndef CROSS_LIBKVM
|
||||
#include <machine/atomic.h>
|
||||
#include <machine/bootinfo.h>
|
||||
#include <machine/elf.h>
|
||||
#include <machine/pte.h>
|
||||
#else
|
||||
#include "../../sys/ia64/include/atomic.h"
|
||||
#include "../../sys/ia64/include/bootinfo.h"
|
||||
#include "../../sys/ia64/include/elf.h"
|
||||
#include "../../sys/ia64/include/pte.h"
|
||||
#endif
|
||||
|
||||
#include <kvm.h>
|
||||
#include <limits.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "kvm_private.h"
|
||||
|
||||
#define REGION_BASE(n) (((uint64_t)(n)) << 61)
|
||||
#define REGION_ADDR(x) ((x) & ((1LL<<61)-1LL))
|
||||
|
||||
#define NKPTEPG(ps) ((ps) / sizeof(struct ia64_lpte))
|
||||
#define NKPTEDIR(ps) ((ps) >> 3)
|
||||
#define KPTE_PTE_INDEX(va,ps) (((va)/(ps)) % NKPTEPG(ps))
|
||||
#define KPTE_DIR0_INDEX(va,ps) ((((va)/(ps)) / NKPTEPG(ps)) / NKPTEDIR(ps))
|
||||
#define KPTE_DIR1_INDEX(va,ps) ((((va)/(ps)) / NKPTEPG(ps)) % NKPTEDIR(ps))
|
||||
|
||||
#define PBVM_BASE 0x9ffc000000000000UL
|
||||
#define PBVM_PGSZ (64 * 1024)
|
||||
|
||||
typedef size_t (a2p_f)(kvm_t *, uint64_t, off_t *);
|
||||
|
||||
struct vmstate {
|
||||
void *mmapbase;
|
||||
size_t mmapsize;
|
||||
size_t pagesize;
|
||||
u_long kptdir;
|
||||
u_long *pbvm_pgtbl;
|
||||
u_int pbvm_pgtblsz;
|
||||
a2p_f *kvatop;
|
||||
};
|
||||
|
||||
/*
|
||||
* Map the ELF headers into the process' address space. We do this in two
|
||||
* steps: first the ELF header itself and using that information the whole
|
||||
* set of headers.
|
||||
*/
|
||||
static int
|
||||
ia64_maphdrs(kvm_t *kd, size_t sz)
|
||||
{
|
||||
struct vmstate *vm = kd->vmst;
|
||||
|
||||
/* munmap() previous mmap(). */
|
||||
if (vm->mmapbase != NULL) {
|
||||
munmap(vm->mmapbase, vm->mmapsize);
|
||||
vm->mmapbase = NULL;
|
||||
}
|
||||
|
||||
vm->mmapsize = sz;
|
||||
vm->mmapbase = mmap(NULL, sz, PROT_READ, MAP_PRIVATE, kd->pmfd, 0);
|
||||
if (vm->mmapbase == MAP_FAILED) {
|
||||
_kvm_err(kd, kd->program, "cannot mmap corefile");
|
||||
return (-1);
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Physical core support.
|
||||
*/
|
||||
|
||||
static size_t
|
||||
phys_addr2off(kvm_t *kd, uint64_t pa, off_t *ofs, size_t pgsz)
|
||||
{
|
||||
Elf64_Ehdr *e;
|
||||
Elf64_Phdr *p;
|
||||
int n;
|
||||
|
||||
if (pa != REGION_ADDR(pa))
|
||||
goto fail;
|
||||
|
||||
e = (Elf64_Ehdr *)(kd->vmst->mmapbase);
|
||||
n = e->e_phnum;
|
||||
p = (Elf64_Phdr *)(void *)((uintptr_t)(void *)e + e->e_phoff);
|
||||
while (n && (pa < p->p_paddr || pa >= p->p_paddr + p->p_memsz))
|
||||
p++, n--;
|
||||
if (n == 0)
|
||||
goto fail;
|
||||
|
||||
*ofs = (pa - p->p_paddr) + p->p_offset;
|
||||
if (pgsz == 0)
|
||||
return (p->p_memsz - (pa - p->p_paddr));
|
||||
return (pgsz - ((size_t)pa & (pgsz - 1)));
|
||||
|
||||
fail:
|
||||
_kvm_err(kd, kd->program, "invalid physical address %#jx",
|
||||
(uintmax_t)pa);
|
||||
return (0);
|
||||
}
|
||||
|
||||
static size_t
|
||||
phys_kvatop(kvm_t *kd, uint64_t va, off_t *ofs)
|
||||
{
|
||||
struct ia64_lpte pte;
|
||||
uint64_t pa, pgaddr, pt0addr, pt1addr;
|
||||
size_t pgno, pgsz, pt0no, pt1no;
|
||||
|
||||
if (va >= REGION_BASE(6)) {
|
||||
/* Regions 6 and 7: direct mapped. */
|
||||
pa = REGION_ADDR(va);
|
||||
return (phys_addr2off(kd, pa, ofs, 0));
|
||||
} else if (va >= REGION_BASE(5)) {
|
||||
/* Region 5: Kernel Virtual Memory. */
|
||||
va = REGION_ADDR(va);
|
||||
pgsz = kd->vmst->pagesize;
|
||||
pt0no = KPTE_DIR0_INDEX(va, pgsz);
|
||||
pt1no = KPTE_DIR1_INDEX(va, pgsz);
|
||||
pgno = KPTE_PTE_INDEX(va, pgsz);
|
||||
if (pt0no >= NKPTEDIR(pgsz))
|
||||
goto fail;
|
||||
pt0addr = kd->vmst->kptdir + (pt0no << 3);
|
||||
if (kvm_read(kd, pt0addr, &pt1addr, 8) != 8)
|
||||
goto fail;
|
||||
if (pt1addr == 0)
|
||||
goto fail;
|
||||
pt1addr += pt1no << 3;
|
||||
if (kvm_read(kd, pt1addr, &pgaddr, 8) != 8)
|
||||
goto fail;
|
||||
if (pgaddr == 0)
|
||||
goto fail;
|
||||
pgaddr += pgno * sizeof(pte);
|
||||
if (kvm_read(kd, pgaddr, &pte, sizeof(pte)) != sizeof(pte))
|
||||
goto fail;
|
||||
if (!(pte.pte & PTE_PRESENT))
|
||||
goto fail;
|
||||
pa = (pte.pte & PTE_PPN_MASK) + (va & (pgsz - 1));
|
||||
return (phys_addr2off(kd, pa, ofs, pgsz));
|
||||
} else if (va >= PBVM_BASE) {
|
||||
/* Region 4: Pre-Boot Virtual Memory (PBVM). */
|
||||
va -= PBVM_BASE;
|
||||
pgsz = PBVM_PGSZ;
|
||||
pt0no = va / pgsz;
|
||||
if (pt0no >= (kd->vmst->pbvm_pgtblsz >> 3))
|
||||
goto fail;
|
||||
pt0addr = kd->vmst->pbvm_pgtbl[pt0no];
|
||||
if (!(pt0addr & PTE_PRESENT))
|
||||
goto fail;
|
||||
pa = (pt0addr & PTE_PPN_MASK) + va % pgsz;
|
||||
return (phys_addr2off(kd, pa, ofs, pgsz));
|
||||
}
|
||||
|
||||
fail:
|
||||
_kvm_err(kd, kd->program, "invalid kernel virtual address %#jx",
|
||||
(uintmax_t)va);
|
||||
*ofs = -1;
|
||||
return (0);
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
phys_read(kvm_t *kd, uint64_t pa, void *buf, size_t bufsz)
|
||||
{
|
||||
off_t ofs;
|
||||
size_t sz;
|
||||
|
||||
sz = phys_addr2off(kd, pa, &ofs, 0);
|
||||
if (sz < bufsz)
|
||||
return ((ssize_t)sz);
|
||||
|
||||
if (lseek(kd->pmfd, ofs, 0) == -1)
|
||||
return (-1);
|
||||
return (read(kd->pmfd, buf, bufsz));
|
||||
}
|
||||
|
||||
/*
|
||||
* Virtual core support (aka minidump).
|
||||
*/
|
||||
|
||||
static size_t
|
||||
virt_addr2off(kvm_t *kd, uint64_t va, off_t *ofs, size_t pgsz)
|
||||
{
|
||||
Elf64_Ehdr *e;
|
||||
Elf64_Phdr *p;
|
||||
int n;
|
||||
|
||||
if (va < REGION_BASE(4))
|
||||
goto fail;
|
||||
|
||||
e = (Elf64_Ehdr *)(kd->vmst->mmapbase);
|
||||
n = e->e_phnum;
|
||||
p = (Elf64_Phdr *)(void *)((uintptr_t)(void *)e + e->e_phoff);
|
||||
while (n && (va < p->p_vaddr || va >= p->p_vaddr + p->p_memsz))
|
||||
p++, n--;
|
||||
if (n == 0)
|
||||
goto fail;
|
||||
|
||||
*ofs = (va - p->p_vaddr) + p->p_offset;
|
||||
if (pgsz == 0)
|
||||
return (p->p_memsz - (va - p->p_vaddr));
|
||||
return (pgsz - ((size_t)va & (pgsz - 1)));
|
||||
|
||||
fail:
|
||||
_kvm_err(kd, kd->program, "invalid virtual address %#jx",
|
||||
(uintmax_t)va);
|
||||
return (0);
|
||||
}
|
||||
|
||||
static size_t
|
||||
virt_kvatop(kvm_t *kd, uint64_t va, off_t *ofs)
|
||||
{
|
||||
|
||||
return (virt_addr2off(kd, va, ofs, 0));
|
||||
}
|
||||
|
||||
/*
|
||||
* KVM architecture support functions.
|
||||
*/
|
||||
|
||||
void
|
||||
_kvm_freevtop(kvm_t *kd)
|
||||
{
|
||||
struct vmstate *vm = kd->vmst;
|
||||
|
||||
if (vm->pbvm_pgtbl != NULL)
|
||||
free(vm->pbvm_pgtbl);
|
||||
if (vm->mmapbase != NULL)
|
||||
munmap(vm->mmapbase, vm->mmapsize);
|
||||
free(vm);
|
||||
kd->vmst = NULL;
|
||||
}
|
||||
|
||||
int
|
||||
_kvm_initvtop(kvm_t *kd)
|
||||
{
|
||||
struct bootinfo bi;
|
||||
struct nlist nl[2];
|
||||
uint64_t va;
|
||||
Elf64_Ehdr *ehdr;
|
||||
size_t hdrsz;
|
||||
ssize_t sz;
|
||||
|
||||
kd->vmst = (struct vmstate *)_kvm_malloc(kd, sizeof(*kd->vmst));
|
||||
if (kd->vmst == NULL) {
|
||||
_kvm_err(kd, kd->program, "cannot allocate vm");
|
||||
return (-1);
|
||||
}
|
||||
|
||||
#ifndef CROSS_LIBKVM
|
||||
kd->vmst->pagesize = getpagesize();
|
||||
#else
|
||||
kd->vmst->pagesize = 8192;
|
||||
#endif
|
||||
|
||||
if (ia64_maphdrs(kd, sizeof(Elf64_Ehdr)) == -1)
|
||||
return (-1);
|
||||
|
||||
ehdr = kd->vmst->mmapbase;
|
||||
hdrsz = ehdr->e_phoff + ehdr->e_phentsize * ehdr->e_phnum;
|
||||
if (ia64_maphdrs(kd, hdrsz) == -1)
|
||||
return (-1);
|
||||
|
||||
kd->vmst->kvatop = (ehdr->e_flags & EF_IA_64_ABSOLUTE) ?
|
||||
phys_kvatop : virt_kvatop;
|
||||
|
||||
/*
|
||||
* Load the PBVM page table. We need this to resolve PBVM addresses.
|
||||
* The PBVM page table is obtained from the bootinfo structure, of
|
||||
* which the address is given to us in e_entry. If e_entry is 0, then
|
||||
* this is assumed to be a pre-PBVM kernel.
|
||||
* Note that the address of the bootinfo structure is either physical
|
||||
* or virtual, depending on whether the core is physical or virtual.
|
||||
*/
|
||||
if (ehdr->e_entry != 0 && (ehdr->e_flags & EF_IA_64_ABSOLUTE) != 0) {
|
||||
sz = phys_read(kd, ehdr->e_entry, &bi, sizeof(bi));
|
||||
if (sz != sizeof(bi)) {
|
||||
_kvm_err(kd, kd->program,
|
||||
"cannot read bootinfo at physical address %#jx",
|
||||
(uintmax_t)ehdr->e_entry);
|
||||
return (-1);
|
||||
}
|
||||
if (bi.bi_magic != BOOTINFO_MAGIC) {
|
||||
_kvm_err(kd, kd->program, "invalid bootinfo");
|
||||
return (-1);
|
||||
}
|
||||
kd->vmst->pbvm_pgtbl = _kvm_malloc(kd, bi.bi_pbvm_pgtblsz);
|
||||
if (kd->vmst->pbvm_pgtbl == NULL) {
|
||||
_kvm_err(kd, kd->program, "cannot allocate page table");
|
||||
return (-1);
|
||||
}
|
||||
kd->vmst->pbvm_pgtblsz = bi.bi_pbvm_pgtblsz;
|
||||
sz = phys_read(kd, bi.bi_pbvm_pgtbl, kd->vmst->pbvm_pgtbl,
|
||||
bi.bi_pbvm_pgtblsz);
|
||||
if (sz != bi.bi_pbvm_pgtblsz) {
|
||||
_kvm_err(kd, kd->program,
|
||||
"cannot read page table at physical address %#jx",
|
||||
(uintmax_t)bi.bi_pbvm_pgtbl);
|
||||
return (-1);
|
||||
}
|
||||
} else {
|
||||
kd->vmst->pbvm_pgtbl = NULL;
|
||||
kd->vmst->pbvm_pgtblsz = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* At this point we've got enough information to use kvm_read() for
|
||||
* direct mapped (ie region 6 and region 7) address, such as symbol
|
||||
* addresses/values.
|
||||
*/
|
||||
|
||||
nl[0].n_name = "ia64_kptdir";
|
||||
nl[1].n_name = 0;
|
||||
|
||||
if (kvm_nlist(kd, nl) != 0) {
|
||||
_kvm_err(kd, kd->program, "bad namelist");
|
||||
return (-1);
|
||||
}
|
||||
|
||||
if (kvm_read(kd, (nl[0].n_value), &va, sizeof(va)) != sizeof(va)) {
|
||||
_kvm_err(kd, kd->program, "cannot read kptdir");
|
||||
return (-1);
|
||||
}
|
||||
|
||||
if (va == REGION_BASE(5)) {
|
||||
_kvm_err(kd, kd->program, "kptdir is itself virtual");
|
||||
return (-1);
|
||||
}
|
||||
|
||||
kd->vmst->kptdir = va;
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
_kvm_kvatop(kvm_t *kd, u_long va, off_t *ofs)
|
||||
{
|
||||
size_t sz;
|
||||
|
||||
sz = kd->vmst->kvatop(kd, va, ofs);
|
||||
return ((sz > INT_MAX) ? INT_MAX : sz);
|
||||
}
|
@ -57,12 +57,10 @@ SRCS+= ntoh.c
|
||||
|
||||
# string functions from libc
|
||||
.PATH: ${.CURDIR}/../libc/string
|
||||
.if ${MACHINE_CPUARCH} != "ia64"
|
||||
SRCS+= bcmp.c bcopy.c bzero.c ffs.c memccpy.c memchr.c memcmp.c memcpy.c \
|
||||
memmove.c memset.c qdivrem.c strcat.c strchr.c strcmp.c strcpy.c \
|
||||
strcspn.c strlen.c strncat.c strncmp.c strncpy.c strpbrk.c \
|
||||
strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c
|
||||
.endif
|
||||
.if ${MACHINE_CPUARCH} == "arm"
|
||||
.PATH: ${.CURDIR}/../libc/arm/gen
|
||||
|
||||
@ -82,17 +80,6 @@ SRCS+= aeabi_idivmod.S aeabi_ldivmod.S aeabi_uidivmod.S aeabi_uldivmod.S
|
||||
SRCS+= aeabi_memcmp.S aeabi_memcpy.S aeabi_memmove.S aeabi_memset.S
|
||||
.endif
|
||||
|
||||
.endif
|
||||
.if ${MACHINE_CPUARCH} == "ia64"
|
||||
.PATH: ${.CURDIR}/../libc/ia64/string
|
||||
SRCS+= bcmp.c bcopy.S bzero.S ffs.S memccpy.c memchr.c memcmp.c memcpy.S \
|
||||
memmove.S memset.c strcat.c strchr.c strcmp.c strcpy.c strcspn.c \
|
||||
strlen.c strncat.c strncmp.c strncpy.c strpbrk.c strrchr.c strsep.c \
|
||||
strspn.c strstr.c strtok.c swab.c
|
||||
|
||||
.PATH: ${.CURDIR}/../libc/ia64/gen
|
||||
SRCS+= __divdi3.S __divsi3.S __moddi3.S __modsi3.S
|
||||
SRCS+= __udivdi3.S __udivsi3.S __umoddi3.S __umodsi3.S
|
||||
.endif
|
||||
.if ${MACHINE_CPUARCH} == "powerpc"
|
||||
.PATH: ${.CURDIR}/../libc/quad
|
||||
|
@ -1,3 +0,0 @@
|
||||
# $FreeBSD$
|
||||
|
||||
SRCS+= _umtx_op_err.S pthread_md.c
|
@ -1,35 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 2009 Marcel Moolenaar
|
||||
* 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$");
|
||||
|
||||
#include <sys/syscall.h>
|
||||
|
||||
ENTRY(_umtx_op_err, 5)
|
||||
CALLSYS_NOERROR(_umtx_op)
|
||||
br.ret.sptk.few rp
|
||||
END(_umtx_op_err)
|
@ -1,54 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Daniel Eischen <deischen@freebsd.org>
|
||||
* Copyright (c) 2005 David Xu <davidxu@freebsd.org>
|
||||
* 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. Neither the name of the author 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 AUTHOR ``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 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.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <rtld_tls.h>
|
||||
|
||||
#include "pthread_md.h"
|
||||
|
||||
/*
|
||||
* The constructors.
|
||||
*/
|
||||
struct tcb *
|
||||
_tcb_ctor(struct pthread *thread, int initial)
|
||||
{
|
||||
struct tcb *tcb;
|
||||
|
||||
tcb = _rtld_allocate_tls((initial) ? _tcb_get() : NULL,
|
||||
sizeof(struct tcb), 16);
|
||||
if (tcb)
|
||||
tcb->tcb_thread = thread;
|
||||
return (tcb);
|
||||
}
|
||||
|
||||
void
|
||||
_tcb_dtor(struct tcb *tcb)
|
||||
{
|
||||
_rtld_free_tls(tcb, sizeof(struct tcb), 16);
|
||||
}
|
@ -1,82 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Marcel Moolenaar
|
||||
* 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 ``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 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.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#ifndef _PTHREAD_MD_H_
|
||||
#define _PTHREAD_MD_H_
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#define CPU_SPINWAIT
|
||||
|
||||
#define HAS__UMTX_OP_ERR 1
|
||||
|
||||
#define DTV_OFFSET offsetof(struct tcb, tcb_dtv)
|
||||
|
||||
/*
|
||||
* Variant I tcb. The structure layout is fixed, don't blindly
|
||||
* change it!
|
||||
*/
|
||||
struct tcb {
|
||||
void *tcb_dtv;
|
||||
struct pthread *tcb_thread;
|
||||
};
|
||||
|
||||
/*
|
||||
* The tcb constructors.
|
||||
*/
|
||||
struct tcb *_tcb_ctor(struct pthread *, int);
|
||||
void _tcb_dtor(struct tcb *);
|
||||
|
||||
/* Called from the thread to set its private data. */
|
||||
static __inline void
|
||||
_tcb_set(struct tcb *tcb)
|
||||
{
|
||||
register struct tcb *tp __asm("%r13");
|
||||
|
||||
__asm __volatile("mov %0 = %1;;" : "=r"(tp) : "r"(tcb));
|
||||
}
|
||||
|
||||
static __inline struct tcb *
|
||||
_tcb_get(void)
|
||||
{
|
||||
register struct tcb *tp __asm("%r13");
|
||||
|
||||
return (tp);
|
||||
}
|
||||
|
||||
extern struct pthread *_thr_initial;
|
||||
|
||||
static __inline struct pthread *
|
||||
_get_curthread(void)
|
||||
{
|
||||
if (_thr_initial)
|
||||
return (_tcb_get()->tcb_thread);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
#endif /* _PTHREAD_MD_H_ */
|
@ -1,65 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2004 Marcel Moolenaar
|
||||
* 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 ``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 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 <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/procfs.h>
|
||||
#include <thread_db.h>
|
||||
#include <ucontext.h>
|
||||
|
||||
#include "libpthread_db.h"
|
||||
|
||||
void
|
||||
pt_reg_to_ucontext(const struct reg *r __unused, ucontext_t *uc __unused)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
pt_ucontext_to_reg(const ucontext_t *uc __unused, struct reg *r __unused)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
pt_fpreg_to_ucontext(const struct fpreg* r __unused, ucontext_t *uc __unused)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
pt_ucontext_to_fpreg(const ucontext_t *uc __unused, struct fpreg *r __unused)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
pt_md_init(void)
|
||||
{
|
||||
}
|
||||
|
||||
int
|
||||
pt_reg_sstep(struct reg *reg __unused, int step __unused)
|
||||
{
|
||||
return (0);
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
# $FreeBSD$
|
||||
|
||||
ARCH_SRCS = s_fma.S s_fmaf.S s_fmal.S
|
||||
LDBL_PREC = 64
|
||||
SYM_MAPS += ${.CURDIR}/ia64/Symbol.map
|
@ -1,13 +0,0 @@
|
||||
/*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
FBSD_1.0 {
|
||||
feupdateenv;
|
||||
};
|
||||
|
||||
FBSD_1.3 {
|
||||
fesetexceptflag;
|
||||
feraiseexcept;
|
||||
fegetenv;
|
||||
feholdexcept;
|
||||
};
|
@ -1,66 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 2004 David Schultz <das@FreeBSD.ORG>
|
||||
* 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.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#define __fenv_static
|
||||
#include "fenv.h"
|
||||
|
||||
#ifdef __GNUC_GNU_INLINE__
|
||||
#error "This file must be compiled with C99 'inline' semantics"
|
||||
#endif
|
||||
|
||||
const fenv_t __fe_dfl_env = 0x0009804c8a70033fULL;
|
||||
|
||||
extern inline int feclearexcept(int __excepts);
|
||||
extern inline int fegetexceptflag(fexcept_t *__flagp, int __excepts);
|
||||
extern inline int fesetexceptflag(const fexcept_t *__flagp, int __excepts);
|
||||
extern inline int feraiseexcept(int __excepts);
|
||||
extern inline int fetestexcept(int __excepts);
|
||||
extern inline int fegetround(void);
|
||||
extern inline int fesetround(int __round);
|
||||
extern inline int fegetenv(fenv_t *__envp);
|
||||
extern inline int feholdexcept(fenv_t *__envp);
|
||||
extern inline int fesetenv(const fenv_t *__envp);
|
||||
|
||||
/*
|
||||
* It doesn't pay to inline feupdateenv() because it includes one of
|
||||
* the rare uses of feraiseexcept() where the argument is not a
|
||||
* constant. Thus, no dead code elimination can occur, resulting in
|
||||
* significant bloat.
|
||||
*/
|
||||
int
|
||||
feupdateenv(const fenv_t *envp)
|
||||
{
|
||||
fenv_t fpsr;
|
||||
|
||||
__stfpsr(&fpsr);
|
||||
__ldfpsr(*envp);
|
||||
feraiseexcept((fpsr >> _FPUSW_SHIFT) & FE_ALL_EXCEPT);
|
||||
return (0);
|
||||
}
|
@ -1,248 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 2004-2005 David Schultz <das@FreeBSD.ORG>
|
||||
* 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.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#ifndef _FENV_H_
|
||||
#define _FENV_H_
|
||||
|
||||
#include <sys/_types.h>
|
||||
|
||||
#ifndef __fenv_static
|
||||
#define __fenv_static static
|
||||
#endif
|
||||
|
||||
typedef __uint64_t fenv_t;
|
||||
typedef __uint16_t fexcept_t;
|
||||
|
||||
/* Exception flags */
|
||||
#define FE_INVALID 0x01
|
||||
#define FE_DENORMAL 0x02
|
||||
#define FE_DIVBYZERO 0x04
|
||||
#define FE_OVERFLOW 0x08
|
||||
#define FE_UNDERFLOW 0x10
|
||||
#define FE_INEXACT 0x20
|
||||
#define FE_ALL_EXCEPT (FE_DIVBYZERO | FE_DENORMAL | FE_INEXACT | \
|
||||
FE_INVALID | FE_OVERFLOW | FE_UNDERFLOW)
|
||||
|
||||
/* Rounding modes */
|
||||
#define FE_TONEAREST 0x0000
|
||||
#define FE_DOWNWARD 0x0400
|
||||
#define FE_UPWARD 0x0800
|
||||
#define FE_TOWARDZERO 0x0c00
|
||||
#define _ROUND_MASK (FE_TONEAREST | FE_DOWNWARD | \
|
||||
FE_UPWARD | FE_TOWARDZERO)
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Default floating-point environment */
|
||||
extern const fenv_t __fe_dfl_env;
|
||||
#define FE_DFL_ENV (&__fe_dfl_env)
|
||||
|
||||
#define _FPUSW_SHIFT 13
|
||||
|
||||
#define __stfpsr(__r) __asm __volatile("mov %0=ar.fpsr" : "=r" (*(__r)))
|
||||
#define __ldfpsr(__r) __asm __volatile("mov ar.fpsr=%0;;" : : "r" (__r))
|
||||
|
||||
__fenv_static inline int
|
||||
feclearexcept(int __excepts)
|
||||
{
|
||||
fenv_t __fpsr;
|
||||
|
||||
__stfpsr(&__fpsr);
|
||||
__fpsr &= ~((fenv_t)__excepts << _FPUSW_SHIFT);
|
||||
__ldfpsr(__fpsr);
|
||||
return (0);
|
||||
}
|
||||
|
||||
__fenv_static inline int
|
||||
fegetexceptflag(fexcept_t *__flagp, int __excepts)
|
||||
{
|
||||
fenv_t __fpsr;
|
||||
|
||||
__stfpsr(&__fpsr);
|
||||
*__flagp = (fexcept_t)(__fpsr >> _FPUSW_SHIFT) & __excepts;
|
||||
return (0);
|
||||
}
|
||||
|
||||
__fenv_static inline int
|
||||
fesetexceptflag(const fexcept_t *__flagp, int __excepts)
|
||||
{
|
||||
fenv_t __fpsr;
|
||||
|
||||
__stfpsr(&__fpsr);
|
||||
__fpsr &= ~((fenv_t)__excepts << _FPUSW_SHIFT);
|
||||
__fpsr |= (fenv_t)(__excepts & *__flagp) << _FPUSW_SHIFT;
|
||||
__ldfpsr(__fpsr);
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* It is worthwhile to use the inline version of this function iff it
|
||||
* is called with arguments that are compile-time constants (due to
|
||||
* dead code elimination). Unfortunately, gcc isn't smart enough to
|
||||
* figure this out automatically, and there's no way to tell it.
|
||||
* We assume that constant arguments will be the common case.
|
||||
*/
|
||||
__fenv_static inline int
|
||||
feraiseexcept(int __excepts)
|
||||
{
|
||||
volatile double d;
|
||||
|
||||
/*
|
||||
* With a compiler that supports the FENV_ACCESS pragma
|
||||
* properly, simple expressions like '0.0 / 0.0' should
|
||||
* be sufficient to generate traps. Unfortunately, we
|
||||
* need to bring a volatile variable into the equation
|
||||
* to prevent incorrect optimizations.
|
||||
*/
|
||||
if (__excepts & FE_INVALID) {
|
||||
d = 0.0;
|
||||
d = 0.0 / d;
|
||||
}
|
||||
if (__excepts & FE_DIVBYZERO) {
|
||||
d = 0.0;
|
||||
d = 1.0 / d;
|
||||
}
|
||||
if (__excepts & FE_OVERFLOW) {
|
||||
d = 0x1.ffp1023;
|
||||
d *= 2.0;
|
||||
}
|
||||
if (__excepts & FE_UNDERFLOW) {
|
||||
d = 0x1p-1022;
|
||||
d /= 0x1p1023;
|
||||
}
|
||||
if (__excepts & FE_INEXACT) {
|
||||
d = 0x1p-1022;
|
||||
d += 1.0;
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
__fenv_static inline int
|
||||
fetestexcept(int __excepts)
|
||||
{
|
||||
fenv_t __fpsr;
|
||||
|
||||
__stfpsr(&__fpsr);
|
||||
return ((__fpsr >> _FPUSW_SHIFT) & __excepts);
|
||||
}
|
||||
|
||||
|
||||
__fenv_static inline int
|
||||
fegetround(void)
|
||||
{
|
||||
fenv_t __fpsr;
|
||||
|
||||
__stfpsr(&__fpsr);
|
||||
return (__fpsr & _ROUND_MASK);
|
||||
}
|
||||
|
||||
__fenv_static inline int
|
||||
fesetround(int __round)
|
||||
{
|
||||
fenv_t __fpsr;
|
||||
|
||||
if (__round & ~_ROUND_MASK)
|
||||
return (-1);
|
||||
__stfpsr(&__fpsr);
|
||||
__fpsr &= ~_ROUND_MASK;
|
||||
__fpsr |= __round;
|
||||
__ldfpsr(__fpsr);
|
||||
return (0);
|
||||
}
|
||||
|
||||
__fenv_static inline int
|
||||
fegetenv(fenv_t *__envp)
|
||||
{
|
||||
|
||||
__stfpsr(__envp);
|
||||
return (0);
|
||||
}
|
||||
|
||||
__fenv_static inline int
|
||||
feholdexcept(fenv_t *__envp)
|
||||
{
|
||||
fenv_t __fpsr;
|
||||
|
||||
__stfpsr(&__fpsr);
|
||||
*__envp = __fpsr;
|
||||
__fpsr &= ~((fenv_t)FE_ALL_EXCEPT << _FPUSW_SHIFT);
|
||||
__fpsr |= FE_ALL_EXCEPT;
|
||||
__ldfpsr(__fpsr);
|
||||
return (0);
|
||||
}
|
||||
|
||||
__fenv_static inline int
|
||||
fesetenv(const fenv_t *__envp)
|
||||
{
|
||||
|
||||
__ldfpsr(*__envp);
|
||||
return (0);
|
||||
}
|
||||
|
||||
int feupdateenv(const fenv_t *__envp);
|
||||
|
||||
#if __BSD_VISIBLE
|
||||
|
||||
/* We currently provide no external definitions of the functions below. */
|
||||
|
||||
static inline int
|
||||
feenableexcept(int __mask)
|
||||
{
|
||||
fenv_t __newfpsr, __oldfpsr;
|
||||
|
||||
__stfpsr(&__oldfpsr);
|
||||
__newfpsr = __oldfpsr & ~(__mask & FE_ALL_EXCEPT);
|
||||
__ldfpsr(__newfpsr);
|
||||
return (~__oldfpsr & FE_ALL_EXCEPT);
|
||||
}
|
||||
|
||||
static inline int
|
||||
fedisableexcept(int __mask)
|
||||
{
|
||||
fenv_t __newfpsr, __oldfpsr;
|
||||
|
||||
__stfpsr(&__oldfpsr);
|
||||
__newfpsr = __oldfpsr | (__mask & FE_ALL_EXCEPT);
|
||||
__ldfpsr(__newfpsr);
|
||||
return (~__oldfpsr & FE_ALL_EXCEPT);
|
||||
}
|
||||
|
||||
static inline int
|
||||
fegetexcept(void)
|
||||
{
|
||||
fenv_t __fpsr;
|
||||
|
||||
__stfpsr(&__fpsr);
|
||||
return (~__fpsr & FE_ALL_EXCEPT);
|
||||
}
|
||||
|
||||
#endif /* __BSD_VISIBLE */
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_FENV_H_ */
|
@ -1,35 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 2005 David Schultz <das@FreeBSD.ORG>
|
||||
* 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$")
|
||||
|
||||
ENTRY(fma, 3)
|
||||
{
|
||||
fma.d f8 = f8, f9, f10
|
||||
br.ret.sptk b0
|
||||
}
|
||||
END(fma)
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user