Commit Graph

28888 Commits

Author SHA1 Message Date
Jake Burkholder
8be89d4719 Add code to copy the enironment and loader metadata into kernel space. 2001-10-30 06:37:36 +00:00
Jake Burkholder
a237ed036e Add definitions for network support, doesn't work yet.
Pass the right arguments to the kernel.
Replace magic numbers with symbolic constants.
Pass the real openfirmware entry point to OF_init.
2001-10-30 06:31:45 +00:00
Jake Burkholder
073e92a52c Use ENTRY() for defining functions in asm.
Remove asm functions to call the openfirmware and kernel entry points;
we can just call them directly.
Don't use the stack pointer for an intermediate result in setx.
Put the stack in the bss.
2001-10-30 06:27:34 +00:00
Jake Burkholder
eea923d7f8 Make the openfirmware entry point function pointer non-static so that it
can be passed to the kernel.
2001-10-30 06:23:32 +00:00
Warner Losh
823a5e8365 MFGeneric: ->1.327 Sync with GENERIC 2001-10-30 06:11:15 +00:00
Warner Losh
8f3a0dd489 Move device lnc to isa section, since it no longer uses the compat shims.
Add comment about lnc.
Remove probe order comment from isa_compat.c.  That appears to no longer
be the case.
2001-10-30 06:08:56 +00:00
Yoshihiro Takahashi
3f64e5a6c2 MFi386: sys/i386/i386/machdep.c revisions 1.481 and 1.482 2001-10-30 00:53:19 +00:00
John Baldwin
d01404c828 Fix a typo in comment and #ifdef fixes: GRAP_PRIO -> GRAB_PRIO so that
x86 SMP kernels actually boot again to single user mode.

Pointy hat to:	jhb
Noticed by:	jlemon
2001-10-30 00:19:42 +00:00
David Malone
12396bdca7 When scanning for control messages, don't process the data mbufs.
This could cause hangs if a unix domain socket was closed with data
still to be read from it.

Tested by:	Andrea Campi <andrea@webcom.it>
2001-10-29 20:04:03 +00:00
Mitsuru IWASAKI
2d64460768 Some small improvements of ACPI thermal driver.
- Give a guaranteed minimum cooling run time to avoid too frequent
   cooling system On/Off switching.  The minimum cooling run time can be
   specified by hw.acpi.thermal.min_runtime in sec.
 - Refine message printing (_AC-1 -> NONE).
 - Add verbose mode enable/disable capability by hw.acpi.verbose in bool.

Reviewed by:	acpi-jp@ folks
2001-10-29 18:09:43 +00:00
Bruce Evans
3f91265a4c Don't set CR0_NE in cpu_setregs() for the SMP case, since setting it
is npx.c's job and setting it here breaks the edit-time option of not
setting it in npx.c.  (It is not set in the right places for the SMP
case, but always setting it here is harmless because there isn't even
an edit-time option to not set it.)
2001-10-29 16:31:15 +00:00
Hajimu UMEMOTO
af109ffd14 System wide policy should be returned when no policy found in the SPD.
The packet was rejected in ipsec[46]_tunnel_validate().

Obtained from:	KAME
MFC after:	1 week
2001-10-29 16:29:41 +00:00
Josef Karthauser
06dae58b17 A few more style changes picked up whilst working on an MFC to -stable. 2001-10-29 15:09:07 +00:00
Josef Karthauser
f227535cd8 Fix some whitespace, and a comment that I missed in the last commit. 2001-10-29 14:08:51 +00:00
Doug Rabson
7a71eab18d Add unwind.c. 2001-10-29 12:04:51 +00:00
Doug Rabson
d57b94ba65 * Factor out common code for manipulating the RSE backing store.
* Implement a fairly simplistic parser for unwinding stack frames.
* Use unwind records for DDB's 'trace' command. Also add support for
  tracing past exceptions to the context which generated the exception.

The stack unwind code requires a toolchain based on binutils-2.11.2 or
later and gcc-3.0.1 or later.
2001-10-29 12:04:23 +00:00
Doug Rabson
c3338474b9 Make the various bits of SMP code conditional on SMP so that I can still
build non-SMP kernels.
2001-10-29 11:57:12 +00:00
Doug Rabson
a4addc62ce Put symbols at the start and end of the unwind section so that we can
find it at runtime.
2001-10-29 11:40:14 +00:00
Doug Rabson
c543113849 Various fixes to make stack traces using the unwind tables work properly. 2001-10-29 11:30:54 +00:00
Doug Rabson
15b209a6f5 Fix disassembly of 'add a=b,c,1' and make the disassembly of the various
break and nops consistent.
2001-10-29 11:26:10 +00:00
Peter Wemm
0050cf3e5d The size of the ELF hash table changed from 64 bits in the prototype
toolchains to 32 bits in 2.11.2.

Obtained from:	dfr
2001-10-29 10:20:19 +00:00
Munechika SUMIKAWA
dc7f237356 Fix fragmented packet handling.
Obtained from:	KAME
MFC after:	3 weeks
2001-10-29 07:55:57 +00:00
Marcel Moolenaar
256e103fcf o Send a test IPI from the BSP to itself at the same time APs
are woken up.
o  Make IPIs synchronuous by default. If we want asynchronuous
   IPIs, we may want to make the memory fence controllable.
2001-10-29 07:34:48 +00:00
Marcel Moolenaar
b1ef773d12 Add an IPI used for testing proper operation of delivering IPIs. 2001-10-29 07:30:37 +00:00
Mike Barcroft
95d839a1c7 Use a more sophisticated check that works better with older versions
of GCC when setting __func__ to NULL.  This also better supports GCC
when using C++.  Move the definition to a better location.

Submitted by:	bde
2001-10-29 07:29:03 +00:00
Marcel Moolenaar
b5f7b8be86 Make the clock vector 255 instead of 240. On Lion boxes, 240 is
the AP wake-up vector. We probably want a more dynamic approach
to assigning vectors in the future...
2001-10-29 05:17:36 +00:00
Marcel Moolenaar
cd85e2620d Small correction in the LOCAL_SAPIC structure. The Flags field
starts at offset 8; not 6. Hence the structure is 12 bytes and
not 10 bytes. Adjust the definition so that the ProcessorEnabled
flag is moved from bit 15 to bit 31 in the Flags field.

The definition now matches ACPI 2.0 Errata 1.5.
2001-10-29 04:59:35 +00:00
Josef Karthauser
25549c009a Clean up the style of this header file. 2001-10-29 04:41:28 +00:00
Matthew Dillon
e74e9032da log routine called w/ %ld and int argument, cast argument to long 2001-10-29 02:22:49 +00:00
Matthew Dillon
2326da5db5 fix int argument used in printf w/ %ld (cast to long) 2001-10-29 02:19:19 +00:00
Matthew Dillon
59ea846905 promote tv_sec in printf to make it type agnostic 2001-10-29 02:17:41 +00:00
Marcel Moolenaar
229778f87e o Do not parse the MADT as a side-effect in AcpiOsGetRootPointer,
do it as a side-effect of probing for MP hardware. This allows
   us to scan for local SAPICs early (especially before MBUF
   initialization).
o  Fix the Local SAPIC structure so that matches the Local SAPIC
   table entry. Now that the Local SAPIC info is the same as the
   Local APIC info, stop dumping the Local APIC entries.
o  For every Local SAPIC entry in the MADT that's not disabled,
   let the SMP code know about it. They represent actual CPUs.
o  Register the OS_BOOT_RENDEZ entry point and provide a (bogus)
   implementation for the entry point.
o  Provide a mapping for internal IPI numbers to ExtINT vectors.
o  In a MP system, announce the CPUs and start them by sending
   IPI_AP_WAKEUP to each of them. Not that it makes a difference
   at this time :-)
o  Miscellaneous style fixes and other adjustments.
2001-10-29 02:16:02 +00:00
Matthew Dillon
434d21ccbf Make ttyprintf() of tv_sec value type agnostic. 2001-10-29 01:23:28 +00:00
Matthew Dillon
f4481658ec cast dev_t to int in printf to fix warning. 2001-10-29 01:22:15 +00:00
Marcel Moolenaar
997313be99 Set RB_MULTIPLE (multiple console support) if the kernel is booted
with the -D flag.
2001-10-29 01:11:40 +00:00
Andrey A. Chernov
e9c044bd9e 1) In devclass_alloc_unit(), skip duplicated wired devices (i.e. with fixed
number) instead of allocating next free unit for them.  If someone needs
fixed place, he must specify it correctly. "Allocating next" is especially bad
because leads to double device detection and to "repeat make_dev panic" as
result.  This can happens if the same devices present somewhere on PCI bus,
hints and  ACPI.  Making them present in one place only not always
possible, "sc" f.e.  can't be removed from hints, it results to no console at
all.

2) In make_device(), detect when devclass_add_device() fails, free dev and
return. I.e. add missing error checking. This part needed to finish fix in 1),
but must be done this way in anycase, with old variant too.
2001-10-28 23:32:35 +00:00
Matthew Dillon
0e9fe2127c Adjust printfs to be time_t agnostic. 2001-10-28 22:53:45 +00:00
John Baldwin
5a994091e0 Revert the reindentation of struct task's definition from rev 1.4.
Requested by:	bde
2001-10-28 16:19:34 +00:00
John Baldwin
9869fa1db8 - More whitespace and comment cleanups.
- Remove unused sw1a label.  A breakpoint can be set in choosethread() for
  the same effect.

Reviewed by:	bde
Submitted by:	bde (partly)
2001-10-28 16:18:22 +00:00
Poul-Henning Kamp
4e13006747 Fix a problem in the disk related hack where device nodes for a physically
non-existent disk in a legacy /dev on a DEVFS system would panic the system
if stat(2)'ed.

Do not whine about anonymous device nodes not having a si_devsw, they're
not supposed to.
2001-10-28 09:39:28 +00:00
Michael Reifenberger
491dec936c Introduce [IPC|SHM]_[INFO|STAT] to shmctl to make
`/compat/linux/usr/bin/ipcs -m` happy.
2001-10-28 09:29:10 +00:00
Yoshihiro Takahashi
8816d1d500 fixed to support pc98 2001-10-28 04:39:02 +00:00
Yoshihiro Takahashi
f4d25d1d62 Remove duplicate apm entry for pc98 2001-10-28 04:34:24 +00:00
Yoshihiro Takahashi
32e2324497 Removed pmc_isa_identify function. It is not needed.
Submitted by:	takawata
2001-10-28 04:16:50 +00:00
Matthew Dillon
1fc36ee6d4 sc_lasttime and sc_starttime are time_t's, not long's. 2001-10-27 20:31:24 +00:00
Mike Barcroft
cb5f460523 Only provide function information in compile environments that support
the C99 variable __func__ and never for C++.  Provide a more meaningful
example in the assert(3) manual.

Reviewed by:	asmodai, bde
2001-10-27 20:11:10 +00:00
Matthew Dillon
4ffa210b94 syncdelay, filedelay, dirdelay, metadelay are ints, not time_t's,
and can also be made static.
2001-10-27 19:58:56 +00:00
Poul-Henning Kamp
4e4a76633b Nudge the axe a bit closer to cdevsw[]:
Make it a panic to repeat make_dev() or destroy_dev(), this check
   should maybe be neutered when -current goes -stable.

   Whine if devsw() is called on anon dev_t's in a devfs system.

   Make a hack to avoid our lazy-eval disk code triggering the above whine.

   Fix the multiple make_dev() in disk code by making ${disk}${unit}s${slice}
   an alias/symlink to ${disk}${unit}s${slice}c
