ia64/xen-unstable

view tools/misc/xc_shadow.c @ 9488:0a6f5527ca4b

[IA64] set itv handoff as masked and enable reading irr[0-3]

Set initial vcpu itv handoff state to mask the timer vector.
This seems to match hardware and makes logical sense from a
spurious interrupt perspective. Enable vcpu_get_irr[0-3]
functions as they seem to work and have the proper backing.
This enables the check_sal_cache_flush() in arch/ia64/kernel.sal.c
to work unmodified, allowing us to remove the Xen changes from
the file (and thus the file from the sparse tree).

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
author awilliam@xenbuild.aw
date Tue Apr 04 09:39:45 2006 -0600 (2006-04-04)
parents d4e433d615b0
children 0f917d63e960
line source
1 /* -*- Mode:C; c-basic-offset:4; tab-width:4 -*-
2 ****************************************************************************
3 * (C) 2005 - Rolf Neugebauer - Intel Research Cambridge
4 ****************************************************************************
5 *
6 * File: xc_shadow.c
7 * Author: Rolf Neugebauer (rolf.neugebauer@intel.com)
8 * Date: Mar 2005
9 *
10 * Description:
11 */
14 #include <xenctrl.h>
15 #include <stdio.h>
16 #include <stdlib.h>
17 #include <sys/mman.h>
18 #include <errno.h>
19 #include <string.h>
21 void usage(void)
22 {
23 printf("xc_shadow: -[0|1|2]\n");
24 printf(" set shadow mode\n");
25 exit(0);
26 }
28 int main(int argc, char *argv[])
29 {
30 int xc_handle;
31 int mode = 0;
33 if ( argc > 1 )
34 {
35 char *p = argv[1];
36 if (*p++ == '-') {
37 if (*p == '1')
38 mode = 1;
39 else if (*p == '2')
40 mode = 2;
41 else if (*p == '0')
42 mode = 0;
43 else
44 usage();
45 } else
46 usage();
47 }
48 else
49 usage();
51 if ( (xc_handle = xc_interface_open()) == -1 )
52 {
53 fprintf(stderr, "Error opening xc interface: %d (%s)\n",
54 errno, strerror(errno));
55 return 1;
56 }
58 if ( xc_shadow_control(xc_handle,
59 0,
60 mode,
61 NULL,
62 0,
63 NULL) < 0 )
64 {
65 fprintf(stderr, "Error reseting performance counters: %d (%s)\n",
66 errno, strerror(errno));
67 return 1;
68 }
69 return 0;
70 }