Commit Graph

4825 Commits

Author SHA1 Message Date
mrg 8075fe8705 don't put the bpendtsleep handy breakpoint in sun2 kernels as the
output asm includes it twice causing multiply-defined symbols.
2006-06-24 05:23:06 +00:00
drochner 99f30cd9d2 add a comment telling which structure members are zero-initialized,
as requested by YAMAMOTO Takashi
2006-06-23 16:17:23 +00:00
yamt e408053d1b fix a simonb-timecounters regression.
the precision of getnanotime() is not suitable for file timestamps.
esp. when it's nfs-exported.

- introduce vfs_timestamp().
  (the name is from freebsd.  currently merely a wrapper of nanotime())
- for ufs-like filesystems, use it rather than getnanotime().

XXX check other filesystems.
2006-06-23 14:13:02 +00:00
drochner 9b00231778 zero-init callback_head by memset(). code is 12 bytes shorter 2006-06-21 17:16:00 +00:00
christos ece76dd170 Don't leak memory on success. Allocate only the type of struct that we'll
need for efficiency.
2006-06-21 13:46:17 +00:00
yamt 300d4b1ed6 bump default so_snd.sb_lowat to increase chance to use loaning.
the idea to tweak the watermark from Jonathan Stone.
reviewed by Bill Studenmund.
2006-06-21 12:55:12 +00:00
christos 709b2e6f55 don't allocate too much stuff on the stack. 2006-06-20 03:20:44 +00:00
yamt 7d3142aa6a - introduce vfs_composefh() and use it where appropriate.
- fix lock/unlock mismatch in sys_getfh.
2006-06-17 07:06:50 +00:00
yamt 7b37f4549b sysctl_security_setidcorename: don't allocate MAXPATHLEN bytes on stack. 2006-06-17 06:54:58 +00:00
dyoung 5174aa84b6 The UID_MAX limit is not enforced by syscalls such as setreuid(2),
so I remove the assertion uid >= 0 && uid <= UID_MAX.  This squashes
a bug where Quagga would panic my machine by passing a UID outside
the range [0, UID_MAX].

AFAICT, this restores the historical (pre-kauth) behavior.

It is likely that GIDs do not satisfy the assertion gid >= 0 &&
gid <= GID_MAX, so remove that, too.

Patch from elad.
2006-06-13 22:56:46 +00:00
ginsbach d05e0bc3e8 Add EAFNOSUPPORT as a possible error if the address family is not
supported.  This adds further differentiation between which argument to
socket(2) caused the error.  No longer are invalid domain (address family)
errors classified as ENOPROTOSUPPORT errors.  This should make socket(2)
conform to current POSIX and X/Open standards.  Fixes PR/33676.
2006-06-13 21:19:56 +00:00
yamt f755e9e9b8 remove unnecessary arguments from kauth_authorize_process.
ie. make it similar to the one found in apple TN.
2006-06-13 13:56:50 +00:00
yamt 4602c1be73 sysctl_unpcblist: don't abuse kauth_authorize_process for non-process object. 2006-06-13 13:52:39 +00:00
yamt c1e6396657 sysctl_kern_file, sysctl_kern_file2: don't abuse kauth_authorize_process
for non-process objects.
2006-06-13 13:52:06 +00:00
yamt 52e88e8188 sysctl_kern_file2: fix an indent. 2006-06-13 13:23:03 +00:00
christos 67894004ec Don't allocate > 2K on the stack. 2006-06-12 01:25:05 +00:00
christos c0160ad4aa don't allocate statvfs on the stack. 2006-06-12 00:22:47 +00:00
christos 1214d130c2 Always make partitions contiguous even if the mbr has gaps. From someone
who wants to remain anonymous.
2006-06-11 23:25:23 +00:00
rjs 4ba88d2489 Add includes of opt_multiprocessor.h and opt_lockdebug.h where missing. 2006-06-11 07:32:18 +00:00
kardel 54cd6fafa8 re-order initialization sequence to have real counters available during autoconfig 2006-06-09 22:47:56 +00:00
drochner 698fb4fb6c make the public declaration of "hardclock_ticks" signed again; other
code (kernel timeout/callout) does comparisions with it
2006-06-08 17:23:11 +00:00
kardel de4337ab21 merge FreeBSD timecounters from branch simonb-timecounters
- struct timeval time is gone
  time.tv_sec -> time_second
- struct timeval mono_time is gone
  mono_time.tv_sec -> time_uptime
- access to time via
	{get,}{micro,nano,bin}time()
	get* versions are fast but less precise
