Home | History | Annotate | Download | only in sbus
History log of /src/sys/dev/sbus/zx.c
RevisionDateAuthorComments
 1.47  07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.46  24-Apr-2021  thorpej branches: 1.46.8;
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?).
 1.45  10-Nov-2019  chs branches: 1.45.10;
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.
 1.44  13-Mar-2019  thorpej In zx_cursor_color(), don't throw away the second half of the color
map data.
 1.43  13-Mar-2019  thorpej Fix an issue with FIOCSCURSOR FB_CUR_SETCMAP on zx described here:

http://mail-index.netbsd.org/port-sparc/2019/02/11/msg002134.html

by replacing the fubyte() calls with copyin() into temporary buffers.

The other issue in zx_cursor_color() mentioned in that message will
be addressed separately.
 1.42  03-Sep-2018  riastradh Rename min/max -> uimin/uimax for better honesty.

These functions are defined on unsigned int. The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER! Some subsystems have

#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX. Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.41  21-Apr-2016  macallan branches: 1.41.16; 1.41.18;
more RASTERCONSOLE purging
 1.40  20-Nov-2015  christos kill subyte.
 1.39  11-Jan-2012  macallan branches: 1.39.6; 1.39.24;
use rasops_init(0, 0)
 1.38  09-Dec-2010  uebayasi branches: 1.38.8; 1.38.12;
Fix DEBUG build.
 1.37  13-Nov-2010  uebayasi Don't pull in the whole uvm(9) API to access only PAGE_SIZE and
some other constants. These are provided by sys/param.h now.
 1.36  04-May-2010  macallan use box drawing font if needed
 1.35  05-Jan-2010  macallan branches: 1.35.2; 1.35.4;
fix off by one in zx_copyrect()
 1.34  05-Jan-2010  macallan fix off by one error in zx_fillrect()
while there, use vcons_replay_msgbuf()
 1.33  19-Sep-2009  tsutsui u_intNN_t -> uintNN_t
 1.32  17-Sep-2009  tsutsui Include "ioconf.h" instead of extern struct cfdriver foo_cd decls.
 1.31  17-Sep-2009  tsutsui Remove struct sbusdev and related functions sbus_establish() and sbusreset().
They are derived from 4.4BSD/sparc and have been there since initial import
of NetBSD/sparc in 1993, but the struct sbusdev is almost unused for years,
nothing calls sbusreset(), and all (*sd->sd_reset)() functions look bogus.

Suggested by mrg@ and martin@, and tested on SS1+ and SS20.
 1.30  26-May-2009  macallan use BUS_SPACE_MAP_LARGE
 1.29  12-May-2009  cegger struct cfdata * -> cfdata_t, no functional changes intended.
 1.28  05-May-2009  macallan clear screen on attach
 1.27  23-Apr-2009  macallan Add wscons support
 1.26  29-Mar-2009  tsutsui Get width, height, and linebytes values from prom_getpropint().
 1.25  27-Mar-2009  tsutsui Use bus_space(9) to access registers. SETREG() macro using bogus casts
against packed structures doesn't work on gcc4. (no character on screen)
See also:
http://mail-index.NetBSD.org/port-sparc/2003/11/11/0002.html

Should be pulled up to netbsd-4 and netbsd-5.
 1.24  11-Jun-2008  drochner branches: 1.24.4; 1.24.6; 1.24.10;
mechanical changes to use device_private() or device_lookup_private()
to get softcs, makes the code compile under the stricter type checking
introduced earlier today
 1.23  11-Jun-2008  cegger - use device_lookup_private to get softc
- ansify
fixes build errors about pointer type mismatches in assignment
 1.22  28-Apr-2008  martin branches: 1.22.2; 1.22.4;
Remove clause 3 and 4 from TNF licenses
 1.21  05-Apr-2008  cegger branches: 1.21.2; 1.21.4;
