Commit Graph

2740 Commits

Author SHA1 Message Date
manu
39b522c107 back out the previous change, which is useless. Darwin loads the libraries
that are required by the binary, not the libraries required by the libraries
required by the binary.

Hopefully, binaries should load again on i386.
2002-11-29 15:49:09 +00:00
manu
b36d0c1bf6 Maitain a chainedlist of already loaded Mach-O objects, to avoid loading
the same file multiple times because of recursive loading (ie: libx require
liby and libz and liby require libz, so libz would be loaded twice)

This is probably suboptimal, but it enable /bin/sh to load on the PowerPC,
so it's a good interim solution until we figure precisely how things should
work.

I'm not sure whether this makes the excessive recursive check useless or not.
2002-11-29 11:31:11 +00:00
wiz
53447847a8 Fix typo in comment. 2002-11-27 13:47:15 +00:00
tron
b60d9eb23c For some mysterious reason we have to actually install "siginfo.h" to be
able to use it.
2002-11-27 13:30:06 +00:00
junyoung
f8c198033a Program header types 0x60000000 ~ 0x6fffffff are reserved for
OS-specific semantics.
2002-11-27 13:15:50 +00:00
lukem
0635de35a3 Remove KDIR=, since SYS_INCLUDE=symlinks and KDIR are not supported any more. 2002-11-26 23:30:07 +00:00
christos
410171110f change fields of struct selinfo from si_ to sel_ so that the don't conflict
with siginfo members.
2002-11-26 19:08:06 +00:00
christos
0cce063c0c deal with siginfo changes, but don't enable SA_SIGINFO outside the kernel
yet, since we are not ready.
2002-11-26 19:07:14 +00:00
christos
50f8466034 This is not used yet. 2002-11-26 19:06:38 +00:00
manu
589ff87f68 Rewrite the excessive recursive loading protection by actually counting the
recursions instead of the total function calls. We limit to 6 recursion,
which is what Darwin does.
2002-11-24 21:59:43 +00:00
thorpej
3d64e26035 Add an EVCNT_ATTACH_STATIC() macro which gathers static evcnts
into a link set, which are added to the list of event counters
at boot time.
2002-11-24 17:33:43 +00:00
manu
f528c56f39 Check for excessive recursive Mach-O loading 2002-11-21 22:30:32 +00:00
manu
af59b63bbd We now have the exact stack initial stack layout of Darwin:
macho_hdr, argc, *argv, NULL, *envp, NULL, progname, NULL,
*progname, **argv, **envp

Where progname is a pointer to the program name as given in the first
argument to execve(), and macho_hdr a pointer to the Mach-O header at
the beginning of the executable file.
2002-11-21 19:53:40 +00:00
christos
0b0eb68538 fix typos in cpu macros. 2002-11-19 19:54:36 +00:00
junyoung
f2edc229d3 - No need to include sys/param.h and sys/types.h here.
- KNF.
2002-11-19 09:53:16 +00:00
chs
ab17ec89d1 add support for __MACHINE_STACK_GROWS_UP platforms. from fredette@ 2002-11-17 22:53:46 +00:00
manu
dc4f3b6625 Introduction of IRIX sysctl broke binary compatibility because I changed the
offset of the Linux entry. Fix this.
2002-11-17 19:54:59 +00:00
uebayasi
c041971257 Fix compilation errors introduced by recent trace_enter()/ktrsyscall() changes.
Provided by FUKAUMI Naoki <naoki at fukaumi dot org> in kern/19070.
2002-11-16 07:40:38 +00:00
wrstuden
80e7381d17 Make O_NOCTTY have the same number of leading zeros as all the other
macros in this file. Makes figuring out what bits are in use easier.
2002-11-14 04:03:35 +00:00
kleink
60e088b1a4 Oops, ENOSR: resource -> resources here, too. 2002-11-12 13:52:28 +00:00
skrll
b207990164 Add the missing errno symbols that are defined in IEEE Std 1003.1-2001.
The language message files need updating.

Change reviewed and OK'd by Klaus Klein.
2002-11-12 08:20:02 +00:00
fvdl
d0e6437e6d Back out previous, it caused compile errors in kern_fork.c. ISSET
and friends should either be made first-class citizens and moved
to an include file (systm.h perhaps), or nuked completely, but
not be redefined in a lot of files.
2002-11-10 14:01:57 +00:00
jdolecek
0a0804119d move definitions of custom SET()/ISSET()/CLR() macros from
sys/systrace.h to kern/kern_systrace.c
2002-11-10 10:01:03 +00:00
thorpej
dccc71f1fe Fix signed/unsigned comparison warnings. 2002-11-10 03:28:59 +00:00
manu
99bc517790 Added sysctl to change all IRIX kernel values reported by uname and systeminfo:
OS name, hw name, kernel version, and so forth.
2002-11-09 09:03:56 +00:00
manu
9a4dfe85fa Added two sysctl-able flags: proc.curproc.stopfork and proc.curproc.stopexec
that can be used to block a process after fork(2) or exec(2) calls. The
new process is created in the SSTOP state and is never scheduled for running.

This feature is designed so that it is esay to attach the process using gdb
before it has done anything.

It works also with sproc, kthread_create, clone...
2002-11-07 00:22:28 +00:00
thorpej
80f8dbe30a Add a new VM map, lkm_map, which machine-dependent code can provide
in the event that it needs to use a special VM range (x86_64 falls
into this category).  We fall back onto kernel_map if machine-dependent
code doesn't create a special map.
2002-11-05 01:24:35 +00:00
perry
4f27ab21b8 /*CONTCOND*/ while (0)'ed macros 2002-11-02 07:30:55 +00:00
yamt
80fb7e0013 M_ZERO for inline'ed MALLOC. 2002-11-02 06:24:34 +00:00
thorpej
4b17905e0f Add support for "link sets", which are arrays of pointers to objects
gathered together in named sections by the linker.
2002-11-01 22:58:44 +00:00
mrg
514174fe75 disk_unbusy() change -> NetBSD 1.6K. 2002-11-01 12:49:47 +00:00
mrg
603098b9b5 implement separate read/write disk statistics:
- disk_unbusy() gets a new parameter to tell the IO direction.
	- struct disk_sysctl gets 4 new members for read/write bytes/transfers.
	when processing hw.diskstats, add the read&write bytes/transfers for
	the old combined stats to attempt to keep backwards compatibility.

unfortunately, due to multiple bugs, this will cause new kernels and old
vmstat/iostat/systat programs to fail.  however, the next time this is
change it will not fail again.

this is just the kernel portion.
2002-11-01 11:31:50 +00:00
manu
9b4f3b0464 Introduce an array of supported CPU types by a given arch for Mach-O 2002-10-29 22:22:30 +00:00
blymn
29b7b4241f Added support for fingerprinted executables aka verified exec 2002-10-29 12:31:20 +00:00
jdolecek
c82ab2eb79 now that mem_no is emitted by config(8), there is no reason to keep
copy of more or less identical iskmemdev() for every arch; move the function
to spec_vnop.c, and g/c machine-dependant copies
2002-10-26 13:50:17 +00:00
jdolecek
d17511b4ea bump version to 1.6J - kqueue branch merge 2002-10-23 09:22:35 +00:00
jdolecek
07c713d5c2 install kqueue sys/event.h 2002-10-23 09:21:24 +00:00
jdolecek
25f6d9c389 regen: kqueue branch merge, addition of kqueue(2), kevent(2) 2002-10-23 09:18:16 +00:00
jdolecek
25cfe9dabd regen: kqueue branch merge, addition of VOP_KQFILTER() 2002-10-23 09:16:46 +00:00
jdolecek
e0cc03a09b merge kqueue branch into -current
kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
2002-10-23 09:10:23 +00:00
gmcgarry
3dae1c4857 vclean() isn't part of the interface so make it local.
Sort prototypes by the interface they belong to.
2002-10-23 06:45:49 +00:00
christos
c0c3ab8507 s/{ }/{ 0 }/g 2002-10-23 01:06:54 +00:00
chs
f17273fd1e add another QUEUEDEBUG check: in TAILQ_REMOVE(), if the element we're
removing has no next element, verify that the queue head agrees that
the current element is the last one.  (this is how I found the recent
ppc pmap bugs).
2002-10-22 04:50:38 +00:00
isaki
49e7158ab9 x68k needs config_cfdriver_lookup() to initialize its console.
XXX ad-hoc way?
2002-10-20 02:26:59 +00:00
provos
5782765e61 When augmenting the nodes in RB_ROTATE_{RIGHT,LEFT} make sure that the
children nodes have reached their final state before augmenting the
parent.  This fixes an obscure inconsistency of the space in the
vm_map tree that gcc 3.2 triggers when compiling isp.o on alpha. (this
only led to some leaked space). from art@openbsd.org
2002-10-19 18:55:00 +00:00
gmcgarry
e109c04d2d vn_stat() can now take a struct vnode * for consistency. Hide away
the opaque file descriptor operations.
2002-10-14 04:18:56 +00:00
kent
1ced03ad42 Add AudioNvideo, AudioNcenter, AudioNdepth, and AudioNlfe
to sync with OpenBSD.
2002-10-12 07:39:00 +00:00
provos
61e8c76047 support for privilege elevation.
with privilege elevation no suid or sgid binaries are necessary any
longer.  Applications can be executed completely unprivileged. Systrace
raises the privileges for a single system call depending on the
configured policy.

Idea from discussions with Perry Metzger, Dug Song and Marcus Watts.
Approved by christos and thorpej.
2002-10-11 21:54:55 +00:00
thorpej
9ee29cd5eb Deal with the fact that __GNUC__ is not defined when preprocessing
assembler (Grr).
2002-10-10 17:02:23 +00:00
thorpej
e4c85a8424 Add __unused, __packed, __aligned(), and __section() macros. Inspired
by FreeBSD.
2002-10-10 01:41:59 +00:00
thorpej
bee5ae7f7d Garbage-collect the __DO_NOT_DO_WEAK__ stuff. 2002-10-10 00:52:47 +00:00
thorpej
194d7347bc Implement config_attach_pseudo(), which creates an instance of
a pseudo-device which behaves like a normal device in the device
tree, including the capability to have children.
2002-10-09 02:59:55 +00:00
provos
a8909a2b8b new message to track uid/gid changes 2002-10-08 14:46:24 +00:00
thorpej
9f704b38bd Move forward decls earlier in the file. Expose bufq_state for the
benefit of kmem grovelers.
2002-10-06 17:05:56 +00:00
chs
993948e989 count executable image pages as executable for vm-usage purposes.
also, always do the VTEXT vs. v_writecount mutual exclusion
(which we previously skipped if the text or data segment was empty).
2002-10-05 22:34:02 +00:00
bjh21
7fc0ee4e27 Update URLs again (serves me right for committing an old change
without checking it).  Back to sco.com, but with a different path.
2002-10-05 14:09:15 +00:00
bjh21
2ece90236c Update URLs for ELF spec (sco.com -> caldera.com). 2002-10-05 13:29:29 +00:00
tsutsui
05aa22b988 Include <sys/lock.h> for struct lock. 2002-10-05 08:00:52 +00:00
elric
bc5dda7779 Add a type for CGD. 2002-10-04 18:26:31 +00:00
thorpej
d90d300b7b Overhaul the way cfattach structures are looked up. The cfdata entry
now carries the name of the attachment (e.g. "tlp_pci" or "audio"),
and cfattach structures are registered at boot time on a per-driver
basis.  The cfdriver and cfattach pointers are cached in the device
structure when attached.
2002-10-04 01:50:53 +00:00
thorpej
2792eea11f Assume caller will add trailing ; to CFDRIVER_DECL and CFATTACH_DECL. 2002-10-02 16:49:31 +00:00
thorpej
2b99f7cc34 Add a generic config finalization hook, to be called once all real
devices have been discovered.  All finalizer routines are iteratively
invoked until all of them report that they have done no work.

