ia64/xen-unstable

view xen/arch/x86/ioport_emulate.c @ 18336:9eb8bbfbaa06

x86: update ioport_quirks_tbl[] for the proliant DL7xx

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Aug 18 10:47:54 2008 +0100 (2008-08-18)
parents 35890b260971
children 2522cc95efd2
line source
1 /******************************************************************************
2 * ioport_emulate.c
3 *
4 * Handle I/O port access quirks of various platforms.
5 */
7 #include <xen/config.h>
8 #include <xen/init.h>
9 #include <xen/sched.h>
10 #include <xen/dmi.h>
12 /* Function pointer used to handle platform specific I/O port emulation. */
13 extern void (*ioemul_handle_quirk)(
14 u8 opcode, char *io_emul_stub, struct cpu_user_regs *regs);
16 static void ioemul_handle_proliant_quirk(
17 u8 opcode, char *io_emul_stub, struct cpu_user_regs *regs)
18 {
19 uint16_t port = regs->edx;
20 uint8_t value = regs->eax;
22 if ( (opcode != 0xee) || (port != 0xcd4) || !(value & 0x80) )
23 return;
25 /* pushf */
26 io_emul_stub[0] = 0x9c;
27 /* cli */
28 io_emul_stub[1] = 0xfa;
29 /* out %al,%dx */
30 io_emul_stub[2] = 0xee;
31 /* 1: in %dx,%al */
32 io_emul_stub[3] = 0xec;
33 /* test $0x80,%al */
34 io_emul_stub[4] = 0xa8;
35 io_emul_stub[5] = 0x80;
36 /* jnz 1b */
37 io_emul_stub[6] = 0x75;
38 io_emul_stub[7] = 0xfb;
39 /* popf */
40 io_emul_stub[8] = 0x9d;
41 /* ret */
42 io_emul_stub[9] = 0xc3;
43 }
45 int __init proliant_quirk(struct dmi_system_id *d)
46 {
47 ioemul_handle_quirk = ioemul_handle_proliant_quirk;
48 return 0;
49 }
51 /* This table is the set of system-specific I/O emulation hooks. */
52 static struct dmi_system_id __initdata ioport_quirks_tbl[] = {
53 /*
54 * I/O emulation hook for certain HP ProLiant servers with
55 * 'special' SMM goodness.
56 */
57 {
58 .callback = proliant_quirk,
59 .ident = "HP ProLiant DL3xx",
60 .matches = {
61 DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
62 DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL3"),
63 },
64 },
65 {
66 .callback = proliant_quirk,
67 .ident = "HP ProLiant DL5xx",
68 .matches = {
69 DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
70 DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL5"),
71 },
72 },
73 {
74 .callback = proliant_quirk,
75 .ident = "HP ProLiant DL7xx",
76 .matches = {
77 DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
78 DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL7"),
79 },
80 },
81 {
82 .callback = proliant_quirk,
83 .ident = "HP ProLiant ML3xx",
84 .matches = {
85 DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
86 DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant ML3"),
87 },
88 },
89 {
90 .callback = proliant_quirk,
91 .ident = "HP ProLiant ML5xx",
92 .matches = {
93 DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
94 DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant ML5"),
95 },
96 },
97 {
98 .callback = proliant_quirk,
99 .ident = "HP ProLiant BL4xx",
100 .matches = {
101 DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
102 DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL4"),
103 },
104 },
105 {
106 .callback = proliant_quirk,
107 .ident = "HP ProLiant BL6xx",
108 .matches = {
109 DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
110 DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL6"),
111 },
112 },
113 { }
114 };
116 int __init ioport_quirks_init(void)
117 {
118 dmi_check_system(ioport_quirks_tbl);
119 return 0;
120 }
121 __initcall(ioport_quirks_init);
123 /*
124 * Local variables:
125 * mode: C
126 * c-set-style: "BSD"
127 * c-basic-offset: 4
128 * tab-width: 4
129 * indent-tabs-mode: nil
130 * End:
131 */