Commit graph

2097 commits

Author SHA1 Message Date
Peter Wemm 8dc26439da Move pcibus (host -> pci bus) probe/attach routines from nexus
to pcibus.c.  pci_cfgopen() becomes static and there are no more
bus #ifdef's in nexus.c.
1999-05-18 20:48:43 +00:00
Alan Cox 88b67a96af pmap_qremove:
Eliminate unnecessary TLB shootdowns.
1999-05-18 06:01:49 +00:00
Peter Wemm 2f2ffb8d2c Don't hardcode IRQ 13 for NPX. It's as good as hardwired in the hardware
though, on systems (386 mostly) that still have a seperate fpu, but it
might be possible to find systems where the FPU coprocessor is wired to
a different IRQ pin.
1999-05-15 17:58:58 +00:00
Doug Rabson 6c2e3dde8c * Define a new static method DEVICE_IDENTIFY which is called to add device
instances to a parent bus.
* Define a new method BUS_ADD_CHILD which can be called from DEVICE_IDENTIFY
  to add new instances.
* Add a generic implementation of DEVICE_PROBE which calls DEVICE_IDENTIFY
  for each driver attached to the parent's devclass.
* Move the hint-based isa probe from the isa driver to a new isahint driver
  which can be shared between i386 and alpha.
1999-05-14 11:22:47 +00:00
David E. O'Brien 282462f969 Add the `xe' Xircom PC Card driver. 1999-05-14 03:57:25 +00:00
Bruce Evans 4daefb91bf Renamed the private copies of strlen and strcpy to gdb_strlen and
gdb_strcpy, respectively.  This saves fixing the wrong return type
of the private strlen and makes the addresses of strlen and strcpy
unambiguous.
1999-05-13 07:34:25 +00:00
Luoqi Chen 0f0fe5a4c5 Unbreak VESA on SMP. 1999-05-12 21:39:07 +00:00
Luoqi Chen 2ee16532b6 VM86_FRAMESIZE is now the size of vm86 frame, not the number of 4-byte words.
Requested by:	Bruce
1999-05-12 21:30:51 +00:00
Poul-Henning Kamp 02342b0cfe Fix dumpon. It passes a udev_t from userland to kernel, that needs a
udev2dev() before we use it.

It really should pass a name like swapon does.
1999-05-12 07:40:50 +00:00
Poul-Henning Kamp bfbb9ce670 Divorce "dev_t" from the "major|minor" bitmap, which is now called
udev_t in the kernel but still called dev_t in userland.

Provide functions to manipulate both types:
        major()         umajor()
        minor()         uminor()
        makedev()       umakedev()
        dev2udev()      udev2dev()

For now they're functions, they will become in-line functions
after one of the next two steps in this process.

Return major/minor/makedev to macro-hood for userland.

Register a name in cdevsw[] for the "filedescriptor" driver.

In the kernel the udev_t appears in places where we have the
major/minor number combination, (ie: a potential device: we
may not have the driver nor the device), like in inodes, vattr,
cdevsw registration and so on, whereas the dev_t appears where
we carry around a reference to a actual device.

In the future the cdevsw and the aliased-from vnode will be hung
directly from the dev_t, along with up to two softc pointers for
the device driver and a few houskeeping bits.  This will essentially
replace the current "alias" check code (same buck, bigger bang).

A little stunt has been provided to try to catch places where the
wrong type is being used (dev_t vs udev_t), if you see something
not working, #undef DEVT_FASCIST in kern/kern_conf.c and see if
it makes a difference.  If it does, please try to track it down
(many hands make light work) or at least try to reproduce it
as simply as possible, and describe how to do that.

Without DEVT_FASCIST I belive this patch is a no-op.

