| 138 | #endif |
| 139 | |
| 140 | static bool check_with_maps(struct ptr_valid_batch *batch, |
| 141 | const char *p, size_t size, bool is_write) |
| 142 | { |
| 143 | unsigned int i; |
| 144 | |
| 145 | for (i = 0; i < batch->num_maps; i++) { |
| 146 | if (p >= batch->maps[i].start && p < batch->maps[i].end) { |
| 147 | /* Overlap into other maps? Recurse with remainder. */ |
| 148 | if (p + size > batch->maps[i].end) { |
| 149 | size_t len = p + size - batch->maps[i].end; |
| 150 | if (!check_with_maps(batch, batch->maps[i].end, |
| 151 | len, is_write)) |
| 152 | return false; |
| 153 | } |
| 154 | return !is_write || batch->maps[i].is_write; |
| 155 | } |
| 156 | } |
| 157 | return false; |
| 158 | } |
| 159 | |
| 160 | static void finish_child(struct ptr_valid_batch *batch) |
| 161 | { |