View | Details | Raw Unified | Return to bug 119356
Collapse All | Expand All

(-)sys/i386/acpica/acpi_wakeup.c (-34 / +3 lines)
Lines 294-333 Link Here
294
	return (ret);
294
	return (ret);
295
}
295
}
296
296
297
static bus_dma_tag_t	acpi_waketag;
297
extern bus_dma_tag_t	acpi_waketag;
298
static bus_dmamap_t	acpi_wakemap;
298
extern bus_dmamap_t	acpi_wakemap;
299
static vm_offset_t	acpi_wakeaddr;
299
extern vm_offset_t	acpi_wakeaddr;
300
301
static void
302
acpi_alloc_wakeup_handler(void)
303
{
304
	void *wakeaddr;
305
306
	if (!cold)
307
		return;
308
309
	/*
310
	 * Specify the region for our wakeup code.  We want it in the low 1 MB
311
	 * region, excluding video memory and above (0xa0000).  We ask for
312
	 * it to be page-aligned, just to be safe.
313
	 */
314
	if (bus_dma_tag_create(/*parent*/ NULL,
315
	    /*alignment*/ PAGE_SIZE, /*no boundary*/ 0,
316
	    /*lowaddr*/ 0x9ffff, /*highaddr*/ BUS_SPACE_MAXADDR, NULL, NULL,
317
	    /*maxsize*/ PAGE_SIZE, /*segments*/ 1, /*maxsegsize*/ PAGE_SIZE,
318
	    0, busdma_lock_mutex, &Giant, &acpi_waketag) != 0) {
319
		printf("acpi_alloc_wakeup_handler: can't create wake tag\n");
320
		return;
321
	}
322
	if (bus_dmamem_alloc(acpi_waketag, &wakeaddr, BUS_DMA_NOWAIT,
323
	    &acpi_wakemap) != 0) {
324
		printf("acpi_alloc_wakeup_handler: can't alloc wake memory\n");
325
		return;
326
	}
327
	acpi_wakeaddr = (vm_offset_t)wakeaddr;
328
}
329
330
SYSINIT(acpiwakeup, SI_SUB_KMEM, SI_ORDER_ANY, acpi_alloc_wakeup_handler, 0)
331
300
332
static void
301
static void
333
acpi_realmodeinst(void *arg, bus_dma_segment_t *segs, int nsegs, int error)
302
acpi_realmodeinst(void *arg, bus_dma_segment_t *segs, int nsegs, int error)
(-)sys/i386/i386/vm_machdep.c (+40 lines)
Lines 69-75 Link Here
69
#include <sys/unistd.h>
69
#include <sys/unistd.h>
70
#include <sys/vnode.h>
70
#include <sys/vnode.h>
71
#include <sys/vmmeter.h>
71
#include <sys/vmmeter.h>
72
#include <sys/bus.h>
72
73
74
#include <vm/vm.h>
75
76
#include <machine/bus.h>
73
#include <machine/cpu.h>
77
#include <machine/cpu.h>
74
#include <machine/cputypes.h>
78
#include <machine/cputypes.h>
75
#include <machine/md_var.h>
79
#include <machine/md_var.h>
Lines 849-851 Link Here
849
853
850
	return 1;
854
	return 1;
851
}
855
}
856
857
bus_dma_tag_t	acpi_waketag;
858
bus_dmamap_t	acpi_wakemap;
859
vm_offset_t	acpi_wakeaddr = NULL;
860
861
static void
862
acpi_alloc_wakeup_handler(void)
863
{
864
	void *wakeaddr;
865
866
	if (!cold)
867
		return;
868
869
	/*
870
	 * Specify the region for our wakeup code.  We want it in the low 1 MB
871
	 * region, excluding video memory and above (0xa0000).  We ask for
872
	 * it to be page-aligned, just to be safe.
873
	 */
874
	if (bus_dma_tag_create(/*parent*/ NULL,
875
	    /*alignment*/ PAGE_SIZE, /*no boundary*/ 0,
876
	    /*lowaddr*/ 0x9ffff, /*highaddr*/ BUS_SPACE_MAXADDR, NULL, NULL,
877
	    /*maxsize*/ PAGE_SIZE, /*segments*/ 1, /*maxsegsize*/ PAGE_SIZE,
878
	    0, busdma_lock_mutex, &Giant, &acpi_waketag) != 0) {
879
		printf("acpi_alloc_wakeup_handler: can't create wake tag\n");
880
		return;
881
	}
882
	if (bus_dmamem_alloc(acpi_waketag, &wakeaddr, BUS_DMA_NOWAIT,
883
	    &acpi_wakemap) != 0) {
884
		printf("acpi_alloc_wakeup_handler: can't alloc wake memory\n");
885
		return;
886
	}
887
	acpi_wakeaddr = (vm_offset_t)wakeaddr;
888
}
889
890
SYSINIT(acpiwakeup, SI_SUB_KMEM, SI_ORDER_ANY, acpi_alloc_wakeup_handler, 0)
891

Return to bug 119356