Commit Graph

1992 Commits

Author SHA1 Message Date
Alan Cox
eaf183a844 pmap_object_init_pt:
Verify that object != NULL.
1999-07-31 23:02:57 +00:00
Alan Cox
5d2aec8927 Change the type of vpgqueues::lcnt from "int *" to "int". The indirection
served no purpose.
1999-07-31 18:31:00 +00:00
Alan Cox
086d0ae1dc Add parentheses for clarity.
Submitted by:	dillon
1999-07-31 04:10:31 +00:00
Mike Smith
3cc31bc262 Formatting-only cleanup accidentally omitted from the patch merge in the
previous major update.  Bring new code into style alignment with the
existing code.  No functional changes.
1999-07-29 18:47:39 +00:00
Peter Wemm
32610e173d GBIOSSTACK_SEL is undefined, but OTOH, BSSSEL apparently isn't used either. 1999-07-29 08:33:00 +00:00
Mike Smith
64ecbc4d0b Remove some duplicate definitions, as suggested by Alan Cox. 1999-07-29 07:10:35 +00:00
Mike Smith
27e901101c Fix for vmspace sharing as per Alan Cox. Thanks! 1999-07-29 06:48:26 +00:00
Mike Smith
496027bf08 Major update to the kernel's BIOS-calling ability.
- Add support for calling 32-bit code in other segments
 - Add support for calling 16-bit protected mode code

Update APM to use this facility.

