The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/i386ps2/kd_mouse_abios.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /* 
    2  * Mach Operating System
    3  * Copyright (c) 1991 Carnegie Mellon University
    4  * Copyright (c) 1991 IBM Corporation 
    5  * All Rights Reserved.
    6  * 
    7  * Permission to use, copy, modify and distribute this software and its
    8  * documentation is hereby granted, provided that both the copyright
    9  * notice and this permission notice appear in all copies of the
   10  * software, derivative works or modified versions, and any portions
   11  * thereof, and that both notices appear in supporting documentation,
   12  * and that the name IBM not be used in advertising or publicity 
   13  * pertaining to distribution of the software without specific, written
   14  * prior permission.
   15  * 
   16  * CARNEGIE MELLON AND IBM ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS IS"
   17  * CONDITION.  CARNEGIE MELLON AND IBM DISCLAIM ANY LIABILITY OF ANY KIND FOR
   18  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
   19  * 
   20  * Carnegie Mellon requests users of this software to return to
   21  * 
   22  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
   23  *  School of Computer Science
   24  *  Carnegie Mellon University
   25  *  Pittsburgh PA 15213-3890
   26  * 
   27  * any improvements or extensions that they make and grant Carnegie Mellon
   28  * the rights to redistribute these changes.
   29  */
   30 
   31 /*
   32  * HISTORY
   33  * $Log:        kd_mouse_abios.h,v $
   34  * Revision 2.3  93/03/11  14:09:29  danner
   35  *      u_long -> u_int
   36  *      [93/03/09            danner]
   37  * 
   38  * Revision 2.2  93/02/04  08:01:08  danner
   39  *      Integrate PS2 code from IBM.
   40  *      [93/01/18            prithvi]
   41  * 
   42  */
   43 
   44 /* @(#)kd_mouse_abios.h       1.9  @(#)kd_mouse_abios.h 1.9 3/8/90 19:40:12 */
   45 /*
   46  * COMPONENT_NAME: SYSXMOUSE mouse driver
   47  *
   48  * FUNCTIONS:
   49  *
   50  * ORIGINS: 27
   51  */                                                                   
   52 
   53 #ifndef _H_MOUSEABIOS
   54 #define _H_MOUSEABIOS
   55 
   56 /* ABIOS mouse specific function codes.
   57 **      - see <sys/abios.h> for generic ABIOS request defines
   58 */
   59 #define ABIOS_MOUSE_RESET_POINTING_DEVICE               0x05
   60 #define ABIOS_MOUSE_ENABLE_POINTING_DEVICE              0x06
   61 #define ABIOS_MOUSE_DISABLE_POINTING_DEVICE             0x07
   62 #define ABIOS_MOUSE_POINTING_DEVICE_CONTINUOUS_READ     0x08
   63 #define ABIOS_MOUSE_SET_SAMPLE_RATE                     0x0B
   64 #define ABIOS_MOUSE_SET_RESOLUTION                      0x0C
   65 #define ABIOS_MOUSE_SET_SCALING_FACTOR                  0x0D
   66 #define ABIOS_MOUSE_READ_POINTING_DEVICE_IDENTIFICATION_CODE    0x0E
   67 
   68 /* ABIOS mouse specific return codes.
   69 */
   70 #define ABIOS_MOUSE_RC_DONE                     0x0000
   71 #define ABIOS_MOUSE_RC_STAGE_ON_INT             0x0001
   72 #define ABIOS_MOUSE_RC_STAGE_ON_TIME            0x0002
   73 #define ABIOS_MOUSE_RC_NOT_MY_INT               0x0005
   74 #define ABIOS_MOUSE_RC_ATTENTION                0x0009
   75 #define ABIOS_MOUSE_RC_DEVICE_IN_USE            0x8000
   76 #define ABIOS_MOUSE_RC_RESEND                   0x8001
   77 #define ABIOS_MOUSE_RC_TWO_CONSECUTIVE_RESENDS_FOUND    0x8002
   78 #define ABIOS_MOUSE_RC_SYSTEM_LOCK              0x8003
   79 #define ABIOS_MOUSE_RC_INVALID_LOGICAL_ID       0xC000
   80 #define ABIOS_MOUSE_RC_INVALID_FUNCTION         0xC001
   81 #define ABIOS_MOUSE_RC_INVALID_UNIT_NUMBER      0xC003
   82 #define ABIOS_MOUSE_RC_INVALID_REQUEST_BLOCK_LENGTH     0xC004
   83 #define ABIOS_MOUSE_RC_INVALID_MOUSE_CONTROLLER_PARAMETER       0xC005
   84 
   85 /*  Set up mouse ABIOS request block, assuming request block length
   86 ** of MOUSE_REQUEST_BLOCK_LEN+0x10 bytes.  This should be sufficient.
   87 ** The real value can be found by issuing ABIOS_LOGICAL_PARAMETER
   88 ** function.
   89 */
   90 struct Device_params
   91 {
   92         u_char  interface_status;
   93         u_char  data_package_size;
   94         u_short flag_word;
   95         u_short current_resolution;
   96         u_short current_sample_rate;
   97         u_int   time_to_wait;
   98 };
   99 
  100 struct Pointing_device_data
  101 {
  102         u_char  reserved[0x0c];
  103         u_char  status;
  104         u_char  deltax;
  105         u_char  deltay;
  106         u_char  reserved2[0x09];
  107 };
  108 
  109 struct Set_scaling_factor
  110 {
  111         u_char  scaling_factor;
  112         u_char  reserved[7];
  113         u_int   time_to_wait;
  114         u_char  reserved2[12];
  115         u_char  retry_mode_enable;
  116         u_char  mouse_data_buffer_index;
  117         u_short retry_parameters;
  118         u_short reserved3;
  119         u_char  count_of_status_bytes_in_RB;
  120         u_char  current_interrupt_level;
  121         u_char  arbitration_level;
  122         u_short device_id;
  123         u_short keyboard_data_register;
  124         u_short the_8042_status_register;
  125         u_char  reserved4;
  126         u_char  pointer_to_beginning_of_request_block_status_area;
  127 };
  128 
  129 struct Pointing_device_id_code
  130 {
  131         u_char  auxiliary_device_identification_code;
  132         u_char  reserved[7];
  133         u_int   time_to_wait;
  134         u_char  reserved2[12];
  135         u_char  retry_mode_enable;
  136         u_char  mouse_data_buffer_index;
  137         u_short retry_parameters;
  138         u_short reserved3;
  139         u_char  count_of_status_bytes_in_RB;
  140         u_char  current_interrupt_level;
  141         u_char  arbitration_level;
  142         u_short device_id;
  143         u_short keyboard_status_register;
  144         u_short the_8042_status_register;
  145         u_char  reserved4;
  146         u_char  pointer_to_beginning_of_request_block_status_area;
  147 };
  148 
  149 struct Set_sample_rate
  150 {
  151      u_char   reserved[2];
  152      u_short  sample_rate;
  153      u_char   reserved2[4];
  154      u_int   time_to_wait;
  155    };
  156 
  157 struct Set_resolution
  158 {
  159      u_char   reserved[2];
  160      u_short  resolution;
  161      u_char   reserved2[4];
  162      u_int   time_to_wait;
  163      u_char   reserved3[4];
  164    };
  165 
  166 #define MOUSE_REQUEST_BLOCK_LEN         64
  167 struct  Mouse_request {
  168         struct Request_header request_header;   /* 0x00-0x0f abios.h */
  169         union {
  170                 struct Logical_id_params        logical_id_params;
  171                 struct Device_params            device_params;
  172                 struct Pointing_device_data     pointing_device_data;
  173                 struct Set_scaling_factor       set_scaling_factor;
  174                 struct Pointing_device_id_code  pointing_device_id_code;
  175                 struct Set_sample_rate          set_sample_rate;
  176                 struct Set_resolution           set_resolution;
  177                 u_char                          uc[MOUSE_REQUEST_BLOCK_LEN];
  178         } un;
  179         short   r_flags;
  180 };
  181 
  182 /* Mouse_request.r_flags */
  183 #define MS_NOERR        0x0001
  184 #define MS_NOUNIT       0x0002
  185 #define MS_DEFLT        (0x0000)
  186 
  187 /* ABIOS_LOGICAL_PARAMETER (0x01)
  188 **      - Always returns 0.
  189 **      - Does not interrupt.
  190 ** INPUT: see mouse_cmd.c
  191 ** OUTPUT: see <sys/abios.h>
  192 */
  193 #define MOUSE_SET_RESERVED_ABIOS_LOGICAL_PARAMETER(rb) \
  194         *( (u_short *) &(rb).un.uc[0x0a])  = 0; \
  195         *( (u_short *) &(rb).un.uc[0x0c])  = 0; \
  196         *( (u_short *) &(rb).un.uc[0x0e])  = 0;
  197 
  198 
  199 /* ABIOS_READ_PARAMETER (0x03)
  200 **      - function which returns info specific to the selected drive.
  201 **      - only returns 0
  202 **      - does not interrupt
  203 ** INPUT: drive number
  204 **
  205 */
  206 #define MOUSE_SET_RESERVED_ABIOS_READ_PARAMETER(rb) \
  207         *( (u_short *) &(rb).un.uc[0x0c])  = 0;
  208 
  209 /* OUTPUT */
  210 #define MOUSE_TIME_TO_WAIT(rb) *( (u_int *) &(rb).un.uc[0x08])
  211 #define r_interface_status      un.device_params.interface_status
  212 #define r_3_data_package_size   un.device_params.data_package_size
  213 #define r_flag_word             un.device_params.flag_word
  214 #define r_current_resolution    un.device_params.current_resolution
  215 #define r_current_sample_rate   un.device_params.current_sample_rate
  216 
  217 /* For ABIOS_MOUSE_RESET_POINTING_DEVICE (0x05)
  218 **      - resets the mouse to an initial state
  219 */
  220 #define MOUSE_SET_RESERVED_ABIOS_RESET_POINTING_DEVICE(rb) \
  221         *( (u_short *) &(rb).un.uc[0x0c]) = 0;
  222 /* OUTPUT */
  223 #define r_pointing_device_completion_code       un.uc[0x00]
  224 #define r_pointing_device_identification_code   un.uc[0x01]
  225 
  226 
  227 /* For MOUSE_ABIOS_ENABLE_POINTING_DEVICE (0x06) */
  228 #define MOUSE_SET_RESERVED_ABIOS_ENABLE_POINTING_DEVICE(rb) \
  229         *((u_short *) &(rb).un.uc[0x0c]) = 0;
  230 
  231 /* For MOUSE_ABIOS_DISABLE_POINTING_DEVICE (0x07) */
  232 #define MOUSE_SET_RESERVED_ABIOS_DISABLE_POINTING_DEVICE(rb) \
  233         *((u_short *) &(rb).un.uc[0x0c]) = 0;
  234 
  235 /* ABIOS_MOUSE_POINTING_DEVICE_CONTINUOUS_READ (0x08) */
  236 #define MOUSE_SET_RESERVED_ABIOS_POINTING_DEVICE_CONTINUOUS_READ(rb) \
  237         *( (u_int *) &(rb).un.uc[0x02]) = 0;
  238 /* INPUT */
  239 #define r_8_data_package_size   un.uc[0x00]
  240 /* OUTPUT */
  241 #define r_pointing_device_data_status   un.pointing_device_data.status
  242 #define r_pointing_device_data_deltax   un.pointing_device_data.deltax
  243 #define r_pointing_device_data_deltay   un.pointing_device_data.deltay
  244 
  245 /* ABIOS_MOUSE_SET_SAMPLE_RATE (0x0b) */
  246 #define MOUSE_SET_RESERVED_ABIOS_MOUSE_SET_SAMPLE_RATE(rb)
  247 /* INPUT: */
  248 #define r_sample_rate  un.set_sample_rate.sample_rate
  249 
  250 /* ABIOS_MOUSE_SET_RESOLUTION (0x0c) */
  251 #define MOUSE_SET_RESERVED_ABIOS_SET_RESOLUTION(rb) \
  252         *( (u_short *) &(rb).un.uc[0x0c]) = 0;
  253 /* INPUT: */
  254 #define r_resolution  un.set_resolution.resolution
  255 
  256 /* ABIOS_MOUSE_SET_SCALING_FACTOR (0x0d) */
  257 #define MOUSE_SET_RESERVED_ABIOS_SET_SCALING_FACTOR(rb) \
  258         *((u_short *) &(rb).un.uc[0x0c]) = 0;
  259 /* INPUT: */
  260 #define r_scaling_factor  un.set_scaling_factor.scaling_factor
  261 /* OUTPUT */
  262 #define r_D_retry_mode_enable   un.set_scaling_factor.retry_mode_enable
  263 #define r_D_mouse_data_buffer_index \
  264         un.set_scaling_factor.mouse_data_buffer_index
  265 #define r_D_retry_parameters    un.set_scaling_factor.retry_parameters
  266 #define r_D_count_of_status_bytes_in_RB \
  267         un.set_scaling_factor.count_of_status_bytes_in_RB
  268 #define r_D_current_interrupt_level \
  269         un.set_scaling_factor.current_interrupt_level
  270 #define r_D_arbitration_level   un.set_scaling_factor.arbitration_level
  271 #define r_D_device_id   un.set_scaling_factor.device_id
  272 #define r_D_keyboard_status_register \
  273         un.set_scaling_factor.keyboard_status_register
  274 #define r_D_8042_status_register \
  275         un.set_scaling_factor.the_8042_status_register
  276 #define r_D_pointer_to_beginning_of_request_block_status_area \
  277         un.set_scaling_factor.pointer_to_beginning_of_request_block_status_area
  278 
  279 /* ABIOS_MOUSE_READ_POINTING_DEVICE_IDENTIFICATION_CODE (0x0e) */
  280 #define MOUSE_SET_RESERVED_ABIOS_READ_POINTING_DEVICE_IDENTIFICATION_CODE(rb) \
  281         *((u_short *) &(rb).un.uc[0x0c]) = 0;
  282 /* OUTPUT */
  283 #define r_auxiliary_device_identification_code \
  284         un.pointing_device_id_code.auxiliary_device_identification_code
  285 #define r_E_retry_mode_enable   un.pointing_device_id_code.retry_mode_enable
  286 #define r_E_mouse_data_buffer_index \
  287         un.pointing_device_id_code.mouse_data_buffer_index
  288 #define r_E_retry_parameters    un.pointing_device_id_code.retry_parameters
  289 #define r_E_count_of_status_bytes_in_RB \
  290         un.pointing_device_id_code.count_of_status_bytes_in_RB
  291 #define r_E_current_interrupt_level \
  292         un.pointing_device_id_code.current_interrupt_level
  293 #define r_E_arbitration_level   un.pointing_device_id_code.arbitration_level
  294 #define r_E_device_id   un.pointing_device_id_code.device_id
  295 #define r_E_keyboard_status_register \
  296         un.pointing_device_id_code.keyboard_status_register
  297 #define r_E_8042_status_register \
  298         un.pointing_device_id_code.the_8042_status_register
  299 #define r_E_pointer_to_beginning_of_request_block_status_area \
  300 un.pointing_device_id_code.pointer_to_beginning_of_request_block_status_area
  301         
  302 #endif /* _H_MOUSEABIOS */

Cache object: 9d2f4d3a5f9ee5fd8cba3e5b5028cf2a


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.