Commit Graph

27387 Commits

Author SHA1 Message Date
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
Ian Dowse
a9a8ba3d71 Arbitrarily limit to 64k the number of bytes that can be read at
a time using the ogetdirentries() compatibility syscall. This is a
hack to ensure that rediculous values don't get passed to MALLOC().

Reviewed by:	kris
2001-08-10 22:14:18 +00:00
John Baldwin
8791b43513 Work around a race between msleep() and endtsleep() where it was possible
for endtsleep() to be executing when msleep() resumed, for endtsleep()
to spin on sched_lock long enough for the other process to loop on
msleep() and sleep again resulting in endtsleep() waking up the "wrong"
msleep.

Obtained from:	BSD/OS
2001-08-10 21:08:56 +00:00
John Baldwin
a45982d2ea Change callout_stop() to return an integer. If callout_stop() succeeds in
removing the callout entry, return 1.  If callout_stop() fails to remove
the callout entry because it is currently executing or has already been
executed, then the function returns 0.  The idea was obtained from BSD/OS,
however, BSD/OS changed untimeout(), and I've just changed callout_stop()
to be more conservative.

Obtained from:	BSD/OS
2001-08-10 21:06:59 +00:00
John Baldwin
4d33620270 Style nit: covert a couple of if (p_wchan) tests to if (p_wchan != NULL). 2001-08-10 20:56:25 +00:00
Ruslan Ermilov
94ba280c59 mdoc(7) police: join split punctuation to macro calls. 2001-08-10 17:35:21 +00:00
Julian Elischer
d05a918fc3 Do NOT allocate a 1K buffer on the kernel stack.
Found by: Smashed u-area and hardware watch points.
MFC after: 1 week
2001-08-10 17:32:11 +00:00
Kazutaka YOKOTA
3863b6db4c Fix missing splx(). 2001-08-10 14:26:48 +00:00
Poul-Henning Kamp
4446bcb757 Eliminate the hot-spare 'r' in Arrray.
Submitted by:	Søren Schrøder <sch@chaos.dk>
2001-08-10 11:47:08 +00:00
Julian Elischer
3b82ede012 DO NOT ALLOCATE 2+K OBJECTS ON THE KERNEL STACK!!!!
found by: Getting my u-area overwritten
2001-08-10 07:50:14 +00:00
John Baldwin
02cd7c3cf2 - Remove asleep(), await(), and M_ASLEEP.
- Callers of asleep() and await() have been converted to calling tsleep().
  The only caller outside of M_ASLEEP was the ata driver, which called both
  asleep() and await() with spl-raised, so there was no need for the
  asleep() and await() pair.  M_ASLEEP was unused.

Reviewed by:	jasone, peter
2001-08-10 06:56:12 +00:00
John Baldwin
c4a448100c - Remove asleep(), await(), and M_ASLEEP.
- Callers of asleep() and await() have been converted to calling tsleep().
  The only caller outside of M_ASLEEP was the ata driver, which called both
  asleep() and await() with spl-raised, so there was no need for the
  asleep() and await() pair.  M_ASLEEP was unused.

Reviewed by:	jasone, peter
2001-08-10 06:45:43 +00:00
John Baldwin
8ec48c6dbf - Remove asleep(), await(), and M_ASLEEP.
- Callers of asleep() and await() have been converted to calling tsleep().
  The only caller outside of M_ASLEEP was the ata driver, which called both
  asleep() and await() with spl-raised, so there was no need for the
  asleep() and await() pair.  M_ASLEEP was unused.

Reviewed by:	jasone, peter
2001-08-10 06:37:05 +00:00
Warner Losh
043b27b450 Move ISA interrupt ISR and timeout routines to pcic from pcic_isa so
that we can use them in the pci code when we have to fall back to ISA
interrupt routing.
2001-08-10 06:07:20 +00:00
Warner Losh
e4db871961 Type sanity: use uintptr_t * for read_ivar and u_int8_t instead of u_char 2001-08-10 06:00:44 +00:00
Warner Losh
f470b3bb56 Rearrange the pcic_irq_type enum (and specifically tag the first one
as being 1) in anticipation of documentation.
2001-08-10 05:42:08 +00:00
John Baldwin
c37c2d03b8 Bump MAXCOMLEN from 16 to 19 to take advantage of 32-bit alignment.
Approved by:	peter, jasone
2001-08-10 05:34:48 +00:00
Jake Burkholder
f02f55a8e3 Correct copyright language. 2001-08-10 04:51:19 +00:00
Jake Burkholder
416d9c00fa Add code to program the tick register and to setup its interrupt handler. 2001-08-10 04:49:33 +00:00
Jake Burkholder
228fa56391 Add early code to support interrupts. 2001-08-10 04:48:48 +00:00
Jake Burkholder
f69f6debc3 Fake up the frame pointers on a process's initial stack so they can be
restored correctly from the trapframe.

