Commit Graph

12287 Commits

Author SHA1 Message Date
simonb
179bda4711 Fix twalk()s 3rd argument name so that it matches rest of manpage and
the source code.
2007-12-07 07:33:13 +00:00
ad
a9718d7115 pthread__mutex_lock_slow: avoid entering the waiters list if a race to
acquire the mutex is lost. Removing the current thread from the waiters
list requires at least one syscall.
2007-12-07 01:38:38 +00:00
dyoung
eac83fd0cb Use __arraycount(). 2007-12-06 22:51:57 +00:00
seb
975a58878b Fix stresep(3) handling of consecutive quoted delimiter characters.
Approved by christos@
2007-12-06 22:07:07 +00:00
christos
14c8a52580 From Richard M Kreuter, add GLOB_PERIOD. 2007-12-05 20:25:54 +00:00
pooka
9bc20dea14 free flushbuffer after use 2007-12-05 18:55:19 +00:00
pooka
7d5d7f4ff9 Send a response message for flush operations from the kernel instead
of abusing the return value of write(2).
2007-12-05 12:11:56 +00:00
pooka
ca8fca7bb9 inverse inverse logic 2007-12-05 11:06:05 +00:00
pooka
8dad772fa4 apply previous in a more readable way 2007-12-05 10:13:37 +00:00
dogcow
96302ffc73 "fix" complaints about type-punned pointers with some icky casts. 2007-12-05 04:29:10 +00:00
mjf
d4a648c345 Implement a new magic string for magic symlinks, @ruid, which exapnds to the
real user id of the process and use this magic string for per-user tmp.
This should fix PR/35687

Kernel parts reviewed by wrstuden@
2007-12-04 22:09:01 +00:00
pooka
61113f40fd Part 3/n of extensive changes to message handling:
Get rid of the original puffs_req(3) framework and use puffs_framebuf(3)
instead for file system requests.  It has the advantage of being
suitable for transporting a distributed message passing protocol
and therefore us being able to run the file system server on any
host.

Ok, puffs is not quite here yet: libpuffs needs to grow request
routing support and the message contents need to be munged into a
host independent format.  Saying which format would be telling,
but it might begin with an X, end in an L and have the 13th character
in the middle.  Keep an eye out for the sequels: Parts 3+m/n.
2007-12-04 21:24:10 +00:00
pooka
cf878f1627 add flushops 2007-12-04 20:03:40 +00:00
pooka
661a5edd0a tyop: reserver -> reserve 2007-12-04 19:40:45 +00:00
christos
b831a8ada2 move decls for _malloc_{pre,post}fork() to extern.h 2007-12-04 17:45:07 +00:00
christos
86ef91b80e - use a non localized version of strerror_r.
- kill localized declarations and let namespace.h do its work.
2007-12-04 17:43:51 +00:00
pooka
2049bce7a5 realloc() len+incr, not offset+incr. Makes space reservation
actually work properly.
2007-12-04 17:21:24 +00:00
yamt
f078e05288 pthread__mutex_wakeup: ignore ESRCH from _lwp_unpark.
once we clear pt_sleeponq, the target thread can proceed further
and even do pthread_exit.
2007-12-04 16:56:11 +00:00
yamt
fc51c23a2d remove unnecessary assignments. 2007-12-04 16:08:28 +00:00
wiz
1746ee1de1 Add comma in enumeration. Punctuation nits. Fix a typo. 2007-12-02 22:05:51 +00:00
wiz
6db764bae5 Add comma in enumeration. 2007-12-02 19:43:10 +00:00
skrll
fd903b1729 Implement ptrace. 2007-12-02 15:48:47 +00:00
skrll
819071140e Fix include files and change use LEAF_ENTRY_NOPROFILE function to fix
the unwind entry.
2007-12-02 14:04:19 +00:00
skrll
587600728d Fix things so that crti.o doesn't contain a completely bogus unwind entry
that covers far too much and confuses gdb.

