1*cc615cf4Sjason /* $OpenBSD: uperfvar.h,v 1.4 2003/06/02 20:02:49 jason Exp $ */ 2c79026dfSjason 3c79026dfSjason /* 4c79026dfSjason * Copyright (c) 2002 Jason L. Wright (jason@thought.net) 5c79026dfSjason * All rights reserved. 6c79026dfSjason * 7c79026dfSjason * Redistribution and use in source and binary forms, with or without 8c79026dfSjason * modification, are permitted provided that the following conditions 9c79026dfSjason * are met: 10c79026dfSjason * 1. Redistributions of source code must retain the above copyright 11c79026dfSjason * notice, this list of conditions and the following disclaimer. 12c79026dfSjason * 2. Redistributions in binary form must reproduce the above copyright 13c79026dfSjason * notice, this list of conditions and the following disclaimer in the 14c79026dfSjason * documentation and/or other materials provided with the distribution. 15c79026dfSjason * 16c79026dfSjason * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17c79026dfSjason * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18c79026dfSjason * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19c79026dfSjason * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, 20c79026dfSjason * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21c79026dfSjason * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22c79026dfSjason * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23c79026dfSjason * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 24c79026dfSjason * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 25c79026dfSjason * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26c79026dfSjason * POSSIBILITY OF SUCH DAMAGE. 275248d82bSjason * 285248d82bSjason * Effort sponsored in part by the Defense Advanced Research Projects 295248d82bSjason * Agency (DARPA) and Air Force Research Laboratory, Air Force 305248d82bSjason * Materiel Command, USAF, under agreement number F30602-01-2-0537. 315248d82bSjason * 32c79026dfSjason */ 33c79026dfSjason 34c79026dfSjason struct uperf_softc { 35c79026dfSjason struct device sc_dv; 36c79026dfSjason void *usc_cookie; /* cookie to pass upwards */ 37c79026dfSjason int (*usc_getcntsrc)(void *, int, u_int *, u_int *); 38c79026dfSjason int (*usc_setcntsrc)(void *, int, u_int, u_int); 39c79026dfSjason int (*usc_clrcnt)(void *, int); 40c79026dfSjason int (*usc_getcnt)(void *, int, u_int32_t *, u_int32_t *); 41c79026dfSjason struct uperf_src *usc_srcs; 42c79026dfSjason }; 43c79026dfSjason 44c79026dfSjason /* Table should be terminated with us_src = -1 */ 45c79026dfSjason struct uperf_src { 46c79026dfSjason int us_src; /* source number (user) */ 47c79026dfSjason int us_flags; /* counters this source is valid for */ 48c79026dfSjason u_int32_t us_val; /* value to put in register */ 49c79026dfSjason }; 50