View | Details | Raw Unified | Return to bug 192036
Collapse All | Expand All

(-)b/sys/arm/arm/dump_machdep.c (-3 / +4 lines)
Lines 269-290 foreach_chunk(callback_t cb, void *arg) Link Here
269
		mdp = md_pa_next(mdp);
269
		mdp = md_pa_next(mdp);
270
	}
270
	}
271
	return (seqnr);
271
	return (seqnr);
272
}
272
}
273
273
274
void
274
int
275
dumpsys(struct dumperinfo *di)
275
dumpsys(struct dumperinfo *di)
276
{
276
{
277
	Elf_Ehdr ehdr;
277
	Elf_Ehdr ehdr;
278
	uint32_t dumpsize;
278
	uint32_t dumpsize;
279
	off_t hdrgap;
279
	off_t hdrgap;
280
	size_t hdrsz;
280
	size_t hdrsz;
281
	int error;
281
	int error;
282
282
283
	if (do_minidump) {
283
	if (do_minidump) {
284
		minidumpsys(di);
284
		minidumpsys(di);
285
		return;
285
		return (0);
286
	}
286
	}
287
287
288
	bzero(&ehdr, sizeof(ehdr));
288
	bzero(&ehdr, sizeof(ehdr));
289
	ehdr.e_ident[EI_MAG0] = ELFMAG0;
289
	ehdr.e_ident[EI_MAG0] = ELFMAG0;
290
	ehdr.e_ident[EI_MAG1] = ELFMAG1;
290
	ehdr.e_ident[EI_MAG1] = ELFMAG1;
Lines 366-376 dumpsys(struct dumperinfo *di) Link Here
366
		goto fail;
366
		goto fail;
367
367
368
	/* Signal completion, signoff and exit stage left. */
368
	/* Signal completion, signoff and exit stage left. */
369
	dump_write(di, NULL, 0, 0, 0);
369
	dump_write(di, NULL, 0, 0, 0);
370
	printf("\nDump complete\n");
370
	printf("\nDump complete\n");
371
	return;
371
	return (0);
372
372
373
 fail:
373
 fail:
374
	if (error < 0)
374
	if (error < 0)
375
		error = -error;
375
		error = -error;
376
376
Lines 378-383 dumpsys(struct dumperinfo *di) Link Here
378
		printf("\nDump aborted\n");
378
		printf("\nDump aborted\n");
379
	else if (error == ENOSPC)
379
	else if (error == ENOSPC)
380
		printf("\nDump failed. Partition too small.\n");
380
		printf("\nDump failed. Partition too small.\n");
381
	else
381
	else
382
		printf("\n** DUMP FAILED (ERROR %d) **\n", error);
382
		printf("\n** DUMP FAILED (ERROR %d) **\n", error);
383
	return (error);
383
}
384
}
(-)b/sys/kern/kern_shutdown.c (-2 / +4 lines)
Lines 247-257 print_uptime(void) Link Here
247
247
248
int
248
int
249
doadump(boolean_t textdump)
249
doadump(boolean_t textdump)
250
{
250
{
251
	boolean_t coredump;
251
	boolean_t coredump;
252
	int error;
252
253
254
	error = 0;
253
	if (dumping)
255
	if (dumping)
254
		return (EBUSY);
256
		return (EBUSY);
255
	if (dumper.dumper == NULL)
257
	if (dumper.dumper == NULL)
256
		return (ENXIO);
258
		return (ENXIO);
257
259
Lines 265-278 doadump(boolean_t textdump) Link Here
265
		coredump = FALSE;
267
		coredump = FALSE;
266
		textdump_dumpsys(&dumper);
268
		textdump_dumpsys(&dumper);
267
	}
269
	}
268
#endif
270
#endif
269
	if (coredump)
271
	if (coredump)
270
		dumpsys(&dumper);
272
		error = dumpsys(&dumper);
271
273
272
	dumping--;
274
	dumping--;
273
	return (0);
275
	return (error);
274
}
276
}
275
277
276
static int
278
static int
277
isbufbusy(struct buf *bp)
279
isbufbusy(struct buf *bp)
278
{
280
{
(-)b/sys/mips/mips/dump_machdep.c (-3 / +4 lines)
Lines 255-276 foreach_chunk(callback_t cb, void *arg) Link Here
255
		mdp = md_pa_next(mdp);
255
		mdp = md_pa_next(mdp);
256
	}
256
	}
257
	return (seqnr);
257
	return (seqnr);
