Commit Graph

285 Commits

Author SHA1 Message Date
ad 63c4506184 Changes to make ktrace LKM friendly and reduce ifdef KTRACE. Proposed
on tech-kern.
2007-08-15 12:07:23 +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 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
rmind 7b9af0160d Handle newlwp() error case. Currently, newlwp() cannot fail, but this
will likely change in the future.
2007-03-24 16:43:56 +00:00
ad 59d979c5f1 Pass an ipl argument to pool_init/POOL_INIT to be used when initializing
the pool's lock.
2007-03-12 18:18: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 b07ec3fc38 Merge newlock2 to head. 2007-02-09 21:55:00 +00:00
hubertf eda05c6413 Remove more duplicate headers.
Patch by Slava Semushin <slava.semushin@gmail.com>

Again, this was tested by comparing obj files from a pristine and a patched
source tree against an i386/ALL kernel, and also for src/sbin/fsck_ffs,
src/sbin/fsdb and src/usr.sbin/makefs. Only changes in assert() line numbers
were detected in 'objdump -d' output.
2007-01-29 01:52:43 +00:00
elad b31e9c44cf Consistent usage of KAUTH_GENERIC_ISSUSER. 2007-01-04 18:27:36 +00:00
christos 168cd830d2 __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +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
jmcneill 8c94a07b9d In mach_msg_receive(), don't declare 'struct proc *p' unless either
DEBUG_MACH_MSG or KTRACE are defined. The variable is unused otherwise,
resulting in a compile error. Fixes PR# 33211.
2006-09-23 03:34:19 +00:00
christos 489fe1e988 add missing initializers 2006-09-02 06:56:30 +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
christos 3f0deeffa7 stack police: don't allocate PAGE_SIZE bytes on the stack. 2006-06-12 00:07:24 +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
christos fc33769a12 gcc 4 does not like LHS casts. 2006-05-14 05:28:45 +00:00
drochner 2f9ef14bcf make this compile w/o KTRACE,
resolves PR kern/33212 by KIYOHARA Takashi
2006-04-07 09:23:16 +00:00
thorpej be8b235384 Clean up fallout proc_is_traced_p() change:
- proc_is_traced_p() -> trace_is_enabled(), to match trace_enter() and
  trace_exit().
- trace_is_enabled() becomes a real function.
- Remove unnecessary include files from various files that used to care
  about KTRACE and SYSTRACE, but do no more.
2006-03-07 03:32:04 +00:00
perry fbae48b901 Change "inline" back to "__inline" in .h files -- C99 is still too
new, and some apps compile things in C89 mode. C89 keywords stay.

As per core@.
2006-02-16 20:17:12 +00:00
christos 95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
simonb a21c456e2e Call nanotime() directly, instead of doing the
microtime()/TIMEVAL_TO_TIMESPEC() dance.
2005-11-11 07:07:42 +00:00
yamt 209478cccf protect p_nrlwps by sched_lock. 2005-09-17 14:35:51 +00:00
christos 758a209d23 64 bit inode changes. 2005-08-19 02:03:49 +00:00
christos 7a55962329 the exception numbers are MI. 2005-06-25 08:28:34 +00:00
christos fb4b40b7e8 - sprinkle const.
- add XXXUNCONST to the emul_find() pbuf argument free'ing. XXX: this needs
  an api change.
- avoid variable shadowing.
2005-05-29 22:08:16 +00:00
fvdl c487efe4a7 Fix some things regarding COMPAT_NETBSD32 and limits/VM addresses.
* For sparc64 and amd64, define *SIZ32 VM constants.
* Add a new function pointer to struct emul, pointing at a function
  that will return the default VM map address. The default function
  is uvm_map_defaultaddr, which just uses the VM_DEFAULT_ADDRESS
  macro. This gives emulations control over the default map address,
  and allows things to be mapped at the right address (in 32bit range)
  for COMPAT_NETBSD32.
* Add code to adjust the data and stack limits when a COMPAT_NETBSD32
  or COMPAT_SVR4_32 binary is executed.
* Don't use USRSTACK in kern_resource.c, use p_vmspace->vm_minsaddr
  instead (emulations might have set it differently)
* Since this changes struct emul, bump kernel version to 3.99.2

Tested on amd64, compile-tested on sparc64.
2005-03-26 05:12:34 +00:00
perry 77f2a006d0 regen 2005-02-26 23:58:19 +00:00
perry bcaf99655c remove trailing whitespace after the "created from: NetBSD..." line. 2005-02-26 23:55:49 +00:00
perry 6377fcfee3 make this rebuild generated files by default, and don't build .bak files 2005-02-26 23:43:15 +00:00
perry 834b86bb6d eliminate creation of .bak files -- we have source control 2005-02-26 23:42:13 +00:00
perry fa91538c32 make this rebuild generated files by default 2005-02-26 23:35:00 +00:00
perry a7f74206ba regen 2005-02-26 23:20:00 +00:00
perry 477853c351 nuke trailing whitespace 2005-02-26 22:58:54 +00:00
yamt 0994e6acb8 introduce a function, proclist_foreach_call, to iterate all procs on
a proclist and call the specified function for each of them.
primarily to fix a procfs locking problem, but i think that it's useful for
others as well.

while i'm here, introduce PROCLIST_FOREACH macro, which is similar to
LIST_FOREACH but skips marker entries which are used by proclist_foreach_call.
2004-10-01 16:30:52 +00:00
hubertf 4592bf2278 Fix copyright notice - OK'd by the copyright holder. 2004-08-21 18:58:31 +00:00
jdolecek 74436be135 pass the fork flags down to the emulation fork hook, so that emulation
code can use the information for setup
2004-08-08 08:42:03 +00:00
manu 6c669327ef Add the emul.mach.exception.hang sysctl, which helps catching programs
that die before they disapear. This is usefull because we cannot start
Mach-O binaries under gdb. We attach the hung process instead.
2004-07-27 22:01:56 +00:00
manu 7e06aa42fb Regen 2004-07-24 15:47:23 +00:00
manu 4bc8afece2 Added port_get_refs and port_mod_refs 2004-07-24 15:46:02 +00:00
manu f58d4a42e1 bugfix: vm_copy was only copying the first page 2004-07-18 23:19:52 +00:00
manu 4d933c5be0 Mark the thread id as clean in cthread_set_self 2004-07-03 09:44:04 +00:00
drochner d19f706361 all ports define __HAVE_SIGINFO now, so remove the CPP conditionals 2004-03-26 17:34:18 +00:00
pooka 8b2eb5b87e Use PR_WAITOK instead of M_WAITOK for pool_get(). This is polite,
since M_WAITOK happens to be PR_NOWAIT.
2004-03-24 16:55:07 +00:00
manu 29638672ea off-by-one error in ary subscript. 2004-01-02 02:09:52 +00:00
manu 996e659ce6 Try to do a better job at Mach port refcount. That's not perfect, though. 2004-01-01 22:48:54 +00:00