Blame lkcd_vmdump_v2_v3.h

Packit Service 501009
/* lkcd_vmdump_v2_v3.h - core analysis suite
Packit Service 501009
 *
Packit Service 501009
 * Copyright (C) 1999, 2000, 2001, 2002 Mission Critical Linux, Inc.
Packit Service 501009
 * Copyright (C) 2002, 2003, 2004, 2005, 2006 David Anderson
Packit Service 501009
 * Copyright (C) 2002, 2003, 2004, 2005, 2006 Red Hat, Inc. All rights reserved.
Packit Service 501009
 *
Packit Service 501009
 * This program is free software; you can redistribute it and/or modify
Packit Service 501009
 * it under the terms of the GNU General Public License as published by
Packit Service 501009
 * the Free Software Foundation; either version 2 of the License, or
Packit Service 501009
 * (at your option) any later version.
Packit Service 501009
 *
Packit Service 501009
 * This program is distributed in the hope that it will be useful,
Packit Service 501009
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 501009
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Service 501009
 * GNU General Public License for more details.
Packit Service 501009
 */
Packit Service 501009
Packit Service 501009
Packit Service 501009
/*
Packit Service 501009
 * Kernel header file for Linux crash dumps.
Packit Service 501009
 *
Packit Service 501009
 * Created by: Matt Robinson (yakker@sgi.com)
Packit Service 501009
 *
Packit Service 501009
 * Copyright 1999 Silicon Graphics, Inc. All rights reserved.
Packit Service 501009
 * 
Packit Service 501009
 */
Packit Service 501009
Packit Service 501009
/* This header file includes all structure definitions for crash dumps. */
Packit Service 501009
#ifndef _VMDUMP_H
Packit Service 501009
#define _VMDUMP_H
Packit Service 501009
Packit Service 501009
/* necessary header files */
Packit Service 501009
#ifndef MCLX
Packit Service 501009
#include <linux/utsname.h>              /* for utsname structure            */
Packit Service 501009
#include <asm/vmdump.h>                 /* for architecture-specific header */
Packit Service 501009
#endif
Packit Service 501009
Packit Service 501009
#if defined(ARM) || defined(X86) || defined(PPC) || defined(S390) || \
Packit Service 501009
	defined(S390X) || defined(ARM64) || defined(MIPS) || defined(SPARC64)
Packit Service 501009
Packit Service 501009
/*
Packit Service 501009
 * Kernel header file for Linux crash dumps.
Packit Service 501009
 *
Packit Service 501009
 * Created by: Matt Robinson (yakker@sgi.com)
Packit Service 501009
 *
Packit Service 501009
 * Copyright 1999 Silicon Graphics, Inc. All rights reserved.
Packit Service 501009
 * 
Packit Service 501009
 */
Packit Service 501009
Packit Service 501009
/* This header file holds the architecture specific crash dump header */
Packit Service 501009
#ifndef _ASM_VMDUMP_H
Packit Service 501009
#define _ASM_VMDUMP_H
Packit Service 501009
Packit Service 501009
/* necessary header files */
Packit Service 501009
typedef unsigned int u32;
Packit Service 501009
#include <asm/ptrace.h>                          /* for pt_regs             */
Packit Service 501009
Packit Service 501009
/* definitions */
Packit Service 501009
#define DUMP_ASM_MAGIC_NUMBER     0xdeaddeadULL  /* magic number            */
Packit Service 501009
#define DUMP_ASM_VERSION_NUMBER   0x1            /* version number          */
Packit Service 501009
Packit Service 501009
Packit Service 501009
/*
Packit Service 501009
 * Structure: dump_header_asm_t
Packit Service 501009
 *  Function: This is the header for architecture-specific stuff.  It
Packit Service 501009
 *            follows right after the dump header.
Packit Service 501009
 */