2001-10-27 17:44:21 +00:00
Dag-Erling Smørgrav
a08d68de5b Eliminate the prefix parameter to linux_emul_find(), which was always
linux_emul_path anyway.  Linux_emul_find() has interesting bugs in its
prefix handling (which luckily are not currently exploitable); this
commit is preliminary to an attempt at cleaning it up.

Approved by:	marcel
2001-10-27 11:15:19 +00:00
Dag-Erling Smørgrav
9ca45e813c Add a P_INEXEC flag that indicates that the process has called execve() and
it has not yet returned.  Use this flag to deny debugging requests while
the process is execve()ing, and close once and for all any race conditions
that might occur between execve() and various debugging interfaces.

Reviewed by:	jhb, rwatson
2001-10-27 11:11:25 +00:00
Jake Burkholder
06c4f91f00 Implement elf_reloc. This makes klds work.
Obtained from:	netbsd
2001-10-27 07:09:40 +00:00
Jake Burkholder
e754f9c7ef Handle instruction access mmu miss faults in kernel mode. These can only
be generated by non-preloaded klds.
2001-10-27 07:06:15 +00:00
Robert Watson
3f755714ce o Modify copyright date format for improved consistency: use '-' for
year ranges, rather than a comma-delimited list of years.
2001-10-27 05:47:47 +00:00
Robert Watson
48be932ac0 o Update copyright dates.
Obtained from:	TrustedBSD Project
2001-10-27 05:46:43 +00:00
Robert Watson
fdba6d3a1e o Improve style(9) compliance following KSE modifications. In particular,
strip the space from '( struct thread *...', wrap long lines.
o Remove an unneeded comment on the topic of no lock being required as
  part of the NDINIT() in __acl_get_file(), as it's really not required
  there.

Obtained from:	TrustedBSD Project
2001-10-27 05:45:42 +00:00
Robert Watson
b6e0472987 o Althought this is not specified in POSIX.1e, the UFS ACL implementation
coerces the deletion of a default ACL on a directory when no default
  ACL EA is present to success.  Because the UFS EA implementation doesn't
  disinguish the EA failure modes "that EA name has not been
  administratively enabled" from "that EA name has no defined data",
  there's a potential conflict in error return values.  Normally, the
  lack of administratively configured EA support is coerced to
  EOPNOTSUPP to indicate that ACLs are not available; in this case,
  it is possible to get a successful return, even if ACLs are not
  available because EA support for them has not been enabled.

  Expand the comment in ufs_setacl() to identify this case.

Obtained from:	TrustedBSD Project
2001-10-27 05:39:17 +00:00
Robert Watson
ac8b3dd7dc o Clarify a comment about the locking condition of the vnode upon exit
from ufs_extattr_enable_with_open().
o Print auto-start notifications if (bootverbose).  This was previously
  commented out since it didn't know how to check for bootverbose.
o Drop in comments throughout indicating where ENOENT should be replaced
  with ENOATTR once that is available.

Obtained from:	TrustedBSD Project
2001-10-27 05:19:14 +00:00
Robert Watson
29543004bd o The comment about ordering the destruction of the lock and the removal of
the flag indicating that the structure was initialized didn't need
  an XXX, since it didn't need fixing.

Obtained from:	TrustedBSD Project
2001-10-27 05:05:39 +00:00
Robert Watson
9444746795 o Wrap a number of long lines of code, many of which were introduced
due to KSE-related (p) expansions.

Obtained from:	TrustedBSD Project
2001-10-27 05:03:05 +00:00
Robert Watson
ce5ddec25f Since namespace support was added to the UFS extended attribute
implementation to replace single-character namespace prefixes, '$' is no
longer an invalid attribute name, and the namespace is relevant to
validity determination.

o Remove '$' case from ufs_extattr_valid_attrname()
o Add attrnamespace argument to ufs_extattr_valid_attrname(), and
  fill out appropriately.

Currently no decisions are made based on the namespace argument, but
may be in the future.

Obtained from:	TrustedBSD Project
2001-10-27 04:58:28 +00:00
Luigi Rizzo
935fe01014 Enable round-robin arbitration between transmit and receive unit
in the 21143, instead of giving priority to the receive unit.
This gives a 10-15% performance improvement in the forwarding rate
under heavy load.

Reviewed-by: Bill Paul
2001-10-27 00:59:17 +00:00
Dag-Erling Smørgrav
a4c0058691 Support the "install.debug" and "reinstall.debug" targets for kernel modules.
Small tweaks to kldxref may be necessary to avoid the surprising (but harm-
less) behaviour of 'kldload foo' loading foo.ko.debug instead of foo.ko if
it is present in the kernel directory.

Approved by:	a week of silence on -arch
MFC after:	2 weeks
2001-10-27 00:52:50 +00:00
Bill Fenner
4730796ca1 Force the length of the sockaddr to be correct for AF_INET and AF_INET6
in bind() and connect().  Linux doesn't care if the length of the
sockaddr matches its address family; FreeBSD does.  This fixes the
known issues with the resolver in linux_base-7.
2001-10-26 23:10:08 +00:00
Mike Smith
0b9272be42 Add 'ciss'. 2001-10-26 21:17:26 +00:00
Matthew Dillon
d23f5958bc Add mtx_lock_giant() and mtx_unlock_giant() wrappers for sysctl management
of Giant during the Giant unwinding phase, and start work on instrumenting
Giant for the file and proc mutexes.

These wrappers allow developers to turn on and off Giant around various
subsystems.  DEVELOPERS SHOULD NEVER TURN OFF GIANT AROUND A SUBSYSTEM JUST
BECAUSE THE SYSCTL EXISTS!  General developers should only considering
turning on Giant for a subsystem whos default is off (to help track down
bugs).  Only developers working on particular subsystems who know what
they are doing should consider turning off Giant.

These wrappers will greatly improve our ability to unwind Giant and test
the kernel on a (mostly) subsystem by subsystem basis.   They allow Giant
unwinding developers (GUDs) to emplace appropriate subsystem and structural
mutexes in the main tree and then request that the larger community test
the work by turning off Giant around the subsystem(s), without the larger
community having to mess around with patches.  These wrappers also allow
GUDs to boot into a (more likely to be) working system in the midst of
their unwinding work and to test that work under more controlled
circumstances.

There is a master sysctl, kern.giant.all, which defaults to 0 (off).  If
turned on it overrides *ALL* other kern.giant sysctls and forces Giant to
be turned on for all wrapped subsystems.  If turned off then Giant around
individual subsystems are controlled by various other kern.giant.XXX sysctls.

Code which overlaps multiple subsystems must have all related subsystem Giant
sysctls turned off in order to run without Giant.
2001-10-26 20:48:04 +00:00
Matthew Dillon
8d5c8e9f04 minor commenting based on syscall environment 2001-10-26 20:35:52 +00:00
Dag-Erling Smørgrav
1831900053 Add VOP_IOCTL support, and fix a bug that would cause a panic if a file or
symlink lacked a filler function.
2001-10-26 18:52:47 +00:00
John Baldwin
282873e2c0 - Change the taskqueue locking to protect the necessary parts of a task
while it is on a queue with the queue lock and remove the per-task locks.
- Remove TASK_DESTROY now that it is no longer needed.
- Go back to inlining TASK_INIT now that it is short again.

Inspired by:	dfr
2001-10-26 18:46:48 +00:00
Mitsuru IWASAKI
f86214b6b8 Add APM compatibility feature to ACPI.
This emulates APM device node interface APIs (mainly ioctl) and
provides APM services for the applications.  The goal is to support
most of APM applications without any changes.
Implemented ioctls in this commit are:
 - APMIO_SUSPEND (mapped ACPI S3 as default but changable by sysctl)
 - APMIO_STANDBY (mapped ACPI S1 as default but changable by sysctl)
 - APMIO_GETINFO and APMIO_GETINFO_OLD
 - APMIO_GETPWSTATUS

With above, many APM applications which get batteries, ac-line
info. and transition the system into suspend/standby mode (such as
wmapm, xbatt) should work with ACPI enabled kernel (if ACPI works well :-)

Reviewed by:	arch@, audit@ and some guys
2001-10-26 17:43:05 +00:00
Matthew Dillon
7a5a635273 Move recently added procedure which was incorrectly placed within an
#ifdef DDB block.
2001-10-26 16:27:54 +00:00
Matt Jacob
831039f850 Detach the prom console when platform.cons_init is called. This seems
to avoid most of the double character kernel goop we've been having by having
both a prom console && a normal console.

Was not able to test with graphics head. Hope this doesn't break anything.

Reviewed by:	silence on alpha
2001-10-26 16:13:47 +00:00
Poul-Henning Kamp
5f7806ab69 Make cdevsw[] static. 2001-10-26 15:31:22 +00:00
Poul-Henning Kamp
71ab1fa5df Reporting device drivers by traversing cdevsw[] is at best a hack
which may or may not return something which is partially right.

Disable the "devices" file until we find out what this is needed for,
and what exactly those apps need.

This will allow cdevsw to become static again.

