Home | History | Annotate | Download | only in sbus
History log of /src/sys/dev/sbus/tcx.c
RevisionDateAuthorComments
 1.62  02-Jun-2025  jdc Use normal (not error) output if we're the console.
 1.61  25-Sep-2022  thorpej branches: 1.61.10;
Remove unnecessary include of <sys/malloc.h>.
 1.60  07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.59  24-Apr-2021  thorpej branches: 1.59.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.58  24-Jan-2018  riastradh branches: 1.58.20;
Fix integer overflows noted by Silvio Cesare of InfoSect.

Someone^TM should name these idioms so we can eliminate this class of
copypasta bug.
 1.57  23-Sep-2016  macallan - finally fix tcx_clearscreen() and tcx_eraserows() to actually work, and
not just by accident
- sprinkle volatile in order to force gcc 5.4 to emit ldd/std for 64bit
accesses - BLIT and STIP spaces require those
 1.56  25-Jul-2014  dholland branches: 1.56.4; 1.56.8;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.55  22-Jul-2014  macallan restore the right colour map when X exits
 1.54  16-Jul-2014  macallan - move all register definitions and hardware documenting comments to
tcxreg.h
- expand hardware documenting comments
no functional change
 1.53  07-Jul-2014  macallan actually put the colour space ID where it belongs in tcx_clearscreen()
 1.52  24-Jun-2014  macallan use STIP/BLIT on 8bit tcx and RSTIP/RBLIT on S24
 1.51  18-Jun-2014  macallan 8bit tcx doesn't implement a hardware cursor, so don't pretend it does.
Also, avoid poking the hw cursor registers in that case. Real hardware doesn't
care but qemu does.
 1.50  17-Jun-2014  macallan fix a few 8bit tcx issues:
- set ROP when clearing the screen, tcx actually uses it
- deal with possible 2MB VRAM tcx
while there, consistently use aprint_* in tcxattach()
 1.49  17-Jun-2014  macallan remove last remnants of CG8 emulation
 1.48  13-May-2014  martin Do not attach if the STIP register is way too small (this happens in qemu
due to buggy emulation and causes crashes).
 1.47  09-May-2014  jdc Cosmetic fix: s/8bit/8-bit/ and new line for 8-bit only TCX's.
 1.46  29-Apr-2014  macallan return a match score >1 to beat out genfb if present
 1.45  16-Mar-2014  dholland branches: 1.45.2;
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.
 1.44  11-Jan-2012  macallan branches: 1.44.6; 1.44.10;
use rasops_init(0, 0)
 1.43  04-May-2010  macallan branches: 1.43.8; 1.43.12;
use box drawing font if needed
 1.42  17-Sep-2009  tsutsui branches: 1.42.2; 1.42.4;
Include "ioconf.h" instead of extern struct cfdriver foo_cd decls.
 1.41  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.40  26-Aug-2009  macallan adjust some mmap ranges so X can work, also use FBTYPE_TCXCOLOR
 1.39  20-Aug-2009  macallan call vcons_replay_msgbuf() if we're the console
 1.38  20-Aug-2009  macallan use vcons_replay_msgbuf()
 1.37  20-Aug-2009  macallan add support for a hardware cursor via wsdisplay
 1.36  19-Aug-2009  macallan clear the screen and initialize it with the right WID to bypass the LUT on
24bit boards when switching to WSDISPLAYIO_MODE_FB
Now 24bit X with wsfb looks right.
TODO:
- hardware cursor
- acceleration
 1.35  19-Aug-2009  macallan - more cosmetics
- support screen blanking ioctl()s on both /dev/fb* and wsdisplay
 1.34  19-Aug-2009  macallan - some cosmetic fixes
- add support for screen blanking via /dev/fb*
- reimplement colour map ioctl()s for /dev/fb*
- implement mmap and ioctl for wscons, map 8 or 24bit framebuffer depending
on hardware
With this X works with the wsfb driver in 24bit.
TODO:
- fix wsfb to use the right pixel format for S24
- implement wsdisplay colour map ioctl()s
- add hardware cursor support for wscons and /dev/fb*
 1.33  18-Aug-2009  macallan device_t-ify
 1.32  06-Aug-2009  macallan make the tcx driver do something useful:
- attach a wsdisplay
- make it work with an S24
- accelerate scrolling and character drawing
This isn't quite finished yet, it works fine as a console but most things
X will need are not functional right now.
 1.31  12-May-2009  cegger struct device * -> device_t, no functional changes intended.
 1.30  12-May-2009  cegger struct cfdata * -> cfdata_t, no functional changes intended.
 1.29  18-Apr-2009  tsutsui Remove extra whitespace added by a stupid tool.
XXX: more in src/sys/arch
 1.28  18-Mar-2009  cegger bcopy -> memcpy
 1.27  14-Mar-2009  dsl 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.
 1.26  14-Mar-2009  dsl 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.)
 1.25  11-Jun-2008  drochner branches: 1.25.4; 1.25.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.24  28-Apr-2008  martin branches: 1.24.2; 1.24.4;
Remove clause 3 and 4 from TNF licenses
 1.23  05-Apr-2008  cegger branches: 1.23.2; 1.23.4;
use aprint_*_dev and device_xname
 1.22  19-Oct-2007  ad branches: 1.22.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.21  04-Mar-2007  christos branches: 1.21.2; 1.21.14; 1.21.16; 1.21.20;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.20  07-Jan-2007  jdc branches: 1.20.2;
Allow this to compile with -DDEBUG: convert proc to lwp->l_proc.
 1.19  29-Mar-2006  thorpej branches: 1.19.8;
Use device_cfdata().
 1.18  11-Dec-2005  christos branches: 1.18.4; 1.18.6; 1.18.8; 1.18.10; 1.18.12;
merge ktrace-lwp.
 1.17  04-Feb-2005  perry branches: 1.17.6;
de-__P
 1.16  14-Jul-2004  pk branches: 1.16.4; 1.16.6;
