Sun Mar 15 22:20:10 2009 UTC ()
ansify function definitions


(cegger)
diff -r1.64 -r1.65 src/sys/arch/arm/arm32/arm32_machdep.c
diff -r1.196 -r1.197 src/sys/arch/arm/arm32/pmap.c
diff -r1.20 -r1.21 src/sys/arch/arm/arm32/stubs.c

cvs diff -r1.64 -r1.65 src/sys/arch/arm/arm32/arm32_machdep.c (expand / switch to unified diff)

--- src/sys/arch/arm/arm32/arm32_machdep.c 2009/03/14 15:36:01 1.64
+++ src/sys/arch/arm/arm32/arm32_machdep.c 2009/03/15 22:20:09 1.65
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: arm32_machdep.c,v 1.64 2009/03/14 15:36:01 dsl Exp $ */ 1/* $NetBSD: arm32_machdep.c,v 1.65 2009/03/15 22:20:09 cegger Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1994-1998 Mark Brinicombe. 4 * Copyright (c) 1994-1998 Mark Brinicombe.
5 * Copyright (c) 1994 Brini. 5 * Copyright (c) 1994 Brini.
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * This code is derived from software written for Brini by Mark Brinicombe 8 * This code is derived from software written for Brini by Mark Brinicombe
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -32,27 +32,27 @@ @@ -32,27 +32,27 @@
32 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 32 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE. 36 * SUCH DAMAGE.
37 * 37 *
38 * Machine dependant functions for kernel setup 38 * Machine dependant functions for kernel setup
39 * 39 *
40 * Created : 17/09/94 40 * Created : 17/09/94
41 * Updated : 18/04/01 updated for new wscons 41 * Updated : 18/04/01 updated for new wscons
42 */ 42 */
43 43
44#include <sys/cdefs.h> 44#include <sys/cdefs.h>
45__KERNEL_RCSID(0, "$NetBSD: arm32_machdep.c,v 1.64 2009/03/14 15:36:01 dsl Exp $"); 45__KERNEL_RCSID(0, "$NetBSD: arm32_machdep.c,v 1.65 2009/03/15 22:20:09 cegger Exp $");
46 46
47#include "opt_md.h" 47#include "opt_md.h"
48#include "opt_pmap_debug.h" 48#include "opt_pmap_debug.h"
49 49
50#include <sys/param.h> 50#include <sys/param.h>
51#include <sys/systm.h> 51#include <sys/systm.h>
52#include <sys/reboot.h> 52#include <sys/reboot.h>
53#include <sys/proc.h> 53#include <sys/proc.h>
54#include <sys/user.h> 54#include <sys/user.h>
55#include <sys/kernel.h> 55#include <sys/kernel.h>
56#include <sys/mbuf.h> 56#include <sys/mbuf.h>
57#include <sys/mount.h> 57#include <sys/mount.h>
58#include <sys/buf.h> 58#include <sys/buf.h>
@@ -149,27 +149,27 @@ arm32_vector_init(vaddr_t va, int which) @@ -149,27 +149,27 @@ arm32_vector_init(vaddr_t va, int which)
149 * readable CPU control register, for now. If we 149 * readable CPU control register, for now. If we
150 * ever encounter one that does not, we'll have to 150 * ever encounter one that does not, we'll have to
151 * rethink this. 151 * rethink this.
152 */ 152 */
153 cpu_control(CPU_CONTROL_VECRELOC, CPU_CONTROL_VECRELOC); 153 cpu_control(CPU_CONTROL_VECRELOC, CPU_CONTROL_VECRELOC);
154 } 154 }
155} 155}
156 156
157/* 157/*
158 * Debug function just to park the CPU 158 * Debug function just to park the CPU
159 */ 159 */
160 160
161void 161void
162halt() 162halt(void)
163{ 163{
164 while (1) 164 while (1)
165 cpu_sleep(0); 165 cpu_sleep(0);
166} 166}
167 167
168 168
169/* Sync the discs and unmount the filesystems */ 169/* Sync the discs and unmount the filesystems */
170 170
171void 171void
172bootsync(void) 172bootsync(void)
173{ 173{
174 static bool bootsyncdone = false; 174 static bool bootsyncdone = false;
175 175

cvs diff -r1.196 -r1.197 src/sys/arch/arm/arm32/pmap.c (expand / switch to unified diff)

--- src/sys/arch/arm/arm32/pmap.c 2009/03/09 08:42:36 1.196
+++ src/sys/arch/arm/arm32/pmap.c 2009/03/15 22:20:10 1.197
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: pmap.c,v 1.196 2009/03/09 08:42:36 nonaka Exp $ */ 1/* $NetBSD: pmap.c,v 1.197 2009/03/15 22:20:10 cegger Exp $ */
2 2
3/* 3/*
4 * Copyright 2003 Wasabi Systems, Inc. 4 * Copyright 2003 Wasabi Systems, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written by Steve C. Woodford for Wasabi Systems, Inc. 7 * Written by Steve C. Woodford for Wasabi Systems, Inc.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -202,27 +202,27 @@ @@ -202,27 +202,27 @@
202#include <sys/pool.h> 202#include <sys/pool.h>
203#include <sys/cdefs.h> 203#include <sys/cdefs.h>
204#include <sys/cpu.h> 204#include <sys/cpu.h>
205#include <sys/sysctl.h> 205#include <sys/sysctl.h>
206  206
207#include <uvm/uvm.h> 207#include <uvm/uvm.h>
208 208
209#include <machine/bus.h> 209#include <machine/bus.h>
210#include <machine/pmap.h> 210#include <machine/pmap.h>
211#include <machine/pcb.h> 211#include <machine/pcb.h>
212#include <machine/param.h> 212#include <machine/param.h>
213#include <arm/arm32/katelib.h> 213#include <arm/arm32/katelib.h>
214 214
215__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.196 2009/03/09 08:42:36 nonaka Exp $"); 215__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.197 2009/03/15 22:20:10 cegger Exp $");
216 216
217#ifdef PMAP_DEBUG 217#ifdef PMAP_DEBUG
218 218
219/* XXX need to get rid of all refs to this */ 219/* XXX need to get rid of all refs to this */
220int pmap_debug_level = 0; 220int pmap_debug_level = 0;
221 221
222/* 222/*
223 * for switching to potentially finer grained debugging 223 * for switching to potentially finer grained debugging
224 */ 224 */
225#define PDB_FOLLOW 0x0001 225#define PDB_FOLLOW 0x0001
226#define PDB_INIT 0x0002 226#define PDB_INIT 0x0002
227#define PDB_ENTER 0x0004 227#define PDB_ENTER 0x0004
228#define PDB_REMOVE 0x0008 228#define PDB_REMOVE 0x0008
@@ -6230,27 +6230,27 @@ pmap_uarea(vaddr_t va) @@ -6230,27 +6230,27 @@ pmap_uarea(vaddr_t va)
6230 } 6230 }
6231 ptep++; 6231 ptep++;
6232 va += PAGE_SIZE; 6232 va += PAGE_SIZE;
6233 } 6233 }
6234 PTE_SYNC_RANGE(sptep, (u_int)(ptep - sptep)); 6234 PTE_SYNC_RANGE(sptep, (u_int)(ptep - sptep));
6235 } 6235 }
6236 cpu_cpwait(); 6236 cpu_cpwait();
6237} 6237}
6238#endif /* ARM_MMU_XSCALE == 1 */ 6238#endif /* ARM_MMU_XSCALE == 1 */
6239 6239
6240/* 6240/*
6241 * return the PA of the current L1 table, for use when handling a crash dump 6241 * return the PA of the current L1 table, for use when handling a crash dump
6242 */ 6242 */
6243uint32_t pmap_kernel_L1_addr() 6243uint32_t pmap_kernel_L1_addr(void)
6244{ 6244{
6245 return pmap_kernel()->pm_l1->l1_physaddr; 6245 return pmap_kernel()->pm_l1->l1_physaddr;
6246} 6246}
6247 6247
6248#if defined(DDB) 6248#if defined(DDB)
6249/* 6249/*
6250 * A couple of ddb-callable functions for dumping pmaps 6250 * A couple of ddb-callable functions for dumping pmaps
6251 */ 6251 */
6252void pmap_dump_all(void); 6252void pmap_dump_all(void);
6253void pmap_dump(pmap_t); 6253void pmap_dump(pmap_t);
6254 6254
6255void 6255void
6256pmap_dump_all(void) 6256pmap_dump_all(void)