258
}
258
}
259
259
260
void
260
int
261
dumpsys(struct dumperinfo *di)
261
dumpsys(struct dumperinfo *di)
262
{
262
{
263
	Elf_Ehdr ehdr;
263
	Elf_Ehdr ehdr;
264
	uint32_t dumpsize;
264
	uint32_t dumpsize;
265
	off_t hdrgap;
265
	off_t hdrgap;
266
	size_t hdrsz;
266
	size_t hdrsz;
267
	int error;
267
	int error;
268
268
269
	if (do_minidump) {
269
	if (do_minidump) {
270
		minidumpsys(di);
270
		minidumpsys(di);
271
		return;
271
		return (0);
272
	}
272
	}
273
273
274
	bzero(&ehdr, sizeof(ehdr));
274
	bzero(&ehdr, sizeof(ehdr));
275
	ehdr.e_ident[EI_MAG0] = ELFMAG0;
275
	ehdr.e_ident[EI_MAG0] = ELFMAG0;
276
	ehdr.e_ident[EI_MAG1] = ELFMAG1;
276
	ehdr.e_ident[EI_MAG1] = ELFMAG1;
Lines 352-362 dumpsys(struct dumperinfo *di) Link Here
352
		goto fail;
352
		goto fail;
353
353
354
	/* Signal completion, signoff and exit stage left. */
354
	/* Signal completion, signoff and exit stage left. */
355
	dump_write(di, NULL, 0, 0, 0);
355
	dump_write(di, NULL, 0, 0, 0);
356
	printf("\nDump complete\n");
356
	printf("\nDump complete\n");
357
	return;
357
	return (0);
358
358
359
 fail:
359
 fail:
360
	if (error < 0)
360
	if (error < 0)
361
		error = -error;
361
		error = -error;
362
362
Lines 364-369 dumpsys(struct dumperinfo *di) Link Here
364
		printf("\nDump aborted\n");
364
		printf("\nDump aborted\n");
365
	else if (error == ENOSPC)
365
	else if (error == ENOSPC)
366
		printf("\nDump failed. Partition too small.\n");
366
		printf("\nDump failed. Partition too small.\n");
367
	else
367
	else
368
		printf("\n** DUMP FAILED (ERROR %d) **\n", error);
368
		printf("\n** DUMP FAILED (ERROR %d) **\n", error);
369
	return (error);
369
}
370
}
(-)b/sys/powerpc/powerpc/dump_machdep.c (-2 / +3 lines)
Lines 203-213 foreach_chunk(callback_t cb, void *arg) Link Here
203
		md = pmap_scan_md(md);
203
		md = pmap_scan_md(md);
204
	}
204
	}
205
	return (seqnr);
205
	return (seqnr);
206
}
206
}
207
207
208
void
208
int
209
dumpsys(struct dumperinfo *di)
209
dumpsys(struct dumperinfo *di)
210
{
210
{
211
	Elf_Ehdr ehdr;
211
	Elf_Ehdr ehdr;
212
	uint32_t dumpsize;
212
	uint32_t dumpsize;
213
	off_t hdrgap;
213
	off_t hdrgap;
Lines 297-307 dumpsys(struct dumperinfo *di) Link Here
297
		goto fail;
297
		goto fail;
298
298
299
	/* Signal completion, signoff and exit stage left. */
299
	/* Signal completion, signoff and exit stage left. */
300
	dump_write(di, NULL, 0, 0, 0);
300
	dump_write(di, NULL, 0, 0, 0);
301
	printf("\nDump complete\n");
301
	printf("\nDump complete\n");
302
	return;
302
	return (0);
303
303
304
 fail:
304
 fail:
305
	if (error < 0)
305
	if (error < 0)
306
		error = -error;
306
		error = -error;
307
307
Lines 309-314 dumpsys(struct dumperinfo *di) Link Here
309
		printf("\nDump aborted\n");
309
		printf("\nDump aborted\n");
310
	else if (error == ENOSPC)
310
	else if (error == ENOSPC)
311
		printf("\nDump failed. Partition too small.\n");
311
		printf("\nDump failed. Partition too small.\n");
312
	else
312
	else
313
		printf("\n** DUMP FAILED (ERROR %d) **\n", error);
313
		printf("\n** DUMP FAILED (ERROR %d) **\n", error);
314
	return (error);
314
}
315
}
(-)b/sys/sparc64/sparc64/dump_machdep.c (-2 / +3 lines)
Lines 140-150 blk_dump(struct dumperinfo *di, vm_paddr_t pa, vm_size_t size) Link Here
140
	}
140
	}
141
	printf("... %s\n", (error) ? "fail" : "ok");
141
	printf("... %s\n", (error) ? "fail" : "ok");
142
	return (error);
142
	return (error);
