| 588 | } |
| 589 | |
| 590 | static int cmd_print_layout(void) |
| 591 | { |
| 592 | if (params.version_str == NULL) { |
| 593 | ERROR("No version provided!\n"); |
| 594 | return -1; |
| 595 | } |
| 596 | |
| 597 | const struct bpdt_ops *ops = get_bpdt_ops(NULL); |
| 598 | if (!ops) { |
| 599 | ERROR("No matching bpdt_ops!\n"); |
| 600 | return -1; |
| 601 | } |
| 602 | |
| 603 | struct buffer buff; |
| 604 | if (buffer_from_file(&buff, params.image_name)) { |
| 605 | ERROR("Failed to read input file %s\n", params.image_name); |
| 606 | return -1; |
| 607 | } |
| 608 | |
| 609 | ifwi.cse_layout = ops->read_layout(&buff); |
| 610 | if (!ifwi.cse_layout) { |
| 611 | ERROR("Failed to read CSE layout!\n"); |
| 612 | return -1; |
| 613 | } |
| 614 | |
| 615 | ops->print_layout(ifwi.cse_layout); |
| 616 | |
| 617 | return 0; |
| 618 | } |
| 619 | |
| 620 | static int allocate_buffer(struct buffer *buff, struct buffer *wbuff, const char *str) |
| 621 | { |
nothing calls this directly
no test coverage detected