aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-x86/lguest_hcall.h2
-rw-r--r--include/linux/Kbuild2
-rw-r--r--include/linux/bitops.h40
-rw-r--r--include/linux/hardirq.h7
-rw-r--r--include/linux/lguest_launcher.h6
5 files changed, 53 insertions, 4 deletions
diff --git a/include/asm-x86/lguest_hcall.h b/include/asm-x86/lguest_hcall.h
index 758b9a5d4539..f239e7069cab 100644
--- a/include/asm-x86/lguest_hcall.h
+++ b/include/asm-x86/lguest_hcall.h
@@ -27,7 +27,7 @@
27#ifndef __ASSEMBLY__ 27#ifndef __ASSEMBLY__
28#include <asm/hw_irq.h> 28#include <asm/hw_irq.h>
29 29
30/*G:031 First, how does our Guest contact the Host to ask for privileged 30/*G:031 But first, how does our Guest contact the Host to ask for privileged
31 * operations? There are two ways: the direct way is to make a "hypercall", 31 * operations? There are two ways: the direct way is to make a "hypercall",
32 * to make requests of the Host Itself. 32 * to make requests of the Host Itself.
33 * 33 *
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index 4108b38ebb16..4a446a19295e 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -195,7 +195,6 @@ unifdef-y += ethtool.h
195unifdef-y += eventpoll.h 195unifdef-y += eventpoll.h
196unifdef-y += signalfd.h 196unifdef-y += signalfd.h
197unifdef-y += ext2_fs.h 197unifdef-y += ext2_fs.h
198unifdef-y += ext3_fs.h
199unifdef-y += fb.h 198unifdef-y += fb.h
200unifdef-y += fcntl.h 199unifdef-y += fcntl.h
201unifdef-y += filter.h 200unifdef-y += filter.h
@@ -248,7 +247,6 @@ unifdef-y += isdn.h
248unifdef-y += isdnif.h 247unifdef-y += isdnif.h
249unifdef-y += isdn_divertif.h 248unifdef-y += isdn_divertif.h
250unifdef-y += isdn_ppp.h 249unifdef-y += isdn_ppp.h
251unifdef-y += jbd.h
252unifdef-y += joystick.h 250unifdef-y += joystick.h
253unifdef-y += kdev_t.h 251unifdef-y += kdev_t.h
254unifdef-y += kd.h 252unifdef-y += kd.h
diff --git a/include/linux/bitops.h b/include/linux/bitops.h
index 69c1edb9fe54..40d54731de7e 100644
--- a/include/linux/bitops.h
+++ b/include/linux/bitops.h
@@ -65,6 +65,46 @@ static inline __u32 ror32(__u32 word, unsigned int shift)
65 return (word >> shift) | (word << (32 - shift)); 65 return (word >> shift) | (word << (32 - shift));
66} 66}
67 67
68/**
69 * rol16 - rotate a 16-bit value left
70 * @word: value to rotate
71 * @shift: bits to roll
72 */
73static inline __u16 rol16(__u16 word, unsigned int shift)
74{
75 return (word << shift) | (word >> (16 - shift));
76}
77
78/**
79 * ror16 - rotate a 16-bit value right
80 * @word: value to rotate
81 * @shift: bits to roll
82 */
83static inline __u16 ror16(__u16 word, unsigned int shift)
84{
85 return (word >> shift) | (word << (16 - shift));
86}
87
88/**
89 * rol8 - rotate an 8-bit value left
90 * @word: value to rotate
91 * @shift: bits to roll
92 */
93static inline __u8 rol8(__u8 word, unsigned int shift)
94{
95 return (word << shift) | (word >> (8 - shift));
96}
97
98/**
99 * ror8 - rotate an 8-bit value right
100 * @word: value to rotate
101 * @shift: bits to roll
102 */
103static inline __u8 ror8(__u8 word, unsigned int shift)
104{
105 return (word >> shift) | (word << (8 - shift));
106}
107
68static inline unsigned fls_long(unsigned long l) 108static inline unsigned fls_long(unsigned long l)
69{ 109{
70 if (sizeof(l) == 4) 110 if (sizeof(l) == 4)
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h
index 49829988bfa0..897f723bd222 100644
--- a/include/linux/hardirq.h
+++ b/include/linux/hardirq.h
@@ -72,6 +72,13 @@
72#define in_softirq() (softirq_count()) 72#define in_softirq() (softirq_count())
73#define in_interrupt() (irq_count()) 73#define in_interrupt() (irq_count())
74 74
75/*
76 * Are we running in atomic context? WARNING: this macro cannot
77 * always detect atomic context; in particular, it cannot know about
78 * held spinlocks in non-preemptible kernels. Thus it should not be
79 * used in the general case to determine whether sleeping is possible.
80 * Do not use in_atomic() in driver code.
81 */
75#define in_atomic() ((preempt_count() & ~PREEMPT_ACTIVE) != 0) 82#define in_atomic() ((preempt_count() & ~PREEMPT_ACTIVE) != 0)
76 83
77#ifdef CONFIG_PREEMPT 84#ifdef CONFIG_PREEMPT
diff --git a/include/linux/lguest_launcher.h b/include/linux/lguest_launcher.h
index 589be3e1f3ac..e7217dc58f39 100644
--- a/include/linux/lguest_launcher.h
+++ b/include/linux/lguest_launcher.h
@@ -16,6 +16,10 @@
16 * a new device, we simply need to write a new virtio driver and create support 16 * a new device, we simply need to write a new virtio driver and create support
17 * for it in the Launcher: this code won't need to change. 17 * for it in the Launcher: this code won't need to change.
18 * 18 *
19 * Virtio devices are also used by kvm, so we can simply reuse their optimized
20 * device drivers. And one day when everyone uses virtio, my plan will be
21 * complete. Bwahahahah!
22 *
19 * Devices are described by a simplified ID, a status byte, and some "config" 23 * Devices are described by a simplified ID, a status byte, and some "config"
20 * bytes which describe this device's configuration. This is placed by the 24 * bytes which describe this device's configuration. This is placed by the
21 * Launcher just above the top of physical memory: 25 * Launcher just above the top of physical memory:
@@ -26,7 +30,7 @@ struct lguest_device_desc {
26 /* The number of virtqueues (first in config array) */ 30 /* The number of virtqueues (first in config array) */
27 __u8 num_vq; 31 __u8 num_vq;
28 /* The number of bytes of feature bits. Multiply by 2: one for host 32 /* The number of bytes of feature bits. Multiply by 2: one for host
29 * features and one for guest acknowledgements. */ 33 * features and one for Guest acknowledgements. */
30 __u8 feature_len; 34 __u8 feature_len;
31 /* The number of bytes of the config array after virtqueues. */ 35 /* The number of bytes of the config array after virtqueues. */
32 __u8 config_len; 36 __u8 config_len;