Packit Service 501009
typedef struct _dump_header_asm_s {
Packit Service 501009
Packit Service 501009
        /* the dump magic number -- unique to verify dump is valid */
Packit Service 501009
        uint64_t             dha_magic_number;
Packit Service 501009
Packit Service 501009
        /* the version number of this dump */
Packit Service 501009
        uint32_t             dha_version;
Packit Service 501009
Packit Service 501009
        /* the size of this header (in case we can't read it) */
Packit Service 501009
        uint32_t             dha_header_size;
Packit Service 501009
Packit Service 501009
	/* the esp for i386 systems */
Packit Service 501009
	uint32_t             dha_esp;
Packit Service 501009
Packit Service 501009
	/* the eip for i386 systems */
Packit Service 501009
	uint32_t             dha_eip;
Packit Service 501009
Packit Service 501009
	/* the dump registers */
Packit Service 501009
#ifndef S390
Packit Service 501009
#ifndef S390X
Packit Service 501009
#ifndef ARM64
Packit Service 501009
	struct pt_regs       dha_regs;
Packit Service 501009
#endif
Packit Service 501009
#endif
Packit Service 501009
#endif
Packit Service 501009
Packit Service 501009
} dump_header_asm_t;
Packit Service 501009
Packit Service 501009
#endif /* _ASM_VMDUMP_H */
Packit Service 501009
Packit Service 501009
#endif /* ARM || X86 || PPC */
Packit Service 501009
Packit Service 501009
#if defined(ALPHA) || defined(IA64) || defined(X86_64) || defined(PPC64)
Packit Service 501009
Packit Service 501009
/* 
Packit Service 501009
 *  Plug in the real ../arch/alpha/vmdump.h when available.  For now the
Packit Service 501009
 *  data here are just placeholders...
Packit Service 501009
 */
Packit Service 501009
Packit Service 501009
#ifndef IA64
Packit Service 501009
typedef unsigned int u32;
Packit Service 501009
#include <asm/ptrace.h>                          /* for pt_regs             */
Packit Service 501009
#endif
Packit Service 501009
Packit Service 501009
/* definitions */
Packit Service 501009
#define DUMP_ASM_MAGIC_NUMBER     0xdeaddeadULL  /* magic number            */
Packit Service 501009
#define DUMP_ASM_VERSION_NUMBER   0x1            /* version number          */
Packit Service 501009
Packit Service 501009
Packit Service 501009
typedef struct _dump_header_asm_s {
Packit Service 501009
Packit Service 501009
        /* the dump magic number -- unique to verify dump is valid */
Packit Service 501009
        uint64_t             dha_magic_number;
Packit Service 501009
Packit Service 501009
        /* the version number of this dump */
Packit Service 501009
        uint32_t             dha_version;
Packit Service 501009
Packit Service 501009
        /* the size of this header (in case we can't read it) */
Packit Service 501009
        uint32_t             dha_header_size;
Packit Service 501009
Packit Service 501009
        /* the esp for i386 systems */
Packit Service 501009
        uint32_t             dha_esp;
Packit Service 501009
Packit Service 501009
        /* the eip for i386 systems */
Packit Service 501009
        uint32_t             dha_eip;
Packit Service 501009
Packit Service 501009
        /* the dump registers */
Packit Service 501009
#ifndef IA64
Packit Service 501009
        struct pt_regs       dha_regs;
Packit Service 501009
#endif
Packit Service 501009
Packit Service 501009
} dump_header_asm_t;
Packit Service 501009
Packit Service 501009
#endif /* ALPHA or IA64 (?) */
Packit Service 501009
Packit Service 501009
/* necessary header definitions in all cases */
Packit Service 501009
#define DUMP_KIOBUF_NUMBER  0xdeadbeef  /* special number for kiobuf maps   */
Packit Service 501009
Packit Service 501009
#ifdef CONFIG_VMDUMP
Packit Service 501009
/* size of a dump header page */
Packit Service 501009
#define DUMP_PAGE_SZ        64 * 1024  /* size of dump page buffer          */
Packit Service 501009
Packit Service 501009
/* standard header definitions */
Packit Service 501009
#define DUMP_MAGIC_NUMBER   0xa8190173618f23edULL  /* dump magic number     */
Packit Service 501009
#define DUMP_VERSION_NUMBER 0x2         /* dump version number              */
Packit Service 501009
#define DUMP_PANIC_LEN      0x100       /* dump panic string length         */
Packit Service 501009
Packit Service 501009
/* dump flags -- add as necessary */
Packit Service 501009
#define DUMP_RAW            0x1         /* raw page (no compression)        */
Packit Service 501009
#define DUMP_COMPRESSED     0x2         /* page is compressed               */
Packit Service 501009
#define DUMP_END            0x4         /* end marker on a full dump        */
Packit Service 501009
Packit Service 501009
/* dump types - type specific stuff added later for page typing */
Packit Service 501009
#define DUMP_NONE           0           /* no dumping at all -- just bail   */
Packit Service 501009
#define DUMP_HEADER         1           /* kernel dump header only          */
Packit Service 501009
#define DUMP_KERN           2           /* dump header and kernel pages     */
Packit Service 501009
#define DUMP_USED           3           /* dump header, kernel/user pages   */
Packit Service 501009
#define DUMP_ALL            4           /* dump header, all memory pages    */
Packit Service 501009
Packit Service 501009
/*
Packit Service 501009
 * Structure: dump_header_t
Packit Service 501009
 *  Function: This is the header dumped at the top of every valid crash
Packit Service 501009
 *            dump.  
Packit Service 501009
 *            easy reassembly of each crash dump page.  The address bits
Packit Service 501009
 *            are split to make things easier for 64-bit/32-bit system
Packit Service 501009
 *            conversions.
Packit Service 501009
 */
