Commit Graph

30 Commits

Author SHA1 Message Date
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
skrll 7fb67d6ed3 No need to have an MD #ifdef in an MI file, so remove it. 2021-03-14 08:13:58 +00:00
skrll 7abdb11983 Remove an '#ifndef hp300' and make STI_{EN,DIS}ABLE_ROM simply check the
sc_{en,disable}_rom methdos provide by the bus attachment glue.
2021-03-07 14:31:20 +00:00
skrll 6db047e95d Use bus_space_mmap in sti_mmap. This makes X on sti for my B160L nearly
work (the colour map is somewhat wrong), but at least the machine doesn't
wedge.
2021-03-07 10:02:33 +00:00
skrll 8d5dbff40a Trailing whitespace 2021-03-04 20:30:39 +00:00
tsutsui ccc5c3a158 Ignore WSDISPLAYIO_PUTCMAP in WSDISPLAYIO_MODE_EMUL, i.e. text mode.
The hardware palette settings are handled by the STI ROM in STI_TEXTMODE
and changing cmap could cause mangled text colors at least on CRX on 425t.
Updating CMAP in EMUL mode isn't expected anyway.

Fixes "red or invisible text" after exiting mlterm-wscons on A1659 CRX.
2020-12-26 08:58:03 +00:00
tsutsui 35d011b3d1 Handle WSSCREEN_REVERSE properly. Based on OpenBSD's sti(4).
Also remove WSSCREEN_UNDERLINE from capabilities that is not handled
by sti(4) ROM routines.

Tested on HP9000/425t with CRX.
2020-12-25 20:41:24 +00:00
tsutsui 31e1e5a96c Pull the latest OpenBSD sti(4) changes for bitmap framebuffer support.
- bitmap and colormap ops based on old HP ngle X11 driver:
  http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sys/dev/ic/sti.c#rev1.76
  > Work-in-progress support for non-accelerated X11 on *some* sti(4)
  > frame buffers; based upon the old HP ngle X11 driver.
  > Currently limited to CRX (720/735/750), Timber (710, old 715),
  > Artist (712, 715) and EG (B-series), however the
  > colormap isn't set up correctly on Timber and EG yet.
  >
  > Joint work with Artem Falcon, now in good enough shape to be worked further
  > in the tree.
- misc other cosmetic changes to reduce diffs

No particular comments on port-hp300@ and port-hppa@:
 https://mail-index.netbsd.org/port-hp300/2020/12/19/msg000184.html
 https://mail-index.netbsd.org/port-hp300/2020/12/20/msg000185.html

The MD hp300 attachment for SGC CRX (A1659-66001) will be committed
separately.
2020-12-23 08:34:35 +00:00
riastradh 9fc453562f Round of uvm.h cleanup.
The poorly named uvm.h is generally supposed to be for uvm-internal
users only.

- Narrow it to files that actually need it -- mostly files that need
  to query whether curlwp is the pagedaemon, which should maybe be
  exposed by an external header.

- Use uvm_extern.h where feasible and uvm_*.h for things not exposed
  by it.  We should split up uvm_extern.h but this will serve for now
  to reduce the uvm.h dependencies.

- Use uvm_stat.h and #ifdef UVMHIST uvm.h for files that use
  UVMHIST(ubchist), since ubchist is declared in uvm.h but the
  reference evaporates if UVMHIST is not defined, so we reduce header
  file dependencies.

- Make uvm_device.h and uvm_swap.h independently includable while
  here.

ok chs@
2020-09-05 16:30:10 +00:00
tsutsui 9b81b6d763 Add bitmap access ops support for EVRX framebuffer on HP9000/425e.
8bpp Xorg wsfb server and mlterm-wscons (formerly mlterm-fb) work.
No particular comment on port-hp300@ and port-hppa@:
 https://mail-index.netbsd.org/port-hp300/2020/05/02/msg000170.html

