summaryrefslogtreecommitdiff
path: root/sys/dev/ic/tcic2.c
AgeCommit message (Collapse)Author
2021-08-07Merge thorpej-cfargs2.thorpej
2021-04-24Merge thorpej-cfargs branch:thorpej
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?).
2018-09-03Rename min/max -> uimin/uimax for better honesty.riastradh
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!)
2012-10-27split device_t/softc for all remaining drivers.chs
replace "struct device *" with "device_t". use device_xname(), device_unit(), etc.
2012-08-24Fix typosmsaitoh
2011-07-26Don't set the iobase and iosize members of pcmciabus_attach_args becausedyoung
they're not used in any meaningful way.
2010-04-19Add default implementations for bus_space_is_equal(9),dyoung
bus_space_tag_create(9), and bus_space_tag_destroy(9). Use bus_space_is_equal(9) throughout the kernel to compare bus_space_tag_t's. Tested on i386 and on sparc64.
2010-03-22pckbc.c, vga.c: It doesn't appear to be helpful to compare twodyoung
bus_space_tag_t's in pckbc_is_console() and vga_is_console(), and MI code should never do such a thing, so don't do it. tcic2.c: #if 0 some diagnostic code that compares two bus_space_tag_t's.
2009-03-14ANSIfy another 1261 function definitions.dsl
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-14Change about 4500 of the K&R function definitions to ANSI ones.dsl
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-02-13More printf format fixes.bouyer
2008-04-08use aprint_*_dev and device_xnamecegger
2008-03-29Make TCICDEBUG / TCICISADEBUG compile.ad
2007-10-19machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.had
2007-07-09Merge some of the less invasive changes from the vmlocking branch:ad
- kthread, callout, devsw API changes - select()/poll() improvements - miscellaneous MT safety improvements
2006-11-16__unused removal on arguments; approved by core.christos
2006-10-12- sprinkle __unused on function decls.christos
- fix a couple of unused bugs - no more -Wno-unused for i386
2006-04-14Coverity CID 2501: Make it painfully obvious that memh is initialized.christos
2005-12-11merge ktrace-lwp.christos
2005-08-25kill a number of autoconf submatch functions which follow thedrochner
standard scheme: if (<configured> != <wildcard> && <configured> != <real>) then fail else ask device match function This is handled by config_stdsubmatch() now.
2005-08-25replace the "locdesc_t" structure carrying the number of locatorsdrochner
explicitely by a plain integer array the length in now known to all relevant parties, so this avoids duplication of information, and we can allocate that thing in drivers without hacks
2005-05-30- add missing constchristos
- fix variable shadowing - remove unneeded casts
2005-02-27nuke trailing whitespaceperry
2005-02-04de-__Pperry
2004-09-13use locator passing versions of xxxsubmatch() and simplify the code bydrochner
using arithmetics instead of case statements
2004-08-11Add a settype function.mycroft
Nuke address windows earlier in power up sequence.
2004-06-20Define and use pcmciabuscf_controller as an alias forthorpej
cf_loc[PCMCIABUSCF_CONTROLLER] and pcmciabuscf_socket as an alias for cf_loc[PCMCIABUSCF_SOCKET].
2003-12-28make the printf statements on chip_io_map complete lines.christos
2003-11-02Fix some typos. From Tom Cosgrove via jmc@openbsd.wiz
2003-01-01Use aprint_normal() in cfprint routines.thorpej
2002-09-27Introduce a new routine, config_match(), which invokes thethorpej
cfattach->ca_match function in behalf of the caller. Use it rather than invoking cfattach->ca_match directly.
2002-06-01SIMPLEQ rototill:lukem
- implement SIMPLEQ_REMOVE(head, elm, type, field). whilst it's O(n), this mirrors the functionality of SLIST_REMOVE() (the other singly-linked list type) and FreeBSD's STAILQ_REMOVE() - remove the unnecessary elm arg from SIMPLEQ_REMOVE_HEAD(). this mirrors the functionality of SLIST_REMOVE_HEAD() (the other singly-linked list type) and FreeBSD's STAILQ_REMOVE_HEAD() - remove notes about SIMPLEQ not supporting arbitrary element removal - use SIMPLEQ_FOREACH() instead of home-grown for loops - use SIMPLEQ_EMPTY() appropriately - use SIMPLEQ_*() instead of accessing sqh_first,sqh_last,sqe_next directly - reorder manual page; be consistent about how the types are listed - other minor cleanups
2001-12-15To make dev/pcmcia work on platforms with 64-bit bus_addr_t andsoren
32-bit bus_size_t (sparc), change the pcmcia_mem_map(9) offsetp argument to bus_size_t as it is used as a bus_space offset.
2001-11-15don't need <sys/types.h> when including <sys/param.h>lukem
2001-11-13add/cleanup RCSIDlukem
2000-06-28remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>mrg
2000-06-16beat back the undead: __BROKEN_INDIRECT_CONFIG had risen, and wascgd
terrorizing innocent hackers...
2000-05-08set paa_busname to pcmcia, like the i82365.c driver does.explorer
2000-01-13(tcic_chip_do_mem_map): handle 8-bit memoryjoda
1999-07-06Make the kthread API a bit more friendly to loadable kernel modules.thorpej
1999-03-23A backend for Databook's TCIC family of PCMCIA chips.bad
Thanks to Andreas Lohrum, O'Reilly Verlag, Terry Moore, and Holger Czukay for hardware, documentation, and support.