debuggers.hg

view xen/include/asm-x86/hpet.h @ 22855:1d1eec7e1fb4

xl: Perform minimal validation of virtual disk file while parsing config file

This patch performs some very basic validation on the virtual disk
file passed through the config file. This validation ensures that we
don't go too far with the initialization like spawn qemu and more
while there could be some potentially fundamental issues.

[ Patch fixed up to work with PHYSTYPE_EMPTY 22808:6ec61438713a -iwj ]

Signed-off-by: Kamala Narasimhan <kamala.narasimhan@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
author Kamala Narasimhan <kamala.narasimhan@gmail.com>
date Tue Jan 25 18:09:49 2011 +0000 (2011-01-25)
parents 30bfa1d8895d
children
line source
1 #ifndef __X86_HPET_H__
2 #define __X86_HPET_H__
4 /*
5 * Documentation on HPET can be found at:
6 * http://www.intel.com/ial/home/sp/pcmmspec.htm
7 * ftp://download.intel.com/ial/home/sp/mmts098.pdf
8 */
10 #define HPET_MMAP_SIZE 1024
12 #define HPET_ID 0x000
13 #define HPET_PERIOD 0x004
14 #define HPET_CFG 0x010
15 #define HPET_STATUS 0x020
16 #define HPET_COUNTER 0x0f0
17 #define HPET_T0_CFG 0x100
18 #define HPET_T0_CMP 0x108
19 #define HPET_T0_ROUTE 0x110
20 #define HPET_T1_CFG 0x120
21 #define HPET_T1_CMP 0x128
22 #define HPET_T1_ROUTE 0x130
23 #define HPET_T2_CFG 0x140
24 #define HPET_T2_CMP 0x148
25 #define HPET_T2_ROUTE 0x150
27 #define HPET_Tn_CFG(n) (HPET_T0_CFG + n * 0x20)
28 #define HPET_Tn_CMP(n) (HPET_T0_CMP + n * 0x20)
29 #define HPET_Tn_ROUTE(n) (HPET_T0_ROUTE + n * 0x20)
31 #define HPET_ID_VENDOR 0xffff0000
32 #define HPET_ID_LEGSUP 0x00008000
33 #define HPET_ID_NUMBER 0x00001f00
34 #define HPET_ID_REV 0x000000ff
35 #define HPET_ID_NUMBER_SHIFT 8
37 #define HPET_ID_VENDOR_SHIFT 16
38 #define HPET_ID_VENDOR_8086 0x8086
40 #define HPET_CFG_ENABLE 0x001
41 #define HPET_CFG_LEGACY 0x002
42 #define HPET_LEGACY_8254 2
43 #define HPET_LEGACY_RTC 8
45 #define HPET_TN_ENABLE 0x004
46 #define HPET_TN_PERIODIC 0x008
47 #define HPET_TN_PERIODIC_CAP 0x010
48 #define HPET_TN_SETVAL 0x040
49 #define HPET_TN_32BIT 0x100
50 #define HPET_TN_ROUTE 0x3e00
51 #define HPET_TN_FSB 0x4000
52 #define HPET_TN_FSB_CAP 0x8000
53 #define HPET_TN_ROUTE_SHIFT 9
56 #define hpet_read32(x) \
57 (*(volatile u32 *)(fix_to_virt(FIX_HPET_BASE) + (x)))
58 #define hpet_write32(y,x) \
59 (*(volatile u32 *)(fix_to_virt(FIX_HPET_BASE) + (x)) = (y))
61 extern unsigned long hpet_address;
63 /*
64 * Detect and initialise HPET hardware: return counter update frequency.
65 * Return value is zero if HPET is unavailable.
66 */
67 u64 hpet_setup(void);
69 /*
70 * Callback from legacy timer (PIT channel 0) IRQ handler.
71 * Returns 1 if tick originated from HPET; else 0.
72 */
73 int hpet_legacy_irq_tick(void);
75 /*
76 * Temporarily use an HPET event counter for timer interrupt handling,
77 * rather than using the LAPIC timer. Used for Cx state entry.
78 */
79 void hpet_broadcast_init(void);
80 void hpet_broadcast_enter(void);
81 void hpet_broadcast_exit(void);
82 int hpet_broadcast_is_available(void);
83 void hpet_disable_legacy_broadcast(void);
85 #endif /* __X86_HPET_H__ */