mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
bitkeeper revision 1.544 (3fa15259IWpuWetGe_175Hq5izSLnA)
hypercall jumps to pervasive debugger
This commit is contained in:
1 parent
27eb637e73
commit
4edec9f991
6 files changed
+91
-7
No files matched your search
@@ -234,6 +234,7 @@
|
||||
3e397e66AyyD5fYraAySWuwi9uqSXg xen/common/ac_timer.c
|
||||
3ddb79bddEYJbcURvqqcx99Yl2iAhQ xen/common/block.c
|
||||
3ddb79bdrqnW93GR9gZk1OJe1qK-iQ xen/common/brlock.c
|
||||
3fa152581E5KhrAtqZef2Sr5NKTz4w xen/common/debug.c
|
||||
3ddb79bdLX_P6iB7ILiblRLWvebapg xen/common/dom0_ops.c
|
||||
3e6377e4i0c9GtKN65e99OtRbw3AZw xen/common/dom_mem_ops.c
|
||||
3ddb79bdYO5D8Av12NHqPeSviav7cg xen/common/domain.c
|
||||
|
||||
@@ -479,3 +479,4 @@ tools/misc/xen_cpuperf
|
||||
tools/misc/xen_log
|
||||
tools/misc/xen_refresh_dev
|
||||
xenolinux-2.4.22-sparse/arch/xeno/drivers/block/device
|
||||
xen/common/debug.c~
|
||||
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* debug.c
|
||||
*
|
||||
* xen pervasive debugger
|
||||
*/
|
||||
|
||||
#include <xeno/config.h>
|
||||
#include <xeno/types.h>
|
||||
#include <xeno/lib.h>
|
||||
#include <hypervisor-ifs/dom0_ops.h>
|
||||
#include <xeno/sched.h>
|
||||
#include <xeno/event.h>
|
||||
|
||||
#define DEBUG_TRACE
|
||||
#ifdef DEBUG_TRACE
|
||||
#define TRC(_x) _x
|
||||
#else
|
||||
#define TRC(_x)
|
||||
#endif
|
||||
|
||||
void pdb_do_debug (dom0_op_t *op)
|
||||
{
|
||||
op->u.debug.status = 0;
|
||||
op->u.debug.out1 = op->u.debug.in2 + 10;
|
||||
op->u.debug.out2 = op->u.debug.in1 + 100;
|
||||
|
||||
TRC(printk("PDB: op:%c, dom:%x, in1:%x, in2:%x\n",
|
||||
op->u.debug.opcode, op->u.debug.domain,
|
||||
op->u.debug.in1, op->u.debug.in2));
|
||||
|
||||
if (op->u.debug.domain == 0)
|
||||
{
|
||||
op->u.debug.status = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
switch (op->u.debug.opcode)
|
||||
{
|
||||
case 'r' :
|
||||
{
|
||||
struct task_struct * p = find_domain_by_id(op->u.debug.domain);
|
||||
if ( p != NULL )
|
||||
{
|
||||
if ( (p->flags & PF_CONSTRUCTED) != 0 )
|
||||
{
|
||||
wake_up(p);
|
||||
reschedule(p);
|
||||
}
|
||||
put_task_struct(p);
|
||||
}
|
||||
else
|
||||
{
|
||||
op->u.debug.status = 2; /* invalid domain */
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 's' :
|
||||
{
|
||||
unsigned long cpu_mask;
|
||||
struct task_struct * p = find_domain_by_id(op->u.debug.domain);
|
||||
|
||||
if (p != NULL)
|
||||
{
|
||||
if (p->state != TASK_SUSPENDED)
|
||||
{
|
||||
cpu_mask = mark_hyp_event(p, _HYP_EVENT_STOP);
|
||||
hyp_event_notify(cpu_mask);
|
||||
}
|
||||
put_task_struct(p);
|
||||
}
|
||||
else
|
||||
{
|
||||
op->u.debug.status = 2; /* invalid domain */
|
||||
}
|
||||
break;
|
||||
}
|
||||
default :
|
||||
{
|
||||
printk("PDB error: unknown debug opcode %c (0x%x)\n",
|
||||
op->u.debug.opcode, op->u.debug.opcode);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -310,8 +310,7 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
|
||||
|
||||
case DOM0_DEBUG:
|
||||
{
|
||||
op.u.debug.out1 = op.u.debug.in2 + 1;
|
||||
op.u.debug.out2 = op.u.debug.in1 + 1;
|
||||
pdb_do_debug(&op);
|
||||
copy_to_user(u_dom0_op, &op, sizeof(op));
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
@@ -106,16 +106,15 @@ typedef struct dom0_msr_st
|
||||
unsigned int in1, in2;
|
||||
/* OUT variables. */
|
||||
unsigned int out1, out2;
|
||||
|
||||
} dom0_msr_t;
|
||||
|
||||
typedef struct dom0_debug_st
|
||||
{
|
||||
/* IN variables. */
|
||||
int in1, in2;
|
||||
char opcode;
|
||||
int domain, in1, in2;
|
||||
/* OUT variables. */
|
||||
int out1, out2;
|
||||
|
||||
int status, out1, out2;
|
||||
} dom0_debug_t;
|
||||
|
||||
/*
|
||||
|
||||
@@ -171,7 +171,7 @@ struct task_struct
|
||||
* TASK_UNINTERRUPTIBLE: Domain is blocked but may not be woken up by an
|
||||
* arbitrary event or timer.
|
||||
* TASK_WAIT: Domains CPU allocation expired.
|
||||
* TASK_SUSPENDED: Domain is in supsended state (eg. start of day)
|
||||
* TASK_SUSPENDED: Domain is suspended (startofday or pervasive debugger)
|
||||
* TASK_DYING: Domain is about to cross over to the land of the dead.
|
||||
*
|
||||
* If you update these then please update the mapping to text names in
|
||||
|
||||