This commit was manufactured by cvs2svn to create branch
[linux-2.6.git] / include / asm-ia64 / diskdump.h
1 #ifndef _ASM_IA64_DISKDUMP_H
2 #define _ASM_IA64_DISKDUMP_H
3
4 /*
5  * linux/include/asm-ia64/diskdump.h
6  *
7  * Copyright (c) 2004 FUJITSU LIMITED
8  * Copyright (c) 2003 Red Hat, Inc. All rights reserved.
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2, or (at your option)
13  * any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23  *
24  */
25
26 #ifdef __KERNEL__
27
28 #include <asm/crashdump.h>
29
30
31 const static int platform_supports_diskdump = 1;
32
33 struct disk_dump_sub_header {
34         elf_gregset_t            elf_regs;
35         struct switch_stack     *sw[NR_CPUS];
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         struct unw_frame_info *info = platform_arg;             \
44                                                                 \
45         ia64_do_copy_regs(info, &dump_sub_header.elf_regs);     \
46         dump_sub_header.sw[smp_processor_id()] = info->sw;      \
47         clear_page(scratch);                                    \
48         memcpy(scratch, &dump_sub_header, sizeof(dump_sub_header));\
49                                                                 \
50         if ((ret = write_blocks(dump_part, 2, scratch, 1)) >= 0)\
51                 ret = 1; /* size of sub header in page */;      \
52         ret;                                                    \
53 })
54
55 #define platform_freeze_cpu()                                   \
56 {                                                               \
57         unw_init_running(ia64_freeze_cpu,                       \
58                 &dump_sub_header.sw[smp_processor_id()]);       \
59 }
60
61 #endif /* __KERNEL__ */
62
63 #endif /* _ASM_IA64_DISKDUMP_H */