Submitted by:	tmm
2001-08-10 04:47:14 +00:00
Jake Burkholder
22693a0fef Handle all types of mmu misses from user mode.
Pass a context argument to tlb functions.
2001-08-10 04:44:33 +00:00
Jake Burkholder
a3698a6d7f Use the macro for getting the trap type from the trapframe.
Only set sticks (and acquire sched_lock) on entry from user mode.
Add handlers for all kinds of mmu misses, and for interrupts from
user mode.
Acquire Giant before calling into the vm system so this runs with
invariants.
Try to get the restrictions for page faults on user memory from
kernel mode right.
Only set pcb_onfault and return to the alternate return code if
this is actually a fault on user memory from kernel mode.
2001-08-10 04:43:31 +00:00
Jake Burkholder
c0eedfbccb Store 8 bytes instead of 4 in suword. Use a temporary stack that's known
to be locked in the tlb for calling openfirmware.

Submitted by:	tmm
2001-08-10 04:39:23 +00:00
Jake Burkholder
e822e0eefb Pass a context to tlb_store_slot, use a member(Sync) after setting the
secondary context register.
2001-08-10 04:37:03 +00:00
Jake Burkholder
9a6cacf3dd 1. Start the clock running early for testing.
2. Use the upcoming "tick" interface.
3. Save a call frame as well as a trap frame on proc0's initial stack.
4. Setup a pointer to the per-cpu interrupt queue.
5. Install the per-cpu pointer in interrupt and alternate globals as well.
6. Flush out setregs so exec works.

Submitted by:	tmm (3, 5, 6)
2001-08-10 04:36:00 +00:00
Jake Burkholder
346d41dd6f Set the pil to something sane on startup. 2001-08-10 04:32:13 +00:00
Jake Burkholder
4a7517d17f Add definitions needed by new assembler code. 2001-08-10 04:31:30 +00:00
Jake Burkholder
cc11501e3b 1. Add code to handle traps and interrupts from user mode.
2. Add spill and fill handlers for spills to the user stack on entry
   to the kernel.
3. Add code to handle instruction mmu misses from user mode.
4. Add code to handle level interrupts from kernel mode and vectored
   interrupt traps from either.
5. Save the pil in the trapframe on entry from kernel mode and restore
   it on return.

Submitted by:	tmm (1, 2)
2001-08-10 04:30:36 +00:00
Jake Burkholder
8dec6a681e Add code to handle stack traces that go all the way back to userland.
Use a better algorithm for finding out if an address is in the kernel.

Submitted by:	tmm
2001-08-10 04:23:41 +00:00
Jake Burkholder
8a7de3c054 Add trap types for interrupts. Ad definitions to get the interrupt level
from the trap type.
2001-08-10 04:22:24 +00:00
Jake Burkholder
fa01c0ff70 1. Add code to demap pages from the tlb for user contexts.
2. Add a context argument to most functions, instead of extracting it from
   from the tte.

Submitted by:	tmm (1).
2001-08-10 04:21:44 +00:00
Jake Burkholder
0cb2d36969 Add fields that point to per-cpu interrupt data. 2001-08-10 04:18:48 +00:00
Jake Burkholder
db6c479810 Add a field to trapframe for saving the pil. 2001-08-10 04:18:13 +00:00
Jake Burkholder
c13c9cbf4f Add asis for interrupt registers. 2001-08-10 04:17:29 +00:00
John Baldwin
ab32297d8d Axe spl's obsoleted by the callout mutex. 2001-08-10 01:36:25 +00:00
Hidetoshi Shimokawa
23cd8d58ac Fix unaligned access (fault) on alpha with ndp -p/-r and sysctl -a.
Discussed on users@jp.ipv6.org

