Commit graph

26985 commits

Author SHA1 Message Date
Scott Long 1a393b6188 Adding missing () in a KASSERT format string.
Submitted by:	brandt@fokus.gmd.de
2001-08-07 16:48:28 +00:00
Ruslan Ermilov c4d9468ea0 mdoc(7) police:
Avoid using parenthesis enclosure macros (.Pq and .Po/.Pc) with plain text.
Not only this slows down the mdoc(7) processing significantly, but it also
has an undesired (in this case) effect of disabling hyphenation within the
entire enclosed block.
2001-08-07 15:48:51 +00:00
Yoshihiro Takahashi e993b51722 Merged from sys/dev/syscons/syscons.c revisions 1.370, 1.371 and 1.372. 2001-08-07 12:23:47 +00:00
Yoshihiro Takahashi 094d43411f Merged from sys/dev/syscons/scterm-sc.c revision 1.16. 2001-08-07 12:10:17 +00:00
Kazutaka YOKOTA d959336c3b Don't call wakeup() while we are in DDB. The patch was
developed by bde. I added the same check in one more place
where wakeup() might be called during the DDB session.
Submitted by: bde
2001-08-07 11:51:26 +00:00
Brooks Davis 88f7a9cf86 Add PCI ID for Cisco Aironet 350 Series cards. The patch differs
slightly from the submitted one.

PR:		kern/29415
Submitted by:	Bob Fleck <rfleck@cigital.com>
2001-08-06 23:14:16 +00:00
Scott Long d047ecf50b Make AAC_COMPAT_LINUX optional once again.
Submitted by:	julian
2001-08-06 19:40:47 +00:00
Hajimu UMEMOTO 232bdaf61f printed current sequence number of the SA. accordingly, changed
into sadb_x_sa2_sequence from sadb_x_sa2_reserved3 in the sadb_x_sa2
structure.  Also the output of setkey is changed.  sequence number
of the sadb is replaced to the end of the output.

Obtained from:	KAME
2001-08-06 19:40:01 +00:00
Hajimu UMEMOTO e51e1807bd do not play too much trick with evaluation order. from netbsd
Obtained from:	KAME
2001-08-06 19:34:41 +00:00
Hajimu UMEMOTO 910e7df8bb fixed to make a response in key_spdadd(). reported by <R.P.Koster@kpn.com>
Obtained from:	KAME
2001-08-06 19:32:47 +00:00
Hajimu UMEMOTO b8f2e55112 merged key_cmpsaidx_*.
Obtained from:	KAME
2001-08-06 19:31:13 +00:00
Nate Williams d4b85e6acf -Finished cleanup of old 'ThinkPad' comments that are no longer useful.
Reminded by:	bde
2001-08-06 16:04:39 +00:00
John Baldwin bcbde237d3 Get the order of the sys/_lock.h and sys/_mutex.h headers right. 2001-08-06 14:25:35 +00:00
Brian Feldman bcc92693d4 Previously, the ELF linker would always just store the pointer to a
filename passed in via the module loader functions in the GDB
"sharedlibrary" support structures.  This isn't good, since the pointer
would become stale in almost every case (not the pre-loaded case, of
course).

Change this to malloc()ed copy of the string and finally fix the reason
that gdb -k's "sharedlibrary" command stopped working.

Obtained from:	LOMAC/FreeBSD (cf. NAI Labs)
2001-08-06 14:21:57 +00:00
Doug Rabson 2f6fec30cf Make this compile again. 2001-08-06 12:52:55 +00:00
Doug Rabson da572e14d4 Remove usage of nonexistent vm_mtx. 2001-08-06 12:52:17 +00:00
Chris Costello c30d4da338 Remove the fildesc_clone() function and its associated unnecessary code.
It didn't implement the proper /dev/fd functionality (which would be to
include in the directory listing /dev/fd/n if the process has fd n open)
anyway.

Anything needing access to /dev/fd/n where n > 2 can use the optional
fdescfs module, which implements this properly and does not cause any
trouble with devfs.

Discussed with:	phk
2001-08-06 05:56:33 +00:00
Scott Long fb0c27d7e2 Put the linux compat ioctl interface on death row. Add FreeBSD
definitions of all of the ioctls, plus round out all ioctl definitions to
match what exists for linux.  Allow ioctls to be called through either the
native or linux interface, though no apps exist (yet) that can take
advantage of native calling.
2001-08-06 04:34:47 +00:00
Scott Long 74e818733c Missed this one in my 80-column sweep. 2001-08-06 03:52:40 +00:00
Jake Burkholder b3a1f1765a Handle dmmu protection faults as well as misses. Enable tracking of
the modify and reference tte bits.  Implementing allocating of tsb pages.
Make tsb_stte_lookup do the right thing with the kernel pmap.
2001-08-06 02:34:20 +00:00
Jake Burkholder e15d0e4cf9 Add page fault and high level tsb miss handlers. 2001-08-06 02:32:38 +00:00
Jake Burkholder a5f2d2a0eb Handle switching switching mmu contexts and mapping the new primary tsb.
Rework some register usage and code placement.  Comment.
2001-08-06 02:31:30 +00:00
Jake Burkholder 04a8a9ba95 Save the primary mmu context around calls to the prom, and install
nucleus context.  The prom runs at trap level 0, so there's no
implicit nucleus context and we have to force it.
2001-08-06 02:29:13 +00:00
Jake Burkholder cfe8998cd6 Remove some debug code. 2001-08-06 02:27:59 +00:00
Jake Burkholder 9592342320 Handle managed and unmanaged mapping better. Allocate an vm object for
the tsb pages.
2001-08-06 02:27:34 +00:00
Jake Burkholder 2a9921d8bd Add trap handlers for dmmu faults from user mode, and for faults from
accessing user address space in kernel mode.
2001-08-06 02:26:04 +00:00
Jake Burkholder 2de67fb944 The kernel runs at a much lower address now. 2001-08-06 02:24:52 +00:00
Jake Burkholder 2e74c0876f Fix macros for dealing with tte contexts.
Add tte bits for initializing tsbs and for specifying managed mappings.
2001-08-06 02:24:18 +00:00
Jake Burkholder d15f935586 Oops. Last commit to tsb.h should have gone here.
Fix macros for eadling with tte contexts and add macros for sfsr fields.
2001-08-06 02:21:53 +00:00
Jake Burkholder 3af9da91bc Fix macros for setting and extracting the context field in ttes and
add macros for the fields in sfsr.
2001-08-06 02:20:36 +00:00
Jake Burkholder 8d94222282 Add a vm_object and page count to struct pmap for allocating tsb pages. 2001-08-06 02:19:52 +00:00
Jake Burkholder a03f751e5a Add code model medlow to cflags and move the kernel load address from
just before the memory hole to 4 megs.  Special case building exception.s
like locore.s, it needs to at the beginning so the branches out from the
trap table don't overflow.
2001-08-06 02:18:39 +00:00
Mike Smith b2c98acc5e The Intel 440MX ACPI timer seems to work properly, so add it to the list
here.  Restructure slightly so that adding more devices is easier.

Submitted by:	Jose Gabriel J Marcelino <gabriel@maquina.com>
2001-08-05 23:20:32 +00:00
Justin T. Gibbs 9f152ec7d2 aic7xxx.c:
Correct an off by one in our critical section handling.
		SEQADDR always reads the next instruction to execute,
		so we must subtract one from its value before making
		comparisons with entries in the critical section table.

		Print a few additional registers whenever we dump
		card state.

		Show the SCB_CONTROL and SCB_TAG values for all pending
		SCBs in card SCB ram when dumping card state.

	aic7xxx.seq:
		Fix a bug introduced while optimizing the SDPTR path.
		We would ack the SDPTR message twice on Ultra2 or better
		chips if it occurred after all data had been transferred
		for a transaction.

		Change our workaround for the PCI2.1 retry bug on some
		chips.  Although the previous workaround was logically
		correct, its faster method of draining the FIFO seemed
		to occassionally confuse the FIFO state.  We now drain
		the FIFO at half the speed which avoids the problem.

	aic7xxx_pci.c:
		Chips with the PCI 2.1 retry bug can't handle a 16byte
		cachesize.  If the cachesize is set to 16bytes, drop
		it to 0.
2001-08-05 22:20:12 +00:00
Nate Williams 3633ea98d7 - Removed comment about ThinkPad keyboards from the PCVT line. Any ThinkPad
that needs this probably won't run -current, as it's at least 5 years old.
2001-08-05 21:56:11 +00:00
Scott Long 3d04a9d7e3 Once again throw out the calculation of si_iosize_max and set it to 64K.
Although it can go higher, it is not safe to so do on arrays with many
members.  Compromise by adding a tunable, "hw.aac.iosize_max" that can be
set at boottime.  Also document in the aac(4) manpage.

MFC after:	4 weeks
2001-08-05 07:26:31 +00:00
Warner Losh 0d3576d9bc Now that we are setting a bit in the PCIC_INT_GEN (0x3) register, we
can't blindly write zero into it to disable the card.  We must
preserve this bit.  This changes pcic_disable to only clear the bits
we know we need to clear on card disable, thus preserving the magic
bit for many TI bridges.

This appears to have fixed the problems that people are reporting
about the system failing to recognize cards being inserted or removed
(or both).  Greg: This may fix your problem too :-).
2001-08-05 07:02:42 +00:00
Warner Losh 79c1672770 Order PCIC_INT_GEN bits large to small, like all other registers. 2001-08-05 06:59:32 +00:00
Scott Long f6c4dd3f48 Bugfixes. Close a race and logic bug in the timeout handling, don't call the
interrupt handler from the upper half, etc.  This fixes some serious stability
problems that we were seeing on our production server.  These patches have
been tested for almost 6 months and are a highly recommended MFC candidate.

Reviewed by:	gibbs, merry, msmith
MFC after:	4 days
2001-08-05 06:20:13 +00:00
Scott Long fadfef893f Fix a couple of copyright issues and an 80 column nit that I missed before 2001-08-05 06:15:00 +00:00
Thomas Moestl 59fa485c3e Add a missing semicolon to unbreak the kernel build with INVARIANTS
(which was unfortunately turned off in the confguration I used for the
last test build).

Spotted by:	jake
Pointy hat to:	tmm
2001-08-05 03:55:02 +00:00
Thomas Moestl 491842fc97 Sigh. Add two files needed for the sparc64 fp contect switching code
that were forgotten in the last commit.