- support NTP nanokernel implementation (NTP API 4)
- further reading:
  Timecounter Paper: http://phk.freebsd.dk/pubs/timecounter.pdf
  NTP Nanokernel: http://www.eecis.udel.edu/~mills/ntp/html/kern.html
2006-06-07 22:33:33 +00:00
christos 65a5eb3712 Grr, change the code so that it compiles with gcc-3. It was ok with gcc-4. 2006-06-04 16:44:08 +00:00
christos 95e13e63bd Introduce SA_NOKERNINFO, a flag for SIGINFO not to print kernel messages. 2006-06-03 18:18:26 +00:00
drochner ad909cf73e export ntp_gettime() and ntp_timestatus(), for use by compat code 2006-05-29 16:43:05 +00:00
drochner 4f2e2f7d77 regen 2006-05-29 09:58:51 +00:00
drochner 42a3bd3098 Extend "struct ntptimeval" for the needs of "timecounters".
Allocate a new syscall for ntp_gettime() and set up COMPAT_30 for
the old one.
2006-05-29 09:57:54 +00:00
yamt 07ddfaead3 systrace_seteuid, systrace_setegid:
fix bugs in kauth change.  don't forget to update p_cred.
2006-05-28 07:08:41 +00:00
yamt 04c3beb7b1 make some internal variables static. 2006-05-28 06:52:17 +00:00
yamt b7da9130d1 remove kauth_cred_destroy, which isn't used anymore. ok'ed by Elad Efrat. 2006-05-28 06:49:27 +00:00
simonb e78022e1d6 Limit the size of any kernel buffers allocated by the VOP_READDIR
routines to MAXBSIZE.
2006-05-27 23:46:49 +00:00
yamt 4e9ca7aa01 callback_head_init: don't forget to initialize ch_running and ch_flags.
fix a problem reported by Jeff Rizzo on tech-kern@.
2006-05-27 07:42:42 +00:00
yamt c24f70bcad move wait points for kva from upper layers to vm_map. PR/33185 #1.
XXX there is a concern about interaction with kva fragmentation.
see: http://mail-index.NetBSD.org/tech-kern/2006/05/11/0000.html
2006-05-25 14:27:28 +00:00
yamt 67c564ace6 sa_upcall_userret: yield cpu on stack starvation so that it's
killable at least.  PR/28612 from ITOH Yasufumi.
2006-05-25 14:13:29 +00:00
blymn 3018e35533 Add kauth header for function prototypes
Whitespace clean up.
2006-05-25 11:23:11 +00:00
yamt a53726f2a7 kauth_cred_uucmp: fix inversed return code. PR/33546 from Juan RP. 2006-05-24 23:00:49 +00:00
yamt be46b8e46c KNF. wrap a long line. 2006-05-23 00:43:30 +00:00
yamt 1075c99d89 introduce macros, UAREA_TO_USER and USER_TO_UAREA,
to convert uarea VA into a pointer to struct user and vice versa,
so that MD code can change the layout in uarea.
2006-05-22 13:43:54 +00:00
yamt b43dc97b09 use consistent order of function specifiers and type specifiers.
(int inline -> inline int)
2006-05-22 12:42:01 +00:00
elad b3e7e1b010 Better implementation of PaX MPROTECT, after looking some more into the
code and not trying to use temporary solutions.

Lots of comments and help from YAMAMOTO Takashi, also thanks to the PaX
author for being quick to recognize that something fishy's going on. :)

Hook up in mmap/vmcmd rather than (ugh!) uvm_map_protect().

Next time I suggest to commit a temporary solution just revoke my
commit bit.
2006-05-20 15:45:37 +00:00
yamt 0f0124d1a9 remove NOLOCKF and use normal NULL instead. 2006-05-20 12:20:55 +00:00
yamt b22546608e remove an debug printf slipped into the previous. 2006-05-20 12:19:30 +00:00
yamt a6518311cc fix F_SETLKW deadlock detection, which has been broken since lwpify.
although this doesn't work for processes with multiple lwps, it's better
than not working at all.
2006-05-20 12:06:20 +00:00
yamt cecc761849 make lockfpool static. 2006-05-20 12:04:21 +00:00
yamt 408b7c1e5c move lockf implementation details from sys/lockf.h to kern/vfs_lockf.c. 2006-05-20 12:02:47 +00:00
elad 56a6a2b09b don't break lkms; pointed out by hannken@ and he@, thanks! 2006-05-18 17:35:49 +00:00
elad b6894eda07 CTLFLAG_IMMEDIATE doesn't do what I thought it did. from yamt@, thanks! 2006-05-18 17:33:18 +00:00
yamt b5420599d2 timers_alloc: use PR_WAITOK. 2006-05-18 10:09:12 +00:00
christos ccd6888699 Don't set mature an fd that has been ffree'd 2006-05-16 21:00:02 +00:00
elad 04d63f90b5 Introduce PaX MPROTECT -- mprotect(2) restrictions used to strengthen
W^X mappings.

