| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: machdep.c,v 1.170 2011/11/10 00:12:04 jym Exp $ */ | | 1 | /* $NetBSD: machdep.c,v 1.171 2011/11/20 18:42:56 yamt Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008, 2011 | | 4 | * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008, 2011 |
5 | * The NetBSD Foundation, Inc. | | 5 | * The NetBSD Foundation, Inc. |
6 | * All rights reserved. | | 6 | * All rights reserved. |
7 | * | | 7 | * |
8 | * This code is derived from software contributed to The NetBSD Foundation | | 8 | * This code is derived from software contributed to The NetBSD Foundation |
9 | * by Charles M. Hannum and by Jason R. Thorpe of the Numerical Aerospace | | 9 | * by Charles M. Hannum and by Jason R. Thorpe of the Numerical Aerospace |
10 | * Simulation Facility, NASA Ames Research Center. | | 10 | * Simulation Facility, NASA Ames Research Center. |
11 | * | | 11 | * |
12 | * This code is derived from software contributed to The NetBSD Foundation | | 12 | * This code is derived from software contributed to The NetBSD Foundation |
13 | * by Coyote Point Systems, Inc. which was written under contract to Coyote | | 13 | * by Coyote Point Systems, Inc. which was written under contract to Coyote |
14 | * Point by Jed Davis and Devon O'Dell. | | 14 | * Point by Jed Davis and Devon O'Dell. |
| @@ -101,27 +101,27 @@ | | | @@ -101,27 +101,27 @@ |
101 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | | 101 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
102 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | | 102 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
103 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | | 103 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
104 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 104 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
105 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 105 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
106 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 106 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
107 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 107 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
108 | * SUCH DAMAGE. | | 108 | * SUCH DAMAGE. |
109 | * | | 109 | * |
110 | * @(#)machdep.c 7.4 (Berkeley) 6/3/91 | | 110 | * @(#)machdep.c 7.4 (Berkeley) 6/3/91 |
111 | */ | | 111 | */ |
112 | | | 112 | |
113 | #include <sys/cdefs.h> | | 113 | #include <sys/cdefs.h> |
114 | __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.170 2011/11/10 00:12:04 jym Exp $"); | | 114 | __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.171 2011/11/20 18:42:56 yamt Exp $"); |
115 | | | 115 | |
116 | /* #define XENDEBUG_LOW */ | | 116 | /* #define XENDEBUG_LOW */ |
117 | | | 117 | |
118 | #include "opt_modular.h" | | 118 | #include "opt_modular.h" |
119 | #include "opt_user_ldt.h" | | 119 | #include "opt_user_ldt.h" |
120 | #include "opt_ddb.h" | | 120 | #include "opt_ddb.h" |
121 | #include "opt_kgdb.h" | | 121 | #include "opt_kgdb.h" |
122 | #include "opt_cpureset_delay.h" | | 122 | #include "opt_cpureset_delay.h" |
123 | #include "opt_mtrr.h" | | 123 | #include "opt_mtrr.h" |
124 | #include "opt_realmem.h" | | 124 | #include "opt_realmem.h" |
125 | #include "opt_xen.h" | | 125 | #include "opt_xen.h" |
126 | #ifndef XEN | | 126 | #ifndef XEN |
127 | #include "opt_physmem.h" | | 127 | #include "opt_physmem.h" |
| @@ -1172,27 +1172,26 @@ dumpsys_seg(paddr_t maddr, paddr_t bytes | | | @@ -1172,27 +1172,26 @@ dumpsys_seg(paddr_t maddr, paddr_t bytes |
1172 | (dump_totalbytesleft / (1024 * 1024))); | | 1172 | (dump_totalbytesleft / (1024 * 1024))); |
1173 | | | 1173 | |
1174 | /* Limit size for next transfer. */ | | 1174 | /* Limit size for next transfer. */ |
1175 | n = bytes - i; | | 1175 | n = bytes - i; |
1176 | if (n > BYTES_PER_DUMP) | | 1176 | if (n > BYTES_PER_DUMP) |
1177 | n = BYTES_PER_DUMP; | | 1177 | n = BYTES_PER_DUMP; |
1178 | | | 1178 | |
1179 | for (m = 0; m < n; m += NBPG) | | 1179 | for (m = 0; m < n; m += NBPG) |
1180 | pmap_kenter_pa(dumpspace + m, maddr + m, | | 1180 | pmap_kenter_pa(dumpspace + m, maddr + m, |
1181 | VM_PROT_READ, 0); | | 1181 | VM_PROT_READ, 0); |
1182 | pmap_update(pmap_kernel()); | | 1182 | pmap_update(pmap_kernel()); |
1183 | | | 1183 | |
1184 | error = (*dump)(dumpdev, blkno, (void *)dumpspace, n); | | 1184 | error = (*dump)(dumpdev, blkno, (void *)dumpspace, n); |
1185 | pmap_kremove(dumpspace, n * PAGE_SIZE); | | | |
1186 | if (error) | | 1185 | if (error) |
1187 | return error; | | 1186 | return error; |
1188 | maddr += n; | | 1187 | maddr += n; |
1189 | blkno += btodb(n); /* XXX? */ | | 1188 | blkno += btodb(n); /* XXX? */ |
1190 | | | 1189 | |
1191 | #if 0 /* XXX this doesn't work. grr. */ | | 1190 | #if 0 /* XXX this doesn't work. grr. */ |
1192 | /* operator aborting dump? */ | | 1191 | /* operator aborting dump? */ |
1193 | if (sget() != NULL) | | 1192 | if (sget() != NULL) |
1194 | return EINTR; | | 1193 | return EINTR; |
1195 | #endif | | 1194 | #endif |
1196 | } | | 1195 | } |
1197 | dump_header_blkno = blkno; | | 1196 | dump_header_blkno = blkno; |
1198 | | | 1197 | |