Pointy hat to: 	tmm
2001-08-05 03:47:02 +00:00
John Baldwin bd8e0d5871 Whitespace fixes. 2001-08-04 20:49:29 +00:00
John Baldwin f5b0911ca7 Axe unused and invalid astpending globaldata member. 2001-08-04 20:47:54 +00:00
John Baldwin 74c2df808a Axe unused and invalid GD_ASTPENDING symbol. 2001-08-04 20:46:46 +00:00
John Baldwin c6da9f6a8c - Fix a comment.
- Whitespace fixes.

Submitted by:	bde
2001-08-04 20:43:48 +00:00
Thomas Moestl b4c53a8111 Add a zdestroy() function to the zone allocator. This is needed for the
unload case of modules that use their own zones.
It has been tested with the nfs module.
2001-08-04 20:17:05 +00:00
Thomas Moestl e64b70af32 Add floating point context switching code for sparc64.
Reviewed by:	jake
2001-08-04 18:55:15 +00:00
Thomas Moestl 12543b2e98 Export the tk_nin and tk_nout variables (number of tty input/output
characters) as sysctls (kern.tty_nin and kern.tty_nout).
2001-08-04 18:09:24 +00:00
Thomas Moestl 938a4e5c0c Export the head structure for the device statistics STAILQ in
sys/devicestat.h, so that the queue can be walked in crashdumps using
libkvm.
2001-08-04 18:02:47 +00:00
Hajimu UMEMOTO e43cc4ae36 When running aplication joined multicast address,
removing network card, and kill aplication.
imo_membership[].inm_ifp refer interface pointer
after removing interface.
When kill aplication, release socket,and imo_membership.
imo_membership use already not exist interface pointer.
Then, kernel panic.

PR:		29345
Submitted by:	Inoue Yuichi <inoue@nd.net.fujitsu.co.jp>
Obtained from:	KAME
MFC after:	3 days
2001-08-04 17:10:14 +00:00
Warner Losh a253d9b47b Kill debug output for sn device. It is confusing the natives 2001-08-04 05:27:52 +00:00
John Baldwin c9c1406f76 Add KTR_INTR tracepoints for when clock interrupts are triggered. 2001-08-03 20:54:41 +00:00
Hajimu UMEMOTO 2a21da3022 When global anycast address was assigned to lo0, wrong source
address was selected.

Reported by:	Shingo WATANABE <nabe@nabechan.org>
Submitted by:	JINMEI Tatuya <jinmei@isl.rdc.toshiba.co.jp>
MFC after:	3 days
2001-08-03 19:10:31 +00:00
Robert Watson fd6aaf7fe1 Anton kindly pointed out (and fixed) a bug in the Jail handling of the
bind() call on IPv4 sockets:

  Currently, if one tries to bind a socket using INADDR_LOOPBACK inside a
  jail, it will fail because prison_ip() does not take this possibility
  into account.  On the other hand, when one tries to connect(), for
  example, to localhost, prison_remote_ip() will silently convert
  INADDR_LOOPBACK to the jail's IP address.  Therefore, it is desirable to
  make bind() to do this implicit conversion as well.

  Apart from this, the patch also replaces 0x7f000001 in
  prison_remote_ip() to a more correct INADDR_LOOPBACK.

This is a 4.4-RELEASE "during the freeze, thanks" MFC candidate.

Submitted by:	Anton Berezin <tobez@FreeBSD.org>
Discussed with at some point:	phk
MFC after:	3 days
2001-08-03 18:21:06 +00:00
Robert Watson 7d69e57088 Remove dangling prototype for the now defunct procfs_kmemaccess()
call.

Obtained from:	TrustedBSD Project
2001-08-03 17:51:05 +00:00
Daniel C. Sobral 07203494d2 MFS: Avoid dropping fragments in the absence of an interface address.
Noticed by:	fenner
Submitted by:	iedowse
Not committed to current by:	iedowse ;-)
2001-08-03 17:36:06 +00:00
Robert Watson 436b89d434 Collapse a Pmem case in with the other debugging files case for procfs,
as there are now "unusual" protection properties to Pmem that differ
from the other files.  While I'm at it, introduce proc locking for
the other files, which was previously present only in the Pmem case.

Obtained from:	TrustedBSD Project
2001-08-03 17:20:34 +00:00
Robert Watson 57de737e82 Remove read permission for group on the /proc/*/mem file, since kmem
no longer requires access.

Reviewed by:	tmm
Obtained from:	TrustedBSD Project
2001-08-03 17:15:40 +00:00
Robert Watson f2e6be5865 Prior to support for almost all ps activity via sysctl, ps used procfs,
and so special-casing was introduced to provide extra procfs privilege
to the kmem group.  With the advent of non-setgid kmem ps, this code
is no longer required, and in fact, can is potentially harmful as it
allocates privilege to a gid that is increasingly less meaningful.
Knowledge of specific gid's in kernel is also generally bad precedent,
as the kernel security policy doesn't distinguish gid's specifically,
only uid 0.

This commit removes reference to kmem in procfs, both in terms of
access control decisions, and the applying of gid kmem to the
/proc/*/mem file, simplifying the associated code considerably.
Processes are still permitted to access the mem file based on
the debugging policy, so ps -e still works fine for normal
processes and use.

Reviewed by:	tmm
Obtained from:	TrustedBSD Project
2001-08-03 17:13:23 +00:00
Bill Fenner 02e3112ae7 Don't terminate the uiomove() loop on a zero-length mbuf. It's not
particularly nice that IPSEC inserts a zero-length mbuf into the
 chain, and that bug should be fixed too, but interfaces should be
 robust to bad input.