While here remove useless dave/restore of r4.
2007-12-02 13:55:38 +00:00
rillig
d59ceee59e ENOENT is also returned when the script interpreter does not exist. 2007-12-02 10:26:27 +00:00
ad
8b96cb8a97 Back out the per-cpu arena changes. With this, ld.so magically stops
loading libc/libpthread twice -- which does not make sense, because it
has its own private malloc().
2007-12-01 22:44:44 +00:00
wiz
9429ef03ff Fix another persistent spello. 2007-12-01 19:54:01 +00:00
wiz
0b6ffdfedb Fix a typo that has migrated across files. 2007-12-01 19:18:49 +00:00
wiz
a6e62b1ef7 Use more markup. New sentence, new line. 2007-12-01 19:03:26 +00:00
pooka
c8c3c477bb fix gotframe signature to match code 2007-12-01 18:59:36 +00:00
wiz
8498f992c4 Typo fixes. 2007-12-01 18:53:28 +00:00
wiz
46b4723955 eg -> e.g. 2007-12-01 18:33:11 +00:00
yamt
c2ad33834a CLEANFILES=${OBJS} 2007-12-01 11:06:36 +00:00
yamt
82f3754f04 ___start: remove a stale comment. 2007-12-01 10:16:06 +00:00
ad
64ebe1397e Hack around ld.so initializing pthread users before libpthread/libc. 2007-12-01 01:19:31 +00:00
ad
b565a56cfb - On 64-bit platforms 1/2 the default tsd values were garbage. Fix it.
- The lwpctl block is now needed on uniprocessors, for pthread_curcpu_np().
2007-12-01 01:07:34 +00:00
rillig
b54c9d13a0 typo 2007-11-30 23:01:03 +00:00
pooka
21913eabe5 Rototill.
Ok, ok, a few more words about it: stop holding puffs_cc as a holy
value and passing it around to almost every possible place (popquiz:
which kernel variable does this remind you of?).  Instead, pass
the natural choice, puffs_usermount, and fetch puffs_cc via
puffs_cc_getcc() only in routines which actually need it.  This
not only simplifies code, but (thanks to the introduction of
puffs_cc_getcc()) enables constructs which weren't previously sanely
possible, say layering as a curious example.

There's still a little to do on this front, but this was the major
fs interface blast.
2007-11-30 19:02:28 +00:00
dsl
b3dec55727 Fix the other half of the 'store int as a thread specific pointer'/ 2007-11-30 17:44:38 +00:00
christos
e09a2e99e8 converting a pointer to unsigned is bad; use uintptr_t. 2007-11-30 17:09:22 +00:00
ad
49dcd767c3 Make the allocation arenas per-CPU in the most optimistic case, but
continue to 'stripe' by thread in case of contention.
2007-11-29 18:46:13 +00:00
pooka
aadcb17f11 * allocate pcc as a slice from the stack instead of allocating it
separately
* provide puffs_cc_getcc()

This is in preparation for the removal of you-should-guess-what as
an argument to routines here and there and everywhere.
2007-11-29 17:47:54 +00:00
pooka
73a538eac2 print mode in open 2007-11-29 17:22:04 +00:00
christos
f6cecc05cf Sync phk malloc.c with the latest one from FreeBSD. This gives us the
same api as jemalloc by:

    - adding posix_memalign()
    - moving calloc in the same file
    - renaming malloc_options -> _malloc_options
2007-11-28 21:55:14 +00:00
christos
621fa4d8c6 Regen! 2007-11-27 22:19:11 +00:00
christos
5b5262a0af another minor fix from Anon Ymous 2007-11-27 22:16:03 +00:00
ad
ae87f94d1d Bump libc/libpthread minor for thr_curcpu()/pthread_curcpu_np(). 2007-11-27 21:06:41 +00:00
ad
4084ca7f3f Add thr_curcpu(), pthread_curcpu_np(). 2007-11-27 20:58:26 +00:00
ad
d5e9b90716 Fix a warning with _LP64. 2007-11-27 20:55:03 +00:00
pooka
6a3d9a187d Remove "puffs_cid" from the puffs interface following l-removal
from the kernel vfs interfaces.  puffs_cc_getcaller(pcc) can be
used now should the same information be desired.
2007-11-27 11:31:17 +00:00
tnozaki
7e1ba00ce8 more PR/36938, restore internal-state if mbtowc() throw EILSEQ.
patch provided by Shiozaki-san, thanks.
2007-11-26 15:31:30 +00:00
christos
1f07a76abf fix substitutions. From Anon Ymous 2007-11-26 15:12:06 +00:00
pooka
7568ff51e1 print more info when receiving an abort 2007-11-26 12:20:21 +00:00
dsl
d8e8042c1c Add a note about the difficulty of actually looking at the return value
of __syscall() caused by ABIs (eg sparc) that don't pass the low bits of
a 64 bit result in the same register as a 32 bit result.
2007-11-23 20:29:40 +00:00
uebayasi
2b37ebddcf KNF; no variable name in function prototype. 2007-11-23 12:39:15 +00:00
dsl
3ba44b945b Reorder the code for i386 and amd64 syscall stubs so that the 'jc' on error
is a forwards jump instead of a backwards jump that a P4 will mispredect (and
probably immediatly get a cache-line miss due to the way the code gets
aligned).
2007-11-23 07:36:05 +00:00
dsl
b0b7248d92 Change all the syscall C 'glue' functions (most of which just add in an
extra argument to ensure that 'off_t' parameters are even numbered
parameters for stack alignment reasons on 32 bit systems) to use a normal
'syscall' wrapper for __foo instead of using __syscall(SYS_foo, ... ).
This saves all the faffing needed to get a 32bit return value on sparc.
Auto-generate the extra syscall wrappers.
Move swapon.c into the correct list (swapon() uses swapctl()).
This probably means there are very few users of syscall() and __syscall() left.
2007-11-22 21:11:30 +00:00
tnozaki
fca38949e4 fix lib/37290
- don't call abort(3) when there's no suitable charset found.
- use iso-8859-1(or INIT1 if specified) for C1 control char.
2007-11-21 14:19:32 +00:00
rillig
55bf992f36 The e* functions don't call the error handler in every case, just in
case of an error.