Use this hook to fix a latent bug in RAIDframe autoconfiguration of
RAID sets exposed by the rework of SCSI device discovery.
2002-10-01 18:11:57 +00:00
thorpej
b987253ef1 Fix thinko in CFATTACH_DECL(). 2002-09-30 20:42:29 +00:00
thorpej
8c44b67b6c Add macros to declare cfdriver and cfattach structures. This will allow
us to shield things that declare these structures from changes to the
structure (to a certain extent, anyway).
2002-09-30 18:46:44 +00:00
thorpej
1a6b241b1d Add a config_init() function to initialize the config data structures.
Normally this is called by configure(), but some ports (amiga, atari,
x68k) need to do this early because of how they find the console.
2002-09-30 17:36:31 +00:00
wiz
b1c7ac0e6d "definitions" has lots of 'i's, but that's not reason to leave one out. 2002-09-29 23:23:56 +00:00
dbj
43395bd5a8 Add support for the Apple UFS variation on ffs
This is the bulk of PR #17345

The general approach is to use a run time deteriminable value
for DIRBLKSIZ.  Additional allowances are included for using
MAXSYMLINKLEN with FS_42INODEFMT and a shift in the cylinder group
cluster summary count array.  Support is added for managing
the Apple UFS volume label.
2002-09-28 20:11:05 +00:00
dbj
8ccb247d47 add MBR_PTYPE_APPLEUFS of 0xa8
part of PR #17345
2002-09-28 00:56:25 +00:00
dbj
a323eac318 add FS_APPLEUFS
part of PR #17345
2002-09-28 00:47:24 +00:00
dbj
7d4caebaf6 add DTYPE_JFS2 and FS_JFS2 for IBM Journaled File System
this is to match FreeBSD's disklabel.h revision 1.73
FreeBSD change was requested by Hiten Pandya <hiten@uk.FreeBSD.org>
2002-09-28 00:30:24 +00:00
thorpej
bf97c13c6c Declare all cfattach structures const. 2002-09-27 20:41:46 +00:00
thorpej
6c88de3b53 Introduce a new routine, config_match(), which invokes the
cfattach->ca_match function in behalf of the caller.  Use it
rather than invoking cfattach->ca_match directly.
2002-09-27 03:17:40 +00:00
thorpej
d1ad2ac4f2 Rather than referencing the cfdriver directly in the cfdata entries,
instead use a string naming the driver.  The cfdriver is then looked
up in a list which is built at run-time.
2002-09-27 02:24:06 +00:00
thorpej
19eeb8d563 Bump version to 1.6I -- device parent spec change. 2002-09-26 04:12:27 +00:00
thorpej
fc0fe0347d Overhaul the way parent attachments are specified; instead of using
a vector of indices into the cfdata table to specify potential parents,
record the interface attributes that devices have and add a new "parent
spec" structure which lists the iattr, as well as optionally listing
specific parent device instances.

See:

    http://mail-index.netbsd.org/tech-kern/2002/09/25/0014.html

...for a detailed description.

While here, const poison some things, as suggested by Matt Thomas.
2002-09-26 04:07:35 +00:00
augustss
0c65ba2386 Don't install map.h now that it's gone. 2002-09-25 22:47:34 +00:00
thorpej
ca5fd3bd46 Garbage-collect the old rmap code. 2002-09-25 22:27:38 +00:00
thorpej
ac1b37ae05 Add support for multiple cfdata tables to the internals of the
autoconfiguration machinery, derived from PR #2112.

More work is left to do, including revamping how matches against
a candidate parent are done.
2002-09-23 23:16:06 +00:00
gmcgarry
6a6ea308fd Separate the scheduler from the context switching code.
This is done by adding an extra argument to mi_switch() and
cpu_switch() which specifies the new process.  If NULL is passed,
then the new function chooseproc() is invoked to wait for a new
process to appear on the run queue.

Also provides an opportunity for optimisations if "switching to self".

Also added are C versions of the setrunqueue() and remrunqueue()
low-level primitives if __HAVE_MD_RUNQUEUE is not defined by MD code.

All these changes are contingent upon the __HAVE_CHOOSEPROC flag being
defined by MD code to indicate that cpu_switch() supports the changes.
2002-09-22 05:36:48 +00:00
manu
80ee637534 - Introduce a e_fault field in struct proc to provide emulation specific
memory fault handler. IRIX uses irix_vm_fault, and all other emulation
use NULL, which means to use uvm_fault.

- While we are there, explicitely set to NULL the uninitialized fields in
struct emul: e_fault and e_sysctl on most ports

- e_fault is used by the trap handler, for now only on mips. In order to avoid
intrusive modifications in UVM, the function pointed by e_fault does not
has exactly the same protoype as uvm_fault:
int uvm_fault __P((struct vm_map *, vaddr_t, vm_fault_t, vm_prot_t));
int e_fault __P((struct proc *, vaddr_t, vm_fault_t, vm_prot_t));

- In IRIX share groups, all the VM space is shared, except one page.
This bounds us to have different VM spaces and synchronize modifications
to the VM space accross share group members. We need an IRIX specific hook
to the page fault handler in order to propagate VM space modifications
caused by page faults.
2002-09-21 21:14:54 +00:00
christos
39f324a802 Add MNT_GETARGS that retrieves fs specific arguments. Also add an empty
#define for vsf_showexport()
2002-09-21 18:06:08 +00:00
ragge
05cab9534e Remove clist.h. Clist blocks has never existed in NetBSD. 2002-09-19 10:49:43 +00:00
lha
4fa2032edc uppercase the lkm kernel-userspace dev macros and prefix them with LKM_
make modload print the bdev and cdev major when its a dev lkm
2002-09-18 22:59:36 +00:00
chs
128b037bfc remove all vesitages of dk_establish(). 2002-09-18 01:46:23 +00:00
gehenna
ddd7a9f3e6 fix pasto. 2002-09-13 14:51:25 +00:00
christos
9c59710333 Move humanize_number(9) to the ifdef _KERNEL section, because it conflicts
with humanize_number(3). In reality, the kernel version should be changed
to more closely match the userland version so that there are no prototype
conflicts.
2002-09-13 14:16:48 +00:00
gehenna
a1d78935eb overload block/character into u_long field.
kern/18234: slightly modified
2002-09-13 13:08:53 +00:00
gehenna
eb1cdba2fd Bump version for the merge of gehenna-devsw. 2002-09-06 13:58:36 +00:00
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
jdolecek
32fad21d27 regen: claim syscall slots for kqueue(2) and kevent(2) 2002-09-04 07:46:25 +00:00
gehenna
848d04ae8d G. not F. 2002-08-31 17:08:49 +00:00
hannken
d6d89cb6c6 Protect struct bufq_state from userland. 2002-08-30 19:21:14 +00:00
hannken
815491c0b3 Remove the old device buffer queue interface.
Approved by: Jason R. Thorpe <thorpej@wasabisystems.com>
2002-08-30 15:43:36 +00:00
gmcgarry
a5c84b7617 Bump version for rasctl syscall. 2002-08-28 07:28:53 +00:00
gmcgarry
14e30716d8 Regenerate: rasctl 2002-08-28 07:18:50 +00:00
gmcgarry
5bcbbd40bf MI kernel support for user-level Restartable Atomic Sequences (RAS). 2002-08-28 07:16:33 +00:00
christos
9f2867a05c - pass struct proc to copyargs
- rename aux vector entries AT_{R,E}{U,G}ID from AT_SYUN_{R,}P{U,G}ID
- update new aux vector size.
2002-08-26 21:09:02 +00:00
augustss
731d1eccf2 Get rid of sysctl for setting BCM2033 firmware path. It doesn't work
for ports that don't include files.usb, and it's also not done quite
the way it should.
2002-08-26 13:09:39 +00:00
thorpej
c92f7f0abb Force CBSIZE to act like an "int" by casting the sizeof() used
within the expression.
2002-08-26 01:16:43 +00:00
thorpej
4bec56201d Fix signed/unsigned comparison warnings from GCC 3.3. 2002-08-25 22:51:05 +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
139cdc3125 Make nbuf, nswbuf, and bufpages unsigned. Make all operations on these
variables unsigned, and update places where their values are printed.
2002-08-25 20:21:33 +00:00
thorpej
f02cb5ee27 Make hashinit() use unsigned quantities throughout. 2002-08-25 20:01:12 +00:00
augustss
cdbff56c90 Add sysctl support for hw.dev.ubtbcmfw (so I can set the firmware
path for my BCM2033).
2002-08-24 17:27:01 +00:00
itojun
1f508ca545 expose a way to see if random number source is enabled, some wants it
for avoiding extra function call for rnd_add_uint32 and such.
2002-08-20 22:30:53 +00:00
jdolecek
d23ad48af9 use 'pid_t' for pipe_pgid, rather that 'gid_t'
this fixes the code in pipeselwakeup() to properly send signal to process group

Problem found by Anders Magnusson, using gcc 3.2 with pdp-10 target.
2002-08-16 10:32:12 +00:00
soren
18d976ffcd Remove bogus comment. 2002-08-14 18:31:36 +00:00
thorpej
aa74d42772 Expose <machine/pmc.h> to userland. 2002-08-08 16:23:19 +00:00
soren
dbfd055e10 Expose the IPC_[RWM] symbols to userspace.
Fixes PR misc/14515 by Hendrik Scholz.
2002-08-07 23:39:24 +00:00
briggs
e046e751c9 Bump to 1.6F for PMCs (thanks for the reminder, Jason) 2002-08-07 15:29:57 +00:00
briggs
0b956d0b8b Implement pmc(9) -- An interface to hardware performance monitoring
counters.  These counters do not exist on all CPUs, but where they
do exist, can be used for counting events such as dcache misses that
would otherwise be difficult or impossible to instrument by code
inspection or hardware simulation.