Print the interface name when TUNDEBUG()ing about dropping an mbuf.
2001-08-03 16:51:53 +00:00
Mike Smith feade91944 Reverse the logic here again with regards to "trusted" ACPI timer
implementations.  More of them seem to be broken, so only "trust"
timers we know work.
2001-08-03 09:52:53 +00:00
Mike Smith d93b034fe9 Shoud build resources in the _CRS buffer. Oops.
Submitted by:	"neckpain@nettaxi.com" <neckpain@nettaxi.com>
2001-08-03 08:38:49 +00:00
Mike Smith a692219d8a Move the resource pointer when we reallocate the buffer.
Submitted by:	"neckpain@nettaxi.com" <neckpain@nettaxi.com>
2001-08-03 08:38:11 +00:00
Bosko Milekic ba3e88262e Rename mb_init() mbuf subsystem initialization routine to mbuf_init(), in
order to avoid namespace collision with subr_mchain.c's mb_init(). This
wasn't "fatal" as the mbuf initialization routine mb_init() was local to
subr_mbuf.c which in turn didn't pull in subr_mchain.c's mb_init()
declaration, but it should deffinately be changed now before it creates
headache.
2001-08-03 05:05:32 +00:00
Jake Burkholder f74250ca46 Remove some code that appears to have endian problems with INVARIANTS.
This is #if BIG_ENDIAN, but is only necessary if malloc types are shorts,
not struct malloc_type * like they are now.
2001-08-03 03:31:45 +00:00
Jake Burkholder 7cabcd9841 Move some code related to managing pv entries from the pmap module to
the pv module.  It works now that vtophys for sttes works.
2001-08-03 01:27:15 +00:00
Jake Burkholder d741ca6bdb Fix a bug translating virtual translation table entry addresses to physical
addresses.  It helps to use the physical address that the virtual address
actually maps to (doh!).  Comment out some code that crashes.

Found independently by:	tmm
2001-08-03 01:21:24 +00:00
Jake Burkholder 3db6135894 Define proc0paddr. Call init_param() as early as possible. 2001-08-03 01:11:49 +00:00
Jake Burkholder d2734d58ab Add a Makefile, ldscript, and config magic for sparc64. This is tailored
to build with a cross compiler alongside the standard compiler; it would be
more desirable to build in a chroot.
2001-08-03 01:09:10 +00:00
Jake Burkholder 1994658f04 Add an Elfhashelt type for sparc64. 2001-08-03 01:00:41 +00:00
Scott Long c6eafcf2c5 Reformat for 80 columns. Sorry, but I had to do it. 2001-08-03 00:50:30 +00:00
Peter Wemm 5635f2a580 Further Makefile.* sync (from Makefile.ia64). The lint target has been
commented out in the entire life of the 2.x+ branch and given the amount
of gcc-specific code we have and the warning checks that gcc does I'm not
sure that it is going to get us much for some time.
2001-08-03 00:07:54 +00:00
Peter Wemm d74dddff88 Move MKMODULESENV+= *after* MKMODULESENV= 2001-08-03 00:01:13 +00:00
Peter Wemm b2c17e333e Add a cosmetic comment. 2001-08-02 23:54:23 +00:00
John Baldwin b39bc3e160 Use 'p' instead of the potentially more expensive 'curproc' inside of
mi_switch().
2001-08-02 22:15:31 +00:00
George C A Reid 1ad86e6dd7 Set up the via_chinfo structures properly so we write to the correct
registers later on; this fixes the VIA82C686 sound problems recently
reported by a number of people.
2001-08-02 22:13:10 +00:00
Warner Losh c7021493ba Make the fmt arguments to make_dev and make_dev_alias const char *.
Approved on IRC as long as it didn't cause a large number of warnings by: phk

MFC After: 700 hours
2001-08-02 20:35:35 +00:00
Jonathan Chen 7ba271ae0b fix memory leak when error during opening of routing socket
PR:		kern/29336
Submitted by:	Richard Andrades <richard@xebeo.com>
MFC after:	1 month
2001-08-02 19:56:29 +00:00
Kazutaka YOKOTA 0426db70c6 Include opt_splash.h. 2001-08-02 13:23:17 +00:00
Kazutaka YOKOTA 2fe5e0b184 Use #ifdef DEV_SPLASH (from opt_splash.h) rather than
#if NSPLASH > 0 (from splash.h) to test the presence
of the splash driver.
2001-08-02 13:22:33 +00:00
Kazutaka YOKOTA eac47d67be Add FBIO_BLANK ioctl support. Return ENODEV for yet-to-be-
supported ioctls for now.
2001-08-02 11:26:30 +00:00
Kazutaka YOKOTA 6d1699583d Add some definitions. Their actual support will be added
to video drivers later.
2001-08-02 11:17:38 +00:00
Sheldon Hearn 2cc33d7946 When building a debugging kernel with modules, build modules with
debugging support as well.

This relies on support added in rev 1.105 to kmod.mk.

Requested by:	peter
2001-08-02 10:56:59 +00:00
Maxim Sobolev fe603109d1 - Deny detaching requests until device is still open, otherwise it is possible
to hang or panic kernel by detaching disk from which fs is mounted;
- replace "md" with MD_NAME in yet another place.

