ia64/xen-unstable

view tools/xcutils/lsevtchn.c @ 19615:13a4f4e6d0a3

x86 hvm: Correctly emulate task switches into vm86 mode.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue May 19 02:12:04 2009 +0100 (2009-05-19)
parents be573a356c90
children
line source
1 #include <err.h>
2 #include <stdlib.h>
3 #include <stdint.h>
4 #include <string.h>
5 #include <stdio.h>
7 #include <xs.h>
8 #include <xenctrl.h>
9 #include <xenguest.h>
11 int main(int argc, char **argv)
12 {
13 int xc_fd, domid, port, rc;
14 xc_evtchn_status_t status;
16 domid = (argc > 1) ? strtol(argv[1], NULL, 10) : 0;
18 xc_fd = xc_interface_open();
19 if ( xc_fd < 0 )
20 errx(1, "failed to open control interface");
22 for ( port = 0; ; port++ )
23 {
24 status.dom = domid;
25 status.port = port;
26 rc = xc_evtchn_status(xc_fd, &status);
27 if ( rc < 0 )
28 break;
30 if ( status.status == EVTCHNSTAT_closed )
31 continue;
33 printf("%4d: VCPU %u: ", port, status.vcpu);
35 switch ( status.status )
36 {
37 case EVTCHNSTAT_unbound:
38 printf("Interdomain (Waiting connection) - Remote Domain %u",
39 status.u.unbound.dom);
40 break;
41 case EVTCHNSTAT_interdomain:
42 printf("Interdomain (Connected) - Remote Domain %u, Port %u",
43 status.u.interdomain.dom, status.u.interdomain.port);
44 break;
45 case EVTCHNSTAT_pirq:
46 printf("Physical IRQ %u", status.u.pirq);
47 break;
48 case EVTCHNSTAT_virq:
49 printf("Virtual IRQ %u", status.u.virq);
50 break;
51 case EVTCHNSTAT_ipi:
52 printf("IPI");
53 break;
54 default:
55 printf("Unknown");
56 break;
57 }
59 printf("\n");
60 }
62 xc_interface_close(xc_fd);
64 return 0;
65 }