pmc(9) is meant to be a general interface.  Initially, the Intel XScale
counters are the only ones supported.
2002-08-07 05:14:47 +00:00
briggs
5b1917a886 Regen for pmc_get_info, pmc_control. 2002-08-07 04:54:29 +00:00
pooka
2bc5807797 Add FORK_CLEANFILES flag to fork1(), which makes the new process start out
with a clean descriptor set (ie. not copied or shared from parent).

for rfork()
2002-08-06 13:58:08 +00:00
itojun
4f0c9c76b6 sync up with latest openbsd systrace.
- avoid race conditions by having seqno in ioctl
- better uid/gid tracking
- "replace" policy to replace args
- less diffs, as many of local changes were fed back to openbsd already

due to the 1st item, it was impossible for us to provide backward-compatibility
(new kernel + old bin/systrace won't work).  upgrade both.
2002-07-30 16:29:28 +00:00
soren
178d83d503 Die, qaddr_t, die! - mnt_data in struct mount is already effectively
a void *, so stop pretending otherwise.
2002-07-30 07:40:07 +00:00
soren
099793e880 Updates from OpenBSD:
date: 2002/06/11 18:59:22;  author: provos;  state: Exp;  lines: +48 -42
SPLAY_{INSERT,REMOVE} have return values now that can be used for error
checking
date: 2002/06/11 22:09:52;  author: provos;  state: Exp;  lines: +6 -5
have rb_remove return the right value, too.
2002-07-30 06:12:13 +00:00
manu
08a69f7d15 Make killproc really public, and while we are there, constify. 2002-07-28 22:18:51 +00:00
jdolecek
f340b79eaf bump to 1.6E - struct proc size change on LP64 platforms 2002-07-25 21:13:40 +00:00
jdolecek
02eb342b57 Make sure that the pointer to old parent process for ptraced children
gets reset properly when the old parent exits before the child. A flag
is set in old parent process when the child is reparented in ptrace(2).
If it's set when process is exiting, all running processes have their
'old parent process' pointer checked and reset if appropriate. Also
change to use 'struct proc *' pointer directly, rather than pid_t.
This fixes security/14444 by David Sainty.

Reviewed by Christos Zoulas.
2002-07-25 20:04:02 +00:00
hannken
7de36862a8 Rename bufq_init() to bufq_alloc().
Add bufq_free() to remove a buffer queue.
Avoid MALLOC while holding a spinlock.

From Chuck Silvers.
2002-07-21 15:32:17 +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
thorpej
3912e469dd Rename cdev_systrace_init() to cdev_clonemisc_init(), so it can
be properly used by any misc. cloning device.  While here, correct
a comment to indicate that "open" is the only entry point and that
everything else is handled with fileops.
2002-07-19 16:38:14 +00:00
hannken
10ff5e6607 Implement a new device buffer queue interface.
One basic struct, a function to setup a queue with a specific strategy and
three macros to put buf's into the queue, get and remove the next buf or
get the next buf without removal.

The BUFQ_XXX interface will be removed in the future.
The B_ORDERED flag is not longer supported.

Approved by: Jason R. Thorpe <thorpej@wasabisystems.com>
2002-07-16 18:03:17 +00:00
thorpej
64a96a4664 Rename DTYPE_SYSTRACE to DTYPE_MISC. DTYPE_MISC can now be used by
any misc. pseudo-device which requires cloning semantics.
2002-07-16 16:40:55 +00:00
scw
185627f408 Add MIDs for SH5. 2002-07-11 13:10:16 +00:00
pooka
15d9246bb2 Add FORK_NOWAIT flag, which sets init as the parent of the forked
process. Useful for FreeBSD rfork() emulation.

ok'd by Christos
2002-07-11 10:37:26 +00:00
wiz
654db6f5fc Fix two typos in comments. From OpenBSD. 2002-07-10 21:56:42 +00:00
perseant
eaa565b571 Changed size of struct inode; bump version to 1.6D. 2002-07-06 01:31:32 +00:00
abs
f20c5099f6 Introduce MALLOC_NOINLINE, which mirrors the effect of DIAGNOSTIC
and similar in making MALLOC/FREE not inline. Saves 11k on acorn26
FOURMEG config.
2002-07-05 13:05:14 +00:00
gmcgarry
88d8a7dd2f Protect local variables in MALLOC/FREE to avoid shadowing
arguments.  Problem reported by David Laight: david@l8s.co.uk.
2002-07-05 06:54:45 +00:00
thorpej
a08a4aecac Regenerate: Added __sigaction_sigtramp at #340. 2002-07-04 23:34:28 +00:00
thorpej
011d4d5f44 Add kernel support for having userland provide the signal trampoline:
* struct sigacts gets a new sigact_sigdesc structure, which has the
  sigaction and the trampoline/version.  Version 0 means "legacy kernel
  provided trampoline".  Other versions are coordinated with machine-
  dependent code in libc.
* sigaction1() grows two more arguments -- the trampoline pointer and
  the trampoline version.
* A new __sigaction_sigtramp() system call is provided to register a
  trampoline along with a signal handler.
* The handler is no longer passed to sensig() functions.  Instead,
  sendsig() looks up the handler by peeking in the sigacts for the
  process getting the signal (since it has to look in there for the
  trampoline anyway).
* Native sendsig() functions now select the appropriate trampoline and
  its arguments based on the trampoline version in the sigacts.

Changes to libc to use the new facility will be checked in later.  Kernel
version not bumped; we will ride the 1.6C bump made recently.
2002-07-04 23:32:02 +00:00
thorpej
2807c6789c Rename SB_UPDATE_TAIL() to SB_EMPTY_FIXUP(), per suggestion from
Jonathan Stone.
2002-07-03 21:39:40 +00:00
thorpej
668640a43d Rename sbappend_stream() to sbappendstream(), per suggestion from
Jonathan Stone.
2002-07-03 21:36:57 +00:00
thorpej
6b3c143231 Bump the OS version to 1.6C: socket buffer structure changed. 2002-07-03 19:11:41 +00:00
thorpej
0585ce1489 Make insertion of data into socket buffers O(C):
* Keep pointers to the first and last mbufs of the last record in the
  socket buffer.
* Use the sb_lastrecord pointer in the sbappend*() family of functions
  to avoid traversing the packet chain to find the last record.
* Add a new sbappend_stream() function for stream protocols which
  guarantee that there will never be more than one record in the
  socket buffer.  This function uses the sb_mbtail pointer to perform
  the data insertion.  Make TCP use sbappend_stream().

On a profiling run, this makes sbappend of a TCP transmission using
a 1M socket buffer go from 50% of the time to .02% of the time.

Thanks to Bill Sommerfeld and YAMAMOTO Takashi for their debugging
assistance!
2002-07-03 19:06:47 +00:00
yamt
d96bff0e27 add KSTACK_CHECK_MAGIC. discussed on tech-kern. 2002-07-02 20:27:44 +00:00
itojun
0a9d2ad2d7 provide KERN_URND, which extracts sizeof(int) random number from the kernel
(similar to /dev/urandom, for use within chroot jail).
2002-07-02 17:06:17 +00:00
thorpej
10c252ba47 Changes to allow the IPv4 and IPv6 layers to align headers themseves,
as necessary:
* Implement a new mbuf utility routine, m_copyup(), is is like
  m_pullup(), except that it always prepends and copies, rather
  than only doing so if the desired length is larger than m->m_len.
  m_copyup() also allows an offset into the destination mbuf, which
  allows space for packet headers, in the forwarding case.
* Add *_HDR_ALIGNED_P() macros for IP, IPv6, ICMP, and IGMP.  These
  macros expand to 1 if __NO_STRICT_ALIGNMENT is defined, so that
  architectures which do not have strict alignment constraints don't
  pay for the test or visit the new align-if-needed path.
* Use the new macros to check if a header needs to be aligned, or to
  assert that it already is, as appropriate.

Note: This code is still somewhat experimental.  However, the new
code path won't be visited if individual device drivers continue
to guarantee that packets are delivered to layer 3 already properly
aligned (which are rules that are already in use).
2002-06-30 22:40:32 +00:00
bjh21
c1ba727b47 Version times() so that programs compiled before the recent change to make
sysconf(_SC_CLK_TCK) return hz will work.

In detail:
__times13() returns values scaled by hz.
times() returns values scaled by 100.
<sys/times.h> renames times() to __times13().

_SC_CLK_TCK has changed from 3 to 39.
sysconf(3) returns 100.
sysconf(39) returns hz.
CLK_TCK is defined as sysconf(39).
2002-06-30 09:45:39 +00:00
yamt
5154ea5e5b constify diskerr(). 2002-06-28 16:37:20 +00:00
itojun
de84d710a4 minor KNF 2002-06-22 05:37:01 +00:00
thorpej
eafe65f83a No need to have two complete copies of the header in the same file. 2002-06-18 16:53:49 +00:00
thorpej
02ce7a5707 cdev_systrace_init() only gets an "open" entry point. 2002-06-18 05:30:40 +00:00
thorpej
2d892281ef Need DTYPE_SYSTRACE (XXX for now, until we get real cloning devices). 2002-06-18 01:54:05 +00:00
thorpej
5cbb1e82f1 * Don't bother protecting the body of the source file with #ifdef SYSTRACE.
It's not even built if the option isn't present.
* Use cdev_decl() to generate prototypes for the devsw functions.
* Minor whitespace cleanup.
* Nuke the SYSTR_CLONE ioctl from orbit; instead, just clone it in
  systraceopen(), like we do with svr4_net.
2002-06-18 01:24:15 +00:00
christos
b86e6ac858 Systrace support. 2002-06-17 16:23:58 +00:00
itojun
9e1c373ba9 make it possible to handle/mount FDISK-partitioned disk.
extended FDISK partitions are not supported yet.
openbsd code was used as reference.
2002-06-17 15:07:06 +00:00
perseant
983455d349 Bump version to 1.6B: changed ITIMES. 2002-06-16 00:14:13 +00:00
ragge
631436bfb0 Add official machine numbers for PDP10 and PDP11. 2002-06-14 09:05:21 +00:00
tron
4f9ae48b8f Include "sys/types.h" here to fix compilation problems in 3rd party
applications.
2002-06-10 10:31:48 +00:00
isaki
53175db820 Add x68k stuff. 2002-06-02 10:44:30 +00:00
lukem
06de426449 SIMPLEQ rototill:
- implement SIMPLEQ_REMOVE(head, elm, type, field).  whilst it's O(n),
  this mirrors the functionality of SLIST_REMOVE() (the other
  singly-linked list type) and FreeBSD's STAILQ_REMOVE()
- remove the unnecessary elm arg from SIMPLEQ_REMOVE_HEAD().
  this mirrors the functionality of SLIST_REMOVE_HEAD() (the other
  singly-linked list type) and FreeBSD's STAILQ_REMOVE_HEAD()
- remove notes about SIMPLEQ not supporting arbitrary element removal
- use SIMPLEQ_FOREACH() instead of home-grown for loops
- use SIMPLEQ_EMPTY() appropriately
- use SIMPLEQ_*() instead of accessing sqh_first,sqh_last,sqe_next directly
- reorder manual page; be consistent about how the types are listed
- other minor cleanups
2002-06-01 23:50:52 +00:00
wiz
96e3e9d9ab Minimize uses of quad_t. Also, use C99 types more thoroughly.
Approved by kleink.
2002-05-28 23:36:30 +00:00
drochner
3963e95b9b turn p_fsize into a union { p_fsize, p_cdsession }; the latter member
is used to store the session offset on multi-session CDs
2002-05-27 16:36:37 +00:00
itojun
e5aa199677 framework to add af-dependent data structure to struct ifnet.
as discussed at bsd-api-discuss.  sync w/kame
2002-05-27 02:53:49 +00:00
matt
486c7ce727 Add SIOCGIFDATA and SIOCZIFDATA ioctl's to get interface data. (the Z
variant also zeroes the counters after copying them).  In ifunit, add
support for dealing all numeric ifname by treating them as an ifindex
which is used to look up the interface.
2002-05-23 21:34:39 +00:00
tv
d2f1bd9cd1 Wouldn't it be nice if there were only one thing that needed changing on a
full version bump?  (Fix comment after __NetBSD_Version__.)
2002-05-22 03:29:09 +00:00
tv
9f4e74bc62 1.6 has branched. Welcome to "NetBSD 1.6A". 2002-05-22 03:18:19 +00:00
thorpej
e839580821 Move kernel_lock manipulation info functions so that they will
show up in a profile.
2002-05-21 01:38:26 +00:00
lukem
f6995335d6 Change NEWS_BOOT_BLOCK_OFFSET from 512 to 0, since parts of bootxx do
get loaded to sector 0 (even though we have to copy the disklabel back in)
2002-05-21 00:19:17 +00:00
lukem
e9a2250850 - add news{68k,mips} definitions, from Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
- be consistent about #define<TAB>
2002-05-20 13:41:42 +00:00
lukem
b3facf5a7d reduce MACPPC_BOOT_BLOCK_MAX_SIZE from 6K to 2K, to fit what bootxx is
limited to (and a CDROM limitation as well?)
2002-05-17 18:53:34 +00:00
lukem
30c58c94be - add Apple driver map and partition map structs, obtained from
sys/arch/macppc/include/disklabel.h (with elements renamed as appropriate)
- consistenly use "uint*_t" instead of "u_int*_t"
2002-05-15 13:32:10 +00:00
lukem
966b42a3e6 bootblock.h:
- unify sparc_bbinfo (1064 bytes, with 256 block entries)
  and sun68k_bbinfo (296 byte, with 64 block entries)
  into shared_bbinfo (512 bytes, with 118 block entries),
  which will be also shared by future bbinfo-using platforms
  (including macppc)
