Commit Graph

1886 Commits

Author SHA1 Message Date
ad
dc579413e1 Add DTYPE_LSU. 2000-10-19 14:27:20 +00:00
assar
23c5cbac2e add missing semicolon to typedef of mode_t 2000-10-18 01:43:18 +00:00
thorpej
339724bb6f NetBSD 1.5H: struct ifnet changed. 2000-10-11 16:55:11 +00:00
toshii
aeeb938ec6 Wrap __cmsg_alignbytes in __BEGIN_DECLS ... __END_DECLS. 2000-10-04 08:59:16 +00:00
assar
51f5a6f27f repair parentheseis error in TAILQ_FOREACH_REVERSE. see PR kern/11117 2000-10-03 00:19:19 +00:00
eeh
1ecf6779be Add support for variable end of user stacks needed to support COMPAT_NETBSD32:
`struct vmspace' has a new field `vm_minsaddr' which is the user TOS.

	PS_STRINGS is deprecated in favor of curproc->p_pstr which is derived
	from `vm_minsaddr'.

	Bump the kernel version number.
2000-09-28 19:05:06 +00:00
kleink
b6cd3fc67b Provide a stub for restrict. 2000-09-27 10:44:12 +00:00
jdolecek
49c105ffdb add new macro BOOT_FLAG() (defined in <sys/boot_flag.h>) - this
maps standard boot flags to corresponding RB_* values
use BOOT_FLAG() in port's MD code as appropriate

as discussed on tech-kern, add new boot flags -v, -q for booting
verbosely or quietly, and corresponding AB_VERBOSE/AB_QUIET
boot flags; also add FreeBSD-compatible bootverbose macro and
NetBSD-specific bootquiet macro

for hpcmips, use new bootverbose instead of it's own hpcmips_verbose

Tested on i386, and to limited extend (compile of affected files) also for
mvme68k, hp300, luna68k, sun3.
2000-09-24 12:32:31 +00:00
sommerfeld
aee40d8006 Bump EXEC_DEFAULT_VMCMD_SETSIZE from 5 to 9, which appears to be the
typical number used by i386 dynamic elf binaries.
2000-09-24 02:40:29 +00:00
kleink
7648b5ad16 Define pid_t via <sys/ansi.h>: no longer expose clutter from <sys/types.h>. 2000-09-20 10:16:49 +00:00
fvdl
2dbd4e25a8 VOP_FSYNC interface change --> 1.5F 2000-09-19 21:58:59 +00:00
fvdl
9d8dbdad9a Regen. 2000-09-19 21:58:01 +00:00
kleink
cafe9756bf Define pid_t via <sys/ansi.h>. 2000-09-19 08:35:36 +00:00
abs
7dea4938ea If device and mountpoint are given without -t, and without a : in the
device, check the disklabel for filesystem type. Fall back to ffs as ever.
2000-09-18 10:48:23 +00:00
thorpej
e3d2277d32 Regen: VNODE_OP_NOINLINE vs. LKM. 2000-09-13 16:09:52 +00:00
thorpej
5d879e9012 Regen for VNODE_OP_NOINLINE. 2000-09-13 15:51:19 +00:00
jdolecek
1ef0c139f9 allocate pty kernel structures on demand at run-time - this allows
to support arbitrary number of ptys without need of kernel recompile
(the extra device special files in /dev/ still need to be created, of course)

upper limit of supported ptys is controlled via new sysctl variable
kern.maxptys (KERN_MAXPTYS), which is raise-only and defaults to 512.
2000-09-09 16:42:04 +00:00
bouyer
ca5824ec3b Implement suspendsched() by putting all sleeping and runnable processes
in SSTOP state, execpt P_SYSTEM and curproc processes. We have to way to
find the original state of the process so we can't restart scheduling,
so this can only be used at shutdown time.

XXX suspendsched() should also deal with processes running on other CPUs.
I don't know how to do that, and as long as we have a kernel big lock,
this shouldn't be a problem.
2000-09-05 16:27:51 +00:00
bouyer
aacf1f7a6a Back out the suspendsched()/resumesched() thing, per request of Jason Thorpe &
Bill Sommerfeld. suspendsched() will be implemented in a different way.
2000-09-05 16:20:27 +00:00
bouyer
629150f864 Add the sched_suspend/sched_resume functions, as discussed on tech-kern,
with the following modifications to the initial patch:
- rename SHOLD and P_HOST to SSUSPEND and P_SUSPEND to avoid confusion with
  PHOLD()
- don't deal with SSUSPEND/P_SUSPEND in fork1(), if we come here while
  scheduler is suspended we're forking proc0, which can't have P_SUSPEND set.

sched_suspend() suspends the scheduling of users process, by removing all
processes from the run queues and changing their state from SRUN to
SSUSPEND. Also mark all user process but curproc P_SUSPEND.
When a process has to be put in SRUN and is marked P_SUSPEND, it's placed in
the SSUSPEND state instead.
sched_resume() places all SSUSPEND processes back in SRUN, clear the P_SUSPEND
flag.
2000-08-31 14:36:19 +00:00
sommerfeld
bdc30aed03 Since the spinlock count is per-cpu, we don't need atomic operations
to update it, so don't bother with <machine/atomic.h>

Flush kernel_lock_release_all() and kernel_lock_acquire_count() (which
didn't do spinlock accounting correctly), and replace them with
spinlock_release_all() and spinlock_acquire_count().
2000-08-26 19:26:43 +00:00
sommerfeld
8d5cbaa48d Forward-declare struct cpu_info 2000-08-26 04:17:44 +00:00
sommerfeld
340951f9d1 On second thought.. pass cpu_info * to roundrobin() explicitly. 2000-08-26 04:01:16 +00:00
sommerfeld
ec08310fab More MP clock/scheduler changes:
- Periodically invoke roundrobin() from hardclock() on all cpu's rather
than from a timer callout; this allows time-slicing on non-primary cpu's.
 - Make pscnt per-cpu.
 - Notice psdiv changes on each cpu, and adjust pscnt at that point.
Also, invoke setstatclockrate() from the clock interrupt when each cpu
notices the divisor change, rather than when starting/stopping the
profiling clock.
2000-08-26 03:34:36 +00:00
thorpej
f759220f40 Define the MI parts of the "big kernel lock" perimeter. From
Bill Sommerfeld.
2000-08-22 17:28:28 +00:00
thorpej
4b2bdb6565 splhigh() -> splsched(). 2000-08-21 02:07:18 +00:00
thorpej
a86d1f4891 Add a lock around the scheduler, and use it as necessary, including
in the non-MULTIPROCESSOR case (LOCKDEBUG requires it).  Scheduler
lock is held upon entry to mi_switch() and cpu_switch(), and
cpu_switch() releases the lock before returning.

Largely from Bill Sommerfeld, with some minor bug fixes and
machine-dependent code hacking from me.
2000-08-20 21:50:06 +00:00
thorpej
8bc6ee56cb Lock debugging fix: Make sure a simplelock's lock_holder gets
initialized properly, and consistently tracks the owning CPU's
cpuid.  Add some diagnostic assertions to enforce this.
2000-08-19 19:36:18 +00:00
cgd
0199b04bef update for changed makesyscalls.master 2000-08-18 19:35:15 +00:00
cgd
3af42e5211 update for changed makesyscalls.sh 2000-08-18 19:26:56 +00:00
cgd
c07a11c347 nuke __P for generated syscall prototypes and sy_call_t 2000-08-18 19:14:33 +00:00
itojun
f5fa53578a repair m_dup(). specifically, now it is safe against non-MCLBYTES cluster
mbuf.  noone seem to be using this function at this moment.
2000-08-18 16:19:22 +00:00
itojun
243eebc256 disable m_dup(), as it makes false assumption on cluster mbuf and unsafe
(does not do the right thing).
2000-08-18 14:23:48 +00:00
thorpej
f2098b2382 Some more lock debugging support:
- LOCK_ASSERT(), which expands to KASSERT() if LOCKDEBUG.
- new simple_lock_held(), which tests if the calling CPU holds
  the specified simple lock.

From Bill Sommerfeld, modified slightly by me.
2000-08-17 04:15:43 +00:00
itojun
85dda25e94 move "options PULLDOWN_TEST" into sys/sys/mbuf.h (in #ifdef _KERNEL),
as it is no wthe default setting for everyone.

the reason we still use the name "PULLDOWN_TEST" while it is now default:
kame code sharing.
2000-08-13 01:31:15 +00:00
thorpej
a91e7a7c6d Don't bother with a trampoline to start the pagedaemon and
reaper threads.
2000-08-12 22:41:53 +00:00
sommerfeld
fe7a6531b0 Add P_BIGLOCK process flag, indicating that the processor should hold
the kernel "big lock" when running this process.
(this is largely a placeholder for now; big lock code will be added later).
2000-08-12 16:38:43 +00:00
ad
19fd9da968 Define SIOC[SG]IFGENERIC in <sys/sockio.h>, as FreeBSD and OpenBSD do. 2000-08-10 11:48:41 +00:00
tv
8bd030c63a Remove the "kprintf" gcc attribute permanently. Use standard "printf"
format checking.  We are now at 1.5E, as the removal of %b will cause
third-party LKMs to break.
2000-08-09 03:23:10 +00:00
mjacob
3910a2e8b1 add SCBUSACCEL ioctl 2000-08-08 22:45:03 +00:00
thorpej
b9d2d53fb8 Add a DIAGNOSTIC or LOCKDEBUG check for held spin locks. 2000-08-07 22:10:52 +00:00
thorpej
b24441d4d1 It doesn't make sense to charge simple locks to proc's, because
simple locks are held by CPUs.  Remove p_simple_locks (which was
unused anyway, really), and add a LOCKDEBUG check for held simple
locks in mi_switch().  Grow p_locks to an int to take up the space
previously used by p_simple_locks so that the proc structure doens't
change size.
2000-08-07 21:55:22 +00:00
bjh21
a62a24f2af Second phase of changes to remove ntp_adjtime(2) from the kernel entirely if
NTP is not defined.

Also removes sysctl_ntptime, since that's unreferenced without NTP.

ntp_gettime(2) is left alone, since it doesn't raise SIGSYS, which sys_nosys()
2000-08-07 18:11:55 +00:00
kleink
755f5b32a4 #ifdef __STDC__ -> #if __STDC__ 2000-08-07 16:35:33 +00:00
chuck
af899e5758 set CSTATUS to CTRL('t') 2000-08-05 01:27:12 +00:00
jdolecek
efe1033005 guard prototypes for lf_* functions by ifdef _KERNEL
Noted by Andrew Brown <atatat@atatdot.net>.
2000-08-04 09:20:21 +00:00
thorpej
4a3f37dd7a 1.5D == namei pathname buffer allocation is pool'ified. 2000-08-03 21:02:04 +00:00
thorpej
7cc27a88c0 Convert namei pathname buffer allocation to use the pool allocator. 2000-08-03 20:41:05 +00:00
thorpej
ed2759b21c Un-__P. 2000-08-01 04:58:55 +00:00
wiz
be8ff811b7 Rename VM_INHERIT_* to MAP_INHERIT_* and move them to sys/sys/mman.h as
discussed on tech-kern.
Retire sys/uvm/uvm_inherit.h, update man page for minherit(2).
2000-08-01 00:53:07 +00:00
jdolecek
e25636b5da g/c RB_DFLTROOT
I've tried hard to find also various usage() messages and remove the
appropriate flag from there as well, hopefully all occurences are covered.
2000-07-29 20:06:27 +00:00
kleink
11ecb446f3 Avoid recursion with traditional cpp. 2000-07-28 09:33:28 +00:00
itojun
4f825aaddd recover traditional MINCLSIZE (= MHLEN + MLEN + 1). it will make
drivers less aggressive about use of cluster mbufs.

this chnage affects drivers with m_devget()-emulation.  many of
recent drivers do not look at MINCLSIZE any more, not sure why.
2000-07-27 17:18:19 +00:00
augustss
54fb7baa71 Fix CIRCLEQ_FOREACH so that it actually works. I guess noone has used this
macro either.
2000-07-26 12:19:40 +00:00
augustss
c65b9bc807 Make parens match in CIRCLEQ_FOREACH_REVERSE; I guess this macro has never
been used before.
2000-07-26 11:01:01 +00:00
mycroft
9af78695ed Introduce Elf64_Xword and Elf64_Sxword, and use them in various places instead
of Elf64_Word.
Make Elf64_Word be 32 bits on sparc64.  (XXXX Need to determine what it's
supposed to be on other, but it's current used to size entries in DT_HASH,
which is 32 bits on sparc64 and 64 bits on alpha.)
2000-07-26 02:04:53 +00:00
mycroft
0b9155381b #if 0 a static declaration for a function that does not exist. 2000-07-23 22:56:14 +00:00
jdolecek
e026e76486 bump to 1.5C - lf_advlock() change 2000-07-22 16:50:39 +00:00
jdolecek
b0fb24279c change the lf_advlock() arguments from
int     lf_advlock __P((struct lockf **,
           off_t, caddr_t, int, struct flock *, int));
to

int     lf_advlock __P((struct vop_advlock_args *, struct lockf **, off_t));

This matches common usage and is also compatible with similar change
in FreeBSD (though they use u_quad_t as last arg).
2000-07-22 15:26:11 +00:00
jdolecek
776aee855f ditch the ifndef _KERNEL around includes needed for some parts
of kinfo_struct - needing to include <uvm/uvm_extern> before <sys/sysctl.h>
is annoying, especially when porting external kernel stuff
2000-07-22 14:59:23 +00:00
matt
188363bf6a Make gcc-2.96 shutup about trigraph ignored. 2000-07-22 05:02:24 +00:00
jeffs
5e822c0f84 Backout last iic change. Will work with cgd to get an i2c code we all
can be happy with.
2000-07-21 19:41:57 +00:00
jeffs
f7337ad9b1 Add cdev_iic_init() macro [i2c bus]. 2000-07-21 18:05:57 +00:00
thorpej
9c881e00cb Add a SIOCGIFCLONERS ioctl, which fetches a list of network
interface cloners from the kernel.
2000-07-20 18:40:26 +00:00
deberg
6d22be08eb add *_FOREACH() and {TAILQ,CIRCLEQ}_FOREACH_REVERSE() macros from
freebsd.  fix some of the comments up top.
2000-07-20 03:36:38 +00:00
lukem
b1fcf03d7f freebsd kqueue implementation 2000-07-18 22:11:54 +00:00
tv
1276c517f4 Remove ENOTSUP for the moment. This needs a unique number, as noted by
kleink, and there are a few more from SUSv2 that we should have for
completeness anyway--these will be added in the near future.
2000-07-14 21:39:56 +00:00
thorpej
195bf5c09f - Fix the likely cause of the "ps(1) hangs machine" problem. Always
vslock the user pages for the data being copied out to userspace,
  so that we won't sleep while holding a lock in case we need to
  fault the pages in.
- Sprinkle some const and ANSI'ify some things while here.
2000-07-14 07:21:21 +00:00
thorpej
8fd9032b90 ANSI'ify. 2000-07-14 07:14:33 +00:00
tv
69e557a91c Add _XOPEN_SOURCE protections. The need for these is questionable, advised
by kleink about the E* predefined namespace; we'll look into that.

Also add ENOTSUP from SUSv2 as an alias for EOPNOTSUPP.  It's used by the
SUSv2 pthreads interface, has the same meaning, and pthreads does not use
EOPNOTSUPP.
2000-07-14 00:52:02 +00:00
simonb
b10a1b69be Add a KERN_CONSDEV sysctl that returns cn_tab->cn_dev (if cn_tab is not
NULL).
2000-07-13 14:26:43 +00:00
matt
81ce10aa1f Extend the vmcmd stuff a bit. Add a flags field and define
VMCMD_BASE & VMCMD_RELATIVE.  This allows one to add vmcmds
which are relative to previous entries.  This is needed for
loading the VAX ld.elf_so
2000-07-13 01:24:04 +00:00
itojun
d8a9a3cc7b add ppsratelimit(9), which does event-per-sec rate limitation.
use it from icmp6 error rate limitation code.
XXX better name for the function?
2000-07-09 06:44:57 +00:00
mycroft
caf07dfa04 When unmounting, make sure to free the syncer vnode so that it can be reused. 2000-07-09 00:59:03 +00:00
sommerfeld
e292542bce More format attributes 2000-07-08 17:36:01 +00:00
jdolecek
53385f1dfd adjust maximum number of vnodes in vnode cache according
to machine memory size upon boot if the number has not been specified
explicitly in kernel config - at this moment, 0.5% of system
memory is used for vnodes (but minimum NVNODE vnodes)
2000-07-06 09:51:54 +00:00
thorpej
fcebfb1295 Add a device_lookup() macro which encapsulates a small snippet of code
that tons and tons of files all over the tree duplicate, many in slightly
different ways.
2000-07-06 00:42:35 +00:00
thorpej
cde72a2c2b Garbage-collect __BDEVSW_DUMP_OLD_TYPE. 2000-07-05 23:31:12 +00:00
christos
76acd28d57 delint a macro 2000-07-05 02:47:23 +00:00
jdolecek
1ec07d7439 change tablefull() to accept one more parameter - optional hint
use that to inform about way to raise current limit when we reach maximum
number of processes, descriptors or vnodes

XXX hopefully I catched all users of tablefull()
2000-07-04 15:33:28 +00:00
thorpej
1e58f22342 Add the notion of "cloning" of network pseudo-interface (e.g. `gif').
This allows them to be created and destroyed on the fly via ifconfig(8),
rather than specifying the count in the kernel configuration file.
2000-07-02 00:20:48 +00:00
veego
04af9ede2c We are now at 1.5B because of the removal of <vm/*>. 2000-06-30 07:44:05 +00:00
mrg
08fa86fe4b use <uvm/uvm_extern.h> instead of <vm/vm.h> 2000-06-29 09:01:09 +00:00
fvdl
975751cda2 vinsheadfree -> ungetnewvnode 2000-06-27 23:51:51 +00:00
fvdl
4ff91a9bc3 Add vinsheadfree prototype. 2000-06-27 23:36:06 +00:00
kleink
83b6632673 Define intptr_t and uintptr_t via <machine/int_types.h>. 2000-06-27 05:51:54 +00:00
kleink
b24866edab Be less invasive and use private names for exact-width integer types. 2000-06-27 05:00:26 +00:00
christos
86d457164d add an MNT_IGNORE flag as a hint to df not to list the filesystem by default. 2000-06-26 21:10:34 +00:00
kleink
fafdb20b11 Add brief descriptions to the types provided. 2000-06-26 17:11:32 +00:00
kleink
034f24247e Provide local definitions of mode_t and off_t, thus eliminating the need
for an application to include <sys/types.h> first.
2000-06-26 16:54:38 +00:00
kleink
b6d4c4d3a9 Define mode_t via __mode_t. 2000-06-26 16:53:47 +00:00
kleink
848fb35eed Define __mode_t. 2000-06-26 16:53:20 +00:00
kleink
3e2cc418c9 Define off_t by means of <sys/ansi.h>. 2000-06-26 15:51:37 +00:00
kleink
811a7d76bb Define __off_t. 2000-06-26 15:51:15 +00:00
kleink
d2787dad27 XNS5.2: define sa_family_t and use it where specified by the standard. 2000-06-26 15:48:19 +00:00
kleink
8e34a044db Define __sa_family_t. 2000-06-26 15:45:43 +00:00
mrg
9049a6f1e3 remove redundant vm includes. 2000-06-26 15:04:52 +00:00
mrg
2f159a1bac remove/move more mach vm header files:
<vm/pglist.h> -> <uvm/uvm_pglist.h>
	<vm/vm_inherit.h> -> <uvm/uvm_inherit.h>
	<vm/vm_kern.h> -> into <uvm/uvm_extern.h>
	<vm/vm_object.h> -> nothing
	<vm/vm_pager.h> -> into <uvm/uvm_pager.h>

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.
2000-06-26 14:20:25 +00:00
simonb
889c658b5b Change the kernel mmap interface so that the offset to map is an
"off_t" and the return value is a "paddr_t" to allow mappings
at offsets past 2^31 bytes.  Somewhat inspired by FreeBSD, which
only changed the offset to a "vm_offset_t".

Includes updates for the i386, pc532 and sh3 mmmmap from Jason Thorpe.
2000-06-26 04:55:19 +00:00
thorpej
45cae282a7 Need opt_lockdebug.h for previous. 2000-06-24 23:52:24 +00:00
pk
f71858b51b Don't inline malloc/free if LOCKDEBUG is on. 2000-06-24 22:24:15 +00:00
thorpej
917871ad64 Pull in <sys/ioccom.h>, and define ENVSYS_NSENSORS (number of sensor
types).
2000-06-24 19:50:28 +00:00
thorpej
dff38f099c Add cdev_sysmon_init(). 2000-06-24 00:39:04 +00:00
matt
d4513b2c95 Add vmcmd_readvn (which was the 2nd halt of vmcmd_map_readvn). 2000-06-21 05:41:07 +00:00
veego
dd68d1f399 Fix the version comment: s/1.4ZD/1.5A/
Noticed by pooka.
2000-06-20 17:59:42 +00:00
fvdl
c92917ebae Declare 1.5A 2000-06-20 12:42:37 +00:00
simonb
00d1b6b147 Add a KERN_MSGBUF sysctl to return the message buffer. 2000-06-16 00:18:09 +00:00
cgd
ef767ee388 Replace my personal attribution string ("This product includes software
developed by Christopher G. Demetriou for the NetBSD Project.") with
a generic NetBSD one ("This product includes software developed for the
NetBSD Project.  See http://www.netbsd.org/ for information about NetBSD.")
so that this same set of terms can be used by others if they so desire.
(Eventually i'll be converting more/all of my code.)
2000-06-13 22:36:16 +00:00
simonb
e907fee281 In the KERN_GETPROC* handler:
* Handle KERN_PROC_SESSION that has been defined in <sys/sysctl.h> from
  day one.
* Add handlers for KERN_PROC_GID and KERN_PROC_RGID.
* If "op" doesn't valid, return EINVAL.
2000-06-13 01:27:00 +00:00
sommerfeld
c0011ad705 Fix several problems with lockf/fcntl byte range locks:
- document a data structure invariant in lockf.h
 - add KASSERT() to check the invariant.
 - be more consistent about dequeuing ourselves from the blocked list
after a tsleep().
 - Fix two places where the invariant is violated.
 - correct a few comments here and there
 - If we're still following a lock dependancy chain after maxlockdepth
processes and haven't gotten back to the start, assume that we're in a
cycle anyway and return EDEADLK.

Fix is a superset of an existing fix in FreeBSD, but independantly
derived.

Fixes kern/3860.
2000-06-12 14:33:04 +00:00
veego
cb0489b10b Bump to 1.4ZD after IP Filter was updated to 3.4.6. 2000-06-12 13:55:07 +00:00
assar
600b645470 bump version to 1.4ZC (changed vfs_getnewfsid) 2000-06-11 07:16:20 +00:00
sommerfeld
e964d558a7 Fix assorted bugs around shutdown/reboot/panic time.
- add a new global variable, doing_shutdown, which is nonzero if
vfs_shutdown() or panic() have been called.
- in panic, set RB_NOSYNC if doing_shutdown is already set on entry
so we don't reenter vfs_shutdown if we panic'ed there.
 - in vfs_shutdown, don't use proc0's process for sys_sync unless
curproc is NULL.
 - in lockmgr, attribute successful locks to proc0 if doing_shutdown
&& curproc==NULL, and  panic if we can't get the lock right away; avoids the
spurious lockmgr DIAGNOSTIC panic from the ddb reboot command.
 - in subr_pool, deal with curproc==NULL in the doing_shutdown case.
 - in mfs_strategy, bitbucket writes if doing_shutdown, so we don't
wedge waiting for the mfs process.
 - in ltsleep, treat ((curproc == NULL) && doing_shutdown) like the
panicstr case.

Appears to fix: kern/9239, kern/10187, kern/9367.
May also fix kern/10122.
2000-06-10 18:44:43 +00:00
assar
6c734cd283 make vfs_getnewfsid only take one argument and fetch the name of the
filesystem from the supplied mount argument.  also make makefstype
take a const parameter.  update all the callers.
2000-06-10 18:27:01 +00:00
danw
f7d6ee345c Use _POSIX_SOURCE-safe type names 2000-06-08 19:01:44 +00:00
thorpej
c7eb823cc8 1.4ZB -- ltsleep(). 2000-06-08 05:53:34 +00:00
thorpej
fcc7898856 Change tsleep() to ltsleep(), which takes an interlock argument. The
interlock is released once the scheduler is locked, so that a race
between a sleeper and an awakener is prevented in a multiprocessor
environment.  Provide a tsleep() macro that provides the old API.
2000-06-08 05:50:37 +00:00
thorpej
0b01d83083 Revert rev. 1.30. 2000-06-07 16:37:24 +00:00
tron
f92ae923f9 Make "src/regress/sys/kern/extent" build again. 2000-06-07 16:25:15 +00:00
thorpej
85063167c9 Correct SIMPLELOCK_INITIALIZER for the LOCKDEBUG case. 2000-06-07 13:50:40 +00:00
sommerfeld
7497ddcce5 /dev/random code cleanups:
- Add comments about which spls apply to which data structures.
 - Consistently protect the rnd_samples queue (the queue of
unprocessed samples) at splhigh().
 - allow MD code to supply cpu_timestamp() and cpu_havetimestamp() for
an optional higher-resolution clock/roulette wheel source.
 - Collect more statistics on the pool state (keeping track of where
collected bits are going, in addition to where they came from).
 - Add RNDGETPOOLSTAT ioctl to get the additional stats.
 - Flush a few unused rndpool calls.
 - XXX XXX Cryptographic changes:
  - 32-bit rotate is:
	((val << rp->rotate) | (val >> (32 - rp->rotate))),
    not
	(val << rp->rotate) | (val >> rp->rotate)
    or
	((val << rp->rotate) | (val >> (31 - rp->rotate)))
  - Avoid overloading of rp->rotate and double-rotation of data
(which limited pool mixing somewhat; "rotate" never got above 7).
  - Be more paranoid (but probably not paranoid enough) about mixing
output back into the pool.  This is an improvement, but it needs
revisiting soon.

We should follow the spirit of some of the recommendations in
the Schneier PRNG papers:

http://www.counterpane.com/yarrow-notes.html
http://www.counterpane.com/pseudorandom_number.html

including:
 - two (or more) stage operation for better isolation between inputs
and outputs.
 - use of keyed one-way functions (probably better even than
invertible keyed functions like 3DES) at key points in the data flow,
so that breaking the PRNG is clearly as hard as breaking the function.
2000-06-05 23:42:34 +00:00
cgd
0d6c1f9870 This is the dawning of the age of Aquarius ... o/~ (evcnt bumps us to 1.4ZA) 2000-06-04 19:17:27 +00:00
cgd
cffb580806 Implement the more flexiable `evcnt' interface as discussed (briefly) on
tech-kern and now documented in evcnt(9).
2000-06-04 19:14:14 +00:00
mycroft
e9deffe0bf Move a bunch of the COFF definitions into exec_coff.h, so they can be used by
other code.   XXX Not tested on SH3 yet.
2000-06-04 16:23:59 +00:00
thorpej
581e676913 Protect kernel function prototypes with _KERNEL. 2000-06-04 15:18:08 +00:00
itojun
0376690bbf move socklen_t decl to sys/ansi.h.
sys/socket.h pulls in sys/ansi.h and declare socklen_t as necessary.
the change is to allow declaration of socklen_t with less inclusion ordering
constraints.  (netdb.h needs this change)
2000-06-04 08:50:28 +00:00
thorpej
5b281c5932 Move schedticks and cp_time into schedstate_percpu. Also, allow
non-primary CPUs to call hardclock(), but make them bail about
before updating global timekeeping state (that's the job of the
primary CPU).
2000-06-03 20:42:42 +00:00
matt
dd335d2595 add M_SOFTINTR 2000-06-03 18:22:38 +00:00
simonb
01ba921ad2 p_xstat and p_acflag should be u_int16_t, not int16_t. 2000-06-03 04:15:43 +00:00
simonb
38cc1b3975 Add new sysctl node "KERN_SYSVIPC_INFO" with "KERN_SYSVIPC_MSG_INFO",
"KERN_SYSVIPC_SEM_INFO" and "KERN_SYSVIPC_SHM_INFO" to return the
info and data structures for the relevent SysV IPC types.  The return
structures use fixed-size types and should be compat32 safe.  All
user-visible changes are protected with
	#if !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)

Make all variable declarations extern in msg.h, sem.h and shm.h and
add relevent variable declarations to sysv_*.c and remove unneeded
header files from those .c files.

Make compat14 SysV IPC conversion functions and sysctl_file() static.

Change the data pointer to "void *" in sysctl_clockrate(),
sysctl_ntptime(), sysctl_file() and sysctl_doeproc().
2000-06-02 15:53:03 +00:00
cgd
00b28e7a52 another mod of opportunity: const poison. (cfprint_t should take
const char * as second arg, too, but that's Hard.)  also, convert use
of "(char *)0" to NULL.
2000-06-02 01:48:50 +00:00
cgd
a556975be3 __P and K&R declarations -> ANSI protos + declarations. tweak NetBSD IDs,
and __KERNEL_RCSID to subr_autoconf.c.
2000-06-02 01:31:52 +00:00
matt
9ed466ce4b Add extern struct device *booted_device (make MI instead of MD since nearly
every port uses it).
2000-06-01 00:03:10 +00:00
thorpej
956b3ca3b3 Track which process a CPU is running/has last run on by adding a
p_cpu member to struct proc.  Use this in certain places when
accessing scheduler state, etc.  For the single-processor case,
just initialize p_cpu in fork1() to avoid having to set it in the
low-level context switch code on platforms which will never have
multiprocessing.

While I'm here, comment a few places where there are known issues
for the SMP implementation.
2000-05-31 05:02:31 +00:00
simonb
e94f50731b Use u_int64_t for cp_time[] and the tk_* terminal counters. 2000-05-29 11:35:19 +00:00
soren
5abcf38c02 Whitespace police. 2000-05-28 20:03:21 +00:00
ragge
f3eeb5b356 Remove vsio.h. 2000-05-28 19:42:31 +00:00
ragge
074bc79414 There is no reason at all to have DEC's internal state data structures for
the VS100 in our source tree. And especially not in /sys :-)
2000-05-28 19:42:01 +00:00
thorpej
e03e9e8086 Rather than starting init and creating kthreads by forking and then
doing a cpu_set_kpc(), just pass the entry point and argument all
the way down the fork path starting with fork1().  In order to
avoid special-casing the normal fork in every cpu_fork(), MI code
passes down child_return() and the child process pointer explicitly.

This fixes a race condition on multiprocessor systems; a CPU could
grab the newly created processes (which has been placed on a run queue)
before cpu_set_kpc() would be performed.
2000-05-28 05:48:59 +00:00
mycroft
4656dfd24f Add a new function to remove extra buffers when truncating a file. This is
more generic than the vinvalbuf(V_SAVEMETA) case, avoiding synchronous
operations when truncating to a non-zero length.
2000-05-28 04:13:56 +00:00
mycroft
820e777524 Add *_EMPTY() and SLIST_NEXT(). 2000-05-27 22:17:54 +00:00
simonb
4f6ebe8e2a The name of the KERN_PROC_ARGS sysctl is proc_args, not proc_argv. 2000-05-27 15:28:58 +00:00
sommerfeld
0ee7e28d72 Add include of <sys/time.h> for now.. 2000-05-27 13:51:38 +00:00
kleink
0bc407a568 Spelling nit. 2000-05-27 12:22:24 +00:00
thorpej
6d02ce1e66 All users of the old sleep() are now gone; nuke it. 2000-05-27 05:00:47 +00:00
sommerfeld
40339b39f9 Reduce use of curproc in several places:
- Change ktrace interface to pass in the current process, rather than
p->p_tracep, since the various ktr* function need curproc anyway.

 - Add curproc as a parameter to mi_switch() since all callers had it
handy anyway.

 - Add a second proc argument for inferior() since callers all had
curproc handy.

Also, miscellaneous cleanups in ktrace:

 - ktrace now always uses file-based, rather than vnode-based I/O
(simplifies, increases type safety); eliminate KTRFLAG_FD & KTRFAC_FD.
Do non-blocking I/O, and yield a finite number of times when receiving
EWOULDBLOCK before giving up.

 - move code duplicated between sys_fktrace and sys_ktrace into ktrace_common.

 - simplify interface to ktrwrite()
2000-05-27 00:40:29 +00:00
thorpej
0ef4481fd3 We made it to 1.4Z, woo! My scheduler hacking, Simon's sysctl proc
stuff.
2000-05-26 21:31:00 +00:00
thorpej
a7d0570e67 First sweep at scheduler state cleanup. Collect MI scheduler
state into global and per-CPU scheduler state:

	- Global state: sched_qs (run queues), sched_whichqs (bitmap
	  of non-empty run queues), sched_slpque (sleep queues).
	  NOTE: These may collectively move into a struct schedstate
	  at some point in the future.

	- Per-CPU state, struct schedstate_percpu: spc_runtime
	  (time process on this CPU started running), spc_flags
	  (replaces struct proc's p_schedflags), and
	  spc_curpriority (usrpri of processes on this CPU).

	- Every platform must now supply a struct cpu_info and
	  a curcpu() macro.  Simplify existing cpu_info declarations
	  where appropriate.

	- All references to per-CPU scheduler state now made through
	  curcpu().  NOTE: this will likely be adjusted in the future
	  after further changes to struct proc are made.

Tested on i386 and Alpha.  Changes are mostly mechanical, but apologies
in advance if it doesn't compile on a particular platform.
2000-05-26 21:19:19 +00:00
simonb
485b240b6f Add some new sysctls to help abolish the dreaded "proc size mismatch"
errors from ps(1) and some other kernel grovellers, and return some
data that has previously only been accessable with /dev/kmem read
access.  The sysctls are:

 + KERN_PROC2 - return an array of fixed sized "struct kinfo_proc2"
   structures that contain most of the useful user-level data in
   "struct proc" and "struct user".  The sysctl also takes the size of
   each element, so that if "struct kinfo_proc2" grows over time old
   binaries will still be able to request a fixed size amount of data.
 + KERN_PROC_ARGS - return the argv or envv for a particular process id.
   envv will only be returned if the process has the same user id as the
   requestor or if the requestor is root.
 + KERN_FSCALE - return the current kernel fixpt scale factor.
 + KERN_CCPU - return the scheduler exponential decay value.
 + KERN_CP_TIME - return cpu time state counters.

With input and suggestions from many people on tech-kern.
2000-05-26 02:23:12 +00:00
thorpej
8964c35eca Introduce a new process state distinct from SRUN called SONPROC
which indicates that the process is actually running on a
processor.  Test against SONPROC as appropriate rather than
combinations of SRUN and curproc.  Update all context switch code
to properly set SONPROC when the process becomes the current
process on the CPU.
2000-05-26 00:36:42 +00:00