summaryrefslogtreecommitdiffstats
path: root/sys/sparc64
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2015-11-16 23:02:33 +0000
committermarius <marius@FreeBSD.org>2015-11-16 23:02:33 +0000
commit7965ca51f7d36e891e8674e4c27e473ed291f287 (patch)
tree8fc49d37a59ec9de898f5e6d475910ba825c2a12 /sys/sparc64
parent6fee50ba240dd3c4478ce694aa1b9df6aa96875b (diff)
downloadFreeBSD-src-7965ca51f7d36e891e8674e4c27e473ed291f287.zip
FreeBSD-src-7965ca51f7d36e891e8674e4c27e473ed291f287.tar.gz
- Unbreak dumpsys(9) on sparc64 after r276772
- While at it, arrange #ifndefs in kern_dump.c more intelligently; it's rather confusing to have multiple competing and/or unused functions in the kernel.
Diffstat (limited to 'sys/sparc64')
-rw-r--r--sys/sparc64/include/dump.h8
-rw-r--r--sys/sparc64/sparc64/dump_machdep.c24
2 files changed, 7 insertions, 25 deletions
diff --git a/sys/sparc64/include/dump.h b/sys/sparc64/include/dump.h
index aee0f58..f154660 100644
--- a/sys/sparc64/include/dump.h
+++ b/sys/sparc64/include/dump.h
@@ -35,7 +35,6 @@
#define KERNELDUMP_ARCH_VERSION KERNELDUMP_SPARC64_VERSION
#define EM_VALUE EM_SPARCV9
-void dumpsys_pa_init(void);
int dumpsys(struct dumperinfo *);
static inline struct dump_pa *
@@ -60,13 +59,6 @@ dumpsys_unmap_chunk(vm_paddr_t pa, size_t s, void *va)
}
static inline int
-dumpsys_write_aux_headers(struct dumperinfo *di)
-{
-
- return (dumpsys_gen_write_aux_headers(di));
-}
-
-static inline int
minidumpsys(struct dumperinfo *di)
{
diff --git a/sys/sparc64/sparc64/dump_machdep.c b/sys/sparc64/sparc64/dump_machdep.c
index 1f28b6d..9cb1aab 100644
--- a/sys/sparc64/sparc64/dump_machdep.c
+++ b/sys/sparc64/sparc64/dump_machdep.c
@@ -55,18 +55,6 @@ extern struct dump_pa dump_map[DUMPSYS_MD_PA_NPAIRS];
int do_minidump = 0;
void
-dumpsys_pa_init(void)
-{
- int i;
-
- memset(dump_map, 0, sizeof(dump_map));
- for (i = 0; i < sparc64_nmemreg; i++) {
- dump_map[i].pa_start = sparc64_memreg[i].mr_start;
- dump_map[i].pa_size = sparc64_memreg[i].mr_size;
- }
-}
-
-void
dumpsys_map_chunk(vm_paddr_t pa, size_t chunk __unused, void **va)
{
@@ -89,16 +77,18 @@ int
dumpsys(struct dumperinfo *di)
{
static struct kerneldumpheader kdh;
-
struct sparc64_dump_hdr hdr;
vm_size_t size, totsize, hdrsize;
int error, i, nreg;
- /* Calculate dump size. */
+ /* Set up dump_map and calculate dump size. */
size = 0;
nreg = sparc64_nmemreg;
- for (i = 0; i < sparc64_nmemreg; i++)
- size += sparc64_memreg[i].mr_size;
+ memset(dump_map, 0, sizeof(dump_map));
+ for (i = 0; i < nreg; i++) {
+ dump_map[i].pa_start = sparc64_memreg[i].mr_start;
+ size += dump_map[i].pa_size = sparc64_memreg[i].mr_size;
+ }
/* Account for the header size. */
hdrsize = roundup2(sizeof(hdr) + sizeof(struct sparc64_dump_reg) * nreg,
DEV_BSIZE);
@@ -139,7 +129,7 @@ dumpsys(struct dumperinfo *di)
fileofs = hdrsize;
/* Now, write out the region descriptors. */
- for (i = 0; i < sparc64_nmemreg; i++) {
+ for (i = 0; i < nreg; i++) {
error = reg_write(di, sparc64_memreg[i].mr_start,
sparc64_memreg[i].mr_size);
if (error != 0)
OpenPOWER on IntegriCloud