Rev 4339 | Rev 4346 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4339 | Rev 4343 | ||
---|---|---|---|
Line 24... | Line 24... | ||
24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | */ |
27 | */ |
28 | 28 | ||
29 | /** @addtogroup mips32mm |
29 | /** @addtogroup mips32mm |
30 | * @{ |
30 | * @{ |
31 | */ |
31 | */ |
32 | /** @file |
32 | /** @file |
33 | */ |
33 | */ |
34 | 34 | ||
Line 39... | Line 39... | ||
39 | #include <mm/as.h> |
39 | #include <mm/as.h> |
40 | #include <arch/cp0.h> |
40 | #include <arch/cp0.h> |
41 | #include <panic.h> |
41 | #include <panic.h> |
42 | #include <arch.h> |
42 | #include <arch.h> |
43 | #include <symtab.h> |
43 | #include <symtab.h> |
44 | #include <synch/spinlock.h> |
44 | #include <synch/mutex.h> |
45 | #include <print.h> |
45 | #include <print.h> |
46 | #include <debug.h> |
46 | #include <debug.h> |
47 | #include <align.h> |
47 | #include <align.h> |
48 | #include <interrupt.h> |
48 | #include <interrupt.h> |
49 | 49 | ||
Line 90... | Line 90... | ||
90 | entry_hi_t hi; |
90 | entry_hi_t hi; |
91 | asid_t asid; |
91 | asid_t asid; |
92 | uintptr_t badvaddr; |
92 | uintptr_t badvaddr; |
93 | pte_t *pte; |
93 | pte_t *pte; |
94 | int pfrc; |
94 | int pfrc; |
95 | 95 | ||
96 | badvaddr = cp0_badvaddr_read(); |
96 | badvaddr = cp0_badvaddr_read(); |
97 | 97 | ||
98 | spinlock_lock(&AS->lock); |
98 | mutex_lock(&AS->lock); |
99 | asid = AS->asid; |
99 | asid = AS->asid; |
100 | spinlock_unlock(&AS->lock); |
100 | mutex_unlock(&AS->lock); |
101 | 101 | ||
102 | page_table_lock(AS, true); |
102 | page_table_lock(AS, true); |
103 | 103 | ||
104 | pte = find_mapping_and_check(badvaddr, PF_ACCESS_READ, istate, &pfrc); |
104 | pte = find_mapping_and_check(badvaddr, PF_ACCESS_READ, istate, &pfrc); |
105 | if (!pte) { |
105 | if (!pte) { |
106 | switch (pfrc) { |
106 | switch (pfrc) { |
107 | case AS_PF_FAULT: |
107 | case AS_PF_FAULT: |
108 | goto fail; |
108 | goto fail; |