- add datestamp to *_BBINFO_MAGIC strings, to prevent installboot vs
  bootxx version skew.
- add macppc support

*/bootxx.c:
- migrate to new shared_bbinfo structure

installboot:
- add macppc support (still needs applepartmap support and testing)
- improve and add some more warnings & errors to installboot
- implement shared_bbinfo_clearboot() and shared_bbinfo_setboot(), which
  perform the majority of the work for bbinfo-using back-ends
  (rather than replicating that across multiple back-ends).
2002-05-15 09:44:54 +00:00
lukem
4369818766 Migrate alpha/pmax/vax bootblock stuff from <dev/dec/dec_boot.h> to
<sys/bootblock.h>  (leaving ultrix compat goo in the former)
2002-05-14 06:34:20 +00:00
lukem
86af66583e correct a couple of comments 2002-05-14 02:41:34 +00:00
lukem
6c34850421 add sparc64 stuff 2002-05-14 01:18:50 +00:00
matt
6e15a048de Remove declaration of total. nothing uses it. 2002-05-12 23:15:42 +00:00
matt
0cb85bc7b9 Eliminate commons. 2002-05-12 23:06:27 +00:00
kleink
cc7147e7f6 Use <sys/ansi.h> definitions for in_{addr,port}_t. 2002-05-12 22:59:50 +00:00
kleink
d05cce938c Provide private definitions for in_{addr,port}_t. 2002-05-12 22:58:48 +00:00
matt
e89ff519c5 Make domains extern. 2002-05-12 20:36:58 +00:00
matt
380e257dac acctp is not used anywhere so delete it. 2002-05-12 20:35:15 +00:00
itohy
c81ad2b05d Userland __COPYRIGHTs have \ns in them, and do not use asm(). 2002-05-11 11:57:14 +00:00
thorpej
f1f51aa2b8 Move code shared by procfs and the kernel proper out of procfs and
into the kernel proper (renaming functions from procfs_* to process_*).
2002-05-09 15:44:44 +00:00
lukem
3777b83a3f <sys/bootblock.h> is a better name than <sys/bootinfo.h> 2002-05-06 13:32:19 +00:00
lukem
e8bbb685d9 Replace <dev/sun/sun_boot.h> with <sys/bootinfo.h>, which is intended
to be more generic than ``bbinfo definitions for Sun-based systems''.
Other platforms can store bbinfo-style information here, and possibly
other platform-specific boot information that needs to be accessible
by foriegn platforms in tools such as /usr/sbin/installboot.
2002-05-06 05:27:53 +00:00
eeh
b6537138f9 Use _LP64 insteadl of __alpha__ to determine if we're generating 64-bit
binaries.
2002-05-03 00:27:45 +00:00
eeh
89e107d917 Regen. 2002-05-03 00:22:16 +00:00
thorpej
7a49fee765 Add some experimental page-loaning for writes on sockets. It is disabled
by default, and can be enabled by adding the SOSEND_LOAN option to your
kernel config.  The SOSEND_COUNTERS option can be used to provide some
instrumentation.

Use of this option, combined with an application that does large enough
writes, gets us zero-copy on the TCP and UDP transmit path.
2002-05-02 17:55:48 +00:00
thorpej
b094ff415f Change the semantics of mbuf external storage "ext_free" routines
so that they're more useful for arbitrary types of external storage:

* Add an "mbuf *" argument to (*ext_free)().  If non-NULL, (*ext_free)()
  is expected to free the mbuf itself.  This allows (*ext_free)() to use
  the mbuf for bookkeeping (e.g. deferring the work to a helper thread).
  If the "mbuf *" argument is NULL, we are assumed to be in a context
  which is safe for performing the destructor operation *now*.
* Adjust MEXTREMOVE() and MFREE() routines for above change.
* Update "ade" and "ti" drivers for new semantics.
2002-05-02 16:22:43 +00:00
christos
1261c89715 From OpenBSD, via FreeBSD: If a set{u,g}id binary is invoked with fd < 3
closed, open those fds to /dev/null.

XXX: This needs to be fixed in a better way. The kernel should not need to
know about /dev/null or special case 0, 1, 2.
2002-04-23 15:11:25 +00:00
manu
c7dcec33a1 Added IRIX /dev/usema and dev/usemaclone (void driver for now, will be
filled later)
2002-04-23 06:48:46 +00:00
ragge
bc27ff6af0 Keep the isbad() prototype here where it belongs, instead of random places. 2002-04-21 20:55:48 +00:00
manu
78583a4567 Always define SA_SIGINFO, and keep track of it in SVR4 emulation. This is
needed for IRIX signal delivery.
Approved by Christos.
2002-04-12 17:37:30 +00:00
simonb
5954457a89 Use "#define<tab>" consistantly. 2002-04-08 12:09:09 +00:00
bouyer
e5727031fb Implement mstohz() as discussed on tech-kern, and use it in SCSI drivers
to convert xs->timeout to callout() parameter.
2002-04-05 18:27:45 +00:00
fvdl
9edfbd43ca Add prototype for shmat1() 2002-04-03 11:50:51 +00:00
jdolecek
ebd670f0bc move emulation-specific sysctl hook from struct execsw to struct emul,
where it belongs
2002-04-02 20:19:59 +00:00
jdolecek
2e327b16be expose emul_search() 2002-04-02 20:18:06 +00:00
tron
5054a7de6d Back out revision 1.22:
- "ktrace/kdump/ktruss" need "enum uio_rw".
- "vmstat" needs "enum uio_seg".
- "ipf" needs "struct uio".
So there is nothing left which can be hidden.
2002-03-31 14:21:56 +00:00
bjh21
66392bd7be split /usr/include/sys/sha1.h and /usr/include/sha1.h completely.
future direction: nuke /usr/include/sys/sha1.h, it shouldn't be there as
we don't provide libkern to userland.

This mirrors the same change for md5.h made by itojun on 2000/12/11.
2002-03-31 14:12:37 +00:00
erh
994e50fc4c Move the _KERNEL down a couple lines sine ktrace/kdump/ktruss need
the enum uio_rw.
2002-03-31 07:11:35 +00:00
erh
48a7940151 Hide struct uio inside of a _KERNEL ifdef. 2002-03-30 20:28:13 +00:00
wrstuden
c1f0a33961 Make a definition of FSMAXTYPES always available, as discussed on
tech-kern. Helps validate partition types w/o needing the whole
list of partition type names.
2002-03-27 19:07:32 +00:00
fredette
749a99134b When DDB is not defined but Debugger() is anyways, define
console_debugger() to be Debugger().  This is relevant on
the sun2 and sun3, where a monitor is always available.
2002-03-26 23:17:09 +00:00
christos
36244cee28 kill PS_STRINGS, STACKGAPBASE_UNALIGNED, STACKGAPBASE 2002-03-20 18:00:07 +00:00
christos
748ed9bd8f put back NSIG=64 for userland. It is not nice to have programs report
unknown signal %u or coredump when they try to report a signal out of
range.
2002-03-20 14:30:11 +00:00
tron
a15356aae8 Don't expose the increased number of signals to the userland because the
required userland support e.g. in "libc" is not in place yet. This fixes
crashes in "ksh" but any other program which uses "sys_siglist".
2002-03-20 14:10:20 +00:00
christos
2aae331e69 add es_sysctl for emulation specific sysctls. 2002-03-20 00:26:33 +00:00
christos
c5f93c4fac new emulation specific sysctls. 2002-03-20 00:23:46 +00:00
christos
225441db6e - Define SIGRTMIN and SIGRTMAX iff _KERNEL.
- Bump the number of signals to 64, and define the default action for
  signals >= SIGRTMIN to be kill.
