1 #ifndef _ASM_I386_NETDUMP_H
2 #define _ASM_I386_NETDUMP_H
5 * linux/include/asm-i386/netdump.h
7 * Copyright (c) 2003, 2004 Red Hat, Inc. All rights reserved.
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)
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.
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.
29 extern int page_is_ram (unsigned long);
30 const static int platform_supports_netdump = 1;
31 extern union irq_ctx *netdump_irq_ctx;
33 #define platform_timestamp(x) rdtscll(x)
35 #define platform_fix_regs() \
39 esp = (unsigned long) ((char *)regs + sizeof (struct pt_regs)); \
41 if (regs->xcs & 3) { \
43 ss = regs->xss & 0xffff; \
47 myregs.xss = (myregs.xss & 0xffff0000) | ss; \
50 static inline void platform_init_stack(void **stackptr)
52 *stackptr = (void *)kmalloc(sizeof(union irq_ctx), GFP_KERNEL);
54 memset(*stackptr, 0, sizeof(union irq_ctx));
57 "netdump: unable to allocate separate stack\n");
60 static inline void platform_start_netdump(void *stackptr, struct pt_regs *regs)
63 union irq_ctx * curctx;
64 union irq_ctx * dumpctx;
67 netpoll_netdump(regs);
69 curctx = (union irq_ctx *) current_thread_info();
70 dumpctx = (union irq_ctx *) stackptr;
72 /* build the stack frame on the IRQ stack */
73 dsp = (u32*) ((char*)dumpctx + sizeof(*dumpctx));
74 dumpctx->tinfo.task = curctx->tinfo.task;
75 dumpctx->tinfo.real_stack = curctx->tinfo.real_stack;
76 dumpctx->tinfo.virtual_stack = curctx->tinfo.virtual_stack;
77 dumpctx->tinfo.previous_esp = current_stack_pointer();
82 " xchgl %%ebx,%%esp \n"
83 " call netpoll_netdump \n"
84 " xchgl %%ebx,%%esp \n"
85 : : "b"(dsp) : "memory", "cc", "edx", "ecx"
90 #define platform_cleanup_stack(stackptr) \
96 #define platform_max_pfn() (num_physpages)
98 #endif /* __KERNEL__ */
100 #endif /* _ASM_I386_NETDUMP_H */