Fri Oct 3 14:52:11 2008 UTC ()
Replace more intptr_t to uintptr_t when casting VA.


(rmind)
diff -r1.119 -r1.120 src/sys/ddb/db_command.c
diff -r1.51 -r1.52 src/sys/ddb/db_xxx.c

cvs diff -r1.119 -r1.120 src/sys/ddb/db_command.c (expand / switch to unified diff)

--- src/sys/ddb/db_command.c 2008/09/29 10:27:53 1.119
+++ src/sys/ddb/db_command.c 2008/10/03 14:52:11 1.120
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: db_command.c,v 1.119 2008/09/29 10:27:53 rmind Exp $ */ 1/* $NetBSD: db_command.c,v 1.120 2008/10/03 14:52:11 rmind Exp $ */
2/* 2/*
3 * Mach Operating System 3 * Mach Operating System
4 * Copyright (c) 1991,1990 Carnegie Mellon University 4 * Copyright (c) 1991,1990 Carnegie Mellon University
5 * All Rights Reserved. 5 * All Rights Reserved.
6 * 6 *
7 * Permission to use, copy, modify and distribute this software and its 7 * Permission to use, copy, modify and distribute this software and its
8 * documentation is hereby granted, provided that both the copyright 8 * documentation is hereby granted, provided that both the copyright
9 * notice and this permission notice appear in all copies of the 9 * notice and this permission notice appear in all copies of the
10 * software, derivative works or modified versions, and any portions 10 * software, derivative works or modified versions, and any portions
11 * thereof, and that both notices appear in supporting documentation. 11 * thereof, and that both notices appear in supporting documentation.
12 * 12 *
13 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 13 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
14 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR 14 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
@@ -48,27 +48,27 @@ @@ -48,27 +48,27 @@
48 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 48 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
49 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 49 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
50 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 50 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
51 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 51 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
52 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 52 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
53 * POSSIBILITY OF SUCH DAMAGE. 53 * POSSIBILITY OF SUCH DAMAGE.
54 */ 54 */
55 55
56/* 56/*
57 * Command dispatcher. 57 * Command dispatcher.
58 */ 58 */
59 59
60#include <sys/cdefs.h> 60#include <sys/cdefs.h>
61__KERNEL_RCSID(0, "$NetBSD: db_command.c,v 1.119 2008/09/29 10:27:53 rmind Exp $"); 61__KERNEL_RCSID(0, "$NetBSD: db_command.c,v 1.120 2008/10/03 14:52:11 rmind Exp $");
62 62
63#include "opt_ddb.h" 63#include "opt_ddb.h"
64#include "opt_kgdb.h" 64#include "opt_kgdb.h"
65#include "opt_inet.h" 65#include "opt_inet.h"
66#include "opt_uvmhist.h" 66#include "opt_uvmhist.h"
67#include "opt_ddbparam.h" 67#include "opt_ddbparam.h"
68 68
69#include <sys/param.h> 69#include <sys/param.h>
70#include <sys/systm.h> 70#include <sys/systm.h>
71#include <sys/reboot.h> 71#include <sys/reboot.h>
72#include <sys/device.h> 72#include <sys/device.h>
73#include <sys/lwp.h> 73#include <sys/lwp.h>
74#include <sys/malloc.h> 74#include <sys/malloc.h>
@@ -1064,29 +1064,29 @@ db_help_print_cmd(db_expr_t addr, bool h @@ -1064,29 +1064,29 @@ db_help_print_cmd(db_expr_t addr, bool h
1064} 1064}
1065 1065
1066/*ARGSUSED*/ 1066/*ARGSUSED*/
1067static void 1067static void
1068db_map_print_cmd(db_expr_t addr, bool have_addr, db_expr_t count, 1068db_map_print_cmd(db_expr_t addr, bool have_addr, db_expr_t count,
1069 const char *modif) 1069 const char *modif)
1070{ 1070{
1071 bool full = false; 1071 bool full = false;
1072 1072
1073 if (modif[0] == 'f') 1073 if (modif[0] == 'f')
1074 full = true; 1074 full = true;
1075 1075
1076 if (have_addr == false) 1076 if (have_addr == false)
1077 addr = (db_expr_t)(intptr_t) kernel_map; 1077 addr = (db_expr_t)(uintptr_t) kernel_map;
1078 1078
1079 uvm_map_printit((struct vm_map *)(intptr_t) addr, full, db_printf); 1079 uvm_map_printit((struct vm_map *)(uintptr_t) addr, full, db_printf);
1080} 1080}
1081 1081
1082/*ARGSUSED*/ 1082/*ARGSUSED*/
1083static void 1083static void
1084db_malloc_print_cmd(db_expr_t addr, bool have_addr, 1084db_malloc_print_cmd(db_expr_t addr, bool have_addr,
1085 db_expr_t count, const char *modif) 1085 db_expr_t count, const char *modif)
1086{ 1086{
1087 1087
1088#ifdef MALLOC_DEBUG 1088#ifdef MALLOC_DEBUG
1089 if (!have_addr) 1089 if (!have_addr)
1090 addr = 0; 1090 addr = 0;
1091 1091
1092 debug_malloc_printit(db_printf, (vaddr_t) addr); 1092 debug_malloc_printit(db_printf, (vaddr_t) addr);
@@ -1095,128 +1095,128 @@ db_malloc_print_cmd(db_expr_t addr, bool @@ -1095,128 +1095,128 @@ db_malloc_print_cmd(db_expr_t addr, bool
1095#endif /* MALLOC_DEBUG */ 1095#endif /* MALLOC_DEBUG */
1096} 1096}
1097 1097
1098/*ARGSUSED*/ 1098/*ARGSUSED*/
1099static void 1099static void
1100db_object_print_cmd(db_expr_t addr, bool have_addr, 1100db_object_print_cmd(db_expr_t addr, bool have_addr,
1101 db_expr_t count, const char *modif) 1101 db_expr_t count, const char *modif)
1102{ 1102{
1103 bool full = false; 1103 bool full = false;
1104 1104
1105 if (modif[0] == 'f') 1105 if (modif[0] == 'f')
1106 full = true; 1106 full = true;
1107 1107
1108 uvm_object_printit((struct uvm_object *)(intptr_t) addr, full, 1108 uvm_object_printit((struct uvm_object *)(uintptr_t) addr, full,
1109 db_printf); 1109 db_printf);
1110} 1110}
1111 1111
1112/*ARGSUSED*/ 1112/*ARGSUSED*/
1113static void 1113static void
1114db_page_print_cmd(db_expr_t addr, bool have_addr, 1114db_page_print_cmd(db_expr_t addr, bool have_addr,
1115 db_expr_t count, const char *modif) 1115 db_expr_t count, const char *modif)
1116{ 1116{
1117 bool full = false; 1117 bool full = false;
1118 1118
1119 if (modif[0] == 'f') 1119 if (modif[0] == 'f')
1120 full = true; 1120 full = true;
1121 1121
1122 uvm_page_printit((struct vm_page *)(intptr_t) addr, full, db_printf); 1122 uvm_page_printit((struct vm_page *)(uintptr_t) addr, full, db_printf);
1123} 1123}
1124 1124
1125/*ARGSUSED*/ 1125/*ARGSUSED*/
1126static void 1126static void
1127db_show_all_pages(db_expr_t addr, bool have_addr, 1127db_show_all_pages(db_expr_t addr, bool have_addr,
1128 db_expr_t count, const char *modif) 1128 db_expr_t count, const char *modif)
1129{ 1129{
1130 1130
1131 uvm_page_printall(db_printf); 1131 uvm_page_printall(db_printf);
1132} 1132}
1133 1133
1134/*ARGSUSED*/ 1134/*ARGSUSED*/
1135static void 1135static void
1136db_buf_print_cmd(db_expr_t addr, bool have_addr, 1136db_buf_print_cmd(db_expr_t addr, bool have_addr,
1137 db_expr_t count, const char *modif) 1137 db_expr_t count, const char *modif)
1138{ 1138{
1139 bool full = false; 1139 bool full = false;
1140 1140
1141 if (modif[0] == 'f') 1141 if (modif[0] == 'f')
1142 full = true; 1142 full = true;
1143 1143
1144 vfs_buf_print((struct buf *)(intptr_t) addr, full, db_printf); 1144 vfs_buf_print((struct buf *)(uintptr_t) addr, full, db_printf);
1145} 1145}
1146 1146
1147/*ARGSUSED*/ 1147/*ARGSUSED*/
1148static void 1148static void
1149db_event_print_cmd(db_expr_t addr, bool have_addr, 1149db_event_print_cmd(db_expr_t addr, bool have_addr,
1150 db_expr_t count, const char *modif) 1150 db_expr_t count, const char *modif)
1151{ 1151{
1152 bool full = false; 1152 bool full = false;
1153 1153
1154 if (modif[0] == 'f') 1154 if (modif[0] == 'f')
1155 full = true; 1155 full = true;
1156 1156
1157 event_print(full, db_printf); 1157 event_print(full, db_printf);
1158} 1158}
1159 1159
1160/*ARGSUSED*/ 1160/*ARGSUSED*/
1161static void 1161static void
1162db_vnode_print_cmd(db_expr_t addr, bool have_addr, 1162db_vnode_print_cmd(db_expr_t addr, bool have_addr,
1163 db_expr_t count, const char *modif) 1163 db_expr_t count, const char *modif)
1164{ 1164{
1165 bool full = false; 1165 bool full = false;
1166 1166
1167 if (modif[0] == 'f') 1167 if (modif[0] == 'f')
1168 full = true; 1168 full = true;
1169 1169
1170 vfs_vnode_print((struct vnode *)(intptr_t) addr, full, db_printf); 1170 vfs_vnode_print((struct vnode *)(uintptr_t) addr, full, db_printf);
1171} 1171}
1172 1172
1173static void 1173static void
1174db_mount_print_cmd(db_expr_t addr, bool have_addr, 1174db_mount_print_cmd(db_expr_t addr, bool have_addr,
1175 db_expr_t count, const char *modif) 1175 db_expr_t count, const char *modif)
1176{ 1176{
1177 bool full = false; 1177 bool full = false;
1178 1178
1179 if (modif[0] == 'f') 1179 if (modif[0] == 'f')
1180 full = true; 1180 full = true;
1181 1181
1182 vfs_mount_print((struct mount *)(intptr_t) addr, full, db_printf); 1182 vfs_mount_print((struct mount *)(uintptr_t) addr, full, db_printf);
1183} 1183}
1184 1184
1185/*ARGSUSED*/ 1185/*ARGSUSED*/
1186static void 1186static void
1187db_mbuf_print_cmd(db_expr_t addr, bool have_addr, 1187db_mbuf_print_cmd(db_expr_t addr, bool have_addr,
1188 db_expr_t count, const char *modif) 1188 db_expr_t count, const char *modif)
1189{ 1189{
1190 1190
1191 m_print((const struct mbuf *)(intptr_t) addr, modif, db_printf); 1191 m_print((const struct mbuf *)(uintptr_t) addr, modif, db_printf);
1192} 1192}
1193 1193
1194/*ARGSUSED*/ 1194/*ARGSUSED*/
1195static void 1195static void
1196db_pool_print_cmd(db_expr_t addr, bool have_addr, 1196db_pool_print_cmd(db_expr_t addr, bool have_addr,
1197 db_expr_t count, const char *modif) 1197 db_expr_t count, const char *modif)
1198{ 1198{
1199 1199
1200 pool_printit((struct pool *)(intptr_t) addr, modif, db_printf); 1200 pool_printit((struct pool *)(uintptr_t) addr, modif, db_printf);
1201} 1201}
1202 1202
1203/*ARGSUSED*/ 1203/*ARGSUSED*/
1204static void 1204static void
1205db_namecache_print_cmd(db_expr_t addr, bool have_addr, 1205db_namecache_print_cmd(db_expr_t addr, bool have_addr,
1206 db_expr_t count, const char *modif) 1206 db_expr_t count, const char *modif)
1207{ 1207{
1208 1208
1209 namecache_print((struct vnode *)(intptr_t) addr, db_printf); 1209 namecache_print((struct vnode *)(uintptr_t) addr, db_printf);
1210} 1210}
1211 1211
1212/*ARGSUSED*/ 1212/*ARGSUSED*/
1213static void 1213static void
1214db_uvmexp_print_cmd(db_expr_t addr, bool have_addr, 1214db_uvmexp_print_cmd(db_expr_t addr, bool have_addr,
1215 db_expr_t count, const char *modif) 1215 db_expr_t count, const char *modif)
1216{ 1216{
1217 1217
1218 uvmexp_print(db_printf); 1218 uvmexp_print(db_printf);
1219} 1219}
1220 1220
1221#ifdef UVMHIST 1221#ifdef UVMHIST
1222/*ARGSUSED*/ 1222/*ARGSUSED*/
@@ -1250,27 +1250,27 @@ db_fncall(db_expr_t addr, bool have_addr @@ -1250,27 +1250,27 @@ db_fncall(db_expr_t addr, bool have_addr
1250 db_expr_t fn_addr; 1250 db_expr_t fn_addr;
1251#define MAXARGS 11 1251#define MAXARGS 11
1252 db_expr_t args[MAXARGS]; 1252 db_expr_t args[MAXARGS];
1253 int nargs = 0; 1253 int nargs = 0;
1254 db_expr_t retval; 1254 db_expr_t retval;
1255 db_expr_t (*func)(db_expr_t, ...); 1255 db_expr_t (*func)(db_expr_t, ...);
1256 int t; 1256 int t;
1257 1257
1258 if (!db_expression(&fn_addr)) { 1258 if (!db_expression(&fn_addr)) {
1259 db_printf("Bad function\n"); 1259 db_printf("Bad function\n");
1260 db_flush_lex(); 1260 db_flush_lex();
1261 return; 1261 return;
1262 } 1262 }
1263 func = (db_expr_t (*)(db_expr_t, ...))(intptr_t) fn_addr; 1263 func = (db_expr_t (*)(db_expr_t, ...))(uintptr_t) fn_addr;
1264 1264
1265 t = db_read_token(); 1265 t = db_read_token();
1266 if (t == tLPAREN) { 1266 if (t == tLPAREN) {
1267 if (db_expression(&args[0])) { 1267 if (db_expression(&args[0])) {
1268 nargs++; 1268 nargs++;
1269 while ((t = db_read_token()) == tCOMMA) { 1269 while ((t = db_read_token()) == tCOMMA) {
1270 if (nargs == MAXARGS) { 1270 if (nargs == MAXARGS) {
1271 db_printf("Too many arguments\n"); 1271 db_printf("Too many arguments\n");
1272 db_flush_lex(); 1272 db_flush_lex();
1273 return; 1273 return;
1274 } 1274 }
1275 if (!db_expression(&args[nargs])) { 1275 if (!db_expression(&args[nargs])) {
1276 db_printf("Argument missing\n"); 1276 db_printf("Argument missing\n");

cvs diff -r1.51 -r1.52 src/sys/ddb/db_xxx.c (expand / switch to unified diff)

--- src/sys/ddb/db_xxx.c 2008/07/14 10:15:11 1.51
+++ src/sys/ddb/db_xxx.c 2008/10/03 14:52:11 1.52
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: db_xxx.c,v 1.51 2008/07/14 10:15:11 blymn Exp $ */ 1/* $NetBSD: db_xxx.c,v 1.52 2008/10/03 14:52:11 rmind Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1982, 1986, 1989, 1991, 1993 4 * Copyright (c) 1982, 1986, 1989, 1991, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -27,27 +27,27 @@ @@ -27,27 +27,27 @@
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE. 29 * SUCH DAMAGE.
30 * 30 *
31 * from: kern_proc.c 8.4 (Berkeley) 1/4/94 31 * from: kern_proc.c 8.4 (Berkeley) 1/4/94
32 */ 32 */
33 33
34/* 34/*
35 * Miscellaneous DDB functions that are intimate (xxx) with various 35 * Miscellaneous DDB functions that are intimate (xxx) with various
36 * data structures and functions used by the kernel (proc, callout). 36 * data structures and functions used by the kernel (proc, callout).
37 */ 37 */
38 38
39#include <sys/cdefs.h> 39#include <sys/cdefs.h>
40__KERNEL_RCSID(0, "$NetBSD: db_xxx.c,v 1.51 2008/07/14 10:15:11 blymn Exp $"); 40__KERNEL_RCSID(0, "$NetBSD: db_xxx.c,v 1.52 2008/10/03 14:52:11 rmind Exp $");
41 41
42#include "opt_kgdb.h" 42#include "opt_kgdb.h"
43 43
44#include <sys/param.h> 44#include <sys/param.h>
45#include <sys/systm.h> 45#include <sys/systm.h>
46#include <sys/kernel.h> 46#include <sys/kernel.h>
47#include <sys/proc.h> 47#include <sys/proc.h>
48#include <sys/msgbuf.h> 48#include <sys/msgbuf.h>
49 49
50#include <sys/callout.h> 50#include <sys/callout.h>
51#include <sys/file.h> 51#include <sys/file.h>
52#include <sys/filedesc.h> 52#include <sys/filedesc.h>
53#include <sys/lockdebug.h> 53#include <sys/lockdebug.h>
@@ -124,27 +124,27 @@ db_show_files_cmd(db_expr_t addr, bool h @@ -124,27 +124,27 @@ db_show_files_cmd(db_expr_t addr, bool h
124 db_expr_t count, const char *modif) 124 db_expr_t count, const char *modif)
125{ 125{
126 struct proc *p; 126 struct proc *p;
127 int i; 127 int i;
128 filedesc_t *fdp; 128 filedesc_t *fdp;
129 fdfile_t *ff; 129 fdfile_t *ff;
130 file_t *fp; 130 file_t *fp;
131 struct vnode *vn; 131 struct vnode *vn;
132 bool full = false; 132 bool full = false;
133 133
134 if (modif[0] == 'f') 134 if (modif[0] == 'f')
135 full = true; 135 full = true;
136 136
137 p = (struct proc *) (intptr_t) addr; 137 p = (struct proc *) (uintptr_t) addr;
138 138
139 fdp = p->p_fd; 139 fdp = p->p_fd;
140 for (i = 0; i < fdp->fd_nfiles; i++) { 140 for (i = 0; i < fdp->fd_nfiles; i++) {
141 if ((ff = fdp->fd_ofiles[i]) == NULL) 141 if ((ff = fdp->fd_ofiles[i]) == NULL)
142 continue; 142 continue;
143 143
144 fp = ff->ff_file; 144 fp = ff->ff_file;
145 145
146 /* Only look at vnodes... */ 146 /* Only look at vnodes... */
147 if ((fp != NULL) && (fp->f_type == DTYPE_VNODE)) { 147 if ((fp != NULL) && (fp->f_type == DTYPE_VNODE)) {
148 if (fp->f_data != NULL) { 148 if (fp->f_data != NULL) {
149 vn = (struct vnode *) fp->f_data; 149 vn = (struct vnode *) fp->f_data;
150 vfs_vnode_print(vn, full, db_printf); 150 vfs_vnode_print(vn, full, db_printf);