--- linux-2.4.2-orig/include/linux/acpi.h Tue Feb 27 20:30:51 2001 +++ linux/include/linux/acpi.h Sat Mar 3 20:48:55 2001 @@ -160,4 +160,6 @@ #define ACPI_SLP_TYP_DISABLED (~0UL) +int pnpbios_register_driver(char *pnpid, void (*callback)(int iolo, int iohi, int irq, int dma)); + #endif /* _LINUX_ACPI_H */ --- linux-2.4.2-orig/drivers/parport/parport_pc.c Tue Feb 27 20:30:46 2001 +++ linux/drivers/parport/parport_pc.c Sat Mar 3 20:46:01 2001 @@ -60,6 +60,10 @@ #include #include +#ifdef CONFIG_ACPI +#include +#endif + #define PARPORT_PC_MAX_PORTS PARPORT_MAX /* ECR modes */ @@ -1395,6 +1399,22 @@ } #endif /* CONFIG_PARPORT_PC_SUPERIO */ +static void __devinit set_superio_hint(int io,int irq,int dma) +{ int i=0; + + while((superios[i].io!= 0) && (i +#include +#include +#include +#include "acpi.h" + + +static ACPI_STATUS found_pnp( ACPI_HANDLE handle, u32 level, void *ctx, void **value); + + +int pnpbios_register_driver( char *pnpid, void (*callback)(int iolo, int iohi, int irq, int dma)) +{ + if(acpi_active) + acpi_get_devices(pnpid, found_pnp, callback, NULL); + return 0; +} + + +static ACPI_STATUS +found_pnp( + ACPI_HANDLE handle, + u32 level, + void *ctx, + void **value) +{ + ACPI_BUFFER buf; + RESOURCE *res; + int iolo=-1, iohi=-1, irq=-1, dma=-1; + + buf.length = 0; + buf.pointer = NULL; + if (acpi_get_current_resources(handle, &buf) != AE_BUFFER_OVERFLOW) + return AE_OK; + + buf.pointer = kmalloc(buf.length, GFP_KERNEL); + if (!buf.pointer) + return AE_NO_MEMORY; + + if (!ACPI_SUCCESS(acpi_get_current_resources(handle, &buf))) { + kfree(buf.pointer); + return AE_OK; + } + + + res = (RESOURCE*) buf.pointer; + + while ( ((void *)res < buf.pointer + buf.length) && + res->length >0 ) { + if(res->id == 0) irq =res->data.irq.interrupts[0]; + if(res->id == 1) dma =res->data.dma.channels[0]; + if(res->id == 4) { + if(iolo==-1) + iolo= res->data.io.min_base_address; + else + iohi= res->data.io.min_base_address; + } + res = NEXT_RESOURCE(res); + } + + kfree(buf.pointer); + + (( void (*) (int ,int, int, int)) ctx)(iolo,iohi,irq,dma); + return 0; +} + +EXPORT_SYMBOL(pnpbios_register_driver); + --- linux-2.4.2-orig/drivers/acpi/include/acglobal.h Tue Feb 27 20:30:33 2001 +++ linux/drivers/acpi/include/acglobal.h Sat Mar 3 20:38:08 2001 @@ -39,6 +39,8 @@ #define ACPI_EXTERN extern #endif +extern int acpi_active; // is ACPI initialized and active ? + extern NATIVE_CHAR *msg_acpi_error_break;