Merge ^/head r307736 through r308146.
This commit is contained in:
commit
02ebdc7823
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/projects/clang390-import/; revision=308147
6
Makefile
6
Makefile
@ -239,7 +239,7 @@ _MAKE+= MK_META_MODE=no
|
|||||||
_TARGET_ARCH= ${TARGET:S/pc98/i386/:S/arm64/aarch64/}
|
_TARGET_ARCH= ${TARGET:S/pc98/i386/:S/arm64/aarch64/}
|
||||||
.elif !defined(TARGET) && defined(TARGET_ARCH) && \
|
.elif !defined(TARGET) && defined(TARGET_ARCH) && \
|
||||||
${TARGET_ARCH} != ${MACHINE_ARCH}
|
${TARGET_ARCH} != ${MACHINE_ARCH}
|
||||||
_TARGET= ${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/:C/aarch64/arm64/:C/powerpc64/powerpc/:C/riscv64/riscv/}
|
_TARGET= ${TARGET_ARCH:C/mips(n32|64)?(el)?(hf)?/mips/:C/arm(v6)?(eb)?/arm/:C/aarch64/arm64/:C/powerpc64/powerpc/:C/powerpcspe/powerpc/:C/riscv64/riscv/}
|
||||||
.endif
|
.endif
|
||||||
.if defined(TARGET) && !defined(_TARGET)
|
.if defined(TARGET) && !defined(_TARGET)
|
||||||
_TARGET=${TARGET}
|
_TARGET=${TARGET}
|
||||||
@ -421,8 +421,8 @@ TARGETS?=amd64 arm arm64 i386 mips pc98 powerpc sparc64
|
|||||||
_UNIVERSE_TARGETS= ${TARGETS}
|
_UNIVERSE_TARGETS= ${TARGETS}
|
||||||
TARGET_ARCHES_arm?= arm armeb armv6
|
TARGET_ARCHES_arm?= arm armeb armv6
|
||||||
TARGET_ARCHES_arm64?= aarch64
|
TARGET_ARCHES_arm64?= aarch64
|
||||||
TARGET_ARCHES_mips?= mipsel mips mips64el mips64 mipsn32
|
TARGET_ARCHES_mips?= mipsel mips mips64el mips64 mipsn32 mipselhf mipshf mips64elhf mips64hf
|
||||||
TARGET_ARCHES_powerpc?= powerpc powerpc64
|
TARGET_ARCHES_powerpc?= powerpc powerpc64 powerpcspe
|
||||||
TARGET_ARCHES_pc98?= i386
|
TARGET_ARCHES_pc98?= i386
|
||||||
.for target in ${TARGETS}
|
.for target in ${TARGETS}
|
||||||
TARGET_ARCHES_${target}?= ${target}
|
TARGET_ARCHES_${target}?= ${target}
|
||||||
|
@ -356,8 +356,13 @@ KNOWN_ARCHES?= aarch64/arm64 \
|
|||||||
mipsn32el/mips \
|
mipsn32el/mips \
|
||||||
mips64/mips \
|
mips64/mips \
|
||||||
mipsn32/mips \
|
mipsn32/mips \
|
||||||
|
mipshf/mips \
|
||||||
|
mipselhf/mips \
|
||||||
|
mips64elhf/mips \
|
||||||
|
mips64hf/mips \
|
||||||
powerpc \
|
powerpc \
|
||||||
powerpc64/powerpc \
|
powerpc64/powerpc \
|
||||||
|
powerpcspe/powerpc \
|
||||||
riscv64/riscv \
|
riscv64/riscv \
|
||||||
sparc64
|
sparc64
|
||||||
|
|
||||||
@ -452,7 +457,7 @@ PACKAGE= kernel
|
|||||||
#
|
#
|
||||||
|
|
||||||
BOOTSTRAPPING?= 0
|
BOOTSTRAPPING?= 0
|
||||||
# Keep these in sync
|
# Keep these in sync -- see below for special case exception
|
||||||
MINIMUM_SUPPORTED_OSREL?= 900044
|
MINIMUM_SUPPORTED_OSREL?= 900044
|
||||||
MINIMUM_SUPPORTED_REL?= 9.1
|
MINIMUM_SUPPORTED_REL?= 9.1
|
||||||
|
|
||||||
@ -1556,10 +1561,23 @@ _elftoolchain_libs= lib/libelf lib/libdwarf
|
|||||||
.endif
|
.endif
|
||||||
|
|
||||||
legacy: .PHONY
|
legacy: .PHONY
|
||||||
|
# Temporary special case for automatically detecting the clang compiler issue
|
||||||
|
# Note: 9.x didn't have FreeBSD_version bumps often enough, so you may need to
|
||||||
|
# set BOOTSTRAPPING to 0 if you're stable/9 tree post-dates r286035 but is before
|
||||||
|
# the version bump in r296219 (from July 29, 2015 -> Feb 29, 2016).
|
||||||
|
.if ${BOOTSTRAPPING} != 0 && \
|
||||||
|
${WANT_COMPILER_TYPE} == "clang" && ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} < 30601
|
||||||
|
.if ${BOOTSTRAPPING} > 10000000 && ${BOOTSTRAPPING} < 1002501
|
||||||
|
@echo "ERROR: Source upgrades from stable/10 prior to r286033 are not supported."; false
|
||||||
|
.elif ${BOOTSTRAPPING} > 9000000 && ${BOOTSTRAPPING} < 903509
|
||||||
|
@echo "ERROR: Source upgrades from stable/9 prior to r286035 are not supported."; false
|
||||||
|
.endif
|
||||||
|
.endif
|
||||||
.if ${BOOTSTRAPPING} < ${MINIMUM_SUPPORTED_OSREL} && ${BOOTSTRAPPING} != 0
|
.if ${BOOTSTRAPPING} < ${MINIMUM_SUPPORTED_OSREL} && ${BOOTSTRAPPING} != 0
|
||||||
@echo "ERROR: Source upgrades from versions prior to ${MINIMUM_SUPPORTED_REL} are not supported."; \
|
@echo "ERROR: Source upgrades from versions prior to ${MINIMUM_SUPPORTED_REL} are not supported."; \
|
||||||
false
|
false
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
.for _tool in tools/build ${_elftoolchain_libs}
|
.for _tool in tools/build ${_elftoolchain_libs}
|
||||||
${_+_}@${ECHODIR} "===> ${_tool} (obj,includes,all,install)"; \
|
${_+_}@${ECHODIR} "===> ${_tool} (obj,includes,all,install)"; \
|
||||||
cd ${.CURDIR}/${_tool}; \
|
cd ${.CURDIR}/${_tool}; \
|
||||||
|
17
UPDATING
17
UPDATING
@ -41,13 +41,22 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW:
|
|||||||
11.0-RELEASE). These revisions post-date the 10.2 and 9.3 releases, so
|
11.0-RELEASE). These revisions post-date the 10.2 and 9.3 releases, so
|
||||||
you'll need to take the unusual step of upgrading to the tip of the
|
you'll need to take the unusual step of upgrading to the tip of the
|
||||||
stable branch before moving to 11 or -current via a source upgrade.
|
stable branch before moving to 11 or -current via a source upgrade.
|
||||||
stable/11 and 11.0-RELEASE post-date the fix so you can move from them
|
stable/11 and 11.0-RELEASE have working newer compiler. This differs
|
||||||
to -current. This differs from the historical situation where one could
|
from the historical situation where one could upgrade from anywhere on
|
||||||
upgrade from anywhere on the last couple of stable branches, so be
|
the last couple of stable branches, so be careful.
|
||||||
careful.
|
|
||||||
|
If you're running a hybrid system on 9.x or 10.x with an updated clang
|
||||||
|
compiler or are using an supported external toolchain, the build system
|
||||||
|
will allow the upgrade. Otherwise it will print a reminder.
|
||||||
|
|
||||||
****************************** SPECIAL WARNING: ******************************
|
****************************** SPECIAL WARNING: ******************************
|
||||||
|
|
||||||
|
20161030:
|
||||||
|
isl(4) and cyapa(4) drivers now require a new driver,
|
||||||
|
chromebook_platform(4), to work properly on Chromebook-class hardware.
|
||||||
|
On other types of hardware the drivers may need to be configured using
|
||||||
|
device hints. Please see the corresponding manual pages for details.
|
||||||
|
|
||||||
20161017:
|
20161017:
|
||||||
The urtwn(4) driver was merged into rtwn(4) and now consists of
|
The urtwn(4) driver was merged into rtwn(4) and now consists of
|
||||||
rtwn(4) main module + rtwn_usb(4) and rtwn_pci(4) bus-specific
|
rtwn(4) main module + rtwn_usb(4) and rtwn_pci(4) bus-specific
|
||||||
|
@ -213,6 +213,7 @@ extern int zpool_get_state(zpool_handle_t *);
|
|||||||
extern const char *zpool_state_to_name(vdev_state_t, vdev_aux_t);
|
extern const char *zpool_state_to_name(vdev_state_t, vdev_aux_t);
|
||||||
extern const char *zpool_pool_state_to_name(pool_state_t);
|
extern const char *zpool_pool_state_to_name(pool_state_t);
|
||||||
extern void zpool_free_handles(libzfs_handle_t *);
|
extern void zpool_free_handles(libzfs_handle_t *);
|
||||||
|
extern int zpool_nextboot(libzfs_handle_t *, uint64_t, uint64_t, const char *);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Iterate over all active pools in the system.
|
* Iterate over all active pools in the system.
|
||||||
|
@ -4126,3 +4126,25 @@ zvol_check_dump_config(char *arg)
|
|||||||
libzfs_fini(hdl);
|
libzfs_fini(hdl);
|
||||||
return (ret);
|
return (ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
zpool_nextboot(libzfs_handle_t *hdl, uint64_t pool_guid, uint64_t dev_guid,
|
||||||
|
const char *command)
|
||||||
|
{
|
||||||
|
zfs_cmd_t zc = { 0 };
|
||||||
|
nvlist_t *args;
|
||||||
|
char *packed;
|
||||||
|
size_t size;
|
||||||
|
int error;
|
||||||
|
|
||||||
|
args = fnvlist_alloc();
|
||||||
|
fnvlist_add_uint64(args, ZPOOL_CONFIG_POOL_GUID, pool_guid);
|
||||||
|
fnvlist_add_uint64(args, ZPOOL_CONFIG_GUID, dev_guid);
|
||||||
|
fnvlist_add_string(args, "command", command);
|
||||||
|
error = zcmd_write_src_nvlist(hdl, &zc, args);
|
||||||
|
if (error == 0)
|
||||||
|
error = ioctl(hdl->libzfs_fd, ZFS_IOC_NEXTBOOT, &zc);
|
||||||
|
zcmd_free_nvlists(&zc);
|
||||||
|
nvlist_free(args);
|
||||||
|
return (error);
|
||||||
|
}
|
||||||
|
@ -1103,7 +1103,7 @@ case "${targ}" in
|
|||||||
want64=true
|
want64=true
|
||||||
;;
|
;;
|
||||||
#endif
|
#endif
|
||||||
powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
|
powerpc-*-*bsd* | powerpcspe-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
|
||||||
powerpc-*-solaris2* | powerpc-*-linux-* | powerpc-*-rtems* | \
|
powerpc-*-solaris2* | powerpc-*-linux-* | powerpc-*-rtems* | \
|
||||||
powerpc-*-chorus*)
|
powerpc-*-chorus*)
|
||||||
targ_defvec=bfd_elf32_powerpc_vec
|
targ_defvec=bfd_elf32_powerpc_vec
|
||||||
|
@ -288,7 +288,7 @@ parse_secparams(struct asn_buf *b, struct snmp_pdu *pdu)
|
|||||||
memset(buf, 0, 256);
|
memset(buf, 0, 256);
|
||||||
tb.asn_ptr = buf;
|
tb.asn_ptr = buf;
|
||||||
tb.asn_len = 256;
|
tb.asn_len = 256;
|
||||||
u_int len;
|
u_int len = 256;
|
||||||
|
|
||||||
if (asn_get_octetstring(b, buf, &len) != ASN_ERR_OK) {
|
if (asn_get_octetstring(b, buf, &len) != ASN_ERR_OK) {
|
||||||
snmp_error("cannot parse usm header");
|
snmp_error("cannot parse usm header");
|
||||||
|
@ -1529,6 +1529,22 @@ print_version(void)
|
|||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Compare the ending of s with end.
|
||||||
|
*/
|
||||||
|
static int
|
||||||
|
strrcmp(const char *s, const char *end)
|
||||||
|
{
|
||||||
|
size_t endlen, slen;
|
||||||
|
|
||||||
|
slen = strlen(s);
|
||||||
|
endlen = strlen(end);
|
||||||
|
|
||||||
|
if (slen >= endlen)
|
||||||
|
s += slen - endlen;
|
||||||
|
return (strcmp(s, end));
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
@ -1562,12 +1578,16 @@ main(int argc, char **argv)
|
|||||||
if ((ecp->progname = ELFTC_GETPROGNAME()) == NULL)
|
if ((ecp->progname = ELFTC_GETPROGNAME()) == NULL)
|
||||||
ecp->progname = "elfcopy";
|
ecp->progname = "elfcopy";
|
||||||
|
|
||||||
if (strcmp(ecp->progname, "strip") == 0)
|
if (strrcmp(ecp->progname, "strip") == 0)
|
||||||
strip_main(ecp, argc, argv);
|
strip_main(ecp, argc, argv);
|
||||||
else if (strcmp(ecp->progname, "mcs") == 0)
|
else if (strrcmp(ecp->progname, "mcs") == 0)
|
||||||
mcs_main(ecp, argc, argv);
|
mcs_main(ecp, argc, argv);
|
||||||
else
|
else {
|
||||||
|
if (strrcmp(ecp->progname, "elfcopy") != 0 &&
|
||||||
|
strrcmp(ecp->progname, "objcopy") != 0)
|
||||||
|
warnx("program mode not known, defaulting to elfcopy");
|
||||||
elfcopy_main(ecp, argc, argv);
|
elfcopy_main(ecp, argc, argv);
|
||||||
|
}
|
||||||
|
|
||||||
free_sec_add(ecp);
|
free_sec_add(ecp);
|
||||||
free_sec_act(ecp);
|
free_sec_act(ecp);
|
||||||
|
@ -48,12 +48,6 @@
|
|||||||
|
|
||||||
ELFTC_VCSID("$Id: strings.c 3446 2016-05-03 01:31:17Z emaste $");
|
ELFTC_VCSID("$Id: strings.c 3446 2016-05-03 01:31:17Z emaste $");
|
||||||
|
|
||||||
enum return_code {
|
|
||||||
RETURN_OK,
|
|
||||||
RETURN_NOINPUT,
|
|
||||||
RETURN_SOFTWARE
|
|
||||||
};
|
|
||||||
|
|
||||||
enum radix_style {
|
enum radix_style {
|
||||||
RADIX_DECIMAL,
|
RADIX_DECIMAL,
|
||||||
RADIX_HEX,
|
RADIX_HEX,
|
||||||
@ -107,7 +101,7 @@ main(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
int ch, rc;
|
int ch, rc;
|
||||||
|
|
||||||
rc = RETURN_OK;
|
rc = 0;
|
||||||
min_len = 0;
|
min_len = 0;
|
||||||
encoding_size = 1;
|
encoding_size = 1;
|
||||||
if (elf_version(EV_CURRENT) == EV_NONE)
|
if (elf_version(EV_CURRENT) == EV_NONE)
|
||||||
@ -197,7 +191,8 @@ main(int argc, char **argv)
|
|||||||
if (!*argv)
|
if (!*argv)
|
||||||
rc = handle_file("{standard input}");
|
rc = handle_file("{standard input}");
|
||||||
else while (*argv) {
|
else while (*argv) {
|
||||||
rc = handle_file(*argv);
|
if (handle_file(*argv) != 0)
|
||||||
|
rc = 1;
|
||||||
argv++;
|
argv++;
|
||||||
}
|
}
|
||||||
return (rc);
|
return (rc);
|
||||||
@ -209,11 +204,11 @@ handle_file(const char *name)
|
|||||||
int fd, rt;
|
int fd, rt;
|
||||||
|
|
||||||
if (name == NULL)
|
if (name == NULL)
|
||||||
return (RETURN_NOINPUT);
|
return (1);
|
||||||
if (strcmp("{standard input}", name) != 0) {
|
if (strcmp("{standard input}", name) != 0) {
|
||||||
if (freopen(name, "rb", stdin) == NULL) {
|
if (freopen(name, "rb", stdin) == NULL) {
|
||||||
warnx("'%s': %s", name, strerror(errno));
|
warnx("'%s': %s", name, strerror(errno));
|
||||||
return (RETURN_NOINPUT);
|
return (1);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return (find_strings(name, (off_t)0, (off_t)0));
|
return (find_strings(name, (off_t)0, (off_t)0));
|
||||||
@ -221,7 +216,7 @@ handle_file(const char *name)
|
|||||||
|
|
||||||
fd = fileno(stdin);
|
fd = fileno(stdin);
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
return (RETURN_NOINPUT);
|
return (1);
|
||||||
rt = handle_elf(name, fd);
|
rt = handle_elf(name, fd);
|
||||||
return (rt);
|
return (rt);
|
||||||
}
|
}
|
||||||
@ -239,7 +234,7 @@ handle_binary(const char *name, int fd)
|
|||||||
(void) lseek(fd, (off_t)0, SEEK_SET);
|
(void) lseek(fd, (off_t)0, SEEK_SET);
|
||||||
if (!fstat(fd, &buf))
|
if (!fstat(fd, &buf))
|
||||||
return (find_strings(name, (off_t)0, buf.st_size));
|
return (find_strings(name, (off_t)0, buf.st_size));
|
||||||
return (RETURN_SOFTWARE);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -257,7 +252,7 @@ handle_elf(const char *name, int fd)
|
|||||||
Elf_Scn *scn;
|
Elf_Scn *scn;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
rc = RETURN_OK;
|
rc = 0;
|
||||||
/* If entire file is chosen, treat it as a binary file */
|
/* If entire file is chosen, treat it as a binary file */
|
||||||
if (entire_file)
|
if (entire_file)
|
||||||
return (handle_binary(name, fd));
|
return (handle_binary(name, fd));
|
||||||
@ -272,7 +267,7 @@ handle_elf(const char *name, int fd)
|
|||||||
if (gelf_getehdr(elf, &elfhdr) == NULL) {
|
if (gelf_getehdr(elf, &elfhdr) == NULL) {
|
||||||
(void) elf_end(elf);
|
(void) elf_end(elf);
|
||||||
warnx("%s: ELF file could not be processed", name);
|
warnx("%s: ELF file could not be processed", name);
|
||||||
return (RETURN_SOFTWARE);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (elfhdr.e_shnum == 0 && elfhdr.e_type == ET_CORE) {
|
if (elfhdr.e_shnum == 0 && elfhdr.e_type == ET_CORE) {
|
||||||
@ -352,7 +347,7 @@ find_strings(const char *name, off_t offset, off_t size)
|
|||||||
if ((obuf = (char*)calloc(1, min_len + 1)) == NULL) {
|
if ((obuf = (char*)calloc(1, min_len + 1)) == NULL) {
|
||||||
(void) fprintf(stderr, "Unable to allocate memory: %s\n",
|
(void) fprintf(stderr, "Unable to allocate memory: %s\n",
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
return (RETURN_SOFTWARE);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
(void) fseeko(stdin, offset, SEEK_SET);
|
(void) fseeko(stdin, offset, SEEK_SET);
|
||||||
@ -426,7 +421,7 @@ find_strings(const char *name, off_t offset, off_t size)
|
|||||||
}
|
}
|
||||||
_exit1:
|
_exit1:
|
||||||
free(obuf);
|
free(obuf);
|
||||||
return (RETURN_OK);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define USAGE_MESSAGE "\
|
#define USAGE_MESSAGE "\
|
||||||
|
77
contrib/gcc/config/rs6000/freebsdspe.h
Normal file
77
contrib/gcc/config/rs6000/freebsdspe.h
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
/* Definitions of target machine for GNU compiler,
|
||||||
|
for PowerPC e500 machines running FreeBSD.
|
||||||
|
Based on linuxspe.h
|
||||||
|
Copyright (C) 2003, 2004 Free Software Foundation, Inc.
|
||||||
|
Contributed by Aldy Hernandez (aldy@quesejoda.com).
|
||||||
|
|
||||||
|
This file is part of GCC.
|
||||||
|
|
||||||
|
GCC is free software; you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published
|
||||||
|
by the Free Software Foundation; either version 2, or (at your
|
||||||
|
option) any later version.
|
||||||
|
|
||||||
|
GCC is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
||||||
|
License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with GCC; see the file COPYING. If not, write to the
|
||||||
|
Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
|
||||||
|
MA 02110-1301, USA. */
|
||||||
|
|
||||||
|
#undef TARGET_VERSION
|
||||||
|
#define TARGET_VERSION fprintf (stderr, " (PowerPC E500 FreeBSD)");
|
||||||
|
|
||||||
|
/* Override rs6000.h and sysv4.h definition. */
|
||||||
|
#undef TARGET_DEFAULT
|
||||||
|
#define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS | MASK_STRICT_ALIGN)
|
||||||
|
|
||||||
|
#undef TARGET_SPE_ABI
|
||||||
|
#undef TARGET_SPE
|
||||||
|
#undef TARGET_E500
|
||||||
|
#undef TARGET_ISEL
|
||||||
|
#undef TARGET_FPRS
|
||||||
|
#undef TARGET_E500_SINGLE
|
||||||
|
#undef TARGET_E500_DOUBLE
|
||||||
|
|
||||||
|
#define TARGET_SPE_ABI rs6000_spe_abi
|
||||||
|
#define TARGET_SPE rs6000_spe
|
||||||
|
#define TARGET_E500 (rs6000_cpu == PROCESSOR_PPC8540)
|
||||||
|
#define TARGET_ISEL rs6000_isel
|
||||||
|
#define TARGET_FPRS (rs6000_float_gprs == 0)
|
||||||
|
#define TARGET_E500_SINGLE (TARGET_HARD_FLOAT && rs6000_float_gprs == 1)
|
||||||
|
#define TARGET_E500_DOUBLE (TARGET_HARD_FLOAT && rs6000_float_gprs == 2)
|
||||||
|
|
||||||
|
#undef SUBSUBTARGET_OVERRIDE_OPTIONS
|
||||||
|
#define SUBSUBTARGET_OVERRIDE_OPTIONS \
|
||||||
|
if (rs6000_select[1].string == NULL) \
|
||||||
|
rs6000_cpu = PROCESSOR_PPC8540; \
|
||||||
|
if (!rs6000_explicit_options.abi) \
|
||||||
|
rs6000_spe_abi = 1; \
|
||||||
|
if (!rs6000_explicit_options.float_gprs) \
|
||||||
|
rs6000_float_gprs = 1; \
|
||||||
|
/* See note below. */ \
|
||||||
|
/*if (!rs6000_explicit_options.long_double)*/ \
|
||||||
|
/* rs6000_long_double_type_size = 128;*/ \
|
||||||
|
if (!rs6000_explicit_options.spe) \
|
||||||
|
rs6000_spe = 1; \
|
||||||
|
if (!rs6000_explicit_options.isel) \
|
||||||
|
rs6000_isel = 1; \
|
||||||
|
if (target_flags & MASK_64BIT) \
|
||||||
|
error ("-m64 not supported in this configuration")
|
||||||
|
|
||||||
|
/* The e500 ABI says that either long doubles are 128 bits, or if
|
||||||
|
implemented in any other size, the compiler/linker should error out.
|
||||||
|
We have no emulation libraries for 128 bit long doubles, and I hate
|
||||||
|
the dozens of failures on the regression suite. So I'm breaking ABI
|
||||||
|
specifications, until I properly fix the emulation.
|
||||||
|
|
||||||
|
Enable these later.
|
||||||
|
#undef CPP_LONGDOUBLE_DEFAULT_SPEC
|
||||||
|
#define CPP_LONGDOUBLE_DEFAULT_SPEC "-D__LONG_DOUBLE_128__=1"
|
||||||
|
*/
|
||||||
|
|
||||||
|
#undef ASM_DEFAULT_SPEC
|
||||||
|
#define ASM_DEFAULT_SPEC "-mppc -mspe -me500"
|
@ -1,3 +1,6 @@
|
|||||||
|
Oct 23, 2016: libarchive 3.2.2 released
|
||||||
|
Security release
|
||||||
|
|
||||||
Jun 20, 2016: libarchive 3.2.1 released
|
Jun 20, 2016: libarchive 3.2.1 released
|
||||||
This fixes a handful of security and other critical issues with 3.2.0
|
This fixes a handful of security and other critical issues with 3.2.0
|
||||||
|
|
||||||
|
@ -129,6 +129,13 @@
|
|||||||
# include <crtdbg.h>
|
# include <crtdbg.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
mode_t umasked(mode_t expected_mode)
|
||||||
|
{
|
||||||
|
mode_t mode = umask(0);
|
||||||
|
umask(mode);
|
||||||
|
return expected_mode & ~mode;
|
||||||
|
}
|
||||||
|
|
||||||
/* Path to working directory for current test */
|
/* Path to working directory for current test */
|
||||||
const char *testworkdir;
|
const char *testworkdir;
|
||||||
#ifdef PROGRAM
|
#ifdef PROGRAM
|
||||||
@ -1156,6 +1163,35 @@ assertion_file_contains_lines_any_order(const char *file, int line,
|
|||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Verify that a text file does not contains the specified strings */
|
||||||
|
int
|
||||||
|
assertion_file_contains_no_invalid_strings(const char *file, int line,
|
||||||
|
const char *pathname, const char *strings[])
|
||||||
|
{
|
||||||
|
char *buff;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
buff = slurpfile(NULL, "%s", pathname);
|
||||||
|
if (buff == NULL) {
|
||||||
|
failure_start(file, line, "Can't read file: %s", pathname);
|
||||||
|
failure_finish(NULL);
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; strings[i] != NULL; ++i) {
|
||||||
|
if (strstr(buff, strings[i]) != NULL) {
|
||||||
|
failure_start(file, line, "Invalid string in %s: %s", pathname,
|
||||||
|
strings[i]);
|
||||||
|
failure_finish(NULL);
|
||||||
|
free(buff);
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
free(buff);
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
/* Test that two paths point to the same file. */
|
/* Test that two paths point to the same file. */
|
||||||
/* As a side-effect, asserts that both files exist. */
|
/* As a side-effect, asserts that both files exist. */
|
||||||
static int
|
static int
|
||||||
@ -1293,6 +1329,11 @@ assertion_file_time(const char *file, int line,
|
|||||||
switch (type) {
|
switch (type) {
|
||||||
case 'a': filet_nsec = st.st_atimespec.tv_nsec; break;
|
case 'a': filet_nsec = st.st_atimespec.tv_nsec; break;
|
||||||
case 'b': filet = st.st_birthtime;
|
case 'b': filet = st.st_birthtime;
|
||||||
|
/* FreeBSD filesystems that don't support birthtime
|
||||||
|
* (e.g., UFS1) always return -1 here. */
|
||||||
|
if (filet == -1) {
|
||||||
|
return (1);
|
||||||
|
}
|
||||||
filet_nsec = st.st_birthtimespec.tv_nsec; break;
|
filet_nsec = st.st_birthtimespec.tv_nsec; break;
|
||||||
case 'm': filet_nsec = st.st_mtimespec.tv_nsec; break;
|
case 'm': filet_nsec = st.st_mtimespec.tv_nsec; break;
|
||||||
default: fprintf(stderr, "INTERNAL: Bad type %c for file time", type);
|
default: fprintf(stderr, "INTERNAL: Bad type %c for file time", type);
|
||||||
@ -1370,6 +1411,8 @@ assertion_file_mode(const char *file, int line, const char *pathname, int expect
|
|||||||
assertion_count(file, line);
|
assertion_count(file, line);
|
||||||
#if defined(_WIN32) && !defined(__CYGWIN__)
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||||
failure_start(file, line, "assertFileMode not yet implemented for Windows");
|
failure_start(file, line, "assertFileMode not yet implemented for Windows");
|
||||||
|
(void)mode; /* UNUSED */
|
||||||
|
(void)r; /* UNUSED */
|
||||||
#else
|
#else
|
||||||
{
|
{
|
||||||
struct stat st;
|
struct stat st;
|
||||||
@ -1424,7 +1467,7 @@ assertion_file_nlinks(const char *file, int line,
|
|||||||
assertion_count(file, line);
|
assertion_count(file, line);
|
||||||
r = lstat(pathname, &st);
|
r = lstat(pathname, &st);
|
||||||
if (r == 0 && (int)st.st_nlink == nlinks)
|
if (r == 0 && (int)st.st_nlink == nlinks)
|
||||||
return (1);
|
return (1);
|
||||||
failure_start(file, line, "File %s has %d links, expected %d",
|
failure_start(file, line, "File %s has %d links, expected %d",
|
||||||
pathname, st.st_nlink, nlinks);
|
pathname, st.st_nlink, nlinks);
|
||||||
failure_finish(NULL);
|
failure_finish(NULL);
|
||||||
@ -1660,6 +1703,7 @@ assertion_make_file(const char *file, int line,
|
|||||||
if (0 != chmod(path, mode)) {
|
if (0 != chmod(path, mode)) {
|
||||||
failure_start(file, line, "Could not chmod %s", path);
|
failure_start(file, line, "Could not chmod %s", path);
|
||||||
failure_finish(NULL);
|
failure_finish(NULL);
|
||||||
|
close(fd);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
if (contents != NULL) {
|
if (contents != NULL) {
|
||||||
@ -1674,6 +1718,7 @@ assertion_make_file(const char *file, int line,
|
|||||||
failure_start(file, line,
|
failure_start(file, line,
|
||||||
"Could not write to %s", path);
|
"Could not write to %s", path);
|
||||||
failure_finish(NULL);
|
failure_finish(NULL);
|
||||||
|
close(fd);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -174,6 +174,9 @@
|
|||||||
/* Assert that file contents match a string. */
|
/* Assert that file contents match a string. */
|
||||||
#define assertFileContents(data, data_size, pathname) \
|
#define assertFileContents(data, data_size, pathname) \
|
||||||
assertion_file_contents(__FILE__, __LINE__, data, data_size, pathname)
|
assertion_file_contents(__FILE__, __LINE__, data, data_size, pathname)
|
||||||
|
/* Verify that a file does not contain invalid strings */
|
||||||
|
#define assertFileContainsNoInvalidStrings(pathname, strings) \
|
||||||
|
assertion_file_contains_no_invalid_strings(__FILE__, __LINE__, pathname, strings)
|
||||||
#define assertFileMtime(pathname, sec, nsec) \
|
#define assertFileMtime(pathname, sec, nsec) \
|
||||||
assertion_file_mtime(__FILE__, __LINE__, pathname, sec, nsec)
|
assertion_file_mtime(__FILE__, __LINE__, pathname, sec, nsec)
|
||||||
#define assertFileMtimeRecent(pathname) \
|
#define assertFileMtimeRecent(pathname) \
|
||||||
@ -182,6 +185,8 @@
|
|||||||
assertion_file_nlinks(__FILE__, __LINE__, pathname, nlinks)
|
assertion_file_nlinks(__FILE__, __LINE__, pathname, nlinks)
|
||||||
#define assertFileSize(pathname, size) \
|
#define assertFileSize(pathname, size) \
|
||||||
assertion_file_size(__FILE__, __LINE__, pathname, size)
|
assertion_file_size(__FILE__, __LINE__, pathname, size)
|
||||||
|
#define assertFileMode(pathname, mode) \
|
||||||
|
assertion_file_mode(__FILE__, __LINE__, pathname, mode)
|
||||||
#define assertTextFileContents(text, pathname) \
|
#define assertTextFileContents(text, pathname) \
|
||||||
assertion_text_file_contents(__FILE__, __LINE__, text, pathname)
|
assertion_text_file_contents(__FILE__, __LINE__, text, pathname)
|
||||||
#define assertFileContainsLinesAnyOrder(pathname, lines) \
|
#define assertFileContainsLinesAnyOrder(pathname, lines) \
|
||||||
@ -239,6 +244,7 @@ int assertion_file_atime_recent(const char *, int, const char *);
|
|||||||
int assertion_file_birthtime(const char *, int, const char *, long, long);
|
int assertion_file_birthtime(const char *, int, const char *, long, long);
|
||||||
int assertion_file_birthtime_recent(const char *, int, const char *);
|
int assertion_file_birthtime_recent(const char *, int, const char *);
|
||||||
int assertion_file_contains_lines_any_order(const char *, int, const char *, const char **);
|
int assertion_file_contains_lines_any_order(const char *, int, const char *, const char **);
|
||||||
|
int assertion_file_contains_no_invalid_strings(const char *, int, const char *, const char **);
|
||||||
int assertion_file_contents(const char *, int, const void *, int, const char *);
|
int assertion_file_contents(const char *, int, const void *, int, const char *);
|
||||||
int assertion_file_exists(const char *, int, const char *);
|
int assertion_file_exists(const char *, int, const char *);
|
||||||
int assertion_file_mode(const char *, int, const char *, int);
|
int assertion_file_mode(const char *, int, const char *, int);
|
||||||
@ -327,6 +333,9 @@ void copy_reference_file(const char *);
|
|||||||
*/
|
*/
|
||||||
void extract_reference_files(const char **);
|
void extract_reference_files(const char **);
|
||||||
|
|
||||||
|
/* Subtract umask from mode */
|
||||||
|
mode_t umasked(mode_t expected_mode);
|
||||||
|
|
||||||
/* Path to working directory for current test */
|
/* Path to working directory for current test */
|
||||||
extern const char *testworkdir;
|
extern const char *testworkdir;
|
||||||
|
|
||||||
|
@ -1164,6 +1164,35 @@ assertion_file_contains_lines_any_order(const char *file, int line,
|
|||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Verify that a text file does not contains the specified strings */
|
||||||
|
int
|
||||||
|
assertion_file_contains_no_invalid_strings(const char *file, int line,
|
||||||
|
const char *pathname, const char *strings[])
|
||||||
|
{
|
||||||
|
char *buff;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
buff = slurpfile(NULL, "%s", pathname);
|
||||||
|
if (buff == NULL) {
|
||||||
|
failure_start(file, line, "Can't read file: %s", pathname);
|
||||||
|
failure_finish(NULL);
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; strings[i] != NULL; ++i) {
|
||||||
|
if (strstr(buff, strings[i]) != NULL) {
|
||||||
|
failure_start(file, line, "Invalid string in %s: %s", pathname,
|
||||||
|
strings[i]);
|
||||||
|
failure_finish(NULL);
|
||||||
|
free(buff);
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
free(buff);
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
/* Test that two paths point to the same file. */
|
/* Test that two paths point to the same file. */
|
||||||
/* As a side-effect, asserts that both files exist. */
|
/* As a side-effect, asserts that both files exist. */
|
||||||
static int
|
static int
|
||||||
@ -1383,6 +1412,8 @@ assertion_file_mode(const char *file, int line, const char *pathname, int expect
|
|||||||
assertion_count(file, line);
|
assertion_count(file, line);
|
||||||
#if defined(_WIN32) && !defined(__CYGWIN__)
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||||
failure_start(file, line, "assertFileMode not yet implemented for Windows");
|
failure_start(file, line, "assertFileMode not yet implemented for Windows");
|
||||||
|
(void)mode; /* UNUSED */
|
||||||
|
(void)r; /* UNUSED */
|
||||||
#else
|
#else
|
||||||
{
|
{
|
||||||
struct stat st;
|
struct stat st;
|
||||||
|
@ -174,6 +174,9 @@
|
|||||||
/* Assert that file contents match a string. */
|
/* Assert that file contents match a string. */
|
||||||
#define assertFileContents(data, data_size, pathname) \
|
#define assertFileContents(data, data_size, pathname) \
|
||||||
assertion_file_contents(__FILE__, __LINE__, data, data_size, pathname)
|
assertion_file_contents(__FILE__, __LINE__, data, data_size, pathname)
|
||||||
|
/* Verify that a file does not contain invalid strings */
|
||||||
|
#define assertFileContainsNoInvalidStrings(pathname, strings) \
|
||||||
|
assertion_file_contains_no_invalid_strings(__FILE__, __LINE__, pathname, strings)
|
||||||
#define assertFileMtime(pathname, sec, nsec) \
|
#define assertFileMtime(pathname, sec, nsec) \
|
||||||
assertion_file_mtime(__FILE__, __LINE__, pathname, sec, nsec)
|
assertion_file_mtime(__FILE__, __LINE__, pathname, sec, nsec)
|
||||||
#define assertFileMtimeRecent(pathname) \
|
#define assertFileMtimeRecent(pathname) \
|
||||||
@ -241,6 +244,7 @@ int assertion_file_atime_recent(const char *, int, const char *);
|
|||||||
int assertion_file_birthtime(const char *, int, const char *, long, long);
|
int assertion_file_birthtime(const char *, int, const char *, long, long);
|
||||||
int assertion_file_birthtime_recent(const char *, int, const char *);
|
int assertion_file_birthtime_recent(const char *, int, const char *);
|
||||||
int assertion_file_contains_lines_any_order(const char *, int, const char *, const char **);
|
int assertion_file_contains_lines_any_order(const char *, int, const char *, const char **);
|
||||||
|
int assertion_file_contains_no_invalid_strings(const char *, int, const char *, const char **);
|
||||||
int assertion_file_contents(const char *, int, const void *, int, const char *);
|
int assertion_file_contents(const char *, int, const void *, int, const char *);
|
||||||
int assertion_file_exists(const char *, int, const char *);
|
int assertion_file_exists(const char *, int, const char *);
|
||||||
int assertion_file_mode(const char *, int, const char *, int);
|
int assertion_file_mode(const char *, int, const char *, int);
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
* assert that ARCHIVE_VERSION_NUMBER >= 2012108.
|
* assert that ARCHIVE_VERSION_NUMBER >= 2012108.
|
||||||
*/
|
*/
|
||||||
/* Note: Compiler will complain if this does not match archive_entry.h! */
|
/* Note: Compiler will complain if this does not match archive_entry.h! */
|
||||||
#define ARCHIVE_VERSION_NUMBER 3002001
|
#define ARCHIVE_VERSION_NUMBER 3002002
|
||||||
|
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <stddef.h> /* for wchar_t */
|
#include <stddef.h> /* for wchar_t */
|
||||||
@ -155,7 +155,7 @@ __LA_DECL int archive_version_number(void);
|
|||||||
/*
|
/*
|
||||||
* Textual name/version of the library, useful for version displays.
|
* Textual name/version of the library, useful for version displays.
|
||||||
*/
|
*/
|
||||||
#define ARCHIVE_VERSION_ONLY_STRING "3.2.1"
|
#define ARCHIVE_VERSION_ONLY_STRING "3.2.2"
|
||||||
#define ARCHIVE_VERSION_STRING "libarchive " ARCHIVE_VERSION_ONLY_STRING
|
#define ARCHIVE_VERSION_STRING "libarchive " ARCHIVE_VERSION_ONLY_STRING
|
||||||
__LA_DECL const char * archive_version_string(void);
|
__LA_DECL const char * archive_version_string(void);
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
#define ARCHIVE_ENTRY_H_INCLUDED
|
#define ARCHIVE_ENTRY_H_INCLUDED
|
||||||
|
|
||||||
/* Note: Compiler will complain if this does not match archive.h! */
|
/* Note: Compiler will complain if this does not match archive.h! */
|
||||||
#define ARCHIVE_VERSION_NUMBER 3002001
|
#define ARCHIVE_VERSION_NUMBER 3002002
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Note: archive_entry.h is for use outside of libarchive; the
|
* Note: archive_entry.h is for use outside of libarchive; the
|
||||||
|
@ -1162,6 +1162,35 @@ assertion_file_contains_lines_any_order(const char *file, int line,
|
|||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Verify that a text file does not contains the specified strings */
|
||||||
|
int
|
||||||
|
assertion_file_contains_no_invalid_strings(const char *file, int line,
|
||||||
|
const char *pathname, const char *strings[])
|
||||||
|
{
|
||||||
|
char *buff;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
buff = slurpfile(NULL, "%s", pathname);
|
||||||
|
if (buff == NULL) {
|
||||||
|
failure_start(file, line, "Can't read file: %s", pathname);
|
||||||
|
failure_finish(NULL);
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; strings[i] != NULL; ++i) {
|
||||||
|
if (strstr(buff, strings[i]) != NULL) {
|
||||||
|
failure_start(file, line, "Invalid string in %s: %s", pathname,
|
||||||
|
strings[i]);
|
||||||
|
failure_finish(NULL);
|
||||||
|
free(buff);
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
free(buff);
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
/* Test that two paths point to the same file. */
|
/* Test that two paths point to the same file. */
|
||||||
/* As a side-effect, asserts that both files exist. */
|
/* As a side-effect, asserts that both files exist. */
|
||||||
static int
|
static int
|
||||||
@ -1381,6 +1410,8 @@ assertion_file_mode(const char *file, int line, const char *pathname, int expect
|
|||||||
assertion_count(file, line);
|
assertion_count(file, line);
|
||||||
#if defined(_WIN32) && !defined(__CYGWIN__)
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||||
failure_start(file, line, "assertFileMode not yet implemented for Windows");
|
failure_start(file, line, "assertFileMode not yet implemented for Windows");
|
||||||
|
(void)mode; /* UNUSED */
|
||||||
|
(void)r; /* UNUSED */
|
||||||
#else
|
#else
|
||||||
{
|
{
|
||||||
struct stat st;
|
struct stat st;
|
||||||
|
@ -174,6 +174,9 @@
|
|||||||
/* Assert that file contents match a string. */
|
/* Assert that file contents match a string. */
|
||||||
#define assertFileContents(data, data_size, pathname) \
|
#define assertFileContents(data, data_size, pathname) \
|
||||||
assertion_file_contents(__FILE__, __LINE__, data, data_size, pathname)
|
assertion_file_contents(__FILE__, __LINE__, data, data_size, pathname)
|
||||||
|
/* Verify that a file does not contain invalid strings */
|
||||||
|
#define assertFileContainsNoInvalidStrings(pathname, strings) \
|
||||||
|
assertion_file_contains_no_invalid_strings(__FILE__, __LINE__, pathname, strings)
|
||||||
#define assertFileMtime(pathname, sec, nsec) \
|
#define assertFileMtime(pathname, sec, nsec) \
|
||||||
assertion_file_mtime(__FILE__, __LINE__, pathname, sec, nsec)
|
assertion_file_mtime(__FILE__, __LINE__, pathname, sec, nsec)
|
||||||
#define assertFileMtimeRecent(pathname) \
|
#define assertFileMtimeRecent(pathname) \
|
||||||
@ -241,6 +244,7 @@ int assertion_file_atime_recent(const char *, int, const char *);
|
|||||||
int assertion_file_birthtime(const char *, int, const char *, long, long);
|
int assertion_file_birthtime(const char *, int, const char *, long, long);
|
||||||
int assertion_file_birthtime_recent(const char *, int, const char *);
|
int assertion_file_birthtime_recent(const char *, int, const char *);
|
||||||
int assertion_file_contains_lines_any_order(const char *, int, const char *, const char **);
|
int assertion_file_contains_lines_any_order(const char *, int, const char *, const char **);
|
||||||
|
int assertion_file_contains_no_invalid_strings(const char *, int, const char *, const char **);
|
||||||
int assertion_file_contents(const char *, int, const void *, int, const char *);
|
int assertion_file_contents(const char *, int, const void *, int, const char *);
|
||||||
int assertion_file_exists(const char *, int, const char *);
|
int assertion_file_exists(const char *, int, const char *);
|
||||||
int assertion_file_mode(const char *, int, const char *, int);
|
int assertion_file_mode(const char *, int, const char *, int);
|
||||||
|
@ -33,6 +33,11 @@ DEFINE_TEST(test_read_format_mtree_crash747)
|
|||||||
const char *reffile = "test_read_format_mtree_crash747.mtree.bz2";
|
const char *reffile = "test_read_format_mtree_crash747.mtree.bz2";
|
||||||
struct archive *a;
|
struct archive *a;
|
||||||
|
|
||||||
|
if (archive_bzlib_version() == NULL) {
|
||||||
|
skipping("This test requires bzlib");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
extract_reference_file(reffile);
|
extract_reference_file(reffile);
|
||||||
|
|
||||||
assert((a = archive_read_new()) != NULL);
|
assert((a = archive_read_new()) != NULL);
|
||||||
|
@ -50,6 +50,11 @@ DEFINE_TEST(test_read_format_zip_high_compression)
|
|||||||
size_t s;
|
size_t s;
|
||||||
int64_t o;
|
int64_t o;
|
||||||
|
|
||||||
|
if (archive_zlib_version() == NULL) {
|
||||||
|
skipping("Zip compression test requires zlib");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
extract_reference_file(refname);
|
extract_reference_file(refname);
|
||||||
p = slurpfile(&archive_size, refname);
|
p = slurpfile(&archive_size, refname);
|
||||||
|
|
||||||
@ -82,6 +87,11 @@ DEFINE_TEST(test_read_format_zip_high_compression2)
|
|||||||
char *body, *body_read, *buff;
|
char *body, *body_read, *buff;
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
|
if (archive_zlib_version() == NULL) {
|
||||||
|
skipping("Zip compression test requires zlib");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
assert((body = malloc(body_size)) != NULL);
|
assert((body = malloc(body_size)) != NULL);
|
||||||
assert((body_read = malloc(body_size)) != NULL);
|
assert((body_read = malloc(body_size)) != NULL);
|
||||||
assert((buff = malloc(buff_size)) != NULL);
|
assert((buff = malloc(buff_size)) != NULL);
|
||||||
|
@ -133,11 +133,12 @@ DEFINE_TEST(test_read_append_filter)
|
|||||||
assert((a = archive_read_new()) != NULL);
|
assert((a = archive_read_new()) != NULL);
|
||||||
assertA(0 == archive_read_set_format(a, ARCHIVE_FORMAT_TAR));
|
assertA(0 == archive_read_set_format(a, ARCHIVE_FORMAT_TAR));
|
||||||
r = archive_read_append_filter(a, ARCHIVE_FILTER_GZIP);
|
r = archive_read_append_filter(a, ARCHIVE_FILTER_GZIP);
|
||||||
if (r == ARCHIVE_WARN && !canGzip()) {
|
if (r != ARCHIVE_OK && archive_zlib_version() == NULL && !canGzip()) {
|
||||||
skipping("gzip reading not fully supported on this platform");
|
skipping("gzip tests require zlib or working gzip command");
|
||||||
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
|
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
assertEqualIntA(a, ARCHIVE_OK, r);
|
||||||
assertEqualInt(ARCHIVE_OK,
|
assertEqualInt(ARCHIVE_OK,
|
||||||
archive_read_open_memory(a, archive, sizeof(archive)));
|
archive_read_open_memory(a, archive, sizeof(archive)));
|
||||||
assertEqualInt(ARCHIVE_OK, archive_read_next_header(a, &ae));
|
assertEqualInt(ARCHIVE_OK, archive_read_next_header(a, &ae));
|
||||||
@ -200,8 +201,11 @@ DEFINE_TEST(test_read_append_filter_wrong_program)
|
|||||||
{
|
{
|
||||||
struct archive_entry *ae;
|
struct archive_entry *ae;
|
||||||
struct archive *a;
|
struct archive *a;
|
||||||
|
#if !defined(_WIN32) || defined(__CYGWIN__)
|
||||||
|
FILE * fp;
|
||||||
int fd;
|
int fd;
|
||||||
fpos_t pos;
|
fpos_t pos;
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If we have "bunzip2 -q", try using that.
|
* If we have "bunzip2 -q", try using that.
|
||||||
@ -211,11 +215,13 @@ DEFINE_TEST(test_read_append_filter_wrong_program)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !defined(_WIN32) || defined(__CYGWIN__)
|
||||||
/* bunzip2 will write to stderr, redirect it to a file */
|
/* bunzip2 will write to stderr, redirect it to a file */
|
||||||
fflush(stderr);
|
fflush(stderr);
|
||||||
fgetpos(stderr, &pos);
|
fgetpos(stderr, &pos);
|
||||||
fd = dup(fileno(stderr));
|
fd = dup(fileno(stderr));
|
||||||
freopen("stderr1", "w", stderr);
|
fp = freopen("stderr1", "w", stderr);
|
||||||
|
#endif
|
||||||
|
|
||||||
assert((a = archive_read_new()) != NULL);
|
assert((a = archive_read_new()) != NULL);
|
||||||
assertA(0 == archive_read_set_format(a, ARCHIVE_FORMAT_TAR));
|
assertA(0 == archive_read_set_format(a, ARCHIVE_FORMAT_TAR));
|
||||||
@ -227,12 +233,15 @@ DEFINE_TEST(test_read_append_filter_wrong_program)
|
|||||||
assertEqualIntA(a, ARCHIVE_WARN, archive_read_close(a));
|
assertEqualIntA(a, ARCHIVE_WARN, archive_read_close(a));
|
||||||
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
|
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
|
||||||
|
|
||||||
/* restore stderr */
|
#if !defined(_WIN32) || defined(__CYGWIN__)
|
||||||
fflush(stderr);
|
/* restore stderr and verify results */
|
||||||
dup2(fd, fileno(stderr));
|
if (fp != NULL) {
|
||||||
close(fd);
|
fflush(stderr);
|
||||||
clearerr(stderr);
|
dup2(fd, fileno(stderr));
|
||||||
fsetpos(stderr, &pos);
|
close(fd);
|
||||||
|
clearerr(stderr);
|
||||||
|
fsetpos(stderr, &pos);
|
||||||
|
}
|
||||||
assertTextFileContents("bunzip2: (stdin) is not a bzip2 file.\n", "stderr1");
|
assertTextFileContents("bunzip2: (stdin) is not a bzip2 file.\n", "stderr1");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -117,8 +117,8 @@ DEFINE_TEST(test_write_format_iso9660)
|
|||||||
*/
|
*/
|
||||||
dirname[0] = '\0';
|
dirname[0] = '\0';
|
||||||
strcpy(dir, "/dir0");
|
strcpy(dir, "/dir0");
|
||||||
for (i = 0; i < 10; i++) {
|
for (i = 0; i < 13; i++) {
|
||||||
dir[4] = '0' + i;
|
dir[4] = "0123456789ABCDEF"[i];
|
||||||
if (i == 0)
|
if (i == 0)
|
||||||
strcat(dirname, dir+1);
|
strcat(dirname, dir+1);
|
||||||
else
|
else
|
||||||
@ -134,6 +134,19 @@ DEFINE_TEST(test_write_format_iso9660)
|
|||||||
archive_entry_free(ae);
|
archive_entry_free(ae);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
strcat(dirname, "/file");
|
||||||
|
assert((ae = archive_entry_new()) != NULL);
|
||||||
|
archive_entry_set_atime(ae, 2, 20);
|
||||||
|
archive_entry_set_birthtime(ae, 3, 30);
|
||||||
|
archive_entry_set_ctime(ae, 4, 40);
|
||||||
|
archive_entry_set_mtime(ae, 5, 50);
|
||||||
|
archive_entry_copy_pathname(ae, dirname);
|
||||||
|
archive_entry_set_mode(ae, S_IFREG | 0755);
|
||||||
|
archive_entry_set_size(ae, 8);
|
||||||
|
assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae));
|
||||||
|
archive_entry_free(ae);
|
||||||
|
assertEqualIntA(a, 8, archive_write_data(a, "12345678", 9));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* "dir0/dir1/file1" has 8 bytes of data.
|
* "dir0/dir1/file1" has 8 bytes of data.
|
||||||
*/
|
*/
|
||||||
@ -332,6 +345,45 @@ DEFINE_TEST(test_write_format_iso9660)
|
|||||||
assert((S_IFDIR | 0555) == archive_entry_mode(ae));
|
assert((S_IFDIR | 0555) == archive_entry_mode(ae));
|
||||||
assertEqualInt(2048, archive_entry_size(ae));
|
assertEqualInt(2048, archive_entry_size(ae));
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Read "dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dirA"
|
||||||
|
*/
|
||||||
|
assertEqualIntA(a, 0, archive_read_next_header(a, &ae));
|
||||||
|
assertEqualInt(2, archive_entry_atime(ae));
|
||||||
|
assertEqualInt(3, archive_entry_birthtime(ae));
|
||||||
|
assertEqualInt(4, archive_entry_ctime(ae));
|
||||||
|
assertEqualInt(5, archive_entry_mtime(ae));
|
||||||
|
assertEqualString("dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dirA",
|
||||||
|
archive_entry_pathname(ae));
|
||||||
|
assert((S_IFDIR | 0555) == archive_entry_mode(ae));
|
||||||
|
assertEqualInt(2048, archive_entry_size(ae));
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Read "dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dirA/dirB"
|
||||||
|
*/
|
||||||
|
assertEqualIntA(a, 0, archive_read_next_header(a, &ae));
|
||||||
|
assertEqualInt(2, archive_entry_atime(ae));
|
||||||
|
assertEqualInt(3, archive_entry_birthtime(ae));
|
||||||
|
assertEqualInt(4, archive_entry_ctime(ae));
|
||||||
|
assertEqualInt(5, archive_entry_mtime(ae));
|
||||||
|
assertEqualString("dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dirA/dirB",
|
||||||
|
archive_entry_pathname(ae));
|
||||||
|
assert((S_IFDIR | 0555) == archive_entry_mode(ae));
|
||||||
|
assertEqualInt(2048, archive_entry_size(ae));
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Read "dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dirA/dirB/dirC"
|
||||||
|
*/
|
||||||
|
assertEqualIntA(a, 0, archive_read_next_header(a, &ae));
|
||||||
|
assertEqualInt(2, archive_entry_atime(ae));
|
||||||
|
assertEqualInt(3, archive_entry_birthtime(ae));
|
||||||
|
assertEqualInt(4, archive_entry_ctime(ae));
|
||||||
|
assertEqualInt(5, archive_entry_mtime(ae));
|
||||||
|
assertEqualString("dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dirA/dirB/dirC",
|
||||||
|
archive_entry_pathname(ae));
|
||||||
|
assert((S_IFDIR | 0555) == archive_entry_mode(ae));
|
||||||
|
assertEqualInt(2048, archive_entry_size(ae));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Read "hardlnk"
|
* Read "hardlnk"
|
||||||
*/
|
*/
|
||||||
@ -385,6 +437,21 @@ DEFINE_TEST(test_write_format_iso9660)
|
|||||||
assertEqualIntA(a, 8, archive_read_data(a, buff2, 10));
|
assertEqualIntA(a, 8, archive_read_data(a, buff2, 10));
|
||||||
assertEqualMem(buff2, "12345678", 8);
|
assertEqualMem(buff2, "12345678", 8);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Read "dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dirA/dirB/dirC/file"
|
||||||
|
*/
|
||||||
|
assertEqualIntA(a, 0, archive_read_next_header(a, &ae));
|
||||||
|
assertEqualInt(2, archive_entry_atime(ae));
|
||||||
|
assertEqualInt(3, archive_entry_birthtime(ae));
|
||||||
|
assertEqualInt(4, archive_entry_ctime(ae));
|
||||||
|
assertEqualInt(5, archive_entry_mtime(ae));
|
||||||
|
assertEqualString("dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dirA/dirB/dirC/file", archive_entry_pathname(ae));
|
||||||
|
assert((AE_IFREG | 0555) == archive_entry_mode(ae));
|
||||||
|
assertEqualInt(1, archive_entry_nlink(ae));
|
||||||
|
assertEqualInt(8, archive_entry_size(ae));
|
||||||
|
assertEqualIntA(a, 8, archive_read_data(a, buff2, 10));
|
||||||
|
assertEqualMem(buff2, "12345678", 8);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Read "dir0/dir1/file1"
|
* Read "dir0/dir1/file1"
|
||||||
*/
|
*/
|
||||||
@ -580,18 +647,40 @@ DEFINE_TEST(test_write_format_iso9660)
|
|||||||
assertEqualInt(2048, archive_entry_size(ae));
|
assertEqualInt(2048, archive_entry_size(ae));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Read "hardlnk"
|
* Read "dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dirA"
|
||||||
*/
|
*/
|
||||||
assertEqualIntA(a, 0, archive_read_next_header(a, &ae));
|
assertEqualIntA(a, 0, archive_read_next_header(a, &ae));
|
||||||
assertEqualInt(5, archive_entry_atime(ae));
|
assertEqualInt(5, archive_entry_atime(ae));
|
||||||
assertEqualInt(5, archive_entry_ctime(ae));
|
assertEqualInt(5, archive_entry_ctime(ae));
|
||||||
assertEqualInt(5, archive_entry_mtime(ae));
|
assertEqualInt(5, archive_entry_mtime(ae));
|
||||||
assertEqualString("hardlnk", archive_entry_pathname(ae));
|
assertEqualString("dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dirA",
|
||||||
assert((AE_IFREG | 0400) == archive_entry_mode(ae));
|
archive_entry_pathname(ae));
|
||||||
assertEqualInt(2, archive_entry_nlink(ae));
|
assert((S_IFDIR | 0700) == archive_entry_mode(ae));
|
||||||
assertEqualInt(8, archive_entry_size(ae));
|
assertEqualInt(2048, archive_entry_size(ae));
|
||||||
assertEqualIntA(a, 8, archive_read_data(a, buff2, 10));
|
|
||||||
assertEqualMem(buff2, "12345678", 8);
|
/*
|
||||||
|
* Read "dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dirA/dirB"
|
||||||
|
*/
|
||||||
|
assertEqualIntA(a, 0, archive_read_next_header(a, &ae));
|
||||||
|
assertEqualInt(5, archive_entry_atime(ae));
|
||||||
|
assertEqualInt(5, archive_entry_ctime(ae));
|
||||||
|
assertEqualInt(5, archive_entry_mtime(ae));
|
||||||
|
assertEqualString("dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dirA/dirB",
|
||||||
|
archive_entry_pathname(ae));
|
||||||
|
assert((S_IFDIR | 0700) == archive_entry_mode(ae));
|
||||||
|
assertEqualInt(2048, archive_entry_size(ae));
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Read "dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dirA/dirB/dirC"
|
||||||
|
*/
|
||||||
|
assertEqualIntA(a, 0, archive_read_next_header(a, &ae));
|
||||||
|
assertEqualInt(5, archive_entry_atime(ae));
|
||||||
|
assertEqualInt(5, archive_entry_ctime(ae));
|
||||||
|
assertEqualInt(5, archive_entry_mtime(ae));
|
||||||
|
assertEqualString("dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dirA/dirB/dirC",
|
||||||
|
archive_entry_pathname(ae));
|
||||||
|
assert((S_IFDIR | 0700) == archive_entry_mode(ae));
|
||||||
|
assertEqualInt(2048, archive_entry_size(ae));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Read "file"
|
* Read "file"
|
||||||
@ -601,8 +690,22 @@ DEFINE_TEST(test_write_format_iso9660)
|
|||||||
assertEqualInt(5, archive_entry_ctime(ae));
|
assertEqualInt(5, archive_entry_ctime(ae));
|
||||||
assertEqualInt(5, archive_entry_mtime(ae));
|
assertEqualInt(5, archive_entry_mtime(ae));
|
||||||
assertEqualString("file", archive_entry_pathname(ae));
|
assertEqualString("file", archive_entry_pathname(ae));
|
||||||
assertEqualString("hardlnk", archive_entry_hardlink(ae));
|
|
||||||
assert((AE_IFREG | 0400) == archive_entry_mode(ae));
|
assert((AE_IFREG | 0400) == archive_entry_mode(ae));
|
||||||
|
assertEqualInt(8, archive_entry_size(ae));
|
||||||
|
assertEqualIntA(a, 8, archive_read_data(a, buff2, 10));
|
||||||
|
assertEqualMem(buff2, "12345678", 8);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Read "hardlnk"
|
||||||
|
*/
|
||||||
|
assertEqualIntA(a, 0, archive_read_next_header(a, &ae));
|
||||||
|
assertEqualInt(5, archive_entry_atime(ae));
|
||||||
|
assertEqualInt(5, archive_entry_ctime(ae));
|
||||||
|
assertEqualInt(5, archive_entry_mtime(ae));
|
||||||
|
assertEqualString("hardlnk", archive_entry_pathname(ae));
|
||||||
|
assertEqualString("file", archive_entry_hardlink(ae));
|
||||||
|
assert((AE_IFREG | 0400) == archive_entry_mode(ae));
|
||||||
|
assertEqualInt(2, archive_entry_nlink(ae));
|
||||||
assertEqualInt(0, archive_entry_size(ae));
|
assertEqualInt(0, archive_entry_size(ae));
|
||||||
assertEqualIntA(a, 0, archive_read_data(a, buff2, 10));
|
assertEqualIntA(a, 0, archive_read_data(a, buff2, 10));
|
||||||
|
|
||||||
@ -624,6 +727,22 @@ DEFINE_TEST(test_write_format_iso9660)
|
|||||||
assertEqualIntA(a, 8, archive_read_data(a, buff2, 10));
|
assertEqualIntA(a, 8, archive_read_data(a, buff2, 10));
|
||||||
assertEqualMem(buff2, "12345678", 8);
|
assertEqualMem(buff2, "12345678", 8);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Read "dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dirA/dirB/dirC/file"
|
||||||
|
*/
|
||||||
|
assertEqualIntA(a, 0, archive_read_next_header(a, &ae));
|
||||||
|
assertEqualInt(5, archive_entry_atime(ae));
|
||||||
|
assertEqualInt(5, archive_entry_ctime(ae));
|
||||||
|
assertEqualInt(5, archive_entry_mtime(ae));
|
||||||
|
assertEqualString(
|
||||||
|
"dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dirA/dirB/dirC/file",
|
||||||
|
archive_entry_pathname(ae));
|
||||||
|
assert((AE_IFREG | 0400) == archive_entry_mode(ae));
|
||||||
|
assertEqualInt(1, archive_entry_nlink(ae));
|
||||||
|
assertEqualInt(8, archive_entry_size(ae));
|
||||||
|
assertEqualIntA(a, 8, archive_read_data(a, buff2, 10));
|
||||||
|
assertEqualMem(buff2, "12345678", 8);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Read "dir0/dir1/file1"
|
* Read "dir0/dir1/file1"
|
||||||
*/
|
*/
|
||||||
@ -745,6 +864,42 @@ DEFINE_TEST(test_write_format_iso9660)
|
|||||||
assert((S_IFDIR | 0700) == archive_entry_mode(ae));
|
assert((S_IFDIR | 0700) == archive_entry_mode(ae));
|
||||||
assertEqualInt(2048, archive_entry_size(ae));
|
assertEqualInt(2048, archive_entry_size(ae));
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Read "rr_moved/dir7/dir8/dir9/dira"
|
||||||
|
*/
|
||||||
|
assertEqualIntA(a, 0, archive_read_next_header(a, &ae));
|
||||||
|
assertEqualInt(5, archive_entry_atime(ae));
|
||||||
|
assertEqualInt(5, archive_entry_ctime(ae));
|
||||||
|
assertEqualInt(5, archive_entry_mtime(ae));
|
||||||
|
assertEqualString("RR_MOVED/DIR7/DIR8/DIR9/DIRA",
|
||||||
|
archive_entry_pathname(ae));
|
||||||
|
assert((S_IFDIR | 0700) == archive_entry_mode(ae));
|
||||||
|
assertEqualInt(2048, archive_entry_size(ae));
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Read "rr_moved/dir7/dir8/dir9/dira/dirB"
|
||||||
|
*/
|
||||||
|
assertEqualIntA(a, 0, archive_read_next_header(a, &ae));
|
||||||
|
assertEqualInt(5, archive_entry_atime(ae));
|
||||||
|
assertEqualInt(5, archive_entry_ctime(ae));
|
||||||
|
assertEqualInt(5, archive_entry_mtime(ae));
|
||||||
|
assertEqualString("RR_MOVED/DIR7/DIR8/DIR9/DIRA/DIRB",
|
||||||
|
archive_entry_pathname(ae));
|
||||||
|
assert((S_IFDIR | 0700) == archive_entry_mode(ae));
|
||||||
|
assertEqualInt(2048, archive_entry_size(ae));
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Read "rr_moved/dir7/dir8/dir9/dirA/dirB/dirC"
|
||||||
|
*/
|
||||||
|
assertEqualIntA(a, 0, archive_read_next_header(a, &ae));
|
||||||
|
assertEqualInt(5, archive_entry_atime(ae));
|
||||||
|
assertEqualInt(5, archive_entry_ctime(ae));
|
||||||
|
assertEqualInt(5, archive_entry_mtime(ae));
|
||||||
|
assertEqualString("RR_MOVED/DIR7/DIR8/DIR9/DIRA/DIRB/DIRC",
|
||||||
|
archive_entry_pathname(ae));
|
||||||
|
assert((S_IFDIR | 0700) == archive_entry_mode(ae));
|
||||||
|
assertEqualInt(2048, archive_entry_size(ae));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Read "dir0"
|
* Read "dir0"
|
||||||
*/
|
*/
|
||||||
@ -826,6 +981,20 @@ DEFINE_TEST(test_write_format_iso9660)
|
|||||||
assert((S_IFDIR | 0700) == archive_entry_mode(ae));
|
assert((S_IFDIR | 0700) == archive_entry_mode(ae));
|
||||||
assertEqualInt(2048, archive_entry_size(ae));
|
assertEqualInt(2048, archive_entry_size(ae));
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Read "hardlink"
|
||||||
|
*/
|
||||||
|
assertEqualIntA(a, 0, archive_read_next_header(a, &ae));
|
||||||
|
assertEqualInt(5, archive_entry_atime(ae));
|
||||||
|
assertEqualInt(5, archive_entry_ctime(ae));
|
||||||
|
assertEqualInt(5, archive_entry_mtime(ae));
|
||||||
|
assertEqualString("HARDLNK", archive_entry_pathname(ae));
|
||||||
|
assertEqualString(NULL, archive_entry_hardlink(ae));
|
||||||
|
assert((AE_IFREG | 0400) == archive_entry_mode(ae));
|
||||||
|
assertEqualInt(8, archive_entry_size(ae));
|
||||||
|
assertEqualIntA(a, 8, archive_read_data(a, buff2, 10));
|
||||||
|
assertEqualMem(buff2, "12345678", 8);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Read "file"
|
* Read "file"
|
||||||
*/
|
*/
|
||||||
@ -835,25 +1004,13 @@ DEFINE_TEST(test_write_format_iso9660)
|
|||||||
assertEqualInt(5, archive_entry_ctime(ae));
|
assertEqualInt(5, archive_entry_ctime(ae));
|
||||||
assertEqualInt(5, archive_entry_mtime(ae));
|
assertEqualInt(5, archive_entry_mtime(ae));
|
||||||
assertEqualString("FILE", archive_entry_pathname(ae));
|
assertEqualString("FILE", archive_entry_pathname(ae));
|
||||||
|
assertEqualString("HARDLNK", archive_entry_hardlink(ae));
|
||||||
assert((AE_IFREG | 0400) == archive_entry_mode(ae));
|
assert((AE_IFREG | 0400) == archive_entry_mode(ae));
|
||||||
assertEqualInt(2, archive_entry_nlink(ae));
|
assertEqualInt(2, archive_entry_nlink(ae));
|
||||||
assertEqualInt(8, archive_entry_size(ae));
|
|
||||||
assertEqualIntA(a, 8, archive_read_data(a, buff2, 10));
|
|
||||||
assertEqualMem(buff2, "12345678", 8);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Read "hardlink"
|
|
||||||
*/
|
|
||||||
assertEqualIntA(a, 0, archive_read_next_header(a, &ae));
|
|
||||||
assertEqualInt(5, archive_entry_atime(ae));
|
|
||||||
assertEqualInt(5, archive_entry_ctime(ae));
|
|
||||||
assertEqualInt(5, archive_entry_mtime(ae));
|
|
||||||
assertEqualString("HARDLNK", archive_entry_pathname(ae));
|
|
||||||
assertEqualString("FILE", archive_entry_hardlink(ae));
|
|
||||||
assert((AE_IFREG | 0400) == archive_entry_mode(ae));
|
|
||||||
assertEqualInt(0, archive_entry_size(ae));
|
assertEqualInt(0, archive_entry_size(ae));
|
||||||
assertEqualIntA(a, 0, archive_read_data(a, buff2, 10));
|
assertEqualIntA(a, 0, archive_read_data(a, buff2, 10));
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Read longname
|
* Read longname
|
||||||
*/
|
*/
|
||||||
@ -870,6 +1027,22 @@ DEFINE_TEST(test_write_format_iso9660)
|
|||||||
assertEqualIntA(a, 8, archive_read_data(a, buff2, 10));
|
assertEqualIntA(a, 8, archive_read_data(a, buff2, 10));
|
||||||
assertEqualMem(buff2, "12345678", 8);
|
assertEqualMem(buff2, "12345678", 8);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Read "rr_moved/dir7/dir8/dir9/dirA/dirB/dirC/file"
|
||||||
|
*/
|
||||||
|
assertEqualIntA(a, 0, archive_read_next_header(a, &ae));
|
||||||
|
assertEqualInt(5, archive_entry_atime(ae));
|
||||||
|
assertEqualInt(5, archive_entry_ctime(ae));
|
||||||
|
assertEqualInt(5, archive_entry_mtime(ae));
|
||||||
|
assertEqualString(
|
||||||
|
"RR_MOVED/DIR7/DIR8/DIR9/DIRA/DIRB/DIRC/FILE",
|
||||||
|
archive_entry_pathname(ae));
|
||||||
|
assert((AE_IFREG | 0400) == archive_entry_mode(ae));
|
||||||
|
assertEqualInt(1, archive_entry_nlink(ae));
|
||||||
|
assertEqualInt(8, archive_entry_size(ae));
|
||||||
|
assertEqualIntA(a, 8, archive_read_data(a, buff2, 10));
|
||||||
|
assertEqualMem(buff2, "12345678", 8);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Read "dir0/dir1/file1"
|
* Read "dir0/dir1/file1"
|
||||||
*/
|
*/
|
||||||
|
@ -1188,7 +1188,7 @@ assertion_file_contains_no_invalid_strings(const char *file, int line,
|
|||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
free(buff);
|
free(buff);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
@ -1412,6 +1412,8 @@ assertion_file_mode(const char *file, int line, const char *pathname, int expect
|
|||||||
assertion_count(file, line);
|
assertion_count(file, line);
|
||||||
#if defined(_WIN32) && !defined(__CYGWIN__)
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||||
failure_start(file, line, "assertFileMode not yet implemented for Windows");
|
failure_start(file, line, "assertFileMode not yet implemented for Windows");
|
||||||
|
(void)mode; /* UNUSED */
|
||||||
|
(void)r; /* UNUSED */
|
||||||
#else
|
#else
|
||||||
{
|
{
|
||||||
struct stat st;
|
struct stat st;
|
||||||
|
@ -244,7 +244,7 @@ int assertion_file_atime_recent(const char *, int, const char *);
|
|||||||
int assertion_file_birthtime(const char *, int, const char *, long, long);
|
int assertion_file_birthtime(const char *, int, const char *, long, long);
|
||||||
int assertion_file_birthtime_recent(const char *, int, const char *);
|
int assertion_file_birthtime_recent(const char *, int, const char *);
|
||||||
int assertion_file_contains_lines_any_order(const char *, int, const char *, const char **);
|
int assertion_file_contains_lines_any_order(const char *, int, const char *, const char **);
|
||||||
int assertion_file_contains_no_invalid_strings(const char *, int, const char *, const char **);
|
int assertion_file_contains_no_invalid_strings(const char *, int, const char *, const char **);
|
||||||
int assertion_file_contents(const char *, int, const void *, int, const char *);
|
int assertion_file_contents(const char *, int, const void *, int, const char *);
|
||||||
int assertion_file_exists(const char *, int, const char *);
|
int assertion_file_exists(const char *, int, const char *);
|
||||||
int assertion_file_mode(const char *, int, const char *, int);
|
int assertion_file_mode(const char *, int, const char *, int);
|
||||||
|
@ -33,7 +33,7 @@ DEFINE_TEST(test_option_b)
|
|||||||
|
|
||||||
assertMakeFile("file1", 0644, "file1");
|
assertMakeFile("file1", 0644, "file1");
|
||||||
if (systemf("cat file1 > test_cat.out 2> test_cat.err") != 0) {
|
if (systemf("cat file1 > test_cat.out 2> test_cat.err") != 0) {
|
||||||
skipping("Platform doesn't have cat");
|
skipping("This test requires a `cat` program");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
testprog_ustar = malloc(strlen(testprog) + sizeof(USTAR_OPT) + 1);
|
testprog_ustar = malloc(strlen(testprog) + sizeof(USTAR_OPT) + 1);
|
||||||
|
@ -63,7 +63,7 @@ DEFINE_TEST(test_symlink_dir)
|
|||||||
/* "dir2" is a symlink to a non-existing "real_dir2" */
|
/* "dir2" is a symlink to a non-existing "real_dir2" */
|
||||||
assertMakeSymlink("dest1/dir2", "real_dir2");
|
assertMakeSymlink("dest1/dir2", "real_dir2");
|
||||||
} else {
|
} else {
|
||||||
skipping("some symlink checks");
|
skipping("Symlinks are not supported on this platform");
|
||||||
}
|
}
|
||||||
/* "dir3" is a symlink to an existing "non_dir3" */
|
/* "dir3" is a symlink to an existing "non_dir3" */
|
||||||
assertMakeFile("dest1/non_dir3", 0755, "abcdef");
|
assertMakeFile("dest1/non_dir3", 0755, "abcdef");
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
// Source Licenses. See LICENSE.TXT for details.
|
// Source Licenses. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
// Compatible with libuwind API documented at:
|
// Compatible with libunwind API documented at:
|
||||||
// http://www.nongnu.org/libunwind/man/libunwind(3).html
|
// http://www.nongnu.org/libunwind/man/libunwind(3).html
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
@ -120,7 +120,7 @@ extern int unw_init_remote_thread(unw_cursor_t *, unw_addr_space_t, thread_t *);
|
|||||||
#endif /* UNW_REMOTE */
|
#endif /* UNW_REMOTE */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* traditional libuwind "remote" API
|
* traditional libunwind "remote" API
|
||||||
* NOT IMPLEMENTED on Mac OS X
|
* NOT IMPLEMENTED on Mac OS X
|
||||||
*
|
*
|
||||||
* extern int unw_init_remote(unw_cursor_t*, unw_addr_space_t,
|
* extern int unw_init_remote(unw_cursor_t*, unw_addr_space_t,
|
||||||
|
@ -374,7 +374,7 @@ inline bool LocalAddressSpace::findUnwindSections(pint_t targetAddr,
|
|||||||
(_Unwind_Ptr) targetAddr, &length);
|
(_Unwind_Ptr) targetAddr, &length);
|
||||||
info.arm_section_length = (uintptr_t)length;
|
info.arm_section_length = (uintptr_t)length;
|
||||||
#endif
|
#endif
|
||||||
_LIBUNWIND_TRACE_UNWINDING("findUnwindSections: section %X length %x\n",
|
_LIBUNWIND_TRACE_UNWINDING("findUnwindSections: section %X length %x",
|
||||||
info.arm_section, info.arm_section_length);
|
info.arm_section, info.arm_section_length);
|
||||||
if (info.arm_section && info.arm_section_length)
|
if (info.arm_section && info.arm_section_length)
|
||||||
return true;
|
return true;
|
||||||
|
@ -105,7 +105,7 @@ int CompactUnwinder_x86<A>::stepWithCompactEncodingEBPFrame(
|
|||||||
default:
|
default:
|
||||||
(void)functionStart;
|
(void)functionStart;
|
||||||
_LIBUNWIND_DEBUG_LOG("bad register for EBP frame, encoding=%08X for "
|
_LIBUNWIND_DEBUG_LOG("bad register for EBP frame, encoding=%08X for "
|
||||||
"function starting at 0x%X\n",
|
"function starting at 0x%X",
|
||||||
compactEncoding, functionStart);
|
compactEncoding, functionStart);
|
||||||
_LIBUNWIND_ABORT("invalid compact unwind encoding");
|
_LIBUNWIND_ABORT("invalid compact unwind encoding");
|
||||||
}
|
}
|
||||||
@ -224,7 +224,7 @@ int CompactUnwinder_x86<A>::stepWithCompactEncodingFrameless(
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
_LIBUNWIND_DEBUG_LOG("bad register for frameless, encoding=%08X for "
|
_LIBUNWIND_DEBUG_LOG("bad register for frameless, encoding=%08X for "
|
||||||
"function starting at 0x%X\n",
|
"function starting at 0x%X",
|
||||||
encoding, functionStart);
|
encoding, functionStart);
|
||||||
_LIBUNWIND_ABORT("invalid compact unwind encoding");
|
_LIBUNWIND_ABORT("invalid compact unwind encoding");
|
||||||
}
|
}
|
||||||
@ -336,7 +336,7 @@ int CompactUnwinder_x86_64<A>::stepWithCompactEncodingRBPFrame(
|
|||||||
default:
|
default:
|
||||||
(void)functionStart;
|
(void)functionStart;
|
||||||
_LIBUNWIND_DEBUG_LOG("bad register for RBP frame, encoding=%08X for "
|
_LIBUNWIND_DEBUG_LOG("bad register for RBP frame, encoding=%08X for "
|
||||||
"function starting at 0x%llX\n",
|
"function starting at 0x%llX",
|
||||||
compactEncoding, functionStart);
|
compactEncoding, functionStart);
|
||||||
_LIBUNWIND_ABORT("invalid compact unwind encoding");
|
_LIBUNWIND_ABORT("invalid compact unwind encoding");
|
||||||
}
|
}
|
||||||
@ -455,7 +455,7 @@ int CompactUnwinder_x86_64<A>::stepWithCompactEncodingFrameless(
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
_LIBUNWIND_DEBUG_LOG("bad register for frameless, encoding=%08X for "
|
_LIBUNWIND_DEBUG_LOG("bad register for frameless, encoding=%08X for "
|
||||||
"function starting at 0x%llX\n",
|
"function starting at 0x%llX",
|
||||||
encoding, functionStart);
|
encoding, functionStart);
|
||||||
_LIBUNWIND_ABORT("invalid compact unwind encoding");
|
_LIBUNWIND_ABORT("invalid compact unwind encoding");
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,7 @@ bool EHHeaderParser<A>::decodeTableEntry(
|
|||||||
const char *message =
|
const char *message =
|
||||||
CFI_Parser<A>::decodeFDE(addressSpace, fde, fdeInfo, cieInfo);
|
CFI_Parser<A>::decodeFDE(addressSpace, fde, fdeInfo, cieInfo);
|
||||||
if (message != NULL) {
|
if (message != NULL) {
|
||||||
_LIBUNWIND_DEBUG_LOG("EHHeaderParser::decodeTableEntry: bad fde: %s\n",
|
_LIBUNWIND_DEBUG_LOG("EHHeaderParser::decodeTableEntry: bad fde: %s",
|
||||||
message);
|
message);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -454,7 +454,7 @@ unwind_phase1(unw_context_t *uc, unw_cursor_t *cursor, _Unwind_Exception *except
|
|||||||
unw_proc_info_t frameInfo;
|
unw_proc_info_t frameInfo;
|
||||||
if (unw_get_proc_info(cursor, &frameInfo) != UNW_ESUCCESS) {
|
if (unw_get_proc_info(cursor, &frameInfo) != UNW_ESUCCESS) {
|
||||||
_LIBUNWIND_TRACE_UNWINDING("unwind_phase1(ex_ojb=%p): unw_get_proc_info "
|
_LIBUNWIND_TRACE_UNWINDING("unwind_phase1(ex_ojb=%p): unw_get_proc_info "
|
||||||
"failed => _URC_FATAL_PHASE1_ERROR\n",
|
"failed => _URC_FATAL_PHASE1_ERROR",
|
||||||
static_cast<void *>(exception_object));
|
static_cast<void *>(exception_object));
|
||||||
return _URC_FATAL_PHASE1_ERROR;
|
return _URC_FATAL_PHASE1_ERROR;
|
||||||
}
|
}
|
||||||
@ -472,7 +472,7 @@ unwind_phase1(unw_context_t *uc, unw_cursor_t *cursor, _Unwind_Exception *except
|
|||||||
unw_get_reg(cursor, UNW_REG_IP, &pc);
|
unw_get_reg(cursor, UNW_REG_IP, &pc);
|
||||||
_LIBUNWIND_TRACE_UNWINDING(
|
_LIBUNWIND_TRACE_UNWINDING(
|
||||||
"unwind_phase1(ex_ojb=%p): pc=0x%llX, start_ip=0x%llX, func=%s, "
|
"unwind_phase1(ex_ojb=%p): pc=0x%llX, start_ip=0x%llX, func=%s, "
|
||||||
"lsda=0x%llX, personality=0x%llX\n",
|
"lsda=0x%llX, personality=0x%llX",
|
||||||
static_cast<void *>(exception_object), (long long)pc,
|
static_cast<void *>(exception_object), (long long)pc,
|
||||||
(long long)frameInfo.start_ip, functionName,
|
(long long)frameInfo.start_ip, functionName,
|
||||||
(long long)frameInfo.lsda, (long long)frameInfo.handler);
|
(long long)frameInfo.lsda, (long long)frameInfo.handler);
|
||||||
@ -484,7 +484,7 @@ unwind_phase1(unw_context_t *uc, unw_cursor_t *cursor, _Unwind_Exception *except
|
|||||||
__personality_routine p =
|
__personality_routine p =
|
||||||
(__personality_routine)(long)(frameInfo.handler);
|
(__personality_routine)(long)(frameInfo.handler);
|
||||||
_LIBUNWIND_TRACE_UNWINDING(
|
_LIBUNWIND_TRACE_UNWINDING(
|
||||||
"unwind_phase1(ex_ojb=%p): calling personality function %p\n",
|
"unwind_phase1(ex_ojb=%p): calling personality function %p",
|
||||||
static_cast<void *>(exception_object),
|
static_cast<void *>(exception_object),
|
||||||
reinterpret_cast<void *>(reinterpret_cast<uintptr_t>(p)));
|
reinterpret_cast<void *>(reinterpret_cast<uintptr_t>(p)));
|
||||||
struct _Unwind_Context *context = (struct _Unwind_Context *)(cursor);
|
struct _Unwind_Context *context = (struct _Unwind_Context *)(cursor);
|
||||||
@ -496,7 +496,7 @@ unwind_phase1(unw_context_t *uc, unw_cursor_t *cursor, _Unwind_Exception *except
|
|||||||
(*p)(_US_VIRTUAL_UNWIND_FRAME, exception_object, context);
|
(*p)(_US_VIRTUAL_UNWIND_FRAME, exception_object, context);
|
||||||
_LIBUNWIND_TRACE_UNWINDING(
|
_LIBUNWIND_TRACE_UNWINDING(
|
||||||
"unwind_phase1(ex_ojb=%p): personality result %d start_ip %x ehtp %p "
|
"unwind_phase1(ex_ojb=%p): personality result %d start_ip %x ehtp %p "
|
||||||
"additional %x\n",
|
"additional %x",
|
||||||
static_cast<void *>(exception_object), personalityResult,
|
static_cast<void *>(exception_object), personalityResult,
|
||||||
exception_object->pr_cache.fnstart,
|
exception_object->pr_cache.fnstart,
|
||||||
static_cast<void *>(exception_object->pr_cache.ehtp),
|
static_cast<void *>(exception_object->pr_cache.ehtp),
|
||||||
@ -508,13 +508,13 @@ unwind_phase1(unw_context_t *uc, unw_cursor_t *cursor, _Unwind_Exception *except
|
|||||||
handlerNotFound = false;
|
handlerNotFound = false;
|
||||||
// p should have initialized barrier_cache. EHABI #7.3.5
|
// p should have initialized barrier_cache. EHABI #7.3.5
|
||||||
_LIBUNWIND_TRACE_UNWINDING(
|
_LIBUNWIND_TRACE_UNWINDING(
|
||||||
"unwind_phase1(ex_ojb=%p): _URC_HANDLER_FOUND \n",
|
"unwind_phase1(ex_ojb=%p): _URC_HANDLER_FOUND",
|
||||||
static_cast<void *>(exception_object));
|
static_cast<void *>(exception_object));
|
||||||
return _URC_NO_REASON;
|
return _URC_NO_REASON;
|
||||||
|
|
||||||
case _URC_CONTINUE_UNWIND:
|
case _URC_CONTINUE_UNWIND:
|
||||||
_LIBUNWIND_TRACE_UNWINDING(
|
_LIBUNWIND_TRACE_UNWINDING(
|
||||||
"unwind_phase1(ex_ojb=%p): _URC_CONTINUE_UNWIND\n",
|
"unwind_phase1(ex_ojb=%p): _URC_CONTINUE_UNWIND",
|
||||||
static_cast<void *>(exception_object));
|
static_cast<void *>(exception_object));
|
||||||
// continue unwinding
|
// continue unwinding
|
||||||
break;
|
break;
|
||||||
@ -526,7 +526,7 @@ unwind_phase1(unw_context_t *uc, unw_cursor_t *cursor, _Unwind_Exception *except
|
|||||||
default:
|
default:
|
||||||
// something went wrong
|
// something went wrong
|
||||||
_LIBUNWIND_TRACE_UNWINDING(
|
_LIBUNWIND_TRACE_UNWINDING(
|
||||||
"unwind_phase1(ex_ojb=%p): _URC_FATAL_PHASE1_ERROR\n",
|
"unwind_phase1(ex_ojb=%p): _URC_FATAL_PHASE1_ERROR",
|
||||||
static_cast<void *>(exception_object));
|
static_cast<void *>(exception_object));
|
||||||
return _URC_FATAL_PHASE1_ERROR;
|
return _URC_FATAL_PHASE1_ERROR;
|
||||||
}
|
}
|
||||||
@ -541,13 +541,13 @@ static _Unwind_Reason_Code unwind_phase2(unw_context_t *uc, unw_cursor_t *cursor
|
|||||||
// See comment at the start of unwind_phase1 regarding VRS integrity.
|
// See comment at the start of unwind_phase1 regarding VRS integrity.
|
||||||
unw_init_local(cursor, uc);
|
unw_init_local(cursor, uc);
|
||||||
|
|
||||||
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p)\n",
|
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p)",
|
||||||
static_cast<void *>(exception_object));
|
static_cast<void *>(exception_object));
|
||||||
int frame_count = 0;
|
int frame_count = 0;
|
||||||
|
|
||||||
// Walk each frame until we reach where search phase said to stop.
|
// Walk each frame until we reach where search phase said to stop.
|
||||||
while (true) {
|
while (true) {
|
||||||
// Ask libuwind to get next frame (skip over first which is
|
// Ask libunwind to get next frame (skip over first which is
|
||||||
// _Unwind_RaiseException or _Unwind_Resume).
|
// _Unwind_RaiseException or _Unwind_Resume).
|
||||||
//
|
//
|
||||||
// Resume only ever makes sense for 1 frame.
|
// Resume only ever makes sense for 1 frame.
|
||||||
@ -572,7 +572,7 @@ static _Unwind_Reason_Code unwind_phase2(unw_context_t *uc, unw_cursor_t *cursor
|
|||||||
unw_get_reg(cursor, UNW_REG_SP, &sp);
|
unw_get_reg(cursor, UNW_REG_SP, &sp);
|
||||||
if (unw_get_proc_info(cursor, &frameInfo) != UNW_ESUCCESS) {
|
if (unw_get_proc_info(cursor, &frameInfo) != UNW_ESUCCESS) {
|
||||||
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): unw_get_proc_info "
|
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): unw_get_proc_info "
|
||||||
"failed => _URC_FATAL_PHASE2_ERROR\n",
|
"failed => _URC_FATAL_PHASE2_ERROR",
|
||||||
static_cast<void *>(exception_object));
|
static_cast<void *>(exception_object));
|
||||||
return _URC_FATAL_PHASE2_ERROR;
|
return _URC_FATAL_PHASE2_ERROR;
|
||||||
}
|
}
|
||||||
@ -588,7 +588,7 @@ static _Unwind_Reason_Code unwind_phase2(unw_context_t *uc, unw_cursor_t *cursor
|
|||||||
functionName = ".anonymous.";
|
functionName = ".anonymous.";
|
||||||
_LIBUNWIND_TRACE_UNWINDING(
|
_LIBUNWIND_TRACE_UNWINDING(
|
||||||
"unwind_phase2(ex_ojb=%p): start_ip=0x%llX, func=%s, sp=0x%llX, "
|
"unwind_phase2(ex_ojb=%p): start_ip=0x%llX, func=%s, sp=0x%llX, "
|
||||||
"lsda=0x%llX, personality=0x%llX\n",
|
"lsda=0x%llX, personality=0x%llX",
|
||||||
static_cast<void *>(exception_object), (long long)frameInfo.start_ip,
|
static_cast<void *>(exception_object), (long long)frameInfo.start_ip,
|
||||||
functionName, (long long)sp, (long long)frameInfo.lsda,
|
functionName, (long long)sp, (long long)frameInfo.lsda,
|
||||||
(long long)frameInfo.handler);
|
(long long)frameInfo.handler);
|
||||||
@ -610,7 +610,7 @@ static _Unwind_Reason_Code unwind_phase2(unw_context_t *uc, unw_cursor_t *cursor
|
|||||||
case _URC_CONTINUE_UNWIND:
|
case _URC_CONTINUE_UNWIND:
|
||||||
// Continue unwinding
|
// Continue unwinding
|
||||||
_LIBUNWIND_TRACE_UNWINDING(
|
_LIBUNWIND_TRACE_UNWINDING(
|
||||||
"unwind_phase2(ex_ojb=%p): _URC_CONTINUE_UNWIND\n",
|
"unwind_phase2(ex_ojb=%p): _URC_CONTINUE_UNWIND",
|
||||||
static_cast<void *>(exception_object));
|
static_cast<void *>(exception_object));
|
||||||
// EHABI #7.2
|
// EHABI #7.2
|
||||||
if (sp == exception_object->barrier_cache.sp) {
|
if (sp == exception_object->barrier_cache.sp) {
|
||||||
@ -621,7 +621,7 @@ static _Unwind_Reason_Code unwind_phase2(unw_context_t *uc, unw_cursor_t *cursor
|
|||||||
break;
|
break;
|
||||||
case _URC_INSTALL_CONTEXT:
|
case _URC_INSTALL_CONTEXT:
|
||||||
_LIBUNWIND_TRACE_UNWINDING(
|
_LIBUNWIND_TRACE_UNWINDING(
|
||||||
"unwind_phase2(ex_ojb=%p): _URC_INSTALL_CONTEXT\n",
|
"unwind_phase2(ex_ojb=%p): _URC_INSTALL_CONTEXT",
|
||||||
static_cast<void *>(exception_object));
|
static_cast<void *>(exception_object));
|
||||||
// Personality routine says to transfer control to landing pad.
|
// Personality routine says to transfer control to landing pad.
|
||||||
// We may get control back if landing pad calls _Unwind_Resume().
|
// We may get control back if landing pad calls _Unwind_Resume().
|
||||||
@ -630,7 +630,7 @@ static _Unwind_Reason_Code unwind_phase2(unw_context_t *uc, unw_cursor_t *cursor
|
|||||||
unw_get_reg(cursor, UNW_REG_IP, &pc);
|
unw_get_reg(cursor, UNW_REG_IP, &pc);
|
||||||
unw_get_reg(cursor, UNW_REG_SP, &sp);
|
unw_get_reg(cursor, UNW_REG_SP, &sp);
|
||||||
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): re-entering "
|
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): re-entering "
|
||||||
"user code with ip=0x%llX, sp=0x%llX\n",
|
"user code with ip=0x%llX, sp=0x%llX",
|
||||||
static_cast<void *>(exception_object),
|
static_cast<void *>(exception_object),
|
||||||
(long long)pc, (long long)sp);
|
(long long)pc, (long long)sp);
|
||||||
}
|
}
|
||||||
@ -668,7 +668,7 @@ static _Unwind_Reason_Code unwind_phase2(unw_context_t *uc, unw_cursor_t *cursor
|
|||||||
/// Called by __cxa_throw. Only returns if there is a fatal error.
|
/// Called by __cxa_throw. Only returns if there is a fatal error.
|
||||||
_LIBUNWIND_EXPORT _Unwind_Reason_Code
|
_LIBUNWIND_EXPORT _Unwind_Reason_Code
|
||||||
_Unwind_RaiseException(_Unwind_Exception *exception_object) {
|
_Unwind_RaiseException(_Unwind_Exception *exception_object) {
|
||||||
_LIBUNWIND_TRACE_API("_Unwind_RaiseException(ex_obj=%p)\n",
|
_LIBUNWIND_TRACE_API("_Unwind_RaiseException(ex_obj=%p)",
|
||||||
static_cast<void *>(exception_object));
|
static_cast<void *>(exception_object));
|
||||||
unw_context_t uc;
|
unw_context_t uc;
|
||||||
unw_cursor_t cursor;
|
unw_cursor_t cursor;
|
||||||
@ -706,7 +706,7 @@ _LIBUNWIND_EXPORT void _Unwind_Complete(_Unwind_Exception* exception_object) {
|
|||||||
/// in turn calls _Unwind_Resume_or_Rethrow().
|
/// in turn calls _Unwind_Resume_or_Rethrow().
|
||||||
_LIBUNWIND_EXPORT void
|
_LIBUNWIND_EXPORT void
|
||||||
_Unwind_Resume(_Unwind_Exception *exception_object) {
|
_Unwind_Resume(_Unwind_Exception *exception_object) {
|
||||||
_LIBUNWIND_TRACE_API("_Unwind_Resume(ex_obj=%p)\n",
|
_LIBUNWIND_TRACE_API("_Unwind_Resume(ex_obj=%p)",
|
||||||
static_cast<void *>(exception_object));
|
static_cast<void *>(exception_object));
|
||||||
unw_context_t uc;
|
unw_context_t uc;
|
||||||
unw_cursor_t cursor;
|
unw_cursor_t cursor;
|
||||||
@ -730,7 +730,7 @@ _Unwind_GetLanguageSpecificData(struct _Unwind_Context *context) {
|
|||||||
if (unw_get_proc_info(cursor, &frameInfo) == UNW_ESUCCESS)
|
if (unw_get_proc_info(cursor, &frameInfo) == UNW_ESUCCESS)
|
||||||
result = (uintptr_t)frameInfo.lsda;
|
result = (uintptr_t)frameInfo.lsda;
|
||||||
_LIBUNWIND_TRACE_API(
|
_LIBUNWIND_TRACE_API(
|
||||||
"_Unwind_GetLanguageSpecificData(context=%p) => 0x%llx\n",
|
"_Unwind_GetLanguageSpecificData(context=%p) => 0x%llx",
|
||||||
static_cast<void *>(context), (long long)result);
|
static_cast<void *>(context), (long long)result);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -758,7 +758,7 @@ _Unwind_VRS_Set(_Unwind_Context *context, _Unwind_VRS_RegClass regclass,
|
|||||||
uint32_t regno, _Unwind_VRS_DataRepresentation representation,
|
uint32_t regno, _Unwind_VRS_DataRepresentation representation,
|
||||||
void *valuep) {
|
void *valuep) {
|
||||||
_LIBUNWIND_TRACE_API("_Unwind_VRS_Set(context=%p, regclass=%d, reg=%d, "
|
_LIBUNWIND_TRACE_API("_Unwind_VRS_Set(context=%p, regclass=%d, reg=%d, "
|
||||||
"rep=%d, value=0x%llX)\n",
|
"rep=%d, value=0x%llX)",
|
||||||
static_cast<void *>(context), regclass, regno,
|
static_cast<void *>(context), regclass, regno,
|
||||||
representation,
|
representation,
|
||||||
ValueAsBitPattern(representation, valuep));
|
ValueAsBitPattern(representation, valuep));
|
||||||
@ -863,7 +863,7 @@ _Unwind_VRS_Result _Unwind_VRS_Get(
|
|||||||
_Unwind_VRS_Get_Internal(context, regclass, regno, representation,
|
_Unwind_VRS_Get_Internal(context, regclass, regno, representation,
|
||||||
valuep);
|
valuep);
|
||||||
_LIBUNWIND_TRACE_API("_Unwind_VRS_Get(context=%p, regclass=%d, reg=%d, "
|
_LIBUNWIND_TRACE_API("_Unwind_VRS_Get(context=%p, regclass=%d, reg=%d, "
|
||||||
"rep=%d, value=0x%llX, result = %d)\n",
|
"rep=%d, value=0x%llX, result = %d)",
|
||||||
static_cast<void *>(context), regclass, regno,
|
static_cast<void *>(context), regclass, regno,
|
||||||
representation,
|
representation,
|
||||||
ValueAsBitPattern(representation, valuep), result);
|
ValueAsBitPattern(representation, valuep), result);
|
||||||
@ -875,7 +875,7 @@ _Unwind_VRS_Pop(_Unwind_Context *context, _Unwind_VRS_RegClass regclass,
|
|||||||
uint32_t discriminator,
|
uint32_t discriminator,
|
||||||
_Unwind_VRS_DataRepresentation representation) {
|
_Unwind_VRS_DataRepresentation representation) {
|
||||||
_LIBUNWIND_TRACE_API("_Unwind_VRS_Pop(context=%p, regclass=%d, "
|
_LIBUNWIND_TRACE_API("_Unwind_VRS_Pop(context=%p, regclass=%d, "
|
||||||
"discriminator=%d, representation=%d)\n",
|
"discriminator=%d, representation=%d)",
|
||||||
static_cast<void *>(context), regclass, discriminator,
|
static_cast<void *>(context), regclass, discriminator,
|
||||||
representation);
|
representation);
|
||||||
switch (regclass) {
|
switch (regclass) {
|
||||||
@ -948,7 +948,7 @@ _Unwind_GetRegionStart(struct _Unwind_Context *context) {
|
|||||||
uintptr_t result = 0;
|
uintptr_t result = 0;
|
||||||
if (unw_get_proc_info(cursor, &frameInfo) == UNW_ESUCCESS)
|
if (unw_get_proc_info(cursor, &frameInfo) == UNW_ESUCCESS)
|
||||||
result = (uintptr_t)frameInfo.start_ip;
|
result = (uintptr_t)frameInfo.start_ip;
|
||||||
_LIBUNWIND_TRACE_API("_Unwind_GetRegionStart(context=%p) => 0x%llX\n",
|
_LIBUNWIND_TRACE_API("_Unwind_GetRegionStart(context=%p) => 0x%llX",
|
||||||
static_cast<void *>(context), (long long)result);
|
static_cast<void *>(context), (long long)result);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -958,7 +958,7 @@ _Unwind_GetRegionStart(struct _Unwind_Context *context) {
|
|||||||
// is caught.
|
// is caught.
|
||||||
_LIBUNWIND_EXPORT void
|
_LIBUNWIND_EXPORT void
|
||||||
_Unwind_DeleteException(_Unwind_Exception *exception_object) {
|
_Unwind_DeleteException(_Unwind_Exception *exception_object) {
|
||||||
_LIBUNWIND_TRACE_API("_Unwind_DeleteException(ex_obj=%p)\n",
|
_LIBUNWIND_TRACE_API("_Unwind_DeleteException(ex_obj=%p)",
|
||||||
static_cast<void *>(exception_object));
|
static_cast<void *>(exception_object));
|
||||||
if (exception_object->exception_cleanup != NULL)
|
if (exception_object->exception_cleanup != NULL)
|
||||||
(*exception_object->exception_cleanup)(_URC_FOREIGN_EXCEPTION_CAUGHT,
|
(*exception_object->exception_cleanup)(_URC_FOREIGN_EXCEPTION_CAUGHT,
|
||||||
|
@ -72,7 +72,7 @@ _Unwind_SjLj_Unregister(struct _Unwind_FunctionContext *fc) {
|
|||||||
static _Unwind_Reason_Code
|
static _Unwind_Reason_Code
|
||||||
unwind_phase1(struct _Unwind_Exception *exception_object) {
|
unwind_phase1(struct _Unwind_Exception *exception_object) {
|
||||||
_Unwind_FunctionContext_t c = __Unwind_SjLj_GetTopOfFunctionStack();
|
_Unwind_FunctionContext_t c = __Unwind_SjLj_GetTopOfFunctionStack();
|
||||||
_LIBUNWIND_TRACE_UNWINDING("unwind_phase1: initial function-context=%p\n", c);
|
_LIBUNWIND_TRACE_UNWINDING("unwind_phase1: initial function-context=%p", c);
|
||||||
|
|
||||||
// walk each frame looking for a place to stop
|
// walk each frame looking for a place to stop
|
||||||
for (bool handlerNotFound = true; handlerNotFound; c = c->prev) {
|
for (bool handlerNotFound = true; handlerNotFound; c = c->prev) {
|
||||||
@ -80,17 +80,17 @@ unwind_phase1(struct _Unwind_Exception *exception_object) {
|
|||||||
// check for no more frames
|
// check for no more frames
|
||||||
if (c == NULL) {
|
if (c == NULL) {
|
||||||
_LIBUNWIND_TRACE_UNWINDING("unwind_phase1(ex_ojb=%p): reached "
|
_LIBUNWIND_TRACE_UNWINDING("unwind_phase1(ex_ojb=%p): reached "
|
||||||
"bottom => _URC_END_OF_STACK\n",
|
"bottom => _URC_END_OF_STACK",
|
||||||
exception_object);
|
exception_object);
|
||||||
return _URC_END_OF_STACK;
|
return _URC_END_OF_STACK;
|
||||||
}
|
}
|
||||||
|
|
||||||
_LIBUNWIND_TRACE_UNWINDING("unwind_phase1: function-context=%p\n", c);
|
_LIBUNWIND_TRACE_UNWINDING("unwind_phase1: function-context=%p", c);
|
||||||
// if there is a personality routine, ask it if it will want to stop at this
|
// if there is a personality routine, ask it if it will want to stop at this
|
||||||
// frame
|
// frame
|
||||||
if (c->personality != NULL) {
|
if (c->personality != NULL) {
|
||||||
_LIBUNWIND_TRACE_UNWINDING("unwind_phase1(ex_ojb=%p): calling "
|
_LIBUNWIND_TRACE_UNWINDING("unwind_phase1(ex_ojb=%p): calling "
|
||||||
"personality function %p\n",
|
"personality function %p",
|
||||||
exception_object, c->personality);
|
exception_object, c->personality);
|
||||||
_Unwind_Reason_Code personalityResult = (*c->personality)(
|
_Unwind_Reason_Code personalityResult = (*c->personality)(
|
||||||
1, _UA_SEARCH_PHASE, exception_object->exception_class,
|
1, _UA_SEARCH_PHASE, exception_object->exception_class,
|
||||||
@ -102,19 +102,19 @@ unwind_phase1(struct _Unwind_Exception *exception_object) {
|
|||||||
handlerNotFound = false;
|
handlerNotFound = false;
|
||||||
exception_object->private_2 = (uintptr_t) c;
|
exception_object->private_2 = (uintptr_t) c;
|
||||||
_LIBUNWIND_TRACE_UNWINDING("unwind_phase1(ex_ojb=%p): "
|
_LIBUNWIND_TRACE_UNWINDING("unwind_phase1(ex_ojb=%p): "
|
||||||
"_URC_HANDLER_FOUND\n", exception_object);
|
"_URC_HANDLER_FOUND", exception_object);
|
||||||
return _URC_NO_REASON;
|
return _URC_NO_REASON;
|
||||||
|
|
||||||
case _URC_CONTINUE_UNWIND:
|
case _URC_CONTINUE_UNWIND:
|
||||||
_LIBUNWIND_TRACE_UNWINDING("unwind_phase1(ex_ojb=%p): "
|
_LIBUNWIND_TRACE_UNWINDING("unwind_phase1(ex_ojb=%p): "
|
||||||
"_URC_CONTINUE_UNWIND\n", exception_object);
|
"_URC_CONTINUE_UNWIND", exception_object);
|
||||||
// continue unwinding
|
// continue unwinding
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// something went wrong
|
// something went wrong
|
||||||
_LIBUNWIND_TRACE_UNWINDING(
|
_LIBUNWIND_TRACE_UNWINDING(
|
||||||
"unwind_phase1(ex_ojb=%p): _URC_FATAL_PHASE1_ERROR\n",
|
"unwind_phase1(ex_ojb=%p): _URC_FATAL_PHASE1_ERROR",
|
||||||
exception_object);
|
exception_object);
|
||||||
return _URC_FATAL_PHASE1_ERROR;
|
return _URC_FATAL_PHASE1_ERROR;
|
||||||
}
|
}
|
||||||
@ -126,18 +126,18 @@ unwind_phase1(struct _Unwind_Exception *exception_object) {
|
|||||||
|
|
||||||
static _Unwind_Reason_Code
|
static _Unwind_Reason_Code
|
||||||
unwind_phase2(struct _Unwind_Exception *exception_object) {
|
unwind_phase2(struct _Unwind_Exception *exception_object) {
|
||||||
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p)\n", exception_object);
|
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p)", exception_object);
|
||||||
|
|
||||||
// walk each frame until we reach where search phase said to stop
|
// walk each frame until we reach where search phase said to stop
|
||||||
_Unwind_FunctionContext_t c = __Unwind_SjLj_GetTopOfFunctionStack();
|
_Unwind_FunctionContext_t c = __Unwind_SjLj_GetTopOfFunctionStack();
|
||||||
while (true) {
|
while (true) {
|
||||||
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2s(ex_ojb=%p): context=%p\n",
|
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2s(ex_ojb=%p): context=%p",
|
||||||
exception_object, c);
|
exception_object, c);
|
||||||
|
|
||||||
// check for no more frames
|
// check for no more frames
|
||||||
if (c == NULL) {
|
if (c == NULL) {
|
||||||
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): unw_step() reached "
|
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): unw_step() reached "
|
||||||
"bottom => _URC_END_OF_STACK\n",
|
"bottom => _URC_END_OF_STACK",
|
||||||
exception_object);
|
exception_object);
|
||||||
return _URC_END_OF_STACK;
|
return _URC_END_OF_STACK;
|
||||||
}
|
}
|
||||||
@ -157,7 +157,7 @@ unwind_phase2(struct _Unwind_Exception *exception_object) {
|
|||||||
case _URC_CONTINUE_UNWIND:
|
case _URC_CONTINUE_UNWIND:
|
||||||
// continue unwinding
|
// continue unwinding
|
||||||
_LIBUNWIND_TRACE_UNWINDING(
|
_LIBUNWIND_TRACE_UNWINDING(
|
||||||
"unwind_phase2(ex_ojb=%p): _URC_CONTINUE_UNWIND\n",
|
"unwind_phase2(ex_ojb=%p): _URC_CONTINUE_UNWIND",
|
||||||
exception_object);
|
exception_object);
|
||||||
if ((uintptr_t) c == exception_object->private_2) {
|
if ((uintptr_t) c == exception_object->private_2) {
|
||||||
// phase 1 said we would stop at this frame, but we did not...
|
// phase 1 said we would stop at this frame, but we did not...
|
||||||
@ -168,7 +168,7 @@ unwind_phase2(struct _Unwind_Exception *exception_object) {
|
|||||||
case _URC_INSTALL_CONTEXT:
|
case _URC_INSTALL_CONTEXT:
|
||||||
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): "
|
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): "
|
||||||
"_URC_INSTALL_CONTEXT, will resume at "
|
"_URC_INSTALL_CONTEXT, will resume at "
|
||||||
"landing pad %p\n",
|
"landing pad %p",
|
||||||
exception_object, c->jbuf[1]);
|
exception_object, c->jbuf[1]);
|
||||||
// personality routine says to transfer control to landing pad
|
// personality routine says to transfer control to landing pad
|
||||||
// we may get control back if landing pad calls _Unwind_Resume()
|
// we may get control back if landing pad calls _Unwind_Resume()
|
||||||
@ -202,7 +202,7 @@ unwind_phase2_forced(struct _Unwind_Exception *exception_object,
|
|||||||
// get next frame (skip over first which is _Unwind_RaiseException)
|
// get next frame (skip over first which is _Unwind_RaiseException)
|
||||||
if (c == NULL) {
|
if (c == NULL) {
|
||||||
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): unw_step() reached "
|
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): unw_step() reached "
|
||||||
"bottom => _URC_END_OF_STACK\n",
|
"bottom => _URC_END_OF_STACK",
|
||||||
exception_object);
|
exception_object);
|
||||||
return _URC_END_OF_STACK;
|
return _URC_END_OF_STACK;
|
||||||
}
|
}
|
||||||
@ -214,11 +214,11 @@ unwind_phase2_forced(struct _Unwind_Exception *exception_object,
|
|||||||
(*stop)(1, action, exception_object->exception_class, exception_object,
|
(*stop)(1, action, exception_object->exception_class, exception_object,
|
||||||
(struct _Unwind_Context *)c, stop_parameter);
|
(struct _Unwind_Context *)c, stop_parameter);
|
||||||
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2_forced(ex_ojb=%p): "
|
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2_forced(ex_ojb=%p): "
|
||||||
"stop function returned %d\n",
|
"stop function returned %d",
|
||||||
exception_object, stopResult);
|
exception_object, stopResult);
|
||||||
if (stopResult != _URC_NO_REASON) {
|
if (stopResult != _URC_NO_REASON) {
|
||||||
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2_forced(ex_ojb=%p): "
|
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2_forced(ex_ojb=%p): "
|
||||||
"stopped by stop function\n",
|
"stopped by stop function",
|
||||||
exception_object);
|
exception_object);
|
||||||
return _URC_FATAL_PHASE2_ERROR;
|
return _URC_FATAL_PHASE2_ERROR;
|
||||||
}
|
}
|
||||||
@ -227,7 +227,7 @@ unwind_phase2_forced(struct _Unwind_Exception *exception_object,
|
|||||||
if (c->personality != NULL) {
|
if (c->personality != NULL) {
|
||||||
__personality_routine p = (__personality_routine) c->personality;
|
__personality_routine p = (__personality_routine) c->personality;
|
||||||
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2_forced(ex_ojb=%p): "
|
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2_forced(ex_ojb=%p): "
|
||||||
"calling personality function %p\n",
|
"calling personality function %p",
|
||||||
exception_object, p);
|
exception_object, p);
|
||||||
_Unwind_Reason_Code personalityResult =
|
_Unwind_Reason_Code personalityResult =
|
||||||
(*p)(1, action, exception_object->exception_class, exception_object,
|
(*p)(1, action, exception_object->exception_class, exception_object,
|
||||||
@ -235,13 +235,13 @@ unwind_phase2_forced(struct _Unwind_Exception *exception_object,
|
|||||||
switch (personalityResult) {
|
switch (personalityResult) {
|
||||||
case _URC_CONTINUE_UNWIND:
|
case _URC_CONTINUE_UNWIND:
|
||||||
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2_forced(ex_ojb=%p): "
|
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2_forced(ex_ojb=%p): "
|
||||||
"personality returned _URC_CONTINUE_UNWIND\n",
|
"personality returned _URC_CONTINUE_UNWIND",
|
||||||
exception_object);
|
exception_object);
|
||||||
// destructors called, continue unwinding
|
// destructors called, continue unwinding
|
||||||
break;
|
break;
|
||||||
case _URC_INSTALL_CONTEXT:
|
case _URC_INSTALL_CONTEXT:
|
||||||
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2_forced(ex_ojb=%p): "
|
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2_forced(ex_ojb=%p): "
|
||||||
"personality returned _URC_INSTALL_CONTEXT\n",
|
"personality returned _URC_INSTALL_CONTEXT",
|
||||||
exception_object);
|
exception_object);
|
||||||
// we may get control back if landing pad calls _Unwind_Resume()
|
// we may get control back if landing pad calls _Unwind_Resume()
|
||||||
__Unwind_SjLj_SetTopOfFunctionStack(c);
|
__Unwind_SjLj_SetTopOfFunctionStack(c);
|
||||||
@ -251,7 +251,7 @@ unwind_phase2_forced(struct _Unwind_Exception *exception_object,
|
|||||||
// something went wrong
|
// something went wrong
|
||||||
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2_forced(ex_ojb=%p): "
|
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2_forced(ex_ojb=%p): "
|
||||||
"personality returned %d, "
|
"personality returned %d, "
|
||||||
"_URC_FATAL_PHASE2_ERROR\n",
|
"_URC_FATAL_PHASE2_ERROR",
|
||||||
exception_object, personalityResult);
|
exception_object, personalityResult);
|
||||||
return _URC_FATAL_PHASE2_ERROR;
|
return _URC_FATAL_PHASE2_ERROR;
|
||||||
}
|
}
|
||||||
@ -262,7 +262,7 @@ unwind_phase2_forced(struct _Unwind_Exception *exception_object,
|
|||||||
// call stop function one last time and tell it we've reached the end of the
|
// call stop function one last time and tell it we've reached the end of the
|
||||||
// stack
|
// stack
|
||||||
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2_forced(ex_ojb=%p): calling stop "
|
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2_forced(ex_ojb=%p): calling stop "
|
||||||
"function with _UA_END_OF_STACK\n",
|
"function with _UA_END_OF_STACK",
|
||||||
exception_object);
|
exception_object);
|
||||||
_Unwind_Action lastAction =
|
_Unwind_Action lastAction =
|
||||||
(_Unwind_Action)(_UA_FORCE_UNWIND | _UA_CLEANUP_PHASE | _UA_END_OF_STACK);
|
(_Unwind_Action)(_UA_FORCE_UNWIND | _UA_CLEANUP_PHASE | _UA_END_OF_STACK);
|
||||||
@ -278,7 +278,7 @@ unwind_phase2_forced(struct _Unwind_Exception *exception_object,
|
|||||||
/// Called by __cxa_throw. Only returns if there is a fatal error
|
/// Called by __cxa_throw. Only returns if there is a fatal error
|
||||||
_LIBUNWIND_EXPORT _Unwind_Reason_Code
|
_LIBUNWIND_EXPORT _Unwind_Reason_Code
|
||||||
_Unwind_SjLj_RaiseException(struct _Unwind_Exception *exception_object) {
|
_Unwind_SjLj_RaiseException(struct _Unwind_Exception *exception_object) {
|
||||||
_LIBUNWIND_TRACE_API("_Unwind_SjLj_RaiseException(ex_obj=%p)\n", exception_object);
|
_LIBUNWIND_TRACE_API("_Unwind_SjLj_RaiseException(ex_obj=%p)", exception_object);
|
||||||
|
|
||||||
// mark that this is a non-forced unwind, so _Unwind_Resume() can do the right
|
// mark that this is a non-forced unwind, so _Unwind_Resume() can do the right
|
||||||
// thing
|
// thing
|
||||||
@ -308,7 +308,7 @@ _Unwind_SjLj_RaiseException(struct _Unwind_Exception *exception_object) {
|
|||||||
/// __cxa_rethrow() which in turn calls _Unwind_Resume_or_Rethrow()
|
/// __cxa_rethrow() which in turn calls _Unwind_Resume_or_Rethrow()
|
||||||
_LIBUNWIND_EXPORT void
|
_LIBUNWIND_EXPORT void
|
||||||
_Unwind_SjLj_Resume(struct _Unwind_Exception *exception_object) {
|
_Unwind_SjLj_Resume(struct _Unwind_Exception *exception_object) {
|
||||||
_LIBUNWIND_TRACE_API("_Unwind_SjLj_Resume(ex_obj=%p)\n", exception_object);
|
_LIBUNWIND_TRACE_API("_Unwind_SjLj_Resume(ex_obj=%p)", exception_object);
|
||||||
|
|
||||||
if (exception_object->private_1 != 0)
|
if (exception_object->private_1 != 0)
|
||||||
unwind_phase2_forced(exception_object,
|
unwind_phase2_forced(exception_object,
|
||||||
@ -326,7 +326,7 @@ _Unwind_SjLj_Resume(struct _Unwind_Exception *exception_object) {
|
|||||||
_LIBUNWIND_EXPORT _Unwind_Reason_Code
|
_LIBUNWIND_EXPORT _Unwind_Reason_Code
|
||||||
_Unwind_SjLj_Resume_or_Rethrow(struct _Unwind_Exception *exception_object) {
|
_Unwind_SjLj_Resume_or_Rethrow(struct _Unwind_Exception *exception_object) {
|
||||||
_LIBUNWIND_TRACE_API("__Unwind_SjLj_Resume_or_Rethrow(ex_obj=%p), "
|
_LIBUNWIND_TRACE_API("__Unwind_SjLj_Resume_or_Rethrow(ex_obj=%p), "
|
||||||
"private_1=%ld\n",
|
"private_1=%ld",
|
||||||
exception_object, exception_object->private_1);
|
exception_object, exception_object->private_1);
|
||||||
// If this is non-forced and a stopping place was found, then this is a
|
// If this is non-forced and a stopping place was found, then this is a
|
||||||
// re-throw.
|
// re-throw.
|
||||||
@ -350,7 +350,7 @@ _LIBUNWIND_EXPORT uintptr_t
|
|||||||
_Unwind_GetLanguageSpecificData(struct _Unwind_Context *context) {
|
_Unwind_GetLanguageSpecificData(struct _Unwind_Context *context) {
|
||||||
_Unwind_FunctionContext_t ufc = (_Unwind_FunctionContext_t) context;
|
_Unwind_FunctionContext_t ufc = (_Unwind_FunctionContext_t) context;
|
||||||
_LIBUNWIND_TRACE_API("_Unwind_GetLanguageSpecificData(context=%p) "
|
_LIBUNWIND_TRACE_API("_Unwind_GetLanguageSpecificData(context=%p) "
|
||||||
"=> 0x%0lX\n", context, ufc->lsda);
|
"=> 0x%0lX", context, ufc->lsda);
|
||||||
return ufc->lsda;
|
return ufc->lsda;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -358,7 +358,7 @@ _Unwind_GetLanguageSpecificData(struct _Unwind_Context *context) {
|
|||||||
/// Called by personality handler during phase 2 to get register values.
|
/// Called by personality handler during phase 2 to get register values.
|
||||||
_LIBUNWIND_EXPORT uintptr_t _Unwind_GetGR(struct _Unwind_Context *context,
|
_LIBUNWIND_EXPORT uintptr_t _Unwind_GetGR(struct _Unwind_Context *context,
|
||||||
int index) {
|
int index) {
|
||||||
_LIBUNWIND_TRACE_API("_Unwind_GetGR(context=%p, reg=%d)\n",
|
_LIBUNWIND_TRACE_API("_Unwind_GetGR(context=%p, reg=%d)",
|
||||||
context, index);
|
context, index);
|
||||||
_Unwind_FunctionContext_t ufc = (_Unwind_FunctionContext_t) context;
|
_Unwind_FunctionContext_t ufc = (_Unwind_FunctionContext_t) context;
|
||||||
return ufc->resumeParameters[index];
|
return ufc->resumeParameters[index];
|
||||||
@ -368,7 +368,7 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetGR(struct _Unwind_Context *context,
|
|||||||
/// Called by personality handler during phase 2 to alter register values.
|
/// Called by personality handler during phase 2 to alter register values.
|
||||||
_LIBUNWIND_EXPORT void _Unwind_SetGR(struct _Unwind_Context *context, int index,
|
_LIBUNWIND_EXPORT void _Unwind_SetGR(struct _Unwind_Context *context, int index,
|
||||||
uintptr_t new_value) {
|
uintptr_t new_value) {
|
||||||
_LIBUNWIND_TRACE_API("_Unwind_SetGR(context=%p, reg=%d, value=0x%0lX)\n"
|
_LIBUNWIND_TRACE_API("_Unwind_SetGR(context=%p, reg=%d, value=0x%0lX)"
|
||||||
, context, index, new_value);
|
, context, index, new_value);
|
||||||
_Unwind_FunctionContext_t ufc = (_Unwind_FunctionContext_t) context;
|
_Unwind_FunctionContext_t ufc = (_Unwind_FunctionContext_t) context;
|
||||||
ufc->resumeParameters[index] = new_value;
|
ufc->resumeParameters[index] = new_value;
|
||||||
@ -378,7 +378,7 @@ _LIBUNWIND_EXPORT void _Unwind_SetGR(struct _Unwind_Context *context, int index,
|
|||||||
/// Called by personality handler during phase 2 to get instruction pointer.
|
/// Called by personality handler during phase 2 to get instruction pointer.
|
||||||
_LIBUNWIND_EXPORT uintptr_t _Unwind_GetIP(struct _Unwind_Context *context) {
|
_LIBUNWIND_EXPORT uintptr_t _Unwind_GetIP(struct _Unwind_Context *context) {
|
||||||
_Unwind_FunctionContext_t ufc = (_Unwind_FunctionContext_t) context;
|
_Unwind_FunctionContext_t ufc = (_Unwind_FunctionContext_t) context;
|
||||||
_LIBUNWIND_TRACE_API("_Unwind_GetIP(context=%p) => 0x%lX\n", context,
|
_LIBUNWIND_TRACE_API("_Unwind_GetIP(context=%p) => 0x%lX", context,
|
||||||
ufc->resumeLocation + 1);
|
ufc->resumeLocation + 1);
|
||||||
return ufc->resumeLocation + 1;
|
return ufc->resumeLocation + 1;
|
||||||
}
|
}
|
||||||
@ -391,7 +391,7 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetIPInfo(struct _Unwind_Context *context,
|
|||||||
int *ipBefore) {
|
int *ipBefore) {
|
||||||
_Unwind_FunctionContext_t ufc = (_Unwind_FunctionContext_t) context;
|
_Unwind_FunctionContext_t ufc = (_Unwind_FunctionContext_t) context;
|
||||||
*ipBefore = 0;
|
*ipBefore = 0;
|
||||||
_LIBUNWIND_TRACE_API("_Unwind_GetIPInfo(context=%p, %p) => 0x%lX\n",
|
_LIBUNWIND_TRACE_API("_Unwind_GetIPInfo(context=%p, %p) => 0x%lX",
|
||||||
context, ipBefore, ufc->resumeLocation + 1);
|
context, ipBefore, ufc->resumeLocation + 1);
|
||||||
return ufc->resumeLocation + 1;
|
return ufc->resumeLocation + 1;
|
||||||
}
|
}
|
||||||
@ -400,7 +400,7 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetIPInfo(struct _Unwind_Context *context,
|
|||||||
/// Called by personality handler during phase 2 to alter instruction pointer.
|
/// Called by personality handler during phase 2 to alter instruction pointer.
|
||||||
_LIBUNWIND_EXPORT void _Unwind_SetIP(struct _Unwind_Context *context,
|
_LIBUNWIND_EXPORT void _Unwind_SetIP(struct _Unwind_Context *context,
|
||||||
uintptr_t new_value) {
|
uintptr_t new_value) {
|
||||||
_LIBUNWIND_TRACE_API("_Unwind_SetIP(context=%p, value=0x%0lX)\n",
|
_LIBUNWIND_TRACE_API("_Unwind_SetIP(context=%p, value=0x%0lX)",
|
||||||
context, new_value);
|
context, new_value);
|
||||||
_Unwind_FunctionContext_t ufc = (_Unwind_FunctionContext_t) context;
|
_Unwind_FunctionContext_t ufc = (_Unwind_FunctionContext_t) context;
|
||||||
ufc->resumeLocation = new_value - 1;
|
ufc->resumeLocation = new_value - 1;
|
||||||
@ -413,7 +413,7 @@ _LIBUNWIND_EXPORT uintptr_t
|
|||||||
_Unwind_GetRegionStart(struct _Unwind_Context *context) {
|
_Unwind_GetRegionStart(struct _Unwind_Context *context) {
|
||||||
// Not supported or needed for sjlj based unwinding
|
// Not supported or needed for sjlj based unwinding
|
||||||
(void)context;
|
(void)context;
|
||||||
_LIBUNWIND_TRACE_API("_Unwind_GetRegionStart(context=%p)\n", context);
|
_LIBUNWIND_TRACE_API("_Unwind_GetRegionStart(context=%p)", context);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -422,7 +422,7 @@ _Unwind_GetRegionStart(struct _Unwind_Context *context) {
|
|||||||
/// is caught.
|
/// is caught.
|
||||||
_LIBUNWIND_EXPORT void
|
_LIBUNWIND_EXPORT void
|
||||||
_Unwind_DeleteException(struct _Unwind_Exception *exception_object) {
|
_Unwind_DeleteException(struct _Unwind_Exception *exception_object) {
|
||||||
_LIBUNWIND_TRACE_API("_Unwind_DeleteException(ex_obj=%p)\n",
|
_LIBUNWIND_TRACE_API("_Unwind_DeleteException(ex_obj=%p)",
|
||||||
exception_object);
|
exception_object);
|
||||||
if (exception_object->exception_cleanup != NULL)
|
if (exception_object->exception_cleanup != NULL)
|
||||||
(*exception_object->exception_cleanup)(_URC_FOREIGN_EXCEPTION_CAUGHT,
|
(*exception_object->exception_cleanup)(_URC_FOREIGN_EXCEPTION_CAUGHT,
|
||||||
@ -437,7 +437,7 @@ _LIBUNWIND_EXPORT uintptr_t
|
|||||||
_Unwind_GetDataRelBase(struct _Unwind_Context *context) {
|
_Unwind_GetDataRelBase(struct _Unwind_Context *context) {
|
||||||
// Not supported or needed for sjlj based unwinding
|
// Not supported or needed for sjlj based unwinding
|
||||||
(void)context;
|
(void)context;
|
||||||
_LIBUNWIND_TRACE_API("_Unwind_GetDataRelBase(context=%p)\n", context);
|
_LIBUNWIND_TRACE_API("_Unwind_GetDataRelBase(context=%p)", context);
|
||||||
_LIBUNWIND_ABORT("_Unwind_GetDataRelBase() not implemented");
|
_LIBUNWIND_ABORT("_Unwind_GetDataRelBase() not implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -448,14 +448,14 @@ _LIBUNWIND_EXPORT uintptr_t
|
|||||||
_Unwind_GetTextRelBase(struct _Unwind_Context *context) {
|
_Unwind_GetTextRelBase(struct _Unwind_Context *context) {
|
||||||
// Not supported or needed for sjlj based unwinding
|
// Not supported or needed for sjlj based unwinding
|
||||||
(void)context;
|
(void)context;
|
||||||
_LIBUNWIND_TRACE_API("_Unwind_GetTextRelBase(context=%p)\n", context);
|
_LIBUNWIND_TRACE_API("_Unwind_GetTextRelBase(context=%p)", context);
|
||||||
_LIBUNWIND_ABORT("_Unwind_GetTextRelBase() not implemented");
|
_LIBUNWIND_ABORT("_Unwind_GetTextRelBase() not implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Called by personality handler to get "Call Frame Area" for current frame.
|
/// Called by personality handler to get "Call Frame Area" for current frame.
|
||||||
_LIBUNWIND_EXPORT uintptr_t _Unwind_GetCFA(struct _Unwind_Context *context) {
|
_LIBUNWIND_EXPORT uintptr_t _Unwind_GetCFA(struct _Unwind_Context *context) {
|
||||||
_LIBUNWIND_TRACE_API("_Unwind_GetCFA(context=%p)\n", context);
|
_LIBUNWIND_TRACE_API("_Unwind_GetCFA(context=%p)", context);
|
||||||
if (context != NULL) {
|
if (context != NULL) {
|
||||||
_Unwind_FunctionContext_t ufc = (_Unwind_FunctionContext_t) context;
|
_Unwind_FunctionContext_t ufc = (_Unwind_FunctionContext_t) context;
|
||||||
// Setjmp/longjmp based exceptions don't have a true CFA.
|
// Setjmp/longjmp based exceptions don't have a true CFA.
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
// Source Licenses. See LICENSE.TXT for details.
|
// Source Licenses. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
// C++ interface to lower levels of libuwind
|
// C++ interface to lower levels of libunwind
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
#ifndef __UNWINDCURSOR_HPP__
|
#ifndef __UNWINDCURSOR_HPP__
|
||||||
@ -935,7 +935,7 @@ bool UnwindCursor<A, R>::getInfoFromDwarfSection(pint_t pc,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//_LIBUNWIND_DEBUG_LOG("can't find/use FDE for pc=0x%llX\n", (uint64_t)pc);
|
//_LIBUNWIND_DEBUG_LOG("can't find/use FDE for pc=0x%llX", (uint64_t)pc);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif // _LIBUNWIND_SUPPORT_DWARF_UNWIND
|
#endif // _LIBUNWIND_SUPPORT_DWARF_UNWIND
|
||||||
@ -1092,13 +1092,13 @@ bool UnwindCursor<A, R>::getInfoFromCompactEncodingSection(pint_t pc,
|
|||||||
funcEnd = firstLevelNextPageFunctionOffset + sects.dso_base;
|
funcEnd = firstLevelNextPageFunctionOffset + sects.dso_base;
|
||||||
if (pc < funcStart) {
|
if (pc < funcStart) {
|
||||||
_LIBUNWIND_DEBUG_LOG("malformed __unwind_info, pc=0x%llX not in second "
|
_LIBUNWIND_DEBUG_LOG("malformed __unwind_info, pc=0x%llX not in second "
|
||||||
"level compressed unwind table. funcStart=0x%llX\n",
|
"level compressed unwind table. funcStart=0x%llX",
|
||||||
(uint64_t) pc, (uint64_t) funcStart);
|
(uint64_t) pc, (uint64_t) funcStart);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (pc > funcEnd) {
|
if (pc > funcEnd) {
|
||||||
_LIBUNWIND_DEBUG_LOG("malformed __unwind_info, pc=0x%llX not in second "
|
_LIBUNWIND_DEBUG_LOG("malformed __unwind_info, pc=0x%llX not in second "
|
||||||
"level compressed unwind table. funcEnd=0x%llX\n",
|
"level compressed unwind table. funcEnd=0x%llX",
|
||||||
(uint64_t) pc, (uint64_t) funcEnd);
|
(uint64_t) pc, (uint64_t) funcEnd);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -1119,7 +1119,7 @@ bool UnwindCursor<A, R>::getInfoFromCompactEncodingSection(pint_t pc,
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
_LIBUNWIND_DEBUG_LOG("malformed __unwind_info at 0x%0llX bad second "
|
_LIBUNWIND_DEBUG_LOG("malformed __unwind_info at 0x%0llX bad second "
|
||||||
"level page\n",
|
"level page",
|
||||||
(uint64_t) sects.compact_unwind_section);
|
(uint64_t) sects.compact_unwind_section);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -1149,7 +1149,7 @@ bool UnwindCursor<A, R>::getInfoFromCompactEncodingSection(pint_t pc,
|
|||||||
}
|
}
|
||||||
if (lsda == 0) {
|
if (lsda == 0) {
|
||||||
_LIBUNWIND_DEBUG_LOG("found encoding 0x%08X with HAS_LSDA bit set for "
|
_LIBUNWIND_DEBUG_LOG("found encoding 0x%08X with HAS_LSDA bit set for "
|
||||||
"pc=0x%0llX, but lsda table has no entry\n",
|
"pc=0x%0llX, but lsda table has no entry",
|
||||||
encoding, (uint64_t) pc);
|
encoding, (uint64_t) pc);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -1162,7 +1162,7 @@ bool UnwindCursor<A, R>::getInfoFromCompactEncodingSection(pint_t pc,
|
|||||||
--personalityIndex; // change 1-based to zero-based index
|
--personalityIndex; // change 1-based to zero-based index
|
||||||
if (personalityIndex > sectionHeader.personalityArrayCount()) {
|
if (personalityIndex > sectionHeader.personalityArrayCount()) {
|
||||||
_LIBUNWIND_DEBUG_LOG("found encoding 0x%08X with personality index %d, "
|
_LIBUNWIND_DEBUG_LOG("found encoding 0x%08X with personality index %d, "
|
||||||
"but personality table has only %d entires\n",
|
"but personality table has only %d entires",
|
||||||
encoding, personalityIndex,
|
encoding, personalityIndex,
|
||||||
sectionHeader.personalityArrayCount());
|
sectionHeader.personalityArrayCount());
|
||||||
return false;
|
return false;
|
||||||
|
@ -29,11 +29,11 @@
|
|||||||
_LIBUNWIND_EXPORT _Unwind_Reason_Code
|
_LIBUNWIND_EXPORT _Unwind_Reason_Code
|
||||||
_Unwind_Resume_or_Rethrow(_Unwind_Exception *exception_object) {
|
_Unwind_Resume_or_Rethrow(_Unwind_Exception *exception_object) {
|
||||||
#if _LIBUNWIND_ARM_EHABI
|
#if _LIBUNWIND_ARM_EHABI
|
||||||
_LIBUNWIND_TRACE_API("_Unwind_Resume_or_Rethrow(ex_obj=%p), private_1=%ld\n",
|
_LIBUNWIND_TRACE_API("_Unwind_Resume_or_Rethrow(ex_obj=%p), private_1=%ld",
|
||||||
(void *)exception_object,
|
(void *)exception_object,
|
||||||
(long)exception_object->unwinder_cache.reserved1);
|
(long)exception_object->unwinder_cache.reserved1);
|
||||||
#else
|
#else
|
||||||
_LIBUNWIND_TRACE_API("_Unwind_Resume_or_Rethrow(ex_obj=%p), private_1=%ld\n",
|
_LIBUNWIND_TRACE_API("_Unwind_Resume_or_Rethrow(ex_obj=%p), private_1=%ld",
|
||||||
(void *)exception_object,
|
(void *)exception_object,
|
||||||
(long)exception_object->private_1);
|
(long)exception_object->private_1);
|
||||||
#endif
|
#endif
|
||||||
@ -66,7 +66,7 @@ _Unwind_Resume_or_Rethrow(_Unwind_Exception *exception_object) {
|
|||||||
_LIBUNWIND_EXPORT uintptr_t
|
_LIBUNWIND_EXPORT uintptr_t
|
||||||
_Unwind_GetDataRelBase(struct _Unwind_Context *context) {
|
_Unwind_GetDataRelBase(struct _Unwind_Context *context) {
|
||||||
(void)context;
|
(void)context;
|
||||||
_LIBUNWIND_TRACE_API("_Unwind_GetDataRelBase(context=%p)\n", (void *)context);
|
_LIBUNWIND_TRACE_API("_Unwind_GetDataRelBase(context=%p)", (void *)context);
|
||||||
_LIBUNWIND_ABORT("_Unwind_GetDataRelBase() not implemented");
|
_LIBUNWIND_ABORT("_Unwind_GetDataRelBase() not implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ _Unwind_GetDataRelBase(struct _Unwind_Context *context) {
|
|||||||
_LIBUNWIND_EXPORT uintptr_t
|
_LIBUNWIND_EXPORT uintptr_t
|
||||||
_Unwind_GetTextRelBase(struct _Unwind_Context *context) {
|
_Unwind_GetTextRelBase(struct _Unwind_Context *context) {
|
||||||
(void)context;
|
(void)context;
|
||||||
_LIBUNWIND_TRACE_API("_Unwind_GetTextRelBase(context=%p)\n", (void *)context);
|
_LIBUNWIND_TRACE_API("_Unwind_GetTextRelBase(context=%p)", (void *)context);
|
||||||
_LIBUNWIND_ABORT("_Unwind_GetTextRelBase() not implemented");
|
_LIBUNWIND_ABORT("_Unwind_GetTextRelBase() not implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -84,7 +84,7 @@ _Unwind_GetTextRelBase(struct _Unwind_Context *context) {
|
|||||||
/// Scans unwind information to find the function that contains the
|
/// Scans unwind information to find the function that contains the
|
||||||
/// specified code address "pc".
|
/// specified code address "pc".
|
||||||
_LIBUNWIND_EXPORT void *_Unwind_FindEnclosingFunction(void *pc) {
|
_LIBUNWIND_EXPORT void *_Unwind_FindEnclosingFunction(void *pc) {
|
||||||
_LIBUNWIND_TRACE_API("_Unwind_FindEnclosingFunction(pc=%p)\n", pc);
|
_LIBUNWIND_TRACE_API("_Unwind_FindEnclosingFunction(pc=%p)", pc);
|
||||||
// This is slow, but works.
|
// This is slow, but works.
|
||||||
// We create an unwind cursor then alter the IP to be pc
|
// We create an unwind cursor then alter the IP to be pc
|
||||||
unw_cursor_t cursor;
|
unw_cursor_t cursor;
|
||||||
@ -108,7 +108,7 @@ _Unwind_Backtrace(_Unwind_Trace_Fn callback, void *ref) {
|
|||||||
unw_getcontext(&uc);
|
unw_getcontext(&uc);
|
||||||
unw_init_local(&cursor, &uc);
|
unw_init_local(&cursor, &uc);
|
||||||
|
|
||||||
_LIBUNWIND_TRACE_API("_Unwind_Backtrace(callback=%p)\n",
|
_LIBUNWIND_TRACE_API("_Unwind_Backtrace(callback=%p)",
|
||||||
(void *)(uintptr_t)callback);
|
(void *)(uintptr_t)callback);
|
||||||
|
|
||||||
#if _LIBUNWIND_ARM_EHABI
|
#if _LIBUNWIND_ARM_EHABI
|
||||||
@ -123,11 +123,11 @@ _Unwind_Backtrace(_Unwind_Trace_Fn callback, void *ref) {
|
|||||||
_Unwind_Reason_Code result;
|
_Unwind_Reason_Code result;
|
||||||
|
|
||||||
#if !_LIBUNWIND_ARM_EHABI
|
#if !_LIBUNWIND_ARM_EHABI
|
||||||
// ask libuwind to get next frame (skip over first frame which is
|
// ask libunwind to get next frame (skip over first frame which is
|
||||||
// _Unwind_Backtrace())
|
// _Unwind_Backtrace())
|
||||||
if (unw_step(&cursor) <= 0) {
|
if (unw_step(&cursor) <= 0) {
|
||||||
_LIBUNWIND_TRACE_UNWINDING(" _backtrace: ended because cursor reached "
|
_LIBUNWIND_TRACE_UNWINDING(" _backtrace: ended because cursor reached "
|
||||||
"bottom of stack, returning %d\n",
|
"bottom of stack, returning %d",
|
||||||
_URC_END_OF_STACK);
|
_URC_END_OF_STACK);
|
||||||
return _URC_END_OF_STACK;
|
return _URC_END_OF_STACK;
|
||||||
}
|
}
|
||||||
@ -164,7 +164,7 @@ _Unwind_Backtrace(_Unwind_Trace_Fn callback, void *ref) {
|
|||||||
unw_get_proc_name(&cursor, functionName, 512, &offset);
|
unw_get_proc_name(&cursor, functionName, 512, &offset);
|
||||||
unw_get_proc_info(&cursor, &frame);
|
unw_get_proc_info(&cursor, &frame);
|
||||||
_LIBUNWIND_TRACE_UNWINDING(
|
_LIBUNWIND_TRACE_UNWINDING(
|
||||||
" _backtrace: start_ip=0x%llX, func=%s, lsda=0x%llX, context=%p\n",
|
" _backtrace: start_ip=0x%llX, func=%s, lsda=0x%llX, context=%p",
|
||||||
(long long)frame.start_ip, functionName, (long long)frame.lsda,
|
(long long)frame.start_ip, functionName, (long long)frame.lsda,
|
||||||
(void *)&cursor);
|
(void *)&cursor);
|
||||||
}
|
}
|
||||||
@ -173,7 +173,7 @@ _Unwind_Backtrace(_Unwind_Trace_Fn callback, void *ref) {
|
|||||||
result = (*callback)((struct _Unwind_Context *)(&cursor), ref);
|
result = (*callback)((struct _Unwind_Context *)(&cursor), ref);
|
||||||
if (result != _URC_NO_REASON) {
|
if (result != _URC_NO_REASON) {
|
||||||
_LIBUNWIND_TRACE_UNWINDING(
|
_LIBUNWIND_TRACE_UNWINDING(
|
||||||
" _backtrace: ended because callback returned %d\n", result);
|
" _backtrace: ended because callback returned %d", result);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -195,7 +195,7 @@ _LIBUNWIND_EXPORT const void *_Unwind_Find_FDE(const void *pc,
|
|||||||
bases->tbase = (uintptr_t)info.extra;
|
bases->tbase = (uintptr_t)info.extra;
|
||||||
bases->dbase = 0; // dbase not used on Mac OS X
|
bases->dbase = 0; // dbase not used on Mac OS X
|
||||||
bases->func = (uintptr_t)info.start_ip;
|
bases->func = (uintptr_t)info.start_ip;
|
||||||
_LIBUNWIND_TRACE_API("_Unwind_Find_FDE(pc=%p) => %p\n", pc,
|
_LIBUNWIND_TRACE_API("_Unwind_Find_FDE(pc=%p) => %p", pc,
|
||||||
(void *)(long) info.unwind_info);
|
(void *)(long) info.unwind_info);
|
||||||
return (void *)(long) info.unwind_info;
|
return (void *)(long) info.unwind_info;
|
||||||
}
|
}
|
||||||
@ -206,7 +206,7 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetCFA(struct _Unwind_Context *context) {
|
|||||||
unw_cursor_t *cursor = (unw_cursor_t *)context;
|
unw_cursor_t *cursor = (unw_cursor_t *)context;
|
||||||
unw_word_t result;
|
unw_word_t result;
|
||||||
unw_get_reg(cursor, UNW_REG_SP, &result);
|
unw_get_reg(cursor, UNW_REG_SP, &result);
|
||||||
_LIBUNWIND_TRACE_API("_Unwind_GetCFA(context=%p) => 0x%" PRIx64 "\n",
|
_LIBUNWIND_TRACE_API("_Unwind_GetCFA(context=%p) => 0x%" PRIx64,
|
||||||
(void *)context, (uint64_t)result);
|
(void *)context, (uint64_t)result);
|
||||||
return (uintptr_t)result;
|
return (uintptr_t)result;
|
||||||
}
|
}
|
||||||
@ -217,7 +217,7 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetCFA(struct _Unwind_Context *context) {
|
|||||||
/// site address. Normally IP is the return address.
|
/// site address. Normally IP is the return address.
|
||||||
_LIBUNWIND_EXPORT uintptr_t _Unwind_GetIPInfo(struct _Unwind_Context *context,
|
_LIBUNWIND_EXPORT uintptr_t _Unwind_GetIPInfo(struct _Unwind_Context *context,
|
||||||
int *ipBefore) {
|
int *ipBefore) {
|
||||||
_LIBUNWIND_TRACE_API("_Unwind_GetIPInfo(context=%p)\n", (void *)context);
|
_LIBUNWIND_TRACE_API("_Unwind_GetIPInfo(context=%p)", (void *)context);
|
||||||
*ipBefore = 0;
|
*ipBefore = 0;
|
||||||
return _Unwind_GetIP(context);
|
return _Unwind_GetIP(context);
|
||||||
}
|
}
|
||||||
@ -229,7 +229,7 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetIPInfo(struct _Unwind_Context *context,
|
|||||||
/// This function has existed on Mac OS X since 10.4, but
|
/// This function has existed on Mac OS X since 10.4, but
|
||||||
/// was broken until 10.6.
|
/// was broken until 10.6.
|
||||||
_LIBUNWIND_EXPORT void __register_frame(const void *fde) {
|
_LIBUNWIND_EXPORT void __register_frame(const void *fde) {
|
||||||
_LIBUNWIND_TRACE_API("__register_frame(%p)\n", fde);
|
_LIBUNWIND_TRACE_API("__register_frame(%p)", fde);
|
||||||
_unw_add_dynamic_fde((unw_word_t)(uintptr_t) fde);
|
_unw_add_dynamic_fde((unw_word_t)(uintptr_t) fde);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -239,7 +239,7 @@ _LIBUNWIND_EXPORT void __register_frame(const void *fde) {
|
|||||||
/// This function has existed on Mac OS X since 10.4, but
|
/// This function has existed on Mac OS X since 10.4, but
|
||||||
/// was broken until 10.6.
|
/// was broken until 10.6.
|
||||||
_LIBUNWIND_EXPORT void __deregister_frame(const void *fde) {
|
_LIBUNWIND_EXPORT void __deregister_frame(const void *fde) {
|
||||||
_LIBUNWIND_TRACE_API("__deregister_frame(%p)\n", fde);
|
_LIBUNWIND_TRACE_API("__deregister_frame(%p)", fde);
|
||||||
_unw_remove_dynamic_fde((unw_word_t)(uintptr_t) fde);
|
_unw_remove_dynamic_fde((unw_word_t)(uintptr_t) fde);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -259,7 +259,7 @@ _LIBUNWIND_EXPORT void __register_frame_info_bases(const void *fde, void *ob,
|
|||||||
(void)ob;
|
(void)ob;
|
||||||
(void)tb;
|
(void)tb;
|
||||||
(void)db;
|
(void)db;
|
||||||
_LIBUNWIND_TRACE_API("__register_frame_info_bases(%p,%p, %p, %p)\n",
|
_LIBUNWIND_TRACE_API("__register_frame_info_bases(%p,%p, %p, %p)",
|
||||||
fde, ob, tb, db);
|
fde, ob, tb, db);
|
||||||
// do nothing, this function never worked in Mac OS X
|
// do nothing, this function never worked in Mac OS X
|
||||||
}
|
}
|
||||||
@ -267,7 +267,7 @@ _LIBUNWIND_EXPORT void __register_frame_info_bases(const void *fde, void *ob,
|
|||||||
_LIBUNWIND_EXPORT void __register_frame_info(const void *fde, void *ob) {
|
_LIBUNWIND_EXPORT void __register_frame_info(const void *fde, void *ob) {
|
||||||
(void)fde;
|
(void)fde;
|
||||||
(void)ob;
|
(void)ob;
|
||||||
_LIBUNWIND_TRACE_API("__register_frame_info(%p, %p)\n", fde, ob);
|
_LIBUNWIND_TRACE_API("__register_frame_info(%p, %p)", fde, ob);
|
||||||
// do nothing, this function never worked in Mac OS X
|
// do nothing, this function never worked in Mac OS X
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -279,33 +279,33 @@ _LIBUNWIND_EXPORT void __register_frame_info_table_bases(const void *fde,
|
|||||||
(void)tb;
|
(void)tb;
|
||||||
(void)db;
|
(void)db;
|
||||||
_LIBUNWIND_TRACE_API("__register_frame_info_table_bases"
|
_LIBUNWIND_TRACE_API("__register_frame_info_table_bases"
|
||||||
"(%p,%p, %p, %p)\n", fde, ob, tb, db);
|
"(%p,%p, %p, %p)", fde, ob, tb, db);
|
||||||
// do nothing, this function never worked in Mac OS X
|
// do nothing, this function never worked in Mac OS X
|
||||||
}
|
}
|
||||||
|
|
||||||
_LIBUNWIND_EXPORT void __register_frame_info_table(const void *fde, void *ob) {
|
_LIBUNWIND_EXPORT void __register_frame_info_table(const void *fde, void *ob) {
|
||||||
(void)fde;
|
(void)fde;
|
||||||
(void)ob;
|
(void)ob;
|
||||||
_LIBUNWIND_TRACE_API("__register_frame_info_table(%p, %p)\n", fde, ob);
|
_LIBUNWIND_TRACE_API("__register_frame_info_table(%p, %p)", fde, ob);
|
||||||
// do nothing, this function never worked in Mac OS X
|
// do nothing, this function never worked in Mac OS X
|
||||||
}
|
}
|
||||||
|
|
||||||
_LIBUNWIND_EXPORT void __register_frame_table(const void *fde) {
|
_LIBUNWIND_EXPORT void __register_frame_table(const void *fde) {
|
||||||
(void)fde;
|
(void)fde;
|
||||||
_LIBUNWIND_TRACE_API("__register_frame_table(%p)\n", fde);
|
_LIBUNWIND_TRACE_API("__register_frame_table(%p)", fde);
|
||||||
// do nothing, this function never worked in Mac OS X
|
// do nothing, this function never worked in Mac OS X
|
||||||
}
|
}
|
||||||
|
|
||||||
_LIBUNWIND_EXPORT void *__deregister_frame_info(const void *fde) {
|
_LIBUNWIND_EXPORT void *__deregister_frame_info(const void *fde) {
|
||||||
(void)fde;
|
(void)fde;
|
||||||
_LIBUNWIND_TRACE_API("__deregister_frame_info(%p)\n", fde);
|
_LIBUNWIND_TRACE_API("__deregister_frame_info(%p)", fde);
|
||||||
// do nothing, this function never worked in Mac OS X
|
// do nothing, this function never worked in Mac OS X
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
_LIBUNWIND_EXPORT void *__deregister_frame_info_bases(const void *fde) {
|
_LIBUNWIND_EXPORT void *__deregister_frame_info_bases(const void *fde) {
|
||||||
(void)fde;
|
(void)fde;
|
||||||
_LIBUNWIND_TRACE_API("__deregister_frame_info_bases(%p)\n", fde);
|
_LIBUNWIND_TRACE_API("__deregister_frame_info_bases(%p)", fde);
|
||||||
// do nothing, this function never worked in Mac OS X
|
// do nothing, this function never worked in Mac OS X
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -39,17 +39,17 @@ unwind_phase1(unw_context_t *uc, unw_cursor_t *cursor, _Unwind_Exception *except
|
|||||||
// Walk each frame looking for a place to stop.
|
// Walk each frame looking for a place to stop.
|
||||||
bool handlerNotFound = true;
|
bool handlerNotFound = true;
|
||||||
while (handlerNotFound) {
|
while (handlerNotFound) {
|
||||||
// Ask libuwind to get next frame (skip over first which is
|
// Ask libunwind to get next frame (skip over first which is
|
||||||
// _Unwind_RaiseException).
|
// _Unwind_RaiseException).
|
||||||
int stepResult = unw_step(cursor);
|
int stepResult = unw_step(cursor);
|
||||||
if (stepResult == 0) {
|
if (stepResult == 0) {
|
||||||
_LIBUNWIND_TRACE_UNWINDING("unwind_phase1(ex_ojb=%p): unw_step() reached "
|
_LIBUNWIND_TRACE_UNWINDING("unwind_phase1(ex_ojb=%p): unw_step() reached "
|
||||||
"bottom => _URC_END_OF_STACK\n",
|
"bottom => _URC_END_OF_STACK",
|
||||||
(void *)exception_object);
|
(void *)exception_object);
|
||||||
return _URC_END_OF_STACK;
|
return _URC_END_OF_STACK;
|
||||||
} else if (stepResult < 0) {
|
} else if (stepResult < 0) {
|
||||||
_LIBUNWIND_TRACE_UNWINDING("unwind_phase1(ex_ojb=%p): unw_step failed => "
|
_LIBUNWIND_TRACE_UNWINDING("unwind_phase1(ex_ojb=%p): unw_step failed => "
|
||||||
"_URC_FATAL_PHASE1_ERROR\n",
|
"_URC_FATAL_PHASE1_ERROR",
|
||||||
(void *)exception_object);
|
(void *)exception_object);
|
||||||
return _URC_FATAL_PHASE1_ERROR;
|
return _URC_FATAL_PHASE1_ERROR;
|
||||||
}
|
}
|
||||||
@ -59,7 +59,7 @@ unwind_phase1(unw_context_t *uc, unw_cursor_t *cursor, _Unwind_Exception *except
|
|||||||
unw_word_t sp;
|
unw_word_t sp;
|
||||||
if (unw_get_proc_info(cursor, &frameInfo) != UNW_ESUCCESS) {
|
if (unw_get_proc_info(cursor, &frameInfo) != UNW_ESUCCESS) {
|
||||||
_LIBUNWIND_TRACE_UNWINDING("unwind_phase1(ex_ojb=%p): unw_get_proc_info "
|
_LIBUNWIND_TRACE_UNWINDING("unwind_phase1(ex_ojb=%p): unw_get_proc_info "
|
||||||
"failed => _URC_FATAL_PHASE1_ERROR\n",
|
"failed => _URC_FATAL_PHASE1_ERROR",
|
||||||
(void *)exception_object);
|
(void *)exception_object);
|
||||||
return _URC_FATAL_PHASE1_ERROR;
|
return _URC_FATAL_PHASE1_ERROR;
|
||||||
}
|
}
|
||||||
@ -77,7 +77,7 @@ unwind_phase1(unw_context_t *uc, unw_cursor_t *cursor, _Unwind_Exception *except
|
|||||||
unw_get_reg(cursor, UNW_REG_IP, &pc);
|
unw_get_reg(cursor, UNW_REG_IP, &pc);
|
||||||
_LIBUNWIND_TRACE_UNWINDING(
|
_LIBUNWIND_TRACE_UNWINDING(
|
||||||
"unwind_phase1(ex_ojb=%p): pc=0x%" PRIx64 ", start_ip=0x%" PRIx64
|
"unwind_phase1(ex_ojb=%p): pc=0x%" PRIx64 ", start_ip=0x%" PRIx64
|
||||||
", func=%s, lsda=0x%" PRIx64 ", personality=0x%" PRIx64 "\n",
|
", func=%s, lsda=0x%" PRIx64 ", personality=0x%" PRIx64 "",
|
||||||
(void *)exception_object, pc, frameInfo.start_ip, functionName,
|
(void *)exception_object, pc, frameInfo.start_ip, functionName,
|
||||||
frameInfo.lsda, frameInfo.handler);
|
frameInfo.lsda, frameInfo.handler);
|
||||||
}
|
}
|
||||||
@ -88,7 +88,7 @@ unwind_phase1(unw_context_t *uc, unw_cursor_t *cursor, _Unwind_Exception *except
|
|||||||
__personality_routine p =
|
__personality_routine p =
|
||||||
(__personality_routine)(long)(frameInfo.handler);
|
(__personality_routine)(long)(frameInfo.handler);
|
||||||
_LIBUNWIND_TRACE_UNWINDING(
|
_LIBUNWIND_TRACE_UNWINDING(
|
||||||
"unwind_phase1(ex_ojb=%p): calling personality function %p\n",
|
"unwind_phase1(ex_ojb=%p): calling personality function %p",
|
||||||
(void *)exception_object, (void *)(uintptr_t)p);
|
(void *)exception_object, (void *)(uintptr_t)p);
|
||||||
_Unwind_Reason_Code personalityResult =
|
_Unwind_Reason_Code personalityResult =
|
||||||
(*p)(1, _UA_SEARCH_PHASE, exception_object->exception_class,
|
(*p)(1, _UA_SEARCH_PHASE, exception_object->exception_class,
|
||||||
@ -101,13 +101,13 @@ unwind_phase1(unw_context_t *uc, unw_cursor_t *cursor, _Unwind_Exception *except
|
|||||||
unw_get_reg(cursor, UNW_REG_SP, &sp);
|
unw_get_reg(cursor, UNW_REG_SP, &sp);
|
||||||
exception_object->private_2 = (uintptr_t)sp;
|
exception_object->private_2 = (uintptr_t)sp;
|
||||||
_LIBUNWIND_TRACE_UNWINDING(
|
_LIBUNWIND_TRACE_UNWINDING(
|
||||||
"unwind_phase1(ex_ojb=%p): _URC_HANDLER_FOUND \n",
|
"unwind_phase1(ex_ojb=%p): _URC_HANDLER_FOUND",
|
||||||
(void *)exception_object);
|
(void *)exception_object);
|
||||||
return _URC_NO_REASON;
|
return _URC_NO_REASON;
|
||||||
|
|
||||||
case _URC_CONTINUE_UNWIND:
|
case _URC_CONTINUE_UNWIND:
|
||||||
_LIBUNWIND_TRACE_UNWINDING(
|
_LIBUNWIND_TRACE_UNWINDING(
|
||||||
"unwind_phase1(ex_ojb=%p): _URC_CONTINUE_UNWIND\n",
|
"unwind_phase1(ex_ojb=%p): _URC_CONTINUE_UNWIND",
|
||||||
(void *)exception_object);
|
(void *)exception_object);
|
||||||
// continue unwinding
|
// continue unwinding
|
||||||
break;
|
break;
|
||||||
@ -115,7 +115,7 @@ unwind_phase1(unw_context_t *uc, unw_cursor_t *cursor, _Unwind_Exception *except
|
|||||||
default:
|
default:
|
||||||
// something went wrong
|
// something went wrong
|
||||||
_LIBUNWIND_TRACE_UNWINDING(
|
_LIBUNWIND_TRACE_UNWINDING(
|
||||||
"unwind_phase1(ex_ojb=%p): _URC_FATAL_PHASE1_ERROR\n",
|
"unwind_phase1(ex_ojb=%p): _URC_FATAL_PHASE1_ERROR",
|
||||||
(void *)exception_object);
|
(void *)exception_object);
|
||||||
return _URC_FATAL_PHASE1_ERROR;
|
return _URC_FATAL_PHASE1_ERROR;
|
||||||
}
|
}
|
||||||
@ -129,23 +129,23 @@ static _Unwind_Reason_Code
|
|||||||
unwind_phase2(unw_context_t *uc, unw_cursor_t *cursor, _Unwind_Exception *exception_object) {
|
unwind_phase2(unw_context_t *uc, unw_cursor_t *cursor, _Unwind_Exception *exception_object) {
|
||||||
unw_init_local(cursor, uc);
|
unw_init_local(cursor, uc);
|
||||||
|
|
||||||
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p)\n",
|
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p)",
|
||||||
(void *)exception_object);
|
(void *)exception_object);
|
||||||
|
|
||||||
// Walk each frame until we reach where search phase said to stop.
|
// Walk each frame until we reach where search phase said to stop.
|
||||||
while (true) {
|
while (true) {
|
||||||
|
|
||||||
// Ask libuwind to get next frame (skip over first which is
|
// Ask libunwind to get next frame (skip over first which is
|
||||||
// _Unwind_RaiseException).
|
// _Unwind_RaiseException).
|
||||||
int stepResult = unw_step(cursor);
|
int stepResult = unw_step(cursor);
|
||||||
if (stepResult == 0) {
|
if (stepResult == 0) {
|
||||||
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): unw_step() reached "
|
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): unw_step() reached "
|
||||||
"bottom => _URC_END_OF_STACK\n",
|
"bottom => _URC_END_OF_STACK",
|
||||||
(void *)exception_object);
|
(void *)exception_object);
|
||||||
return _URC_END_OF_STACK;
|
return _URC_END_OF_STACK;
|
||||||
} else if (stepResult < 0) {
|
} else if (stepResult < 0) {
|
||||||
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): unw_step failed => "
|
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): unw_step failed => "
|
||||||
"_URC_FATAL_PHASE1_ERROR\n",
|
"_URC_FATAL_PHASE1_ERROR",
|
||||||
(void *)exception_object);
|
(void *)exception_object);
|
||||||
return _URC_FATAL_PHASE2_ERROR;
|
return _URC_FATAL_PHASE2_ERROR;
|
||||||
}
|
}
|
||||||
@ -156,7 +156,7 @@ unwind_phase2(unw_context_t *uc, unw_cursor_t *cursor, _Unwind_Exception *except
|
|||||||
unw_get_reg(cursor, UNW_REG_SP, &sp);
|
unw_get_reg(cursor, UNW_REG_SP, &sp);
|
||||||
if (unw_get_proc_info(cursor, &frameInfo) != UNW_ESUCCESS) {
|
if (unw_get_proc_info(cursor, &frameInfo) != UNW_ESUCCESS) {
|
||||||
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): unw_get_proc_info "
|
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): unw_get_proc_info "
|
||||||
"failed => _URC_FATAL_PHASE1_ERROR\n",
|
"failed => _URC_FATAL_PHASE1_ERROR",
|
||||||
(void *)exception_object);
|
(void *)exception_object);
|
||||||
return _URC_FATAL_PHASE2_ERROR;
|
return _URC_FATAL_PHASE2_ERROR;
|
||||||
}
|
}
|
||||||
@ -172,7 +172,7 @@ unwind_phase2(unw_context_t *uc, unw_cursor_t *cursor, _Unwind_Exception *except
|
|||||||
functionName = ".anonymous.";
|
functionName = ".anonymous.";
|
||||||
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): start_ip=0x%" PRIx64
|
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): start_ip=0x%" PRIx64
|
||||||
", func=%s, sp=0x%" PRIx64 ", lsda=0x%" PRIx64
|
", func=%s, sp=0x%" PRIx64 ", lsda=0x%" PRIx64
|
||||||
", personality=0x%" PRIx64 "\n",
|
", personality=0x%" PRIx64,
|
||||||
(void *)exception_object, frameInfo.start_ip,
|
(void *)exception_object, frameInfo.start_ip,
|
||||||
functionName, sp, frameInfo.lsda,
|
functionName, sp, frameInfo.lsda,
|
||||||
frameInfo.handler);
|
frameInfo.handler);
|
||||||
@ -194,7 +194,7 @@ unwind_phase2(unw_context_t *uc, unw_cursor_t *cursor, _Unwind_Exception *except
|
|||||||
case _URC_CONTINUE_UNWIND:
|
case _URC_CONTINUE_UNWIND:
|
||||||
// Continue unwinding
|
// Continue unwinding
|
||||||
_LIBUNWIND_TRACE_UNWINDING(
|
_LIBUNWIND_TRACE_UNWINDING(
|
||||||
"unwind_phase2(ex_ojb=%p): _URC_CONTINUE_UNWIND\n",
|
"unwind_phase2(ex_ojb=%p): _URC_CONTINUE_UNWIND",
|
||||||
(void *)exception_object);
|
(void *)exception_object);
|
||||||
if (sp == exception_object->private_2) {
|
if (sp == exception_object->private_2) {
|
||||||
// Phase 1 said we would stop at this frame, but we did not...
|
// Phase 1 said we would stop at this frame, but we did not...
|
||||||
@ -204,7 +204,7 @@ unwind_phase2(unw_context_t *uc, unw_cursor_t *cursor, _Unwind_Exception *except
|
|||||||
break;
|
break;
|
||||||
case _URC_INSTALL_CONTEXT:
|
case _URC_INSTALL_CONTEXT:
|
||||||
_LIBUNWIND_TRACE_UNWINDING(
|
_LIBUNWIND_TRACE_UNWINDING(
|
||||||
"unwind_phase2(ex_ojb=%p): _URC_INSTALL_CONTEXT\n",
|
"unwind_phase2(ex_ojb=%p): _URC_INSTALL_CONTEXT",
|
||||||
(void *)exception_object);
|
(void *)exception_object);
|
||||||
// Personality routine says to transfer control to landing pad.
|
// Personality routine says to transfer control to landing pad.
|
||||||
// We may get control back if landing pad calls _Unwind_Resume().
|
// We may get control back if landing pad calls _Unwind_Resume().
|
||||||
@ -214,7 +214,7 @@ unwind_phase2(unw_context_t *uc, unw_cursor_t *cursor, _Unwind_Exception *except
|
|||||||
unw_get_reg(cursor, UNW_REG_SP, &sp);
|
unw_get_reg(cursor, UNW_REG_SP, &sp);
|
||||||
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): re-entering "
|
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): re-entering "
|
||||||
"user code with ip=0x%" PRIx64
|
"user code with ip=0x%" PRIx64
|
||||||
", sp=0x%" PRIx64 "\n",
|
", sp=0x%" PRIx64,
|
||||||
(void *)exception_object, pc, sp);
|
(void *)exception_object, pc, sp);
|
||||||
}
|
}
|
||||||
unw_resume(cursor);
|
unw_resume(cursor);
|
||||||
@ -247,7 +247,7 @@ unwind_phase2_forced(unw_context_t *uc, unw_cursor_t *cursor,
|
|||||||
unw_proc_info_t frameInfo;
|
unw_proc_info_t frameInfo;
|
||||||
if (unw_get_proc_info(cursor, &frameInfo) != UNW_ESUCCESS) {
|
if (unw_get_proc_info(cursor, &frameInfo) != UNW_ESUCCESS) {
|
||||||
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2_forced(ex_ojb=%p): unw_step "
|
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2_forced(ex_ojb=%p): unw_step "
|
||||||
"failed => _URC_END_OF_STACK\n",
|
"failed => _URC_END_OF_STACK",
|
||||||
(void *)exception_object);
|
(void *)exception_object);
|
||||||
return _URC_FATAL_PHASE2_ERROR;
|
return _URC_FATAL_PHASE2_ERROR;
|
||||||
}
|
}
|
||||||
@ -263,7 +263,7 @@ unwind_phase2_forced(unw_context_t *uc, unw_cursor_t *cursor,
|
|||||||
functionName = ".anonymous.";
|
functionName = ".anonymous.";
|
||||||
_LIBUNWIND_TRACE_UNWINDING(
|
_LIBUNWIND_TRACE_UNWINDING(
|
||||||
"unwind_phase2_forced(ex_ojb=%p): start_ip=0x%" PRIx64
|
"unwind_phase2_forced(ex_ojb=%p): start_ip=0x%" PRIx64
|
||||||
", func=%s, lsda=0x%" PRIx64 ", personality=0x%" PRIx64 "\n",
|
", func=%s, lsda=0x%" PRIx64 ", personality=0x%" PRIx64,
|
||||||
(void *)exception_object, frameInfo.start_ip, functionName,
|
(void *)exception_object, frameInfo.start_ip, functionName,
|
||||||
frameInfo.lsda, frameInfo.handler);
|
frameInfo.lsda, frameInfo.handler);
|
||||||
}
|
}
|
||||||
@ -275,11 +275,11 @@ unwind_phase2_forced(unw_context_t *uc, unw_cursor_t *cursor,
|
|||||||
(*stop)(1, action, exception_object->exception_class, exception_object,
|
(*stop)(1, action, exception_object->exception_class, exception_object,
|
||||||
(struct _Unwind_Context *)(cursor), stop_parameter);
|
(struct _Unwind_Context *)(cursor), stop_parameter);
|
||||||
_LIBUNWIND_TRACE_UNWINDING(
|
_LIBUNWIND_TRACE_UNWINDING(
|
||||||
"unwind_phase2_forced(ex_ojb=%p): stop function returned %d\n",
|
"unwind_phase2_forced(ex_ojb=%p): stop function returned %d",
|
||||||
(void *)exception_object, stopResult);
|
(void *)exception_object, stopResult);
|
||||||
if (stopResult != _URC_NO_REASON) {
|
if (stopResult != _URC_NO_REASON) {
|
||||||
_LIBUNWIND_TRACE_UNWINDING(
|
_LIBUNWIND_TRACE_UNWINDING(
|
||||||
"unwind_phase2_forced(ex_ojb=%p): stopped by stop function\n",
|
"unwind_phase2_forced(ex_ojb=%p): stopped by stop function",
|
||||||
(void *)exception_object);
|
(void *)exception_object);
|
||||||
return _URC_FATAL_PHASE2_ERROR;
|
return _URC_FATAL_PHASE2_ERROR;
|
||||||
}
|
}
|
||||||
@ -289,7 +289,7 @@ unwind_phase2_forced(unw_context_t *uc, unw_cursor_t *cursor,
|
|||||||
__personality_routine p =
|
__personality_routine p =
|
||||||
(__personality_routine)(long)(frameInfo.handler);
|
(__personality_routine)(long)(frameInfo.handler);
|
||||||
_LIBUNWIND_TRACE_UNWINDING(
|
_LIBUNWIND_TRACE_UNWINDING(
|
||||||
"unwind_phase2_forced(ex_ojb=%p): calling personality function %p\n",
|
"unwind_phase2_forced(ex_ojb=%p): calling personality function %p",
|
||||||
(void *)exception_object, (void *)(uintptr_t)p);
|
(void *)exception_object, (void *)(uintptr_t)p);
|
||||||
_Unwind_Reason_Code personalityResult =
|
_Unwind_Reason_Code personalityResult =
|
||||||
(*p)(1, action, exception_object->exception_class, exception_object,
|
(*p)(1, action, exception_object->exception_class, exception_object,
|
||||||
@ -298,14 +298,14 @@ unwind_phase2_forced(unw_context_t *uc, unw_cursor_t *cursor,
|
|||||||
case _URC_CONTINUE_UNWIND:
|
case _URC_CONTINUE_UNWIND:
|
||||||
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2_forced(ex_ojb=%p): "
|
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2_forced(ex_ojb=%p): "
|
||||||
"personality returned "
|
"personality returned "
|
||||||
"_URC_CONTINUE_UNWIND\n",
|
"_URC_CONTINUE_UNWIND",
|
||||||
(void *)exception_object);
|
(void *)exception_object);
|
||||||
// Destructors called, continue unwinding
|
// Destructors called, continue unwinding
|
||||||
break;
|
break;
|
||||||
case _URC_INSTALL_CONTEXT:
|
case _URC_INSTALL_CONTEXT:
|
||||||
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2_forced(ex_ojb=%p): "
|
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2_forced(ex_ojb=%p): "
|
||||||
"personality returned "
|
"personality returned "
|
||||||
"_URC_INSTALL_CONTEXT\n",
|
"_URC_INSTALL_CONTEXT",
|
||||||
(void *)exception_object);
|
(void *)exception_object);
|
||||||
// We may get control back if landing pad calls _Unwind_Resume().
|
// We may get control back if landing pad calls _Unwind_Resume().
|
||||||
unw_resume(cursor);
|
unw_resume(cursor);
|
||||||
@ -314,7 +314,7 @@ unwind_phase2_forced(unw_context_t *uc, unw_cursor_t *cursor,
|
|||||||
// Personality routine returned an unknown result code.
|
// Personality routine returned an unknown result code.
|
||||||
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2_forced(ex_ojb=%p): "
|
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2_forced(ex_ojb=%p): "
|
||||||
"personality returned %d, "
|
"personality returned %d, "
|
||||||
"_URC_FATAL_PHASE2_ERROR\n",
|
"_URC_FATAL_PHASE2_ERROR",
|
||||||
(void *)exception_object, personalityResult);
|
(void *)exception_object, personalityResult);
|
||||||
return _URC_FATAL_PHASE2_ERROR;
|
return _URC_FATAL_PHASE2_ERROR;
|
||||||
}
|
}
|
||||||
@ -324,7 +324,7 @@ unwind_phase2_forced(unw_context_t *uc, unw_cursor_t *cursor,
|
|||||||
// Call stop function one last time and tell it we've reached the end
|
// Call stop function one last time and tell it we've reached the end
|
||||||
// of the stack.
|
// of the stack.
|
||||||
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2_forced(ex_ojb=%p): calling stop "
|
_LIBUNWIND_TRACE_UNWINDING("unwind_phase2_forced(ex_ojb=%p): calling stop "
|
||||||
"function with _UA_END_OF_STACK\n",
|
"function with _UA_END_OF_STACK",
|
||||||
(void *)exception_object);
|
(void *)exception_object);
|
||||||
_Unwind_Action lastAction =
|
_Unwind_Action lastAction =
|
||||||
(_Unwind_Action)(_UA_FORCE_UNWIND | _UA_CLEANUP_PHASE | _UA_END_OF_STACK);
|
(_Unwind_Action)(_UA_FORCE_UNWIND | _UA_CLEANUP_PHASE | _UA_END_OF_STACK);
|
||||||
@ -340,7 +340,7 @@ unwind_phase2_forced(unw_context_t *uc, unw_cursor_t *cursor,
|
|||||||
/// Called by __cxa_throw. Only returns if there is a fatal error.
|
/// Called by __cxa_throw. Only returns if there is a fatal error.
|
||||||
_LIBUNWIND_EXPORT _Unwind_Reason_Code
|
_LIBUNWIND_EXPORT _Unwind_Reason_Code
|
||||||
_Unwind_RaiseException(_Unwind_Exception *exception_object) {
|
_Unwind_RaiseException(_Unwind_Exception *exception_object) {
|
||||||
_LIBUNWIND_TRACE_API("_Unwind_RaiseException(ex_obj=%p)\n",
|
_LIBUNWIND_TRACE_API("_Unwind_RaiseException(ex_obj=%p)",
|
||||||
(void *)exception_object);
|
(void *)exception_object);
|
||||||
unw_context_t uc;
|
unw_context_t uc;
|
||||||
unw_cursor_t cursor;
|
unw_cursor_t cursor;
|
||||||
@ -375,7 +375,7 @@ _Unwind_RaiseException(_Unwind_Exception *exception_object) {
|
|||||||
/// in turn calls _Unwind_Resume_or_Rethrow().
|
/// in turn calls _Unwind_Resume_or_Rethrow().
|
||||||
_LIBUNWIND_EXPORT void
|
_LIBUNWIND_EXPORT void
|
||||||
_Unwind_Resume(_Unwind_Exception *exception_object) {
|
_Unwind_Resume(_Unwind_Exception *exception_object) {
|
||||||
_LIBUNWIND_TRACE_API("_Unwind_Resume(ex_obj=%p)\n", (void *)exception_object);
|
_LIBUNWIND_TRACE_API("_Unwind_Resume(ex_obj=%p)", (void *)exception_object);
|
||||||
unw_context_t uc;
|
unw_context_t uc;
|
||||||
unw_cursor_t cursor;
|
unw_cursor_t cursor;
|
||||||
unw_getcontext(&uc);
|
unw_getcontext(&uc);
|
||||||
@ -399,7 +399,7 @@ _Unwind_Resume(_Unwind_Exception *exception_object) {
|
|||||||
_LIBUNWIND_EXPORT _Unwind_Reason_Code
|
_LIBUNWIND_EXPORT _Unwind_Reason_Code
|
||||||
_Unwind_ForcedUnwind(_Unwind_Exception *exception_object,
|
_Unwind_ForcedUnwind(_Unwind_Exception *exception_object,
|
||||||
_Unwind_Stop_Fn stop, void *stop_parameter) {
|
_Unwind_Stop_Fn stop, void *stop_parameter) {
|
||||||
_LIBUNWIND_TRACE_API("_Unwind_ForcedUnwind(ex_obj=%p, stop=%p)\n",
|
_LIBUNWIND_TRACE_API("_Unwind_ForcedUnwind(ex_obj=%p, stop=%p)",
|
||||||
(void *)exception_object, (void *)(uintptr_t)stop);
|
(void *)exception_object, (void *)(uintptr_t)stop);
|
||||||
unw_context_t uc;
|
unw_context_t uc;
|
||||||
unw_cursor_t cursor;
|
unw_cursor_t cursor;
|
||||||
@ -424,11 +424,11 @@ _Unwind_GetLanguageSpecificData(struct _Unwind_Context *context) {
|
|||||||
if (unw_get_proc_info(cursor, &frameInfo) == UNW_ESUCCESS)
|
if (unw_get_proc_info(cursor, &frameInfo) == UNW_ESUCCESS)
|
||||||
result = (uintptr_t)frameInfo.lsda;
|
result = (uintptr_t)frameInfo.lsda;
|
||||||
_LIBUNWIND_TRACE_API(
|
_LIBUNWIND_TRACE_API(
|
||||||
"_Unwind_GetLanguageSpecificData(context=%p) => 0x%" PRIxPTR "\n",
|
"_Unwind_GetLanguageSpecificData(context=%p) => 0x%" PRIxPTR,
|
||||||
(void *)context, result);
|
(void *)context, result);
|
||||||
if (result != 0) {
|
if (result != 0) {
|
||||||
if (*((uint8_t *)result) != 0xFF)
|
if (*((uint8_t *)result) != 0xFF)
|
||||||
_LIBUNWIND_DEBUG_LOG("lsda at 0x%" PRIxPTR " does not start with 0xFF\n",
|
_LIBUNWIND_DEBUG_LOG("lsda at 0x%" PRIxPTR " does not start with 0xFF",
|
||||||
result);
|
result);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
@ -444,7 +444,7 @@ _Unwind_GetRegionStart(struct _Unwind_Context *context) {
|
|||||||
uintptr_t result = 0;
|
uintptr_t result = 0;
|
||||||
if (unw_get_proc_info(cursor, &frameInfo) == UNW_ESUCCESS)
|
if (unw_get_proc_info(cursor, &frameInfo) == UNW_ESUCCESS)
|
||||||
result = (uintptr_t)frameInfo.start_ip;
|
result = (uintptr_t)frameInfo.start_ip;
|
||||||
_LIBUNWIND_TRACE_API("_Unwind_GetRegionStart(context=%p) => 0x%" PRIxPTR "\n",
|
_LIBUNWIND_TRACE_API("_Unwind_GetRegionStart(context=%p) => 0x%" PRIxPTR,
|
||||||
(void *)context, result);
|
(void *)context, result);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -454,7 +454,7 @@ _Unwind_GetRegionStart(struct _Unwind_Context *context) {
|
|||||||
// is caught.
|
// is caught.
|
||||||
_LIBUNWIND_EXPORT void
|
_LIBUNWIND_EXPORT void
|
||||||
_Unwind_DeleteException(_Unwind_Exception *exception_object) {
|
_Unwind_DeleteException(_Unwind_Exception *exception_object) {
|
||||||
_LIBUNWIND_TRACE_API("_Unwind_DeleteException(ex_obj=%p)\n",
|
_LIBUNWIND_TRACE_API("_Unwind_DeleteException(ex_obj=%p)",
|
||||||
(void *)exception_object);
|
(void *)exception_object);
|
||||||
if (exception_object->exception_cleanup != NULL)
|
if (exception_object->exception_cleanup != NULL)
|
||||||
(*exception_object->exception_cleanup)(_URC_FOREIGN_EXCEPTION_CAUGHT,
|
(*exception_object->exception_cleanup)(_URC_FOREIGN_EXCEPTION_CAUGHT,
|
||||||
@ -467,7 +467,7 @@ _Unwind_GetGR(struct _Unwind_Context *context, int index) {
|
|||||||
unw_cursor_t *cursor = (unw_cursor_t *)context;
|
unw_cursor_t *cursor = (unw_cursor_t *)context;
|
||||||
unw_word_t result;
|
unw_word_t result;
|
||||||
unw_get_reg(cursor, index, &result);
|
unw_get_reg(cursor, index, &result);
|
||||||
_LIBUNWIND_TRACE_API("_Unwind_GetGR(context=%p, reg=%d) => 0x%" PRIx64 "\n",
|
_LIBUNWIND_TRACE_API("_Unwind_GetGR(context=%p, reg=%d) => 0x%" PRIx64,
|
||||||
(void *)context, index, (uint64_t)result);
|
(void *)context, index, (uint64_t)result);
|
||||||
return (uintptr_t)result;
|
return (uintptr_t)result;
|
||||||
}
|
}
|
||||||
@ -476,7 +476,7 @@ _Unwind_GetGR(struct _Unwind_Context *context, int index) {
|
|||||||
_LIBUNWIND_EXPORT void _Unwind_SetGR(struct _Unwind_Context *context, int index,
|
_LIBUNWIND_EXPORT void _Unwind_SetGR(struct _Unwind_Context *context, int index,
|
||||||
uintptr_t value) {
|
uintptr_t value) {
|
||||||
_LIBUNWIND_TRACE_API("_Unwind_SetGR(context=%p, reg=%d, value=0x%0" PRIx64
|
_LIBUNWIND_TRACE_API("_Unwind_SetGR(context=%p, reg=%d, value=0x%0" PRIx64
|
||||||
")\n",
|
")",
|
||||||
(void *)context, index, (uint64_t)value);
|
(void *)context, index, (uint64_t)value);
|
||||||
unw_cursor_t *cursor = (unw_cursor_t *)context;
|
unw_cursor_t *cursor = (unw_cursor_t *)context;
|
||||||
unw_set_reg(cursor, index, value);
|
unw_set_reg(cursor, index, value);
|
||||||
@ -487,7 +487,7 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetIP(struct _Unwind_Context *context) {
|
|||||||
unw_cursor_t *cursor = (unw_cursor_t *)context;
|
unw_cursor_t *cursor = (unw_cursor_t *)context;
|
||||||
unw_word_t result;
|
unw_word_t result;
|
||||||
unw_get_reg(cursor, UNW_REG_IP, &result);
|
unw_get_reg(cursor, UNW_REG_IP, &result);
|
||||||
_LIBUNWIND_TRACE_API("_Unwind_GetIP(context=%p) => 0x%" PRIx64 "\n",
|
_LIBUNWIND_TRACE_API("_Unwind_GetIP(context=%p) => 0x%" PRIx64,
|
||||||
(void *)context, (uint64_t)result);
|
(void *)context, (uint64_t)result);
|
||||||
return (uintptr_t)result;
|
return (uintptr_t)result;
|
||||||
}
|
}
|
||||||
@ -497,7 +497,7 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetIP(struct _Unwind_Context *context) {
|
|||||||
/// start executing in the landing pad.
|
/// start executing in the landing pad.
|
||||||
_LIBUNWIND_EXPORT void _Unwind_SetIP(struct _Unwind_Context *context,
|
_LIBUNWIND_EXPORT void _Unwind_SetIP(struct _Unwind_Context *context,
|
||||||
uintptr_t value) {
|
uintptr_t value) {
|
||||||
_LIBUNWIND_TRACE_API("_Unwind_SetIP(context=%p, value=0x%0" PRIx64 ")\n",
|
_LIBUNWIND_TRACE_API("_Unwind_SetIP(context=%p, value=0x%0" PRIx64 ")",
|
||||||
(void *)context, (uint64_t)value);
|
(void *)context, (uint64_t)value);
|
||||||
unw_cursor_t *cursor = (unw_cursor_t *)context;
|
unw_cursor_t *cursor = (unw_cursor_t *)context;
|
||||||
unw_set_reg(cursor, UNW_REG_IP, value);
|
unw_set_reg(cursor, UNW_REG_IP, value);
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
// Source Licenses. See LICENSE.TXT for details.
|
// Source Licenses. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
// Defines macros used within libuwind project.
|
// Defines macros used within libunwind project.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
@ -84,7 +84,7 @@
|
|||||||
fflush(stderr); \
|
fflush(stderr); \
|
||||||
abort(); \
|
abort(); \
|
||||||
} while (0)
|
} while (0)
|
||||||
#define _LIBUNWIND_LOG(msg, ...) fprintf(stderr, "libuwind: " msg, __VA_ARGS__)
|
#define _LIBUNWIND_LOG(msg, ...) fprintf(stderr, "libunwind: " msg "\n", __VA_ARGS__)
|
||||||
|
|
||||||
// Macros that define away in non-Debug builds
|
// Macros that define away in non-Debug builds
|
||||||
#ifdef NDEBUG
|
#ifdef NDEBUG
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
//===--------------------------- libuwind.cpp -----------------------------===//
|
//===--------------------------- libunwind.cpp ----------------------------===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
@ -42,7 +42,7 @@ extern int unw_getcontext(unw_context_t *);
|
|||||||
/// unw_getcontext().
|
/// unw_getcontext().
|
||||||
_LIBUNWIND_EXPORT int unw_init_local(unw_cursor_t *cursor,
|
_LIBUNWIND_EXPORT int unw_init_local(unw_cursor_t *cursor,
|
||||||
unw_context_t *context) {
|
unw_context_t *context) {
|
||||||
_LIBUNWIND_TRACE_API("unw_init_local(cursor=%p, context=%p)\n",
|
_LIBUNWIND_TRACE_API("unw_init_local(cursor=%p, context=%p)",
|
||||||
static_cast<void *>(cursor),
|
static_cast<void *>(cursor),
|
||||||
static_cast<void *>(context));
|
static_cast<void *>(context));
|
||||||
#if defined(__i386__)
|
#if defined(__i386__)
|
||||||
@ -159,7 +159,7 @@ _LIBUNWIND_EXPORT void unw_destroy_addr_space(unw_addr_space_t asp) {
|
|||||||
/// Get value of specified register at cursor position in stack frame.
|
/// Get value of specified register at cursor position in stack frame.
|
||||||
_LIBUNWIND_EXPORT int unw_get_reg(unw_cursor_t *cursor, unw_regnum_t regNum,
|
_LIBUNWIND_EXPORT int unw_get_reg(unw_cursor_t *cursor, unw_regnum_t regNum,
|
||||||
unw_word_t *value) {
|
unw_word_t *value) {
|
||||||
_LIBUNWIND_TRACE_API("unw_get_reg(cursor=%p, regNum=%d, &value=%p)\n",
|
_LIBUNWIND_TRACE_API("unw_get_reg(cursor=%p, regNum=%d, &value=%p)",
|
||||||
static_cast<void *>(cursor), regNum,
|
static_cast<void *>(cursor), regNum,
|
||||||
static_cast<void *>(value));
|
static_cast<void *>(value));
|
||||||
AbstractUnwindCursor *co = (AbstractUnwindCursor *)cursor;
|
AbstractUnwindCursor *co = (AbstractUnwindCursor *)cursor;
|
||||||
@ -174,7 +174,7 @@ _LIBUNWIND_EXPORT int unw_get_reg(unw_cursor_t *cursor, unw_regnum_t regNum,
|
|||||||
/// Set value of specified register at cursor position in stack frame.
|
/// Set value of specified register at cursor position in stack frame.
|
||||||
_LIBUNWIND_EXPORT int unw_set_reg(unw_cursor_t *cursor, unw_regnum_t regNum,
|
_LIBUNWIND_EXPORT int unw_set_reg(unw_cursor_t *cursor, unw_regnum_t regNum,
|
||||||
unw_word_t value) {
|
unw_word_t value) {
|
||||||
_LIBUNWIND_TRACE_API("unw_set_reg(cursor=%p, regNum=%d, value=0x%llX)\n",
|
_LIBUNWIND_TRACE_API("unw_set_reg(cursor=%p, regNum=%d, value=0x%llX)",
|
||||||
static_cast<void *>(cursor), regNum, (long long)value);
|
static_cast<void *>(cursor), regNum, (long long)value);
|
||||||
typedef LocalAddressSpace::pint_t pint_t;
|
typedef LocalAddressSpace::pint_t pint_t;
|
||||||
AbstractUnwindCursor *co = (AbstractUnwindCursor *)cursor;
|
AbstractUnwindCursor *co = (AbstractUnwindCursor *)cursor;
|
||||||
@ -193,7 +193,7 @@ _LIBUNWIND_EXPORT int unw_set_reg(unw_cursor_t *cursor, unw_regnum_t regNum,
|
|||||||
/// Get value of specified float register at cursor position in stack frame.
|
/// Get value of specified float register at cursor position in stack frame.
|
||||||
_LIBUNWIND_EXPORT int unw_get_fpreg(unw_cursor_t *cursor, unw_regnum_t regNum,
|
_LIBUNWIND_EXPORT int unw_get_fpreg(unw_cursor_t *cursor, unw_regnum_t regNum,
|
||||||
unw_fpreg_t *value) {
|
unw_fpreg_t *value) {
|
||||||
_LIBUNWIND_TRACE_API("unw_get_fpreg(cursor=%p, regNum=%d, &value=%p)\n",
|
_LIBUNWIND_TRACE_API("unw_get_fpreg(cursor=%p, regNum=%d, &value=%p)",
|
||||||
static_cast<void *>(cursor), regNum,
|
static_cast<void *>(cursor), regNum,
|
||||||
static_cast<void *>(value));
|
static_cast<void *>(value));
|
||||||
AbstractUnwindCursor *co = (AbstractUnwindCursor *)cursor;
|
AbstractUnwindCursor *co = (AbstractUnwindCursor *)cursor;
|
||||||
@ -209,10 +209,10 @@ _LIBUNWIND_EXPORT int unw_get_fpreg(unw_cursor_t *cursor, unw_regnum_t regNum,
|
|||||||
_LIBUNWIND_EXPORT int unw_set_fpreg(unw_cursor_t *cursor, unw_regnum_t regNum,
|
_LIBUNWIND_EXPORT int unw_set_fpreg(unw_cursor_t *cursor, unw_regnum_t regNum,
|
||||||
unw_fpreg_t value) {
|
unw_fpreg_t value) {
|
||||||
#if _LIBUNWIND_ARM_EHABI
|
#if _LIBUNWIND_ARM_EHABI
|
||||||
_LIBUNWIND_TRACE_API("unw_set_fpreg(cursor=%p, regNum=%d, value=%llX)\n",
|
_LIBUNWIND_TRACE_API("unw_set_fpreg(cursor=%p, regNum=%d, value=%llX)",
|
||||||
static_cast<void *>(cursor), regNum, value);
|
static_cast<void *>(cursor), regNum, value);
|
||||||
#else
|
#else
|
||||||
_LIBUNWIND_TRACE_API("unw_set_fpreg(cursor=%p, regNum=%d, value=%g)\n",
|
_LIBUNWIND_TRACE_API("unw_set_fpreg(cursor=%p, regNum=%d, value=%g)",
|
||||||
static_cast<void *>(cursor), regNum, value);
|
static_cast<void *>(cursor), regNum, value);
|
||||||
#endif
|
#endif
|
||||||
AbstractUnwindCursor *co = (AbstractUnwindCursor *)cursor;
|
AbstractUnwindCursor *co = (AbstractUnwindCursor *)cursor;
|
||||||
@ -226,7 +226,7 @@ _LIBUNWIND_EXPORT int unw_set_fpreg(unw_cursor_t *cursor, unw_regnum_t regNum,
|
|||||||
|
|
||||||
/// Move cursor to next frame.
|
/// Move cursor to next frame.
|
||||||
_LIBUNWIND_EXPORT int unw_step(unw_cursor_t *cursor) {
|
_LIBUNWIND_EXPORT int unw_step(unw_cursor_t *cursor) {
|
||||||
_LIBUNWIND_TRACE_API("unw_step(cursor=%p)\n", static_cast<void *>(cursor));
|
_LIBUNWIND_TRACE_API("unw_step(cursor=%p)", static_cast<void *>(cursor));
|
||||||
AbstractUnwindCursor *co = (AbstractUnwindCursor *)cursor;
|
AbstractUnwindCursor *co = (AbstractUnwindCursor *)cursor;
|
||||||
return co->step();
|
return co->step();
|
||||||
}
|
}
|
||||||
@ -235,7 +235,7 @@ _LIBUNWIND_EXPORT int unw_step(unw_cursor_t *cursor) {
|
|||||||
/// Get unwind info at cursor position in stack frame.
|
/// Get unwind info at cursor position in stack frame.
|
||||||
_LIBUNWIND_EXPORT int unw_get_proc_info(unw_cursor_t *cursor,
|
_LIBUNWIND_EXPORT int unw_get_proc_info(unw_cursor_t *cursor,
|
||||||
unw_proc_info_t *info) {
|
unw_proc_info_t *info) {
|
||||||
_LIBUNWIND_TRACE_API("unw_get_proc_info(cursor=%p, &info=%p)\n",
|
_LIBUNWIND_TRACE_API("unw_get_proc_info(cursor=%p, &info=%p)",
|
||||||
static_cast<void *>(cursor), static_cast<void *>(info));
|
static_cast<void *>(cursor), static_cast<void *>(info));
|
||||||
AbstractUnwindCursor *co = (AbstractUnwindCursor *)cursor;
|
AbstractUnwindCursor *co = (AbstractUnwindCursor *)cursor;
|
||||||
co->getInfo(info);
|
co->getInfo(info);
|
||||||
@ -248,7 +248,7 @@ _LIBUNWIND_EXPORT int unw_get_proc_info(unw_cursor_t *cursor,
|
|||||||
|
|
||||||
/// Resume execution at cursor position (aka longjump).
|
/// Resume execution at cursor position (aka longjump).
|
||||||
_LIBUNWIND_EXPORT int unw_resume(unw_cursor_t *cursor) {
|
_LIBUNWIND_EXPORT int unw_resume(unw_cursor_t *cursor) {
|
||||||
_LIBUNWIND_TRACE_API("unw_resume(cursor=%p)\n", static_cast<void *>(cursor));
|
_LIBUNWIND_TRACE_API("unw_resume(cursor=%p)", static_cast<void *>(cursor));
|
||||||
AbstractUnwindCursor *co = (AbstractUnwindCursor *)cursor;
|
AbstractUnwindCursor *co = (AbstractUnwindCursor *)cursor;
|
||||||
co->jumpto();
|
co->jumpto();
|
||||||
return UNW_EUNSPEC;
|
return UNW_EUNSPEC;
|
||||||
@ -258,7 +258,7 @@ _LIBUNWIND_EXPORT int unw_resume(unw_cursor_t *cursor) {
|
|||||||
/// Get name of function at cursor position in stack frame.
|
/// Get name of function at cursor position in stack frame.
|
||||||
_LIBUNWIND_EXPORT int unw_get_proc_name(unw_cursor_t *cursor, char *buf,
|
_LIBUNWIND_EXPORT int unw_get_proc_name(unw_cursor_t *cursor, char *buf,
|
||||||
size_t bufLen, unw_word_t *offset) {
|
size_t bufLen, unw_word_t *offset) {
|
||||||
_LIBUNWIND_TRACE_API("unw_get_proc_name(cursor=%p, &buf=%p, bufLen=%lu)\n",
|
_LIBUNWIND_TRACE_API("unw_get_proc_name(cursor=%p, &buf=%p, bufLen=%lu)",
|
||||||
static_cast<void *>(cursor), static_cast<void *>(buf),
|
static_cast<void *>(cursor), static_cast<void *>(buf),
|
||||||
static_cast<unsigned long>(bufLen));
|
static_cast<unsigned long>(bufLen));
|
||||||
AbstractUnwindCursor *co = (AbstractUnwindCursor *)cursor;
|
AbstractUnwindCursor *co = (AbstractUnwindCursor *)cursor;
|
||||||
@ -271,7 +271,7 @@ _LIBUNWIND_EXPORT int unw_get_proc_name(unw_cursor_t *cursor, char *buf,
|
|||||||
|
|
||||||
/// Checks if a register is a floating-point register.
|
/// Checks if a register is a floating-point register.
|
||||||
_LIBUNWIND_EXPORT int unw_is_fpreg(unw_cursor_t *cursor, unw_regnum_t regNum) {
|
_LIBUNWIND_EXPORT int unw_is_fpreg(unw_cursor_t *cursor, unw_regnum_t regNum) {
|
||||||
_LIBUNWIND_TRACE_API("unw_is_fpreg(cursor=%p, regNum=%d)\n",
|
_LIBUNWIND_TRACE_API("unw_is_fpreg(cursor=%p, regNum=%d)",
|
||||||
static_cast<void *>(cursor), regNum);
|
static_cast<void *>(cursor), regNum);
|
||||||
AbstractUnwindCursor *co = (AbstractUnwindCursor *)cursor;
|
AbstractUnwindCursor *co = (AbstractUnwindCursor *)cursor;
|
||||||
return co->validFloatReg(regNum);
|
return co->validFloatReg(regNum);
|
||||||
@ -281,7 +281,7 @@ _LIBUNWIND_EXPORT int unw_is_fpreg(unw_cursor_t *cursor, unw_regnum_t regNum) {
|
|||||||
/// Checks if a register is a floating-point register.
|
/// Checks if a register is a floating-point register.
|
||||||
_LIBUNWIND_EXPORT const char *unw_regname(unw_cursor_t *cursor,
|
_LIBUNWIND_EXPORT const char *unw_regname(unw_cursor_t *cursor,
|
||||||
unw_regnum_t regNum) {
|
unw_regnum_t regNum) {
|
||||||
_LIBUNWIND_TRACE_API("unw_regname(cursor=%p, regNum=%d)\n",
|
_LIBUNWIND_TRACE_API("unw_regname(cursor=%p, regNum=%d)",
|
||||||
static_cast<void *>(cursor), regNum);
|
static_cast<void *>(cursor), regNum);
|
||||||
AbstractUnwindCursor *co = (AbstractUnwindCursor *)cursor;
|
AbstractUnwindCursor *co = (AbstractUnwindCursor *)cursor;
|
||||||
return co->getRegisterName(regNum);
|
return co->getRegisterName(regNum);
|
||||||
@ -290,7 +290,7 @@ _LIBUNWIND_EXPORT const char *unw_regname(unw_cursor_t *cursor,
|
|||||||
|
|
||||||
/// Checks if current frame is signal trampoline.
|
/// Checks if current frame is signal trampoline.
|
||||||
_LIBUNWIND_EXPORT int unw_is_signal_frame(unw_cursor_t *cursor) {
|
_LIBUNWIND_EXPORT int unw_is_signal_frame(unw_cursor_t *cursor) {
|
||||||
_LIBUNWIND_TRACE_API("unw_is_signal_frame(cursor=%p)\n",
|
_LIBUNWIND_TRACE_API("unw_is_signal_frame(cursor=%p)",
|
||||||
static_cast<void *>(cursor));
|
static_cast<void *>(cursor));
|
||||||
AbstractUnwindCursor *co = (AbstractUnwindCursor *)cursor;
|
AbstractUnwindCursor *co = (AbstractUnwindCursor *)cursor;
|
||||||
return co->isSignalFrame();
|
return co->isSignalFrame();
|
||||||
@ -299,7 +299,7 @@ _LIBUNWIND_EXPORT int unw_is_signal_frame(unw_cursor_t *cursor) {
|
|||||||
#ifdef __arm__
|
#ifdef __arm__
|
||||||
// Save VFP registers d0-d15 using FSTMIADX instead of FSTMIADD
|
// Save VFP registers d0-d15 using FSTMIADX instead of FSTMIADD
|
||||||
_LIBUNWIND_EXPORT void unw_save_vfp_as_X(unw_cursor_t *cursor) {
|
_LIBUNWIND_EXPORT void unw_save_vfp_as_X(unw_cursor_t *cursor) {
|
||||||
_LIBUNWIND_TRACE_API("unw_fpreg_save_vfp_as_X(cursor=%p)\n",
|
_LIBUNWIND_TRACE_API("unw_fpreg_save_vfp_as_X(cursor=%p)",
|
||||||
static_cast<void *>(cursor));
|
static_cast<void *>(cursor));
|
||||||
AbstractUnwindCursor *co = (AbstractUnwindCursor *)cursor;
|
AbstractUnwindCursor *co = (AbstractUnwindCursor *)cursor;
|
||||||
return co->saveVFPAsX();
|
return co->saveVFPAsX();
|
||||||
@ -311,7 +311,7 @@ _LIBUNWIND_EXPORT void unw_save_vfp_as_X(unw_cursor_t *cursor) {
|
|||||||
/// SPI: walks cached dwarf entries
|
/// SPI: walks cached dwarf entries
|
||||||
_LIBUNWIND_EXPORT void unw_iterate_dwarf_unwind_cache(void (*func)(
|
_LIBUNWIND_EXPORT void unw_iterate_dwarf_unwind_cache(void (*func)(
|
||||||
unw_word_t ip_start, unw_word_t ip_end, unw_word_t fde, unw_word_t mh)) {
|
unw_word_t ip_start, unw_word_t ip_end, unw_word_t fde, unw_word_t mh)) {
|
||||||
_LIBUNWIND_TRACE_API("unw_iterate_dwarf_unwind_cache(func=%p)\n",
|
_LIBUNWIND_TRACE_API("unw_iterate_dwarf_unwind_cache(func=%p)",
|
||||||
reinterpret_cast<void *>(func));
|
reinterpret_cast<void *>(func));
|
||||||
DwarfFDECache<LocalAddressSpace>::iterateCacheEntries(func);
|
DwarfFDECache<LocalAddressSpace>::iterateCacheEntries(func);
|
||||||
}
|
}
|
||||||
|
@ -120,12 +120,6 @@ ATF_TC_BODY(snprintf_posarg_error, tc)
|
|||||||
{
|
{
|
||||||
char s[16], fmt[32];
|
char s[16], fmt[32];
|
||||||
|
|
||||||
#ifndef __NetBSD__
|
|
||||||
atf_tc_expect_signal(SIGSEGV,
|
|
||||||
"some non-NetBSD platforms including FreeBSD don't validate "
|
|
||||||
"negative size; testcase blows up with SIGSEGV");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
snprintf(fmt, sizeof(fmt), "%%%zu$d", SIZE_MAX / sizeof(size_t));
|
snprintf(fmt, sizeof(fmt), "%%%zu$d", SIZE_MAX / sizeof(size_t));
|
||||||
|
|
||||||
ATF_CHECK(snprintf(s, sizeof(s), fmt, -23) == -1);
|
ATF_CHECK(snprintf(s, sizeof(s), fmt, -23) == -1);
|
||||||
|
@ -2544,11 +2544,6 @@ Zone Asia/Karachi 4:28:12 - LMT 1907
|
|||||||
# From Paul Eggert (2015-03-03):
|
# From Paul Eggert (2015-03-03):
|
||||||
# http://www.timeanddate.com/time/change/west-bank/ramallah?year=2014
|
# http://www.timeanddate.com/time/change/west-bank/ramallah?year=2014
|
||||||
# says that the fall 2014 transition was Oct 23 at 24:00.
|
# says that the fall 2014 transition was Oct 23 at 24:00.
|
||||||
# For future dates, guess the last Friday in March at 24:00 through
|
|
||||||
# the first Friday on or after October 21 at 00:00. This is consistent with
|
|
||||||
# the predictions in today's editions of the following URLs:
|
|
||||||
# http://www.timeanddate.com/time/change/gaza-strip/gaza
|
|
||||||
# http://www.timeanddate.com/time/change/west-bank/hebron
|
|
||||||
|
|
||||||
# From Hannah Kreitem (2016-03-09):
|
# From Hannah Kreitem (2016-03-09):
|
||||||
# http://www.palestinecabinet.gov.ps/WebSite/ar/ViewDetails?ID=31728
|
# http://www.palestinecabinet.gov.ps/WebSite/ar/ViewDetails?ID=31728
|
||||||
@ -2558,7 +2553,21 @@ Zone Asia/Karachi 4:28:12 - LMT 1907
|
|||||||
#
|
#
|
||||||
# From Paul Eggert (2016-03-12):
|
# From Paul Eggert (2016-03-12):
|
||||||
# Predict spring transitions on March's last Saturday at 01:00 from now on.
|
# Predict spring transitions on March's last Saturday at 01:00 from now on.
|
||||||
# Leave fall predictions alone for now.
|
|
||||||
|
# From Sharef Mustafa (2016-10-19):
|
||||||
|
# [T]he Palestinian cabinet decision (Mar 8th 2016) published on
|
||||||
|
# http://www.palestinecabinet.gov.ps/WebSite/Upload/Decree/GOV_17/16032016134830.pdf
|
||||||
|
# states that summer time will end on Oct 29th at 01:00.
|
||||||
|
#
|
||||||
|
# From Tim Parenti (2016-10-19):
|
||||||
|
# Predict fall transitions on October's last Saturday at 01:00 from now on.
|
||||||
|
# This is consistent with the 2016 transition as well as our spring
|
||||||
|
# predictions.
|
||||||
|
#
|
||||||
|
# From Paul Eggert (2016-10-19):
|
||||||
|
# It's also consistent with predictions in the following URLs today:
|
||||||
|
# http://www.timeanddate.com/time/change/gaza-strip/gaza
|
||||||
|
# http://www.timeanddate.com/time/change/west-bank/hebron
|
||||||
|
|
||||||
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
|
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
|
||||||
Rule EgyptAsia 1957 only - May 10 0:00 1:00 S
|
Rule EgyptAsia 1957 only - May 10 0:00 1:00 S
|
||||||
@ -2587,9 +2596,10 @@ Rule Palestine 2011 only - Sep 30 0:00 0 -
|
|||||||
Rule Palestine 2012 2014 - Mar lastThu 24:00 1:00 S
|
Rule Palestine 2012 2014 - Mar lastThu 24:00 1:00 S
|
||||||
Rule Palestine 2012 only - Sep 21 1:00 0 -
|
Rule Palestine 2012 only - Sep 21 1:00 0 -
|
||||||
Rule Palestine 2013 only - Sep Fri>=21 0:00 0 -
|
Rule Palestine 2013 only - Sep Fri>=21 0:00 0 -
|
||||||
Rule Palestine 2014 max - Oct Fri>=21 0:00 0 -
|
Rule Palestine 2014 2015 - Oct Fri>=21 0:00 0 -
|
||||||
Rule Palestine 2015 only - Mar lastFri 24:00 1:00 S
|
Rule Palestine 2015 only - Mar lastFri 24:00 1:00 S
|
||||||
Rule Palestine 2016 max - Mar lastSat 1:00 1:00 S
|
Rule Palestine 2016 max - Mar lastSat 1:00 1:00 S
|
||||||
|
Rule Palestine 2016 max - Oct lastSat 1:00 0 -
|
||||||
|
|
||||||
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
|
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
|
||||||
Zone Asia/Gaza 2:17:52 - LMT 1900 Oct
|
Zone Asia/Gaza 2:17:52 - LMT 1900 Oct
|
||||||
@ -2739,45 +2749,31 @@ Zone Asia/Singapore 6:55:25 - LMT 1901 Jan 1
|
|||||||
# People who live in regions under Tamil control can use [TZ='Asia/Kolkata'],
|
# People who live in regions under Tamil control can use [TZ='Asia/Kolkata'],
|
||||||
# as that zone has agreed with the Tamil areas since our cutoff date of 1970.
|
# as that zone has agreed with the Tamil areas since our cutoff date of 1970.
|
||||||
|
|
||||||
# From K Sethu (2006-04-25):
|
# From Sadika Sumanapala (2016-10-19):
|
||||||
# I think the abbreviation LKT originated from the world of computers at
|
# According to http://www.sltime.org (maintained by Measurement Units,
|
||||||
# the time of or subsequent to the time zone changes by SL Government
|
# Standards & Services Department, Sri Lanka) abbreviation for Sri Lanka
|
||||||
# twice in 1996 and probably SL Government or its standardization
|
# standard time is SLST.
|
||||||
# agencies never declared an abbreviation as a national standard.
|
|
||||||
#
|
#
|
||||||
# I recollect before the recent change the government announcements
|
# From Paul Eggert (2016-10-18):
|
||||||
# mentioning it as simply changing Sri Lanka Standard Time or Sri Lanka
|
# "SLST" seems to be reasonably recent and rarely-used outside time
|
||||||
# Time and no mention was made about the abbreviation.
|
# zone nerd sources. I searched Google News and found three uses of
|
||||||
#
|
# it in the International Business Times of India in February and
|
||||||
# If we look at Sri Lanka Department of Government's "Official News
|
# March of this year when discussing cricket match times, but nothing
|
||||||
# Website of Sri Lanka" ... http://www.news.lk/ we can see that they
|
# since then (though there has been a lot of cricket) and nothing in
|
||||||
# use SLT as abbreviation in time stamp at the beginning of each news
|
# other English-language news sources. Our old abbreviation "LKT" is
|
||||||
# item....
|
# even worse. For now, let's use a numeric abbreviation; we can
|
||||||
#
|
# switch to "SLST" if it catches on.
|
||||||
# Within Sri Lanka I think LKT is well known among computer users and
|
|
||||||
# administrators. In my opinion SLT may not be a good choice because the
|
|
||||||
# nation's largest telcom / internet operator Sri Lanka Telcom is well
|
|
||||||
# known by that abbreviation - simply as SLT (there IP domains are
|
|
||||||
# slt.lk and sltnet.lk).
|
|
||||||
#
|
|
||||||
# But if indeed our government has adopted SLT as standard abbreviation
|
|
||||||
# (that we have not known so far) then it is better that it be used for
|
|
||||||
# all computers.
|
|
||||||
|
|
||||||
# From Paul Eggert (2006-04-25):
|
|
||||||
# One possibility is that we wait for a bit for the dust to settle down
|
|
||||||
# and then see what people actually say in practice.
|
|
||||||
|
|
||||||
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
|
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
|
||||||
Zone Asia/Colombo 5:19:24 - LMT 1880
|
Zone Asia/Colombo 5:19:24 - LMT 1880
|
||||||
5:19:32 - MMT 1906 # Moratuwa Mean Time
|
5:19:32 - MMT 1906 # Moratuwa Mean Time
|
||||||
5:30 - IST 1942 Jan 5
|
5:30 - +0530 1942 Jan 5
|
||||||
5:30 0:30 IHST 1942 Sep
|
5:30 0:30 +0530/+06 1942 Sep
|
||||||
5:30 1:00 IST 1945 Oct 16 2:00
|
5:30 1:00 +0530/+0630 1945 Oct 16 2:00
|
||||||
5:30 - IST 1996 May 25 0:00
|
5:30 - +0530 1996 May 25 0:00
|
||||||
6:30 - LKT 1996 Oct 26 0:30
|
6:30 - +0630 1996 Oct 26 0:30
|
||||||
6:00 - LKT 2006 Apr 15 0:30
|
6:00 - +06 2006 Apr 15 0:30
|
||||||
5:30 - IST
|
5:30 - +0530
|
||||||
|
|
||||||
# Syria
|
# Syria
|
||||||
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
|
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
|
||||||
|
@ -350,7 +350,13 @@ Zone Indian/Cocos 6:27:40 - LMT 1900
|
|||||||
# commencing at 2.00 am on Sunday 1st November, 2015 and ending at
|
# commencing at 2.00 am on Sunday 1st November, 2015 and ending at
|
||||||
# 3.00 am on Sunday 17th January, 2016.
|
# 3.00 am on Sunday 17th January, 2016.
|
||||||
|
|
||||||
# From Paul Eggert (2015-09-01):
|
# From Raymond Kumar (2016-10-04):
|
||||||
|
# http://www.fiji.gov.fj/Media-Center/Press-Releases/DAYLIGHT-SAVING-STARTS-ON-6th-NOVEMBER,-2016.aspx
|
||||||
|
# "Fiji's daylight savings will begin on Sunday, 6 November 2016, when
|
||||||
|
# clocks go forward an hour at 2am to 3am.... Daylight Saving will
|
||||||
|
# end at 3.00am on Sunday 15th January 2017."
|
||||||
|
|
||||||
|
# From Paul Eggert (2016-10-03):
|
||||||
# For now, guess DST from 02:00 the first Sunday in November to
|
# For now, guess DST from 02:00 the first Sunday in November to
|
||||||
# 03:00 the third Sunday in January. Although ad hoc, it matches
|
# 03:00 the third Sunday in January. Although ad hoc, it matches
|
||||||
# transitions since late 2014 and seems more likely to match future
|
# transitions since late 2014 and seems more likely to match future
|
||||||
|
@ -1908,7 +1908,7 @@ Zone Europe/Monaco 0:29:32 - LMT 1891 Mar 15
|
|||||||
# Amsterdam mean time.
|
# Amsterdam mean time.
|
||||||
|
|
||||||
# The data entries before 1945 are taken from
|
# The data entries before 1945 are taken from
|
||||||
# http://www.phys.uu.nl/~vgent/wettijd/wettijd.htm
|
# http://www.staff.science.uu.nl/~gent0113/idl/idl.htm
|
||||||
|
|
||||||
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
|
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
|
||||||
Rule Neth 1916 only - May 1 0:00 1:00 NST # Netherlands Summer Time
|
Rule Neth 1916 only - May 1 0:00 1:00 NST # Netherlands Summer Time
|
||||||
@ -3427,22 +3427,24 @@ Zone Europe/Zurich 0:34:08 - LMT 1853 Jul 16 # See above comment.
|
|||||||
|
|
||||||
# Turkey
|
# Turkey
|
||||||
|
|
||||||
# From Amar Devegowda (2007-01-03):
|
# From Kıvanç Yazan (2016-09-25):
|
||||||
# The time zone rules for Istanbul, Turkey have not been changed for years now.
|
# 1) For 1986-2006, DST started at 01:00 local and ended at 02:00 local, with
|
||||||
# ... The latest rules are available at:
|
# no exceptions.
|
||||||
# http://www.timeanddate.com/worldclock/timezone.html?n=107
|
# 2) 1994's lastSun was overridden with Mar 20 ...
|
||||||
# From Steffen Thorsen (2007-01-03):
|
# Here are official papers:
|
||||||
# I have been able to find press records back to 1996 which all say that
|
# http://www.resmigazete.gov.tr/arsiv/19032.pdf - page 2 for 1986
|
||||||
# DST started 01:00 local time and end at 02:00 local time. I am not sure
|
# http://www.resmigazete.gov.tr/arsiv/19400.pdf - page 4 for 1987
|
||||||
# what happened before that. One example for each year from 1996 to 2001:
|
# http://www.resmigazete.gov.tr/arsiv/19752.pdf - page 15 for 1988
|
||||||
# http://newspot.byegm.gov.tr/arsiv/1996/21/N4.htm
|
# http://www.resmigazete.gov.tr/arsiv/20102.pdf - page 6 for 1989
|
||||||
# http://www.byegm.gov.tr/YAYINLARIMIZ/CHR/ING97/03/97X03X25.TXT
|
# http://www.resmigazete.gov.tr/arsiv/20464.pdf - page 1 for 1990 - 1992
|
||||||
# http://www.byegm.gov.tr/YAYINLARIMIZ/CHR/ING98/03/98X03X02.HTM
|
# http://www.resmigazete.gov.tr/arsiv/21531.pdf - page 15 for 1993 - 1995
|
||||||
# http://www.byegm.gov.tr/YAYINLARIMIZ/CHR/ING99/10/99X10X26.HTM#%2016
|
# http://www.resmigazete.gov.tr/arsiv/21879.pdf - page 1 for overriding 1994
|
||||||
# http://www.byegm.gov.tr/YAYINLARIMIZ/CHR/ING2000/03/00X03X06.HTM#%2021
|
# http://www.resmigazete.gov.tr/arsiv/22588.pdf - page 1 for 1996, 1997
|
||||||
# http://www.byegm.gov.tr/YAYINLARIMIZ/CHR/ING2001/03/23x03x01.HTM#%2027
|
# http://www.resmigazete.gov.tr/arsiv/23286.pdf - page 10 for 1998 - 2000
|
||||||
# From Paul Eggert (2007-01-03):
|
# http://www.resmigazete.gov.tr/eskiler/2001/03/20010324.htm#2 - for 2001
|
||||||
# Prefer the above source to Shanks & Pottenger for time stamps after 1990.
|
# http://www.resmigazete.gov.tr/eskiler/2002/03/20020316.htm#2 - for 2002-2006
|
||||||
|
# From Paul Eggert (2016-09-25):
|
||||||
|
# Prefer the above sources to Shanks & Pottenger for time stamps after 1985.
|
||||||
|
|
||||||
# From Steffen Thorsen (2007-03-09):
|
# From Steffen Thorsen (2007-03-09):
|
||||||
# Starting 2007 though, it seems that they are adopting EU's 1:00 UTC
|
# Starting 2007 though, it seems that they are adopting EU's 1:00 UTC
|
||||||
@ -3551,10 +3553,10 @@ Rule Turkey 1983 only - Jul 31 0:00 1:00 S
|
|||||||
Rule Turkey 1983 only - Oct 2 0:00 0 -
|
Rule Turkey 1983 only - Oct 2 0:00 0 -
|
||||||
Rule Turkey 1985 only - Apr 20 0:00 1:00 S
|
Rule Turkey 1985 only - Apr 20 0:00 1:00 S
|
||||||
Rule Turkey 1985 only - Sep 28 0:00 0 -
|
Rule Turkey 1985 only - Sep 28 0:00 0 -
|
||||||
Rule Turkey 1986 1990 - Mar lastSun 2:00s 1:00 S
|
Rule Turkey 1986 1993 - Mar lastSun 1:00s 1:00 S
|
||||||
Rule Turkey 1986 1990 - Sep lastSun 2:00s 0 -
|
Rule Turkey 1986 1995 - Sep lastSun 1:00s 0 -
|
||||||
Rule Turkey 1991 2006 - Mar lastSun 1:00s 1:00 S
|
Rule Turkey 1994 only - Mar 20 1:00s 1:00 S
|
||||||
Rule Turkey 1991 1995 - Sep lastSun 1:00s 0 -
|
Rule Turkey 1995 2006 - Mar lastSun 1:00s 1:00 S
|
||||||
Rule Turkey 1996 2006 - Oct lastSun 1:00s 0 -
|
Rule Turkey 1996 2006 - Oct lastSun 1:00s 0 -
|
||||||
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
|
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
|
||||||
Zone Europe/Istanbul 1:55:52 - LMT 1880
|
Zone Europe/Istanbul 1:55:52 - LMT 1880
|
||||||
|
@ -24,8 +24,32 @@
|
|||||||
# was the result of his proposals at the Convention of Railroad Trunk Lines
|
# was the result of his proposals at the Convention of Railroad Trunk Lines
|
||||||
# in New York City (1869-10). His 1870 proposal was based on Washington, DC,
|
# in New York City (1869-10). His 1870 proposal was based on Washington, DC,
|
||||||
# but in 1872-05 he moved the proposed origin to Greenwich.
|
# but in 1872-05 he moved the proposed origin to Greenwich.
|
||||||
# His proposal was adopted by the railroads on 1883-11-18 at 12:00,
|
|
||||||
# and the most of the country soon followed suit.
|
# From Paul Eggert (2016-09-21):
|
||||||
|
# Dowd's proposal left many details unresolved, such as where to draw
|
||||||
|
# lines between time zones. The key individual who made time zones
|
||||||
|
# work in the US was William Frederick Allen - railway engineer,
|
||||||
|
# managing editor of the Travelers' Guide, and secretary of the
|
||||||
|
# General Time Convention, a railway standardization group. Allen
|
||||||
|
# spent months in dialogs with scientific and railway leaders,
|
||||||
|
# developed a workable plan to institute time zones, and presented it
|
||||||
|
# to the General Time Convention on 1883-04-11, saying that his plan
|
||||||
|
# meant "local time would be practically abolished" - a plus for
|
||||||
|
# railway scheduling. By the next convention on 1883-10-11 nearly all
|
||||||
|
# railroads had agreed and it took effect on 1883-11-18 at 12:00.
|
||||||
|
# That Sunday was called the "day of two noons", as the eastern parts
|
||||||
|
# of the new zones observed noon twice. Allen witnessed the
|
||||||
|
# transition in New York City, writing:
|
||||||
|
#
|
||||||
|
# I heard the bells of St. Paul's strike on the old time. Four
|
||||||
|
# minutes later, obedient to the electrical signal from the Naval
|
||||||
|
# Observatory ... the time-ball made its rapid descent, the chimes
|
||||||
|
# of old Trinity rang twelve measured strokes, and local time was
|
||||||
|
# abandoned, probably forever.
|
||||||
|
#
|
||||||
|
# Most of the US soon followed suit. See:
|
||||||
|
# Bartky IR. The adoption of standard time. Technol Cult 1989 Jan;30(1):25-56.
|
||||||
|
# http://dx.doi.org/10.2307/3105430
|
||||||
|
|
||||||
# From Paul Eggert (2005-04-16):
|
# From Paul Eggert (2005-04-16):
|
||||||
# That 1883 transition occurred at 12:00 new time, not at 12:00 old time.
|
# That 1883 transition occurred at 12:00 new time, not at 12:00 old time.
|
||||||
|
@ -42,7 +42,7 @@ $code=<<___;
|
|||||||
#if __ARM_MAX_ARCH__>=7
|
#if __ARM_MAX_ARCH__>=7
|
||||||
.text
|
.text
|
||||||
___
|
___
|
||||||
$code.=".arch armv8-a+crypto\n" if ($flavour =~ /64/);
|
# $code.=".arch armv8-a+crypto\n" if ($flavour =~ /64/);
|
||||||
$code.=".arch armv7-a\n.fpu neon\n.code 32\n" if ($flavour !~ /64/);
|
$code.=".arch armv7-a\n.fpu neon\n.code 32\n" if ($flavour !~ /64/);
|
||||||
#^^^^^^ this is done to simplify adoption by not depending
|
#^^^^^^ this is done to simplify adoption by not depending
|
||||||
# on latest binutils.
|
# on latest binutils.
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
#include "arm_arch.h"
|
#include "arm_arch.h"
|
||||||
|
|
||||||
.text
|
.text
|
||||||
.arch armv8-a+crypto
|
|
||||||
|
|
||||||
.align 5
|
.align 5
|
||||||
.global _armv7_neon_probe
|
.global _armv7_neon_probe
|
||||||
|
@ -49,7 +49,7 @@ $code=<<___;
|
|||||||
|
|
||||||
.text
|
.text
|
||||||
___
|
___
|
||||||
$code.=".arch armv8-a+crypto\n" if ($flavour =~ /64/);
|
# $code.=".arch armv8-a+crypto\n" if ($flavour =~ /64/);
|
||||||
$code.=".fpu neon\n.code 32\n" if ($flavour !~ /64/);
|
$code.=".fpu neon\n.code 32\n" if ($flavour !~ /64/);
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
|
@ -2713,7 +2713,7 @@ nomatch 32 {
|
|||||||
match "bus" "uhub[0-9]+";
|
match "bus" "uhub[0-9]+";
|
||||||
match "mode" "host";
|
match "mode" "host";
|
||||||
match "vendor" "0x0bda";
|
match "vendor" "0x0bda";
|
||||||
match "product" "0x8152";
|
match "product" "(0x8152|0x8153)";
|
||||||
action "kldload -n if_ure";
|
action "kldload -n if_ure";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -32,6 +32,8 @@
|
|||||||
..
|
..
|
||||||
casper
|
casper
|
||||||
..
|
..
|
||||||
|
cron.d
|
||||||
|
..
|
||||||
defaults
|
defaults
|
||||||
..
|
..
|
||||||
devd
|
devd
|
||||||
|
6
etc/rc
6
etc/rc
@ -135,16 +135,16 @@ done
|
|||||||
# Note: this assumes firstboot_sentinel is on / when we have
|
# Note: this assumes firstboot_sentinel is on / when we have
|
||||||
# a read-only /, or that it is on media that's writable.
|
# a read-only /, or that it is on media that's writable.
|
||||||
if [ -e ${firstboot_sentinel} ]; then
|
if [ -e ${firstboot_sentinel} ]; then
|
||||||
[ ${root_rw_mount#[Yy][Ee][Ss]} = "" ] || mount -uw /
|
checkyesno root_rw_mount && mount -uw /
|
||||||
chflags -R 0 ${firstboot_sentinel}
|
chflags -R 0 ${firstboot_sentinel}
|
||||||
rm -rf ${firstboot_sentinel}
|
rm -rf ${firstboot_sentinel}
|
||||||
if [ -e ${firstboot_sentinel}-reboot ]; then
|
if [ -e ${firstboot_sentinel}-reboot ]; then
|
||||||
chflags -R 0 ${firstboot_sentinel}-reboot
|
chflags -R 0 ${firstboot_sentinel}-reboot
|
||||||
rm -rf ${firstboot_sentinel}-reboot
|
rm -rf ${firstboot_sentinel}-reboot
|
||||||
[ ${root_rw_mount#[Yy][Ee][Ss]} = "" ] || mount -ur /
|
checkyesno root_rw_mount && mount -ur /
|
||||||
kill -INT 1
|
kill -INT 1
|
||||||
fi
|
fi
|
||||||
[ ${root_rw_mount#[Yy][Ee][Ss]} = "" ] || mount -ur /
|
checkyesno root_rw_mount && mount -ur /
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo ''
|
echo ''
|
||||||
|
@ -118,14 +118,17 @@ FILES= DAEMON \
|
|||||||
ugidfw \
|
ugidfw \
|
||||||
${_utx} \
|
${_utx} \
|
||||||
var \
|
var \
|
||||||
watchdogd \
|
watchdogd
|
||||||
ypbind \
|
|
||||||
|
.if ${MK_NIS} != "no"
|
||||||
|
FILES+= ypbind \
|
||||||
ypldap \
|
ypldap \
|
||||||
yppasswdd \
|
yppasswdd \
|
||||||
ypserv \
|
ypserv \
|
||||||
ypset \
|
ypset \
|
||||||
ypupdated \
|
ypupdated \
|
||||||
ypxfrd
|
ypxfrd
|
||||||
|
.endif
|
||||||
|
|
||||||
.if ${MK_ACCT} != "no"
|
.if ${MK_ACCT} != "no"
|
||||||
FILESGROUPS+= ACCT
|
FILESGROUPS+= ACCT
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
name="swaplate"
|
name="swaplate"
|
||||||
desc="Setup late swap space"
|
desc="Setup late swap space"
|
||||||
start_cmd='/sbin/swapon -aLq'
|
start_cmd='/sbin/swapon -aLq'
|
||||||
stop_cmd='/sbin/swapoff -aq'
|
stop_cmd='/sbin/swapoff -aLq'
|
||||||
|
|
||||||
load_rc_config swap
|
load_rc_config swap
|
||||||
run_rc_command "$1"
|
run_rc_command "$1"
|
||||||
|
@ -165,7 +165,7 @@ LIBADD+= compiler_rt
|
|||||||
.if ${TARGET_CPUARCH} == mips
|
.if ${TARGET_CPUARCH} == mips
|
||||||
LIB2FUNCS_EXTRA = floatunsidf.c floatunsisf.c
|
LIB2FUNCS_EXTRA = floatunsidf.c floatunsisf.c
|
||||||
# ABIs other than o32 need this
|
# ABIs other than o32 need this
|
||||||
.if ${TARGET_ARCH} != "mips" && ${TARGET_ARCH} != "mipsel"
|
.if ${TARGET_ARCH:Mmips64*} != "" || ${TARGET_ARCH:Mmipsn32*} != ""
|
||||||
LIB2FUNCS_EXTRA+= floatdidf.c fixunsdfsi.c
|
LIB2FUNCS_EXTRA+= floatdidf.c fixunsdfsi.c
|
||||||
LIB2FUNCS_EXTRA+= floatdisf.c floatundidf.c
|
LIB2FUNCS_EXTRA+= floatdisf.c floatundidf.c
|
||||||
LIB2FUNCS_EXTRA+= fixsfdi.c floatundisf.c
|
LIB2FUNCS_EXTRA+= fixsfdi.c floatundisf.c
|
||||||
@ -173,7 +173,7 @@ LIB2FUNCS_EXTRA+= fixdfdi.c fixunssfsi.c
|
|||||||
.endif
|
.endif
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
.if ${TARGET_ARCH} == "powerpc"
|
.if ${TARGET_ARCH} == "powerpc" || ${TARGET_ARCH} == "powerpcspe"
|
||||||
# from config/rs6000/t-ppccomm
|
# from config/rs6000/t-ppccomm
|
||||||
LIB2FUNCS_EXTRA = tramp.asm
|
LIB2FUNCS_EXTRA = tramp.asm
|
||||||
LIB2FUNCS_STATIC_EXTRA = eabi.asm
|
LIB2FUNCS_STATIC_EXTRA = eabi.asm
|
||||||
|
@ -24,7 +24,7 @@ VERSION_MAP= ${SRCDIR}/libgomp.map
|
|||||||
|
|
||||||
# Target-specific OpenMP configuration
|
# Target-specific OpenMP configuration
|
||||||
.if ${MACHINE_CPUARCH} == arm || ${MACHINE_CPUARCH} == i386 || \
|
.if ${MACHINE_CPUARCH} == arm || ${MACHINE_CPUARCH} == i386 || \
|
||||||
${MACHINE_ARCH} == powerpc || \
|
${MACHINE_ARCH} == powerpc || ${MACHINE_ARCH} == powerpcspe || \
|
||||||
(${MACHINE_CPUARCH} == mips && ${MACHINE_ARCH:Mmips64*} == "")
|
(${MACHINE_CPUARCH} == mips && ${MACHINE_ARCH:Mmips64*} == "")
|
||||||
OMP_LOCK_ALIGN = 4
|
OMP_LOCK_ALIGN = 4
|
||||||
OMP_LOCK_KIND= 4
|
OMP_LOCK_KIND= 4
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
VERSION= "2.17.50 [FreeBSD] 2007-07-03"
|
VERSION= "2.17.50 [FreeBSD] 2007-07-03"
|
||||||
|
|
||||||
.if defined(TARGET_ARCH)
|
.if defined(TARGET_ARCH)
|
||||||
TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc64/powerpc/}
|
TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?(hf)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc(64|spe)/powerpc/}
|
||||||
.else
|
.else
|
||||||
TARGET_CPUARCH=${MACHINE_CPUARCH}
|
TARGET_CPUARCH=${MACHINE_CPUARCH}
|
||||||
.endif
|
.endif
|
||||||
@ -17,7 +17,7 @@ TARGET_OS?= freebsd
|
|||||||
BINUTILS_ARCH=${TARGET_ARCH:C/amd64/x86_64/}
|
BINUTILS_ARCH=${TARGET_ARCH:C/amd64/x86_64/}
|
||||||
TARGET_TUPLE?= ${BINUTILS_ARCH}-${TARGET_VENDOR}-${TARGET_OS}
|
TARGET_TUPLE?= ${BINUTILS_ARCH}-${TARGET_VENDOR}-${TARGET_OS}
|
||||||
.if ${TARGET_ARCH} == "armeb" || ${TARGET_ARCH} == "armv6eb" || \
|
.if ${TARGET_ARCH} == "armeb" || ${TARGET_ARCH} == "armv6eb" || \
|
||||||
(${TARGET_CPUARCH} == "mips" && ${TARGET_ARCH:Mmips*el} == "")
|
(${TARGET_CPUARCH} == "mips" && ${TARGET_ARCH:Mmips*el*} == "")
|
||||||
TARGET_BIG_ENDIAN=t
|
TARGET_BIG_ENDIAN=t
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
@ -30,7 +30,7 @@ RELSRC= ${RELTOP}/../../../contrib/binutils
|
|||||||
SRCDIR= ${.CURDIR}/${RELSRC}
|
SRCDIR= ${.CURDIR}/${RELSRC}
|
||||||
|
|
||||||
.if ${TARGET_CPUARCH} == "arm" || ${TARGET_CPUARCH} == "i386" || \
|
.if ${TARGET_CPUARCH} == "arm" || ${TARGET_CPUARCH} == "i386" || \
|
||||||
${TARGET_ARCH} == "powerpc" || \
|
${TARGET_ARCH} == "powerpc" || ${TARGET_ARCH} == "powerpcspe" || \
|
||||||
(${TARGET_CPUARCH} == "mips" && ${TARGET_ARCH:Mmips64*} == "")
|
(${TARGET_CPUARCH} == "mips" && ${TARGET_ARCH:Mmips64*} == "")
|
||||||
CFLAGS+= -DBFD_DEFAULT_TARGET_SIZE=32
|
CFLAGS+= -DBFD_DEFAULT_TARGET_SIZE=32
|
||||||
.else
|
.else
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# $FreeBSD$
|
# $FreeBSD$
|
||||||
|
|
||||||
.if ${TARGET_ARCH:Mmips*el} != ""
|
.if ${TARGET_ARCH:Mmips*el*} != ""
|
||||||
_EMULATION_ENDIAN=l
|
_EMULATION_ENDIAN=l
|
||||||
.else
|
.else
|
||||||
_EMULATION_ENDIAN=b
|
_EMULATION_ENDIAN=b
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# $FreeBSD$
|
# $FreeBSD$
|
||||||
|
|
||||||
.if ${TARGET_ARCH:Mmips*el} != ""
|
.if ${TARGET_ARCH:Mmips*el*} != ""
|
||||||
_EMULATION_ENDIAN=little
|
_EMULATION_ENDIAN=little
|
||||||
.else
|
.else
|
||||||
_EMULATION_ENDIAN=big
|
_EMULATION_ENDIAN=big
|
||||||
|
@ -39,7 +39,7 @@ CFLAGS += -DFREEBSD_ARCH_armv6
|
|||||||
.endif
|
.endif
|
||||||
|
|
||||||
.if ${TARGET_CPUARCH} == "mips"
|
.if ${TARGET_CPUARCH} == "mips"
|
||||||
.if ${TARGET_ARCH:Mmips*el} != ""
|
.if ${TARGET_ARCH:Mmips*el*} != ""
|
||||||
CFLAGS += -DTARGET_ENDIAN_DEFAULT=0
|
CFLAGS += -DTARGET_ENDIAN_DEFAULT=0
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
# MACHINE_CPUARCH, but there's no easy way to export make functions...
|
# MACHINE_CPUARCH, but there's no easy way to export make functions...
|
||||||
|
|
||||||
.if defined(TARGET_ARCH)
|
.if defined(TARGET_ARCH)
|
||||||
TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc64/powerpc/}
|
TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?(hf)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc(64|spe)/powerpc/}
|
||||||
.else
|
.else
|
||||||
TARGET_CPUARCH=${MACHINE_CPUARCH}
|
TARGET_CPUARCH=${MACHINE_CPUARCH}
|
||||||
.endif
|
.endif
|
||||||
@ -15,7 +15,7 @@ GCC_CPU=${TARGET_CPUARCH:C/amd64/i386/:C/powerpc/rs6000/:C/sparc64/sparc/}
|
|||||||
TARGET_CPU_DEFAULT= TARGET_CPU_ultrasparc
|
TARGET_CPU_DEFAULT= TARGET_CPU_ultrasparc
|
||||||
.endif
|
.endif
|
||||||
.if ${TARGET_ARCH} == "armeb" || ${TARGET_ARCH} == "armv6eb" || \
|
.if ${TARGET_ARCH} == "armeb" || ${TARGET_ARCH} == "armv6eb" || \
|
||||||
(${TARGET_CPUARCH} == "mips" && ${TARGET_ARCH:Mmips*el} == "")
|
(${TARGET_CPUARCH} == "mips" && ${TARGET_ARCH:Mmips*el*} == "")
|
||||||
TARGET_BIG_ENDIAN=t
|
TARGET_BIG_ENDIAN=t
|
||||||
.endif
|
.endif
|
||||||
.if ${TARGET_ARCH} == "powerpc64"
|
.if ${TARGET_ARCH} == "powerpc64"
|
||||||
|
@ -46,6 +46,10 @@ TARGET_INC+= ${GCC_CPU}/bpabi.h
|
|||||||
TARGET_INC+= ${GCC_CPU}/biarch64.h
|
TARGET_INC+= ${GCC_CPU}/biarch64.h
|
||||||
TARGET_INC+= ${GCC_CPU}/default64.h
|
TARGET_INC+= ${GCC_CPU}/default64.h
|
||||||
.endif
|
.endif
|
||||||
|
.if ${TARGET_ARCH} == "powerpcspe"
|
||||||
|
TARGET_INC+= ${GCC_CPU}/freebsdspe.h
|
||||||
|
TARGET_INC+= ${GCC_CPU}/e500-double.h
|
||||||
|
.endif
|
||||||
TARGET_INC+= ${GCC_CPU}/freebsd.h
|
TARGET_INC+= ${GCC_CPU}/freebsd.h
|
||||||
.if ${TARGET_CPUARCH} == "amd64"
|
.if ${TARGET_CPUARCH} == "amd64"
|
||||||
TARGET_INC+= ${GCC_CPU}/freebsd64.h
|
TARGET_INC+= ${GCC_CPU}/freebsd64.h
|
||||||
|
@ -14,7 +14,8 @@ INCS= ammintrin.h emmintrin.h mmintrin.h mm3dnow.h pmmintrin.h \
|
|||||||
INCS+= wmmintrin.h __wmmintrin_aes.h __wmmintrin_pclmul.h
|
INCS+= wmmintrin.h __wmmintrin_aes.h __wmmintrin_pclmul.h
|
||||||
.elif ${TARGET_ARCH} == "arm"
|
.elif ${TARGET_ARCH} == "arm"
|
||||||
INCS= mmintrin.h
|
INCS= mmintrin.h
|
||||||
.elif ${TARGET_ARCH} == "powerpc" || ${TARGET_ARCH} == "powerpc64"
|
.elif ${TARGET_ARCH} == "powerpc" || ${TARGET_ARCH} == "powerpc64" || \
|
||||||
|
${TARGET_ARCH} == "powerpcspe"
|
||||||
INCS= ppc-asm.h altivec.h spe.h
|
INCS= ppc-asm.h altivec.h spe.h
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ OBJ_RL= ${OBJ_ROOT}/../lib/libreadline/readline
|
|||||||
# MACHINE_CPUARCH, but there's no easy way to export make functions...
|
# MACHINE_CPUARCH, but there's no easy way to export make functions...
|
||||||
|
|
||||||
.if defined(TARGET_ARCH)
|
.if defined(TARGET_ARCH)
|
||||||
TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc64/powerpc/}
|
TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?(hf)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc(64|spe)/powerpc/}
|
||||||
.else
|
.else
|
||||||
TARGET_CPUARCH=${MACHINE_CPUARCH}
|
TARGET_CPUARCH=${MACHINE_CPUARCH}
|
||||||
.endif
|
.endif
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
# MACHINE_CPUARCH, but there's no easy way to export make functions...
|
# MACHINE_CPUARCH, but there's no easy way to export make functions...
|
||||||
|
|
||||||
.if defined(TARGET_ARCH)
|
.if defined(TARGET_ARCH)
|
||||||
TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc64/powerpc/}
|
TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?(hf)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc(64|spe)/powerpc/}
|
||||||
.else
|
.else
|
||||||
TARGET_CPUARCH=${MACHINE_CPUARCH}
|
TARGET_CPUARCH=${MACHINE_CPUARCH}
|
||||||
.endif
|
.endif
|
||||||
|
@ -120,7 +120,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if __XSI_VISIBLE || __POSIX_VISIBLE >= 200809
|
#if __XSI_VISIBLE || __POSIX_VISIBLE >= 200809
|
||||||
#define NL_ARGMAX 99 /* max # of position args for printf */
|
#define NL_ARGMAX 65536 /* max # of position args for printf */
|
||||||
#define NL_MSGMAX 32767
|
#define NL_MSGMAX 32767
|
||||||
#define NL_SETMAX 255
|
#define NL_SETMAX 255
|
||||||
#define NL_TEXTMAX 2048
|
#define NL_TEXTMAX 2048
|
||||||
|
@ -62,6 +62,14 @@ typedef ___wchar_t wchar_t;
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L
|
||||||
|
#ifndef __CLANG_MAX_ALIGN_T_DEFINED
|
||||||
|
typedef __max_align_t max_align_t;
|
||||||
|
#define __CLANG_MAX_ALIGN_T_DEFINED
|
||||||
|
#define __GCC_MAX_ALIGN_T
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#define offsetof(type, member) __offsetof(type, member)
|
#define offsetof(type, member) __offsetof(type, member)
|
||||||
|
|
||||||
#endif /* _STDDEF_H_ */
|
#endif /* _STDDEF_H_ */
|
||||||
|
@ -30,7 +30,7 @@ SHARED_CFLAGS+= -DHAVE_ICONV=1 -DHAVE_ICONV_H=1 -DICONV_CONST=
|
|||||||
.endif
|
.endif
|
||||||
|
|
||||||
.if ${MACHINE_ARCH:Marm*} != "" || ${MACHINE_ARCH:Mmips*} != "" || \
|
.if ${MACHINE_ARCH:Marm*} != "" || ${MACHINE_ARCH:Mmips*} != "" || \
|
||||||
${MACHINE_ARCH:Msparc64*} != ""
|
${MACHINE_ARCH:Msparc64*} != "" || ${MACHINE_ARCH:Mpowerpc*} != ""
|
||||||
NO_WCAST_ALIGN= yes
|
NO_WCAST_ALIGN= yes
|
||||||
.if ${MACHINE_ARCH:M*64*} == ""
|
.if ${MACHINE_ARCH:M*64*} == ""
|
||||||
CFLAGS+= -DPPMD_32BIT
|
CFLAGS+= -DPPMD_32BIT
|
||||||
|
@ -111,7 +111,7 @@ NOASM=
|
|||||||
.include "${LIBC_SRCTOP}/xdr/Makefile.inc"
|
.include "${LIBC_SRCTOP}/xdr/Makefile.inc"
|
||||||
.if (${LIBC_ARCH} == "arm" && \
|
.if (${LIBC_ARCH} == "arm" && \
|
||||||
(${MACHINE_ARCH:Marmv6*} == "" || (defined(CPUTYPE) && ${CPUTYPE:M*soft*}))) || \
|
(${MACHINE_ARCH:Marmv6*} == "" || (defined(CPUTYPE) && ${CPUTYPE:M*soft*}))) || \
|
||||||
${LIBC_ARCH} == "mips"
|
(${LIBC_ARCH} == "mips" && ${MACHINE_ARCH:Mmips*hf} == "")
|
||||||
.include "${LIBC_SRCTOP}/softfloat/Makefile.inc"
|
.include "${LIBC_SRCTOP}/softfloat/Makefile.inc"
|
||||||
.endif
|
.endif
|
||||||
.if ${LIBC_ARCH} == "i386" || ${LIBC_ARCH} == "amd64"
|
.if ${LIBC_ARCH} == "i386" || ${LIBC_ARCH} == "amd64"
|
||||||
|
@ -183,16 +183,16 @@ The top level names are defined with a CTL_ prefix in
|
|||||||
and are as follows.
|
and are as follows.
|
||||||
The next and subsequent levels down are found in the include files
|
The next and subsequent levels down are found in the include files
|
||||||
listed here, and described in separate sections below.
|
listed here, and described in separate sections below.
|
||||||
.Bl -column CTLXMACHDEPXXX "Next level namesXXXXXX" -offset indent
|
.Bl -column CTLXMACHDEPXXX "Next Level NamesXXXXXX" -offset indent
|
||||||
.It Sy "Name Next level names Description"
|
.It Sy Name Ta Sy Next Level Names Ta Sy Description
|
||||||
.It "CTL_DEBUG sys/sysctl.h Debugging"
|
.It Dv CTL_DEBUG Ta In sys/sysctl.h Ta Debugging
|
||||||
.It "CTL_VFS sys/mount.h File system"
|
.It Dv CTL_VFS Ta In sys/mount.h Ta File system
|
||||||
.It "CTL_HW sys/sysctl.h Generic CPU, I/O"
|
.It Dv CTL_HW Ta In sys/sysctl.h Ta Generic CPU, I/O
|
||||||
.It "CTL_KERN sys/sysctl.h High kernel limits"
|
.It Dv CTL_KERN Ta In sys/sysctl.h Ta High kernel limits
|
||||||
.It "CTL_MACHDEP sys/sysctl.h Machine dependent"
|
.It Dv CTL_MACHDEP Ta In sys/sysctl.h Ta Machine dependent
|
||||||
.It "CTL_NET sys/socket.h Networking"
|
.It Dv CTL_NET Ta In sys/socket.h Ta Networking
|
||||||
.It "CTL_USER sys/sysctl.h User-level"
|
.It Dv CTL_USER Ta In sys/sysctl.h Ta User-level
|
||||||
.It "CTL_VM vm/vm_param.h Virtual memory"
|
.It Dv CTL_VM Ta In vm/vm_param.h Ta Virtual memory
|
||||||
.El
|
.El
|
||||||
.Pp
|
.Pp
|
||||||
For example, the following retrieves the maximum number of processes allowed
|
For example, the following retrieves the maximum number of processes allowed
|
||||||
@ -270,20 +270,20 @@ The string and integer information available for the CTL_HW level
|
|||||||
is detailed below.
|
is detailed below.
|
||||||
The changeable column shows whether a process with appropriate
|
The changeable column shows whether a process with appropriate
|
||||||
privilege may change the value.
|
privilege may change the value.
|
||||||
.Bl -column "Second level nameXXXXXX" integerXXX -offset indent
|
.Bl -column "Second Level Name" integerXXX Changeable -offset indent
|
||||||
.It Sy "Second level name Type Changeable"
|
.It Sy Second Level Name Ta Sy Type Ta Sy Changeable
|
||||||
.It "HW_MACHINE string no"
|
.It Dv HW_MACHINE Ta string Ta no
|
||||||
.It "HW_MODEL string no"
|
.It Dv HW_MODEL Ta string Ta no
|
||||||
.It "HW_NCPU integer no"
|
.It Dv HW_NCPU Ta integer Ta no
|
||||||
.It "HW_BYTEORDER integer no"
|
.It Dv HW_BYTEORDER Ta integer Ta no
|
||||||
.It "HW_PHYSMEM integer no"
|
.It Dv HW_PHYSMEM Ta integer Ta no
|
||||||
.It "HW_USERMEM integer no"
|
.It Dv HW_USERMEM Ta integer Ta no
|
||||||
.It "HW_PAGESIZE integer no"
|
.It Dv HW_PAGESIZE Ta integer Ta no
|
||||||
.\".It "HW_DISKNAMES integer no"
|
.\".It Dv HW_DISKNAMES Ta integer Ta no
|
||||||
.\".It "HW_DISKSTATS integer no"
|
.\".It Dv HW_DISKSTATS Ta integer Ta no
|
||||||
.It "HW_FLOATINGPT integer no"
|
.It Dv HW_FLOATINGPT Ta integer Ta no
|
||||||
.It "HW_MACHINE_ARCH string no"
|
.It Dv HW_MACHINE_ARCH Ta string Ta no
|
||||||
.It "HW_REALMEM integer no"
|
.It Dv HW_REALMEM Ta integer Ta no
|
||||||
.El
|
.El
|
||||||
.Bl -tag -width 6n
|
.Bl -tag -width 6n
|
||||||
.It Li HW_MACHINE
|
.It Li HW_MACHINE
|
||||||
@ -293,7 +293,7 @@ The machine model
|
|||||||
.It Li HW_NCPU
|
.It Li HW_NCPU
|
||||||
The number of cpus.
|
The number of cpus.
|
||||||
.It Li HW_BYTEORDER
|
.It Li HW_BYTEORDER
|
||||||
The byteorder (4,321, or 1,234).
|
The byteorder (4321 or 1234).
|
||||||
.It Li HW_PHYSMEM
|
.It Li HW_PHYSMEM
|
||||||
The bytes of physical memory.
|
The bytes of physical memory.
|
||||||
.It Li HW_USERMEM
|
.It Li HW_USERMEM
|
||||||
@ -319,36 +319,36 @@ system vnodes, the open file entries, routing table entries,
|
|||||||
virtual memory statistics, load average history, and clock rate
|
virtual memory statistics, load average history, and clock rate
|
||||||
information.
|
information.
|
||||||
.Bl -column "KERNXMAXFILESPERPROCXXX" "struct clockrateXXX" -offset indent
|
.Bl -column "KERNXMAXFILESPERPROCXXX" "struct clockrateXXX" -offset indent
|
||||||
.It Sy "Second level name Type Changeable"
|
.It Sy Second Level Name Ta Sy Type Ta Sy Changeable
|
||||||
.It "KERN_ARGMAX integer no"
|
.It Dv KERN_ARGMAX Ta integer Ta no
|
||||||
.It "KERN_BOOTFILE string yes"
|
.It Dv KERN_BOOTFILE Ta string Ta yes
|
||||||
.It "KERN_BOOTTIME struct timeval no"
|
.It Dv KERN_BOOTTIME Ta struct timeval Ta no
|
||||||
.It "KERN_CLOCKRATE struct clockinfo no"
|
.It Dv KERN_CLOCKRATE Ta struct clockinfo Ta no
|
||||||
.It "KERN_FILE struct xfile no"
|
.It Dv KERN_FILE Ta struct xfile Ta no
|
||||||
.It "KERN_HOSTID integer yes"
|
.It Dv KERN_HOSTID Ta integer Ta yes
|
||||||
.It "KERN_HOSTUUID string yes"
|
.It Dv KERN_HOSTUUID Ta string Ta yes
|
||||||
.It "KERN_HOSTNAME string yes"
|
.It Dv KERN_HOSTNAME Ta string Ta yes
|
||||||
.It "KERN_JOB_CONTROL integer no"
|
.It Dv KERN_JOB_CONTROL Ta integer Ta no
|
||||||
.It "KERN_MAXFILES integer yes"
|
.It Dv KERN_MAXFILES Ta integer Ta yes
|
||||||
.It "KERN_MAXFILESPERPROC integer yes"
|
.It Dv KERN_MAXFILESPERPROC Ta integer Ta yes
|
||||||
.It "KERN_MAXPROC integer no"
|
.It Dv KERN_MAXPROC Ta integer Ta no
|
||||||
.It "KERN_MAXPROCPERUID integer yes"
|
.It Dv KERN_MAXPROCPERUID Ta integer Ta yes
|
||||||
.It "KERN_MAXVNODES integer yes"
|
.It Dv KERN_MAXVNODES Ta integer Ta yes
|
||||||
.It "KERN_NGROUPS integer no"
|
.It Dv KERN_NGROUPS Ta integer Ta no
|
||||||
.It "KERN_NISDOMAINNAME string yes"
|
.It Dv KERN_NISDOMAINNAME Ta string Ta yes
|
||||||
.It "KERN_OSRELDATE integer no"
|
.It Dv KERN_OSRELDATE Ta integer Ta no
|
||||||
.It "KERN_OSRELEASE string no"
|
.It Dv KERN_OSRELEASE Ta string Ta no
|
||||||
.It "KERN_OSREV integer no"
|
.It Dv KERN_OSREV Ta integer Ta no
|
||||||
.It "KERN_OSTYPE string no"
|
.It Dv KERN_OSTYPE Ta string Ta no
|
||||||
.It "KERN_POSIX1 integer no"
|
.It Dv KERN_POSIX1 Ta integer Ta no
|
||||||
.It "KERN_PROC node not applicable"
|
.It Dv KERN_PROC Ta node Ta not applicable
|
||||||
.It "KERN_PROF node not applicable"
|
.It Dv KERN_PROF Ta node Ta not applicable
|
||||||
.It "KERN_QUANTUM integer yes"
|
.It Dv KERN_QUANTUM Ta integer Ta yes
|
||||||
.It "KERN_SAVED_IDS integer no"
|
.It Dv KERN_SAVED_IDS Ta integer Ta no
|
||||||
.It "KERN_SECURELVL integer raise only"
|
.It Dv KERN_SECURELVL Ta integer Ta raise only
|
||||||
.It "KERN_UPDATEINTERVAL integer no"
|
.It Dv KERN_UPDATEINTERVAL Ta integer Ta no
|
||||||
.It "KERN_VERSION string no"
|
.It Dv KERN_VERSION Ta string Ta no
|
||||||
.It "KERN_VNODE struct xvnode no"
|
.It Dv KERN_VNODE Ta struct xvnode Ta no
|
||||||
.El
|
.El
|
||||||
.Bl -tag -width 6n
|
.Bl -tag -width 6n
|
||||||
.It Li KERN_ARGMAX
|
.It Li KERN_ARGMAX
|
||||||
@ -439,14 +439,14 @@ For the following names, an array of
|
|||||||
.Va struct kinfo_proc
|
.Va struct kinfo_proc
|
||||||
structures is returned,
|
structures is returned,
|
||||||
whose size depends on the current number of such objects in the system.
|
whose size depends on the current number of such objects in the system.
|
||||||
.Bl -column "Third level nameXXXXXX" "Fourth level is:XXXXXX" -offset indent
|
.Bl -column "Third Level NameXXXXXX" "Fourth LevelXXXXXX" -offset indent
|
||||||
.It "Third level name Fourth level is:"
|
.It Sy Third Level Name Ta Sy Fourth Level
|
||||||
.It "KERN_PROC_ALL None"
|
.It Dv KERN_PROC_ALL Ta None
|
||||||
.It "KERN_PROC_PID A process ID"
|
.It Dv KERN_PROC_PID Ta A process ID
|
||||||
.It "KERN_PROC_PGRP A process group"
|
.It Dv KERN_PROC_PGRP Ta A process group
|
||||||
.It "KERN_PROC_TTY A tty device"
|
.It Dv KERN_PROC_TTY Ta A tty device
|
||||||
.It "KERN_PROC_UID A user ID"
|
.It Dv KERN_PROC_UID Ta A user ID
|
||||||
.It "KERN_PROC_RUID A real user ID"
|
.It Dv KERN_PROC_RUID Ta A real user ID
|
||||||
.El
|
.El
|
||||||
.Pp
|
.Pp
|
||||||
If the third level name is
|
If the third level name is
|
||||||
@ -465,8 +465,8 @@ For
|
|||||||
a process ID of
|
a process ID of
|
||||||
.Li \-1
|
.Li \-1
|
||||||
implies the current process.
|
implies the current process.
|
||||||
.Bl -column "Third level nameXXXXXX" "Fourth level is:XXXXXX" -offset indent
|
.Bl -column "Third Level NameXXXXXX" "Fourth LevelXXXXXX" -offset indent
|
||||||
.It Sy "Third level name Fourth level is:"
|
.It Sy Third Level Name Ta Sy Fourth Level
|
||||||
.It Dv KERN_PROC_ARGS Ta "A process ID"
|
.It Dv KERN_PROC_ARGS Ta "A process ID"
|
||||||
.It Dv KERN_PROC_PATHNAME Ta "A process ID"
|
.It Dv KERN_PROC_PATHNAME Ta "A process ID"
|
||||||
.El
|
.El
|
||||||
@ -481,12 +481,12 @@ is detailed below.
|
|||||||
The changeable column shows whether a process with appropriate
|
The changeable column shows whether a process with appropriate
|
||||||
privilege may change the value.
|
privilege may change the value.
|
||||||
.Bl -column "GPROFXGMONPARAMXXX" "struct gmonparamXXX" -offset indent
|
.Bl -column "GPROFXGMONPARAMXXX" "struct gmonparamXXX" -offset indent
|
||||||
.It Sy "Third level name Type Changeable"
|
.It Sy Third Level Name Ta Sy Type Ta Sy Changeable
|
||||||
.It "GPROF_STATE integer yes"
|
.It Dv GPROF_STATE Ta integer Ta yes
|
||||||
.It "GPROF_COUNT u_short[\|] yes"
|
.It Dv GPROF_COUNT Ta u_short[\|] Ta yes
|
||||||
.It "GPROF_FROMS u_short[\|] yes"
|
.It Dv GPROF_FROMS Ta u_short[\|] Ta yes
|
||||||
.It "GPROF_TOS struct tostruct yes"
|
.It Dv GPROF_TOS Ta struct tostruct Ta yes
|
||||||
.It "GPROF_GMONPARAM struct gmonparam no"
|
.It Dv GPROF_GMONPARAM Ta struct gmonparam Ta no
|
||||||
.El
|
.El
|
||||||
.Pp
|
.Pp
|
||||||
The variables are as follows:
|
The variables are as follows:
|
||||||
@ -530,11 +530,11 @@ The string and integer information available for the CTL_NET level
|
|||||||
is detailed below.
|
is detailed below.
|
||||||
The changeable column shows whether a process with appropriate
|
The changeable column shows whether a process with appropriate
|
||||||
privilege may change the value.
|
privilege may change the value.
|
||||||
.Bl -column "Second level nameXXXXXX" "routing messagesXXX" -offset indent
|
.Bl -column "Second Level NameXXXXXX" "routing messagesXXX" -offset indent
|
||||||
.It Sy "Second level name Type Changeable"
|
.It Sy Second Level Name Ta Sy Type Ta Sy Changeable
|
||||||
.It "PF_ROUTE routing messages no"
|
.It Dv PF_ROUTE Ta routing messages Ta no
|
||||||
.It "PF_INET IPv4 values yes"
|
.It Dv PF_INET Ta IPv4 values Ta yes
|
||||||
.It "PF_INET6 IPv6 values yes"
|
.It Dv PF_INET6 Ta IPv6 values Ta yes
|
||||||
.El
|
.El
|
||||||
.Bl -tag -width 6n
|
.Bl -tag -width 6n
|
||||||
.It Li PF_ROUTE
|
.It Li PF_ROUTE
|
||||||
@ -548,13 +548,13 @@ The third level name is a protocol number, which is currently always 0.
|
|||||||
The fourth level name is an address family, which may be set to 0 to
|
The fourth level name is an address family, which may be set to 0 to
|
||||||
select all address families.
|
select all address families.
|
||||||
The fifth, sixth, and seventh level names are as follows:
|
The fifth, sixth, and seventh level names are as follows:
|
||||||
.Bl -column -offset indent "Fifth level Sixth level" "Seventh level"
|
.Bl -column -offset indent "Fifth Level" "Sixth Level" "Seventh Level"
|
||||||
.It Sy "Fifth level Sixth level" Ta Sy "Seventh level"
|
.It Sy Fifth level Ta Sy Sixth Level Ta Sy Seventh Level
|
||||||
.It "NET_RT_FLAGS rtflags" Ta "None"
|
.It Dv NET_RT_FLAGS Ta rtflags Ta None
|
||||||
.It "NET_RT_DUMP None" Ta "None or fib number"
|
.It Dv NET_RT_DUMP Ta None Ta None or fib number
|
||||||
.It "NET_RT_IFLIST 0 or if_index" Ta None
|
.It Dv NET_RT_IFLIST Ta 0 or if_index Ta None
|
||||||
.It "NET_RT_IFMALIST 0 or if_index" Ta None
|
.It Dv NET_RT_IFMALIST Ta 0 or if_index Ta None
|
||||||
.It "NET_RT_IFLISTL 0 or if_index" Ta None
|
.It Dv NET_RT_IFLISTL Ta 0 or if_index Ta None
|
||||||
.El
|
.El
|
||||||
.Pp
|
.Pp
|
||||||
The
|
The
|
||||||
@ -582,13 +582,13 @@ The third level name is the protocol.
|
|||||||
The fourth level name is the variable name.
|
The fourth level name is the variable name.
|
||||||
The currently defined protocols and names are:
|
The currently defined protocols and names are:
|
||||||
.Bl -column ProtocolXX VariableXX TypeXX ChangeableXX
|
.Bl -column ProtocolXX VariableXX TypeXX ChangeableXX
|
||||||
.It Sy "Protocol Variable Type Changeable"
|
.It Sy Protocol Ta Sy Variable Ta Sy Type Ta Sy Changeable
|
||||||
.It "icmp bmcastecho integer yes"
|
.It icmp Ta bmcastecho Ta integer Ta yes
|
||||||
.It "icmp maskrepl integer yes"
|
.It icmp Ta maskrepl Ta integer Ta yes
|
||||||
.It "ip forwarding integer yes"
|
.It ip Ta forwarding Ta integer Ta yes
|
||||||
.It "ip redirect integer yes"
|
.It ip Ta redirect Ta integer Ta yes
|
||||||
.It "ip ttl integer yes"
|
.It ip Ta ttl Ta integer Ta yes
|
||||||
.It "udp checksum integer yes"
|
.It udp Ta checksum Ta integer Ta yes
|
||||||
.El
|
.El
|
||||||
.Pp
|
.Pp
|
||||||
The variables are as follows:
|
The variables are as follows:
|
||||||
@ -633,27 +633,27 @@ is detailed below.
|
|||||||
The changeable column shows whether a process with appropriate
|
The changeable column shows whether a process with appropriate
|
||||||
privilege may change the value.
|
privilege may change the value.
|
||||||
.Bl -column "USER_COLL_WEIGHTS_MAXXXX" "integerXXX" -offset indent
|
.Bl -column "USER_COLL_WEIGHTS_MAXXXX" "integerXXX" -offset indent
|
||||||
.It Sy "Second level name Type Changeable"
|
.It Sy Second Level Name Ta Sy Type Ta Sy Changeable
|
||||||
.It "USER_BC_BASE_MAX integer no"
|
.It Dv USER_BC_BASE_MAX Ta integer Ta no
|
||||||
.It "USER_BC_DIM_MAX integer no"
|
.It Dv USER_BC_DIM_MAX Ta integer Ta no
|
||||||
.It "USER_BC_SCALE_MAX integer no"
|
.It Dv USER_BC_SCALE_MAX Ta integer Ta no
|
||||||
.It "USER_BC_STRING_MAX integer no"
|
.It Dv USER_BC_STRING_MAX Ta integer Ta no
|
||||||
.It "USER_COLL_WEIGHTS_MAX integer no"
|
.It Dv USER_COLL_WEIGHTS_MAX Ta integer Ta no
|
||||||
.It "USER_CS_PATH string no"
|
.It Dv USER_CS_PATH Ta string Ta no
|
||||||
.It "USER_EXPR_NEST_MAX integer no"
|
.It Dv USER_EXPR_NEST_MAX Ta integer Ta no
|
||||||
.It "USER_LINE_MAX integer no"
|
.It Dv USER_LINE_MAX Ta integer Ta no
|
||||||
.It "USER_POSIX2_CHAR_TERM integer no"
|
.It Dv USER_POSIX2_CHAR_TERM Ta integer Ta no
|
||||||
.It "USER_POSIX2_C_BIND integer no"
|
.It Dv USER_POSIX2_C_BIND Ta integer Ta no
|
||||||
.It "USER_POSIX2_C_DEV integer no"
|
.It Dv USER_POSIX2_C_DEV Ta integer Ta no
|
||||||
.It "USER_POSIX2_FORT_DEV integer no"
|
.It Dv USER_POSIX2_FORT_DEV Ta integer Ta no
|
||||||
.It "USER_POSIX2_FORT_RUN integer no"
|
.It Dv USER_POSIX2_FORT_RUN Ta integer Ta no
|
||||||
.It "USER_POSIX2_LOCALEDEF integer no"
|
.It Dv USER_POSIX2_LOCALEDEF Ta integer Ta no
|
||||||
.It "USER_POSIX2_SW_DEV integer no"
|
.It Dv USER_POSIX2_SW_DEV Ta integer Ta no
|
||||||
.It "USER_POSIX2_UPE integer no"
|
.It Dv USER_POSIX2_UPE Ta integer Ta no
|
||||||
.It "USER_POSIX2_VERSION integer no"
|
.It Dv USER_POSIX2_VERSION Ta integer Ta no
|
||||||
.It "USER_RE_DUP_MAX integer no"
|
.It Dv USER_RE_DUP_MAX Ta integer Ta no
|
||||||
.It "USER_STREAM_MAX integer no"
|
.It Dv USER_STREAM_MAX Ta integer Ta no
|
||||||
.It "USER_TZNAME_MAX integer no"
|
.It Dv USER_TZNAME_MAX Ta integer Ta no
|
||||||
.El
|
.El
|
||||||
.Bl -tag -width 6n
|
.Bl -tag -width 6n
|
||||||
.It Li USER_BC_BASE_MAX
|
.It Li USER_BC_BASE_MAX
|
||||||
@ -731,16 +731,16 @@ The string and integer information available for the CTL_VM level
|
|||||||
is detailed below.
|
is detailed below.
|
||||||
The changeable column shows whether a process with appropriate
|
The changeable column shows whether a process with appropriate
|
||||||
privilege may change the value.
|
privilege may change the value.
|
||||||
.Bl -column "Second level nameXXXXXX" "struct loadavgXXX" -offset indent
|
.Bl -column "Second Level NameXXXXXX" "struct loadavgXXX" -offset indent
|
||||||
.It Sy "Second level name Type Changeable"
|
.It Sy Second Level Name Ta Sy Type Ta Sy Changeable
|
||||||
.It "VM_LOADAVG struct loadavg no"
|
.It Dv VM_LOADAVG Ta struct loadavg Ta no
|
||||||
.It "VM_TOTAL struct vmtotal no"
|
.It Dv VM_TOTAL Ta struct vmtotal Ta no
|
||||||
.It "VM_SWAPPING_ENABLED integer maybe"
|
.It Dv VM_SWAPPING_ENABLED Ta integer Ta maybe
|
||||||
.It "VM_V_FREE_MIN integer yes"
|
.It Dv VM_V_FREE_MIN Ta integer Ta yes
|
||||||
.It "VM_V_FREE_RESERVED integer yes"
|
.It Dv VM_V_FREE_RESERVED Ta integer Ta yes
|
||||||
.It "VM_V_FREE_TARGET integer yes"
|
.It Dv VM_V_FREE_TARGET Ta integer Ta yes
|
||||||
.It "VM_V_INACTIVE_TARGET integer yes"
|
.It Dv VM_V_INACTIVE_TARGET Ta integer Ta yes
|
||||||
.It "VM_V_PAGEOUT_FREE_MIN integer yes"
|
.It Dv VM_V_PAGEOUT_FREE_MIN Ta integer Ta yes
|
||||||
.El
|
.El
|
||||||
.Bl -tag -width 6n
|
.Bl -tag -width 6n
|
||||||
.It Li VM_LOADAVG
|
.It Li VM_LOADAVG
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
# $NetBSD: Makefile.inc,v 1.7 2005/09/17 11:49:39 tsutsui Exp $
|
# $NetBSD: Makefile.inc,v 1.7 2005/09/17 11:49:39 tsutsui Exp $
|
||||||
# $FreeBSD$
|
# $FreeBSD$
|
||||||
|
|
||||||
|
.if ${MACHINE_ARCH:Mmips*hf} == ""
|
||||||
CFLAGS+=-DSOFTFLOAT
|
CFLAGS+=-DSOFTFLOAT
|
||||||
|
.endif
|
||||||
|
|
||||||
MDSRCS+= machdep_ldisd.c
|
MDSRCS+= machdep_ldisd.c
|
||||||
SYM_MAPS+= ${LIBC_SRCTOP}/mips/Symbol.map
|
SYM_MAPS+= ${LIBC_SRCTOP}/mips/Symbol.map
|
||||||
|
@ -31,6 +31,10 @@ FBSD_1.0 {
|
|||||||
sbrk;
|
sbrk;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
FBSD_1.3 {
|
||||||
|
__flt_rounds;
|
||||||
|
};
|
||||||
|
|
||||||
FBSDprivate_1.0 {
|
FBSDprivate_1.0 {
|
||||||
/* PSEUDO syscalls */
|
/* PSEUDO syscalls */
|
||||||
__sys_getlogin;
|
__sys_getlogin;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# $NetBSD: Makefile.inc,v 1.27 2005/10/07 17:16:40 tsutsui Exp $
|
# $NetBSD: Makefile.inc,v 1.27 2005/10/07 17:16:40 tsutsui Exp $
|
||||||
# $FreeBSD$
|
# $FreeBSD$
|
||||||
|
|
||||||
SRCS+= infinity.c fabs.c ldexp.c
|
SRCS+= infinity.c fabs.c ldexp.c flt_rounds.c
|
||||||
|
|
||||||
# SRCS+= flt_rounds.c fpgetmask.c fpgetround.c fpgetsticky.c fpsetmask.c \
|
# SRCS+= flt_rounds.c fpgetmask.c fpgetround.c fpgetsticky.c fpsetmask.c \
|
||||||
# fpsetround.c fpsetsticky.c
|
# fpsetround.c fpsetsticky.c
|
||||||
|
@ -11,7 +11,14 @@ __FBSDID("$FreeBSD$");
|
|||||||
__RCSID("$NetBSD: flt_rounds.c,v 1.5 2005/12/24 23:10:08 perry Exp $");
|
__RCSID("$NetBSD: flt_rounds.c,v 1.5 2005/12/24 23:10:08 perry Exp $");
|
||||||
#endif /* LIBC_SCCS and not lint */
|
#endif /* LIBC_SCCS and not lint */
|
||||||
|
|
||||||
#include <machine/float.h>
|
#include <fenv.h>
|
||||||
|
#include <float.h>
|
||||||
|
|
||||||
|
#ifdef SOFTFLOAT
|
||||||
|
#include "softfloat-for-gcc.h"
|
||||||
|
#include "milieu.h"
|
||||||
|
#include "softfloat.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
static const int map[] = {
|
static const int map[] = {
|
||||||
1, /* round to nearest */
|
1, /* round to nearest */
|
||||||
@ -23,8 +30,13 @@ static const int map[] = {
|
|||||||
int
|
int
|
||||||
__flt_rounds()
|
__flt_rounds()
|
||||||
{
|
{
|
||||||
int x;
|
int mode;
|
||||||
|
|
||||||
__asm("cfc1 %0,$31" : "=r" (x));
|
#ifdef SOFTFLOAT
|
||||||
return map[x & 0x03];
|
mode = __softfloat_float_rounding_mode;
|
||||||
|
#else
|
||||||
|
__asm __volatile("cfc1 %0,$31" : "=r" (mode));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return map[mode & 0x03];
|
||||||
}
|
}
|
||||||
|
6
lib/libc/powerpc/gen/Makefile.common
Normal file
6
lib/libc/powerpc/gen/Makefile.common
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
# $FreeBSD$
|
||||||
|
|
||||||
|
.PATH: ${LIBC_SRCTOP}/powerpc/gen
|
||||||
|
|
||||||
|
SRCS += _ctx_start.S eabi.S infinity.c ldexp.c makecontext.c \
|
||||||
|
signalcontext.c syncicache.c _set_tp.c trivial-getcontextx.c
|
@ -1,11 +1,7 @@
|
|||||||
# $FreeBSD$
|
# $FreeBSD$
|
||||||
|
|
||||||
SRCS += _ctx_start.S eabi.S fabs.S flt_rounds.c fpgetmask.c fpgetround.c \
|
.include "${LIBC_SRCTOP}/powerpc/gen/Makefile.common"
|
||||||
|
|
||||||
|
SRCS += fabs.S flt_rounds.c fpgetmask.c fpgetround.c \
|
||||||
fpgetsticky.c fpsetmask.c fpsetround.c \
|
fpgetsticky.c fpsetmask.c fpsetround.c \
|
||||||
infinity.c ldexp.c makecontext.c _setjmp.S \
|
_setjmp.S setjmp.S sigsetjmp.S
|
||||||
setjmp.S sigsetjmp.S signalcontext.c syncicache.c \
|
|
||||||
_set_tp.c \
|
|
||||||
trivial-getcontextx.c
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
8
lib/libc/powerpcspe/Makefile.inc
Normal file
8
lib/libc/powerpcspe/Makefile.inc
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# $FreeBSD$
|
||||||
|
|
||||||
|
CFLAGS+= -I${LIBC_SRCTOP}/powerpc
|
||||||
|
SRCS+= trivial-vdso_tc.c
|
||||||
|
|
||||||
|
# Long double is 64-bits
|
||||||
|
MDSRCS+=machdep_ldisd.c
|
||||||
|
SYM_MAPS+=${LIBC_SRCTOP}/powerpc/Symbol.map
|
7
lib/libc/powerpcspe/gen/Makefile.inc
Normal file
7
lib/libc/powerpcspe/gen/Makefile.inc
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# $FreeBSD$
|
||||||
|
|
||||||
|
.include "${LIBC_SRCTOP}/powerpc/gen/Makefile.common"
|
||||||
|
|
||||||
|
SRCS += fabs.S flt_rounds.c fpgetmask.c fpgetround.c \
|
||||||
|
fpgetsticky.c fpsetmask.c fpsetround.c \
|
||||||
|
_setjmp.S setjmp.S sigsetjmp.S
|
117
lib/libc/powerpcspe/gen/_setjmp.S
Normal file
117
lib/libc/powerpcspe/gen/_setjmp.S
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
/*-
|
||||||
|
* Copyright (c) 2016 Justin Hibbits
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
/* $NetBSD: _setjmp.S,v 1.1 1997/03/29 20:55:53 thorpej Exp $ */
|
||||||
|
|
||||||
|
#include <machine/asm.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
|
/*
|
||||||
|
* C library -- _setjmp, _longjmp
|
||||||
|
*
|
||||||
|
* _longjmp(a,v)
|
||||||
|
* will generate a "return(v?v:1)" from the last call to
|
||||||
|
* _setjmp(a)
|
||||||
|
* by restoring registers from the stack.
|
||||||
|
* The previous signal state is NOT restored.
|
||||||
|
*
|
||||||
|
* jmpbuf layout:
|
||||||
|
* +------------+
|
||||||
|
* | unused |
|
||||||
|
* +------------+
|
||||||
|
* | unused |
|
||||||
|
* | |
|
||||||
|
* | (4 words) |
|
||||||
|
* | |
|
||||||
|
* +------------+
|
||||||
|
* | saved regs |
|
||||||
|
* | ... |
|
||||||
|
*/
|
||||||
|
|
||||||
|
ENTRY(_setjmp)
|
||||||
|
mflr %r11
|
||||||
|
mfcr %r12
|
||||||
|
evstdd %r1,24+0*8(%r3)
|
||||||
|
evstdd %r2,24+1*8(%r3)
|
||||||
|
evstdd %r11,24+2*8(%r3)
|
||||||
|
evstdd %r12,24+3*8(%r3)
|
||||||
|
evstdd %r13,24+4*8(%r3)
|
||||||
|
evstdd %r14,24+5*8(%r3)
|
||||||
|
evstdd %r15,24+6*8(%r3)
|
||||||
|
evstdd %r16,24+7*8(%r3)
|
||||||
|
evstdd %r17,24+8*8(%r3)
|
||||||
|
evstdd %r18,24+9*8(%r3)
|
||||||
|
evstdd %r19,24+10*8(%r3)
|
||||||
|
evstdd %r20,24+11*8(%r3)
|
||||||
|
evstdd %r21,24+12*8(%r3)
|
||||||
|
evstdd %r22,24+13*8(%r3)
|
||||||
|
evstdd %r23,24+14*8(%r3)
|
||||||
|
evstdd %r24,24+15*8(%r3)
|
||||||
|
evstdd %r25,24+16*8(%r3)
|
||||||
|
evstdd %r26,24+17*8(%r3)
|
||||||
|
evstdd %r27,24+18*8(%r3)
|
||||||
|
evstdd %r28,24+19*8(%r3)
|
||||||
|
evstdd %r29,24+20*8(%r3)
|
||||||
|
evstdd %r30,24+21*8(%r3)
|
||||||
|
evstdd %r31,24+22*8(%r3)
|
||||||
|
|
||||||
|
li %r3,0
|
||||||
|
blr
|
||||||
|
END(_setjmp)
|
||||||
|
|
||||||
|
ENTRY(_longjmp)
|
||||||
|
evldd %r1,24+0*8(%r3)
|
||||||
|
evldd %r2,24+1*8(%r3)
|
||||||
|
evldd %r11,24+2*8(%r3)
|
||||||
|
evldd %r12,24+3*8(%r3)
|
||||||
|
evldd %r13,24+4*8(%r3)
|
||||||
|
evldd %r14,24+5*8(%r3)
|
||||||
|
evldd %r15,24+6*8(%r3)
|
||||||
|
evldd %r16,24+7*8(%r3)
|
||||||
|
evldd %r17,24+8*8(%r3)
|
||||||
|
evldd %r18,24+9*8(%r3)
|
||||||
|
evldd %r19,24+10*8(%r3)
|
||||||
|
evldd %r20,24+11*8(%r3)
|
||||||
|
evldd %r21,24+12*8(%r3)
|
||||||
|
evldd %r22,24+13*8(%r3)
|
||||||
|
evldd %r23,24+14*8(%r3)
|
||||||
|
evldd %r24,24+15*8(%r3)
|
||||||
|
evldd %r25,24+16*8(%r3)
|
||||||
|
evldd %r26,24+17*8(%r3)
|
||||||
|
evldd %r27,24+18*8(%r3)
|
||||||
|
evldd %r28,24+19*8(%r3)
|
||||||
|
evldd %r29,24+20*8(%r3)
|
||||||
|
evldd %r30,24+21*8(%r3)
|
||||||
|
evldd %r31,24+22*8(%r3)
|
||||||
|
|
||||||
|
mtlr %r11
|
||||||
|
mtcr %r12
|
||||||
|
or. %r3,%r4,%r4
|
||||||
|
bnelr
|
||||||
|
li %r3,1
|
||||||
|
blr
|
||||||
|
END(_longjmp)
|
||||||
|
|
||||||
|
.section .note.GNU-stack,"",%progbits
|
38
lib/libc/powerpcspe/gen/fabs.S
Normal file
38
lib/libc/powerpcspe/gen/fabs.S
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2016 Justin Hibbits
|
||||||
|
* 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$");
|
||||||
|
|
||||||
|
/*
|
||||||
|
* double fabs(double)
|
||||||
|
*/
|
||||||
|
ENTRY(fabs)
|
||||||
|
efdabs %f1,%f1
|
||||||
|
blr
|
||||||
|
END(fabs)
|
||||||
|
|
||||||
|
.section .note.GNU-stack,"",%progbits
|
57
lib/libc/powerpcspe/gen/flt_rounds.c
Normal file
57
lib/libc/powerpcspe/gen/flt_rounds.c
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
/* $NetBSD: flt_rounds.c,v 1.4.10.3 2002/03/22 20:41:53 nathanw Exp $ */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2016 Justin Hibbits
|
||||||
|
* 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 Mark Brinicombe
|
||||||
|
* 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 <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <machine/float.h>
|
||||||
|
#include <machine/spr.h>
|
||||||
|
|
||||||
|
#ifndef _SOFT_FLOAT
|
||||||
|
static const int map[] = {
|
||||||
|
1, /* round to nearest */
|
||||||
|
0, /* round to zero */
|
||||||
|
2, /* round to positive infinity */
|
||||||
|
3 /* round to negative infinity */
|
||||||
|
};
|
||||||
|
|
||||||
|
int
|
||||||
|
__flt_rounds()
|
||||||
|
{
|
||||||
|
uint32_t fpscr;
|
||||||
|
|
||||||
|
__asm__ __volatile("mfspr %0, %1" : "=r"(fpscr) : "K"(SPR_SPEFSCR));
|
||||||
|
return map[(fpscr & 0x03)];
|
||||||
|
}
|
||||||
|
#endif
|
49
lib/libc/powerpcspe/gen/fpgetmask.c
Normal file
49
lib/libc/powerpcspe/gen/fpgetmask.c
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
/* $NetBSD: fpgetmask.c,v 1.3 2002/01/13 21:45:47 thorpej Exp $ */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2016 Justin Hibbits
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This code is derived from software contributed to The NetBSD Foundation
|
||||||
|
* by Dan Winship.
|
||||||
|
*
|
||||||
|
* 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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 <machine/spr.h>
|
||||||
|
#include <ieeefp.h>
|
||||||
|
|
||||||
|
#ifndef _SOFT_FLOAT
|
||||||
|
fp_except_t
|
||||||
|
fpgetmask()
|
||||||
|
{
|
||||||
|
uint32_t fpscr;
|
||||||
|
|
||||||
|
__asm__ __volatile("mfspr %0, %1" : "=r"(fpscr) : "K"(SPR_SPEFSCR));
|
||||||
|
return ((fp_except_t)((fpscr >> 3) & 0x1f));
|
||||||
|
}
|
||||||
|
#endif
|
49
lib/libc/powerpcspe/gen/fpgetround.c
Normal file
49
lib/libc/powerpcspe/gen/fpgetround.c
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
/* $NetBSD: fpgetround.c,v 1.3 2002/01/13 21:45:47 thorpej Exp $ */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2016 Justin Hibbits
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This code is derived from software contributed to The NetBSD Foundation
|
||||||
|
* by Dan Winship.
|
||||||
|
*
|
||||||
|
* 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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 <machine/spr.h>
|
||||||
|
#include <ieeefp.h>
|
||||||
|
|
||||||
|
#ifndef _SOFT_FLOAT
|
||||||
|
fp_rnd_t
|
||||||
|
fpgetround()
|
||||||
|
{
|
||||||
|
uint32_t fpscr;
|
||||||
|
|
||||||
|
__asm__ __volatile("mfspr %0, %1" : "=r"(fpscr) : "K"(SPR_SPEFSCR));
|
||||||
|
return ((fp_rnd_t)(fpscr & 0x3));
|
||||||
|
}
|
||||||
|
#endif
|
55
lib/libc/powerpcspe/gen/fpgetsticky.c
Normal file
55
lib/libc/powerpcspe/gen/fpgetsticky.c
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
/* $NetBSD: fpgetsticky.c,v 1.3 2002/01/13 21:45:48 thorpej Exp $ */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2016 Justin Hibbits
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This code is derived from software contributed to The NetBSD Foundation
|
||||||
|
* by Dan Winship.
|
||||||
|
*
|
||||||
|
* 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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/cdefs.h>
|
||||||
|
|
||||||
|
#include "namespace.h"
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <machine/spr.h>
|
||||||
|
#include <ieeefp.h>
|
||||||
|
|
||||||
|
#ifndef _SOFT_FLOAT
|
||||||
|
#ifdef __weak_alias
|
||||||
|
__weak_alias(fpgetsticky,_fpgetsticky)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
fp_except_t
|
||||||
|
fpgetsticky()
|
||||||
|
{
|
||||||
|
uint32_t fpscr;
|
||||||
|
|
||||||
|
__asm__ __volatile("mfspr %0, %1" : "=r"(fpscr) : "K"(SPR_SPEFSCR));
|
||||||
|
return ((fp_except_t)((fpscr >> 25) & 0x1f));
|
||||||
|
}
|
||||||
|
#endif
|
53
lib/libc/powerpcspe/gen/fpsetmask.c
Normal file
53
lib/libc/powerpcspe/gen/fpsetmask.c
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
/* $NetBSD: fpsetmask.c,v 1.3 2002/01/13 21:45:48 thorpej Exp $ */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2016 Justin Hibbits
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This code is derived from software contributed to The NetBSD Foundation
|
||||||
|
* by Dan Winship.
|
||||||
|
*
|
||||||
|
* 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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 <machine/spr.h>
|
||||||
|
#include <ieeefp.h>
|
||||||
|
|
||||||
|
#ifndef _SOFT_FLOAT
|
||||||
|
fp_except_t
|
||||||
|
fpsetmask(fp_except_t mask)
|
||||||
|
{
|
||||||
|
uint32_t fpscr;
|
||||||
|
fp_rnd_t old;
|
||||||
|
|
||||||
|
__asm__ __volatile("mfspr %0, %1" : "=r"(fpscr) : "K"(SPR_SPEFSCR));
|
||||||
|
old = (fp_rnd_t)((fpscr >> 3) & 0x1f);
|
||||||
|
fpscr = (fpscr & 0xffffff07) | (mask << 3);
|
||||||
|
__asm__ __volatile("mtspr %1,%0" :: "r"(fpscr), "K"(SPR_SPEFSCR));
|
||||||
|
return (old);
|
||||||
|
}
|
||||||
|
#endif
|
53
lib/libc/powerpcspe/gen/fpsetround.c
Normal file
53
lib/libc/powerpcspe/gen/fpsetround.c
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
/* $NetBSD: fpsetround.c,v 1.3 2002/01/13 21:45:48 thorpej Exp $ */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2016 Justin Hibbits
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This code is derived from software contributed to The NetBSD Foundation
|
||||||
|
* by Dan Winship.
|
||||||
|
*
|
||||||
|
* 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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 <machine/spr.h>
|
||||||
|
#include <ieeefp.h>
|
||||||
|
|
||||||
|
#ifndef _SOFT_FLOAT
|
||||||
|
fp_rnd_t
|
||||||
|
fpsetround(fp_rnd_t rnd_dir)
|
||||||
|
{
|
||||||
|
uint32_t fpscr;
|
||||||
|
fp_rnd_t old;
|
||||||
|
|
||||||
|
__asm__ __volatile("mfspr %0, %1" : "=r"(fpscr) : "K"(SPR_SPEFSCR) );
|
||||||
|
old = (fp_rnd_t)(fpscr & 0x3);
|
||||||
|
fpscr = (fpscr & 0xfffffffc) | rnd_dir;
|
||||||
|
__asm__ __volatile("mtspr %1, %0" :: "r"(fpscr), "K"(SPR_SPEFSCR));
|
||||||
|
return (old);
|
||||||
|
}
|
||||||
|
#endif
|
138
lib/libc/powerpcspe/gen/setjmp.S
Normal file
138
lib/libc/powerpcspe/gen/setjmp.S
Normal file
@ -0,0 +1,138 @@
|
|||||||
|
/*-
|
||||||
|
* Copyright (c) 2016 Justin Hibbits
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
/* $NetBSD: setjmp.S,v 1.3 1998/10/03 12:30:38 tsubai Exp $ */
|
||||||
|
|
||||||
|
#include <machine/asm.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
|
#include <sys/syscall.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* C library -- setjmp, longjmp
|
||||||
|
*
|
||||||
|
* longjmp(a,v)
|
||||||
|
* will generate a "return(v?v:1)" from the last call to
|
||||||
|
* setjmp(a)
|
||||||
|
* by restoring registers from the stack.
|
||||||
|
* The previous signal state is restored.
|
||||||
|
*
|
||||||
|
* jmpbuf layout:
|
||||||
|
* +------------+
|
||||||
|
* | unused |
|
||||||
|
* +------------+
|
||||||
|
* | sig state |
|
||||||
|
* | |
|
||||||
|
* | (4 words) |
|
||||||
|
* | |
|
||||||
|
* +------------+
|
||||||
|
* | saved regs |
|
||||||
|
* | ... |
|
||||||
|
*/
|
||||||
|
|
||||||
|
ENTRY(setjmp)
|
||||||
|
mr %r6,%r3
|
||||||
|
li %r3,1 /* SIG_BLOCK, but doesn't matter */
|
||||||
|
/* since set == NULL */
|
||||||
|
li %r4,0 /* set = NULL */
|
||||||
|
mr %r5,%r6 /* &oset */
|
||||||
|
addi %r5,%r5,4
|
||||||
|
li %r0, SYS_sigprocmask /*sigprocmask(SIG_BLOCK, NULL, &oset)*/
|
||||||
|
sc /*assume no error XXX */
|
||||||
|
mflr %r11 /* r11 <- link reg */
|
||||||
|
mfcr %r12 /* r12 <- condition reg */
|
||||||
|
mr %r10,%r1 /* r10 <- stackptr */
|
||||||
|
mr %r9,%r2 /* r9 <- global ptr */
|
||||||
|
evstdd %r9,24+0*8(%r6)
|
||||||
|
evstdd %r10,24+1*8(%r6)
|
||||||
|
evstdd %r11,24+2*8(%r6)
|
||||||
|
evstdd %r12,24+3*8(%r6)
|
||||||
|
evstdd %r13,24+4*8(%r6)
|
||||||
|
evstdd %r14,24+5*8(%r6)
|
||||||
|
evstdd %r15,24+6*8(%r6)
|
||||||
|
evstdd %r16,24+7*8(%r6)
|
||||||
|
evstdd %r17,24+8*8(%r6)
|
||||||
|
evstdd %r18,24+9*8(%r6)
|
||||||
|
evstdd %r19,24+10*8(%r6)
|
||||||
|
evstdd %r20,24+11*8(%r6)
|
||||||
|
evstdd %r21,24+12*8(%r6)
|
||||||
|
evstdd %r22,24+13*8(%r6)
|
||||||
|
evstdd %r23,24+14*8(%r6)
|
||||||
|
evstdd %r24,24+15*8(%r6)
|
||||||
|
evstdd %r25,24+16*8(%r6)
|
||||||
|
evstdd %r26,24+17*8(%r6)
|
||||||
|
evstdd %r27,24+18*8(%r6)
|
||||||
|
evstdd %r28,24+19*8(%r6)
|
||||||
|
evstdd %r29,24+20*8(%r6)
|
||||||
|
evstdd %r30,24+21*8(%r6)
|
||||||
|
evstdd %r31,24+22*8(%r6)
|
||||||
|
|
||||||
|
li %r3,0 /* return (0) */
|
||||||
|
blr
|
||||||
|
END(setjmp)
|
||||||
|
|
||||||
|
WEAK_REFERENCE(CNAME(__longjmp), longjmp)
|
||||||
|
ENTRY(__longjmp)
|
||||||
|
evldd %r9,24+0*8(%r3)
|
||||||
|
evldd %r10,24+1*8(%r3)
|
||||||
|
evldd %r11,24+2*8(%r3)
|
||||||
|
evldd %r12,24+3*8(%r3)
|
||||||
|
evldd %r13,24+4*8(%r3)
|
||||||
|
evldd %r14,24+5*8(%r3)
|
||||||
|
evldd %r15,24+6*8(%r3)
|
||||||
|
evldd %r16,24+7*8(%r3)
|
||||||
|
evldd %r17,24+8*8(%r3)
|
||||||
|
evldd %r18,24+9*8(%r3)
|
||||||
|
evldd %r19,24+10*8(%r3)
|
||||||
|
evldd %r20,24+11*8(%r3)
|
||||||
|
evldd %r21,24+12*8(%r3)
|
||||||
|
evldd %r22,24+13*8(%r3)
|
||||||
|
evldd %r23,24+14*8(%r3)
|
||||||
|
evldd %r24,24+15*8(%r3)
|
||||||
|
evldd %r25,24+16*8(%r3)
|
||||||
|
evldd %r26,24+17*8(%r3)
|
||||||
|
evldd %r27,24+18*8(%r3)
|
||||||
|
evldd %r28,24+19*8(%r3)
|
||||||
|
evldd %r29,24+20*8(%r3)
|
||||||
|
evldd %r30,24+21*8(%r3)
|
||||||
|
evldd %r31,24+22*8(%r3)
|
||||||
|
|
||||||
|
mr %r6,%r4 /* save val param */
|
||||||
|
mtlr %r11 /* r11 -> link reg */
|
||||||
|
mtcr %r12 /* r12 -> condition reg */
|
||||||
|
mr %r1,%r10 /* r10 -> stackptr */
|
||||||
|
mr %r4,%r3
|
||||||
|
li %r3,3 /* SIG_SETMASK */
|
||||||
|
addi %r4,%r4,4 /* &set */
|
||||||
|
li %r5,0 /* oset = NULL */
|
||||||
|
li %r0,SYS_sigprocmask /* sigprocmask(SIG_SET, &set, NULL) */
|
||||||
|
sc /* assume no error XXX */
|
||||||
|
or. %r3,%r6,%r6
|
||||||
|
bnelr
|
||||||
|
li %r3,1
|
||||||
|
blr
|
||||||
|
END(__longjmp)
|
||||||
|
|
||||||
|
.section .note.GNU-stack,"",%progbits
|
150
lib/libc/powerpcspe/gen/sigsetjmp.S
Normal file
150
lib/libc/powerpcspe/gen/sigsetjmp.S
Normal file
@ -0,0 +1,150 @@
|
|||||||
|
/*-
|
||||||
|
* Copyright (c) 2016 Justin Hibbits
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
/* $NetBSD: sigsetjmp.S,v 1.4 1998/10/03 12:30:38 tsubai Exp $ */
|
||||||
|
|
||||||
|
#include <machine/asm.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
|
/*
|
||||||
|
* C library -- sigsetjmp, siglongjmp
|
||||||
|
*
|
||||||
|
* siglongjmp(a,v)
|
||||||
|
* will generate a "return(v?v:1)" from the last call to
|
||||||
|
* sigsetjmp(a, savemask)
|
||||||
|
* by restoring registers from the stack.
|
||||||
|
* The previous signal state is restored if savemask is non-zero
|
||||||
|
*
|
||||||
|
* jmpbuf layout:
|
||||||
|
* +------------+
|
||||||
|
* | savemask |
|
||||||
|
* +------------+
|
||||||
|
* | sig state |
|
||||||
|
* | |
|
||||||
|
* | (4 words) |
|
||||||
|
* | |
|
||||||
|
* +------------+
|
||||||
|
* | saved regs |
|
||||||
|
* | ... |
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include <sys/syscall.h>
|
||||||
|
|
||||||
|
ENTRY(sigsetjmp)
|
||||||
|
mr %r6,%r3
|
||||||
|
stw %r4,0(%r3)
|
||||||
|
or. %r7,%r4,%r4
|
||||||
|
beq 1f
|
||||||
|
li %r3,1 /* SIG_BLOCK, but doesn't matter */
|
||||||
|
/* since set == NULL */
|
||||||
|
li %r4,0 /* set = NULL */
|
||||||
|
mr %r5,%r6 /* &oset */
|
||||||
|
addi %r5,%r5,4
|
||||||
|
li %r0, SYS_sigprocmask /* sigprocmask(SIG_BLOCK, NULL, &oset)*/
|
||||||
|
sc /* assume no error XXX */
|
||||||
|
1:
|
||||||
|
mflr %r11
|
||||||
|
mfcr %r12
|
||||||
|
mr %r10,%r1
|
||||||
|
mr %r9,%r2
|
||||||
|
|
||||||
|
/* FPRs */
|
||||||
|
evstdd %r9,24+0*8(%r6)
|
||||||
|
evstdd %r10,24+1*8(%r6)
|
||||||
|
evstdd %r11,24+2*8(%r6)
|
||||||
|
evstdd %r12,24+3*8(%r6)
|
||||||
|
evstdd %r13,24+4*8(%r6)
|
||||||
|
evstdd %r14,24+5*8(%r6)
|
||||||
|
evstdd %r15,24+6*8(%r6)
|
||||||
|
evstdd %r16,24+7*8(%r6)
|
||||||
|
evstdd %r17,24+8*8(%r6)
|
||||||
|
evstdd %r18,24+9*8(%r6)
|
||||||
|
evstdd %r19,24+10*8(%r6)
|
||||||
|
evstdd %r20,24+11*8(%r6)
|
||||||
|
evstdd %r21,24+12*8(%r6)
|
||||||
|
evstdd %r22,24+13*8(%r6)
|
||||||
|
evstdd %r23,24+14*8(%r6)
|
||||||
|
evstdd %r24,24+15*8(%r6)
|
||||||
|
evstdd %r25,24+16*8(%r6)
|
||||||
|
evstdd %r26,24+17*8(%r6)
|
||||||
|
evstdd %r27,24+18*8(%r6)
|
||||||
|
evstdd %r28,24+19*8(%r6)
|
||||||
|
evstdd %r29,24+20*8(%r6)
|
||||||
|
evstdd %r30,24+21*8(%r6)
|
||||||
|
evstdd %r31,24+22*8(%r6)
|
||||||
|
|
||||||
|
li %r3,0
|
||||||
|
blr
|
||||||
|
END(sigsetjmp)
|
||||||
|
|
||||||
|
ENTRY(siglongjmp)
|
||||||
|
|
||||||
|
/* FPRs */
|
||||||
|
evldd %r9,24+0*8(%r3)
|
||||||
|
evldd %r10,24+1*8(%r3)
|
||||||
|
evldd %r11,24+2*8(%r3)
|
||||||
|
evldd %r12,24+3*8(%r3)
|
||||||
|
evldd %r13,24+4*8(%r3)
|
||||||
|
evldd %r14,24+5*8(%r3)
|
||||||
|
evldd %r15,24+6*8(%r3)
|
||||||
|
evldd %r16,24+7*8(%r3)
|
||||||
|
evldd %r17,24+8*8(%r3)
|
||||||
|
evldd %r18,24+9*8(%r3)
|
||||||
|
evldd %r19,24+10*8(%r3)
|
||||||
|
evldd %r20,24+11*8(%r3)
|
||||||
|
evldd %r21,24+12*8(%r3)
|
||||||
|
evldd %r22,24+13*8(%r3)
|
||||||
|
evldd %r23,24+14*8(%r3)
|
||||||
|
evldd %r24,24+15*8(%r3)
|
||||||
|
evldd %r25,24+16*8(%r3)
|
||||||
|
evldd %r26,24+17*8(%r3)
|
||||||
|
evldd %r27,24+18*8(%r3)
|
||||||
|
evldd %r28,24+19*8(%r3)
|
||||||
|
evldd %r29,24+20*8(%r3)
|
||||||
|
evldd %r30,24+21*8(%r3)
|
||||||
|
evldd %r31,24+22*8(%r3)
|
||||||
|
|
||||||
|
lwz %r7,0(%r3)
|
||||||
|
mr %r6,%r4
|
||||||
|
mtlr %r11
|
||||||
|
mtcr %r12
|
||||||
|
mr %r1,%r10
|
||||||
|
or. %r7,%r7,%r7
|
||||||
|
beq 1f
|
||||||
|
mr %r4,%r3
|
||||||
|
li %r3,3 /* SIG_SETMASK */
|
||||||
|
addi %r4,%r4,4 /* &set */
|
||||||
|
li %r5,0 /* oset = NULL */
|
||||||
|
li %r0,SYS_sigprocmask /* sigprocmask(SIG_SET, &set, NULL) */
|
||||||
|
sc /* assume no error XXX */
|
||||||
|
1:
|
||||||
|
or. %r3,%r6,%r6
|
||||||
|
bnelr
|
||||||
|
li %r3,1
|
||||||
|
blr
|
||||||
|
END(siglongjmp)
|
||||||
|
|
||||||
|
.section .note.GNU-stack,"",%progbits
|
49
lib/libc/powerpcspe/softfloat/milieu.h
Normal file
49
lib/libc/powerpcspe/softfloat/milieu.h
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
/* $NetBSD: milieu.h,v 1.1 2000/12/29 20:13:54 bjh21 Exp $ */
|
||||||
|
/* $FreeBSD$ */
|
||||||
|
|
||||||
|
/*
|
||||||
|
===============================================================================
|
||||||
|
|
||||||
|
This C header file is part of the SoftFloat IEC/IEEE Floating-point
|
||||||
|
Arithmetic Package, Release 2a.
|
||||||
|
|
||||||
|
Written by John R. Hauser. This work was made possible in part by the
|
||||||
|
International Computer Science Institute, located at Suite 600, 1947 Center
|
||||||
|
Street, Berkeley, California 94704. Funding was partially provided by the
|
||||||
|
National Science Foundation under grant MIP-9311980. The original version
|
||||||
|
of this code was written as part of a project to build a fixed-point vector
|
||||||
|
processor in collaboration with the University of California at Berkeley,
|
||||||
|
overseen by Profs. Nelson Morgan and John Wawrzynek. More information
|
||||||
|
is available through the Web page `http://HTTP.CS.Berkeley.EDU/~jhauser/
|
||||||
|
arithmetic/SoftFloat.html'.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort
|
||||||
|
has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT
|
||||||
|
TIMES RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO
|
||||||
|
PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY
|
||||||
|
AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE.
|
||||||
|
|
||||||
|
Derivative works are acceptable, even for commercial purposes, so long as
|
||||||
|
(1) they include prominent notice that the work is derivative, and (2) they
|
||||||
|
include prominent notice akin to these four paragraphs for those parts of
|
||||||
|
this code that are retained.
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Include common integer types and flags.
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
#include "powerpc-gcc.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Symbolic Boolean literals.
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
enum {
|
||||||
|
FALSE = 0,
|
||||||
|
TRUE = 1
|
||||||
|
};
|
92
lib/libc/powerpcspe/softfloat/powerpc-gcc.h
Normal file
92
lib/libc/powerpcspe/softfloat/powerpc-gcc.h
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
/* $NetBSD: arm-gcc.h,v 1.2 2001/02/21 18:09:25 bjh21 Exp $ */
|
||||||
|
/* $FreeBSD$ */
|
||||||
|
|
||||||
|
/*
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
One of the macros `BIGENDIAN' or `LITTLEENDIAN' must be defined.
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
#define BIGENDIAN
|
||||||
|
|
||||||
|
/*
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
The macro `BITS64' can be defined to indicate that 64-bit integer types are
|
||||||
|
supported by the compiler.
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
#define BITS64
|
||||||
|
|
||||||
|
/*
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Each of the following `typedef's defines the most convenient type that holds
|
||||||
|
integers of at least as many bits as specified. For example, `uint8' should
|
||||||
|
be the most convenient type that can hold unsigned integers of as many as
|
||||||
|
8 bits. The `flag' type must be able to hold either a 0 or 1. For most
|
||||||
|
implementations of C, `flag', `uint8', and `int8' should all be `typedef'ed
|
||||||
|
to the same as `int'.
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
typedef int flag;
|
||||||
|
typedef unsigned int uint8;
|
||||||
|
typedef int int8;
|
||||||
|
typedef unsigned int uint16;
|
||||||
|
typedef int int16;
|
||||||
|
typedef unsigned int uint32;
|
||||||
|
typedef signed int int32;
|
||||||
|
#ifdef BITS64
|
||||||
|
typedef unsigned long long int uint64;
|
||||||
|
typedef signed long long int int64;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Each of the following `typedef's defines a type that holds integers
|
||||||
|
of _exactly_ the number of bits specified. For instance, for most
|
||||||
|
implementation of C, `bits16' and `sbits16' should be `typedef'ed to
|
||||||
|
`unsigned short int' and `signed short int' (or `short int'), respectively.
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
typedef unsigned char bits8;
|
||||||
|
typedef signed char sbits8;
|
||||||
|
typedef unsigned short int bits16;
|
||||||
|
typedef signed short int sbits16;
|
||||||
|
typedef unsigned int bits32;
|
||||||
|
typedef signed int sbits32;
|
||||||
|
#ifdef BITS64
|
||||||
|
typedef unsigned long long int bits64;
|
||||||
|
typedef signed long long int sbits64;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef BITS64
|
||||||
|
/*
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
The `LIT64' macro takes as its argument a textual integer literal and
|
||||||
|
if necessary ``marks'' the literal as having a 64-bit integer type.
|
||||||
|
For example, the GNU C Compiler (`gcc') requires that 64-bit literals be
|
||||||
|
appended with the letters `LL' standing for `long long', which is `gcc's
|
||||||
|
name for the 64-bit integer type. Some compilers may allow `LIT64' to be
|
||||||
|
defined as the identity macro: `#define LIT64( a ) a'.
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
#define LIT64( a ) a##LL
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
The macro `INLINE' can be used before functions that should be inlined. If
|
||||||
|
a compiler does not support explicit inlining, this macro should be defined
|
||||||
|
to be `static'.
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
#define INLINE static __inline
|
||||||
|
|
||||||
|
/*
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
The ARM FPA is odd in that it stores doubles high-order word first, no matter
|
||||||
|
what the endianness of the CPU. VFP is sane.
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
#if defined(SOFTFLOAT_FOR_GCC)
|
||||||
|
#define FLOAT64_DEMANGLE(a) (a)
|
||||||
|
#define FLOAT64_MANGLE(a) (a)
|
||||||
|
#endif
|
307
lib/libc/powerpcspe/softfloat/softfloat.h
Normal file
307
lib/libc/powerpcspe/softfloat/softfloat.h
Normal file
@ -0,0 +1,307 @@
|
|||||||
|
/* $NetBSD: softfloat.h,v 1.6 2002/05/12 13:12:46 bjh21 Exp $ */
|
||||||
|
/* $FreeBSD$ */
|
||||||
|
|
||||||
|
/* This is a derivative work. */
|
||||||
|
|
||||||
|
/*
|
||||||
|
===============================================================================
|
||||||
|
|
||||||
|
This C header file is part of the SoftFloat IEC/IEEE Floating-point
|
||||||
|
Arithmetic Package, Release 2a.
|
||||||
|
|
||||||
|
Written by John R. Hauser. This work was made possible in part by the
|
||||||
|
International Computer Science Institute, located at Suite 600, 1947 Center
|
||||||
|
Street, Berkeley, California 94704. Funding was partially provided by the
|
||||||
|
National Science Foundation under grant MIP-9311980. The original version
|
||||||
|
of this code was written as part of a project to build a fixed-point vector
|
||||||
|
processor in collaboration with the University of California at Berkeley,
|
||||||
|
overseen by Profs. Nelson Morgan and John Wawrzynek. More information
|
||||||
|
is available through the Web page `http://HTTP.CS.Berkeley.EDU/~jhauser/
|
||||||
|
arithmetic/SoftFloat.html'.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort
|
||||||
|
has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT
|
||||||
|
TIMES RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO
|
||||||
|
PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY
|
||||||
|
AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE.
|
||||||
|
|
||||||
|
Derivative works are acceptable, even for commercial purposes, so long as
|
||||||
|
(1) they include prominent notice that the work is derivative, and (2) they
|
||||||
|
include prominent notice akin to these four paragraphs for those parts of
|
||||||
|
this code that are retained.
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
The macro `FLOATX80' must be defined to enable the extended double-precision
|
||||||
|
floating-point format `floatx80'. If this macro is not defined, the
|
||||||
|
`floatx80' type will not be defined, and none of the functions that either
|
||||||
|
input or output the `floatx80' type will be defined. The same applies to
|
||||||
|
the `FLOAT128' macro and the quadruple-precision format `float128'.
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
/* #define FLOATX80 */
|
||||||
|
/* #define FLOAT128 */
|
||||||
|
|
||||||
|
#include <machine/ieeefp.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Software IEC/IEEE floating-point types.
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
typedef unsigned int float32;
|
||||||
|
typedef unsigned long long float64;
|
||||||
|
#ifdef FLOATX80
|
||||||
|
typedef struct {
|
||||||
|
unsigned short high;
|
||||||
|
unsigned long long low;
|
||||||
|
} floatx80;
|
||||||
|
#endif
|
||||||
|
#ifdef FLOAT128
|
||||||
|
typedef struct {
|
||||||
|
unsigned long long high, low;
|
||||||
|
} float128;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Software IEC/IEEE floating-point underflow tininess-detection mode.
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
#ifndef SOFTFLOAT_FOR_GCC
|
||||||
|
extern int8 float_detect_tininess;
|
||||||
|
#endif
|
||||||
|
enum {
|
||||||
|
float_tininess_after_rounding = 0,
|
||||||
|
float_tininess_before_rounding = 1
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Software IEC/IEEE floating-point rounding mode.
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
extern fp_rnd_t float_rounding_mode;
|
||||||
|
enum {
|
||||||
|
float_round_nearest_even = FP_RN,
|
||||||
|
float_round_to_zero = FP_RZ,
|
||||||
|
float_round_down = FP_RM,
|
||||||
|
float_round_up = FP_RP
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Software IEC/IEEE floating-point exception flags.
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
typedef fp_except_t fp_except;
|
||||||
|
|
||||||
|
extern fp_except float_exception_flags;
|
||||||
|
extern fp_except float_exception_mask;
|
||||||
|
enum {
|
||||||
|
float_flag_inexact = FP_X_IMP,
|
||||||
|
float_flag_underflow = FP_X_UFL,
|
||||||
|
float_flag_overflow = FP_X_OFL,
|
||||||
|
float_flag_divbyzero = FP_X_DZ,
|
||||||
|
float_flag_invalid = FP_X_INV
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Routine to raise any or all of the software IEC/IEEE floating-point
|
||||||
|
exception flags.
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
void float_raise( fp_except );
|
||||||
|
|
||||||
|
/*
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Software IEC/IEEE integer-to-floating-point conversion routines.
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
float32 int32_to_float32( int );
|
||||||
|
float64 int32_to_float64( int );
|
||||||
|
#ifdef FLOATX80
|
||||||
|
floatx80 int32_to_floatx80( int );
|
||||||
|
#endif
|
||||||
|
#ifdef FLOAT128
|
||||||
|
float128 int32_to_float128( int );
|
||||||
|
#endif
|
||||||
|
float32 int64_to_float32( long long );
|
||||||
|
float64 int64_to_float64( long long );
|
||||||
|
#ifdef FLOATX80
|
||||||
|
floatx80 int64_to_floatx80( long long );
|
||||||
|
#endif
|
||||||
|
#ifdef FLOAT128
|
||||||
|
float128 int64_to_float128( long long );
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Software IEC/IEEE single-precision conversion routines.
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
int float32_to_int32( float32 );
|
||||||
|
int float32_to_int32_round_to_zero( float32 );
|
||||||
|
unsigned int float32_to_uint32_round_to_zero( float32 );
|
||||||
|
long long float32_to_int64( float32 );
|
||||||
|
long long float32_to_int64_round_to_zero( float32 );
|
||||||
|
float64 float32_to_float64( float32 );
|
||||||
|
#ifdef FLOATX80
|
||||||
|
floatx80 float32_to_floatx80( float32 );
|
||||||
|
#endif
|
||||||
|
#ifdef FLOAT128
|
||||||
|
float128 float32_to_float128( float32 );
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Software IEC/IEEE single-precision operations.
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
float32 float32_round_to_int( float32 );
|
||||||
|
float32 float32_add( float32, float32 );
|
||||||
|
float32 float32_sub( float32, float32 );
|
||||||
|
float32 float32_mul( float32, float32 );
|
||||||
|
float32 float32_div( float32, float32 );
|
||||||
|
float32 float32_rem( float32, float32 );
|
||||||
|
float32 float32_sqrt( float32 );
|
||||||
|
int float32_eq( float32, float32 );
|
||||||
|
int float32_le( float32, float32 );
|
||||||
|
int float32_lt( float32, float32 );
|
||||||
|
int float32_eq_signaling( float32, float32 );
|
||||||
|
int float32_le_quiet( float32, float32 );
|
||||||
|
int float32_lt_quiet( float32, float32 );
|
||||||
|
#ifndef SOFTFLOAT_FOR_GCC
|
||||||
|
int float32_is_signaling_nan( float32 );
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Software IEC/IEEE double-precision conversion routines.
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
int float64_to_int32( float64 );
|
||||||
|
int float64_to_int32_round_to_zero( float64 );
|
||||||
|
unsigned int float64_to_uint32_round_to_zero( float64 );
|
||||||
|
long long float64_to_int64( float64 );
|
||||||
|
long long float64_to_int64_round_to_zero( float64 );
|
||||||
|
float32 float64_to_float32( float64 );
|
||||||
|
#ifdef FLOATX80
|
||||||
|
floatx80 float64_to_floatx80( float64 );
|
||||||
|
#endif
|
||||||
|
#ifdef FLOAT128
|
||||||
|
float128 float64_to_float128( float64 );
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Software IEC/IEEE double-precision operations.
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
float64 float64_round_to_int( float64 );
|
||||||
|
float64 float64_add( float64, float64 );
|
||||||
|
float64 float64_sub( float64, float64 );
|
||||||
|
float64 float64_mul( float64, float64 );
|
||||||
|
float64 float64_div( float64, float64 );
|
||||||
|
float64 float64_rem( float64, float64 );
|
||||||
|
float64 float64_sqrt( float64 );
|
||||||
|
int float64_eq( float64, float64 );
|
||||||
|
int float64_le( float64, float64 );
|
||||||
|
int float64_lt( float64, float64 );
|
||||||
|
int float64_eq_signaling( float64, float64 );
|
||||||
|
int float64_le_quiet( float64, float64 );
|
||||||
|
int float64_lt_quiet( float64, float64 );
|
||||||
|
#ifndef SOFTFLOAT_FOR_GCC
|
||||||
|
int float64_is_signaling_nan( float64 );
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef FLOATX80
|
||||||
|
|
||||||
|
/*
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Software IEC/IEEE extended double-precision conversion routines.
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
int floatx80_to_int32( floatx80 );
|
||||||
|
int floatx80_to_int32_round_to_zero( floatx80 );
|
||||||
|
long long floatx80_to_int64( floatx80 );
|
||||||
|
long long floatx80_to_int64_round_to_zero( floatx80 );
|
||||||
|
float32 floatx80_to_float32( floatx80 );
|
||||||
|
float64 floatx80_to_float64( floatx80 );
|
||||||
|
#ifdef FLOAT128
|
||||||
|
float128 floatx80_to_float128( floatx80 );
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Software IEC/IEEE extended double-precision rounding precision. Valid
|
||||||
|
values are 32, 64, and 80.
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
extern int floatx80_rounding_precision;
|
||||||
|
|
||||||
|
/*
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Software IEC/IEEE extended double-precision operations.
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
floatx80 floatx80_round_to_int( floatx80 );
|
||||||
|
floatx80 floatx80_add( floatx80, floatx80 );
|
||||||
|
floatx80 floatx80_sub( floatx80, floatx80 );
|
||||||
|
floatx80 floatx80_mul( floatx80, floatx80 );
|
||||||
|
floatx80 floatx80_div( floatx80, floatx80 );
|
||||||
|
floatx80 floatx80_rem( floatx80, floatx80 );
|
||||||
|
floatx80 floatx80_sqrt( floatx80 );
|
||||||
|
int floatx80_eq( floatx80, floatx80 );
|
||||||
|
int floatx80_le( floatx80, floatx80 );
|
||||||
|
int floatx80_lt( floatx80, floatx80 );
|
||||||
|
int floatx80_eq_signaling( floatx80, floatx80 );
|
||||||
|
int floatx80_le_quiet( floatx80, floatx80 );
|
||||||
|
int floatx80_lt_quiet( floatx80, floatx80 );
|
||||||
|
int floatx80_is_signaling_nan( floatx80 );
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef FLOAT128
|
||||||
|
|
||||||
|
/*
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Software IEC/IEEE quadruple-precision conversion routines.
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
int float128_to_int32( float128 );
|
||||||
|
int float128_to_int32_round_to_zero( float128 );
|
||||||
|
long long float128_to_int64( float128 );
|
||||||
|
long long float128_to_int64_round_to_zero( float128 );
|
||||||
|
float32 float128_to_float32( float128 );
|
||||||
|
float64 float128_to_float64( float128 );
|
||||||
|
#ifdef FLOATX80
|
||||||
|
floatx80 float128_to_floatx80( float128 );
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Software IEC/IEEE quadruple-precision operations.
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
float128 float128_round_to_int( float128 );
|
||||||
|
float128 float128_add( float128, float128 );
|
||||||
|
float128 float128_sub( float128, float128 );
|
||||||
|
float128 float128_mul( float128, float128 );
|
||||||
|
float128 float128_div( float128, float128 );
|
||||||
|
float128 float128_rem( float128, float128 );
|
||||||
|
float128 float128_sqrt( float128 );
|
||||||
|
int float128_eq( float128, float128 );
|
||||||
|
int float128_le( float128, float128 );
|
||||||
|
int float128_lt( float128, float128 );
|
||||||
|
int float128_eq_signaling( float128, float128 );
|
||||||
|
int float128_le_quiet( float128, float128 );
|
||||||
|
int float128_lt_quiet( float128, float128 );
|
||||||
|
int float128_is_signaling_nan( float128 );
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
4
lib/libc/powerpcspe/sys/Makefile.inc
Normal file
4
lib/libc/powerpcspe/sys/Makefile.inc
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
# $FreeBSD$
|
||||||
|
|
||||||
|
.PATH: ${LIBC_SRCTOP}/powerpc/sys
|
||||||
|
.sinclude "${LIBC_SRCTOP}/powerpc/sys/Makefile.inc"
|
@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include "namespace.h"
|
#include "namespace.h"
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
#include <limits.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -55,6 +56,12 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include "un-namespace.h"
|
#include "un-namespace.h"
|
||||||
#include "printflocal.h"
|
#include "printflocal.h"
|
||||||
|
|
||||||
|
#ifdef NL_ARGMAX
|
||||||
|
#define MAX_POSARG NL_ARGMAX
|
||||||
|
#else
|
||||||
|
#define MAX_POSARG 65536
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Type ids for argument type table.
|
* Type ids for argument type table.
|
||||||
*/
|
*/
|
||||||
@ -70,9 +77,9 @@ enum typeid {
|
|||||||
struct typetable {
|
struct typetable {
|
||||||
enum typeid *table; /* table of types */
|
enum typeid *table; /* table of types */
|
||||||
enum typeid stattable[STATIC_ARG_TBL_SIZE];
|
enum typeid stattable[STATIC_ARG_TBL_SIZE];
|
||||||
int tablesize; /* current size of type table */
|
u_int tablesize; /* current size of type table */
|
||||||
int tablemax; /* largest used index in table */
|
u_int tablemax; /* largest used index in table */
|
||||||
int nextarg; /* 1-based argument index */
|
u_int nextarg; /* 1-based argument index */
|
||||||
};
|
};
|
||||||
|
|
||||||
static int __grow_type_table(struct typetable *);
|
static int __grow_type_table(struct typetable *);
|
||||||
@ -84,7 +91,7 @@ static void build_arg_table (struct typetable *, va_list, union arg **);
|
|||||||
static inline void
|
static inline void
|
||||||
inittypes(struct typetable *types)
|
inittypes(struct typetable *types)
|
||||||
{
|
{
|
||||||
int n;
|
u_int n;
|
||||||
|
|
||||||
types->table = types->stattable;
|
types->table = types->stattable;
|
||||||
types->tablesize = STATIC_ARG_TBL_SIZE;
|
types->tablesize = STATIC_ARG_TBL_SIZE;
|
||||||
@ -185,7 +192,7 @@ static inline int
|
|||||||
addaster(struct typetable *types, char **fmtp)
|
addaster(struct typetable *types, char **fmtp)
|
||||||
{
|
{
|
||||||
char *cp;
|
char *cp;
|
||||||
int n2;
|
u_int n2;
|
||||||
|
|
||||||
n2 = 0;
|
n2 = 0;
|
||||||
cp = *fmtp;
|
cp = *fmtp;
|
||||||
@ -194,7 +201,7 @@ addaster(struct typetable *types, char **fmtp)
|
|||||||
cp++;
|
cp++;
|
||||||
}
|
}
|
||||||
if (*cp == '$') {
|
if (*cp == '$') {
|
||||||
int hold = types->nextarg;
|
u_int hold = types->nextarg;
|
||||||
types->nextarg = n2;
|
types->nextarg = n2;
|
||||||
if (addtype(types, T_INT))
|
if (addtype(types, T_INT))
|
||||||
return (-1);
|
return (-1);
|
||||||
@ -211,7 +218,7 @@ static inline int
|
|||||||
addwaster(struct typetable *types, wchar_t **fmtp)
|
addwaster(struct typetable *types, wchar_t **fmtp)
|
||||||
{
|
{
|
||||||
wchar_t *cp;
|
wchar_t *cp;
|
||||||
int n2;
|
u_int n2;
|
||||||
|
|
||||||
n2 = 0;
|
n2 = 0;
|
||||||
cp = *fmtp;
|
cp = *fmtp;
|
||||||
@ -220,7 +227,7 @@ addwaster(struct typetable *types, wchar_t **fmtp)
|
|||||||
cp++;
|
cp++;
|
||||||
}
|
}
|
||||||
if (*cp == '$') {
|
if (*cp == '$') {
|
||||||
int hold = types->nextarg;
|
u_int hold = types->nextarg;
|
||||||
types->nextarg = n2;
|
types->nextarg = n2;
|
||||||
if (addtype(types, T_INT))
|
if (addtype(types, T_INT))
|
||||||
return (-1);
|
return (-1);
|
||||||
@ -245,7 +252,7 @@ __find_arguments (const char *fmt0, va_list ap, union arg **argtable)
|
|||||||
{
|
{
|
||||||
char *fmt; /* format string */
|
char *fmt; /* format string */
|
||||||
int ch; /* character from fmt */
|
int ch; /* character from fmt */
|
||||||
int n; /* handy integer (short term usage) */
|
u_int n; /* handy integer (short term usage) */
|
||||||
int error;
|
int error;
|
||||||
int flags; /* flags as above */
|
int flags; /* flags as above */
|
||||||
struct typetable types; /* table of types */
|
struct typetable types; /* table of types */
|
||||||
@ -296,6 +303,11 @@ reswitch: switch (ch) {
|
|||||||
n = 0;
|
n = 0;
|
||||||
do {
|
do {
|
||||||
n = 10 * n + to_digit(ch);
|
n = 10 * n + to_digit(ch);
|
||||||
|
/* Detect overflow */
|
||||||
|
if (n > MAX_POSARG) {
|
||||||
|
error = -1;
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
ch = *fmt++;
|
ch = *fmt++;
|
||||||
} while (is_digit(ch));
|
} while (is_digit(ch));
|
||||||
if (ch == '$') {
|
if (ch == '$') {
|
||||||
@ -433,7 +445,7 @@ __find_warguments (const wchar_t *fmt0, va_list ap, union arg **argtable)
|
|||||||
{
|
{
|
||||||
wchar_t *fmt; /* format string */
|
wchar_t *fmt; /* format string */
|
||||||
wchar_t ch; /* character from fmt */
|
wchar_t ch; /* character from fmt */
|
||||||
int n; /* handy integer (short term usage) */
|
u_int n; /* handy integer (short term usage) */
|
||||||
int error;
|
int error;
|
||||||
int flags; /* flags as above */
|
int flags; /* flags as above */
|
||||||
struct typetable types; /* table of types */
|
struct typetable types; /* table of types */
|
||||||
@ -484,6 +496,11 @@ reswitch: switch (ch) {
|
|||||||
n = 0;
|
n = 0;
|
||||||
do {
|
do {
|
||||||
n = 10 * n + to_digit(ch);
|
n = 10 * n + to_digit(ch);
|
||||||
|
/* Detect overflow */
|
||||||
|
if (n > MAX_POSARG) {
|
||||||
|
error = -1;
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
ch = *fmt++;
|
ch = *fmt++;
|
||||||
} while (is_digit(ch));
|
} while (is_digit(ch));
|
||||||
if (ch == '$') {
|
if (ch == '$') {
|
||||||
@ -624,7 +641,11 @@ __grow_type_table(struct typetable *types)
|
|||||||
enum typeid *const oldtable = types->table;
|
enum typeid *const oldtable = types->table;
|
||||||
const int oldsize = types->tablesize;
|
const int oldsize = types->tablesize;
|
||||||
enum typeid *newtable;
|
enum typeid *newtable;
|
||||||
int n, newsize = oldsize * 2;
|
u_int n, newsize = oldsize * 2;
|
||||||
|
|
||||||
|
/* Detect overflow */
|
||||||
|
if (types->nextarg > NL_ARGMAX)
|
||||||
|
return (-1);
|
||||||
|
|
||||||
if (newsize < types->nextarg + 1)
|
if (newsize < types->nextarg + 1)
|
||||||
newsize = types->nextarg + 1;
|
newsize = types->nextarg + 1;
|
||||||
@ -653,7 +674,7 @@ __grow_type_table(struct typetable *types)
|
|||||||
static void
|
static void
|
||||||
build_arg_table(struct typetable *types, va_list ap, union arg **argtable)
|
build_arg_table(struct typetable *types, va_list ap, union arg **argtable)
|
||||||
{
|
{
|
||||||
int n;
|
u_int n;
|
||||||
|
|
||||||
if (types->tablemax >= STATIC_ARG_TBL_SIZE) {
|
if (types->tablemax >= STATIC_ARG_TBL_SIZE) {
|
||||||
*argtable = (union arg *)
|
*argtable = (union arg *)
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
.\"
|
.\"
|
||||||
.\" $FreeBSD$
|
.\" $FreeBSD$
|
||||||
.\"
|
.\"
|
||||||
.Dd October 5, 2016
|
.Dd October 21, 2016
|
||||||
.Dt CAPSICUM_HELPERS 3
|
.Dt CAPSICUM_HELPERS 3
|
||||||
.Os
|
.Os
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
@ -57,7 +57,8 @@
|
|||||||
.Sh DESCRIPTION
|
.Sh DESCRIPTION
|
||||||
The
|
The
|
||||||
.Nm capsicum helpers
|
.Nm capsicum helpers
|
||||||
are a set of a inline functions which simplify Capsicumizing programs.
|
are a set of a inline functions which simplify modifying programs to use
|
||||||
|
Capsicum.
|
||||||
The goal is to reduce duplicated code patterns.
|
The goal is to reduce duplicated code patterns.
|
||||||
The
|
The
|
||||||
.Nm capsicum helpers
|
.Nm capsicum helpers
|
||||||
@ -70,7 +71,7 @@ restricts capabilities on
|
|||||||
.Fa fd
|
.Fa fd
|
||||||
to only those needed by POSIX stream objects (that is, FILEs).
|
to only those needed by POSIX stream objects (that is, FILEs).
|
||||||
.Pp
|
.Pp
|
||||||
The following flags can be provided:
|
These flags can be provided:
|
||||||
.Pp
|
.Pp
|
||||||
.Bl -tag -width "CAPH_IGNORE_EBADF" -compact -offset indent
|
.Bl -tag -width "CAPH_IGNORE_EBADF" -compact -offset indent
|
||||||
.It Dv CAPH_IGNORE_EBADF
|
.It Dv CAPH_IGNORE_EBADF
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
# $FreeBSD$
|
# $FreeBSD$
|
||||||
|
|
||||||
|
SHLIBDIR?= /lib/casper
|
||||||
|
|
||||||
.include <src.opts.mk>
|
.include <src.opts.mk>
|
||||||
|
|
||||||
PACKAGE=libcasper
|
PACKAGE=libcasper
|
||||||
LIB= cap_dns
|
LIB= cap_dns
|
||||||
|
|
||||||
SHLIB_MAJOR= 0
|
SHLIB_MAJOR= 0
|
||||||
SHLIBDIR?= /lib/casper
|
|
||||||
INCSDIR?= ${INCLUDEDIR}/casper
|
INCSDIR?= ${INCLUDEDIR}/casper
|
||||||
|
|
||||||
SRCS= cap_dns.c
|
SRCS= cap_dns.c
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
# $FreeBSD$
|
# $FreeBSD$
|
||||||
|
|
||||||
|
SHLIBDIR?= /lib/casper
|
||||||
|
|
||||||
.include <src.opts.mk>
|
.include <src.opts.mk>
|
||||||
|
|
||||||
PACKAGE=libcasper
|
PACKAGE=libcasper
|
||||||
LIB= cap_grp
|
LIB= cap_grp
|
||||||
|
|
||||||
SHLIB_MAJOR= 0
|
SHLIB_MAJOR= 0
|
||||||
SHLIBDIR?= /lib/casper
|
|
||||||
INCSDIR?= ${INCLUDEDIR}/casper
|
INCSDIR?= ${INCLUDEDIR}/casper
|
||||||
|
|
||||||
SRCS= cap_grp.c
|
SRCS= cap_grp.c
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
# $FreeBSD$
|
# $FreeBSD$
|
||||||
|
|
||||||
|
SHLIBDIR?= /lib/casper
|
||||||
|
|
||||||
.include <src.opts.mk>
|
.include <src.opts.mk>
|
||||||
|
|
||||||
PACKAGE=libcasper
|
PACKAGE=libcasper
|
||||||
LIB= cap_pwd
|
LIB= cap_pwd
|
||||||
|
|
||||||
SHLIB_MAJOR= 0
|
SHLIB_MAJOR= 0
|
||||||
SHLIBDIR?= /lib/casper
|
|
||||||
INCSDIR?= ${INCLUDEDIR}/casper
|
INCSDIR?= ${INCLUDEDIR}/casper
|
||||||
|
|
||||||
SRCS= cap_pwd.c
|
SRCS= cap_pwd.c
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
# $FreeBSD$
|
# $FreeBSD$
|
||||||
|
|
||||||
|
SHLIBDIR?= /lib/casper
|
||||||
|
|
||||||
.include <src.opts.mk>
|
.include <src.opts.mk>
|
||||||
|
|
||||||
PACKAGE=libcasper
|
PACKAGE=libcasper
|
||||||
LIB= cap_sysctl
|
LIB= cap_sysctl
|
||||||
|
|
||||||
SHLIB_MAJOR= 0
|
SHLIB_MAJOR= 0
|
||||||
SHLIBDIR?= /lib/casper
|
|
||||||
INCSDIR?= ${INCLUDEDIR}/casper
|
INCSDIR?= ${INCLUDEDIR}/casper
|
||||||
|
|
||||||
SRCS= cap_sysctl.c
|
SRCS= cap_sysctl.c
|
||||||
|
@ -4,19 +4,24 @@ COMPILERRTDIR= ${SRCTOP}/contrib/compiler-rt
|
|||||||
UNWINDINCDIR= ${SRCTOP}/contrib/llvm/projects/libunwind/include
|
UNWINDINCDIR= ${SRCTOP}/contrib/llvm/projects/libunwind/include
|
||||||
UNWINDSRCDIR= ${SRCTOP}/contrib/llvm/projects/libunwind/src
|
UNWINDSRCDIR= ${SRCTOP}/contrib/llvm/projects/libunwind/src
|
||||||
|
|
||||||
CFLAGS+=${PICFLAG} -fvisibility=hidden -DVISIBILITY_HIDDEN
|
STATIC_CFLAGS+=${PICFLAG} -fvisibility=hidden -DVISIBILITY_HIDDEN
|
||||||
|
|
||||||
.PATH: ${COMPILERRTDIR}/lib/builtins
|
.PATH: ${COMPILERRTDIR}/lib/builtins
|
||||||
.PATH: ${UNWINDSRCDIR}
|
.PATH: ${UNWINDSRCDIR}
|
||||||
SRCS+= gcc_personality_v0.c
|
SRCS_EXC+= gcc_personality_v0.c
|
||||||
SRCS+= int_util.c
|
SRCS_EXC+= int_util.c
|
||||||
SRCS+= Unwind-EHABI.cpp
|
SRCS_EXC+= Unwind-EHABI.cpp
|
||||||
SRCS+= Unwind-sjlj.c
|
SRCS_EXC+= Unwind-sjlj.c
|
||||||
SRCS+= UnwindLevel1-gcc-ext.c
|
SRCS_EXC+= UnwindLevel1-gcc-ext.c
|
||||||
SRCS+= UnwindLevel1.c
|
SRCS_EXC+= UnwindLevel1.c
|
||||||
SRCS+= UnwindRegistersRestore.S
|
SRCS_EXC+= UnwindRegistersRestore.S
|
||||||
SRCS+= UnwindRegistersSave.S
|
SRCS_EXC+= UnwindRegistersSave.S
|
||||||
SRCS+= libunwind.cpp
|
SRCS_EXC+= libunwind.cpp
|
||||||
|
|
||||||
|
SRCS+= ${SRCS_EXC}
|
||||||
|
.for file in ${SRCS_EXC:M*.c}
|
||||||
|
CFLAGS.${file}+= -fexceptions
|
||||||
|
.endfor
|
||||||
|
|
||||||
CFLAGS+= -I${UNWINDINCDIR} -I${.CURDIR} -D_LIBUNWIND_IS_NATIVE_ONLY
|
CFLAGS+= -I${UNWINDINCDIR} -I${.CURDIR} -D_LIBUNWIND_IS_NATIVE_ONLY
|
||||||
.if empty(CXXFLAGS:M-std=*)
|
.if empty(CXXFLAGS:M-std=*)
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
PKG= clibs
|
PKG= clibs
|
||||||
SHLIB_NAME= libgcc_s.so.1
|
SHLIB_NAME= libgcc_s.so.1
|
||||||
|
SHLIBDIR?= /lib
|
||||||
|
|
||||||
WARNS?= 2
|
WARNS?= 2
|
||||||
|
|
||||||
|
@ -35,11 +35,13 @@
|
|||||||
|
|
||||||
#include_next <sys/cdefs.h>
|
#include_next <sys/cdefs.h>
|
||||||
|
|
||||||
|
#ifndef __dead
|
||||||
#ifdef __dead2
|
#ifdef __dead2
|
||||||
#define __dead __dead2
|
#define __dead __dead2
|
||||||
#else
|
#else
|
||||||
#define __dead
|
#define __dead
|
||||||
#endif
|
#endif
|
||||||
|
#endif /* !__dead */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The __CONCAT macro is used to concatenate parts of symbol names, e.g.
|
* The __CONCAT macro is used to concatenate parts of symbol names, e.g.
|
||||||
|
@ -36,7 +36,8 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <util.h>
|
|
||||||
|
#include "util.h"
|
||||||
|
|
||||||
char *
|
char *
|
||||||
flags_to_string(u_long flags, const char *def)
|
flags_to_string(u_long flags, const char *def)
|
||||||
|
@ -68,6 +68,14 @@ __FBSDID("$FreeBSD$");
|
|||||||
#error "Add support for your architecture"
|
#error "Add support for your architecture"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Use 4-bytes holder for breakpoint instruction on all the platforms.
|
||||||
|
* Works for x86 as well until it is endian-little platform.
|
||||||
|
* (We are coping one byte only on x86 from this 4-bytes piece of
|
||||||
|
* memory).
|
||||||
|
*/
|
||||||
|
typedef uint32_t instr_t;
|
||||||
|
|
||||||
static int
|
static int
|
||||||
proc_stop(struct proc_handle *phdl)
|
proc_stop(struct proc_handle *phdl)
|
||||||
{
|
{
|
||||||
@ -92,8 +100,9 @@ proc_bkptset(struct proc_handle *phdl, uintptr_t address,
|
|||||||
unsigned long *saved)
|
unsigned long *saved)
|
||||||
{
|
{
|
||||||
struct ptrace_io_desc piod;
|
struct ptrace_io_desc piod;
|
||||||
unsigned long paddr, caddr;
|
unsigned long caddr;
|
||||||
int ret = 0, stopped;
|
int ret = 0, stopped;
|
||||||
|
instr_t instr;
|
||||||
|
|
||||||
*saved = 0;
|
*saved = 0;
|
||||||
if (phdl->status == PS_DEAD || phdl->status == PS_UNDEAD ||
|
if (phdl->status == PS_DEAD || phdl->status == PS_UNDEAD ||
|
||||||
@ -115,10 +124,10 @@ proc_bkptset(struct proc_handle *phdl, uintptr_t address,
|
|||||||
* Read the original instruction.
|
* Read the original instruction.
|
||||||
*/
|
*/
|
||||||
caddr = address;
|
caddr = address;
|
||||||
paddr = 0;
|
instr = 0;
|
||||||
piod.piod_op = PIOD_READ_I;
|
piod.piod_op = PIOD_READ_I;
|
||||||
piod.piod_offs = (void *)caddr;
|
piod.piod_offs = (void *)caddr;
|
||||||
piod.piod_addr = &paddr;
|
piod.piod_addr = &instr;
|
||||||
piod.piod_len = BREAKPOINT_INSTR_SZ;
|
piod.piod_len = BREAKPOINT_INSTR_SZ;
|
||||||
if (ptrace(PT_IO, proc_getpid(phdl), (caddr_t)&piod, 0) < 0) {
|
if (ptrace(PT_IO, proc_getpid(phdl), (caddr_t)&piod, 0) < 0) {
|
||||||
DPRINTF("ERROR: couldn't read instruction at address 0x%"
|
DPRINTF("ERROR: couldn't read instruction at address 0x%"
|
||||||
@ -126,15 +135,15 @@ proc_bkptset(struct proc_handle *phdl, uintptr_t address,
|
|||||||
ret = -1;
|
ret = -1;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
*saved = paddr;
|
*saved = instr;
|
||||||
/*
|
/*
|
||||||
* Write a breakpoint instruction to that address.
|
* Write a breakpoint instruction to that address.
|
||||||
*/
|
*/
|
||||||
caddr = address;
|
caddr = address;
|
||||||
paddr = BREAKPOINT_INSTR;
|
instr = BREAKPOINT_INSTR;
|
||||||
piod.piod_op = PIOD_WRITE_I;
|
piod.piod_op = PIOD_WRITE_I;
|
||||||
piod.piod_offs = (void *)caddr;
|
piod.piod_offs = (void *)caddr;
|
||||||
piod.piod_addr = &paddr;
|
piod.piod_addr = &instr;
|
||||||
piod.piod_len = BREAKPOINT_INSTR_SZ;
|
piod.piod_len = BREAKPOINT_INSTR_SZ;
|
||||||
if (ptrace(PT_IO, proc_getpid(phdl), (caddr_t)&piod, 0) < 0) {
|
if (ptrace(PT_IO, proc_getpid(phdl), (caddr_t)&piod, 0) < 0) {
|
||||||
DPRINTF("ERROR: couldn't write instruction at address 0x%"
|
DPRINTF("ERROR: couldn't write instruction at address 0x%"
|
||||||
@ -156,8 +165,9 @@ proc_bkptdel(struct proc_handle *phdl, uintptr_t address,
|
|||||||
unsigned long saved)
|
unsigned long saved)
|
||||||
{
|
{
|
||||||
struct ptrace_io_desc piod;
|
struct ptrace_io_desc piod;
|
||||||
unsigned long paddr, caddr;
|
unsigned long caddr;
|
||||||
int ret = 0, stopped;
|
int ret = 0, stopped;
|
||||||
|
instr_t instr;
|
||||||
|
|
||||||
if (phdl->status == PS_DEAD || phdl->status == PS_UNDEAD ||
|
if (phdl->status == PS_DEAD || phdl->status == PS_UNDEAD ||
|
||||||
phdl->status == PS_IDLE) {
|
phdl->status == PS_IDLE) {
|
||||||
@ -178,10 +188,10 @@ proc_bkptdel(struct proc_handle *phdl, uintptr_t address,
|
|||||||
* Overwrite the breakpoint instruction that we setup previously.
|
* Overwrite the breakpoint instruction that we setup previously.
|
||||||
*/
|
*/
|
||||||
caddr = address;
|
caddr = address;
|
||||||
paddr = saved;
|
instr = saved;
|
||||||
piod.piod_op = PIOD_WRITE_I;
|
piod.piod_op = PIOD_WRITE_I;
|
||||||
piod.piod_offs = (void *)caddr;
|
piod.piod_offs = (void *)caddr;
|
||||||
piod.piod_addr = &paddr;
|
piod.piod_addr = &instr;
|
||||||
piod.piod_len = BREAKPOINT_INSTR_SZ;
|
piod.piod_len = BREAKPOINT_INSTR_SZ;
|
||||||
if (ptrace(PT_IO, proc_getpid(phdl), (caddr_t)&piod, 0) < 0) {
|
if (ptrace(PT_IO, proc_getpid(phdl), (caddr_t)&piod, 0) < 0) {
|
||||||
DPRINTF("ERROR: couldn't write instruction at address 0x%"
|
DPRINTF("ERROR: couldn't write instruction at address 0x%"
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user