Disabled by default.

First proposed in:

	http://mail-index.netbsd.org/tech-security/2005/12/18/0000.html

More information in:

	http://pax.grsecurity.net/docs/mprotect.txt

Read relevant parts of options(4) and sysctl(3) before using!

Lots of thanks to the PaX author and Matt Thomas.
2006-05-16 00:08:24 +00:00
elad 215bd95ba4 integrate kauth. 2006-05-14 21:15:11 +00:00
elad 33b0a10da4 add kauth backend. 2006-05-14 21:12:38 +00:00
christos 103d2f520c XXX: GCC uninitialized. 2006-05-14 05:30:31 +00:00
christos 99b7478875 Initialize an uninitialized variable gcc 4 found 2006-05-14 05:26:59 +00:00
christos 5eed059930 Add MSG_NOSIGNAL (from FreeBSD) 2006-05-11 15:49:44 +00:00
mrg 084c052803 quell GCC 4.1 uninitialised variable warnings.
XXX: we should audit the tree for which old ones are no longer needed
after getting the older compilers out of the tree..
2006-05-10 21:53:14 +00:00
yamt 7729c57a0f don't allocate struct statvfs on stack as it's too large. 2006-05-10 11:02:29 +00:00
thorpej 2977973ac1 Initialize dv_properties in config_attach_pseudo(). PR kern/33438 2006-05-08 01:04:09 +00:00
thorpej 621d724145 Remove the obsolete (and now unused) propdb API. 2006-05-05 18:26:19 +00:00
thorpej fb44a8574b Remove the devprop API and switch everthing over to the new proplib. Add
a new device_properties() accessor for device_t that returns the device's
property dictionary.
2006-05-05 18:04:41 +00:00
christos 89a5572015 Regen 2006-05-04 17:50:28 +00:00
christos 9ec9aed92e fhstat needs to be versioned too (for ino_t). Pointed out by Izumi Tsutsui 2006-05-04 17:48:56 +00:00
perseant 86f30eea43 Regen after making VOP_FCNTL take an unlocked vnode. 2006-05-04 16:49:54 +00:00
perseant 935530188d Change VOP_FCNTL to take an unlocked vnode. Approved by wrstuden@. 2006-05-04 16:48:16 +00:00
rpaulo 69ade2726c Use for in a forever loop as per KNF. 2006-05-02 13:26:07 +00:00
yamt a0e5478237 lwp_suspend: don't forget to decrement p_nrlwps when suspending ourselves.
fix PR/33287 from Gregory McGarry.
2006-04-26 11:44:39 +00:00
yamt 261fb8266c sprinkle some const and static. 2006-04-21 14:00:18 +00:00
yamt 80dfcaed5b iostat_alloc: don't forget to initialize io_busy etc.
fix weird "time" in iostat.
2006-04-21 13:58:10 +00:00
yamt b9eb99f927 iostat_find/disk_find: constify and simplify. 2006-04-21 13:53:30 +00:00
yamt c1078a4a2a sysctl_io_stats_setup: HW_IOSTATS is iostats, not drivestats. 2006-04-21 13:52:23 +00:00
yamt f7fc2f12db remove some unnecessary #include. 2006-04-21 13:51:24 +00:00
yamt 86ddb75ddc iostat_alloc: use waitok allocation. 2006-04-21 13:50:38 +00:00
yamt 1a29b7c5c3 unwrap a short line. 2006-04-21 13:49:32 +00:00
yamt 6237cabc7d whitespace. 2006-04-21 13:48:57 +00:00
blymn 10df330c85 Prefix iostat structure elements with io_ 2006-04-20 12:13:51 +00:00
yamt 51ab7131e8 from Christian Ehrhardt:
* physio: The first call to ltsleep should apparently use o &obp->b_interlock
  instead of bp->b_interlock (bp is probably NULL here).