Submitted by:	jlemon
1999-07-29 01:49:19 +00:00
Brian Feldman
8799702cbc Remove XXX from the headers (broke the build, I'm betting.) 1999-07-29 01:20:47 +00:00
Matthew N. Dodd
15317dd875 Alter the behavior of sys/kern/subr_bus.c:device_print_child()
- device_print_child() either lets the BUS_PRINT_CHILD
	  method produce the entire device announcement message or
	  it prints "foo0: not found\n"

Alter sys/kern/subr_bus.c:bus_generic_print_child() to take on
the previous behavior of device_print_child() (printing the
"foo0: <FooDevice 1.1>" bit of the announce message.)

Provide bus_print_child_header() and bus_print_child_footer()
to actually print the output for bus_generic_print_child().
These functions should be used whenever possible (unless you can
just use bus_generic_print_child())

The BUS_PRINT_CHILD method now returns int instead of void.

Modify everything else that defines or uses a BUS_PRINT_CHILD
method to comply with the above changes.

	- Devices are 'on' a bus, not 'at' it.
	- If a custom BUS_PRINT_CHILD method does the same thing
	  as bus_generic_print_child(), use bus_generic_print_child()
	- Use device_get_nameunit() instead of both
	  device_get_name() and device_get_unit()
	- All BUS_PRINT_CHILD methods return the number of
	  characters output.

Reviewed by: dfr, peter
1999-07-29 01:03:04 +00:00
Mike Smith
e33bfde398 We're called too early to have any idea whether APM is going to be
active or not.  The only sane thing we can do here is assume that if
APM is supported it might be active at some point, and bail.

In reality, even this isn't good enough; regardless of whether we support
APM or not, the system may well futz with the CPU's clock speed and throw
the TSC off.  We need to stop using it for timekeeping except under
controlled circumstances.  Curse the lack of a dependable high-resolution
timer.
1999-07-28 20:22:30 +00:00
Mike Smith
dce593b01e Remove some droppings left over from the removal of the APM hooks. 1999-07-28 19:34:16 +00:00
Doug Rabson
aa595accc9 Add support for SYS_RES_DENSE and SYS_RES_BWX resource types. These are
equivalent to SYS_RES_MEMORY for x86 but for alpha, the rman_get_virtual()
address of the resource is initialised to point into either dense-mapped
or bwx-mapped space respectively, allowing direct memory pointers to be
used to device memory.

Reviewed by: Andrew Gallatin <gallatin@cs.duke.edu>
1999-07-28 07:57:48 +00:00
Martin Cracauer
784648c675 Various formatting fixes on my FPE trapcode commit.
Submitted by:	BDE
1999-07-26 05:47:31 +00:00
Martin Cracauer
a7674320e9 On FPU exceptions, pass a useful error code (one of the FPE_...
macros) to the signal handler, for old-style BSD signal handlers as
the second (int) argument, for SA_SIGINFO signal handlers as
siginfo_t->si_code. This is source-compatible with Solaris, except
that we have no <siginfo.h> (which isn't even mentioned in POSIX
1003.1b).

An rather complete example program is at
  http://www3.cons.org/cracauer/freebsd-signal.c
This will be added to the regression tests in src/.

This commit also adds code to disable the (hardware) FPU from
userconfig, so that you can use a software FP emulator on a machine
that has hardware floating point. See LINT.
1999-07-25 13:16:09 +00:00
Bill Paul
691c152864 This commit adds device driver support for Adaptec Duralink PCI fast
ethernet controllers based on the AIC-6915 "Starfire" controller chip.
There are single port, dual port and quad port cards, plus one 100baseFX
card. All are 64-bit PCI devices, except one single port model.

The Starfire would be a very nice chip were it not for the fact that
receive buffers have to be longword aligned. This requires buffer
copying in order to achieve proper payload alignment on the alpha.
Payload alignment is enforced on both the alpha and x86 platforms.
The Starfire has several different DMA descriptor formats and transfer
mechanisms. This driver uses frame descriptors for transmission which
can address up to 14 packet fragments, and a single fragment descriptor
for receive. It also uses the producer/consumer model and completion
queues for both transmit and receive. The transmit ring has 128
descriptors and the receive ring has 256.

This driver supports both FreeBSD/i386 and FreeBSD/alpha, and uses newbus
so that it can be compiled as a loadable kernel module. Support for BPF
and hardware multicast filtering is included.
1999-07-25 04:32:50 +00:00
David Greenman
6704748cf6 Increased max kmem to 200MB. This should fix some out-of-kmem panics on
large systems.
1999-07-24 22:26:42 +00:00
Alan Cox
03e3bc8e62 atomic.h:
Change "void *" to "volatile TYPE *", improving type safety
	and eliminating some warnings (e.g., mp_machdep.c rev 1.106).

cpufunc.h:
	Eliminate setbits.  As defined, it's not precisely correct;
	and it's redundant.  (Use atomic_set_int instead.)

ipl_funcs.c:
	Use atomic_set_int instead of setbits.

systm.h:
	Include atomic.h.

Reviewed by:	bde
1999-07-23 23:45:50 +00:00
Alan Cox
3b21348301 Reduce the number of "magic constants" used for page coloring
by one: PQ_PRIME2 and PQ_PRIME3 are used to accomplish the same
thing at different places in the kernel.  Drop PQ_PRIME3.
1999-07-22 06:04:17 +00:00
Alan Cox
d4da2dbae6 Fix the following problem:
When creating new processes (or performing exec), the new page
directory is initialized too early.  The kernel might grow before
p_vmspace is initialized for the new process.  Since pmap_growkernel
doesn't yet know about the new page directory, it isn't updated, and
subsequent use causes a failure.

The fix is (1) to clear p_vmspace early, to stop pmap_growkernel
from stomping on memory, and (2) to defer part of the initialization
of new page directories until p_vmspace is initialized.

PR:		kern/12378
Submitted by:	tegge
Reviewed by:	dfr
1999-07-21 18:02:27 +00:00
Mike Smith
d1a6c79537 Update of the i686 MTRR/memory range support.
- Support for setting memory range attributes on SMP systems using the
   new SMP rendezvous function
 - Don't print the confusing default memory type message.
 - Allow legal overlapping range types.
 - Turn interrupts back on after setting MTRRs in UP mode (whoops)
 - Don't waste time calling invltlb() after wbinvd(); it's not
   SMP-compatible (interrupts are off) and unncessary because
   wbinvd already flushes the TLB.

This code is now essentially feature-complete.
1999-07-20 06:58:51 +00:00
Mike Smith
91fe3dc1e1 Implement an all-CPU shootdown-style rendezvous facility. This allows
the caller to specify a function to be guarded between an entry and exit
barrier, as well as pre- and post-barrier functions.

The primary use for this function is synchronised update of per-cpu private
data.  The implementation is almost (but not quite) MI; with a better
mechanism for masking per-CPU interrupts it could probably be hoisted.

Reviewed by:	peter (partially)
1999-07-20 06:52:35 +00:00
Peter Wemm
7e08426441 Fix a page size vs. KB mixup. The extra buffers allocated at a reduced
rate is meant to kick in at 64MB, not 256MB.

Reviewed by:	Matthew Dillon <dillon@backplane.com>
1999-07-19 23:36:30 +00:00
Bruce Evans
e9ecccf8cb Updated acquire_timer2()'s state machine to work when the i8254 is
being used for timecounting.  Fixed a race or two in it.  Undisabled
it.

PR:		10455
1999-07-18 18:32:42 +00:00
Bruce Evans
ab64b6dc3c Don't let the machdep.tsc_freq sysctl proceed if the TSC is present
but broken, since tsc_timecounter is not initialised in that case,
and updating an uninitialised timecounter is fatal.

Fixed style bugs in the machdep.i8254_freq and machdep.tsc_freq
sysctls.

Reviewed by:	phk
1999-07-18 15:19:29 +00:00
Poul-Henning Kamp
f06a54f0a0 Centralize dumpdev handling. 1999-07-17 20:47:52 +00:00
Mike Smith
850013034a Add support for multiple PCI busses directly connected to the nexus.
This is only partially complete, but allows 450NX-based systems with
more than one PCI bus to be used again.

Submitted by:	dfr
1999-07-16 01:00:30 +00:00
David E. O'Brien
a6c6cfcddf Move the xe0 driver back where it was. It was misleading where it was as it
does not take over the PCIC, it does require PCCARD support, and it doesn't
replace any existing driver.
1999-07-13 08:08:20 +00:00
Alan Cox
47b8bc92e8 Commit the correct patch, i.e., the one that actually corresponds
to the rev 1.2 log entry.
1999-07-13 06:35:25 +00:00
Alan Cox
e58bb1c453 Changed the implementation of the primitives to guarantee atomicity
with respect to interrupts on UP systems.  (The upgrade from gcc 2.7.x
to egcs 1.1.2 produced at least one non-atomic code sequence in
swap_pager_getpages.)

In addition, the primitives are now SMP-safe, but only on SMPs.  (For
portability between SMPs and UPs, modules are compiled with the SMP-safe
versions.)

Submitted by:	dillon and myself
Reviewed by:	bde
1999-07-13 03:32:17 +00:00
Bruce Evans
eec2e836e9 Go back to the old (icu.s rev.1.7 1993) way of keeping the AST-pending
bit separate from ipending, since this is simpler and/or necessary for
SMP and may even be better for UP.

Reviewed by:	alc, luoqi, tegge
1999-07-10 15:28:01 +00:00
Bruce Evans
c618090a83 Fixed a longstanding scheduling bug. ASTs and softclock interrupts were
not masked during handling of shared PCI interrupts.  This resulted in
ASTs sometimes being discarded and softclock interrupts sometimes being
handled prematurely (sometimes = quite often on systems with shared PCI
interrupts, never on other systems).

Debugged by:	gibbs and other people at plutotech.com
PR:		6944, maybe 12381
1999-07-10 14:54:19 +00:00
Jonathan Lemon
ab001a72be Implement support for hardware debug registers on the i386.
Submitted by:	Brian Dean <brdean@unx.sas.com>
1999-07-09 04:16:00 +00:00
Kirk McKusick
ad8ac923fa These changes appear to give us benefits with both small (32MB) and
large (1G) memory machine configurations.  I was able to run 'dbench 32'
on a 32MB system without bring the machine to a grinding halt.

    * buffer cache hash table now dynamically allocated.  This will
      have no effect on memory consumption for smaller systems and
      will help scale the buffer cache for larger systems.

    * minor enhancement to pmap_clearbit().  I noticed that
      all the calls to it used constant arguments.  Making
      it an inline allows the constants to propogate to
      deeper inlines and should produce better code.

    * removal of inherent vfs_ioopt support through the emplacement
      of appropriate #ifdef's, with John's permission.  If we do not
      find a use for it by the end of the year we will remove it entirely.

    * removal of getnewbufloops* counters & sysctl's - no longer
      necessary for debugging, getnewbuf() is now optimal.

    * buffer hash table functions removed from sys/buf.h and localized
      to vfs_bio.c

    * VFS_BIO_NEED_DIRTYFLUSH flag and support code added
      ( bwillwrite() ), allowing processes to block when too many dirty
      buffers are present in the system.

    * removal of a softdep test in bdwrite() that is no longer necessary
      now that bdwrite() no longer attempts to flush dirty buffers.

    * slight optimization added to bqrelse() - there is no reason
      to test for available buffer space on B_DELWRI buffers.

    * addition of reverse-scanning code to vfs_bio_awrite().
      vfs_bio_awrite() will attempt to locate clusterable areas
      in both the forward and reverse direction relative to the
      offset of the buffer passed to it.  This will probably not
      make much of a difference now, but I believe we will start
      to rely on it heavily in the future if we decide to shift
      some of the burden of the clustering closer to the actual
      I/O initiation.

    * Removal of the newbufcnt and lastnewbuf counters that Kirk
      added.  They do not fix any race conditions that haven't already
      been fixed by the gbincore() test done after the only call
      to getnewbuf().  getnewbuf() is a static, so there is no chance
      of it being misused by other modules.  ( Unless Kirk can think
      of a specific thing that this code fixes.  I went through it
      very carefully and didn't see anything ).

    * removal of VOP_ISLOCKED() check in flushbufqueues().  I do not
      think this check is necessary, the buffer should flush properly
      whether the vnode is locked or not. ( yes? ).

    * removal of extra arguments passed to getnewbuf() that are not
      necessary.

    * missed cluster_wbuild() that had to be a cluster_wbuild_wb() in
      vfs_cluster.c

    * vn_write() now calls bwillwrite() *PRIOR* to locking the vnode,
      which should greatly aid flushing operations in heavy load
      situations - both the pageout and update daemons will be able
      to operate more efficiently.

    * removal of b_usecount.  We may add it back in later but for now
      it is useless.  Prior implementations of the buffer cache never
      had enough buffers for it to be useful, and current implementations
      which make more buffers available might not benefit relative to
      the amount of sophistication required to implement a b_usecount.
      Straight LRU should work just as well, especially when most things
      are VMIO backed.  I expect that (even though John will not like
      this assumption) directories will become VMIO backed some point soon.

Submitted by:	Matthew Dillon <dillon@backplane.com>
Reviewed by:	Kirk McKusick <mckusick@mckusick.com>
1999-07-08 06:06:00 +00:00
Dag-Erling Smørgrav
6b5ca0d83e Rename bpfilter to bpf. 1999-07-06 19:23:32 +00:00
Peter Wemm
8bd48ca8d4 Quieten gcc paranoia. 1999-07-06 13:23:56 +00:00
Peter Wemm
0431584674 Typo: s/0ff0/0xff0/ 1999-07-06 12:42:26 +00:00
Martin Cracauer
aff66c5455 Implement SA_SIGINFO for i386. Thanks to Bruce Evans for much more
than a review, this was a nice puzzle.

This is supposed to be binary and source compatible with older
applications that access the old FreeBSD-style three arguments to a
signal handler.

Except those applications that access hidden signal handler arguments
bejond the documented third one. If you have applications that do,
please let me know so that we take the opportunity to provide the
functionality they need in a documented manner.

Also except application that use 'struct sigframe' directly. You need
to recompile gdb and doscmd. `make world` is recommended.

Example program that demonstrates how SA_SIGINFO and old-style FreeBSD
handlers (with their three args) may be used in the same process is at
http://www3.cons.org/tmp/fbsd-siginfo.c

Programs that use the old FreeBSD-style three arguments are easy to
change to SA_SIGINFO (although they don't need to, since the old style
will still work):

  Old args to signal handler:
    void handler_sn(int sig, int code, struct sigcontext *scp)

  New args:
    void handler_si(int sig, siginfo_t *si, void *third)
  where:
    old:code == new:second->si_code
    old:scp == &(new:si->si_scp)     /* Passed by value! */

The latter is also pointed to by new:third, but accessing via
si->si_scp is preferred because it is type-save.

FreeBSD implementation notes:
- This is just the framework to make the interface POSIX compatible.
  For now, no additional functionality is provided. This is supposed
  to happen now, starting with floating point values.
- We don't use 'sigcontext_t.si_value' for now (POSIX meant it for
  realtime-related values).
- Documentation will be updated when new functionality is added and
  the exact arguments passed are determined. The comments in
  sys/signal.h are meant to be useful.

Reviewed by:	BDE
1999-07-06 07:13:48 +00:00
Brian Feldman
2c2c424e91 Add Centaur/IDT WinChip support.
Why in the world do people put breaks at the end of a switch's default case?
1999-07-06 06:25:38 +00:00
Brian Feldman
c92f8276cd I made some cleanups, rearranged things a bit, and made AMD Features default
printing on CPUs that have it.
If there are no objections, I'll MFC all recent changes (harmless, really)
to 3.2 and PAO.
1999-07-06 05:25:41 +00:00
Mike Smith
134c934ce7 Move the initialisation/tuning of nmbclusters from param.c/machdep.c
into uipc_mbuf.c.  This reduces three sets of identical tunable code to
one set, and puts the initialisation with the mbuf code proper.

Make NMBUFs tunable as well.

Move the nmbclusters sysctl here as well.

Move the initialisation of maxsockets from param.c to uipc_socket2.c,
next to its corresponding sysctl.

Use the new tunable macros for the kern.vm.kmem.size tunable (this should have
been in a separate commit, whoops).
1999-07-05 08:52:54 +00:00
Brian Feldman
b613154006 Add an extra space to " AMD Features=" to make it line up well. 1999-07-05 02:28:21 +00:00
Brian Feldman
69c784af9f K6-III CPUs are now case:d in the appropriate switch; also, in
print_AMD_info(), L2 internal cache is shown, as are AMD's special CPUID
infos:

CPU: AMD-K6(tm) 3D processor (350.81-MHz 586-class CPU)
  Origin = "AuthenticAMD"  Id = 0x58c  Stepping=12
  Features=0x8021bf<FPU,VME,DE,PSE,TSC,MSR,MCE,CX8,PGE,MMX>
 AMD Features=0x808029bf<FPU,VME,DE,PSE,TSC,MSR,MCE,CX8,SYSCALL,PGE,MMX,3DNow!>

PR:		kern/12512
Submitted by:	Louis A. Mamakos <louie@TransSys.COM>
1999-07-05 02:27:32 +00:00
Jonathan Lemon
3f594242d1 Some cleanup and rearrangement. hw.physmem is now an absolute quantity;
we will never use more memory than this value (if specified), but will always
check memory for validity up to this amount.

Get rid of the speculative_mprobe option; the memory amount can now be
specified by hw.physmem.
1999-07-04 02:26:23 +00:00
Kirk McKusick
e929c00d23 The buffer queue mechanism has been reformulated. Instead of having
QUEUE_AGE, QUEUE_LRU, and QUEUE_EMPTY we instead have QUEUE_CLEAN,
QUEUE_DIRTY, QUEUE_EMPTY, and QUEUE_EMPTYKVA.  With this patch clean
and dirty buffers have been separated.  Empty buffers with KVM
assignments have been separated from truely empty buffers.  getnewbuf()
has been rewritten and now operates in a 100% optimal fashion.  That is,
it is able to find precisely the right kind of buffer it needs to
allocate a new buffer, defragment KVM, or to free-up an existing buffer
when the buffer cache is full (which is a steady-state situation for
the buffer cache).

Buffer flushing has been reorganized.  Previously buffers were flushed
in the context of whatever process hit the conditions forcing buffer
flushing to occur.  This resulted in processes blocking on conditions
unrelated to what they were doing.  This also resulted in inappropriate
VFS stacking chains due to multiple processes getting stuck trying to
flush dirty buffers or due to a single process getting into a situation
where it might attempt to flush buffers recursively - a situation that
was only partially fixed in prior commits.  We have added a new daemon
called the buf_daemon which is responsible for flushing dirty buffers
when the number of dirty buffers exceeds the vfs.hidirtybuffers limit.
This daemon attempts to dynamically adjust the rate at which dirty buffers
are flushed such that getnewbuf() calls (almost) never block.

The number of nbufs and amount of buffer space is now scaled past the
8MB limit that was previously imposed for systems with over 64MB of
memory, and the vfs.{lo,hi}dirtybuffers limits have been relaxed
somewhat.  The number of physical buffers has been increased with the
intention that we will manage physical I/O differently in the future.

reassignbuf previously attempted to keep the dirtyblkhd list sorted which
could result in non-deterministic operation under certain conditions,
such as when a large number of dirty buffers are being managed.  This
algorithm has been changed.  reassignbuf now keeps buffers locally sorted
if it can do so cheaply, and otherwise gives up and adds buffers to
the head of the dirtyblkhd list.  The new algorithm is deterministic but
not perfect.  The new algorithm greatly reduces problems that previously
occured when write_behind was turned off in the system.

The P_FLSINPROG proc->p_flag bit has been replaced by the more descriptive
P_BUFEXHAUST bit.  This bit allows processes working with filesystem
buffers to use available emergency reserves.  Normal processes do not set
this bit and are not allowed to dig into emergency reserves.  The purpose
of this bit is to avoid low-memory deadlocks.

A small race condition was fixed in getpbuf() in vm/vm_pager.c.

Submitted by:	Matthew Dillon <dillon@apollo.backplane.com>
Reviewed by:	Kirk McKusick <mckusick@mckusick.com>
1999-07-04 00:25:38 +00:00
Peter Wemm
882b71223e printf int/dev_t (pointer) warning 1999-07-03 21:03:56 +00:00
Warner Losh
279f2101e7 Improve compatibility with other systems by changing the default
behavior slightly.

If machine/bus.h is included, but neither bus_memio.h nor bus_pio.h
are included, then behave as if both were included.

This won't change existing drivers, all of which include one or more
of bus_{p,mem}io.h, but will allow drivers from other systems to come
over with fewer changes.  I freely admit that this might not be
optimal for some drivers, but those drivers can be optimized for
FreeBSD after the initial bringup happens.

Without the change, there is a bug that preclude drivers from
compiling with strange warning/errors.

I've been running this here for a while now w/o ill effects.

Reviewed by: gibbs
Not objected to by: bde, arch@ list.
1999-07-03 20:14:08 +00:00
Peter Wemm
ca224f89a9 Fix warnings in last commit (dev_t is not an int, and not even int
compatable in arg lists on the Alpha)
1999-07-03 17:40:31 +00:00
Poul-Henning Kamp
ad6cb55952 Be more informative and try to ask the user in some instances if we can't
figure out the root device.
1999-07-03 08:24:00 +00:00
Alan Cox
789fb7ccdc An SMP-specific change: Add the lock prefix to RMW operations
on ipending.
1999-07-03 06:33:48 +00:00