Deleted Added
full compact
atkbd.c (197444) atkbd.c (197466)
1/*-
2 * Copyright (c) 1999 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 12 unchanged lines hidden (view full) ---

21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
26 */
27
28#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1999 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 12 unchanged lines hidden (view full) ---

21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
26 */
27
28#include <sys/cdefs.h>
29__FBSDID("$FreeBSD: head/sys/dev/atkbdc/atkbd.c 197444 2009-09-23 20:49:14Z jkim $");
29__FBSDID("$FreeBSD: head/sys/dev/atkbdc/atkbd.c 197466 2009-09-24 19:24:42Z jkim $");
30
31#include "opt_compat.h"
32#include "opt_kbd.h"
33#include "opt_atkbd.h"
34
35#include <sys/param.h>
36#include <sys/systm.h>
37#include <sys/kernel.h>

--- 1055 unchanged lines hidden (view full) ---

1093 /*
1094 * Only some systems allow us to retrieve the keyboard repeat
1095 * rate previously set via the BIOS...
1096 */
1097 x86regs_t regs;
1098 vm_offset_t p;
1099
1100 regs.R_AX = 0xc000;
30
31#include "opt_compat.h"
32#include "opt_kbd.h"
33#include "opt_atkbd.h"
34
35#include <sys/param.h>
36#include <sys/systm.h>
37#include <sys/kernel.h>

--- 1055 unchanged lines hidden (view full) ---

1093 /*
1094 * Only some systems allow us to retrieve the keyboard repeat
1095 * rate previously set via the BIOS...
1096 */
1097 x86regs_t regs;
1098 vm_offset_t p;
1099
1100 regs.R_AX = 0xc000;
1101 x86biosCall(&regs, 0x15);
1101 x86bios_intr(&regs, 0x15);
1102 if ((regs.R_EFLG & PSL_C) || regs.R_AH)
1103 return ENODEV;
1104 p = BIOS_PADDRTOVADDR((regs.R_ES << 4) + regs.R_BX);
1105 if ((readb(p + 6) & 0x40) == 0) /* int 16, function 0x09 supported? */
1106 return ENODEV;
1107 regs.R_AX = 0x0900;
1102 if ((regs.R_EFLG & PSL_C) || regs.R_AH)
1103 return ENODEV;
1104 p = BIOS_PADDRTOVADDR((regs.R_ES << 4) + regs.R_BX);
1105 if ((readb(p + 6) & 0x40) == 0) /* int 16, function 0x09 supported? */
1106 return ENODEV;
1107 regs.R_AX = 0x0900;
1108 x86biosCall(&regs, 0x16);
1108 x86bios_intr(&regs, 0x16);
1109 if ((regs.R_AL & 0x08) == 0) /* int 16, function 0x0306 supported? */
1110 return ENODEV;
1111 regs.R_AX = 0x0306;
1109 if ((regs.R_AL & 0x08) == 0) /* int 16, function 0x0306 supported? */
1110 return ENODEV;
1111 regs.R_AX = 0x0306;
1112 x86biosCall(&regs, 0x16);
1112 x86bios_intr(&regs, 0x16);
1113 kbd->kb_delay1 = typematic_delay(regs.R_BH << 5);
1114 kbd->kb_delay2 = typematic_rate(regs.R_BL);
1115 return 0;
1116#else
1117 return ENODEV;
1118#endif /* __i386__ || __amd64__ */
1119}
1120

--- 382 unchanged lines hidden ---
1113 kbd->kb_delay1 = typematic_delay(regs.R_BH << 5);
1114 kbd->kb_delay2 = typematic_rate(regs.R_BL);
1115 return 0;
1116#else
1117 return ENODEV;
1118#endif /* __i386__ || __amd64__ */
1119}
1120

--- 382 unchanged lines hidden ---