2006-04-18 09:54:32 +00:00
christos 45af66f763 Make sure we clear cpi_name; reported by Aymeric Vincent. 2006-04-17 22:05:23 +00:00
elad ae87f36cbf Ensure creation of kern node. 2006-04-17 03:45:19 +00:00
elad 7ee081e4bd Move securelevel-specific stuff to its own file. 2006-04-17 03:39:39 +00:00
simonb 727facb192 Add a DEBUG check that panics if pool_init() is called more than
once on the same pool.

As discussed on tech-kern a few months ago.
2006-04-15 14:23:11 +00:00
christos 6f0c68c543 Spell coalesce correctly. 2006-04-15 05:07:15 +00:00
christos 1e59f0da77 Coverity CID 2727: Simplify code. 2006-04-15 05:05:44 +00:00
christos cb70a32776 Coverity CID 848: Protect against NULL deref. 2006-04-15 04:58:14 +00:00
christos df507c4fbb Coverity CID 846: Simplify code. 2006-04-15 04:56:14 +00:00
christos 76a19fcdb4 Coverity CID 845: Make it clear that devnullfp != NULL. 2006-04-15 04:50:08 +00:00
christos d269a5fa4d Coverity CID 760: Protect against NULL deref. 2006-04-15 04:47:11 +00:00
christos 10c2c730a5 Coverity CID 716: Fix query size vs return results initialization. 2006-04-15 04:41:52 +00:00
christos e073deb555 Coverity CID 602: Remove always true if statement. 2006-04-15 04:33:48 +00:00
christos b0c1177d65 Coverity CID 840: Add KASSERT before deref. 2006-04-15 04:26:43 +00:00
christos 6b9fd03a44 Make this compile again. 2006-04-15 02:12:49 +00:00
elad 1ec3fc44a3 Coverity CID 1050, 1051: Correct NULL guards. 2006-04-15 00:34:42 +00:00
elad 31162c28c3 Coverity CID 1739: Plug leak. 2006-04-14 23:54:21 +00:00
christos ce9b807645 Coverity CID 1089: Add more KASSERTs to prevent NULL deref. 2006-04-14 23:15:21 +00:00
christos ff57dc92a8 Coverity CID 1088: Add KASSERT to prevent NULL pointer deref. 2006-04-14 23:12:14 +00:00
blymn eb5227b874 Functions to support io statistics collection. 2006-04-14 13:17:20 +00:00
blymn 3c0adb7d99 Make i/o statistics collection more generic, include tape drives and
nfs mounts in the set of devices that statistics will be reported on.
2006-04-14 13:09:05 +00:00
christos e26a0c7cb1 Coverity CID 2352: Protect all l2 accesses inside the if statement. 2006-04-13 18:55:49 +00:00
christos 5cf38f035b Strip the chrooted portion of the path from the reported pty path. Reported
and tested by Lasse Kliemann. Thanks!
2006-04-13 17:44:24 +00:00
matt cda5c405e0 Add a KASSERT to document a condition for the PRU_ABORT case. 2006-04-13 04:58:31 +00:00
yamt 32d32e7e2a sodopendfree/sodopendfreel: remove unused "so" argument. 2006-04-11 09:32:58 +00:00
onoe ec94ced902 Move "opt_maxuprc.h" from init_main.c to kern_proc.c, as the definition
of maxuprc has been moved to kern_proc.c (rev. 1.80).
2006-04-10 11:16:22 +00:00
uwe 7494d34448 Tell config to generate fs_ffs.h as vfs_bio.c checks for defined(FFS).
Include that header in vfs_bio.c so that bioops are not redefined.
2006-04-05 00:52:16 +00:00
yamt c61cfbc7ca pool_grow: don't increase pr_minpages. (fix a mistake in 1.113) 2006-04-02 13:25:34 +00:00
dsl 114adc27fb call extent_free_region_descriptor(ex, myrp) when ltseep() returns non-zero
(eg if interrupted).
Fixes Coverty CIDs 1555 and 1556.
2006-04-02 09:27:05 +00:00
dsl c89fb86a25 Bail out of sysctl_create() if we fail to malloc() own.
free(own) when we bail out if any later malloc() calls fail.
Fixes coverty CID 2310
2006-04-02 09:07:57 +00:00
dsl 49b6576d34 Predicate all the tests against existing children with a single 'if (node)'.
Simplify the test that ensures a CTLFLAG_ANYNUMBER child is an only child.
Will stop the coverty CID 1082 report.
2006-04-02 08:04:05 +00:00
christos 46c0b8e98a PR/26804: Jason Thorpe: Make PT_DUMPCORE require the process to be PT_ATTACH'ed
first so that it is stopped and there are no races.
2006-04-01 22:34:00 +00:00
christos dfabd062ab PR/32809: Pavel Cahyna: Conflicting flags in l_flag and p_flag are causing
ps(1) to print incorrect information. Annotate the flags in the header files
to make sure that flags are not being re-used and move flags so that there
are no conflicts.
2006-04-01 00:57:34 +00:00
erh 76d8aa2c53 Fix call to simple_lock_assert_held() so builds with -DDEBUG work. 2006-03-31 06:01:07 +00:00
elad 42eb9126e2 Remove useless whitepsace.
This commit is dedicated to Dan Langille.
2006-03-30 17:40:58 +00:00
chs 60b21d1590 use uvm_km_alloc() instead of uvm_map(). 2006-03-30 04:05:05 +00:00
cube 699fe710fb Rework the _lwp* and sa_* families of syscalls so some details can be
handled differently depending on the emulation.  This paves the way for
COMPAT_NETBSD32 support of our pthread system.
2006-03-29 23:02:31 +00:00
thorpej a48de83500 Fix typo. 2006-03-29 06:25:35 +00:00
thorpej 35947a37ad Add a device_private() to return the driver's private data (softc).
For now, this just returns the passed device_t (as a void *) because
device softcs currently contain a "struct device" as the first member.
2006-03-29 06:08:16 +00:00
thorpej 78ffd948be Replace device_locators() with device_locator(), and use it. 2006-03-29 06:00:46 +00:00
thorpej 39cd836ee1 Use device_unit(). 2006-03-28 17:38:24 +00:00
martin d6d75eaf5d KASSERT that the returned file id length from VPTOFH is <= the
maximum allowed value (_VFS_MAXFIDSZ).
2006-03-27 20:20:45 +00:00
erh e4412d2162 Add simple_lock_assert_locked/simple_lock_assert_unlocked to provide additional
useful information when panic'ing because the assertion fails.
Use these to define the SCHED_ASSERT_LOCKED/SCHED_ASSERT_UNLOCKED macros.
2006-03-26 20:19:52 +00:00
erh 0cccd65efb When DIAGNOSTIC is defined, provide a kern.panic_now sysctl to conviniently
and reliably panic the system
2006-03-26 20:07:21 +00:00
hannken ce61e2843e vn_rdwr(): Initialize `mp' to NULL. vn_finished_write() would be called
with uninitialized `mp' if `vp->v_type == VCHR'.

