Deleted Added
full compact
procfs_map.c (185864) procfs_map.c (185984)
1/*-
2 * Copyright (c) 1993 Jan-Simon Pendry
3 * Copyright (c) 1993
4 * The Regents of the University of California. All rights reserved.
5 *
6 * This code is derived from software contributed to Berkeley by
7 * Jan-Simon Pendry.
8 *

--- 18 unchanged lines hidden (view full) ---

27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)procfs_status.c 8.3 (Berkeley) 2/17/94
34 *
1/*-
2 * Copyright (c) 1993 Jan-Simon Pendry
3 * Copyright (c) 1993
4 * The Regents of the University of California. All rights reserved.
5 *
6 * This code is derived from software contributed to Berkeley by
7 * Jan-Simon Pendry.
8 *

--- 18 unchanged lines hidden (view full) ---

27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)procfs_status.c 8.3 (Berkeley) 2/17/94
34 *
35 * $FreeBSD: head/sys/fs/procfs/procfs_map.c 185864 2008-12-10 16:11:09Z kib $
35 * $FreeBSD: head/sys/fs/procfs/procfs_map.c 185984 2008-12-12 12:12:36Z kib $
36 */
37
38#include "opt_compat.h"
39
40#include <sys/param.h>
41#include <sys/systm.h>
42#include <sys/lock.h>
43#include <sys/filedesc.h>

--- 4 unchanged lines hidden (view full) ---

48#include <sys/sbuf.h>
49#include <sys/uio.h>
50#include <sys/vnode.h>
51
52#include <fs/pseudofs/pseudofs.h>
53#include <fs/procfs/procfs.h>
54
55#include <vm/vm.h>
36 */
37
38#include "opt_compat.h"
39
40#include <sys/param.h>
41#include <sys/systm.h>
42#include <sys/lock.h>
43#include <sys/filedesc.h>

--- 4 unchanged lines hidden (view full) ---

48#include <sys/sbuf.h>
49#include <sys/uio.h>
50#include <sys/vnode.h>
51
52#include <fs/pseudofs/pseudofs.h>
53#include <fs/procfs/procfs.h>
54
55#include <vm/vm.h>
56#include <vm/vm_extern.h>
56#include <vm/pmap.h>
57#include <vm/vm_map.h>
58#include <vm/vm_page.h>
59#include <vm/vm_object.h>
60
61#ifdef COMPAT_IA32
62#include <sys/procfs.h>
63#include <machine/fpu.h>

--- 13 unchanged lines hidden (view full) ---

77 * be atomic. The best that we can do is to allow the program to do a read
78 * with an arbitrarily large buffer, and return as much as we can. We can
79 * return an error code if the buffer is too small (EFBIG), then the program
80 * can try a bigger buffer.
81 */
82int
83procfs_doprocmap(PFS_FILL_ARGS)
84{
57#include <vm/pmap.h>
58#include <vm/vm_map.h>
59#include <vm/vm_page.h>
60#include <vm/vm_object.h>
61
62#ifdef COMPAT_IA32
63#include <sys/procfs.h>
64#include <machine/fpu.h>

--- 13 unchanged lines hidden (view full) ---

78 * be atomic. The best that we can do is to allow the program to do a read
79 * with an arbitrarily large buffer, and return as much as we can. We can
80 * return an error code if the buffer is too small (EFBIG), then the program
81 * can try a bigger buffer.
82 */
83int
84procfs_doprocmap(PFS_FILL_ARGS)
85{
85 vm_map_t map = &p->p_vmspace->vm_map;
86 struct vmspace *vm;
87 vm_map_t map;
86 vm_map_entry_t entry, tmp_entry;
87 struct vnode *vp;
88 char *fullpath, *freepath;
89 int error, vfslocked;
90 unsigned int last_timestamp;
91#ifdef COMPAT_IA32
92 int wrap32 = 0;
93#endif

--- 10 unchanged lines hidden (view full) ---

104#ifdef COMPAT_IA32
105 if (curthread->td_proc->p_sysent == &ia32_freebsd_sysvec) {
106 if (p->p_sysent != &ia32_freebsd_sysvec)
107 return (EOPNOTSUPP);
108 wrap32 = 1;
109 }
110#endif
111
88 vm_map_entry_t entry, tmp_entry;
89 struct vnode *vp;
90 char *fullpath, *freepath;
91 int error, vfslocked;
92 unsigned int last_timestamp;
93#ifdef COMPAT_IA32
94 int wrap32 = 0;
95#endif

--- 10 unchanged lines hidden (view full) ---

106#ifdef COMPAT_IA32
107 if (curthread->td_proc->p_sysent == &ia32_freebsd_sysvec) {
108 if (p->p_sysent != &ia32_freebsd_sysvec)
109 return (EOPNOTSUPP);
110 wrap32 = 1;
111 }
112#endif
113
114 vm = vmspace_acquire_ref(p);
115 if (vm == NULL)
116 return (ESRCH);
117 map = &vm->vm_map;
112 vm_map_lock_read(map);
113 for (entry = map->header.next; entry != &map->header;
114 entry = entry->next) {
115 vm_object_t obj, tobj, lobj;
116 int ref_count, shadow_count, flags;
117 vm_offset_t e_start, e_end, addr;
118 int resident, privateresident;
119 char *type;

--- 110 unchanged lines hidden (view full) ---

230 * modified while it was unlocked. Specifically,
231 * the entry may have been clipped, merged, or deleted.
232 */
233 vm_map_lookup_entry(map, e_end - 1, &tmp_entry);
234 entry = tmp_entry;
235 }
236 }
237 vm_map_unlock_read(map);
118 vm_map_lock_read(map);
119 for (entry = map->header.next; entry != &map->header;
120 entry = entry->next) {
121 vm_object_t obj, tobj, lobj;
122 int ref_count, shadow_count, flags;
123 vm_offset_t e_start, e_end, addr;
124 int resident, privateresident;
125 char *type;

--- 110 unchanged lines hidden (view full) ---

236 * modified while it was unlocked. Specifically,
237 * the entry may have been clipped, merged, or deleted.
238 */
239 vm_map_lookup_entry(map, e_end - 1, &tmp_entry);
240 entry = tmp_entry;
241 }
242 }
243 vm_map_unlock_read(map);
244 vmspace_free(vm);
238 return (error);
239}
245 return (error);
246}