Approved by:	DES
2001-10-26 15:30:44 +00:00
Ruslan Ermilov
0df659af99 Finish the asbestos suited move of $mach/conf/*.$mach to conf/*.$mach.
Fix some more typos.
2001-10-26 10:33:45 +00:00
John Baldwin
8e2e767b1f Add a per-thread ucred reference for syscalls and synchronous traps from
userland.  The per thread ucred reference is immutable and thus needs no
locks to be read.  However, until all the proc locking associated with
writes to p_ucred are completed, it is still not safe to use the per-thread
reference.

Tested on:	x86 (SMP), alpha, sparc64
2001-10-26 08:12:54 +00:00
John Baldwin
1de1c550b1 Add locking to taskqueues. There is one mutex per task, one mutex per
queue, and a mutex to protect the global list of taskqueues.  The only
visible change is that a TASK_DESTROY() macro has been added to mirror
the TASK_INIT() macro to destroy a task before it is free'd.

Submitted by:	Andrew Reiter <awr@watson.org>
2001-10-26 06:32:21 +00:00
John Baldwin
40c6d2be16 Use msleep() to avoid lost wakeup's instead of doing an ineffective
splhigh() before the mtx_unlock and tsleep().  The splhigh() was probably
correct in the original code using simplelocks but is not correct in
5.0-current.

Noticed by:	Andrew Reiter <awr@FreeBSD.org>
2001-10-26 06:09:01 +00:00
Matthew Dillon
245df27cee Implement kern.maxvnodes. adjusting kern.maxvnodes now actually has a
real effect.

Optimize vfs_msync().  Avoid having to continually drop and re-obtain
mutexes when scanning the vnode list.  Improves looping case by 500%.

Optimize ffs_sync().  Avoid having to continually drop and re-obtain
mutexes when scanning the vnode list.  This makes a couple of assumptions,
which I believe are ok, in regards to vnode stability when the mount list
mutex is held.  Improves looping case by 500%.

(more optimization work is needed on top of these fixes)

MFC after:	1 week
2001-10-26 00:08:05 +00:00
Matthew Dillon
f92dcd3e4a Add missing TAILQ_INSERT_TAIL's which somehow didn't get comitted with
the recent vnode cleanup.
2001-10-25 23:13:56 +00:00
Ian Dowse
71fc5e11c7 Default to not performing ufs_dirhash's extensive directory-block
sanity check after every directory modification. This check can be
re-enabled at any time by setting the sysctl "vfs.ufs.dirhash_docheck"
to 1.

This group of sanity tests was there to ensure that any UFS_DIRHASH
bugs could be caught by a panic before a potentially corrupted
directory block would be written to disk. It has served its main
purpose now, so disable it in the interest of performance.

MFC after:	1 week
2001-10-25 22:55:59 +00:00
Matthew Dillon
f02098e59c In cluster_rbuild(), 'size' had better match buf->b_bcount and buf->b_bufsize
or the cluster will not be properly merged.  Dup the code from
cluster_wbuild() and add some printf()s to see if bad cases are present.

MFC after:	2 weeks
2001-10-25 22:49:48 +00:00
John Baldwin
76e7a78292 Use TASK_INIT to initialize taskqueue task instead of violating the
abstraction.

Submitted by:	Andrew Reiter <arr@watson.org>
2001-10-25 19:56:02 +00:00
Jeroen Ruigrok van der Werven
9c59aa470c Remove wx driver, which got recently removed.
Submitted by:	revamped kernincludes.sh
2001-10-25 19:45:39 +00:00
Jeroen Ruigrok van der Werven
0297dba19f Unbreak NEWCARD by removing options NFS and replacing it with the
new NFSCLIENT and NFSSERVER options.

Submitted by:	revamped kernincludes.sh
2001-10-25 19:41:13 +00:00
Jonathan Lemon
208b417fd5 Aargh. I really shouldn't do late night commits. Remove a floating point
multiply, and replace it with a close equivalent.  1.488 =~ 1.5
2001-10-25 19:36:44 +00:00
Ian Dowse
4f6434bdde Now that nfsm_reply() does not usually set 'error' to 0, we need
to do it explicitly in nfsrv_noop so that the reply gets sent back
to the client. This fixes the generation of a selection of RPC
error replies (RPC_PROGMISMATCH, RPC_PROGUNAVAIL, RPC_PROCUNAVAIL
etc.) that are used by some clients to detect support for optional
protocols and features.

Reviewed by:	peter
Reported by:	Thomas Quinot <quinot@inf.enst.fr>
PR:		kern/31479
2001-10-25 19:07:56 +00:00
Luigi Rizzo
617b3dd758 Defs for three (unused so far) bits in PCI command/status register
were off by one bit.
2001-10-25 17:43:26 +00:00
John Baldwin
5a08b84f83 Fix an inverted test csae. Success of getenv() is determined by a return
value of !NUL rather than NUL.

Submitted by:	luigi
Pointy hat to:	jhb
2001-10-25 17:22:31 +00:00
John Baldwin
e0e3030796 Currently no code does a CROSSJUMP() to sw1a, so we don't need a
CROSSJUMPTARGET() for it.

Submitted by:	bde
2001-10-25 16:54:21 +00:00
John Baldwin
02c41f11e3 Use %ecx instead of %ebx for the scratch register while updating %dr7 since
%ecx isn't a call safe register and thus we don't have to save and restore
it.

Submitted by:	bde
2001-10-25 16:52:43 +00:00
John Baldwin
7df8a724c2 - Fix typo in comment from previous revision.
- Fix a bug in the LDT changes where the wrong argument was passed to
  set_user_ldt() from cpu_switch().  The bug was passing a pointer to the
  ldt, but set_user_ldt() takes a pointer to the process' mdproc structure.

Submitted by:	bde
2001-10-25 16:50:16 +00:00
John Baldwin
163fd6fb97 Whitespace, comment, and string fixes.
Submitted by:	bde (mostly)
2001-10-25 16:47:01 +00:00
Bruce Evans
42108a7706 Fixed misformatting of options line for COMPAQ_M610 and EICON_DIVA in
rev.1.974.

Fixed previous misformatting of options line for ACCEPT_FILTER_DATA,
ACCEPT_FILTER_HTTP, ACPI_DEBUG, COMPAT_SVR4, DEBUG_SVR4, ED_NO_MIIBUS,
IFS, PCFCLOCK_MAX_RETRIES, PCFCLOCK_VERBOSE, PECOFF_DEBUG, PECOFF_SUPPORT,
PPC_PROBE_CHIPSET, RANDOM_IP_ID, REGRESSION, SC_CUT_SEPCHARS,
SC_CUT_SPACES2TABS, SES_ENABLE_PASSTHROUGH, UFS_DIRHASH, UFS_EXTATTR
and UFS_EXTATTR_AUTOSTART.
2001-10-25 12:05:45 +00:00
Bruce Evans
c797ab47ab Fixed bugs in rev.1.973. Actually enable PCI_ENABLE_IO_MODES. It
defeats the point of LINT to comment out positive options.

Fixed style bugs in rev.1.973:
- disordering of PCI options list.
- missing space after "options".
- line longer than 80 characters.
- bogus quoting of "BIOS".
2001-10-25 11:46:54 +00:00
Hellmuth Michaelis
0103e55f3f add options line for Compaq Microcom 610 ISDN card. 2001-10-25 11:14:46 +00:00
Ruslan Ermilov
ff0c93cc0e Just use ${MACHINE}, it's already special-casing pc98. 2001-10-25 09:05:47 +00:00
Doug Rabson
4abfff1e2e Call ExitBootServices and disable interrupts before we start hacking
the VM registers. This ought to make things slightly more reliable here.
2001-10-25 08:53:39 +00:00
Doug Rabson
7d5af294dc Add the two sections used for PLT entries to the text and sdata sections
respectively. This makes IPLTLSB relocations work properly (these are
generated for weak symbols, particularly for _longjmp).
2001-10-25 08:50:14 +00:00
Jonathan Lemon
0751407193 Don't use the ip_timestamp structure to access timestamp options, as the
compiler may cause an unaligned access to be generated in some cases.

PR: 30982
2001-10-25 06:27:51 +00:00
Jonathan Lemon
ec691a10e6 If we are bridging, fall back to using any inet address in the system,
irrespective of receive interface, as a last resort.

Submitted by: ru
2001-10-25 06:14:21 +00:00
Jonathan Lemon
807b8338ba Relocate the KASSERT for a null recvif to a location where it will
actually do some good.

Pointed out by: ru
2001-10-25 05:56:30 +00:00
Jonathan Lemon
72a32a26aa Add support for loadable microcode which implements interrupt coalescing
and packet bundling.  Make the microcode settings controllable via sysctl
and loader tunables.

Submitted by: Marko Zec <zec@tel.fer.hr>
  (with some munging and dynamic sysctl support by me)

Also extend the workaround for Dynamic Standby mode to later '559 chips,
not just the ICH2 variants.
2001-10-25 05:32:01 +00:00
Jonathan Lemon
9a7a8c90d1 . Add structure elements for sysctl.
. Document default values for microcode
2001-10-25 05:27:25 +00:00
Jonathan Lemon
3ceb25205d . Add structure definition for microcode download.
Submitted by: Marko Zec <zec@tel.fer.hr>

  . Add some PCI chip revision entries.
  . Make size of txcb dependent on pointer size rather than arch #define
2001-10-25 05:25:58 +00:00
Jonathan Lemon
b4c45df0a7 Add Intel's loadable microcode to implement receive side bundling.
This is taken verbatim from the Intel's e100-1.6.22 release, with
the addition of their LICENSE file at the top.

Submitted by: Marko Zec <zec@tel.fer.hr>
2001-10-25 05:23:31 +00:00
Jonathan Lemon
18bfd58110 cnclose() can potentially race against itself. To avoid vn_close() races,
NULL-out cnd_vp before calling the latter, as it may block.

Submitted by: dillon
2001-10-25 04:51:37 +00:00
Jonathan Lemon
ae4da68827 Add PCI_ENABLE_IO_MODES option, for BIOSen that neglect this.
Submitted by: Andrew R. Reiter arr@watson.org
2001-10-25 04:44:50 +00:00
Robert Watson
f8bf16fc88 o Remove extern showallsockets, defunct as of the change to
kern.security.seeotheruids_permitted.  This was missed in the
  commit that made this change elsewhere.
2001-10-25 02:03:37 +00:00
Luigi Rizzo
c5ca4c7e6e Backout 1.61 -- both intrcnt and intrnames are already exported
via sysctl under "hw".
2001-10-25 01:32:24 +00:00
John Baldwin
24db04598b Split the per-process Local Descriptor Table out of the PCB and into
struct mdproc.

Submitted by:	Andrew R. Reiter <arr@watson.org>
Silence on:	-current
2001-10-25 00:53:43 +00:00
Jonathan Lemon
7ce26133ea Force FWRITE on when opening the console, so that the flags passed to
vn_close match those from vn_open.  This fixes the panic some people
were seeing about "vrele: missed vn_close".
2001-10-25 00:14:16 +00:00
Julian Elischer
5a2553fa1d re-undo rev 1.78 now that style(9) is sane in this regard,
(make struct {proc,thread,kse,ksgrp} readable again.)
2001-10-24 23:40:59 +00:00
John Baldwin
882bcf5879 Document the requirements and nature of the logical CPU IDs. It isn't
very strict and leaves much up to the platform so that it can define a
convenient mapping.

Requested by:	mjacob
2001-10-24 22:15:38 +00:00
John Baldwin
02185af5a9 Change the module name from 'snd_sonicvibes' to 'snd_vibes' as that is
the filename (thus the "old" module name) and the name used by
snd_driver.ko.
2001-10-24 21:44:07 +00:00
John Baldwin
579f17a038 Change module name from 'snd_als' to 'snd_als4000' to match name in
snd_driver.ko.
2001-10-24 21:42:06 +00:00
John Baldwin
0ff24d06f7 Change the module name from 'via' to 'snd_via82c686' to match the KLD
filename and in snd_driver.ko.
2001-10-24 21:38:08 +00:00
John Baldwin
ee1fbec1bf Change the module name from 'snd_cmipci' to 'snd_cmi' to match the
filename, module name in the loader, the dependency in snd_driver.ko, and
to be consistent with other sound drivers.
2001-10-24 21:35:31 +00:00
Doug Rabson
04c2a8f6be * Clear the TLB on boot.
* If a pte for a location given to pmap_enter_quick is valid, just give
  up - don't panic, even if the mapping is different.
2001-10-24 21:22:08 +00:00
Doug Rabson
45740e15b4 If we get an unhandled page fault in kernel mode, either panic (if
pcb_onfault is not set) or arrange to restart at the location in
pcb_onfault.

This ought to help the stability of a system under moderate load. It
certainly stops DDB from hanging the kernel when it tries to access a
non-present page.
2001-10-24 21:20:50 +00:00
Doug Rabson
88f5f7ac50 Try to get the self-relocator to work with IPLTLSB relocations. Doesn't
work right though - I can't figure out why.
2001-10-24 20:14:49 +00:00
Matt Jacob
888ef2d923 Unbreak alpha builds. 2001-10-24 18:45:35 +00:00
Matthew Dillon
a06fe5111e unwind v_writecount in fhopen() if we are unable to allocate the
descriptor.

MFC after:	3 days
2001-10-24 18:32:17 +00:00
Jonathan Lemon
553b79aa63 cn_tab no longer exists, use cnadd() to add a console device. Note that
this may result in duplicate console output in some cases.
2001-10-24 18:30:05 +00:00
Dag-Erling Smørgrav
27c97f7660 Don't enable write cacheing on devices that don't support tagged queuing
unless hw.ata.wc is set.

Approved by:	sos
MFC after:	1 week
2001-10-24 18:24:09 +00:00
Jonathan Lemon
b792b54c89 Remove call to cninit_finish(). 2001-10-24 17:42:01 +00:00
John Baldwin
c5ca5a55a1 - Clean up the comments slightly here to make them more readable.
- Set the type and trapframe number for the F00F workaround since type
  can be used later by sv_transtrap().  Debuggers might also want to look
  at the type in the trapframe.

Submitted by:	bde (mostly)
2001-10-24 17:38:40 +00:00
Hajimu UMEMOTO
a55dfa2ac1 Make apm a module.
We need further work to be able to specify an equivalence of `flags 0x20'.
Many PCs should work for now.  But, some PCs need `flags 0x20'.
2001-10-24 16:53:54 +00:00
Yoshihiro Takahashi
6cac891491 Added the pmc driver which supports power management controller of
old NEC PC-98NOTE.

Submitted by:	chi@bd.mbn.or.jp (Chiharu Shibata)
MFC after:	1 week
2001-10-24 14:46:40 +00:00
John Baldwin
781a35df6b Fix this to actually compile in the !INVARIANTS case.
Reported by:	Maxime Henrion <mux@qualys.com>
2001-10-24 14:18:33 +00:00
Robert Drehmel
9a024fc559 Use vm_offset_t instead of caddr_t to fix a warning and remove
two casts.
2001-10-24 14:15:28 +00:00
Hellmuth Michaelis
365bf7980c fix kvprintf panic in attach routine 2001-10-24 14:12:47 +00:00
Cameron Grant
16a33022e7 fix SNDCTL_DSP_GETISPACE behaviour 2001-10-24 12:40:54 +00:00
Cameron Grant
8309fd9aef improve recording behaviour 2001-10-24 12:33:21 +00:00
Marcel Moolenaar
3a6ec54e58 Remove call to cninit_finish. This is part of the multiple
low-level console support.
2001-10-24 08:06:55 +00:00
Marcel Moolenaar
39a4abbe0c Add parse functions for local APIC and I/O APIC entries.
Also, show when a local APIC or SAPIC is disabled.
2001-10-24 04:48:05 +00:00
Robert Watson
c1787d3b75 o Note an additional potential problem here: LOCKD_MSG directly exports
struct ucred to userland.  In 5.0-CURRENT, it is desirable to instead
  export struct xucred, as ucred contains mutexes, pointers, and other
  kernel evil.  I'll add it to my work queue.
2001-10-24 02:48:38 +00:00
Matthew Dillon
79deba82cd Fix ktrace enablement/disablement races that can result in a vnode
ref count panic.

Bug noticed by:	ps
Reviewed by:	ps
MFC after:	1 day
2001-10-24 01:05:39 +00:00
Matt Jacob
fc16d270b7 Tra-La, another QLogic f/w funny- this time with the 2300.
If we get a completion status of RQCS_QUEUE_FULL, it means
that the internal queues are full. Other QLogic boards set
the QFULL SCSI status. But *nooooooooooo*, not the 2300.

MFC after:	1 day
2001-10-23 23:05:20 +00:00
Nick Hibma
9965784733 Regen. 2001-10-23 22:44:36 +00:00
Nick Hibma
2b97142db8 Add Olympus C-700 2001-10-23 22:44:03 +00:00
John Baldwin
4e5e677bc0 Change the sx(9) assertion API to use a sx_assert() function similar to
mtx_assert(9) rather than several SX_ASSERT_* macros.
2001-10-23 22:39:11 +00:00
John Baldwin
e5e5b51f9f Allow hw.acpi.cpu.{economy,performance}_speed to be set from the loader
via tunables.
2001-10-23 22:37:36 +00:00
John Baldwin
d19fc02a22 Change TUNABLE_*_FETCH to have a return value of 0 if the variable was not
found or successfully converted and true otherwise.
2001-10-23 22:35:25 +00:00
John Baldwin
21cbf0cc8b - Change getenv_quad() to return an int instead of a quad_t since it
returns an success/failure code rather than the actual value.
- Add getenv_string() which copies a string from the environment to another
  string and returns true on success.
2001-10-23 22:34:36 +00:00
John Baldwin
a33cbf355e Set the code and signal for the F00F hack fault directly instead of
changing the code in the trapframe and looping back to the top of trap
again.

Tested by:	cjc
2001-10-23 22:29:16 +00:00
Peter Wemm
76792d87a8 Fix RAW dependency violation when compiled with gcc-3
Warning: Use of 'br.ret.sptk.many' violates RAW dependency 'PSR.tb' (data)
2001-10-23 22:23:22 +00:00
Jonathan Lemon
22dc069c24 Set RB_MULTIPLE (multiple console support) if the kernel is booted
with the -D flag.
2001-10-23 20:27:48 +00:00
Jonathan Lemon
c80bd6e378 Allow the RBX_DUAL flag to appear in bootinfo. 2001-10-23 20:27:05 +00:00
Jonathan Lemon
991f976036 Implement multiple low-level console support. 2001-10-23 20:25:50 +00:00
Jonathan Lemon
5e1cf72708 Add RB_MULTIPLE flag so the bootloader can turn on mulitiple console
support.  This flag value is identical to RBX_DUAL from boot2.
2001-10-23 20:22:04 +00:00
Jonathan Lemon
034cc6fe5a Add a siocnterm function for the CONS_DRIVER function vector. 2001-10-23 20:16:56 +00:00
Robert Watson
b5c05ddcb8 o Add two comments identifying problems with the current nfs_lock.c
implementation, so that the information doesn't get lost.
  (1) /var/run/lock is looked up relative to the current thread's root
      directory, but it's not clear that's desirable.
  (2) A race condition associated with live credential modification on
      a shared credential is present when privilege is granted for
      the purposes of talking to /var/run/lock.
2001-10-23 19:11:31 +00:00
Robert Watson
fc2749a40c o vn_open() fails to call VOP_CLOSE() if vfs_object_create fails. Ideally
all successful calls to VOP_OPEN() might be reflected in a call to
  VOP_CLOSE().  For now, simply add a comment reflecting this problem;
  this should be fixed at some point.
2001-10-23 19:09:01 +00:00
John Baldwin
ac9a258074 Assert that Giant is not held in mi_switch() unless the process state
is SMTX or SRUN.
2001-10-23 17:52:49 +00:00
Warner Losh
2ce87d3448 Break out the bus front ends into their own files. Rewrite
sio_pccard_detach to use new siodetach.  Add an extra arg to sioprobe
to tell driver to probe/not probe the device for IRQs.

This incorporates most of Bruce's review material.  I'm at a good
checkpoint, but there will be more to come based on bde's further
reviews.

Reviewed by: bde
2001-10-23 15:17:33 +00:00
Peter Wemm
b248bfe48d Turn off the single-user override. We've been running multi-user
for some time.  Having a machine boot unattended is useful. :-)
2001-10-23 11:04:43 +00:00
Doug Rabson
378749743c Add data serialisations after ptc and mov to rr[] instructions. 2001-10-23 10:20:04 +00:00
Søren Schmidt
d5c047cf10 Add a bunch of new PCI ID's for Intel ATA chips. 2001-10-23 09:57:49 +00:00
Akio Morita
cfb3969378 fix broken `compat_atdisk'(replace raw device name with block device's).
Reviewed by:	nyan
MFC after:	3 days
2001-10-23 09:39:09 +00:00
Søren Schmidt
e32abc1a60 Add experimental support for the HighPoint HPT372 ATA133 controller.
Based on docs kindly provided by HighPoint which we thank for
the close cooperation with the FreeBSD project!.
2001-10-23 09:25:57 +00:00
Akio Morita
5f44a44380 Fix compile error of the case using `LINE30' option.
Reviewed by:	nyan
MFC after:	3 days
2001-10-23 08:54:50 +00:00
Søren Schmidt
6a1f123c0c Add experimental support for the Promise ATA133 controller.
This might need additional code for hotswapping use, but first
I need to get my hands on actual hw...

Based on docs kindly provided by Promise Inc which we thank for
the close cooperation with the FreeBSD project!.
2001-10-23 08:01:47 +00:00
Warner Losh
516fdf9478 Add a tunable (hw.pcic.boot_deactivated) which will boot the system
with the pccards deactivated.  This can work around some problems in
pccard system, but is also for people that want to explicitly turn on
cards after boot rather that at boot.

MFC after: 7 days
Submitted by: iwasaki-san
Reviewed by: ume-san, shiba-san
2001-10-23 07:04:03 +00:00
Matthew Dillon
4f467cb8c1 Fix incorrect double-termination of vm_object. When a vm_object is
terminated and flushes pending dirty pages it is possible for the
object to be ref'd (0->1) and then deref'd (1->0) during termination.
We do not terminate the object a second time.

Document vop_stdgetvobject() to explicitly allow it to be called without
the vnode interlock held (for upcoming sync_msync() and ffs_sync()
performance optimizations)

MFC after:	3 days
2001-10-23 01:23:41 +00:00
Matthew Dillon
c72ccd014d Change the vnode list under the mount point from a LIST to a TAILQ
in preparation for an implementation of limiting code for kern.maxvnodes.

MFC after:	3 days
2001-10-23 01:21:29 +00:00
Mike Barcroft
3a72286480 Remove funky right justification.
Pointed out by:	bde
2001-10-23 00:42:15 +00:00
Hajimu UMEMOTO
9f833c5b5a Fixed the value of the prefixlen in the sadb_address structure.
When pfkey message relative to SA is sent, the prefixlen was incorrect.

Obtained from:	KAME
MFC after:	1 week
2001-10-22 20:19:47 +00:00
Doug Rabson
ab47b84778 In the signal trampoline, flush the register stack before calling
sigreturn. This appears to fix the last set of problems with csh.
2001-10-22 19:43:05 +00:00
Mitsuru IWASAKI
c7a9768031 Reduce frequency of Battery info (_BIF) acquisition. This helps
avoiding EC read errors on some laptops.
 - Stop updating Battery info for all user requests
 - Update Battery info by notify events and resume method
 - Poll Battery info every one minute

Suggested by:	takawata
2001-10-22 18:01:37 +00:00
Mike Smith
096dcb5345 Fix reversed virtual/physical bus check, whoops!
Submitted by:	HIROSHI OOTA <oota@LSi.nec.co.jp>
2001-10-22 17:38:02 +00:00
Jonathan Lemon
21987f0645 Remove unused headers that were breaking LINT. 2001-10-22 16:35:15 +00:00
Dag-Erling Smørgrav
c193b945eb No, you may not /* FALLTHROUGH */. Not only will you return an incorrect
result, but you'd corrupt the kernel malloc() arena if it weren't for a
small but life-saving optimization in ioctl().