From Coverity CID 2475.
2006-03-24 17:16:10 +00:00
christos ed99bb9996 Fix old pty name resolution for ptys > 256 2006-03-23 23:53:54 +00:00
matt ce8489309f There is no need to use MALLOC/FREE when rebuilding the execsw array
due to LKM loading/unloading.  This is not performance critical.
2006-03-22 01:14:46 +00:00
matt 3ae62e4c0b Get rid of stupid GCC fix. It was wrong. Spotted by Coverity. 2006-03-22 00:13:26 +00:00
yamt bd149b4812 m_copyback0:
- unify two copies of code to extend a chain.
- when extending a chain,
	- use trailing space of the last mbuf if any.
	- use mbuf cluster if appropriate.
2006-03-19 10:07:19 +00:00
yamt 3aa5cee09f m_print: fix the previous correctly. 2006-03-18 18:17:19 +00:00
chris 998afe8b1c Move check of strp for NULL to the top of the function, if it's NULL
release the lock and exit.

It could be argued that we only ever call the function with strp being
valid so the test isn't needed, but that requires the caller not to change,
or be altered/broken.

Fixes Coverity CID 2357, strp deferenced before NULL check.
2006-03-18 17:44:13 +00:00
chris 3b6dcb2526 Fix Coverity CID 1473: Static buffer overrun.
Add a counter for the number of pages, so that we print out the ext_pgs
values.
2006-03-18 17:37:17 +00:00
simonb 6c79cda5ae Coverity CID 2466 - Fix a GCC uninitialised variable warning in a way
that (hopefully!) keeps coverity happy too.
2006-03-18 07:27:50 +00:00
tls 2ebe53e4ac Add one more buffer pool, for 512-byte buffers. On the one hand, most
systems will never, ever need this -- because they use 8k/1k or even,
these days, 16k/2k or 32k/4k filesystems.  On the other hand, when you
do need this, you *really* need it: on anoncvs.netbsd.org, for instance,
where /tmp is 4k/512 and the filesystem contains tens or even hundreds
of thousands of single-frag directories, this essentially doubles the
efficiency of the allocator.  Since the overhead of keeping one extra
pool around is minimal, just add it by default.
2006-03-17 23:43:37 +00:00
christos 5a57baa413 don't use MALLOC with a non-constant size; use malloc instead. 2006-03-17 23:29:07 +00:00
skrll 75eb73218c KNF 2006-03-17 11:03:07 +00:00
yamt 848da92913 make duplicated code fragments into a function, pool_grow. 2006-03-17 10:09:25 +00:00
erh 8e641f354a Found by coverity issue 887. Check for NULL before using base_ph so
an interpreter that does not have PT_LOAD in the program header doesn't
crash the system.
2006-03-17 08:51:35 +00:00
chris caebf8211b Move check for rnode being NULL to before it's first use.
Fixes Coverity CID 2434
2006-03-17 01:52:08 +00:00
erh 762add7da1 Check db_onpanic before dropping into the debugger on lock errors. 2006-03-16 00:52:32 +00:00
drochner 94c70b92a9 Check the "oldlen" argument to sysctl(2) before passing it
to vslock(9). This prevents a local DOS.
(The checks against system and user limits for wired
memory should be centralized in UVM; for now prefer a less
invasive fix which can be pulled pulled up into releases.)
2006-03-15 16:12:07 +00:00
yamt 0c8e5d8d8f whitespace. 2006-03-15 11:10:41 +00:00
yamt 2ff5a7c85c m_copyback0: add comments and assertions. 2006-03-15 10:40:30 +00:00
yamt 7935de6ea7 use UIO_SETUP_SYSSPACE instead of using vmspace_kernel() directly. 2006-03-13 08:52:07 +00:00
yamt 0969bf3261 copyin_vmspace, copyout_vmspace: set uio_vmspace correctly.
from Christos Zoulas.
2006-03-13 03:17:47 +00:00
cube 209be910b7 Support the generation of coredumps for 32-bits binaries under
COMPAT_NETBSD32.  They haven't worked for 5 years.

