summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Implement mblen(s, n) as mbtowc(NULL, s, n) to avoid calling sgetrune()tjr2003-08-071-26/+9
| | | | | and to simplify things. This is only valid until we start supporting state-dependent encodings.
* Implement mbstowcs() as a wrapper around mbsrtowcs(), and wcstombs()tjr2003-08-072-115/+24
| | | | as a wrapper around wcsrtombs().
* Grok async contexts. When a thread is interrupted and an upcallmarcel2003-08-074-18/+82
| | | | | | | | | | | | | | | | | | | | | happens, the context of the interrupted thread is exported to userland. Unlike most contexts, it will be an async context and we cannot easily use our existing functions to set such a context. To avoid a lot of complexity that may possibly interfere with the common case, we simply let the kernel deal with it. However, we don't use the EPC based syscall path to invoke setcontext(2). No, we use the break-based syscall path. That way the trapframe will be compatible with the context we're trying to restore and we save the kernel a lot of trouble. The kind of trouble we did not want to go though ourselves... However, we also need to set the threads mailbox and there's no syscall to help us out. To avoid creating a new syscall, we use the context itself to pass the information to the kernel so that the kernel can update the mailbox. This involves setting a flag (_MC_FLAGS_KSE_SET_MBOX) and setting ifa (the address) and isr (the value).
* Implement mbtowc() in terms of mbrtowc(), and wctomb() in terms of wcrtomb().tjr2003-08-072-53/+42
|
* Implement btowc() in terms of mbrtowc() instead of sgetrune(), andtjr2003-08-072-10/+27
| | | | | | | | | wctob() in terms of wcrtomb() instead of sputrune(). There should be no functional differences, but there may be a small performance hit because we make an extra function call. The aim here is to have as few functions as possible calling s{get,put}rune() to make it easier to remove them in the future.
* Document that connect(2) can return EINTR, and that ityar2003-08-061-3/+6
| | | | can return EALREADY for a socket in blocking mode as well.
* Fix a typo. s/Line/Like/deischen2003-08-062-2/+2
|
* Avoid a level of indirection to get from the thread pointer to themarcel2003-08-064-78/+54
| | | | | | | | | | | TCB. We know that the thread pointer points to &tcb->tcb_tp, so all we have to do is subtract offsetof(struct tcb, tcb_tp) from the thread pointer to get to the TCB. Any reasonably smart compiler will translate accesses to fields in the TCB as negative offsets from TP. In _tcb_set() make sure the fake TCB gets a pointer to the current KCB, just like any other TCB. This fixes a NULL-pointer dereference in _thr_ref_add() when it tried to get the current KSE.
* Don't call kse_set_curthread() when scheduling a new bounddeischen2003-08-062-4/+6
| | | | | | | thread. It should only be called by the current kse and never by a KSE on behalf of another. Submitted by: davidxu
* Fix an off by one error in the number of arguments passed tomarcel2003-08-062-2/+2
| | | | | | makecontext(). We only supply 3, not 4. This is mostly harmless, except that on ia64 the garbage can include NaT bits, resulting in NaT consumption faults.
* Define the static TLS as an array of long double. This will guaranteemarcel2003-08-062-4/+12
| | | | | | | that the TLS is 16-byte aligned, as well as guarantee that the thread pointer is 16-byte aligned as it points to struct ia64_tp. Likewise, struct tcb and struct ksd are also guaranteed to be 16-byte aligned (if they weren't already).
* Use auto LDT allocation for i386.deischen2003-08-052-126/+12
|
* Rethink the MD interfaces for libpthread to account fordeischen2003-08-0537-960/+2077
| | | | | | | | | archs that can (or are required to) have per-thread registers. Tested on i386, amd64; marcel is testing on ia64 and will have some follow-up commits. Reviewed by: davidxu
* Define THR_GETCONTEXT and THR_SETCONTEXT in terms of the userlandmarcel2003-08-052-8/+10
| | | | | | | | | context functions. We don't need to enter the kernel anymore. The contexts are compatible (ie a context created by getcontext() can be restored by _ia64_restore_context()). While here, make the use of THR_ALIGNBYTES and THR_ALIGN a no-op. They are going to be removed anyway.
* o In _ia64_save_context() clear the return registers except for r8.marcel2003-08-052-26/+50
| | | | | | | | | | We write 1 for r8 in the context so that _ia64_restore_context() will return with a non-zero value. _ia64_save_context() always return 0. o In _ia64_restore_context(), don't restore the thread pointer. It is not normally part of the context. Also, restore the return registers. We get called for contexts created by getcontext(), which means we have to restore all the syscall return values.
* add support for using kqueue to watch bpf sockets.jmg2003-08-051-1/+8
| | | | | Submitted by: Brian Buchanan of nCircle, Inc. Tested on: i386 and sparc64
* LANG->LC_ALLache2003-08-041-1/+1
| | | | Pointed by: ru
* 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
* Fix problem differently, useache2003-08-041-1/+1
| | | | | LANG=C tr 'a-z' 'A-Z' for hypotetical case that script may generate non-ascii characters
* Fix double-wrong tr usage: tr '[a-z]' '[A-Z]'ache2003-08-041-1/+1
| | | | | | | | First of all, it should be written as: tr 'a-z' 'A-Z' ranges not encolosed in [] according to POSIX, so [] just included in the replacement. Second, it should be written: tr '[:lower:]' '[:upper:]' since a-z and A-Z may have different length in some locales.
* Restore including of "collate.h", for its own prototype (mis)match detectionache2003-08-031-0/+1
|
* Remove commented out and never used codeache2003-08-031-34/+1
|
* Remove __collate_range_cmp() stabilization, it conflicts with rangesache2003-08-031-10/+2
|
* -15 is incorrect to be used to align stack to 16 bytes, use ~15 instead.davidxu2003-08-022-2/+2
|
* Override the default stubs for getcontext(2) and swapcontext(2) somarcel2003-08-023-2/+80
| | | | | | | | | | | | | that we can flush the register stack prior to entering the kernel. This avoids having dirty registers and saves us from having to manually write them to the backing store from within the kernel. In that respect, flushing the RSE is both functionally required as well as performance optimal. On average we had 18 dirty registers when getcontext(2) was called from libthr. Since libthr does not switch back to a context created by getcontext(2), not having dealt with the dirty registers was harmless.
* The END() must expand to the .endp directive with the same name asmarcel2003-08-013-6/+5
| | | | | | | on the corresponding .proc directive, or the .endp must not have a name at all. While here, remove an artificial dependency in Ovfork.S by performing manual register renaming.
* Use FSBase to map kse, GCC generates code which uses %fs to access TLS data.davidxu2003-07-311-4/+4
| | | | Reminded by: marcel
* Remove unnecssary <vm/swap_pager.h> includes.phk2003-07-313-3/+0
| | | | | These were probably not cleaned up back in whatever murky past these files were split into separate files.
* Remove various unused variables, prototypes and local variables.phk2003-07-311-25/+0
|
* Disable and lobotomize the kvm image reading swapinfo code, the kernelphk2003-07-311-125/+1
| | | | | | layout is about to change. The sysctl based method still returns correct information.
* Retire the SWIF_DUMP_TREE code, this is in the way for a rework ofphk2003-07-312-191/+0
| | | | the swap_pager layout.
* This file hasn't been used for some time; nuke it.deischen2003-07-311-42/+0
|
* Take the same approach for i386 as that for ia64 and amd64. Usedeischen2003-07-319-339/+150
| | | | | | | | | the userland version of [gs]etcontext to switch between a thread and the UTS scheduler (and back again). This also fixes a bug in i386 _thr_setcontext() which wasn't properly restoring the context. Reviewed by: davidxu
* Unifdef -UDEBUG_SWAPINFO The kernel data structures are about to change.phk2003-07-311-79/+0
|
* Set GSBASE for kse. Finally make libkse work on AMD64.davidxu2003-07-311-6/+3
|
* Fix some typos, correctly jump into UTS.davidxu2003-07-312-4/+4
|
* sysctlbyname needs size_t type, not int.davidxu2003-07-312-2/+2
|
* Cross-reference arc4random(3).das2003-07-311-0/+4
|
* The upper end of the range of arc4random(3) is 2**32-1, not 2**31-1.das2003-07-311-2/+4
|
* Update manual for i386_set_ldt to reflect newly added features.davidxu2003-07-311-0/+34
| | | | Submitted by: julian
* Don't forget to unlock the scheduler lock. Somehow this got removeddeischen2003-07-302-0/+2
| | | | | | | from one of my last commits. This only affected priority ceiling mutexes. Pointy hat to: deischen
* Only allow trapframe formats instead of sigframe formats like themarcel2003-07-301-4/+4
| | | | | comment says and don't write the first 3 arguments to FRAME_TRAPARG_* as they are specific to sigframes.
* Correct a cut'n'paste error in a comment.harti2003-07-291-1/+1
|
* Make a local static string const.harti2003-07-291-4/+4
|
* Use the appropriate [s]size_t type where a buffer size is meant.harti2003-07-296-78/+50
| | | | Add const specifiers to constant function arguments.
* Minor constification.phk2003-07-291-2/+2
|
* Add support for gb18030 encodingache2003-07-293-1/+170
| | | | | PR: 51729 Submitted by: Kang Liu <liukang@bjpu.edu.cn>
* * Merge index(3) and rindex(3) to index(3) since the two functions aresimon2003-07-285-216/+61
| | | | | | | | | | | | | almost identical. * Merge strchr(3) and strrchr(3) to strchr(3) since the two functions are almost identical. * Make the wording of index(3) and strchr(3) more similar. * mdoc(7) cleanup. Submitted by: SUZUKI Koichi <metal@gc5.so-net.ne.jp>, keramida, myself PR: docs/32054 Reviewed by: ru Approved by: ceri (mentor)
* Simplify sigwait code a bit by using a waitset and removing oldsigmask.davidxu2003-07-276-44/+34
| | | | Reviewed by: deischen
* Set mc_len to sizeof(mcontext_t), otherwise it is an invalid context.davidxu2003-07-261-0/+1
|
OpenPOWER on IntegriCloud