MFC after:	1 week
2001-10-22 16:13:38 +00:00
Warner Losh
9e90edd49a wx is an ex-parrot. wx doesn't exist any more, so remove it. 2001-10-22 16:02:51 +00:00
Warner Losh
565fcd9dbb These two used sioreg.h as well. This is mildly bogus, but it is harder
to fix right in a hurry.

This (almost) fixes LINT.

Submitted by:	bde
2001-10-22 15:59:49 +00:00
Dag-Erling Smørgrav
e9745b9961 Upon further reflection, back out previous commit, partly for the reasons
Bruce stated and partly because it introduces gratuitous incompatibilities
with -STABLE.
2001-10-22 15:08:14 +00:00
Hajimu UMEMOTO
cb34210012 restore the data of the ip header when extended udp header and data checksum
is calculated.  this caused some trouble in the code which the ip header
is not modified.  for example, inbound policy lookup failed.

Obtained from:	KAME
MFC after:	1 week
2001-10-22 12:43:30 +00:00
Poul-Henning Kamp
5015bb7f85 disk_clone() was a bit too eager to please: "md0s1ec" is not a valid
device.

Noticed by:	Chad David <davidc@acns.ab.ca>
2001-10-22 10:18:45 +00:00
Ruslan Ermilov
f1eafd6db8 Remove extra memory region kept by "struct pfil_head pfil_head_t;".
Seems to be a typo for typedef, but we don't want this non-style(9)
typedef anyway.

