Changeset View
Changeset View
Standalone View
Standalone View
sys/sparc64/sparc64/dump_machdep.c
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | |||||
#include <machine/metadata.h> | #include <machine/metadata.h> | ||||
#include <machine/kerneldump.h> | #include <machine/kerneldump.h> | ||||
#include <machine/ofw_mem.h> | #include <machine/ofw_mem.h> | ||||
#include <machine/tsb.h> | #include <machine/tsb.h> | ||||
#include <machine/tlb.h> | #include <machine/tlb.h> | ||||
static off_t fileofs; | static off_t fileofs; | ||||
extern off_t dumplo; | |||||
extern struct dump_pa dump_map[DUMPSYS_MD_PA_NPAIRS]; | extern struct dump_pa dump_map[DUMPSYS_MD_PA_NPAIRS]; | ||||
int do_minidump = 0; | int do_minidump = 0; | ||||
void | void | ||||
dumpsys_map_chunk(vm_paddr_t pa, size_t chunk __unused, void **va) | dumpsys_map_chunk(vm_paddr_t pa, size_t chunk __unused, void **va) | ||||
{ | { | ||||
Show All 33 Lines | hdrsize = roundup2(sizeof(hdr) + sizeof(struct sparc64_dump_reg) * nreg, | ||||
DEV_BSIZE); | DEV_BSIZE); | ||||
size += hdrsize; | size += hdrsize; | ||||
dump_init_header(di, &kdh, KERNELDUMPMAGIC, KERNELDUMP_SPARC64_VERSION, | dump_init_header(di, &kdh, KERNELDUMPMAGIC, KERNELDUMP_SPARC64_VERSION, | ||||
size); | size); | ||||
printf("Dumping %lu MB (%d chunks)\n", (u_long)(size >> 20), nreg); | printf("Dumping %lu MB (%d chunks)\n", (u_long)(size >> 20), nreg); | ||||
error = dump_start(di, &kdh, &dumplo); | error = dump_start(di, &kdh); | ||||
if (error != 0) | if (error != 0) | ||||
goto fail; | goto fail; | ||||
/* 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; | ||||
hdr.dh_tsb_size = tsb_kernel_size; | hdr.dh_tsb_size = tsb_kernel_size; | ||||
hdr.dh_tsb_mask = tsb_kernel_mask; | hdr.dh_tsb_mask = tsb_kernel_mask; | ||||
Show All 12 Lines | dumpsys(struct dumperinfo *di) | ||||
} | } | ||||
dumpsys_buf_flush(di); | dumpsys_buf_flush(di); | ||||
/* Dump memory chunks. */ | /* Dump memory chunks. */ | ||||
error = dumpsys_foreach_chunk(dumpsys_cb_dumpdata, di); | error = dumpsys_foreach_chunk(dumpsys_cb_dumpdata, di); | ||||
if (error < 0) | if (error < 0) | ||||
goto fail; | goto fail; | ||||
error = dump_finish(di, &kdh, dumplo); | error = dump_finish(di, &kdh); | ||||
if (error != 0) | if (error != 0) | ||||
goto fail; | goto fail; | ||||
printf("\nDump complete\n"); | printf("\nDump complete\n"); | ||||
return (0); | return (0); | ||||
fail: | fail: | ||||
if (error < 0) | if (error < 0) | ||||
error = -error; | error = -error; | ||||
/* XXX It should look more like VMS :-) */ | /* XXX It should look more like VMS :-) */ | ||||
printf("** DUMP FAILED (ERROR %d) **\n", error); | printf("** DUMP FAILED (ERROR %d) **\n", error); | ||||
return (error); | return (error); | ||||
} | } |