Refactor map_page_at_addr
authorBarret Rhoden <brho@cs.berkeley.edu>
Tue, 16 Aug 2016 19:52:04 +0000 (15:52 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Tue, 29 Nov 2016 16:27:40 +0000 (11:27 -0500)
commite5761f2a57cf8aa10c2f02ced71eea5298a9847b
tree62e5c73b1ea55319e2381ced0b62f22219f3f80a
parentb77822c4858d2577062eb1359a459811d36a5aa6
Refactor map_page_at_addr

The pte_is_mapped() case was a little sketchy.  The page_is_pagemap() check
was a little hard to follow; it's easier if the caller tells us what to do,
instead of us inferring what to do.

This also fixes a memory leak in __hpf, where if we failed to map a
non-page-map page, we neglected to free it.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/src/mm.c