bitkeeper revision 1.485 (3f81b19fL5Y4lVlRaEpJI9r_IZlDcw)

Merge labyrinth.cl.cam.ac.uk:/auto/groups/xeno/users/rn212/xeno.mini
into labyrinth.cl.cam.ac.uk:/auto/anfs/scratch/labyrinth/iap10/xeno-clone/xeno.bk
This commit is contained in:
iap10@labyrinth.cl.cam.ac.uk committed 2003-10-06 18:17:03 +00:00
commit d5d4e6ed04
3 files changed
+61 -20

No files matched your search

+4
View File
@@ -63,6 +63,10 @@ struct pt_regs {
int xss;
};
/* some function prototypes */
void trap_init(void);
void dump_regs(struct pt_regs *regs);
/*
* STI/CLI equivalents. These basically set and clear the virtual
+12 -2
View File
@@ -36,10 +36,10 @@ char stack[8192];
void hypervisor_callback(void);
void failsafe_callback(void);
/* default exit event handler */
/* default event handlers */
static void exit_handler(int ev, struct pt_regs *regs);
static void debug_handler(int ev, struct pt_regs *regs);
extern void trap_init(void);
/*
* INITIAL C ENTRY POINT.
@@ -100,6 +100,10 @@ void start_kernel(start_info_t *si)
enable_ev_action(EV_DIE);
enable_hypervisor_event(EV_DIE);
add_ev_action(EV_DEBUG, &debug_handler);
enable_ev_action(EV_DEBUG);
enable_hypervisor_event(EV_DEBUG);
/* init time and timers */
init_time();
@@ -124,3 +128,9 @@ static void exit_handler(int ev, struct pt_regs *regs) {
do_exit();
}
/*
* a debug handler to print out some state from the guest
*/
static void debug_handler(int ev, struct pt_regs *regs) {
dump_regs(regs);
}
+45 -18
View File
@@ -1,6 +1,7 @@
#include <os.h>
#include <hypervisor.h>
#include <mm.h>
#include <lib.h>
/*
@@ -31,6 +32,7 @@ void machine_check(void);
extern void do_exit(void);
int kstack_depth_to_print = 24;
#define THREAD_SIZE (2*PAGE_SIZE)
static inline int kernel_text_address(unsigned long addr)
{
@@ -57,24 +59,49 @@ void show_trace(unsigned long * stack)
printk("\n");
}
void dump_regs(struct pt_regs *regs) {
printk("Register dump:");
printk("ebx: \t 0x%lx", regs->ebx);
printk("ecx: \t 0x%lx", regs->ecx);
printk("edx: \t 0x%lx", regs->edx);
printk("esi: \t 0x%lx", regs->esi);
printk("edi: \t 0x%lx", regs->edi);
printk("ebp: \t 0x%lx", regs->ebp);
printk("eax: \t 0x%lx", regs->eax);
printk("xds: \t 0x%x", regs->xds);
printk("xes: \t 0x%x", regs->xes);
printk("orig_eax: \t 0x%lx", regs->orig_eax);
printk("eip: \t 0x%lx", regs->eip);
printk("xcs: \t 0x%x", regs->xcs);
printk("eflags: \t 0x%lx", regs->eflags);
printk("esp: \t 0x%lx", regs->esp);
printk("xss: \t 0x%x", regs->xss);
};
void show_stack(unsigned long * esp)
{
unsigned long *stack;
int i;
if(esp==NULL)
esp=(unsigned long*)&esp;
stack = esp;
for(i=0; i < kstack_depth_to_print; i++) {
if (((long) stack & (THREAD_SIZE-1)) == 0)
break;
printk("%08lx ", *stack++);
}
printk("\n");
show_trace(esp);
}
void dump_regs(struct pt_regs *regs)
{
int in_kernel = 1;
unsigned long esp;
unsigned short ss;
esp = (unsigned long) (&regs->esp);
ss = __KERNEL_DS;
if (regs->xcs & 2) {
in_kernel = 0;
esp = regs->esp;
ss = regs->xss & 0xffff;
}
printf("EIP: %04x:[<%08lx>]\n",
0xffff & regs->xcs, regs->eip);
printf("EFLAGS: %08lx\n",regs->eflags);
printf("eax: %08lx ebx: %08lx ecx: %08lx edx: %08lx\n",
regs->eax, regs->ebx, regs->ecx, regs->edx);
printf("esi: %08lx edi: %08lx ebp: %08lx esp: %08lx\n",
regs->esi, regs->edi, regs->ebp, esp);
printf("ds: %04x es: %04x ss: %04x\n",
regs->xds & 0xffff, regs->xes & 0xffff, ss);
printf("\n");
}
static inline void dump_code(unsigned eip)
{
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.