Commit Graph

7331 Commits

Author SHA1 Message Date
pooka
773120876e Make lfs syscalls loadable. This nukes fs_lfs.h & #ifdef LFS.
(I don't mind if someone wants to go further and OBSOL them).
2010-03-02 19:34:26 +00:00
pooka
e867c34ab2 Make is possible to add extra output at the top of syscallargs.h.
Use this feature to stick sys/mount.h in there.
2010-03-02 19:33:12 +00:00
pooka
3f57313fc5 fs_ffs.h is no longer required (since the death of bufops / softdep) 2010-03-02 14:22:44 +00:00
darran
c9e0343fff Revert accidental commit of CTF work-in-progress changes. 2010-03-01 22:27:07 +00:00
darran
6a9056a926 DTrace: Add an SDT (Statically Defined Tracing) provider framework, and
implement most of the proc provider.  Adds proc:::create, exec,
exec_success, exec_faillure, signal_send, signal_discard, signal_handle,
lwp_create, lwp_start, lwp_exit.
2010-03-01 21:10:13 +00:00
mlelstv
7ad5c184b5 Move block number computations to callers of wapl_read/wapl_write and
conditionally build DEV_BSIZE adjustments for kernel. fsck_ffs shares
the same code but accesses physical blocks.

Also compute correct block numbers for each physical sector.
2010-02-27 16:51:03 +00:00
mlelstv
ef95b640b0 Store physical block numbers in superblock that point to the journal.
Calculate position of both commit headers correctly for disks with
large sectors.
Correct calculation of circular buffer size.
2010-02-27 12:04:19 +00:00
mlelstv
c30b0f26b2 mnt_fs_bshift is the filesystem block size, not the fragment size.
Revert to physical block size. This is fine as long as filesystem
and log stay on a similar physical medium.
2010-02-26 22:24:07 +00:00
jym
cbdb1f8831 Change RSS (resident set size) limit. Instead of setting it arbitrarily
to the total free memory available to the system, use the smallest value
between VM_MAXUSER_ADDRESS and total free memory (having a RSS limit
bigger than VM_MAXUSER_ADDRESS has no real meaning).

Fix a possible int overflow when ptoa(uvmexp.free) is bigger than 4GB
with a 32 bits vaddr_t.

This change is similar to the one made in rev 1.144 of uvm/uvm_glue.c.
2010-02-26 18:47:13 +00:00
dyoung
c1b390d493 A pointer typedef entails trading too much flexibility to declare const
and non-const types, and the kernel uses both const and non-const
PMF qualifiers and device suspensors, so change the pmf_qual_t and
device_suspensor_t typedefs from "pointers to const" to non-pointer,
non-const types.
2010-02-24 22:37:54 +00:00
darran
eda764aaf5 DTrace: remove kern_dtrace.c since it is no longer used. (Its functions
are inlined in dtrace_bsd.h).
2010-02-23 22:22:29 +00:00
darran
383b7f700b DTrace: Get rid of the KDTRACE_HOOKS ifdefs in the kernel. Replace the
functions with inline function that are empty when KDTRACE_HOOKS is not
defined.
2010-02-23 22:19:27 +00:00
mlelstv
b4d69db7b5 Use correct offset to block number calculations.
Also change access to filesystem blocks to be done by fragment instead
of by physical block. Fragments are the fundamental blocks of the
filesystem.

For a theoretical filesystem that accesses the disk in smaller units
than stored in mp->mnt_fs_bshift, the assumption might be wrong. But
this will also break other subsystems. The value mp->mnt_dev_bshift
which formerly represents the physical sector size is currently only
virtual in NetBSD (always DEV_BSIZE).
2010-02-23 20:51:25 +00:00
drochner
ec0c8f12ca Run binaries with ELF_TYPE==DYN at virtual address PAGE_SIZE rather
than 0. This is still not the intent of PIE, but it allows them to
run with VA 0 disabled.
(The PAX_ASLR stuff which should deal with this needs work.)
CV: ----------------------------------------------------------------------
2010-02-22 19:46:18 +00:00
darran
2c398f9ea9 DTrace: Add __predict_false() to the DTrace hooks per rmind's suggestion. 2010-02-21 07:39:18 +00:00
darran
8d0c2f9cd9 DTrace: missed kern_dtrace.c (thanks rmind!) 2010-02-21 07:28:51 +00:00
darran
37422f86b0 Added a defflag option for KDTRACE_HOOKS and included opt_dtrace.h in the
relevant files. (Per Quentin Garnier - thanks!).
2010-02-21 07:01:57 +00:00
darran
1bc28ea1e9 Add the DTrace hooks to the kernel (KDTRACE_HOOKS config option).
DTrace adds a pointer to the lwp and proc structures which it uses to
manage its state.  These are opaque from the kernel perspective to keep
the kernel free of CDDL code. The state arenas are kmem_alloced and freed
as proccesses and threads are created and destoyed.

Also add a check for trap06 (privileged/illegal instruction) so that
DTrace can check for D scripts that may have triggered the trap so it
can clean up after them and resume normal operation.

Ok with core@.
2010-02-21 02:11:39 +00:00
dyoung
754590e092 Avoid a potential crash: get more struct device initialization
out of the way before trying to get a unit number.  If we cannot
get a unit number, we call config_devfree(), which expects for
fields such as dv_flags, dv_cfattach, and dv_private to be initialized.
2010-02-19 22:28:47 +00:00
skrll
f3c7b2c4cd Fix comment(s).
OK'ed by rmind
2010-02-18 20:58:23 +00:00
dyoung
c26d0a3ad4 Initialize the temporary pmf_qual_t in pmf_device_subtree_release()
to avoid a failed ds != NULL assertion, later.
2010-02-17 00:15:24 +00:00
dholland
1b722ce8d0 Don't inspect vn_stat() results until after checking that it succeeded.
If anyone's been seeing random "File too large" results from module loading,
this should fix it.
2010-02-16 05:47:52 +00:00
dyoung
ff79c75809 Extract a subroutine, const char *cfdata_ifattr(cfdata_t cf), that
returns the name of the interface attribute that associates cf with
its parent.  Use cfdata_ifattr() at several sites in the autoconf
code.
2010-02-15 20:20:34 +00:00
yamt
ca9d84bc07 sysctl_doeproc: don't follow a possibly stale pointer. 2010-02-13 11:22:21 +00:00
haad
aa8090778a Add vrele_async routine which asynchronously release vnodes in different contex
and in some time in the future.

Ok: ad@.
2010-02-11 23:16:35 +00:00
haad
a23681588b Add kmem_asprintf rotuine which allocates string accordingly to format
string from kmem pool. Allocated string is string length + 1 char for ending
zero.

Ok: ad@.
2010-02-11 23:13:46 +00:00
wiz
8e35c759e7 Fix typo in comment. 2010-02-09 23:05:16 +00:00
joerg
1476e7a45a Handle rump like the direct mapping case. 2010-02-08 22:55:36 +00:00
joerg
d621e29eca Remove separate mb_map. The nmbclusters is computed at boot time based
on the amount of physical memory and limited by NMBCLUSTERS if present.
Architectures without direct mapping also limit it based on the kmem_map
size, which is used as backing store. On i386 and ARM, the maximum KVA
used for mbuf clusters is limited to 64MB by default.

The old default limits and limits based on GATEWAY have been removed.
key_registered_sb_max is hard-wired to a value derived from 2048
clusters.
2010-02-08 19:02:25 +00:00
skrll
c53ddcfff2 Re-apply:
Invert the sense of the bit to mark if LOCKDEBUG is enabled to
	disabled.

	This will help my fellow developers spot "use before initialised"
	problems that hppa picks up very well.

but fix the !LOCKDEBUG case by defining the "no debug" bits to zero so
they have no effect on lock stubs.
2010-02-08 09:54:27 +00:00
uebayasi
2903e6d834 __inline -> inline 2010-02-06 12:10:59 +00:00
cube
5ba423200b Revert commit from Fri Feb 5 06:43:17 UTC 2010 by skrll:
Invert the sense of the bit to mark if LOCKDEBUG is enabled to disabled.

      This will help my fellow developers spot "use before initialised" problems
      that hppa picks up very well.

It has to be done differently, because the semantics of mtx_owner in the non-
LOCKDEBUG case can vary significantly between archs, and thus it is not
possible to simply flip a bit to 1.

Ok core@, as at least i386 is unbootable right now.
2010-02-06 04:50:19 +00:00
cegger
8e585686fb fix LOCKDEBUG panic 'uninitialized lock'.
seminit() calls exithook_establish(). exithook_establish() uses the exec_lock.
exec_lock is initialzed by exec_init(1).
Call exec_init(1) before seminit().
2010-02-05 11:06:36 +00:00
skrll
60b795dc0a Invert the sense of the bit to mark if LOCKDEBUG is enabled to disabled.
This will help my fellow developers spot "use before initialised" problems
that hppa picks up very well.
2010-02-05 06:43:16 +00:00
njoly
0da168aed4 Switch SSP init output to aprint_debug() instead of aprint_normal()
under DIAGNOSTIC ifdefs.
2010-02-01 16:14:58 +00:00
njoly
69c8ab9322 Aprintify. 2010-02-01 12:58:04 +00:00
pooka
0f9bb09e12 Device accessors are only marginally related to autoconf, so put them
into subr_device.c instead of having them in subr_autoconf.c.

Since none of the copyrights in subr_autoconf.c really match the
history of device accessors, I took the liberty of slapping (c)
2006 TNF onto subr_device.c.
2010-01-31 15:10:11 +00:00
skrll
e975ed8767 1 CTASSERT(foo) is enough for anyone. 2010-01-31 11:54:32 +00:00
martin
476c17bc5a This is using device_t, so it needs to include <sys/device.h>. 2010-01-31 09:27:40 +00:00
pooka
8288b650e5 uncommit part which wasn't supposed to get committed yet 2010-01-31 03:57:01 +00:00
pooka
3cba324816 Pass root device as a parameter to domountroothook(). 2010-01-31 02:04:43 +00:00
pooka
04b824ef52 Place *hook implementations in kern_hook.c instead of them floating
around in the kern_subr.c gruel.  Arrrrr.
2010-01-31 01:38:48 +00:00
pooka
3b780690a4 Use proper static initializers for *hooklist (currently they happened
to work accidentally anyway since the initializer is 0).
2010-01-31 00:48:07 +00:00
hubertf
af120bb199 Replace more printfs with aprint_normal / aprint_verbose
Makes "boot -z" go mostly silent for me.
2010-01-31 00:43:37 +00:00
pooka
92394bf5f3 Trade 200-something bytes for the death of an ifdef. 2010-01-30 23:19:55 +00:00
rmind
b8ea6ca48b aio_suspend1: remove wrong comment, add one new.
Tidy up a little, while here.
2010-01-30 21:23:46 +00:00
mlelstv
49be4d025a Add helper function that determines the size and block size of a disk device.
For now we query
- the disk label
- the wedge info and data from disk(9)
2010-01-30 11:57:17 +00:00
he
ce1061323d On a recursive panic(), don't try to take a dump, as that may very
well have triggered the recursive panic.
Fix the comment for panic() to reflect now-current reality: the code
was already changed never to sync() on panic(), now we avoid dumping
core on a recursive panic.
2010-01-26 12:59:50 +00:00
dholland
3c82208a56 Amplify comment about ultrix bits. 2010-01-24 19:56:26 +00:00
hubertf
739e259054 Let kernel build when MALLOCLOG is defined but DIAGNOSTIC is not.
Else, hitmlog() is defined but not used, which triggers a warning.
2010-01-22 08:32:05 +00:00