]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/patches/suse-2.6.27.25/patches.fixes/uv-bios_call_watchlist.diff
Added missing SuSE-Xen-Patches.
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.25 / patches.fixes / uv-bios_call_watchlist.diff
1 From: Russ Anderson <rja@sgi.com>
2 Subject: Add UV bios calls to allocate and free watchlists.
3 References: bnc#442455
4
5 Add UV bios calls to allocate and free watchlists.
6
7
8 Signed-off-by: Russ Anderson <rja@sgi.com>
9 Acked-by: Bernhard Walle <bwalle@suse.de>
10
11 ---
12 arch/x86/kernel/bios_uv.c | 33 +++++++++++++++++++++++++++++++++
13 include/asm-x86/uv/bios.h | 17 ++++++++++++++++-
14 2 files changed, 49 insertions(+), 1 deletion(-)
15
16 --- a/arch/x86/kernel/bios_uv.c
17 +++ b/arch/x86/kernel/bios_uv.c
18 @@ -100,6 +100,39 @@ s64 uv_bios_get_sn_info(int fc, int *uvt
19 return ret;
20 }
21
22 +int
23 +uv_bios_mq_watchlist_alloc(int blade, void *mq, unsigned int mq_size,
24 + unsigned long *intr_mmr_offset)
25 +{
26 + union uv_watchlist_u size_blade;
27 + unsigned long addr;
28 + u64 watchlist;
29 + s64 ret;
30 +
31 + addr = (unsigned long)mq;
32 + size_blade.size = mq_size;
33 + size_blade.blade = blade;
34 +
35 + /*
36 + * bios returns watchlist number or negative error number.
37 + */
38 + ret = (int)uv_bios_call_irqsave(UV_BIOS_WATCHLIST_ALLOC, addr,
39 + size_blade.val, (u64)intr_mmr_offset,
40 + (u64)&watchlist, 0);
41 + if (ret < BIOS_STATUS_SUCCESS)
42 + return ret;
43 +
44 + return watchlist;
45 +}
46 +EXPORT_SYMBOL_GPL(uv_bios_mq_watchlist_alloc);
47 +
48 +int
49 +uv_bios_mq_watchlist_free(int blade, int watchlist_num)
50 +{
51 + return (int)uv_bios_call_irqsave(UV_BIOS_WATCHLIST_FREE,
52 + blade, watchlist_num, 0, 0, 0);
53 +}
54 +EXPORT_SYMBOL_GPL(uv_bios_mq_watchlist_free);
55
56 s64 uv_bios_freq_base(u64 clock_type, u64 *ticks_per_second)
57 {
58 --- a/include/asm-x86/uv/bios.h
59 +++ b/include/asm-x86/uv/bios.h
60 @@ -32,7 +32,9 @@
61 enum uv_bios_cmd {
62 UV_BIOS_COMMON,
63 UV_BIOS_GET_SN_INFO,
64 - UV_BIOS_FREQ_BASE
65 + UV_BIOS_FREQ_BASE,
66 + UV_BIOS_WATCHLIST_ALLOC,
67 + UV_BIOS_WATCHLIST_FREE
68 };
69
70 /*
71 @@ -71,6 +73,15 @@ union partition_info_u {
72 };
73 };
74
75 +union uv_watchlist_u {
76 + u64 val;
77 + struct {
78 + u64 blade : 16,
79 + size : 32,
80 + filler : 16;
81 + };
82 +};
83 +
84 /*
85 * bios calls have 6 parameters
86 */
87 @@ -80,9 +91,13 @@ extern s64 uv_bios_call_reentrant(enum u
88
89 extern s64 uv_bios_get_sn_info(int, int *, long *, long *, long *);
90 extern s64 uv_bios_freq_base(u64, u64 *);
91 +extern int uv_bios_mq_watchlist_alloc(int, void *, unsigned int,
92 + unsigned long *);
93 +extern int uv_bios_mq_watchlist_free(int, int);
94
95 extern void uv_bios_init(void);
96
97 +extern unsigned long sn_rtc_cycles_per_second;
98 extern int uv_type;
99 extern long sn_partition_id;
100 extern long sn_coherency_id;