summaryrefslogtreecommitdiff
path: root/sys/arch/macppc/dev/cuda.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?).
2021-03-05Convert to intr_establish_xname().rin
2020-07-14Adapt to new proplib APImartin
2020-07-14Adapt to new proplib APImartin
2019-12-22Cleanup i2c bus acquire / release, centralizing all of the logic intothorpej
iic_acquire_bus() / iic_release_bus(). "acquire" and "release" hooks no longer need to be provided by back-end controller drivers (only if they need special handling, e.g. powering on the i2c controller). This results in the removal of a bunch of rendundant code from each back-end controller driver. Assert that we are not in hard interrupt context in iic_acquire_bus(), iic_exec(), and iic_release_bus().
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!)
2017-09-22direct configure i2c devicesmacallan
2016-02-14zero the i2c_attach_args structure before filling it in.chs
fixes occasional crashes in iic_attach().
2014-08-13if we get garbage from the RTC try again a couple timesmacallan
this seems to happen more frequently when the PRAM battery goes bad
2014-03-14remove various set-but-unused variables.mrg
2013-07-30Strip redundant parenthesis.joerg
2011-07-01#include <sys/bus.h> instead of <machine/bus.h>.dyoung
2011-06-18struct device * -> device_tmatt
struct cfdata * -> cfdata_t use device accessors, use device_private. some softc/device_t splits (macppc needs a bunch more) aprint*_dev used considerably more
2009-12-12Remove `volatile' qualifier from argument types oftsutsui
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-03-18Ansify function definitions w/o arguments. Generated with sed.cegger
2009-02-04Return error status if an attempt is made to use the quick_{read,write}pgoyette
i2c protocols, since we don't (yet) know how to make the controller do it.
2009-01-11fix format instead of casting wildlymacallan
2009-01-11don't truncate the print.christos
2009-01-11deal with 64bit time_tmacallan
Noticed by Wojciech Galazka
2008-12-07Fix attach messages. (extra colons, misplaced newline etc.)tsutsui
2008-05-16struct device * -> device_tmacallan
2008-04-29Convert to new 2 clause licensemartin
2007-12-06lockmgr -> mutexad
2007-11-07Convert macppc to shared ofw_autoconf.c. Compile tested only.garbled
2007-10-17Merge the ppcoea-renovation branch to HEAD.garbled
This branch was a major cleanup and rototill of many of the various OEA cpu based PPC ports that focused on sharing as much code as possible between the various ports to eliminate near-identical copies of files in every tree. Additionally there is a new PIC system that unifies the interface to interrupt code for all different OEA ppc arches. The work for this branch was done by a variety of people, too long to list here. TODO: bebox still needs work to complete the transition to -renovation. ofppc still needs a bunch of work, which I will be looking at. ev64260 still needs to be renovated amigappc was not attempted. NOTES: pmppc was removed as an arch, and moved to a evbppc target.
2007-02-15don't use IPL_HIGHmacallan
2007-02-05- don't go CUDA_IDLE before calling message handlers, that way we force allmacallan
writes they might issue to be delayed which keeps us from deadlocking - don't splhigh() in cuda_intr() - usually we're there already. Instead do the splhigh()/splx() dance when we're polling - remove some leftover debugging gunk
2007-01-17new drivers for pmu and cudamacallan