Commit Graph

88 Commits

Author SHA1 Message Date
gehenna 77a6b82b27 Merge the gehenna-devsw branch into the trunk.
This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

	device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
  by using this grammer.

- Added the new naming convention.
  The name of the device switch must be <prefix>_[bc]devsw for auto-generation
  of device switch tables.

- The backward compatibility of loading block/character device
  switch by LKM framework is broken. This is necessary to convert
  from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
  We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
  the LKM framework will refer it to assign device major number dynamically.
2002-09-06 13:18:43 +00:00
matt 48bbf5f234 Use the queue macros from <sys/queue.h> instead of referring to the queue
members directly.  Use *_FOREACH whenever possible.
2002-09-04 01:32:31 +00:00
thorpej 556e3c90c4 Fix a signed/unsigned comparison warning from GCC 3.3. 2002-08-25 22:32:02 +00:00
thorpej c57c6b52cb Make uiomove()'s count argument a size_t rather than an int. 2002-08-25 22:28:40 +00:00
thorpej f02cb5ee27 Make hashinit() use unsigned quantities throughout. 2002-08-25 20:01:12 +00:00
matt 2d290eb699 Use the qtype_FOREACH macros. Print out address of hook that could not
be disestablished.
2002-08-23 20:50:25 +00:00
thorpej 67b2a0cf06 * Add copyin_proc() and copyout_proc(), which are like copyin() and
copyout(), except they can operate on any process, not just curproc.
* Use this in uiomove() to allow UIO_USERSPACE to non-curproc.
2002-07-20 03:58:24 +00:00
christos acf2d4083d Niels Provos systrace work, ported to NetBSD by kittenz and reworked... 2002-06-17 16:22:50 +00:00
christos f7d98e2451 - merge all the hook insertion and deletion code so that we don't create
a fourth copy.
- add exithook to be executed when a process exits.
2002-03-17 22:19:20 +00:00
simonb 9a942a34e0 Don't use local extern declarations for the mountroot variable or
declare local prototypes for nfs_mountroot() or md_root_setconf().
2002-03-04 02:25:21 +00:00
thorpej 7380aa1467 Add a "ddb" command (if DDB is configured into the kernel) for
easy, convenient dropping into DDB at the "root device: " prompt.
Useful if your console can't do it w/o actually taking an interrupt
and you want to, say, look at the boot messages.
2002-02-08 00:58:58 +00:00
lukem adc783d537 add RCSIDs 2001-11-12 15:25:01 +00:00
thorpej 9ec2953eef Make "reboot" an option at the root device/filesystem prompt (we
already had a "halt").
2001-05-27 01:29:50 +00:00
cgd 926244ff0d nuke extra token (;) after #endif 2001-01-12 22:55:10 +00:00
fvdl 538c381225 findblkname is not static (and is in fact used outside this file). 2000-12-10 14:14:15 +00:00
takemura 3c9d9276dc Add new powerhook argument values, PWR_SOFTSUSPEND, PWR_SOFTSTANDBY and
PWR_SOFTRESUME. Apm calls powerhook with the values in normal interrupt
priority level while others are protected with splhigh().
2000-11-26 11:08:57 +00:00
ad 5fcf59fd7c Allow for creation of both LIST and TAILQ based hashes by adding a `hash
type' argument to hashinit().
2000-11-08 14:25:23 +00:00
augustss 72afbf03cf Run power hooks in reverse installation order when powering down and
installation order when powering up.  This allows drivers in a hierarchy
to DTRT.
2000-07-26 12:24:52 +00:00
enami 52a5cc1c5e Make this file compile with DIAGNOSTIC. 2000-05-31 06:18:03 +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
enami ec808c5ba9 Make this file compiles with !DIAGNOSTIC. 2000-05-27 01:43:27 +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
enami c6f0aaa60f Check malloc failure. 2000-05-10 02:16:15 +00:00
enami 007d263ce9 Cosmetic change. 2000-05-10 02:14:41 +00:00
itojun e6469f14ad move static function getstr() to cons.c, make it publically available
as cngetsn().  there will be other consumer.
2000-05-08 16:30:57 +00:00
augustss 264f1d27c6 Get rid of register declarations. 2000-03-30 09:27:11 +00:00
thorpej 7c8b72d592 uiomove(): if we're informed that we should yield the CPU, use the new
preempt() primitive to do so.
2000-03-23 20:39:58 +00:00
jdolecek 677d6a9962 add hashdone() - frees memory previously allocated via hashinit() 2000-03-16 17:19:53 +00:00
enami 13d92f98ce Remove unnecessary asterisk in comment (probably it was comment leader of
multiline comment).
2000-03-01 03:51:29 +00:00
enami 543db3a000 Cosmetic changes. 2000-03-01 03:50:04 +00:00
sommerfeld cd14e5fa0c Add a fifth "divisor" argument to humanize_number; suitable values are
either 1024 or 1000.
Needed because frequencies use decimal rather than power-of-two SI
prefixes.
2000-02-20 19:32:28 +00:00
oster 919df6690a Add support for / on RAID. A bit of a gross hack, but sufficient for now.
Note that this doesn't help you much until the RAID autoconfig code
in sys/dev/raidframe/rf_netbsdkintf.c is turned on.
2000-02-13 04:57:44 +00:00
enami 3669884c32 Factor out a common functionality into a subroutine. 2000-02-01 05:28:01 +00:00
enami 65c138fea0 - Print a name of root device even if it is a network device.
- If RB_ASKNAME, only dumpdv holds the results asked interactively.
  Examie dumpspec only when !RB_ASKNAME.  This allows us to override
  dumps on none in kernel config file by booting kernel with RB_ASKNAME.
- Slightly rearrange code so that it more matches to comment.
2000-01-25 09:23:59 +00:00
enami 047cc5e94f Cleanup setroot() a bit:
- No longer necessary to use goto, just breaking the loop like other case
  is enough.
- Don't caliculate loop invariant every time.  Just reuse.
2000-01-25 03:42:36 +00:00
fvdl 65e677bd99 Add an exec hook mechanism, where kernel subsystem can register to
execute certain functions when a process does an exec(). Currently
uses a global list. Could possibly be done using a per-process list,
but this needs more thought.
2000-01-25 01:15:14 +00:00
augustss 94b815050e Add powerhooks, i.e., the ability to register a function that will be
called when the machine does a suspend or resume.
XXX Will go away when Jason's kevents come to life.
1999-06-26 08:25:25 +00:00
thorpej d76e7b8c6d Don't pass a nam2blk around at all; just have setroot() and friends reference
dev_name2blk[] directly.  Addresses PR #7622 (ITOH Yasufumi), although
in a different way.
1999-06-07 20:16:08 +00:00
lukem 5e76cbddfb in humanize_number(), when printing a u_int64_t, use '%qu' (unsigned long long)
instead of '%qd' (long long)
1999-06-02 05:53:56 +00:00
lukem 03b1725220 rework format_bytes() into a more generic humanize_number().
implement the former with the latter.
1999-05-20 05:58:19 +00:00
lukem 719cd63d24 Implement format_bytes(), which pretty prints a given u_int64_t into a
given buffer, and if necessary, reducing the display width of the
number to fit in the buffer by increasing the units (from kilobytes
(2^10) through to exabytes (2^60)).
1999-05-09 13:48:44 +00:00
mrg 48c12bfeed revert previous. oops. 1999-04-21 02:37:07 +00:00
mrg 58540a2274 properly test the msgsz as "msgsz - len". from PR#7386 1999-04-21 02:31:49 +00:00
mrg d2397ac5f7 completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
1999-03-24 05:50:49 +00:00
kleink f69591d12d Use of casts as lvalues is a GNU C extension; rearrange slightly. 1999-02-10 17:03:26 +00:00
jonathan c9d036d796 defopt MEMORY_DISK_{HOOKS,SERVER,IS_ROOT}. 1999-02-07 09:34:58 +00:00
chs 5819a5d0f4 fix an off-by-one space-waster in hashinit() and add some description. 1999-01-22 07:57:13 +00:00
perry 275d1554aa Abolition of bcopy, ovbcopy, bcmp, and bzero, phase one.
bcopy(x, y, z) ->  memcpy(y, x, z)
ovbcopy(x, y, z) -> memmove(y, x, z)
   bcmp(x, y, z) ->  memcmp(x, y, z)
  bzero(x, y)    ->  memset(x, 0, y)
1998-08-04 04:03:10 +00:00
perry 730baa7431 fix sizeofs so they comply with the KNF style guide. yes, it is pedantic. 1998-07-31 22:50:48 +00:00
kleink fe2d01988e Fix some arithmetics lossage on typeless pointers. 1998-05-08 18:18:55 +00:00