⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hil.4

📁 早期freebsd实现
💻 4
字号:
.\" Copyright (c) 1990, 1991, 1993.\"	The Regents of the University of California.  All rights reserved..\".\" This code is derived from software contributed to Berkeley by.\" the Systems Programming Group of the University of Utah Computer.\" Science Department..\".\" Redistribution and use in source and binary forms, with or without.\" modification, are permitted provided that the following conditions.\" are met:.\" 1. Redistributions of source code must retain the above copyright.\"    notice, this list of conditions and the following disclaimer..\" 2. Redistributions in binary form must reproduce the above copyright.\"    notice, this list of conditions and the following disclaimer in the.\"    documentation and/or other materials provided with the distribution..\" 3. All advertising materials mentioning features or use of this software.\"    must display the following acknowledgement:.\"	This product includes software developed by the University of.\"	California, Berkeley and its contributors..\" 4. Neither the name of the University nor the names of its contributors.\"    may be used to endorse or promote products derived from this software.\"    without specific prior written permission..\".\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION).\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF.\" SUCH DAMAGE..\".\"     @(#)hil.4	8.2 (Berkeley) 11/30/93.\".Dd November 30, 1993.Dt HIL 4 hp300.Os.Sh NAME.Nm hil.Nd Human Interface Link device driver.Sh DESCRIPTIONThe Human Interface Link.Pq Tn HILis the interface used by the Series300 computers to connect devices such as keyboards, mice, control knobs,and.Tn IDmodules to the machine. .PpSpecial files.Pa /dev/hil[1-7]refer to physical.Tn HILdevices 1 through 7..Pa /dev/hil0refers to the ``loop'' pseudo-device and is used for the queueallocation commands described below.In the current implementation,there can only be one keyboard and it must be the first device.Pq Li hil1 ..PpThe device file that corresponds to a particular.Tn HILdevice is determinedby the order of the devices on the loop. For instance, if the.Tn IDmoduleis the second physical device on the loop, then.Pa /dev/hil2is the specialfile that should be used for communication with the module..PpCommunication with an.Tn HILdevice is begun with an.Em opensystem call.A process may open a device already opened by another process unlessthe process is operating in.Tn HP-UXcompatibility modein which case it requires exclusive use of the device, oranother process has the device open and is using.Tn HP-UXstyledevice access (see.Dv HILIOCHPUXbelow)..PpInput data from a device are obtained in one of two ways.Processes may use an.Tn HP-UXstyle interface in which the.Xr read 2system call is used to get fixed-size input packets,or they can use a.Em shared-queueinterface.The shared-queue interface avoids the system call overhead associated withthe.Tn HP-UXread interface by sharing a region of memory between the systemand a user process.This region consists of a circular list of 255 event packets,and a header containing the size of the queue, and its head and tail indices.The system deposits event data at the tail of the queue,a process extracts it from the head.Extracting an event is done by copying it from the queue and then updatingthe head appropriately (i.e. head = (head + 1) % qsize).It is up to the process to ensure that packets are removed from thequeue quickly enough to prevent the queue from filling.The system, when it determines that the queue is full,will ignore future packets from the device.Devices are.Em mappedto queues via an.Xr ioctl 2.More than one device can be mapped to a single queue and one device canbe mapped to several queues.Queues are implicitly unmapped by a.Xr fork 2and thus,cannot be shared between processes..PpChoosing the type of interface is done on a per device basis usingan.Xr ioctl ,but each device can only have one interface at any given time..Pp.Em Selectmay be used with either interface to detect when input data are present.With the read interface, selecting indicates when there is input for agiven device.With the shared-queue interface, selecting on the loop pseudo-device.Pq Li hil0indicates when data are present from any device on any queuewhile selecting on an individual device indicates when data are presentfor that device on any queue..Pp.Em Closeshuts down the file descriptor associated with the.Tn HILdevice.The last close (system-wide) of any device removes that devicefrom all queues it was mapped to while the last close of the looppseudo-device unmaps all devices and deallocates all queues..Pp.Xr Ioctl 2is used to control the.Tn HILdevice.The ioctl commands (see.Aq Pa hpdev/hilioctl.h )listed below are separated into two groups.The first are those which provide functions identical to.Tn HP-UX .Refer to.Xr hil 7in the.Tn HP-UXdocumentation for morecomplete descriptions of these ioctls.The second set of ioctls are specific to this implementation and areprimarily related to the shared-queue interface..Bl -tag -width HILIOCARO.It Dv HILIOCIDIdentify and Describe.PpThe device will return up to 11 bytes of information describing thetype and characteristics of the device.At the very least, 2 bytes of information,the device.Tn ID ,and the Describe Record Header will be returned.Identical to the.Tn HP-UX.Dv HILIDioctl..It Dv HILIOCSCReport Security Code.PpRequest the security code record from a device. The security code canvary from 1 byte to 15, and is only supported by some.Tn HILdevices.Identical to the.Tn HP-UX.Dv HILSCioctl..It Dv HILIOCRNReport Name.PpAn ascii string of up to 15 bytes in length that describes the deviceis returned.Identical to the.Tn HP-UX.Dv HILRNioctl..It Dv HILIOCRSReport Status.PpAn ascii string of up to 15 bytes in length that describes the currentstatus of the device is returned.Identical to the.Tn HP-UX.Dv HILRSioctl..It Dv HILIOCEDExtended Describe.PpAdditional information of up to 15 bytes is returned describing the device.This ioctl is similar to.Tn HILIOCID ,which must be used firstto determine if the device supports extended describe.Identical to the.Tn HP-UX.Dv HILEDioctl..It Dv HILIOCAROFFDisable Auto Repeat.PpTurn off auto repeat on the keyboard while it is in cooked mode.Identical to the.Tn HP-UX.Dv HILDKRioctl..It Dv HILIOCAR1Enable Auto Repeat.PpTurn on auto repeat on the keyboard while it is in raw mode.The repeat rate is set to 1/30th of a second.Identical to the.Tn HP-UX.Dv HILER1ioctl..It Dv HILIOCAR2Enable Auto Repeat.PpTurn on auto repeat on the keyboard while it is in raw mode.The repeat rate is set to 1/60th of a second.Identical to the.Tn HP-UX.Dv HILER2ioctl..PpThe following ioctls are specific to this implementation:.It Dv HILIOCBEEPBeep.PpGenerate a keyboard beep as defined by.Ar arg ..Ar Argis a pointer to two bytes of information,the first is the duration of the beep (microseconds),the second is the frequency of the beep..It Dv HILIOCALLOCQAllocate Queue.PpAllocate and map into user space,an.Tn HILQstructure as defined in.Aq Pa hpdev/hilioctl.h ..Ar Argis a pointer to a.Ar hilqinfostructure (also described in.Aq Pa hpdev/hilioctl.h )consisting of a.Pa qidand an.Pa addr .If.Pa addris non-zero it specifies where in the address space to map the queue.If zero, the system will select a convenient location and fill in.Pa addr ..Pa Qidis filled in by the system andis a small integer used to uniquely identify this queue.This ioctl can only be issued to the loop pseudo-device..It Dv HILIOCFREEQFree Queue.PpRelease a previously allocated.Tn HILevent queue,unmapping it from the user's address space..Ar Argshould point to a.Ar hilqinfostructure which contains the.Ar qidof the queue to be released.All devices that are currently mapped to the queue are unmapped.This ioctl can only be issued to the loop pseudo-device..It Dv HILIOCMAPQMap Device to Queue.PpMaps this device to a previously allocated.Tn HILevent queue..Ar Argis a pointer to an integer containing the.Ar qidof the queue.Once a device is mapped to a queue,all event information generated by the device will be placedinto the event queue at the tail..It Dv HILIOCUNMAPQUnmap Device from Queue.PpUnmap this device from a previously allocated.Tn HILevent queue..Ar Argis a pointer to an integer containing the.Ar qidfor the queue.Future events from the device are no longer placed on the event queue..It Dv HILIOCHPUXUse HP-UX Read Interface.PpUse.Tn HP-UXsemantics for gathering data from this device.Instead of placing input events for the device on a queue,they are placed, in.Tn HP-UXformat, into a buffer from which theycan be obtained via.Xr read 2 .This interface is provided for backwards compatibility.Refer to the.Tn HP-UXdocumentation for a description of the event packet..El.Sh FILES.Bl -tag -width /dev/hil[2-7] -compact.It Pa /dev/hil0.Tn HILloop pseudo device..It Pa /dev/hil1.Tn HILkeyboard device..It Pa /dev/hil[2-7]Individual.Tn HILloop devices..El.Sh ERRORS.Bl -tag -width [EINVAL].It Bq Er ENODEVno such HIL loop device..It Bq Er ENXIOHIL loop is inoperative..It Bq Er EBUSYAnother HP-UX process has the device open, or another.Bxprocess has thedevice open, and is using it in.Tn HP-UXmode..It Bq Er EINVALInvalid.Xr ioctlspecification..It Bq Er EMFILENo more shared queues available..El

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -