Commit Graph

246 Commits

Author SHA1 Message Date
dsl 3107f9cd42 Add arguments to sys_syscall and sys___syscall.
Use MI wrappers for them in netbsd32.
Change prefix for constants from netbsd32 to NETBSD32 (used in #defines etc).
2007-11-09 15:05:33 +00:00
ad a2a3828545 machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h 2007-10-19 11:59:34 +00:00
ad 63c4506184 Changes to make ktrace LKM friendly and reduce ifdef KTRACE. Proposed
on tech-kern.
2007-08-15 12:07:23 +00:00
ad 88ab7da936 Merge some of the less invasive changes from the vmlocking branch:
- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
2007-07-09 20:51:58 +00:00
dsl 8d3eb2476f Comment out the code that uses the stackgap to issue the WSDISPLAYIO_PUTCMAP
ioctl in order to change the display colours.
Changing the code to not need the stackgap is rather pervasive, and it isn't
at all clear this is useful effort given the suspected bitrottedness
of compat darwin.
2007-07-01 20:14:17 +00:00
dsl 53e0243f27 Changes to sompat socket function to avoid the dreaded stackgap. 2007-06-30 15:31:49 +00:00
dsl a150e6e4f5 Use do_sys_recvmsg(), so_sys_accept(), do_sys_getsockname() and do_sys_senmsg()
in order to avoid the stackgap (etc).
Note that since changing the darwin socket address is simply a matter of
  translating the address family and adding sa_len, it can easily be done
  on the mbuf resident address before/after copying to/from userspace.
Simplify the convertion of AF_LOCAL addresses by usingthe user-supplied
  buffer length instead of dowing an unbounded strlen().
Untested - did this work before?
2007-06-24 18:07:34 +00:00
dsl 4147586696 There is no need for the stackgap in sys_bind() and sys_connect().
If sa_len is zero, believing the size passed to bind/connect seems
better than trying to strlen somthing that might run off the mapped kma.
Verify the address family against the array size before indexing.
2007-06-17 21:30:11 +00:00
dsl cf80941288 Kill that stackgap...
Use vn_stat() and dostatvfs() on the vnode the code always has got - even
though it used compat versions of the other syscalls.
2007-06-17 20:43:10 +00:00
dsl 95206f19b1 No need for stackgap for darwin_sys_sigaction and sigprocmask.
XXX: it doesn't look right that the new and old 'sigaction' parameters
have different types.
2007-06-17 20:15:19 +00:00
christos c61eed39a8 rename si_sigval -> si_value to match POSIX RTS. 2007-05-21 15:35:47 +00:00
yamt f03010953f merge yamt-idlelwp branch. asked by core@. some ports still needs work.
from doc/BRANCHES:

	idle lwp, and some changes depending on it.

	1. separate context switching and thread scheduling.
	   (cf. gmcgarry_ctxsw)
	2. implement idle lwp.
	3. clean up related MD/MI interfaces.
	4. make scheduler(s) modular.
2007-05-17 14:51:11 +00:00
dsl 906b9af2a7 Rework compat stat() and statvfs() code so that it no longer uses the stackgap. 2007-04-30 14:05:47 +00:00
dsl b8fbaf8c4b Change the way that emulations locate files within the emulation root to
avoid having to allocate space in the 'stackgap'
  - which is very LWP unfriendly.
The additional code for non-emulation namei() is trivial, the reduction for
  the emulations is massive.
The vnode for a processes emulation root is saved in the cwdi structure
  during process exec.
If the emulation root the TRYEMULROOT flag are set, namei() will do an initial
  search for absolute pathnames in the emulation root, if that fails it will
  retry from the normal root.
".." at the emulation root will always go to the real root, even in the middle
  of paths and when expanding symlinks.
Absolute symlinks found using absolute paths in the emulation root will be
  relative to the emulation root (so /usr/lib/xxx.so -> /lib/xxx.so links
  inside the emulation root don't need changing).
If the root of the emulation would be returned (for an emulation lookup), then
  the real root is returned instead (matching the behaviour of emul_lookup,
  but being a cheap comparison here) so that programs that scan "../.."
  looking for the root dircetory don't loop forever.
The target for symbolic links is no longer mangled (it used to get the
  CHECK_ALT_xxx() treatment, so could get /emul/xxx prepended).
CHECK_ALT_xxx() are no more. Most of the change is deleting them, and adding
  TRYEMULROOT to the flags to NDINIT().
A lot of the emulation system call stubs could now be deleted.
2007-04-22 08:29:55 +00:00
dsl 007d96a7bb Get emul_find() to update SCARG(uap, path) instead of assuming that the
updated path parameter is ever valid - especially when emul_find() fails.
Use the modified path for the access() calls.
Found when compiling with emul_find() hacked to always fail.
2007-04-05 07:37:14 +00:00
dsl 893faeae9e Update all the compat stuff to not use the 'stackgap' for processing
sys_stat() and friends, instead use do_sys_stat() and do_sys_fstat()
that write the answer into a kernel buffer (on stack) that can be
converted to the correct form and written the userspace.
I've test compiled a few kernels, and tested i386 netbsd1.6 ls.
Given I think I've fixed some bugs, it might be 50-50 with new ones.
2007-03-10 21:40:23 +00:00
ad c147748d84 - Make the proclist_lock a mutex. The write:read ratio is unfavourable,
and mutexes are cheaper use than RW locks.
- LOCK_ASSERT -> KASSERT in some places.
- Hold proclist_lock/kernel_lock longer in a couple of places.
2007-03-09 14:11:22 +00:00
christos 53524e44ef Kill caddr_t; there will be some MI fallout, but it will be fixed shortly. 2007-03-04 05:59:00 +00:00
cube 632ece3eaf Introduce a new member to struct emul, e_startlwp, to be used by
sys__lwp_create.  It allows using the said syscall under COMPAT_NETBSD32.

The libpthread regression tests now pass on amd64 and sparc64.
2007-02-19 15:10:02 +00:00
pavel 934634a18c Change the process/lwp flags seen by userland via sysctl back to the
P_*/L_* naming convention, and rename the in-kernel flags to avoid
conflict. (P_ -> PK_, L_ -> LW_ ). Add back the (now unused) LSDEAD
constant.

Restores source compatibility with pre-newlock2 tools like ps or top.

Reviewed by Andrew Doran.
2007-02-17 22:31:36 +00:00
ad 087fdb9080 Count the number of CPUs at boot and stash in 'ncpu'. Eventually should
have each CPU register at attach, so we can figure out the topology for
the scheduler.
2007-02-15 20:32:47 +00:00
ad b07ec3fc38 Merge newlock2 to head. 2007-02-09 21:55:00 +00:00
christos 168cd830d2 __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
jmmv c963ce01ee Pull in opt_ktrace.h (and sys/ktrace.h) so that the ktrace-related code
is compiled when enabled.  You know, preprocessor hell...
2006-11-13 17:01:06 +00:00
jmmv 870dd91500 Let this build when KTRACE is not enabled. Closes PR kern/33210. 2006-11-13 16:57:40 +00:00
christos 0838967c65 ktruser now returns an error if the buffer length is too big. 2006-10-22 18:18:08 +00:00
reinoud 98d17cde9d Make it compile again; it had an empty if body due the the DPRINTF and gcc
complained about it.
2006-10-19 15:11:59 +00:00
christos 4d595fd7b1 - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
2006-10-12 01:30:41 +00:00
manu 63ac93df54 Add sysctl tracing to emulations.
While we are there, fix a bug in FreeBSD sysctl emulation: use copyin for
moving data to the kernel
2006-09-23 22:11:59 +00:00
matt 2e04559304 When calling PTRACE from an LKM, use sysent[SYS_ptrace].sy_call in case
the sys_ptrace symbol isn't present.
2006-09-01 21:20:46 +00:00
christos 5970d219ae remove stray ;'s that were unintentionally placed 2006-08-29 23:58:42 +00:00
christos 33cacef35e correct comparison that was always false. 2006-08-29 23:57:49 +00:00
christos 11d381a90a fix incomplete initializer 2006-08-29 23:56:02 +00:00
christos 35ca6c8b5b Fix all the -D*DEBUG* code that it was rotting away and did not even compile.
Mostly from Arnaud Lacombe, many thanks!
2006-08-17 17:11:27 +00:00
ad f474dceb13 Use the LWP cached credentials where sane. 2006-07-23 22:06:03 +00:00
mrg e2eb31d3a3 version the socket(2) syscall. for compat30 socket, we use
EPROTONOSUPPORT instead of EAFNOSUPPORT.

from pavel@ with a little bit of clean up from myself.

XXX: netbsd32 (and perhaps other emulations) should be able
XXX: to call the standard socket calls for this i think, but
XXX: revisit this at another time.
2006-06-26 21:23:56 +00:00
christos e6ea8fe642 Don't allocate too much stuff on the stack 2006-06-20 03:21:30 +00:00
christos fc6d984beb kauth fallout 2006-05-15 00:05:16 +00:00
elad 874fef3711 integrate kauth. 2006-05-14 21:19:33 +00:00
thorpej 8077f13805 Use device_is_a(), rather than testing the dv_cfdriver pointer. 2006-03-29 04:19:48 +00:00
thorpej 39cd836ee1 Use device_unit(). 2006-03-28 17:38:24 +00:00
yamt ec5a93183a merge yamt-uio_vmspace branch.
- use vmspace rather than proc or lwp where appropriate.
  the latter is more natural to specify an address space.
  (and less likely to be abused for random purposes.)
- fix a swdmover race.
2006-03-01 12:38:10 +00:00
wiz 5d1e8b2745 Fix some typos. 2006-02-25 02:28:55 +00:00
christos 95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
manu bc210edac8 Fix COMPAT_DARWIN build. This closes PR#31336 2005-10-03 17:11:25 +00:00
christos 03ec972e58 maplen was uninitialized. 2005-09-19 02:47:15 +00:00
christos e20c28140a Add compat signal headers. 2005-09-18 14:30:15 +00:00
christos 063b880cf0 compat code reorg. 2005-09-13 01:42:32 +00:00
christos 6a2a989266 variable name mistake again. 2005-09-12 22:16:56 +00:00
christos d9f67be7fe - Avoid overflow by checking the count argument (Christer Oeberg).
- While I am here, don't leak fds either.
2005-09-12 20:54:38 +00:00