MFC candidate.
2001-08-10 00:34:20 +00:00
Mark Peek
7684ab55c6 Allow for text section alignment to properly align the "end" symbol at the
actual end of the section. The new gas (binutils) puts in additional padding
which was misaligning the concatenated btx loader.

Reported by:	Oliver Hartmann <ohartman@klima.physik.uni-mainz.de>,
		Harti Brandt <brandt@fokus.gmd.de>
Tested by:	Oliver Hartmann <ohartman@klima.physik.uni-mainz.de>,
		David Wolfskill <dhw@whistle.com>, ps
Reviewed by:	jhb
MFC after:	1 day
2001-08-09 20:47:58 +00:00
John Baldwin
8b42d7fc11 Trim trailing whitespace. 2001-08-09 18:07:45 +00:00
David E. O'Brien
688985be2b The author isn't a [UC] Regents. Correct the copyright language. 2001-08-09 02:32:05 +00:00
David E. O'Brien
b2d4cd8f6e Fix VCS ID spamage. 2001-08-09 02:29:32 +00:00
David E. O'Brien
d410360643 Restore the proper copyright on this and remove the gratuitous changes from
sys/alpha/include/elf.h.
2001-08-09 02:24:05 +00:00
David E. O'Brien
73a4930297 The author isn't a [UC] Regents. Correct the copyright language. 2001-08-09 02:09:34 +00:00
Peter Wemm
99ab2d5dca *** empty log message *** 2001-08-09 01:21:58 +00:00
Peter Wemm
3de6da9cc9 Build modules from the main src/sys tree.
Tidy up some loose ends.. there were extra -I's being added to CFLAGS for
no reason.
2001-08-09 00:13:30 +00:00
Peter Wemm
74a40576eb Add the screen savers for test coverage. 2001-08-09 00:05:30 +00:00
Peter Wemm
20d6258def repo-copy the source files from modules/syscons to the normal tree
and connect them to the normal build infrastructure.
2001-08-09 00:02:30 +00:00
Peter Wemm
8e5003b0ea Add the Rio 800 USB device IDs
Submitted by: Wesley Morgan <morganw@chemikals.org>
2001-08-08 23:04:31 +00:00
Brian Feldman
46877fb22c In the KLD "load" make target, don't load using the "absolute" path of
"./foo.ko".  Use "/full/path/foo.ko" instead so that when the path is
reported as being an absolute path to the "shared library", at least
it's not really a relative path.

Obtained from:	LOMAC/FreeBSD project
2001-08-08 13:51:10 +00:00
Peter Wemm
2aca0c28d3 Zap 'ptrace(PT_READ_U, ...)' and 'ptrace(PT_WRITE_U, ...)' since they
are a really nasty interface that should have been killed long ago
when 'ptrace(PT_[SG]ETREGS' etc came along.  The entity that they
operate on (struct user) will not be around much longer since it
is part-per-process and part-per-thread in a post-KSE world.

gdb does not actually use this except for the obscure 'info udot'
command which does a hexdump of as much of the child's 'struct user'
as it can get.  It carries its own #defines so it doesn't break
compiles.
2001-08-08 05:25:15 +00:00
Peter Wemm
44c76a36f8 We do not have UPAGES following the tail end of the user VM space anymore. 2001-08-08 04:02:22 +00:00
Dima Dorfman
26a0ee75c6 Introduce a force option, MD_FORCE, that instructs the driver to
bypass some extra anti-foot-shooting measures.  Currently, its only
effect is to allow detaching a device while it's still open (e.g.,
mounted).  This is useful for testing how the system reacts to a disk
suddenly going away, which can happen with some removeable media.

At this point, the force option is only checked on detach, so it
would've been possible to allow the option to be passed with the
MDIOCDETACH operation.  This was not done to allow the possibility of
having the force flag influence other tests in the future, which may
not necessarily deal with detaching the device.

Reviewed by:	sobomax
Approved by:	phk
2001-08-07 19:23:16 +00:00
John Baldwin
5ebe32c611 Grab Giant arond page faults. ia64 boots again in the simulator now. 2001-08-07 17:31:42 +00:00
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