freebsd32_misc.c (255219) | freebsd32_misc.c (255426) |
---|---|
1/*- 2 * Copyright (c) 2002 Doug Rabson 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2002 Doug Rabson 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/compat/freebsd32/freebsd32_misc.c 255219 2013-09-05 00:09:56Z pjd $"); | 28__FBSDID("$FreeBSD: head/sys/compat/freebsd32/freebsd32_misc.c 255426 2013-09-09 18:11:59Z jhb $"); |
29 30#include "opt_compat.h" 31#include "opt_inet.h" 32#include "opt_inet6.h" 33 34#define __ELF_WORD_SIZE 32 35 36#include <sys/param.h> --- 406 unchanged lines hidden (view full) --- 443 round_page(end), 444 entry->protection | prot, 445 FALSE); 446 if (rv != KERN_SUCCESS) 447 return (EINVAL); 448 } 449 } else { 450 vm_offset_t addr = trunc_page(start); | 29 30#include "opt_compat.h" 31#include "opt_inet.h" 32#include "opt_inet6.h" 33 34#define __ELF_WORD_SIZE 32 35 36#include <sys/param.h> --- 406 unchanged lines hidden (view full) --- 443 round_page(end), 444 entry->protection | prot, 445 FALSE); 446 if (rv != KERN_SUCCESS) 447 return (EINVAL); 448 } 449 } else { 450 vm_offset_t addr = trunc_page(start); |
451 rv = vm_map_find(map, 0, 0, 452 &addr, PAGE_SIZE, FALSE, prot, 453 VM_PROT_ALL, 0); | 451 rv = vm_map_find(map, NULL, 0, &addr, PAGE_SIZE, 0, 452 VMFS_NO_SPACE, prot, VM_PROT_ALL, 0); |
454 if (rv != KERN_SUCCESS) 455 return (EINVAL); 456 } 457 458 if (fd != -1) { 459 struct pread_args r; 460 r.fd = fd; 461 r.buf = (void *) start; --- 75 unchanged lines hidden (view full) --- 537 struct pread_args r; 538 int rv; 539 540 prot |= VM_PROT_WRITE; 541 map = &td->td_proc->p_vmspace->vm_map; 542 rv = vm_map_remove(map, start, end); 543 if (rv != KERN_SUCCESS) 544 return (EINVAL); | 453 if (rv != KERN_SUCCESS) 454 return (EINVAL); 455 } 456 457 if (fd != -1) { 458 struct pread_args r; 459 r.fd = fd; 460 r.buf = (void *) start; --- 75 unchanged lines hidden (view full) --- 536 struct pread_args r; 537 int rv; 538 539 prot |= VM_PROT_WRITE; 540 map = &td->td_proc->p_vmspace->vm_map; 541 rv = vm_map_remove(map, start, end); 542 if (rv != KERN_SUCCESS) 543 return (EINVAL); |
545 rv = vm_map_find(map, 0, 0, 546 &start, end - start, FALSE, 547 prot, VM_PROT_ALL, 0); | 544 rv = vm_map_find(map, NULL, 0, &start, end - start, 545 0, VMFS_NO_SPACE, prot, VM_PROT_ALL, 0); |
548 if (rv != KERN_SUCCESS) 549 return (EINVAL); 550 r.fd = fd; 551 r.buf = (void *) start; 552 r.nbyte = end - start; 553 r.offset = pos; 554 error = sys_pread(td, &r); 555 if (error) --- 2449 unchanged lines hidden --- | 546 if (rv != KERN_SUCCESS) 547 return (EINVAL); 548 r.fd = fd; 549 r.buf = (void *) start; 550 r.nbyte = end - start; 551 r.offset = pos; 552 error = sys_pread(td, &r); 553 if (error) --- 2449 unchanged lines hidden --- |