Packit Service 501009
typedef struct _dump_header_s {
Packit Service 501009
	/* the dump magic number -- unique to verify dump is valid */
Packit Service 501009
	uint64_t             dh_magic_number;
Packit Service 501009
Packit Service 501009
	/* the version number of this dump */
Packit Service 501009
	uint32_t             dh_version;
Packit Service 501009
Packit Service 501009
	/* the size of this header (in case we can't read it) */
Packit Service 501009
	uint32_t             dh_header_size;
Packit Service 501009
Packit Service 501009
	/* the level of this dump (just a header?) */
Packit Service 501009
	uint32_t             dh_dump_level;
Packit Service 501009
Packit Service 501009
	/* the size of a Linux memory page (4K, 8K, 16K, etc.) */
Packit Service 501009
	uint32_t             dh_page_size;
Packit Service 501009
Packit Service 501009
	/* the size of all physical memory */
Packit Service 501009
	uint64_t             dh_memory_size;
Packit Service 501009
Packit Service 501009
	/* the start of physical memory */
Packit Service 501009
	uint64_t             dh_memory_start;
Packit Service 501009
Packit Service 501009
	/* the end of physical memory */
Packit Service 501009
	uint64_t             dh_memory_end;
Packit Service 501009
Packit Service 501009
	/* the number of pages in this dump specifically */
Packit Service 501009
	uint32_t             dh_num_pages;
Packit Service 501009
Packit Service 501009
	/* the panic string, if available */
Packit Service 501009
	char                 dh_panic_string[DUMP_PANIC_LEN];
Packit Service 501009
Packit Service 501009
	/* the time of the system crash */
Packit Service 501009
	struct timeval       dh_time;
Packit Service 501009
Packit Service 501009
	/* the utsname (uname) information */
Packit Service 501009
	struct new_utsname   dh_utsname;
Packit Service 501009
Packit Service 501009
	/* the address of the current task */
Packit Service 501009
	struct task_struct  *dh_current_task;
Packit Service 501009
Packit Service 501009
} dump_header_t;
Packit Service 501009
Packit Service 501009
/*
Packit Service 501009
 * Structure: dump_page_t
Packit Service 501009
 *  Function: To act as the header associated to each physical page of
Packit Service 501009
 *            memory saved in the system crash dump.  This allows for
Packit Service 501009
 *            easy reassembly of each crash dump page.  The address bits
Packit Service 501009
 *            are split to make things easier for 64-bit/32-bit system
Packit Service 501009
 *            conversions.
Packit Service 501009
 */
Packit Service 501009
typedef struct _dump_page_s {
Packit Service 501009
    
Packit Service 501009
	/* the address of this dump page */
Packit Service 501009
	uint64_t             dp_address;
Packit Service 501009
Packit Service 501009
	/* the size of this dump page */
Packit Service 501009
	uint32_t             dp_size;
Packit Service 501009
Packit Service 501009
	/* flags (currently DUMP_COMPRESSED, DUMP_RAW or DUMP_END) */
Packit Service 501009
	uint32_t             dp_flags;
Packit Service 501009
} dump_page_t;
Packit Service 501009
Packit Service 501009
#endif /* CONFIG_VMDUMP */
Packit Service 501009
Packit Service 501009
#ifdef __KERNEL__
Packit Service 501009
extern void dump_init(uint64_t, uint64_t);
Packit Service 501009
extern void dump_open(char *);
Packit Service 501009
extern void dump_execute(char *, struct pt_regs *);
Packit Service 501009
#endif
Packit Service 501009
Packit Service 501009
#endif /* _VMDUMP_H */