PR:		kern/31356
2001-10-22 08:46:23 +00:00
David E. O'Brien
283da80631 Setup for a 200MB FS -- 209715200/512= 409600 sectors.
(DFR's latest ia64-root-*.tar.gz leaves only 7.7M avail when created by
dd if=/dev/zero of=ia64-root.fs bs=1024k count=200)
2001-10-22 07:33:38 +00:00
Alan Cox
eab754b91d Implement TCP/IP checksum off-loading on send for the 3c905B and later
generation cards.
2001-10-22 06:45:42 +00:00
Warner Losh
d75c1b4a90 First commit after a repo copy of isa/sio* -> dev/sio:
Move sio from isa/sio.c to dev/sio/sio.c.  The next step is to break
out the front end attachments, improve support for these parts on
different busses, and maybe, if we're lucky, merging in pc98 support.
It will also be MI and live in conf/files rather than files.*.

Approved by: bde
Tested with: i386, pc98
2001-10-22 02:48:38 +00:00
Dag-Erling Smørgrav
902830c2ba Move the stop event macros from pioctl.h to proc.h, and add an S_ALLSTOPS
macro to represent "all stop events".
2001-10-22 02:00:33 +00:00
Dag-Erling Smørgrav
7c62990641 Move procfs_* from procfs_machdep.c into sys_process.c, and rename them to
proc_* in the process; procfs_machdep.c is no longer needed.

Run-tested on i386, build-tested on Alpha, untested on other platforms.
2001-10-21 23:57:24 +00:00
Dag-Erling Smørgrav
1f04261973 [partially forced commit due to pilot error in earlier commit attempt]
{set,fill}_{,fp,db}regs() fixup:

 - Add dummy {set,fill}_dbregs() on architectures that don't have them.

 - KSEfy the powerpc versions (struct proc -> struct thread).

 - Some architectures had the prototypes in md_var.h, some in reg.h, and
   some in both; for consistency, move them to reg.h on all platforms.

These functions aren't really MD (the implementation is MD, but the interface
is MI), so they should move to an MI header, but I haven't figured out which
one yet.

Run-tested on i386, build-tested on Alpha, untested on other platforms.
2001-10-21 22:16:48 +00:00
Dag-Erling Smørgrav
ef394d81ad {set,fill}_{,fp,db}regs() fixup:
- Add dummy {set,fill}_dbregs() on architectures that don't have them.

 - KSEfy the powerpc versions (struct proc -> struct thread).

 - Some architectures had the prototypes in md_var.h, some in reg.h, and
   some in both; for consistency, move them to reg.h on all platforms.

These functions aren't really MD (the implementation is MD, but the interface
is MI), so they should move to an MI header, but I haven't figured out which
{set,fill}_{,fp,db}regs() fixup:

 - Add dummy {set,fill}_dbregs() on architectures that don't have them.

 - KSEfy the powerpc versions (struct proc -> struct thread).

 - Some architectures had the prototypes in md_var.h, some in reg.h, and
   some in both; for consistency, move them to reg.h on all platforms.

These functions aren't really MD (the implementation is MD, but the interface
is MI), so they should move to an MI header, but I haven't figured out which
one yet.

Run-tested on i386, build-tested on Alpha, untested on other platforms.
2001-10-21 22:14:00 +00:00
Dag-Erling Smørgrav
7936569b00 Add proc/mtab which simulates a Linux system's /etc/mtab. 2001-10-21 15:56:46 +00:00
Dag-Erling Smørgrav
364d225aac This module will soon need opt_linux.h (for <linux/linux_util.h>) 2001-10-21 15:54:56 +00:00
Dag-Erling Smørgrav
45fb069ac9 Convert textvp_fullpath() into the more generic vn_fullpath() which takes a
struct thread * and a struct vnode * instead of a struct proc *.

Temporarily add a textvp_fullpath macro for compatibility.
2001-10-21 15:52:51 +00:00
Doug Rabson
eedecb60e8 Add some more names for bits of trapframe. 2001-10-21 14:03:58 +00:00
Doug Rabson
c623bf3471 We need to save a bit more information in the partial syscall trapframe
in case we need to take a signal.
2001-10-21 14:03:25 +00:00
Doug Rabson
3b51c8566c Set ar.fpsr to something sane before trying to handle a trap - the user
might have trashed it.
2001-10-21 14:02:27 +00:00
Doug Rabson
54e594762b Use ia64_set_fpsr() instead of __asm to set ar.fpsr. 2001-10-21 14:01:48 +00:00
Doug Rabson
f85321667c Add ia64_set_fpsr(). 2001-10-21 14:00:59 +00:00
Hellmuth Michaelis
8ae67d78bf Fix bug attaching the ELSA PCC16, the cardtyp value was set incorrectly
in the probe routine.
MFC after:	3 days
2001-10-21 09:22:48 +00:00
Hellmuth Michaelis
676ccc0cd0 Add a driver for the Compaq Microcom 610 ISDN (Compaq series PSB2222I) ISA PnP
card.

Submitted by:   Steve Looman
Reviewed by:    hm
MFC after:      1 month
2001-10-21 09:20:52 +00:00
Hellmuth Michaelis
12428dfd1b Add a driver for the Compaq Microcom 610 ISDN (Compaq series PSB2222I) ISA PnP
card.

Submitted by:	Steve Looman
Reviewed by:	hm
MFC after:	1 month
2001-10-21 09:17:25 +00:00
Marcel Moolenaar
cf1a20ea71 Implement the IPI send functions. No mapping between IPI message
Id and interrupt vector has been made yet.
2001-10-21 08:57:02 +00:00
Hellmuth Michaelis
a986a974e9 It seems that I slipped a nasty bug into the CAPI support. The message
lengths for CONNECT_REQ and CONNECT_IND are incorrect, which causes
dialouts to fail after certain error situations (an invalid -- not
wrong! -- number has been dialed). Since these messages are tagged as
too short, the device reads trailing garbage as the B protocol
parameters; this is OK as long as the garbage consists of zero bytes,
which it usually does, except after the said error.

Another change we have taken into use is to send an explicit Q.850
"normal call clearing" code when a call is ignored using PRI equipment
(specifically AVM T1); the CAPI pseudo-code for ignore, 1, translates
into something at least Ericsson exchanges interpret oddly (message
"this area is not reachable from your number"). NCCLR makes the exchange
give a busy signal, which is the behaviour at least we prefer
(conceivably, the ignore code could be made a sysctl variable).

The attached patch corrects the message length issue. It also includes a
somewhat unpretty solution for the PRI ignore code (if device's number
of channels equals 30, assume PRI and send NCCLR, otherwise send CAPI
ignore). Tested using AVM B1 PCI and T1 PCI.

Submitted by:	Juha-Matti Liukkonen <jml@cubical.fi>
Reviewed by:	hm
MFC after:	1 month
2001-10-21 08:51:54 +00:00
Matthew Dillon
5eb13f768c Documentation
MFC after:	1 day
2001-10-21 06:26:55 +00:00
Bruce Evans
7dd43330b3 Use the i386 version of npx.c. It has been merged with the pc98 version.
Approved by:	nyan
Not tested by:	bde
2001-10-21 06:14:12 +00:00
Matthew Dillon
57601bcb5d Syntax cleanup and documentation, no operational changes.
MFC after:	1 day
2001-10-21 06:12:06 +00:00
Bruce Evans
08b00f49c3 MFi386:
- sys/pc98/pc98/npx.c 1.87 (2001/09/15; author: imp)
  I don't think pc98 has acpi at all, so ifdef the acpi attachments for
  now.

This completes merging sys/pc98/pc98/npx.c into sys/i386/isa/npx.c so
that the former can be removed.
2001-10-21 06:05:08 +00:00
Bruce Evans
abfde38316 MFpc98: fundamental differences. The magic numbers for the i/o port
and the irq are different for pc98, and are not very well handled (we
use a historical mess of hard-coded values, values from header files
and values from hints).
2001-10-21 05:56:03 +00:00
Marcel Moolenaar
2791ddeb6c Add define for the PIB default address and include a reference to
the SDM.
2001-10-21 05:52:54 +00:00
Bruce Evans
40d8c8da95 MFpc98: all changes in sys/pc98/pc98/npx.c related to FPU_ERROR_BROKEN.
- 1.58 (2000/09/01; author: kato)
  Fixed FPU_ERROR_BROKEN code.  It had old-isa code.
- 1.33 (1998/03/09; author: kato)
  Make FPU_ERROR_BROKEN a new-style option.
- 1.7 (1996/10/09; author: asami)
  Make sure FPU is recognized for non-Intel CPUs.

The log for rev.1.7 should have said something like:
Added FPU_ERROR_BROKEN option.  This forces a successful probe for
exception 16, so that hardware with a broken FPU error signal can sort
of work.
2001-10-21 05:18:30 +00:00
Matt Jacob
d7ae92aeb3 Update to latest 12160 f/w.
MFC after:	1 week
2001-10-20 21:47:58 +00:00
Andrew Gallatin
e47b20bee2 - splhigh()/splx() -> critical_enter()/critical_exit()
- fix KV macro in t2_pci.c to include the sable_lynx_base variable
so that the T2 CSRs can be found on lynxes.   Current should be
bootable on lynxes now.
2001-10-20 21:05:14 +00:00
Jake Burkholder
226d92f1b0 Add missing include. 2001-10-20 20:57:58 +00:00
Matt Jacob
574b6ca465 remove wx 2001-10-20 20:21:51 +00:00
Matt Jacob
0ba15d27f7 Oops. Remove wx. 2001-10-20 20:21:34 +00:00
Jake Burkholder
6bbac2dd30 Add missing includes. 2001-10-20 18:52:44 +00:00
Jake Burkholder
ac7165deae Remove interrupt queue array. Its in globaldata now. 2001-10-20 18:51:45 +00:00
Jake Burkholder
58a822cfc2 Fix get_cyclecount. Wrap in ifdef _KERNEL. 2001-10-20 18:51:10 +00:00
Matt Jacob
8c7c272c5a Remove wx. 2001-10-20 18:50:31 +00:00
Matt Jacob
f2465b0df3 Remove this driver from FreeBSD.
Jonathon Lemon's driver (gx) is at least as fast and has more features
and is likely to be better supported.

It is also possible that Intel might support this chipset in FreeBSD
with their own driver. Somewhat secretive and furtive rumblings from
certain Yahoo employees have indicated that this might happen soon.

I'm a little unhappy at the lack of discussion on the net list about
this, or on developers, or on hackers, or the lack of mention on
audit. This then leaves me to try and figure out the right thing
to do.

I've concluded that the right thing to do is to remove wx from FreeBSD,
as this is probably best for FreeBSD.
2001-10-20 18:48:45 +00:00
Jake Burkholder
d620294863 Use KTR_PMAP instead of KTR_CT1. 2001-10-20 17:11:07 +00:00
Jake Burkholder
49d8e44385 Catch up to changing entry point names so traces through traps
mostly work right.  This catches recursive traps too early, but
generally such traps are fatal and we won't get this far anyway.
2001-10-20 17:10:34 +00:00
Jake Burkholder
e47e7481db Add a definition for normal kernel window state. 2001-10-20 17:08:33 +00:00
Jake Burkholder
cc0bc9ad21 Catch up to new assembly language code. 2001-10-20 17:07:18 +00:00
Jake Burkholder
140bf733a7 Fix a bug in the kernel entry window handling where the wrong register
was used.  This resulted in bogus bad window traps (invalid wstate).