Special thanks to Miod Vallat, for his advice about HP-UX implementation
and binutils patches to disassemble old HP-UX a.out-hp300hpux binaries
(and also contributing his 425e back in 2014).
2020-05-04 06:52:53 +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
spz 4b70fd126d correct size checks so they cannot be circumvented by integer overflows
reported by CTurt, thanks for the notification
2017-06-13 19:13:55 +00:00
tsutsui b0be3f23bf Export accessops functions to allow overriding them in MD attachment. 2014-06-29 04:08:43 +00:00
tsutsui 18155f04b3 Add proper consinit(9) support for sti(4) at sgc framebuffer on hp300.
The cnattach functions for sti(4) and service switch check method
for 425e in com_frodo.c are taken from OpenBSD.
The strategy how to choose the console device in hp300_cninit() is
quite diverged from 4.4BSD and OpenBSD so it's tweaked by me.

Also put several changes in sti_sgc.c to reduce diffs from OpenBSD/hp300.

Tested on 425e and 362 (which still uses gendiofb(4), not sti(4)).

XXX: sti(4) requires uvm_km_alloc(9) and uvm_map_protect(9)
     to copy and call ROM functions on the executable memory region, so
     it can be called before UVM and related initializations are complete.
     Probably it's time to consider about MI "deferred consinit()" API
     in init_main.c (or elsewhere) for modern complicated VM system...
2014-04-20 04:12:54 +00:00
matt 679c1ab7fb Fix
error: new qualifiers in middle of multi-level non-const cast are unsafe
by defining the type correctly thereby avoid the cast.
2011-07-11 02:30:49 +00:00
tsutsui 823c8d62ae Add a kludge to make this build on hp300.
(anyway bus independent driver should not include bus dependent sti_pci.h)
2011-05-21 12:02:55 +00:00
skrll ce0d59c64f Improve debug output. 2010-11-24 19:12:08 +00:00
skrll f2dcf75998 Update sti(4) from OpenBSD bringing across support for sti @ pci.
Thanks to Adam Hoka for testing.
2010-11-09 12:24:47 +00:00
skrll 702f3de6e7 u_intNN_t -> uintNN_t
Same code before and after.
2010-11-01 06:41:50 +00:00
skrll 0e5fcee3e5 RCSId police. 2010-10-31 15:47:53 +00:00
skrll 7ab26758f5 device_t/softc split
struct device * -> device_t
struct cfdata * -> cfdata_t
Use aprint*

There are a couple of MI drivers with MD attachments left.
2009-05-07 15:34:49 +00:00
cegger 7088512994 use aprint_*_dev and device_xname 2008-04-08 12:07:25 +00:00
ad a2a3828545 machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h 2007-10-19 11:59:34 +00:00
christos 53524e44ef Kill caddr_t; there will be some MI fallout, but it will be fixed shortly. 2007-03-04 05:59:00 +00:00
jmmv 7a51d4dddc Add an extra cookie to the ioctl and mmap wsdisplay accessops that points
to the screen on which they are being called.  The driver cannot guess
this by itself but it is needed to implement, at least, the getwschar and
putwschar functions in the correct place.  There are no functional changes
yet.

Tested on i386 (vga, vga_raster, machfb, vesafb), macppc and sparc64.
Suggested and reviewed by macallan@.
2006-04-12 19:38:22 +00:00
christos 95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
yamt 6b2d8b66a4 merge yamt-km branch.
- don't use managed mappings/backing objects for wired memory allocations.
  save some resources like pv_entry.  also fix (most of) PR/27030.
- simplify kernel memory management API.
- simplify pmap bootstrap of some ports.
- some related cleanups.
2005-04-01 11:59:21 +00:00
perry f31bd063e9 nuke trailing whitespace 2005-02-27 00:26:58 +00:00
chs b42337cb2a fix optimized compilation. 2004-09-19 23:00:29 +00:00
jkunz 1035c6af08 Import STI wscons(4) driver from OpenBSD and add new driver for PS/2
keyboard / mouse pots of LASI.
2004-08-26 16:48:06 +00:00