[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 02/22] mini-os: make dump_regs() work in early boot



dump_regs() will result in page fault in early boot as there is no
current thread pointer. Handle this case.

Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
---
 arch/x86/traps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/traps.c b/arch/x86/traps.c
index 6353718..307a14c 100644
--- a/arch/x86/traps.c
+++ b/arch/x86/traps.c
@@ -32,7 +32,7 @@ void machine_check(void);
 
 void dump_regs(struct pt_regs *regs)
 {
-    printk("Thread: %s\n", current->name);
+    printk("Thread: %s\n", current ? current->name : "*NONE*");
 #ifdef __i386__    
     printk("EIP: %lx, EFLAGS %lx.\n", regs->eip, regs->eflags);
     printk("EBX: %08lx ECX: %08lx EDX: %08lx\n",
-- 
2.6.6


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.