Add a trace to sfsr traps (alignment among other things).

Use KTR_TRAP instead of KTR_CT1.

Use the right registers when storing the values of various
mmu registers into the trap frame.  This fixes a bug where sometimes
the context number reported by a fault would be garbage.  Sometimes
it would be zero for faults on user address space so the kernel would
wrongly think that it was a fault on kernel address space and fail.

Use the preloaded registers in the vectored interrupt trap instead
of reading pointers from memory.  Remove traces due to register
pressure and excess verbosity.  We can probably still sneak in one
trace.  Remove some debug code.

Go back to using the tsb register during kernel page table lookups.
This is the best way to not have to have the address of the kernel tsb be
a compile time constant.  We lie and say we have 1 page tsb when really
its much larger.  This way the hardware provides bits 13-22 of the
virtual address (the lower 9 bits of the virtual page number) in the
form of the address of the tte corresponding to the fault address in
the (1 page) kernel tsb.  With some clever arithmetic we can then get
bits 22 and up from the tte tag and add them to the tte address in
order to index massive tsbs (basically unlimited).

Add traps for physical address hardware watchpoints.

Don't try to pass the window state from the trap table entry point
all the way down to the common trap code.  Its too easy to clobber
and reading it again doesn't cost much.

Fixup some traces.

Fiddle the cwp bits on return from the kernel to user mode so that
the window we are returning to is always the same as the one we
restore to in the trap code.  Strictly speaking this is not necessary,
it only affects return from fork and exec, but setting up the windows
right would require hard coding the right cwp values in cpu_fork and
setregs, basically hard coding the number of frames between syscall and
tl0_ret.  The result of getting it wrong is usually a spill to an invalid
stack pointer; either 0 or pointing into kernel space.  This should also
alleviate the need to context switch the cwp.

Transfer the trap state from locals to alternate globals in the trap
return code so that we can do a restore and rotate the windows before
reloading the trap registers.  If the restore fails we'll trap back
into the kernel, so there's no point in loading the trap registers
before hand.  Its is crucial that the window trap recovery code not
clobber the alternate globals.
2001-10-20 17:06:04 +00:00
Jake Burkholder
2baa1ef450 Align the symbol that demarks the end of the signal code on a 16 byte
boundary.  It must be on at least an 8 byte boundary so that the length
of the signal code is a multiple of 8 (well aligned).  The size is used
in the calculation of the address of the argument and environment vectors
on the user stack; getting it wrong results in the string pointers being
misaligned and causes alignment faults in getenv() among other things.

Allocate a regular stack frame below the signal frame on the user stack
and join up the frame pointer to the previous frame.  This fixes longjmp-ing
out of signal handlers.  Longjmp traverses the stack upwards in order to
find the right frame to return to, so the frame pointers must join up
seamlessly.  I thought this would just work, but obviously the frame
needs to be below the signal frame, not above it like before.  Account
for the extra space in the signal code.

Preload pointers to interrupt data structures in interrupt globals.
This avoids the need to load the pointers from memory in the vectored
interrupt trap handler.

Transfer the first 2 out registers into td_retval in setregs.  We use
the same registers for system call arguments as return values, so these
registers got clobbered by the system call return values on return from
execve.  They now get clobbered by the right values.  We must put the values
in both the out registers in the trapframe and in td_retval because init
calls exec but fails to transfer the return value into the out registers.
This fixes a bug where the first exec after init would pass junk to the
c runtime, instead of a pointer to the argument strings.  A better solution
would be to return EJUSTRETURN on success from execve.

Adjust for change in pmap_bootstraps prototype.

Map the message buffer after the trap table is setup.  We will fault
on it immediately.
2001-10-20 16:36:08 +00:00
Jake Burkholder
6ef2d9a02d Parameterize the size of the kernel virtual address space on KVA_PAGES.
Don't use a hard coded address constant for the virtual address of the
kernel tsb.  Allocate kernel virtual address space for the kernel tsb
at runtime.
Remove unused parameter to pmap_bootstrap.
Adapt pmap.c to use KVA_PAGES.
Map the message buffer too.
Add some traces.
Implement pmap_protect.
2001-10-20 16:17:04 +00:00
Jake Burkholder
d37e05e1c4 Remove hardcoded cwp value. 2001-10-20 16:10:13 +00:00
Jake Burkholder
4daaec8bec Use KTR_PROC instead of KTR_CT1 in traces. 2001-10-20 16:09:50 +00:00
Jake Burkholder
7e16bdb39b Return zero on success from su*. Apparently no one checks the return
values.
Add traces to fubyte, subyte, etc.  These are useful for catching errors.
due to alignment since its usually not checked for by the caller.
2001-10-20 16:09:20 +00:00
Ian Dowse
72ec63a53d Introduce some jitter to the timing of the samples that determine
the system load average. Previously, the load average measurement
was susceptible to synchronisation with processes that run at
regular intervals such as the system bufdaemon process.

Each interval is now chosen at random within the range of 4 to 6
seconds. This large variation is chosen so that over the shorter
5-minute load average timescale there is a good dispersion of
samples across the 5-second sample period (the time to perform 60
5-second samples now has a standard deviation of approx 4.5 seconds).
2001-10-20 16:07:17 +00:00
Jake Burkholder
209cf80d43 Add support for physical address hardware watchpoints. 2001-10-20 16:04:39 +00:00
Jake Burkholder
6c3dcb9735 Change the stray count in struct intr_vector to a vector number that can
be used to index tables of counters.
Remove intr_dispatch() inline, it is implemented directly in tl*_intr now.
Count stray interrupts in a table of counters like intrcnt.
Disable interrupts briefly when setting up the interrupt vector table.
We must disable interrupts completely, not just raise the pil.
Pass pointers to the intr_vector structures rather than a vector number
to sched_ithd and intr_stray.
2001-10-20 16:03:41 +00:00
Jake Burkholder
44217f38a5 Remove traces that are loud and not that useful. Remove nested include
of ktr.h.
2001-10-20 15:58:31 +00:00
Jake Burkholder
c93b7ccb41 Remove an unused macro arg. 2001-10-20 15:57:39 +00:00
Jake Burkholder
4fd2757c37 Include a whole interrupt queue in struct globaldata instead of just a
pointer.  Minor style.
2001-10-20 15:57:09 +00:00
Jake Burkholder
3d6e05660a Add fields for boothowto and the kernel environment to boothowto. 2001-10-20 15:55:42 +00:00
Doug Rabson
2baea57020 Reserve space for signal state. 2001-10-20 15:19:43 +00:00
Ian Dowse
0eb6ce3169 Move the code that computes the system load average from vm_meter.c
to kern_synch.c in preparation for adding some jitter to the
inter-sample time.

Note that the "vm.loadavg" sysctl still lives in vm_meter.c which
isn't the right place, but it is appropriate for the current (bad)
name of that sysctl.

Suggested by:	jhb (some time ago)
Reviewed by:	bde
2001-10-20 13:10:43 +00:00
Jonathan Lemon
d8b84d9e07 Only examine inet addresses of the interface. This was broken in r1.83,
with the result that the system would reply to an ARP request of 0.0.0.0
2001-10-20 05:14:06 +00:00
Marcel Moolenaar
3824d75af1 Save the AP wake-up vector from the SAL descriptor under SMP.
Note that the descriptor is optional. Add a comment to indicate
that we want to register the OS_BOOT_RENDEZ here as well.
2001-10-20 03:39:55 +00:00
Marcel Moolenaar
5b8c64dd2c Make this compile under option SMP. 2001-10-20 03:33:07 +00:00
John Baldwin
76e296aa31 - Make the sio_inited handling more properly MP safe.
- If we are booting with a serial console, then pass the MTX_QUIET flag to
  mtx_init of the sio lock as otherwise KTR_VERBOSE simply doesn't work.
2001-10-20 03:32:33 +00:00
John Baldwin
dee2bb2540 Assert that a ucred is unshared before we remap its ids. 2001-10-20 03:30:34 +00:00
John Baldwin
c516499ad4 Make the flag field in the ps output one char wider to account for recent
growth in the number of flags used.  Also, if a thread is blocked on a
mutex, print the mutex name in the wait channel column.
2001-10-20 03:22:23 +00:00
Andrew Gallatin
dd79258102 apparently EV5 2x00s have their t2 CSRs where I'd expect to find
them on a  2100A

Thanks to Tyler Willingham <ze_willow@yahoo.com> for letting me
test this on his AS2000
2001-10-20 01:27:23 +00:00
John Baldwin
7ada587697 The mtx_init() and sx_init() functions bzero'd locks before handing them
off to witness_init() making the check for double intializating a lock by
testing the LO_INITIALIZED flag moot.  Workaround this by checking the
LO_INITIALIZED flag ourself before we bzero the lock structure.
2001-10-20 01:22:42 +00:00
David E. O'Brien
c932615213 Drop support for x87 emulation. Any CPU one would dare to run 5-CURRENT
on would have built-in FP support.
2001-10-20 01:15:54 +00:00
Dag-Erling Smørgrav
82835638e1 Tweak the way we determine if an interface needs to have its name translated.
Add some missing break statements in the socket ioctl switch.
Check the return value from copyin() / copyout().
Fix some disorderings and misindentations.
Support a couple more socket ioctls.
Add missing break statements.
2001-10-20 00:01:26 +00:00
Peter Wemm
259ed91740 Add a sysctl for preventing the sync() in panic() recovery. This can
be so dangerous it isn't funny.  eg: if you panic inside NFS or softdep,
and then try and sync you run into held locks and cause either deadlocks,
recursive panics or other interesting chaos.  Default is unchanged.
2001-10-19 23:32:03 +00:00
Mark Peek
94e0b85e76 Fix includes based on recent changes to lock.h, mutex.h and ktr.h. 2001-10-19 22:45:46 +00:00
Doug Rabson
ccd97ec1f2 Add unaligned.c and delete commented out entry for userconfig.c 2001-10-19 22:25:00 +00:00
Doug Rabson
76f7435e6e Make a start at an unaligned trap handler. Only integer loads and stores
are handled so far.
2001-10-19 22:23:51 +00:00
Mark Peek
43aba0eadb Make override of nm consistent across all platforms and sort the overrides.
Reminded by:	obrien
2001-10-19 22:19:06 +00:00
Doug Rabson
c33287f969 Translate various userland traps into SIGBUS (instead of just panicing). 2001-10-19 20:46:12 +00:00
Ruslan Ermilov
c3917acb86 Fix the typedef of va_list. 2001-10-19 20:07:46 +00:00
Ruslan Ermilov
8c93e71e33 Try two on the preprocessing logic.
Reviewed by:	obrien
2001-10-19 20:06:23 +00:00
David E. O'Brien
9f9bd82e15 Try two on the preprocessing logic.
Reviewed by:	ru
2001-10-19 20:01:01 +00:00
John Baldwin
fb63feef6f - Move the definition of LOCK_DEBUG back to sys/lock.h from sys/_lock.h.
- Change LOCK_DEBUG so that it is always on if KTR is compiled in
  regardless of the state of KTR_COMPILE.  This means that we no longer
  need to include sys/ktr.h before sys/lock.h to ensure a valid setting
  for LOCK_DEBUG.
- Change the use of LOCK_DEBUG so that it is now always defined and its
  value is used instead of merely its definition.  That is, instead of
  #ifdef LOCK_DEBUG, code should now use #if LOCK_DEBUG > 0.
- Use this latest to #error out in sys/mutex.h if sys/lock.h isn't
  included before sys/mutex.h to ensure that the proper versions of the
  mutex operations are used.