Silently agreed by the tech-kern readers.

XXX sparc64 MD glue still lacking.
XXX The FPU registers on i386 are not dumped correctly, according to my
XXX tests.  It shouldn't be much work for someone who has the slightest
XXX idea of how that stuff is supposed to be laid out on i386.
2006-03-12 20:25:25 +00:00
christos 40a6c72b1d KNF: brace and parenthesis usage 2006-03-12 18:36:58 +00:00
yamt 6c02fe74a4 proc_vmspace_getref: treat curproc specially to fix coredump problem pointed
by Christos Zoulas.
2006-03-12 10:32:47 +00:00
yamt 33f0a013e3 fix copyout_proc after yamt-uio_vmspace merge. from Christos Zoulas. 2006-03-12 09:47:08 +00:00
yamt a5fe09f2de remove a wrong assertion. 2006-03-10 11:07:01 +00:00
thorpej b0275539fe Make extent_alloc_subregion(), extent_alloc(), and extent_alloc1() real
functions, not CPP macros.
2006-03-08 04:43:00 +00:00
pooka 1279f1b037 remove the no longer useful fdavail(), as proposed and (thankfully) not
discussed on tech-kern
2006-03-07 17:13:53 +00:00
thorpej 61dd49d3bc Syscall debug tracing is handled by trace_enter() / trace_exit(). Change
trace_is_enabled() to return TRUE if SYSCALL_DEBUG is defined, and g/c
all of the SYSCALL_DEBUG handling from individual system call dispatch
routines.
2006-03-07 07:21:50 +00:00
thorpej a2b6f1b10c Wrap calls to (*e_syscall_intern)() in __HAVE_SYSCALL_INTERN. Fixes
VAX build.
2006-03-07 07:19:44 +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
matt 044257a109 Add a diagnostic printf if a write fails during a coredump. 2006-03-06 21:53:29 +00:00
cube ec9bafb3f3 Introduce msgrcv1 and msgsnd1 which take special care of the msg_type
parameter that gets copied in or out, making sys_msg{rcv,snd} friendly to
COMPAT_NETBSD32.
2006-03-06 14:24:13 +00:00
christos 33db6ebb5e always define proc, not just when ktrace and systrace are defined. 2006-03-06 02:17:53 +00:00
christos 81b9ed737b Move ISSET/SET/CLR macros to sys/types.h 2006-03-05 16:57:16 +00:00
christos a4495f4cec implement PT_SYSCALL 2006-03-05 07:21:37 +00:00
cube f6f0eee324 Change the way semid_t values are chosen. Instead of using kernel
addresses, use a uint32_t counter and the machinery to properly use it.
That makes the ksem_* system calls friendly for COMPAT_NETBSD32.