Reviewed by:	phk
Approved by:	phk
2001-08-02 10:19:13 +00:00
Brian Somers 2b5dcd2ffe Pack struct uniqtag declarations to stop our data field from being pushed
4 bytes to the right on the alpha.

Tested by:	Thomas Pornin <Thomas.Pornin@ens.fr>
MFC after:	1 week
2001-08-02 09:28:31 +00:00
Sheldon Hearn f66116083c When building a debugging kernel with modules, build modules with
debugging support as well.  Debugging module support is handled
identically to kernel debugging support, right down to poor
choice of make variable names.
2001-08-02 09:22:18 +00:00
Kazutaka YOKOTA 4866e2769a Refine cursor type/shape control escape sequences and
ioctls. We can now add ve, vi and vs capabilities to
cons25 in termcap.

Discussed with and tested by: ache
2001-08-02 08:30:40 +00:00
Alfred Perlstein 61ce6eeee3 Fixups for the initial allocation by dillon:
1) allocate fewer buckets
  2) when failing to allocate swap zone, keep reducing the zone by
     a third rather than a half in order to reduce the chance of
     allocating way too little.

I also moved around some code for readability.

Suggested by: dillon
Reviewed by: dillon
2001-08-02 07:54:58 +00:00
Matt Jacob d51456f800 Oops- don't set 'goal' twice when you mean to set 'nvrm' as well.
This breaks bogus NVRAM boards.

MFC after:	1 day
2001-08-02 00:34:56 +00:00
Matt Jacob d82784053e Revert part of previous- I misunderstood the use of 'ncpus'- I thought it'd
been hack to keep clocks from being reinitialized.
2001-08-01 20:35:42 +00:00
Peter Wemm aa7a4dae6d Temporarily back out kern_sig.c rev 1.125 and kern_exit.c rev 1.131.
This paniced my one of my machines one time too many :-( and there is
no sign of a solution in the pipeline.  The deltas are still easily
available in cvs.  The problem is that if the parent has been swapped
out, the child process cannot grope around in the parent's UPAGES to
see the sigact[] array or it will fault.  This probably is a showstopper
for this implementation anyway.
2001-08-01 20:35:24 +00:00
Dima Dorfman 635751fa8c Fix grammar nit. 2001-08-01 20:16:12 +00:00
Warner Losh 53af1c8a3d TI cardbus bridges, 12xx and newer, have an interesting register. It
is the diagnostics register at offset 0x93.  When bit 5 is set in this
register, bits 4-7 in ExCA register 0x5 being 0000 are required for
pci interrupt routing.  When it is clear, then bit 4 of ExCA register
0x3 is used to enable it.

The only other issue is that when you route interrupts this way, you
must read ExCA register 0x4 in order to clear the interrupt, else you
get an interrupt storm.

Deal with this requirement by setting things up.  It is believed that
this won't hurt other chipsets, but other chipsets may require their
own work arounds.
2001-08-01 19:41:56 +00:00
Matt Jacob 802f355a3f Don't initialize a clock twice (it's not a function of number of
cpus).
2001-08-01 19:40:11 +00:00
Ian Dowse 02b31a0ee9 Fix a client-side memory leak in nfs_flush(). The code allocates
a temporary array to store struct buf pointers if the list doesn't
fit in a local array. Usually it frees the array when finished,
but if it jumps to the 'again' label and the new list does fit in
the local array then it can forget to free a previously malloc'd
M_TEMP memory.

Move the free() up a line so that it frees any previously allocated
memory whether or not it needs to malloc a new array.

Reviewed by:	dillon
2001-08-01 10:25:13 +00:00
Greg Lehey d505403792 open_device: Recognize ar device.
Submitted by:  Valery Kotchiev <valery@rudiment.dk>
2001-08-01 04:35:28 +00:00
Bosko Milekic bb6f838c79 Move CPU_ABSENT() macro to smp.h, where it belongs anyway. It will be
defined to 0 in the non-SMP case, which very much makes sense as it
permits its usage in per-CPU initialization loops (for an example, check
out subr_mbuf.c).
  Further, on a UP system, make mb_alloc always use the first per-CPU
container, regardless of cpuid (i.e. remove reliability on cpuid in the
UP case).

Requested by: alfred
2001-08-01 00:54:00 +00:00
Bill Fenner 46da4bc6fc Update our bpf.h with tcpdump.org's new DLT_ types.
Use our bpf.h instead of tcpdump.org's to build libpcap.
2001-07-31 23:27:06 +00:00
John Baldwin 36c2e9feb4 Apply the cluebat to myself and undo the await() -> mawait() rename. The
asleep() and await() functions split the functionality of msleep() up into
two halves.  Only the asleep() half (which is what puts the process on the
sleep queue) actually needs the lock usually passed to msleep() held to
prevent lost wakeups.  await() does not need the lock held, so the lock
can be released prior to calling await() and does not need to be passed in
to the await() function.  Typical usage of these functions would be as
follows:

        mtx_lock(&foo_mtx);
        ... do stuff ...
        asleep(&foo_cond, PRIxx, "foowt", hz);
        ...
        mtx_unlock&foo_mtx);
        ...
        await(-1, -1);

Inspired by:	dillon on the couch at Usenix
2001-07-31 22:06:56 +00:00
John Baldwin e9121d0663 Add a safety belt to mawait() for the (cold || panicstr) case identical to
the one in msleep() such that we return immediately rather than blocking.

