summaryrefslogtreecommitdiffstats
path: root/lib/libc/sparc64
Commit message (Collapse)AuthorAgeFilesLines
* MFC: r278870marius2015-02-242-3/+4
| | | | | | | | Unbreak sparc64 after r276630 (MFCed to stable/10 in r277317) by calling __sparc_sigtramp_setup signal trampoline as part of the MD __sys_sigaction again. Submitted by: kib (initial versions)
* MFC r262613:dim2014-03-261-1/+1
| | | | | | | | | | | | | | | | | | | | | Merge the projects/clang-sparc64 branch back to head. This brings in several updates from the llvm and clang trunks to make the sparc64 backend fully functional. Apart from one patch to sys/sparc64/include/pcpu.h which is still under discussion, this makes it possible to let clang fully build world and kernel for sparc64. Any assistance with testing this on actual sparc64 hardware is greatly appreciated, as there will unavoidably be bugs left. Many thanks go to Roman Divacky for his upstream work on getting the sparc64 backend into shape. MFC r262985: Repair a few minor mismerges from r262261 in the clang-sparc64 project branch. This is also to minimize differences with upstream.
* MFC r258779,r258780,r258787,r258822:eadler2014-02-042-4/+4
| | | | | | | | | | | | | Fix undefined behavior: (1 << 31) is not defined as 1 is an int and this shifts into the sign bit. Instead use (1U << 31) which gets the expected result. Similar to the (1 << 31) case it is not defined to do (2 << 30). 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.
* Prefix the alias macros for members of struct __mcontext with an underscoremarius2013-07-122-8/+8
| | | | in order to avoid a clash in the net80211 code.
* The getcontext() from the __fillcontextx() call in thekib2013-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
* Rework the __vdso_* symbols attributes to only make the symbols weak,kib2013-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
* Make the sys/ucontext.h self-contained by changing the return typekib2012-02-011-1/+1
| | | | | | | of __getcontextx_size(3) from size_t to int. PR: ports/164654 MFC after: 1 month
* Add API for obtaining extended machine context states that cannot bekib2012-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
* Computations on NaNs are supposed to return one of the input NaNs unchanged.das2012-01-162-4/+3
| | | | | | | Fix a few places in the sparc64 floating-point emulator where this wasn't being handled properly. Submitted by: bde
* Replace a proliferation of buggy MD implementations of modf() with adas2011-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.
* Fix whitespace inconsistencies found in homegrown Symbol.maps.ed2011-10-071-1/+1
|
* Disconnect sun4v architecture from the three.attilio2011-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
* Avoid aliasing which leads to incorrect results when compiling with themarius2010-03-211-12/+11
| | | | | | | | default strict aliasing rules. PR: 144900 Submitted by: Peter Jeremy MFC after: 3 days
* - While SPARC V9 allows tininess to be detected either before or aftermarius2010-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
* Division should take both arguments' signs into account when themarius2010-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
* FPU_DEBUG requires <stdio.h>.marius2010-03-203-1/+12
| | | | | | PR: 144900 Submitted by: Peter Jeremy MFC after: 3 days
* Ensure that __fpu_ftox() both returns the high bits and res[1] containsmarius2010-03-201-5/+7
| | | | | | | | the low bits also in the default case. PR: 144900 Obtained from: OpenBSD MFC after: 3 days
* - Remove a bogus forward declaration.marius2010-03-202-7/+3
| | | | - Fix whitespace.
* Fix a typo in r204974 so that FTYPE_LNG matches the initialisers ofmarius2010-03-111-1/+1
| | | | | | the opmask array. Pointed out by: Peter Jeremy
* - The OPSZ macro actually only does the right thing for int32 and int64marius2010-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
* The NetBSD Foundation has granted permission to remove clause 3 and 4 fromjoel2010-03-031-7/+0
| | | | | | their software. Obtained from: NetBSD
* Remove unneeded stdlib directories.ed2009-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
* Provide a type for the argument.rdivacky2009-02-021-1/+1
| | | | Approved by: kib (mentor)
* Mark uname(), getdomainname() and setdomainname() with COMPAT_FREEBSD4.ed2008-11-091-2/+1
| | | | | | | | | | | | | | | | | | | | | Looking at our source code history, it seems the uname(), getdomainname() and setdomainname() system calls got deprecated somewhere after FreeBSD 1.1, but they have never been phased out properly. Because we don't have a COMPAT_FREEBSD1, just use COMPAT_FREEBSD4. Also fix the Linuxolator to build without the setdomainname() routine by just making it call userland_sysctl on kern.domainname. Also replace the setdomainname()'s implementation to use this approach, because we're duplicating code with sysctl_domainname(). I wasn't able to keep these three routines working in our COMPAT_FREEBSD32, because that would require yet another keyword for syscalls.master (COMPAT4+NOPROTO). Because this routine is probably unused already, this won't be a problem in practice. If it turns out to be a problem, we'll just restore this functionality. Reviewed by: rdivacky, kib
* Fix some bugs that caused sparc64's quad precision sqrt to getdas2008-04-121-5/+5
| | | | | | the wrong answer for virtually all inputs. Thanks to remko for access to a sparc64 box for testing.
* Make the software emulator for long doubles set the FPU exceptiondas2008-04-121-0/+15
| | | | | | | flags appropriately. The next step is to make it raise a SIGFPE if any exceptions are unmasked. Thanks to remko for access to a sparc64 box for testing.
* Add a new union member to access the exponent and sign of a long doubledas2008-01-181-0/+5
| | | | in a single op. Idea from bde.
* Since nan() is supposed to work the same as strtod("nan(...)", NULL),das2007-12-181-3/+0
| | | | | | | | | | | | my original implementation made both use the same code. Unfortunately, this meant libm depended on a vendor header at compile time and previously- unexposed vendor bits in libc at runtime. Hence, I just wrote my own version of the relevant vendor routine. As it turns out, mine has a factor of 8 fewer of lines of code, and is a bit more readable anyway. The strtod() and *scanf() routines still use vendor code. Reviewed by: bde
* Export gdtoa's __ULto{x,Q}_D2A routine in a private namespace sodas2007-12-161-0/+3
| | | | libm can use it.
* Arrange so that the NaN returned by strtod("nan", NULL) is the same asdas2007-12-161-11/+11
| | | | the NaN returned by strtod("nan()", NULL).
* In scanf, round according to the current rounding mode.das2007-12-031-1/+1
|
* Use an intermediate pointer to avoid a strict aliasing warning.jb2007-11-231-1/+2
|
* Classify mmap, lseek, pread, pwrite, truncate, ftruncate as pseudopeter2007-07-041-4/+5
| | | | | | | | | | syscalls, unless WITHOUT_SYSCALL_COMPAT is defined. The default case will have the .c wrappers still. If you define WITHOUT_SYSCALL_COMPAT, the .c wrappers will go away and libc will make direct syscalls. After 7-stable starts, the direct syscall method will be default. Approved by: re (kensmith)
* Adjust the syscall stub macros to be consistent in their meaning. Inpeter2007-07-041-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | particular: SYSCALL() makes a syscall, with errno handling, and continues execution directly after the macro in the non-error case. RSYSCALL() is just like SYSCALL(), but returns after success. Both SYSCALL(name) and RSYSCALL(name) export "__sys_name" as a strong symbol, with "_name" and "name" as weak aliases. PSEUDO() is just like RSYSCALL(), but skipping the "name" weak alias. It still does "__sys_name" and "_name". Change i386 to add errno handling to PSEUDO. The same for amd64 and sparc64, with appear to have copied the behavior. ia64 was correct (as was alpha). Just remove some apparently unused variants of the macros. (untested!) I believe powerpc is correct. Fix arm to not export "name" from the PSEUDO case. Remove apparently extra unused variants. (untested!) The errno problem manifested on i386/amd64/sparc64 by having "PSEUDO" classified syscalls return without setting errno. eg: "addr = mmap()" could return with "addr" = 22 instead of setting errno to 22 and returning -1. Approved by: re (kensmith)
* Some libc symbol map cleanups.deischen2007-05-311-4/+0
| | | | | | | | | | | | | | | | | | | | | net: endhostdnsent is named _endhostdnsent and is private to netdb family of functions. posix1e: acl_size.c has been never compiled in, so there's no "acl_size". rpc: "getnetid" is a static function. stdtime: "gtime" is #ifdef'ed out in the source. some symbols are specific only to some architectures, e.g., ___tls_get_addr is only defined on i386. __htonl, __htons, __ntohl and __ntohs are no longer functions, they are now (internal) defines in <machine/endian.h>. Submitted by: ru
* - Add bits for userland profiling. For sun4u this is compile-tested only.marius2007-05-111-0/+1
| | | | - Replace magic 14 with PIL_TICK.
* Use C comments since we now preprocess these files with CPP.deischen2007-04-291-11/+13
|
* Per Regents of the University of Calfornia letter, remove advertisingimp2007-01-0923-102/+0
| | | | | | clause. # If I've done so improperly on a file, please let me know.
* The distinction between quiet and signaling NaN formats isdas2007-01-031-0/+21
| | | | | machine-dependent; these files tell the latest version of gdtoa what to do.
* Fix a typo in __fpu_ftox() that caused long double to long (and long long)marius2006-12-241-9/+10
| | | | | | | | | conversion of negative numbers to always result in -1. While at it, rearrange the nearby comment so it fits in 80 chars per line, like the rest of this file does. PR: 107130 MFC after: 1 day
* Instead of re-implementing hton[ls] and friends for each arch, add a new MIcognet2006-11-065-231/+0
| | | | | | | file, net/ntoh.c, which just implement them using the inline functions from <sys/endian.h>. Suggested by: bde
* - change ABI for user trap handler for sun4v (eventually will sync sparc64 nokmacy2006-11-032-0/+7
| | | | | | hardware set up to test at the moment) Approved by: scottl (standing in for mentor rwatson)
* fix bus error in newsyslog by making sure that fields in struct fpemukmacy2006-10-121-0/+1
| | | | that are accessed as 8 byte quantities are 8 byte aligned
* Fix TLS on sparc64 for statically and dynamically linked binarieskmacy2006-10-081-2/+1
| | | | | Approved by: rwatson (mentor) Reviewed by: jmg and marcel
* For _Qp_{fge,fgt,fle,flt}() the SCD states that "Exceptions mimic fcmpeq",marius2006-04-161-4/+4
| | | | | | | this means they should set the cmpe flag when calling __fpu_compare(). Submitted by: stefanf MFC after: 2 weeks
* - Move _Qp_* and __dtoul from FBSDprivate to the list of FBSD_1.0 symbolsmarius2006-04-111-35/+18
| | | | | | | | | | | | | | | | | | | | | | | as well as add __sparc_utrap_install to FBSD_1.0; these are required by the SCD libc 64 psABI and thus meant to be officially exported symbols. - Remove the __fpu_* entries as well as the __sigtramp entry altogether as these are internal to the libc FPU emulation and the signal trampoline initialization in sigaction(2) respectively and thus don't need to be externally visible. - Add __sparc_utrap_setup to the list of FBSDprivate symbols as it's used in src/lib/csu/sparc64/crt1.c to initialize the libc FPU emulation (I think alternatively src/lib/csu/sparc64/crt1.c could be changed to use __sparc_utrap_install instead, at the expense of increasing the size of executables a bit). - Add an entry for the vfork symbol to the FBSD_1 list and entries for it's associated symbols generated by the RSYSCALL() macro to the FBSDprivate list. There's some magic in place that automatically generates code for vfork() if there's no explicit MD code for it so it might make sense to move these symbols from the MD symbol map files to a MI one. The last two changes make the libc symbol versioning useable on sparc64. Ok'ed by: deischen
* Desupport the undocumented NO_QUAD option, just don't compileru2006-03-161-5/+0
| | | | the quad support on 64-bit platforms.
* Add each directory's symbol map file to SYM_MAPS.deischen2006-03-131-0/+1
|
* Add symbol maps and initial symbol version definitions to libc.deischen2006-03-131-0/+117
| | | | Reviewed by: davidxu
* Add the functions _Qp_cmp() and _Qp_cmpe() as described in the Sparcstefanf2005-06-211-8/+11
| | | | | | | | Compliance Definition. On sparc64, GCC emits _Qp_cmp() calls for its __builtin_isfoo() functions which are used for C99's isfoo() macros. Approved by: re(dwhite) PR: 73782
OpenPOWER on IntegriCloud