Skip to content

Commit

Permalink
Simplify memrw().
Browse files Browse the repository at this point in the history
MFC after:	10 days
  • Loading branch information
alcriceedu committed Oct 27, 2014
1 parent 6a46424 commit 2a5ed8d
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions sys/sparc64/sparc64/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ __FBSDID("$FreeBSD$");
#include <vm/vm.h>
#include <vm/vm_param.h>
#include <vm/vm_page.h>
#include <vm/vm_phys.h>
#include <vm/vm_kern.h>
#include <vm/pmap.h>
#include <vm/vm_extern.h>

#include <machine/cache.h>
#include <machine/md_var.h>
#include <machine/pmap.h>
#include <machine/tlb.h>

#include <machine/memdev.h>
Expand All @@ -92,7 +92,6 @@ memrw(struct cdev *dev, struct uio *uio, int flags)
vm_size_t cnt;
vm_page_t m;
int error;
int i;
uint32_t colors;

cnt = 0;
Expand Down Expand Up @@ -124,15 +123,7 @@ memrw(struct cdev *dev, struct uio *uio, int flags)
cnt = ulmin(cnt, PAGE_SIZE - off);
cnt = ulmin(cnt, iov->iov_len);

m = NULL;
for (i = 0; phys_avail[i] != 0; i += 2) {
if (pa >= phys_avail[i] &&
pa < phys_avail[i + 1]) {
m = PHYS_TO_VM_PAGE(pa);
break;
}
}

m = vm_phys_paddr_to_vm_page(pa);
if (m != NULL) {
if (ova == 0) {
if (dcache_color_ignore == 0)
Expand Down

0 comments on commit 2a5ed8d

Please sign in to comment.