ia64/xen-unstable

view xen/arch/x86/ioport_emulate.c @ 19835:edfdeb150f27

Fix buildsystem to detect udev > version 124

udev removed the udevinfo symlink from versions higher than 123 and
xen's build-system could not detect if udev is in place and has the
required version.

Signed-off-by: Marc-A. Dahlhaus <mad@wol.de>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Jun 25 13:02:37 2009 +0100 (2009-06-25)
parents 2522cc95efd2
children
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 BL2xx",
100 .matches = {
101 DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
102 DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL2"),
103 },
104 },
105 {
106 .callback = proliant_quirk,
107 .ident = "HP ProLiant BL4xx",
108 .matches = {
109 DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
110 DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL4"),
111 },
112 },
113 {
114 .callback = proliant_quirk,
115 .ident = "HP ProLiant BL6xx",
116 .matches = {
117 DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
118 DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL6"),
119 },
120 },
121 { }
122 };
124 int __init ioport_quirks_init(void)
125 {
126 dmi_check_system(ioport_quirks_tbl);
127 return 0;
128 }
129 __initcall(ioport_quirks_init);
131 /*
132 * Local variables:
133 * mode: C
134 * c-set-style: "BSD"
135 * c-basic-offset: 4
136 * tab-width: 4
137 * indent-tabs-mode: nil
138 * End:
139 */