cvs diff -r1.20 -r1.21 src/sys/arch/arm/arm32/stubs.c (expand / switch to unified diff)

--- src/sys/arch/arm/arm32/stubs.c 2009/01/21 16:24:34 1.20
+++ src/sys/arch/arm/arm32/stubs.c 2009/03/15 22:20:10 1.21
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: stubs.c,v 1.20 2009/01/21 16:24:34 he Exp $ */ 1/* $NetBSD: stubs.c,v 1.21 2009/03/15 22:20:10 cegger Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1994-1998 Mark Brinicombe. 4 * Copyright (c) 1994-1998 Mark Brinicombe.
5 * Copyright (c) 1994 Brini. 5 * Copyright (c) 1994 Brini.
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * This code is derived from software written for Brini by Mark Brinicombe 8 * This code is derived from software written for Brini by Mark Brinicombe
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -31,27 +31,27 @@ @@ -31,27 +31,27 @@
31 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 31 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 32 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE. 36 * SUCH DAMAGE.
37 * 37 *
38 * Routines that are temporary or do not have a home yet. 38 * Routines that are temporary or do not have a home yet.
39 * 39 *
40 * Created : 17/09/94 40 * Created : 17/09/94
41 */ 41 */
42 42
43#include <sys/cdefs.h> 43#include <sys/cdefs.h>
44__KERNEL_RCSID(0, "$NetBSD: stubs.c,v 1.20 2009/01/21 16:24:34 he Exp $"); 44__KERNEL_RCSID(0, "$NetBSD: stubs.c,v 1.21 2009/03/15 22:20:10 cegger Exp $");
45 45
46#include <sys/param.h> 46#include <sys/param.h>
47#include <sys/systm.h> 47#include <sys/systm.h>
48#include <sys/errno.h> 48#include <sys/errno.h>
49#include <sys/proc.h> 49#include <sys/proc.h>
50#include <sys/conf.h> 50#include <sys/conf.h>
51#include <sys/msgbuf.h> 51#include <sys/msgbuf.h>
52#include <uvm/uvm_extern.h> 52#include <uvm/uvm_extern.h>
53#include <machine/cpu.h> 53#include <machine/cpu.h>
54#include <machine/intr.h> 54#include <machine/intr.h>
55#include <machine/bootconfig.h> 55#include <machine/bootconfig.h>
56#include <machine/pcb.h> 56#include <machine/pcb.h>
57#include <arm/arm32/machdep.h> 57#include <arm/arm32/machdep.h>
@@ -74,27 +74,27 @@ int dumpsize = 0; /* pages */ @@ -74,27 +74,27 @@ int dumpsize = 0; /* pages */
74long dumplo = 0; /* blocks */ 74long dumplo = 0; /* blocks */
75 75
76struct pcb dumppcb; 76struct pcb dumppcb;
77 77
78/* 78/*
79 * This is called by main to set dumplo and dumpsize. 79 * This is called by main to set dumplo and dumpsize.
80 * Dumps always skip the first PAGE_SIZE of disk space 80 * Dumps always skip the first PAGE_SIZE of disk space
81 * in case there might be a disk label stored there. 81 * in case there might be a disk label stored there.
82 * If there is extra space, put dump at the end to 82 * If there is extra space, put dump at the end to
83 * reduce the chance that swapping trashes it. 83 * reduce the chance that swapping trashes it.
84 */ 84 */
85 85
86void 86void
87cpu_dumpconf() 87cpu_dumpconf(void)
88{ 88{
89 const struct bdevsw *bdev; 89 const struct bdevsw *bdev;
90 int nblks, dumpblks; /* size of dump area */ 90 int nblks, dumpblks; /* size of dump area */
91 91
92 if (dumpdev == NODEV) 92 if (dumpdev == NODEV)
93 return; 93 return;
94 bdev = bdevsw_lookup(dumpdev); 94 bdev = bdevsw_lookup(dumpdev);
95 if (bdev == NULL) 95 if (bdev == NULL)
96 panic("dumpconf: bad dumpdev=0x%"PRIx64"", dumpdev); 96 panic("dumpconf: bad dumpdev=0x%"PRIx64"", dumpdev);
97 if (bdev->d_psize == NULL) 97 if (bdev->d_psize == NULL)
98 return; 98 return;
99 nblks = (*bdev->d_psize)(dumpdev); 99 nblks = (*bdev->d_psize)(dumpdev);
100 if (nblks <= ctod(1)) 100 if (nblks <= ctod(1))
@@ -114,27 +114,27 @@ cpu_dumpconf() @@ -114,27 +114,27 @@ cpu_dumpconf()
114 114
115 /* dumpsize is in page units, and doesn't include headers. */ 115 /* dumpsize is in page units, and doesn't include headers. */
116 dumpsize = cpu_dump_mempagecnt(); 116 dumpsize = cpu_dump_mempagecnt();
117 return; 117 return;
118 118
119 bad: 119 bad:
120 dumpsize = 0; 120 dumpsize = 0;
121} 121}
122 122
123/* 123/*
124 * cpu_dump: dump the machine-dependent kernel core dump headers. 124 * cpu_dump: dump the machine-dependent kernel core dump headers.
125 */ 125 */
126int 126int
127cpu_dump() 127cpu_dump(void)
128{ 128{
129 int (*dump)(dev_t, daddr_t, void *, size_t); 129 int (*dump)(dev_t, daddr_t, void *, size_t);
130 char bf[dbtob(1)]; 130 char bf[dbtob(1)];
131 kcore_seg_t *segp; 131 kcore_seg_t *segp;
132 cpu_kcore_hdr_t *cpuhdrp; 132 cpu_kcore_hdr_t *cpuhdrp;
133 phys_ram_seg_t *memsegp; 133 phys_ram_seg_t *memsegp;
134 const struct bdevsw *bdev; 134 const struct bdevsw *bdev;
135 int i; 135 int i;
136 136
137 bdev = bdevsw_lookup(dumpdev); 137 bdev = bdevsw_lookup(dumpdev);
138 if (bdev == NULL) 138 if (bdev == NULL)
139 return (ENXIO); 139 return (ENXIO);
140 dump = bdev->d_dump; 140 dump = bdev->d_dump;
@@ -165,68 +165,68 @@ cpu_dump() @@ -165,68 +165,68 @@ cpu_dump()
165 */ 165 */
166 for (i = 0; i < bootconfig.dramblocks; i++) { 166 for (i = 0; i < bootconfig.dramblocks; i++) {
167 memsegp[i].start = bootconfig.dram[i].address; 167 memsegp[i].start = bootconfig.dram[i].address;
168 memsegp[i].size = bootconfig.dram[i].pages * PAGE_SIZE; 168 memsegp[i].size = bootconfig.dram[i].pages * PAGE_SIZE;
169 } 169 }
170 170
171 return (dump(dumpdev, dumplo, bf, dbtob(1))); 171 return (dump(dumpdev, dumplo, bf, dbtob(1)));
172} 172}
173 173
174/* 174/*
175 * cpu_dumpsize: calculate size of machine-dependent kernel core dump headers. 175 * cpu_dumpsize: calculate size of machine-dependent kernel core dump headers.
176 */ 176 */
177int 177int
178cpu_dumpsize() 178cpu_dumpsize(void)
179{ 179{
180 int size; 180 int size;
181 181
182 size = ALIGN(sizeof(kcore_seg_t)) + ALIGN(sizeof(cpu_kcore_hdr_t)) + 182 size = ALIGN(sizeof(kcore_seg_t)) + ALIGN(sizeof(cpu_kcore_hdr_t)) +
183 ALIGN( bootconfig.dramblocks * sizeof(phys_ram_seg_t)); 183 ALIGN( bootconfig.dramblocks * sizeof(phys_ram_seg_t));
184 if (roundup(size, dbtob(1)) != dbtob(1)) 184 if (roundup(size, dbtob(1)) != dbtob(1))
185 return (-1); 185 return (-1);
186 186
187 return (1); 187 return (1);
188} 188}
189 189
190 190
191/* 191/*
192 * cpu_dump_mempagecnt: calculate the size of RAM (in pages) to be dumped. 192 * cpu_dump_mempagecnt: calculate the size of RAM (in pages) to be dumped.
193 */ 193 */
194u_long 194u_long
195cpu_dump_mempagecnt() 195cpu_dump_mempagecnt(void)
196{ 196{
197 u_long i, n; 197 u_long i, n;
198 198
199 n = 0; 199 n = 0;
200 for (i = 0; i < bootconfig.dramblocks; i++) { 200 for (i = 0; i < bootconfig.dramblocks; i++) {
201 n += bootconfig.dram[i].pages; 201 n += bootconfig.dram[i].pages;
202 } 202 }
203 203
204 return (n); 204 return (n);
205} 205}
206 206
207/* This should be moved to machdep.c */ 207/* This should be moved to machdep.c */
208 208
209extern vaddr_t memhook; /* XXX */ 209extern vaddr_t memhook; /* XXX */
210 210
211/* 211/*
212 * Doadump comes here after turning off memory management and 212 * Doadump comes here after turning off memory management and
213 * getting on the dump stack, either when called above, or by 213 * getting on the dump stack, either when called above, or by
214 * the auto-restart code. 214 * the auto-restart code.
215 */ 215 */
216void dodumpsys(void); 216void dodumpsys(void);
217 217
218void 218void
219dodumpsys() 219dodumpsys(void)
220{ 220{
221 const struct bdevsw *bdev; 221 const struct bdevsw *bdev;
222 daddr_t blkno; 222 daddr_t blkno;
223 int psize; 223 int psize;
224 int error; 224 int error;
225 int addr; 225 int addr;
226 int block; 226 int block;
227 int len; 227 int len;
228 vaddr_t dumpspace; 228 vaddr_t dumpspace;
229 229
230 /* flush everything out of caches */ 230 /* flush everything out of caches */
231 cpu_dcache_wbinv_all(); 231 cpu_dcache_wbinv_all();
232 232