OK'd by thorpej@.
2006-03-05 00:49:19 +00:00
yamt e6844c675a sysctl_lookup: use "d" rather than "rnode->sysctl_data" after
"d = rnode->sysctl_data".
2006-03-05 00:32:43 +00:00
rumble f76a328cb8 Update namei(9) comments and man page to indicate that we operate on
vnodes, not inodes.
2006-03-03 16:15:11 +00:00
cube 0666ca366e Fix md(4) like raid(4) was fixed. 2006-03-01 22:12:09 +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
christos a529c06750 PR/32856: Christian Biere: Don't panic if you send a control message with
SCM_RIGHTS on an unconnected stream socket.
2006-03-01 02:06:11 +00:00
thorpej d1f18238ca Use device_is_a(). 2006-02-27 02:59:24 +00:00
skrll 6f2d82f65a Fix PR 32923 by ensuring we have non-NULL LWP in vfs_shutdown. 2006-02-25 07:11:31 +00:00
drochner b18cf5c358 update comments for const sysctl args 2006-02-24 19:26:50 +00:00
drochner 4de7d24ae3 regen 2006-02-24 19:25:28 +00:00
drochner e4c5c3aea6 constify the __sysctl() kernel side 2006-02-24 19:20:20 +00:00
bjh21 70c82cfa56 Medium-sized overhaul of POOL_SUBPAGE support so that:
1: I can understand it, and
2: It works.
Notable externally-visible changes are that POOL_SUBPAGE now has to be a
compile-time constant, and that trying to initialise a pool whose objects are
larger than POOL_SUBPAGE automatically generates a pool that doesn't use
subpages.

NetBSD/acorn26 now boots multi-user again.
2006-02-24 11:46:20 +00:00
thorpej bd81f8887a Add device_is_a(), which returns true if the device is an instance
of the driver specified by name.
2006-02-23 05:48:12 +00:00
thorpej 58853410ae Use device_class() instead of accessing dv_class directly. 2006-02-21 04:32:38 +00:00
thorpej c37edf541c Add accessor functions for the device_t type. Make device_lookup() a
real function, rather than a macro.
2006-02-19 15:01:21 +00:00
martin f128d05a8c #if __i386__ the include of opt_splash.h for now - it is only defined
on i386.
XXX - Jared, this needs to be done differently!
2006-02-18 19:40:42 +00:00
jmcneill e94541db3a If options SPLASHSCREEN and SPLASHSCREEN_PROGRESS are enabled, update the
animation periodically during autoconf.
2006-02-18 19:09:53 +00:00
thorpej 680d9eea68 - Don't expose dev_propdb directly -- provide devprop_*() wrappers instead.
- Rework the ARMADILLO / epe device properties interaction so that it actually
  associates the MAC address property with the epe device instance.
2006-02-18 05:04:11 +00:00
chs 899d1b31b2 convert "magiclinks" from a per-fs mount option to a system-wide sysctl.
as discussed on tech-kern quite some time ago.
2006-02-12 01:32:06 +00:00
manu ee0c5b44de Add initial (but unfinished) COMPAT_LINUX32 for amd64. This is good enough so
that the i386 license manager part of amd64 version of Fluent works.

While I'm here, add SysV IPC to COMPAT_LINUX/amd64
2006-02-09 19:18:56 +00:00
yamt 5a3e361753 for some random places, use PNBUF_GET/PUT rather than
- on-stack buffer
	- malloc(MAXPATHLEN)
