| 248 | } |
| 249 | |
| 250 | bool selfload_mapped(struct prog *payload, void *mapping, |
| 251 | enum bootmem_type dest_type) |
| 252 | { |
| 253 | uintptr_t entry = 0; |
| 254 | struct cbfs_payload_segment *cbfssegs; |
| 255 | |
| 256 | cbfssegs = &((struct cbfs_payload *)mapping)->segments; |
| 257 | |
| 258 | if (check_payload_segments(cbfssegs, dest_type)) |
| 259 | return false; |
| 260 | |
| 261 | if (load_payload_segments(cbfssegs, &entry)) |
| 262 | return false; |
| 263 | |
| 264 | printk(BIOS_SPEW, "Loaded segments\n"); |
| 265 | |
| 266 | /* Pass cbtables to payload if architecture desires it. */ |
| 267 | prog_set_entry(payload, (void *)entry, cbmem_find(CBMEM_ID_CBTABLE)); |
| 268 | |
| 269 | return true; |
| 270 | } |
| 271 | |
| 272 | bool selfload_check(struct prog *payload, enum bootmem_type dest_type) |
| 273 | { |
no test coverage detected