| 525 | } |
| 526 | |
| 527 | static unsigned int convert_host_to_flash(const struct buffer *region, unsigned int addr) |
| 528 | { |
| 529 | int idx; |
| 530 | const struct region *to, *from; |
| 531 | |
| 532 | idx = find_mmap_window(HOST_SPACE_ADDR, addr); |
| 533 | if (idx == -1) { |
| 534 | ERROR("Host address(%x) not in any mmap window!\n", addr); |
| 535 | return 0; |
| 536 | } |
| 537 | |
| 538 | to = &mmap_window_table[idx].flash_space; |
| 539 | from = &mmap_window_table[idx].host_space; |
| 540 | |
| 541 | /* region->offset is subtracted because caller expects offset in the given region. */ |
| 542 | return convert_address(to, from, addr) - region->offset; |
| 543 | } |
| 544 | |
| 545 | static unsigned int convert_flash_to_host(const struct buffer *region, unsigned int addr) |
| 546 | { |
no test coverage detected