Submitted by:	peter
Prodded by:	sheldonh
2001-07-31 20:57:57 +00:00
John Baldwin b0606ca15f Add in a hack to support IBM "El Torito" CD-ROM booting BIOS's which expect
the first sector of the emulated floppy to contain a valid MS-DOS BPB that
it can modify.  Since boot1 is the first sector of boot.flp, this resulted
in the BIOS overwriting part of boot1: specifically the function used to
read in sectors from the disk.

Submitted by:	Mark Peek <mark@whistle.com>
Submitted by:	Doug Ambrisko <ambrisko@ambrisko.com>
PR:		i386/26382
Obtained from:	NetBSD, OpenBSD (the example BPB)
MFC after:	1 month
2001-07-31 19:50:09 +00:00
John Baldwin 5cb0fbe47e If we have already panic'd then don't bother enforcing mutex asserts as
things are pretty much shot already and all panic'ing does is hurt our
chances of getting a dump.

Inspired by:	sheldonh
2001-07-31 17:45:50 +00:00
John Baldwin 32bca5fe03 - Fix panicstr checks to explicitly check against NULL.
- Add a few more panicstr checks so that we don't panic recursively.

Requested by:	sheldonh (2)
2001-07-31 17:44:57 +00:00
Robert Watson e7f65fdcf9 o Modify p_candebug() such that there is no longer automatic acceptance
of debugging the current process when that is in conflict with other
  restrictions (such as jail, unprivileged_procdebug_permitted, etc).
o This corrects anomolies in the behavior of
  kern.security.unprivileged_procdebug_permitted when using truss and
  ktrace.  The theory goes that this is now safe to use.

Obtained from:	TrustedBSD Project
2001-07-31 17:25:12 +00:00
Bill Paul 89b1abc0bf Re-order things slightly in the RX handler for VLAN support: we need
call vlan_input_tag() after stripping the ether header from the frame
with m_adj(), not before.

Noticed by: Brooks Davis <brooks@one-eyed-alien.net>
2001-07-31 16:38:58 +00:00
Warner Losh 6d5c3c4c96 bsh and bst are unused in softc, except for setting them. We do use the
bsh and bst in the pcic_slot structures.
2001-07-31 15:53:17 +00:00
Robert Watson 0ef5652e27 o Introduce new kern.security sysctl tree for kernel security policy
MIB entries.
o Relocate kern.suser_permitted to kern.security.suser_permitted.
o Introduce new kern.security.unprivileged_procdebug_permitted, which
  (when set to 0) prevents processes without privilege from performing
  a variety of inter-process debugging activities.  The default is 1,
  to provide current behavior.

  This feature allows "hardened" systems to disable access to debugging
  facilities, which have been associated with a number of past security
  vulnerabilities.  Previously, while procfs could be unmounted, other
  in-kernel facilities (such as ptrace()) were still available.  This
  setting should not be modified on normal development systems, as it
  will result in frustration.  Some utilities respond poorly to
  failing to get the debugging access they require, and error response
  by these utilities may be improved in the future in the name of
  beautification.

  Note that there are currently some odd interactions with some
  facilities, which will need to be resolved before this should be used
  in production, including odd interactions with truss and ktrace.
  Note also that currently, tracing is permitted on the current process
  regardless of this flag, for compatibility with previous
  authorization code in various facilities, but that will probably
  change (and resolve the odd interactions).

Obtained from:	TrustedBSD Project
2001-07-31 15:48:21 +00:00
Warner Losh 1b64899001 Fix typo where I assigned the bus tag and not the bus handled. It
appears that this may be unused, but I'll keep it for the moment.

Noticed by: Shizuka Kudo <shizukakudo_99@yahoo.com>
2001-07-31 15:42:44 +00:00
John Baldwin 4ce050bf39 GC some obsolete alpha code. 2001-07-31 14:35:36 +00:00
Hajimu UMEMOTO 79e15ef30c If LCP proto-rej is received, drop the protocol mentioned by the message.
This is to be friendly with non-IPv6 peer (If the peer complains due to
lack of IPv6CP, drop IPv6CP).  This basically implements "RXJ+" state
transition in the RFC.

Obtained from:	NetBSD
2001-07-31 07:27:01 +00:00
Warner Losh 372458622f A bunch of interrupt related cleanup.
o Move PIOCSRESOURCE from pccard to pcic so the kernel can give pccardd
  better hints as to what resources to use.
o Implement an undocumented hw.pcic.interrupt_route to allow people that
  need to do so to route their interrupts in a non-standard way.
o Only preallocate a resource in probe if we're routing via pci.
o If we aren't routing via pci, then set the irq to use explicitly
  to defeat the automatic IRQ routing of the pci layer.

This, with the pccardd code should be close to what can be committed
to -stable.
2001-07-31 06:44:37 +00:00
Warner Losh 4ee0b26518 Move pcic_override_irq from pcic_isa, to pcic. 2001-07-31 06:32:02 +00:00
Warner Losh 9f3112df2d Add CLPD6832_BCR_ISA_IRQ definition for ISA routing of interrupts.
Minor commentary tweaking.
2001-07-31 06:31:38 +00:00
Jake Burkholder 89bf8575ee Flesh out the sparc64 port considerably. This contains:
- mostly complete kernel pmap support, and tested but currently turned
  off userland pmap support
