summaryrefslogtreecommitdiff
path: root/lib/libc/sparc64
Commit message (Collapse)AuthorAgeFilesLines
* Remove sparc64 specific parts of libc.Warner Losh2020-02-2655-5751/+0
| | | | | | | | | | | | | | | Also update comments for which architectures use 128 bit long doubles, as appropriate. The softfloat specialization routines weren't updated since they appear to be from an upstream source which we may want to update in the future to get a more favorable license. Reviewed by: emaste@ Differential Revision: https://reviews.freebsd.org/D23658 Notes: svn path=/head/; revision=358348
* Fix initial exec TLS mode for dynamically loaded shared objects.Konstantin Belousov2019-03-291-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | If dso uses initial exec TLS mode, rtld tries to allocate TLS in static space. If there is no space left, the dlopen(3) fails. If space if allocated, initial content from PT_TLS segment is distributed to all threads' pcbs, which was missed and caused un-initialized TLS segment for such dso after dlopen(3). The mode is auto-detected either due to the relocation used, or if the DF_STATIC_TLS dynamic flag is set. In the later case, the TLS segment is tried to allocate earlier, which increases chance of the dlopen(3) to succeed. LLD was recently fixed to properly emit the flag, ld.bdf did it always. Initial test by: dumbbell Tested by: emaste (amd64), ian (arm) Tested by: Gerald Aryeetey <aryeeteygerald_rogers.com> (arm64) Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D19072 Notes: svn path=/head/; revision=345703
* Remove MD __sys_* private symbols.Brooks Davis2018-12-051-5/+0
| | | | | | | | | | | | | No references to any of these exist in the tree. The list was also erratic with different architectures exporting different things (arm64 and riscv exported none). Reviewed by: kib Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D18425 Notes: svn path=/head/; revision=341509
* Reimplement brk() and sbrk() to avoid the use of _end.Mark Johnston2018-06-044-138/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Previously, libc.so would initialize its notion of the break address using _end, a special symbol emitted by the static linker following the bss section. Compatibility issues between lld and ld.bfd could cause the wrong definition of _end (libc.so's definition rather than that of the executable) to be used, breaking the brk()/sbrk() interface. Avoid this problem and future interoperability issues by simply not relying on _end. Instead, modify the break() system call to return the kernel's view of the current break address, and have libc initialize its state using an extra syscall upon the first use of the interface. As a side effect, this appears to fix brk()/sbrk() usage in executables run with rtld direct exec, since the kernel and libc.so no longer maintain separate views of the process' break address. PR: 228574 Reviewed by: kib (previous version) MFC after: 2 months Differential Revision: https://reviews.freebsd.org/D15663 Notes: svn path=/head/; revision=334626
* Replace MD assembly exect() with a portable version.Brooks Davis2018-04-123-55/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Originally, on the VAX exect() enable tracing once the new executable image was loaded. This was possible because tracing was controllable through user space code by setting the PSL_T flag. The following instruction is a system call that activated tracing (as all instructions do) by copying PSL_T to PSL_TP (trace pending). The first instruction of the new executable image would trigger a trace fault. This is not portable to all platforms and the behavior was replaced with ptrace(PT_TRACE_ME, ...) since FreeBSD forked off of the CSRG repository. Platforms either incorrectly call execve(), trigger trace faults inside the original executable, or do contain an implementation of this function. The exect() interfaces is deprecated or removed on NetBSD and OpenBSD. Submitted by: Ali Mashtizadeh <ali@mashtizadeh.com> Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D14989 Notes: svn path=/head/; revision=332443
* Remove caching from getlogin(2).Brooks Davis2018-04-062-56/+1
| | | | | | | | | | | | | | | | This caching has existed since the CSRG import, but serves no obvious purpose. Sure, setlogin() is called rarely, but calls to getlogin() should also be infrequent. The required invalidation was not implemented on aarch64, arm, mips, amd riscv so updates would never occur if getlogin() was called before setlogin(). Reported by: Ali Mashtizadeh <ali@mashtizadeh.com> Reviewed by: kib Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14965 Notes: svn path=/head/; revision=332119
* o Let rtld(1) set up psABI user trap handlers prior to executing theMarius Strobl2018-02-031-5/+3
| | | | | | | | | | | | | | | | | objects' init functions instead of doing the setup via a constructor in libc as the init functions may already depend on these handlers to be in place. This gets us rid of: - the undefined order in which libc constructors as __guard_setup() and jemalloc_constructor() are executed WRT __sparc_utrap_setup(), - the requirement to link libc last so __sparc_utrap_setup() gets called prior to constructors in other libraries (see r122883). For static binaries, crt1.o still sets up the user trap handlers. o Move misplaced prototypes for MD functions in to the MD prototype section of rtld.h. o Sprinkle nitems(). Notes: svn path=/head/; revision=328834
* lib: Fix several typos and minor errorsEitan Adler2017-12-271-1/+1
| | | | | | | | | | | - duplicate words - typos - references to old versions of FreeBSD Reviewed by: imp, benno Notes: svn path=/head/; revision=327232
* libc: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-2514-0/+28
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using mis-identified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326193
* General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-206-5/+17
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326025
* Correct an misunderstanding of MDSRCS.Brooks Davis2017-03-021-1/+1
| | | | | | | | | | | | | | | MDSRCS it intended to allow assembly versions of funtions with C implementations listed in MISRCS. The selection of the correct machdep_ldis?.c for a given architecture does not follow this pattern and the file should be added to SRCS directly. Reviewed by: emaste, imp, jhb MFC after: 1 week Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D9841 Notes: svn path=/head/; revision=314557
* Correct MDSRCS use in <arch>/string/Makefile.inc.Brooks Davis2017-03-021-1/+0
| | | | | | | | | | | | | | | | - Remove .c files which duplicate entries in MISRCS. - Use the same, less merge conflict prone style in all cases. - Use MDSRCS for mips (.c and .S files both ended up in SRCS). - Remove pointless sparc64 Makefile.inc. - Remove uninformative foreign VCS ID entries. Reviewed by: emaste, imp, jhb MFC after: 1 week Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D9841 Notes: svn path=/head/; revision=314556
* Renumber copyright clause 4Warner Losh2017-02-2820-20/+20
| | | | | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96 Notes: svn path=/head/; revision=314436
* Reduce duplicate NOASM and PSEUDO definitionsBrooks Davis2016-09-081-5/+0
| | | | | | | | | | | | | | | | The initial value of NOASM is nearly the same in all cases and the initial value of PSEUDO is the same in all cases so reduce duplication (and hopefully, future merge conflicts) by machine independent defaults. Also document the PSEUDO variable. Reviewed by: jhb, kib Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D7820 Notes: svn path=/head/; revision=305630
* Rewrite ptrace(2) wrappers in C.Konstantin Belousov2016-08-292-58/+1
| | | | | | | | | | | | | Besides removing hand-translation to assembler, this also adds missing wrappers for arm64 and risc-v. Reviewed by: emaste, jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D7694 Notes: svn path=/head/; revision=305012
* Remove unusedd and obsolete openbsd_poll system call. (Phase 1)George V. Neville-Neil2016-08-181-1/+1
| | | | | | | | | Reported by: brooks Reviewed by: brooks,jhb Differential Revision: https://reviews.freebsd.org/D7548 Notes: svn path=/head/; revision=304395
* Replace use of the pipe(2) system call with pipe2(2) with a zero flagsBrooks Davis2016-06-222-58/+1
| | | | | | | | | | | | | | | | | | | value. This eliminates the need for machine dependant assembly wrappers for pipe(2). It also make passing an invalid address to pipe(2) return EFAULT rather than triggering a segfault. Document this behavior (which was already true for pipe2(2), but undocumented). Reviewed by: andrew Approved by: re (gjb) Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D6815 Notes: svn path=/head/; revision=302092
* libc: spelling fixes.Pedro F. Giffuni2016-04-301-1/+1
| | | | | | | Mostly on comments. Notes: svn path=/head/; revision=298830
* libc: stop exporting cerrorEd Maste2016-03-301-1/+0
| | | | | | | | | | | | | i386 stopped exporting .cerror in r240152, and likewise for amd64 in r240178. It is not used by other libraries on any platform, so apply the same change to the remaining architectures. Reviewed by: jhibbits, jilles Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5774 Notes: svn path=/head/; revision=297418
* libc: stop exporting curbrk and minbrk in the private namespaceEd Maste2016-03-241-2/+0
| | | | | | | | | | | | They are not used anywhere else in the base system and are an internal implementation detail that does not need to be exposed. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5728 Notes: svn path=/head/; revision=297238
* Fix unused-but-set-variableBaptiste Daroussin2015-11-151-1/+1
| | | | | | | Spotted by: gcc 5.2 Notes: svn path=/head/; revision=290883
* Add include for declaration of _set_tp(). Eliminates -Wmissing-prototypes ↵Craig Rodrigues2015-09-201-0/+1
| | | | | | | warnings. Notes: svn path=/head/; revision=288019
* The lseek(2), mmap(2), truncate(2), ftruncate(2), pread(2), andKonstantin Belousov2015-04-181-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | pwrite(2) syscalls are wrapped to provide compatibility with pre-7.x kernels which required padding before the off_t parameter. The fcntl(2) contains compatibility code to handle kernels before the struct flock was changed during the 8.x CURRENT development. The shims were reasonable to allow easier revert to the older kernel at that time. Now, two or three major releases later, shims do not serve any purpose. Such old kernels cannot handle current libc, so revert the compatibility code. Make padded syscalls support conditional under the COMPAT6 config option. For COMPAT32, the syscalls were under COMPAT6 already. Remove WITHOUT_SYSCALL_COMPAT build option, which only purpose was to (partially) disable the removed shims. Reviewed by: jhb, imp (previous versions) Discussed with: peter Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=281714
* libc: Eliminate duplicate copies of __vdso_gettc.cEd Maste2015-04-022-49/+1
| | | | | | | | Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D2152 Notes: svn path=/head/; revision=281004
* Unbreak sparc64 after r276630 by calling __sparc_sigtramp_setup signalMarius Strobl2015-02-162-3/+4
| | | | | | | | | | trampoline as part of the MD __sys_sigaction again. Submitted by: kib (initial versions) MFC after: 3 days Notes: svn path=/head/; revision=278870
* Remove duplicate copies of trivial getcontextx.cEd Maste2015-01-122-78/+3
| | | | | | | | | | | | | Only i386 and amd64 provide a non-trivial __getcontextx(). Use a common trivial implementation in gen/ for other architectures, rather than copying the file to each MD subdirectory. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D1472 Notes: svn path=/head/; revision=277078
* Convert from WITHOUT_SYSCALL_COMPAT to MK_SYSCALL_COMPAT.Warner Losh2014-04-051-1/+1
| | | | Notes: svn path=/head/; revision=264155
* Replace use of ${.CURDIR} by ${LIBC_SRCTOP} and define ${LIBC_SRCTOP}Marcel Moolenaar2014-03-043-4/+4
| | | | | | | | | | | | | | if not already defined. This allows building libc from outside of lib/libc using a reach-over makefile. A typical use-case is to build a standard ILP32 version and a COMPAT32 version in a single iteration by building the COMPAT32 version using a reach-over makefile. Obtained from: Juniper Networks, Inc. Notes: svn path=/head/; revision=262722
* In lib/libc/sparc64/sys/__sparc_utrap_setup.c, avoid an error aboutDimitry Andric2014-02-201-1/+1
| | | | | | | passing a pointer to a const object to sysarch(). Notes: svn path=/projects/clang-sparc64/; revision=262268
* Fix undefined behavior: (1 << 31) is not defined as 1 is an int and thisEitan Adler2013-11-302-4/+4
| | | | | | | | | | | | | | | | shifts into the sign bit. Instead use (1U << 31) which gets the expected result. This fix is not ideal as it assumes a 32 bit int, but does fix the issue for most cases. A similar change was made in OpenBSD. Discussed with: -arch, rdivacky Reviewed by: cperciva Notes: svn path=/head/; revision=258780
* Prefix the alias macros for members of struct __mcontext with an underscoreMarius Strobl2013-07-122-8/+8
| | | | | | | in order to avoid a clash in the net80211 code. Notes: svn path=/head/; revision=253266
* The getcontext() from the __fillcontextx() call in theKonstantin Belousov2013-05-281-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | check_deferred_signal() returns twice, since handle_signal() emulates the return from the normal signal handler by sigreturn(2)ing the passed context. Second return is performed on the destroyed stack frame, because __fillcontextx() has already returned. This causes undefined and bad behaviour, usually the victim thread gets SIGSEGV. Avoid nested frame and the need to return from it by doing direct call to getcontext() in the check_deferred_signal() and using a new private libc helper __fillcontextx2() to complement the context with the extended CPU state if the deferred signal is still present. The __fillcontextx() is now unused, but is kept to allow older libthr.so to be used with the new libc. Mark __fillcontextx() as returning twice [1]. Reported by: pgj Pointy hat to: kib Discussed with: dim Tested by: pgj, dim Suggested by: jilles [1] MFC after: 1 week Notes: svn path=/head/; revision=251047
* Rework the __vdso_* symbols attributes to only make the symbols weak,Konstantin Belousov2013-01-302-0/+50
| | | | | | | | | | | | | but use normal references instead of weak. This makes the statically linked binaries to use fast gettimeofday(2) by forcing the linker to resolve references and providing the neccessary functions. Reported by: bde Tested by: marius (sparc64) MFC after: 2 weeks Notes: svn path=/head/; revision=246117
* Make the sys/ucontext.h self-contained by changing the return typeKonstantin Belousov2012-02-011-1/+1
| | | | | | | | | | of __getcontextx_size(3) from size_t to int. PR: ports/164654 MFC after: 1 month Notes: svn path=/head/; revision=230864
* Add API for obtaining extended machine context states that cannot beKonstantin Belousov2012-01-212-1/+70
| | | | | | | | | | | | | | fit into existing mcontext_t. On i386 and amd64 do return the extended FPU states using getcontextx(3). For other architectures, getcontextx(3) returns the same information as getcontext(2). Tested by: pho MFC after: 1 month Notes: svn path=/head/; revision=230429
* Computations on NaNs are supposed to return one of the input NaNs unchanged.David Schultz2012-01-162-4/+3
| | | | | | | | | | Fix a few places in the sparc64 floating-point emulator where this wasn't being handled properly. Submitted by: bde Notes: svn path=/head/; revision=230193
* Replace a proliferation of buggy MD implementations of modf() with aDavid Schultz2011-10-213-179/+1
| | | | | | | | | | working MI one. The MI one only needs to be overridden on machines with non-IEEE754 arithmetic. (The last supported one was the VAX.) It can also be overridden if someone comes up with a faster one that actually passes the regression tests -- but this is harder than it sounds. Notes: svn path=/head/; revision=226606
* Fix whitespace inconsistencies found in homegrown Symbol.maps.Ed Schouten2011-10-071-1/+1
| | | | Notes: svn path=/head/; revision=226111
* Disconnect sun4v architecture from the three.Attilio Rao2011-05-142-7/+0
| | | | | | | | | | | | Some files keep the SUN4V tags as a code reference, for the future, if any rewamped sun4v support wants to be added again. Reviewed by: marius Tested by: sbruno Approved by: re Notes: svn path=/head/; revision=221869
* Avoid aliasing which leads to incorrect results when compiling with theMarius Strobl2010-03-211-12/+11
| | | | | | | | | | | default strict aliasing rules. PR: 144900 Submitted by: Peter Jeremy MFC after: 3 days Notes: svn path=/head/; revision=205410
* - While SPARC V9 allows tininess to be detected either before or afterMarius Strobl2010-03-201-5/+10
| | | | | | | | | | | | | | | | rounding (impl. dep. #55), the SPARC JPS1 responsible for SPARC64 and UltraSPARC processors defines that in all cases tinyness is detected before rounding, therefore rounding up to the smallest normalised number should set the underflow flag. - If an infinite result is rounded down, the result should have an exponent 1 less than the value for infinity. PR: 144900 Submitted by: Peter Jeremy MFC after: 3 days Notes: svn path=/head/; revision=205397
* Division should take both arguments' signs into account when theMarius Strobl2010-03-201-7/+9
| | | | | | | | | | | the dividend is infinity or zero and the divisor is not the same. PR: 144900 Submitted by: Peter Jeremy MFC after: 3 days Notes: svn path=/head/; revision=205396
* FPU_DEBUG requires <stdio.h>.Marius Strobl2010-03-203-1/+12
| | | | | | | | | PR: 144900 Submitted by: Peter Jeremy MFC after: 3 days Notes: svn path=/head/; revision=205395
* Ensure that __fpu_ftox() both returns the high bits and res[1] containsMarius Strobl2010-03-201-5/+7
| | | | | | | | | | | the low bits also in the default case. PR: 144900 Obtained from: OpenBSD MFC after: 3 days Notes: svn path=/head/; revision=205394
* - Remove a bogus forward declaration.Marius Strobl2010-03-202-7/+3
| | | | | | | - Fix whitespace. Notes: svn path=/head/; revision=205393
* Fix a typo in r204974 so that FTYPE_LNG matches the initialisers ofMarius Strobl2010-03-111-1/+1
| | | | | | | | | the opmask array. Pointed out by: Peter Jeremy Notes: svn path=/head/; revision=205002
* - The OPSZ macro actually only does the right thing for int32 and int64Marius Strobl2010-03-102-29/+21
| | | | | | | | | | | | | | | | | | | | operands but not for double and extended double ones. Instead of trying to fix the macro just nuke it and unroll the loops in the correct way though as extended double operands turn out to be the only special case. - For FxTO{s,d,q} the source operand is int64 so rs2 has to be re-decoded after setting type accordingly as it's generally decoded using the low 2 bits as the type, which are 0 for these three instructions. - Similarly, in case of F{s,d,q}TOx the target is int64 so rd has to be re-decoded using not only the operand mask appropriate for int64 but also the correct register number encoding. - Use const where appropriate. - Wrap long lines. Submitted by: Peter Jeremy (partly) MFC after: 3 days Notes: svn path=/head/; revision=204974
* The NetBSD Foundation has granted permission to remove clause 3 and 4 fromJoel Dahl2010-03-031-7/+0
| | | | | | | | | their software. Obtained from: NetBSD Notes: svn path=/head/; revision=204640
* Remove unneeded stdlib directories.Ed Schouten2009-06-231-1/+0
| | | | | | | | | | It's not necessary to add stdlib directories for each architecture, even if the architecture doesn't implement any files of its own. Submitted by: Christoph Mallon Notes: svn path=/head/; revision=194704
* Provide a type for the argument.Roman Divacky2009-02-021-1/+1
| | | | | | | Approved by: kib (mentor) Notes: svn path=/head/; revision=188031