|
|
1.1 ! root 1: /* ! 2: * Copyright (c) 1988 University of Utah. ! 3: * Copyright (c) 1990 The Regents of the University of California. ! 4: * All rights reserved. ! 5: * ! 6: * This code is derived from software contributed to Berkeley by ! 7: * the Systems Programming Group of the University of Utah Computer ! 8: * Science Department. ! 9: * ! 10: * Redistribution is only permitted until one year after the first shipment ! 11: * of 4.4BSD by the Regents. Otherwise, redistribution and use in source and ! 12: * binary forms are permitted provided that: (1) source distributions retain ! 13: * this entire copyright notice and comment, and (2) distributions including ! 14: * binaries display the following acknowledgement: This product includes ! 15: * software developed by the University of California, Berkeley and its ! 16: * contributors'' in the documentation or other materials provided with the ! 17: * distribution and in all advertising materials mentioning features or use ! 18: * of this software. Neither the name of the University nor the names of ! 19: * its contributors may be used to endorse or promote products derived from ! 20: * this software without specific prior written permission. ! 21: * THIS SOFTWARE IS PROVIDED AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED ! 22: * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF ! 23: * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 24: * ! 25: * from: Utah $Hdr: hilreg.h 1.8 89/08/24$ ! 26: * ! 27: * @(#)hilreg.h 7.1 (Berkeley) 5/8/90 ! 28: */ ! 29: ! 30: struct hil_dev { ! 31: char hil_pad0; ! 32: volatile char hil_data; ! 33: char hil_pad1; ! 34: volatile char hil_cmd; ! 35: #define hil_stat hil_cmd ! 36: }; ! 37: ! 38: #define HILADDR ((struct hil_dev *)IOV(0x428000)) ! 39: #define BBCADDR ((struct hil_dev *)IOV(0x420000)) ! 40: ! 41: #define splhil spl1 ! 42: ! 43: #define HIL_BUSY 0x02 ! 44: #define HIL_DATA_RDY 0x01 ! 45: ! 46: #define HILWAIT(hil_dev) while ((hil_dev->hil_stat & HIL_BUSY)) ! 47: #define HILDATAWAIT(hil_dev) while ((hil_dev->hil_stat & HIL_DATA_RDY) == 0) ! 48: ! 49: /* HIL status bits */ ! 50: #define HIL_POLLDATA 0x10 /* HIL poll data follows */ ! 51: #define HIL_COMMAND 0x08 /* Start of original command */ ! 52: #define HIL_ERROR 0x080 /* HIL error */ ! 53: #define HIL_RECONFIG 0x080 /* HIL has reconfigured */ ! 54: #define HIL_STATMASK (HIL_DATA | HIL_COMMAND) ! 55: ! 56: #define HIL_SSHIFT 4 /* Bits to shift status over */ ! 57: #define HIL_SMASK 0xF /* Service request status mask */ ! 58: #define HIL_DEVMASK 0x07 ! 59: ! 60: /* HIL status types */ ! 61: #define HIL_STATUS 0x5 /* HIL status in data register */ ! 62: #define HIL_DATA 0x6 /* HIL data in data register */ ! 63: #define HIL_CTRLSHIFT 0x8 /* key + CTRL + SHIFT */ ! 64: #define HIL_CTRL 0x9 /* key + CTRL */ ! 65: #define HIL_SHIFT 0xA /* key + SHIFT */ ! 66: #define HIL_KEY 0xB /* key only */ ! 67: #define HIL_68K 0x4 /* Data from the 68k is ready */ ! 68: ! 69: /* HIL commands */ ! 70: #define HIL_SETARD 0xA0 /* set auto-repeat delay */ ! 71: #define HIL_SETARR 0xA2 /* set auto-repeat rate */ ! 72: #define HIL_SETTONE 0xA3 /* set tone generator */ ! 73: #define HIL_CNMT 0xB2 /* clear nmi */ ! 74: #define HIL_INTON 0x5C /* Turn on interrupts. */ ! 75: #define HIL_INTOFF 0x5D /* Turn off interrupts. */ ! 76: #define HIL_TRIGGER 0xC5 /* trigger command */ ! 77: #define HIL_STARTCMD 0xE0 /* start loop command */ ! 78: #define HIL_TIMEOUT 0xFE /* timeout */ ! 79: #define HIL_READTIME 0x13 /* Read real time register */ ! 80: ! 81: /* Read/write various registers on the 8042. */ ! 82: #define HIL_READBUSY 0x02 /* internal "busy" register */ ! 83: #define HIL_READKBDLANG 0x12 /* read keyboard language code */ ! 84: #define HIL_READKBDSADR 0xF9 ! 85: #define HIL_WRITEKBDSADR 0xE9 ! 86: #define HIL_READLPSTAT 0xFA ! 87: #define HIL_WRITELPSTAT 0xEA ! 88: #define HIL_READLPCTRL 0xFB ! 89: #define HIL_WRITELPCTRL 0xEB ! 90: ! 91: /* BUSY bits */ ! 92: #define BSY_LOOPBUSY 0x04 ! 93: ! 94: /* LPCTRL bits */ ! 95: #define LPC_AUTOPOLL 0x01 /* enable auto-polling */ ! 96: #define LPC_NOERROR 0x02 /* don't report errors */ ! 97: #define LPC_NORECONF 0x04 /* don't report reconfigure */ ! 98: #define LPC_KBDCOOK 0x10 /* cook all keyboards */ ! 99: #define LPC_RECONF 0x80 /* reconfigure the loop */ ! 100: ! 101: /* LPSTAT bits */ ! 102: #define LPS_DEVMASK 0x07 /* number of loop devices */ ! 103: #define LPS_CONFGOOD 0x08 /* reconfiguration worked */ ! 104: #define LPS_CONFFAIL 0x80 /* reconfiguration failed */ ! 105: ! 106: /* HIL packet headers */ ! 107: #define HIL_MOUSEDATA 0x2 ! 108: #define HIL_KBDDATA 0x40 ! 109: ! 110: #define HIL_MOUSEMOTION 0x02 /* mouse movement event */ ! 111: #define HIL_KBDBUTTON 0x40 /* keyboard button event */ ! 112: #define HIL_MOUSEBUTTON 0x40 /* mouse button event */ ! 113: #define HIL_BUTTONBOX 0x60 /* button box event */ ! 114: #define HIL_TABLET 0x02 /* tablet motion event */ ! 115: #define HIL_KNOBBOX 0x03 /* knob box motion data */ ! 116: ! 117: /* Magic */ ! 118: #define KBDNMISTAT ((volatile char *)IOV(0x478005)) ! 119: #define KBDNMI 0x04 ! 120: ! 121: /* For setting auto repeat on the keyboard */ ! 122: #define ar_format(x) ~((x - 10) / 10) ! 123: #define KBD_ARD 400 /* initial delay in msec (10 - 2560) */ ! 124: #define KBD_ARR 60 /* rate (10 - 2550 msec, 2551 == off)*/
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.