| 367 | static struct mmap_window mmap_window_table[MMAP_MAX_WINDOWS]; |
| 368 | |
| 369 | static int add_mmap_window(unsigned long flash_offset, unsigned long host_offset, unsigned long window_size) |
| 370 | { |
| 371 | if (mmap_window_table_size >= MMAP_MAX_WINDOWS) { |
| 372 | ERROR("Too many memory map windows\n"); |
| 373 | return 1; |
| 374 | } |
| 375 | |
| 376 | if (region_create_untrusted( |
| 377 | &mmap_window_table[mmap_window_table_size].flash_space, |
| 378 | flash_offset, window_size) != CB_SUCCESS || |
| 379 | region_create_untrusted( |
| 380 | &mmap_window_table[mmap_window_table_size].host_space, |
| 381 | host_offset, window_size) != CB_SUCCESS) { |
| 382 | ERROR("Invalid mmap window size %lu.\n", window_size); |
| 383 | return 1; |
| 384 | } |
| 385 | |
| 386 | mmap_window_table_size++; |
| 387 | return 0; |
| 388 | } |
| 389 | |
| 390 | |
| 391 | static int decode_mmap_arg(char *arg) |
no test coverage detected