Commit Graph

27387 Commits

Author SHA1 Message Date
Matt Jacob
38db9454de John Polstra
bogus additional write to WXREG_IMASK that enabled *all* interrupt causes
while I was trying to disable the chip. Oops.
2001-08-24 23:08:13 +00:00
Bosko Milekic
76dcbd6f9f Force a commit on kern_mutex.c to explain reason for last commit but while
I'm at it also add a comment in mtx_validate() explaining the purpose
of the last change.

Basically, this fixes booting kernels compiled with MUTEX_DEBUG. What used
to happen is before we setidt from init386() [still using BTX idt], we
called mtx_init() on several mutex locks, notably Giant and some others.
This is a problem for MUTEX_DEBUG because it enables mtx_validate() which
calls kernacc(), some of which in turn requires Giant.
Fix by calling kernacc() from mtx_validate() only if (!cold).
2001-08-24 23:00:59 +00:00
Bosko Milekic
ab07087e16 *** empty log message *** 2001-08-24 22:53:45 +00:00
Matthew Dillon
2ee4dc6565 Add INHERIT_XXX defines for minherit() system call.
Remove MAP_INHERIT - it is no longer supported.
2001-08-24 19:48:07 +00:00
Matthew Dillon
676274db9b Remove support for the badly broken MAP_INHERIT (from -current only). 2001-08-24 19:29:56 +00:00
Matthew Dillon
c45da89917 Remove MAP_NOEXTEND. It came from 4.4-lite and not only was never
implemented, but mmap()'s default behavior is *already* to not extend
files.  Only write() or ftruncate() can extend a file.
2001-08-24 18:22:46 +00:00
John Baldwin
6385dec00e Style nits:
- Don't use punctuation or newlines in panic messages.
- Remove excess blank lines.

Requested and partially submitted by:	bde
2001-08-24 17:46:58 +00:00
Warner Losh
d625c99d74 Explain what we're doing in pcic_pci_shutdown a little better. Try to
explain the subtle side effects that are going to happen and why we go
ahead and ack the interrupt source.  This stuff is tricky to get
right.

Also, emperical tests have shown that doing a shutdown in attach to be
ineffectual, so remove it from there.  Analysis of the code paths
shows that nearly identical writes to these registers happen in later
parts of the code.  The hanging problem on thinkpads when we change
the interrupt routing type is something else.
2001-08-24 17:29:42 +00:00
John Baldwin
e5dfa86a70 Axe a commented, unused #define related to the old giant lock. 2001-08-24 16:52:31 +00:00
John Baldwin
134b29765c INTREN() and INTRDIS() have been MP safe for a while. Don't say that they
are "soon to be" MP safe in the comments.
2001-08-24 16:51:47 +00:00
John Baldwin
a0f831f573 Remove references to the old giant kernel lock in various comments. 2001-08-24 16:46:15 +00:00
Peter Pentchev
ccdbd10cb7 Prevent passing a null pointer as a filename to vn_open(),
if for some reason expand_name() failed to build a core file name.

PR:		29931
Submitted by:	Foldi Tamas <crow@kapu.hu>
Reviewed by:	dd, -arch
MFC after:	1 month
2001-08-24 15:49:30 +00:00
Andrey A. Chernov
5215e1ea12 Copy from kern_lockf.c: remove extra check 2001-08-24 10:22:16 +00:00
Andrey A. Chernov
dc6e1079e6 Remove extra check unneded now 2001-08-24 10:20:26 +00:00
Peter Wemm
c1c2006ca7 Export the actual KERNBASE to the symbol table. We can use nlist() to get
this without having to second guess it in userland.
2001-08-24 08:29:54 +00:00
Peter Wemm
5897d41109 Move cpu_fxsr definition to C code (so debug info is generated) and where
it is easily #ifdef'ed so that we dont miss unintentional references to it.
2001-08-24 08:27:24 +00:00
Warner Losh
662460d3d5 Move code to shutdown the pcic_pci_shutdown. Call it on system
shutdown and also before we get going with the device initialization.
This may fix the hangs some people are seeing on warmboot.  It appears
that some machines will reset the cardbus bridge on boot, while others
don't.  So we turn off the card, and ack the interrupts (which likely
is a nop in the shutdown case since we're still fielding interrupts).
This should turn off the interrupts.

Since I don't have hardware that hangs on reboot, I'm committing this
without testing that aspect of the patch (it causes no harm on my
Dell).
2001-08-24 07:43:35 +00:00
Warner Losh
9bec31a4c0 Two fixes. First, put into place a more generic chipset specific
initialization structure.  Warn the user for those chipsets that
aren't yet customized that they might not work.  Second, try to power
off the slot on attach and ack the interrupts.  I don't know, but this
might solve the hangs that people will see on Thinkpads if they set
hw.pcic.init_routing=1.
2001-08-24 07:30:18 +00:00
Nick Sayer
2afcd749c7 Get rid of redundant device_set_desc. Both the PCI and PCCARD versions
do this in the probe routine now.
2001-08-24 05:47:50 +00:00
Nick Sayer
fa081a357e In order for the MA301 to pass interrupts from the PCCard, you must
go into the PLX 9052's interrupt control register and turn on the magic
interrupt enable bit.

Partial thanks are due to OpenBSD for pointing out that the chip is a
PLX 9052 and pointing me to the datasheet PDF.
2001-08-24 02:14:26 +00:00
Robert Watson
670f6b2fc6 o Clarify comments in vaccess_acl_posix1e() ACL evaluation routine so
as to improve readability and accuracy.

