Rev 3837 | Rev 3839 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 3837 | Rev 3838 | ||
|---|---|---|---|
| Line 38... | Line 38... | ||
| 38 | #include <interrupt.h> |
38 | #include <interrupt.h> |
| 39 | #include <mm/as.h> |
39 | #include <mm/as.h> |
| 40 | #include <arch.h> |
40 | #include <arch.h> |
| 41 | #include <print.h> |
41 | #include <print.h> |
| 42 | #include <symtab.h> |
42 | #include <symtab.h> |
| - | 43 | #include <macros.h> |
|
| 43 | 44 | ||
| 44 | 45 | ||
| 45 | static unsigned int seed = 10; |
46 | static unsigned int seed = 10; |
| 46 | static unsigned int seed_real __attribute__ ((section("K_UNMAPPED_DATA_START"))) = 42; |
47 | static unsigned int seed_real __attribute__ ((section("K_UNMAPPED_DATA_START"))) = 42; |
| 47 | 48 | ||
| Line 127... | Line 128... | ||
| 127 | panic("%p: PHT Refill Exception at %p (%s<-%s).", badvaddr, |
128 | panic("%p: PHT Refill Exception at %p (%s<-%s).", badvaddr, |
| 128 | istate->pc, symbol, sym2); |
129 | istate->pc, symbol, sym2); |
| 129 | } |
130 | } |
| 130 | 131 | ||
| 131 | 132 | ||
| 132 | /** Pseudorandom generator |
- | |
| 133 | * |
- | |
| 134 | * A pretty standard linear congruential pseudorandom |
- | |
| 135 | * number generator (m = 2^32). |
- | |
| 136 | * |
- | |
| 137 | */ |
- | |
| 138 | #define RANDI(seed) \ |
- | |
| 139 | ({ \ |
- | |
| 140 | (seed) = 1103515245 * (seed) + 12345; \ |
- | |
| 141 | (seed); \ |
- | |
| 142 | }) |
- | |
| 143 | - | ||
| 144 | - | ||
| 145 | static void pht_insert(const uintptr_t vaddr, const pte_t *pte) |
133 | static void pht_insert(const uintptr_t vaddr, const pte_t *pte) |
| 146 | { |
134 | { |
| 147 | uint32_t page = (vaddr >> 12) & 0xffff; |
135 | uint32_t page = (vaddr >> 12) & 0xffff; |
| 148 | uint32_t api = (vaddr >> 22) & 0x3f; |
136 | uint32_t api = (vaddr >> 22) & 0x3f; |
| 149 | 137 | ||