diff options
| author | jym <jym@NetBSD.org> | 2010-02-24 00:01:11 +0000 |
|---|---|---|
| committer | jym <jym@NetBSD.org> | 2010-02-24 00:01:11 +0000 |
| commit | 7bf36164a7555ca377b8c193554850b308d4efa5 (patch) | |
| tree | 1d3eec54b77852be44242226124d02c999b45b3a /sys/dev/pci | |
| parent | 49f69a7e5c3556f91c03e84716a4edd61de3f829 (diff) | |
- Use ctob() instead of ptoa() to obtain physical addresses from frame
numbers. Using ptoa() will cast to vaddr_t, which might no be adequate
for architectures where sizeof(paddr_t) > sizeof(vaddr_t) (like i386 PAE).
- small fix inside AGP heuristics to avoid masking high order bits for
systems with more than 4GB.
Reviewed by bouyer@.
See also http://mail-index.netbsd.org/tech-kern/2010/02/22/msg007373.html
Diffstat (limited to 'sys/dev/pci')
| -rw-r--r-- | sys/dev/pci/agp.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/pci/agp.c b/sys/dev/pci/agp.c index 0e07125cd55..c05d6a2d6dd 100644 --- a/sys/dev/pci/agp.c +++ b/sys/dev/pci/agp.c @@ -1,4 +1,4 @@ -/* $NetBSD: agp.c,v 1.66 2010/01/08 19:56:51 dyoung Exp $ */ +/* $NetBSD: agp.c,v 1.67 2010/02/24 00:01:11 jym Exp $ */ /*- * Copyright (c) 2000 Doug Rabson @@ -65,7 +65,7 @@ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: agp.c,v 1.66 2010/01/08 19:56:51 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: agp.c,v 1.67 2010/02/24 00:01:11 jym Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -327,7 +327,7 @@ agpattach(device_t parent, device_t self, void *aux) * Work out an upper bound for agp memory allocation. This * uses a heuristic table from the Linux driver. */ - memsize = ptoa(physmem) >> 20; + memsize = physmem >> (20 - PAGE_SHIFT); /* memsize is in MB */ for (i = 0; i < agp_max_size; i++) { if (memsize <= agp_max[i][0]) break; |