143
}
143
}
144
144
145
void
145
int
146
dumpsys(struct dumperinfo *di)
146
dumpsys(struct dumperinfo *di)
147
{
147
{
148
	struct sparc64_dump_hdr hdr;
148
	struct sparc64_dump_hdr hdr;
149
	vm_size_t size, totsize, hdrsize;
149
	vm_size_t size, totsize, hdrsize;
150
	int error, i, nreg;
150
	int error, i, nreg;
Lines 216-226 dumpsys(struct dumperinfo *di) Link Here
216
		goto fail;
216
		goto fail;
217
217
218
	/* Signal completion, signoff and exit stage left. */
218
	/* Signal completion, signoff and exit stage left. */
219
	dump_write(di, NULL, 0, 0, 0);
219
	dump_write(di, NULL, 0, 0, 0);
220
	printf("\nDump complete\n");
220
	printf("\nDump complete\n");
221
	return;
221
	return (0);
222
222
223
 fail:
223
 fail:
224
	/* XXX It should look more like VMS :-) */
224
	/* XXX It should look more like VMS :-) */
225
	printf("** DUMP FAILED (ERROR %d) **\n", error);
225
	printf("** DUMP FAILED (ERROR %d) **\n", error);
226
	return (error);
226
}
227
}
(-)b/sys/sys/conf.h (-1 / +1 lines)
Lines 334-344 struct dumperinfo { Link Here
334
	off_t   mediasize;	/* Space available in bytes. */
334
	off_t   mediasize;	/* Space available in bytes. */
335
};
335
};
336
336
337
int set_dumper(struct dumperinfo *, const char *_devname);
337
int set_dumper(struct dumperinfo *, const char *_devname);
338
int dump_write(struct dumperinfo *, void *, vm_offset_t, off_t, size_t);
338
int dump_write(struct dumperinfo *, void *, vm_offset_t, off_t, size_t);
339
void dumpsys(struct dumperinfo *);
339
int dumpsys(struct dumperinfo *);
340
int doadump(boolean_t);
340
int doadump(boolean_t);
341
extern int dumping;		/* system is dumping */
341
extern int dumping;		/* system is dumping */
342
342
343
#endif /* _KERNEL */
343
#endif /* _KERNEL */
344
344
(-)b/sys/x86/x86/dump_machdep.c (-3 / +4 lines)
Lines 264-285 foreach_chunk(callback_t cb, void *arg) Link Here
264
		mdp = md_pa_next(mdp);
264
		mdp = md_pa_next(mdp);
265
	}
265
	}
266
	return (seqnr);
266
	return (seqnr);
267
}
267
}
268
268
269
void
269
int
270
dumpsys(struct dumperinfo *di)
270
dumpsys(struct dumperinfo *di)
271
{
271
{
272
	Elf_Ehdr ehdr;
272
	Elf_Ehdr ehdr;
273
	uint64_t dumpsize;
273
	uint64_t dumpsize;
274
	off_t hdrgap;
274
	off_t hdrgap;
275
	size_t hdrsz;
275
	size_t hdrsz;
276
	int error;
276
	int error;
277
277
278
	if (do_minidump) {
278
	if (do_minidump) {
279
		minidumpsys(di);
279
		minidumpsys(di);
280
		return;
280
		return (0);
281
	}
281
	}
282
	bzero(&ehdr, sizeof(ehdr));
282
	bzero(&ehdr, sizeof(ehdr));
283
	ehdr.e_ident[EI_MAG0] = ELFMAG0;
283
	ehdr.e_ident[EI_MAG0] = ELFMAG0;
284
	ehdr.e_ident[EI_MAG1] = ELFMAG1;
284
	ehdr.e_ident[EI_MAG1] = ELFMAG1;
285
	ehdr.e_ident[EI_MAG2] = ELFMAG2;
285
	ehdr.e_ident[EI_MAG2] = ELFMAG2;
Lines 361-371 dumpsys(struct dumperinfo *di) Link Here
361
		goto fail;
361
		goto fail;
362
362
363
	/* Signal completion, signoff and exit stage left. */
363
	/* Signal completion, signoff and exit stage left. */
364
	dump_write(di, NULL, 0, 0, 0);
364
	dump_write(di, NULL, 0, 0, 0);
365
	printf("\nDump complete\n");
365
	printf("\nDump complete\n");
366
	return;
366
	return (0);
367
367
368
 fail:
368
 fail:
369
	if (error < 0)
369
	if (error < 0)
370
		error = -error;
370
		error = -error;
371
371
Lines 373-378 dumpsys(struct dumperinfo *di) Link Here
373
		printf("\nDump aborted\n");
373
		printf("\nDump aborted\n");
374
	else if (error == ENOSPC)
374
	else if (error == ENOSPC)
375
		printf("\nDump failed. Partition too small.\n");
375
		printf("\nDump failed. Partition too small.\n");
376
	else
376
	else
377
		printf("\n** DUMP FAILED (ERROR %d) **\n", error);
377
		printf("\n** DUMP FAILED (ERROR %d) **\n", error);
378
	return (error);
378
}
379
}

Return to bug 192036