2002-03-19 20:50:41 +00:00
christos
22839acdb9 use the exithook mechanism to clean up semaphores. 2002-03-17 22:21:58 +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
atatat
26500cdfcd Bump kernel version -- ERESTART has been moved and EPASSTHROUGH has
been introduced.
2002-03-17 19:43:07 +00:00
atatat
31144d9976 Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command".  ERESTART is -1, which can lead to
confusion.  ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4.  No ioctl code should now return -1 anywhere.  The
ioctl() system call is now properly restartable.
2002-03-17 19:40:26 +00:00
thorpej
53df727d27 Add a new ptrace request, PT_IO, as proposed by Artur Grabowski
on the <bsd-api-discuss@wasabisystems.com> mailing list.  PT_IO
is a more general inferior I/D space I/O mechanism.  FreeBSD and
OpenBSD have also added PT_IO.

From lha@stacken.kth.se, kern/15945.
2002-03-17 17:02:45 +00:00
simonb
72b108a114 Don't 'extern' function prototypes.
ANSIfy kernel-only prototypes.
2002-03-17 11:14:04 +00:00
martin
94881fb123 Rename ISDN devices, per discussion on tech-kern. The network devices
become ippp (ISDN ppp) and irip (ISDN raw IP). The character device now
are called: /dev/isdn (isdnd <-> kernel communication), /dev/isdnctl (dialing
and other control), /dev/isdntrc* (tracing), /dev/isdnbchan* (raw B channel
access, i.e. for user land PPP) and /dev/isdntel* (telephone devices, i.e.
for answering machines).
2002-03-16 16:55:51 +00:00
manu
da6cdf1446 Added IRIX /dev/kmem emulation pseudodevice and SVR4 net pseudodevice 2002-03-15 17:29:06 +00:00
jdolecek
368878d433 add NetBSD RCS tag 2002-03-13 20:51:37 +00:00
jdolecek
19ac0b19d7 Merge in FreeBSD rev. 1.18 - MP changes + rename of PIPE_LOCK to PIPE_LOCKFL
XXXSMP the MP hooks are unused on NetBSD for now

put NetBSD kernel-only parts into #ifdef _KERNEL
2002-03-13 20:50:00 +00:00
simonb
f81b8604f8 Move 'struct pool_cache_group' definition into <sys/pool.h> 2002-03-13 10:57:18 +00:00
enami
89433f5abd Fix indentation. 2002-03-11 01:19:17 +00:00
enami
c26a42313c Fix function decl. of _pool_reclaim() so that subr_pool.c compiles again
even if POOL_DIAGNOSTIC is defined.
2002-03-11 01:16:43 +00:00
chs
240c70fa15 add a note to discourage the use of {u_,}longlong_t in non-XDR contexts,
as discussed on tech-kern.
2002-03-09 23:57:25 +00:00
thorpej
d100f2ae43 Put back pool_prime(); the i386 mp pmap uses it. 2002-03-09 18:06:54 +00:00
thorpej
c4a2ca6a3e Remove pool_prime(). Nothing uses it, and how it should be used it not
really well-defined in the absense of PR_STATIC.
2002-03-09 01:56:27 +00:00
thorpej
e21319b482 Make mbpool and mclpool use the new drain hook facaility. Adjust
m_reclaim() to match the drain hook signature.  This allows us to
delete m_retry() and m_retryhdr(), as the pool allocator will now
perform the reclaimation step for us.

From art@openbsd.org.
2002-03-09 01:46:32 +00:00
thorpej
24cd6c510c Bump version to 1.5ZB -- The pool(9) API/ABI changed. 2002-03-09 01:42:13 +00:00
thorpej
d54150e78a Remove PR_MALLOCOK and PR_STATIC. The former wasn't actually used,
and the latter, while there was some code tested the bit, was woefully
incomplete and also unused by anything.  Besides, PR_STATIC functionality
could be better handled by backend allocators anyhow.

From art@openbsd.org
2002-03-09 01:33:33 +00:00
thorpej
8cdc6121b7 Add an optional "drain" client callback, which can be set by the new
pool_set_drain_hook().  This hook is called in three cases:
* When a pool has hit the hard limit, just before either erroring
  out or sleeping.
* When a backend allocator fails to allocate memory.
* Just before trying to reclaim pages in pool_reclaim().

This hook requests the client to try and free some items back to
the pool.

From art@openbsd.org.
2002-03-08 21:41:59 +00:00
thorpej
7c94c68f10 Remove PR_FREEHEADER; nothing uses it anymore.
From art@openbsd.org.
2002-03-08 20:51:25 +00:00
thorpej
a180cee23b Pool deals fairly well with physical memory shortage, but it doesn't
deal with shortages of the VM maps where the backing pages are mapped
(usually kmem_map).  Try to deal with this:

* Group all information about the backend allocator for a pool in a
  separate structure.  The pool references this structure, rather than
  the individual fields.
* Change the pool_init() API accordingly, and adjust all callers.
* Link all pools using the same backend allocator on a list.
* The backend allocator is responsible for waiting for physical memory
  to become available, but will still fail if it cannot callocate KVA
  space for the pages.  If this happens, carefully drain all pools using
  the same backend allocator, so that some KVA space can be freed.
* Change pool_reclaim() to indicate if it actually succeeded in freeing
  some pages, and use that information to make draining easier and more
  efficient.
* Get rid of PR_URGENT.  There was only one use of it, and it could be
  dealt with by the caller.

From art@openbsd.org.
2002-03-08 20:48:27 +00:00
simonb
60b62880cc Add a extern declaration for the mountroot variable. 2002-03-04 02:24:37 +00:00
matt
6327f7590a Move MBR_PTYPE_PREP from arch/prep/stand/mkbootimage to here.
Add a MBR_FLAGS_ACTIVE too.
2002-03-02 07:04:31 +00:00
christos
a5890d9fa8 - add constants for DEV_{MEM,KMEM,NULL,ZERO} only arm is the oddball one using
3 for DEV_ZERO and should be fixed.
- cdev_decl(mm) since all the ports do the same.
- change _mm_ initialization to include ioctl entry point.
2002-02-27 01:17:58 +00:00
simonb
14ac06f0bd Add a "show event" ddb command to show the event counters. 2002-02-15 11:18:26 +00:00
christos
582f45a690 Add __MNT_CONTROL_FLAGS to __MNT_FLAGS for the sake of completeness.. 2002-02-05 21:25:48 +00:00
chuck
df904ed198 after discussion with christos, use string "hidden" rather than "ignored" 2002-02-05 19:35:03 +00:00
kleink
935d56d508 Add {POSIX_MONOTONIC_CLOCK} variables. 2002-01-31 00:32:47 +00:00
simonb
346fc0519d Implement the CLOCK_MONOTONIC clock for the posix/opengroup realtime
clock_() functions.  This simply returns the kernel mono_time variable.
As discussed on tech-kern.
2002-01-31 00:13:07 +00:00
christos
0a2c1af131 Define the strings for the flags used by mount(8) next to the flags, so
that they don't get out of sync again.
2002-01-30 21:39:51 +00:00
thorpej
07d023a3aa Define ELF32_EHDR_FLAGS_OK()/ELF64_EHDR_FLAGS_OK() and use it
as an added measure to make sure that we can execute a binary.
These default to (1) if elf_machdep.h does not override them.

