Changeset View
Changeset View
Standalone View
Standalone View
sys/sparc64/sparc64/dump_machdep.c
Context not available. | |||||
DEV_BSIZE); | DEV_BSIZE); | ||||
size += hdrsize; | size += hdrsize; | ||||
totsize = size + 2 * sizeof(kdh); | totsize = size + 2 * sizeof(kdh) + | ||||
kerneldumpcrypto_dumpkeysize(di->kdc); | |||||
if (totsize > di->mediasize) { | if (totsize > di->mediasize) { | ||||
printf("Insufficient space on device (need %ld, have %ld), " | printf("Insufficient space on device (need %ld, have %ld), " | ||||
"refusing to dump.\n", (long)totsize, | "refusing to dump.\n", (long)totsize, | ||||
Context not available. | |||||
/* Determine dump offset on device. */ | /* Determine dump offset on device. */ | ||||
dumplo = di->mediaoffset + di->mediasize - totsize; | dumplo = di->mediaoffset + di->mediasize - totsize; | ||||
/* Initialize kernel dump crypto. */ | |||||
error = kerneldumpcrypto_init(di->kdc); | |||||
if (error) | |||||
goto fail; | |||||
mkdumpheader(&kdh, KERNELDUMPMAGIC, KERNELDUMP_SPARC64_VERSION, size, | mkdumpheader(&kdh, KERNELDUMPMAGIC, KERNELDUMP_SPARC64_VERSION, size, | ||||
di->blocksize); | kerneldumpcrypto_dumpkeysize(di->kdc), di->blocksize); | ||||
printf("Dumping %lu MB (%d chunks)\n", (u_long)(size >> 20), nreg); | printf("Dumping %lu MB (%d chunks)\n", (u_long)(size >> 20), nreg); | ||||
/* Dump leader */ | /* Dump leader */ | ||||
error = dump_write(di, &kdh, 0, dumplo, sizeof(kdh)); | error = dump_write_header(di, &kdh, 0, dumplo); | ||||
if (error) | if (error) | ||||
goto fail; | goto fail; | ||||
dumplo += sizeof(kdh); | dumplo += sizeof(kdh); | ||||
/* Dump key */ | |||||
error = dump_write_key(di, 0, dumplo); | |||||
if (error) | |||||
goto fail; | |||||
dumplo += kerneldumpcrypto_dumpkeysize(di->kdc); | |||||
/* Dump the private header. */ | /* Dump the private header. */ | ||||
hdr.dh_hdr_size = hdrsize; | hdr.dh_hdr_size = hdrsize; | ||||
hdr.dh_tsb_pa = tsb_kernel_phys; | hdr.dh_tsb_pa = tsb_kernel_phys; | ||||
Context not available. | |||||
goto fail; | goto fail; | ||||
/* Dump trailer */ | /* Dump trailer */ | ||||
error = dump_write(di, &kdh, 0, dumplo, sizeof(kdh)); | error = dump_write_header(di, &kdh, 0, dumplo); | ||||
if (error) | if (error) | ||||
goto fail; | goto fail; | ||||
dumplo += sizeof(kdh); | |||||
/* Signal completion, signoff and exit stage left. */ | /* Signal completion, signoff and exit stage left. */ | ||||
dump_write(di, NULL, 0, 0, 0); | dump_write(di, NULL, 0, 0, 0); | ||||
Context not available. |