static int do_bootstage_stash(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { ulong base, size; int ret; if (get_base_size(argc, argv, &base, &size)) return CMD_RET_USAGE; if (base == -1UL) { printf("No bootstage stash area defined\n"); return 1; } if (0 == strcmp(argv[0], "stash")) ret = bootstage_stash((void *)base, size); else ret = bootstage_unstash((void *)base, size); if (ret) return 1; return 0; }
// assumes layout makes sense inline size_t get_max_size() { return BUFFER_SIZE - get_base_size() - sizeof(CommunicatorContext); }