- As a result of (2) sys/mutex.h no longer includes sys/ktr.h in the
  KERNEL case.

Requested by:	bde (1)
2001-10-19 19:28:18 +00:00
John Baldwin
e37d2a8c82 Remove unneeded sys/mutex.h includes. 2001-10-19 19:23:32 +00:00
John Baldwin
d6e19ad10e Move sys/mutex.h include after sys/lock.h to ensure we use the proper
versions of the mutex operations.
2001-10-19 19:22:04 +00:00
David E. O'Brien
4b16cf4f8a Blah, fix braino where ru had to remind me of proper preprocessor syntax.
Bad fingers, no cookie.
2001-10-19 19:17:11 +00:00
Matt Jacob
e58c2b8381 Fix this so it compiles cleanly for alpha. Tried to do some minimal testing.
Reviewed by:	freebsd-net
2001-10-19 18:29:57 +00:00
Dag-Erling Smørgrav
32c798f806 Argh! I updated the version number in the MODULE_DEPEND() thingamagook but
not in the actual MODULE_VERSION().  Pass me the pointy hat.
2001-10-19 18:23:51 +00:00
Mark Peek
6b2d0a7791 Cleanup of the stdarg code.
Submitted by:	ru
2001-10-19 16:15:46 +00:00
Jonathan Lemon
bb373620cb Fix the le driver - it has been broken for a while and these fixes have
been sitting neglected in my tree.
2001-10-19 15:47:41 +00:00
Søren Schmidt
7ebc82d6ec Make an ATAPI CD device appear as /dev/acdN and the individual
tracks as /dev/acdNtY.

This solves the problems with having to deal with howmany and which
devices are open.

For hysterical reasons ONLY, make a link to both the acdNa & acdNc devices.
2001-10-19 13:34:48 +00:00
Yoshihiro Takahashi
00da2ef3cc MFi386: sys/i386/isa/npx.c revisions from 1.114 to 1.116 2001-10-19 12:30:16 +00:00
Ruslan Ermilov
d350f39772 Fixed style bugs from revisions 8.1 (CSRG), 1.14, 1.19 and 1.22. 2001-10-19 12:24:54 +00:00
Yoshihiro Takahashi
f89c65e5ab Changed IO_NPXSIZE to 8 2001-10-19 12:24:45 +00:00
Yoshihiro Takahashi
0886808eda MFi386: sys/i386/isa/clock.c revision 1.177 2001-10-19 11:52:49 +00:00
Yoshihiro Takahashi
0db7b6f691 MFi386: sys/i386/isa/pcaudio.c revision 1.63 2001-10-19 11:50:00 +00:00
Yoshihiro Takahashi
2e8727d53d Merged from sys/isa/sio.c revisions from 1.344 to 1.347 2001-10-19 11:48:47 +00:00
Yoshihiro Takahashi
dee072b6ba MFi386: sys/i386/conf/GENERIC revision 1.320 2001-10-19 11:46:13 +00:00
Yoshihiro Takahashi
17dcdab4d3 MFi386: options.i386 revision 1.158 2001-10-19 11:45:05 +00:00
Doug Rabson
5577bd2bca Rework pmap so that it separates the PTE structure from the pv_entry
structure. This makes it possible to pre-allocate PTEs for the kernel,
which is necessary for a reliable implementation of pmap_kenter(). This
also avoids wasting space (about 48 bytes per page) for kernel mappings
and user mappings of memory-mapped devices.

This also fixes a bug with the previous version where the implementation
required the pv_entry structure to be physically contiguous but did not
enforce this (the structure size was not a power of two). This meant
that the pv_entry free list was quickly corrupted as soon as the system
was even mildly loaded.
2001-10-19 09:47:02 +00:00
Marcel Moolenaar
0a622d8291 Build the linux module on Alpha again. Note that the linux module
is not added to the MI list of modules. The current state of
affairs is such that the linux module is the exception, not the
common case.
2001-10-19 08:33:56 +00:00
Marcel Moolenaar
5983000903 After removing the bogus differences, any real incompatibilities
have been merged into /sys/compat/linux/linux_ioctl.h. This file
is now unused.
2001-10-19 08:20:15 +00:00
Marcel Moolenaar
3c7b85d4f0 Fix Alpha related brokenness. We used to have a MD linux_ioctl.h
that appeared to be very different from the MI version. These
differences were mostly bogus and caused by copying octal
definitions and write them as hexadecimal values without doing
any base conversion (ie 010 was copied to 0x10). After filtering
out these differences, any remaining (real) incompatibilities
have been merged into the MI header file to make them more visible.

While here, fix the termios <-> termio conversion WRT to the c_cc
field for Alpha. The termios values do not match the termio values
and thus prevents us from copying.

By eliminating the Alpha MD copy of linux_ioctl.h we also fixed
the recent build breakage caused by putting new bits in the MI
header and not in the MD header.
2001-10-19 08:18:31 +00:00
Matt Jacob
f1ef0a68b0 Linux compiles broken on alpha again. Remove. 2001-10-19 05:04:02 +00:00
Jonathan Lemon
e903bd58a6 Add entry for the PRO/1000. 2001-10-19 02:28:12 +00:00
Jonathan Lemon
f8a984ed0d Hook the gx module up to the build. 2001-10-19 02:21:16 +00:00
Jonathan Lemon
109362e442 Add a driver for the Intel PRO/1000 Gigabit Ethernet boards. 2001-10-19 02:17:32 +00:00
Dag-Erling Smørgrav
a55f7148f1 #if 0 out some code that depends on other uncommitted patches. 2001-10-19 01:52:13 +00:00
Dag-Erling Smørgrav
1c0bfd6e3a Adapt to pseudofs changes (dynamic initialization, not static).
Use the new linux_ifname() function from the linuxulator rather than roll
our own interface name translation.
2001-10-19 01:45:03 +00:00
Dag-Erling Smørgrav
33802b9eff Switch to dynamic rather than static initialization.
This makes it possible (in theory) for nodes to be added and / or removed
from pseudofs filesystems at runtime.
2001-10-19 01:43:06 +00:00
Dag-Erling Smørgrav
b51cc76c45 Add support for the "device private" ioctls soon to be used by the an driver.
Also slightly change the name translation policy - only rename interfaces
that have the IFF_BROADCAST flag set.  This is not perfect, but is closer to
how Linux names network interfaces.
2001-10-19 01:38:10 +00:00
Dag-Erling Smørgrav
f45ccc6898 Add two "device private" ioctls needed by the Aironet (an) driver.
Move some ioctls that were out of order.
2001-10-19 01:20:21 +00:00
Dag-Erling Smørgrav
55a9c3ad8f Whitespace fix. 2001-10-19 00:46:17 +00:00
Mark Peek
acd26a4b7a Use normal CWARNFLAGS and defines when compiling on FreeBSD. 2001-10-19 00:32:00 +00:00
Warner Losh
0e3d06b12c Add verbage for MODULES_OVERRIDE. 2001-10-18 19:44:13 +00:00
Mark Peek
ad91c1e7bd Add support for the gcc-2.95 stdarg implementation. 2001-10-18 19:11:12 +00:00
Matt Jacob
8b8e73049d Protect against deranged fabric nameservers that spit out 10000 identical
port numbers.

MFC after:	1 day
2001-10-18 17:26:52 +00:00
Doug Rabson
ef826b3ca8 Shift the code which packs and unpacks instruction bundles out of DDB
since it is useful for various emulations duties (e.g. unaligned trap
handling).
2001-10-18 16:20:04 +00:00
David E. O'Brien
e3ddd70789 My attempts at minimizing the number of #def's got me in trouble. 2001-10-18 16:07:21 +00:00
Hellmuth Michaelis
8f3a90354e Add experimental support for sending keypad facility messages.
MFC after: 2 months
2001-10-18 11:58:49 +00:00
Marcel Moolenaar
acddfcf3a2 Fix typos in previous commit:
o  s/sys_narg/sy_narg/
o  s/SYS_MPSAFE/SYF_MPSAFE/
2001-10-18 05:21:52 +00:00
David E. O'Brien
4a3391b5a1 Add support for "__gnuc_va_list". Some overly "smart" libraries assume
the existence of the __gnuc_va_list type[*] because our compiler is GCC.

[*] __gnuc_va_list is defined in the GCC ginclude/stdarg.h replacement
headerwhich we don't use.
2001-10-18 00:27:39 +00:00
David E. O'Brien
a3fc3de448 Sync comments with i386. 2001-10-18 00:00:31 +00:00
David E. O'Brien
1f3efe7fe4 Minor comment tweaking. 2001-10-17 23:59:29 +00:00
John Baldwin
05724cdd08 - Small cleanups to the Giant handling in trap().
- Only release Giant in trap() if we locked it, otherwise we could release
  Giant in a kernel trap if we didn't get it for a page fault and the
  previous frame had grabbed the lock.
- Only get Giant for !MP safe syscalls.
2001-10-17 22:04:45 +00:00
John Baldwin
c006932186 Small cleanups to the handling of Giant in trap(). 2001-10-17 21:55:56 +00:00
Jonathan Lemon
de5934508a Add a SIOCGIFINDEX ioctl, which returns the index of a named interface.
This will be used to more efficiently support if_nametoindex(3).
2001-10-17 19:40:44 +00:00
Jonathan Lemon
10930aad3f Cleanup ifunit(), so it uses the dev_named() function to map an interface
name into a device.
2001-10-17 18:58:14 +00:00
Jonathan Lemon
7e7c3f3f33 Add dev_named(dev, name), which is similar in spirit to devtoname().
This function returns success if the device is known by either 'name'
or any of its aliases.
2001-10-17 18:47:12 +00:00
Ruslan Ermilov
8071913df2 Pull post-4.4BSD change to sys/net/route.c from BSD/OS 4.2.
Have sys/net/route.c:rtrequest1(), which takes ``rt_addrinfo *''
as the argument.  Pass rt_addrinfo all the way down to rtrequest1
and ifa->ifa_rtrequest.  3rd argument of ifa->ifa_rtrequest is now
``rt_addrinfo *'' instead of ``sockaddr *'' (almost noone is
using it anyways).

Benefit: the following command now works.  Previously we needed
two route(8) invocations, "add" then "change".
# route add -inet6 default ::1 -ifp gif0

Remove unsafe typecast in rtrequest(), from ``rtentry *'' to
``sockaddr *''.  It was introduced by 4.3BSD-Reno and never
corrected.

Obtained from:	BSD/OS, NetBSD
MFC after:	1 month
PR:		kern/28360
2001-10-17 18:07:05 +00:00
Brian Somers
9082264160 Change kern.bootfile when mv'ing the kernel
Not tested by: brian
2001-10-17 18:04:13 +00:00
Ruslan Ermilov
65ad7c437d Pull fix for memory leak in in6_losing() from netinet/in_pcb.c,v 1.85.
MFC after:	1 week
2001-10-17 17:42:23 +00:00
Matthew Dillon
b386828956 contigmalloc1() could cause the vm_page_zero_count to become incorrect.
Properly track the count.