Mentioned the error conditions for the various functions.
2007-11-21 09:17:24 +00:00
ad
a4c99db9fe Sync with reality, and note that programs must link against the dynamic
libpthread in order to remain compatible with future releases of NetBSD.
2007-11-19 15:53:20 +00:00
ad
8077340e63 Remove the debuglog stuff. ktrace is more useful now. 2007-11-19 15:14:11 +00:00
ad
a448c4f214 int -> ssize_t in a couple of places. 2007-11-19 15:12:18 +00:00
ad
95182011ed Enable posix_memalign(). 2007-11-19 14:48:41 +00:00
skrll
4f3467d61e Remove unused include.
Fix unwind info with S/ENTRY/LEAF_&/
2007-11-18 14:11:25 +00:00
skrll
8ed2bd6ec6 Generate correct unwind info for syscall stubs by using LEAF_ENTRY instead
of ENTRY(foo,0) so that gdb can backtrace through the stubs.
2007-11-18 13:25:39 +00:00
jdc
ca32a8e578 We don't need to call __init_getch here, as it is called from
screen.c:newterm().
2007-11-18 10:01:04 +00:00
pooka
dac2b0c689 fix request size 2007-11-17 17:12:11 +00:00
pooka
4b2334142b puffs_mount():
* initialize values better
* always go through "fail" to see if puffs_daemon() needs to be
  woken up
* open device r/w instead of r/o
2007-11-17 16:06:18 +00:00
plunky
06e82841a0 Fix problem with handling SDP contination state, from FreeBSD
(specifically, this manifested itself when reading a long HID
descriptor from a Microsoft Mouse.)
2007-11-16 19:35:08 +00:00
pooka
3537e99eb1 Introduce puffs_daemon(), which works like daemon(3) except that it
also synchronizes with puffs_mount() and does not return (exit) in the
parent process until the file system has been mounted.  This makes
it possible to reliably run e.g. mount_foo jippi /kai ; cd /kai/ee
2007-11-16 18:35:10 +00:00
pooka
154c2e54fb dump lookup return values 2007-11-16 14:59:14 +00:00
drochner
095b25e7dd Add pthread_equal() to libc stubs; this makes a lot of sense for
threadsafe libraries implementing own locking functions.
Ride on yesterday's minor version bumps.
2007-11-14 19:28:23 +00:00
ad
4be57c5368 Don't try to block if there are already waiters; it doesn't make sense. 2007-11-14 17:20:57 +00:00
ad
b919eb8116 Crank libpthread to 0.8. It now uses _lwp_ctl(), and it's handy to keep
0.7 hanging around for old kernels.
2007-11-13 17:22:51 +00:00
ad
66ac2ffaf2 Mutexes:
- Play scrooge again and chop more cycles off acquire/release.
- Spin while the lock holder is running on another CPU (adaptive mutexes).
- Do non-atomic release.

Threadreg:

- Add the necessary hooks to use a thread register.
- Add the code for i386, using %gs.
- Leave i386 code disabled until xen and COMPAT_NETBSD32 have the changes.
2007-11-13 17:20:08 +00:00
ad
3c776c8aa6 Bump libc minor for _lwp_ctl, libpthread constructor changes. 2007-11-13 17:13:14 +00:00
ad
15e9cec117 For PR bin/37347:
- Override __libc_thr_init() instead of using our own constructor.
- Add pthread__getenv() and use instead of getenv(). This is used before
  we are up and running and unfortunatley getenv() takes locks.

Other changes:

- Cache the spinlock vectors in pthread__st. Internal spinlock operations
  now take 1 function call instead of 3 (i386).
