Commit Graph

242 Commits

Author SHA1 Message Date
tsutsui 8de5b505c8 Use proper macro for return values and remove #if 0'ed out block.
Mostly from OpenBSD/vax. No binary changes.
2024-02-14 12:59:44 +00:00
tsutsui aec2656993 Fix a fatal typo that causes dzkbd_cngetc() to stall.
Should be pulled up to netbsd-10 and netbsd-9.
2024-02-14 12:49:47 +00:00
tsutsui 14b54388da Use aprint_normal(9) for attach messages. 2024-02-02 15:44:43 +00:00
andvar d3b53f2689 s/MC_DFEAULTHZ/MC_DEFAULTHZ/ for alpha specific default rate definition. 2023-08-24 14:21:40 +00:00
andvar 828b49ebb8 remove likely accidental part of the comment. 2023-08-19 19:21:34 +00:00
riastradh dcd1feedbf vax/dz(4): Convert to ttylock/ttyunlock. 2022-10-26 23:44:36 +00:00
thorpej c7fb772b85 Merge thorpej-cfargs2. 2021-08-07 16:18:40 +00:00
thorpej 2685996b0e Merge thorpej-cfargs branch:
Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
  actually needed.
- Don't be explicit about what interface attribute is attaching if
  the device only has one.  (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
  situations, making is visibly easier to see when indirect config is
  in play, and allowing for future change in semantics.  (As of now,
  this is just a wrapper around config_match(), but that is an
  implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance.  This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
2021-04-24 23:36:23 +00:00
msaitoh a3317f920a s/le_de_subr/le_dec_subr/ in comment. 2019-12-27 09:47:55 +00:00
msaitoh 74868e2a8b s/recevive/receive/ in comment. 2019-12-27 06:52:43 +00:00
chs d47bcd296c in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
2019-11-10 21:16:21 +00:00
riastradh 82b8caba92 Kill some more extern struct cfdriver declarations.
Down with externs in .c!
2017-10-28 04:53:54 +00:00
flxd 50e68e123b spelling (DEC called it "TURBOchannel") 2017-06-22 16:46:52 +00:00
skrll 83e52e0af5 Don't use a callout unnecessarily - especially not this early 2016-07-11 10:55:35 +00:00
jklos 2d49a0d673 Patches from Björ Johannesson to fix DEC LK201 keyboards, this time
applied to correct tree.
2015-01-02 21:32:26 +00:00
christos a95736d447 PR/49207: Kamil Rytarowski: Add sys/clock.h with generic time macros
(derived from clock_subr.h). Keep clock_subr.h with the kernel structures
and functions to reduce diffs, and have clock.h only include standalone
constants and macros.
2014-11-17 02:15:48 +00:00
dholland f9228f4225 Add d_discard to all struct cdevsw instances I could find.
All have been set to "nodiscard"; some should get a real implementation.
2014-07-25 08:10:31 +00:00
dholland a68f9396b6 Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
2014-03-16 05:20:22 +00:00
chs cbab9cadce split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
2012-10-27 17:17:22 +00:00
abs 2336bb243d revert last 2012-07-16 12:55:36 +00:00
abs 213efd2227 Allow WSKBDIO_SETMODE 2012-07-16 12:52:47 +00:00
tsutsui eaf783ae5b Split device_t/softc. Tested on GXemul. 2011-06-04 01:43:56 +00:00
rmind 2626d57668 Rename ttymalloc() to tty_alloc(), and ttyfree() to tty_free() for
consistency.  Remove some unnecessary malloc.h inclusions as well.
2011-04-24 16:26:51 +00:00
tsutsui 56f894e4bc Make this compile with options DEBUG. (PRId64 for time_t) 2011-04-06 14:51:12 +00:00
hans 10e151e52e The interrupt handler uses the softc, so it's probably a good idea to
initialize it before causing interrupts. Prevents a panic on VAXstation
4000/9x with SPX console.
2010-05-09 22:29:26 +00:00
mhitch 425781ccc5 Fix error introduced with timecounters - RTC clock register only uses
the last 2 digits of the year.  Fixes setting the clock and keeps the
DECstation PROM happy and stops it from setting the date to Jan 1, 1972.
2010-05-03 18:04:56 +00:00
pooka 10fe49d72c Redefine bpf linkage through an always present op vector, i.e.
#if NBPFILTER is no longer required in the client.  This change
doesn't yet add support for loading bpf as a module, since drivers
can register before bpf is attached.  However, callers of bpf can
now be modularized.

Dynamically loadable bpf could probably be done fairly easily with
coordination from the stub driver and the real driver by registering
attachments in the stub before the real driver is loaded and doing
a handoff.  ... and I'm not going to ponder the depths of unload
here.

Tested with i386/MONOLITHIC, modified MONOLITHIC without bpf and rump.
2010-01-19 22:06:18 +00:00
tsutsui 471e528b58 Remove `volatile' qualifier from argument types of
struct timeval passed to todr_gettime(9) and todr_settime(9).
We no longer have an ancient and volatile struct timeval `time'
global since we have switched to MI timercounter(9) on all port.

XXX1: some of these RTC drivers still assume 32bit time_t
XXX2: some of these should be rewritten to use todr_[gs]ettime_ymdhms()
XXX3: todr(9) man page doesn't mention todr_[gs]ettime_ymdhms()
2009-12-12 14:44:08 +00:00
he c411502583 After the change from "struct device *" to "device_t", we now depend
on the definitions from <sys/device.h>, so include it here.
2009-05-23 19:11:19 +00:00
cegger 529e91fca1 struct device * -> device_t, no functional changes intended. 2009-05-12 14:16:35 +00:00
cegger 32c4940900 struct cfdata * -> cfdata_t, no functional changes intended. 2009-05-12 12:10:29 +00:00
dsl 82357f6d42 ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
2009-03-14 21:04:01 +00:00
dsl 454af1c0e8 Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
2009-03-14 15:35:58 +00:00
gmcgarry 0de5da9678 Replace most gcc-specific __attribute__ uses with BSD-style sys/cdef.h
preprocessor macros.
2008-09-08 23:36:53 +00:00
cegger 332bec333d use device_lookup_private to get softc
XXX this driver assumes unit of zero
2008-06-12 21:51:12 +00:00
ad b18c28f549 PR kern/38763 "hanging in tty" bugfix breaks the build for vax (and
probably others)
2008-05-27 14:13:41 +00:00
nisimura 540dfe3a95 - assign 2 clause TNF license to the files cited as my ownership.
- abandon and remove my copyright notice from the three files were
copied in order to adapt HW I don't have; pvr.c, pm.c and stic.c
2008-05-26 10:31:22 +00:00
ad 5e4b324300 Properly fix the "hanging in tty" bug that was worked around with cv_wakeup()
some time again.
2008-05-25 19:22:21 +00:00
cegger 1b044f414a use aprint_*_dev and device_xname 2008-04-08 07:35:35 +00:00
tsutsui d9941582bf Split device_t/softc for le(4) and variants and misc cosmetic changes. 2008-04-04 12:25:06 +00:00
tsutsui 9dd0b2634a Remove an extra newline added in rev 1.18.
It will be put in the following clockattach().
2008-03-29 15:59:03 +00:00
matt 9e8ca25d60 Switch dz driver to PRIVALLOC and device_* accessors. 2008-03-15 00:57:15 +00:00
matt dfba816635 Rototill the vax code. Switch to devicet/PRIV_ALLOC. Cleanup vax autoconf
code.  Move to prototype definitions.  staticfy, constify, avoid casting.
Use device_* accessors.
2008-03-11 05:34:01 +00:00
simonb 0bab12ba30 Make this compile with DEBUG enabled (fix a printf format, convert to
timecounters).
2008-01-04 01:00:43 +00:00
joerg 28b31e738f Timecounter and generic todr support for pmax. From Garret D'Amore. 2008-01-03 23:02:24 +00:00
ad 4b293a84e1 Interrupt handling changes, in discussion since February:
- Reduce available SPL levels for hardware devices to none, vm, sched, high.
- Acquire kernel_lock only for interrupts at IPL_VM.
- Implement threaded soft interrupts.
2007-12-03 15:33:00 +00:00
yamt 0ae55456d7 dzstart: remove a variable which is no longer used after the previous change. 2007-11-20 09:16:53 +00:00
ad dc26833bb6 - Factor out too many copies of the same bit of tty code.
- Fix another tty signalling/wakeup problem.
2007-11-19 18:51:36 +00:00
ad d37935697b Merge tty changes from the vmlocking branch. 2007-11-07 15:56:11 +00:00
ad a2a3828545 machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h 2007-10-19 11:59:34 +00:00