Submitted by:	mark tinguely <tinguely@web.cs.ndsu.nodak.edu>
2001-10-17 17:34:34 +00:00
Yoshihiro Takahashi
aa0abed214 Use a array to convert from a attribute for AT to one for PC98.
(merged from sys/pc98/pc98/scvtbpc98.c)
2001-10-17 15:15:01 +00:00
Yoshihiro Takahashi
f49ccfe990 Merged from sys/boot/i386/libi386/vidconsole.c revisions 1.16, 1.17 and 1.18. 2001-10-17 14:41:50 +00:00
Yoshihiro Takahashi
2967d8485e fix style(9) 2001-10-17 14:17:11 +00:00
Yoshihiro Takahashi
60e0796757 Merged from sys/boot/i386/loader/Makefile revision 1.54. 2001-10-17 14:13:36 +00:00
Brian Somers
82a6d03aa6 Change kern.bootfile when mv'ing the kernel 2001-10-17 13:57:32 +00:00
Hajimu UMEMOTO
ce5b9b31ca Fixed to process a IPv6 packet when ah transport after esp tunnel
should be applied.  the SA of AH transport could not be selected
from the SAD because of this bug.

Obtained from:	KAME
MFC after:	1 week
2001-10-17 13:03:37 +00:00
Hajimu UMEMOTO
56a87de33f The behavior of SPDUPDATE has been changed.
SPDUPDATE doesn't depend on whether there is a SP or not.
This change makes `generate_policy on' of racoon work.

Obtained from:	KAME
MFC after:	1 week
2001-10-17 13:01:39 +00:00
Ruslan Ermilov
28070a0efe Bring in latest CSRG revisions to this file:
- Report destination address of a P2P link when servicing
  routing socket messages.

- Report interface name, address, and destination address
  of a P2P link when servicing NET_RT_{DUMP,FLAGS} sysctls.

Part of CSRG revision 8.6 coresponds to revision 1.12.
CSRG revision 8.7 corresponds to revision 1.15.
2001-10-17 11:23:59 +00:00
Ruslan Ermilov
4862bf8c0d 64-bit fixes from CSRG. 2001-10-17 11:10:55 +00:00
Ruslan Ermilov
fe6db7c77e Revision 1.32 corresponded to CSRG revision 8.2. 2001-10-17 10:44:39 +00:00
Ruslan Ermilov
66afbd6890 Revision 1.13 corresponded to CSRG revision 8.4.
Revision 1.59 corresponded to CSRG revision 8.5.
2001-10-17 10:41:00 +00:00
Ruslan Ermilov
4f252c4dd5 Record the fact that revision 1.39 corresponded to CSRG revision 8.4,
and first hunk of revision 1.76 corresponded to CSRG revision 8.3.
2001-10-17 10:18:42 +00:00
Warner Losh
e5ee3605a9 Print 4 per line. To do this, we test against i % 16 == 0 rather than i % 4
since that's always true for this loop.
2001-10-17 05:33:51 +00:00
Warner Losh
b79e6caffe ToPIC fixes. scale back what we do for functional interrupts because
it appears to break at least the ToPIC 100.

Submitted by: Mark Santcroos <marks@ripe.net>
2001-10-17 05:20:56 +00:00
Dag-Erling Smørgrav
b37831146b Back out previous revision. TCBHASHSIZE isn't an option, despite what I'd
been misled to believe by unknown parties.  It probably *should* be an option,
but the runtime value is controlled by a tunable, which Ought To Be Enough.
2001-10-17 04:30:04 +00:00
Bill Fenner
05153c617d if_index is the highest interface index in the system, not the next
available index.
2001-10-17 04:23:14 +00:00
Bill Fenner
b9d45cebf4 The interface index space may be sparsely populated (e.g. when an
interface in the middle is if_detach()'d).  Return (and handle)
 ENOENT when the ifmib(4) is accessed for a nonexistent interface.

MFC after: 14 days
2001-10-17 04:12:29 +00:00
Matthew Dillon
2210e5d9fa fix minor bug in kern.minvnodes sysctl. Use OID_AUTO. 2001-10-16 23:08:09 +00:00
Matt Jacob
aaeac4f6c3 Make SCSI changer and SES devices standard in generic kernels.
Reviewed by:	ken@kdm.org
2001-10-16 22:22:58 +00:00
Dag-Erling Smørgrav
446975de60 Document TCBHASHSIZE. 2001-10-16 21:53:27 +00:00
Bruce Evans
265e95d904 Deleted most of npxprobe(), and merged npxprobe1() back into npxprobe().
Use the normal interrupt handler (npx_intr()) instead of a special
probe-time interrupt handler, although this causes problems due to
the bus_teardown_intr() not actually even tearing down the interrupt
(these problems were avoided by doing interrupt attachment for the
special interrupt handler directly).  Fixed minor bitrot in comments.

The reason for the npxprobe()/npxprobe1() split mostly went away at
about the same time it was made (in 1992 or 1993 just before the
beginning of history).  386BSD ran all probes with interrupts completely
masked, and I didn't want to disturb this when I added an irq probe
to npxprobe().  An irq (not necessarily npx) must be acked for at least
external npx's to take the cpu out of the wait state that it enters
when an npx error occurs, so the probe must be done with a suitable
irq unmasked.  npxprobe() went to great lengths to unmask precisely
the npx irq.

Running probes with all interrupts masked was never really needed in
FreeBSD, since FreeBSD always masked interrupts well enough using
splhigh(), but it wasn't until rev.1.48 (1995/12/12) of autoconf.c
that all probes were run with CPU interrupts enabled.  This permits
npxprobe() to probe its irq using normal interrupt resources.  Note
that most drivers still can't depend on this.  It depends on the
interrupt handler being fast and the irq not being shared.
2001-10-16 14:12:35 +00:00
Bruce Evans
2504f76272 Commit my old fixes for cosmetic bugs in npxprobe() so that they aren't
lost when the buggy code goes away completely:
- don't assume that the npx irq number is >= 8.  Rev.1.73 only reversed
  part of the hard-coding of it to 13 in rev.1.66.
- backed out the part of rev.1.84 that added a highly confused comment
  about an enable_intr() being "highly bogus".  The whole reason for
  existence of npxprobe() (separate from the main probe, npxprobe1())
  is to handle the complications to make this enable_intr() safe.
- backed out the part of rev.1.94 that modified npxprobe().  It mainly
  broke the enable_intr() to restore_intr().  Restoring the interrupt
  state in a nested way is precisely what is not wanted here.  It was
  harmless in practice because npxprobe() is called with interrupts
  enabled, so restoring the interrupt state enables interrupts.  Most
  of npxprobe() is a no-op for the same reason...
2001-10-16 12:55:38 +00:00
Søren Schmidt
db92bfc1b4 Fix bug introduced by the last commit, the caused some ATAPI
devices to fail to proberly initialize at boot..
2001-10-16 08:07:36 +00:00
Doug Rabson
ebc26de418 Size the number of pv_entries we use to bootstrap the pv_entry allocator
based on the size of physical memory. This should eliminate the tweaking
needed for larger memory configurations.
2001-10-16 08:03:16 +00:00
Marcel Moolenaar
4c1e3817c4 Implement linux_chown and linux_lchown. The fchown syscall maps
directly to the native syscall, because no filename handling
needs to be done.

Tested by: Martin Blapp <mb@imp.ch>
2001-10-16 06:15:36 +00:00
Marcel Moolenaar
2bf1eed95b o Change prototype of linux_lchown and linux_chown so that the
argument names match those on Alpha.
o  Map the fchown directly to FreeBSD. Since the old version of
   fchown is also mapped to the native fchown, give the new one
   type NODEF.

Tested by: Martin Blapp <mb@imp.ch>
2001-10-16 06:11:11 +00:00
Tor Egge
d6844b6bf6 Don't use an uninitialized field reserved for callers in the bio structure
passed to swap_pager_strategy().  Instead, use a field reserved for drivers
and initialize it before usage.

Reviewed by:	dillon
2001-10-15 23:02:54 +00:00
Dag-Erling Smørgrav
8cdcad811c Try to make Linux socket ioctls work. Up until now they've only *pretended*
to work, but haven't really due to subtle differences in structs etc.

This is still not perfect (some ioctls are still known not to work, while
others haven't been tested at all), but it's enough to get Debian's ifconfig
to produce relatively sane output.

More work will be needed to get all ioctls (or at least a reasonable subset)
working, and to support the Cisco Aironet config tool mentioned in the PR.

PR:		26546
Submitted by:	Doug Ambrisko <ambrisko@ambrisko.com>
2001-10-15 20:52:17 +00:00
Tor Egge
4c8f0aced5 Explicitly initialize the fpu when SSE is enabled since this no
longer happens as a side effect of calling npxsave.

Reviewed by:	peter, bde
2001-10-15 20:18:06 +00:00
Dag-Erling Smørgrav
268aeb1ed3 In FreeBSD's ifreq, ifr_ifru.ifru_flags is an array of two chars, while Linux
defines it as a short.  Change that to an array of one short so that FreeBSD's
ifr_flags macro will work (it evaluates to ifr_ifru.ifru_flags[0]).
2001-10-15 20:06:34 +00:00
Bill Fenner
211f625a91 Set the interface speed back to zero, after ether_ifattach() set it
to 10Mbps.  RFC 2863 says: "For a sub-layer which has no concept
of bandwidth, [ifSpeed] should be zero."
2001-10-15 19:21:01 +00:00
Robert Drehmel
aa5bde88b1 Add a prototype for OF_alloc_phys. 2001-10-15 14:43:38 +00:00
Robert Drehmel
8414482077 Fix some warnings. 2001-10-15 14:40:36 +00:00
Robert Drehmel
2727d8ffc8 Add the FreeBSD/sparc64 boot loader source files. 2001-10-15 14:35:39 +00:00
Darren Reed
3a4d67f769 catch forwarded ipv6 packets with pfil_hooks for outbound things too 2001-10-15 14:16:18 +00:00
Benno Rice
569b264f40 Add a hack to get around the fact that egcs 1.1.2 (which I'm using to build
my powerpc kernels on NetBSD/macppc 1.5) doesn't know of the __func__ macro.
2001-10-15 13:30:04 +00:00
Benno Rice
f3ca814471 Flesh out cpu_fork() and cpu_set_fork_handler(). This is a work in progress. 2001-10-15 12:24:43 +00:00
Benno Rice
d163144b45 - Correct the type of the argument to delay() so as to not conflict with
sys/boot/common/bootstrap.h.
- Add a prototype for fork_trampoline().
2001-10-15 12:23:10 +00:00
Robert Drehmel
7081e52987 Make the ofw_reg structure and ofw_alloc_heap 64-bit save. 2001-10-15 12:16:20 +00:00
Robert Drehmel
fc06896610 Add a Makefile for the sparc64 boot loader. 2001-10-15 10:36:35 +00:00
Robert Drehmel
d729d0aa31 Do not include openfirm.h; it is now included by libofw.h. 2001-10-15 09:52:38 +00:00
Robert Drehmel
66631c00de - Use the cell_t type definition for Open Firmware arguments in
combination with requisite casts as this avoids fatal side
   effects on 64-bit architectures.
 - Add the OF_alloc_phys function.
2001-10-15 09:51:09 +00:00
Ruslan Ermilov
6695313820 Don't even attempt to clone host routes.
MFC after:	1 week
2001-10-15 09:46:48 +00:00
Robert Drehmel
1da9b140b7 - Fill dummy functions with code to read from disk using Open
Firmware.
 - Add a temporary disklabel header to boot off a NetBSD/sparc64
   partition.  This file can be deleted when we have got a FCode
   bootblock.

The disklabel header was obtained from NetBSD.
2001-10-15 09:35:40 +00:00
Robert Drehmel
7ff1bab73b - Include openfirm.h for phandle_t.
- Add some necessary members to the ofwdisk structure.
 - Add a prototype for ofw_parseofwdev.
2001-10-15 09:28:07 +00:00
Robert Drehmel
cdfc68815b Add a function for parsing an Open Firmware boot path into the
ofw_devdesc structure.
2001-10-15 09:25:30 +00:00