use aprint_*_dev and device_xname
 1.20  19-Oct-2007  ad branches: 1.20.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.19  04-Mar-2007  christos branches: 1.19.2; 1.19.14; 1.19.16; 1.19.20;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.18  07-Jan-2007  jdc branches: 1.18.2;
Allow this to compile with -DDEBUG: convert proc to lwp->l_proc.
 1.17  29-Mar-2006  thorpej branches: 1.17.8; 1.17.12;
Use device_cfdata().
 1.16  11-Dec-2005  christos branches: 1.16.4; 1.16.6; 1.16.8; 1.16.10; 1.16.12;
merge ktrace-lwp.
 1.15  04-Jun-2005  tsutsui branches: 1.15.2;
Fix a shadowing variable.
 1.14  27-Feb-2005  perry nuke trailing whitespace
 1.13  13-Nov-2003  chs branches: 1.13.8; 1.13.10;
eliminate uvm_useracc() in favor of checking the return value of
copyin() or copyout().

uvm_useracc() tells us whether the mapping permissions allow access to
the desired part of an address space, and many callers assume that
this is the same as knowing whether an attempt to access that part of
the address space will succeed. however, access to user space can
fail for reasons other than insufficient permission, most notably that
paging in any non-resident data can fail due to i/o errors. most of
the callers of uvm_useracc() make the above incorrect assumption. the
rest are all misguided optimizations, which optimize for the case
where an operation will fail. we'd rather optimize for operations
succeeding, in which case we should just attempt the access and handle
failures due to insufficient permissions the same way we handle i/o
errors. since there appear to be no good uses of uvm_useracc(), we'll
just remove it.
 1.12  28-Oct-2003  chs uninitialized variables.
 1.11  28-Oct-2003  ad Uninitialized variable.
 1.10  25-Aug-2003  uwe Undo previous as it broke things.

