| 821 | } |
| 822 | |
| 823 | static int parse_region(struct region *r, char *arg) |
| 824 | { |
| 825 | char *tok; |
| 826 | |
| 827 | tok = strtok(arg, ":"); |
| 828 | unsigned long offset = strtoul(tok, NULL, 0); |
| 829 | |
| 830 | tok = strtok(NULL, ":"); |
| 831 | unsigned long size = strtoul(tok, NULL, 0); |
| 832 | |
| 833 | if (region_create_untrusted(r, offset, size) != CB_SUCCESS) { |
| 834 | ERROR("Invalid region: %lx:%lx\n", offset, size); |
| 835 | return -1; |
| 836 | } |
| 837 | |
| 838 | return 0; |
| 839 | } |
| 840 | |
| 841 | static struct command { |
| 842 | const char *name; |
no test coverage detected