to us, subr_bus.c will free it. This bug (panic: freeing already free)
was exposed by kern/subr_bus.c rev 1.54
Not explicitly approved by: jkh (but this is a showstopper and fallout of
the above approved change)
Enable the driver in sys/conf/files.i386.
In isa/isavar.h increase ISA_NPORT from 32 to 50. This is required
because this brain-damaged card maps 49 (!) port ranges. This does
not have a negative impact because this value only specifies the maximum
number of entries in a linked list and not the size of an array which
is allocated in all drivers.
The register/fifo access routines were not newbus-ified because
1) I knew that the old code worked and is simpler and more efficient
2) the if_ed driver does something similar and
3) the newbus macros collapse to inb/outb anyway.
Reviewed and tested by: hm
Approved by: jkh
1) Non-AST4 multiport cards were broken by bypassing the code that changes
`idev' to the multiport master device.
2) AST4 multiport cards apparently were broken by inverting the test for
the master device having an irq.
3) Error handling for nonexistent master devices was broken by removing a
check for a null pointer.
4) `int' error codes returned by bus_get_resource() were assigned directly
to the boolean variable com->no_irq. Probably harmless, since the
boolean is implemented as a u_char.
Submitted by: part 1) by Chris Radek <cradek@in221.inetnebr.com>
part 2) by yokota
Approved by: jkh
- trying for a fit for a PnP configuration from a device
- soaking up resources from a configuration that were not allocated by
the driver
do not attempt to activate them. Only a device driver that is aware of
the nature of the resource and its suitability can be certain that
activating a resource, particularly a memory resource, is a safe thing
to do.
This was prompted by the discovery that many systems report all physical
memory through a PNP0c02 device; activating this resource maps all
physical memory into the kernel's virtual space, either blowing out the
kernel pagetable or in the worst case causing a panic in pmap_mapdev()
if the system has too much physical memory.
Authorised by: jkh
Reviewed by: dfr
the same vendor and logical ID. The rest I am not sure whether they
are vendor or logical, but it won't hurt if I've put a vendor ID here
as merely will not match. These came from the old sio-pnp code, hence
the uncertainty about which ID it is.
and there may be a good reason for them being unallocated (eg. they're
nonsensical or not useful). The goal here is simply to reserve them
against accidental use by other code.
things like sound cards can get called "Parallel port". A note to the
unwary; the isa-pnp devices in the system are probed like PCI - each
device ID is passed to *all* isa probe routines to find the best match.
If the driver is not prepared to deal with this, it must abort in this
scenario or it will try and claim all PnP devices.
Note1: the correct interrupt level is invoked correctly for each driver.
For this purpose, drivers request the bus before being able to
call BUS_SETUP_INTR and BUS_TEARDOWN_INTR call is forced by the ppbus
core when drivers release it. Thus, when BUS_SETUP_INTR is called
at ppbus driver level, ppbus checks that the caller owns the
bus and stores the interrupt handler cookie (in order to unregister
it later).
Printing is impossible while plip link is up is still TRUE.
vpo (ZIP driver) and lpt are make in such a way that
using the ZIP and printing concurrently is permitted is also TRUE.
Note2: specific chipset detection is not done by default. PPC_PROBE_CHIPSET
is now needed to force chipset detection. If set, the flags 0x40
still avoid detection at boot.
Port of the pcf(4) driver to the newbus system (was previously directly
connected to the rootbus and attached by a bogus pcf_isa_probe function).
ddb is entered. Don't refer to `in_Debugger' to see if we
are in the debugger. (The variable used to be static in Debugger()
and wasn't updated if ddb is entered via traps and panic anyway.)
- Don't refer to `in_Debugger'.
- Add `db_active' to i386/i386/db_interface.d (as in
alpha/alpha/db_interface.c).
- Remove cnpollc() stub from ddb/db_input.c.
- Add the dbctl function to syscons, pcvt, and sio. (The function for
pcvt and sio is noop at the moment.)
Jointly developed by: bde and me
(The final version was tweaked by me and not reviewed by bde. Thus,
if there is any error in this commit, that is entirely of mine, not
his.)
Some changes were obtained from: NetBSD
It seems that the IDE system uses 0x3f6 for itself, which conflicts with
fdc's default 0x3f0-3f7 allocation range. Sigh. Work around this.
Use bus_set_resource() rather than allocating specific areas, it makes
the code a little cleaner.
Based on work by: dfr
o Rename FDC_PCMCIA to FDC_NODMA to allow systems that don't have dma
for floppies.
o Remove all but two FDC_YE ifdefs. They aren't needed.
o Move defines for YE_DATAPORT to fdreg.h.
Not fixed:
o The pccard probe/attach. However, motivated individuals can more
easily add this now.
This is a merge of changes I've had in my tree for a long time. These
fixes were tested on my VAIO with its normal floppy. Please let me
know if I broke anything.
Prodded by: Peter Wemm <peter@freebsd.org>
This is the hack that compensates for when bios vendors "forget" to
include the fdc control (0x3f7) port in their io port mappings. Instead
of accessing ports outside of a range allocated to a handle, simply
allocate the port directly. It even shows up in the probe..
In particular:
- Don't leave resources allocated in the probe routine. Allocate them
during probe and release them. Probe's job is to identify devices only.
- Don't abuse the ivars pointer.. (!). Create real ivars and use the
proper access system. (the bus_read_ivar method)
- Don't add the children until attach() has successfully grabbed the
hardware, otherwise there are potential leaks if attach fails.
the low level interrupt handler number should be used. Change
setup_apic_irq_mapping() to allocate low level interrupt handler X (Xintr${X})
for any ISA interrupt X mentioned in the MP table.
Remove an assumption in the driver for the system clock (clock.c) that
interrupts mentioned in the MP table as delivered to IOAPIC #0 intpin Y
is handled by low level interrupt handler Y (Xintr${Y}) but don't assume
that low level interrupt handler 0 (Xintr0) is used.
Don't allocate two low level interrupt handlers for the system clock.
Reviewed by: NOKUBI Hirotaka <hnokubi@yyy.or.jp>
is an application space macro and the applications are supposed to be free
to use it as they please (but cannot). This is consistant with the other
BSD's who made this change quite some time ago. More commits to come.
5in HD 2 heads, 77 cylinders, 8 sectors/track, 1024 bytes/sector
5/3.5in DD 2 heads, 80 cylinders, 8 sectors/track, 512 bytes/sector
Meanings of the rogrammer-readeble fd name were explained by Brian
Fundakowski Feldman and Peter Wemm in hackers list and NOKUBI
Hirotaka.
Reviewed by: nyan
apm_default_resume() to sometimes set a very wrong time.
(1) Accesses to the RTC index and data registers were not atomic enough.
Interrupts were not masked. This was only good enough until an
interrupt handler (rtcintr()) started accessing the RTC in FreeBSD-2.0.
(2) Access to the block of time registers in inittodr() was not atomic
enough. inittodr() has 244us to read the time registers. Interrupts
were not masked. This was only good enough until something (apm)
started calling inittodr() after boot time in FreeBSD-2.0.
The fix for (2) also makes the timecounter update more atomic, although
this is currently unimportant due to the low resolution of the RTC.
Problem reported by: mckay
of these are bound to have a PNP05xx compatid, but there's no easy way to
tell. Since it's just an ID list and uses the pnp header's description
strings rather than encoding strings here, it doesn't seem to be too
expensive to err on the safe side.
misdetecting FIFO capabilities, at least on my girlfriend's Thinkpad 755,
the driver doesn't work using the FIFO.
While i was at it, i (partially) fixed option FCC_YE since it would no
longer have compiled at all under -current. I've also made an attempt
to document the device driver flags value (ab-)used internally by this
option.
RELENG_3 candidate, but with a slightly different patch there (will go
to jkh in email).
o fix return type of sio_pccard_detach
o don't free softc in deatch, since that is done by newbus
o disconnect interrupt we used to have. Add cookie to com so that we can
tear down the interrupt on unload
o Set gone earlier, but likely doesn't matter
This makes sio pccards work again. Cards that are active when ejects may
not work (but they might, softc goes away quickly).
These changes are unreviewed by bde. I'll make any style changes he wants.
programming practices. It seems that newer fdc chips have an
alternative way of setting the transfer speed (including high speed
modes for floppy tape) that doesn't use the control register (which
we don't support - we use the old way only). So, they (the BIOS
programmers) sometimes leave out the 0x3f6 control register from
the PnP ports descriptor(!!). "Hey, it works with windows, so
what's the problem?" :-( Anyway, this hack tries to compensate
for that. This was discussed with dfr (who did the pnp attachment).
returns "0" on failure, which is indistinguishable from (say) irq 0. This
should stop a couple of stray messages that turn up.
Also, if a BUS_SETUP_INTR() fails with INTR_TYPE_FAST, try falling back to
a normal interrupt. This might help pccard folks with a shared slot
interrupt. This whole thing needs to be revisited.
joystick port on PnP sound cards that have a suitable device ID on them.
Doug Rabson added timer code so it didn't have to beat on the isa timer.
Submitted by: Takanori Watanabe <takawata@shidahara1.planet.sci.kobe-u.ac.jp>
device_add_child_ordered(). 'ivars' may now be set using the
device_set_ivars() function.
This makes it easier for us to change how arbitrary data structures are
associated with a device_t. Eventually we won't be modifying device_t
to add additional pointers for ivars, softc data etc.
Despite my best efforts I've probably forgotten something so let me know
if this breaks anything. I've been running with this change for months
and its been quite involved actually isolating all the changes from
the rest of the local changes in my tree.
Reviewed by: peter, dfr
problem.
o Create new timeout routine so we don't detach the card inside a ISR
but instead drop back to spl0 via a timeout of 0.
o Actually delete the child of the pccard device rather than just faking
it badly.
o Fix sio, ed and ep to have pccard detach routines that are int rather
than void.
o Fix ep and ed pccard detach routines to use if_detach rather than just
if_down. if_detach destroys the device, while if_down just marks it
down. In this incarnation of the pccard things, we map the disable
the slot action to detach the driver, which removes the driver from the
device tree. When that is done, a panic would soon follow as the
ifconfig tried to down the device.
Didn't fix:
o Should cache the pccard dev child's pointer in struct slot
o remove now unused parts of struct slot
o Any driver using softc after detach has been called. sio's softc used
to be statically allocated, so you could check sc->gone, but that is
now gone.
o Didn't remove gone from softc of drivers that use the old pccard method.
Didn't test:
o ed driver changes
o sio driver changes on pccards
o suspend (no laptop or apm support on my desktop)
Remove EXTRA_SIO/NSIOTOT and make it fully dynamic (from dev/sio/sio.c)
Make sio work for pccard here - pccardd doesn't activate interrupts
until after prove has succeeded.
Mark the initial reset of likely sio ports as broken as it depended on
config supplying a list of locations to probe, devices are now proved
standalone.
Optimize a bit of COM_NOAST4() logic.
Use bus_get_resource_start() etc rather than using isa-centric calls.
Reactivate the IIR_TXRDYBUG test, I've got a card here with it.
Try to be a bit smarter about activating interrupts (ie: don't panic
if polled)
Fix some style bugs that have crept in over time (there are still more).
Don't use NFDC as an arbitary limit, it is not required and goes against
using PnP fdc devices (eg: when PNPBIOS is turned on, the motherboard
devices (sio, fdc, etc etc) are detected via PnP, not config(8).)
during autoconfig to support strange hardware (such as the Yamaha DS-1)
which implements 'legacy' ISA devices as well as a PCI device. This will
allow the PCI driver for the YMF724 to add the legacy devices to the ISA
bus and will allow the PnP system to automatically allocate the resources
for those devices.
the countdown register.
this should not be necessary but there are broken laptops that
do not restore the countdown register on resume.
when it happnes, it messes up the hardclock interval and system clock,
which leads to the infamous "calcru: negative time" problem.
Submitted by: kjc, iwasaki
Reviewed by: Steve O'Hara-Smith <steveo@eircom.net> and committers.
Obtained from: PAO3
by Peter Wemm, but I've not merged all the changes he sent to me yet.
This has not been reviewed by bde, so I'm committing to resolve any
issues he has with this when he returns from FreeBSD CON 99.
I've had four reports of this working for them. I've been able to
communicate to both my built in modem and a pccard modem with these
patches.
* Move pnp_eisaformat() to pnp.c, declared in <isa/pnpvar.h>.
* Turn the pnpbios code into an enumerator for the isa bus. This allows
all devices known to the bios to be probed automatically.
Currently the pnpbios code is dependant on the PNPBIOS option. As the code
is tested more and when more drivers are converted this will be made the
default. I have PnP changes in the wings for fdc, atkbd, psm, pcaudio, and
joy. Sio already works with pnpbios.
resource_list_release. This removes the dependancy on the
layout of ivars.
* Move set_resource, get_resource and delete_resource from
isa_if.m to bus_if.m.
* Simplify driver code by providing wrappers to those methods:
bus_set_resource(dev, type, rid, start, count);
bus_get_resource(dev, type, rid, startp, countp);
bus_get_resource_start(dev, type, rid);
bus_get_resource_count(dev, type, rid);
bus_delete_resource(dev, type, rid);
* Delete isa_get_rsrc and use bus_get_resource_start instead.
* Fix a stupid typo in isa_alloc_resource reported by Takahashi
Yoshihiro <nyan@FreeBSD.org>.
* Print a diagnostic message if we can't assign resources to a PnP
device.
* Change device_print_prettyname() so that it doesn't print
"(no driver assigned)-1" for anonymous devices.
0x8024b04e) so that the cards description is used instead of overriding
it. While I'm here, add an ID for the SUP2080 and the SUP2030.
PR: kern/13983
Submitted by: Kurt D. Zeilenga <Kurt@OpenLDAP.Org> (SUP2030)
dfr (rest of change)
Reviewed by: dfr
Vendor ID SUP2480 (0x8024b04e), Serial Number 0x00001334
PnP Version 1.0, Vendor Version 0
Device Description: SupraExpress 56i Sp V.90
Reviewed by: dfr
have been there in the first place. A GENERIC kernel shrinks almost 1k.
Add a slightly different safetybelt under nostop for tty drivers.
Add some missing FreeBSD tags
fields in struct cdevsw:
d_stop moved to struct tty.
d_reset already unused.
d_devtotty linkage now provided by dev_t->si_tty.
These fields will be removed from struct cdevsw together with
d_params and d_maxio Real Soon Now.
The changes in this patch consist of:
initialize dev->si_tty in *_open()
initialize tty->t_stop
remove devtotty functions
rename ttpoll to ttypoll
a few adjustments to these changes in the generic code
a bump of __FreeBSD_version
add a couple of FreeBSD tags
warnings caused by the arg having the wrong type (not const enough).
The arg was also wrong (a full name instead of a short one) for calls
from from subr_diskmbr.c and pc98/diskslice_machdep.c.
rewrite the pccard attachment case. This is a work in progress, but
doesn't break the isa case.
I left the #if 0...#endif around the pccard stuff, at Peter's request,
so that normal users don't shoot themselves in the foot.
While I was here:
o Indent a comment to the right location
o Spell Unknown with a final 'n'.
Reviewed by: peter
a quick think and discussion among various people some form of some of
these changes will probably be recommitted.
The reversion requested was requested by dg while discussions proceed.
PHK has indicated that he can live with this, and it has been agreed
that some form of some of these changes may return shortly after further
discussion.
new system is integrated with the ISA bus code more cleanly and allows
the future addition of more enumerators such as PnPBIOS and ACPI.
This commit also enables the new pcm driver since it is somewhat tied to
the new PnP code.
the highly non-recommended option ALLOW_BDEV_ACCESS is used.
(bdev access is evil because you don't get write errors reported.)
Kill si_bsize_best before it kills Matt :-)
Use the specfs routines rather having cloned copies in devfs.
Diskslice/label code not yet handled.
Vinum, i4b, alpha, pc98 not dealt with (left to respective Maintainers)
Add the correct hook for devfs to kern_conf.c
The net result of this excercise is that a lot less files depends on DEVFS,
and devtoname() gets more sensible output in many cases.
A few drivers had minor additional cleanups performed relating to cdevsw
registration.
A few drivers don't register a cdevsw{} anymore, but only use make_dev().
instead, use generic entry points for all drivers.
- Eliminate bogus makedev().
- Eliminate softc in the lower drivers, as it is no longer necessary.
Submitted (95%) by: phk
Introduce BUF_STRATEGY(struct buf *, int flag) macro, and use it throughout.
please see comment in sys/conf.h about the flag argument.
Remove strategy argument from all the diskslice/label/bad144
implementations, it should be found from the dev_t.
Remove bogus and unused strategy1 routines.
Remove open/close arguments from dssize(). Pick them up from dev_t.
Remove unused and unfinished setgeom support from diskslice/label/bad144 code.
- 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
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.
by removing a floppy that as being operated on.
The spagghetti is hardly understandable at all anymore, so i can't
100 % ascertain this is really the Right Thing to do, maybe our new
floppy driver maintainer, Jesus Monroy Jr can do this. :-))
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
lockmgr locks. This commit should be functionally equivalent to the old
semantics. That is, all buffer locking is done with LK_EXCLUSIVE
requests. Changes to take advantage of LK_SHARED and LK_RECURSIVE will
be done in future commits.
1. Rise is recognized in identdcpu.c.
2. The TSC is not written to. A workaround for the CPU bug is being
applied to clock.c (the bug being that the mP6 has TSC enabled
in its CPUID-capabilities, but it only supports reading it. If we
try to write to it (MSR 16), a GPF occurs.) The new behavior is that
FreeBSD will _not_ zero the TSC. Instead, we do a bit of 64-bit
arithmetic.
Reviewed by: msmith
Obtained from: unfurl & msmith
- Split syscons source code into manageable chunks and reorganize
some of complicated functions.
- Many static variables are moved to the softc structure.
- Added a new key function, PREV. When this key is pressed, the vty
immediately before the current vty will become foreground. Analogue
to PREV, which is usually assigned to the PrntScrn key.
PR: kern/10113
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
- Modified the kernel console input function sccngetc() so that it
handles function keys properly.
- Reorganized the screen update routine.
- VT switching code is reorganized. It now should be slightly more
robust than before.
- Added the DEVICE_RESUME function so that syscons no longer hooks the
APM resume event directly.
- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
SC_NO_HISTORY and SC_NO_SYSMOUSE.
Various parts of syscons can be omitted so that the kernel size is
reduced.
SC_PIXEL_MODE
Made the VESA 800x600 mode an option, rather than a standard part of
syscons.
SC_DISABLE_DDBKEY
Disables the `debug' key combination.
SC_ALT_MOUSE_IMAGE
Inverse the character cell at the mouse cursor position in the text
console, rather than drawing an arrow on the screen.
Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)
SC_DFLT_FONT
makeoptions "SC_DFLT_FONT=_font_name_"
Include the named font as the default font of syscons. 16-line,
14-line and 8-line font data will be compiled in. This option replaces
the existing STD8X16FONT option, which loads 16-line font data only.
- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.
- The video driver provides a set of ioctl commands to manipulate the
frame buffer.
- New kernel configuration option: VGA_WIDTH90
Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These
modes are mot always supported by the video card.
PR: i386/7510
Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.
- The header file machine/console.h is reorganized; its contents is now
split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
(another new file). machine/console.h is still maintained for
compatibility reasons.
- Kernel console selection/installation routines are fixed and
slightly rebumped so that it should now be possible to switch between
the interanl kernel console (sc or vt) and a remote kernel console
(sio) again, as it was in 2.x, 3.0 and 3.1.
- Screen savers and splash screen decoders
Because of the header file reorganization described above, screen
savers and splash screen decoders are slightly modified. After this
update, /sys/modules/syscons/saver.h is no longer necessary and is
removed.
The cdevsw_add() function now finds the major number(s) in the
struct cdevsw passed to it. cdevsw_add_generic() is no longer
needed, cdevsw_add() does the same thing.
cdevsw_add() will print an message if the d_maj field looks bogus.
Remove nblkdev and nchrdev variables. Most places they were used
bogusly. Instead check a dev_t for validity by seeing if devsw()
or bdevsw() returns NULL.
Move bdevsw() and devsw() functions to kern/kern_conf.c
Bump __FreeBSD_version to 400006
This commit removes:
72 bogus makedev() calls
26 bogus SYSINIT functions
if_xe.c bogusly accessed cdevsw[], author/maintainer please fix.
I4b and vinum not changed. Patches emailed to authors. LINT
probably broken until they catch up.
Reformat and initialize correctly all "struct cdevsw".
Initialize the d_maj and d_bmaj fields.
The d_reset field was not removed, although it is never used.
I used a program to do most of this, so all the files now use the
same consistent format. Please keep it that way.
Vinum and i4b not modified, patches emailed to respective authors.
The old version only worked right when the time was read strictly
more often than every 1/HZ seconds, but we only guarantee reading
it every (1/HZ + epsilon) seconds. Part of rev.1.126-1.127 attempted
to fix this but didn't succeed. Detect counter rollover using the
heuristic from the old version of microtime() with additional
complications for supporting calls from fast interrupt handlers.
This works provided i8254 interrupts are not delayed by more than
1/(2*HZ) seconds.
This needs more comments, and cleanups for the SMP case, and more
testing of the SMP case before it is merged into RELENG_3.
Tested by: jhay
easier to use and more flexible.
* Change BUS_ADD_CHILD to take an order argument instead of a place.
* Define a partial ordering for isa devices so that sensitive devices are
probed before non-sensitive ones.
* Re-work the resource allocation code to use helper functions in subr_bus.c.
* Add simple isa interface for manipulating the resource ranges which can be
allocated and remove the code from isa_write_ivar() which was previously
used for this purpose.
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.
with other reset handling in rev.1.83 but broke it in rev.1.120. The
breakage didn't seem to cause any problems even on the system which had
problems ("extra" interrupts and botched handling thereof) before rev.1.83.
It only affects multi-floppy systems anyway.
although this is pretty trivial. devclass_get_softc() is a tad more
expensive than the old com_addr() implementation. If Bruce is really
worried about the cost of this, it could always be changed so that the
softc pointer is stored in a local array again.
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.
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.)
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.
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.
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.
- fix cut/paste problem. :-)
- don't forget to call isa_dmacascade()
- reset the port after we release resources.
That last one is a trap to watch out for.. The isa bus driver uses the
same port/irq/mem/etc variables for the initial probe hints as it does
for allocation/deallocation tracking. Releasing a resource clears the
variable and then you loose the hint during attach.. (ouch!)
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>
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
- Refined internal interface in keyboard drivers so that:
1. the side effect of device probe is kept minimal,
2. polling mode function is added,
3. and new ioctl and configuration options are added (see below).
- Added new ioctl: KDSETREPEAT
Set keyboard typematic rate. There has existed an ioctl command,
KDSETRAD, for the same purpose. However, KDSETRAD is dependent on
the AT keyboard. KDSETREPEAT provides more generic interface.
KDSETRAD will still be supported in the atkbd driver.
- Added new configuration options:
ATKBD_DFLT_KEYMAP
Specify a keymap to be used as the default, built-in keymap.
(There has been undocumented options, DKKEYMAP, UKKEYMAP, GRKEYMAP,
SWKEYMAP, RUKEYMAP, ESKEYMAP, and ISKEYMAP to set the default keymap.
These options are now gone for good. The new option is more general.)
KBD_DISABLE_KEYMAP_LOADING
Don't allow the user to change the keymap.
driver was thinking irq was enabled although it wasn't.
This case was particular to a no-interrupt static configuration.
Reported by: "Norman C. Rice" <nrice@emu.sourcee.com>
peripheral drivers can determine where in the devstat(9) list they are
inserted.
This requires recompilation of libdevstat, systat, vmstat, rpc.rstatd, and
any ports that depend on the devstat code, since the size of the devstat
structure has changed. The devstat version number has been incremented as
well to reflect the change.
This sorts devices in the devstat list in "more interesting" to "less
interesting" order. So, for instance, da devices are now more important
than floppy drives, and so will appear before floppy drives in the default
output from systat, iostat, vmstat, etc.
The order of devices is, for now, kept in a central table in devicestat.h.
If individual drivers were able to make a meaningful decision on what
priority they should be at attach time, we could consider splitting the
priority information out into the various drivers. For now, though, they
have no way of knowing that, so it's easier to put them in an easy to find
table.
Also, move the checkversion() call in vmstat(8) to a more logical place.
Thanks to Bruce and David O'Brien for suggestions, for reviewing this, and
for putting up with the long time it has taken me to commit it. Bruce did
object somewhat to the central priority table (he would rather the
priorities be distributed in each driver), so his objection is duly noted
here.
Reviewed by: bde, obrien
the screen width.
- Store the current video mode information in the `video_adapter' struct.
- The size of the `v_offscreensize' field in the VESA mode information
block is u_int16, not u_int8.
Change microseq offsets. Previously, offsets of the program counter where
added to the index of the current microinstruction. Make them rely on the
index of the next executed microinstruction.
Suggested by: Luigi Rizzo <luigi@labinfo.iet.unipi.it>
buffer had to be left on the head of the queue for [bufq]disksort()
to sort against. This isn't right for devices that can support multiple
active i/o's, and only the fd driver did it. "Fixing" this in rev.1.36
of ufs_disksubr.c broke the fd driver in much the same way as rev.1.52
of <sys/buf.h> broke it (see rev.1.119).
Bug reported and fix tested by: dt
+ ECP parallel port chipset FIFO detection
+ DMA+FIFO parallel I/O handled as chipset specific
+ nlpt updated in order to use the above enhanced parallel I/O.
Use 'lptcontrol -e' to use enhanced I/O
+ Various options documented in LINT
+ Full IEEE1284 NIBBLE and BYTE modes support. See ppbus(4) for
an overview of the IEEE1284 standard
+ Detection of PnP parallel devices at boot
+ Read capability added to nlpt driver to get IEEE1284 compliant
printer status with a simple 'cat /dev/lpt0'
+ IEEE1284 peripheral emulation added to BYTE mode. Two computers
may dialog according to IEEE1284 signaling method.
See PERIPH_1284 option and /sys/dev/ppbus/ppi.c
All this code is supposed to provide basic functions for IEEE1284 programming.
ppi.c and nlpt.c may act as examples.
floppy is used on the toshiba Libretto line of subnotebook computers.
It differs from a normal floppy in that you must use PIO rather than
DMA to transfer the data.
To enable this, you must add options "FDC_YE" to your kernel. I don't
have a machine that has a floppy and a pcmcia slot to test to make
sure that this doesn't impact normal floppy units, so I've left this as
an option.
I have ported this to -current and made an attempt to ensure that the
indentation conforms to style(9), aka the bruce filter.
Reviewed by: nate, markm
Submitted by: David Horwitt (dhorwitt@ucsd.edu)
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>
* Update drivers to the latest version of the bus interface.
The ISA drivers' use of the new resource api is minimal. Garrett has
some much cleaner drivers which should be more easily shared between
i386 and alpha. This has only been tested on cia based machines. It
should work on lca and apecs but I might have broken something.
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.
a vga.
* Fix broken logic in syscons for a failed probe.
* Fix AlphaStation 500/600 so that non-serial consoles are supported.
Submitted by: Thomas Valentino Crimi <tcrimi+@andrew.cmu.edu> (vga bits),
Andrew Gallatin <gallatin@cs.duke.edu> (AS500/AS600)
hasseen_isadev so this will be less noisy when conflicts do exist.
Also eliminate redundant warnings about conflicts.
Requested by: bde
Reviewed by: gibbs
o For bt and aha only probe the one I/O range if a specific I/O is specified
in the config file.
o Don't even try to probe I/O ranges that have been seen already.
o If we conflict with an IRQ or DRQ, then fail the probe.
Requested by: bde, gibbs
Approved by: jkh
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.
and use this when masking/unmasking interrupts.
Maintain a mapping from (iopaic number, int pin) tuple to irq number,
and use this when configuring devices and programming the ioapics.
Previous code assumed that irq number was equal to int pin number, and
that the ioapic number was 0.
Don't let an AP enter _cpu_switch before all local apics are initialized.
for the Lite2 fix for always returning EIO in dead_read().
Cleaned up the cdevswitch initializers for all tty drivers.
Removed explicit calls to ttsetwater() from all (tty) drivers. ttsetwater()
is now called centrally for opens, not just for parameter changes.
for 1 second's worth of input) and larger tty output buffers. The
interrupt-level buffers are still too small for speeds above 115200
bps (only a little too small for 230400 bps if RTS flow control is
enabled).
Don't call ttsetwater() explicitly in open(). It is now called for
the TTYDISC l_open() and should be static.
Don't attempt to register the cdevsw more than once.
instead of at compile time using ifdefs.
Use _swi_null instead of dummycamisr. CAM and dpt should call
register_swi() instead of hacking on ihandlers[] directly.