From: Brown, L. <len...@in...> - 2005-05-24 09:48:22
|
My personal preference is to delete /proc/acpi/dsdt rather than complicate other code to support a feature that shouldn't exist. We've got an updated user-space utility that can read dsdt, multiple ssdt, etc -- should be available in an acpica release soon; replacing the current pmtools acpidmp. -Len >-----Original Message----- >From: Kenji Kaneshige [mailto:kan...@jp...]=20 >Sent: Tuesday, May 24, 2005 4:28 AM >To: Brown, Len; acp...@li... >Cc: Alan Cox >Subject: [PATCH] take2: enable acpi_os_allocate() to allocate=20 >larger memory > >Hi, > >Here is an updated patch to enable acpi_os_allocate() to allocate >larger memory. This patch is based on the feedback from Alan Cox >(Thank you!). > >Len, could you consider applying this patch? > >Thanks, >Kenji Kaneshige > >--- > >I encountered the problem that I could not read /proc/acpi/dsdt on my >machine. It turned out that acpi_os_allocate() was failed to allocate >buffer. The DSDT on my machine was too large for acpi_os_allocate() to >allocate the buffer. > >Current acpi_os_allocate() interface is implemented by using kmalloc() >whose maximum allocation size is limited. So acpi_os_allocate() would >fail if larger size than maximum allocation size of kmalloc was >specified. I think this restriction should be removed. > >The following patch enables acpi_os_allocate() to allocate larger >memory. > >Signed-off-by: Kenji Kaneshige <kan...@jp...> > >--- > > linux-2.6.12-rc4-kanesige/drivers/acpi/osl.c | 12 ++++++++++-- > 1 files changed, 10 insertions(+), 2 deletions(-) > >diff -puN drivers/acpi/osl.c~fix_acpi_os_allocate drivers/acpi/osl.c >--- linux-2.6.12-rc4/drivers/acpi/osl.c~fix_acpi_os_allocate=09 >2005-05-24 16:32:51.000000000 +0900 >+++ linux-2.6.12-rc4-kanesige/drivers/acpi/osl.c=09 >2005-05-24 16:34:25.000000000 +0900 >@@ -37,6 +37,7 @@ > #include <linux/delay.h> > #include <linux/workqueue.h> > #include <linux/nmi.h> >+#include <linux/vmalloc.h> > #include <acpi/acpi.h> > #include <asm/io.h> > #include <acpi/acpi_bus.h> >@@ -145,13 +146,20 @@ acpi_os_vprintf(const char *fmt, va_list > void * > acpi_os_allocate(acpi_size size) > { >- return kmalloc(size, GFP_KERNEL); >+ void *ptr =3D kmalloc(size,=20 >GFP_KERNEL|__GFP_NORETRY|__GFP_NOWARN); >+ if (!ptr) >+ ptr =3D vmalloc(size); >+ return ptr; > } >=20 > void > acpi_os_free(void *ptr) > { >- kfree(ptr); >+ if (VMALLOC_START <=3D (unsigned long)ptr && >+ (unsigned long)ptr < VMALLOC_END) >+ vfree(ptr); >+ else >+ kfree(ptr); > } > EXPORT_SYMBOL(acpi_os_free); >=20 > >_ > |