- low level assembly language trap, context switching and support code
- fully implemented atomic.h and supporting cpufunc.h
- some support for kernel debugging with ddb
- various header tweaks and filling out of machine dependent structures
2001-07-31 06:05:05 +00:00
Jake Burkholder 98bb5304e1 Add skeleton machine dependent headers and c files for a port of freebsd
to a new architecture.  This is the base of the sparc64 port, but contains
limited machine dependent code, and can be used a base for ports.  Included
are:
- standard machine dependent headers, tweaked for a 64 bit, big endian
  architecture, including empty versions of all the machine dependent
  structures
- a machine independent atomic.h, which can be used until a port has
  support for interrupts and the operations really need to be atomic
- stub versions of all the machine dependent functions, which panic
  when called and print out the name of the function that needs to
  be implemented.  functions which are normally in assembly files are
  not included, but this should reduce the number of different undefined
  references on the first few compiles from hundreds to 5 or 6
Given minimal startup code and console support it should be trivial to
make this compile and run the first few sysinits on almost any architecture.

Requested by:   alfred, imp, jhb
2001-07-31 05:45:16 +00:00
Jake Burkholder 9ceb184438 Machine dependent ifdefs for sparc64. 2001-07-31 04:14:30 +00:00
Jake Burkholder 3a9b5daf48 Oops. Last commit to vm_object.c should have got these files too.
Remove the use of atomic ops to manipulate vm_object and vm_page flags.
Giant is required here, so they are superfluous.

Discussed with:	dillon
2001-07-31 04:09:52 +00:00
Jake Burkholder b06805ad34 Remove the use of atomic ops to manipulate vm_object and vm_page flags.
Giant is required here, so they are superfluous.

Discussed with:	dillon
2001-07-31 04:03:53 +00:00
Jake Burkholder 146be906a1 Don't try to find an eventhandler list if the list of lists hasn't
been initialized yet.
2001-07-31 03:52:16 +00:00
Jake Burkholder 98b0e9d587 Don't try to print a field that doesn't exist; in usually commented
out debugging code.
2001-07-31 03:51:07 +00:00
Jake Burkholder 7e5102989e Use a machine dependent type, Elf_Hashelt, for the elements of the elf
dynamic symbol table buckets and chains.  The sparc64 toolchain uses 32
bit .hash entries, unlike other 64 bits architectures (alpha), which use
64 bit entries.

Discussed with: dfr, jdp
2001-07-31 03:46:39 +00:00
Yoshihiro Takahashi baa444b77e Removed PLIP support. 2001-07-31 03:39:35 +00:00
Jake Burkholder 8aa920fd1d Make the openfirmware functions work on 64 bit architectures by using
a standard cell_t type for the fields of all argument structs.  Also
make ihandle_t and phandle_t unsigned to avoid sign extension problems.

Approved by:	benno
2001-07-31 03:36:26 +00:00
Jake Burkholder c22c65b1d4 Quiet uninitialized variable warning (also a bug). 2001-07-31 03:32:24 +00:00
Peter Wemm 7b141d5db3 Check the filehandle size when mounting.
Obtained from:  Constantine Sapuntzakis <csapuntz@openbsd.org>
2001-07-30 20:01:59 +00:00
Jeroen Ruigrok van der Werven 7b389f3335 Fix obsolete code.
FreeBSD _does_ define ENOMSG, so no need for checking if we support it.

Inspired by PR:		22470
Which was submitted by:	Bjorn Tornqvist <bjorn@west.se>
MFC after:	1 week
2001-07-30 19:28:02 +00:00
Darren Reed 31f3bf83f6 fix import/merge related code problems 2001-07-30 10:53:23 +00:00
Mike Smith f16527bb44 The current resource buffer returned from an interrupt link device
in the case where there are no interrupts routed for it does not
contain enough space to use it to route an interrupt.  In the case
where we need to route an interrupt, throw away the returned buffer
and create a new one containing the interrupt we want.
2001-07-30 09:01:18 +00:00
Mike Smith 6d63101a75 - Prevent the ACPI code from being loaded as a module other than at
boot time.  Loading as a module once the system is up and running
   doesn't make any sense.

 - Fix acpi_FindIndexedResource (it would only check the first resource),
   changes the calling interface.

 - Add a new helper function (acpi_AppendBufferResource) to help building
   buffers containing resources.
2001-07-30 08:59:43 +00:00
Mike Smith d8a9fe36a1 Minor updates (no functional changes)
- Remove the beer-ware license (reqested by phk)
 - Reorganise so that the PIIX4 workaround code is kept together, and
   switch the workaround function via the timecounter struct, saving
   a compare in the read-timecounter codepath.  Also indicate that
   the workaround is active by changing the timecounter hardware string.
2001-07-30 08:57:55 +00:00
Warner Losh 7e766053f8 Don't use a buffer for the state info from the TI chips. Just print
it directly.  Also, minor style(9) nits near one or two of these
sites.
2001-07-30 07:17:40 +00:00
Matt Jacob 9ce9bdaf8a Redo how we manage SCSI device settings- have a 3rd flags (nvram) that records
either what's in NVRAM or what the safe defaults would be if we lack NVRAM.
Then we rename cur_XXXX to actv_XXXX (these are the currently active settings)
and the dev_XXX settings to goal_XXXX (these are the settings which we want
cur_XXXX to converge to).

