This commit was generated by cvs2svn to compensate for changes in r925,
[linux-2.6.git] / include / asm-i386 / diskdump.h
1 #ifndef _ASM_I386_DISKDUMP_H
2 #define _ASM_I386_DISKDUMP_H
3
4 /*
5  * linux/include/asm-i386/diskdump.h
6  *
7  * Copyright (c) 2004 FUJITSU LIMITED
8  * Copyright (c) 2003 Red Hat, Inc. All rights reserved.
9  */
10 /*
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2, or (at your option)
14  * any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24  *
25  */
26
27 #ifdef __KERNEL__
28
29 #include <linux/elf.h>
30 #include <asm/crashdump.h>
31
32 const static int platform_supports_diskdump = 1;
33
34 struct disk_dump_sub_header {
35         elf_gregset_t           elf_regs;
36 };
37
38 #define size_of_sub_header()    ((sizeof(struct disk_dump_sub_header) + PAGE_SIZE - 1) / DUMP_BLOCK_SIZE)
39
40 #define write_sub_header()                                              \
41 ({                                                                      \
42         int ret;                                                        \
43                                                                         \
44         ELF_CORE_COPY_REGS(dump_sub_header.elf_regs, (&myregs));        \
45         clear_page(scratch);                                            \
46         memcpy(scratch, &dump_sub_header, sizeof(dump_sub_header));     \
47                                                                         \
48         if ((ret = write_blocks(dump_part, 2, scratch, 1)) >= 0)        \
49                 ret = 1; /* size of sub header in page */;              \
50         ret;                                                            \
51 })
52
53 #endif /* __KERNEL__ */
54
55 #endif /* _ASM_I386_DISKDUMP_H */