There are some scattered implicit RASTERCONSOLE dependencies,
so there should be a better way.
 1.9  24-Aug-2003  uwe #include "opt_rcons.h"
 1.8  29-Jun-2003  fvdl branches: 1.8.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.7  29-Jun-2003  darrenr More changes for providing lwpid for ktrace (sparc GENERIC built)
 1.6  10-Dec-2002  pk Remove the `flags' argument from bus_intr_establish().
 1.5  02-Oct-2002  thorpej branches: 1.5.2;
Add trailing ; to CFATTACH_DECL.
 1.4  30-Sep-2002  thorpej Use CFATTACH_DECL().
 1.3  27-Sep-2002  thorpej Declare all cfattach structures const.
 1.2  18-Sep-2002  ad Squash some bugs.
 1.1  13-Sep-2002  ad branches: 1.1.2;
Driver for the Sun ZX/Leo framebuffer. This would be called leo, but the
amiga port already has a driver by that name.
 1.1.2.4  11-Dec-2002  thorpej Sync with HEAD.
 1.1.2.3  18-Oct-2002  nathanw Catch up to -current.
 1.1.2.2  17-Sep-2002  nathanw Catch up to -current.
 1.1.2.1  13-Sep-2002  nathanw file zx.c was added on branch nathanw_sa on 2002-09-17 21:21:09 +0000
 1.5.2.2  10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.5.2.1  02-Oct-2002  jdolecek file zx.c was added on branch kqueue on 2002-10-10 18:42:09 +0000
 1.8.2.6  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.8.2.5  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.8.2.4  04-Feb-2005  skrll Adapt to branch.
 1.8.2.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.8.2.2  18-Sep-2004  skrll Sync with HEAD.
 1.8.2.1  03-Aug-2004  skrll Sync with HEAD
 1.13.10.1  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.13.8.1  29-Apr-2005  kent sync with -current
 1.15.2.4  27-Oct-2007  yamt sync with head.
 1.15.2.3  03-Sep-2007  yamt sync with head.
 1.15.2.2  26-Feb-2007  yamt sync with head.
 1.15.2.1  21-Jun-2006  yamt sync with head.
 1.16.12.1  31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.16.10.1  19-Apr-2006  elad sync with head.
 1.16.8.1  01-Apr-2006  yamt sync with head.
 1.16.6.1  22-Apr-2006  simonb Sync with head.
 1.16.4.1  09-Sep-2006  rpaulo sync with head
 1.17.12.1  15-Apr-2009  snj Pull up following revision(s) (requested by tsutsui in ticket #1300):
sys/dev/sbus/zx.c: revision 1.25 via patch
sys/dev/sbus/zxreg.h: revision 1.6 via patch
sys/dev/sbus/zxvar.h: revision 1.3
Use bus_space(9) to access registers. SETREG() macro using bogus casts
against packed structures doesn't work on gcc4. (no character on screen)
See also:
http://mail-index.NetBSD.org/port-sparc/2003/11/11/0002.html
 1.17.8.1  12-Jan-2007  ad Sync with head.
 1.18.2.1  12-Mar-2007  rmind Sync with HEAD.
 1.19.20.1  25-Oct-2007  bouyer Sync with HEAD.
 1.19.16.1  06-Nov-2007  matt sync with HEAD
 1.19.14.1  26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.19.2.1  23-Oct-2007  ad Sync with head.
 1.20.16.2  29-Jun-2008  mjf Sync with HEAD.
 1.20.16.1  02-Jun-2008  mjf Sync with HEAD.
 1.21.4.6  11-Aug-2010  yamt sync with head.
 1.21.4.5  11-Mar-2010  yamt sync with head
 1.21.4.4  20-Jun-2009  yamt sync with head
 1.21.4.3  16-May-2009  yamt sync with head
 1.21.4.2  04-May-2009  yamt sync with head.
 1.21.4.1  16-May-2008  yamt sync with head.
 1.21.2.2  17-Jun-2008  yamt sync with head.
 1.21.2.1  18-May-2008  yamt sync with head.
 1.22.4.1  18-Jun-2008  simonb Sync with head.
 1.22.2.1  23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.24.10.2  23-Jul-2009  jym Sync with HEAD.
 1.24.10.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.24.6.3  18-Oct-2009  bouyer Back out ticket 960
 1.24.6.2  18-Oct-2009  bouyer Pull up following revision(s) (requested by macallan in ticket #960):
sys/dev/sbus/zxreg.h: revision 1.7
sys/dev/sbus/files.sbus: revision 1.32
sys/dev/sbus/zxvar.h: revision 1.4
sys/dev/sbus/zx.c: revision 1.27
Add wscons support
 1.24.6.1  03-Apr-2009  snj branches: 1.24.6.1.4;
Pull up following revision(s) (requested by tsutsui in ticket #647):
sys/dev/sbus/zx.c: revision 1.25
sys/dev/sbus/zxreg.h: revision 1.6
sys/dev/sbus/zxvar.h: revision 1.3
Use bus_space(9) to access registers. SETREG() macro using bogus casts
against packed structures doesn't work on gcc4. (no character on screen)
See also:
http://mail-index.NetBSD.org/port-sparc/2003/11/11/0002.html
Should be pulled up to netbsd-4 and netbsd-5.
 1.24.6.1.4.1  21-Apr-2010  matt sync to netbsd-5
 1.24.4.1  28-Apr-2009  skrll Sync with HEAD.
 1.35.4.2  05-Mar-2011  rmind sync with head
 1.35.4.1  30-May-2010  rmind sync with head
 1.35.2.1  17-Aug-2010  uebayasi Sync with HEAD.
 1.38.12.1  18-Feb-2012  mrg merge to -current.
 1.38.8.1  17-Apr-2012  yamt sync with head
 1.39.24.2  22-Apr-2016  skrll Sync with HEAD
 1.39.24.1  27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.39.6.1  03-Dec-2017  jdolecek update from HEAD
 1.41.18.2  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.41.18.1  10-Jun-2019  christos Sync with HEAD
 1.41.16.1  06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.45.10.1  21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.46.8.1  04-Aug-2021  thorpej Adapt to CFARGS().

RSS XML Feed