Return to midivar.h CVS log | Up to [local] / sys / dev |
File: [local] / sys / dev / midivar.h (download)
Revision 1.1.1.1 (vendor branch), Tue Mar 4 16:09:42 2008 UTC (16 years, 4 months ago) by nbrk
Import of OpenBSD 4.2 release kernel tree with initial code to support Jornada 720/728, StrongARM 1110-based handheld PC. At this point kernel roots on NFS and boots into vfs_mountroot() and traps. What is supported: - glass console, Jornada framebuffer (jfb) works in 16bpp direct color mode (needs some palette tweaks for non black/white/blue colors, i think) - saic, SA11x0 interrupt controller (needs cleanup) - sacom, SA11x0 UART (supported only as boot console for now) - SA11x0 GPIO controller fully supported (but can't handle multiple interrupt handlers on one gpio pin) - sassp, SSP port on SA11x0 that attaches spibus - Jornada microcontroller (jmcu) to control kbd, battery, etc throught the SPI bus (wskbd attaches on jmcu, but not tested) - tod functions seem work - initial code for SA-1111 (chip companion) : this is TODO Next important steps, i think: - gpio and intc on sa1111 - pcmcia support for sa11x0 (and sa1111 help logic) - REAL root on nfs when we have PCMCIA support (we may use any of supported pccard NICs) - root on wd0! (using already supported PCMCIA-ATA) |
/* $OpenBSD: midivar.h,v 1.5 2005/11/21 18:16:38 millert Exp $ */ /* * Copyright (c) 2003, 2004 Alexandre Ratchov * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #ifndef _SYS_DEV_MIDIVAR_H_ #define _SYS_DEV_MIDIVAR_H_ #include <dev/midi_if.h> #include <sys/device.h> #include <sys/selinfo.h> #include <sys/proc.h> #include <sys/timeout.h> #define MIDI_MAXWRITE 32 /* max bytes to give to the uart at once */ #define MIDI_RATE 3125 /* midi uart baud rate in bytes/second */ #define MIDI_UNIT(a) ((a) & 0xff) #define MIDI_DEV2SC(a) (midi_cd.cd_devs[MIDI_UNIT(a)]) #include "sequencer.h" #if NSEQUENCER > 0 struct midi_dev; /* defined in sequencervar.h */ #endif /* * simple ring buffer */ #define MIDIBUF_SIZE (1 << 10) #define MIDIBUF_MASK (MIDIBUF_SIZE - 1) struct midi_buffer { unsigned char data[MIDIBUF_SIZE]; unsigned start, used; }; #define MIDIBUF_START(buf) ((buf)->start) #define MIDIBUF_END(buf) (((buf)->start + (buf)->used) & MIDIBUF_MASK) #define MIDIBUF_USED(buf) ((buf)->used) #define MIDIBUF_AVAIL(buf) (MIDIBUF_SIZE - (buf)->used) #define MIDIBUF_ISFULL(buf) ((buf)->used >= MIDIBUF_SIZE) #define MIDIBUF_ISEMPTY(buf) ((buf)->used == 0) #define MIDIBUF_WRITE(buf, byte) \ do { \ (buf)->data[MIDIBUF_END(buf)] = (byte); \ (buf)->used++; \ } while(0) #define MIDIBUF_READ(buf, byte) \ do { \ (byte) = (buf)->data[(buf)->start++]; \ (buf)->start &= MIDIBUF_MASK; \ (buf)->used--; \ } while(0) #define MIDIBUF_REMOVE(buf, count) \ do { \ (buf)->start += (count); \ (buf)->start &= MIDIBUF_MASK; \ (buf)->used -= (count); \ } while(0) #define MIDIBUF_INIT(buf) \ do { \ (buf)->start = (buf)->used = 0; \ } while(0) struct midi_softc { struct device dev; struct midi_hw_if *hw_if; void *hw_hdl; int isopen; int isbusy; /* concerns only the output */ int isdying; int flags; /* open flags */ int props; /* midi hw proprieties */ int rchan; int wchan; unsigned wait; /* see midi_out_do */ struct selinfo rsel; struct selinfo wsel; struct proc *async; struct timeout timeo; struct midi_buffer inbuf; struct midi_buffer outbuf; #if NSEQUENCER > 0 int seqopen; struct midi_dev *seq_md; /* structure that links us with the seq. */ int evindex; unsigned char evstatus; unsigned char evdata[2]; #endif /* NSEQUENCER > 0 */ }; #endif /* _SYS_DEV_MIDIVAR_H_ */