1*63371a7fSjsg /* $OpenBSD: siofile.h,v 1.6 2024/05/19 00:05:43 jsg Exp $ */ 287bc9f6aSratchov /* 387bc9f6aSratchov * Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org> 487bc9f6aSratchov * 587bc9f6aSratchov * Permission to use, copy, modify, and distribute this software for any 687bc9f6aSratchov * purpose with or without fee is hereby granted, provided that the above 787bc9f6aSratchov * copyright notice and this permission notice appear in all copies. 887bc9f6aSratchov * 987bc9f6aSratchov * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 1087bc9f6aSratchov * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 1187bc9f6aSratchov * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 1287bc9f6aSratchov * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 1387bc9f6aSratchov * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 1487bc9f6aSratchov * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 1587bc9f6aSratchov * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 1687bc9f6aSratchov */ 1787bc9f6aSratchov #ifndef SIOFILE_H 1887bc9f6aSratchov #define SIOFILE_H 1987bc9f6aSratchov 20d135469bSratchov #include "file.h" 21d135469bSratchov 2287bc9f6aSratchov struct dev; 2387bc9f6aSratchov 2467db5a8cSratchov struct dev_sio { 2587bc9f6aSratchov struct sio_hdl *hdl; 2687bc9f6aSratchov unsigned int todo; 2787bc9f6aSratchov #ifdef DEBUG 2887bc9f6aSratchov long long wtime, utime; 2987bc9f6aSratchov long long sum_wtime, sum_utime; 3087bc9f6aSratchov int pused, rused, events; 3187bc9f6aSratchov #endif 3287bc9f6aSratchov struct file *file; 3387bc9f6aSratchov #define DEV_SIO_READ 0 3487bc9f6aSratchov #define DEV_SIO_CYCLE 1 3587bc9f6aSratchov #define DEV_SIO_WRITE 2 3687bc9f6aSratchov int cstate; 37d135469bSratchov struct timo watchdog; 3887bc9f6aSratchov }; 3987bc9f6aSratchov 4087bc9f6aSratchov int dev_sio_open(struct dev *); 4187bc9f6aSratchov void dev_sio_close(struct dev *); 4287bc9f6aSratchov void dev_sio_start(struct dev *); 4387bc9f6aSratchov void dev_sio_stop(struct dev *); 4487bc9f6aSratchov 4587bc9f6aSratchov #endif /* !defined(SIOFILE_H) */ 46