On Sun2, ELF32_EHDR_FLAGS_OK() checks for the presense of EF_M68000,
since the 68010 cannot run binaries for the 68020-and-up.
2002-01-28 22:15:54 +00:00
simonb
bfc71f3c10 Add sysctls to read tk_{nin,nout,cancc,rawcc} (under a kern.tkstat node).
"extern" those variables in <sys/dkstat.h>, and add declarations for them
in sys/tty.c
2002-01-28 02:06:02 +00:00
simonb
ed6b438e40 Implement the hw.disknames and hw.diskstats sysctl's that have been listed
in <sys/sysctl.h> since day one but never implemented.
2002-01-27 12:41:07 +00:00
martin
b41d81ade2 Ooops, ISDN phone devices have an ioctl function, so add them to the
cdevsw. Noticed by Matthias Drochner.
(One of these days I'll setup an answering machine for testing myself ;-) )
2002-01-27 11:40:48 +00:00
lukem
8d39bcd4da correct comment 2002-01-27 07:19:25 +00:00
nathanw
0244dbad00 Reserve the SA malloc type on the trunk. 2002-01-12 00:00:39 +00:00
christos
d4e7e4c9c4 Fix a ptrace/execve race that could be used to modify the child process's
image during execve. This is a security issue because one can
do that to setuid programs... From FreeBSD.
2002-01-11 21:16:27 +00:00
thorpej
229efaff69 Add ioctls to get (DIOCGCACHE) and set (DIOCSCACHE) cache enables
on disks in a generic way.  Implement these ioctls for SCSI disks.

This is not fully fleshed-out yet, but it allows people to experiment
with disk caches more easily.
2002-01-09 04:12:11 +00:00
deberg
2cdce43be6 add SMBFS 2002-01-09 00:18:02 +00:00
deberg
7882fd04da gc unused M_NSMBDEV.
add comments reminding to mirror changes to the types list in malloc.9.
2002-01-07 01:02:19 +00:00
deberg
2935620216 add smbfs malloc types 2002-01-07 00:21:56 +00:00
dbj
d5738f5104 add support for the `D' kgdb detach command
add comment about minimum requirement for KGDB_BUFLEN
2002-01-05 22:57:38 +00:00
deberg
2268929539 cdev_netsmb_init() 2002-01-04 02:46:08 +00:00
deberg
c4b309d7aa add netsmb malloc types 2002-01-04 02:45:33 +00:00
augustss
1c06f6a40f Add support for radio cards. Written by Maxim Tsyplakov and Vladimir Popov
for OpenBSD, from where it was imported.
2002-01-01 21:51:38 +00:00
thorpej
38e94b28b8 From the comment added to the file:
* NOTE: Do not protect this header against multiple inclusion.  Doing
 * so can have subtle side-effects due to header file inclusion order
 * and testing of e.g. _POSIX_SOURCE vs. _POSIX_C_SOURCE.  Instead,
 * protect each CPP macro that we want to supply.
2001-12-20 20:07:24 +00:00
jdolecek
0f36df0693 Bump version to 1.5ZA - struct file change
Only three version bumps left to beat previous release :)
2001-12-18 22:34:37 +00:00
jdolecek
8884866a60 struct file: bump f_count and f_msgcount to u_int, to protect against
counter overflow. Fixes kern/5080 by David A. Holland.
Also move f_usecount & f_iflags to better place, and make f_type int.

Note: the maximum possible number of references to a struct file is
maxfiles + unp_rights == 2 * INT_MAX
2001-12-18 22:29:25 +00:00
fvdl
e946e67d2b Introduce M_NEWDIRBLK type. 2001-12-18 10:57:42 +00:00
thorpej
f77397d481 Use __sh__ instead of __sh3__. 2001-12-14 23:30:02 +00:00
thorpej
51535d4bf5 Add support for dumping ELF-cormat core files. 2001-12-09 23:05:56 +00:00
veego
f36a75214e Add some headers for region code support (RPC), which will be added in the
next commit of sys/dev/scsipi/cd.c.
2001-12-09 22:54:51 +00:00
manu
3cdc6f6197 Changed clocktl interface to use syscallargs structures 2001-12-09 16:10:43 +00:00
lukem
290cc55a28 - Implement
uint32_t namei_hash(const char *p, const char **ep)
  which determines the equivalent MI hash32_str() hash for p.
  If *ep != NULL, calculate the hash to the character before ep.
  If *ep == NULL, calculate the has to the first / or NUL found, and
  point *ep to that location.
- Use namei_hash() to calculate cn_hash in lookup() and relookup().
  Hash distribution goes from 35-40% to 55-70%, with similar profiled
  time spent in cache_lookup() and cache_enter() on my P3-600.
- Use namei_hash() to calculate cn_hash in nfs_readdirplusrpc(),
  insetad of homegrown code (that differed from that in lookup() !)
  namei_hash() has better spread and is faster than previous code
  (which used a non-constant multiplication).
2001-12-08 04:09:59 +00:00
thorpej
205c159f0e Make the coredump routine exec-format/emulation specific. Split
out traditional NetBSD coredump routines into core_netbsd.c and
netbsd32_core.c (for COMPAT_NETBSD32).
2001-12-08 00:35:25 +00:00
jdolecek
3d4c59a8ee Back off previous for now, Jason thinks it's not right. Will discuss
on tech-kern@
2001-12-07 07:09:29 +00:00
jdolecek
255ce12e50 replace FIF_WANTCLOSE/FIF_LARVAL with FWANTCLOSE/FLARVAL, which are set
in f_flag of struct file
for now, keep former f_iflags of struct file as _f_spare0, it will be g/c'ed
when struct file will be changed (this will happen soon)
2001-12-06 22:34:24 +00:00
lukem
c3a9ebdf37 fix comment 2001-12-06 04:02:22 +00:00
atatat
7ac1189351 Remove a redundant definition of __KERNEL_RCSID() that was redundantly
defined.
2001-12-05 21:06:51 +00:00
lukem
e35019c17b Add <sys/hash.h>, which currently implements three inline functions:
uint32_t hash32_buf(const void *buf, size_t len, uint32_t ihash)
	return 32 bit hash of buf, size len,
	seeded with initial hash of ihash (usually HASH32_BUF_INIT).
	this hash may use a different algorithm to hash32_str() and
	hash32_strn().

    uint32_t hash32_str(const void *buf, uint32_t ihash)
	return 32 bit hash of buf, which is an NUL terminated ascii string,
	seeded with initial hash of ihash (usually HASH32_STR_INIT).
	this hash may use a different algorithm to hash32_buf()
	but must use the same algorithm as hash32_strn().

    uint32_t hash32_strn(const void *buf, size_t len, uint32_t ihash)
	return 32 bit hash of buf, which is an NUL terminated ascii string
	up to a maximum of len bytes,
	seeded with initial hash of ihash (usually HASH32_STR_INIT).
	this hash may use a different algorithm to hash32_buf()
	but must use the same algorithm as hash32_str().

As discussed on tech-kern@netbsd.org.
2001-12-05 06:51:55 +00:00
enami
996ee10484 Introduce new function malloc_roundup(), suggested by Bill Sommerfeld
on tech-kern.
2001-12-05 01:29:04 +00:00
thorpej
03efee5585 * Allow machine-dependent code to specify hooks for ptrace(2)
(__HAVE_PTRACE_MACHDEP) and procfs (__HAVE_PROCFS_MACHDEP).
  These changes will allow platforms like x86 (XMM) and PowerPC
  (AltiVec) to export extended register sets in a sane manner.

* Use __HAVE_PTRACE_MACHDEP to export x86 XMM registers (standard
  FP + SSE/SSE2) using PT_{GET,SET}XMMREGS (in the machdep
  ptrace request space).
* Use __HAVE_PROCFS_MACHDEP to export x86 XMM registers via
  /proc/N/xmmregs in procfs.
2001-12-05 00:58:05 +00:00
enami
d2391ede6a Remove extern from function prototype. 2001-12-05 00:00:10 +00:00
enami
769949847d KNF and other cosmetic changes. 2001-12-04 23:56:36 +00:00
jdolecek
c152d680d8 Add M_CANFAIL malloc(9) flag. This flag changes behaviour in M_WAITOK
case when the requested memory size can't ever be granted - instead
of panic, malloc(9) would return failure (NULL).
Note kernel code should do proper bound checking, rather than
depend on M_CANFAIL. This flag is only supposed to be used in very
special cases, where common bound checking is not appropriate.

Discussed on tech-kern@, name ``M_CANFAIL'' suggested by Chuck Cranor.
2001-12-04 20:13:19 +00:00
christos
f6f0ceea17 PR/14639: Ben Harris: Stick the rcsid's in the data segment via inline
assembly, so that we don't get duplicate symbol errors when we have multiple
__KERNEL_RCSID's
2001-12-04 16:44:55 +00:00
augustss
45bdf1e78d Add IRFRAMEDISC line discipline for IrDA frames. 2001-12-03 23:29:11 +00:00
lukem
e2387142a7 convert cdev_ir_init() to use the cdev__ocrwip_init() helper macro,
like everything else with the same cdev methods does.  (hi lennart! :)
2001-12-02 12:17:12 +00:00
augustss
a8ef9684b0 Add cdev_ir_init() macro. 2001-12-02 10:36:33 +00:00
augustss
051c7d6423 Prototype for config_makeroom(), the routine that expands the cd_devs array. 2001-12-02 02:42:25 +00:00
christos
710a2e8de1 Welcome to 1.5Z [struct ucred changes] 2001-11-29 21:20:36 +00:00
christos
edd0fb6c43 use struct uucred in export_args. 2001-11-29 21:20:17 +00:00
christos
4328373c61 Introduce struct uucred which is our ``old'' ucred structure. This is
going to be used the kernel interfaces to userland, so that we don't
break the existing ABI. struct ucred has now been modified to have
u_int32_t for cr_ref and cr_ngroups.
2001-11-29 21:20:00 +00:00
lukem
91d1bbeaf3 Deprecate fnv_32_*() API. We'll replace this with a more generic hash API. 2001-11-29 18:39:08 +00:00
thorpej
57854f014a Install disklabel_acorn.h 2001-11-25 22:49:39 +00:00
thorpej
4fbe7a81e0 G/c riscbsd_partition; it's not used by anything, and is the same
as the riscix_partition anyway.
2001-11-25 19:04:48 +00:00
thorpej
1b71762f33 Move disklabel_acorn.h to <sys/disklabel_acorn.h>, much like we did
with disklabel_mbr.h.  More cleanup yet to come.
2001-11-25 16:22:47 +00:00
enami
4789a8840d Provide compat definition of __func__ for pre-C99 compiler. 2001-11-23 10:19:47 +00:00
enami
14c47b61f9 Fix possible typo in comment (s/MAXALLOCSIZE/MAXALLOCSAVE/). 2001-11-21 00:58:08 +00:00
lukem
677c5dd824 add RCSID and multiple inclusion protection 2001-11-19 05:37:49 +00:00
lukem
4b797c216a install fnv_hash.h 2001-11-19 05:31:39 +00:00
lukem
118c24bff7 In fnv_64_str(), replace u_register_t (which NetBSD doesn't have) with
Fnv32_t, since it's only going to store an 8 bit number anyway.
2001-11-19 05:29:02 +00:00
lukem
576eed5512 Add new malloc(9) flag M_ZERO - zeros memory before returning.
From Poul-Henning Kamp's equivalent enhancement in FreeBSD.
2001-11-17 03:50:27 +00:00
soren
662f877587 MAXSLP is defined to be a machine-independent scheduling parameter,
so move it into sys/param.h.
2001-11-15 18:06:11 +00:00
tv
d4c01db697 Turn off kernel rcsids by default on a.out, but let it be turned on again
with the option USE_KERNEL_RCSIDS.  (On a.out, these strings are actually
allocated memory and loaded; on ELF, they exist in a non-loaded file section.)
2001-11-13 19:52:39 +00:00
tv
8be2d6667c Dummy commit (removed one blank comment line) to make sure that all the
libc .o's for syscalls are rebuilt.
2001-11-13 14:49:56 +00:00
christos
731fd0e33d Protect printf() like functions and b{copy,zero,cmp} from being defined
in userland.
2001-11-12 23:08:13 +00:00
lukem
2be6cd9ae3 regen 2001-11-12 14:48:47 +00:00
perry
ea6b9b674d patch up some comments to avoid cpp warnings about redefines. 2001-11-11 00:00:15 +00:00
chs
6fbca7d0fc use pmap_kenter_pa() instead of pmap_enter(), this is required for
pages loaned to the kernel.  this implies that we also need to
call pmap_kremove() before uvm_km_free().

other general cleanup:  remove argument names from prototypes,
rename some variables, etc.
2001-11-06 07:30:14 +00:00
fvdl
b16adc3043 Make cn_isconsole check if cn_tab is NULL. 2001-11-05 21:38:14 +00:00
thorpej
d42a6dc5c2 Rather than using a NetBSD-specific header file <machine/int_types.h>
and non-standard inttype-like types, pull in <sys/types.h> if
_KERNEL or _STANDALONE and <inttypes.h> otherwise, and use standard
inttype types.

Discussed with and OK'd by Christos.
2001-10-31 18:05:35 +00:00
thorpej
6d2e0bcbc2 Use <machine/elf_machdep.h> to override Elf64_Word and Elf64_Sword
on the Alpha (which uses a non-standard definitions for historical
reasons), rather than #ifdef __alpha__ (which is not cross-tool safe).
2001-10-31 17:44:42 +00:00
thorpej
d973bb96f1 Include <machine/elf_machdep.h> earlier, at the beginning of the file,
after the inttypes header.
2001-10-31 17:35:06 +00:00
manu
40c8c13901 Made syscallargs.h lint-friendly, so that it can be included in libc sources
more easily.
2001-10-30 21:52:26 +00:00
thorpej
e8ee04475d - Add a new vnode flag VEXECMAP, which indicates that a vnode has
executable mappings.  Stop overloading VTEXT for this purpose (VTEXT
  also has another meaning).
- Rename vn_marktext() to vn_markexec(), and use it when executable
  mappings of a vnode are established.
- In places where we want to set VTEXT, set it in v_flag directly, rather
  than making a function call to do this (it no longer makes sense to
  use a function call, since we no longer overload VTEXT with VEXECMAP's
  meaning).

VEXECMAP suggested by Chuq Silvers.
2001-10-30 15:32:01 +00:00
simonb
243a8aa895 Add EM_NS32K for the ns32k series CPUs. 2001-10-29 21:30:54 +00:00
jdolecek
47ea6cbd85 Use hardcoded 8192 for PIPE_MINDIRECT, rather than being dependant
on PAGE_SIZE. The overhead of setting up Page Loan is pretty much constant
irregardless of page size, so it makes more sense to use fixed constant.

According to hbench, the overhead of Page Loan setup is still significantly
bigger than the performance gain for 4096 byte buffers on i386
(PIII/600Mhz). The difference is smaller on 386DX, but Page Loan is
still not faster for this case.

Also, there is some other code out there which expects 4KB writes
to not block even for 'blocking' write, since it works this
way on some other operating systems.
Partially addresses kern/14246 by Andreas Persson.
2001-10-28 20:27:55 +00:00
itohy
4ad7b15d39 Add more MIDI control change numbers. 2001-10-23 13:07:09 +00:00
kleink
38c46d1f11 Sprinkle some __restrict into <sys/socket.h>. 2001-10-22 20:59:02 +00:00
kleink
d4c0d0f2a2 Add a sockatmark(3), the 1003.1g wrapper around SIOCATMARK. 2001-10-22 17:53:43 +00:00
simonb
52680e72d6 Remove two cases of:
#endif		<- from an #ifdef _KERNEL

	#ifdef _KERNEL
2001-10-21 19:24:43 +00:00
thorpej
e45efd967f Deprecate the "m_act" alias of "m_nextpkt" (m_act is a historical
name), and just use m_nextpkt everywhere.
2001-10-18 20:17:24 +00:00
thorpej
9b2f51421c Use a pool cache for namei buffers -- it's faster to allocate from
a pool cache than a pool.
2001-10-17 23:33:29 +00:00
kleink
7c6ef4a85e Make this capable of being included without pre-requisite headers. 2001-10-16 19:47:44 +00:00
kleink
7c182e37e3 Cosmetical nit-pick. 2001-10-16 18:05:26 +00:00
kleink
ac7e78d152 Define caddr_t, gid_t and uid_t via <sys/ansi.h>. 2001-10-16 18:04:14 +00:00
kleink
1242c3de72 Make this capable of being included without pre-requisite headers. 2001-10-16 15:52:19 +00:00
bjh21
d0844f93bb Add support for allocating pool memory in units smaller than a whole page.
This is activated by defining POOL_SUBPAGE to the size of the new allocation
unit, and makes pools much more efficient on machines with obscenely large
pages.  It might even make four-megabyte arm26 systems usable.
2001-10-07 12:44:06 +00:00
eeh
c824ea9b57 Remove the property sysctl interface for now. 2001-10-05 19:05:05 +00:00
thorpej
1edcfbbee2 Fix a typo so that /sbin/sysctl compiles again. 2001-10-05 05:46:50 +00:00
thorpej
02d031e24d Fix a typo in a comment. 2001-10-05 02:08:09 +00:00
jmc
fd9e0c2d9c It's sys/properties.h. Fix typo 2001-10-05 01:24:05 +00:00
eeh
b2803e7da0 Install sys/property.h 2001-10-04 19:06:29 +00:00
eeh
b8f825b33b Add sysctl for generic properties. 2001-10-04 19:03:59 +00:00
eeh
ade7065ac5 Add M_PROP. 2001-10-04 19:00:44 +00:00
eeh
e1bd5ac110 Add generic properties. 2001-10-04 18:56:06 +00:00
simonb
d3fb79099a Put comments around token after #endif. 2001-09-30 05:31:20 +00:00
jdolecek
8c94944fe7 sbspace(): use lmin() instead of imin() and kill now unneeded casts
Pointed out by Scott Barron in kern/13687.
2001-09-28 18:02:45 +00:00
chs
7bec4cf98b don't include argument names in prototypes. 2001-09-28 12:14:27 +00:00
chs
7bb91a0959 resize the namecache hash table also when desiredvnodes changes. 2001-09-24 06:01:13 +00:00
ad
38e48ad060 Add cdev__ocm_init() helper. 2001-09-18 19:55:06 +00:00
jdolecek
ef8abe0767 Make the setregs hook emulation-specific, rather than executable
format specific.
Struct emul has a e_setregs hook back, which points to emulation-specific
setregs function. es_setregs of struct execsw now only points to
optional executable-specific setup function (this is only used for
ECOFF).
2001-09-18 19:36:32 +00:00
wiz
456dff6cb8 Spell 'occurred' with two 'r's. 2001-09-16 16:34:23 +00:00
pooka
4d3a8df544 fix tyop (literally)
clockctlh. -> clockctl.h
2001-09-16 12:52:34 +00:00
jmc
b16bfaf57b Add prototype for ntp_adjtime1 2001-09-16 09:55:52 +00:00
jmc
5f4c074523 Re-alphabetize list 2001-09-16 09:52:08 +00:00
manu
531c050261 Added missing include for clockctl.h 2001-09-16 09:00:42 +00:00
manu
a7455445c4 Added the clockctl device 2001-09-16 07:20:29 +00:00
manu
3d54fc0e8a Added prototypes declarations for lower part of root-only time-related
system calls. This is the the clockctl pseudosriver
2001-09-16 07:14:15 +00:00
manu
5a8892e22d This is the clockctl pseudodevice. It gives non root users access to root-only
time-related system calls through ioctls. For instance, if user daemon is able
to write to /dev/clockctl, then it is able to use the CLOCKCTL_SETTIMEOFDAY
ioctl on it, which will be equivalent to a settimeofday.
Approved by Christos
2001-09-16 06:53:54 +00:00
chs
02464e8394 bump to 1.5Y: vfs_reinit, massive UVM/UBC/filesystem changes. 2001-09-15 20:48:27 +00:00
chs
d9faf4d4e7 regen 2001-09-15 20:37:36 +00:00
chs
64c6d1d2dc a whole bunch of changes to improve performance and robustness under load:
- remove special treatment of pager_map mappings in pmaps.  this is
   required now, since I've removed the globals that expose the address range.
   pager_map now uses pmap_kenter_pa() instead of pmap_enter(), so there's
   no longer any need to special-case it.
 - eliminate struct uvm_vnode by moving its fields into struct vnode.
 - rewrite the pageout path.  the pager is now responsible for handling the
   high-level requests instead of only getting control after a bunch of work
   has already been done on its behalf.  this will allow us to UBCify LFS,
   which needs tighter control over its pages than other filesystems do.
   writing a page to disk no longer requires making it read-only, which
   allows us to write wired pages without causing all kinds of havoc.
 - use a new PG_PAGEOUT flag to indicate that a page should be freed
   on behalf of the pagedaemon when it's unlocked.  this flag is very similar
   to PG_RELEASED, but unlike PG_RELEASED, PG_PAGEOUT can be cleared if the
   pageout fails due to eg. an indirect-block buffer being locked.
   this allows us to remove the "version" field from struct vm_page,
   and together with shrinking "loan_count" from 32 bits to 16,
   struct vm_page is now 4 bytes smaller.
 - no longer use PG_RELEASED for swap-backed pages.  if the page is busy
   because it's being paged out, we can't release the swap slot to be
   reallocated until that write is complete, but unlike with vnodes we
   don't keep a count of in-progress writes so there's no good way to
   know when the write is done.  instead, when we need to free a busy
   swap-backed page, just sleep until we can get it busy ourselves.
 - implement a fast-path for extending writes which allows us to avoid
   zeroing new pages.  this substantially reduces cpu usage.
 - encapsulate the data used by the genfs code in a struct genfs_node,
   which must be the first element of the filesystem-specific vnode data
   for filesystems which use genfs_{get,put}pages().
 - eliminate many of the UVM pagerops, since they aren't needed anymore
   now that the pager "put" operation is a higher-level operation.
 - enhance the genfs code to allow NFS to use the genfs_{get,put}pages
   instead of a modified copy.
 - clean up struct vnode by removing all the fields that used to be used by
   the vfs_cluster.c code (which we don't use anymore with UBC).
 - remove kmem_object and mb_object since they were useless.
   instead of allocating pages to these objects, we now just allocate
   pages with no object.  such pages are mapped in the kernel until they
   are freed, so we can use the mapping to find the page to free it.
   this allows us to remove splvm() protection in several places.

The sum of all these changes improves write throughput on my
decstation 5000/200 to within 1% of the rate of NetBSD 1.5
and reduces the elapsed time for "make release" of a NetBSD 1.5
source tree on my 128MB pc to 10% less than a 1.5 kernel took.
2001-09-15 20:36:31 +00:00
chs
adf5d360a7 add a new VFS op, vfs_reinit, which is called when desiredvnodes is
adjusted via sysctl.  file systems that have hash tables which are
sized based on the value of this variable now resize those hash tables
using the new value.  the max number of FFS softdeps is also recalculated.

convert various file systems to use the <sys/queue.h> macros for
their hash tables.
2001-09-15 16:12:54 +00:00
thorpej
62a1f0bdde Add cdev_pci_init(). 2001-09-13 21:59:21 +00:00
simonb
237596d77d Install agpio.h. 2001-09-11 06:53:59 +00:00
thorpej
16c229ea7c Optimization suggested by Bill Sommerfeld: Keep a hint as to the
"earliest" firing callout in a bucket.  This allows us to skip
the scan up the bucket if no callouts are due in the bucket.

A cheap O(1) hint update is done at callout insertion (if new callout
is earlier than hint) and removal (is bucket empty).  A thorough
refresh of the hint is done when the bucket is traversed.

This doesn't matter much on machines with small values of hz
(e.g. i386), but on systems with large values of hz (e.g. Alpha),
it has a definite positive effect.

Also, keep the callwheel stats in evcnts, so that you can view them
with "vmstat -e".
2001-09-11 04:32:19 +00:00
fvdl
f21020c1e6 Add M_AGP type. 2001-09-10 10:09:36 +00:00
fvdl
639a4315f4 Add extra initializer macro. 2001-09-10 10:09:13 +00:00
fvdl
a3130cfbe2 AGP GART support code. Originally written by Doug Rabson for FreeBSD,
modifications to fit it into the NetBSD device/config structure and
to use bus_dma by me.
2001-09-10 10:01:00 +00:00
enami
bab65a8da3 Mix random data directly into the pool and increase entropy instead of
estimating entropy with polling based timing.
2001-09-09 00:48:54 +00:00
enami
a1eef7d6a4 Cosmetic changes. 2001-09-09 00:32:52 +00:00
christos
51d673156c Set the credentials to be used in the NDINIT macro so that syscalls can
hijack them.
2001-09-08 02:02:04 +00:00
itojun
bc9095e4c7 make CMSG_FIRSTHDR() validat emsg_controllen, as suggested in RFC2292.
from kame
2001-09-07 08:13:01 +00:00
matt
449a758850 Add EVCNT_TRAP event counter type. 2001-08-26 02:48:12 +00:00
itojun
9fe945f2fe sync argument/return type of [hn]to[nh][ls] to XNET 5.2 (uint{16,32}_t).
as discussed on tech-net.
2001-08-22 07:42:07 +00:00
wiz
1e378c4c12 precede, not preceed. 2001-08-20 12:00:46 +00:00
thorpej
bbd3d01db5 Artur Grabowski's simple brute-force malloc debugger, which uses
guard pages.  Can only debug one malloc type at a time, and nothing
larger than 1 page.  But can be useful for debugging certain types
of "data modified on freelist" type problems.

Modified from code in OpenBSD.
2001-08-17 00:48:29 +00:00
matt
9c82a67f2b Add a MID_88K (note that it's different from OpenBSD's since their value
for 88K is our value for SPARC64).
2001-08-16 05:06:35 +00:00
pooka
fe42be1734 make elf64_copyargs() of type int also per the recent copyargs changes 2001-07-30 14:07:25 +00:00
christos
3e1e7a68e5 adjust to the new copyargs footprint 2001-07-29 21:22:58 +00:00
thorpej
9e74a14e1f Add a sysctl to frob sb_max. 2001-07-27 21:19:09 +00:00
thorpej
fb384a3827 Strictly cosmetic changes. 2001-07-26 22:08:34 +00:00
thorpej
fcc2e4e5f6 Use pool_cache_*() for mbufs and clusters. While we don't use the
ctor/dtor feature, it's still faster to allocate from the cache groups
than it is from the pool (cache groups are analogous to "magazines"
in the Solaris SLAB allocator).
2001-07-26 19:05:04 +00:00
thorpej
2a6aa3926d Add an M_READONLY() macro, which evaluates to true if the mbuf's
data area is not to be written to.  This is the case for mbufs with
external storage which is either a non-cluster or a cluster referenced
by multiple mbufs.

Change M_LEADINGSPACE() and M_TRAILINGSPACE() to use M_READONLY(),
rather than their own testing for M_EXT.  Previously, M_LEADINGSPACE()
treated all M_EXT mbufs as read-only (which causes an extra mbuf to
be needlessly allocated when sending large TCP packets), and
M_TRAILINGSPACE() previously did not treat any external storage as
read-only (could lead to data corruption of external storage buffers!).
2001-07-26 17:24:59 +00:00
assar
a292e4c661 update to 1.5X: removed WILLRELE from vop_mknod and vop_symlink 2001-07-24 15:40:15 +00:00
jdolecek
bef81951f3 define BIG_PIPE_SIZE value using PIPE_SIZE 2001-07-23 19:34:36 +00:00
bouyer
f18f3b2d4c Add SCBUSIODETACH ioctl. 2001-07-18 20:20:16 +00:00
thorpej
f20822333e Add `WALLSIG' which causes wait4(2) to wait for all processes, regardless
of exit signal.  Add Linux-compatible aliases __WCLONE (for WALTSIG) and
__WALL (for WALLSIG), for compatibility with the Linux clone(2) API.
2001-07-18 19:10:26 +00:00
kleink
0b2a6b7929 Prevent trad. cpp recursion; from Katsuomi Hamajima in PR kern/13479. 2001-07-18 17:29:53 +00:00
jdolecek
588b94c0a2 Expel MSG_COMPAT/COMPAT_OLDSOCK, make the COMPAT_43 wrappers
arrange things as needed.  Unfortunately, the check in sockargs()
have to stay, since 4.3BSD bind(2), connect(2) and sendto(2) were
not versioned at the time :(

This code was tested to pass regression tests.
2001-07-17 11:49:40 +00:00
kleink
8468d6d854 Fix obvious typo in multiple-inclusion protection wrapper. 2001-07-14 12:05:53 +00:00
matt
f300898396 Add support for kern.maxphys, vm.maxslp, vm.uspace (the later two for ps). 2001-07-14 06:36:01 +00:00
christos
b6639a0e83 new exec module for MACH-O fat binaries
XXX: shared libraries are not handled properly yet.
2001-07-14 02:09:41 +00:00
christos
69f5770270 - add exec_read_from and make exec_elf32 use it.
- add a macho probe function
2001-07-14 02:08:29 +00:00
lukem
dfaec93e4e move to kqueue branch for now 2001-07-10 11:59:50 +00:00
simonb
2fb6ef500e De-__P kernel prototypes. 2001-07-09 10:25:21 +00:00
perry
3b89bf8100 Remove ovbcopy macro added in last commit.
I think we should sit back and have an actual discussion on all of
this and come to consensus before we make any more changes in all of this.
2001-07-07 17:07:26 +00:00
tv
1a4f57e22c Add (parenthetical) macro protection for one of the ovbcopy macro args. 2001-07-07 16:35:21 +00:00
itojun
5e920039c6 have ovbcopy() macro, for cross-BSD compatibility only. 2001-07-07 14:45:46 +00:00
perry
b2237246e2 I'm an idiot. 2001-07-07 05:22:10 +00:00
perry
9d7de51394 Add memcmp, memcpy, memmove and memset prototypes, which should have
been here a long time ago.

XXX should this file be un-__P'ed in the new regime? It isn't used in
userland...
2001-07-07 05:15:56 +00:00
perry
7a31be3198 move the bcopy macro back to generating memcpy.
Here is why:

kernel bcopy and userland bcopy semantics were never the same. bcopy
in the kernel did not traditionally handle overlap.
ovbcopy in the kernel was the traditional "overlapping bcopy".

Lets take a step back here. The point of the macros was to provide
legacy interfaces so we could transition to mem* without disrupting
large parts of the code still being repeatedly merged, like the KAME
merges in net*/. Having purged the last ovbcopy from the kernel,
replacing them all with memmove, we didn't need ovbcopy any more so we
didn't need a macro.

Now, by leaving bcopy as memcpy, we make it clear that if you are
purging bcopys, you should replace them with memcpys. If we used
memmoves everywhere, it would lose very painstaking optimizations made
in the original code during which the ovbcopy/bcopy distinction was
held. Making bcopy into memmove is BAD BAD BAD.

It has been argued we should add an ovbcopy->memmove macro, but that
is precisely what we do not want -- if someone needs ovbcopy, what
they really want to write memmove, not ovbcopy. We don't want NEW code
with ovbcopy, having laboriously gotten rid of it.

In fact, the bcopy/bzero/bcmps in the kernel should all be purged. We
held off on doing net*/ to make the kame merge easier, and similarly
held off on some other places, but the time has come.

Anyway, for all these reasons, bcopy is changed back to memcpy.
2001-07-07 04:14:43 +00:00
perry
dedadee3db "safe" the macros for bcopy bzero and bcmp, after a request from mrg 2001-07-06 15:59:23 +00:00
tv
cc1cf30d01 bcopy() is documented as allowing overlapping memory regions. Define it
in terms of the standard name memmove() to account for this.
Fixes kern/13369 and the redundant lib/13370.
2001-07-05 21:51:10 +00:00
jdolecek
6a07acfe9c #include <sys/select> implicitly in !_KERNEL case 2001-07-02 20:54:26 +00:00
jdolecek
4dd8293a6d Move CTL_PIPE_NAMES and KERN_PIPE_* from <sys/sysctl.h> to <sys/pipe.h> 2001-07-02 20:48:31 +00:00
jdolecek
9f7b135e53 g/c PIPE_MOREW 2001-07-02 20:44:17 +00:00
matt
54ec2573c9 Use consistent types for len. Limit sockarg length to reasonable values. 2001-07-01 20:42:48 +00:00
thorpej
ce232da4eb Regen; added Linux-compatible clone(2) system call. 2001-07-01 18:07:33 +00:00
thorpej
9377ba2c38 Linux-compatible clone(2) system call, lifted from the Linux
compatibility module.  Based on patches from Bang Jun-Young <bjy@mogua.org>.
2001-07-01 18:06:11 +00:00
gmcgarry
d6182a9e77 In-kernel device configuration manager - allows modification
of device locators at run-time.

Written by Mats O Jansson <moj@stacken.kth.se>.  Reworked by
Jun-ichiro itojun Hagino <itojun@netbsd.org>.
2001-07-01 02:56:20 +00:00
jdolecek
7fc92b8a86 Remove obsoleted comment, note CTL_VFS_NAMES need only be updated
if the new filesystem actually supports sysctl now.
2001-06-28 08:15:44 +00:00
fredette
687bbc74b6 Add ID for the m68000 with 2k pages. 2001-06-27 19:58:52 +00:00
thorpej
a160a0b77c Make the kmemstats limits unsigned, and use unsigned arithmetic
to compute them.  Prevents overflows when using a very large number
of kmem pages.

From chopps@netbsd.org.
2001-06-26 16:02:27 +00:00
nathanw
493f55e596 A little space->tab fixup. 2001-06-25 22:56:18 +00:00
jdolecek
26d45c1101 Back off the sendit()/recvit() change, some have problems with it 2001-06-25 20:46:11 +00:00
jdolecek
7f7c60e827 Add 'kernsa' parameter for sendit()/recvit(); if nonzero, msg->msg_name
is supposed to point directly to struct mbuf or struct sockaddr in kernel
space as appropriate, rather than being a pointer to memory in userland.

This is to be used by compat/* when emulation needs to wrap
send{to|msg}(2)/recv{from|msg}(2) and modify the passed struct
sockaddr.
2001-06-25 19:24:02 +00:00
chs
24204a1ea2 for QUEUEDEBUG_*_POSTREMOVE(), set the pointers to 1 instead of 0
so that we'll crash instead of thinking we're at the end of the list.
2001-06-22 06:18:22 +00:00
jdolecek
36f8e84443 Move prototype of sysctl_dopipe() from <sys/sysctl.h> to <sys/pipe.h>
and adjust kern/kern_sysctl.c accordingly.
2001-06-21 19:08:36 +00:00
simonb
9f273cc763 Fix up comment botch.
_Never_ fix a simple formatting thing _after_ a test compile.
2001-06-20 05:33:25 +00:00
simonb
d75760a329 Add some more e_machine values and a reference to the SCO website with
ELF ABI information.
2001-06-20 03:15:42 +00:00
fvdl
e861a00729 X8664 -> X86_64 2001-06-20 01:20:19 +00:00
fvdl
5f21a82a5d Elf64_Word should be 32 bits; alpha is the exception rather than
the rule, so change the ifdef to reflect this.
2001-06-20 01:07:22 +00:00
wiz
3f9984fc90 existent', not existant' 2001-06-19 13:42:07 +00:00