Make this compile with the TCX_CG8 option turned on (PR#26269).
 1.15  29-Jun-2003  fvdl branches: 1.15.2; 1.15.4;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.14  29-Jun-2003  darrenr More changes for providing lwpid for ktrace (sparc GENERIC built)
 1.13  23-Oct-2002  jdolecek merge kqueue branch into -current

kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.12  02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.11  30-Sep-2002  thorpej Use CFATTACH_DECL().
 1.10  27-Sep-2002  thorpej Declare all cfattach structures const.
 1.9  06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.8  23-Aug-2002  thorpej Use the structures defined in bsd_openprom.h for "reg", "range",
and "intr" properties, rather than having identical-except-for-names
sbus_* and iommu_* versions.
 1.7  27-Mar-2002  darrenr branches: 1.7.2; 1.7.4;
Merge in the patch (PR kern/15963) to provide unaccelerated 24bit support
for the S24.
 1.6  20-Mar-2002  eeh Use bus_space_vaddr().
 1.5  11-Mar-2002  pk Get rid of `bus_type_t' and use BUS_ADDR() (in sbus_bus_map()) to construct
a `bus_addr_t' to pass on to bus_space_map().

Drop `va' argument from sbus_bus_map(); it should not be used by MI Sbus
drivers.
 1.4  13-Nov-2001  lukem add RCSIDs
 1.3  24-Sep-2001  eeh Change bus_space_mmap() signature to the official one.
 1.2  22-Aug-2000  pk branches: 1.2.2; 1.2.4; 1.2.6; 1.2.8;
Get tcxreg.h from the correct location.
 1.1  20-Aug-2000  pk Move these SBus drivers here from arch/sparc.
 1.2.8.2  10-Oct-2001  fvdl Convert all remaining devices.
 1.2.8.1  01-Oct-2001  fvdl Catch up with -current.
 1.2.6.7  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.2.6.6  06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.2.6.5  28-Jun-2002  jdolecek hook fbkqfilter to leaf drivers' kqfilter
 1.2.6.4  28-Jun-2002  jdolecek prove kqfilter hook; it's very simple equivalent of seltrue()
 1.2.6.3  23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.6.2  16-Mar-2002  jdolecek Catch up with -current.
 1.2.6.1  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.4.7  11-Nov-2002  nathanw Catch up to -current
 1.2.4.6  18-Oct-2002  nathanw Catch up to -current.
 1.2.4.5  17-Sep-2002  nathanw Catch up to -current.
 1.2.4.4  27-Aug-2002  nathanw Catch up to -current.
 1.2.4.3  01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.2.4.2  14-Nov-2001  nathanw Catch up to -current.
 1.2.4.1  26-Sep-2001  nathanw Catch up to -current.
Again.
 1.2.2.2  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.2.2.1  22-Aug-2000  bouyer file tcx.c was added on branch thorpej_scsipi on 2000-11-20 22:35:48 +0000
 1.7.4.1  22-Nov-2002  tron Pull up revision 1.8 (requested by martin in ticket #948):
Use the structures defined in bsd_openprom.h for "reg", "range",
and "intr" properties, rather than having identical-except-for-names
sbus_* and iommu_* versions.
 1.7.2.2  29-Aug-2002  gehenna catch up with -current.
 1.7.2.1  16-May-2002  gehenna Add the character device switch.
 1.15.4.1  15-Jul-2004  he Pull up revision 1.16 (requested by pk in ticket #659):
Make this compile with the TCX_CG8 option turned on,
fixes PR#26269.
 1.15.2.5  04-Feb-2005  skrll Sync with HEAD.
 1.15.2.4  04-Feb-2005  skrll Adapt to branch.
 1.15.2.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.15.2.2  18-Sep-2004  skrll Sync with HEAD.
 1.15.2.1  03-Aug-2004  skrll Sync with HEAD
 1.16.6.1  12-Feb-2005  yamt sync with head.
 1.16.4.1  29-Apr-2005  kent sync with -current
 1.17.6.4  27-Oct-2007  yamt sync with head.
 1.17.6.3  03-Sep-2007  yamt sync with head.
 1.17.6.2  26-Feb-2007  yamt sync with head.
 1.17.6.1  21-Jun-2006  yamt sync with head.
 1.18.12.1  31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.18.10.1  19-Apr-2006  elad sync with head.
 1.18.8.1  01-Apr-2006  yamt sync with head.
 1.18.6.1  22-Apr-2006  simonb Sync with head.
 1.18.4.1  09-Sep-2006  rpaulo sync with head
 1.19.8.1  12-Jan-2007  ad Sync with head.
 1.20.2.1  12-Mar-2007  rmind Sync with HEAD.
 1.21.20.1  25-Oct-2007  bouyer Sync with HEAD.
 1.21.16.1  06-Nov-2007  matt sync with HEAD
 1.21.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.21.2.1  23-Oct-2007  ad Sync with head.
 1.22.16.2  29-Jun-2008  mjf Sync with HEAD.
 1.22.16.1  02-Jun-2008  mjf Sync with HEAD.
 1.23.4.7  11-Aug-2010  yamt sync with head.
 1.23.4.6  11-Mar-2010  yamt sync with head
 1.23.4.5  16-Sep-2009  yamt sync with head
 1.23.4.4  19-Aug-2009  yamt sync with head.
 1.23.4.3  16-May-2009  yamt sync with head
 1.23.4.2  04-May-2009  yamt sync with head.
 1.23.4.1  16-May-2008  yamt sync with head.
 1.23.2.2  17-Jun-2008  yamt sync with head.
 1.23.2.1  18-May-2008  yamt sync with head.
 1.24.4.1  18-Jun-2008  simonb Sync with head.
 1.24.2.1  23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.25.10.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.25.4.1  28-Apr-2009  skrll Sync with HEAD.
 1.42.4.1  30-May-2010  rmind sync with head
 1.42.2.1  17-Aug-2010  uebayasi Sync with HEAD.
 1.43.12.1  18-Feb-2012  mrg merge to -current.
 1.43.8.2  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.43.8.1  17-Apr-2012  yamt sync with head
 1.44.10.1  18-May-2014  rmind sync with head
 1.44.6.2  03-Dec-2017  jdolecek update from HEAD
 1.44.6.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.45.2.1  10-Aug-2014  tls Rebase.
 1.56.8.1  04-Nov-2016  pgoyette Sync with HEAD
 1.56.4.1  05-Oct-2016  skrll Sync with HEAD
 1.58.20.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.59.8.1  04-Aug-2021  thorpej Adapt to CFARGS().
 1.61.10.1  02-Aug-2025  perseant Sync with HEAD

RSS XML Feed