2006-02-04 12:09:50 +00:00
yamt 14962199bf nestiobuf_iodone: remove a comment which is no longer true. 2006-02-04 12:02:35 +00:00
yamt e57cc1fc5c vfs_buf_print: print b_rawblkno as well. 2006-02-04 12:01:26 +00:00
yamt ffadcb89d9 vn_read: don't bother to allocate read-ahead context here.
it will be done in uvn_get if necessary.
2006-02-04 11:58:08 +00:00
simonb 769d33c547 Import main FreeBSD timecounter support files as of 4th Feb 2006. 2006-02-04 08:06:23 +00:00
jmmv 47d8ee4167 Implement options string parsing of the form 'a=b c=d ...'. This will be
initially used by i386's Multiboot support but will be useful in other
situations too (think refactoring mount(2)'s API).
2006-02-03 11:04:46 +00:00
elad 4a302fa004 implement a security.setid_core node as discussed on tech-kern@ and
tech-security@.
2006-02-02 17:48:51 +00:00
yamt d9b9d1ddc8 falloc: grab fd_slock when calling fd_unused. 2006-01-31 14:02:10 +00:00
dsl db0d69832d Improve disk portability between systems.
- Always look for labels in the first two sectors
- Update all existing labels, but only write new labels to netbsd mbr
  partitions, and the first/second sector of disks that don't have an mbr.
Moving disks between systems still sucks bigtime!
- raw patition is either c or d, if d then c is reserved
- max partitions might be 8 or 16, nothing in the label gives the maximum
- endianness
2006-01-28 19:57:07 +00:00
darrenr 5987976cc1 if db_onpanic is -1, do not invoke any ddb functions at all when handling
a panic.  This allows ddb's behaviour on a panic to be controlled via
sysctl rather than just compiling it in/out.
2006-01-28 14:37:31 +00:00
darrenr 76f9e99eec Introduce a new style of behaviour for ddb_onpanic == 2.
When set to 0 or 1, behaviour is normal (today)
When set to 2, kernel will display a stack trace and then enter ddb.
2006-01-28 07:23:37 +00:00
elad 2f934347d3 remove security node sysctl objects; they are now created using CTL_CREATE. 2006-01-27 03:14:56 +00:00
christos dfd8bc48f7 PR/32631: Yves-Emmanuel JUTARD: Fix DIAGNOSTIC panic in the pool code. At
the time pool_get() calls pool_catchup(), pp has been free'd but it is still
in the "entered" state. The chain pool_catchup() -> pool_allocator_alloc()
-> pool_reclaim() on pp fails because pp is still in the "entered" state.
Call pr_leave() before calling calling pool_catchup() to avoid this.

Thanks for the excellent analysis!
2006-01-26 15:07:25 +00:00
christos e7e64b6ab3 PR/32630: Yves-Emmanuel JUTARD: Illegal return in sys/kern/uipc_mbuf2.c.
Gcc likes return (void), but other compilers disagree.
2006-01-25 16:21:39 +00:00
yamt e8a3b3eb83 add ddb "sh mbuf" command. 2006-01-24 13:02:57 +00:00
uwe a881c52408 Rewrite to support LINTSTUB in multiline comments.
Be more flexible in what we accept as a valid LINTSTUB directive.
Don't abort on first error.

Separate LINTSTUB comments look ugly if the function/variable already
has a descriptive comment.  People don't like to write ugly code.
Now one can write:

/*
 * LINTSTUB: Func: type function(args)
 *    Some descriptive comment about the function.
 */
2006-01-22 05:11:11 +00:00
reinoud 0071238956 Propagate an appropiate error code in nestiobuf_iodone() to the master
buffer when the passed nested buffer has no B_ERROR flag set but not all
was transfered for the nested iobuf extent.

Discussed on tech-kern and ok'd by Takashi
2006-01-21 14:09:35 +00:00
yamt 6f3f9a8f52 blst_meta_fill: fix an assertion. PR/32580 from Nick Hudson. 2006-01-20 14:19:40 +00:00
reinoud 6e09afa9be vfs_mountedon() can only and only handle special device nodes and will
otherwise generate an UVM trap or will access random memory. This is due to
the dereference of vp->v_specmountpoint that is really
vp->v_specinfo->si_mountpoint. The field v_specinfo is multiplexed with
other structs in the vun union in struct vnode like struct socket.

The patch adds a sanity check for accessing the specinfo fields by only
allowing VBLK nodes to be passed. In theory also VCHR could be valid since
its also a special node though mounting is only done on VBLK so be strict.

Ok'd by yamt.
2006-01-18 14:26:55 +00:00
yamt dae53410a7 - tweak RUN_ONCE api to allow init_func returns an error.
- physio: handle failure of workqueue_create.
2006-01-16 21:45:38 +00:00
yamt 330b298a42 make some functions static. 2006-01-16 21:44:46 +00:00
yamt 926005485e allocbuf: yield cpu in a loop. 2006-01-15 09:01:02 +00:00
yamt 3856e837b5 - use POOL_INIT for bufpool.
- make bufiopool static.
2006-01-15 08:27:07 +00:00
yamt db2c8f4e34 add nestiobuf api for convenience when splitting a request to several pieces. 2006-01-11 00:44:41 +00:00
yamt 2addc3084c remove B_EINTR as it isn't used anymore. 2006-01-07 00:26:58 +00:00