aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/lguest/lg.h
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2009-07-30 18:03:45 -0400
committerRusty Russell <rusty@rustcorp.com.au>2009-07-30 02:33:45 -0400
commit2e04ef76916d1e29a077ea9d0f2003c8fd86724d (patch)
tree2ff8d625d6e467be9f9f1b67a3674cb6e125e970 /drivers/lguest/lg.h
parente969fed542cae08cb11d666efac4f7c5d624d09f (diff)
lguest: fix comment style
I don't really notice it (except to begrudge the extra vertical space), but Ingo does. And he pointed out that one excuse of lguest is as a teaching tool, it should set a good example. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Cc: Ingo Molnar <mingo@redhat.com>
Diffstat (limited to 'drivers/lguest/lg.h')
-rw-r--r--drivers/lguest/lg.h23
1 files changed, 15 insertions, 8 deletions
diff --git a/drivers/lguest/lg.h b/drivers/lguest/lg.h
index 01c591923793..74c0db691b53 100644
--- a/drivers/lguest/lg.h
+++ b/drivers/lguest/lg.h
@@ -54,13 +54,13 @@ struct lg_cpu {
54 54
55 unsigned long pending_notify; /* pfn from LHCALL_NOTIFY */ 55 unsigned long pending_notify; /* pfn from LHCALL_NOTIFY */
56 56
57 /* At end of a page shared mapped over lguest_pages in guest. */ 57 /* At end of a page shared mapped over lguest_pages in guest. */
58 unsigned long regs_page; 58 unsigned long regs_page;
59 struct lguest_regs *regs; 59 struct lguest_regs *regs;
60 60
61 struct lguest_pages *last_pages; 61 struct lguest_pages *last_pages;
62 62
63 int cpu_pgd; /* which pgd this cpu is currently using */ 63 int cpu_pgd; /* Which pgd this cpu is currently using */
64 64
65 /* If a hypercall was asked for, this points to the arguments. */ 65 /* If a hypercall was asked for, this points to the arguments. */
66 struct hcall_args *hcall; 66 struct hcall_args *hcall;
@@ -96,8 +96,11 @@ struct lguest
96 unsigned int nr_cpus; 96 unsigned int nr_cpus;
97 97
98 u32 pfn_limit; 98 u32 pfn_limit;
99 /* This provides the offset to the base of guest-physical 99
100 * memory in the Launcher. */ 100 /*
101 * This provides the offset to the base of guest-physical memory in the
102 * Launcher.
103 */
101 void __user *mem_base; 104 void __user *mem_base;
102 unsigned long kernel_address; 105 unsigned long kernel_address;
103 106
@@ -122,11 +125,13 @@ bool lguest_address_ok(const struct lguest *lg,
122void __lgread(struct lg_cpu *, void *, unsigned long, unsigned); 125void __lgread(struct lg_cpu *, void *, unsigned long, unsigned);
123void __lgwrite(struct lg_cpu *, unsigned long, const void *, unsigned); 126void __lgwrite(struct lg_cpu *, unsigned long, const void *, unsigned);
124 127
125/*H:035 Using memory-copy operations like that is usually inconvient, so we 128/*H:035
129 * Using memory-copy operations like that is usually inconvient, so we
126 * have the following helper macros which read and write a specific type (often 130 * have the following helper macros which read and write a specific type (often
127 * an unsigned long). 131 * an unsigned long).
128 * 132 *
129 * This reads into a variable of the given type then returns that. */ 133 * This reads into a variable of the given type then returns that.
134 */
130#define lgread(cpu, addr, type) \ 135#define lgread(cpu, addr, type) \
131 ({ type _v; __lgread((cpu), &_v, (addr), sizeof(_v)); _v; }) 136 ({ type _v; __lgread((cpu), &_v, (addr), sizeof(_v)); _v; })
132 137
@@ -140,9 +145,11 @@ void __lgwrite(struct lg_cpu *, unsigned long, const void *, unsigned);
140 145
141int run_guest(struct lg_cpu *cpu, unsigned long __user *user); 146int run_guest(struct lg_cpu *cpu, unsigned long __user *user);
142 147
143/* Helper macros to obtain the first 12 or the last 20 bits, this is only the 148/*
149 * Helper macros to obtain the first 12 or the last 20 bits, this is only the
144 * first step in the migration to the kernel types. pte_pfn is already defined 150 * first step in the migration to the kernel types. pte_pfn is already defined
145 * in the kernel. */ 151 * in the kernel.
152 */
146#define pgd_flags(x) (pgd_val(x) & ~PAGE_MASK) 153#define pgd_flags(x) (pgd_val(x) & ~PAGE_MASK)
147#define pgd_pfn(x) (pgd_val(x) >> PAGE_SHIFT) 154#define pgd_pfn(x) (pgd_val(x) >> PAGE_SHIFT)
148#define pmd_flags(x) (pmd_val(x) & ~PAGE_MASK) 155#define pmd_flags(x) (pmd_val(x) & ~PAGE_MASK)