Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F106143352
D19680.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D19680.diff
View Options
Index: head/sys/kern/imgact_elf.c
===================================================================
--- head/sys/kern/imgact_elf.c
+++ head/sys/kern/imgact_elf.c
@@ -158,9 +158,7 @@
static Elf_Brandinfo *elf_brand_list[MAX_BRANDS];
-#define trunc_page_ps(va, ps) rounddown2(va, ps)
-#define round_page_ps(va, ps) roundup2(va, ps)
-#define aligned(a, t) (trunc_page_ps((u_long)(a), sizeof(t)) == (u_long)(a))
+#define aligned(a, t) (rounddown2((u_long)(a), sizeof(t)) == (u_long)(a))
static const char FREEBSD_ABI_VENDOR[] = "FreeBSD";
@@ -568,8 +566,8 @@
object = imgp->object;
map = &imgp->proc->p_vmspace->vm_map;
- map_addr = trunc_page_ps((vm_offset_t)vmaddr, PAGE_SIZE);
- file_addr = trunc_page_ps(offset, PAGE_SIZE);
+ map_addr = trunc_page((vm_offset_t)vmaddr);
+ file_addr = trunc_page(offset);
/*
* We have two choices. We can either clear the data in the last page
@@ -580,9 +578,9 @@
if (filsz == 0)
map_len = 0;
else if (memsz > filsz)
- map_len = trunc_page_ps(offset + filsz, PAGE_SIZE) - file_addr;
+ map_len = trunc_page(offset + filsz) - file_addr;
else
- map_len = round_page_ps(offset + filsz, PAGE_SIZE) - file_addr;
+ map_len = round_page(offset + filsz) - file_addr;
if (map_len != 0) {
/* cow flags: don't dump readonly sections in core */
@@ -611,11 +609,10 @@
* segment in the file is extended to provide bss. It's a neat idea
* to try and save a page, but it's a pain in the behind to implement.
*/
- copy_len = filsz == 0 ? 0 : (offset + filsz) - trunc_page_ps(offset +
- filsz, PAGE_SIZE);
- map_addr = trunc_page_ps((vm_offset_t)vmaddr + filsz, PAGE_SIZE);
- map_len = round_page_ps((vm_offset_t)vmaddr + memsz, PAGE_SIZE) -
- map_addr;
+ copy_len = filsz == 0 ? 0 : (offset + filsz) - trunc_page(offset +
+ filsz);
+ map_addr = trunc_page((vm_offset_t)vmaddr + filsz);
+ map_len = round_page((vm_offset_t)vmaddr + memsz) - map_addr;
/* This had damn well better be true! */
if (map_len != 0) {
@@ -631,8 +628,7 @@
return (EIO);
/* send the page fragment to user space */
- off = trunc_page_ps(offset + filsz, PAGE_SIZE) -
- trunc_page(offset + filsz);
+ off = trunc_page(offset + filsz) - trunc_page(offset + filsz);
error = copyout((caddr_t)sf_buf_kva(sf) + off,
(caddr_t)map_addr, copy_len);
vm_imgact_unmap_page(sf);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 27, 2:56 AM (11 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15610491
Default Alt Text
D19680.diff (2 KB)
Attached To
Mode
D19680: Remove trunc_page_ps(), round_page_ps().
Attached
Detach File
Event Timeline
Log In to Comment