fedora core 2.6.10-1.12-FC2
[linux-2.6.git] / include / asm-i386 / netdump.h
1 #ifndef _ASM_I386_NETDUMP_H_
2 #define _ASM_I386_NETDUMP_H_
3
4 /*
5  * linux/include/asm-i386/netdump.h
6  *
7  * Copyright (c) 2003, 2004 Red Hat, Inc. All rights reserved.
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2, or (at your option)
12  * any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22  *
23  */
24
25 #ifdef __KERNEL__
26
27 #include <asm/irq.h>
28 #include <asm/crashdump.h>
29
30 const static int platform_supports_netdump = 1;
31
32 #define platform_page_is_ram(x) (page_is_ram(x))
33 #define platform_machine_type() (EM_386)
34
35 static inline unsigned char platform_effective_version(req_t *req)
36 {
37         if (req->from == 0)
38                 return NETDUMP_VERSION;
39         else
40                 return min_t(unsigned char, req->from, NETDUMP_VERSION_MAX);
41 }
42
43 #define platform_max_pfn() (num_physpages)
44
45 static inline u32 platform_next_available(unsigned long pfn)
46 {
47         unsigned long pgnum = next_ram_page(pfn);
48
49         if (pgnum < platform_max_pfn()) {
50                 return (u32)pgnum;
51         }
52         return 0;
53 }
54
55 static inline void platform_jiffy_cycles(unsigned long long *jcp)
56 {
57         unsigned long long t0, t1;
58
59         platform_timestamp(t0);
60         netdump_mdelay(1);
61         platform_timestamp(t1);
62         if (t1 > t0)
63                 *jcp = t1 - t0;
64 }
65
66 static inline unsigned int platform_get_regs(char *tmp, struct pt_regs *myregs)
67 {
68         elf_gregset_t elf_regs;
69         char *tmp2;
70
71         tmp2 = tmp + sprintf(tmp, "Sending register info.\n");
72         ELF_CORE_COPY_REGS(elf_regs, myregs);
73         memcpy(tmp2, &elf_regs, sizeof(elf_regs));
74
75         return(strlen(tmp) + sizeof(elf_regs));
76 }
77 #endif /* __KERNEL__ */
78
79 #endif /* _ASM_I386_NETDUMP_H_ */