Commit 988f749a authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] more isa-ectomy

switch to ioremap + normal iomem access primitives
Signed-off-by: default avatarAl Viro <viro@parcelfarce.linux.theplanet.co.uk>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent d2201aa1
...@@ -102,11 +102,10 @@ inline static int __init dmi_checksum(u8 *buf) ...@@ -102,11 +102,10 @@ inline static int __init dmi_checksum(u8 *buf)
static int __init dmi_iterate(void (*decode)(struct dmi_header *)) static int __init dmi_iterate(void (*decode)(struct dmi_header *))
{ {
u8 buf[15]; u8 buf[15];
u32 fp=0xF0000; char __iomem *p, *q;
while (fp < 0xFFFFF) for (p = q = ioremap(0xF0000, 0x10000); q < p + 0x10000; q += 16) {
{ memcpy_fromio(buf, q, 15);
isa_memcpy_fromio(buf, fp, 15);
if(memcmp(buf, "_DMI_", 5)==0 && dmi_checksum(buf)) if(memcmp(buf, "_DMI_", 5)==0 && dmi_checksum(buf))
{ {
u16 num=buf[13]<<8|buf[12]; u16 num=buf[13]<<8|buf[12];
...@@ -126,11 +125,13 @@ static int __init dmi_iterate(void (*decode)(struct dmi_header *)) ...@@ -126,11 +125,13 @@ static int __init dmi_iterate(void (*decode)(struct dmi_header *))
num, len)); num, len));
dmi_printk((KERN_INFO "DMI table at 0x%08X.\n", dmi_printk((KERN_INFO "DMI table at 0x%08X.\n",
base)); base));
if(dmi_table(base,len, num, decode)==0) if(dmi_table(base,len, num, decode)==0) {
iounmap(p);
return 0; return 0;
} }
fp+=16;
} }
}
iounmap(p);
return -1; return -1;
} }
......
...@@ -1004,9 +1004,11 @@ static void __init set_task_gate(unsigned int n, unsigned int gdt_entry) ...@@ -1004,9 +1004,11 @@ static void __init set_task_gate(unsigned int n, unsigned int gdt_entry)
void __init trap_init(void) void __init trap_init(void)
{ {
#ifdef CONFIG_EISA #ifdef CONFIG_EISA
if (isa_readl(0x0FFFD9) == 'E'+('I'<<8)+('S'<<16)+('A'<<24)) { void __iomem *p = ioremap(0x0FFFD9, 4);
if (readl(p) == 'E'+('I'<<8)+('S'<<16)+('A'<<24)) {
EISA_bus = 1; EISA_bus = 1;
} }
iounmap(p);
#endif #endif
#ifdef CONFIG_X86_LOCAL_APIC #ifdef CONFIG_X86_LOCAL_APIC
......
...@@ -622,12 +622,13 @@ static int __init dmi_table(u32 base, int len, int num, void (*fn)(DMIHeader*)) ...@@ -622,12 +622,13 @@ static int __init dmi_table(u32 base, int len, int num, void (*fn)(DMIHeader*))
static int __init dmi_iterate(void (*decode)(DMIHeader *)) static int __init dmi_iterate(void (*decode)(DMIHeader *))
{ {
unsigned char buf[20]; unsigned char buf[20];
long fp = 0x000e0000L; void __iomem *p = ioremap(0xe0000, 0x20000), *q;
fp -= 16;
while (fp < 0x000fffffL) { if (!p)
fp += 16; return -1;
isa_memcpy_fromio(buf, fp, 20);
for (q = p; q < p + 0x20000; q += 16) {
memcpy_fromio(buf, q, 20);
if (memcmp(buf, "_DMI_", 5)==0) { if (memcmp(buf, "_DMI_", 5)==0) {
u16 num = buf[13]<<8 | buf[12]; u16 num = buf[13]<<8 | buf[12];
u16 len = buf [7]<<8 | buf [6]; u16 len = buf [7]<<8 | buf [6];
...@@ -642,10 +643,12 @@ static int __init dmi_iterate(void (*decode)(DMIHeader *)) ...@@ -642,10 +643,12 @@ static int __init dmi_iterate(void (*decode)(DMIHeader *))
buf[11]<<24 | buf[10]<<16 | buf[9]<<8 | buf[8]); buf[11]<<24 | buf[10]<<16 | buf[9]<<8 | buf[8]);
#endif #endif
if (dmi_table(base, len, num, decode)==0) { if (dmi_table(base, len, num, decode)==0) {
iounmap(p);
return 0; return 0;
} }
} }
} }
iounmap(p);
return -1; return -1;
} }
/* end of DMI code */ /* end of DMI code */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment