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)
static int __init dmi_iterate(void (*decode)(struct dmi_header *))
{
u8 buf[15];
u32 fp=0xF0000;
char __iomem *p, *q;
while (fp < 0xFFFFF)
{
isa_memcpy_fromio(buf, fp, 15);
for (p = q = ioremap(0xF0000, 0x10000); q < p + 0x10000; q += 16) {
memcpy_fromio(buf, q, 15);
if(memcmp(buf, "_DMI_", 5)==0 && dmi_checksum(buf))
{
u16 num=buf[13]<<8|buf[12];
......@@ -126,11 +125,13 @@ static int __init dmi_iterate(void (*decode)(struct dmi_header *))
num, len));
dmi_printk((KERN_INFO "DMI table at 0x%08X.\n",
base));
if(dmi_table(base,len, num, decode)==0)
if(dmi_table(base,len, num, decode)==0) {
iounmap(p);
return 0;
}
}
fp+=16;
}
iounmap(p);
return -1;
}
......
......@@ -1004,9 +1004,11 @@ static void __init set_task_gate(unsigned int n, unsigned int gdt_entry)
void __init trap_init(void)
{
#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;
}
iounmap(p);
#endif
#ifdef CONFIG_X86_LOCAL_APIC
......
......@@ -621,32 +621,35 @@ static int __init dmi_table(u32 base, int len, int num, void (*fn)(DMIHeader*))
static int __init dmi_iterate(void (*decode)(DMIHeader *))
{
unsigned char buf[20];
long fp = 0x000e0000L;
fp -= 16;
while (fp < 0x000fffffL) {
fp += 16;
isa_memcpy_fromio(buf, fp, 20);
if (memcmp(buf, "_DMI_", 5)==0) {
u16 num = buf[13]<<8 | buf[12];
u16 len = buf [7]<<8 | buf [6];
u32 base = buf[11]<<24 | buf[10]<<16 | buf[9]<<8 | buf[8];
unsigned char buf[20];
void __iomem *p = ioremap(0xe0000, 0x20000), *q;
if (!p)
return -1;
for (q = p; q < p + 0x20000; q += 16) {
memcpy_fromio(buf, q, 20);
if (memcmp(buf, "_DMI_", 5)==0) {
u16 num = buf[13]<<8 | buf[12];
u16 len = buf [7]<<8 | buf [6];
u32 base = buf[11]<<24 | buf[10]<<16 | buf[9]<<8 | buf[8];
#ifdef I8K_DEBUG
printk(KERN_INFO "DMI %d.%d present.\n",
buf[14]>>4, buf[14]&0x0F);
printk(KERN_INFO "%d structures occupying %d bytes.\n",
buf[13]<<8 | buf[12],
buf [7]<<8 | buf[6]);
printk(KERN_INFO "DMI table at 0x%08X.\n",
buf[11]<<24 | buf[10]<<16 | buf[9]<<8 | buf[8]);
printk(KERN_INFO "DMI %d.%d present.\n",
buf[14]>>4, buf[14]&0x0F);
printk(KERN_INFO "%d structures occupying %d bytes.\n",
buf[13]<<8 | buf[12],
buf [7]<<8 | buf[6]);
printk(KERN_INFO "DMI table at 0x%08X.\n",
buf[11]<<24 | buf[10]<<16 | buf[9]<<8 | buf[8]);
#endif
if (dmi_table(base, len, num, decode)==0) {
return 0;
}
if (dmi_table(base, len, num, decode)==0) {
iounmap(p);
return 0;
}
}
}
}
return -1;
iounmap(p);
return -1;
}
/* 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