FreeBSD Bugzilla – Attachment 83568 Details for
Bug 119356
[acpi]: i386 ACPI wakeup not work due resource exhaustion
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 2.88 KB, created by
Dan Lukes
on 2008-01-05 11:50:01 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Dan Lukes
Created:
2008-01-05 11:50:01 UTC
Size:
2.88 KB
patch
obsolete
>--- sys/i386/acpica/acpi_wakeup.c.ORIG 2008-01-05 11:04:04.000000000 +0100 >+++ sys/i386/acpica/acpi_wakeup.c 2008-01-05 11:12:10.000000000 +0100 >@@ -294,40 +294,9 @@ > return (ret); > } > >-static bus_dma_tag_t acpi_waketag; >-static bus_dmamap_t acpi_wakemap; >-static vm_offset_t acpi_wakeaddr; >- >-static void >-acpi_alloc_wakeup_handler(void) >-{ >- void *wakeaddr; >- >- if (!cold) >- return; >- >- /* >- * Specify the region for our wakeup code. We want it in the low 1 MB >- * region, excluding video memory and above (0xa0000). We ask for >- * it to be page-aligned, just to be safe. >- */ >- if (bus_dma_tag_create(/*parent*/ NULL, >- /*alignment*/ PAGE_SIZE, /*no boundary*/ 0, >- /*lowaddr*/ 0x9ffff, /*highaddr*/ BUS_SPACE_MAXADDR, NULL, NULL, >- /*maxsize*/ PAGE_SIZE, /*segments*/ 1, /*maxsegsize*/ PAGE_SIZE, >- 0, busdma_lock_mutex, &Giant, &acpi_waketag) != 0) { >- printf("acpi_alloc_wakeup_handler: can't create wake tag\n"); >- return; >- } >- if (bus_dmamem_alloc(acpi_waketag, &wakeaddr, BUS_DMA_NOWAIT, >- &acpi_wakemap) != 0) { >- printf("acpi_alloc_wakeup_handler: can't alloc wake memory\n"); >- return; >- } >- acpi_wakeaddr = (vm_offset_t)wakeaddr; >-} >- >-SYSINIT(acpiwakeup, SI_SUB_KMEM, SI_ORDER_ANY, acpi_alloc_wakeup_handler, 0) >+extern bus_dma_tag_t acpi_waketag; >+extern bus_dmamap_t acpi_wakemap; >+extern vm_offset_t acpi_wakeaddr; > > static void > acpi_realmodeinst(void *arg, bus_dma_segment_t *segs, int nsegs, int error) >--- sys/i386/i386/vm_machdep.c.ORIG 2008-01-05 11:04:16.000000000 +0100 >+++ sys/i386/i386/vm_machdep.c 2008-01-05 11:09:18.000000000 +0100 >@@ -69,7 +69,11 @@ > #include <sys/unistd.h> > #include <sys/vnode.h> > #include <sys/vmmeter.h> >+#include <sys/bus.h> > >+#include <vm/vm.h> >+ >+#include <machine/bus.h> > #include <machine/cpu.h> > #include <machine/cputypes.h> > #include <machine/md_var.h> >@@ -849,3 +853,39 @@ > > return 1; > } >+ >+bus_dma_tag_t acpi_waketag; >+bus_dmamap_t acpi_wakemap; >+vm_offset_t acpi_wakeaddr = NULL; >+ >+static void >+acpi_alloc_wakeup_handler(void) >+{ >+ void *wakeaddr; >+ >+ if (!cold) >+ return; >+ >+ /* >+ * Specify the region for our wakeup code. We want it in the low 1 MB >+ * region, excluding video memory and above (0xa0000). We ask for >+ * it to be page-aligned, just to be safe. >+ */ >+ if (bus_dma_tag_create(/*parent*/ NULL, >+ /*alignment*/ PAGE_SIZE, /*no boundary*/ 0, >+ /*lowaddr*/ 0x9ffff, /*highaddr*/ BUS_SPACE_MAXADDR, NULL, NULL, >+ /*maxsize*/ PAGE_SIZE, /*segments*/ 1, /*maxsegsize*/ PAGE_SIZE, >+ 0, busdma_lock_mutex, &Giant, &acpi_waketag) != 0) { >+ printf("acpi_alloc_wakeup_handler: can't create wake tag\n"); >+ return; >+ } >+ if (bus_dmamem_alloc(acpi_waketag, &wakeaddr, BUS_DMA_NOWAIT, >+ &acpi_wakemap) != 0) { >+ printf("acpi_alloc_wakeup_handler: can't alloc wake memory\n"); >+ return; >+ } >+ acpi_wakeaddr = (vm_offset_t)wakeaddr; >+} >+ >+SYSINIT(acpiwakeup, SI_SUB_KMEM, SI_ORDER_ANY, acpi_alloc_wakeup_handler, 0) >+
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 119356
: 83568