Stylistic/posixoid comments about the userland view of the <sys/*.h>
files welcome now, from userland they now contain the end result.

Next planned step: make all dev_t's refer to the same devsw[] which
means convert BLK's to CHR's at the perimeter of the vnodes and
other places where they enter the game (bootdev, mknod, sysctl).
1999-05-11 19:55:07 +00:00
Luoqi Chen cd121c9cae Yet another place I missed when increasing trapframe size, which causes problem
to SIGFPE handling.

Reviewed by:	Bruce Evans	<bde@zeta.org.au>
1999-05-11 16:29:21 +00:00
Luoqi Chen fcfe0b7b48 Do not hardcode size of struct vm86frame.
Submitted by:	Jonathan Lemon <jlemon@americantv.com>
1999-05-11 16:04:40 +00:00
Doug Rabson 41787a353d Add missing suspend/resume methods. 1999-05-10 17:56:23 +00:00
Peter Wemm 7f2d5fc4f2 Move the mfs_getimage() prototype to mfs_extern.h duplicating it
everywhere.
1999-05-10 17:12:45 +00:00
Bruce Evans 149c3aa60a [Forgot to commit this in the batch a few days ago.]
Fixed profiling of elf kernels.  Made high resolution profiling compile
for elf kernels (it is broken for all kernels due to lack of egcs support).

Renaming of many assembler labels is avoided by declaring by declaring
the labels that need to be visible to gprof as having type "function"
and depending on the elf version of gprof being zealous about discarding
the others.  A few type declarations are still missing, mainly for SMP.

PR:		9413
Submitted by:	Assar Westerlund <assar@sics.se> (initial parts)
1999-05-10 10:51:25 +00:00
Peter Wemm 45d84a2db3 Clean out some unused leftovers from before the split from the old isa.c. 1999-05-09 23:56:00 +00:00
Peter Wemm 3bab4ac5a1 For what it's worth, idelayed is declared as a volatile in the headers,
and even though it's not used in this file make it a volatile here too.
1999-05-09 23:32:29 +00:00
Peter Wemm 0264a0ebd1 loadandclear() uses an atomic instruction (even on SMP, where it's an
implicitly LOCK'ed instruction), so there shouldn't be any harm in making
it volatile pointer compatable for one of the users of it.  It seems to
generate the same code regardless.
1999-05-09 23:30:01 +00:00
Peter Wemm 18c3dd1745 s/main/mi_startup/ for the kernel entry point so that egcs doesn't get
upset about it (and generate things like __main() calls that are reserved
for main()).  Renaming was phk's suggestion, but I'd already thought about
it too.  (phk liked my suggested name tada() but I decided against it :-)

Reviewed by:	phk
1999-05-09 19:01:49 +00:00
Poul-Henning Kamp aa713cb898 Oops. If ROOTDEVNAME isn't defined, have -r call -a. 1999-05-09 16:56:09 +00:00
Poul-Henning Kamp b307e58fc7 Major lobotomy of config(8). The
config kernel mumble mumble

line has been obsoleted and removed and with it went all knowledge of
devices on the part of config.

You can still configure a root device (which is used if you give
the "-r" flag) but now with an option:

        options         ROOTDEVNAME=\"da0s2e\"

The string is parsed by the same code as at the "boot -a" prompt.

At the same time, make the "boot -a" prompt both more able and more
informative.

ALPHA/PC98 people:  You will have to adapt a few simple changes
(defining rootdev and dumpdev somewhere else) before config works
for you again, sorry, but it's all in the name of progress.
1999-05-09 16:46:01 +00:00
Poul-Henning Kamp 3000820ae0 add some amount of sanity to the way the gdb stuff finds its device.
I'm not too happy about the result either, but at least it has less
chance of backfiring.

This particular feature could be called "a mess" without offending
anybody.
1999-05-09 10:51:13 +00:00
Poul-Henning Kamp 33525517b5 Duh, bdevsw() takes dev_t arg. 1999-05-09 07:56:36 +00:00
Doug Rabson 566643e39e Move the declaration of the interrupt type from the driver structure
to the BUS_SETUP_INTR call.
1999-05-08 21:59:43 +00:00
Peter Wemm 0bbd01ea13 Add some notes about the globalness of certain things like interrupts
and ISA DMA channels (ie: on most PCI systems, they are not.. they are
on the ISA side of the PCI-ISA bridge and could be duplicated if there
were multiple PCI-ISA bridges, say in a laptop docking station), while
the APIC resources would be global on SMP systems.
Also, revert a previous change, change some printfs back to panics.
1999-05-08 21:34:34 +00:00
Peter Wemm 14d3b6b80c GC some #if 0 junk 1999-05-08 21:28:39 +00:00
Peter Wemm f98661016d Don't print 'interrupting at irq nn' on the x86 family, it's not all
that big a deal just yet and isn't worth a whole line on the boot screen.
This could change later in the face of multi-ISA-bus (eg: laptop docking
stations with two independent ISA busses) and SMP/APIC systems.  The Alpha
already has multiple interrupt destinations to deal with.
1999-05-08 20:24:44 +00:00
Peter Wemm 1a738e4be7 Look up the sensitive flag better, allowing interoperation between old and
new isa drivers with sensitive flags.  If the resource_find() code
is meant to "find" the wildcard sensitive flag for a driver even though
a unit is supplied, this can be simplified.
1999-05-08 18:15:49 +00:00
Peter Wemm df5c783c68 Fix unused variable "flags". (only used if #ifdef I586_CPU) 1999-05-08 18:14:09 +00:00
Peter Wemm 9c06a38614 Make sure the mem_range_AP_init() prototype is seen where it's needed, and
#ifdef SMP around it for fun.
1999-05-08 17:48:22 +00:00
Poul-Henning Kamp 4be2eb8c49 I got tired of seeing all the cdevsw[major(foo)] all over the place.
Made a new (inline) function devsw(dev_t dev) and substituted it.

Changed to the BDEV variant to this format as well: bdevsw(dev_t dev)

DEVFS will eventually benefit from this change too.
1999-05-08 06:40:31 +00:00
Poul-Henning Kamp 46eede0058 Continue where Julian left off in July 1998:
Virtualize bdevsw[] from cdevsw.  bdevsw() is now an (inline)
        function.

        Join CDEV_MODULE and BDEV_MODULE to DEV_MODULE (please pay attention
        to the order of the cmaj/bmaj arguments!)

        Join CDEV_DRIVER_MODULE and BDEV_DRIVER_MODULE to DEV_DRIVER_MODULE
        (ditto!)

(Next step will be to convert all bdev dev_t's to cdev dev_t's
before they get to do any damage^H^H^H^H^H^Hwork in the kernel.)
1999-05-07 10:11:40 +00:00
Kirk McKusick e244fe31d6 Generalize to allow any serial port to be used as the GDB port.
Mark the GDB port in the config file with flags 0x80. Currently
only the sio driver checks these flags and sets up a GDB port,
but adding similar code to other serial drivers would be easy.
For backward compatibility, if an sio port is marked as the console
and no port is marked as the gdb port, the GDB port will be mapped
to the console port. This hack should go away at some point.
1999-05-07 06:50:41 +00:00
Peter Wemm 94f9940a0c Ensure prototype for pnp_configure() is visible. 1999-05-06 22:16:19 +00:00
Peter Wemm dfd5dee1b0 Add sufficient braces to keep egcs happy about potentially ambiguous
if/else nesting.
1999-05-06 18:13:11 +00:00
Peter Wemm 97bf178703 I'm not sure why the #ifdef SMP became #if 1 (this overrode the npx probe
and always succeeded as is required on SMP).  Anyway, reverting this
still compiles and appears ok.
1999-05-06 12:47:21 +00:00
Bruce Evans ea2b3e3d1b Fixed profiling of elf kernels. Made high resolution profiling compile
for elf kernels (it is broken for all kernels due to lack of egcs support).

Renaming of many assembler labels is avoided by declaring by declaring
the labels that need to be visible to gprof as having type "function"
and depending on the elf version of gprof being zealous about discarding
the others.  A few type declarations are still missing, mainly for SMP.

PR:		9413
Submitted by:	Assar Westerlund <assar@sics.se> (initial parts)
1999-05-06 09:44:57 +00:00
Luoqi Chen c300b7b6c1 Initialize dblfault_tss.tss_fs to the per-cpu private data segment selector. 1999-05-06 00:54:54 +00:00
Luoqi Chen 68db6cea99 Do not set curproc until proc0 is fully initialized (in proc0_init()). 1999-05-06 00:39:00 +00:00
Doug Rabson 6887e80a0f Use unit, not device_id as an argument to an old-style ISA interrupt
handler. This fixes pnp interrupts and would have fixed pccard interrupts
but a workaround has been applied there.

This the sound driver problems which people have reported with new-bus.
1999-05-04 21:18:20 +00:00
Mike Smith 3574d12d70 Disable the ppc chipset-specific probes by default. 1999-05-04 00:15:15 +00:00
Bill Fumerola 3d177f465a Add sysctl descriptions to many SYSCTL_XXXs
PR:		kern/11197
Submitted by:	Adrian Chadd <adrian@FreeBSD.org>
Reviewed by:	billf(spelling/style/minor nits)
Looked at by:	bde(style)
1999-05-03 23:57:32 +00:00
Peter Wemm cbdfdcb2f4 Don't deref a NULL mem_range_softc.mr_op pointer on non-MTRR systems when
starting the AP.
1999-05-03 09:47:53 +00:00
Nick Hibma b7b075a2a2 Add driver for the Iomega Zip 100 drive. 1999-05-02 21:54:05 +00:00
Mike Smith 1bbb92c757 Whoops, not all SMP systems have memory range attribute support. Don't
try to set it up on an AP unless we do.

Submitted by:	dave adkins <adkin003@tc.umn.edu>
1999-05-02 03:06:22 +00:00
Mike Smith 4a034f21cd Add a hook that can be called to initialise a slave processor's memory
range attributes after they have been extracted from the master.

Hook up the i686 MP code to do this for each AP.

Be more careful about printing the default memory type for the i686.

Suggestions from: luoqi
1999-04-30 22:09:45 +00:00
Luoqi Chen 5206bca10a Enable vmspace sharing on SMP. Major changes are,
- %fs register is added to trapframe and saved/restored upon kernel entry/exit.
- Per-cpu pages are no longer mapped at the same virtual address.
- Each cpu now has a separate gdt selector table. A new segment selector
  is added to point to per-cpu pages, per-cpu global variables are now
  accessed through this new selector (%fs). The selectors in gdt table are
  rearranged for cache line optimization.
- fask_vfork is now on as default for both UP and SMP.
- Some aio code cleanup.

Reviewed by:	Alan Cox	<alc@cs.rice.edu>
		John Dyson	<dyson@iquest.net>
		Julian Elischer	<julian@whistel.com>
		Bruce Evans	<bde@zeta.org.au>
		David Greenman	<dg@root.com>
1999-04-28 01:04:33 +00:00
Poul-Henning Kamp f711d546d2 Suser() simplification:
1:
  s/suser/suser_xxx/

2:
  Add new function: suser(struct proc *), prototyped in <sys/proc.h>.

3:
  s/suser_xxx(\([a-zA-Z0-9_]*\)->p_ucred, \&\1->p_acflag)/suser(\1)/

The remaining suser_xxx() calls will be scrutinized and dealt with
later.

There may be some unneeded #include <sys/cred.h>, but they are left
as an exercise for Bruce.

More changes to the suser() API will come along with the "jail" code.
1999-04-27 11:18:52 +00:00
Peter Wemm 10cd8cf48b Register the netisr's via SYSINIT rather than linker sets. 1999-04-26 08:57:51 +00:00
Alan Cox 51bb7ba664 pmap_dispose_proc and pmap_copy_page:
Conditionally compile 386-specific code.

pmap_enter:
	Eliminate unnecessary TLB shootdowns.

pmap_zero_page and pmap_zero_page_area:
	Use invltlb_1pg instead of duplicating the code.
1999-04-25 18:40:05 +00:00
Poul-Henning Kamp 0bb2226a4d Make the machdep.i8254_freq and machdep.tsc_freq sysctls modify the
timecounter as well

Asked for by:	bde, jhay
1999-04-25 09:00:00 +00:00
Peter Wemm 5895e3c8ee De-quote where possible and minor tweaks. depends on a current config(8). 1999-04-24 21:45:44 +00:00
KATO Takenori 424af31b45 Changed the type of id_port from short into int to avoid wrong
conversion from short to unsigned long which is an argument of
bus_alloc_resource.  Since the value -1 is used to indicate no port
reousece, id_port need to be signed (suggested by Doug Rabson and
Peter Wemm.)
1999-04-24 18:24:43 +00:00
Peter Wemm 36d9945d74 Drop the tty/net/bio/cam interrupt class labels, they are meaninless here
now.
1999-04-24 16:04:16 +00:00
Peter Wemm d70a04d62d Don't clear the hints on release, just the resource containers. 1999-04-24 06:47:24 +00:00
KATO Takenori 6e982e922a 1MB is not 1024 * 1024 * 1024 but 1024 * 1024. 1999-04-24 04:16:22 +00:00
Peter Wemm 525a3d26e7 Make the register_intr() glue actually have a chance of working... 1999-04-23 21:01:19 +00:00
Dmitrij Tejblum 11a9f83f80 Make pmap_collect() an official pmap interface. 1999-04-23 20:29:58 +00:00
Dmitrij Tejblum 0666dbe1cf Moved cpu_set_fork_handler's prototype from <machine/cpu.h> to <sys/proc.h>.
Suggested by:	bde
1999-04-23 20:22:44 +00:00
Peter Wemm 8528f91719 oops, SMP was missing includes for a typedef. 1999-04-21 07:41:40 +00:00
Peter Wemm 54a8c69347 Stage 1 of a cleanup of the i386 interrupt registration mechanism.
Interrupts under the new scheme are managed by the i386 nexus with the
awareness of the resource manager.  There is further room for optimizing
the interfaces still.  All the users of register_intr()/intr_create()
should be gone, with the exception of pcic and i386/isa/clock.c.
1999-04-21 07:26:30 +00:00
Alan Cox 270da41581 _pmap_unwire_pte_hold and pmap_remove_page:
Use pmap_TLB_invalidate instead of invltlb_1pg to eliminate
	unnecessary IPIs.

pmap_remove, pmap_protect and pmap_remove_pages:
	Use pmap_TLB_invalidate_all instead of invltlb to eliminate
	unnecessary IPIs.

pmap_copy:
	Use cpu_invltlb instead of invltlb when updating APTDpde.

pmap_changebit:
	Rather than deleting the unused "set bit" option (which may be
	useful later), make pmap_changebit an inline that is used
	by the new pmap_clearbit procedure.

Collectively, the first three changes reduce the number of TLB shootdown
IPIs by 1/3 for a kernel compile.
1999-04-19 18:45:21 +00:00
Peter Wemm db42d90829 unifdef -DVM_STACK - it's been on for a while for x86 and was checked
and appeared to be working for the Alpha some time ago.
1999-04-19 14:14:14 +00:00
Peter Wemm f71c851c25 Drop the 'at nexus?' from the busses, it's not used.
Reactivate eisa0 and pnp0 in GENERIC, they work..  (eisa has been converted
but pnp still (for the most part) works the old way).
1999-04-19 11:53:36 +00:00
Brian Somers 23f7bd1706 Spelling police 1999-04-19 10:18:34 +00:00
Peter Wemm 3c0d8bc982 Always create attach points for the various child busses that can be
attached to the nexus.  With one exception, this (for example) allows
you to do wierd things like kldload the eisa bus on the fly and then
drivers, and have it auto probe the eisa bus when the drivers come online.

The one exception being pci, it only adds the pcib after the presence of
the pci bus is detected and that's #if'ed code.

A side effect of this is that isa and eisa will be attached to the nexus
directly rather than the PCI->ISA or PCI->EISA bridges.  I'm not sure if
this is good or bad at this point, but it seems to be closer to the way
things are for the i386 family...  This is likely to be followed up.

This also fixes compilation without a PCI bus configured and will allow
eisa to work without PCI too.
1999-04-19 08:04:19 +00:00
Peter Wemm a49a3d4433 Implement an EISA new-bus framework. The old driver probe mechanism
had a quirk that made a shim rather hard to implement properly and it was
just easier to convert the drivers in one go.  The changes to the
buslogic driver go beyond just this - the whole driver was new-bus'ed
including pci and isa.  I have only tested the EISA part of this so far.

Submitted by:	 Doug Rabson <dfr@nlsystems.com>
1999-04-18 15:50:35 +00:00
KATO Takenori 924b60cb56 Added PC98 code.
Submitted by:	Takahashi Yoshihiro <nyan@wyvern.cc.kogakuin.ac.jp>
1999-04-18 14:30:55 +00:00
Peter Wemm c2c75d780e As a temporary anti-foot-shooting measure, don't let the user attach
the atkbd device to isa, as was in the old (and 3.x) GENERIC config.
1999-04-16 23:39:15 +00:00
Peter Wemm 6182fdbda8 Bring the 'new-bus' to the i386. This extensively changes the way the
i386 platform boots, it is no longer ISA-centric, and is fully dynamic.
Most old drivers compile and run without modification via 'compatability
shims' to enable a smoother transition.  eisa, isapnp and pccard* are
not yet using the new resource manager.  Once fully converted, all drivers
will be loadable, including PCI and ISA.

(Some other changes appear to have snuck in, including a port of Soren's
 ATA driver to the Alpha.  Soren, back this out if you need to.)

This is a checkpoint of work-in-progress, but is quite functional.

The bulk of the work was done over the last few years by Doug Rabson and
Garrett Wollman.

Approved by:	core
1999-04-16 21:22:55 +00:00
Jordan K. Hubbard 24c38be4da Add SYSVSEM so that newer versions of Xaccel don't require a kernel
compile just to work.  We have the room now, so what the heck.

Reqested by:    Thomas Roell <roell@xig.com>
1999-04-16 18:27:18 +00:00
Nick Hibma ec71ab8ec3 Remove the entries for umodem and ucom. These drivers only probe
and attach, nothing else. This is confusing to people.
1999-04-16 16:17:05 +00:00
Bruce Evans e05da2e941 Made booting with -a work for all configurations. Previously it
only worked for configurations with "swap on generic".

usr.sbin/config/config.y:
- ignore all "swap [on] device ...' specifications except for
  warning about them.  They haven't done anything related to swap
  for almost 4 years, and were previously silently ignored,
  except for "swap on generic" which stopped swap${KERNEL}.c
  from being generated.  Code to support swapping is now deader
  than before.

usr.sbin/config/mkswapconf.c:
- don't generate a dummy setconf() function in swap${KERNEL}.c.

sys/i386/conf/files.i386:
- swapgeneric.c is now standard.  It should be merged into autoconf.c
  so that it doesn't conflict with swap${KERNEL}.c for kernels named
  "generic".

sys/i386/i386/autoconf.c:
- don't call setroot() for mfs roots.  Since setroot() doesn't do anything
  harmful, this was just a waste of time, except possibly for booting with
  -a it may have helped prevent an undesireable call to setconf() by
  finding a bogus rootdev.
- honor -a for ffs roots.  -a now overrides all other ways of specifying
  the root device.  Previously, -r had precedence over -a, and the -a
  handling was usually a no-op.
- don't honor -a for non-ffs roots, since it would currently just get in
  the way of a clean panic.

sys/i386/i386/swapgeneric.c:
- don't declare things that are now always declared in swap${KERNEL}.c.
  Don't decide things that are now decided in autoconf.c.  Code to
  support the "generic" case is now dead instead of useless.
1999-04-15 14:52:24 +00:00
Bruce Evans 6a9df7a421 Generate intrnames[] dynamically. This should be new-bus friendly.
Old version reviewed by: se
1999-04-14 14:26:36 +00:00
Peter Wemm 112904833c Add a commented-out example on using the makeoptions command to get a
kernel.debug.
1999-04-13 20:59:36 +00:00
Peter Wemm 3e3e4375c8 Shoot the LKM support in the old wd/wdc/atapi driver set in the head and
perform a cleanup/unifdef sweep over it to tidy things up.  The atapi
code is permanently attached to the wd driver and is always probed.

I will add an extra option bit in the flags to disable an atapi probe on
either the master or slave if needed, if people want this.

Remember, this driver is destined to die some time.  It's possible that
it will loose all atapi support down the track and only be used for
dumb non-ATA disks and all ata/atapi devices will be handled by the new
ata system.

ATAPI, ATAPI_STATIC and CMD640 are no longer options, all are implicit.

Previously discussed with:  sos
1999-04-13 19:38:12 +00:00
Tor Egge 87c737bc83 Backout early start of APs since it caused some machines to hang. 1999-04-13 03:24:47 +00:00
Nick Hibma 7dc1a5bd17 Make debugging more selective.
Remove debugging options from GENERIC
1999-04-11 20:53:50 +00:00
Peter Wemm b4718cedf6 Move initialization of SWI's in the tty|net|bio masks from isa.c into
the static initializers in ipl.s.
1999-04-11 15:51:15 +00:00
Tor Egge 44c57e7121 Add prototype for wait_ap(). 1999-04-11 00:43:43 +00:00
Tor Egge 90c26b0d2d Let BSP wait until all APs are initialized. 1999-04-10 22:58:29 +00:00
Tor Egge 0bf47fca4f Test CF after a btrl operation instead of testing ZF (which is undefined). 1999-04-10 19:19:02 +00:00
Alan Cox 53134efb59 pmap_remove_pte:
Use "loadandclear" to update the pte.

pmap_changebit and pmap_ts_referenced:
	Switch to pmap_TLB_invalidate from invltlb.
1999-04-10 02:58:17 +00:00
Peter Wemm bfda1e3ff7 Disable the mtrr copy calls, it doesn't work with the i686_mem.c stuff.
This should make it compile/link again.
1999-04-07 17:08:40 +00:00
Mike Smith 1f2d03c05e Add defines for the P6 model-specific registers. 1999-04-07 03:58:15 +00:00
Mike Smith 4ffd949eaa mem.c
Split out ioctl handler a little more cleanly, add memory
	range attribute handling for both kernel and user-space
	consumers.

pmap.c
	Remove obsolete P6 MTRR-related code.

i686_mem.c
	Map generic memory-range attribute interface to the P6 MTRR
	model.
1999-04-07 03:57:45 +00:00
Alan Cox 47b9dbd431 Two changes to pmap_remove_all:
1. Switch to pmap_TLB_invalidate from invltlb, eliminating a full TLB
flush where a single-page flush suffices.  (Also, this eliminates some
unnecessary IPIs.)

2. Use "loadandclear" to update the pte, eliminating a race condition
on SMPs.

Change #2 should be committed to -STABLE.
1999-04-06 04:52:27 +00:00
Julian Elischer 8d17e69460 Catch a case spotted by Tor where files mmapped could leave garbage in the
unallocated parts of the last page when the file ended on a frag
but not a page boundary.
Delimitted by tags PRE_MATT_MMAP_EOF and POST_MATT_MMAP_EOF,
in files alpha/alpha/pmap.c i386/i386/pmap.c nfs/nfs_bio.c vm/pmap.h
    vm/vm_page.c vm/vm_page.h vm/vnode_pager.c miscfs/specfs/spec_vnops.c
    ufs/ufs/ufs_readwrite.c kern/vfs_bio.c

Submitted by: Matt Dillon <dillon@freebsd.org>
Reviewed by: Alan Cox <alc@freebsd.org>
1999-04-05 19:38:30 +00:00
John Polstra 4fe88fe637 Restore support for executing BSD/OS binaries on the i386 by passing
the address of the ps_strings structure to the process via %ebx.
For other kinds of binaries, %ebx is still zeroed as before.

Submitted by:	Thomas Stephens <tas@stephens.org>
Reviewed by:	jdp
1999-04-03 22:20:03 +00:00
Alan Cox 087e80a934 Put in place the infrastructure for improved UP and SMP TLB management.
In particular, replace the unused field pmap::pm_flag by pmap::pm_active,
which is a bit mask representing which processors have the pmap activated.
(Thus, it is a simple Boolean on UPs.)

Also, eliminate an unnecessary memory reference from cpu_switch()
in swtch.s.

Assisted by:	John S. Dyson <dyson@iquest.net>
Tested by:	Luoqi Chen <luoqi@watermarkgroup.com>,
		Poul-Henning Kamp <phk@critter.freebsd.dk>
1999-04-02 17:59:49 +00:00
Poul-Henning Kamp 6a5d592ae8 Purging lint from the Bruce filter. 1999-03-30 09:00:45 +00:00
Kenneth D. Merry 4a64714fd8 Delete all references to the "aic" driver. It isn't in the tree, and
may not show up for a while, and I'm tired of people asking about it.

Perhaps this will eliminate some of the confusion.
1999-03-29 17:56:28 +00:00
Dmitrij Tejblum a4ca0596ca Ifdef declaration of a conditionally defined function "timezero". 1999-03-28 23:28:18 +00:00
Poul-Henning Kamp 48c619d0ee Link the bb structures together as we find them. 1999-03-21 12:30:50 +00:00
Alan Cox 2618393ec3 Eliminate a pointless TLB flush from the SMP idle loop.
Submitted by:	Luoqi Chen <luoqi@watermarkgroup.com>
Reviewed by:	"John S. Dyson" <toor@dyson.iquest.net>
1999-03-20 18:44:13 +00:00
Jonathan Lemon 6d2b6a085e Change btrl/btsl to cmpl/movl, since each cpu now has their own copy
of private_tss, and there's no need to use a bit array.  Also fixes
the problem of using `je' after btrl, since cmpl sets ZF.

Noticed by: Luoqi, on -current
1999-03-18 04:22:23 +00:00
Mike Smith 446a106927 Look for the right ACPI table signature.
PR:		i386/10587
Submitted by:	Takanori Watanabe <takawata@shidahara1.planet.sci.kobe-u.ac.jp>
1999-03-16 21:11:28 +00:00
Søren Schmidt d99434fb80 Rewert the atapi CDROM driver's name to wcd.
This is to avoid confusion with the new system.
Also provide real entires in MAKEDEV for the new system.
1999-03-16 13:34:03 +00:00
Alan Cox 10e77073e1 pmap_qenter/pmap_qremove:
Use the pmap_kenter/pmap_kremove inline functions
	instead of duplicating them.

pmap_remove_all:
	Eliminate an unused (but initialized) variable.

pmap_ts_reference:
	Change the implementation.  The new implementation is much smaller
	and simpler, but functionally identical.  (Reviewed by
	"John S. Dyson" <dyson@iquest.net>.)
1999-03-13 07:31:29 +00:00
David Greenman 8681b974c1 Increased kernel virtual address space to 1GB. NOTE: You MUST have fixed
bootblocks in order to boot the kernel after this! Also note that this
change breaks BSDI BSD/OS compatibility.
Also increased default NKPT to 17 so that FreeBSD can boot on machines
with >=2GB of RAM. Booting on machines with exactly 4GB requires other
patches, not included.
1999-03-11 18:28:46 +00:00
Ollivier Robert cd1df78903 Fix two tests against hex. values for CPUID.
PR:		i386/10050
Submitted by:	Kevin Day <toasty@dragondata.com>
1999-03-10 20:42:00 +00:00
Poul-Henning Kamp a2210fe12b Make TIMER_FREQ a normal, undocumented option. Raise confusion to
a higher level with example in LINT.

Clarify comment about PPS_SYNC.  Ignore for now that it doesn't
work in FLL mode, it will in a few days.
1999-03-09 20:20:09 +00:00
Garrett Wollman acc8326d0c Expose a slightly-lower-level interface to timeouts which allows callers
to manage their own memory.  Tested on my machine (make buildworld).
I've made analogous changes on the alpha, but don't have a machine
to test.

Not-objected-to by:	dg, gibbs
1999-03-06 04:46:20 +00:00
Bruce Evans efc96764e0 The magic "no-cpu" cpu number is 0xff. Don't misrepresent cpu
numbers as chars or use bogus casts in an attempt to unmisrepresnt
them.  In top, don't assume that 0xff is the only negative cpu
number when cpu numbers are (mis)represented.
1999-03-05 16:38:13 +00:00
Alan Cox 901671c028 Fix an SMP-only TLB invalidation bug. Specifically, disable
a TLB invalidation optimization that won't work given the
limitations of our current SMP support.

This patch should be applied to -stable ASAP.

Thanks to John Capo <jc@irbs.com>,
          Steve Kargl <sgk@troutmask.apl.washington.edu>, and
          Chuck Robey <chuckr@mat.net>
for testing.
1999-03-05 08:05:44 +00:00
David Greenman 37cd370c97 Correct casts in vtophys and avtophys to be vm_offset_t. 1999-03-02 16:20:39 +00:00
Kirk McKusick 0ee81fe5f5 Update to know about current kernel directory layout.
Add ability to build links as well as tags.
1999-02-28 22:14:16 +00:00
Bruce Evans e7ba67f274 Removed all traces of `p_switchtime'. The relevant timestamp is per-cpu,
not per-process.  Keep it in `switchtime' consistently.

It is now clear that the timestamp is always valid in fork_trampoline()
except when the child is running on a previously idle cpu, which
can only happen if there are multiple cpus, so don't check or set
the timestamp in fork_trampoline except in the (i386) SMP case.
Just remove the alpha code for setting it unconditionally, since
there is no SMP case for alpha and the code had rotted.

Parts reviewed by:	dfr, phk
1999-02-28 10:53:29 +00:00
Tor Egge 79a7a64b85 Don't call assign_apic_irq with a value for irq that is out of range. 1999-02-26 03:42:50 +00:00
Bruce Evans 1b0b259ed2 Don't forget to update `switchticks' in corner cases (except for
the alpha fork_trampoline(), forget it because it I believe it is
only necessary for the unsupported SMP case).
1999-02-25 11:03:08 +00:00
Bruce Evans 025a06fd58 Added a per-cpu variable `switchticks' for use in scheduling. 1999-02-22 15:13:34 +00:00
Nick Hibma 1571f899d2 Rename hid device to uhid (HID: Human Interface Device) 1999-02-21 16:23:23 +00:00
Nick Hibma af1b53b1f1 Removed uhub from list. Mandatory with usb device and this was already
forced in conf/files. Unneccessary entry.
1999-02-20 23:29:24 +00:00
David E. O'Brien 2402b9a1db Really make the "Rename nlpt to lpt." purported to have been made in
rev 1.149.
1999-02-20 21:12:24 +00:00
Ollivier Robert 0230aa3bea Bit 24 of the Feature Flag is FXSR (for Fast FP Save and Restore).
Reminded by: Francis Dupont <Francis.Dupont@inria.fr>
1999-02-20 19:46:39 +00:00
Luoqi Chen 1c6d46f93c Introduce machine-dependent macro pgtok() to convert page count to number
of kilobytes. Its definition for each architecture could be optimized to
avoid potential numerical overflows.
1999-02-19 19:34:49 +00:00
Luoqi Chen b1028ad122 Hide access to vmspace:vm_pmap with inline function vmspace_pmap(). This
is the preparation step for moving pmap storage out of vmspace proper.

Reviewed by:	Alan Cox	<alc@cs.rice.edu>
		Matthew Dillion	<dillon@apollo.backplane.com>
1999-02-19 14:25:37 +00:00
John Polstra 0aca4b60dc On the i386, load the ELF dynamic linker where an mmap(0, ...) would
put it, just like on the Alpha.  It was wrong to load it at the
fixed address 0x08000000.  That should only be done if the dynamic
linker is an executable (not a shared object) with a specific load
address encoded in the object file itself.

This fixes the recent breakage in the Linux emulator.
1999-02-19 01:30:43 +00:00
Garrett Wollman 29c6a10b58 Add a little bit more identifying information to the myriad PCI network
drivers.
1999-02-18 01:13:40 +00:00
Doug Rabson ce02431ffa * Change sysctl from using linker_set to construct its tree using SLISTs.
This makes it possible to change the sysctl tree at runtime.

* Change KLD to find and register any sysctl nodes contained in the loaded
  file and to unregister them when the file is unloaded.

Reviewed by: Archie Cobbs <archie@whistle.com>,
	Peter Wemm <peter@netplex.com.au> (well they looked at it anyway)
1999-02-16 10:49:55 +00:00
Jordan K. Hubbard 7d0d5e18d4 MF3: add SYSVMSG 1999-02-14 20:28:38 +00:00
Nicolas Souchu fdf94d1afe Rename nlpt to lpt.
Remove from ppi.c the old depreciated module stuff.
Print info when if_plip can't use interrupts.
1999-02-14 12:00:00 +00:00
Bruce Evans 2088de1b49 Don't pass PSL_NT to vm86 signal handlers. Some vm86/real mode
programs, including msdos, set PSL_NT in probes for old cpu types,
although PSL_NT doesn't do anything useful in vm86 or real mode.
PSL_NT is even less useful in the signal handlers.  It just causes
T_TSSFLT faults on return from syscalls made by the handlers.
These faults are fixed up lazily so that Xsyscall() doesn't have
to be slowed down to prevent them.  The fault handler recently
started complaining about these faults occurring "with interrupts
disabled".  It should not have, but the complaints pointed to this
bug.

PR:		9211
1999-02-13 17:45:15 +00:00
Mike Smith e4a5d947a3 Zero p->retval[1] when starting a process. This value ends up in %edx
when the process starts, and having it nonzero causes statically-linked
Linux binaries to fail.

PR:		i386/10015
Submitted by:	Marcel Moolenaar <marcel@scc.nl>
1999-02-11 07:53:28 +00:00
Joseph Koshy 04e83575bc Fix typos 1999-02-11 06:07:27 +00:00
Dag-Erling Smørgrav de7462ba59 Use ppbus instead of the lpt driver. Throw in a (commented-out) vpo entry
for good measure.
1999-02-10 02:18:31 +00:00
Matthew Dillon dd2f9956e2 Adjust idle zero-page fill hysteresis based on tests. Use 2/3 and 4/5
zero-fill levels.

    Adjust comment for ozfod in vmmeter.h - this counter represents
    non-optimal ( on the fly ) zero fills, not prefills.
1999-02-08 02:42:13 +00:00
Matthew Dillon faa273d5c2 Rip out PQ_ZERO queue. PQ_ZERO functionality is now combined in with
PQ_FREE.  There is little operational difference other then the kernel
    being a few kilobytes smaller and the code being more readable.

    * vm_page_select_free() has been *greatly* simplified.
    * The PQ_ZERO page queue and supporting structures have been removed
    * vm_page_zero_idle() revamped (see below)

    PG_ZERO setting and clearing has been migrated from vm_page_alloc()
    to vm_page_free[_zero]() and will eventually be guarenteed to remain
    tracked throughout a page's life ( if it isn't already ).

    When a page is freed, PG_ZERO pages are appended to the appropriate
    tailq in the PQ_FREE queue while non-PG_ZERO pages are prepended.
    When locating a new free page, PG_ZERO selection operates from within
    vm_page_list_find() ( get page from end of queue instead of beginning
    of queue ) and then only occurs in the nominal critical path case.  If
    the nominal case misses, both normal and zero-page allocation devolves
    into the same _vm_page_list_find() select code without any specific
    zero-page optimizations.

    Additionally, vm_page_zero_idle() has been revamped.  Hysteresis has been
    added and zero-page tracking adjusted to conform with the other changes.
    Currently hysteresis is set at 1/3 (lo) and 1/2 (hi) the number of free
    pages.  We may wish to increase both parameters as time permits.  The
    hysteresis is designed to avoid silly zeroing in borderline allocation/free
    situations.
1999-02-08 00:37:36 +00:00
John Polstra 47633640aa Change the load address of the ELF dynamic linker from "2L*MAXDSIZ"
to an architecture-specific value defined in <machine/elf.h>.  This
solves problems on large-memory systems that have a high value for
MAXDSIZ.

The load address is controlled by a new macro ELF_RTLD_ADDR(vmspace).
On the i386 it is hard-wired to 0x08000000, which is the standard
SVR4 location for the dynamic linker.

On the Alpha, the dynamic linker is loaded MAXDSIZ bytes beyond
the start of the program's data segment.  This is the same place
a userland mmap(0, ...) call would put it, so it ends up just below
all the shared libraries.  The rationale behind the calculation is
that it allows room for the data segment to grow to its maximum
possible size.

These changes have been tested on the i386 for several months
without problems.  They have been tested on the Alpha as well,
though not for nearly as long.  I would like to merge the changes
into 3.1 within a week if no problems have surfaced as a result of
them.
1999-02-07 23:49:56 +00:00
Adam David 38ebe5624f replace previous stupid comment with one more appropriate
where it will be easily found
1999-02-04 22:34:23 +00:00
Adam David 431552d221 remind that apm is required in order for timekeeping to work 1999-02-04 18:08:55 +00:00
KATO Takenori 921bc385e8 Recognize Pentium II Xeon, Celeron and Pentium III cpus. Because CPU
names are printed on their packages and shown by BIOS, kernel does not
need to show details.

PR:		8751, 9320 and 9463
1999-02-04 16:48:26 +00:00
David Greenman cf7d145389 Fixed the type of target_page to vm_offset_t (unsigned). This fixes a
panic during boot on machines with >=2GB of RAM. Also changed some
incorrect printf conversion specifiers from %d to %u (signed to unsigned).
This fixes bugs when printing the amount of memory on machines with >=2GB
of RAM.
1999-02-03 14:10:50 +00:00
Bruce Evans bb25f0dd23 Check for signals while reading /dev/urandom. Reading 10MB from
/dev/urandom takes about 38 seconds on a P5/133.  It is useful
to be able to kill such reads almost immediately.  Processes
doing such reads are now scheduled so their denial of service
is no worse than that of processes looping in user mode.
1999-02-02 14:14:05 +00:00
Bruce Evans 79a2501238 Added a hopefully-machine-independent macro for determining if a
reschedule is pending.
1999-02-02 09:08:23 +00:00
KATO Takenori 4c51e923e0 Use offset to _pc98_system_parameter instead of immediate value which
assumes KERNBASE=0x100000.
1999-01-31 02:04:43 +00:00
KATO Takenori 1463f029a5 Moved pc98_system_parameter from .text to .data to make ELF kernel
work.
1999-01-30 15:38:48 +00:00
Matthew Dillon bc81493155 More const fixes for -Wall, -Wcast-qual 1999-01-29 23:18:50 +00:00
Matthew Dillon 3cfc69e6c2 More -Wall / -Wcast-qual cleanup. Also, EXEC_SET can't use
C_DECLARE_MODULE due to the linker_file_sysinit() function
    making modifications to the data.
1999-01-29 08:36:45 +00:00
Mark Newton 27286ca9a8 Sun Bug ID 1251858 (on http://sunsolve1.sun.com) discusses the way that
Sun implemented iBCS2 compatibility on Solaris >= 2.6:  The emulator
runs in user-mode, patching the LDT so that client programs making
syscalls through the old iBCS2 call gate get handled by the emulator
process.  Unemulated syscalls therefore need their own call-gate that
bypasses the emulator.  Sun chose LDT entry 4 to implement this, which
is what we've been using as LUDATA_SEL, so we need to change LUDATA_SEL
if we want to run Solaris executables.

Discussed with: Mike Smith
1999-01-28 11:45:49 +00:00
Matthew Dillon 0a5e03dda5 Fix warnings in preparation for adding -Wall -Wcast-qual to the
kernel compile
1999-01-28 01:59:53 +00:00
Matthew Dillon fe08c21a53 Fix warnings in preparation for adding -Wall -Wcast-qual to the
kernel compile.

    This commit includes significant work to proper handle const arguments
    for the DDB symbol routines.
1999-01-27 23:45:44 +00:00
Eivind Eklund 8d25715cfb Add ISA PnP support, now that we have the space for it. 1999-01-27 15:34:25 +00:00
Matthew Dillon 7dbf82dc13 Change all manual settings of vm_page_t->dirty = VM_PAGE_BITS_ALL
to use the vm_page_dirty() inline.

    The inline can thus do sanity checks ( or not ) over all cases.
1999-01-24 06:04:52 +00:00
Matthew Dillon 1c7c3c6a86 This is a rather large commit that encompasses the new swapper,
changes to the VM system to support the new swapper, VM bug
    fixes, several VM optimizations, and some additional revamping of the
    VM code.  The specific bug fixes will be documented with additional
    forced commits.  This commit is somewhat rough in regards to code
    cleanup issues.

Reviewed by:	"John S. Dyson" <root@dyson.iquest.net>, "David Greenman" <dg@root.com>
1999-01-21 08:29:12 +00:00
Jordan K. Hubbard c71d51c375 Make more messages conditional on bootverbose 1999-01-20 04:24:22 +00:00
Peter Wemm 8d3e670c7d Break configure() into a couple of stages to allow insertion of
hooks (eg: by drivers or (pre)loadable modules into a convenient spot.
1999-01-19 00:10:59 +00:00
KATO Takenori 4b05574297 There are two models of AMD K6-2 Model 8 (c.f. AMD's document), so the
CPU stepping must be checked.  Also, fixed print_AMD_info.

Submitted by:	Akio Morita <amorita@meadow.scphys.kyoto-u.ac.jp>
1999-01-16 13:41:33 +00:00
Mike Smith 8664a77199 Fetch an overide for NMBCLUSTERS from the kernel environment. Never allow
the value to be reduced below that defined when the kernel was built.
1999-01-15 17:24:05 +00:00
Eivind Eklund 1950f59007 Silence warnings. 1999-01-12 00:19:33 +00:00
Eivind Eklund fd8d7e3875 Silence warnings by removing unused convenience function and
globalizing debugging functions.
1999-01-12 00:17:53 +00:00
Kazutaka YOKOTA 2ad872c579 The first stage of console driver reorganization: activate new
keyboard and video card drivers.

Because of the changes, you are required to update your kernel
configuration file now!

The files in sys/dev/syscons are still i386-specific (but less so than
before), and won't compile for alpha and PC98 yet.

syscons still directly accesses the video card registers here and
there; this will be rectified in the later stages.
1999-01-11 03:18:56 +00:00
Dmitrij Tejblum c197d61d7a Oops --<, replace 1.216 with a version that actually check pv_entries (and
was tested for month or two in production).

Noticed by:	Stephen McKay

Stephen also suggested to remove the complication at all. I don't do it as
it would be backout of a large part of 1.190 (from 1998/03/16)...
1999-01-09 21:41:22 +00:00
Bill Paul 31188d61c1 Add driver support (and man page) for PCI fast ethernet cards based
on the ASIX AX88140A chip. Update /sys/conf/files, RELNOTES.TXT,
/sys/i388/i386/userconfig.c, sysinstall/devices.c, GENERIC and LINT
accordingly.

For now, the only board that I know of that uses this chip is the
Alfa Inc. GFC2204. (Its predecessor, the GFC2202, was a DEC tulip card.)
Thanks again to Ulf for obtaining the board for me. If anyone runs
across another, please feel free to update the man page and/or the
release notes. (The same applies for the other drivers.)

FreeBSD should now have support for all of the DEC tulip workalike
chipsets currently on the market (Macronix, Lite-On, Winbond, ASIX).
And unless I'm mistaken, it should also have support for all PCI fast
ethernet chipsets in general (except maybe the SMC FEAST chip, which
nobody seems to ever use, including SMC). Now if only we could convince
3Com, Intel or whoever to cough up some documentation for gigabit
ethernet hardware.

Also updated RELNOTEX.TXT to mention that the SVEC PN102TX is supported
by the Macronix driver (assuming you actually have an SVEC PN102TX with
a Macronix chip on it; I tried to order a PN102TX once and got a box
labeled 'Hawking Technology PN102TX' that had a VIA Rhine board inside
it).
1999-01-09 18:12:08 +00:00
Bruce Evans 1dfc2ef25c Removed a stray label that broke compiling in the (elf && profiling) case.
PR:		9369
Submitted by:	Assar Westerlund <assar@sics.se>
1999-01-09 17:29:38 +00:00
Bruce Evans b5be346ff7 Fixed switching between consoles (sc0, vt0 or sioN) in userconfig.
Broken in:		rev.1.315
1999-01-09 15:41:49 +00:00
Bruce Evans c65da0c71e Don't put operands in clobber lists, since this is dubious for old
versions of gcc and broken for current versions of egcs.

Cleaned up the asm statement for do_cpuid() a little.

Submitted by:	"John S. Dyson" <dyson@iquest.net> but rewritten by me
1999-01-09 13:07:18 +00:00
Bruce Evans 896763fa9e Don't put operands in clobber lists, since this is dubious for old
versions of gcc and broken for current versions of egcs.

Submitted by:	"John S. Dyson" <dyson@iquest.net> but rewritten by me
1999-01-09 13:00:27 +00:00
Bruce Evans f48bbd5fb8 Fixed some style bugs. Clarified a comment. 1999-01-08 19:51:02 +00:00
Bruce Evans 2a32c15f45 Unspammed includes in <machine/cpufunc.h> in the !SMP case. Partially
unspammed them in the SMP case.
1999-01-08 19:17:49 +00:00
Bruce Evans 68ba369606 Moved declarations related to copying and zeroing to the right place. 1999-01-08 16:29:59 +00:00
Luoqi Chen fcf37ac337 Allocate kernel page table object (kptobj) before any kmem_alloc calls.
On a system with a large amount of ram (e.g. 2G), allocation of per-page
data structures (512K physical pages) could easily bust the initial kernel
page table (36M), and growth of kernel page table requires kptobj.
1999-01-08 14:20:54 +00:00
Dmitrij Tejblum 6143bceb3f Make pmap_ts_referenced check more than 1 pv_entry. (One should be carefull
when move elements to the tail of a list in a loop...)
1999-01-07 22:15:51 +00:00
Kazutaka YOKOTA fc847f6651 Remove a hard-coded table of kernel console I/O functions exported
from sc, vt and sio drivers.  Use instead a linker_set to collect them.

Staticize ??cngetc(), ??cnputc(), etc functions in sc and vt drivers.
We must still have siocngetc() and siocnputc() as globals because they
are directly referred to by i386-gdbstub.c :-(

Oked by: bde
1999-01-07 14:14:24 +00:00
Julian Elischer 2267af789e Add (but don't activate) code for a special VM option to make
downward growing stacks more general.
Add (but don't activate) code to use the new stack facility
when running threads, (specifically the linux threads support).
This allows people to use both linux compiled linuxthreads, and also the
native FreeBSD linux-threads port.

The code is conditional on VM_STACK. Not using this will
produce the old heavily tested system.

Submitted by: Richard Seaman <dick@tar.com>
1999-01-06 23:05:42 +00:00
Kazutaka YOKOTA 2d15a1badc Move IO_PSMSIZE from kbdio.h to isa.h. I thought I did this a long time
ago...

While I am here, correct the values for IO_MDASIZE and IO_CGASIZE; they
should be 12 rather than 16.
1999-01-06 05:40:01 +00:00
Peter Wemm c19da41ebb Part 1 of pcvt/voxware revival. I hope I have not clobbered any other
deltas, but it is possible since I had a few merge conflicts over the last
few days while this has been sitting ready to go.

Approved by:	core
1999-01-01 08:09:58 +00:00
Mike Smith 9959b1a882 Improved DDB_UNATTENDED behaviour. From the submitter:
There's something that's been bugging me for a while, so I decided to fix it.
FreeBSD now will DTRT WRT DDB and DDB_UNATTENDED (!debugger_on_panic), at least
in my opinion. The behavior change is such that:

	1. Nothing changes when debugger_on_panic != 0.
	2. When DDB_UNATTENDED (!debugger_on_panic), if a panic occurs, the
		machine will reboot. Also, if a trap occurs, the machine will
		panic and reboot, unlike how it broke to DDB before. HOWEVER,
		a trap inside DDB will not cause a panic, allowing full use
		of DDB without having to worry about the machine being stuck
		at a DDB prompt if something goes wrong during the day.
		Patches for this behavior follow my signature, and it would
		be a boon to anyone (like me) who uses DDB_UNATTENDED, but
		actually wants the machine to panic on a trap (otherwise,
		what's the use, if the machine causes a fatal trap rather than
		a true panic, of debugger_on_panic?). The changes cause no
		adverse behavior, but do involve two symbols becoming global

Submitted by:	Brian Feldman <green@unixhelp.org>
1998-12-28 23:03:00 +00:00
Mike Smith 925f368193 From the submitter:
CPU_WT_ALLOC does not work correctly for K6-2s of model 8+ and
probably K6-3s (when they appear on the market soon). In addition,
print_AMD_info() incorrectly printfs write allocation's size. I've
fixed them, so they now Do The Right Thing, and added a
"NO_MEMORY_HOLE" option to easily allow 15-16mb range handling for us
K6 and K6-2 users.

Submitted by:	Brian Feldman <green@unixhelp.org>
1998-12-27 23:23:26 +00:00
Søren Schmidt fe43354884 Pre 3.0 branch cleanup sos#1: wcd
Superceded by acd driver...
1998-12-27 13:55:48 +00:00
Poul-Henning Kamp fc47545ec3 Pre 3.0 branch cleanup casualty #6: ft 1998-12-27 13:40:57 +00:00
Poul-Henning Kamp 8fab58d8f2 Add commented out SMP stuff in GENERIC, remove stale configs. 1998-12-27 13:12:59 +00:00
Poul-Henning Kamp 11ceeec231 Pre 3.0 branch cleanup casualty #5: nca, sea, wds, uha
No CAM drivers available.  If somebody CAMifies one of these, they
will be welcome back in the tree
1998-12-27 13:06:44 +00:00
Poul-Henning Kamp 9034de81c2 Pre 3.0 branch cleanup casualty #4: pcvt 1998-12-27 12:52:46 +00:00
Bruce Evans 4c56fcdead Removed the cast to a pointer in the definition of PS_STRINGS and
adjusted related casts to match (only in the kernel in this commit).
The pointer was only wanted in one place in kern_exec.c.  Applications
should use the kern.ps_strings sysctl instead of PS_STRINGS, so they
shouldn't notice this change.
1998-12-16 16:28:58 +00:00
Bruce Evans 4f2129fa86 Removed bogus casts of USRSTACK and/or the other operand in binary
expressions involving USRSTACK.
1998-12-16 15:21:51 +00:00
Bruce Evans 407e5f394f Moved the declaration of another non-SMP variable into the non-SMP section. 1998-12-14 19:16:17 +00:00
Bruce Evans 0be036c31a Ifdefed the declarations of conditionally used variables. 1998-12-14 18:21:34 +00:00
Stephen McKay 2619394c7c Fix tabs that should have been spaces. Some were in kernel error messages. 1998-12-14 13:30:29 +00:00
Matthew Dillon 9402b52081 Get rid of uninitialized variable warnings. No bugs found, just
preinitializing some locals to 0 to get rid of the compiler warnings.
1998-12-14 06:16:13 +00:00
Matthew Dillon c5a8ae50dd author was assuming that nextpaddr declared *inside* the do loop would
survive within the loop.  This is not guarenteed by C.  I have moved
    the nextpaddr declaration to outside the do loop.
1998-12-14 05:35:56 +00:00
Matthew Dillon 98848ba89a Change local ddb_mode variable to volatile to handle GCC warning about
the variable possibly being clobbered by setjmp/longjmp.
1998-12-14 05:34:33 +00:00
Nick Hibma eca58e5e00 dded the stubs for umodem and ucom (communications class driver). They are nothing other than
the ugen driver with different variable names.
1998-12-13 23:04:35 +00:00
Steve Price b6e744b572 Cleanup up the wording for the F00F bug workaround message.
PR:		8041
Submitted by:	Dan Nelson <dnelson@emsphone.com>
1998-12-10 01:49:01 +00:00
Nick Hibma a48e33e094 Preliminary support for OHCI motherboards 1998-12-09 23:28:43 +00:00
KATO Takenori 8b14dec9ba Use CNAME macro for pc98_system_parameter, which is referenced from C
source.

Submitted by:	Masanori Kanaoka <kana@saijo.mke.mei.co.jp>
1998-12-08 10:22:31 +00:00
Archie Cobbs f1d19042b0 The "easy" fixes for compiling the kernel -Wunused: remove unreferenced static
and local variables, goto labels, and functions declared but not defined.
1998-12-07 21:58:50 +00:00
Archie Cobbs 2326715f79 Avoid compiler warning (printf arg type mismatch) when compiling #ifdef DEBUG 1998-12-06 00:03:30 +00:00
KATO Takenori e697d57628 Print out information for write-allocate of AMD CPUs.
Submitted by:	Akio Morita <amorita@meadow.scphys.kyoto-u.ac.jp>
1998-12-05 16:30:55 +00:00
Archie Cobbs 2127f26023 Examine all occurrences of sprintf(), strcat(), and str[n]cpy()
for possible buffer overflow problems. Replaced most sprintf()'s
with snprintf(); for others cases, added terminating NUL bytes where
appropriate, replaced constants like "16" with sizeof(), etc.

These changes include several bug fixes, but most changes are for
maintainability's sake. Any instance where it wasn't "immediately
obvious" that a buffer overflow could not occur was made safer.

Reviewed by:	Bruce Evans <bde@zeta.org.au>
Reviewed by:	Matthew Dillon <dillon@apollo.backplane.com>
Reviewed by:	Mike Spengler <mks@networkcs.com>
1998-12-04 22:54:57 +00:00
Bill Paul 726ff6a158 An early Christmas present: add driver support for a whole bunch of
PCI fast ethernet adapters, plus man pages.

if_pn.c: Netgear FA310TX model D1, LinkSys LNE100TX, Matrox FastNIC 10/100,
         various other PNIC devices

if_mx.c: NDC Communications SOHOware SFA100 (Macronix 98713A), various
         other boards based on the Macronix 98713, 98713A, 98715, 98715A
         and 98725 chips

if_vr.c: D-Link DFE530-TX, other boards based on the VIA Rhine and
         Rhine II chips (note: the D-Link and certain other cards
         that actually use a Rhine II chip still return the PCI
         device ID of the Rhine I. I don't know why, and it doesn't
         really matter since the driver treats both chips the same
         anyway.)

if_wb.c: Trendware TE100-PCIE and various other cards based on the
         Winbond W89C840F chip (the Trendware card is identical to
         the sample boards Winbond sent me, so who knows how many
         clones there are running around)

All drivers include support for ifmedia, BPF and hardware multicast
filtering.

Also updated GENERIC, LINT, RELNOTES.TXT, userconfig and
sysinstall device list.

I also have a driver for the ASIX AX88140A in the works.
1998-12-04 18:01:24 +00:00
KATO Takenori 9ad861edee - For some old Cyrix CPUs, %cr2 is clobbered by interrupts. This
problem is worked around by using an interrupt gate for the page
   fault handler.  This code was originally made for NetBSD/pc98 by
   Naofumi Honda <honda@kururu.math.sci.hokudai.ac.jp> and has already
   been in PC98 tree.  Because of this bug, trap_fatal cannot show
   correct page fault address if %cr2 is obtained in this function.
   Therefore, trap_fatal uses the value from trap() function.
-  The trap handler always enables interruption when buggy application
   or kernel code has disabled interrupts and then trapped.  This code
   was prepared by Bruce Evans <bde@FreeBSD.org>.

Submitted by:	Bruce Evans <bde@FreeBSD.org>
		Naofumi Honda <honda@kururu.math.sci.hokudai.ac.jp>
1998-12-02 08:15:17 +00:00
Poul-Henning Kamp 5986967ee2 don't print '?' for ioaddr the device may legitimately not have an
ioaddr.
1998-11-29 15:42:40 +00:00
Tor Egge 18830dba83 Don't forget to update the pmap associated with aio daemons when adding
new page directory entries for a growing kernel virtual address space.
1998-11-27 01:14:21 +00:00
Tor Egge f0ac792bec Attempt to handle interrupts delivered to all IO APICs by using the first
IO APIC with a sufficient number of pins.
1998-11-26 23:14:23 +00:00
Nick Hibma 0cec007c5f Initial commit of ported NetBSD USB stack 1998-11-26 23:13:13 +00:00
Eivind Eklund 9fcdafaefc Staticize. 1998-11-26 18:50:24 +00:00
Eivind Eklund 38cc2d9316 Move the declaration of PPro_vmtrr from the header file to pmap.c,
replacing the one in the header file with a definition.  This makes it
easier to work with tools that grok ANSI C only.
1998-11-24 20:25:52 +00:00
David E. O'Brien 58371a7e38 Remove amd', nca' SCSI devices to match Mike's LINT commit. 1998-11-12 11:29:28 +00:00
Doug Rabson 7095ee912b * Fix a couple of places in the device pager where an address was
truncated to 32 bits.
* Change the calling convention of the device mmap entry point to
  pass a vm_offset_t instead of an int for the offset allowing
  devices with a larger memory map than (1<<32) to be supported
  on the alpha (/dev/mem is one such).

These changes are required to allow the X server to mmap the various
I/O regions used for device port and memory access on the alpha.
1998-11-08 12:39:07 +00:00
Mike Smith 1916cd2927 Enable 686 class optimisations for all 686-class processors, not just the
Pentium Pro.  This resolves the "Dog slow SMP" issue for Pentium II
systems.
1998-11-08 02:26:14 +00:00
Dag-Erling Smørgrav fb46af4f6c Back out previous commit. The bpfilter -> bpf transition will have to be a
flag day unless we can hack config(8) to smooth things over.
1998-11-03 22:01:22 +00:00
Dag-Erling Smørgrav 10b4ab477f Rename the 'bpfilter' pseudo-device to 'bpf'. The old syntax is still legal
and will stick around for a while.
1998-11-03 21:12:20 +00:00
Mike Smith ec2a20b046 Remove the USERCONFIG_BOOT option. Userconfig script data is searched
for in a loaded module of type "userconfig_script".  The RB_CONFIG
flag will always result in the user being left inside userconfig at
the end of the script's execution, regardless of 'quit' commands in
the script.  If the RB_CONFIG flag is not specified, the user will
never be left inside userconfig, even if the script does not have an
explicit exit command.

Add the INTRO_USERCONFIG option.  This option forces the userconfig 'intro'
screen (after a script has optionally been executed).  There is no longer
a need to queue an 'intro' command.
1998-11-03 21:07:51 +00:00
Peter Wemm b0359e2c11 Add John Dyson's SYSCTL descriptions, and an export of more stats to
a sysctl hierarchy (vm.stats.*).  SYSCTL descriptions are only present
in source, they do not get compiled into the binaries taking up memory.
1998-10-31 17:21:31 +00:00
Mike Smith 35d27a0f39 Add the ability to specify where on the at_shutdown queue a handler is
installed.

Remove cpu_power_down, and replace it with an entry at the end of the
SHUTDOWN_FINAL queue in the only place it's used (APM).

Submitted by:	Some ideas from Bruce Walter <walter@fortean.com>
1998-10-30 05:41:15 +00:00
Garrett Wollman 46365a874a A small fragment of new ISA framework: manifest constants for the resources
implemented by the i386 root nexus.
1998-10-29 01:56:23 +00:00
David Greenman 730075613a Added a second argument, "activate" to the vm_page_unwire() call so that
the caller can select either inactive or active queue to put the page on.
1998-10-28 13:37:02 +00:00
Bruce Evans 83d5d944d0 Check the major number of the boot device more carefully. There was only
a problem if the boot blocks passed bad data.

Check the major number of the dump device consistently.
1998-10-26 07:05:34 +00:00
Poul-Henning Kamp d259be02bc Update timecounters to new interface. 1998-10-23 10:46:20 +00:00
Bruce Evans 4a04f6f613 Quote port names that have a digit in them. IO_TIMER1 was lexed as
{ port_name = "IO_TIMER", port_number = 1 } and only worked because
it was reassembled to "IO_TIMER1".  Trailing digits always work, but
this is too magic to depend on.

Don't quote port names that don't have a digit in them.
1998-10-22 13:49:51 +00:00
Bruce Evans 78e33712bb Removed all `vector xxxintr' specifications. Interrupt handlers are now
configured in drivers.
1998-10-22 12:23:04 +00:00
Bruce Evans fe310de802 Initialize isa_devtab entries for interrupt handlers in individual
device drivers, not in ioconf.c.  Use a different hack in isa_device.h
so that a new config(8) is not required yet.

pc98 parts approved by: kato
1998-10-22 05:58:45 +00:00
David Greenman 9b827155f8 Decrement the now unused page table page's wire_count prior to freeing it.
It will soon be required that pages have a zero wire_count when being
freed.
1998-10-21 11:38:14 +00:00
Bill Paul 589e38a609 Add driver support for PCI fast ethernet adapters based on the
RealTek 8129/8139 chipset like I've been threatening. Update kernel
configs, userconfig.c, relnotes and sysinstall. No man page yet;
comming soon.

I consider this driver stable enough that I want to give it some
exposure in -current.
1998-10-18 16:24:34 +00:00
Peter Wemm 034db87204 Add an ELF_MACHINE_OK() macro for compatability with the Alpha version. 1998-10-18 15:31:23 +00:00
Peter Wemm aa855a598d *gulp*. Jordan specifically OK'ed this..
This is the bulk of the support for doing kld modules.  Two linker_sets
were replaced by SYSINIT()'s.  VFS's and exec handlers are self registered.
kld is now a superset of lkm.  I have converted most of them, they will
follow as a seperate commit as samples.
This all still works as a static a.out kernel using LKM's.
1998-10-16 03:55:01 +00:00
David E. O'Brien d1436a882b Add commented out bpf entry. (DHCP is popular here, and this is required).
Ok'ed by:	jkh
1998-10-16 01:30:11 +00:00
David Greenman 6cde7a165f Fixed two potentially serious classes of bugs:
1) The vnode pager wasn't properly tracking the file size due to
   "size" being page rounded in some cases and not in others.
   This sometimes resulted in corrupted files. First noticed by
   Terry Lambert.
   Fixed by changing the "size" pager_alloc parameter to be a 64bit
   byte value (as opposed to a 32bit page index) and changing the
   pagers and their callers to deal with this properly.
2) Fixed a bogus type cast in round_page() and trunc_page() that
   caused some 64bit offsets and sizes to be scrambled. Removing
   the cast required adding casts at a few dozen callers.
   There may be problems with other bogus casts in close-by
   macros. A quick check seemed to indicate that those were okay,
   however.
1998-10-13 08:24:45 +00:00
Bruce Evans a4e195e166 Don't print conflict messages in haveseen_isadev() if CC_QUIET is
specified.  This makes haveseen_isadev() useful for searching for a
free resource.  This increases the bitrot in the pci RESOURCE_CHECK
code.

Fixed the pre-attach conflict message.  The flag for distinguishing
pre-attach conflict checks from pre-probe ones was never set.
1998-10-12 13:12:45 +00:00
KATO Takenori 7344a7bb2e mp_machdep.c: Set a vector to boot code (PC-98).
locore.s: Tell the bios to warmboot next time (PC-98).
1998-10-10 13:37:16 +00:00
KATO Takenori 160ba1c5c8 PC-98 doesn't have CMOS ram. 1998-10-10 10:36:12 +00:00
KATO Takenori ed68ba2cd0 PC-98 doesn't have CMOS ram. 1998-10-10 09:38:02 +00:00
Jordan K. Hubbard cbe7e08892 Add entries for MFS which are consistent with the others, now that
Peter has made this more selectable.
1998-10-10 08:13:58 +00:00
Jordan K. Hubbard a33b93ff31 Allow more flexible use of MFS root.
Submitted by:	peter
1998-10-10 08:12:24 +00:00
Peter Wemm df9e84e0c0 Relocate the preload module info from machdep specifically rather than
trying to do it in locore.  We also walk through the module table
and relocate any MODINFO_ADDR pointers so that they become KVM relative
rather than physical addresses.  This means that hacks for adding
0xf0000000 in places like MFS go away.
1998-10-09 23:36:26 +00:00
Peter Wemm bde362f5e9 Null commit.. CVS aborted on freefall last time (reaonly file).
An elf_reloc() function for the i386.  Based on alpha/alpha/elf_machdep.c
and rtld-elf/i386/reloc.c.
1998-10-09 20:38:03 +00:00
Peter Wemm 033f58df20 An elf_reloc() function for the i386. Based on alpha/alpha/elf_machdep.c
and rtld-elf/i386/reloc.c.
1998-10-09 20:35:45 +00:00
Mike Smith d7a5acb5ec Initialise kernel environment and module metadata pointers. 1998-10-09 00:31:06 +00:00
Mike Smith 8ef367d43c Fix up the kernel environment and module data pointers in the bootinfo if
they are present.
If we are told where the end of the loaded kernel image is, believe it.
1998-10-08 21:03:41 +00:00
KATO Takenori 5baef6cd27 BIOS ROM base address is 0xe8000 on PC-98. 1998-10-08 16:15:22 +00:00
David E. O'Brien abd931ff18 Fix syntax errors I introduced. 1998-10-07 13:51:46 +00:00
Justin T. Gibbs 859244a61e Add entries for the adw device driver. 1998-10-07 03:42:44 +00:00
Justin T. Gibbs 9aa4621326 Fix a parent tag reference count bug during tag teardown.
Enable optimization for nobounce_dmamap clients by setting the map
held by the client to NULL.  This allows the macros in bus.h to check
against a constant to avoid function calls.

Don't attempt to 'free()' contigmalloced pages in bus_dmamem_free().
We currently leak these pages, which is not ideal, but is better than
a panic.  The leak will be fixed when contigmalloc is merged into the
bus dma framework after 3.0R.
1998-10-07 03:38:14 +00:00
KATO Takenori 4536af6a70 - Implement enabling write allocate on AMD K5/K6/K6-2 cpus.
The code was originaly contributed by Kelly Yancey
  <kbyanc@freedomnet.com> in PR i386/6269 and revised by Akio Morita
  <amorita@meadow.scphys.kyoto-u.ac.jp> and me.  Test was performed by
  Akio Morita and Toshiomi Moriki <moriki@db.is.kyushu-u.ac.jp>.
- Fix stylistic bug in identcpu.c.
- Update copyright in initcpu.c
- Fix typo in LINT.

PR:		6269 and 6270
1998-10-06 13:16:29 +00:00
David E. O'Brien 1afb40e2c2 Undo most of the previous commit. 1998-10-05 21:09:21 +00:00
David E. O'Brien b208455ad7 Now require *FS_ROOT to enable the ability to mount a *FS /.
Previously one could config(8) a kernel that would not link.
1998-10-05 11:28:27 +00:00
David E. O'Brien a788bdc476 Document that `options xFS_ROOT'' requires the associated `options xFS''.
Reordered xFS_ROOT's to be below the associated xFS.
1998-10-05 07:45:54 +00:00
Jordan K. Hubbard 6335d18e9b Add dpt driver back to GENERIC and adjust a stale comment. 1998-10-03 17:09:00 +00:00
Mike Smith d35326ae28 Remove lpt1 - we have userconfig if you have a weird port.
Remove mse0 - the Microsoft Bus Mouse is a dinosaur.  There are probably
              more Pintos on the road than these on peoples' desks.
1998-10-01 19:35:28 +00:00
Andrzej Bialecki dede34d355 Add sysctl 'machdep.msgbuf_clear'. Setting it to anything causes the
kernel message buffer to be cleared. It comes handy in situations when
the only logging facility you have is the msgbuf.

Reviewed by:	jkh
1998-09-29 11:20:16 +00:00
Bruce Evans 0c71101cb7 Don't pretend to support ix86's with 16-bit ints by using longs just
to ensure 32-bit variables.  Doing so broke ix86's with 64-bit longs.
1998-09-29 09:06:00 +00:00
Tor Egge a16edda365 Initialize pcb_mpnest to 1 in the child process in cpu_fork(). This should
fix the 50% idle problem that the ELF /sbin/init triggered.  The problem
appeared when the last context switch before a fork() call was due to
the kernel faulting in user pages via normal page faults (e.g. copyin).
Reviewed by:	Peter Wemm <peter@netplex.com.au>
1998-09-28 03:34:39 +00:00
Tor Egge 8fce521a54 Use correct virtual address when configuring the per CPU idle page directory
for a vm86 call under SMP.
1998-09-28 03:26:22 +00:00
Peter Wemm 10baba4b95 Goodbye BOUNCE_BUFFERS, for a hack it has served us well.
The last consumer of this code (the old SCSI system) has left us and
the CAM code does it's own bouncing.  The isa dma system has been
doing it's own bouncing for a while too.

Reviewed by:	core
1998-09-25 17:34:49 +00:00
Bruce Evans dade759d9f Don't redefine kernel. Makefile.i386 now defines it.
Removed some unused includes.
1998-09-24 10:22:21 +00:00
Bruce Evans 6ed49410a5 Attempt to work around a bug in the previous commit related to
non-reentrancy of SMP clock locking.  Depend on the giant lock
protecting clkintr().
1998-09-20 19:56:28 +00:00
Bruce Evans a6796db6ce Ensure that the i8254 timecounter doesn't go backards. It sometimes
went backwards when interrupts were masked for more than one i8254
interrupt period.  It sometimes went backwards when the i8254 counter
was reprogrammed.  Neither of these should happen in normal operation.

Update the i8254 timecounter support variables atomically.  Calling
timecounter functions from fast interrupt handlers may actually work
in all cases now.
1998-09-20 03:47:54 +00:00
Matt Jacob 3dd37e4387 (requested by gibbs) Remove the SCSI_CAM option (and rework the isp driver
that had depended on it for compilation within or without CAM to use
__FreeBSD_version instead).
1998-09-18 00:46:42 +00:00
Mike Smith c009fe307d Mark the syscons and pcvt drivers as being allowed to conflict, so that
well-meaning but uneducated users don't exterminate the psm driver in
their zeal to achieve zero conflicts.
1998-09-17 03:15:30 +00:00