summaryrefslogtreecommitdiffstats
path: root/lib/libc/i386/sys
Commit message (Collapse)AuthorAgeFilesLines
* MFC r304285:kib2016-09-162-116/+1
| | | | Implement userspace gettimeofday(2) with HPET timecounter.
* MFC r304928:kib2016-09-032-58/+1
| | | | | | | | | | | | | Do not obliterate errno value in the main thread during ptrace(2) call on x86. MFC r304931: Follow ABI when calling __error from the ptrace(2) wrapper. MFC r305012: Rewrite ptrace(2) wrappers in C. MFC r305022: Restore the requirement of setting errno to zero before calling ptrace(2).
* Replace use of the pipe(2) system call with pipe2(2) with a zero flagsbrooks2016-06-222-50/+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
* libc/{i386,amd64}: Do not export .cerror when building WITHOUT_SYMVERemaste2016-03-081-0/+1
| | | | | | | | | | | | | | | Further to r240152 (i386) and r240178 (amd64), hide the .cerror symbol so that it is not exported if symbol versioning is not in use. Without this change WITHOUT_SYMVER libc contains .text relocations for .cerror, as described in LLVM PR 26813 (http://llvm.org/pr26813). This is a no-op for the regular build as the symbol version script already controls .cerror visibility. PR: 207712 Submitted by: Rafael EspĂ­ndola Reviewed by: jilles, kib Differential Revision: https://reviews.freebsd.org/D5571
* Copy the fencing of the algorithm to do lock-less update and readingkib2015-08-041-2/+56
| | | | | | | | | | | | | | of the timehands, from the kern_tc.c implementation to vdso. Add comments giving hints where to look for the algorithm explanation. To compensate the removal of rmb() in userspace binuptime(), add explicit lfence instruction before rdtsc. On i386, add usual complications to detect SSE2 presence; assume that old CPUs which do not implement SSE2 also execute rdtsc almost in order. Reviewed by: alc, bde (previous version) Sponsored by: The FreeBSD Foundation MFC after: 2 weeks
* Remove reboot.S (part of libc). It's not needed and was actuallytrasz2015-07-072-46/+1
| | | | | | | broken - returning 0 from reboot(2) resulted in SIGBUS. MFC after: 1 month Sponsored by: The FreeBSD Foundation
* The lseek(2), mmap(2), truncate(2), ftruncate(2), pread(2), andkib2015-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
* Convert from WITHOUT_SYSCALL_COMPAT to MK_SYSCALL_COMPAT.imp2014-04-051-1/+1
|
* Replace the WEAK_ALIAS() alias with the WEAK_REFERENCE() alias. Use it andandreast2013-11-212-8/+4
| | | | | | get rid of the __CONCAT and CNAME macros. Reviewed by: bde, kib
* libc: Access _logname_valid more efficiently.jilles2013-08-171-8/+1
| | | | | | | | | | | The variable _logname_valid is not exported via the version script; therefore, change C and i386/amd64 assembler code to remove indirection (which allowed interposition). This makes the code slightly smaller and faster. Also, remove #define PIC_GOT from i386/amd64 in !PIC mode. Without PIC, there is no place containing the address of each variable, so there is no possible definition for PIC_GOT.
* Rework the __vdso_* symbols attributes to only make the symbols weak,kib2013-01-301-0/+10
| | | | | | | | | | 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
* libc/i386: Do not export .cerror.jilles2012-09-058-32/+12
| | | | | | | | | | | | | | | | | | | | | | | For some reason, libc exports the symbol .cerror (HIDENAME(cerror)), albeit in the FBSDprivate_1.0 version. It looks like there is no reason for this since it is not used from other libraries. Given that it cannot be accessed from C and its strange calling convention, it is rather unlikely that other things rely on it. Perhaps it is from a time when symbols could not be hidden. Not exporting .cerror causes it to be jumped to directly instead of via the PLT. This change also takes advantage of .cerror's new status by not saving and loading %ebx before jumping to it. (Therefore, .cerror now saves and loads %ebx itself.) Where there was a conditional jump to a jump to .cerror, the conditional jump has been changed to jump to .cerror directly (many modern CPUs don't do static prediction and in any case it is not much of a benefit anyway). This change makes libc.so.7 a few kilobytes smaller. Reviewed by: kib
* Use struct vdso_timehands data to implement fast gettimeofday(2) andkib2012-06-222-1/+52
| | | | | | | | | | | | | | | clock_gettime(2) functions if supported. The speedup seen in microbenchmarks is in range 4x-7x depending on the hardware. Only amd64 and i386 architectures are supported. Libc uses rdtsc and kernel data to calculate current time, if enabled by kernel. Hopefully, this code is going to migrate into vdso in some future. Discussed with: bde Reviewed by: jhb Tested by: flo MFC after: 1 month
* mdoc: sort prologue macros.joel2012-03-263-3/+3
|
* Add section .note.GNU-stack for assembly files used by 386 and amd64.kib2011-01-0712-0/+23
|
* Unconditionally build wrappers for i386_get_ioperm(), i386_set_ioperm(),kib2009-04-011-4/+3
| | | | | | | i386_get_ldt() and i386_set_ldt(). In collaboration with: pho Reviewed by: jhb
* On i386, the primary function that SYSCALL() generates is with thepeter2008-11-153-3/+3
| | | | | __sys_ prefix. Make END() match. This didn't cause a compile error, but the function size is attached to the .weak symbol, not the real one.
* 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
* Add missing END() macros, as per rev 184547 for amd64. The lack of thesepeter2008-11-0210-0/+11
| | | | is mostly harmless, but it does upset some of valgrind's functionality.
* Classify mmap, lseek, pread, pwrite, truncate, ftruncate as pseudopeter2007-07-041-3/+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)
* Per Regents of the University of Calfornia letter, remove advertisingimp2007-01-0912-48/+0
| | | | | | clause. # If I've done so improperly on a file, please let me know.
* Forgot to bump the document date.ru2006-10-131-1/+1
|
* Some word smithing adopted from the PR.ru2006-10-131-14/+14
| | | | | | | PR: docs/54451 Originally by: Andreas Fuchs Adopted by: jhb MFC after: 3 days
* Markup fixes.ru2006-09-171-6/+6
|
* A few minor wording changes and a clarification about error conditions.bsd2006-05-031-10/+10
|
* Provide stub functions for i386_set_ldt() and i386_get_ldt() even whenpeter2005-04-261-3/+4
| | | | | compiling as an amd64 support binary. They will return EINVAL on an amd64 kernel, but this simplifies other #ifdefs that were getting a bit nasty.
* No longer use _amd64_set_gsbase(). Use i386_set_gsbase() even whenpeter2005-04-265-165/+1
| | | | building for amd64.
* Add stubs for the %fs/%gs base management calls.peter2005-04-145-0/+149
|
* Fix strict-alias warnings by removing excessive (and wrong) casts.peter2005-04-072-2/+2
|
* When building the custom i386 libraries for use on amd64 kernels, wepeter2004-11-065-0/+166
| | | | | | | | | can't use the i386_set_ldt() family of routines, because they are not implemented. Instead, use the recently exposed direct access sysarch routines for setting what %fs and %gs point to. Use this for the i386 TLS _set_tp() routine, but only when compiling to run as a 32 bit support binary for amd64 kernels.
* Mechanically kill hard sentence breaks.ru2004-07-022-6/+12
|
* Removed trailing whitespace.ru2004-07-021-10/+10
|
* Provide sysarch(2) prototypes in the MD sysarch.h headers. While I'mnectar2004-01-095-15/+5
| | | | | | | | | | at it, use the ANSI C generic pointer type for the second argument, thus matching the documentation. Remove the now extraneous (and now conflicting) function declarations in various libc sources. Remove now unnecessary casts. Reviewed by: bde
* mdoc(7): Use the new feature of the .In macro.ru2003-09-081-1/+1
|
* Make getcontext(2) work on i386. It needs a small wrapper in libcpeter2003-09-042-2/+52
| | | | | | | | | | | | | | | | | | | | | | | otherwise the return from the syscall stub for getcontext will pop off the return value for the caller to the getcontext stub and it will appear as though the setcontext() syscall returned instead of the getcontext(). The same bug exists on amd64, a fix is coming there too. The bug can be demonstrated with this test code fragment: main() { ucontext_t top; if (getcontext(&top) == 0) { write(2, "PING!\n", 6); /* Cause a return value of 1 from getcontext this time */ top.uc_mcontext.mc_eax = 1; setcontext(&top); err(1, "setcontext() returned"); } write(2, "PONG!\n", 6); _exit(0); }
* Add the mlockall() and munlockall() system calls.bms2003-08-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | - All those diffs to syscalls.master for each architecture *are* necessary. This needed clarification; the stub code generation for mlockall() was disabled, which would prevent applications from linking to this API (suggested by mux) - Giant has been quoshed. It is no longer held by the code, as the required locking has been pushed down within vm_map.c. - Callers must specify VM_MAP_WIRE_HOLESOK or VM_MAP_WIRE_NOHOLES to express their intention explicitly. - Inspected at the vmstat, top and vm pager sysctl stats level. Paging-in activity is occurring correctly, using a test harness. - The RES size for a process may appear to be greater than its SIZE. This is believed to be due to mappings of the same shared library page being wired twice. Further exploration is needed. - Believed to back out of allocations and locks correctly (tested with WITNESS, MUTEX_PROFILING, INVARIANTS and DIAGNOSTIC). PR: kern/43426, standards/54223 Reviewed by: jake, alc Approved by: jake (mentor) MFC after: 2 weeks
* Allow foot shooting as Linux emulation needs it.julian2003-08-041-1/+2
| | | | | | | | | Also change "Auto mode" to use a "special" value instead of 0, and define and document it. I had thought libpthread had already been switched to use auto mode but it appears that patch hasn't been committed yet. Discussed with: Davidxu
* Update manual for i386_set_ldt to reflect newly added features.davidxu2003-07-311-0/+34
| | | | Submitted by: julian
* Remove stale reference to the deprecated USER_LDT option. The associatedjhb2003-06-091-4/+0
| | | | | | | code is always compiled into the kernel now. Submitted by: Hubert Tournier <hubert@frbsd.org> PR: docs/53068
* Assorted mdoc(7) fixes.ru2003-05-221-6/+9
| | | | Approved by: re (blanket)
* Fixed troff(1) and mdoc(7) warnings.ru2003-05-181-1/+1
| | | | Approved by: re (blanket)
* Document VM86_INTCALL.mdodd2003-04-291-4/+35
| | | | Submitted by: Bruce M Simpson
* Eliminate 61 warnings emitted at WARNS=2 (leaving 53 to go).nectar2003-02-165-0/+10
| | | | | | | Only warnings that could be fixed without changing the generated object code and without restructuring the source code have been handled. Reviewed by: /sbin/md5
* english(4) police.schweikh2002-12-271-1/+1
|
* mdoc(7) police: "The .Fa argument.".ru2002-12-193-3/+15
|
* mdoc(7) police: Fixed abuses of the .Ar and .Em macros.ru2002-12-181-1/+1
|
* mdoc(7) police: "The .Fn function".ru2002-12-181-0/+8
|
* mdoc(7) police: "The .Fn system call".ru2002-12-183-0/+18
|
* libc_r wasn't so tied to libc for 22 months.ru2002-11-181-2/+0
|
* track gratuitous change to sys/i386/include/reg.hsam2002-10-212-4/+4
|
OpenPOWER on IntegriCloud