Obtained from:	TrustedBSD Project
2001-08-24 01:41:42 +00:00
Nick Sayer
15d2a7c783 if_wi can be either pci (without pccard) or pccard 2001-08-23 23:58:49 +00:00
John Baldwin
b0b7cb508c Use witness_upgrade/downgrade for sx_try_upgrade/downgrade. 2001-08-23 22:51:22 +00:00
John Baldwin
8df70cb7a9 Whitespace nit. 2001-08-23 22:47:51 +00:00
John Baldwin
c19fe5e261 Add witness_upgrade() and witness_downgrade() for handling upgrades and
downgrades of shared/exclusive locks.
2001-08-23 22:47:05 +00:00
John Baldwin
d7c4536a55 Convert some KASSERT()'s into if (foo) panic() because they are testing
how locks are managed by the rest of the kernel, not verifying the internal
integrity of witness itself.
2001-08-23 22:44:47 +00:00
Dima Dorfman
98ec4706ee Correct the comment about bpfattach() to match reality.
PR:		29967
Submitted by:	Joseph Mallett <jmallett@xMach.org>
2001-08-23 22:38:08 +00:00
Dima Dorfman
745bab7f84 Correct a typo in a comment: FIN_WAIT2 -> FIN_WAIT_2
PR:		29970
Submitted by:	Joseph Mallett <jmallett@xMach.org>
2001-08-23 22:34:29 +00:00
John Baldwin
1432aa0c5e Add a new kernel option RESTARTABLE_PANICS. If this option is present,
then one can restart from a panic by resetting the panicstr variable to
NULL.  This commit conditionalizes the previously committed functionality
on this variable.  It also removes the __dead2 attribute from the panic()
function so that when one continues from a panic() the behavior will
be predictable.
2001-08-23 20:32:21 +00:00
Bill Paul
645ed1a78b Fix a bug in the ste_setmulti() routine. The NIC has 4 16-bit multicast
hash registers, not 2 32-bit ones. This would prevent the multicasr filter
from being programmed correctly in some cases.
2001-08-23 18:22:55 +00:00
Andrey A. Chernov
f6bf1abc1b Stupid error from my side in prev. commit: || -> && 2001-08-23 18:02:29 +00:00
John Baldwin
e2870579fa Clear the sx_xholder pointer when downgrading an exclusive lock. 2001-08-23 17:57:37 +00:00
Andrey A. Chernov
5d97bedb22 vn_stat(): if va_size (u_quad_t) > OFF_MAX, return EOVERFLOW, don't copy it
blindly to st_size
2001-08-23 17:56:48 +00:00
Andrey A. Chernov
2a31175b6e Copy yet one check for SEEK_END overflow 2001-08-23 17:12:42 +00:00
Andrey A. Chernov
6fb9fbceab Add yet one check for SEEK_END overflow 2001-08-23 17:09:23 +00:00
Andrey A. Chernov
db106eff39 lseek: fix check for vattr.va_size overflow. Check suggested by bde simple not
works with unsigned types.
2001-08-23 17:01:25 +00:00
Andrey A. Chernov
e02faad5ca Implement l_len<0 per POSIX check.
Check for valid l_whence too.
2001-08-23 16:13:59 +00:00
Andrey A. Chernov
ea4313e351 Copy my newly introduced l_len<0 'oops' fix from kern_lockf.c 2001-08-23 16:06:14 +00:00
Andrey A. Chernov
62be011ebd Oops, fix my broken handling of new l_len<0 case 2001-08-23 16:00:27 +00:00
Andrey A. Chernov
e3e2c03de3 Copy POSIX l_len<0 handling from kern_lockf.c 2001-08-23 15:44:24 +00:00
Andrey A. Chernov
f510e1c2ec Originally BSD return EINVAL for l_len < 0, but now POSIX wants it too,
so implement POSIX l_len < 0 handling.
2001-08-23 15:40:30 +00:00
Andrey A. Chernov
bbf6984cec Cosmetique: correct English in comments
non-cosmetique: add missing break; - original code was broken here
2001-08-23 14:45:31 +00:00
Andrey A. Chernov
6d24c65d96 Cosmetique: correct English in comments
Pointed by:	bde
2001-08-23 14:41:39 +00:00
Andrey A. Chernov
6c3f4fef64 Even better move: suppose that server is able to handle SEEK_END,
so check arguments for all but not SEEK_END case, leaving SEEK_END
handling for server
2001-08-23 14:21:26 +00:00
Andrey A. Chernov
e018907ed4 Apparently SEEK_END locking not supported by NFS. Previous variant
returns EINVAL in that case, change it to EOPNOTSUPP.
2001-08-23 14:09:16 +00:00
Andrey A. Chernov
b82f5b624c Cosmetique: more <sys/*> into one group, separate include families by
blank line
2001-08-23 13:51:17 +00:00
Andrey A. Chernov
fb2f187058 Move <machine/*> after <sys/*>
Pointed by:	bde
2001-08-23 13:27:58 +00:00
Andrey A. Chernov
b44af710d3 Move <machine/*> after <sys/*>
Pointed by:	bde
2001-08-23 13:21:17 +00:00
Andrey A. Chernov
4b207d9868 Move <machine/*> after <sys/*>
Add missing fdrop() before EOVERFLOW

Pointed by:	bde
2001-08-23 13:19:32 +00:00
Cameron Grant
4132a3b206 the feederchain builder is currently broken for recording channels. disable
it until it is fixed.  this limits recording to native formats and speeds
only.
2001-08-23 12:27:27 +00:00
Cameron Grant
334326a17f handle bogus values passed to SOUND_PCM_WRITE_CHANNELS/SNDCTL_DSP_CHANNELS
ioctls better- if 0 is passed, return the current setting.  if 1 or 2 are
passed, behave accordingly.  treat values >2 as 2.

PR:		kern/29964
2001-08-23 12:21:12 +00:00
Cameron Grant
48875621e1 make the 4dwave nx chip work
Submitted by:	Philippe Anel <xigh@noos.fr>
2001-08-23 12:02:29 +00:00
Cameron Grant
92f39b2c05 MFS: make SNDCTL_DSP_SETTRIGGER work 2001-08-23 11:58:38 +00:00
Cameron Grant
1662598f0c MFS: allow multiple opens of mixer devices 2001-08-23 11:56:07 +00:00
Cameron Grant
67b1dce3bc many changes:
* add new channels to the end of the list so channels used in order of
addition

* de-globalise definition of struct snddev_info and provide accessor
functions where necessary.

* move the $FreeBSD$ tag in each .c file into a macro and allow the
/dev/sndstat handler to display these when set to maximum verbosity to aid
debugging.

* allow each device to register its own sndstat handler to reduce the amount
of groping sndstat must do in foreign structs.
2001-08-23 11:30:52 +00:00
Andrey A. Chernov
4779017439 adv. lock:
copy EOVERFLOW handling code from main variant
fix type of 'size' arg
2001-08-23 08:54:22 +00:00
Andrey A. Chernov
e9d095afdc adv. lock:
detect off_t overflow _before_ it occurse and return EOVERFLOW instead of
EINVAL
2001-08-23 08:20:21 +00:00
Andrey A. Chernov
69cc1d0d7f Detect off_t EOVERFLOW of start/end offsets calculations for adv. lock,
as POSIX require.
2001-08-23 07:42:40 +00:00
Nick Sayer
499147571e Oops. The new pci_ids array should be static. 2001-08-23 03:06:16 +00:00
Peter Wemm
85ceedd60f Fix a #endif misplacement in 1.231 due to misapplied patch
Pointy hat to: peter
2001-08-23 01:50:31 +00:00
Peter Wemm
66875a2aff Fix a comment error that was fixed in the pc98 version. hw.maxmem is
really hw.physmem.
2001-08-23 01:49:12 +00:00
Peter Wemm
520f648f42 Merge i386/machdep.c rev 1.474: dont overextend %cs. (finally, it doesn't
conflict with unmerged changes)
2001-08-23 01:47:26 +00:00
Peter Wemm
2ddb1aff19 Merge i386/machdep.c rev 1.469: whitespace changes to fit 80 columns
Forgotten by: jhb
2001-08-23 01:46:23 +00:00
Peter Wemm
2fb7d2e4c2 Merge i386/machdep.c rev 1.468: make breakpoint/trace interrupt instead
of trap gates

Forgotten by: bde
2001-08-23 01:43:38 +00:00
Peter Wemm
10abeae984 Merge 386/machdep.c rev 1.467: fix bugs/miscalculations
Forgotten by:  iwasaki
2001-08-23 01:42:21 +00:00
Peter Wemm
b65110f80b Identical to i386/machdep.c rev 1.473: move submap initialization to MI. 2001-08-23 01:36:54 +00:00
Peter Wemm
60e562536f Merge i386/machdep.c rev 1.472: Fix bug in physmem_est and maxbcache
calculation

Forgotten by: dillon
2001-08-23 01:34:35 +00:00
Peter Wemm
748e7247a1 Merge i386/machdep.c rev 1.470. Limit KVM for buffer cache etc.
Forgotten by: dillon
2001-08-23 01:30:51 +00:00
Peter Wemm
9f9360003f Dont add UPAGES to the %cs segment limit. There is nothing there except
page tables.
2001-08-23 01:25:21 +00:00
Peter Wemm
1ef4734b8a Do not printf when we get called as a result of a pci shared interrupt,
and add a comment to that effect.
2001-08-23 01:16:10 +00:00
Peter Wemm
dae6dcff3f Revert part of the last commit, as suggested by Nick. This is expected,
it is part of the way PCI shared interrupts work.
2001-08-23 01:12:35 +00:00
Peter Wemm
3b703181e3 Dont compile in SSE fxsave/fxrstor instructions if CPU_ENABLE_SSE isn't
active.
2001-08-23 01:03:56 +00:00
Nick Sayer
84031c85e5 Add support for the Netgear MA301 PCI adapter for the MA401.
It appears that a number of PrismII card vendors seem to be doing the
same thing (that is, using the same PCI bridge chip) to support PCI,
but each with their own vendor/product ID. So rather than cut-n-paste
another if statement into the probe routine, it's probably better to
provide support for a table. Adding new devices will be a lot easier
that way.
2001-08-23 00:57:40 +00:00
Thomas Moestl
040ef07af8 Regenerate from syscalls.master using the new makesyscalls.sh revision. 2001-08-22 23:27:20 +00:00
Thomas Moestl
a4189a088b Add padding before each element of the syscall argument structures in
sysproto.h in addition to the existing padding afterwards.
This is needed to support big-endian architectures like sparc64.

Reviewed by:	bde
Tested on alpha by:	jhb
2001-08-22 23:22:47 +00:00
Alexander Langer
b8c526df70 Fix a simple typo I just happened to find. 2001-08-22 19:12:24 +00:00
Matthew Dillon
0cf5e0ebd6 Remove the code that limited the buffer_map to 1/2 the size of the
kernel_map.  maxbcache takes care of this now and the 1/2 limit can
interfere with testing.

Suggested by: bde
2001-08-22 18:10:37 +00:00
Mitsuru IWASAKI
e4e9098988 Move CR4.PGE enabling code after paging is enabled via CR0.PG based on
the description (2.5. CONTROL REGISTERS) of Intel developer's manual at:
ftp://download.intel.com/design/PentiumII/manuals/24319202.pdf

Reviewed by:	peter, bde, tlambert2@mindspring.com
Pointed-out by:	"Shin'ya Kumabuchi" <kumabu@t3.rim.or.jp>
MFC after:	1 week
2001-08-22 15:41:43 +00:00
Peter Wemm
94ad1d3eb7 OK, now I am scared of pxeldr. It had /boot/loader appended onto
the end of it and decoded the headers.

Submitted by:	jhb
2001-08-22 08:02:01 +00:00
Peter Wemm
1408f3e993 Make these depend on the usb module so they can use its symbols if they
are loaded as seperate .ko files
2001-08-22 05:33:57 +00:00
Peter Wemm
89ea00a7d8 Generate an ELF /boot/loader instead of fake a.out. The fake a.out wrapper
did not work with old a.out-only bootblocks anyway. :-(
2001-08-22 05:29:25 +00:00
Matthew Dillon
219d632c15 Move most of the kernel submap initialization code, including the
timeout callwheel and buffer cache, out of the platform specific areas
and into the machine independant area.  i386 and alpha adjusted here.
Other cpus can be fixed piecemeal.

Reviewed by:    freebsd-smp, jake
2001-08-22 04:07:27 +00:00
Matthew Dillon
0b76df7146 KASSERT if vm_page_t->wire_count overflows. 2001-08-22 04:01:56 +00:00
Ian Dowse
7dfb550e0c When compressing directory blocks, the dirhash code didn't check
that the directory entry was in use before attempting to find it
in the hash structures to change its offset. Normally, unused
entries do not need to be moved, but fsck can leave behind some
unused entries that do. A dirhash sanity panic resulted when the
entry to be moved was not found. Add a check that stops entries
with d_ino == 0 from being passed to ufsdirhash_move().
2001-08-22 01:35:17 +00:00
Mike Silbersack
b0e3ad758b Much delayed but now present: RFC 1948 style sequence numbers
In order to ensure security and functionality, RFC 1948 style
initial sequence number generation has been implemented.  Barring
any major crypographic breakthroughs, this algorithm should be
unbreakable.  In addition, the problems with TIME_WAIT recycling
which affect our currently used algorithm are not present.

Reviewed by: jesper
2001-08-22 00:58:16 +00:00
Peter Wemm
3d6fde76ed Introduce two new sysctl's.. vm.kvm_size and vm.kvm_free. These are
purely informational and can give some advance indications of tuning
problems.  These are i386 only for now as it seems that the i386 is
the only one suffering kvm pressure.
2001-08-22 00:50:46 +00:00
John Baldwin
61e9650010 Clear db_active in boot() so that one can call the boot function (as well
as use the panic command) w/o having to manually clear db_active first
to avoid the db_error() in mi_switch().
2001-08-21 23:29:40 +00:00
John Baldwin
3a9e0f5bd1 Push down Giant some in trap_pfault() so we don't grab Giant around
trap_fatal() to make restarting from panic's slightly easier.  Before if
one did 'w 0 0' in ddb, the longjmp in ddb inside of trap_fatal() would
result in Giant being held (or recursed one level deeper) which led to
problems later on.  You can now drop to teh debugger, do 'w 0 0', and
continue w/o a problem.
2001-08-21 23:15:25 +00:00
John Baldwin
b285782b29 Release the sched_lock before bombing out in mi_switch() via db_error().
This makes things slightly easier if you call a function that calls
mi_switch() as it keeps the locking before and after closer.
2001-08-21 23:10:37 +00:00
John Baldwin
1a5333c37c Allow one to restart from a panic in DDB by clearing the panicstr
variable to NULL.  Note that since panic() is marked with __dead2, this
has somewhat unpredictable results at best.
2001-08-21 22:55:20 +00:00
Nick Hibma
83429be9b0 Find spurious interrupts. 2001-08-21 22:39:04 +00:00
Nick Hibma
e940cef54f Add support for the I-O DATA USB-ET/TX(USB Ethernet adapter)
PR:		27792
2001-08-21 22:20:50 +00:00
Nick Hibma
6e155c1b96 Add support for the HP 4300C scanner.
Submitted by:		Ernst de Haan <ernst@jollem.com>
2001-08-21 22:16:44 +00:00
Peter Wemm
95a6562598 Strip out some #if's for old implementations of global data pointers. 2001-08-21 22:14:13 +00:00
Nick Hibma
b4cf607bde Add quirks for the Olympus Digital Camera.
PR:		26295

Add quirks for the Microtech CameraMate.
2001-08-21 22:13:53 +00:00
Nick Hibma
4817ad7e09 Support for the HP 8200e CD writer. (commented out)
Submitted by:	Heath Nielson <heath@cs.byu.edu>
2001-08-21 22:03:18 +00:00
Nick Hibma
d815b123a2 Add support for the Microtech CameraMate.
Submitted by:		Phil Knaack <pknaack1@netscape.net>
Submitted by:		Jim Bryant <kc5vdj@yahoo.com>
2001-08-21 21:47:08 +00:00
Nick Hibma
924be33dc3 Deconfuse a debugging message. 2001-08-21 21:41:15 +00:00
Nick Hibma
9a9a00ec47 Regen.
National BearPaw 1200 has changed name USB_PRODUCT_NATIONAL_BEARPAW1200.
2001-08-21 21:36:58 +00:00
Nick Hibma
ff3863b777 Add Mustek, National and Ultima scanners.
Submitted by:	Henning Meier-Geinitz <hmg@gmx.de>
PR:		29777
MFC after:	1 week
2001-08-21 21:35:40 +00:00
Warner Losh
c08288b540 Report the interrupt path via the sysctl to userland as a string.
Submitted by: green
2001-08-21 21:31:27 +00:00
Andrey A. Chernov
383f169d4a Make lseek() POSIXed: for non character special files
1) handle off_t overflow with EOVERFLOW
2) handle negative offsets with EINVAL

Reviewed by:	arch discussion
2001-08-21 21:20:42 +00:00
John Baldwin
161778121a Add a hook to mi_switch() to abort via db_error() if we attempt to
perform a context switch from DDB.

Consulting from:	bde
2001-08-21 20:09:05 +00:00
Warner Losh
0f102020db Rearrange how we do interrupt routing tweaking. We now have
hw.pcic.intr_path	{1,2}	1 == ISA, 2 == PCI
	hw.pcic.init_route	Force TI chipset initializations in edge case.
2001-08-21 20:04:42 +00:00
Scott Long
2c325c113c Fresh code drop from the vendor. This fixes some critical bugs and adds
support for a new class of controllers.  Also adjust MAINTAINER at the
approval of msmith.

Obtained from:	mark_salyzyn@adaptec.com
2001-08-21 19:58:16 +00:00
John Baldwin
91a4536f22 - Fix a bug in the previous workaround for the tsleep/endtsleep race.
callout_stop() would fail in two cases:
    1) The timeout was currently executing, and
    2) The timeout had already executed.
  We only needed to work around the race for 1).  We caught some instances
  of 2) via the PS_TIMEOUT flag, however, if endtsleep() fired after the
  process had been woken up but before it had resumed execution,
  PS_TIMEOUT would not be set, but callout_stop() would fail, so we
  would block the process until endtsleep() resumed it.  Except that
  endtsleep() had already run and couldn't resume it.  This adds a new flag
  PS_TIMOFAIL to indicate the case of 2) when PS_TIMEOUT isn't set.
- Implement this race fix for condition variables as well.

Tested by:	sos
2001-08-21 18:42:45 +00:00
Mitsuru IWASAKI
eb5b463449 Fix error checking about device state transition from D0 to D3.
Turn off the resources listed in _PR0 to go to D3 if we don't have _PR3/_PS3.

Reviewed by:	msmith
2001-08-21 18:22:40 +00:00
Warner Losh
df1d57cdb9 It looks like we're doing the wrong thing by catching the setup_intr
request and just calling it when we get a bridge interrupt.  The
problem is that if other code wants to block hardware interrupts for a
little bit with splXXX, those masks aren't updated the way we're doing
it.  This doesn't matter for -current, but does for -stable.

The whole reason that we were catching interrupts was to detect that
the card was still there.  Ian's fixes however ensure that the card
will be there with an interrupt handler, or not there at all.  Since
the pcic interrupt is at a high priority, this should be OK.

This should fix the network related crashes people started seeing in
stable after I merged the pcic as a pci device code.

Submitted indirectly by: Ian Dowse
MFC when: Ian has had a chance to do his torture hang testing.
2001-08-21 18:13:16 +00:00
Ruslan Ermilov
d86293dbea Added TFTP support.
Submitted by:	Joe Clarke <marcus@marcuscom.com>
MFC after:	2 weeks
2001-08-21 16:25:38 +00:00
John Baldwin
c0684ba549 Whitespace style nits. 2001-08-21 15:37:19 +00:00
John Baldwin
a71c43dd2b Protect prototype of ptrace_clear_single_step() with #ifdef _KERNEL/#endif.
Requested by:	bde
2001-08-21 13:42:39 +00:00
John Baldwin
d721b5de59 GC unused prototype of ptrace_write_u().
Forgotten by:	peter
2001-08-21 13:41:46 +00:00
Brian Somers
376958b412 Fix two typos 2001-08-21 13:20:02 +00:00
Søren Schmidt
65d5e55cdd Add support for the newer Promise chips here as well. 2001-08-21 12:23:31 +00:00
Søren Schmidt
468fe0fdf1 Finally commit some of the minor things I've collected over the last month(s):
Add tagged queueing support for new IBM drives.

Add support for Yet Another Promise ATA 100 chip.

Flush disk cache on close.

Dont flush the disk cache on BIO_ORDERED anymore.

Cleanup the tests for DMA on ATAPI devices.

Allow to share ALL irq's even the std irg 14 & 15.

Fix calculation bug in end of media code on CD's.

Add REZERO on opening a CDR/CDRW.

Cleanup ataioctl a bit.
2001-08-21 11:35:47 +00:00
Ruslan Ermilov
04c3e33949 Close the "IRC DCC" security breach reported recently on Bugtraq.
Submitted by:	Makoto MATSUSHITA <matusita@jp.FreeBSD.org>
2001-08-21 11:21:08 +00:00
Boris Popov
fe98760edc Map errdos:67 to the ENOENT.
Obtained from:	Mac OS X
MFC after:		1 week
2001-08-21 09:16:57 +00:00
Boris Popov
e7681448e7 Use local wrappers instead of direct calls to mtx_destroy().
Obtained from:	Mac OS X
MFC after:		1 week
2001-08-21 09:10:23 +00:00
Mike Smith
6d3d1a8100 Remove noisy printfs from the notify handler; having these go off
every couple of seconds is not useful.
2001-08-21 09:06:02 +00:00
Boris Popov
2da5cc6e00 Remove unnecessary "#if __FreeBSD_version". 2001-08-21 08:58:02 +00:00
Boris Popov
798bb23e93 Use proper endian conversion.
Obtained from:	Mac OS X
MFC after:		1 week
2001-08-21 08:27:47 +00:00
Boris Popov
3419dc99dd Return proper length of _PC_NAME_MAX value if long names support is enabled.
Obtained from:	Mac OS X
MFC after:	1 week
2001-08-21 08:25:09 +00:00
Boris Popov
618d5e9216 Use proper endian conversions.
Obtained from:	Mac OS X
MFC after:	1 week
2001-08-21 08:21:03 +00:00
Boris Popov
31201790ba Fix an old off-by-one error causing well known 'wrong bucket' panic.
Submitted by:	Conrad Minshall <conrad@mac.com>
MFC after:	1 week
2001-08-21 08:07:18 +00:00
Warner Losh
0b9427de88 The general conesnsus on irc was that pci bios for config registers
and such was just a bad idea and one that users should be forced to
enable if they want it.  This patch introduces a hw.pci.enable_pcibios
tunable for those people.  This does not impact the pcibios interrupt
routing at all.

Approved by: peter, msmith
2001-08-21 07:53:37 +00:00
George C A Reid
65bb3f0cca Correct the URL to the Hacker's Guide to Voxware.
PR:		29896
Submitted by:	Gerhard Gonter <gonter@whisky.wu-wien.ac.at>
2001-08-21 07:39:47 +00:00
Warner Losh
abd21a2011 These appear to be necessary for a pci cardbus card, but not for laptops.
Ifdef them out until I figure out the right way to configure this.

This solves Nate's hangs as well as Anders Andersson's.

MCF: Soon.
2001-08-21 07:38:13 +00:00
Matthew Dillon
6db5812aef Fix bug in physmem_est calculation - the kernel_map size was not being
converted into pages.

Fix bug in maxbcache calculation, nbuf must be tested against maxbcache
rather then physmem_est.

Obtained from:	bde
2001-08-21 07:20:06 +00:00
Peter Wemm
573be82757 Detect a certain type of PCIBIOS brain damage. For some reason,
some bios vendors took it apon themselves to "censor" the
host->pci bridges from PCIBIOS callers, even when the caller
explicitly asks for them.  This includes certain Compaq machines
(eg: DL360) and some laptops.

If we detect this, shut down pcibios and revert to using IO
port bashing.

Under -current, apcica does a better job anyway.
2001-08-21 03:10:55 +00:00
Peter Wemm
e8ebc08f80 Make COMPAT_43 optional again. XXX we need COMPAT_FBSD3 etc for this
stuff.
2001-08-21 02:32:59 +00:00
Jake Burkholder
f2594a872e Use register g6 to point to a small stack for svaing alternate globals
during trap handlers.
Implement ptrace_set_pc FWIW.
Initialize the pcb window scratch area in setregs(), and setup user
registers as specified by the SCD.

Submitted by:	tmm
2001-08-21 00:07:37 +00:00
Jake Burkholder
0a90a07733 Handle the pcb window scratch area in cpu_fork.
Implement cpu_exit.

Submitted by:	tmm
2001-08-21 00:02:54 +00:00
Jake Burkholder
9e4ffd02dc Save and restore %fprs and %y, which are unused by kernel code, but
may be used by 32bit userland code.
Implement cpu_throw().

Submitted by:	tmm
2001-08-21 00:01:28 +00:00
Jake Burkholder
8d5e3be7a4 Disable interrupts when calling openfirmware. 2001-08-21 00:00:18 +00:00
Jake Burkholder
0839a4e34b Rename fp_init_pcb to fp_init_proc. Set the FEF bit in fprs register;
according the SCD it should be set if no user trap handler in set.

Submitted by:	tmm
2001-08-20 23:56:19 +00:00
Jake Burkholder
1f175fd0ec Add definitions for new assembler code. 2001-08-20 23:53:11 +00:00
Jake Burkholder
78d6df223d Catch up with new trap entry point names. 2001-08-20 23:51:40 +00:00
Jake Burkholder
ef3df3f0fe Add variables needed by hardware watchpoint support.
Submitted by:	tmm
2001-08-20 23:50:48 +00:00
Jake Burkholder
11676d49ba Add code for supporting hardware watch points.
Submitted by:	tmm
2001-08-20 23:50:08 +00:00
Jake Burkholder
bdb71a81f3 Add a system call trap type and syscall() call request handler.
Also add support for hardware watch point traps.

Submitted by:	tmm
2001-08-20 23:43:43 +00:00
Jake Burkholder
e2aceedd5a Add support for splitting the register windows on entry to the
kernel from usermode.  The remaining user windows are spilled
to the pcb as necessary.  The user land window fault handlers
fill directly from the pcb on return.
Add system call entry points.

Submitted by:	tmm
2001-08-20 23:40:31 +00:00
Jake Burkholder
b3ef0bf465 db_expr_t is signed. 2001-08-20 23:35:15 +00:00
Jake Burkholder
076f1c081a Add definitions for bits in condition code register and the load store
unit control registers.  Move tstate definitions to their own file.

Submitted by:	tmm
2001-08-20 23:34:46 +00:00
Jake Burkholder
2b31cfd3a0 Add a definition for the load store unit control register. 2001-08-20 23:31:41 +00:00
Brian Somers
f68e0a68d8 Make the copyright consistent.
Previously approved by:	Charles Mott <cmott@scientech.com>
2001-08-20 22:57:33 +00:00
David E. O'Brien
c9ba45aa7a Sync globals.h up with the other platforms. There is still some cruft in
here, but now all the platforms have the same cruft.  Consistantly spell
the `struct globaldata *' "globalp".

Reviewed by:	peter
2001-08-20 21:29:16 +00:00
Ian Dowse
8774836bf8 Avoid sleeping while holding a mutex in dounmount(). This problem
has existed for a long time, but I made it worse a few months ago
by by adding calls to VFS_ROOT() and checkdirs() in revision 1.179.

Also, remove the LK_REENABLE flag in the lockmgr() call; this flag
has been ignored by the lockmgr code for 4 years. This was the only
remaining mention of it apart from its definition.

Reviewed by:	jhb
2001-08-20 19:16:31 +00:00
Bill Fenner
fd374ac8a7 Fix fencepost error causing creation of 0-length mbufs when the boundary
between header and data fell on the boundary between two mbufs.
2001-08-20 17:58:46 +00:00
Matt Jacob
ed4bea259e Clean up some ways in which we set defaults for SCSI cards
that do not have valid NVRAM. In particular, we were leaving
a retry count set (to retry selection timeouts) when thats
not really what we want. Do some constant string additions
so that LOGDEBUG0 info is useful across all cards.

MFC after:	2 weeks
2001-08-20 17:28:32 +00:00
Matt Jacob
dec1985672 Add MBOX_GET_PCI_PARAMS alias.
MFC after:	2 weeks
2001-08-20 17:26:45 +00:00
Matthew Dillon
e1616f3a7b Conditionalize VM_SWZONE_SIZE_MAX and VM_BCACHE_SIZE_MAX so MD sections
that don't define these constants don't break.
2001-08-20 16:29:13 +00:00
Kris Kennaway
6dac8ac9e5 Mark some functions as __printflike() and/or taking const char * arguments
instead of char *.

MFC after:	2 weeks
2001-08-20 12:53:36 +00:00
Brian Somers
7806546c39 Handle snprintf() returning -1
MFC after: 2 weeks
2001-08-20 12:06:42 +00:00
Ruslan Ermilov
3faf1df3a7 mdoc(7) police: markup nits. 2001-08-20 08:55:07 +00:00
Dima Dorfman
fcd7e67061 Sync the default module search path with the one in
sys/boot/common/module.c.

PR:		21405
Submitted by:	Makoto MATSUSHITA <matusita@jp.FreeBSD.org>
2001-08-20 01:12:28 +00:00
Matthew Dillon
2f9e4e8025 Limit the amount of KVM reserved for the buffer cache and for swap-meta
information.  The default limits only effect machines with > 1GB of ram
and can be overriden with two new kernel conf variables VM_SWZONE_SIZE_MAX
and VM_BCACHE_SIZE_MAX, or with loader variables kern.maxswzone and
kern.maxbcache.  This has the effect of leaving more KVM available for
sizing NMBCLUSTERS and 'maxusers' and should avoid tripups where a sysad
adds memory to a machine and then sees the kernel panic on boot due to
running out of KVM.

Also change the default swap-meta auto-sizing calculation to allocate half
of what it was previously allocating.  The prior defaults were way too high.
Note that we cannot afford to run out of swap-meta structures so we still
stay somewhat conservative here.
2001-08-20 00:41:12 +00:00
Warner Losh
6ac061b532 Improve interlocking for card removal. We now can remove the card in
the ISR.  We keep track of the card state and don't call the IRS when
the card isn't inserted.  This helps quite a bit with card ejection
problems that Ian was seeing.

Submitted by: Ian Dowse
MFC upon: re approvel.
2001-08-19 05:01:18 +00:00
Julian Elischer
aad8d98833 Constify m_copydata.
this allows constants to be copied without giving errors.
(removes a couple of warning messages in the kernel.)

Note: uipc_mbuf.c is a forced commit as it was accidentally included in another commit.

MFC after:	2 weeks
2001-08-19 04:35:28 +00:00
Julian Elischer
a8cfc0ee40 Forgot to remove this un-needed test. (M_WAITOK won't fail)
I vaguely remember someone once proving it COULD return NULL..
was that changed?

Reminded by: BDE

MFC after:	2 weeks
2001-08-19 04:30:13 +00:00
Jake Burkholder
8091b69762 Don't needlessly duplicate what's basically the same copyright. 2001-08-18 19:09:55 +00:00
Jake Burkholder
be30ee31a5 Implement cpu_wait(). 2001-08-18 18:11:48 +00:00
Jake Burkholder
cdc04697be Increase the size of the phys_avail memory map. Implement pmap_dispose_proc.
Turn some more potentially import functions into nops so we can do stuff
until they matter.
2001-08-18 18:11:13 +00:00
Jake Burkholder
f70bfa97c0 Spell ta 1 correctly as ta %xcc, 1. Use %pil for critical enter/exit
instead of pstate.ie.  Note that popc is not implemented in hardware
on certain ultras, so we can't use it for inline ffs (suck).
2001-08-18 18:07:37 +00:00
Jake Burkholder
cae71da765 Gcc 3.0 requires a .register pseudo-op for certain global registers when
used in assembly language.  Tell it to ignore the registers for now.
2001-08-18 18:05:24 +00:00
Julian Elischer
ad4ff09012 fix typo
Submitted by:	Ian Dowse <iedowse@maths.tcd.ie>
2001-08-18 17:43:29 +00:00
Maxim Sobolev
9ee52e44f4 Extend comments documenting various supported audio formats and mixer devices.
Reviewed by:    ru, cg
Approved by:    cg
Obtained from:  4Front's OSS Programming Guide
MFC after:	2 weeks
2001-08-18 15:07:51 +00:00
Mark Peek
29b7fbd17f Unbreak linux compatibility by providing the correct length of the buffer.
Reported by:	"Pierre Y. Dampure" <pierre.dampure@westmarsh.com>,
		"Niels Chr. Bank-Pedersen" <ncbp@bank-pedersen.dk>
Pointy hat to:	mp
2001-08-18 04:24:30 +00:00
Peter Wemm
4faa812afa There is nothing special that requires SSE to be only on 686 class cpus.
This enables 586-only SMP kernels to compile again.

Problem reported by:  Jacek Jedrzejczak <jacol@ids.gda.pl>
2001-08-18 04:04:45 +00:00
Peter Wemm
61a4237001 Sigh. ufs_lookup() calls ffs_snapgone(), meaning that 'options EXT2FS'
without 'options FFS' would fail to link.
2001-08-18 03:08:48 +00:00
Peter Wemm
2c17cf2d54 Only compile the ufs components if FFS || IFS || EXT2FS are present, not
unconditionally.
2001-08-18 02:57:25 +00:00
Julian Elischer
8f364875fe Don't alocate a 400 byte buffer on the stack,
Nor 800 bytes of structures..

MFC after:	2 weeks
2001-08-18 02:53:50 +00:00
John Baldwin
4583298b21 Turn off SMP on Alpha for the time being. There are some memory ordering
issues that can result in panics and probably data corruption on SMP
systems right now.  When they are fixed this can be turned back on.
2001-08-18 01:12:43 +00:00
John Baldwin
027e0eb15d Grab Giant around trapsignal() at the bottom of trap().
Reported by:	obrien
2001-08-18 01:08:45 +00:00
John Baldwin
be08df7290 Remove redundant declarations of functions that are declared in
sys/ptrace.h.
2001-08-18 00:57:32 +00:00
Dima Dorfman
0c1bb4fbf1 Implement a LOCAL_PEERCRED socket option which returns a
`struct xucred` with the credentials of the connected peer.
Obviously this only works (and makes sense) on SOCK_STREAM
sockets.  This works for both the connect(2) and listen(2)
callers.

There is precise documentation of the semantics in unix(4).

Reviewed by:	dwmalone (eyeballed)
2001-08-17 22:01:18 +00:00
Scott Long
33a375b754 Clarify the description string for one of the StrongARM based cards. 2001-08-17 20:59:49 +00:00
David E. O'Brien
7b1e8fbd77 Fix style nits. 2001-08-17 16:54:09 +00:00
Justin T. Gibbs
937b771c8c Restore initialization of ahc->unpause lost in rev 1.76. ahc->unpause
should be initialized to 0 for PCI adapters which was a side-effect of
the memset in ahc_alloc().  EISA/VL adapters require our unpause value to
include the "levelness" of our interrupt.

This change allows EISA adapters to work again.

PR: 29689, 29471
2001-08-17 04:22:50 +00:00
Peter Wemm
0ecd57ad0b Fix part of another problem that bde pointed out. This is different
to what bde suggested though.
2001-08-16 23:43:24 +00:00
Peter Wemm
5a66a2532b Remove redundant null-termination. The buffer is already explicitly
zeroed, and we intentionally leave -1 on the strncpy length to leave
the original \0.

Submitted by: bde
2001-08-16 20:18:43 +00:00
Peter Wemm
a75a0c55f4 Don't explicitly null-terminate. The buffer we are copying into is
already zeroed, and we explicitly leave the last byte untouched.

Submitted by: bde
2001-08-16 20:16:20 +00:00
Bill Paul
d3ab0d02cf After one more day of testing, make what I hope are the final tweaks to
prevent/workaround TX lockups in this driver. The secret seems to be to
not let the TX DMA queue become too full. If we have too many packets
in the queue, we should wait for them to drain a bit before trying to
queue more. This should prevent the lockup from occurring, and if it
does occur, there is special code in sf_start() to kick the NIC in the
head and get it going again.

Special thanks to Glen Neff for helping me test this fix.
2001-08-16 20:15:16 +00:00
David E. O'Brien
e113a479b2 Prototype the ptrace_*() 2001-08-16 19:57:36 +00:00
Matt Jacob
169ad8cfef oops- typo in a previous commit 2001-08-16 17:39:45 +00:00
Matt Jacob
561e7bb942 Fix a spelling error in a comment. 2001-08-16 17:31:27 +00:00
Warner Losh
1865c617e4 Fix the so-called "half-baked-probe" code that I wrote a long time ago
to properly clear the interrupt register on the no error case.  Also,
set the mcr register to zero when we find we can't support the chip.

This fixes the hang on sio driver attach problem in the new pci pccard
code that some people have reported.  At least on my machine.  I'd
like to get this into 4.4.

Submitted by: bde
PR: kern/29742

MFC after: 1 day
2001-08-16 17:30:55 +00:00
Matt Jacob
dda035d1fc Add more MBOX and ASYNC event defines.
MFC after:	2 weeks
2001-08-16 17:26:03 +00:00
Matt Jacob
be534d5f1a Thanks to PHK for spotting: ISPASYNC_UNHANDLED_RESPONSE not
handle in isp_async.
2001-08-16 17:25:41 +00:00
Matt Jacob
50719f7521 Enable LIP F8, LIP Reset async events.
Be more chatty about SNS failures. Fix
typo for skipped phase mesage. Correct
MBOX_GET_PORT_QUEUE_PARAMS options in
table.

MFC after:	2 weeks
2001-08-16 17:25:08 +00:00
Julian Elischer
6221ffb389 Fix typo
Submitted by:	 BDE
MFC after:	2 weeks
2001-08-16 17:17:54 +00:00
Julian Elischer
50624012be Only allocate teh 1540 byte buffer if we need it..
(lazy allocation)

MFC after:	13 days
2001-08-16 17:16:31 +00:00
Mark Peek
911c2be00b Reduce stack allocation (stack-fast?).
elf_load_file()   =>  352 to 52 bytes
    exec_elf_imgact() => 1072 to 48 bytes
    elf_corehdr()     =>  396 to  8 bytes

Reviewed by:	julian
2001-08-16 16:14:26 +00:00
David E. O'Brien
9428157dbd Fix a dangling { 2001-08-16 10:32:42 +00:00
David E. O'Brien
a6b989ffbf Minor style(9)'ing 2001-08-16 10:13:34 +00:00
David E. O'Brien
589278dbae style(9) and make consistent across platforms 2001-08-16 09:29:35 +00:00
Peter Wemm
77330eeba7 Use the backwards compatability mechanisms so that ps/top etc dont have
unnecessary breakage.

While here, use explicit sizes for the string fields so that we dont
have unintentional changes again in the future when key tunables change.

This still is not quite right, but a june userland is happy with
a -current kernel with these tweaks.
2001-08-16 08:41:15 +00:00
Peter Wemm
6eef6816a8 Use explicit sizes for the prpsinfo command length string so that
we dont have any more unexpected changes in core dumps.  This gets us
back to the original core dump layout from a few days ago.
2001-08-16 08:35:51 +00:00
Dima Dorfman
e692c40ce1 Don't allocate a 512 byte buffer on the stack in snplwrite. It's
probably harmless in this case, since the latter is called on tty
input, which is usually a result of some system call, so we've got
plenty of stack left.  It's still nice to fix these things, though, in
case somebody ever decides this driver is a good example of something
(perhaps "what you probably shouldn't do").
2001-08-16 06:00:57 +00:00
Dima Dorfman
e0cebb4027 There is no MD_OBJET disk type, it's actually MD_SWAP. I guess the
former was either a previous or proposed name that kind of snuck in.
2001-08-16 03:04:49 +00:00
Bill Paul
fa97ab323c Still more changes to try to prevent TX lockups. Will wait for one more
night of testing before merging to -stable.

Also added to code to detect TX underruns and automatically increase the
TX threshold to avoid them. Carefully placed diagnostig printf() about
this under #ifdef DIAGNOSTIC to avoid getting any panicky e-mails from
confused users, like I always do with the xl and dc drivers.
2001-08-16 00:32:20 +00:00
Julian Elischer
51b5ed79de Don't allocate an entire 1500 byte buffer on the stack.
May need more review in light of SMP.

MFC after:	2 weeks
2001-08-15 23:59:00 +00:00
Andrey A. Chernov
2a54e09dff OFF_T -> OFF (more standard style) 2001-08-15 19:50:59 +00:00
John Baldwin
d89c83bef1 The 'astpending' variable is already declared in trap.c (and unused in
FreeBSD besides).
2001-08-15 19:39:54 +00:00
John Baldwin
bf3db3eacb FreeBSD doesn't use a want_resched variable. Instead, the PS_NEEDRESCHED
p_sflag is managed in a MI fashion.
2001-08-15 19:39:09 +00:00
Andrey A. Chernov
a6314641a4 Add OFF_T_MAX/OFF_T_MIN 2001-08-15 19:25:08 +00:00
Andrey A. Chernov
527b997c3d Add OFF_T_MAX/OFF_T_MIN 2001-08-15 19:12:46 +00:00
Bill Paul
0a4b345e9f Tweak the interrupt handler so that we call the txeof handler more often,
to hopefully prevent the TX DMA queue from filling up and never getting
flushed.
2001-08-15 17:46:57 +00:00
Bill Paul
0219a42155 Convert the if_sis and if_rl drivers to use the bus_dma API instead of
calling vtophys() and contigmalloc()/contigfree() directly. Hopefully,
I have shaken out all of the problems with busdma on the alpha now.
(Everything seems to work as expected.)

Also, change the max RX DMA limit to 1024 bytes instead of "unlimited,"
as the latter seems not to work correctly on the alpha that I tested.
(At 100Mbps, all attempts to receive frames yield RX errors.)
2001-08-15 17:38:43 +00:00
Bill Paul
3708f8da9c Teach bus_dmamem_free() about contigfree(). This is a bit of a hack,
but it's better than the buggy behavior we have now. If we contigmalloc()
buffers in bus_dmamem_alloc(), then we must configfree() them in
bus_dmamem_free(). Trying to free() them is wrong, and will cause
a panic (at least, it does on the alpha.)

I tripped over this when trying to kldunload my busdma-ified if_rl
driver.
2001-08-15 17:26:54 +00:00
Matt Jacob
cf1bca84b6 Old business: some SMP support. 2001-08-15 17:23:22 +00:00
Matt Jacob
c70f4417dc Old business: be able to disable processor configuration from resource. 2001-08-15 17:03:13 +00:00
John Baldwin
2be7b27a41 Whitespace fixes to make this mostly fit in 80 columns. 2001-08-15 16:57:12 +00:00
Bruce Evans
a572c95c3b Don't dump on the label sector or below. This avoids clobbering the
label if the dump device overflaps the label (which is a slight
misconfiguration).  Dump routines don't use dscheck(), so the normal
write protection of the label doesn't help.

Reduced some nearby overflow bugs.  In disk_dumpcheck(), there was
(fatal but fail-safe) overflow on i386's with 4GB of memory, at least
if Maxmem was the top page (can this happen?).  The fix assumes that
the sector size divides PAGE_SIZE (dump routines already assume this).
In setdumpdev(), the corresponding overflow occurred with only about
2GB of memory on all machines with 32-bit ints.  This allowed setdumpdev()
to succeed when it shouldn't have, but then disk_dumpcheck() failed
safe later.  Except in old versions of FreeBSD like RELENG_3 where
there is no disk_dumpcheck().

PR:		28164 (label clobbering part)
MFC after:	1 week
2001-08-15 11:35:45 +00:00
Warner Losh
cce0210e49 There is no tcic driver, so no need to list it here. 2001-08-15 05:39:58 +00:00
David E. O'Brien
059d1e91d8 Style changes to commonize the various platforms. 2001-08-15 04:02:41 +00:00
David E. O'Brien
7a92dc6167 Sync up with the latest ansi.h in other platforms -- especially RUNE and
wchar bits.
2001-08-15 03:55:37 +00:00
David E. O'Brien
680169040b No tokens should follow #endif. 2001-08-15 03:38:49 +00:00
Peter Wemm
dd84e9658b In order to bring about the end of the universe, delete the lines:
# DO NOT DELETE THIS LINE -- make depend uses it
2001-08-15 00:33:55 +00:00
Warner Losh
dc2e861bdb Merge from stable (which seems to have been spammed at some point in current):
#ifdef the deltap pcic_set_memory_offset argument so that raylink
driver works.
2001-08-14 23:34:09 +00:00
Warner Losh
a547ba9cce Implement PIOCSRESOURCE for mecia like we do for pcic. 2001-08-14 23:24:56 +00:00
Warner Losh
cc3a07dbb3 Minor style(9) nits to make code more readable 2001-08-14 23:16:01 +00:00
Jason Evans
54db32e945 Implement kernel semaphores.
Reviewed by:	jhb
2001-08-14 22:13:14 +00:00
Bill Paul
ee755665c2 Fix yet another "unconditionally free()ing memory without even checking
to see if it was malloc()ed first" bug. In bus_dmamap_create(), one of
two things can happen: either we need to allocate a special map due to
some manner of bounce buffering requirement, or we can DMA a buffer
in place. On the x86 platform, the "in place" case results in
bus_dmamap_create() returning a dmamap of NULL. The bus_dmamap_destroy()
routine later checks for NULL and won't bother free()ing the map if
it detects this condition.

But on the alpha, we don't use NULL, we use a statically allocated map
called nobounce_dmamap(). Unfortunately, bus_dmamap_destroy() does not
handle the condition where we attempt to destroy such a map: it tries
to free() the dmamap, which causes a panic.

Fix: test that map != &nobounce_dmamap before trying to free() it.

With this fix, my busdma-ified if_sis driver works on the alpha. I'm
a bit alarmed that I'm the first person ever to trip over this bug, since
we have been using busdma on the alpha for a while, and since it sort
of screams out "Hi! I'm a bug! Booga-booga!" when you look at it.

(Somewhere, somebody will say: "But Bill, why don't you just not bother
destroying the maps in this case." Because the API is supposed to be
a) symetrical and b) opaque to the caller. I can't know whether it's safe
to skip the bus_dmamap_destroy() step or not without sticking my fingers
into unsafe places, which is what I wanted to avoid in the first place.)
2001-08-14 21:56:53 +00:00
Warner Losh
482a667634 Treat min,max of 0,0 for IRQ special. Reject it if we didn't specifically
assing an IRQ.  Add better comments while I'm here.

MFC after: 1 day
# Note: That's merging all the -current pci pcic code, not just this one
# change for the Aug 15th code freeze.
2001-08-14 19:23:12 +00:00
Warner Losh
e423aa38ba For TI12xx and newer, clear register 0x84. This is the "Multimedia"
register.  It enables Zoom Video.  It appears that on at least one
card that Monzoon is using sets these bits by default.  Nothing works
when these bits are set, everything works when they are clear.

Add commentary on some of the ti bits.  Make code a little clearer.
Also remove a call to pcic_pci_pd6729 which was prematurely added in
the last commit.
2001-08-14 07:31:47 +00:00
Poul-Henning Kamp
12d1aec26f linux ls fails on DEVFS /dev because linux_getdents fails because
linux_getdents uses VOP_READDIR( ..., &ncookies, &cookies ) instead of
     VOP_READDIR( ..., NULL, NULL ) because it seems to need the offsets for
     linux_dirent and sizeof(dirent) != sizeof(linux_dirent)...

PR:	29467
Submitted by:	Michael Reifenberger <root@nihil.plaut.de>
Reviewed by:	phk
2001-08-14 06:42:32 +00:00
Warner Losh
82c38f3a43 Try to support the Cirrus Logic PD6833 better in pci mode. This is
done from the datasheets since I'm ahving problems with my laptop that
has the 6833 in it...

Minor rework of TI code.  Should be the same as before.
2001-08-14 05:31:56 +00:00
Jake Burkholder
c64e8a395b Add a GENERIC kernel config for sparc64. 2001-08-14 03:27:02 +00:00
Jake Burkholder
05ae93afbf Add some definitions that got left out, *blush*. 2001-08-14 03:10:41 +00:00
Jake Burkholder
39f004ea89 Don't define ELF_RTLD_ADDR twice. 2001-08-14 03:09:19 +00:00
John Baldwin
4f99f11257 In prom_halt(), set the halt restart flags on the current CPU, not the
boot CPU.  This was the reason reboots on SMP systems could result in
weird hangs.  Unlike the x86, we do not need to switch back to the boot
CPU in order to reboot the machine.  See Section 3.4.5 of Part III
(Console Interface Architecture) from the Alpha Architecture Reference
Manual (aka the Brown Book) for more info.
2001-08-13 22:44:55 +00:00
John Baldwin
6937ca29dc Remove IPI_HALT to make way for a more correct fix for halts and restarts
on SMP alphas.
2001-08-13 22:41:15 +00:00
John Baldwin
1c94cee872 Minor style nits: cleanup and add some function prototypes. 2001-08-13 22:38:36 +00:00
Jason Evans
d55229b72e Add sx_try_upgrade() and sx_downgrade().
Submitted by:	Alexander Kabaev <ak03@gte.com>
2001-08-13 21:25:30 +00:00
Semen Ustimenko
395a636fb2 Fix an bug in FreeBSD attach routine - attaching MII interfaces before doing
common_attach is wrong as common attach initialize some fileds used by
mediainit routine. This was hard to notify because loading driver as kld
lead to mediainit routine being called after common_attach, though probe_phy
is called before.

MFC after:	1 week
2001-08-13 18:37:31 +00:00
Semen Ustimenko
2c9067b16f Add support for 802.1Q VLAN and oversized ethernet frames.
PR:		kern/29235
Submitted by:	Peter Jeremy <peter.jeremy@alcatel.com.au>
Reviewed by:	Yar Tikhiy <yar@FreeBSD.org>
MFC after:	1 week
2001-08-13 18:32:39 +00:00
Ruslan Ermilov
c5e7e03a14 Spell "FreeBSD" with "F" and "BSD" in uppercase. 2001-08-13 16:33:00 +00:00
Bruce Evans
3d66f80905 Use interrupt gates instead of trap gates for breakpoint and trace
traps, so that ddb can keep control (almost) no matter how it is
entered.  This breaks time-critical interrupts while the system is
stopped in ddb, but I haven't noticed any significant problems except
that applications become confused about the time.  Lost time will be
adjusted for later.  Anyway, the half-baked disabling of interrupts in
Debugger() gives the same problems for the usual way of entering ddb.
2001-08-13 13:22:50 +00:00
Bruce Evans
d072acf902 Removed he BPTTRAP() macro and its use. It was intended for restoring
bug for bug compatibility to ddb trap handlers after fixing the debugger
trap gates to be interrupt gates, but the fix was never committed.  Now
I want the fix to apply to ddb.
2001-08-13 12:42:13 +00:00
Bruce Evans
807ef07ea1 Fixed minor numbers when there is more than one cy card.
PR:		19256
Submitted by:	initial version by yokota
MFC after:	1 week
2001-08-13 10:52:15 +00:00
Bruce Evans
0ce18d0354 Use ttymalloc() instead of a static array of `struct tty'. This will
be a regression until `pstat -t' actually understands the results of
ttymalloc().

Submitted by:	mostly by yokota
2001-08-13 07:00:21 +00:00
Mitsuru IWASAKI
dfc356335a Fix some trivial bugs.
- fix segment limit mis-calculation for GCODE_SEL, GDATA_SEL, GPRIV_SEL,
   LUCODE_SEL and LUDATA_SEL.
 - move `loader(8) metadata' related printf() after cninit().
 - use atop macro (address to pages) for segment limit calculation
   instead of i386_btop macro (bytes to pages).
 - fix style bugs for the declarations of ints.

Reviewed by:    bde, msmith (and arch & audit ML)
2001-08-12 08:37:39 +00:00
Mark Peek
53ab587043 Remove unused nmdmpoll function.
Approved by:	julian
2001-08-11 00:18:15 +00:00
John Baldwin
3f085c228e If we've panic'd already, then just bail in lockmgr rather than blocking or
possibly panic'ing again.
2001-08-10 23:29:15 +00:00
Julian Elischer
2b6a0c4fcd Make the protoswitch definitiosn checkable in the same way that
cdevsw entries have been for a long time.
Discover that we now have two version sof the same structure.
I will shoot one of them shortly when I figure out why someone thinks
they need it. (And I can prove they don't)
(netinet/ipprotosw.h should GO AWAY)
2001-08-10 23:17:22 +00:00
Bill Paul
c214e6636e Fix some of the GDB linkage setup. The l_name member of the gdb linkage
structure is always free()ed yet only sometimes malloc()ed. In particular,
it was simply set to point to l_filename from the a linker_file_t in
link_elf_link_preload_finish(). The l_filename had been malloc()ed inside
the kern_linker.c module and was being free()ed twice: once by
link_elf_unload_file() and again by linker_file_unload(), leading to
a panic.

How to duplicate the problem:

- Pre-load a kernel module from the loader, i.e. if_sis.ko
- Boot system
- Attempt to unload module with kldunload if_sis
- Bewm

The problem here is that the case where the module was loaded with kldload
after system boot would work correctly, so this bug went unnoticed until
I stubbed my toe on it just now. (Also, you can only trip this bug if
you compile a kernel with options DDB, but that's the default now.)

Fix: remember to malloc() a separate copy of the module name for the
l_name member of the gdb linkage structure in three places where the
linkage structure can be initialized.
2001-08-10 23:15:13 +00:00
John Baldwin
0f345c4054 Add an optimization where we check hte PS_ASTPENDING and PS_NEEDRESCHED
flags with interrupts disabled to see if we should call ast() during
doreti.  This was mostly submitted by Bruce, but his original patch did
the looping in ast() in assembly rather than in the ast() function itself.
Once we've actually called into the ast() function, it's cheaper to just
loop inside the function rather than returning from the function,
performing the check, and then calling the function again.  However, we
can optimize the first check to avoid calling the function at all.
Other architectures may choose to implement this optimization if they
wish but it is not required for correct operation.

Submitted by:	bde
2001-08-10 23:00:07 +00:00
John Baldwin
688ebe120c - Close races with signals and other AST's being triggered while we are in
the process of exiting the kernel.  The ast() function now loops as long
  as the PS_ASTPENDING or PS_NEEDRESCHED flags are set.  It returns with
  preemption disabled so that any further AST's that arrive via an
  interrupt will be delayed until the low-level MD code returns to user
  mode.
- Use u_int's to store the tick counts for profiling purposes so that we
  do not need sched_lock just to read p_sticks.  This also closes a
  problem where the call to addupc_task() could screw up the arithmetic
  due to non-atomic reads of p_sticks.
- Axe need_proftick(), aston(), astoff(), astpending(), need_resched(),
  clear_resched(), and resched_wanted() in favor of direct bit operations
  on p_sflag.
- Fix up locking with sched_lock some.  In addupc_intr(), use sched_lock
  to ensure pr_addr and pr_ticks are updated atomically with setting
  PS_OWEUPC.  In ast() we clear pr_ticks atomically with clearing
  PS_OWEUPC.  We also do not grab the lock just to test a flag.
- Simplify the handling of Giant in ast() slightly.

Reviewed by:	bde (mostly)
2001-08-10 22:53:32 +00:00
John Baldwin
827dcaf663 Make witness compile w/o DDB.
Reported by:	wpaul
2001-08-10 22:33:59 +00:00
David E. O'Brien
9fd2cfcc2f Style cleanup. 2001-08-10 22:31:05 +00:00