This probably isn't entirely final as yet- but it's a lot closer to now
being what it should be, including allowing camcontrol to actually set
specific settings.
2001-07-30 01:00:21 +00:00
Matt Jacob d9c272f3ea Redo how we manage SCSI device settings- have a 3rd flags (nvram) that records
either what's in NVRAM or what the safe defaults would be if we lack NVRAM.
Then we rename cur_XXXX to actv_XXXX (these are the currently active settings)
and the dev_XXX settings to goal_XXXX (these are the settings which we want
cur_XXXX to converge to).

Roll core minor.
2001-07-30 00:59:32 +00:00
Matt Jacob df225582bf Redo how we manage SCSI device settings- have a 3rd flags (nvram) that records
either what's in NVRAM or what the safe defaults would be if we lack NVRAM.
Then we rename cur_XXXX to actv_XXXX (these are the currently active settings)
and the dev_XXX settings to goal_XXXX (these are the settings which we want
cur_XXXX to converge to).
2001-07-30 00:59:06 +00:00
Matt Jacob c7ec439040 Kill the command (don't rerun it) if we had an AUTOSENSE failure.
If we had an AUTOSENSE failure, we don't know what SENSE DATA
we had for a CHECK CONDITION. It's far better to assume failure
in this case.
2001-07-30 00:44:32 +00:00
Matt Jacob 387c7c9d0e (Forced commit- last one missed the comments)
Handle both old and new TARGIOALLOCUNIT/TARGIOFREEUNIT cases- the new
one allows us to specify inquiry data we want to use.

Handle more of the CAM_DIS_DISCONNECT case.
2001-07-30 00:30:58 +00:00
Matt Jacob 17ff160058 (Forced commit- last commit was inadvertant in that it missed the comments)
Move TARGCTLIOALLOCUNIT to OTARGCTLIOALLOCUNIT, TARGCTLIOFREEUNIT
to OTARGCTLIOFREEUNIT and redefine old associated structure to be
old_ioc_alloc_unit- deprecation but preservation of binaries.

Add new structure for same- but this one contains a pointer to
user defined INQUIRY data so you can define what the target
device looks like to the outside world.
2001-07-30 00:27:54 +00:00
Matt Jacob 102d676930 backout last commit- inadvertant 2001-07-30 00:22:57 +00:00
Matt Jacob 3759de8993 scsi_targetio.h 2001-07-30 00:21:29 +00:00
Matt Jacob c2accd3411 Propagate CAM_DIS_DISCONNECT on through:
1. If we get frozen, unfreeze for disable disconnects.
2. Put CAM_DIS_DISCONNECT commands at the head of the work queue
(we have a target still connected and we can't run anything else
until this command completes).

If we had an error sending the last CTIO, unfreeze the queue anyway.
2001-07-30 00:19:50 +00:00
Warner Losh 4c7bc18993 When booted -v (eg bootverbose is non-zero), have pccard report what
resources it is attempting to assign to a child object.  This should
help people track down mysterious resource allocation problems more
easily.

# Unfortunately, it is harder to do the conflict check and report which
# resource failed if the driver itself doesn't.
2001-07-30 00:03:58 +00:00
Ian Dowse 9e27954de1 Two recent commits in sys/ufs/ufs interacted badly with ext2fs
because it shares ufs code. In ufs_fhtovp(), the test on i_effnlink
is invalid because ext2fs does not maintain this field. In ufs_close(),
i_effnlink is also tested, to determines whether or not to call
vn_start_write(). The ufs_fhtovp issue breaks NFS exporting of
ext2fs filesystems; I believe the other is harmless.

Fix both cases by checking um_i_effnlink_valid in the ufsmount
struct, and use i_nlink if necessary.

Noticed by:	bde
Reviewed by:	mckusick, bde
2001-07-29 22:26:01 +00:00
Thomas Moestl 9c4968d152 Disallow ATAPI CD transfers that are not a multiple of the device block
size (previously, the transfer size would be rounded up to a multiple of
the block size, which would overflow the buffer).
This fixes panics when doing things like trying to mount audio CD's.

PR:		kern/21946
Review Timeout:	sos
2001-07-29 21:01:13 +00:00
Yoshihiro Takahashi f7827e0a6e Convert the olpt driver to using new-bus stuff. 2001-07-29 11:11:45 +00:00
Yoshihiro Takahashi 8ea2602a0d Merged from sys/dev/syscons/syscons.c revisions 1.367 and 1.368. 2001-07-29 10:52:07 +00:00
KATO Takenori cd9709998e Make symlink $S/$M/include -> compile/FOO/machine at kernel-depend
instead of geneassym.o.
2001-07-29 07:39:14 +00:00
Mark Murray 7d42654638 Diff-reduce this with GENERIC.
OK'ed by:	imp
2001-07-28 20:40:49 +00:00
Ian Dowse a4821e444e Permit direct swapping to NFS regular files using swapon(2). We
already allow this for NFS swap configured via BOOTP, so it is
known to work fine.

For many diskless configurations is is more flexible to have the
client set up swapping itself; it can recreate a sparse swap file
to save on server space for example, and it works with a non-NFS
root filesystem such as an in-kernel filesystem image.
2001-07-28 20:18:38 +00:00
Justin T. Gibbs 00efe71bc7 Remove a bootverbose diagnostic that makes bootverbose just too verbose. 2001-07-28 18:45:52 +00:00