/* $NetBSD: rf_etimer.h,v 1.11 2006/06/07 22:33:37 kardel Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. * * Author: Mark Holland * * Permission to use, copy, modify and distribute this software and * its documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. * * Carnegie Mellon requests users of this software to return to * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. */ #ifndef _RF__RF_TIMER_H_ #define _RF__RF_TIMER_H_ #include "rf_utils.h" #include #include struct RF_Etimer_s { struct timeval st; struct timeval et; struct timeval diff; }; #define RF_ETIMER_START(_t_) \ { \ memset(&(_t_), 0, sizeof (_t_)); \ getmicrouptime(&(_t_).st); \ } #define RF_ETIMER_STOP(_t_) \ { \ getmicrouptime(&(_t_).et); \ } #define RF_ETIMER_EVAL(_t_) \ { \ RF_TIMEVAL_DIFF(&(_t_).st, &(_t_).et, &(_t_).diff) \ } #define RF_ETIMER_VAL_US(_t_) (RF_TIMEVAL_TO_US((_t_).diff)) #define RF_ETIMER_VAL_MS(_t_) (RF_TIMEVAL_TO_US((_t_).diff)/1000) #endif /* !_RF__RF_TIMER_H_ */ 1'>urio.c
AgeCommit message (Collapse)Author
2020-01-29remove urio(4), a driver for the Rio500 MP3 player.maya
At this point it is highly unlikely this 1999 device still has users, but it still comes up in the context of maxv's USB-fuzzing (and any device could pretend to be a urio(4)), so it's best to get rid of it. Renamed all major entries to obsolete, as was done in previous removals. This still requires an update to sanitizers, but they're located in "external", perhaps it should be first committed upstream? Proposed on tech-kern a month ago.
2019-12-01localifymaxv
2019-09-14Fix error handling, to prevent kernel crashes when detaching an urio0maxv
device. Found with vHCI.
2019-05-05remove explicit 'extern struct cfdriver <my>_cd;' and use ioconf.hmrg
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!)
2016-12-04Whitespaceskrll
2016-11-25+#include "opt_usb.h"skrll
2016-07-07KNF. Remove extra spaces. No functional change.msaitoh
2016-04-23Merge nick-nhusbskrll
- API / infrastructure changes to support memory management changes. - Memory management improvements and bug fixes. - HCDs should now be MP safe - conversion to KERNHIST based debug - FS/LS isoc support on ehci(4). - conversion to kmem(9) - Some USB 3 support - mostly from Takahiro HAYASHI (t-hash). - interrupt transfers now get proper DMA operations - general bug fixes - kern/48308 - uhub status notification improvements - umass(4) probe fix (applied to HEAD already) - ohci(4) short transfer fix
2014-07-25Add d_discard to all struct cdevsw instances I could find.dholland
All have been set to "nodiscard"; some should get a real implementation.
2014-03-16Change (mostly mechanically) every cdevsw/bdevsw I can find to usedholland
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.
2012-12-27Consistent/Correct error message from failing usbd_set_config.skrll
Use aprint_error_dev.
2012-03-06pull down from usbmp branch:mrg
- rename usb_detach_{wake,waitup}() to usb_detach_{wake,waitup}old() - use some c99 struct .initialisers
2012-02-24remove any remnants of freebsd/openbsd code.mrg
2011-12-23Revert previous due to active usbmp branch(es).jakllsch
2011-12-22Adjust-away inconsistent and trailing whitespace.jakllsch
2010-11-03Stop using the compatibility macros USB_ATTACH(), USB_DETACH(),dyoung
USB_MATCH(), et cetera. These files produce the same assembly (according to objdump -d) before and after the change
2009-12-06Simplify device-activation hooks.dyoung
2009-09-23fix up USB drivers printing of autoconf informationplunky
1. expand the USB_ATTACH_SETUP macro (requested by jmcneill) 2. reorder the attach function so that the first thing it does is print newlines. 3. after this, we can call usbd_devinfo_alloc(), which polls the device allowing a context switch, and aprint_normal() the device information. this avoids problems where autoconf messages are getting mixed up.
2009-01-20Change major()/minor() to return 32-bit types again, calleddrochner
devmajor_t/devminor_t, as proposed on tech-kern. This avoids 64-bit arithmetics and 64-bit printf formats in parts of the kernel where it is not really useful, and helps clarity.
2009-01-11make this compilecegger
2008-05-24Split device_t and softc for all USB device drivers, and related cosmeticcube
changes. Matthias Drochner kindly reviewed this patch, and tested ums, ubt, uaudio and ral. I tested umass myself.
2008-04-28Remove clause 3 and 4 from TNF licensesmartin
2007-03-13Introduce different autoconf interface attributes for USB driversdrochner
matching (and handling) a whole device and those which match an interface only. This will allow to enforce some rules, eg that the former don't use interface information for matching or that the latter don't modify global device state. The previous way left too much freedom do the drivers which led to inconsistencies and abuse. For now, I've not changed locators and submatch rules, this will happen later. There should not be any change in behaviour, except in the case of some drivers which did behave inconsistently: if_atu, if_axe, uep: matched the configured device in the interface stage, but did configuration again. I've converted them to match in the device stage. ustir, utoppy: matched in the interface stage, but only against vendor/device information, and used any configuration/interface without checking. Changed to match in device stage, and added some simple code to configure and use the first interface. If you have one of those devices, please test!
2007-03-04Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.christos
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-09-03add missing initializer.christos
2006-03-28Use device_unit().thorpej
2006-03-01merge yamt-uio_vmspace branch.yamt
- use vmspace rather than proc or lwp where appropriate. the latter is more natural to specify an address space. (and less likely to be abused for random purposes.) - fix a swdmover race.
2005-12-11merge ktrace-lwp.christos
2005-05-11Don't keep the devinfo string on the stack, instead use malloc/free.augustss
This should cure some rare stack overflows.