| 4891 | } |
| 4892 | |
| 4893 | static void memwatch_setup(void) |
| 4894 | { |
| 4895 | memwatch_reset(); |
| 4896 | mwnodes_start = MEMWATCH_TOTAL - 1; |
| 4897 | mwnodes_end = 0; |
| 4898 | for (int i = 0; i < MEMWATCH_TOTAL; i++) { |
| 4899 | struct memwatch_node *m = &mwnodes[i]; |
| 4900 | if (!m->size) |
| 4901 | continue; |
| 4902 | if (mwnodes_start > i) |
| 4903 | mwnodes_start = i; |
| 4904 | if (mwnodes_end < i) |
| 4905 | mwnodes_end = i; |
| 4906 | int addr = m->addr & ~65535; |
| 4907 | int eaddr = (m->addr + m->size + 65535) & ~65535; |
| 4908 | while (addr < eaddr) { |
| 4909 | memwatch_remap(addr); |
| 4910 | addr += 65536; |
| 4911 | } |
| 4912 | } |
| 4913 | } |
| 4914 | |
| 4915 | static int deinitialize_memwatch (void) |
| 4916 | { |
no test coverage detected