Commit Graph

7865 Commits

Author SHA1 Message Date
obrien
531d1f3334 Imply NOLIBC_R for PowerPC. 2003-08-16 21:21:07 +00:00
marcel
63b922245d Fix wrong identifier on .end directive. The SYSCALL macro does name
mangling and creates an .ent directive with the mangled name.
2003-08-16 18:59:08 +00:00
davidxu
76d162d172 If threaded mode is not turned on yet, direct call __sys_sched_yield. 2003-08-16 13:02:45 +00:00
davidxu
8f0c2fc3c4 Replace some syscalls with libc version, this makes abort work better with
libkse. Tested under libc_r, libkse, libthr.

Reviewed by: deischen
2003-08-16 11:43:57 +00:00
davidxu
e695327086 Keep initial kse and kse group just like we keep initial thread,
Don't free them, so some code can still reference them.

Reviewed by: deischen
2003-08-16 05:22:20 +00:00
davidxu
206928815a Access user provided pointer out of lock, and also check the case when
a key is less than 0.
2003-08-16 05:19:00 +00:00
marcel
8e205a2f04 Don't run verify directly as that would require the perl script to
have execute permissions. Run "perl verify" instead. Replace all
occurences of the hardcoding of ./verify with $(VERIFY) to allow
it to be overridden as well.
2003-08-13 03:59:18 +00:00
davidxu
f9f5048801 Always set tcb for bound thread, and switch tcb for M:N thread at correct
time.
2003-08-13 01:49:07 +00:00
davidxu
2bb2e522ee Don't forget to set kcb_self. 2003-08-12 22:13:06 +00:00
davidxu
c5eb02d502 Correctly set current tcb. This fixes some IA64/KSE problems.
Reviewed by: deischen, julian
2003-08-12 08:01:34 +00:00
iedowse
581beee0a8 Make the documentation of PT_STEP match its implementation: the
`data' parameter is not ignored; if non-zero, it specifies a signal
number to be delivered to the traced process.

MFC after:	1 day
2003-08-11 13:13:46 +00:00
bms
69bd57b2dd Add the mlockall()/munlockall() system call manual page from NetBSD.
PR:		kern/42426, standards/54223
Obtained from:	NetBSD
Reviewed by:	jake, alc
Approved by:	jake (mentor)
MFC after:	2 weeks
2003-08-11 07:16:21 +00:00
bms
44aa51e3ae Add the mlockall() and munlockall() system calls.
- 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
2003-08-11 07:14:08 +00:00
davidxu
09416455b1 Add some quick pathes to exit process when signal action is default and
signal can causes process to exit.

Reviewed by: deischen
2003-08-10 22:35:46 +00:00
davidxu
4d41804986 Initialize rtld lock just before turning on thread mode and
uninitialize rtld lock after thread mode shutdown.
2003-08-10 22:30:20 +00:00
davidxu
b614f44d78 If thread mode is not activated yet, just call __sys_fork() directly,
otherwise masks all signals until fork() returns, in child process,
we reset library state before restoring signal masks until we reach
a safe to point.

Reviewed by: deischen
2003-08-10 22:20:41 +00:00
davidxu
349a8e7e9b Tweak rtld lock to allow recursive on reader lock and detect recursive
on writer lock. This is first cut at rwlock for rtld.

Submitted by: desichen
2003-08-10 22:15:03 +00:00
davidxu
b213a2432e If thread mode is not activated yet, don't do extra work.
Reviewed by: deischen
2003-08-10 22:07:28 +00:00
ache
5e7abd79c0 For type 0 rng lower initial drop to 50, it is enough to hide linearity
Reorganize historic #ifdef section
2003-08-10 17:49:55 +00:00
tjr
a356560e21 Fix the case of the encoding name in the ENCODING line. Names are
case-sensitive, and MSKANJI does not work.
2003-08-10 11:41:38 +00:00
tjr
79a1201577 Cross-reference gbk(5). 2003-08-10 11:38:28 +00:00
tjr
8e1b8c0cf9 Cross-reference gbk(5) now that it exists. Fix a copy & paste error:
one occurrence of GB 18030 should have been 11383.
2003-08-10 11:36:42 +00:00
tjr
ff610fe32a Add a fairly minimal manual page for the GBK encoding. 2003-08-10 11:34:35 +00:00
tjr
b3b78c5227 Add a cross reference to Unicode 3.0. 2003-08-10 11:26:18 +00:00
tjr
843375b3a6 Add cross references to the new character encoding manual pages,
and to mbsinit(3) while I'm at it.
2003-08-10 09:25:52 +00:00
tjr
a29811f4a0 Add manual pages for the BIG5, GB18030 and MSKanji encodings. These may
need to be fleshed out a little, especially big5(5).
2003-08-10 09:23:51 +00:00
marcel
32aa925e11 o There are 6 trap disable bits in ar.fpsr, not five. Even though we
didn't provide a constant for one of them (non-IEEE denormal trap),
  in an attempt to not support it probably, it's not we are left with
  the lower 5 bits.
o Properly mask the passed or returned fp_except_t. Not doing so
  causes instant core dumps by trying to write an invalid value to
  ar.fpsr. Now that we're masking, stop using exclusive-or to invert
  bits.

This fixes the illegal instruction fault encountered when building
mozilla.
2003-08-09 17:07:24 +00:00
deischen
52d72144a6 Add libpthread to the alpha build.
Requested by ru: Since the majority of archs can now support the
build of libpthread, rearrange the Makefile to treat libpthread
as an exception.
2003-08-09 15:29:52 +00:00
deischen
a99e26741c Add alpha support to libpthread. It compiles but hasn't been tested;
there is still some missing kernel support.

Reviewed by:	marcel
2003-08-09 05:44:27 +00:00
deischen
cba11c2ed4 Add signalcontext() which will be needed by libpthread.
Reviewed by:	marcel
2003-08-09 05:37:54 +00:00
bms
5b3e496d6a Add the POSIX 1003.1-2001 posix_madvise() interface.
PR:		standards/54634
Reviewed by:	das
Approved by:	jake (mentor)
2003-08-09 03:23:24 +00:00
davidxu
6245694474 o Add code to GC freed KSEs and KSE groups
o Fix a bug in kse_free_unlocked(), kcb_dtor shouldn't be called because
  the KSE is cached and will be resued in _kse_alloc().

Reviewed by: deischen
2003-08-08 22:20:59 +00:00
deischen
50c0d6cd4f Since it builds and seems to work OK, add libpthread to the amd64 build. 2003-08-08 21:16:06 +00:00
marcel
792d59e06f Remove stale DCE 1.1 pointers to the IBM site. The URLs aren't valid
anymore. This also fixes long line bugs caused by the lengthy URLs :-)
2003-08-08 19:18:43 +00:00
marcel
dca0a30804 Fix markup for uuid_equal() 2003-08-08 19:12:28 +00:00
marcel
29b3048430 Fix two (2) bugs in one (1) statement:
o  fix the len argument of memcmp(3) to be the size of the node field
   of the uuid structure, not the size of the uuid structure itself.
   We're comparing the node fields...
o  uuid_compare(3) is specified to return -1, 0 or 1, depending on
   the outcome of the comparison. memcmp(3) returns the difference
   between the first differing bytes. Hence, we cannot ever return
   the return value of memcmp(3) as-is.

PR: standards/55370
Submitted by: Konstantin Oznobihin <bork@rsu.ru>
2003-08-08 19:03:37 +00:00
jake
1cee0842b2 Implement signalcontext. 2003-08-08 15:40:28 +00:00
kan
0faaaf6049 Allow gcc driver to process -r option iself, do not use -Wl,-r to
bypass it. Doing otherwise did not allow compiler to detect and disable
conflicting options generated from specs.

Reported by:	jake
2003-08-08 03:41:13 +00:00
tjr
cbe12b7936 Implement mblen(s, n) as mbtowc(NULL, s, n) to avoid calling sgetrune()
and to simplify things. This is only valid until we start supporting
state-dependent encodings.
2003-08-07 09:34:51 +00:00
tjr
84d24ef340 Implement mbstowcs() as a wrapper around mbsrtowcs(), and wcstombs()
as a wrapper around wcsrtombs().
2003-08-07 08:04:01 +00:00
marcel
0dae148272 Grok async contexts. When a thread is interrupted and an upcall
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).
2003-08-07 08:03:05 +00:00
tjr
b88da9d9aa Implement mbtowc() in terms of mbrtowc(), and wctomb() in terms of wcrtomb(). 2003-08-07 07:59:36 +00:00
tjr
298b52ca87 Implement btowc() in terms of mbrtowc() instead of sgetrune(), and
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.
2003-08-07 07:45:35 +00:00
yar
f02f488d85 Document that connect(2) can return EINTR, and that it
can return EALREADY for a socket in blocking mode as well.
2003-08-06 14:21:06 +00:00
deischen
9dd8477032 Fix a typo. s/Line/Like/ 2003-08-06 06:12:54 +00:00
marcel
37f3261fb0 Avoid a level of indirection to get from the thread pointer to the
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.
2003-08-06 04:17:42 +00:00
deischen
b024e2e419 Don't call kse_set_curthread() when scheduling a new bound
thread.  It should only be called by the current kse and
never by a KSE on behalf of another.

Submitted by:	davidxu
2003-08-06 00:43:28 +00:00
marcel
5dfa7ee632 Fix an off by one error in the number of arguments passed to
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.
2003-08-06 00:23:40 +00:00
marcel
e45924adac Define the static TLS as an array of long double. This will guarantee
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).
2003-08-06 00:17:15 +00:00
deischen
aff30d7ad6 Use auto LDT allocation for i386. 2003-08-05 23:09:22 +00:00