| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: procfs_map.c,v 1.37 2009/01/11 02:45:53 christos Exp $ */ | | 1 | /* $NetBSD: procfs_map.c,v 1.38 2009/12/14 13:00:07 uebayasi Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1993 | | 4 | * Copyright (c) 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 | * This code is derived from software contributed to Berkeley by | | 7 | * This code is derived from software contributed to Berkeley by |
8 | * Jan-Simon Pendry. | | 8 | * Jan-Simon Pendry. |
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. |
| @@ -66,27 +66,27 @@ | | | @@ -66,27 +66,27 @@ |
66 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | | 66 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
67 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 67 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
68 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 68 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
69 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 69 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
70 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 70 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
71 | * SUCH DAMAGE. | | 71 | * SUCH DAMAGE. |
72 | * | | 72 | * |
73 | * @(#)procfs_status.c 8.3 (Berkeley) 2/17/94 | | 73 | * @(#)procfs_status.c 8.3 (Berkeley) 2/17/94 |
74 | * | | 74 | * |
75 | * $FreeBSD: procfs_map.c,v 1.18 1998/12/04 22:54:51 archie Exp $ | | 75 | * $FreeBSD: procfs_map.c,v 1.18 1998/12/04 22:54:51 archie Exp $ |
76 | */ | | 76 | */ |
77 | | | 77 | |
78 | #include <sys/cdefs.h> | | 78 | #include <sys/cdefs.h> |
79 | __KERNEL_RCSID(0, "$NetBSD: procfs_map.c,v 1.37 2009/01/11 02:45:53 christos Exp $"); | | 79 | __KERNEL_RCSID(0, "$NetBSD: procfs_map.c,v 1.38 2009/12/14 13:00:07 uebayasi Exp $"); |
80 | | | 80 | |
81 | #include <sys/param.h> | | 81 | #include <sys/param.h> |
82 | #include <sys/systm.h> | | 82 | #include <sys/systm.h> |
83 | #include <sys/proc.h> | | 83 | #include <sys/proc.h> |
84 | #include <sys/vnode.h> | | 84 | #include <sys/vnode.h> |
85 | #include <sys/malloc.h> | | 85 | #include <sys/malloc.h> |
86 | #include <sys/namei.h> | | 86 | #include <sys/namei.h> |
87 | #include <sys/filedesc.h> | | 87 | #include <sys/filedesc.h> |
88 | #include <miscfs/procfs/procfs.h> | | 88 | #include <miscfs/procfs/procfs.h> |
89 | | | 89 | |
90 | #include <sys/lock.h> | | 90 | #include <sys/lock.h> |
91 | | | 91 | |
92 | #include <uvm/uvm.h> | | 92 | #include <uvm/uvm.h> |
| @@ -174,27 +174,27 @@ again: | | | @@ -174,27 +174,27 @@ again: |
174 | "%0*lx-%0*lx %c%c%c%c %0*lx %llx:%llx %ld %s\n", | | 174 | "%0*lx-%0*lx %c%c%c%c %0*lx %llx:%llx %ld %s\n", |
175 | (int)sizeof(void *) * 2,(unsigned long)entry->start, | | 175 | (int)sizeof(void *) * 2,(unsigned long)entry->start, |
176 | (int)sizeof(void *) * 2,(unsigned long)entry->end, | | 176 | (int)sizeof(void *) * 2,(unsigned long)entry->end, |
177 | (entry->protection & VM_PROT_READ) ? 'r' : '-', | | 177 | (entry->protection & VM_PROT_READ) ? 'r' : '-', |
178 | (entry->protection & VM_PROT_WRITE) ? 'w' : '-', | | 178 | (entry->protection & VM_PROT_WRITE) ? 'w' : '-', |
179 | (entry->protection & VM_PROT_EXECUTE) ? 'x' : '-', | | 179 | (entry->protection & VM_PROT_EXECUTE) ? 'x' : '-', |
180 | (entry->etype & UVM_ET_COPYONWRITE) ? 'p' : 's', | | 180 | (entry->etype & UVM_ET_COPYONWRITE) ? 'p' : 's', |
181 | (int)sizeof(void *) * 2, | | 181 | (int)sizeof(void *) * 2, |
182 | (unsigned long)entry->offset, | | 182 | (unsigned long)entry->offset, |
183 | (unsigned long long)major(dev), | | 183 | (unsigned long long)major(dev), |
184 | (unsigned long long)minor(dev), fileid, path); | | 184 | (unsigned long long)minor(dev), fileid, path); |
185 | } else { | | 185 | } else { |
186 | pos += snprintf(buffer + pos, bufsize - pos, | | 186 | pos += snprintf(buffer + pos, bufsize - pos, |
187 | "0x%lx 0x%lx %c%c%c %c%c%c %s %s %d %d %d\n", | | 187 | "0x%"PRIxVADDR"x 0x%"PRIxVADDR"x %c%c%c %c%c%c %s %s %d %d %d\n", |
188 | entry->start, entry->end, | | 188 | entry->start, entry->end, |
189 | (entry->protection & VM_PROT_READ) ? 'r' : '-', | | 189 | (entry->protection & VM_PROT_READ) ? 'r' : '-', |
190 | (entry->protection & VM_PROT_WRITE) ? 'w' : '-', | | 190 | (entry->protection & VM_PROT_WRITE) ? 'w' : '-', |
191 | (entry->protection & VM_PROT_EXECUTE) ? 'x' : '-', | | 191 | (entry->protection & VM_PROT_EXECUTE) ? 'x' : '-', |
192 | (entry->max_protection & VM_PROT_READ) ? 'r' : '-', | | 192 | (entry->max_protection & VM_PROT_READ) ? 'r' : '-', |
193 | (entry->max_protection & VM_PROT_WRITE) ? 'w' : '-', | | 193 | (entry->max_protection & VM_PROT_WRITE) ? 'w' : '-', |
194 | (entry->max_protection & VM_PROT_EXECUTE) ? | | 194 | (entry->max_protection & VM_PROT_EXECUTE) ? |
195 | 'x' : '-', | | 195 | 'x' : '-', |
196 | (entry->etype & UVM_ET_COPYONWRITE) ? | | 196 | (entry->etype & UVM_ET_COPYONWRITE) ? |
197 | "COW" : "NCOW", | | 197 | "COW" : "NCOW", |
198 | (entry->etype & UVM_ET_NEEDSCOPY) ? "NC" : "NNC", | | 198 | (entry->etype & UVM_ET_NEEDSCOPY) ? "NC" : "NNC", |
199 | entry->inheritance, entry->wired_count, | | 199 | entry->inheritance, entry->wired_count, |
200 | entry->advice); | | 200 | entry->advice); |