- Use pthread__self() internally, not pthread_self().
- Use __attribute__ ((visibility("hidden"))) in some places.
- Kill PTHREAD_MAIN_DEBUG.
2007-11-13 15:57:10 +00:00
ad
46f5cd4fb9 - Make it pass lint.
- Add RCSID.
2007-11-13 15:33:55 +00:00
ad
ec4d182d4a - stack_protector.c doesn't really belong under sys/. Add a new directory
for misc support routines and put it there.
- Add a libc constructor. Use this to initialize threading and the
  stack protector stuff. libpthread cannot be initialized safely using
  its own constructor because libc and libpthread are deeply intertwined.
  PR bin/37347
2007-11-13 15:21:19 +00:00
he
4869f8a215 Need to point to sys/ for includes to pick up <sys/lwpctl.h> for
the lint stubs.
2007-11-13 10:22:15 +00:00
he
3b9b3c5341 We now need <sys/lwpctl.h> included in order to lint LintSysNormal.c. 2007-11-13 09:07:33 +00:00
skrll
6e57c35ead Remove an include that's not required. 2007-11-13 08:41:50 +00:00
ad
9202b10ca9 Cosmetic change. 2007-11-13 01:21:32 +00:00
ad
b668a9a05f Add _lwp_ctl() system call: provides a bidirectional, per-LWP communication
area between processes and the kernel.
2007-11-12 23:11:58 +00:00
ad
51a2159851 Don't unconditionally clear the direction flag. The ABI says it must always
be clear when making a function call, and 'cld' takes about 50 clock cyles
on the P4.
2007-11-12 18:41:59 +00:00
pooka
805571cfce remove header that was never committed 2007-11-12 17:35:32 +00:00
pooka
9ac65ee1fe * split the putter header into a kernel version and a userland version
+ install latter to /usr/include/dev/putter
* remove last dependencies to puffs from putter, it's completely
  independent now
2007-11-12 16:39:32 +00:00
jmmv
096ebe7672 Add the libatf library
This adds reachover Makefiles to build the libatf library and enables it in
the parent Makefile.

Things to review in this change:

* Add proper version numbers in the shlib_version files.

* Is libatf properly listed in lib/Makefile?  It theoretically needs
  libstdc++, but the resulting binary library is not linked against it.
2007-11-12 14:56:24 +00:00
christos
0405bf4cb9 always compile getopt_long. some ifdef reduction. more to come. 2007-11-09 03:29:20 +00:00
joerg
b9d83a2411 Fix a typo in the last change that broke a comparision. 2007-11-08 21:58:26 +00:00
martin
4cdfe9d3ee When creating unsigned int results, do not distinguish positive versus
negative overflow.
2007-11-08 21:31:04 +00:00
joerg
6475789b74 Add kvm_dump_header and implement kvm_dump_wrtheader on top of it.
This function allows the caller finer control of how the writes happen
and doesn't force stdio as interface. Optimise clear_gap a bit to not
fill the gap byte-wise. Bump minor version of libkvm.
2007-11-08 20:48:04 +00:00
drochner
754fc2622c Set the number of record and play channels individually -- currently
we try to set both in one ioctl, to the same value, which fails if not
both record and play direction support that many channels. (Having
more play than record channels is common these days.)
This does likely address part of the problem described in PR pkg/35444
by Mihai Chelaru, and it helped Matthew R. Green about half a year
ago -- see the thread in tech-misc in April.
2007-11-08 20:27:25 +00:00
joerg
4267598f61 ANSIfy. 2007-11-08 17:32:30 +00:00
pooka
6b61e56541 I've written more than a fair share of this to see my name up in
lights.  Wine & women, come to me now!
2007-11-08 17:08:46 +00:00
martin
5265977a9e When converting long double values to integer types, explicitly use the
"round to zero" variants of the softfloat conversion functions.
Add a variant to convert long double to unsigned long - the "to long"
variant checked for overflows that do not apply to unsigned results.
This fixes the regress/lib/libc/convfp tests for sparc64.
2007-11-08 15:50:19 +00:00
jdc
194f45e187 Fix the handling for added carriage return characters.
Should fix the "staircase effect" part of PR 36560.
2007-11-08 06:42:22 +00:00
jdc
55f0d59917 Make sure we copy the relevant cell (and not the first cell) for
each line that we copy.

We also need to touch the destination window here.

Fixes display bug in atc(6).  Bug reported by and fix tested by
David Holland.
2007-11-08 06:39:31 +00:00
jdc
52cd399dde Make sure we don't shrink windows or sub-windows so that they end up
with zero length or height.
2007-11-08 06:34:34 +00:00
ad
f63239c2a0 Use _lwp_setname() to pass thread names to the kernel. 2007-11-07 00:55:22 +00:00